#help-development

1 messages · Page 1045 of 1

young knoll
#

There’s PlayerBucketEmptyEvent

summer scroll
#

Oh didn't know that, that's nice.

exotic obsidian
#

i tried this

#

@EventHandler
public void onBucketEmpty(PlayerBucketEmptyEvent event) {
org.bukkit.block.Block clickedBlock = event.getBlockClicked();

    if (event.getBucket() == Material.LAVA_BUCKET) {
        new BukkitRunnable() {
            @Override
            public void run() {
                if (clickedBlock.getType() == Material.LAVA) {
                    clickedBlock.setType(Material.AIR);
                }
            }
        }.runTaskLater(Main.getInstance(), 15 * 20);
    }
}
#

but it is not work with me

#

@summer scroll

#

@young knoll

worthy yarrow
#

tf am I looking at

#

What do you need a task for when placing lava on lava?

exotic obsidian
#

Logic error

summer scroll
#

In that event you can get the block and the block faces.

exotic obsidian
#

you mean this event.getBlockClicked().getRelative(event.getBlockFace() ?

summer scroll
#

The lava is not placed on the clicked block.

exotic obsidian
#

but i already try this now xd

#

but not work

#
                        event.getBlockClicked().getRelative(event.getBlockFace()).setType(Material.AIR);
                    }
summer scroll
#

You can format the code using in discord with this btw

#

put java too in the formatting

summer scroll
exotic obsidian
#
    @EventHandler
    public void onBucketEmpty(PlayerBucketEmptyEvent event) {
        if (event.getBucket() == Material.LAVA_BUCKET) {
            new BukkitRunnable() {
                @Override
                public void run() {
                    if (event.getBlockClicked().getRelative(event.getBlockFace()).getType() == Material.LAVA) {
                        event.getBlockClicked().getRelative(event.getBlockFace()).setType(Material.AIR);
                    }
                }
            }.runTaskLater(Main.getInstance(), 15 * 20);
        }
    }
exotic obsidian
summer scroll
#

You need to make sure if the task is even called.

exotic obsidian
#
    @EventHandler
    public void onBucketEmpty(PlayerBucketEmptyEvent event) {
        org.bukkit.block.Block block = event.getBlockClicked().getRelative(event.getBlockFace());
        if (event.getBucket() == Material.LAVA_BUCKET) {
            new BukkitRunnable() {
                @Override
                public void run() {
                    event.getPlayer().sendMessage("wlc");
                    if (block.getType() == Material.LAVA) {
                        block.setType(Material.AIR);
                        event.getPlayer().sendMessage("done!");
                    }
                }
            }.runTaskLater(Main.getInstance(), 15 * 20);
        }
    }

the first message was sended but the message that in if block doesn't sended.

#

@summer scroll

summer scroll
# exotic obsidian

That's nice, now you know that the task is called and running properly, now debug the material type of the block, so debug the Block#getType

exotic obsidian
#

yea

summer scroll
#

I think you might need to store the variable inside the task.

#

The block variable.

exotic obsidian
#

the problem come from gettype method

exotic obsidian
summer scroll
#

So on your code above, the block is before the lava is even placed, so it will be Air if I'm not wrong

exotic obsidian
#

nah

#

i tried to put the block variable inside the task but i got the same result

summer scroll
#

There is block, and blockClicked, I don't know what's the difference.

exotic obsidian
#

but when i remove the condition of getType the code is work

summer scroll
exotic obsidian
#

not says anything

#

but i tried to remove it

#

and try

#

and it is works

#
    @EventHandler
    public void onBucketEmpty(PlayerBucketEmptyEvent event) {
        org.bukkit.block.Block block = event.getBlockClicked().getRelative(event.getBlockFace());
        if (event.getBucket() == Material.LAVA_BUCKET) {
            new BukkitRunnable() {
                @Override
                public void run() {
                    block.setType(Material.AIR);
                    event.getPlayer().sendMessage("done!");
                }
            }.runTaskLater(Main.getInstance(), 15 * 20);
        }
    }
summer scroll
#

Like debug the block.getType() in the task.

#

But you need the variable block inside the task.

#

Because what you have here is not ideal, if player places something in the lava for example diamond block, it will be gone.

#

@exotic obsidian it's working fine on me, as long as you assign the variable inside the task.

exotic obsidian
#

can u send the code please?

#

i want to see how? @summer scroll

summer scroll
# exotic obsidian i want to see how? <@299801068450086912>
    @EventHandler()
    private void onBucketEmpty(PlayerBucketEmptyEvent event) {
        if (event.getBucket() != Material.LAVA_BUCKET) return;
        // Start the task to remove the lava
        Executor.syncLater(60L, () -> {
            Block block = event.getBlockClicked().getRelative(event.getBlockFace());
            // If the block is lava, remove it
            if (block.getType() == Material.LAVA) {
                block.setType(Material.AIR);
            }
        });
    }
exotic obsidian
#
            new BukkitRunnable() {
                @Override
                public void run() {
                    org.bukkit.block.Block block = event.getBlockClicked().getRelative(event.getBlockFace());
                    if(block.getType() == Material.LAVA) {
                    block.setType(Material.AIR);
                    event.getPlayer().sendMessage("done!");
                    }
                }
            }.runTaskLater(Main.getInstance(), 15 * 20);

@summer scroll i think there's a joke xd

summer scroll
exotic obsidian
#

i know but it is not works

summer scroll
exotic obsidian
#

wait i think i found the solution

summer scroll
#

What was it?

exotic obsidian
#

nah

#

i try to change the name of class because the name of class is the same as the block variable definition so i was thought there is confusing.

summer scroll
#

I mean it should work regardless right? lmao

exotic obsidian
#

yup

#

i want u to try something

#

the code ur sended above is works with me

#

when i changed the timer

#

in the beginning was 15s right? i tried to put it 3

#

and it is works

#

but when u try number above 3 it is not works u can try

#

@summer scroll

summer scroll
summer scroll
exotic obsidian
#

lol 😂

#

Np

#

Anyways thx for help me 🫡

wet breach
#

Make sure to help someone in the future

summer scroll
fervent void
#

Custom items coding and Add Custom Texturen help ?? Video ?

quaint mantle
#

is any devs here doing a project for free? im looking to build a dev team for my server yeah head dev is still open please dm me if anyone is interested

undone axleBOT
plucky rock
#

Does anyone know ow a way to check how long right click is held or smtn like that

#

Pls @ me In the response

green prism
#

Hi, I'm starting a petition to remove the debugging phase from the world. React with a + if you agree

blazing ocean
#

what debug phase

green prism
#

just think about a world without debugs

nova notch
#

what are you on about

twin venture
#

gm , still have the problem 😶

#

..

fervent void
#

Using blockbench with spigot ??

vast ledge
#

You asking that ironically?

#

or you want to know if its possible?

sleek estuary
#

getstate instanceof Wool not works why?

#

instanceof wool returns false

fervent void
#

how do I use blockbench with spigot

nova notch
#

You use one of the existing plugins (model engine mainly) or make your own

#

Actually model engine I think only works on paper? Might wanna double check that

blazing ocean
dense oracle
#

hey, i want to disable the ender dragon spawn
i just canceled the CreatureSpawnEvent
however, the bossbar still apears
is there a way to remove it?

blazing ocean
#

you can just use custom model datas

nova notch
#

Well they didn't specify what "blockbench" is

#

For just simple item models yes

sleek estuary
#

how i verifiy if main thread is blocked?

hazy parrot
#

What

#

Why do you need that

sleek estuary
# hazy parrot Why do you need that

I have a method that goes through many locations and I feel that the server "crashes" at that moment, so I assume that the thread is being blocked

short raptor
#

If I've got config file with format

data:
  somekey: 1
  otherkey: 2
  thirdkey: 3

How can I get a list of those second level keys? e.g. a list of somekey, otherkey, thirdkey. I don't need their values

sleek estuary
#

this method runs through 10x10x256 locations

hazy parrot
hazy parrot
short raptor
hazy parrot
sleek estuary
sleek estuary
#

now im testing with for interaction

blazing egret
#

hi guys, I'm trying to make a plugin for guards but something went wrong and they don't attack entities, I'm attaching the code below
https://pastebin.com/2TFm7uzP

sullen marlin
#

What debugging have you tried

blazing egret
#

me?

near mason
#

and bedrock entity model

sleek estuary
#

if i do this and the server crashes a few seconds later, and auto-save was not called, this line of code will have no effect. correct?

halcyon hemlock
#

oink oink

#

meow

#

woof

halcyon hemlock
twin venture
#

this code to create custom potion effects does not work :

#

but the item is not changing still same ..

#

THIS IS HOW IT LOOKS LIKE :

#

no lore , no potions , no enchantments(for weapons , armors , tools) is working ..

smoky anchor
#

Idk how your code looks, I do not remember doing anything with potions myself
But the PotionMeta seems sus, you might be replacing the previously modified ItemMeta with it ?

shadow night
#

Are you ever applying the meta

twin venture
#

yes

#

the name is changed to &eSloth Potion so the item meta is set successfully

#

i have been trying for 2 day's now

#

idk what's wrong

#

this is how it should looks like

#

in the config file

#

any help will be appricated ❤️

#

potions , lore , enchantments and also the amount seems to not working?

#

only name and material do work

smoky anchor
#

I would recommend just creating some random command to test if you can create an item normally, as a sanity check of a kind ig

twin venture
#

thanks

smoky anchor
# twin venture thanks

I would also check if you somehow modify the items in your list after creating them.
'cause I can't find anything wrong with your ItemCreator

sleek estuary
#

I did not say that

halcyon hemlock
#

;)

#

simple words: that piece of code should indeed not crash your server

twin venture
#

[11:23:17 INFO]: Potion Effect: SPEED Duration: 60 Amplifier: 2

smoky anchor
#

Try using that method to give a player those items isntead of whatever you're doing with them.

twin venture
#

it say that the potion effect is correct

#

oky

smoky anchor
#

To be sure the item is correctly created.

#

After the setItemMeta just print out the itemstack

twin venture
#

oky

#

to string

#

or only itemstack?

smoky anchor
#

Just itemstack is enough

#

I mean, the print method calls toString on its own if you pass an object.

twin venture
#

alr thanks

#

let me try

smoky anchor
#

Do keep me updated

twin venture
#

oh

#

it works

smoky anchor
#

So you're most likely modifying the items- what

twin venture
#

i don't think so

smoky anchor
#

You mean the whole thing works or.. ?

twin venture
#

it just not showing it here :

#

so when itry to remove it it open a menu

#

without lore , etc etc

#

when i give it to my self

#

it works

smoky anchor
#

Great, congratz on moving further with your problem :)

twin venture
#

thanks so much 🙂

#

brb gonna go eat now

smoky anchor
blazing egret
#

hi guys, I'm trying to make a plugin for guards but something went wrong and they don't attack entities, I'm attaching the code below
https://pastebin.com/kmYhjb3m

buoyant sonnet
#

can somoane help

#

i want to make my own custom reipe with custum in and output item

twin venture
smoky anchor
#

Yup~

#

For the next time just learn how to correctly debug.

coarse trail
#

hello, just wondering if anybody knows how to make java like chest ui, even tho bedrock users use pocket ui?
just like this.. ive been searching for a long time for this but seems like i cant find anything (edited)

smoky anchor
#
  1. eww loot boxes
  2. tell your users to switch the UI
  3. I'll be surprised if I see you getting any support here
echo basalt
smoky anchor
#

Tho I have to say, I like the centered text there

blazing ocean
#

yeah that looks good

coarse trail
echo basalt
#

the fuck is that supposed to mean

#

Bedrock forms are.. complex

#

You can, for example, use geyser's api to send a form, which is alright

#

But geyser only added API for like 10% of all functionality

coarse trail
echo basalt
#

If you want more than that you need to use Json-UI

#

And Json-UI is complex and not that many people know it

#

It does let you do things like these

blazing ocean
#

that can be easily done in java too

coarse trail
echo basalt
#

Yeah

coarse trail
#

i mean that form can be done to java too?

echo basalt
#

Java doesn't have forms

#

You'd need to have a regular menu on java and a custom form on bedrock

coarse trail
#

i guess i sould use cleshlike ui then on java while forms on bedrock

echo basalt
#

Up to you

coarse trail
#

even tho bedrock players use pocket,, the menu is still java-like chest ui

#

i wonder if it has any of the plugin but they said in the post the only use deluxemenu

blazing ocean
#

i mean on java p much everything is possible*

#

with resource packs

echo basalt
#

not everything though

#

bedrock allows for a lot more

#

but the scene is incredibly underdeveloped

blazing ocean
#

haven't played bedrock in ages

queen idol
#

why are buildtools creating a 1.20.1 jar when i select 1.20

blazing ocean
#

because it's practically the same

young knoll
#

1.20 was fully replaced

#

1.20.1 was like 2 bug fixes iirc

queen idol
#

i see, thanks

orchid iron
#

does anyone know how i can make a text display entity smaller and remove its background?

young knoll
#

Set the background color to something with 0 alpha

#

And use the scale part of the transformation

orchid iron
#

ty

kindred valley
#

?learnjava

undone axleBOT
#

For Beginners:

Codecademy - Learn Java: Interactive Java programming course from basics to more advanced concepts. Perfect for absolute beginners.
https://www.codecademy.com/learn/learn-java
JetBrains Academy - Java Developer Track: Learn by doing with projects and challenges. It covers Java fundamentals to advanced topics.
https://www.jetbrains.com/academy/
Udemy - Java Programming Masterclass for Software Developers: Updated courses that cover Java 8 to Java 17 features. Suitable for those who prefer structured learning.
https://www.udemy.com/course/java-the-complete-java-developer-course/

For Intermediate to Advanced Learners:

Oracle Java Tutorials: The official guides by Oracle for Java programming—great for understanding the depth of Java.
https://docs.oracle.com/javase/tutorial/
Baeldung - Learn Java and Spring: Focus on Spring Framework and modern Java technologies. Best for intermediate learners aiming to expand their knowledge.
https://www.baeldung.com/

Practice and Hands-on Learning:

Exercism - Java Track: Solve exercises and get feedback from mentors. Great for practicing coding skills.
https://exercism.io/tracks/java
LeetCode: Practice your coding skills and prepare for technical interviews with Java.
https://leetcode.com/

Free Resources and Documentation:

Java Programming and Documentation: A comprehensive collection of Java programming guides, tutorials, and API documentation.
https://docs.oracle.com/en/java/

Community and Support:

Stack Overflow: A vast community of developers. Great for getting help with specific problems or understanding concepts.
https://stackoverflow.com/questions/tagged/java
r/learnjava on Reddit: Join the community of Java learners and get advice, share resources, and discuss projects.
https://www.reddit.com/r/learnjava/

Remember: Learning to program takes practice and patience. Don't hesitate to experiment with code and participate in community discussions. Happy coding! 🎉

blazing ocean
#

?

slender elbow
#

¿

blazing ocean
#

¿?

small hawk
#

do u guys know how to solve this problemt java.lang.NullPointerException: Cannot invoke "net.minecraft.server.network.ServerGamePacketListenerImpl.latency()" because "player.connection" is null

happening here

                    ServerGamePacketListenerImpl packetListener = serverPlayer.connection;

                    packetListener.send(ClientboundPlayerInfoUpdatePacket.createSinglePlayerInitializing(npcPlayer, false));
                    packetListener.send(new ClientboundAddEntityPacket(npcPlayer, 0, blockPos));
sleek estuary
#

i need check 25000 locations if has a block on db. any alternative?

blazing ocean
#

add them to a list and do a contains check? idk what you expect here, that's a lot

vast ledge
blazing ocean
#

?xy btw

undone axleBOT
sleek estuary
#

cupboardarea have 25000 locations

vast ledge
#

epic command called ?paste

#

?paste

undone axleBOT
blazing ocean
#

^

vast ledge
#

please use that

#

its easier than screenshots

sleek estuary
#

and it seems to be blocking the main thread because when I undo it, at that very moment the server "crashes" for a few milliseconds

small hawk
sleek estuary
blazing ocean
sleek estuary
blazing ocean
#

not run it on the main thread

vast ledge
sleek estuary
blazing ocean
#

what

blazing ocean
#

not on an async thread

river oracle
#

You can't do any mutation asynchronously on another thread

sleek estuary
#

for no "crashes" the main thread

river oracle
blazing ocean
#

we literally just said it's not possible on an async thread..?

vast ledge
#

changing anything in the world, usually cant be done async afaik

sleek estuary
blazing ocean
#

ok?

vast ledge
#

that aint async

blazing ocean
#

that's not async

vast ledge
#

bukkit#runAsyncTaskLater()

#

is async

sleek estuary
vast ledge
#

or #runAsyncTask()

blazing ocean
#

?scheduling

undone axleBOT
river oracle
#

They really need work distro

#

Stop going on about useless shit for world mutation

sleek estuary
blazing ocean
#

you didn't understand how tasks work

river oracle
#

Can we just not ignore work distro thread please

#

It's clearly applicable here

sleek estuary
hazy parrot
#

?workdistro

hazy parrot
river oracle
#

I've sent this three times already 😭

sleek estuary
#

im seeing

slender elbow
#

hm?

#

must've been the wind

sleek estuary
river oracle
#

It's literally not kekw

#

It's a single thread

#

Distributing it's task over time

slender elbow
#

async != multithreaded

#

🙃

river oracle
#

It's asyncrhonous still because the tasks don't occur at the same time

slender elbow
#

yes

river oracle
#

Nump

slender elbow
#

just pointing out that async != multithreaded because they seem to believe that is the case

river oracle
slender elbow
#

i know

#

we are on the same page

#

i am not dismissing what you said lol

graceful patrol
#

hello, im updating 1.8.8 plugin to 1.20.1, it does not recognize "minecraft" library, I tried to remap spigot 1.20.1 jar, but does not work for some reason, can someone please help me?

blazing ocean
#

depend on spigot not spigot-api

graceful patrol
blazing ocean
#

what?

#

show your pom.xml

#

?paste

undone axleBOT
graceful patrol
blazing ocean
#

then gradle

#

your build.gradle(.kts)

graceful patrol
onyx fjord
#

looking for a fairly simple and tiny xml parsing library for java

#

with deserialization and whatnot

blazing ocean
graceful patrol
blazing ocean
#

@graceful patrol

#

since when is consumer bukkit 🤨

young knoll
#

It's deprecated

slender elbow
#

wasn't it deleted

young knoll
#

nop

slender elbow
#

that's dum

sleek estuary
#

what ths makes

onyx fjord
#

?

blazing ocean
#

import BB?

sleek estuary
blazing ocean
#

yeah? i don't get your problem

sleek estuary
blazing ocean
#

1.8 issue

#

make it yourself then

#

or just add it kekw

#

?stash

undone axleBOT
onyx fjord
#

dont use 1.8 api

blazing ocean
#

?1.8

undone axleBOT
sleek estuary
blazing ocean
#

add the compileOnly 'org.spigotmc:spigot:...', not spigot-api

sleek estuary
#

@blazing ocean max on this case, the coordinates are 10,0,0 and min the coordnates are 0,0,-10. right?

blazing ocean
#

🤷

#

should be

sleek estuary
blazing ocean
#

and you can just impl that yourself easily kekw

blazing ocean
#

?

#

it's like 6 lines lol

slender elbow
#

you can literally just go to current bukkit source and copy the class

sleek estuary
#

HOW AM I GOING TO IMPL IF I DON'T EVEN KNOW WHAT THAT CODE DOES?

blazing ocean
#

yeah lmao

blazing ocean
sleek estuary
#

I AM ASKING WHAT TO DO TO JUST IMPLEMENT MYSELF

blazing ocean
#

yeah i was just about to tell you

slender elbow
#

step 1 is to chill the fuck out

sleek estuary
sleek estuary
blazing ocean
#

just maxX = max(cornerA.getX(), cornerB.getX()) iirc

#

?stash

undone axleBOT
blazing ocean
sleek estuary
#

OK

#

thx

sleek estuary
#

maybe be this

blazing ocean
#

please for the love of god don't inline those

blazing ocean
#

?mappings btw

undone axleBOT
blazing ocean
#

?nms i meant

sleek estuary
blazing ocean
#

it's just ugly

sleek estuary
#

tastes are personal

graceful patrol
# blazing ocean remove those `includeGroup` and run buildtools again

`Total Time: 4 minutes 43 seconds

Success! Everything completed successfully. Copying final .jar files now.
Copying spigot-1.20.1-R0.1-SNAPSHOT-bootstrap.jar to C:\Users\user\Downloads\spigot-1.20.1.jar

  • Saved as .\spigot-1.20.1.jar`

its still the same tho (i opened intellij after it was comepleted)

shadow night
#

Replace the - in spigot-1.20.1 by a : in your buildscript

graceful patrol
#

?

blazing ocean
#

try

shadow night
#

the structure looks like this group-id:artifact-name:version:classifier

graceful patrol
torn shuttle
#

does anyone know if the spigot way of serializing/deserializing data also saves pdc contents?

#

sorry I mean specifically for itemstacks

#

I was using base64 but people were asking me to switch

shadow night
buoyant sonnet
#

how can i send my code for help

shadow night
undone axleBOT
eternal night
torn shuttle
#

so it should preserve all data like base64 does right

blazing ocean
#

omg this is so fun

eternal night
#

well idk how you create the b64

blazing ocean
#

wrong channel

torn shuttle
#

I'm talking about itemstack.serialize and then itemstack.deserialize

eternal night
#

Well yea, but that method is used both for MemorySection#set and for BukkitObjectOuputStream

buoyant sonnet
torn shuttle
#

alright I just needed to make sure it preserved everything because the whole point is to save items modified by other plugins so they're frequently loaded up with pdc data, thanks

eternal night
#

👍 (|| required disclaimer that bukkits item stack storage stuff is less than idea and is known to break on version upgrades|| )

buoyant sonnet
#

if i use any give cmnd but then i get in chat the command peinted

young knoll
#

Does our itemstack serialization include a version now

#

And run through DFU

buoyant sonnet
#

what

graceful patrol
#

i have this in my class:
import net.minecraft.server.IChatBaseComponent; import net.minecraft.server.PacketPlayOutChat;

why does it say "Cannot resolve symbol 'PacketPlayOutChat'"?

blazing ocean
#

?mappings

undone axleBOT
blazing ocean
#

PacketPlayOutChat is spigot-mapped, but you have mojang mappings

icy beacon
hot reef
#

hi, how can i use getConfig() to save data?

vast ledge
#

oh remapeed

#

remapped**

kindred valley
#

?paste

undone axleBOT
kindred valley
#

?paste

undone axleBOT
blazing ocean
#

???

#

¿¿¿

hot reef
#

lmfaoo

tranquil glen
#

hey guys, i was looking for some advice on some good practice

i have some location data that i want to story in a yml file, sort of like homes
should i load it into a map so it's in ram? or should i read directly from the file when i need to access it?

young knoll
#

YamlConfiguration already loads it into a map

#

But there's no reason not to have your own map as well

tranquil glen
#

okay, ill research YamlConfiguration

#

haven't really done much with serialization yet

#

good learning opportunity

torn shuttle
#

hm am I doing this wrong somehow? never tried to do it via spigot before (ignore the method names I'm in the middle of changing it)

    public static Map<String, Object> toBase64(ItemStack itemStack) throws IllegalStateException {
        return itemStack.serialize();
    }

    public static ItemStack itemStackArrayFromBase64(String data) {
        try {
            YamlConfiguration yaml = new YamlConfiguration();
            yaml.loadFromString(data);
            return yaml.getItemStack("");
        } catch (InvalidConfigurationException e) {
            throw new RuntimeException(e);
        }
    }
#
[16:35:13] [Server thread/WARN]: java.lang.RuntimeException: org.bukkit.configuration.InvalidConfigurationException: while parsing a flow mapping
[16:35:13] [Server thread/WARN]:  in 'reader', line 1, column 48:
[16:35:13] [Server thread/WARN]:      ... RON_CHESTPLATE, meta=ARMOR_META:{meta-type=ARMOR, lore=[{"text": ... 
#

definitely not happy

#

oh is it because it doesn't like the way it's a string? probably is isn't it

spice burrow
#

this is what i use


  public static ItemStack itemStackFromBase64(String data) throws IOException {
    try {
      ByteArrayInputStream inputStream = new ByteArrayInputStream(Base64Coder.decodeLines(data));
      BukkitObjectInputStream dataInput = new BukkitObjectInputStream(inputStream);
      return (ItemStack) dataInput.readObject();
    } catch (Exception e) {
      throw new IOException("unable to decode:", e);
    }
  }
torn shuttle
#

I'm switching out from base64 based on user feedback

#

I do have it working with base64

spice burrow
#

ahh

#

i read somewhere sometimes enchants dont deserialize properly but i havent had issues so far

torn shuttle
#

nah I definitely messed up forgot how I structured this in the backend, I should not be passing this as a string

#

oh hey think I got it

languid hound
#

what does that mean? : [Spigot Watchdog Thread/INFO]: Startup script './start.sh' does not exist! Stopping server.

hybrid spoke
eternal night
#

you presumably attempted to /restart

languid hound
open sage
#

I would like to get the village Position from
/execute positioned 0 0 0 run locate structure #minecraft:village but that only returns the distance using store result.
Is there a way to get the raw console result so I can parse The nearest #minecraft:village (minecraft:village_plains) is at [24, ~, 24] (500 blocks away) using Bukkit code?
I'm using Bukkit.getServer().dispatchCommand(Bukkit.getServer().getConsoleSender(), to run the command.

slender elbow
#

use the api instead?

plucky rock
#

any1 know how to detect how long somone holds right click

open sage
#

tyvm

kindred valley
#

?paste

undone axleBOT
blazing ocean
# kindred valley ?paste

can you please stop doing that randomly, same with ?learnjava, #bot-commands exists for a reason

kindred valley
#

I can text it whenever i want

#

you stop provoking people

blazing ocean
#

you just randomly do ?learnjava

#

and double ?paste

blazing ocean
kindred valley
#

And what is it about you

coarse trail
kindred valley
#

you should shut your mouth up and not talk anything you see

#

Whevener i start to say something you appear like a cucumber

blazing ocean
#

lynx based

blazing ocean
undone axleBOT
#

For Beginners:

Codecademy - Learn Java: Interactive Java programming course from basics to more advanced concepts. Perfect for absolute beginners.
https://www.codecademy.com/learn/learn-java
JetBrains Academy - Java Developer Track: Learn by doing with projects and challenges. It covers Java fundamentals to advanced topics.
https://www.jetbrains.com/academy/
Udemy - Java Programming Masterclass for Software Developers: Updated courses that cover Java 8 to Java 17 features. Suitable for those who prefer structured learning.
https://www.udemy.com/course/java-the-complete-java-developer-course/

For Intermediate to Advanced Learners:

Oracle Java Tutorials: The official guides by Oracle for Java programming—great for understanding the depth of Java.
https://docs.oracle.com/javase/tutorial/
Baeldung - Learn Java and Spring: Focus on Spring Framework and modern Java technologies. Best for intermediate learners aiming to expand their knowledge.
https://www.baeldung.com/

Practice and Hands-on Learning:

Exercism - Java Track: Solve exercises and get feedback from mentors. Great for practicing coding skills.
https://exercism.io/tracks/java
LeetCode: Practice your coding skills and prepare for technical interviews with Java.
https://leetcode.com/

Free Resources and Documentation:

Java Programming and Documentation: A comprehensive collection of Java programming guides, tutorials, and API documentation.
https://docs.oracle.com/en/java/

Community and Support:

Stack Overflow: A vast community of developers. Great for getting help with specific problems or understanding concepts.
https://stackoverflow.com/questions/tagged/java
r/learnjava on Reddit: Join the community of Java learners and get advice, share resources, and discuss projects.
https://www.reddit.com/r/learnjava/

Remember: Learning to program takes practice and patience. Don't hesitate to experiment with code and participate in community discussions. Happy coding! 🎉

hybrid spoke
#

since when is it so long lol

kindred valley
#

is it funny

blazing ocean
#

no

hybrid spoke
#

it actually is yeah

torn shuttle
#

the first filter is whether people have the patience to read that whole thing

blazing ocean
#

it's really not long

blazing ocean
torn shuttle
#

I often times can't get people to read 7 words

blazing ocean
#

i ain't reading allat

eternal oxide
#

Its way too long

#

should be a single link and a little text to a wiki page

torn shuttle
#

it should be a 5 second long tiktok video that shows a timelapse of learning java over 10,000 hours, sped up

#

I think this is what the matrix movie was about, it's been a whle since I've last seen it

icy beacon
#

5 seconds is too long

hybrid spoke
icy beacon
hybrid spoke
icy beacon
kindred solar
#

Does anybody know which constructor corresponds in 1.20.1 to this 1.17.1 NMS constructor?

smoky anchor
#

?mappings

undone axleBOT
smoky anchor
icy beacon
#

it took me like 4 minutes to invert a condition of two booleans

#

very proud

blazing ocean
#

congrats

shadow night
#

Relatable

icy beacon
#

thanks

coarse trail
#

hi, wonder if you guys know how to connect old bedrock plpayers even tho geyser only support 1.20.80 now at the minimum

grim hound
#

how can I do Player#launchProjectile

#

without trigerring ProjectileLaunchEvent

pseudo hazel
#

why

blazing ocean
#

hashmaps ✨

grim hound
#

Why doesn't InventoryClickEvent fire on armor equip (by placing the armor piece)?

grim hound
#

is

#

that

#

nonsense

shadow night
inner mulch
# grim hound what

your plugins are running on the server, if the server doesnt know about something (it happens client side) then there is nothing the server can do

shadow night
inner mulch
shadow night
#

Only the creative inv is client-side iirc

grim hound
#

yes

shadow night
#

Everything else is handled on the server

grim hound
#

that's right

shadow night
#

Minecraft is a server bound game

inner mulch
#

wait i thought its client side

#

my mistake then

grim hound
#

maybe it's 1.20.1 spigot error then

shadow night
#

Any other plugins on ur server?

exotic oracle
#

is there a way to upload my own plugins?

shadow night
exotic oracle
shadow night
#

Upload where

#

Ofc

exotic oracle
#

how

shadow night
#

Are you 7, 70 or why can you not navigate a basic forum site

#

By making an account and creating a resource

exotic oracle
#

i found it 💀

ionic sapphire
#

anyone an idea?

grim hound
#

since WallSign is a data type

#

not a block

#

right?

ionic sapphire
#

yeah, ik, when i'm using the normal Sign class it works for Oak Wall Signs, but not for other variants

quiet ice
#

jira is probably the better place

#

Though, what the the inheritance hierarchy differences between the classes?

grim hound
#

is there a way to apply a punch enchantment to a shot arrow?

blazing ocean
#

int is a primitive, which cannot be lateinit

#

set it to 0 or something

sage patio
#

why getInt cannot be null but getString can

kind hatch
#

Cause primitives can’t be null.
Objects can.

blazing ocean
# sage patio

this is the whole kotlin string/java string thingy

ionic sapphire
sage patio
tranquil glen
#

anyone willing to help me debug something to do with my .yml file clearing upon server reload?

#

not sure how to fix it

tardy delta
blazing ocean
tardy delta
#

what

blazing ocean
#

what if it's null

#

just ?: error("node is not found")

#

don't NPE it

#

that's bad for users

tranquil glen
#

Before reload, these test places are fine and are showing up okay

#

after reload, they're gone from the GUI, but not the yml

kind hatch
#

Reload or restart?

tranquil glen
#

and then after one more reload, they're gone from the yml

#

reload

smoky anchor
#

Sounds like you're not loading them

kind hatch
#

Probably a list being cleared.

tranquil glen
#

i'm loading them, but im not really sure where it's going wrong

#

i'll send my PlaceManager class

#

i run this every time on server startup

inner mulch
#

is there an event for finishing the game?

blazing ocean
#

as in end portal?

inner mulch
#

maybe that or just killing the enderdragon for the first time

#

this animation

#

idk

#

i guess just the entitydeathevent

sullen belfry
#

respawnevent triggers when you leave the end portal

sullen belfry
#

on entityDeathEvent would work just check if the entity is the ender dragon

inner mulch
#

okay thanks

sage patio
quaint mantle
#

🗿

#

?: throw NullPointerException()

sage patio
#

yea jk

blazing ocean
green prism
#

Hey, I just read this message and managed to reduce some usage (translated: massive caching). What do you think now?
I really appreciate your help and advice, thank you 🙂

https://spark.lucko.me/X5Siv3guS6

spark is a performance profiler for Minecraft clients, servers, and proxies.

sage patio
#

with the same processor :O

#

(btw they are just bots)

green prism
sage patio
#

yes

#

what is your gpu? xd

green prism
#

xd

#

5700 radeon

#

amd

sage patio
#

ow, 6600

green prism
#

wait we're even using the same amount of ram

sage patio
#

lol

#

really?

#

yea almost

green prism
#

28.1 GB you

29.2 GB me

#

haha

sage patio
#

how tf you've 80gb of swap

#

Memory(swap)
71.9 GB/81 GB

#

is it because the size of partation? the server was on my desktop and my c drive has 128gb

#

maybe thats the reason

green prism
#

I don't really know haha, sounds very high

grim hound
#

does anyone know how I could download a newer java version on an aarch linux?

blazing ocean
#

and archlinux-java ftw

grim hound
blazing ocean
#

install yay kekw

#

at least have some basic arch knowledge first

grim hound
blazing ocean
#

?google

undone axleBOT
grim hound
#

did

blazing ocean
#

then you'd have yay installed by now

slender elbow
#

pacman :nodders:

blazing ocean
#

some jdks aren't in arch repos

grim hound
#

uh

#

every command I try is just "command not found"

#

bruh

blazing ocean
#

what did you do KEKW

grim hound
#

I mean

#

nothing'

#

hehe

grim hound
carmine mica
#

do uname -a

blazing ocean
#

and if pacman also isn't a thing that's not arch

hazy parrot
#

I mean u aren't using debian based distro lol

grim hound
# carmine mica do `uname -a`

Linux alixsystemtests 5.15.0-102.110.5.1.el8uek.aarch64 #2 SMP Sat Jun 10 18:23:55 PDT 2023 aarch64 aarch64 aarch64 GNU/Linux

blazing ocean
#

that's aarch

#

not archlinux

grim hound
#

uh

#

aight 👍

blazing ocean
#

you said archlinux

grim hound
#

so how do I install a newer java version?

blazing ocean
#

erm yea i missed that a

slender elbow
#

he literally said aarch

grim hound
#

since I need like 22

blazing ocean
slender elbow
#

same

blazing ocean
#

what distro you running

grim hound
#

I'm pretty sure Debian

slender elbow
#

hello kitty linux

grim hound
#

once guy once showed me how to check that

blazing ocean
#

debian has dpkg

grim hound
#

but I forgot how

blazing ocean
grim hound
#

oh no

#

it's worse

#

it's fedora

blazing ocean
#

oh no

#

fedora ain't that bad

grim hound
grim hound
blazing ocean
#

literally first google result KEKW

grim hound
#

I have no opinion since I have no idea about any of this

blazing ocean
grim hound
blazing ocean
peak depot
#

hey quick question what is the smartest move to disable a plugin when database com fails bc the rest of the plugin depends on it

blazing ocean
#

throw an error in initialiser

chrome beacon
#

Or just call the disable method in plugin manager and safely abort the startup of your plugin

blazing ocean
#

plugman vibes

grim hound
#

but uh

#

65.0 bytecode versions are still unrecognized

blazing ocean
#

make sure to run it with the right version

mellow edge
#

^^^

grim hound
#

I just start jars with -java

blazing ocean
#

do which java

grim hound
blazing ocean
#

on arch they bins are located under /usr/lib/jvm/.../bin/java

#

idk how it's on fedora never used it

blazing ocean
grim hound
#

uhhhh

blazing ocean
#

-version ig

#

silly java

grim hound
#

bruh it's still 19

#

do I restart putty?

blazing ocean
grim hound
#

ye

blazing ocean
#

then use that

mellow edge
#

Are you trying to run a mc server but your new java version is not recognized by your server?

blazing ocean
#

sounds like it

remote swallow
#

use direct file path

blazing ocean
#

that's what i said

mellow edge
#

Why doesn't he just specify the path to the executable file (on win java.exe on linux I think just java) instead of java at the start

eternal night
#

use direct file path

grim hound
blazing ocean
#

wait you might need to use direct file path!

remote swallow
eternal night
#

java.exe KEKW fedora KEKW

remote swallow
#

java for linux nerds

grim hound
#

eeee

#

I am lost

eternal night
#

when you just type java -jar shit has to traverse your PATH to find a java binary on your machine

grim hound
#

why can't I just upgrade the jdk?

eternal night
#

if the first java binary found is the 19 one, you use the 19 one

blazing ocean
eternal night
#

to circumvent that, you just full specify the path to the java 21 binary

blazing ocean
#

i always prefer having everything installed or just docker

grim hound
blazing ocean
#

dockerised mc >>

blazing ocean
grim hound
#

but wasn't there a way to dynamically switch the used java version on linux?

eternal night
#

Well but changing around your path or by using symlinks

blazing ocean
#

idk on fedora

eternal night
#

but I am not well enough versed on fedora yea

blazing ocean
#

but arch has archlinux-java and debian has alternatives-list or something

eternal night
#

update-alternatives is debian iirc?

blazing ocean
#

ah yea that

mellow edge
#

I wonder what even defines default java on linux? Is it PATH or JAVA_HOME or something different?

eternal night
#

depends ™️

blazing ocean
#

path usually iirc

eternal night
#

some things might use JAVA_HOME

#

your default shell will just use PATH

blazing ocean
#

yea everybody just does their own shit

river oracle
#

U should just use sdkman on Linux

eternal night
blazing ocean
#

never heard of it

#

you should just use docker

slender elbow
#

sdkman on debian, sure

mellow edge
#

Docker best

grim hound
#

got it

blazing ocean
#

what no

grim hound
#

eh

#

then what?

river oracle
blazing ocean
#

use the direct file path as four people told you KEKW

eternal night
#

I mean, why use sdkman when you could be on an OS that has the AUR

blazing ocean
#

at least actually uninstall it, not just rm -rf the directories it uses KEKW

river oracle
grim hound
#

to which java exe

blazing ocean
#

the one you installed

#

jdk 17

#

21*

grim hound
#

aight that works

#

thanks ;]

quiet ice
#

Are there some kind of HashMaps that supports weak values instead of weak references?

eternal night
#

guava has some

#

which iirc is included in the api?

young knoll
#

Yes

eternal night
#

See their MapMaker

quiet ice
#

cool

potent shuttle
#

Hello

#

Do you guys know when the next spigot build comes out for 1.21?

young knoll
#

One came out 18 minutes ago

#

How many do ya want?

remote swallow
shadow pelican
vast ledge
#

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

vast ledge
undone axleBOT
#

For Beginners:

Codecademy - Learn Java: Interactive Java programming course from basics to more advanced concepts. Perfect for absolute beginners.
https://www.codecademy.com/learn/learn-java
JetBrains Academy - Java Developer Track: Learn by doing with projects and challenges. It covers Java fundamentals to advanced topics.
https://www.jetbrains.com/academy/
Udemy - Java Programming Masterclass for Software Developers: Updated courses that cover Java 8 to Java 17 features. Suitable for those who prefer structured learning.
https://www.udemy.com/course/java-the-complete-java-developer-course/

For Intermediate to Advanced Learners:

Oracle Java Tutorials: The official guides by Oracle for Java programming—great for understanding the depth of Java.
https://docs.oracle.com/javase/tutorial/
Baeldung - Learn Java and Spring: Focus on Spring Framework and modern Java technologies. Best for intermediate learners aiming to expand their knowledge.
https://www.baeldung.com/

Practice and Hands-on Learning:

Exercism - Java Track: Solve exercises and get feedback from mentors. Great for practicing coding skills.
https://exercism.io/tracks/java
LeetCode: Practice your coding skills and prepare for technical interviews with Java.
https://leetcode.com/

Free Resources and Documentation:

Java Programming and Documentation: A comprehensive collection of Java programming guides, tutorials, and API documentation.
https://docs.oracle.com/en/java/

Community and Support:

Stack Overflow: A vast community of developers. Great for getting help with specific problems or understanding concepts.
https://stackoverflow.com/questions/tagged/java
r/learnjava on Reddit: Join the community of Java learners and get advice, share resources, and discuss projects.
https://www.reddit.com/r/learnjava/

Remember: Learning to program takes practice and patience. Don't hesitate to experiment with code and participate in community discussions. Happy coding! 🎉

shadow pelican
#

Can any people help with a plugin? im new to coding and i dont know how to fix this
"
@EventHandler
public void onPlayerDeath(PlayerDeathEvent event) {
Player player = event.getEntity();
for (ItemStack item : player.getInventory().getContents()) {
if (item != null && item.getItemMeta() != null && "Atlas Totem".equals(item.getItemMeta().getDisplayName())) {
int uses = totemUses.getOrDefault(player.getName(), 0) + 1;

            if (uses < 10) {
                event.setKeepInventory(true);
                event.setKeepLevel(true);
                totemUses.put(player.getName(), uses);
            } else {
                totemUses.remove(player.getName());
            }
            break;
        }
    }
} "
vast ledge
#

?paste

undone axleBOT
vast ledge
#

Paste there please

#
    @EventHandler
    public void onPlayerDeath(PlayerDeathEvent event) {
        Player player = event.getEntity();
        for (ItemStack item : player.getInventory().getContents()) {
            if (item != null && item.getItemMeta() != null && "Atlas Totem".equals(item.getItemMeta().getDisplayName())) {
                int uses = totemUses.getOrDefault(player.getName(), 0) + 1;

                if (uses < 10) {
                    event.setKeepInventory(true);
                    event.setKeepLevel(true);
                    totemUses.put(player.getName(), uses);
                } else {
                    totemUses.remove(player.getName());
                }
                break;
            }
        }
    }
shadow pelican
shadow pelican
vast ledge
#

Thats not an error?

shadow pelican
#

weird

vast ledge
#

Whats the error, not is there a error

shadow pelican
#

i get setKeepLevel as a error

#

and onPlayerDeath

vast ledge
#

stacktrace?

worthy yarrow
#

go to your console and copy the big error that gets spit out

shadow pelican
#

?

shadow pelican
#

"cannot find symbol"

vast ledge
#

The entire error...

worthy yarrow
#

brother

vast ledge
#

sounds like the spigot jar isnt being included in the plugin tho

shadow pelican
#

im sorry im new

worthy yarrow
#

how would he compile then

shadow pelican
#

i khow how to do that

#

im not that stupid

vast ledge
#

No stack trace?

worthy yarrow
#

But you don't know how to copy/paste?

vast ledge
#

No error

#

just works?

#

Using the code provided

shadow pelican
#

ooo that cosole

worthy yarrow
#

...

vast ledge
#

....

shadow pelican
#

sorry

vast ledge
#

np

shadow pelican
#

That is the comoile

#

give me one min to start the server

worthy yarrow
#

I don't wanna do it, do you bedless?

shadow pelican
#

ooo k

worthy yarrow
#

It's a different thing

#

not to do with helping you

#

Rather a spigot inside joke if you will

shadow pelican
#

oo

#

ok

vast ledge
#

malformed pom?

shadow pelican
#

and wen i was compile it i got this "class AtlasItemsPlugin is public, should be declared in a file named AtlasItemsPlugin.java"

vast ledge
#

can you send a ss of your project struct and your main class?

shadow pelican
#

Ye'

nova notch
quartz basalt
#

World world = Bukkit.createWorld(new WorldCreator(String.valueOf(player.getUniqueId())).type(WorldType.FLAT));

after a server restart the world kinda dissapears, i cant access it anymore using /world <name of world>, any reason for this?

vast ledge
#

are you saving the world on shutdown?

kindred solar
#

I need help, java.lang.NoClassDefFoundError: net/minecraft/world/entity/player/Player using NMS

quartz basalt
sullen marlin
quartz basalt
#

then im creating multiple worlds though no?

sullen marlin
#

Not if the name is the same

vast ledge
#

not if they got the same name

quartz basalt
#

also idk how that would work since i cant really store every players uuid, etc

sullen marlin
#

The method is really loadOrCreate

#

I doubt you want 10000 worlds loaded all the time

quartz basalt
#

i could probably just get all files in the container then ig and load like that

#

ok thanks

sullen marlin
#

How many worlds are you loading....

#

One for each player that's ever joined your server is a terrible idea

quartz basalt
#

im making a server where each player has their own island and their island is in their own world

worthy yarrow
#

That's just inefficient

sullen marlin
#

Load it when they join and unload it when they leave

#

You don't want every island ever loaded all the time

quartz basalt
#

yeah didnt rly think of that

worthy yarrow
#

Iirc the modern practice is same world different islands no? I mean rendering is already a thing so

quartz basalt
#

idk i looked it up and i found a couple pages saying 1 world for x islands is the same as 1 world per island

#

its also easier to do a world per player since the locations would be the same for every world

worthy yarrow
#

I mean you can just save any location for any player so that's not really valid argument imo

quartz basalt
#

🤷‍♂️ i find it a lot easier

worthy yarrow
#

It's not like that bad to world : player, but just do as md said and don't forget to unload the worlds when you dont need em anymore

quartz basalt
#

👍 ty fpr the help

nova notch
#

wouldnt ASWM be perfect for this?

worthy yarrow
#

Don't reinvent the wheel yeah, but good practice

young knoll
#

Or space them out in the same world

#

Depends what you really need

worthy yarrow
#

They don't want to do that

young knoll
#

Fair

#

It’s a bit more work to manage but you don’t have the overhead of loading and unloading worlds

worthy yarrow
#

Yeah and if the intent is to spawn them on their island onJoin, the loading worlds is a bit of a nogo

#

But ig their intent is unknown so up to them

young knoll
#

I still need to develop an algorithm for this tbh

#

I can create the world quickly, but I need to generate an area within the world without making the server cry

sullen belfry
#

anyone know how to fix this issue?

vast ledge
#

You're on a higher or lower java version than required

vast ledge
young knoll
#

Trying to generate a lot of chunks at once

sullen belfry
#

my pc has java 22

#

and i have java 22 selected in all my projects

vast ledge
#

you're trying to shade something thats on version 17

sullen belfry
vast ledge
#

so im unsure

#

check ur pom.xml or build.gradle

sullen belfry
#

its bstats im trying to use

vast ledge
#

see what you're using in the shade

sullen belfry
#

?paste

undone axleBOT
sullen belfry
worthy yarrow
astral glen
#

hello, is there a guide for data pack developers to make them compatible with spigot?

sacred mountain
#

for recipes using RecipeChoice.ExactChoice / RecipeChoice.MaterialChoice

Will these be ONLY a single item, but multiple options
or will it be any variety of these items?

#

so like if i have a multiple choice that has Netherrack and Oak planks, i want to make it so i can only use ALL planks or ALL netherrack

young knoll
sacred mountain
#

like not mix and match

young knoll
#

I was thinking about how to run a repeating task as a completable future

acoustic shuttle
#
    private void sendBlockDamage(Player player, Location blockLocation, int stage) {
        BlockPos blockPos = new BlockPos(blockLocation.getBlockX(), blockLocation.getBlockY(), blockLocation.getBlockZ());
        ClientboundBlockDestructionPacket packet = new  net.minecraft.network.protocol.game.ClientboundBlockDestructionPacket(player.getEntityId(), blockPos, stage);
        CraftPlayer cp = (CraftPlayer) player;
        ServerPlayer serverPlayer = cp.getHandle();
        ServerPlayerConnection playerConnection = serverPlayer.connection;
        playerConnection.send(packet);
    }```
(Yes I've tried the spigot method, yes I've tried protocol Lib, Yes it's sending these every tick)

No matter what I do the block break animation ends up looking extremely weird as show in the video it's like flashing on and off
young knoll
#

But then I realized I can use a callback instead

worthy yarrow
#

I wonder if you put completion thresholds in the generation process to moniter progress

young knoll
#

The api also allows you to do that

worthy yarrow
young knoll
#

Meh, I just need to execute something async when it’s done

slender elbow
worthy yarrow
young knoll
#

How would you make a future that returns when a repeating task has gone through X iterations tho

#

:p

sullen belfry
slender elbow
#

counter
if (counter-- == 0)
cancel();
future.complete(null)

young knoll
#

Omg right

#

I don’t need to use supplyAsync

slender elbow
#

yeah you can just create a new CF

young knoll
#

I’m special

#

I swear I’ve been using java for 10 years and not 10 days

slender elbow
#

I believe you :kek:

#

I've been fighting callbacks today

acoustic shuttle
#

Also why does it matter just curious?

echo basalt
#

Just use the block's hashcode or something

acoustic shuttle
young knoll
#

Inb4 block hashcode matches player entity id :p

echo basalt
#

lil unlikely

#

Integer.MAX_LIMIT - block.hashcode just to be sure

young knoll
#

Could still match!

#

But yes it’s like a 1/4 billion chance

acoustic shuttle
#

@young knoll @echo basalt ty guys it worked

carmine mica
#

@lone jacinth can you explain what the point of the || condition is here? In what situation would the owner not be Material in an invokedynamic instruction's handle?

echo basalt
#

arrays?

#

Not sure about exact bytecode but arrays are always wonky

carmine mica
#

an array won't be the owner of a values or ordinal call in an invokedynamic instruction. You can't call those methods on an array of materials, just methods on Object like toString

#

in both these cases, the owner should still be Material in the invokedynamic's handle

echo basalt
#

How about Material.values().length

#

or whatever

carmine mica
#

well .length isn't a method. You can't have an invokedynamic instruction with a H_GETFIELD from javac. you can have a H_GETFIELD in an invokedynamic in the jvm, but afaik, javac won't ever produce that. however, it shouldn't matter. All that matters is you return the correct array, then the .length is after that

#

the owner of the values() call is still Material

echo basalt
#

array.toString() mayhaps?

#

it's dumb but can happen

carmine mica
#

again, you already have the array

#

this is about getting the array, whatever happens after with the array is of no consequense

inner mulch
#

is there a way to fix the issue with maven, that even after install changes arent applied to other modules that depend on the other one?

carmine mica
#

this is rewriting the method to get the array

echo basalt
#

Is there some method to get an array that isn't like

#

values

carmine mica
#

I don't think so? That || condition didn't exist until it was rewritten to correctly handle invokedynamic and it's specifically checking stuff that is only present for invokedynamic

young knoll
#

getEnumConstants?

#

Wait no that’s on Class

echo basalt
#

maybe some fucked up plugin doing heavy bytecode shit caused some error

#

(^ is clueless)

#

can we like blame lombok or something

carmine mica
#

yeah, I'm curious as to what causes that. so I'm guessing derfrzocker has some reason why it was added

#

You can have this situation, but I don't think that covers this.


private static <E extends Enum<E>> int test(final E constant) {
    final java.util.function.Function<E, Integer> ordinal = Enum::ordinal;
    return ordinal.apply(constant);
}

test(Material.AIR);
#

so in this situation, the owner of ordinal is not Material, but Enum. But the instantated method type in the handle wouldn't include Material I don't think, so it wouldn't trip that second condition

#

I actually think that this example completely fails and could cause all sorts of issues currently since Material isn't known anywhere inside the test method. You'd have to rewrite all Enum::ordinal calls and check if the enum is a Material which is a huge performance drag

sacred mountain
#

for this, does that return a clone

#

or can i just use .add(material)

#

or will i have to take that list and update it and set it back to the pdc

#

manually

carmine mica
#

you have to set it back. pdc impls just wrap nbt

sacred mountain
#

alr

#

ty

carmine mica
#

so its creating the list every get() by parsing that nbt

sacred mountain
#

wdym

#

the get is only called on used interaction when the list is updated

#

thats all

carmine mica
#

yeah, and every time you call get it's re-creating the list from the nbt, and everytime you call set, it's taking that list and converting it to nbt

#

that list doesn't exist anywhere except when you call get, so it isn't even a clone

sacred mountain
#

oh i get what you mean now

#

I thought you were making a comment of the performance of it lol

#

yeah thanks tho

#

i get it now

carmine mica
#

well it could be performance comment if you were calling get 400 times instead of just once and then re-using the list instance

sacred mountain
#

lol

inner mulch
#

i have a multi module project, when i update the common module, it often happens that the new stuff still didnt arrive in the other modules after mvn installing the common one. is there a way to ensure this and not having to remove and readd common as a dependency?

sacred mountain
#

Unsupported class file major version 60

#

fudge

#

mfnalex's morepersistentdatatypes

#

im using java 22.0.1

#

how do i fix that lol

snow pond
#

had an issue with inventories, if u make a inv with Bukkit.createInventory it asks for title but how can this title be retrieved from the inventory object

young knoll
#

It can’t

#

It’s a bit weird, I know

snow pond
#

Is there some workaround

sacred mountain
#

create a neural net and a server side api that recognises english text, then port a monitor view from every client and read the inventory name

lean ermine
#

odd, in my listener, the event gets cancelled but swapdye seemingly does not work, but this only happens on high ping, why would this be?

public void onItemClick(PlayerInteractEvent event) {
        Player player = event.getPlayer();

        ItemStack itemInHand = player.getInventory().getItemInMainHand();
        if (itemInHand.getType() == Material.LIME_DYE || itemInHand.getType() == Material.GRAY_DYE) {
            if(event.getAction() != Action.PHYSICAL && (player.hasPermission("hubbly.playervisibility.use") || player.isOp())) {
                event.setCancelled(true);
                swapDye(player, itemInHand);
            } else {
                player.sendMessage(ChatColor.translateAlternateColorCodes('&', config.getString("messages.no_permission_use")));
            }
        }
    }
#
private void swapDye(Player player, ItemStack itemInHand) {
        Material newMaterial;
        String displayName;
        if (itemInHand.getType() == Material.LIME_DYE) {
            newMaterial = Material.GRAY_DYE;
            displayName = ChatColor.translateAlternateColorCodes('&', "&rPlayers: &cHidden&r");
            for(Player online : Bukkit.getOnlinePlayers()){
                player.hidePlayer(plugin, online);
            }
        } else {
            newMaterial = Material.LIME_DYE;
            displayName = ChatColor.translateAlternateColorCodes('&', "&rPlayers: &aVisible&r");
            for(Player online : Bukkit.getOnlinePlayers()){
                player.showPlayer(plugin, online);
            }
        }
        ItemStack newItem = new ItemStack(newMaterial);
        ItemMeta meta = newItem.getItemMeta();
        if (meta != null) {
            meta.setDisplayName(displayName);
            newItem.setItemMeta(meta);
        }
        player.getInventory().setItemInMainHand(newItem);
    }
young knoll
undone axleBOT