#help-development
1 messages · Page 1871 of 1
Did you forget to register the listener
No
what the fuck
why are you casting a player to player
why are you casting a block to a block
Ik im like
why do you use equals for enums
So confused what’s going on here
and also you didnt register the event listener
@swift adder for enums, like materials use ==
There you go
Wtf I have no words
What?
You didn’t register the listener
Yes I did
In my main
.
Show us
getServer().getPluginManager().registerEvents(new pStats(), this);
String string = (String) "string";
are you sure you actually run this .jar file and not some old version?
is that in your onEnable ?
Mhm
Mhm
You probably are creating a new instance when setting the command and registering the listener
Registering command*
oh wait wtf
@swift adder
you check if b equals DIRT
a block can never equal a material
😳
would be easier to see if you used actual proper variable names like "block" instead of "b" 🙂
😭
Just…
change if(b.equals(Material.DIRT)) to if(b.getType() == Material.DIRT)
Someone else helped me and changed like bits of my code
yeah but all those casts are bullshit
Well they were a dumbass
Mine before had one issue and worked fine before
and as said, get the blocks type instead of comparing the block to a material
and please do yourself a favor and use proper variable names
Spam ctrl+z lol
No thanks
@swift adder don’t just ignore this like most people do actually read it
It’s helpful
People won’t yell at you as often
I'll mkae my variables very descriptive like BlockThatPlayerDestroys
Speaking from experience
Just Block
Oh okay
Since it’s defined in the scope as blockBreakEvent, people can reasonably assume that it is the broken block
can someone help me please
whyyy
Cause you have no information…
but i dont know what else to do
If it has to do with plugins
Like
Developing
Put it here
If not, we ain’t gonna help you
can i get .getItem in PlayerInteractAtEntityEvent?
u mean the item used?
Item in main hand go brrrrrr
cool
Maybe there’s a way through the event
The event still doesn't work
But idk
Explain!!!
wat u trying to do?
no .getItem
You can’t just say it doesn’t work
The if statement isn't doing the if part of it in the @EventHander
What did you change, what isn’t working, show examples
can u state ur problem I just got here
Still the same issue
There
have u registered it?
Yes
like implements Listener?
Yes
can u send the main class?
I'm not dumb I've done the basic
Scroll up
Probably did it wrong like I said before
To where
I've sent it
Send it agin rq
wait where is it?
why is player.getAttribute(Attribute.GENERIC_ATTACK_KNOCKBACK) null
He’s referring to the one line he sent
public final class Shovel extends JavaPlugin {
@Override
public void onEnable() {
getServer().getPluginManager().registerEvents(new pStats(), this);
getCommand("stats").setExecutor(new pStats());
}
@Override
public void onDisable() {
}
}```
wait
Hmmm idk
ohhh
and the event is in that class too?
Create a object for pStats
wait nvm
Because players don’t use that attribute
u can do that?
Yea, but then the command isn’t gonna run that listener
I usually just create two new classes
what do i do instead then
Nothing
Oh nvm
?
Well, you’d have to make your own code to modify knockback
pStats pstats= new pStats();
?
Do you not know object oriented 🍔
Yea
Pretty much
It’s a lot of pStats ik
I do I just never thought of it lol
but knockback is already built in why would i need to code it
Because you can’t modify it?
Can i disable animation for example placing blocks? maybe using packets or sth like this.
BUT DONT YOU FUCKING DARE CAST IT TO pStats
well why cant i modify it
What
he didnt
I dont get it but ok
Because Mojang hasn’t set it up that way?
but they did
Getting "Method call expected" now
No they didn’t
So passive aggressive jeez
No they didn’t lol
Stfu
Send the full thing. Please
bruh /attribute @s minecraft:generic.attack_knockback base set 0
public final class Shovel extends JavaPlugin {
pStats pstats= new pStats();
@Override
public void onEnable() {
getServer().getPluginManager().registerEvents(new pStats(), this);
getCommand("stats").setExecutor(pstats());
}
@Override
public void onDisable() {
}
}```
You can’t modify it through spigot
Happy?
lol k
missing the new
Register your events to the object too
No lol
Remove the ()
Oh I see the thing above nevermind
This pains me
@swift adder just. Think before you ask questions
Like
Look at it
Think, is there anything I know how to fix
If not
Then ask
I’m new to answering questions, yea
huh
what is the difference betweem finaldamage and damage
pluginManager.registerEvents()
Check the JavaDocs
?jd
getServer().getPluginManager().registerEvents(new pStats(), this);
No no
@swift adder change that to the pStats object
Don’t create another instance
use the same instance yeah
I was quoting his code
He originally made two, I’m trying to get him to fix it
That's waht I did it aint wokring
very helpful error
I will
talking to Tristan
Is there more to it?
public final class Shovel extends JavaPlugin {
pStats pstats= new pStats();
@Override
public void onEnable() {
getServer().getPluginManager().registerEvents(pstats(), this);
}
@Override
public void onDisable() {
}
}
O
You still need to register the command
Remove the () after pstats in the register event line
fggrtttttttttttttttttttttttttttttttttttttttttttttttttttted'
Also remove the ()
Not really
My guess is calling an event in an event
In a stack overflow error they can be a bitch
You good?
That was my cat
She got scared of a candle and walked backwards
lmao
Lol
lol
dude it literally auto embeds in discor
I don’t give a fuck if it’s a txt file use paste
crashes website on save
Ik
you need to chill out dude thefuck
But I’m untrusting
you won't survive in this discord if you get that annoyed/pissed
thats part of it
this Hyper dude
Send the link
Try a different paste website
What
Anyone can send a txt file no one knows it’s an auto embed
its too big for it to save a link
what are you calling getPersistentDataContainer() on?
Idk I just got out of school
I’m tired
You don't have to download it, that's what we're saying 
what bad can .txt files do, say a bad word?
BufferOverflows exist, in theory every file could fuck your PC 😄
theres different if statements so idk
but the error shows the exact line number
oh
"something" i like this minimalistic word
Java stack trace is the best at screaming "panic!"
discord mobile users go brr
Sucks for them 
yep
ive tried multiple paste websites all of them its above the limit
its about 4 mb of text btw
lol
What is Listeners line 34
now thats a sketch link lmao
but makes sense you need a sketch website for a paste that big
?botstrap
lol
?bootstrap
Bootstrap Jar
The main spigot-1.18.jar is now a bootstrap jar which contains all libraries. You cannot directly depend on this jar. You should depend on Spigot/Spigot-API/target/spigot-api-1.18-R0.1-SNAPSHOT-shaded.jar, or the entire contents of the bundler directory from your server, or use a dependency manager such as Maven or Gradle to handle this automatically.
Please read the release notes for further information: https://www.spigotmc.org/threads/9-years-of-spigotmc-spigot-bungeecord-1-18-1-18-1-release.534760/#post-4305163
if(event.getEntity() instanceof Player)
OHHHHHH
I’m on mobile rn
It shows up as a txt
I thought you meant how when you paste a long message it sends it as message.txt
it embedded it lol
so if it was gonna fuck it you wouldnt have had to download it
Discord can have bugs too
go install checkmk now
The entity doesn't have a value under the key you're giving it
How could I save HashMap data?
in a YAML or json, or inside SQL
Ohno
Okay thanks
except it does
i did /data get and it had it
@arctic moth
problem is with Players-Revamped v1.0
there is an integer null in relation to doing something with PDC
You're using event.getDamager(), I assume it should be event.getEntity() ?
Line 35
no i just screwed smth up
need to check if its player first
You are wot
You're checking if the getEntity is a player and then getting the PDC of the damager.
i need to check damager too
oh
wait im dmb
that shit was supposed to go in a different event
or whatever
so yeah it is getEntity
is there any way to monitor warnings on a java logger?
I need help, so I have this code
boolean shouldSendCoords = false;
@EventHandler
public void onBlockPlaced(BlockPlaceEvent event)
{
if(shouldSendCoords)
{
if(!event.getPlayer().isOp())
{
return;
}
Location location = event.getBlock().getLocation();
event.getPlayer().sendMessage(event.getBlock().getType().toString() + " : "+ ChatColor.AQUA + "X : " + location.getX() + ChatColor.RED + " Y : " + location.getY() + ChatColor.YELLOW + " Z : " + location.getZ());
} else {
System.out.println("shouldn't send coords");
System.out.println(shouldSendCoords);
}
}
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if(!shouldSendCoords) { shouldSendCoords = true; } else { shouldSendCoords = false; }
return false;
}
}
For some reason the command is failing to set shouldSendCoords to true, I can't figure out why. I have tried other ways of making it true and nothing works. is this just a simple oversight or something else
i have confirmed the command is running but it never gets set to true. i even changed the code to literally just
shouldSendCoords = true;
and it still won't set to true, I might just be tired but I feel like this should work
"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.
awesome
should work fine. did you really really really make sure the onCommand() runs? 😛
also is there a way to build an artifact to two places with intellij
you can use maven-exec plugin to copy the file
yeah, i made a println that says "this does in fact run" and it triggered
you probably registered two instances of the same class
are you on linux or windows? if windows, do you have git bash installed?
oh yeah! you probably have one instance for the command and one for the event
stupid fix; make the variable static
proper fix: use one instance for both, command and event
ew static
static is perfectly fine to use in many cases 🙂
putting listeners in the same class as a command class 🤮
yeah it's a bit ugly
@woeful crescent if you don't know what static means, read this https://blog.jeff-media.com/static-methods-and-fields-when-to-use-them-and-when-to-avoid-them/
I had to have the event access the variable and same with the command, im not the best at coding it's all I knew how to do
you can do it like you do it right now, but it's kinda messy
i know what static means, lol
so why do you give me the finger for saying it makes sense sometimes to use it? 😄
LOL
ooh
lmao
s'ok
How do I do multi-module projects in maven for Bungee & Spigot at the same time
I don't understand it
cpp be like
i get modules
👆
utility methods and constants
Thats all
Singleton?
only if it has immutable state
(antipattern btw)
Static classes are somehow handy too
what is the range that the setRotation() method for entities takes for pitch and yaw?
lazy static singleton might perhaps be justifiable sometimes
?
as example?
probably 360
resource intensive components which might not end up being used by the system at all, ofc you could fix it by using IoC and DI with a simple supplier sam tho it kinda depends on context more specifically.
ah maybe
but, i cant really imagine a resource intensive component without depenecies. How could you pass depenencies to the singletone..?
you have a point, and well, you can always avoid static in these stateful cases, tho sometimes dissuading yourself from it might end up making the design more complicated unnecessarily
yeah manya that might be problematic in some scenarios, which may just prove static singleton is the wrong choice there
Singletones are good for some immutable implementations thst doesnt takes depenencies, good example are persistent data types or kyori component serializers
i feel it
well the persistent data types aren't really static singletons, rather just static final fields
no. everything that describes stuff about the class itself
Passing ClanBuilderFactory all the time if i need to just create a plain java object
ask yourself "Does it make sense to call this method or access this field, even if no object has been constructed yet?" If so, it should definitely be static.
also yeah static factory
that is one hella of a good pattern
tho its not about state
i mean, i dont have a static factory
well I mean static factory methods
(i can confirm this lol)
How can I prevent a player from temporarily becoming invulnerable after being hit by a certain arrow?
there's "setNoDamageTicks" or sth on the entity object
declaration: package: org.bukkit.entity, interface: LivingEntity
np
I think you'll have to set it to 0 so they can be damaged right away again
hi
Yoooo
you need any help?
my gosh thats 3 am
The chat is turning wild
you better justify what you just wrote rn
they are pointing at a hand-made bunny
😄
seems like a warning/ban is in order
rukus stop spamming this channel then if you don't have any development questions, thanks
#general is the channel to use if you want to randomly chat lol
erm I doubt that
if the event gets cancelled, there definitely is no damage happening
With that being said, random emote spam and just trolling around should be avoided.
Ik it says that I do damage myself on one line but that line doesn't matter cuz damage is set to 0
please check if the code where you set it to be cancelled actually runs
Yes it does
are you 100% sure? Did you add some debug text to see it?
Ill debug it now
just add some System.out.println above e.setCancelled and see if it gets printed
It does
do you have any other plugins running?
Does anyone know how to get the logger to log messages at CONFIG (debug) level? This doesn't work with 1.18.1: https://www.spigotmc.org/threads/enable-debug-logging-to-console.456250/
Not that I know of that would effect this but I'll try removing them
yeah please remove ALL other plugins, because your code should work 100% fine
Only one left is Essentials. Let's remove that and see
is it really that important?
I mostly just do stuff like this:
public void debug(String s) {
if(getConfig().getBoolean("debug",false)) {
getLogger().warning(s);
}
}
Still happening
Nope, but it'd be nice if it was a known simple fix
Also taking the normal knockback and everything
sorry but I highly doubt that you actually cancel the event if you still get damage
let me create a test plugin quickly
I am on 1.8.8 does it affect anything?
1.8.8 sucks but it should still work fine if you are sure that the code runs
Cringe!
I'll comment everything out after the cancell so my code cannot affect it
it works fine @modern fox ```java
@EventHandler
public void onDeath(EntityDamageByEntityEvent event) {
Bukkit.broadcastMessage("Event cancelled");
event.setCancelled(true);
}
It was something with my code that affected it. It worked when I removed the thing after. Ima find out what makes it not workj
I found out why. Thank you man 😄
:3
Alex didn’t you have a pdc type library?
sure, one sec
Can listeners be registered async safely?
probably yes, but... why?
Ok im gonna get this answered
Reasons
@tender shard what do you do with plugin, do you use the plugin.yml permissions system
or do you hardcode them with plr.getPermission()
iirc not in 1.8
But who cares about 1.8 frankly
conclure, what do you do
I have static classes for that, one sec
You really should attach permissions directly to your commands
That way unauthorized users can’t even see them
Ah thanks
stuff like this:
public class Permissions {
public static final String RELOAD = "myplugin.reload";
}
and then I just do
if(sender.hasPermission(Permissions.RELOAD))```
Don’t you register the to the map?
thats cool
imma do that
if there's anything missing you need, please PR 🙂
i never understood how it works
Sure very cool tho
commands:
beep:
permission: beep.beep
commands:
someCommand:
permission: yourplugin.somecommand
I mean it’s nice to declare the permissions in plugin yml so LuckPerms can pick ‘em up
bukkit then automatically makes people not be able to run it if they dont have that permission
dont you also need to add a seperate permissions part in your plugin.yml?
Not only can they not run it, but they can’t see it either
it is not needed, but it's good to do so for reasons @ivory sleet said
alright
wait, do you mean like autocomplete in luckperms?
for example, yes
ok
If your plugin declares permissions like that, then you’re officially cool
😎
Where I can learn how does the spigot server deals with plugin?
I'd like to understand better how does the Plugin context interfaces itself with the user
Like the bootstrap process? Or just the concrete implementation of the api?
Yes, the bootstrap one.
Well you need to understand how classloading works first then
I just want to know if there is some documentation
or if i need to dive into the code
The code
It’s not documented
But it gives your the best explanation of how the server is implemented
as it’s 100% up to date
and code never lies
hahahaha
Just creates miserable illusions
another question
Ask away
The plugin instance is shared among users right? So basically, it's one instance for many.
Yes
Well
Partly true
Bukkit ensures a plugin singleton given that the plugin is loaded onto the server
But yeah zer0
Spigot actually extends a custom class loader
Which stores the correct plugin instance
As you’re aware it uses reflection to instantiate each plugin also
However if one were to reload the server
There’s no guarantee that the plugin instance that was created before the reloaded is still present in memory
In other words, reload can cause the old plugin instances to be garbage collected
These kind of stuff is always damn interesting
Some1 know how transform a euler angle to a vector
I dont even know what an euler angle is lol
It’s used for armor stand posing
I hate this
I Just want set the armorstand pose using nbt
Euler angle ungly
It’s just a vector but radians
?
Covert each component to radians and then construct a vector from them?
Ok?
private static EulerAngle convertVectorToEulerAngle(Vector vec) {
double x = vec.getX();
double y = vec.getY();
double z = vec.getZ();
double xz = Math.sqrt(x*x + z*z);
double eulX;
if(x < 0) {
if(y == 0) {
eulX = Math.PI*0.5;
} else {
eulX = Math.atan(xz/y)+Math.PI;
}
} else {
eulX = Math.atan(y/xz)+Math.PI*0.5;
}
double eulY;
if(x == 0) {
if(z > 0) {
eulY = Math.PI;
} else {
eulY = 0;
}
} else {
eulY = Math.atan(z/x)+Math.PI*0.5;
}
return new EulerAngle(eulX, eulY, 0);
}
literally the first google result
I will steal this for my lib
I already haver that method
so retrace it
Bit i want euler angle to vector
so retrace it
I dont know How do this
Mucho ifs
This more easy
https://stackoverflow.com/questions/1568568/how-to-convert-euler-angles-to-directional-vector second google result
its literally a step by step instruction
I can use only the first math to get a vector
where are you from guys? askin for curiosity
US
Canada Eh
Central Europe
Görmany
sorry
are canadians really as friendly as portrayed in all the memes?
Also I'm 99% sure it's impossible to figure out the blocks that fall without using reflection or something lol. It's the tick method that decides if a bock breaks when the bottom is removed
No I'm an ass
asking the real question here
yeah I thought so 😦
he is indeed friendly
he is canadian, it's the law
I like turtles
i like trains
lol this capitol storming documentary is awesome
- This is #help-development not #general ;p
- That depends. We like to portray ourselves as nice (and for the most part, a good chunk of us will be nice when meeting new people), but Canadian to Canadian interactions will occasionally include "Sorry" which can range from "What the fuck is wrong with you, bud?" to "I'm genuinely so sorry".
Seriously. Bump into someone in Canada by accident and they will say "Sorry about that", but what they're thinking is "Fuck that guy, look where you're going, damn it"
In this Jan 6 special we get a call from the Q shaman (aka Jake Angeli) who is currently serving a 41 month prison sentence for his involvement in the Capitol Riot.
enjoy
sorry 😛
oh btw
I still remember FurnitureLib
is it still a thing? like do people still use it?
Is anyone else having issues loading the Spigot API?
no
what issues do you have
I do
no need to download anything if you just run buildtools
they don't really work for me when it comes to Spigot
there is only <artifactId>spigot-api</artifactId> but i also need <artifactId>spigot</artifactId>
and they don't have it on https://hub.spigotmc.org/nexus/content/repositories/snapshots/
delete your whole BuildTools directory
then download newest BuildTools again and run it
should be fixed then
hm let me check
third try's a charm
what version are you building?
1.18 or 1.18.1 / latest?
1.18.1
remapped or "default"?
pretty sure they dont need it remapped
they said they use need the spigot artifact
im a paper person i only use spigot for old stuff
sorry if im sayin the wrong thing
well someone who uses spigot instead spigot-api should use remapped in 99% of cases
build tools console logged something about remapping and %..
what are you using it for
so i assume it's building a remapped
@sullen marlin
Creating npc players
@tender shard
Again same error when it comes to spigot
can you just paste your console output
canÄt help right now, build tools doesnt let me build anything right now
i cannot read that
Rebuilding Forked projects....
Cloning into 'Spigot-API'...
fatal: invalid branch name: init.defaultBranch =
applyPatches.sh: line 16: cd: /c/Users/Tomek/IdeaProjects/mobarablasts/buildtools/Spigot/Spigot-API: No such file or directory
Resetting Spigot-API to Bukkit...
fatal: ambiguous argument 'origin/spigot': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
Applying patches to Spigot-API...
fatal: could not open '../Bukkit-Patches/*.patch' for reading: No such file or directory
Something did not apply cleanly to Spigot-API.
Please review above details and finish the apply then
save the changes with rebuildPatches.sh
Error compiling Spigot. Please check the wiki for FAQs.
If this does not resolve your issue then please pastebin the entire BuildTools.log.txt file when seeking support.
java.lang.RuntimeException: Error running command, return status !=0: [C:\WINDOWS\system32\cmd.exe, /D, /C, sh, applyPatches.sh]
at org.spigotmc.builder.Builder.runProcess0(Builder.java:964)
at org.spigotmc.builder.Builder.runProcess(Builder.java:895)
at org.spigotmc.builder.Builder.main(Builder.java:694)
at org.spigotmc.builder.Bootstrap.main(Bootstrap.java:27)
I keep getting this ```Could not find spigot-api-1.18.1-R0.1-SNAPSHOT.jar (org.spigotmc:spigot-api:1.18.1-R0.1-SNAPSHOT:20211226.225430-20).
Searched in the following locations:
https://hub.spigotmc.org/nexus/content/repositories/snapshots/org/spigotmc/spigot-api/1.18.1-R0.1-SNAPSHOT/spigot-api-1.18.1-R0.1-20211226.225430-20.jar
Possible solution:
- Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html
something seems to be wrong on their side
and I get something like "no credentials" when running BT lol
think so too
Your fork isn’t public. Alternatively and better —dont-update
do u guys maybe have spigot-api-1.18.1-R0.1.jar ?
its like this with some other API's and idk how to fix it
to download already built?
oh shit
sorry, yeah
I changed the git remote
sorry mb
you can just get the API from the maven repo'
i thought you needed the server
you need to build the server youreslf
eh
buildtools runs fine for me, my problem was just that I messed with the git remote repository
???????
I was tyrying to manually have <systemPath>${project.basedir}/src/main/resources/spigot-1.8.8-R0.1-SNAPSHOT-latest.jar</systemPath>
no god why
so for that slution I needed
wtf
I NEED
and thats the server
1.18.1
anyone got any ideas?
can u just
ugh so why did you add 1.8.8 as system scope?
ok
lets work on running buildtools first
you need to do that
to install it to your local maven repo
What's your maven config look like
buildtools runs just fine for me
im using gradle
Oh there's your issue 
how? im using what it says to use for gradle
we got a gradle hater here smh
it was a bad joke lol
ik that wasnt is answer, but it could atleast have made sense 😂
show your gradle file then pls 🙂
?paste
yes
your settings too
your build.gradle or however it's called
are you using groovy or kotlin dsl
@tender shard
- This is example of 1.8.8 spigot api (net.minecraft.server) working locally not from repository url.
- I need 1.18.1 lib so i can
import net.minecraft.server.
@dusty sphinx - I need API
- Idk what BuildTools is used for (API or Server), however it crashes when it comes to spigot (Working fine with CraftBukkit, and Bukkit)
- If I could use external link I really would. However I couldn't find anything working, (I assume ur talking about
<repository><id>asd</id><url>HERE LINK</url><repository>) SO I WENT ON SEARCHING FOR A JAR which I can use having <systemPath>
wait didn't you just say that you need 1.18.1? and now it's 1.8.8 again?
.
im also very confused can you just send your maven file
ill tell you what you need to do from there
2. I need 1.18.1
?
<repositories>
<repository>
<id>minecraft-repo</id>
<url>https://libraries.minecraft.net/</url>
</repository>
<repository>
<id>sonatype</id>
<url>https://oss.sonatype.org/content/groups/public/</url>
</repository>
<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.18.1</version>
<systemPath>LOCAL FILE IF THERE IS NO LINK</systemPath>
<type>jar</type>
<scope>system</scope>
</dependency>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.18.1-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.mojang</groupId>
<artifactId>authlib</artifactId>
<version>1.5.21</version>
<scope>provided</scope>
</dependency>
</dependencies>
this example isnt mine, im VS'ing someone elses open source plugin to compile, but it isnt working. and ive had the same issue on other projects that ive developed myself https://paste.md-5.net/eqazimisaj.cs
DO NOT USE SYSTEM PATH
get rid of systemPath and type
then i give me the link
just run buildtools like this:
java -jar BuildTools.jar --rev 1.18.1 --remapped
3. If I could use external link I really would. However I couldn't find anything working, (I assume ur talking about <repository><id>asd</id><url>HERE LINK</url><repository>) SO I WENT ON SEARCHING FOR A JAR which I can use having <systemPath>
in which folder?
it doesnt matter
it installs it to your maven folder
in the folder where your buildtools.jar is
well yeah duh
remove EVERYTHING inside your buildtools folder, redownload it, then build it. it MUST work
You should have no reason to depend on the server jar unless you're using server internals (which you should avoid at all costs anyways)
well sometimes it's needed
API jar = on Maven repo. Server jar != on Maven repo
we are beyond that
do this
eh
jesus messages get lost quick here 😂
java -version?
you need to you cant download it
java version "17.0.1" 2021-10-19 LTS
Java(TM) SE Runtime Environment (build 17.0.1+12-LTS-39)
Java HotSpot(TM) 64-Bit Server VM (build 17.0.1+12-LTS-39, mixed mode, sharing)
spigot (unlike spigot-api) is in no repo. you HAVE to build it yourself for copyright reasons
so
delete your buildtools dir
redownload buildtools
run the command I sent
do you need jdk for buildtools or does jre work
java -jar BuildTools.jar --rev 1.18.1 --remapped
ok 4th
yeah that would be helpful
i cant help you if i cant read the error
ok one second im running it again.
did you delete everything before running it again though?
BUILDTOOLSPATH=/path/to/your/buildtools rm -rf $BUILDTOOLSPATH && mkdir -p $BUILDTOOLSPATH && cd $BUILDTOOLSPATH && wget https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar && java -jar BuildTools.jar --rev 1.18.1 --remapped```
😛
?paste
did you use this
legally we cant
Here is another example of it not working https://paste.md-5.net/ahugacagok.bash and the error is this: https://paste.md-5.net/icenilovek.rb
Soo i assume i won't be able to develop plugins for the new version of mc
because buildtools on my computer don't work and if sb build it for me it's illegal XD
ik i dont need to, but they should work either way, and I dont understand why they dont
I need a bit of help with Vectors. I'm trying to make a pendulum effect (I want the character to be able to swing) and I'm having a bit of trouble visualizing how this would be done.
basically i need to figure out how I would calculate the vector created by the inertia caused by the connection of the player to that point
because minecraft already applies gravitational velocity in some form, I would just need to apply the horizontal velocity of the pendulum, getting this right is tricky
@dusty sphinx @tender shard u got any idea?
seems like files aren't being created, or they're being deleted
yep, i don't have ny kind of anti virus which might do that
Syncing stuff like google cloud or onedrive also mess with this stuff
Sure it's whatever
Ima just assume no one has a clue
no sorry, I really have no idea
you could ping md_5
although I don't know whether he likes to be pinged
but I don't know any other solution
As I said, do not include Bukkit nor craftbukkit. They are not in Maven for 1.17+
@sullen marlin Sorry for pinging again but I really have no idea what the problem is
and you are the only person of whom I could think of to help in this case
is there a way to get the min world block? since in 1.18 vs other versions the min block is at a different location
y=0 previously and now y=-65 i think
min world block? wdym?
oh
World#getMinHeight
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/generator/WorldInfo.html#getMinHeight() @livid void
declaration: package: org.bukkit.generator, interface: WorldInfo
Thanks for trying guys
ah i was using 1.17 so didn't see that thank u @tender shard !!
- they would work either way, 2. its literally what is suggested on the spigot website..
wait pls
I pinged md_5 for you
he'll respond once he has time
link?
just look up spigot gradle API
I'm not searching, if you want help, link it
I guarantee it does not recomend adding Bukkit to your gradle anywher on Spigot
thats not help, im telling you that it is, if you want to know then google it
You asking for help, me offering. Either provide a link or I can't help you
Bukkit is not a thing
Elgar has been correctly saying this repeatedly
this @sullen marlin
but wouldnt the spigot api still load either way?
No, your gradle build is failing due to missing dependencies
fatal: invalid branch name: init.defaultBranch =
User fked their .gitconfig, breaking git
Your error says bukkit couldn’t load
I told them to delete their buildtools folder and redownload it like 3 times
and they said that they did it
Which makes sense because bukkit doesn’t exist
@winter mesa
Their .gitconfig in their home dir
did you actually remove your buildtools folder?!
bukkit only exists up to 1.15.2
ooooh
your ~/.gitconfig is the problem is what md_5 says
alrighty, thank you very much 🙂
u know where can I find it? (not using linux don't have ~ home )
im building in clear directory
~ = C:\Users\YourUserName
C:\Users\%username%\.gitconfig
it should be there, yes. its probably a hidden file
rename it pls
Ok
just rename it to "gitconfig.backup" or sth
yep
then run buildtools again
btw u know how to set a location of a EntityPlayer in these new libs?
trying to make some npcs
teleporte
thanks 🙂
I was uh
u got link to docs? will be useful
I was making a joke
oh
won't it work?
so maybe any of u got idea how to create "npc" player?
teleport doesn't work..
I only have an example to spawn an armortsand/ area effect cloud, but maybe it helps? idk
https://github.com/JEFF-Media-GbR/JeffLib/blob/9b34ce783ecb006e5bc660f9a904b8c12636a5c8/spigot_1_18_R1/src/main/java/de/jeff_media/jefflib/internal/nms/v1_18_R1/NMSHandler.java#L49
is there a better way to test small changes besides closing the server and restarting it
can I like swap them out and reload within minecraft
how would I get the vector perpendicular to another vector
this is so hard
im having so much trouble visuallizing this
There is no single vector that is perpendicular to another in 3d space
Im trying to add a hover event to my textcomponent, why am I getting a error? java copy.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder(ChatColor.YELLOW + "Click to copy the ad!").create()));
would be nice if you showed the error
is working with persistent data containers slow at all?
Like should i avoid it, or is it just fine
I assume it’s all in memory
So it’s just map access
Doesn’t 1.15 have a scoreboard API
Well yeah
You can’t have more than 1 without it either
You can swap them around though
You can’t
With or without NMS
What
What do you even mean by multiple scoreboards
Okay
But what do you need more than one for
What
I still don’t understand
Glow is done with teams, a scoreboard can have several teams
How would I use BukkitScheduler to run a simple thing 3 seconds later
like running first set to portal thing then 3 seconds later set to air
runTaskLater
im srry but could u provide an example ive been readidng the doc for it and cant figure it out
?scheduling
what's the best version api to develop on, e.g. for a skyblock plugin?
Latest
hello guys
how can i set value of random int . Like int a = random.nextInt() < 10
nextInt takes a value for the upper bound
alr how can i get an arraylist reference's value like which number that reference is on
indexOf?
i created 1 arraylist put something to it. I want to see those's number order
like if i added "a", "b", "c". Want to see their order numbers.
ArrayLists are insertion ordered
Yes
get ur head out of the gutter, this isnt Lua
just trying to make simple algorithms and get topics good
Nice ... Never got custom entity types to work ... Always had to use already existing entity types and extend them to make it work with the API since it doesn't know the entitytype if you just extend Mob(or EnrityInsentient)
Is there a ?-cmd for the world creator with the new Chunk creator as tutorial ?
No
Giant g = (Giant)loc.getWorld().spawn(loc, Giant.class);```
The class exists so i assume that's a yes
@ivory sleet should i save my users here?
https://github.com/FourteenBrush/MagmaBuildNetwork/blob/main/src/main/java/io/github/FourteenBrush/MagmaBuildNetwork/user/MySqlUserStorage.java
Im trying to Creat a playerentity however when i teleport it to my desired location nothing happens- no errors etc
Did you add it to the world ? Player entity just don't do anything without placing it in a world or giving it an shadow-actor
?
"Test negative numbers" ?
For String -> Number do Integer.parseInt(...)/Long.parseLong(...)/Float.parseFloat(...)/Double.parseDouble(...)
yeah
How do I send a PacketDataSerializer?
assert number < 0;
what is assert
debugging stuff, not enabled by default outside of unit testing
throws an AssertionError if the operand is false
figured it out, I didn't realize it could be easily converted to a bytebuf
ive noticed a lot of ppl talking about creating playerentities
can you just make fake nms players easily now?
How to do so
?
Because world.spawnEntity( is for Types, not EntityPlayer no Player
Ok I found that world.getEntities().add(my_entity) will add an entity however only type Entity not EntityPlayer nor Player. Any idea of how to cast it?
This sounds dangerous
Yeah it's not written in the apispec that it should return a mutable list, let alone a list that is backed by the actual list of entities
does anyone know any apis to add lines above player names using riding entities? I've tried to use multilineapi but the api that it uses doesn't work on 1.8
Eh 1.8
When making custom crafting how do I group items so I can avoid making multiple crafting recipes and just have one for all?
I'm cancelling InventoryMoveItemEvent and for some reason, idk why, there is a condition where all items except 1 simply disappear. All I do is do setCancelled(true)
is there no nms thing #toBukkitEntity()?
how can i access to a private interface in a class via field reflections?
😳
How can I convert a PathResult to a PathEntity? (or get an NMS PathEntity from an API Pathfinder?)
public void connect() throws ClassNotFoundException, SQLException {
if (!isConnected()){
connection = DriverManager.getConnection("jdbc:mysql://" +
host + ":" + port + "/" + database + "?useSSL=false",
username, password);
}
}
how can i implement autoreconnect here?
Do not keep connection opened.
use hikaricp
use a try with resources instead smh
@EventHandler
public void lockEvent(EntityDamageByEntityEvent e) {
if (e.getEntity() instanceof Minecart) {
if (e.getDamager() instanceof Player) {
getServer().broadcastMessage("TEST");
}
}
}
why is this not working?
you are saying if the entity is a minecart? that won't hit
are you sure breaking a minecart is a damage event?
^^
uhm, i don't really know how to use that
whats the event of hitting a minecart then?
?jd
Take a look at some guide
possibly the PlayerInteractEvent?
but, i'll have to change my whole code?
you can filter out the ones you want tho
i mean, i have finished mysql code but if the server doesn't restart it says something about auto-reconnect
maybe
i mean
ah i get it
when the server has been for x time
when i call something to execute mysql
it says that has been long and try to use autoreconnect
Do not be aware of rewriting bad code
afraid?
thats why you need to close your connection
yep, afraid**
makes more sense
and returning an open connection on the method call
i disconnect the mysql onDisable
so a try with resources + hikariCp would be more convenient
that defeats the purpose of using a pool
well uhh
you can close out the resources being used, but you shouldn't need to close out the connection unless you don't need the connection anymore
Multithreaded access to Connections was deprecated in JDBC and is not supported by HikariCP either.
HikariCP is fast enough that you can obtain a Connection, execute SQL, and then return it back to the pool many times in the course of a request.
It is a Best Practice to only hold Connections in local variables, preferably in a try-with-resources block, or possibly passed on the stack, but never in a class member field. If you follow that pattern it is virtually impossible to leak a Connection or accidentally share across threads.
Yeah you are meant to close them with hikariCP
well it probably doesn't actually close it though if hikariCP has its own methods to use for doing such
Not that I recall
i always saw people closing them
There’s even a setting to detect leaked connections
well leaking a connection refers to something else using the same connection as another thing
I suppose you could end up with a leaked connection with nothing connected to it, but a properly configured MySQL server should kill such connections
worst case is you hit the TCP time limits
nothing wrong with this, however connection pools are designed where the connection gets re-used if something is done with it
this way, the time is removed from opening a new connection and thus using less resources
if all the connection pool itself is doing is closing out the connection completely, then it is virtually pointless to have such an API since you can code the few lines to open a connection and then close it out yourself lol
when Im trying world.getEntities().add(mobaraEntity); mobaraEntity.teleport(loc);
No entity appears and no error occurs

