#help-development

1 messages · Page 809 of 1

umbral ridge
#

I check this with hasPlayedBefore

pseudo hazel
#

rip shark 2023

quaint mantle
#

Do not touch logs tho

umbral ridge
#

change log-named-deaths to false

quaint mantle
#

some1 can read the help-server section

valid burrow
#

just for certain sitations

#

looking for a way to cancel it on the entity death event or sometihg like that

#

will an entity.remove count as a entity death event?

alpine otter
#
[17:50:44 INFO]: Starting Javalin ...
[17:50:44 INFO]: You are running Javalin 4.6.8 (released May 4, 2023. Your Javalin version is 207 days old. Consider checking for a newer version.).
[17:50:44 ERROR]: Error occurred while enabling LiquidREST v0.1.0 (Is it up to date?)
java.lang.NoSuchMethodError: 'void org.eclipse.jetty.servlet.ServletHolder.<init>(javax.servlet.Servlet)'
        at io.javalin.jetty.JettyServer.start(JettyServer.kt:57) ~[LiquidREST-0.1-all.jar:?]
        at io.javalin.Javalin.start(Javalin.java:174) ~[LiquidREST-0.1-all.jar:?]
        at io.javalin.Javalin.start(Javalin.java:148) ~[LiquidREST-0.1-all.jar:?]
        at wtf.justmammtlol.plugins.LiquidREST.LiquidREST.onEnable(LiquidREST.java:36) ~[LiquidREST-0.1-all.jar:?]
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:273) ~[forge:?]
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:335) ~[forge:?]
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:479) ~[forge:?]
        at org.bukkit.craftbukkit.v1_16_R3.CraftServer.enablePlugin(CraftServer.java:502) ~[forge:7e29f765-296df566-9fb885e8]
        at org.bukkit.craftbukkit.v1_16_R3.CraftServer.enablePlugins(CraftServer.java:414) ~[forge:7e29f765-296df566-9fb885e8]
        at net.minecraft.server.MinecraftServer.func_240787_a_(MinecraftServer.java:427) ~[?:?]
        at net.minecraft.server.MinecraftServer.func_240800_l__(MinecraftServer.java:347) ~[?:?]
        at net.minecraft.server.dedicated.DedicatedServer.func_71197_b(DedicatedServer.java:227) ~[?:?]
        at net.minecraft.server.MinecraftServer.func_240802_v_(MinecraftServer.java:768) ~[?:?]
        at net.minecraft.server.MinecraftServer.func_240783_a_(MinecraftServer.java:267) ~[?:?]
        at java.lang.Thread.run(Thread.java:833) ~[?:?]
[17:50:44 INFO]: [LiquidREST] Disabling LiquidREST v0.1.0
[17:50:44 INFO]: Disabled LiquidREST```still
undone axleBOT
alpine otter
valid burrow
alpine otter
vast ledge
#

What are you trying to make?

valid burrow
vast ledge
#

Whats Javalin??

remote swallow
#

java/kotlin web framework

valid burrow
vast ledge
#

ewww

#

I mean

#

its not that bad

#

i just no like

#

its syntax is weirdd

rotund ravine
#

Try updating javalin

valid burrow
alpine otter
# valid burrow

it previously triggered another error on the latest version

#

i'm retrying tho

brazen tartan
#

trying to track an Arrow after it hits the ground, anyone know the Event for that? (if it's ArrowBodyCountChangeEvent could someone send me the method to get the data of the arrow and not the entity it hit, Thanks!)

dusky prawn
#

How do i open old intellij projects? xDxD

brazen tartan
#

Main Menu -> Open -> Main project folder (outside src)

ashen quest
#

How do I start my pc

#

Its wondows

dusky prawn
brazen tartan
#

yup

alpine otter
# valid burrow

on latest version it throws: java.lang.IncompatibleClassChangeError: class org.eclipse.jetty.websocket.server.JettyWebSocketServletFactory can not implement org.eclipse.jetty.websocket.api.WebSocketPolicy, because it is not an interface (org.eclipse.jetty.websocket.api.WebSocketPolicy is in unnamed module of loader cpw.mod

dusky prawn
#

player.sendMessage(Colorize.color("&fYou can't run this command, before" + (10000 - timeElapsed) + "seconds"));

How do i do, so this is seconds, and not milliseconds?

brazen tartan
#

i asume your tracking either system time or ticks correct?

dusky prawn
dusky prawn
brazen tartan
#

milliseconds / 1000 = seconds

valid burrow
#

well yg

#

yh

dusky prawn
#

Oh, i * them

#

im so dumb

#

xD

brazen tartan
#

but if your tracking game ticks it will be very wrong

#

just saying

dusky prawn
#

We'll see ;P

valid burrow
#

There are 1000 milliseconds in one second. Therefore, to convert milliseconds to seconds, you divide the number of milliseconds by 1000.

dusky prawn
#

Ya

#

It just says 9999 seconds :P

#

And then goes down

brazen tartan
dusky prawn
#

Kody Simpson 😎

brazen tartan
#

like a repeating task instead of System.getTimeInMili. . .

brazen tartan
#

nvm

brazen tartan
valid burrow
dusky prawn
#

Anyways

#

How do i fix it

brazen tartan
#

divide by 1000

dusky prawn
#

When i / 1000, its just saying 9999

brazen tartan
brazen tartan
#

wana send a larger snipit

#

or link the vid

dusky prawn
#

A larger bit of my code?

brazen tartan
#

yea

dusky prawn
#

Here ya go

#

this is so shit, no one wanna use it anyways

brazen tartan
#

((10000 - timeElapsed) / 1000)

rotund ravine
#

Meteoren

#

Brug den nye date api, mega nem og mindre hovedpine

#

Instant.now()

#

Date api is leet

dusky prawn
valid burrow
dusky prawn
#

xD

brazen tartan
#

THATS WHAT IT WAS

dusky prawn
#

Dansk er lidt et pølsesprog, men meget hyggeligt

#

XDXDXD

brazen tartan
#

holy

#

i was in my language settings

dusky prawn
#

GAGHAAHAHAHAH

valid burrow
#

xd

#

jan were in denmark do you live

rotund ravine
valid burrow
#

im there in few months

rotund ravine
valid burrow
#

come visit me in copenhagen when im there will ya

#

denmark so small cant be more then 2h dive

#

drive

rotund ravine
#

When are you here?

valid burrow
#

some time next year

#

class trip

rotund ravine
#

I am quite busy with school, so maybe?

valid burrow
#

alright xd

brazen tartan
#

if im spawning an arrow entity can i just grab the var and do arrowVar.getLocation to track it through the air?

valid burrow
dusky prawn
#

Altså, lyder klogt, bevares - Kan du komme med et kort eksempel, hvis du magter? ahaha

brazen tartan
#

im spawning an invisible arrow and attempting to reskin it to a warden blast

#

lamo

valid burrow
#

why.

#

sounds cool but

#

why

brazen tartan
#

ive been having issues using the Plugin type to create repeating and delayed tasks bc I dont understand how the Plugin class fully works

brazen tartan
rotund ravine
# dusky prawn Ehh

Fik bing til at skrive noget da jeg er på mobil.

I can try to rewrite the code for you using instants and duration for the cooldown. Here is my attempt:

public class EatCommand implements CommandExecutor {

    //key = uuid of the player
    //Instant = the instant of when they ran the command
    private final HashMap<UUID, Instant> cooldown;

    public EatCommand(Plugin6 plugin6){
        this.cooldown = new HashMap<>();
    }

    @Override
    public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String s, @NotNull String[] strings) {

        if(sender instanceof Player p){

            Player player = (Player) sender;

            if (!this.cooldown.containsKey(player.getUniqueId())){
                this.cooldown.put(player.getUniqueId(), Instant.now());
                p.setFoodLevel(20);
                p.sendMessage(Colorize.color("&8[ &e&lEAT &8]"));
                p.sendMessage(" ");
                p.sendMessage(Colorize.color("&fHerren sørgede for din sult! &eDu blev mættet."));
            }else{

                // Difference in seconds
                long timeElapsed  = Duration.between(cooldown.get(player.getUniqueId()), Instant.now()).getSeconds();
                // 10 sekunder..
                if (timeElapsed > 10){

                    this.cooldown.put(player.getUniqueId(), Instant.now());
                    p.setFoodLevel(20);
                    p.sendMessage(Colorize.color("&8[ &e&lEAT &8]"));
                    p.sendMessage(" ");
                    p.sendMessage(Colorize.color("&fHerren sørgede for din sult! &eDu blev mættet."));
                }else{
                    player.sendMessage(Colorize.color("&fDu kan &cikke &fbruge kommandoen, før om &e" + (10 - timeElapsed ) + "sekunder"));
                }

            }


        }

        return true;
    }
}```
#

Du kan nok reducere det lidt endnu

valid burrow
#

well repeating tasks are easy

brazen tartan
#

I just dont know what the parameter does bc all the resources online are like: here you go its done now. but they dont explain why or how

valid burrow
#

chat gpt lol

rotund ravine
#

What parameters

brazen tartan
#

for syncRepeatingTasks

rotund ravine
brazen tartan
#

the plugin param

#

    public SonicShriek(_1_20_2 parent) {
        this.parent = parent;
    }
valid burrow
rotund ravine
#

Oh no

brazen tartan
#

Bukkit.getServer().getScheduler().scheduleSyncRepeatingTask(parent, () -> bullet.getWorld().spawnParticle(Particle.SONIC_BOOM, bullet.getLocation(), 1), 0, 1);

brazen tartan
valid burrow
brazen tartan
#

like as a BukkitTask?

rotund ravine
#

@dusky prawn virkede det fint?

#

Eller har du flere spørgsmål

dusky prawn
#

Har massere af spørgsmål, hvis du bare vidste hvor mange jeg holdte inde. Men tester lige

rotund ravine
#

Altså det var mere så du fik ideen til hvordan man brugte det.

valid burrow
dusky prawn
#

Nårh ja, jeg tror jeg har en nogenlunde idé nu :)

valid burrow
#

You can encapsulate each task in a class

brazen tartan
#

ive tried that with other things but you can't pass in data throught the run() method

rotund ravine
dusky prawn
#

Korrekt, den skifter faktisk slet ikke

#

Udover det, virker det fint

#

Altså, den står kun på 10 aha

rotund ravine
#

Virker mærkeligt, men forstår du brugen af instants of duration ud fra den?

#

Du kan prøve at genskrive det ordentligt

dusky prawn
#

Forsøger

#

Efter jeg har ædt - Tak ellers :)

rotund ravine
#

Velbekomme

umbral ridge
#

hey

valid burrow
#

hey

umbral ridge
#

how can I check if player has a permission such as "homes.limit.<number>" ? number can be anything in a range of int (above 0)

#

do I have to loop through their permissions?

remote swallow
#

anyone used docker desktop beore, some reason i cant download images, none of the versions work its always error code 500

umbral ridge
#

Is that how I retrieve their permissions?

candid galleon
#

that’s probably the easiest way of doing it

#

i used to just check hasPermission

umbral ridge
#

hmm I could check if player has a permission of (homes.limit.<current number of homes + 1>)

#

and then so on?

#

without retrieving their permissions

remote swallow
#

if you have the other permission just split it at the dots get the last entry and then use player.hasPermission

umbral ridge
rotund ravine
#

Yes

umbral ridge
#

Ok perfect

alpine otter
#

do you guys think that sparkjava may be better to embed in a plugin?

rotund ravine
#

Sparkjava?

#

Ahh

#

Sure go for it

alpine otter
#

javalin is revealing as a pain in the ass

#

java.lang.IllegalStateException: This must be done before route mapping has begun this, what..

chrome beacon
#

Send the entire stacktrace

#

"this" would probably refer to the method you called

alpine otter
#
java.lang.IllegalStateException: This must be done before route mapping has begun
        at spark.Service.throwBeforeRouteMappingException(Service.java:504) ~[LiquidREST-0.1-all.jar:?]
        at spark.Service.port(Service.java:169) ~[LiquidREST-0.1-all.jar:?]
        at spark.Spark.port(Spark.java:1014) ~[LiquidREST-0.1-all.jar:?]
        at wtf.justmammtlol.plugins.LiquidREST.LiquidREST.onEnable(LiquidREST.java:39) ~[LiquidREST-0.1-all.jar:?]
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:273) ~[forge:?]
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:335) ~[forge:?]
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:479) ~[forge:?]
        at org.bukkit.craftbukkit.v1_16_R3.CraftServer.enablePlugin(CraftServer.java:502) ~[forge:7e29f765-296df566-9fb885e8]
        at org.bukkit.craftbukkit.v1_16_R3.CraftServer.enablePlugins(CraftServer.java:414) ~[forge:7e29f765-296df566-9fb885e8]
        at net.minecraft.server.MinecraftServer.func_240787_a_(MinecraftServer.java:427) ~[?:?]
        at net.minecraft.server.MinecraftServer.func_240800_l__(MinecraftServer.java:347) ~[?:?]
        at net.minecraft.server.dedicated.DedicatedServer.func_71197_b(DedicatedServer.java:227) ~[?:?]
        at net.minecraft.server.MinecraftServer.func_240802_v_(MinecraftServer.java:768) ~[?:?]
        at net.minecraft.server.MinecraftServer.func_240783_a_(MinecraftServer.java:267) ~[?:?]
        at java.lang.Thread.run(Thread.java:829) ~[?:?]```
#
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
        Thread.currentThread().setContextClassLoader(this.getClassLoader());
        init();
        port(restPort);
        Thread.currentThread().setContextClassLoader(classLoader);


        get("/econ/balance/:name", (request, response) -> {
                    User user = getUserClass(request.params(":name"));
                    BigDecimal balance = getMoneyExact(user);
                    DecimalFormat numberFormat = new DecimalFormat("#.00");
                    return numberFormat.format(balance);
                }
        );```port is done before routing
chrome beacon
alpine otter
#

yes that's sparkjava

quaint mantle
#

hi i need help

#

npc is created even though one already exists

rotund ravine
#

Load the chunk the entity is in first

quaint mantle
#

that's all?

rotund ravine
#

Probably?

quaint mantle
#

after chunk load: ```[ERROR] .... Error occurred while enabling spawn v1 (Is it up to date?)

java.lang.NullPointerException: null

at java.util.Objects.requireNonNull(Unknown Source) ~[?:?]

at pl.playgroundhc.spawn.Spawn.onEnable(Spawn.java:59) ~[spawn-1.jar:?]

at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264) ~[patched_1.17.1.jar:git-Paper-399]

at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:370) ~[patched_1.17.1.jar:git-Paper-399]

at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:500) ~[patched_1.17.1.jar:git-Paper-399]

at org.bukkit.craftbukkit.v1_17_R1.CraftServer.enablePlugin(CraftServer.java:561) ~[patched_1.17.1.jar:git-Paper-399]

at org.bukkit.craftbukkit.v1_17_R1.CraftServer.enablePlugins(CraftServer.java:475) ~[patched_1.17.1.jar:git-Paper-399]

at net.minecraft.server.MinecraftServer.loadWorld(MinecraftServer.java:733) ~[patched_1.17.1.jar:git-Paper-399]

at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:317) ~[patched_1.17.1.jar:git-Paper-399]

at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1220) ~[patched_1.17.1.jar:git-Paper-399]

at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:319) ~[patched_1.17.1.jar:git-Paper-399]

at java.lang.Thread.run(Unknown Source) ~[?:?]```

alpine otter
#
[19:21:34 WARN]:        at spark.embeddedserver.EmbeddedServers.initialize(EmbeddedServers.java:41)
[19:21:34 WARN]:        at spark.Service.lambda$init$2(Service.java:618)
[19:21:34 WARN]:        at java.base/java.lang.Thread.run(Thread.java:829)
[19:21:34 WARN]: Caused by: java.lang.ClassNotFoundException: javax.servlet.Filter
[19:21:34 WARN]:        at org.bukkit.plugin.java.PluginClassLoader.loadClass0(PluginClassLoader.java:178)
[19:21:34 WARN]:        at org.bukkit.plugin.java.PluginClassLoader.loadClass(PluginClassLoader.java:133)
[19:21:34 WARN]:        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:527)
[19:21:34 WARN]:        ... 3 more```
i managed to get it running, it starts but still throws an error
rotund ravine
quaint mantle
#

ok

brazen tartan
#

is there a way for me to re-enable a canceled task

chrome beacon
#

Just schedule a new task

grim hound
#

Is there any way to check whether a block has been destroyed?

#

as of: an event

river oracle
grim hound
river oracle
#

yeah idk how else a block would break outside of explosions

#

which is like ExplodeSomethingSomethingEvent

#

one second

grim hound
#

water

river oracle
#

?jd-s

undone axleBOT
grim hound
#

enderman pickup

#

gravity

#

etc.

river oracle
#

you can't track setType though

#

I mean you can you'll just need to mixin or patch the server

brazen tartan
#

the task runs and cancels correctly 1 time

#

then you cannot re-run it

young knoll
#

Correct

brazen tartan
#

canceled with task.cancel();

young knoll
#

Make a new one

brazen tartan
#

oh

#

is there a way to make a new one every time

#

the task object is assigned to a new BukkitRunnable() {};

brazen tartan
lost matrix
brazen tartan
lost matrix
#

Please dont capslock. Its considered rude.
And this channel is for development related questions. Pls move it to #help-server

lost matrix
remote swallow
#

7smile theres stuff in general

brazen tartan
lost matrix
brazen tartan
#

ok

#

thx

lost matrix
brazen tartan
#

ok

#

thanks

#

one more thing

#

should i store the data with a hashmap or an arrayList in your opinion

lost matrix
#

Which data?

brazen tartan
#

the arrow data bc I have different arrows that do different things

lost matrix
#

I would use an abstract class which defines the custom behavior and a LinkedList for my runnable.
Want a short example?

brazen tartan
#

yes

#

lmao

#

i am very confused by that XD

#

also im handling the arrow initialization in a separate class

#

from onEnable

lost matrix
#
public abstract class CustomProjectile {

  private final Projectile projectile;

  public CustomProjectile(Projectile projectile) {
    this.projectile = projectile;
  }

  public boolean isAlive() {
    return this.projectile.isValid();
  }

  public abstract void onTick();

}
public class CustomProjectileRunnable implements Runnable {

  private final LinkedList<CustomProjectile> projectiles = new LinkedList<>();

  public void addProjectile(CustomProjectile projectile) {
    this.projectiles.add(projectile);
  }

  @Override
  public void run() {
    this.projectiles.removeIf(this::tickAndCheck);
  }

  private boolean tickAndCheck(CustomProjectile projectile) {
    projectile.onTick();
    return !projectile.isAlive();
  }

}

This might me a bit much for less experienced devs

brazen tartan
#

im using the Arrow type, is the Projectile type handeled differently?

lost matrix
#

Arrow extends Projectile, so you can use this code 1:1 for arrows, snowballs and any other projectile

brazen tartan
#

ok

#

thats really cool

#

thx

lost matrix
#

This example however lacks custom impact handling.
You still need a manager class which Maps your projectiles to your CustomProjectile instances.

brazen tartan
#

oh

grim hound
#

Why won't it work?

#

the adding

lost matrix
grim hound
#

but I click

#

to make it add it

#

anyway

#

so what's the problem?

#

I click OK

#

it ain't working

lost matrix
#

The problem is that those dependencies depend on each other. Dont just click ok. Resolve the problem.

grim hound
#

absoulutely no problem

#

also I can't change that since it's made by others

lost matrix
#

Intellij tells us otherwise

grim hound
#

intellij stupid

#

:c

lost matrix
# grim hound intellij stupid

You cant add circular dependencies. How do you expect the project to compile. Be glad you have intellij.
Compiling by hand might result in a compiler bomb, trashing your entire RAM

grim hound
#

it worked before

#

but I had to get the repository from github and have it synchronized

lost matrix
#

Then restore the original setup where it worked

grim hound
#

and now it's not working anymore

grim hound
#

it's in another project

#

which isn't github synced

#

and is just a copy of the project

#

instead of a synced github rep

brazen tartan
#

so how do I add a projectile to the CustomProjectile list inside the Runnable?

grim hound
#

the Runnable class

brazen tartan
#

ive done nothing with implementing abstract classes before

#

o-o

grim hound
#

and it's one of the core java mechanics

brazen tartan
lost matrix
whole lintel
#

Yeah so

#

anyone has an idea of how do i learn site dev

lost matrix
# whole lintel anyone has an idea of how do i learn site dev

Start with basic html, then some css, and embed basic js.
Afterwards you can choose a framework like Vue or React and suffer until the next framework comes out. (This happens every few weeks it seems)

There are plenty of websites that teach you web dev out there

#

*And dont use Angular as your first framework pls

whole lintel
#

i don't need to be extraordinary at frontend, basic skills are ok

lost matrix
#

Other nice frameworks for java are: Quarkus and Micronaut.

whole lintel
#

so id rather that

worn tundra
lost matrix
#

Yeah Javelin might be nicer if you havent done any enterprise java before

whole lintel
#

yeah i should learn some basics too

#

like what the fuck is nodejs..etc

lost matrix
#

ugh

#

JS runs in your browser, so the frontend.
Node simply lets you run javascript in the backend, thats all.

#

You can go full stack with only javascript this way.

twin venture
#

hi , uhh ihave a question :-: so i did remake my project , and now its using modules , but some methods and tasks require JavaPlugin which is the main class that run , but i don't have it in core , i have in game module and lobby module

#

so some methods in core require a JavaPlugin to work

#

for example in core :

#

i was thinking about making a loader class :

#

its in the api moudle *

#

and i thought maybe i can do it in the Game class ?

#

dk if that is correct , anyone have a good idea?

visual laurel
#

How can i check if a clicked item is in the players inventory or in an open inventory? e.g. chest, etc

rotund ravine
#

getClickedInventory or smth like that

young knoll
#

Check if getClickedInventory == view.getBottomInventory

visual laurel
visual laurel
wide coyote
#

can't say smth for sure with the provided code tho

#

if you have a constructor then its probably something else

visual laurel
young knoll
#

You don't

#

The entire view has a title, not just the top inventory

visual laurel
#

ah ok, thanks

molten hearth
#

does anyone know how the fuck i ignore some files in git that have been accidentally committed in the past

twin venture
#

nvm i figured it out

#

thanks anyway

molten hearth
#

im gonna start tweakin soon

opal carbon
#

i think if u delete in that git menu it doesnt delete from your end but it does on git end

#

dont quote me on that tho

#

did that once and it worked iirc

molten hearth
#

bet

opal carbon
#

tell me if it works cause i actually dont 100% remember

molten hearth
#

i deleted it with right click delete and its still there lmao

opal carbon
#

the files still there right

#

so gitignore it now

#

and i think it should remove it in next push iirc

molten hearth
#

yeah its still there but i gitignored it and its still in the commit list

rotund ravine
#

That .

#

Is actually there

opal carbon
#

yeah but is it in git list for being deleted

#

like is it red

molten hearth
#

oh

#

no

#

LOL

opal carbon
#

oh my lord

molten hearth
#

now its just gray

rotund ravine
#

Xpdz wilding

opal carbon
#

yeah i think thats right? i forgot exactly

rotund ravine
#

Gray is good

molten hearth
#

sanest git experience

#

so i should delete them all and commit?

opal carbon
#

i think?

molten hearth
#

💀

opal carbon
#

iirc tho green is new file blue is updated grey is deleted

#

so should be fine

molten hearth
#

ya that seems to have done it ty

wet breach
molten hearth
#

i just wanted them to fuck off from my screen ong 😭 🙏

wet breach
#

you can exclude files on commit, gitignore is also an option if you want it permanent

opal carbon
#

that should accomplish both

molten hearth
#

yeah it did work thank u

opal carbon
#

yippie no dementia yet

molten hearth
#

sike

opal carbon
#

fuck

wet breach
#

so that means eventually you will have it?

opal carbon
#

maybe

#

but yeah glad that trick still works

upbeat hornet
#

How do people make their plugin work on a large version fork? Like 1.8.9-1.19.2 ?

#

I am making a plugin rn and would like it to be functionning on 1.8.9-1.16.5

lost matrix
#

But keep in mind that you will loose a ton of API from later versions and that there is a high
chance of eventual deprecation conflicts.

upbeat hornet
#

ok so 1.8.9-1.12.2 should be easy?

gleaming yarrow
#

quick one, can EntityDamageByEntity detect if an arrow was hit

#

i.e. would the event even fire if I hit an arrow with my fist for example

sullen marlin
#

Try and see!

gleaming yarrow
#

got a bit of a potato pc so wanted to check beforehand but thanks anyway

umbral ridge
#

hey what's the max. chest inventory size again? 54?

lost matrix
lost matrix
upbeat hornet
gleaming yarrow
lost matrix
gleaming yarrow
#

to simulate a sort of deflection system

lost matrix
#

Wait i read that wrong. I thought you meant an arrow hitting something.
I cant imagine that you will be able to hit an arrow with your hand.
This would lead to a horrible melee experience when you are being fired at.

gleaming yarrow
#

good point...

#

I need someone else to test it with though cause my pc is dying as it is

#

So I'll wait until a friend logs on and then report my findings

lost matrix
#

Skeleton or hoppers exist.
Or you can write 5 lines of code and fire an arrow at yourself from the front when you right click

gleaming yarrow
#

if it doesn't work I can always just raycast and see if the result is an arrow ig

#

that should be close enough in most scenarios

lost matrix
#

Yep that would be my first idea as well

upbeat hornet
#

how do we add custom (and persistent) item data again?

#

I have this:

ItemStack itemStack = player.getItemInHand();

I want to add a custom tag to the item

chrome beacon
#

?pdc

upbeat hornet
#

i'm in 1.8.8 :/

chrome beacon
#

You'll need nms then

hazy parrot
#

is there no super reaction anymore ?

upbeat hornet
#

you only get a few per month with nitro or need to pay for extra

#

Also uhm doesn't look like I have NMS installed

alpine otter
#

maybe is not the right server but this is getting me dumb sh [22:57:52 INFO]: [LiquidREST] Enabling LiquidREST v0.1.0 [22:57:52 INFO]: Enabled LiquidREST [22:57:52 WARN]: 2023-11-27 22:57:52.887:INFO::Thread-97: Logging initialized @208903ms to org.eclipse.jetty.util.log.StdErrLog [22:57:52 WARN]: Exception in thread "Thread-97" java.lang.NoSuchMethodError: 'javax.servlet.SessionCookieConfig spark.embeddedserver.jetty.JettyHandler.getSessionCookieConfig()' [22:57:52 WARN]: at spark.embeddedserver.jetty.EmbeddedJettyFactory.create(EmbeddedJettyFactory.java:52) [22:57:52 WARN]: at spark.embeddedserver.EmbeddedServers.create(EmbeddedServers.java:80) [22:57:52 WARN]: at spark.Service.lambda$init$2(Service.java:624) [22:57:52 WARN]: at java.base/java.lang.Thread.run(Thread.java:829)

build.gradle -> https://paste.md-5.net/yicesapami.bash

quaint mantle
#

import net.*;

#

How can I make this thread safe:

I have a database that stores Polls. You can retrieve and save a Poll object.

Scenario: Two users vote at the same time on different threads. Both threads get the Poll from the database, and increment the poll by one vote. Then they both save the poll back to the database.
once a poll is saved it may only increment by one, even though two users voted due to thread safety

#

I was recommended to have a method like

#

PollManager#upvotePoll(String pollID);

#

but what should I do if I have a different object with a bunch of fields to change

hazy parrot
#

mysql should have locks by default

#

have you tested that behaviour ?

upbeat hornet
#

nms isn't installed...

quaint mantle
#

well im working in the abstract

molten hearth
#

is there any sane util to copy a resource folder and not a single file

quaint mantle
#

and also

hazy parrot
#

mysql should have locks by default

#

and any database that is used

molten hearth
#

this shi doesnt seem like a folder to me ngl

quaint mantle
#

what about files

molten hearth
#

or do i need to do the funny ZipInputStream

quaint mantle
#

idk if that matters tho

both threads:
get the Poll (assume 5 votes)

both threads read 5 votes, and increment it to 6 votes

both threads save the poll at 6 votes instead of it being 7 votes

molten hearth
#

2 people asked this and all got ignored sheesh

glossy venture
molten hearth
#

from resources

glossy venture
#

lmao

#

thats aids

molten hearth
#

i think it is too

upbeat hornet
young knoll
#

?nms

brazen tartan
#

is there a way to set the info for an Arrow before spawning it?

deep herald
#

anyone know how to do this?

river oracle
#

in the consumer set the info that you need before it spawns

brazen tartan
#

cool

echo basalt
#

Class<T> Consumer<T>

worldly ingot
#

Yes, but same idea lol

young knoll
#

Spawn a virtual arrow, edit that, and then add it to world

river oracle
deep herald
weak meteor
#

is there a way i can have 2 folders opened on vscode? Local and SSH?

young knoll
#

I would just do YamlConfiguration.loadConfiguration(file)

echo basalt
#

sounds like bungee

ivory sleet
#

isnt that bungee

#

yea

young knoll
#

Ah

echo basalt
#

prob ij fucking imports for the 19th time

deep herald
#

what abt that

weak meteor
#

idk people says that intellij imports wrong stuff

#

but

#

i never got that problem

brazen tartan
#

byond me

weak meteor
echo basalt
#

you need to code more

weak meteor
#

also tht

deep herald
weak meteor
#

yea

#

ConfigurationProvider doesnt exist

young knoll
#

I thought this was bungee

#

Those are all bukkit imports

deep herald
#

ik

#

im using the same config system for bukkit

young knoll
#

Do you have the bungee api as a dependency

deep herald
#

no

#

im just trying to make a config for bukkit

young knoll
#

Ah

young knoll
deep herald
echo basalt
#

that's how bungee loads configs

#

not spig

deep herald
#

how do i save in spigot

echo basalt
#

FileConfiguration#save

deep herald
#

thats not a thing

young knoll
#

I assure you it is

brazen tartan
young knoll
#

Notice the #, it’s not a static method

eternal oxide
brazen tartan
#

it says you need a location parameter to do the createEntity method

young knoll
#

Yes

#

The location doesn’t really matter, but I would make sure it’s in a loaded chunk

deep herald
young knoll
#

If you want to keep it around for a long time, I would advise converting it to a template after you make your changes

brazen tartan
eternal oxide
young knoll
#

Then yeah, create a virtual entity, edit it, and covert it to a template

eternal oxide
#

Plugin#getConfig()

brazen tartan
young knoll
#

Ah right template is the name in my brain :p

#

EntitySnapshot

deep herald
#

do i need to do that or can i do it in the file?

young knoll
#

Do it in the file

#

Defaults are kinda weird

deep herald
#

ok

young knoll
#

Then just do saveDefaultConfig in your onEnable

gleaming yarrow
#

so raycasting ig

deep herald
#

does anyone know if links will parse automatically?

upbeat hornet
# young knoll ?nms

fixed my issue from changing this:

<dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot-api</artifactId>
            <version>1.8.8-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>

to this:

<dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot</artifactId>
            <version>1.8.8-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>
#

removing the "api"

young shell
#

Respawn anchors only work in the nether, right?

upbeat hornet
#

right

river oracle
#

I think... It is possible that there is a bug within my program

remote swallow
#

thats a lot of miles

#

we only need 1

slender elbow
#

speak for yourself

umbral ridge
#

hey

remote swallow
umbral ridge
#

how do you hide itemstack attributes again? with attribute modifiers? I don't know 1.20.2 stuff since a lot has changed

#

attributes such as enchantments, etc..

remote swallow
river oracle
#

we don't need any more

quaint mantle
#

Guys I need a hand how can I add multiple lines of text to an armorstand? because it doesn't work if I go over putting

armorstand#setcustomname(text + "\n" + newLine);

The entity practically doesn't spawn at all, but it doesn't give errors

lethal coral
#

Or use display entities

remote swallow
quaint mantle
#

Ok thanks

young knoll
twin venture
#

[ERROR] Failed to execute goal on project core: Could not resolve dependencies for project org.skywars:core🫙1.0-SNAPSHOT: org.skywars:api🫙1.0-SNAPSHOT was not found in https://hub.spigotmc.org/nexus/content/repositories/snapshots/ during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of spigotmc-repo has elapsed or updates are forced -> [Help 1]
[ERROR]

how i can fix this ? :-:

weak meteor
#

You need to put the repo

#

Or check it

twin venture
#

:0

umbral ridge
#

hey how do you retrieve a friendly material name?

eg. for Material.GRASS_BLOCK,

retrieve Grass Block, and so on

#

Is there a function that already does that or do I have to manually replace "_" and so on

rough blaze
#

how could I go about making ghast fireballs break cobblestone, this is what I have so far

@EventHandler
public void onEntityExplode(EntityExplodeEvent event) {
    Entity entity = event.getEntity();

    if (entity instanceof Fireball) {
        for (Block block : event.blockList()) {
            Material blockMaterial = block.getType();
            if (blockMaterial == Material.COBBLESTONE | |
                    blockMaterial == Material.DEEPSLATE | |
                    blockMaterial == Material.STONE ||
                    blockMaterial == Material.COBBLED_DEEPSLATE) {
                block.breakNaturally();
            }
        }
    }
}
quaint mantle
young knoll
#

How would it be voted on from 2 different threads

hazy parrot
#

even if its different server, im sure mysql will handle that just right

quaint mantle
hazy parrot
#

because there is lock mechanism, as i already said

quaint mantle
#

both threads:
get the Poll (assume 5 votes)

both threads read 5 votes, and increment it to 6 votes

both threads save the poll at 6 votes instead of it being 7 votes

remote swallow
#

well id say you just add a queue

wary harness
#

Is it possible to hide NoEffect on potion in GUI

#

I tried ItemFlag.HIDE_POTION_EFFECTS

#

but it is not working

quaint mantle
#

the only possible way rn I can think of is a method with like

#

Manager#upvotePoll

#

and a single thread executor

remote swallow
#

you add a method which adds it to a queue then you just run it as quick as you can

hazy parrot
#

there is really no need for that

quaint mantle
#

who you talking to

remote swallow
#

how ur managing to get multi threaded stuff for this one 1 server is the thing you should probably fix first

quaint mantle
#

bruh

#

ok

young knoll
#

You could just

quaint mantle
#

if this were to be the scenario, then how would you approach it

young knoll
#

Keep the poll in memory with an atomic int

quaint mantle
#

yeah but then

#

ima have to deal with like

#

player stats

#

or should i keep them in memory too

young knoll
#

Generally yes

#

You want to cache things

quaint mantle
torn badge
#

What exactly are you trying to do

quaint mantle
#

and make sure it is thread safe

#

like multiple threads can edit values from one database

upbeat hornet
remote swallow
#

Not hard just make a core module a 1.8 to 1.13 modules then a module for 1.14 and higher using pdc

upbeat hornet
#

is it possible to make a single JAR?

#

or would it need to be 3 different?

grand flint
#

lmao what

#

its one single jar

#

search up a ytbe tutorial on how to make a plugin for multiple versions

upbeat hornet
#

but in the maven, what version of spigot do I import?

grand flint
#

probs the lowest version u wanna go for

#

idk tbh

river oracle
upbeat hornet
#

I use NMS

#

to replace PDC

river oracle
#

then just use NBT API

grand flint
#

im making paradise

#

remake nbt api

#

but more modern

#

😄

river oracle
#

NBT API is pretty much uneeded in newer versions though

grand flint
#

why

river oracle
#

PDC pretty much invalidates it

grand flint
#

oh wtf lmao @molten hearth L

#

bro was gonna remake it all

river oracle
#

I mean when you do use NBT you should just put it to where PDC goes with modern versions

#

which is pretty easy to do since Bukkit Source is public

grand flint
#

we forking folia :(

river oracle
#

ahhh I forgot your a troll

#

the pfp change threw me off

grand flint
#

how am i

#

trolling

upbeat hornet
upbeat hornet
grand flint
#

idk dont ask me

#

best plugin i made is a chat plugin

upbeat hornet
#

sorry bro

#

I usually make mods but I took that plugin request cuz it's easy

river oracle
#

not NMS

#

you can look at CraftBukkits code and see where they put PDC

#

?pdc

river oracle
#

oops ignore above

#

?stash

undone axleBOT
river oracle
lament slate
#

Hey ik this is a dumb question thats probably been asked millions of times by where do I get the version of spoigot for my Pom.xml file

upbeat hornet
#
    <dependencies>
        <dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot</artifactId>
            <version>1.8.8-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>
lament slate
#

Ik that but I have to but in the version manually

#

<version>1.8.8-R0.1-SNAPSHOT</version>

upbeat hornet
#

aghh there's a archive for each of them

lament slate
#

Thanks!

#

Thats what i was looking for

upbeat hornet
#

this one is for 1.8.8

lament slate
#

Ill go until i find 1.9.4 thanks

upbeat hornet
#

Go in "History" and find the right post

lament slate
#

Alrighty will do!

#

Ok how do I replace a external library on maven-

I want to change my 1.20.2 plugin into a 1.19.4 plguin (Note this is a very basic plugin that just makes a command run nothing complicated or different)

would it be easier to change the external libraries to downport it or just copy and paste all the new files and code?

river oracle
lament slate
#

Not replaceing a entire maven thing

#

IntelliJ wont let me delete and add the external libraries for some reason

#

with eclipse ide I could just cpoy and paste libraries but for intelliJ it doeesnt seem so

#

nv I figured it out thanks!

grand flint
#

nw i got u 😄

lament slate
#

OK i did a bootleg version of just copying everythign and pasting it with the new libraries XD

#

in thet main class that I had

#

If you guys have any idea of maybe how to do that better then tell me id love new ideas

upbeat hornet
river oracle
#

error is pretty self explanatory

ItemStack can't be null/air/amount of 0
#

the item is air or null

#

or the amount is 0

upbeat hornet
#

I'm holding a netherite sword

#

So I'm guessing the error is coming from that

river oracle
#

does it error on a diamond sword?

upbeat hornet
#

works on any other item from 1.8.9

upbeat hornet
#

can try in 1.20

#

also this in logs early on:

[22:08:52] [Server thread/WARN]: Legacy plugin ItemKeeper v1.0 does not specify an api-version.```
river oracle
#

yeah thats fine if your plugin is on legacy API

#

what versions are you trying to support

upbeat hornet
#

1.8-1.20

river oracle
#

do you use 1.8 yourself?

upbeat hornet
#

works fine on other swords

upbeat hornet
river oracle
#

rough thne

upbeat hornet
#

base is 1.8, trying to allow 1.20 to use

#

would the opposite be easier?

river oracle
#

no

#

it'll be aids either way what you're doing rn is as easy as it gets

upbeat hornet
#

also I gtg off my pc so is there anything else I should test rn?

river oracle
#

still break with netherite?

upbeat hornet
#

tested those two items as well

#

breaks

#

so it really is newer items

river oracle
#

must be something with the material conversion though it should work

#

so I'm not sure why

upbeat hornet
#

same error: ItemStack can't be null/air/amount of 0! This is not a NBTAPI bug!

#

ill investigate more tommorrow

river oracle
#

what are you using to get the new ItemStacks

upbeat hornet
#

creative tab

river oracle
#

I meant in code

#

to edit them with NBT

#

just the base ItemStack?

upbeat hornet
#

player.gethelditem

#

something like that

river oracle
#

hm weird

#

I chalk it up to 1.8 jank

upbeat hornet
ashen quest
#

public final class GlidePlugin extends JavaPlugin implements Listener {

    public ArrayList<Player> players;

    @Override
    public void onEnable() {
        players = new ArrayList<>();
        getServer().getPluginManager().registerEvents(this, this);
    }

    @EventHandler
    public void onJumpTwice(PlayerToggleFlightEvent event) {
        System.out.println(players);
        Player player = event.getPlayer();
        if(players.contains(player)) {
            player.setGliding(false);
            player.setAllowFlight(false);
            players.remove(player);
            return;
        }
        player.setGliding(true);
        player.setAllowFlight(true);
        players.add(player);
    }

    @EventHandler
    public void onGlideCancel(EntityToggleGlideEvent event) {
        if(players.contains((Player) event.getEntity())) event.setCancelled(true);
    }
}

events not getting called

river oracle
ashen quest
#

well it should print the players arrray atleast

river oracle
#

is your plugin being enabled?

ashen quest
#

indeed

river oracle
#

are you actually Triggering the event

quaint mantle
ashen quest
#

ahh

#

the event is only triggered when you are in creative

#

how would i detect it in survival then?

vast ledge
ashen quest
#

ahh

ashen quest
#

how do i make a player be able to glide and shit without a elytra (i dont want players to see elytra dats it)

drowsy helm
#

Pretty sure you can make it so other players cant see the elytra

#

But initiating the gliding is clientside and requires the player to have it in their inventory

ashen quest
#

i can call setGliding that makes them glide ive tested

#

but dunno how to make it invisible

#

since i also want them to be ale to wear chestplates

molten hearth
#

does bukkit not have a harp instrument

alpine otter
#

any reasons why the plug-in is working fine without errors o. local machine and on vps host it throws an error

#

happened with every package i used

lost matrix
#

Send the exception

alpine otter
#

but maybe is some other plugins, i’ll test

lost matrix
alpine otter
#

so the relocations are useless

lost matrix
#

Because you are not using them correctly 🙂

alpine otter
#

how should i use them?

#

i’m trying to learn

lost matrix
#

You cant relocate a dependency, only a package.
There is also no need to relocate everything.

alpine otter
lost matrix
#

If you shade a dependency, and someone else has the same dependency but with a different version, then you should relocate.
You have a bunch of relocations which arent even dependencies of your project. That wont work either.

#

"implementation" dependencies will get shaded into your jar.
You can find the package of them and relocate their path to another.
This way the classloader doesnt have the same path+class when two plugins load with
the same dependencies.

alpine otter
#

oh okay

#

understood, thanks

short pilot
#

What would be the best way to implement a factions health block?

Basically it'll function like a bedwars bed but for a faction, and each hit from an enemg will deduct its health

#

Would you need to store this in chunk data itself to check when the egg was hit and which faction it belongs to

#

I can't wrap my head around it

lost matrix
#

There are multiple ways of handling this. Does 'hit' mean when someone breaks the block?

#

Is this a minigame or are factions always loaded?

#

@short pilot ?

ashen quest
rotund ravine
#

Wtf

#

You can modify the packet or send a new one to update their equipment from other players.

ashen quest
#

well wouldnt that make their chestplates gone??

rotund ravine
#

They wouldn’t have one if they have an elytra

ashen quest
#

exactly

#

i wanna make em glyde

#

without an elytra

#

it works without elytra i know for sure

I did it today, but the event that initiates it only gets called when in creative (EntityToggleFlightEvent)

rotund ravine
#

Just allow the player to fly in survival

ashen quest
#
@EventHandler
    public void onJumpTwice(PlayerToggleFlightEvent event) {
        Player player = event.getPlayer();
        player.setFlying(false);
        player.setGliding(true);
        players.add(player);
    }

    @EventHandler
    public void onPlayerTrySneak(PlayerToggleSneakEvent event) {
        Player player = event.getPlayer();
        if(players.contains(player)) {
            player.setGliding(false);
            players.remove(player);
        }
    }

    @EventHandler
    public void onGlideCancel(EntityToggleGlideEvent event) {
        if(players.contains((Player) event.getEntity())) event.setCancelled(true);
    }
ashen quest
rough drift
#

use UUIDs

rotund ravine
#

Stop misunderstanding me sigh

#

?jd-s

undone axleBOT
ashen quest
ashen quest
quaint mantle
#

hey

#

ob

#

arent u the guy who made a poc pymem for linux?>

rotund ravine
#

Then they will trigger the event when they try to fly

kindred sentinel
#

Can someone tell me how to work with placeholders?

rough drift
#

like PAPI placeholders?

kindred sentinel
#

Yeah

ashen quest
rotund ravine
ashen quest
rotund ravine
quaint mantle
#

ur pfp and name r similar so i was js askin

ashen quest
#

yea

ashen quest
whole lintel
#

is Spring useful to learn?

ashen quest
#

by flying i mean like creative double space

ashen quest
rotund ravine
ashen quest
#

thanks

#

you definitely have large balls

rotund ravine
#

Thank you

whole lintel
ashen quest
#

indeed then

rotund ravine
#

I would instead look at what positions you can get and what their requirements are.

#

Then start learning things they need

whole lintel
#

I'm not necessarily looking to get a position

#

I just want to be good enough for most

rotund ravine
#

Get a CS degree then

whole lintel
rotund ravine
twin venture
#

Hello there

#

iam getting an error while connecting to jedis : the information are correct , i checked the ubuntu server i have its the same information

#

Error while validating pooled Jedis object.
me.dev.mskywars.jedis.exceptions.JedisDataException: NOAUTH Authentication required.

#

i tried to login to jedis server and i put the password it correct , but the plugin can't seems to be able to connect

upbeat hornet
smoky oak
# twin venture

not relevant to your question but please dont put any auth stuff into source code - put it in a config setup separately!

subtle folio
twin venture
subtle folio
twin venture
#

i didn't change the code

upbeat hornet
#

If I want my plugin to work from 1.8 to 1.20, what should I change?
The main thing is:
-> I want to use PDC when possible
-> I want to make sure newer blocks and items are taken into account and won't crash anything.

  1. How should my pom.xml look like? Should it use spigot 1.8 or 1.20 api?
  2. If I use 1.8, how can I make sure newer blocks/items/materials will work?
  3. How do I make a switch in the code to detect above and below 1.14 to use pdc or not?
twin venture
#

You could use Xseries library

young knoll
#

If you want to support that low use 1.13 as API version

icy beacon
#

Yep, I use this

  private fun ensureVersion(minimum: Int, block: () -> Unit) {
    val numericalVersion = Bukkit.getBukkitVersion() // e.g. 1.19.3-R0.1-SNAPSHOT or 1.19-R0.1-SNAPSHOT
      .split(".")[1] // e.g. ["1", "19", "3-R0.1-SNAPSHOT"] -> "19" or ["1", "19-R0", "1-SNAPSHOT"] -> "19-R0"
      .split("-")[0] // e.g. ["19"] -> "19" or ["19", "R0"] -> "19"
      .toInt() // e.g. "19" -> 19
    if (numericalVersion < minimum) {
      block.invoke()
    }
  }
#

Very very handy

eternal oxide
#

if I'm needing a version I usejava public static final String BUKKIT_VERSION = Bukkit.getServer().getBukkitVersion().substring(0, Bukkit.getServer().getBukkitVersion().indexOf('-'));Else I just check the method exists before using it.

upbeat hornet
eternal oxide
#

it was in 1.13 in a basic version

#

1.14 is the better

upbeat hornet
#

Ok as long as I can store booleans thats fine

young knoll
#

You'd have to use byte

#

The boolean type is new

#

Also the early 1.13 PDC is not compatible with the new PDC

flint rune
#

can i change entity's facing with vector3?

upbeat hornet
#

Maybe I should simply store it in nbt...

flint rune
rough drift
#

inventory.getViewers().forEach(HumanEntity::closeInventory); This seems to throw a CME, I really don't know how I would close the inventory for every viewer otherwise, can anyone give me a hand

young knoll
#

Clone the collection

#

Also if you are doing this in an inventory even make sure to delay 1 tick

rough drift
#

Alright thanks coll :D

#

new ArrayList<>(inventory.getViewers()).forEach(HumanEntity::closeInventory); bop

#

or I could use an iterator?

young knoll
#

maybe

#

But I think that will still cme

rough drift
#

fair

#

this is also not ran often

#

so yk what

proud badge
#

uhh how could I do this?

young knoll
#

@EventHandler(priority = EventPriority.HIGHEST)

ashen quest
#

it is what u call an Annotation

proud badge
#

Actually wait I just realised my event requires the lowest priority. Because my issue is that it thinks that the event isnt cancelled from another plugin
I assume its EventPriority.LOWEST then?

worldly ingot
#

Lowest is called first, highest* is called last

proud badge
#

what would I make the "priority"

young knoll
#

priority

#

I just can't spell

proud badge
#

oh

#

ok thanks

#
io.papermc.paper:paper-api:1.20.1-R0.1-SNAPSHOT/maven-metadata.xml failed to transfer from https://oss.sonatype.org/content/groups/public/ during a previous attempt. This failure was cached in the local repository and resolution will not be reattempted until the update interval of sonatype has elapsed or updates are forced. Original error: Could not transfer metadata io.papermc.paper:paper-api:1.20.1-R0.1-SNAPSHOT/maven-metadata.xml from/to sonatype (https://oss.sonatype.org/content/groups/public/): status code: 502, reason phrase: Bad Gateway (502)```
eternal oxide
#

paper

proud badge
#

?

eternal oxide
#

?fork

undone axleBOT
#

SpigotMC maintains the Spigot server. If you are using a fork of Spigot (such as Paper, Airplane, Purpur, or other derivative works), you should seek support in the appropriate Discord servers.

proud badge
#

Ok

heavy swan
ashen quest
#

I am, going to, use Thread.sleep() for a 10 second delay in my code. Surely it cant be that bad?? 😏

remote swallow
#

On the main thread it will

green plaza
#

Am i tripping or spigot does not have BossBar packet? (1.17)

ashen quest
slender elbow
#

why'd you use packets for boss bars

ashen quest
#

i shall increase the delay

young knoll
#

Why would spigot have packets for anything

#

Packets aren't api

ashen quest
#

How shall I get a tag

#

a scoreboard tag

#

I just know its name (Flyer)

green plaza
#

And i would prefer to do it on my own

slender elbow
#

the bossbar api is pretty complete

young knoll
#

There isn't really much to bossbars

#

Color, fill amount, segements

#

name

#

bout it

ashen quest
young knoll
#

Use contains on getScoreboardTags?

#

Or avoid scoreboard tags and use PDC

ashen quest
#

man i m doing it for someone else and they have another plugin give them the tag

#

so yea

young knoll
#

rip

ashen quest
young knoll
#

Then yeah just use contains

green plaza
# slender elbow the bossbar api is pretty complete

Let's imagine you have 600 players on the server and for every one of them you need to create specific bossbar with only one player because you want to send some personal info. So you need 600 BossBar objects in list, iterate through this list every time someone leaves the server and iterate it all every time you want to update it for one player or everyone

young knoll
green plaza
#

Seems like a good way to handle it

ashen quest
#

1.20.2

young knoll
#

In latest getScoreboardTags is a Set<String>

ashen quest
#

oh

slender elbow
#

i.e. a map

young knoll
#

Yay maps

ashen quest
#

Col1234567 you are a legend

slender elbow
#

Col1234567 > Coll1234567

#

facts

ashen quest
ashen quest
green plaza
#

It might be map but still you are 24/7 holding 600 objects where you can do that in much more efficient way

young knoll
#

Like?

slender elbow
#

do you know how much memory that is

young knoll
#

What are you going to hold instead?

slender elbow
#

600 bossbars is, like... less than a MB probably

#

or, at worse, around

young knoll
#

I imagine they don't have much data

#

lessee

slender elbow
#

no yeah it is definitely far far less than a MB lol

dry hazel
#

🤓

rotund ravine
#

You can just do File IOs instead of storing objects 👀

young knoll
#

a map*

whole lintel
#

Why a map

slender elbow
#

i mean if you're doing one bar per player a map player -> bar is ideal

whole lintel
#

Ah, he wants to store a bossbar for each player

young knoll
#
private final UUID id;
public Component name;
protected float progress;
public BossEvent.BossBarColor color;
public BossEvent.BossBarOverlay overlay;
protected boolean darkenScreen;
protected boolean playBossMusic;
protected boolean createWorldFog;
private final Set<ServerPlayer> players = Sets.newHashSet();
private final Set<ServerPlayer> unmodifiablePlayers = Collections.unmodifiableSet(this.players);
public boolean visible = true;
#

That's all it holds

slender elbow
#

not much at all

#

the component is the worst one probably if you're doing rainbows n shit

green plaza
#

Great for you so is there a BossBar packet in spigot or not?

young knoll
#

No

#

Spigot doesn't have packets

slender elbow
#

but even then you need several thousands for it to be impactful

rotund ravine
#

Why do you want packets

slender elbow
#

just use the api lol

green plaza
young knoll
#

Bukkit also does not have packets

rotund ravine
#

Emily, is there a get a million dollars packet in paper?

slender elbow
#

there is!

rotund ravine
#

OMG

slender elbow
#

it doesn't affect the server tho

rotund ravine
#

Oh, that's sad.

young knoll
#

Everything in the API is api

#

Some of it is basically just sending a packet, but that's an implementation detail

rotund ravine
#

I am eating white chocolate popcorn, amercians are weird.

#

Never thought popcorn had flavours

slender elbow
#

wtf

rotund ravine
#

quite tasty tbh

young knoll
#

I just noticed Jan is purple

ashen quest
#

does Player#setFlying remove their ability to get fall damage?

young knoll
#

yes

ashen quest
#

Well how would you counter that

young knoll
#

you want flying players to take fall damage?

ashen quest
#

indeed

#

atleast when they fall

#

nvm i dont

junior pewter
#

could anyone please help me with that i can't import javaplugin? plugin version 1.20.1, using eclipse workspace, project Java 17 version, spigot 1.20.1 build path imported

rotund ravine
#

Skill issue.

#

Tried using maven or gradle? They make it much easier and it's nice to start up with using a build tool straight from the getgo

junior pewter
#

what is maven?

rotund ravine
#

Look it up, most spigot guides actually use it.

subtle folio
#

eclipse EE

ashen quest
#

So since a player in creative, is able to BOTH FLY & GLIDE depending on the context, how would someone track if they want to glide or fly

#

when they want to fly they quicly press jump twice, when they want to go elytra mode, they either have a small delay between 2 jump presses or press jump when falling once

young knoll
#

There is events for toggling both

ashen quest
#

ah'

#

damn

#

but the Glide Event is only called when player has an elytra, how could i make it trigger when they dont have an elytra

ashen quest
young knoll
#

I believe the client needs to have it in order for the event to fire

quiet ice
#

Uh, what is the correct way to have a multi-java-version gradle setup (for MRJs) without causing gradle to use a ridiculous amount of resources?

ashen quest
quiet ice
#

I really ought to write my own build tool from scratch one of these days

ashen quest
#

milfs mihds: man i hate gradle sometimes

quiet ice
#

Maven unfortunately is not an option (the architecture simply doesn't give it away for my usecase), and other build tools likely have to be forked and a lot of investment has to be put into them to make them viable.

subtle folio
#

iirc the client won’t send another jump packet if they’re mid air

ashen quest
#

how do these double jump plugins work then

echo basalt
#

setAllowFlight

#

setFlying

#

setVelocity

#

setAllowFlight

subtle folio
#

you can check the players velocity

ashen quest
#

won the velocity while falling just be 0, -g, 0

#

nvm thats acceleration

rotund ravine
ashen quest
#

see, heres what i m trying to achieve

the player, (survival mode) has the ability to both fly like creative, and glide like an elytra

but i dont want them to see the elytras

rotund ravine
#

Is this a hub server?

#

You could have an item that toggle between gliding and flying

subtle folio
rotund ravine
#

He is already using the flight event

#

Sadly he wants to do both gliding and flying.

#

Which is kinda 👀

#

@ashen quest I suppose you can check locations and if they're falling set them to gliding instead of using the toggle flight event

subtle folio
#

why not have an item to toggle between the two? or like a double shift mode

#

so many ways to restructure this

ashen quest
rotund ravine
#

Could make a custom item that takes some interesting stuff

ashen quest
#

let me ask the client

#

if it was my own plugin id have deleted it by now

rotund ravine
#

Unless they want a modded client with a toggle.

wet breach
rotund ravine
subtle folio
#

texture packs?

rotund ravine
#

client would need to initiate the gliding and it doesn't do that unless it has an elytra.

wet breach
rotund ravine
#

The client as i said again

#

needs to know it has an elytra

#

to initiate the gliding.

#

also he wants breastplates

#

i think he said earlier?

wet breach
#

in that case, just use a custom texture for the elytra

ashen quest
#

i do not need chestplates now

rotund ravine
#

Do they choose flight with a command?

ashen quest
#

but texture pack isnt possible for me in this case

ashen quest
pseudo hazel
#

should be an item then

wet breach
ashen quest
#

u cant be typing /flymode set glide while someones coming at you 50kmph with a mystirous wing in a block game (BOOM)

ashen quest
wet breach
#

do you forget gaming keyboards exist where you can setup macros and gaming mouses that do the same?

rotund ravine
#

and be quite fun when used correctly

ashen quest
#

frostalf, you are the wizard of minecraft as i try to explain in the shortest of words, not everyone is capable of achieving the level of pro-ness you have your majesty

ashen quest
wet breach
#

its not that I am pro lmao, its just I have a gaming keyboard and mouse that lets me setup stuff that is real handy in games