#help-development
1 messages · Page 860 of 1
No don't shade ProtocolLib
I don't think you should shade it
That's if he doesn't provide ProtocolLib
given cross-version compat and all that jazz
if he doesn't want to, he should just put protocollib's plugin in the plugin folder
ProtocolLib should not be shaded
if you want to shade use something that's shade friendly like PacketEvents
I understand
do you have protocollib installed?
proceeds to bing retrooper
if no: install protocollib
i added it to maven dependency
👍
put it on provided and install the plugin
i may be very stupid
do you have protocollib installe don the server?
as in put it in your plugin folder
oh
OH
OHHHHHH
I
jesus
bruh
thats what sleep deprevation did to me yesterday lmao
And here we see a spigot dev in it's natural habitat
your plugin now requires protocollib to be installed on the server. you shuold also add it as depend or softdepend to your plugin.yml
yeah no
i know
i just
ok bruh
😂 all good
Can a Proxy stop a method's invocation?
if you mean what I think you mean, no
If you are talking about these JVM proxies - probably
So... It doesn't work
The java Proxy class
The what
the reflect proxies
Go up a little bit, i proposed some solutions
But yeah, they probably can delegate a method invocation to the bitvoid
What are reflect proxies
Wrappers around an object so to speak
can i do packets without the protocolib btw?
cuz like uhh. i dont want dependencies :(
plus im stupid
cant find download link
and everything that can be wrong is wrong
You can but you'll need to write code for every version you want to support
Well yeah of course you can
- Use PacketEvents
uhhh
Hmm, I'm thinking rn, could I theoretically make a static method as a variable (like the ones you can get with reflection)?
1.20 only?
- You can build it with your plugin
1.8 users dont grammar
gramer? Newer hert of tat
I don't see why not
Code
Methods should only be static final
You mean a Method object?
Meh, you should use MethodHandles in this day and age
Packets can be hard if you're new to Spigot/Minecraft development and especially if you're new to java as well
I meant the objects
Yeah, I'm thinking of making a variable with a method object I instantiate and somehow put code into(?)
that is not possible with Method, but you can do it via MethodHandle
And I can like put code into it?
Although with limitations
The problem is that it's too difficult to create itemstack boat of material of entity boat
LIKE WHAT DO YOU MEAN BY THIS
So confusing
super basic code, yes. Basic loops, single method invocations and stuff
Method myMethod = new Method(() -> {/*code*/});
go down a little bit, i said you could also drop the boat's natural dropping items (sticks & planks) on destruction
Do you need it to override something?
I could show you in dms, if you want
What's the purpose
I need boat item, not the natural drop
Dms
Hmm, could I implement an interface without making a new class or even knowing the exact location of it? Like nms, dynamically getting its package
wdym?
I mean technically speaking that is not really possible as your lambda wouldn't map to a class (well you could map it to a method anyways but that is like 8D chess).
Yes
ByteBuddy has it
I have boat entity, and I need the boat item
WHAT IF ON RUNTIME I INJECT A CLASS INTO THE PLUGIN
Sounds shitty
ItemStack boat
"Inject"?
then just get the material from the boattype
You mean load?
Ig
Just use MethodHandles.Lookup#defineClass
Bytebuddy is evil
Haven't used it but have seen it used
All praise the holy ASM (Or cafedude IFF you know what you are doing)
Boat.getType.getMaterial returns planks
Basically, I wanna implement a nms class to do funny things bukkit doesn't wanna do and I want it to compatible over all the versions so no import statements allowed
Yoo I wanna do the same
But override the loaded nms class
Damn
I'm not doing stuff so complex, I just need to make a custom impl of a nms interface to get some values
So the way that I found is Material boatMaterial = Material.getMaterial(boat.getBoatType() + "_BOAT");
I mean I have done something similar in the past: https://github.com/Geolykt/EnchantmentsPlus/blob/4xx/src/main/java/de/geolykt/enchantments_plus/compatibility/hackloader/Hackloader.java#L71-L195
Well this is absolutely necessary for me
Ok, so can anyone tell me what packet is responsible for the up and down animation when changing nbt of item?
But also a dynamic one
The what?
The item reload I think
I think that is hardcoded?
Oh
Ohhh, you're on recent versions?
It's client-sided
isn't that a bit kinda complicated
You can probably add a txt
Yeaaaah
oh well then just create a map or sth
private static final Map<Boat.Type, Material> BOAT_TYPES = new HashMap<Boat.Type, Material>() {
{
Arrays.stream(Boat.Type.values()).forEach(type -> {
put(type, Material.valueOf(type.name() + "_BOAT"));
});
}
};
sth like this should do. although I believe there's a builtin way
mixins required moment
I actually hate how craftbukkit works
Whaaaat is that
what happened yesterday?
Pure shit
Something that doesn't work in bukkit space
goofy way, too many relocations, etc.
Bytecode injection library
Yet people always demand it, even though it is complete nonsense
Yeah thanks, I just did the same #help-development message
u told me i can use packets to cancel that animtion
We have Minestom, let's all just create a better Paper and agree to write plugins for it from now on
Mixins is useful but people resort to it far too often causing poorly made mods that conflict and break stuff
lmao
most of the time mixins aren't even needed lol
Yeah
and did it work?
Well if only people could learn to accept friggn PRs
which packets to cancel
which animation?
?img
Can't send images? That's because you're not verified! Use !verify to complete verification.
Alternatively, you can upload screenshots to any image hosting site and share the link.
Here's some screenshot utilities that you can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org
?img
Can't send images? That's because you're not verified! Use !verify to complete verification.
Alternatively, you can upload screenshots to any image hosting site and share the link.
Here's some screenshot utilities that you can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org
you could also explain which animation you mean
They did already say the arm swing when holding an item being updated
It's most likely the animation that plays when you invoke #setItemstack
^^
ah
Ah, I thought it was the hotbar anim
Well the arm swing might be cancellable, idk
both should be cancellable
Itt's not
no clue which packet it is, I'd just listen to all outgoing packets, print out their class names, then update an itemstack and see which packet was sent at that time
It's sent from the client
And he doesn't care what the server says
He just sends it to tell other players that they need to have it displayed
the update inventory packet from server > client is what has to be cancelled
So you can't stop the client from showing it to himself
Weirdo
how to modify world border?
if I remember correctly it should be
its prolly client, right?
?jd
declaration: package: org.bukkit, interface: World
._.
at least on kt
?learnkotlin
yeah
so use the object it returns
Uhhhh, arent none of these what this is
ok so it is not cancelable
held item slot does seem reasonable
but most likely something else is triggering the arm swing that you need to work around
Not recommended if you're new to Java and/or Spigot
Sorry what is it exactly that you want to cancel?
@wooden frost (insane name btw)
Cause I don't think you can cancel the animation
yeah
i wanted to cancel the animation
and no, a normal nick
same as urs tbh @minor junco
its the adj + word combo
Slav_egg
cuz me russian ass
and character is egg
lituraly
Damn
Lol
It's client sided and impossible, the animation is done before any packet is sent / received
U can force the client to use mods but I don't think client like dat
yeah nah
słowiańske jajko or something
you simply have to cancel the server telling the client about the changed item
what do you do if you get a CancelledPacketHandleException (packet received async error) and none of your code is referenced
how do I take a player direction and turn it into a quaternion?
słowiańskie
my brain is breaking
trying to store list into player
my brain hurtsss
like i know how to
but brain hurt
so not doing it today
You can create custom persistent data types on your own, or use one of the many libraries available which have implemented those which match your needs. Learn about more persistent data types here: https://www.spigotmc.org/threads/more-persistent-data-types-collections-maps-and-arrays-for-pdc.520677/
then it's probably using NMS
is it on github?
have you used gradle to build, or ./gradlew ?
hmm please send the whole output of gradle, e.g.
./gradlew build | tee output.log
?paste
you can paste it there ^
oh hi alex
try running ./gradlew shadowJar
looks good, so what's missing in the .jar? also did it create more than one .jar? I cannot test it because that project uses toolchains for weird java versions (16) that aren't available for arm64
that whole build file is cursed :X
yeah
also the fact of them requiring jars with specific names and that
its just a mess
yeah lol
anyway I changed the toolchain from 16 to 17 in NMS 1.17, compiling it myself now
which NMS version do you need? it should include all the versions form the NMS folder, if I'm not mistaken
damn paperweight is so extremely slow
it'll probably take half an hour before it has downloaded and setup all versions for me
ive decided to use patrick choes remapper and just use bt jars
yep that's definitely the best solution imho
also doesnt force you to use paper's incompatible api
that too
and doesnt have to redownload everything for every new project
bc we cant use paperweight when they stop relocating
?
there are experimental shared caches btw
why can't it just use the local maven repo
for what?
for all the stuff it downloads over and over again for every project
are you using MorePersistentDataTypes?
no?
You can create custom persistent data types on your own, or use one of the many libraries available which have implemented those which match your needs. Learn about more persistent data types here: https://www.spigotmc.org/threads/more-persistent-data-types-collections-maps-and-arrays-for-pdc.520677/
not sure what you mean
it doesn't only download maven artifacts
the .jar does contain all NMS classes for me when doing ./gradlew build
can you jar xvf the .jar it created for you in target, then show what the nms package contains?
?img
Can't send images? That's because you're not verified! Use !verify to complete verification.
Alternatively, you can upload screenshots to any image hosting site and share the link.
Here's some screenshot utilities that you can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org
huh
that's weird
try running it again but this time we redirect stderr too
./gradlew clean build 2>&1 | tee weird-gradle.log
tbh with that weird build file, I wouldn't be surprised if it only worked on second or third run lol. it's copying arbitrary files around and stuff
thx you too
If im using Jetbrains annotations for a plugin the dependency should be provided right? Because they are only used at developing
HI, is json/gson fine with adapting arrays?
If you are working over jsons and want to facilitate the objects serialization and deserilization its perfect. In your case you are using for parsing an array i suppouse
provided, yes
thanks alex!
Yeah it is no problem if annotations are missing at runtime - for as long as you do not use reflection with them
How would I structure an event method that changes the weather based on a bookedit event?
Would I need 2 parameters, one for PlayerBookEditEvent and one for WeatherChangeEvent?
No
You can only listen to one event at a time
also you probably don't want to listen to the weather event, you want to change the weather
So use the PlayerBookEditEvent as my parameter and call a weather change within? What would you suggest to get the weather change to occur?
You can use the setStorm method to toggle rain on and off
or setThundering if you want thunderstorm
?jd-s
^^ Take a look at the javadoc
Events are reactionary. They're called based on triggers. Calling an event doesn't make the trigger take place.
@lost matrix I am currently working on the API Setter-Expose for previouslyKilled in Bukkit. Do you think we should just expose the setter to the API directly? Because this seems like it could create problems if some plugin dev runs it without thinking about it. May I implement some checks or automatically respawn the dragon if called? Also, since this is a private var, do I need to write a nms-patch to create a Setter for it?
anyone else with an idea or opinion, give me
Do you remember you were trying to help me with my command framework i was doing? Would you be able to explain me why did this extra checking fix it. The code i added is the one in bold (args.isEmpty())
@Override
public final boolean execute(CommandSender sender, List<String> args) {
if (args.isEmpty()) {
sendUsage(sender);
return true;
}
Command argument = getCommand(args.get(0));
if (argument == null) {
sender.sendMessage("Argument " + args.get(0) + " not found");
return true;
}
args.remove(0);
if (**args.isEmpty()** && !isAuthorized(sender) && **args.isEmpty()** && !argument.isAuthorized(sender)){
sender.sendMessage("No permission");
return true;
}
return argument.execute(sender, args);
}```
@pseudo hazel do you remember my framework? I fixed with that code but not an idea why is working
he wants to know why his code is working lol
why the code suddenly started to work correct once i add the extra conditions the args.isEmpty() one
it was also a question of setting up teh permissions correctly, which you dont show here so I have to assume this is the only code you changed?
To check if a plugin has any updates, the spigot url to the plugin is needed, but if the plugin has not been created, the url does not exist, how should I then check for updates?
add the update checker in the second update
just changed that (added 2 isEmpty() checks) and tested with same code i provided
alternatively check for updates from github
Okey
if args.get(0) is null, will return because argument will be null too
I just know the code started to work correctly after i add those 2 extra checks for args being empty
That why i came to ask why started work because for me doesnt really make a sense
How do I get the blocks destroyed by an explosion? There isn't a EntityExplodeEvent#getBlockList Method in the 1.20 anymore
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/entity/EntityExplodeEvent.html#blockList()
declaration: package: org.bukkit.event.entity, class: EntityExplodeEvent
its just blockList()
It's just called blockList()
bruh my bad sorry
i wonder who committed that crime
i mean, those short method names are fine, but then it should be consistent lol
When I remove a Block of this blockList, the block doesn't break does it
i remember how I also once didnt find the method because I just entered get... and didnt find it in the list
correct
k thanks
totally agree, spigot start being the new hated paper. Thats the truth sorry
That's how I feel sometimes searching for #remove() when it's actually #clear()
Method name is from 18 Jan 2011, pretty much exactly 13 years ago lol
How hard would it be to adapt ItemStack to json? Imo I think very, considering it has so much stuff like lore, pdc, name etc.
yo md what do you think about exposing previouslyKilled for API in some way?
Idk what that is
But sure?
Isn't there already a getLastKiller or something
At least a getLastDamageEvent or something
it's for DragonBattle
Sounds fine, open a pr
referring to this
do you just want to respawn the dragon as if it was first spawned or what? i havent really understood what you're trying to do
epic I can use this alongside my regular objects right?
yeah im currently working on it
Why are people obsessed with json over yaml
Cuz speed
sure, you can just add it as type hierarchy adapter to existing gson instances, or just use it standalone whenever you wanna turn a ConfigurationSerializable into json or vice versa
JsonConfiguration when
i hate json so much
I concur
I use json for everything

I love json only L is no comments but it's not a big deal can just have a md file
is 18 still the latest resource pack format? the wiki article hasnt been updated since 1.20.2
Pretty big L for configuration
Hey, im working on an afk plugin and im trying to detect afk pools, so far i've tried to detect playermovement via packets, but the packets are being sent still even tho the player was moved with water. Any ideas?
No idea why you need packets to detect movement
i tried using packets so in hopes that these are only sent when the player presses wasd
but this was not the case
True generally I use it for more "registry" like stuff which I tend to find annoying in yaml.
the ServerboundPlayerInputPacket is sent when the player is moved by water?
i suppose, (if the POSITION protocollib packet is the correct one)
Move packet is sent every tick pretty sure
well but if you want to detect movements through water too, then why not just use the move event?
no i want to detect the opposite, i only want to detect movement via wasd
so no movement with tnt
no movement with pushing
no minecart
ah ok. yeah well if the client sends the packet even though no WASD was pressed, then RIP
there has to be a way tho, there are afk plugins out there that can detect stuff like this
Just check if they're in flowing water??
i guess that would work, but wouldnt that mean i need to hard code every single scenario?
What scenarios are there
Yerp I'm sure that's what other plugins do
player pushed by player
ride horse
minecart
tnt
entity attack
I mean these are all boolean checks
What are you trying to prevent
good description?
im creating an afk plugin
a player shouldnt be marked as not afk i he moves with a minecraft for example
First and second Lines are kinda redundant but sure
is there any good api for skulls around
dam really
Spigot 1.18.1 added the new PlayerProfiles class, which finally allows us to use custom heads without needing any reflection! You can obtain them as normal items, or actually place them down into the world. I’ll show you how both works: Creating a new PlayerProfile First, we gotta create a new PlayerProfile object. To do so,...
if only there'd be a nice baboon skull texture
for a monkey plugin
now, how do I make my CraftBukkit Stash Fork use my API changes from my Bukkit Stash Fork the best way?
Anyone know a good way to stress test your plugin, so I've tried to test it in as many different ways as I can think of but there are more.
i guess it depends on what your plugin does?
Upload it and let players do that
If it is a premium plugin? 🙂
Mvn install your bukkit fork with a custom version, then run mvn package on craftbukkit and use your custom version as dependency
Hm i simply installed my plugins on my own server or play singleplayer with them to find bugs
Lol wtf
what is a proper naming scheme for that one?
Huh
Use whatever you want, its only for you to test it
I just use "mvn install -Dversion=Iliketurtles", use it for my cb stuff, run it, make my changes, do my testing, revert it in the cb code, build and then pr?
im not sure if you can just override the version like that. I always just edited the pom and then just not committed that change when uploading it
ah ok
When I should create my plugin in spigot it is the src code needed for review or how works that?
Like a github repo or something
No you only have to upload the jar
But i guess it gets approved faster if staff can directly see the source code
But its not required to provide the source
Okay Thanks 🙂
Source code is only required for premium plugins. (For review)
Its not required
Well, it's much more helpful for them.
I never provided the source for angelchest or drop2inventoryplus or jukeboxplus etc
I just uploaded the unobfuscated jars
But premium plugins do have to go under review before they are approved.
Yes, sure
ok so I locally installed the api, now, how do I add the right dep in cb
They‘ll just decompile it
with the filepath I installed it?
In craftbukkits pom, change the bukkit version to your custom version
Then compile craftbukkit and run it
didn't find the version
Did you mvn install bukkit?
But if my code is obfuscated, because is like a premium plugin I also need to add src code, but how should I add that?
its easier to just publish the actual version
Show your craftbukkit pom
The obfuscation you use just has to be able to be deobfuscated by the reviewers. So as long as you provide the method to deobfuscate, then you'll be fine.
<groupId>org.bukkit</groupId>
<artifactId>bukkit</artifactId>
<version>iliketurtles</version>
<scope>compile</scope>
</dependency>```
dpm
should install to the default stuff automatically right?
ok then
well I already mvn installed it now like Y2K said lmao
guess imma just revert later
but use it now to debug it
That will break in at most 24 hours when maven updates snapshots
well im done in 10 minutes tho likely lmao
Then no problem
it's just a simple setter, I don't think there is anything that is gonna be able to fail
@Override
public void setPreviouslyKilled(boolean previouslyKilled) {
handle.setPreviouslyKilled(previouslyKilled);
}```
it works perfect for bukkit as it doesn't stick around
ok, now what I do is build CB, start some random server with it and write a plugin testing it
?
well I maven installed it, so it defaults to that anyways doesn't it?
wdym? if you create a plugin now, you have to add bukkit as dependency instead of spigot-api
im getting npe for papi
[15:42:10 WARN]: [MazerArena] Plugin MazerArena v1.1.1 generated an exception while executing task 11
java.lang.NullPointerException: Cannot invoke "me.clip.placeholderapi.PlaceholderAPIPlugin.getLocalExpansionManager()" because the return value of "me.clip.placeholderapi.PlaceholderAPIPlugin.getInstance()" is null
at me.clip.placeholderapi.PlaceholderAPI.setPlaceholders(PlaceholderAPI.java:72) ~[MazerArena-1.0-SNAPSHOT-all.jar:?]
at me.clip.placeholderapi.PlaceholderAPI.setPlaceholders(PlaceholderAPI.java:99) ~[MazerArena-1.0-SNAPSHOT-all.jar:?]
at me.cirosanchez.mazerarena.scoreboard.ScoreboardManager.updateLines(ScoreboardManager.java:49) ~[MazerArena-1.0-SNAPSHOT-all.jar:?]
at me.cirosanchez.mazerarena.scoreboard.ScoreboardManager.lambda$new$0(ScoreboardManager.java:25) ~[MazerArena-1.0-SNAPSHOT-all.jar:?]
at org.bukkit.craftbukkit.v1_20_R1.scheduler.CraftTask.run(CraftTask.java:103) ~[paper-1.20.1.jar:git-Paper-196]
at org.bukkit.craftbukkit.v1_20_R1.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:57) ~[paper-1.20.1.jar:git-Paper-196]
at com.destroystokyo.paper.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:22) ~[paper-1.20.1.jar:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?]
at java.lang.Thread.run(Thread.java:840) ~[?:?]
tbh don't know what could be happening
i thought it was cause i was implementing Papi but when i changed it nothing happened
First Paper.
Second your PAPI instance is null, so you are either getting it too early (before PAPI has loaded), or you shaded your own copy of PAPI by mistake
paper 🤓
lemme try
with excluding papi
You don't include papi on your jar
Hello
papi is not like a library that would be shaded into your project. You just depend on it and use their things
yes
i know
stupid me
it was that
lol
np it's okay
how can i check if the player is going to any of the 8 axis?
8D Minecraft
when working with mongo
how can i know if a document has an UUID
from the player
cause doc.isEmpty() isnt working to me
Why would your document not have one? What is the code you're trying to invoke that has the issue?
Are there any good GUI apis for use?
I just built 1.20.4... and eclipe isn't letting me improt anything from the jar
?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
bruh why isn't that on the builtools page
Cause most people end up using maven or gradle to handle all of the importing.
That's an interesting assumption to make on their part ig
maybe I'm just old school
Thank you for the help tho
very old school :P
I don't think most java developers touch the vanilla build system
I used to use it when I was a beginner, but I'm much past that xD
Could also just be the case for us spigot devs. More frequent use of maven and gradle.
Yea most Java projects that I do (I'm mainly a web dev / kubernetes) don't need / use a build system like maven / gradle
what's a cleaner code-design?
1.A utility method that does something and calls an event.
2.All the classes that do would call the utility method just call the event.
number 1
this is because you can modify behavior across files without changing them individually
okay, thank you :)
Say you need to correct a typo. You do it in 1 spot instead of 2 or more
Same reason we use string constants
okay, gonna implement it that way, thanks for the quick response
for sure
@worldly ingot You still around?
Yep
Any suggestions on how to test a modified version of applyPatches? I'm trying to fix the global git commands within BuildTools and the suggestion was to update that file.
Problem is that I don't know how I can use my modified version instead of the one that BuildTools downloads and replaces.
choco you are developing for hypixel?
Just by using applyPatches, no? :p
Yes
are you making updates for hypxiel skyblock as well?
Nope. Minigame developer. I don't touch Skyblock
oh ok :/
He gets stuffed into the unloved part of the network
Hey :( it's loved
That's not a fair comparison 
I'm trying to confirm it works while BuildTools is running.
Would running it on an already compiled work directory do anything?
Just run it manually
I think SB fluctuates between 50 - 60% of the network though
Back in my day they only had like 4 games!
Bash is weird, but I think I got it working now.
And there we go. https://hub.spigotmc.org/stash/projects/SPIGOT/repos/spigot/pull-requests/127/overview
10 years later it finally got fixed. lmao
decade old bug fixing goes hard
👀 what was the bug
but it still uses --global? 
Can't see, no account
BUILDTOOLS-26: Set git author locally instead of globally
Wait, did I screw it up?
Ah nice
Yeah that would make more sense
I've made a PR with the spigot git author 💀
Why was it setting the global one to begin with
I made changes in my local copy but didn't update it in the IDE. :p
Classic "I forgot to Ctrl + S"
Yeah there you go. That makes a bit more sense
Wait
No, hold up.
I think I actually had it right
Yea it used --global, but it didn't set anything.
At least I think it didn't
Don't you want a combination of both?
git config --global user.name
That should just return a string.
git config --global user.name USERNAME
That should set the username
Unless I have this messed up?
Making me doubt myself. smh
-z is "not" right? Or empty?
-z checks if the string is null
Yeah. Is "" null?
Yes
I would say also maybe git config --local user.name unconfigured
For explicit purposes
When setting the name?
And email, yeah
Just add the --local
I'm pretty certain --local is default but I think it's clearer to be explicit here
Fair
The hatred for it? lol
The heck is fi
if -> fi
It's certainly creative
I think I've seen it used somewhere else besides bash.
At least Lua uses "end"
Do they also have for -> rof and while -> elihw
They have elif (else if)
I wish they did, but no, they're "do" and "end" iirc
How boring
Isn't done also in batch?
Probably
Time to make a language where you end everything with the reverse
Including classes and methods
All classes have become palindromes.
org.bukkub.Bukkub
org.bukkub.bukkub.gro
Palindromes are same forwards and backwards.
Bukkit will now be kkikk
hey
i was investigating on regions and stuff on minecfaft
I found rtree
or smth like that
But i feel thats too complex for a minecraft plugin
its that actually used?
yeah pretty sure WorldGuard uses an R-Tree or some variation
Hmm
I see
Maybe its better for me to implement world guard?
or its better to make my own region system
not implementing rtree, smth real basic ig
if you thnik an RTree is the best solution push yourself and go for it
Does anyone know big gamemode plugins that I can reference to due to a lot of good practices and designs
idk if he has any free ones but check out my friend Wazup92 he makes MiniGames quite a lot actually
I mainly just wanna know how listeners should properly be used
cause I see 7smile7 use it in kind of a unique way
Well
You should abstract all your logic away to the point where listeners are just api endpoints
yeah damn none of his are free
Wdym endpoints
not endpoints but whatever
your listeners should just call your api
and your api handles it from there
like
on PlayerJoinEvent:
ConnectionManager#handleEvent(event)
yeah but
Instead of doing all the IO on the listener
What if I need the event data
You can pass the event itself
Like all of it
or just the params you need
Like including the ability to cancel it
It really depends on what you need

is that difficult?
@EventHandler
public void onEntityDamage(EntityDamageEvent event) {
if (event.isCancelled() || event.getEntity().getType() != EntityType.PLAYER) {
return;
}
Player victim = (Player) event.getEntity();
PitDamageEvent pitDamageEvent = new PitDamageEvent(event, victim, null);
Bukkit.getPluginManager().callEvent(pitDamageEvent);
if (pitDamageEvent.isCancelled()) {
return;
}
Never tried to make a data structure more than a singly linked list lol
The cancel at the end is useless (for now)
I thought about moving this logic into the manager like,
handleEvent() just straight up
and then after the PitDamageEvent is called, I handle it somewhere
So it makes sense to put it in my manager cause the listener shouldn't handle the custom event, but how would I even abstract this
Does he have any public ones
idk never made one, but usually the intuition of tree's isn't horrible
nah unfortunately
I used to work with him he was pretty damn good at minigames
well RTrees are only worth it if you have a shit load of regions
probably like a 10 or so thousand
if you're interested though https://github.com/davidmoten/rtree/blob/master/src/main/java/com/github/davidmoten/rtree/RTree.java
yeah anyways RTrees work great for WorldGuard because its optimized for arbitrarily large amounts of regions
I'd still highly reccomend checking it out as its a useful algorithm
anyways here is a pretty decent benchmark too if you're interested https://github.com/ambling/rtree-benchmark
Ill just spark the fuck out of my implementation lol
what do you need your regions for
im trying to make an HCF plugin
So for the claims i need regions
spawn, warzone, wilderness and the factions claims
Might want to use rtrees then
in that case RTrees are going to be worth it
just use the library I sent you
it's an already existing implementation way better than you likely could ever make
there really isn't a need for it to be "linked" to minecraft at all
essentially just need to see is thing here???
Yes thing here!!!
or no thing not here
but an rtree would be the whole world lets say
yeah prey much
yeah i dont understand this
so 30,000,000x30,000,000
hell nah
luckily for you with this library you don't actually need to specify how big the region is
That is some complicated code wtf
and it's super consistent with the format it looks nice
RTree<Pos1, Pos2>? Or what the fuck is a String Geometry
@ivory sleet wish I came across this when working on my generators plugin, would have been perfect. I might use RTrees when I revisit it tbh.
yeah my word of caution though is to make your own Position object for the love of god to not use Location
But Geometries.point is what
a point in space
erm actually it'd be 60 million by 60 million? 🤓
I thought it was 30,000,000 x 30,000,000 default
So ig a Geometry.rectangle consists of 2 of them
damn
30 mill radius
oh fucking christ
hell yeah
well a recatnagle is just a 2d array of points or in laymans terms a bunch of points 👍
the library seems fairly nice
the github readme is pretty extensive and explains stuff welll so you sohuld beable to get it with time
Yeah but
I dont really understand the paper that the 2 generic types have
Like a map??
? the paper
Like role, dont know how to specify it
RTree<MyEntryObject, Geometry> myFunRtree = Rtree.create()
Ciro ima be honest
its quite literally all in the read me you can ignore the scholarly articles at the top lmao
like not saying this wouldn't benefit u
say it
I found this library at the same time you did
but like I feel like
test it for yourself but I don't think that you'll have enough claims to lag the server
RTree is still better here and its easier to use with this library too
especially if you want to detect when a player steps in a claim RTree is defintely the superior choice
O(N) looping operation over ever claim every Movement is trouble
with tree's you're generally ensured log n search time
are we reading the same repository?
What's his github
idk if he uses github even
might be a gitlab user haven't talked to him in ages
@astral scroll I'm headed to bed, but if you can't understand that readme I sent you're in way over your head
yeah they're pretty good stuff
🥲
How can I know if server is implementing Bukkit API?
I am doing a command framework with @sterile token and we are almost done, we are now starting to add support to other popular server software
org.bukkit.Bukkit ?
If it has bukkit classes
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Bukkit.html#getVersion()
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Bukkit.html#getBukkitVersion()
declaration: package: org.bukkit, class: Bukkit
first one gets the implementation, second gets the api
by checking whether your plugin is enabled
if your plugin is being run it's implementing bukkit
you'll need a BuilderFactory to acquire a Builder for this class which I hope implements Registry<AbstractSkyblockIslandManagerProvider>
then you call this "enterprise code" and call it a day
it's more of a minecraft registry thing
this is actually enterprise code lmfao
but yeah this IslandManagerProviderRegistry BS is so my plugin supports SWM and isn't forced to support my other plugin
I think they are just wanting to know if its like some custom version
or just a way to tell the difference on what it is running on
hi, I have a plugin that uses GameProfiles for fetching skulldata (for custom head skins). and this worked perfectly (code: GameProfile profile = new GameProfile(UUID.randomUUID(), null) and i think in one of the latest versions a change went through, which didnt allow the second argument of the gameprofile (the name) to be null.
Here's my issue, I don't know how to work arround this. because i tired to just put up a random name like "Steve", and it'll work, but you'll get a warning message each time the skull gets used (basically every mobspawn), saying the data is inconsistent and that you need to inform the dev...
there's no such thing as a random name generator right?
Use the api
which one?
thanks! this'll help
Spigot 1.18.1 added the new PlayerProfiles class, which finally allows us to use custom heads without needing any reflection! You can obtain them as normal items, or actually place them down into the world. I’ll show you how both works: Creating a new PlayerProfile First, we gotta create a new PlayerProfile object. To do so,...
Technically if I saved the Event object after an event passes, I could use that object to get anything from the event right?
I mean, yea, but why not make your own data holder
Is it possible to silently drop a player's connection with the BungeeCord API?
I want the connection to time out, not kick the player instantly
you can alter the reason the player is kicked for
Is the best way to remove resources to self reports them?
yeah report and ask for it to be deleted
I hate it so much when people think methods are deprecated just because they're using a totally different api (paper) and then their suggested "fix" to get rid of "deprecated methods" is to use a method that only exists in paper, and does the exact same thing.
great, now you switched from a non-deprecated method to a non-existing method!
I think he just wanted to write a method to use for Paper if anyone had that link and wanted to use it.
But yeah, unrelated, the title is in Spigot.
it also happens on this discord all the time
someone uses §, other people tell them to use the ChatColor class, then they claim it's deprecated
I tried spawning a marker entity
var marker = world.spawn(location, Marker.class, markerEntity -> {
markerEntity.setOp(true);
});
Then I tried executing a command
Bukkit.dispatchCommand(marker, "say HELLO, WORLD!");
However it seems as if entities other than players or console can't run commands, I need this to be able to run commands in a specific world, and using execute in world run doesn't seem to recognize plugin commands. Anyone have any other solution?
they should be able to
are you running a permissions plugin that disregards setOp
try without a permissions plugin
Ah yeah, someone else added LP -_-
I'll try without it
there's a setting in LP's config.yml to avoid messing up OP btw
that came in handy lmao
did it work?
checking right now
btw OP isn't needed for that test command?
I just ran this and it printed "hello" just fine
/summon minecraft:marker
/execute as @e[type=marker] run say hello
when I use "in world" though, it doesnt print anything, so I guess that might be the problem?
Still doesn't run, even with removing LuckPerms
Also @tender shard I'm running dispatchCommand without using execute as execute doesn't see plugin commands
hm, letting the command run /me hi works, however things like say or time set don't
maybe setOp doesn't work on entities
try add a permissible for minecraft.command.say
This seems to work, apparently it just doesn't like setOp lol
Open a bug report please
On jira, correct?
big pog new documentation website
finally I can actually make multilingual docs
still ironing out the details but I'm happy with how it's turning out
It seems as if the server jar is now paper (I hate sysadmins not communicating smh), I don't think I should report it on the spigot jira, correct?
you need to replicate the bug on spigot first yea
makes little sense to report something to spigot if it might be caused by one of papers patches
Screen needs to be wider
Yep, I'll replicate it later, don't have much time right now
wider? as in the padding is too much right now?
wth is that monitor xD
Monitor not wide enough
ignore the massive image, this is all legacy contents
I just added a markdown converter so I can recycle most of the github wikis
ahh okay
I am prtty sure it's not player object since it changes
how do you properly extend a custom exception class
do I need to override any functions
so just a super("message") in constructor?
ya
it sounds too simple xD
it works i tried it but i was thinking if theres any other way of doing this without super
cuz it is ig
nvm thanks
Hello im trying to setup my voting plugin it works but it wont broadcast or give rewards ive been stuck
?nocode
It’s hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.
Id like to discuss it 1on1 with someone
im sure its something simple im just not grasping
so i was going through the votingplugin config to setup
and i enabled the broadcast
no its the public plugin
im new to this
ah my bad
npnp
Not sure if this is suitable to be asked here but for some reason I don't see javadocs comments when inspecting spigot classes in IntelliJ is there a way to do this or should I just keep referring to the actual javadocs webpage?
You can seperately include javadoc as a dependency I think, but I have no idea tbh
Thanks, I'll have a look into it
any one has experience with VC Code and changing syntax colors for Yaml file?
how would I change key color to some thing else
I tried ``` "editor.tokenColorCustomizations": {
"textMateRules": [
{
"scope": [
"string.quoted.double.yaml punctuation.separator.key-value.mapping.yaml",
],
"settings": {
"foreground": "#FF0000"
}
}
],
},```
but no luck
I happen to have a need for it
Yep
NDA, Can't mention
Running plugin commands as an entity
didn't think of that
* is worse than op
built from BuildTools with java -jar BuildTools.jar --rev 1.20.1
--rev 1.20.1
for shame

also if you're on 1.20.1 so what if we fix it lol
can you even give Entities operator
I thought that was a Player Only thing
yes you can
wild
cuz commands
The real question is if the base entities have the same level of permission protection as the players do.
Cause if they don't and are allowed to bypass most stuff, then that could be problematic.
public void op(GameProfile var0) {
super.op(var0);
this.saveOps();
}
public void deop(GameProfile var0) {
super.deop(var0);
this.saveOps();
}
``` How can other entities have op?
from DedicatedPlayerList
you sure that just isn't an original oversite?
Save the opps
within NMS I see no reference that Non-Players can have operator
but Mojang's system is quite different from bukkit's
Compare different mappings with this website: https://mappings.cephx.dev
well as far as Vanilla goes they have permission levels iirc
where its just numbers
Bukkit adds all the "permission.thing.thing"
iirc op is permission level 4
it's Player related data iirc
like skin, player name etc, cape
sure, but other Entities don't have those things other than op
also this was explicitly overriden, I'm sure there was a reason for that, atleast when it was originally done
public boolean isOp() {
return this.opable == null ? false : this.opable.isOp();
}
public void setOp(boolean value) {
if (this.opable == null) {
throw new UnsupportedOperationException("Cannot change op value as no ServerOperator is set");
} else {
this.opable.setOp(value);
}
}``` is what's in the actual PermissibleBase class
we're planning to update later
seems like only some entities actually reap its benefits though
I could try changing it and see if it does anything, but I'm assuming it doesn' t which is why its only overriden in some places
Git is weird.
yes, yes it is
it's very good and powerful
eh why not just return this.opable != null && this.opable.isOp()
Its hierarchy of finding information was finally starting to make some sort of sense and then I learn about this.
it won't do anything :P so its easier to short cut
k
do i need to use Bukkit.removeBossbar?
or can i just do bossBar.removeAll()
i dont use bossbars very often
Did you create the bossbar yourself
yeah
Then use removeAll
removeAll() removes all players on that bossbar
removeBossBar() removes the entire bossbar from the server
oh i see
Depends if you want to remove all bossbars or just a specific one
There is anyway to get an offline player in bungee?
I'm creating a ban command for bungeecord and I want to ban also if the player is offline
damn does json not recognise null? If an area is null it seems to just not add that area at all, instead of doing "area":null
