#help-development

1 messages · Page 1793 of 1

fast onyx
#

i don't pretend to only learn by other people teach me

#

lol

eternal night
#

this is not #give-me-free-java-course-please

misty current
#

i have offered you help

proud basin
#

should I put the dependency-reduced-pom in my .gitignore?

fast onyx
#

#im-not-asking-for-java-course lol

misty current
#

you literally said this

fast onyx
#

that doesn't mean that is the only way that i've to learn

misty current
#

whatever

#

anyways for(Object name : objects) that's how a foreach works

young knoll
#

This is for spigot help

#

Not basic java help

eternal oxide
#

You will not have a clue what this does, but study it and learnjava player.getInventory().forEach(itemStack -> { if (itemStack.getItemMeta() instanceof Damageable meta) { meta.setDamage(0); itemStack.setItemMeta((ItemMeta) meta); } });

misty current
#

imagine he's not running java 16

paper viper
eternal oxide
#

guaranteed

fast onyx
#

Stop pinging

misty current
#

dude can we make people take a java test before being able to chat here

paper viper
#

#help-development is how i push all my anger out after getting tilted for playing comp in valorant 😂

eternal night
#

please don't, this discord would be useless 😭

fast onyx
#

i like how people talks with new people that is learning java, i have to see how they started, that will make me laugh

misty current
#

i didn't start learning java coding plugins

paper viper
#

same

eternal night
#

^

misty current
#

i started learning java like you are meant to learn java

fast onyx
#

you didn't born with 100% java knowledge

misty current
#

one of my first projects was tic tac toe

paper viper
misty current
#

it was a public static mess but it worked

paper viper
#

XD

#

we all start somewhere

fast onyx
#

you probably was stuck like me with some other things that doesn't have to be a plugin when you're new

misty current
#

yes, and i googled them

paper viper
#

but, im telling you man. with how shitty bukkit api is. and your current knowledge of Java. just

eternal night
#

tbf if we had to elaborate the internal jvm string cache to you, that would be acceptable xD for-each loops aren't

paper viper
#

dont

misty current
#

and they were that basic that it took me 2 minutes to find them on stackoverflow

paper viper
#

on an unrelated note, ive been watching uncle bob

fast onyx
paper viper
#

hes a legend

fast onyx
#

and still without find anything

#

only deprecated code

misty current
#

i didn't search for how to make tictactoe

misty current
#

i searched how to loop lists

#

or this stuff

#

not the whole code

paper viper
#

🤡

misty current
#

and if you don't start from that

#

you'll never get anywhere

paper viper
#

Objects.requireNonNull(Bukkit.getWorld("world))

#

🤡

misty current
#

only place you'll get will be on people's nerves

young knoll
#

You forgot the closing “

#

Back to programmer kindergarten with you

fast onyx
#

wtf? i search all my doubts and if i don't found anything then i come here?

eternal oxide
#

I gave you the code you need, but if you'd rather argue with people

eternal night
fast onyx
#

i always search first

#

and if not then ask

#

that's all

paper viper
#

guys just dont... hes like the average 18 year old shared server provider who doesnt want to learn java cause its too slow...

#

Also most of your questions can simply be answered by using javadocs

#

?jd

ivory sleet
#

Yeah pulse we should have an uncle bob command

fast onyx
ivory sleet
#

Did you order any of his books?

paper viper
#

No, i just watched his videos

#

very informative

ivory sleet
#

Ah nice

#

So I assume you’re an expert regarding SOLID now

paper viper
#

Well

#

i need to rewatch that one

#

lol

ivory sleet
#

Aha

paper viper
#

I think a lot of is just to think conservative programming

ivory sleet
#

How about comments then roo_confuse

eternal night
#

commenting code ?

#

are you insane

young knoll
#

Political programming?

ivory sleet
#

🥲

paper viper
#

Lol

paper viper
#

thats what he said in a twitter post

#

its pretty good

ivory sleet
#

Yuh it’s the gist of it

paper viper
#

and also who has the time even to write comments the first place

ivory sleet
#

Tho I guess javadocs can be excused sometimes when we don’t want to dive into implementation of apis hahayes

paper viper
#

Yeah

ivory sleet
#

Oh I think we wrote comments on the among us thing back then?

paper viper
#

Wait really XD

ivory sleet
#

Idr tbf lol

paper viper
#

Well that was when i didnt no shit

#

in java

ivory sleet
#

Tho likely

paper viper
#

and i didnt know any design patterns

ivory sleet
#

lol

paper viper
#

lol

ivory sleet
#

I remember the all the static

paper viper
#

Yeah

ivory sleet
#

😅

paper viper
#

with the

#

bootstrap thing

#

remember

#

XD

ivory sleet
#

Oh lmao

paper viper
#

did everyone leave the org

#

cause i did

#

XD

young knoll
#

My college was really specific about comments for java

#

They wanted a comment for each field

paper viper
#

tf

young knoll
#

// The heck do you think it is?
private int xPosition;

ivory sleet
#

Lol

#

@paper viper

#

Don’t mind the anime thing

paper viper
#

OP

#

code

young knoll
#

Why static

ivory sleet
#

Why not derp

young knoll
#

You right

paper viper
#

static abuse good

proud basin
#

burger is 0,3 and fries is 1,3

quaint mantle
#

spacing

#

also how is that spigot help

#

I have this neat little runnable that'll spawn a wave of falling blocks, but the blocks they originate from turn into air for the client

#

ghost blocks so to speak, any idea how i can prevent that / make them re-appear for the client

proud basin
quaint mantle
#

Okay but real shit, how do I prevent a falling block from turning the block it falls into to air

ember estuary
#

how can i extend a class to add my own features, and then make an instance of that class into an instance of my own class?

#

(cant change that superclass)

#

i just get a ClassCastException

#

when trying to cast it to my subclass

#

its possible with a wrapper class, but then i'd need to re-make every method and direct them to the method on the super object

#

That's my try using a wrapper class

public class Canvas {
    CraftMapCanvas craftMapCanvas;

    public Canvas(CraftMapCanvas craftMapCanvas) {
        this.craftMapCanvas = craftMapCanvas;
    }

    public void drawRect(int x, int y, int width, int height, byte color) {
        for(int i = x; i < x + (width-1); i++) {
            for (int j = y; j < y + (height-1); j++) {
                craftMapCanvas.setPixel(x, y, color);
            }
        }
    }

    public void drawText(int x, int y, MapFont font, String text) {
        craftMapCanvas.drawText(x, y, font, text);
    }
    // ^ Would need to do this for all other methods, which is a lot of work
}
young knoll
#

Or you can just expose the super object and call methods on it directly

ember estuary
#

how

young knoll
#

Except the ones you want to change

ember estuary
#

how can i do that

young knoll
#

For example, if I wanted to wrap a player

#

PlayerWrapper.getPlayer.sendMessage

ember estuary
#

oh

#

i see

#

no way to connect myPlayerWrapperInstace.sendMessage() directly to the internal Player Instance?

young knoll
#

You could

#

But if you don’t need to change anything, don’t bother

#

Otherwise you’ll just have a ton of 1 line methods calling this.wrappedPlayer.XYZ

ember estuary
#

making it exposed is just kinda un-intuitive to use imo

#

but if thats the only solution

young knoll
#

I mean like I said

#

You could redo every single method

ember estuary
#

well yeah, but i meant connecting it automatically

#

without redoing all methods

#

xD

young knoll
#

You might be able to do it with your IDE

ember estuary
#

i use IntelliJ

young knoll
#

Eclipse has an option to overwrite/inherit methods

#

I’m sure IntelliJ does too, somewhere

ember estuary
#

alright xD

#

I can't use extends to achieve my goal, can i?

#

extends would allow me to easily add some methods and stuff. but then theres the problem that bukkit gives me an instance of the extended class / superclass, so i cant downcast it. or can i somehow?

ember estuary
#

ill just use this wrapper than, ty

golden turret
#

i need a regex to validate the following:

test-1.0.0.jar
test1.0.0.jar
test.jar
test1.0.jar

basically i want only the test

shut field
#

I'm using an InvetoryDragEvent, is there anyway that I can get the clicked inventory?

golden turret
quaint mantle
#

?

quaint mantle
#

what do you want exactly

golden turret
#

i just want to ignore the version in the file name

#

if it is there

#

test-1.0.0.jar -> test

quaint mantle
#

just rename it

#

or i think you can use maven config

#

or something

#

to make it always produce the name

#

or you want to check?

golden turret
#

i just need to check

#

\b-\d+(?:\.\d+)+\b

#

thanks google

jade perch
#

.JAr

#

What monster

golden turret
#

.JaR

jade perch
#

Also there is a case insensitive flag for regex

golden turret
#

.jar
.Jar
.jAr
.jaR
.JAr
.jAR
.JaR
.JAR
.jAR

willow moss
#

Hello

#

I need help to find the version someone is joining my server with

#

such as: "Fabric 1.17.1"

#

or whatever their client says

#

I already have an on join event setup

#

I just can't find anything to do after that

young knoll
#

If you really want to do it yourself you need to read the incoming packets

#

The version I believe is just part of normal connection packets

#

Forge fires a specific packet you can use to detect it

#

Not sure if fabric does

ember estuary
#

i wanna have a drawPolygon function which you can pass vertices: public void drawPolygon(int x1, int y1, int x2, int y2, (int, int)... rest).
Is there a way to have optional parameters (so you can pass infinitely many vertices), but always force two (x and y) at once?
So when using that function you can either call drawPolygon(x1, y1, x2, y2) , or drawPolygon(x1, y1, x2, y2, x3, y3), but not drawPolygon(x1, y1, x2, y2, x3)

#

(I know i could use a Pair<Integer, Integer> or SimpleEntry<Integer, Integer>, but i dont really like having to make objects for simply passing numbers)

young knoll
#

You can overload the method with all the different options

ember estuary
#

what does that mean

#

u mean create

drawPolygon(int x1, int y1, int x2, int y2)
drawPolygon(int x1, int y1, int x2, int y2, int x3, int y3)
drawPolygon(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4)
etc ?

young knoll
#

Yes

ember estuary
#

but then i cant have infinitely many

young knoll
#

Of course that doesn’t work for infinite

#

You would need to use a pair of some sort

ember estuary
#

alright :/

#

or just throw an error if args.length%2 == 1

#

xD

#

but thats at runtime sadly

young knoll
#

You could also do that

ember estuary
#

or is it

quaint mantle
#

can do varargs and do the length check

young knoll
#

Yes it’s runtime

ember estuary
#

does the compiler know/warn its gonna throw an error?

young knoll
#

No

ember estuary
#

i mean the ide

#

sry xD

#

ok

quaint mantle
#

just dont do user error 🙂

ember estuary
#

programmers are the users in my case

#

so then usererror is alright, right?

#

its an api

young knoll
#

Spigot has a lot of stuff like that

#

For example, if you try to use .distance between 2 locations in different worlds you will get a runtime exception

ember estuary
#

ok, so i tried using Pairs, and i get the following warning: Possible heap pollution from parameterized vararg type
What does it mean?
Googling didnt really make it any clearer

#

Set<Pair<Integer, Integer>> getPolygonPoints(Pair<Integer, Integer> ... vertices) { ... }

young knoll
ember estuary
#

well idk if its save

#

how can i fix it

#

i saw that post before, but didnt really help me fix the problem

#

is it unfixable?

#

just add @SafeVarargs and hope for the best?

jade perch
#

Don't use a pair

#

Make a class

ember estuary
#

and that will fix it?

jade perch
#

Yes

ember estuary
#

ah, yeah, true

#

ty

#

will do that

quasi patrol
#

Confused for title component? (custom inventory btw).

jade perch
quasi patrol
jade perch
#

that's not spigot

eternal oxide
#

Wrong import

sweet pike
#

I was wondering, with NMS, if you are trying to develop against mojang mappings, how can i check, for ex, what the name of the class EntityInsentient, is in the mojang mappings?
https://nms.screamingsandals.org/ <-- this is a pretty good website, however it only shows your the remapped things and not the original spigot mappings, so if I try to search EntityInsentient, nothing shows up

sullen marlin
#

You can view all mappings in the bt work folder

#

Or just figure it out based in context

jade perch
#

context is my preferred way

sweet pike
#

but it took me more than 30 mins to find that EntityInsentient was just Mob LOL

#
  • using context is ridiculously hard when you are dealing with this such as pathfinders
#

packets are understandable

quaint mantle
#

woulda took a couple seconds if you just started from an actual mob and went down the chain

jade perch
#

ctrl+click from intellij is op

sweet pike
#

nah nah thats not the problem

#

Cuz basically what happened was i needed a private field of type EntityInsentient but obv needed that in mojang mappings

sweet pike
jade perch
#

That's how I made my simulator so it should be fine for anything else

quaint mantle
#

when I was converting I just setup a 2nd project with spigot mappings

sweet pike
quaint mantle
#

go down the extend chain

sweet pike
#

Here i had no clue what EntityInsentient actually was, therefore didn't know what it was linked to

quaint mantle
#

just go off the same mob

#

like cow

#

you'll see the different class names if you do the 2 project setup very quickly

sweet pike
#

Like for ex, now with pathfinders I have a completely different issue, trying to find what the mojang mapping equivalent of EntityLiving.h(EntityInsentient) and the h() name is from a yt vid like 2 years ago so method names prolly changed as well

#

but I get what you mean and stuff

dim jewel
#

hey there
I need help
Why i can't get the compile spigot?
The BuildTools.bat said Unable to access jarfile Buildtools.jar

chrome beacon
#

The BuildTools jar needs to be in the same folder

acoustic pendant
#
        BukkitRunnable runnable = new BukkitRunnable() {
            @Override
            public void run() {
                for (Player player : Bukkit.getOnlinePlayers()){
                    if (player.getLocation().getY() >= 50){
                        cold++;
                        if (!playerHeigh.containsKey(player)){
                            playerHeigh.put(player.getUniqueId(), player);
                            player.sendMessage("You are getting cold!");
                        }
                    } else if (player.getLocation().getY() <= 49){
                        if (playerHeigh.containsKey(player)){
                            playerHeigh.remove(player.getUniqueId(), player);
                        }
                    }
                }
            }
        };```

```java
 if (player.getLocation().getY() >= 50){
            if (playerHeigh.containsKey(player)) {
                player.sendMessage(warningMessageUp);
                task0 = scheduler.scheduleSyncRepeatingTask(plugin, () -> {
                    cold++;
                }, 0, 20);

            } else {
                playerHeigh.put(player.getUniqueId(), player);
            }
        } else if (player.getLocation().getY() <= 49){
            if (playerHeigh.containsKey(player)){
                playerHeigh.remove(player.getUniqueId(), player);
                if (scheduler.isCurrentlyRunning(task0)){

                    scheduler.cancelTask(task0);
                }
            }
        }```

Hey! which is the best way for doing this?
sullen marlin
#

First seems fine

acoustic pendant
#

so the first way should be better?

balmy pendant
#

I think that is what happened from testing, it just seems like the class I used for 1.8-1.13 builds works for 1.18, and the other class only works for 1.14-1.17 (different classes for different import locations)

noble lantern
#

How do you get click events for this panel?

#

It doesnt print anything not even null or -999 like when you click on the outside of the inv (InventoryClickEvent)

noble lantern
#

You see i did see that class

#

However, i wanted to use this class:

#

However the click events only give Merchent inventories when villager GUI's get clicked...

#

my bad i meant clicked

smoky oak
#

wait where comes click event from again?

noble lantern
#

Essentially InventoryClickEvent doesnt give a MerchantInventory

#

If i could get a MerchantInventory, it has a selected recipe method

However i feel MerchantInventory would be something you would need to make yourself?

#

And then you would have to handle esentially the whole trading system yourself?

smoky oak
#

aren't you already casting that to MerchantInventory? Why is that an issue then?

noble lantern
#

Because Merchant != MerchantInventory

#

the most bottom broadcast doesnt get fired

smoky oak
#

well of course

#

were both stupid

#

you cast the inventory to a merchant inventory

#

but you check if its a merchant inventory before you do

noble lantern
#

But Merchant isnt what i need

#

I need MerchantInventory, as it has

smoky oak
#

does it give an error when removing that if line?

acoustic pendant
#
            @Override
            public void run() {
                for (Player player : Bukkit.getOnlinePlayers()){
                    if (player.getLocation().getY() >= 50){
                        if (!(cold >= 100)){
                            cold++;
                        }
                        if (!playerHeigh.containsKey(player)){
                            player.sendMessage("You are getting cold!");
                            playerHeigh.put(player.getUniqueId(), player);
                        }
                    } else if (player.getLocation().getY() <= 49){
                        if (cold >= 1){
                            cold--;
                        }
                        if (playerHeigh.containsKey(player)){
                            playerHeigh.remove(player.getUniqueId(), player);
                        }
                    }
                }
            }
        }.runTaskTimer(ClimaticEffects.getInstance(), 0, 20);```

Hello! i have this code^^ 

but for some reason the value is increasing like very fast and the messages keep sending, what do i have bad?
noble lantern
#

If its not a instance of something, you cant cast so yes it will error

noble lantern
acoustic pendant
#

yes

#

but

#

it sends like 30 messages in a second

#

i can send you video if you want

noble lantern
#

does it keep getting faster and faster

#

until your server crashes

#

omg discord come on

acoustic pendant
#

well

#

i haven't try if my server crash

noble lantern
#

It basically just keeps printing "You are getting cold!"?

acoustic pendant
#

but sends many messages in a second

#

yep

#

and increasing very fast the cold value

smoky oak
#

and with what you were doing earlier, event.getInventory() there should be no errors

acoustic pendant
#

do you know how to solve it burchard?

smoky oak
#

wait

#

event.getClickedInventory()

#

i think event.getInventory() returns player inventory

#

oops

acoustic pendant
noble lantern
noble lantern
#

Your probably creating a bunch of those runnables

acoustic pendant
#

oh

#

makes sense

#

@noble lantern if (playerHeigh.containsKey(player)) {
if (player.getLocation().getY() >= 50)
}

maybe like that should be done?

#
            @Override
            public void run() {
                for (Player player : Bukkit.getOnlinePlayers()){
                    if (!playerHeigh.containsKey(player)) {
                        if (player.getLocation().getY() >= 50){
                            playerHeigh.put(player.getUniqueId(), player);
                        }
                    }```
#

like that

noble lantern
#

Or your creating more runnables inside the runnable

#

If it continuinly gets faster, that means more runnables keep getting registered

acoustic pendant
#

yes, i understand that

noble lantern
#

However if its the same rate, then its just the rate of the runnable

#

So you need to find where you calling the method that registers that runnable

acoustic pendant
#

to place the user

#

and if the user is not in the hashmap it just create one

#

@EventHandler
public void coldAndHeatSetter(PlayerMoveEvent e) {

#

^^

noble lantern
#

your calling a runnable in that?!?!?!

supple parcel
#

Am I missing something?

    public void onBlockPhysics(BlockPhysicsEvent event) {
        Block b = event.getBlock();

        if (b.getType() == Material.REDSTONE_TORCH || event.getSourceBlock().getType() == Material.REDSTONE_TORCH ||
                event.getChangedType() == Material.REDSTONE_TORCH) {
            Bukkit.broadcastMessage("Cancelled redstone torch!");
            event.setCancelled(true);
        }
    }```

Only if I cancel air (Where all 3 block/materials are air) will this physics update be cancelled.
acoustic pendant
#

oh wait

#

bruuuh

noble lantern
#

Just call the runnable once in onEnable

#

and check player positions every x ticks

acoustic pendant
#

i just realized

noble lantern
#

PlayerMoveEvent calls so many times, and when you have lots of players it becomes pretty rough

#

and it would explain stuff getting faster

acoustic pendant
#

yes, ty

noble lantern
#

I dont see event.setCancelled(true); ?

#

unless im an idiot and blind

supple parcel
#

Whoops

noble lantern
#

xD

supple parcel
#

Just cancelled it and same result 😛

#

It's basically an extract of code in a larger plugin

noble lantern
#

Hmm

#

Ive never done block physics like that before

#

However maybe you need to cancel physics directly on the Block?

acoustic pendant
#

burchard, now it works, but keep sending the message instead of just 1 time

supple parcel
#

How exactly does that work..
You can see I'm cancelling it everytime there's a redstone torch involved in the physics

acoustic pendant
#
                    if (!playerHeigh.containsKey(player)){
                        player.sendMessage("You are getting cold!");
                        playerHeigh.put(player.getUniqueId(), player);
                    }```
#

and i don't understand why this doesn't work

noble lantern
#

Unless your Key is an Object?

visual tide
#

youre checking if the key is the player, not the value

#

since your value is uuid

acoustic pendant
noble lantern
#

So,

#

you should be checking

acoustic pendant
#
   Map<UUID, Player> playerHeigh = new HashMap<>();```
noble lantern
#

for the UUID, not the Player

#

Because your just directly checking the Player object

#

Not the Player's UUID

#
if (!playerHeigh.containsKey(player.getUniqueId())) {}
acoustic pendant
#

oh

noble lantern
#

However, what is the purpose of this HashMap?

acoustic pendant
#

because if not

#

when you are above 50

#

it keeps sending messages

noble lantern
#

IMO it seems kind of redundant if you just want to see if player are above 50

#

Instead keep a list of UUID's

#

HashMap of UUID, Player will use up more memory in the long run

#

List of UUID's though is very lightweight and serves the same purpose

#

and you can just get Player from Bukkit#getPlayer(UUID)

acoustic pendant
#

now it works

#

ty!

#

i'm silly, the move event and now the uuid object

#

sorry

noble lantern
#

Bukkit.getOnlinePlayers()

#

If you do the List way, use Bukkit.getOnlinePlayers() and then check UUID

quaint mantle
#

hi, weird question, anyone know how i can make the water not flow outside the worldborder but also still flow normally inside? whenever i check if its outside and cancel the event it does that since the closest path for it to flow is only outside the border https://gyazo.com/7f508bf92004c858c8e57091f4a6eee0

noble lantern
#

I forgot getPlayer sends a request to Mojang

#

but getOnlinePlayers is just players online on your server, and also prevents the error of sending messages to an offline player

chrome beacon
#

getOfflinePlayer*

noble lantern
supple parcel
supple parcel
#

So if you cancel it, then set the block it tried to barrier

noble lantern
#

If its an internal check scratch everything is said then

#

Hey Olivo

quaint mantle
noble lantern
#

Do you know how to get a MerchantInventory?

#

InventoryClickEvent returns Merchant only

chrome beacon
#

Also I'm unsure if the uuid version of get offline player does a request might just be string one

noble lantern
supple parcel
chrome beacon
noble lantern
#

Im trying something now where i get the Villager entity itself, and then get its ivnentory that way sec

chrome beacon
noble lantern
#

your right lmfao

chrome beacon
#

Ow it was that

noble lantern
#

Cause i was jsut trying right now, and it said i couldnt cast to Merchant when it was a MerchantInventory im like wtf

noble lantern
supple parcel
chrome beacon
noble lantern
#

Well thing it that was confusing me

#

When i used event.getInventory.getType

#

it printed Merchant

#

And my instanceof check typo made me think it wasnt MerchantInventory

chrome beacon
#

Quick tip when you try to troubleshoot inside of printing getType print getClass

#

This way you know exactly what it is

noble lantern
#

Okay so

acoustic pendant
noble lantern
#

When i logged getInventory it logged the same thing

#

and the class name made it seem really weird and not like it was MerchantInventory because it was InventoryMerchant by NMS

noble lantern
#

Just use List of UUID and then loop through it using getPlayer(UUID)

#

getOfflinePlayer(String) was the method i was getting confused with so ignore me for that sorry

noble lantern
#

Maybe you can look into theyre source code and see how they do it?

acoustic pendant
#

k np

chrome beacon
noble lantern
#

Never heard of PaperWeight tbf

chrome beacon
#

In this case you could check and see that the CraftInventoryMerchant is the implementation of the Merchant inventory interface

noble lantern
#

In what cases for clicking inventory would inventory even be Merchant anyways?

#

Would the Merchant inventory be what the Villager is holding? Like when they pickup food?

chrome beacon
#

Nvm

#

I'm actually not sure

#

This is why having access to NMS can be useful you can check how things work

noble lantern
#

ill definatly take a look into PaperWeight, i assume its just Spigot equivilent of BuildTools huh?

mortal hare
#

is there any way to access block ids in modern versions of minecraft

smoky oak
#

whats your goal?

#

because the block Ids are now enums

mortal hare
#

i need to fill this

hoary pawn
#
java.lang.NoClassDefFoundError: org/apache/commons/io/FilenameUtils
        at com.splyfof.splymain.SplyMain.onEnable(SplyMain.java:47) ~[?:?]
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264) ~[server.jar:3277-Spigot-3892929-2071671]
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:342) ~[server.jar:3277-Spigot-3892929-2071671]
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:480) ~[server.jar:3277-Spigot-3892929-2071671]
        at org.bukkit.craftbukkit.v1_17_R1.CraftServer.enablePlugin(CraftServer.java:520) ~[server.jar:3277-Spigot-3892929-2071671]
        at org.bukkit.craftbukkit.v1_17_R1.CraftServer.enablePlugins(CraftServer.java:434) ~[server.jar:3277-Spigot-3892929-2071671]
        at net.minecraft.server.MinecraftServer.loadWorld(MinecraftServer.java:619) ~[server.jar:3277-Spigot-3892929-2071671]
        at net.minecraft.server.dedicated.DedicatedServer.init(DedicatedServer.java:266) ~[server.jar:3277-Spigot-3892929-2071671]
        at net.minecraft.server.MinecraftServer.x(MinecraftServer.java:1010) ~[server.jar:3277-Spigot-3892929-2071671]
        at net.minecraft.server.MinecraftServer.lambda$0(MinecraftServer.java:305) ~[server.jar:3277-Spigot-3892929-2071671]
        at java.lang.Thread.run(Thread.java:831) [?:?]
Caused by: java.lang.ClassNotFoundException: org.apache.commons.io.FilenameUtils
        at org.bukkit.plugin.java.PluginClassLoader.loadClass0(PluginClassLoader.java:147) ~[server.jar:3277-Spigot-3892929-2071671]
        at org.bukkit.plugin.java.PluginClassLoader.loadClass(PluginClassLoader.java:99) ~[server.jar:3277-Spigot-3892929-2071671]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:519) ~[?:?]
        ... 11 more```
hmm can anyone see the problem here
mortal hare
#

You're missing dependency: org.apache.commons.io.FilenameUtils

hoary pawn
#

shouldnt that be installing it?

noble lantern
#

nope

#

set scope to compile

#

As commons-io isnt provided by anything iirc

hoary pawn
#

ahh then i get this tho

eternal oxide
#

its included in Spigot, but you have to have the right path

#

oh io, not commons

hoary pawn
noble lantern
#

Its basically saying that is provided in another dependency

#

Try removing it from maven pom file

#

and using it

#

Maybe Spigot already includes it?

#

if it has both commons and io commons

hoary pawn
#

by removing it from pom

hoary pawn
noble lantern
hoary pawn
#

no thats the errors

hoary pawn
noble lantern
#

It should still compile with that

#

Omg discord lag again come on man

#

I wish discord would fix this bs

hoary pawn
mortal hare
#
    @Deprecated
    public int getId() {
        Validate.isTrue(this.legacy, "Cannot get ID of Modern Material");
        return this.id;
    }
#

Material.STONE.getId() wouldnt work

#

since it has guard check

drowsy helm
#

for what usecase?

mortal hare
#

Packets

#

I need block state id

#

to send metadata packet

drowsy helm
#

similar question was asked a while ago, i think your only option is making your own util class

#

wait so a post-flattening packet requires a pre-flattened id?

mortal hare
#

OptBlockID (VarInt) 0 for absent (implies air); otherwise, a block state ID as per the global palette

hoary pawn
noble lantern
#

It just takes the newest version and uses that during compile time

hoary pawn
#

i think im cursed lol

#

everything i get a tech problem stuff noone knows how to solve it lol

noble lantern
#

Im kinda spoiled with maven ive never had any groundbreaking issues so i dont know how to fix much with it xD

hoary pawn
#

maven is really nice

#

when it works

noble lantern
#

So im trying to get all of a specific material from a Players into a List and i want to know the more efficient TPS Safe way to do this:

Should i: Inventory#forEach((material)) and then add to List if material is true

Or use: Inventory#all(Material) and then go through the hashmap specifically grabbing the ItemStack that way? Does using Inventory#all do the same thing as basically the first thing i said under the hood:

noble lantern
#

i like to randomly use gradle at times though

noble lantern
quaint mantle
#

why is it that when I click the block on the ground, the message does not output, and when I click on the air or on the ground where I can install the block, it does not output?

#
    if (e.getHand() == EquipmentSlot.HAND) {
                if (itemInHand.isSimilar(it)) {
                    e.getPlayer().sendMessage("HAND");
                }
            }
#

does not output a message after this condition:
if (itemInHand.isSimilar(it)) {

noble lantern
#

What are you ultimatly trying to achieve?

quaint mantle
noble lantern
#

No its fine, im just curious as to what your trying to do? Are you trying to make something happen if someone is holding a specific item in hand?

quaint mantle
#

I have a problem, i try to make an NPC Spawn Command, but then i get this error

misty current
#

probably npc is an abstract class

noble lantern
#

lowkey never used mc's vanilla npc api

#

just use citizens ngl

quaint mantle
#

Okay

noble lantern
#

Its free, it has a well made API kinda, and the devs will always add things if you have a legitimate use case for it

quaint mantle
#

Okay

#

I go try it

#

thx

quaint mantle
noble lantern
#

Well the main beef of your code is kinda covered by an error

#

so idk

quaint mantle
#

Yea

#

Do I need to create different class for that NPC? So the command and the NPC are not in the same class?

noble lantern
#

well idek what your trying to do because the code is covered by an error panel, it looks like your trying to reskin a spawned npc but idk

#

and its weird

#

Why your accessing it statically unless it needs to be done that, which i doubt it, it looks like you need to call that o nthe actual npc object

quaint mantle
#

manya

#

zaebal

#
    @EventHandler
    public void onPlayerInteract(PlayerInteractEvent e) {
        Player p = e.getPlayer();
        ItemStack it = ItemManager.bottle(Material.STONE, Config.bottleOneName(p), Config.bottleOneLore(p));
        ItemStack itemInHand = p.getInventory().getItemInMainHand();
        ItemStack itemInOffHand = e.getPlayer().getInventory().getItemInOffHand();

        if (e.getAction() == Action.RIGHT_CLICK_AIR || e.getAction() == Action.RIGHT_CLICK_BLOCK) {
            e.setCancelled(true);
            if (e.getHand() == EquipmentSlot.HAND) {
                if (itemInHand.isSimilar(it)) {
                    e.getPlayer().sendMessage("HAND");
                }
            }

            if (e.getHand() == EquipmentSlot.OFF_HAND) {
                if (itemInOffHand.isSimilar(it)) {
                    if (itemInHand.isSimilar(it))
                        return;
                    e.getPlayer().sendMessage("OFF_HAND");

                }
            }
        }
    }
}
quaint mantle
misty current
#

oh god the pyramid of doom

quaint mantle
#

ril zaebal

#

hi, pupsik😘

mortal hare
#

lol you can enderman hold nothing

#

in their hands

quaint mantle
misty current
#

packets are fun

noble lantern
#

Top 10 anime villans of all time:

noble lantern
#

lambdas feel so useless

misty current
quaint mantle
mortal hare
misty current
#

wait really

mortal hare
#

i've had these kind of issues before

#

yes

misty current
#

oh i feel stupid now

noble lantern
#

ngl i hate using for is looks so ugly ik theres no different in forEach and for

#

but forEach looks nicer

mortal hare
#

just use for loop

#

why foreach

misty current
#

i like lambdas more

noble lantern
#

Yeah i typically use for when anything im doing edits a List or HashMap etc

mortal hare
#

also there's filter method iirc

misty current
#

yea

noble lantern
#

But Lambdas for things like notifying or whatever doesnt let me use for

#

Never dabbled to much in filters

#

i probably should

#

been doing this years now LMAO, and never really touched them too much

quaint mantle
misty current
#

you can't construct NPC

quaint mantle
#

What i need to do?

noble lantern
#

yeah was just about to try that and it gave me those errors

mortal hare
#

i wonder if endermen can hold items, not just blocks too

noble lantern
misty current
#

they probably can

noble lantern
misty current
#

but they'll appear in the center i suppose?

noble lantern
#

There was a rather hacky plugin a few years back that just offset the item in between the endermans hands

#

That was way long ago

mortal hare
#

now i get it why minecraft has namespaced key registry since 1.13

#

it would be cancer to sort the block types by IDS for developers

noble lantern
#

namespaced keys are godsends

mortal hare
#

well in the end they all end up as numeric ID's in packets

noble lantern
#

Anything to deal with PersistantDataContainer is just godsend

mortal hare
#

its just that developers don't need them to handle

noble lantern
#

Ofc course but would you rather do all that by without those wrappers? That would be so much torture

misty current
#

i'd rather directly use nbt

mortal hare
#

imagine 10000 of ID's

#

half of them are just the block states

misty current
#

yea lol

mortal hare
#

gl sorting them

#

well it was something like that

#

with mods

misty current
#

something that never made sense is that different items have the same id

#

pain for everyone

mortal hare
#

especially with modpacks

misty current
#

like dyes

mortal hare
#

but hey ID system is faster

#

convenience > performance

misty current
#

i'm pretty sure ids were starting to be deprecated when i started playing mc

#

around 1.8

mortal hare
#

I've played this game since Beta 1.8

#

i remember torrenting it off the site 😄

misty current
#

and then in 1.13/14 they changed all to string ids

#

danm

mortal hare
#

too bad that they removed Auto update feature

#

it would've made community shift more quickly

#

to newer versions of minecraft

misty current
#

i'm 16 and i was not allowed to play games sooo i kinda started at 9/10

tacit drift
misty current
#

1.13's also a godsend for datapack developers

#

i used to be one

#

and i'm glad i'm not anymore

mortal hare
#

Minecraft was so at my veins at that time that i've stolen money off my parents (I was a dumb kid) just to buy premium minecraft account

misty current
#

meet the belt

mortal hare
#

yep

#

exactly

#

how that happened

quaint mantle
misty current
#

i've never requested much from my parents so they didn't really mind buying me mc when i asked

quaint mantle
#

Or i need to download the plugin and import that as a jar?

noble lantern
#

sec

#

ill give you it im using it rn

quaint mantle
#

okay

misty current
#

btw can you make npcs pathfind with citizens

noble lantern
#
    <repositories>
        <!-- Citizens2 API -->
        <repository>
            <id>everything</id>
            <url>http://repo.citizensnpcs.co/</url>
        </repository>
    </repositories>

    <dependencies>
        <!-- Citizens2 dependency -->
        <dependency>
            <groupId>net.citizensnpcs</groupId>
            <artifactId>citizensapi</artifactId>
            <version>2.0.28-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>
#

Thats the most recent version

misty current
#

or can you implement your own code to make them pathfind

noble lantern
#

^

mortal hare
#

Ngl Minecraft is like a drug, it never gets old

noble lantern
#

The only thing i hate about the citizens api is

misty current
#

mc never gets old because i always have something to do

noble lantern
#

that... the getting of npc's during startup is weird asf

noble lantern
misty current
#

now i'm developing, 6 mo ago i was playing modded with some friends of mine

#

even earlier i play on a random server i've found

misty current
#

and the cycle continues

mortal hare
#

I was playing Rust too

#

but solo

noble lantern
misty current
#

oh rust

#

tried it

mortal hare
#

really sucks to play

noble lantern
#

I have 1200 hours in rust xD

#

i hate rust

misty current
#

i can't play for shit

#

at rust

noble lantern
#

My AK spray has prolly gotten so dogwater

mortal hare
#

I've had classmate that i've played rust with sadly, he moved out to the other location

noble lantern
#

big sad :c

mortal hare
#

so we don't hangout anymore

noble lantern
#

I havent played rust in this long dang

misty current
#

i really don't play many games else than minecraft

#

sometimes i play factorio

#

or dyson sphere program

noble lantern
#

I play lots of Ark and Rust, more than i should admit

#

damn what am i doing with my life

misty current
#

ugh im making custom damage and enchants system and i can't count the number of issues i've had

noble lantern
#

Custom damage is fun

#

enchants arent

misty current
#

NaN health, random 1500 damage

noble lantern
#

LMAO

#

java longs be like

misty current
#

nah doubles

#

ffs

noble lantern
#

OOF

chrome beacon
#

Use an existing library or plugin for enchants

misty current
#

now i still get random 100/200 damage spikes

noble lantern
#

I should add the ability to make custom enchants to my API

#

im kinda stumped on what to add next for it

misty current
#

i already have a pretty solid custom enchant structure

noble lantern
#

Im thinking NMS but ehhhhhhh

#

wanna let me steal it :>

#

xD

misty current
#

mmmmmmm

noble lantern
#

I do have a damage system though if you wanna look into it but

#

its burried inside 3k lines of code

misty current
#

lol

noble lantern
#

It shows health through a boss bar

#

That plugin is lowkey a mess

misty current
#

what i do is setting the damage to what i want the final damage to be and then there's a final entitydamagevent with highest priority

#

that sets the final damage to the damage

noble lantern
#

I learned a lot more advanced java stuff i need to add to it to make it more readable

Like i had methods in there to update an objects values inside a hashmap after i edit it via a method ontha tobject...

misty current
#

setting the final damage how i do it is probably what causes issues

#

it's pretty sketchy

noble lantern
#

yeah i remove the damage

#

and handle it myself

#

this way though doesnt support other plugins

#

i need to set priority to highest

misty current
#

My pc died

#

Fun

#

Anyways i gave up on that now and now i'm coding custom mining

noble lantern
#

custom mining?

misty current
#

Yea

#

Did you ever play cosmic prisons?

noble lantern
#

oh my

#

god..

#

was it by the youtuber BrokeSkies...

misty current
#

not sure

#

i know lodgozip played it

noble lantern
#

If it was yes, i used to be a dev on there, if not then no

misty current
#

hm not sure

noble lantern
#

Owner is lowkey a D word if its BrokeSkies

misty current
#

an admin goes by the name of slayer

#

he's been one since 2017

noble lantern
#

Oh its still running?

misty current
#

yea

#

it always will probably

#

they make bank

noble lantern
#

In that case nah i never heard of it

#

Anyways whats the custom mining thing?

misty current
#

basically to have more control over the mining speed

#

or what tools can mine what

#

also block breaking states remain even if you stop mining

#

let's say i want a stone pickaxe to break emeralds in 12 ticks

#

i can

noble lantern
#

Sounds like assloads of NMS ngl

misty current
#

yeah few packets

#

i listen for player dig and play block break animations

#

not that bad tho

#

the worst will be armorstand animations

#

all packets

#

for performance reasons

noble lantern
#

Ngl though you can have a pretty popular plugin if you take one of those features and make it standalong

#

If you made a standalone for making the block breaking status staying after mining people would love that

#

cause iirc only a mod can do that

misty current
#

yea but in that case i would have to try to replicate vanilla mining

#

i don't think i can get somehow else what stage was a block in when a player stopped mining

acoustic pendant
#

Hello! how can i solve they both have the same value? (look scoreboard)
I tried when they joined putting them in a hashmap but i think i have to specify something else, could anyone help me?

  Map<UUID, Double> playerHeat = new HashMap<>();

  @EventHandler
    public void onPlayerJoin(PlayerJoinEvent event) {
        Player player = event.getPlayer();
        if (!playerHeat.containsKey(player.getUniqueId())) {
            playerHeat.put(player.getUniqueId(), 0.0);
        }
    }```
misty current
#

wait actually it might be doable

#

hmm i'll consider

#

ima go eat now

tardy delta
#

wdym?

noble lantern
# misty current hmm i'll consider

I would assume all you would have to do is either set mining state on a block, if possible ofc, or play a fake mining animation on the block and set its speed anim speed to 0

summer scroll
tardy delta
#

i dont understand

#

also Map#putIfAbsent is something

noble lantern
tardy delta
#

uhu

noble lantern
#

However, it does remove the if check i forgot about that part

acoustic pendant
#
 Map<UUID, Double> playerHeat = new HashMap<>();
    Map<UUID, Double> playerCold = new HashMap<>();
    @EventHandler
    public void onPlayerJoin(PlayerJoinEvent event) {
        Player player = event.getPlayer();
        if (!playerHeat.containsKey(player.getUniqueId())) {
            playerHeat.put(player.getUniqueId(), PlayerHeight.heat);
        } else if (!playerCold.containsKey(player.getUniqueId())){
            playerCold.put(player.getUniqueId(), PlayerHeight.cold);
        }
    }```
#

something like this you mean?

#

nope, doesn't work

tardy delta
#

instead of java if (!playerHeat.containsKey(player.getUniqueId())) { playerHeat.put(player.getUniqueId(), PlayerHeight.heat); }
use

playerHeat.putIfAbsent(player.getUniqueId(), PlayerHeight.heat);```
acoustic pendant
#

but i need the if

tardy delta
#

putIfAbsent checks if the key doesnt exist so you dont need the if anymore

noble lantern
#

Damn yall im banned from maven 😢

tardy delta
#

or if it's mapped to null

#

):

acoustic pendant
tardy delta
#

yes but what are you trying to change from the scoreboard?

acoustic pendant
#

this two values

#

i want to be different per players

quaint mantle
#

make it non static

tardy delta
#

you cant put two times the same key

#

it will overwrite the previous

quaint mantle
#

Oh wait

tardy delta
#

xd

acoustic pendant
tardy delta
#

ah uh

#

my bad

acoustic pendant
#

but still the same problem

torn shuttle
#

huh did the barrier particle change for the 1.18 snapshot api again?

#

I'm now getting block markers requiring data

misty current
#

in a map Location, Integer

#

but then when a player starts mining the block again, i'd have to make so each time a mining packet is sent, it gets modified to the last saved state +1

#

and when the state is 10, break the block and spawn the item

#

and delete the mining stat

noble lantern
#

Yall i wanna apologize

#

I was gonna rant on you all for why maven is so retarded when importing local jar files

lost matrix
noble lantern
#

But then i realized....

#

i wa susing net instead of com :c

lost matrix
noble lantern
#

Like i was typing up a storm on why maven is bs for importing jar files lmfao

rancid hare
#

HEy guys I developed an Rank plugin which works with permissions https://www.spigotmc.org/resources/oranks-1-17-x.96208/
Everything is working BUT if I reload the server, everyone which is on the server will loose his rank because LuckPerms is loading AFTER Oranks

Is there anything I can do so that my plugin loads AFTER any permission plugin?

noble lantern
#

And i thought it was maven being stupid

lost matrix
#

F

misty current
#

btw burchard were you the guy looking for people to dev a server on MH? did you start working on anything?

noble lantern
#

i used net instead of com and i was confused for well over 15 mins

misty current
#

lol

noble lantern
#

dms?

misty current
#

sure

wide creek
#

how can I check if the player exp level is minor 15?

misty current
#

get the level of player

#

and check

wide creek
#

yes, but there isn't a method that returns the exact level

quaint mantle
#

it is horrible

#

ngl

#

dont just tell people not to reload it

slim kernel
# lost matrix F

Yo you helped me a while ago with this Pathfinder thing, maybe you remember. I got a issue with it now. Do you have time right now to look at it?

rancid hare
#

Is there something like a permissionchangeevent? @quaint mantle

quaint mantle
#

wtf? why u asking me that?

#

there are javadocs lol

lost matrix
lost matrix
lost matrix
slim kernel
lost matrix
slim kernel
quaint mantle
#

mkv?

#

that looks sus

slim kernel
#

its a video

#

why sus

#

better?

lost matrix
#

Ok lets see if i can remember what i fabricated there...

summer scroll
slim kernel
quaint mantle
#

Anyone got a clue why there's ghost block being created where the falling sand dissapears?

#
        public void run() {
            for (Location loc : getCircle(l, rad, (rad * ((int) (Math.PI * 2))))) {
                FallingBlock fb = loc.getWorld().spawnFallingBlock(loc.add(0, 0.1, 0), loc.getBlock().getType(), loc.getBlock().getData());
                fb.setDropItem(false);
                fb.setVelocity(new Vector(0, .4, 0));
            }
            rad++;
            rad = (((rad % 20) == 0) ? 1 : rad);
        }```
opal juniper
#

are they not just forming blocks?

#

or are they ghost blocks

quaint mantle
#

Ghostblocks

#

if you refresh area on the client it's just normal

opal juniper
#

hmm

quaint mantle
#
    @EventHandler
    public void onFallingSand(EntityChangeBlockEvent e) {
        if (e.getEntity().getType() == EntityType.FALLING_BLOCK) {
            e.setCancelled(true);
        }
    }```
#

The blocks are still there, just not for the client

opal juniper
#

i have done something like this before

quaint mantle
opal juniper
#

hmm

#

idk tbh lol

quaint mantle
#

It's got something to do with the block being deleted, when the falling entity dies it just sets the block to air or something

opal juniper
#

you could always try setting the block to air as well as cancelling the event

#

idk if that would work tho

#

especially for your usecase

quaint mantle
#

well I don't really want it to affect the area, just the cosmetic wave effect

opal juniper
#

the smart guy is here

#

☺️

lost matrix
# slim kernel So the problem is that it not really comes from the nearest water block anymore ...

Ok first some optimization on your WaterManager class:

public class WaterAbilityManager {

  public static Block getNearestWater(final Player player) {
    final Block center = player.getLocation().getBlock();
    // Optionals can be used like this.
    // The method ".orElse(Block)" returns the value if present or
    // the specified value if not
    return BlockFinder.findNearest(center, 10, Material.WATER).orElse(null);
  }

  public static void refillWater(final Player player) {
    final Block startBlock = getNearestWater(player);
    if (startBlock == null) {
      return;
    }
    // This is not how you get the Block a Player is looking at. You should ray trace instead.
    // final Block to = player.getEyeLocation().add(player.getLocation().getDirection().normalize()).getBlock();
    // Like this:
    final RayTraceResult rayTraceResult = player.rayTraceBlocks(3.0);
    if (rayTraceResult == null || rayTraceResult.getHitBlock() == null) {
      return;
    }
    final Block to = rayTraceResult.getHitBlock();
    final Pathfinder.Path path = Pathfinder.findShortest(to, startBlock, 20, true);
    if (path == null) {
      return;
    }
    Main.getPlugin().getTaskRunnable().addTask(new RefillWaterTask(path, player.getUniqueId()));
  }
}
smoky oak
#

how do i check if something is null again? I forgot you can't call .equals on null

lost matrix
smoky oak
#

that did it thanks

slim kernel
quaint mantle
lost matrix
# quaint mantle https://gyazo.com/98001146ca9d974f699a4b9867754468

If a Blocks state us updated then a packet is sent to the client. If the client does not have this Block then he will create it.
I think for some Blocks a physics update is triggered and thus corresponding data is sent to the clients nearby so the client
re-creates the Blocks based on those packets.

lost matrix
quaint mantle
#

well it's deleting the blocks for the client

lost matrix
quaint mantle
#

Hmm. what can I do to prevent that

lost matrix
#

This is whats probably happening

  1. Send delete packet
  2. Block gets updated (redstone, or lightning, or state change)
  3. Client becomes update packet and realises that there is no Block
  4. Client re-creates the Block and applies the update
lost matrix
# quaint mantle Hmm. what can I do to prevent that

Per-Player Block states are a bit tricky. You should probably build a whole state handler abstraction for that. It involves listening to outgoing packets and fetching those which could affect a clients perception of changed Blocks.

quaint mantle
#

so no real good way to solve this issue then

willow moss
young knoll
#

You gotta buy a rank to see diamond ore

willow moss
quaint mantle
lost matrix
quaint mantle
#

:/

quaint mantle
slim kernel
torn shuttle
#

just to make double sure, Minecraft 1.18 is still slated to come out on the 30th of this month, right?

#

no delays announced thus far?

chrome beacon
#

Yes

tardy delta
#

is there maybe a way to fix wrong blockstates in the world?

#

instead of doing it all manualy

#

worldedit seems to change them

chrome beacon
#

Are you using FAWE

#

If so that's why block states are a bit weird

tardy delta
#

nope, just normal worldedit

#

//replace seems to cause it

manic furnace
#

How can i send a player an empty line?

quaint mantle
#

sendmessage("")

digital rain
#

hello, im looking for method to decrease health of an entity

quaint mantle
#

setdamage

#

or what i forgot

manic furnace
#

And how can i sent a message with multiple lines?

quaint mantle
#

\n

#

or do sendmessage multiple times

#

example:

manic furnace
#

But when a player sen a message in this time, it will split

quaint mantle
#
p.sendMessage("");
p.sendMessage("Hewoo");
p.sendMessage("");
p.sendMessage("!!!");```
maiden mountain
#

Is it possible for Citizens NPC to have an inventory?

quaint mantle
#

or ```java
p.sendMessage("\nHewoo\n!!!");

maiden mountain
#

I tried using the Inventory Trait but it doesnt work

tardy delta
#

smh my server version doesnt support citizen

manic furnace
quaint mantle
#

but i dare you use it

manic furnace
#

How many characters fit in the chat?

quaint mantle
#

hardcoded messages arent cool bro

mighty pier
#

how do i change the weather?

digital rain
quaint mantle
quaint mantle
#

yeah def unnecessary

digital rain
#

yeah you do, entity can be an arrow for example

ancient plank
#

im an entity

manic furnace
#

Oh, sry. I mean how many characters till minecraft splits the line

quaint mantle
mighty pier
#

ok

quaint mantle
#

you cant really know

#

because that is client settings

#

but by default then idk

#

wiki might help yoi

quaint mantle
#

it dont need to cast to living entity

digital rain
#

im looking at entity tho

#

not player

maiden mountain
#

Is it possible for Citizens NPC to have an inventory?

#

I tried using the Inventory Trait but it doesnt work

mighty pier
#

how do i set the amount to args[1]?

#

cause that doesnt work

ancient plank
#

args[1] by default is a string

maiden mountain
#

Integer.parseInt(args[1]);

#

@mighty pier

mighty pier
#

ok ty

maiden mountain
#

But first, check if the value is an integer or not

mighty pier
#

i did

maiden mountain
#

Otherwise an exception will be thrown

mighty pier
#

why can i not scroll, paste or do anything in intellij?

#

it just stopped letting me

ancient plank
#

alt tab and tab back in?

maiden mountain
#

Not sure, restart the application

mighty pier
#

ok

tardy delta
#

everyone using String.valueOf(int) me Integer.toString(int) 😳

digital rain
tardy delta
#

no 😳

quaint mantle
#

😳

digital rain
#

😳

mighty pier
maiden mountain
#
  int amount = Integer.parseInt(args[1]);
mighty pier
#

ok

#

ty

quaint mantle
#

?learnjava when

undone axleBOT
tender shard
#

Is it possible that chunk's PDC are broken in 1.18-rc3?

#

Everything I save into a chunk's PDC is gone after a server restart

#
@Override
    public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) {
        Player player = (Player) sender;
        Chunk chunk = player.getLocation().getChunk();

        if(args[0].equals("get")) {
            for(NamespacedKey key : chunk.getPersistentDataContainer().getKeys()) {
                System.out.println(key.getNamespace()+":"+key.getKey());
            }
        }
        if(args[0].equals("set")) {
            chunk.getPersistentDataContainer().set(new NamespacedKey(this,"test"),PersistentDataType.STRING,"someValue");
        }
        return true;
    }
#

using /test set, then /test get, it shows "test:test", but after a restart, nothing

fast onyx
#
String online = String.valueOf(getServer().getOnlinePlayers());
e.setMaxPlayers(Integer.parseInt(online))
#

why?

tender shard
#

because getOnlinePlayers() returns a Collection and not an integer

fast onyx
#

mmm

#

understand

tender shard
#

use size() on the player collection

fast onyx
#

okay ty

tender shard
fast onyx
#

I love ur plugins mfnalex :)

tender shard
#

thx 🙂

hoary pawn
tender shard
#

you can't just add filters inside <project>

#

btw you can see the full error message when you click on the top entry on the left side

#

the one above the one you have selected

tardy delta
#

is there even a way to change the player's name above his head without using packets?

#

scoreboards hmmm

tender shard
quaint mantle
#

It is safe to extend location? I wanna make an unmodifiable wrapper around

peak granite
quaint mantle
#

ItemNamesEnum.VALUE.toString().contains(args[0])

peak granite
#

VALUE?

quaint mantle
#

whatever value your enum has that you want to compare

tender shard
peak granite
#

my command is /item <item name> i'm comparing arg0 to see if it matches an enum

tacit drift
#

how can i make it so it shows the breaking block animation on a certain block? without someone actually breaking that block

quaint mantle