#help-development

1 messages ยท Page 1021 of 1

quaint mantle
#

But I think keys are always stored as string

eternal oxide
#

it can;t unless they fixed it

wanton comet
#

if anyone know's what the problem could be

carmine mica
#

yes, and when it's read, it converts the strings into non string objects (for the stuff that isn't actually a string)

#

so the Map that MemorySection wraps, doesn't have just strings

undone axleBOT
carmine mica
#

and that doesn't happen on "get" calls ever

wet breach
#

however everything in Java can be converted to String, this is why I just use string because it literally will not fail

#

you can make any object in Java a string ๐Ÿ˜‰

echo basalt
#

DummyConnectionHandler line 12

#

what's it about?

#

show constructor :)

carmine mica
#

I'm saying this is jsut wrong

#

getLong doesn't so any "parsing"

wanton comet
# echo basalt show constructor :)
public DummyConnectionHandler(MinecraftServer minecraftserver, PacketFlow networkmanager, ServerPlayer entityplayer, CommonListenerCookie commonlistenercookie) {
        super(minecraftserver, new DummyConnection(networkmanager), entityplayer, commonlistenercookie);
    }
echo basalt
#

Right

carmine mica
#

it was a string at some point, but way before any get methods, it's been turned into somethign else

echo basalt
#

What does DummyConnection look like

wet breach
echo basalt
#

And what does the super call look like

wanton comet
carmine mica
#

literally parsing

echo basalt
#

Pretty sure you need to override a bunch of methods to be empty

eternal oxide
#

only send

#

but

wanton comet
#

so do the same I did in the handler?

public class DummyConnectionHandler extends ServerGamePacketListenerImpl {
    public DummyConnectionHandler(MinecraftServer minecraftserver, PacketFlow networkmanager, ServerPlayer entityplayer, CommonListenerCookie commonlistenercookie) {
        super(minecraftserver, new DummyConnection(networkmanager), entityplayer, commonlistenercookie);
    }

    @Override
    public void send(Packet<?> packet) {
        // empty because we don't want to send packets as this is a fake connection
    }
}
eternal oxide
#

What spigot version are you doing this dummyConnection?

wet breach
#

anyways I am done arguing with this as its pointless

#

point is, as I said initially this is why I use string as grabbing it as a string will never fail

#

ever

#

unless your path is wrong and you get an NPE

carmine mica
#

I was never ever talking about that. I was talking about the incorrect things you were saying about other things

wet breach
#

I don't care anymore

eternal oxide
# wanton comet 1.20.4

This is a little old but the simplest way ```java
public class Npc extends ServerPlayer {

Npc(MinecraftServer minecraftServer, ServerLevel worldServer, GameProfile gameProfile, ProfilePublicKey publicKey) {

    super(minecraftServer, worldServer, gameProfile, publicKey);

    this.connection = new NetworkHandler(minecraftServer, this);
}```
wet breach
eternal oxide
#

the NetworkHandler is```java
public class NetworkHandler extends ServerGamePacketListenerImpl {

public NetworkHandler(MinecraftServer minecraftserver, ServerPlayer entityplayer) {
    super(minecraftserver, new Connection(PacketFlow.CLIENTBOUND), entityplayer);
}

@Override
public void send(Packet<?> packet) {
    // Empty as we never want to try to send packets to a fake player.
}

}```

wet breach
#

second the spec doesn't define how implementations can do stuff

carmine mica
#

I specifically mentioned MemorySection a couple times now, which isn't snakeyaml, that's bukkit

#

MemorySection just essentially wraps a Map<String, Object> where stuff is already parsed into non-String types

#

so getLong doesn't do anything except check if its already a number

wet breach
#

seems like a flaw then

#

anyways, I recommend just grabbing everything as a string

carmine mica
wet breach
#

because obviously it can't differentiate a long with a L

#

if it failed on it

#

if it did a valueOf java would accept it

carmine mica
#

what

#

no, valueOf does not accept L suffix

wet breach
#

it must be some other method I am thinking of that lets you specify L

#

anyways, just use strings ๐Ÿ™‚

#

won't hurt anything and you don't lose anything on performance and you can do your own type checking

quaint mantle
#

I would just use strings when there's no other option

wet breach
quaint mantle
#

That's not a good practice on my opinion

wet breach
#

I already explained that file parsing is one of two things. It is either binary or it is a string. All objects in Java can be conveyed as a string. So there is literally no where you can go wrong with grabbing as a string

wet breach
carmine mica
#

just using getString always isn't good. You shouhld have it setup in such a way that it's already the type you want, number, bool, your custom type

#

then its just a map lookup instead of re-parsing anything

carmine mica
#

well it literally does

#

it's extra instructions which could be avoided

wet breach
#

if you can show that it hurts performance beyond a few nanoseconds I will believe you

carmine mica
#

ofc it depends on how often you are doing it

#

but its always good to have good practices even if it doesn't have any real impact in the specific scenario you are working with

wet breach
#

it is good practice to not have it fail

carmine mica
#

and it wont fail

#

if you put a number into a yaml file, getLong will work, it'll just work

wet breach
#

you are right using a string won't fail

#

which I guarantee all my stuff to always work

#

its not dependent on what an api thinks

grim hound
#

I don't get it: when doing a lot write(s) on a lot of packets and then flush the minecraft client accepts the packets. But when doing so using the Channel.Unsafe and doing a singular write with the packets being in a single ComposedByteBuf the client disconnects (the packets are correctly formatted, I checked on a localhost, the disconnect happens when the server is a remote one).

slender elbow
#

using a string will only delay the failure

#

inevitably

grim hound
slender elbow
#

if it would fail early, it will fail later

wet breach
#

the only way you can fail with pulling it in as a string is if your path is wrong

carmine mica
#

if its a number, it will be a number and the getNumber methods will work

#

if its not a number, itll be a string, and your parsing/valueOf you do on getString will fail

wet breach
#

that didn't answer the question

carmine mica
#

that's delaying the failure

wet breach
#

no

slender elbow
#

you just claim that "using a string won't fail", but if you need a long you inevitably will have to parse it, using a String to delay the parsing until you need the long won't avoid the failure, it will just delay it

wet breach
#

well it won't if you want the config to load

quaint mantle
#

What you are doing is just "ignoring" if the value you are expecting to be a number is not

wet breach
#

it just depends why you needed the stuff. It also depends if you allow the ability of it to be fixed

quaint mantle
#

Which is, in fact a bad practice

wet breach
#

or error correction

quaint mantle
#

As the user don't know that he has a bad value

#

If there's a problem, the user should know about it

#

So he can fix it

#

Not "ignore" it and do something behind it

wet breach
#

and you can't do both?

slender elbow
#

fail-fast is a very common programming practice

#

you want to validate the user input is correct

eternal oxide
wet breach
#

validating user input is important, but you can sanitize too or correct

#

no one said you couldn't nor is it against any standards

#

if you know something is a number, and the only reason its not accepted as one was because of a single letter

#

you would rather the entire thing failing?

#

even though that thing is not really all that important

carmine mica
#

um yes 100%. you're gonna try to coerce a string into a number using some vauge set of rules that aren't well known or described?

#

"what if thers a random a char in the number, its probably a typo, ill just ignore it"

wet breach
wet breach
#

that is literally what sanitizing is

#

just because you choose to not do it, doesn't make it wrong

#

its a valid concept and standard

grim hound
#

just says "Disconnected"

#

no server-side errors either

wet breach
grim hound
#

I think no

#

the client log itself is weird

#

lemme retry

wet breach
#

well client log is no different then the server log

astral pilot
#

ok the issue was isLong() returns false but getLong() works even tho isLong() is false

wet breach
#

would suck if it also didn't provide anything in the client log

grim hound
#

and that's it

wet breach
#

so....whats with the custom identifier?

grim hound
#

I have no idea

astral pilot
#

anyone why does isLong() return false even tho its a number

wet breach
carmine mica
wet breach
#

minecraft:register is to register plugin channels if I am not mistaken

#

let me go look

carmine mica
#

isLong only returns true of the value is an instanceof Long

#

but getLong will turn any Number instance into a long

eternal oxide
carmine mica
eternal oxide
#

his isLong and getLong are both failing, so his path is wrong

carmine mica
#

getLong works

grim hound
eternal oxide
grim hound
#

so this doesn't seem to be the issue

#

the client literally just decides to disconnect

astral pilot
eternal oxide
#

and isLong returns false. Both things point to wrong path

slender elbow
#

if in my yaml i have foo: 123, isLong will be false but getLong will be 123

carmine mica
#

I don't think they'd describe getLong as "working" if it still returned 0 when it was supposed to be another number

eternal oxide
grim hound
wet breach
grim hound
#

and I send it raw, so like this

grim hound
grim hound
#

translated into bytebufs

#

and then combined into a composite bytebuf

icy beacon
#

my project has 0 warnings!!! not even deprecations or unused imports it's legit just typos

#

wow first time this has happened to me probably

grim hound
wet breach
grim hound
grim hound
#

and when the client decodes it

#

he understands that those are 600 packets

wet breach
eternal oxide
#

sounds like some packet size issue then

grim hound
#

but at the same time

#

the data sent when I was writing the bytebufs seperately and only then flushing

#

is matching in size

#

thus the os doesn't block anything

wet breach
#

its quite possible that its either a packet size issue, or the timing of the packets is triggering firewall/anti-ddos related stuff

grim hound
eternal oxide
#

or he has an odd MTU between him an the server

wet breach
grim hound
#

the data size is the exact same

wet breach
wet breach
#

server isn't disconnecting otherwise you would had an error that stated other end closed the connection

#

so its on the client side that the connection is just being terminated

grim hound
#

then what am I supposed to do?

astral pilot
wet breach
astral pilot
wet breach
#

try sending half as many of them

grim hound
astral pilot
#

where isLong shows false but getLong gives value

wet breach
#

well common MTU is 1500

#

if your packet is larger then 1,500bytes or whatever the MTU is set at it will break up your packet into smaller packets anyways

#

the lowest MTU on the network between you and the server is what dictates packet being split

#

however its not common to have some device have a lower MTU size of 1500 although it is possible

#

but I don't think MTU here is the issue, just this is an answer if you were trying to send the largest packet without it being split up

slender elbow
wet breach
#

I am thinking the amount of packets being sent at one time and then being received is the issue

grim hound
#

so I'm wondering what I should set the byte split limit to

wet breach
#

well it makes no sense to have it be above 1500

#

since the network devices and your nic will split at that

#

also MTU is the size of packett itself, not just the contents

#

so you minus TCP header from that number

astral pilot
wet breach
#

and you should get a general idea for content size

grim hound
#

I'll try with 1000 and see how it goes, thanks

wet breach
#

if you still disconnect

#

I would then try sending the packets slower

grim hound
#

you don't get it

#

when I write them like in a for loop

#

and then flush

#

everything seems to be flushed

#

immediately

#

and the client interprets it as normal

wet breach
#

and client doesn't DC?

grim hound
#

yep

wet breach
#

alright, so what are you doing now

eternal oxide
hazy parrot
grim hound
#

where I just see what the server would normally send

#

copy it

wet breach
#

ok but you are not looping anymore and you changed that?

grim hound
#

and then send it from the lowest point in netty

grim hound
#

normally I'd do for(ByteBuf buf : buffers) user.writeSilently(buf); and then like user.flushSilently();

#

which just invoke a write on a ChannelHandlerContext

#

that is of the packet events handler (so that they're not intercepted)

wet breach
grim hound
#

it works

#

but it's too slow

grim hound
#

but it's about 200 times faster

wet breach
#

yes but that is because the loopback doesn't interfere like your nic and other network related connections would

#

you are not understanding that devices actually have rate limits and other settings

#

loopback ignores such things

blazing ocean
wet breach
#

its quite possible that sending 600packets in less than a second

#

is causing either the network driver to think its an attack

#

and just severes the connection or something other that is similar

#

idk what unsafenetty utils does

#

either

grim hound
#

YOO

#

WAIT A SEC

#

I just set use-native-transport to false

#

cuz on my pc it's windows

#

and that server is on linux

grim hound
grim hound
grim hound
#

no disconnecting

wet breach
#

nice, eventually we would have gotten there ๐Ÿ˜›

grim hound
#

xD

astral pilot
wet breach
#

technically was a hardware issue

#

๐Ÿ˜‰

astral pilot
grim hound
#

but I can't just tell my plugin users "disable native transport" cuz that's stupid

wet breach
#

well driver I guess

grim hound
astral pilot
eternal oxide
#

that shoudl work for snake, but I guess no mor

wet breach
#

lol

grim hound
astral pilot
#

anyways thanks for the help guys

#

appreciate it

grim hound
#

no idea what driver is tho

wet breach
grim hound
#

crazy

#

this guy's got some brains

wet breach
#

they said what I was going to say

#

UnsafeNettyUtils might be using NIO

#

but you are telling the server to use Epoll

grim hound
wet breach
#

ok, but the methods you are making use of

grim hound
wet breach
#

might be making using NIO

icy beacon
#

how do i submit parameters from a html form? this is just a form that i use for testing my stuff, i need to pass parameters code and id and a multipart (file), not sure if i'm doing it properly

<form enctype="multipart/form-data" action="http://localhost:21247/v1/update_pack" method="POST">
        <input type="hidden"/>
        Choose a pack to update: <input name="uploadedfile" type="file" /><br />
        Input the pack id: <input name="id" type="number" /><br />
        Input the secret code: <input name="code" type="password" /><br />
        <input type="submit" value="Upload File" />
    </form><br>

apparently i need to use javascript which i would rather not... if someone could spoonfeed the code to me i would greatly appreciate it lmao

wet breach
#

and not Epoll

grim hound
still ridge
#

why it's not possible to create custom recipe choice ? ๐Ÿค”

wet breach
#

for epoll specifically?

grim hound
wet breach
#

ok....I guess you are not understanding

grim hound
#

yep

#

affirmative

wet breach
#

there is different implementations that can be used in regards to network handling stuff. NIO is java's implementation

#

Epoll is another

#

then you have kqueue

#

and there is others

#

fortunately we only have to be concerned with NIO and Epoll and not some others

grim hound
wet breach
#

I wouldn't say shortcut for better performance

#

there is times epoll sucks

#

and nio wins

#

like your example for instance

#

you may be sending packets quickly and jumping the queue

#

but what happens when 20 players show up while you have 50 trying to play?

#

that is 12k packets that jumped the queue

#

that is fine if you are prioritizing those who are new I guess, but NIO works best with this especially if you are only using a single thread

#

also note

#

for every packet sent, the client has to send one back

#

because in TCP an ack has to be sent that the packet was received

#

if the server doesn't get the ack in a timely fashion it will send a packet again depending on which it didn't get an ack from

#

and then if the client gets the packets out of order, it will wait to send an ack until it gets the order

#

all this sounds insignificant but they are important depending on the implementation trying to be used lol

grim hound
wet breach
#

in general yes. But epoll sucks if connections are long lasting, you are not making use of multiple threads etc

#

well you are not getting the benefits of epoll if that is the case

grim hound
#

so uh

#

do I just check what kind of transport is used

wet breach
#

mmm, I would try investigating further why native transport is the issue here

grim hound
#

and then if NIO I can use my unholy magic and otherwise I use the slower methods whilst giving a console warning?

wet breach
#

I am guessing as I said earlier it just has to do with how many packets you are sending and how quickly as well as you jumping the queue it seems? Not sure if you are leveraging the threads that netty has

grim hound
wet breach
#

yeah, I would just do a test with the number of packets first

#

and just keep increasing until it fails XD

grim hound
wet breach
#

yeah that might help too

#

how much data per packet

grim hound
#

btw

#

how do I check what is used?

#

statically

#

cuz dynamically I could check for the Channel class type

#

oh wait, I know, nvm

#

just checking the server Channel's type

lean pumice
#

if the player is sneaked, how i can get the block under?

eternal oxide
#

get teh block under them when they toggle sneak (event)

lean pumice
wet breach
#

player location - 1

grim hound
#

bytes

eternal oxide
#

sneaking allows them to overhang

wet breach
grim hound
#

didn't you say 1500?

wet breach
#

for the entire packet

grim hound
#

ye

wet breach
#

all you are doing is modifying content

#

which ignores all the other stuff related to TCP

lean pumice
grim hound
#

975 is accepted

wet breach
#

in your case though it seems you might have a network hardware that is set at MTU of 1300

grim hound
#

1105 is denied

#

seems like 1k

wet breach
#

at 1500, with most compatibilities, generally you could send 1380 bytes

grim hound
#

is the limit

wet breach
#

but if your MTU limit is set less

#

then you get less like in your case lol

grim hound
#

and can you even check that server-side?

wet breach
#

you keep sending a packet until it fails

wet breach
#

just whether or not it was successful

#

but let me check

wet breach
grim hound
#

how???

wet breach
#

I knew there was, but how you will implement it in the application is a different story

#

anyways ICMP will inform you if a packet needed to be fragmented

wet breach
#

its a protocol, most commonly used for pinging

#

Internet Control Message Packet?

#

if I remember right

#

anyways, when you use it for pinging you can specify the size of the packet to send the ping

#

and there is an option to have it inform if the packet was fragmented

#

so you either start at an arbitrary high value and lower until it doesn't fragment

#

or vice versa until it fragments lol

#

on windows you can use the ping command

#
ping www.google.com -f -l 1492
#

1492 being the size of the packet in bytes

#

so for me

#

1472 was the max I could send via ping anything higher and it fragmented

grim hound
wet breach
#

it tells you

grim hound
#

it doesn't tell you the threshold, you just gotta keep guessing?

wet breach
#
C:\Windows\system32>ping google.com -f -l 1472

Pinging google.com [142.250.113.113] with 1472 bytes of data:
Reply from 142.250.113.113: bytes=68 (sent 1472) time=16ms TTL=57
Reply from 142.250.113.113: bytes=68 (sent 1472) time=22ms TTL=57
Reply from 142.250.113.113: bytes=68 (sent 1472) time=18ms TTL=57
Reply from 142.250.113.113: bytes=68 (sent 1472) time=14ms TTL=57

Ping statistics for 142.250.113.113:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 14ms, Maximum = 22ms, Average = 17ms

C:\Windows\system32>ping google.com -f -l 1473

Pinging google.com [142.250.113.113] with 1473 bytes of data:
Packet needs to be fragmented but DF set.
Packet needs to be fragmented but DF set.
Packet needs to be fragmented but DF set.
Packet needs to be fragmented but DF set.

Ping statistics for 142.250.113.113:
    Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),
grim hound
#

cuz Runtime.getRuntime... execution

#

is rather slow

wet breach
#

so notice that it didn't send the ping if it fragmented

#

so you could easily tell if it succeeded or failed lol

grim hound
wet breach
#

not entirely sure

#

you could see if there is ICMP libraries

grim hound
#

btw for me 1040 was accepted xD

wet breach
#

but keep in mind, this is ICMP and not TCP

eternal oxide
#

on linux ifconfig| grep -i MTU UP BROADCAST MULTICAST MTU:1500 Metric:1 UP LOOPBACK RUNNING MTU:65536 Metric:1 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

wet breach
#

that is to get the default defined MTU

grim hound
#

that they can have different fragmentation thresholds

wet breach
#

yep, but you could just go with 3/4's of what is found from ICMP

#

and the reason the threshold is different is because TCP has more data in the headers then ICMP

#

but ICMP is higher up on the level in the network then TCP

#

as well

#

ICMP is layer 3

#

where as TCP is at layer 4

icy beacon
#

is there an easy way to parse a component string to an item? (/minecraft:give's syntax)

wet breach
#

you could probably check if it exists in the materials list?

blazing ocean
#

dfu

#

๐Ÿ’€

icy beacon
#

i do not think that is whati need

icy beacon
blazing ocean
#

please don't

#

there's probably better ways

#

dfu is just a pain when not using mods

icy beacon
#

๐Ÿ˜ฆ

wet breach
#

you want to turn what they specify in the command into an item?

blazing ocean
icy beacon
#

the give command was just an example

#

data components are now a thing

#

i want to parse a component string into an itemstack

#

example from minecraft.wiki
minecraft:diamond_block[minecraft:can_place_on={blocks:"minecraft:dirt"},minecraft:can_break={blocks:"minecraft:quartz_block"}]
stick[attribute_modifiers=[{type:"generic.scale",slot:"hand",uuid:[I;547231302,-391626178,1591181916,1572689867],name:"",amount:4,operation:"add_multiplied_base"}]]

wet breach
#

so you would get the material form of it, and create an itemstack with that material

icy beacon
blazing ocean
#

does material even support components

icy beacon
#

i am NOT parsing that manually

carmine mica
#

Use the UnsafeValues method modifyItemStack

icy beacon
carmine mica
#

yeah, there's a method there that takes an itemstack and a string which is passed to the Itemparser

wet breach
#

I suppose that is one way

#

but other then that, I am not aware of any other way

icy beacon
#

kk ty i'll take a look

wet breach
#

and its not like you really have to parse much, literally need to find minecraft: and then anything after and before [

icy beacon
worldly ingot
#

You want ItemFactory#createItemStack(). You don't need unsafevalues

worldly ingot
#

You could throw into it that exact string you sent above and it'll pop out an ItemStack

worldly ingot
#

It just passes it through the ItemStackArgument for commands (e.g. the one used in /give)

rough ibex
#

my mind instantly went to /give

worldly ingot
#

I added it back in like 1.17 or something. It's a couple years old at this point

wet breach
#

its not like I read every commit >>

worldly ingot
#

:p

wet breach
#

but I am surprised I missed that

worldly ingot
#

Also, it was 1.18.2. I was so close!

wet breach
#

lol

grim hound
#

they CAN have different fragmentation?

#

aight, nobody's gonna set it up higher than 1k, surely

eternal oxide
#

oh interesting. IPv6 drops over sized packets

#

IPv6 does not allow fragmenting

grim hound
eternal oxide
# grim hound WHAT

IPv4 allows fragmentation so packets can exceed teh MTU as they will be split and reassembled. IPv6 does not and will drop over sized packets

grim hound
#

amigo

#

NOOOOOOO\

#

MORE POTENTIAL PROBLEMS

eternal oxide
#

lol

grim hound
#

NOOOOOOOOOO

wet breach
#

I just assumed ipv4 since everyone seems to run their mc servers on ipv4

#

good news though

#

ipv6 mtu has to be minimum 1280

eternal oxide
#

yep

#

IPv4 can be low, around 570 ish if I remember

grim hound
orchid gazelle
#

IPv6 is annoying

grim hound
#

yeah SCIENCE

orchid gazelle
#

they look garbage

wet breach
# grim hound oh now we speaking numbers

well what I am saying is since the packet you send with ipv4 needs to be less then about 1300 anyways to ensure no fragmentation, you can just limit to the size of ipv6 minimum of ipv6

grim hound
#

I was gonna assume 1280 for ipv6 and 1000 for ipv4

wet breach
#

also

#

I just found out you can find out the fragmentation level with tcp

#

you just set the DF option in the header

#

anything along the path that doesn't support the packet size will drop it

#

DF = Don't Fragment

eternal oxide
#

and returns a ping packet with the MTU

wet breach
#

^

#

so in regards to implementing in your application in finding out largest packet you could send, is actually simpler

#

the only thing is you will have to implement the connection stuff for that yourself though and not rely on the netty stuff

#

unless there is something in the netty stuff that would allow you to create a netty connection separate from the MC stuff

grim hound
#

so I still need to figure this out by myself?

wet breach
#

yes but no

#

instead of trying to figure out how to use ICMP

#

you can use TCP instead

#

you just have to initiate a connection somewhere and send a packet with the DF flag in the header set

dreamy chasm
#

just updated to 1.20.6 including remapped jar and am getting this, anything I am missing other than changing pom and downloading/selecting java 21?

blazing ocean
#

change jdk in project structure?

#

also try a clean build

dreamy chasm
#

yeh that is on 21 as well

#

yup done that

#

ah, found it, problem was I just changed the version from 1.20.4 to 1.20.6 but left the specialsource-maven-plugin version, and that needed to be changed also

tender shard
#

anyone know if there's better way to prevent players from jumping? Because this cancels player's current velocity

nova notch
#

It was that or negative jump boost or something

young knoll
#

Yeah jump boost > 128

#

Which overflows to negative

tender shard
#

hm lets try

blazing ocean
fair rock
blazing ocean
#

you could check for y level increase in move?

tender shard
#

why should I? the statistic is much easier

blazing ocean
#

place barrier above the head?

young knoll
tender shard
echo basalt
#

client-sided barrier

#

used to do that

young knoll
#

Target their spacebar with an ICBM

nova notch
blazing ocean
nova notch
#

?

#

You can still walk up stairs and slabs

young knoll
#

Nah you can still autostep with the negative jumpboost

analog lantern
blazing ocean
#

is still buggy

nova notch
#

No... It's not

blazing ocean
#

visual glitches for me

nova notch
#

I've made an entire game out of it

analog lantern
#

weird

#

You could try a player velocity event but without a dedicated PlayerJumpEvent like paper has, statistics might be your best bet

blazing ocean
nova notch
#

Never seen that happen

blazing ocean
#

i literally just jumped 400 blocks in the air

nova notch
#

Maybe it's a 1.20+ thing then

blazing ocean
#

am on 1.21

analog lantern
#

yeah its possible its been fixed

nova notch
#

It worked fine a few versions ago

blazing ocean
#

my server when i die

#

fun

#

not general whoopsie

tender shard
blazing ocean
#

it's always gonna look buggy on the client

tender shard
#

that's not the issue

blazing ocean
#

ah i just saw the last bit

tender shard
#

the issue is it doesnt detect jumps "off the edge"

slender elbow
#

i mean the client doesn't really tell the server "i am trying to jump"

analog lantern
#

thats true

slender elbow
#

it's based on the delta i believe

worldly ingot
#

and is the reason we never added a jump event in spigot - because a "jump" event doesn't technically exist without making something hacky :p

slender elbow
#

and if you try to diy it's probably gonna be the same approach and suffer from the same potential false positives lol

worldly ingot
#

Yepyep

#

Do you know off hand if Paper keeps dx/dz changes despite a cancelled dy? This is just the client being annoying?

slender elbow
#

i don't

tender shard
worldly ingot
#

Yeah but is that what it actually does in implementation?

worldly ingot
#

btw you can use nogui to hide that second GUI lol

tender shard
#

but then I#d have to type nogui everytime lol

worldly ingot
#

Well, yeah, but make a run script KEKW

blazing ocean
worldly ingot
#

I wonder why they opted to use the from position?

blazing ocean
#

you are 36 builds behind

worldly ingot
#

Surely using some delta x/z values would be better

tender shard
#

not on spigot

safe sleet
#

How can I show the active player on the bot?

blazing ocean
#

waht bot

safe sleet
#

npc

#

please help

blazing ocean
#

please explain what you want

#

we cannot help you without more information

safe sleet
#

Dude, I want to show how many players are active in that world under the NPC.

tender shard
#

which NPC?

safe sleet
#

ฤฑd 1

#

id 1

tender shard
safe sleet
#

I didn't see

restive mango
#

How do you make a packet listener for nms packets and not protocol lib packets?

night scroll
#

Hello everyone i have a question, where can i found early components of a craftbukkit server?
Like org.bukkit.minecraft-server for version 1.5.1R0.2, early i getted them from nexus repository, are they erased now?

young knoll
#

Yes

#

Afaik there is no official source for craftbukkit from before 1.8

night scroll
#

There was earlier

night scroll
noble lantern
#

Can get calls to player inventories be async?

wet breach
#

but it might be possible with the latest versions though considering player inventory is always open

wet breach
#

but I won't disclose where >>

noble lantern
wet breach
#

Well, I know that if it modifies the world in any way it can't be async

noble lantern
#

Yee thats about all I know as well too

wet breach
#

which technically code created inventories can be async

#

since they don't actually have to be attached to anything

noble lantern
wet breach
#

yeah not entirely sure

#

you could test it out

#

worse that happens is you get a CME

#

well ok that isn't the worse

#

worse is you encounter some weird glitch/bug from doing it lmao

noble lantern
# wet breach worse is you encounter some weird glitch/bug from doing it lmao

yeeeah this would be the main thing ๐Ÿคฃ

I was gonna think could just clone player inventory -> manage it off thread -> then shove it back on the main thread but any changes during that async awaiting to the player inventories would need to be taken into account or else you get a weird situation where dupes are possible just by existing ๐Ÿคฃ

wet breach
#

yeah

#

and that is pretty much the premise in how you make stuff non thread safe, thread safe

#

ultimately you clone it

#

do some stuff, bring the result back to main thread

noble lantern
#

I really wish things like creating entities could be done async

#

That would be such a big help for some performance things, but Minecraft bitches about spawning entities async :c

young knoll
#

Well technically spigot does

noble lantern
#

What method is it?

#

Or is it all entities in general are spawned async

young knoll
#

What

mellow hazel
broken nacelle
#

?stacktrace

undone axleBOT
agile plover
#

Hey, I am trying to make my plugin compatible with multiple versions (using nms)
How can I import with maven multiple versions of spigot (mojang remapped) and reobjuscate when compiling?

sullen marlin
#

You could just not use NMS ๐Ÿ™ƒ

young knoll
#

Okay but how else will I unfreeze registries

echo basalt
#

Anyone knows a way I can basically do a T<V>?

#

I have a Property<T> interface and I want to make a PropertyHolder<T extends Property<?>> so I can do stuff like setProperty(T<V> property, V value) type deal

#

I guess I can do some abstraction for filtering but it's a little icky

#

Hm

torn shuttle
#

that just made me realize how long it's been since I last used generics

#

not a fan

echo basalt
#

omw to do a very funky cast

torn shuttle
#

i'm like 99% sure that's what I ended up doing last time I did generics too lol

#

how's your chicken grease supplier doing? Has he bought a lambo yet from your degenerate eating habits?

echo basalt
#

great question

#

he's on holiday

torn shuttle
#

what a national tragedy

#

guess he'd be able to afford a holiday after all the patronage you give him

echo basalt
#

how the fuck did I manage to specify a generic that I can't specify

#

fuck it unsafe cast

torn shuttle
#

my man

drowsy helm
#

You probs have to take the class in first

#

Since T<V> assumes the class has a type V aswell

echo basalt
#

Hm

#

I'm just tryna see if there's a generic way of achieving this

#

this is gonna get big

drowsy helm
#

Like instead of taking ControlProperty?

echo basalt
#

Instead of the methods being hardcoded to take ControlProperty

#

I'd like to have a PropertyContainer<ControlProperty>

#

I could hm

#

HmmMMm

#

Split ControlProperty away from Property as just a tag interface

#

And then make a merged interface

restive mango
#

how the ever loving christ does PlayerInfoData work

#

im going to explode

carmine mica
#

just have to add a second generic to Property

echo basalt
#

Which is itself?

carmine mica
#

idk if that will work, but this is just a separate type that is just for the "property type" essentially

#

then your holder has that as the generic, and each method then requires a property of that type

echo basalt
#

I'd like to see it in action

#

Can't really wrap my head around this

drowsy helm
echo basalt
#

this is funky

#

beyblade lookin ass

carmine mica
echo basalt
#

Any way I can do this without nested classes

carmine mica
#

well yeah, I just did that so its all on one screen

#

they don't have to be nested at all

restive mango
carmine mica
#

also, no unsafe casts or anything jank like that

restive mango
#

like do I need a different PlayerInfoData for every PlayerInfoAction?

echo basalt
#

I need to take like 5 looks at this

#

Does the PropType class need to exist

#

Or can I just omit it

carmine mica
#

I think you need it. That's what you use in the Holder generic instead of the actual Property type

#

its just an empty type

echo basalt
#

Because I want just generic properties for int and stuff

carmine mica
#

I mean you can have that?

#

you only need as many prop types as you have different types of properties, not different generic params for properties

echo basalt
#

ah

#

alr

#

do I also need the empty nested class

carmine mica
#

the SomePropertyType and OtherPropertyType? yeah, you need one of those per types of properties (not per different generic param in the Property)

#

so if you've got Properties that only apply to like an entity, then you have an EntityProperty<V> and its got an EntityPropertyType

#

and then BlockProperty<V> & BlockPropertyType

#

and then the different holders for those 2 property types, and you won't be able to mix properties between the two

drowsy helm
carmine mica
#

maybe it makes more sense if I use block and entity

#

so you can see that this prevents you from using some block property in an entity property holder

echo basalt
#

still gonna use an unsafe cast lol

#

I guess it can be made safe by inheriting

#

Well hmm ๐Ÿค”

carmine mica
#

well yeah, you will need an unsafe cast there obviously. But that's to be expected so long as you guard against putting stufff in the map that doesn't match

#

you always need unsafe casts getting from a map when doing some generic "property" system

echo basalt
#

interesting

#

alright this works

carmine mica
#

oh yeah, the generic on the get from PropertyHolder to just have Property<V, T> which you did

#

might make it clear if you still do <P extends Property<V, T>>, idk tho. up to you

echo basalt
carmine mica
#

I would leave the empty "type" classes as inner classes of the property types, just cause its less files and they are literally only 1 line

echo basalt
#

Yeah I'll do the same

#

this will end up as a bedrock JSON-UI wrapper thing so I might credit you once this goes public

#

Thing's heavily undocumented and the only public projects out there are written in php / some random shell script

wicked sinew
#

Anyone here happen to ever work with CoreProtect? ๐Ÿคฃ I've been trying to get the API to work for weeks but never been able to use it

#

Using CoreProtect v22.4, Using the snippets for API v10, and logRemoval just refuses to work yet returns success

#
Bukkit.getServer().broadcastMessage(String.valueOf(getCoreProtect().APIVersion()));
  CoreProtectAPI api = getCoreProtect();
  if (api != null){ // <- works
      api.testAPI(); // <- works
      player.sendMessage("CoreProtect API SHOULD be working..");
      // logRemoval(String user, Location location, Material type, BlockData blockData)
      boolean success = api.logRemoval("Notch", block.getLocation(), block.getType(), block.getData());
      player.sendMessage("Success?: " + success);
restive mango
#

i guess my issue is

#

like, if I listen for packets which only have one of the PlayerInfoActions... how does that work with modifying PlayerInfoData?

drowsy helm
dawn flower
#

so uh, i'm making coding in minecraft for fun
what's a good input method that accepts unlimited lines

#

or at least ALOT of lines

noble lantern
dawn flower
#

i'm talking about the players

#

normal players

noble lantern
#

OHH you mean input my bad, books would be the biggest thing players can type in, other than that would just have to let them type in chat then cancel the message thats sent and use that as the input

dawn flower
#

chat is great but it isn't multiline

#

i might use books

#

and combine the pages

drowsy helm
#

what are you doing

drowsy helm
#

yes whats the usecase tho

#

OH

#

a plugin that parses code?

dawn flower
#

pretty much

#

i already made the intrepreter but i want a way for them to write their code

#

another flaw with books is they don't allow tabs, i'm prob gonna make them write 4 spaces or tell them to write it in a text editor or smth

#

is it a good idea to give them java functions (including spigot)

can i limit them to only do stuff in their plot so they cant for example ban someone from the whole network but instead they ban someone from their own plot through the java functions

#

other than creating a subserver for each plot cuz that'd cost 2 kidneys

astral pilot
#

how do you disable commands

astral pilot
dawn flower
#

yeah

#

all commands are registered through there

astral pilot
#

alright thanks

astral pilot
dawn flower
#

it's not a method

#

get the knownCommands by reflection and do whatever you like with it

astral pilot
dawn flower
astral pilot
dawn flower
#

intellij idea

#

ctrl and click on the class

astral pilot
#

mine shows this

#

only the interface

dawn flower
#

you can do

SimpleCommandMap map = ...
map.getKnownCommands().remove("msg");```
astral pilot
#

oh its simplecommandmap

dawn flower
#

you view the implemnetation

astral pilot
#

i see

dawn flower
#

what dis particle

#

sorry for low quality, that video is like 9 years old

valid burrow
#

which one lmao

dawn flower
#

i'm talking abt the cross one

valid burrow
#

the cross one is crit iirc

dawn flower
#

alr

#

this is ancient code

ParticleEffect.WITCH_MAGIC.display(loc, 0, 0, 0, 0, 1);```
but what do these numbers represent 0, 0, 0, 0, 1
#

delta + speed + count?

#

the only thing i can think of is the first 3 numbers is delta, 4th one is speed and 5th one is amount

valid burrow
dawn flower
#

ah

astral pilot
#

hmm, somehow this isn't working

SimplePluginManager spm = (SimplePluginManager) this.getServer().getPluginManager();
            Field f = SimplePluginManager.class.getDeclaredField("commandMap");
            f.setAccessible(true);
            SimpleCommandMap scm = (SimpleCommandMap) f.get(spm);

            Field knownCommandsField = scm.getClass().getDeclaredField("knownCommands");
            knownCommandsField.setAccessible(true);
            Map<String, Command> knownCommands = (Map<String, Command>) knownCommandsField.get(scm);

did i do anything wrong?

vast ledge
#

Where's simple plugin manager from

valid burrow
#

?notworking

undone axleBOT
#

"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.

astral pilot
vast ledge
#

What is that packagge from

astral pilot
#
Field knownCommandsField = scm.getClass().getDeclaredField("knownCommands");
#

this one is the one failing

astral pilot
vast ledge
#

net.bukkit.api.server orwhere

shadow night
#

net.bukkit??

valid burrow
astral pilot
#

ah import

vast ledge
astral pilot
#

org.bukkit.plugin.SimplePluginManager

shadow night
vast ledge
#

Ye

astral pilot
shadow night
#

Just get the command map from the server using reflection and then get the knownCommands (either reflection or using a getter if there is one, idk)

astral pilot
#

it keeps saying that knownCommands doesn't exist

shadow night
#

ยฏ_(ใƒ„)_/ยฏ

eternal oxide
#

Then you are not using Spigot

#

Bukkit.getPluginManager().class.getDeclaredField("commandMap");

#

oh you are failign on known not the map itself

shadow night
#

My personal favourite way to debug it would be by printing getDeclaredFields

astral pilot
#
SimplePluginManager spm = (SimplePluginManager) this.getServer().getPluginManager();
Field f = SimplePluginManager.class.getDeclaredField("commandMap");
f.setAccessible(true);
SimpleCommandMap scm = (SimpleCommandMap) f.get(spm);

logger.info(scm.toString());
#

it shows its a CraftCommandMap

shadow night
#

Well, yes

#

That's how the bukkit api works

astral pilot
#

where do i get SimpleCommandMap then

shadow night
#

You don't need to, CraftCommandMap extends SimpleCommandMap

#

If you cast a class it does not change its type

spice burrow
#

i havent really learned much about making animations with spigot, is the armor stand method the only/best way?

astral pilot
shadow night
#

probably not

astral pilot
#

weird

eternal oxide
#
Field knownCommandsField = SimpleCommandMap.class.getDeclaredField("knownCommands");```
#

This works```java
SimplePluginManager spm = (SimplePluginManager) this.getServer().getPluginManager();

    try {
        Field commandMapField = SimplePluginManager.class.getDeclaredField("commandMap");
        commandMapField.setAccessible(true);
        SimpleCommandMap scm = (SimpleCommandMap) commandMapField.get(spm);

        Field knownCommandsField = SimpleCommandMap.class.getDeclaredField("knownCommands");
        knownCommandsField.setAccessible(true);
        Map<String, Command> knownCommands = (Map<String, Command>) knownCommandsField.get(scm);
        
        System.out.println("KnownCommands: " + knownCommands.toString());
        
        
    } catch (NoSuchFieldException | SecurityException | IllegalArgumentException | IllegalAccessException e) {
        e.printStackTrace();
    }```
astral pilot
#

tho mine worked by adding getSuperclass() somehow

#

thanks anyways

eternal oxide
#

No, scm.getClass() is not the same as SImpleCommandMap.class

astral pilot
#

what's the difference in those 2

eternal oxide
#

sysout their name and you'll see

glad prawn
#

CommandMap commandMap = Bukkit.getServer().getDeclaredMethod("getCommandMap").invoke(Bukkit.getServer());

eternal oxide
#

no he wants knownCommands from inside SimpleCommandMap

glad prawn
#

then get commandMap first

eternal oxide
#

You seem to not be reading ๐Ÿ™‚

#

anyway, the reason his was not workgin was because he was using instanceOfCommandMap.getClass() instead of SimpleCommandMap.class.

#
System.out.println(SimpleCommandMap.class.getName());
System.out.println(scm.getClass().getName());```Returns```
org.bukkit.command.SimpleCommandMap
org.bukkit.craftbukkit.v1_20_R1.command.CraftCommandMap```
astral pilot
#

i see, thanks a lot

eternal oxide
#

top one is the correct class to read fields from, second is not

astral pilot
#
Map<String, Command> knownCommands = (Map<String, Command>) knownCommandsField.get(scm);

tho is this one a reference? or a copy of map?

eternal oxide
#

a reference

glad prawn
#

reference

astral pilot
#

so if i mutate that, the original one gets muted too right?

blazing ocean
astral pilot
#

int original_value = 0;
int* ref = &original_value;

*ref+= 1;

printf("%d", original_value); // 1
#

doesn't it work like this?

pseudo hazel
hazy parrot
eternal oxide
#

He probably thought mutating the reference not the contents

agile plover
#

Hey, so I'm working on a project with multi modules on maven to support different versions of nms. All versions work fine, except from 1.20.6 where I get errors when I try to compile:

cannot access net.minecraft.network.Connection
cannot access net.minecraft.server.network.ServerCommonPacketListenerImpl
cannot access net.minecraft.server.network.ServerGamePacketListenerImpl
cannot access org.bukkit.craftbukkit.v1_20_R4.entity.CraftPlayer
cannot find symbol
cannot find symbol
cannot find symbol
cannot find symbol
cannot find symbol

Does anyone have any idea how to fix that?

#

Fixed by changing jdk to 21

nova notch
#

That would make sense considering 1.20.6 requires java 21

restive mango
#

Like idk how you are supposed to do listeners for packets for native minecraft nms instead of using the protocollib listenerโ€ฆ which GIVES you protocollib packets

slender elbow
#

you can use protocollib just fine

#

just not with PacketWrappers itself, or update it to match modern MC packets

#

protocollib is nothing but a reflection accessor

still ridge
#

Hi, I wanted to know, is it possible to make custom structures that are generated naturally with spigot or not? (I'm in 1.20.4)

vast ledge
#

It is possible

#

Usually data packs are used tho afaik

#

But it should also be doable with a plugin

young knoll
#

Yeah you can do it with just a BlockPopulator

#

Or hack some stuff into registries, kek

still ridge
#

ok

#

And do you know if it's possible to create custom biomes, or is that too tricky?

young knoll
#

Yeah

#

But itโ€™s also a lot of registry hacking if you donโ€™t use a datapack

still ridge
#

ok

#

do you have an example or a lib that makes it easier to do this? (if it's not too much trouble)

pseudo hazel
#

look up datapacks that have custom biomes

#

and then I guess make a way to add datapacks to your plugin

young knoll
#

You can do that

#

buttttt plugins run too late, so if you deploy a datapack it will be after the server loads them

#

So you then need to restart the server

still ridge
#

ok

zealous osprey
#

Quick question, how do you log exceptions from futures sensibly? I get the stack trace and print some of that, but that often leaves out the stuff I actually care about. Any suggestions?

eternal oxide
#

CompletionException, or try/catch inside teh Future

zealous osprey
#

Additionally, is there a way to not let lambdas consume exceptions? It makes debugging annoying/figuring out that there even is an error.
I now do:

...
.whenComplete((d, e) -> {
  if (e != null) { Server.error(..., e); return; }
  <doing stuff>
})
.whenComplete((_, e) -> {
  if (e != null) return;
  Server.error(..., e);  // Just in case the previous future threw an exception for some reason
})
eternal oxide
#

its not the lambda consuming the exception

#

its you not handling it

#

add a .exceptionally

zealous osprey
#

What I meant with "consume" is that if an exception would have been thrown in a method or so, it would have raised it and I'd receive a stack trace in my console. Lambdas just don't do that

eternal oxide
#

its not raising it because you are not processing it. You are ignoring the exception

#

.exceptionally((ex) -> {ex.printStackTrace()}

tardy delta
#

^

zealous osprey
#

Ah, for some reason I always thought #exceptionally would raise an exception and not handle them

#

thx :D

zealous osprey
#

like this ig

tardy delta
#

yes

#

well you have to return T which will give you a new Future<T> thats how it goes

#

iirc, ye

zealous osprey
#

true, but null should be fine ig

slender elbow
#

exceptionally is more of a recovery function, it takes an exception and returns a valid result; if you have it as a last step and don't care about chaining any more results or returning that, then that's fine

zealous osprey
#

Yeah, though I see little difference in this example between using #whenComplete and checking if e is null or just doing #exceptionally

harsh ruin
#

How do I make a delay in a command or anything..? example; I want to set a block broken to air for a few seconds, then set it to stone(just a exmaple)

tardy delta
#

?scheduling

undone axleBOT
tardy delta
#

schedule a task that runs for example for x ticks, and checks itself if it should stop and set the block to stone

harsh ruin
#

Thanks

pliant topaz
#

I can multithread a process in my plugin, right?

#

(never worked with it so yea)

tardy delta
#

i mean ye, depends on what, most api interactions must happen on the main thread tho

pliant topaz
#

it's just some stuff i need to register, the api stuff of it is fast enough

slender elbow
#

multithreaded != fast

marble hearth
#

Has anyone worked developing faction servers or plugins? im looking to add one to my network of servers and need people who want to work together

tardy delta
#

?services

undone axleBOT
pliant topaz
echo basalt
#

Depends on what you're doing

pliant topaz
#

I'm adding millions of entries to an arraylistm, well, not millions, but in the future it could lead to such an enormous amount so I wanna be prepared

slender elbow
#

๐Ÿคจ

pliant topaz
#

and i think multithreading should fasten the process a bit

slender elbow
#

what are you doing

tardy delta
#

uhhhhhh

pliant topaz
#

creating a whole lot of classes linked to a location in an map

tardy delta
#

sounds like you are the one solely responsible for all memory leaks on spigot

echo basalt
#

๐Ÿค” the fuck

#

I did work on scanning surfaces at work

#

Sounds like something related

#

In which case, multithreading can be beneficial GIVEN you know how to optimize it

#

(thread pool, making chunk snapshots, concurrent collections, caching, re-using values)

agile plover
#

Hey,
I'm trying to spawn in a custom entity (using nms)
Is there a certain NBT tag or property I can activate so that it will not collide with players? (so when players touch the mob, they can walk right past it without any pushback)
I can't seem to find anything like that

pliant topaz
pliant topaz
tardy delta
#

idk i dont have any context

young knoll
#

kek

deep scroll
#

Hey guys, I am genuinely losing my sanity.

In plugin.yml I specified soft dependency on another plugin from which I use it's API.

softdepend:
  - 'AdvancedServerList'

I tried editing loadbefore in the ASL plugin.yml... Using depend, etc. But my plugin always loads first and straight up ignores any plugin.yml configurations. Any ideas?

quaint mantle
#

You can make the task to await the soft depended plugin

deep scroll
#

Gotcha, I will do that. But what even is the purpose of that configuration in plugin.yml file?
From the testing I did it just looks like only depend is somewhat useful as it just force disables the plugin when the dependency is not found... And that's basically it.

tardy delta
#

actually i always forget if its softdepend or softdepends, try using [] for a list

#

you sure you got the right name tho?

deep scroll
#

List is a list.. It shouldn't matter if it's written like [AAA, BBB, CCC] or

list:
  - 'AAA'
  - 'BBB'

Parser will eat it...

#

In SpigotMC wiki there is only "softdepend" mentioned.. Without the 's'.

#

The name is written correctly, I even checked the plugin's plugin.yml to check the name, which is:
name: 'AdvancedServerList'

slender elbow
#

?paste the full server logs pls

undone axleBOT
vernal vessel
#
                Location loc1 = new Location(Bukkit.getWorld("world"), 30, 72.0, 20);
                Location loc2 = new Location(Bukkit.getWorld("world"), 30, 62.0, 20);

                ParticleDisplay display = ParticleDisplay.of(XParticle.EXPLOSION);
                display.withColor(Color.GRAY);

                Particles.filledCube(loc1, loc2, 300, display);

Is anyone know why nothing gets spawned (Xseries)

blazing ocean
#

tf is a particle display

fair rock
blazing ocean
vernal vessel
fair rock
#

Look at the code

#

I saw the problem within an instant

#

Reduce your "rate"

#

?paste

undone axleBOT
fair rock
#

+= rate,

Its adding 300 every loop, so basically its instant done xd
The example rate is btw 0.3

gentle inlet
#

Anyone know how i can make the players armor invisible but not the item they are holding?

vernal vessel
#

still no particles

fair rock
#

Do you see fr no particles? Did you check the start point?

And why grey? Since when can have explosions a color?

#

So many questions. Copy the example code from them and try it

#

And try a cube please. Like 30 60 30
40 70 40

wraith delta
swift dew
#

public Material getMaterial() { return Material.getMaterial(material); }
this is serializable right?

#

why moyai ๐Ÿ˜ญ

#

also material is a string

#

i tried it because i have issues with 2 same classes being different after serialization

eternal oxide
#

material is not a String

swift dew
#

Material is not

swift dew
#

its Material.toString()

#

thats how i save it

blazing ocean
#

material is just an enum

#

so you should be able to do that with no issues

eternal oxide
#

to get a Material from a String use Material.matchMaterial

swift dew
#

aight ty

blazing ocean
#

i always used valueOf lol

slender elbow
#

registry :nodders:

blazing ocean
slender elbow
#

the material registry is still there, and item types are unaffected by the change from nbt to data components

blazing ocean
#

i meant like nms item stacks

slender elbow
#

?

blazing ocean
#

like you can only init them with a reg entry

slender elbow
#

why bring up nms?

blazing ocean
#

idk it was a question

#

you were talking about regs

slender elbow
#

they just changed itemstacks to not have NBT in memory but strongly typed structs, data components, not really to do with registries or anything, like yeah it is semi related i guess since there is a components registry iirc but it's not like itemstacks are backed by a registry itself

twin venture
#

hi , uhh i change all maven to 1.8 , and even Porject structure to java 1.8 , and Moudles to 1.8 but it still say :
C:\Users........jdks\corretto-17.0.11\bin\java.exe

#

how i can fix it?

eternal oxide
#

install java 8 and configure your IDE to use java 8

twin venture
#

done

#

i found it

eternal oxide
#

make sure your JAVA_HOME is set to teh java 8 path

#

read and display info from the exception

quaint mantle
#

mostly by catching exceptions and giving good error output

young knoll
#

^

#

Stack traces are scary for the average user

vague swallow
#

is there a way to make an item meta glimmer like it had an enchantment without actually enchanting it? I know about HIDE_ENCHANTMENTS but is there a way?

valid burrow
#

just put a random entchant and hide it

twin venture
#

how i can stop this?

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.

alpine urchin
#

we need more code

young knoll
#

I forget the name but itโ€™s in ItemMeta

twin venture
valid burrow
#

ah lol didnt see the link

tardy delta
#

replaceAll is for regex

vague swallow
vague swallow
young knoll
#

Yeah thatโ€™s the one

dry forum
#

any suggestions for how to make a textdisplay smoothly follow a player? i have this rn but its not smooth

    @EventHandler
    public void onPlayerMove(PlayerMoveEvent e) {
        Player player = e.getPlayer();
        ChatBubble bubble = chatBubblesHashMap.get(player);

        if (bubble == null) {
            return;
        }

        Location newLocation = e.getTo();
        Location oldLocation = e.getFrom();

        if (newLocation == null) {
            return;
        }

        double difX = newLocation.getX() - oldLocation.getX();
        double difY = newLocation.getY() - oldLocation.getY();
        double difZ = newLocation.getZ() - oldLocation.getZ();

        for (TextDisplay textDisplay : bubble.chatBubbles) {
            textDisplay.teleport(textDisplay.getLocation().clone().add(difX, difY, difZ));
        }
    }```
inner mulch
#

then its 100% sync

dry forum
#

im stacking them though i have multiple above the player

inner mulch
#

yeah then stack them too