#help-development

1 messages · Page 860 of 1

full laurel
#

He could still just create the items for the boat, ex: the boat drops sticks and planks when it breaks, he could call the event and create these items, then drop them naturally on the broken boat's location

chrome beacon
#

No don't shade ProtocolLib

quiet ice
#

I don't think you should shade it

full laurel
#

That's if he doesn't provide ProtocolLib

quiet ice
#

given cross-version compat and all that jazz

full laurel
#

if he doesn't want to, he should just put protocollib's plugin in the plugin folder

chrome beacon
#

ProtocolLib should not be shaded

#

if you want to shade use something that's shade friendly like PacketEvents

full laurel
#

I understand

tender shard
#

do you have protocollib installed?

quiet ice
#

proceeds to bing retrooper

tender shard
wooden frost
full laurel
#

👍

full laurel
wooden frost
#

i may be very stupid

tender shard
full laurel
#

as in put it in your plugin folder

wooden frost
#

OH

#

OHHHHHH

#

I

#

jesus

full laurel
#

bruh

wooden frost
#

thats what sleep deprevation did to me yesterday lmao

quiet ice
#

And here we see a spigot dev in it's natural habitat

tender shard
#

your plugin now requires protocollib to be installed on the server. you shuold also add it as depend or softdepend to your plugin.yml

wooden frost
#

trying to uncover wtf i did yesterday when downloading was

#

ok

wooden frost
#

i know

#

i just

#

ok bruh

full laurel
#

😂 all good

grim hound
#

Can a Proxy stop a method's invocation?

quiet ice
#

if you mean what I think you mean, no

#

If you are talking about these JVM proxies - probably

kindred sentinel
#

So... It doesn't work

grim hound
#

The java Proxy class

quiet ice
#

the reflect proxies

full laurel
quiet ice
#

But yeah, they probably can delegate a method invocation to the bitvoid

shadow night
quiet ice
#

Wrappers around an object so to speak

wooden frost
#

plus im stupid

#

cant find download link

#

and everything that can be wrong is wrong

chrome beacon
shadow night
#

Hmm, I'm thinking rn, could I theoretically make a static method as a variable (like the ones you can get with reflection)?

wooden frost
#

1.20 only?

grim hound
#
  1. You can build it with your plugin
tender shard
#

1.8 users dont grammar

shadow night
shadow night
grim hound
#

Methods should only be static final

grim hound
quiet ice
#

Meh, you should use MethodHandles in this day and age

chrome beacon
# wooden frost 1.20 only?

Packets can be hard if you're new to Spigot/Minecraft development and especially if you're new to java as well

shadow night
grim hound
#

Like

#

Class#getMethod

quiet ice
grim hound
#

Uhh

#

That's it

shadow night
quiet ice
#

Although with limitations

kindred sentinel
#

The problem is that it's too difficult to create itemstack boat of material of entity boat

kindred sentinel
#

i can get boat type

#

but that is planks

grim hound
#

So confusing

quiet ice
shadow night
full laurel
grim hound
full laurel
#

I could show you in dms, if you want

grim hound
#

What's the purpose

kindred sentinel
full laurel
shadow night
quiet ice
kindred sentinel
shadow night
#

Sounds shitty

tender shard
#

wdym with item

kindred sentinel
#

ItemStack boat

tender shard
#

then just get the material from the boattype

grim hound
#

You mean load?

shadow night
#

Ig

quiet ice
quiet ice
#

Bytebuddy is evil

grim hound
quiet ice
#

All praise the holy ASM (Or cafedude IFF you know what you are doing)

kindred sentinel
shadow night
#

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

grim hound
#

But override the loaded nms class

shadow night
shadow night
kindred sentinel
#

So the way that I found is Material boatMaterial = Material.getMaterial(boat.getBoatType() + "_BOAT");

grim hound
wooden frost
#

Ok, so can anyone tell me what packet is responsible for the up and down animation when changing nbt of item?

grim hound
#

But also a dynamic one

ashen quest
#

The item reload I think

grim hound
#

Oh

grim hound
#

It's client-sided

wooden frost
#

@tender shard im gona gusfring you for yesterday...

shadow night
grim hound
#

You can probably add a txt

grim hound
#

No I dunno how I'll do this

kindred sentinel
tender shard
# kindred sentinel Boat.getType.getMaterial returns planks

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

shadow night
quiet ice
#

Nah

#

my hackloader does this perfectly

shadow night
#

I actually hate how craftbukkit works

grim hound
grim hound
#

Nms as well

tender shard
grim hound
#

Pure shit

quiet ice
shadow night
#

goofy way, too many relocations, etc.

chrome beacon
quiet ice
#

Yet people always demand it, even though it is complete nonsense

wooden frost
grim hound
chrome beacon
#

Mixins is useful but people resort to it far too often causing poorly made mods that conflict and break stuff

shadow night
chrome beacon
#

Yeah

tender shard
quiet ice
wooden frost
tender shard
#

which animation?

wooden frost
#

i cant send

#

cuz no image perms

chrome beacon
#

?img

undone axleBOT
#

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

tender shard
#

?img

undone axleBOT
#

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

tender shard
#

you could also explain which animation you mean

chrome beacon
#

They did already say the arm swing when holding an item being updated

quiet ice
#

It's most likely the animation that plays when you invoke #setItemstack

chrome beacon
#

^^

tender shard
#

ah

quiet ice
#

Well the arm swing might be cancellable, idk

chrome beacon
#

both should be cancellable

grim hound
tender shard
#

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

grim hound
#

It's sent from the client

grim hound
#

He just sends it to tell other players that they need to have it displayed

tender shard
#

the update inventory packet from server > client is what has to be cancelled

wooden frost
#

im trying to verify 🗣🗣🗣

#

hold up

grim hound
grim hound
#

Weirdo

wooden frost
#

is this thing cancelable

astral scroll
#

how to modify world border?

chrome beacon
wooden frost
#

its prolly client, right?

tender shard
undone axleBOT
astral scroll
#

its a val

#

can't be reassigned

chrome beacon
#

._.

astral scroll
#

at least on kt

tender shard
#

?learnkotlin

chrome beacon
#

Why would you reassign it

#

it's a getter??

astral scroll
#

yeah

chrome beacon
#

so use the object it returns

astral scroll
#

oh fuck

#

yeah

#

thanks

wooden frost
#

ok so it is not cancelable

chrome beacon
#

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

wooden frost
#

oki

#

thinking of a workaround already

minor junco
#

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

wooden frost
#

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

minor junco
#

Damn

ashen quest
#

Lol

minor junco
#

I thought it was slave gg

#

💀

minor junco
ashen quest
#

U can force the client to use mods but I don't think client like dat

minor junco
#

yeah nah

shadow night
tender shard
hushed spindle
#

what do you do if you get a CancelledPacketHandleException (packet received async error) and none of your code is referenced

sturdy heron
#

how do I take a player direction and turn it into a quaternion?

grim hound
#

Albo słoweńskie

#

Nwm

opal saffron
grim hound
#

Okey

shadow night
#

Am not polish man

#

Just tried to do it from memory lol

wooden frost
#

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

tender shard
#

?morepdc

undone axleBOT
tender shard
#

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

undone axleBOT
tender shard
#

you can paste it there ^

remote swallow
#

oh hi alex

tender shard
#

try running ./gradlew shadowJar

remote swallow
#

fine, hbu

#

that gradle stuff looks horrid

tender shard
#

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

remote swallow
#

yeah

tender shard
#

why are they using zipTree to shade stuff

#

if they already have the shadow plugin

remote swallow
#

also the fact of them requiring jars with specific names and that

#

its just a mess

tender shard
#

yeah lol

#

anyway I changed the toolchain from 16 to 17 in NMS 1.17, compiling it myself now

remote swallow
#

it might be easier to just redo the entire gradle stuff

#

ye

tender shard
#

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

remote swallow
#

ive decided to use patrick choes remapper and just use bt jars

wooden frost
#

im actualy brain rotted

tender shard
#

also doesnt force you to use paper's incompatible api

remote swallow
#

that too

tender shard
#

and doesnt have to redownload everything for every new project

remote swallow
#

bc we cant use paperweight when they stop relocating

tender shard
dry hazel
tender shard
#

why can't it just use the local maven repo

dry hazel
#

for what?

tender shard
#

for all the stuff it downloads over and over again for every project

wooden frost
#

how do you store list into it

#

i dont get it

#

actually

tender shard
#

are you using MorePersistentDataTypes?

wooden frost
tender shard
#

why not?

#

?morepdc

undone axleBOT
wooden frost
#

yup

#

gona do it later

#

dont understand a single word rn

dry hazel
#

it doesn't only download maven artifacts

tender shard
#

the .jar does contain all NMS classes for me when doing ./gradlew build

chrome beacon
#

That's a mac

#

but sure

#

I really read more carefully :p

tender shard
#

can you jar xvf the .jar it created for you in target, then show what the nms package contains?

#

?img

undone axleBOT
#

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

tender shard
#

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

sterile token
#

If im using Jetbrains annotations for a plugin the dependency should be provided right? Because they are only used at developing

proud badge
#

HI, is json/gson fine with adapting arrays?

sterile token
sterile token
quiet ice
#

Yeah it is no problem if annotations are missing at runtime - for as long as you do not use reflection with them

spring stag
#

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?

chrome beacon
#

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

spring stag
#

So use the PlayerBookEditEvent as my parameter and call a weather change within? What would you suggest to get the weather change to occur?

chrome beacon
#

You can use the setStorm method to toggle rain on and off

#

or setThundering if you want thunderstorm

#

?jd-s

undone axleBOT
chrome beacon
#

^^ Take a look at the javadoc

vocal cloud
#

Events are reactionary. They're called based on triggers. Calling an event doesn't make the trigger take place.

orchid gazelle
#

@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

sterile token
# vocal cloud Events are reactionary. They're called based on triggers. Calling an event doesn...

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

hazy parrot
#

what are u exactly asking xd

#

if you dont do that check, args.get(0) might throw

tender shard
sterile token
pseudo hazel
#

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?

slate tinsel
#

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?

tender shard
#

add the update checker in the second update

sterile token
tender shard
slate tinsel
sterile token
#

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

fickle mantle
#

How do I get the blocks destroyed by an explosion? There isn't a EntityExplodeEvent#getBlockList Method in the 1.20 anymore

tender shard
#

its just blockList()

kind hatch
#

It's just called blockList()

fickle mantle
#

bruh my bad sorry

tender shard
#

i mean, those short method names are fine, but then it should be consistent lol

fickle mantle
#

When I remove a Block of this blockList, the block doesn't break does it

tender shard
#

i remember how I also once didnt find the method because I just entered get... and didnt find it in the list

fickle mantle
#

k thanks

sterile token
kind hatch
sullen marlin
proud badge
#

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.

tender shard
orchid gazelle
sullen marlin
#

Idk what that is

#

But sure?

#

Isn't there already a getLastKiller or something

#

At least a getLastDamageEvent or something

orchid gazelle
#

it's for DragonBattle

sullen marlin
#

Sounds fine, open a pr

orchid gazelle
#

referring to this

tender shard
#

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

proud badge
orchid gazelle
sullen marlin
#

Why are people obsessed with json over yaml

kind hatch
#

Cuz speed

tender shard
sullen marlin
#

JsonConfiguration when

tender shard
#

i hate json so much

kind hatch
#

I concur

proud badge
#

I use json for everything

tender shard
river oracle
tender shard
#

is 18 still the latest resource pack format? the wiki article hasnt been updated since 1.20.2

sullen marlin
#

Pretty big L for configuration

inner mulch
#

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?

sullen marlin
#

No idea why you need packets to detect movement

inner mulch
#

but this was not the case

river oracle
tender shard
inner mulch
sullen marlin
#

Move packet is sent every tick pretty sure

tender shard
#

well but if you want to detect movements through water too, then why not just use the move event?

inner mulch
#

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

tender shard
#

ah ok. yeah well if the client sends the packet even though no WASD was pressed, then RIP

inner mulch
#

there has to be a way tho, there are afk plugins out there that can detect stuff like this

sullen marlin
#

Just check if they're in flowing water??

inner mulch
#

i guess that would work, but wouldnt that mean i need to hard code every single scenario?

sullen marlin
#

What scenarios are there

river oracle
#

Yerp I'm sure that's what other plugins do

inner mulch
#

ride horse

#

minecart

#

tnt

#

entity attack

river oracle
#

I mean these are all boolean checks

sullen marlin
#

What are you trying to prevent

orchid gazelle
#

good description?

inner mulch
#

im creating an afk plugin

#

a player shouldnt be marked as not afk i he moves with a minecraft for example

river oracle
orchid gazelle
#

then imma just delete the second and add the detail of the internal state

wary harness
#

is there any good api for skulls around

tender shard
#

yes

#

spigot-api

wary harness
#

dam really

tender shard
#

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

orchid gazelle
#

now, how do I make my CraftBukkit Stash Fork use my API changes from my Bukkit Stash Fork the best way?

slate tinsel
#

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.

inner mulch
#

i guess it depends on what your plugin does?

tender shard
slate tinsel
tender shard
orchid gazelle
#

damn

#

ok

tender shard
tender shard
orchid gazelle
slate tinsel
tender shard
orchid gazelle
#

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?

tender shard
orchid gazelle
#

ah ok

slate tinsel
#

Like a github repo or something

tender shard
#

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

slate tinsel
#

Okay Thanks 🙂

kind hatch
#

Source code is only required for premium plugins. (For review)

tender shard
#

Its not required

kind hatch
#

Well, it's much more helpful for them.

tender shard
#

I never provided the source for angelchest or drop2inventoryplus or jukeboxplus etc

#

I just uploaded the unobfuscated jars

kind hatch
#

But premium plugins do have to go under review before they are approved.

tender shard
#

Yes, sure

orchid gazelle
tender shard
orchid gazelle
#

with the filepath I installed it?

tender shard
#

Then compile craftbukkit and run it

orchid gazelle
#

didn't find the version

tender shard
#

Did you mvn install bukkit?

slate tinsel
#

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?

orchid gazelle
remote swallow
#

its easier to just publish the actual version

tender shard
kind hatch
orchid gazelle
#
            <groupId>org.bukkit</groupId>
            <artifactId>bukkit</artifactId>
            <version>iliketurtles</version>
            <scope>compile</scope>
        </dependency>```
river oracle
#

dpm

orchid gazelle
#

should install to the default stuff automatically right?

river oracle
#

don't change the version my mans

#

just do mvn install

orchid gazelle
tender shard
#

Change the version to turtles in bukkit pom

#

I guess you cant override it on cli

orchid gazelle
#

well I already mvn installed it now like Y2K said lmao

#

guess imma just revert later

#

but use it now to debug it

tender shard
#

That will break in at most 24 hours when maven updates snapshots

orchid gazelle
#

well im done in 10 minutes tho likely lmao

tender shard
#

Then no problem

orchid gazelle
#

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);
    }```
river oracle
orchid gazelle
#

ok, now what I do is build CB, start some random server with it and write a plugin testing it

#

?

tender shard
#

Yes

#

Remember that your plugin must depend on your custom bukkit, not spigot-api

orchid gazelle
#

yeah

#

stonks I just built CB

#

in 17s

#

uhhh that is bad

#

oh wait

#

nvm

orchid gazelle
tender shard
#

wdym? if you create a plugin now, you have to add bukkit as dependency instead of spigot-api

orchid gazelle
#

yeah but I can use the normal version

#

since I installed it to default

astral scroll
#

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

eternal oxide
#

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

astral scroll
astral scroll
#

lemme try

#

with excluding papi

sterile token
sterile sapphire
#

Hello

sterile token
#

papi is not like a library that would be shaded into your project. You just depend on it and use their things

astral scroll
#

i know

#

stupid me

#

it was that

#

lol

sterile token
#

np it's okay

spare mason
#

how can i check if the player is going to any of the 8 axis?

slender elbow
#

8D Minecraft

astral scroll
#

when working with mongo

#

how can i know if a document has an UUID

#

from the player

#

cause doc.isEmpty() isnt working to me

vocal cloud
#

Why would your document not have one? What is the code you're trying to invoke that has the issue?

true perch
#

Are there any good GUI apis for use?

woven burrow
#

I just built 1.20.4... and eclipe isn't letting me improt anything from the jar

kind hatch
#

?bootstrap

undone axleBOT
#

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

woven burrow
#

bruh why isn't that on the builtools page

kind hatch
#

Cause most people end up using maven or gradle to handle all of the importing.

woven burrow
#

That's an interesting assumption to make on their part ig

#

maybe I'm just old school

#

Thank you for the help tho

river oracle
#

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

kind hatch
#

Could also just be the case for us spigot devs. More frequent use of maven and gradle.

woven burrow
#

Yea most Java projects that I do (I'm mainly a web dev / kubernetes) don't need / use a build system like maven / gradle

inner mulch
#

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.

woven burrow
#

number 1

#

this is because you can modify behavior across files without changing them individually

inner mulch
#

okay, thank you :)

woven burrow
#

Say you need to correct a typo. You do it in 1 spot instead of 2 or more

#

Same reason we use string constants

inner mulch
#

okay, gonna implement it that way, thanks for the quick response

woven burrow
#

for sure

kind hatch
#

@worldly ingot You still around?

worldly ingot
#

Yep

kind hatch
#

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.

inner mulch
worldly ingot
#

Just by using applyPatches, no? :p

worldly ingot
inner mulch
#

are you making updates for hypxiel skyblock as well?

worldly ingot
#

Nope. Minigame developer. I don't touch Skyblock

inner mulch
#

oh ok :/

young knoll
#

He gets stuffed into the unloved part of the network

worldly ingot
#

Hey :( it's loved

young knoll
#

How many players are on skyblock vs anything else

#

:p

worldly ingot
#

That's not a fair comparison PES2_FloorCry

kind hatch
worldly ingot
#

I think SB fluctuates between 50 - 60% of the network though

sullen marlin
#

./applyPatches.sh

#

After running it via bt once

young knoll
#

Back in my day they only had like 4 games!

kind hatch
#

Bash is weird, but I think I got it working now.

chrome beacon
#

👀 what was the bug

worldly ingot
#

but it still uses --global? PES_Think

chrome beacon
#

Can't see, no account

worldly ingot
#

BUILDTOOLS-26: Set git author locally instead of globally

kind hatch
#

Wait, did I screw it up?

kind hatch
#

Oops, that's supposed to be --includes.

#

Frick

worldly ingot
#

Yeah that would make more sense

chrome beacon
#

I've made a PR with the spigot git author 💀

#

Why was it setting the global one to begin with

kind hatch
#

I made changes in my local copy but didn't update it in the IDE. :p

worldly ingot
#

Classic "I forgot to Ctrl + S"

kind hatch
#

Fr

#

Now it's fixed.

#

hopefully 👀

worldly ingot
#

Yeah there you go. That makes a bit more sense

kind hatch
#

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

worldly ingot
#

Don't you want a combination of both?

kind hatch
#

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?

worldly ingot
#

no, I think you're right

#

Maybe I was wrong lol

kind hatch
#

Making me doubt myself. smh

worldly ingot
#

-z is "not" right? Or empty?

kind hatch
#

-z checks if the string is null

worldly ingot
#

Yeah. Is "" null?

kind hatch
#

Yes

worldly ingot
#

Then yeah you're right KEKW

#

Here I am throwing off your fix

kind hatch
#

I confirmed with echo output.

#

Oh well, back to reverting changes.

worldly ingot
#

I would say also maybe git config --local user.name unconfigured

#

For explicit purposes

kind hatch
#

When setting the name?

worldly ingot
#

And email, yeah

#

Just add the --local

#

I'm pretty certain --local is default but I think it's clearer to be explicit here

kind hatch
#

Fair

worldly ingot
#

Also, fuck bash script

#

Really? -z?

kind hatch
#

Yea, I had to look all of that up.

#

Thankfully it's widespread.

worldly ingot
#

The hatred for it? lol

young knoll
#

The heck is fi

kind hatch
#

Sure, but mostly the documentation.

#

End if

worldly ingot
#

if -> fi

young knoll
#

I…

#

Am very upset

worldly ingot
#

It's certainly creative

kind hatch
#

I think I've seen it used somewhere else besides bash.

worldly ingot
#

At least Lua uses "end"

young knoll
#

Do they also have for -> rof and while -> elihw

kind hatch
#

They have elif (else if)

worldly ingot
#

I wish they did, but no, they're "do" and "end" iirc

young knoll
#

How boring

worldly ingot
#

Oh, sorry, "for", "do", and "done"

#
for VAR in setOfThings
do
    # do something
done
kind hatch
#

Isn't done also in batch?

worldly ingot
#

Probably

young knoll
#

Time to make a language where you end everything with the reverse

#

Including classes and methods

kind hatch
#

All classes have become palindromes.

worldly ingot
#

jfc

#

If that were a strict classname requirement, I'd actually cry

young knoll
#

org.bukkub.Bukkub

river oracle
young knoll
#

Ah right

#

Gotta make packages palindromes too

kind hatch
#

org.bukkub.bukkub.gro
Palindromes are same forwards and backwards.

young knoll
#

Problem is org isn’t a palindrome

#

So I guess we gotta do oro

kind hatch
#

Bukkit will now be kkikk

astral scroll
#

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?

river oracle
#

yeah pretty sure WorldGuard uses an R-Tree or some variation

astral scroll
#

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

river oracle
#

if you thnik an RTree is the best solution push yourself and go for it

quaint mantle
#

Does anyone know big gamemode plugins that I can reference to due to a lot of good practices and designs

river oracle
#

idk if he has any free ones but check out my friend Wazup92 he makes MiniGames quite a lot actually

quaint mantle
#

I mainly just wanna know how listeners should properly be used

#

cause I see 7smile7 use it in kind of a unique way

echo basalt
#

Well

#

You should abstract all your logic away to the point where listeners are just api endpoints

river oracle
#

yeah damn none of his are free

echo basalt
#

not endpoints but whatever

#

your listeners should just call your api

#

and your api handles it from there

quaint mantle
#

like

on PlayerJoinEvent:
ConnectionManager#handleEvent(event)

echo basalt
#

For example

#

My player data cache just has a handleJoin(Player) method

quaint mantle
#

yeah but

echo basalt
#

Instead of doing all the IO on the listener

quaint mantle
#

What if I need the event data

echo basalt
#

You can pass the event itself

quaint mantle
#

Like all of it

echo basalt
#

or just the params you need

quaint mantle
#

Like including the ability to cancel it

echo basalt
#

It really depends on what you need

quaint mantle
#

let me check what I have rn

#

I think I forgot to commit

#

💀

echo basalt
quaint mantle
#
    @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; 
         } 
astral scroll
#

Never tried to make a data structure more than a singly linked list lol

quaint mantle
#

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

quaint mantle
river oracle
#

nah unfortunately

#

I used to work with him he was pretty damn good at minigames

astral scroll
#

idk

#

i'll just stay with pos1 and pos2

#

😎

river oracle
#

well RTrees are only worth it if you have a shit load of regions

astral scroll
#

a shitload are

#

more than a thousand?

river oracle
#

probably like a 10 or so thousand

astral scroll
#

yeah not worth it

#

i'll stay with Cuboids

river oracle
#

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

astral scroll
#

thanks btw

#

;)

river oracle
astral scroll
#

Ill just spark the fuck out of my implementation lol

river oracle
#

what do you need your regions for

astral scroll
#

im trying to make an HCF plugin

#

So for the claims i need regions

#

spawn, warzone, wilderness and the factions claims

chrome beacon
#

Might want to use rtrees then

river oracle
#

in that case RTrees are going to be worth it

astral scroll
#

😭

#

well ig i gotta figure out how tf to implement rtrees on minecrafr

#

minecraft

river oracle
#

just use the library I sent you

#

it's an already existing implementation way better than you likely could ever make

astral scroll
#

i saw it

#

yeah lol

river oracle
#

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

astral scroll
#

but an rtree would be the whole world lets say

river oracle
#

yeah prey much

astral scroll
#

yeah i dont understand this

river oracle
#

so 30,000,000x30,000,000

astral scroll
#

hell nah

river oracle
#

luckily for you with this library you don't actually need to specify how big the region is

astral scroll
#

HCF is 2000x2000, bigger ive seen is 4000x4000

#

yeah

#

But a stupid question ig

quaint mantle
#

That is some complicated code wtf

#

and it's super consistent with the format it looks nice

astral scroll
#

RTree<Pos1, Pos2>? Or what the fuck is a String Geometry

river oracle
astral scroll
#

OHHH GEOMETRY.RECTANGLE

#

oke oke im kinda understanding

river oracle
#

yeah my word of caution though is to make your own Position object for the love of god to not use Location

astral scroll
#

But Geometries.point is what

river oracle
#

a point in space

slender elbow
river oracle
astral scroll
river oracle
#

damn

slender elbow
#

30 mill radius

river oracle
#

oh fucking christ

slender elbow
#

hell yeah

astral scroll
#

And i can do smth like

#

Position with members x, z, x, z

river oracle
astral scroll
#

fuck

#

This is kinda difficult tbh

river oracle
#

the library seems fairly nice

#

the github readme is pretty extensive and explains stuff welll so you sohuld beable to get it with time

astral scroll
#

Yeah but

#

I dont really understand the paper that the 2 generic types have

#

Like a map??

astral scroll
#

Like role, dont know how to specify it

river oracle
#

RTree<MyEntryObject, Geometry> myFunRtree = Rtree.create()

astral scroll
#

What the fuck they mean

#

oh

#

okay

quaint mantle
#

Ciro ima be honest

river oracle
#

its quite literally all in the read me you can ignore the scholarly articles at the top lmao

quaint mantle
#

like not saying this wouldn't benefit u

astral scroll
#

say it

river oracle
#

I found this library at the same time you did

quaint mantle
#

but like I feel like

#

test it for yourself but I don't think that you'll have enough claims to lag the server

river oracle
#

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

astral scroll
#

i dint understand a single fuck of the readme

#

😭

river oracle
#

are we reading the same repository?

river oracle
river oracle
#

might be a gitlab user haven't talked to him in ages

quaint mantle
#

Oh

#

lol

#

Wazup92

#

Oh my

river oracle
#

@astral scroll I'm headed to bed, but if you can't understand that readme I sent you're in way over your head

quaint mantle
#

his resources are impressive

#

on spigot

river oracle
quaint mantle
#

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

echo basalt
#

org.bukkit.Bukkit ?

river oracle
#

If it has bukkit classes

quaint mantle
#

Great

#

Thanks

tender shard
chrome beacon
#

if your plugin is being run it's implementing bukkit

echo basalt
#

help

tender shard
#

you'll need a BuilderFactory to acquire a Builder for this class which I hope implements Registry<AbstractSkyblockIslandManagerProvider>

echo basalt
#

oh yeah I have a registry system

#

who cares

tender shard
#

then you call this "enterprise code" and call it a day

echo basalt
#

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

wet breach
#

or just a way to tell the difference on what it is running on

faint tide
#

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?

sullen marlin
#

Use the api

faint tide
#

which one?

sullen marlin
#

Spigot

#

PlayerProfile

#

?jd-s

undone axleBOT
faint tide
#

thanks! this'll help

chrome beacon
#

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,...

proud badge
#

Technically if I saved the Event object after an event passes, I could use that object to get anything from the event right?

dry hazel
#

I mean, yea, but why not make your own data holder

sage dragon
#

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

valid burrow
#

you can alter the reason the player is kicked for

slate tinsel
#

Is the best way to remove resources to self reports them?

chrome beacon
#

yeah report and ask for it to be deleted

tender shard
#

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!

glad prawn
#

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.

tender shard
#

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

rough drift
#

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?

sullen marlin
#

they should be able to

#

are you running a permissions plugin that disregards setOp

#

try without a permissions plugin

rough drift
#

Ah yeah, someone else added LP -_-

I'll try without it

tender shard
#

there's a setting in LP's config.yml to avoid messing up OP btw

rough drift
#

that came in handy lmao

sullen marlin
#

did it work?

rough drift
#

checking right now

tender shard
#

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?

rough drift
#

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

sullen marlin
#

maybe setOp doesn't work on entities

#

try add a permissible for minecraft.command.say

rough drift
sullen marlin
#

Open a bug report please

rough drift
#

On jira, correct?

torn shuttle
#

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

rough drift
eternal night
#

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

sullen marlin
rough drift
torn shuttle
quaint mantle
torn shuttle
#

it's not a full monitor screenshot

#

this is closer to a full page

sullen marlin
#

Monitor not wide enough

torn shuttle
#

ignore the massive image, this is all legacy contents

#

I just added a markdown converter so I can recycle most of the github wikis

tender shard
long kettle
#

ahh okay

tender shard
#

by name?

ashen quest
#

I am prtty sure it's not player object since it changes

umbral ridge
#

how do you properly extend a custom exception class

#

do I need to override any functions

hazy parrot
#

nah

#

probably just match super constructor

#

for message

umbral ridge
#

so just a super("message") in constructor?

hazy parrot
#

ya

umbral ridge
#

it sounds too simple xD

#

it works i tried it but i was thinking if theres any other way of doing this without super

hazy parrot
#

cuz it is ig

umbral ridge
#

nvm thanks

glass moat
#

Hello im trying to setup my voting plugin it works but it wont broadcast or give rewards ive been stuck

valid burrow
#

?nocode

undone axleBOT
#

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.

glass moat
#

Id like to discuss it 1on1 with someone

valid burrow
#

discuss it with me

#

im right here

glass moat
#

im sure its something simple im just not grasping

#

so i was going through the votingplugin config to setup

#

and i enabled the broadcast

valid burrow
#

is it YOUR plugin?

#

or someone elses

glass moat
#

no its the public plugin

valid burrow
glass moat
#

im new to this

valid burrow
#

this is a development channel

#

for people who code stuff

glass moat
#

ah my bad

valid burrow
#

npnp

terse pumice
#

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?

shadow night
#

You can seperately include javadoc as a dependency I think, but I have no idea tbh

terse pumice
#

Thanks, I'll have a look into it

wary harness
#

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

rough drift
#

I happen to have a need for it

#

Yep

#

NDA, Can't mention

chrome beacon
#

Running plugin commands as an entity

rough drift
#

^

#

in a world*

undone axleBOT
rough drift
#

didn't think of that

chrome beacon
#

* is worse than op

slender elbow
#

it doesn't

#

it doesn't work on entities

#

it only works on players

worldly ingot
#

--rev 1.20.1

#

for shame

river oracle
#

is this replicable on latest?

worldly ingot
river oracle
#

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

slender elbow
#

yes you can

river oracle
#

wild

slender elbow
#

cuz commands

kind hatch
#

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.

river oracle
#
    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?

echo basalt
#

Save the opps

river oracle
#

within NMS I see no reference that Non-Players can have operator

#

but Mojang's system is quite different from bukkit's

undone axleBOT
river oracle
#

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

slender elbow
#

fun fact you can change the level in the ops file

#

for extra spice

river oracle
#

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
rough drift
river oracle
#

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

rough drift
#

I just fixed it for now with a minecart command block

#

^

kind hatch
#

Git is weird.

river oracle
#

yes, yes it is

slender elbow
#

it's very good and powerful

glad prawn
kind hatch
river oracle
glad prawn
#

k

rare rover
#

do i need to use Bukkit.removeBossbar?

#

or can i just do bossBar.removeAll()

#

i dont use bossbars very often

chrome beacon
#

Did you create the bossbar yourself

rare rover
#

yeah

chrome beacon
#

Then use removeAll

rare rover
#

👍

#

ty

kind hatch
#

removeAll() removes all players on that bossbar
removeBossBar() removes the entire bossbar from the server

chrome beacon
#

removeBossBar has some notes about it's usage

#

?jd-s

undone axleBOT
rare rover
#

oh i see

umbral ridge
# rare rover

Depends if you want to remove all bossbars or just a specific one

quaint mantle
#

There is anyway to get an offline player in bungee?

chrome beacon
#

Wish the Bungee javadoc search would work

#

What do you need it for?

quaint mantle
#

I'm creating a ban command for bungeecord and I want to ban also if the player is offline

proud badge
#

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

shadow night
#

No, json doesn't have null afaik

#

It'e either there, or it is not

proud badge
#

ok Ill use "" instead of null then

#

(its a string)

shadow night
#

¯_(ツ)_/¯

#

Well, your json parser should return null for a non-existant element anyways ig