#help-development

1 messages · Page 777 of 1

chrome beacon
#

Movement is client side and trying to stop the velocity that way on the server will just cause problems

rotund ravine
#

Do some math

twin venture
#

hi , question what would be the best way to handle multi profile system for each user so for example :

  • Solo , doubles , Ranked , insane , this is 4 diffrent type of the same Mode [skywars]
    what would be the best way to handle the user data for each type ?
#

i was thinking about making a profile for each type

#

and just load them all

#

when user join , and edit it when it required

grand flint
#

just save it all under the same user's stats in the databae

#

like
username
> ranked

kills
deaths
> solo
kills
deaths

acoustic stag
#

how can i clear banner patterns from a shield? if i have a shield with a banner applied to it, how to get a clean shield?

rotund ravine
#

I mean you can just give them a new shield with the same durability

acoustic stag
#

isn't there a better way?

rotund ravine
#

Probably

#

?jd-s

undone axleBOT
rotund ravine
grim hound
#

the Info packet on older versions InfoAction.ADD_PLAYER and on newer wersions EnumSet.of(ADD_PLAYER , UPDATE_LIST)

acoustic stag
rotund ravine
acoustic stag
#

how

young knoll
#

Oh shields use blockstatemeta

#

Interesting

rotund ravine
undone axleBOT
rotund ravine
#

It’s a very simple method

cold pawn
grim hound
#

Whatchu asking?

#

like

#

a List is a different structure to an EnumSet

#

I even told you to do

grim hound
lost matrix
#

static import PES_CringeGrin

icy beacon
#

Is listening to PlayerStatisticIncrementEvent for JUMP increase the best way to detect jumps? Or is there some API I don't know about?

young knoll
#

Pretty much

icy beacon
#

Kk ty

grim hound
#

wait

#

TabCompleteEvent

#

is command only?

icy beacon
grim hound
#

yeah I saw that

icy beacon
#

Kk

grim hound
#

but then

#

is there no event for when someone checks the TAB?

rotund ravine
#

Clientside

icy beacon
#

Do you mean the tablist?

grim hound
#

ohhh that's why the packets are one-time

grim hound
icy beacon
#

Yeah I think that's not sent to the server

#

Unless there's some peculiar packet

rotund ravine
#

There would be little reason for it to be sent

grim hound
#

is there any event

#

for tablist manipulation?

cold pawn
grim hound
#

Set

#

Not

#

Set

#

and

#

not

#

luist

#

list

#

just

#

EnumSet

#

I have no idea how ProtocolLib works

glad prawn
#

spam 😡

cold pawn
#

😅

grim hound
icy beacon
cold pawn
#

ngl feel kinda slow rn

icy beacon
#

Stretch a bit

grim hound
#

either input only the action or only the EnumSet

#

try both

cold pawn
#

Ok gotcha

grim hound
#

so if I want to hide some players in the tab I have to send the remove packets to everyone?

icy beacon
#

I think so

grim hound
#

mmmm

#

is there a way to stop the server from sending it in the first place?

#

except for constant ChannelDuplexHandler monitoring

young knoll
#

ProtocolLib

#

You can listen for and cancel packets

grim hound
young knoll
#

yes

grim hound
#

fine

crimson blaze
#

hi guys
someone can help me with the animation?
with the plugin tab?
i want to do animation with the name too
but i do only the role
how i do with the name?

grim hound
#

or smthg like that

#

on a repeating task

crimson blaze
#

wait

grim hound
#

GL 👍

crimson blaze
#

i give you something

grim hound
#

what?

river oracle
rotund ravine
crimson blaze
#

owner:
change-interval: 100
texts:

  • '&C&LO&4&LWNER'
  • '&4&LO&c&LW&4&LNER'
  • '&4&LOW&c&LN&4&LER'
  • '&4&LOWN&c&LE&4&LR '
  • '&4&LOWNE&c&LR'
#

this is the owner

rotund ravine
crimson blaze
#

can you do to me with the animation?

brazen badge
#

Can anyone help me? I would like to create a command that accepts 3 args, player_name time number. I want these args to be passed in an event, and everything I write in the event is executed for a certain amount of time (I use a database). how can I do?

rotund ravine
#

That’s a lot of stuff

#

That doesn’t really pair together

#

What is the outcome you want it to do?

brazen badge
#

The important thing is that I understand how to pass the args

rotund ravine
#

Nope

eternal oxide
#

The important thing is you properly explain your end goal. It sounds like you have everything else wrong

brazen badge
#

a mmocore booster

#

with PlayerExpGainEvent

eternal oxide
#

Explain your end goal. What is it supposed to achieve?

brazen badge
eternal oxide
#

all exp?

brazen badge
eternal oxide
#

not difficult

slim gate
#

hi

eternal oxide
#

first you need some kind of database (HashMap) to hold the player multiplier data.

#

then in the exp gain event you read from that database for the player multiplier and do Math

eternal oxide
#

you create an object which holds the multiplier adn the time

#

so your Map<UUID, Data>

#

data can just be a simple Record

#
public record Data (float multiplier, long time) {}```
brazen badge
#

my problem now, it's not how to save the data. It's how to check the time, if it's done or if it's started

eternal oxide
#

just use System.currentTime

#

mills, it's a long

#

using that you can compare teh stored value against the current and see which is larger

quaint mantle
#

and math

twin venture
#

Hi iam facing a weird problem

#

what iam doing wrong ,-,?

eternal oxide
#

sw.null

twin venture
#

well its already there in the mysql

#

why it say its null

eternal oxide
#

null isn;t a table

twin venture
#

i dont have a null anywhere

hazy parrot
#

Show where you make your query

twin venture
#

didn't set any null vlaues

#

this is where its acctully buged

#

the bug is from here

#

mySQLManager.executeUpdate(query, parameters.toArray(new Object[0]));

#

this line

lost matrix
twin venture
#

wait ik whats wrong

#

the name was ..

#

uhhh

#

oky thanks

river oracle
#

I'm attempting to store a Multiblock structure within a chunk's PDC, I'm questioning what type of key I should use though, the issue with sometihng like a BoundingBox would be the need to reconstruct a bounding box to grab the MultiBlock, I'm hestitant to use a Location because you'd need to store many locations that conforms to the size of the multiblock

eternal oxide
#

if you are storing in a Chunk you don;t need the location, only the x/y/z

lost matrix
river oracle
lost matrix
#

They key would be "multi-block-structures" and the value would be a List<MultiblockStructure>
Each structure has a base block and a list of x, y and z values, pointing at Blocks, relative to the base block.

river oracle
sacred mountain
#

i know that this isn't the place for specific api support, but the discord is somewhat inactive, so i was wondering if theres a way to create a bukkit advancement object and then when i use Bukkit.advancementIterator() it would be included

#

not sure if that's possible but lmk

river oracle
worldly ingot
#

Although that's in JSON format. There's no pretty API way to do it

lost matrix
worldly ingot
sacred mountain
#

this thing then

#

i was trying to convert a BaseAdvancement class into the bukkit Advancement

#

but it seems like their entire framework is custom

river oracle
#

oh by specific API I thought you meant like bukkit API

worldly ingot
#

Yeah they're using some reflection insanity in that

#

No clue why

sacred mountain
#

and only accesses minecraft stuff at a lower level than im willing to look at

#

i saw some classes and just kinda

#

brain closed

worldly ingot
#

I'd opt for the one I sent, personally

sacred mountain
worldly ingot
#

The one I sent above at least makes use of API. Unstable API, but it uses API

river oracle
sacred mountain
#

hmm since i've already got quite a few custom advancements already built in and working, would it be worth it to just make a converter for the plugin that is using the iterator?

#

like just have them as extras

#

so currently i have an advancement display gui

#

and it should just display all the advancements in the game, i could just add the custom ones on at the end

tall dragon
#

tell em to click their mouse

sacred mountain
#

💀

#

install killaura idk

fading dirge
#

why i cant use znpcs on aternos

sacred mountain
#

aternos servers run on outdated potatoes

quaint mantle
#

why does it only flag it if I add the @NotNull in the generic spot

#

but it doesn't flag the other ones

river oracle
#

but the list will never be null

quaint mantle
river oracle
#

however conventional wisdom will tell you that @NotNull on the list probably indicates that the contents shouldn't be null

#

I'm aware

#

that means the contents shouldn't be null

#

having the notnull only on the list part means the contents COULD be null, extremely stupid, but whatever

quaint mantle
#

Do I just ignore it then

eternal oxide
#

Those annotations are only advisories.

river oracle
#

^ I would ignore it

dull goblet
#

What would be a good way to add websockets to a spigot plugin?

lost matrix
#

Start a new thread and open a socket on it

dull goblet
#

Any recommended library that works well with it?

slender elbow
#

client or server?

eternal oxide
#

Java

dull goblet
#

Server

#

I've used vertx before

#

but not with spigot

chrome beacon
#

I've you're familiar with it then you can just use that in a different thread

dull goblet
#

I haven't done much with threads except for small things, any things i need to watch out for?

chrome beacon
#

Many things in the Spigot API are not thread safe

#

So you want to jump back to the main thread when doing stuff

#

and an easy way to do that is using the scheduler

river oracle
chrome beacon
#

Yeah

river oracle
#

Most read operations are semi-safe on another thread

#

though under specific circumstances they most likely can cause errors

dull goblet
#

That seems difficult, any guide somewhere that talks about going back to the main thread?

chrome beacon
#

?scheduling

undone axleBOT
chrome beacon
#

Schedule a task to run next tick

#

That will run on the main thread

river oracle
#

BukkitScheduler#runTask(Runnable)

#

Bukkit.getScheduler().runTask(() -> System.out.println("I'm on the main thread now mom"));

dull goblet
#

So then i for example send something through the socket every one tick?

river oracle
#

in what world would you need to send something through a Web socket every tick?

#

sounds extremely heavy

dull goblet
#

its like a plugin where people can race and there is a live leaderboard on a web app for it

river oracle
#

ahhhh

#

just remember don't do spigot tasks on the asynchronous therad

quaint mantle
#

is there a way to make it so intellij doesn't put the @NotNull here

river oracle
#

you'll get errors most likely

quaint mantle
#

cause whenever I auto implement the methods

#

it puts it there

chrome beacon
#

is characterInformation marked as not null?

quaint mantle
chrome beacon
#

That would be why

quaint mantle
#

but I want it like

@Override
@NotNull
public void ...

#

unless that's not the convention

river oracle
quaint mantle
#

honestly idek

#

cause if I have a list

#

it would be weird

chrome beacon
quaint mantle
#

@Override
@NotNull
public List<@NotNull String>

compared to

@Override
public @NotNull List<@NotNull String>

quaint mantle
#

cause it's like this

#

instead of that

river oracle
#

I don't think its a bug

chrome beacon
#

^^

river oracle
#

just need to change your format settings

chrome beacon
#

Check your code style settings

quaint mantle
#

I'll just keep it next to the return type

river oracle
#

I hate that which is why I just use the java 5 annotations

quaint mantle
#

wdym

river oracle
#

the @NotNull List<@NotNull Object>

chrome beacon
#

I usually don't do that

river oracle
#

I thought it was like a common inferance that a returned collection of any type shouldn't ever really be null

chrome beacon
#

Yeah I always assume it's NotNull by default

#

If there for some reason would be a null value I would mark it as such

south mason
#

I tried to do this, but [21:52:13 ERROR]: Exception in thread "Thread-0" java.lang.NoClassDefFoundError: org/springframework/boot/SpringApplication
[21:52:13 ERROR]: at jcn.siteinplugin.WebServer.startServer(WebServer.java:9)
[21:52:13 ERROR]: at jcn.siteinplugin.SiteInPlugin.lambda$onProxyInitialization$0(SiteInPlugin.java:23)
[21:52:13 ERROR]: at java.base/java.lang.Thread.run(Thread.java:1623)
[21:52:13 ERROR]: Caused by: java.lang.ClassNotFoundException: org.springframework.boot.SpringApplication
[21:52:13 ERROR]: at com.velocitypowered.proxy.plugin.PluginClassLoader.loadClass0(PluginClassLoader.java:87)
[21:52:13 ERROR]: at com.velocitypowered.proxy.plugin.PluginClassLoader.loadClass(PluginClassLoader.java:64)
[21:52:13 ERROR]: at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
[21:52:13 ERROR]: ... 3 more

quaint mantle
#

U didn't compile it correctly

lost matrix
south mason
lost matrix
#

If you are new to programming then spring is not something you should touch to be honest.
They have a ton of concepts that make no sense if you dont know meta programming.

lost matrix
south mason
#

I just want to run the site from a plugin

lost matrix
# south mason Sorry, I'm new to programming, could you suggest resources on which to study thi...
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>3.5.1</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <createDependencyReducedPom>false</createDependencyReducedPom>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            ... etc

This is how you setup the shade plugin in your pom.xml

lost matrix
south mason
river oracle
dull goblet
#

I have a websocket server through vertx in my spigot plugin. What port do i use? Can i use a custom port or does it need to go through the minecraft server port?

river oracle
#

this can easily be done with WebSockets or some form of Rest API

river oracle
south mason
#

Okay, thank you all for your help. I'm going to try

lost matrix
dull goblet
#

Yeah i got confused because my client couldn't connect but the ports were right.

#

I found the problem tho, its CORS

rotund ravine
#

Funny question

#

@last temple I suppose if you hold a strong reference to the player var and they leave that might be set to null hmm

river oracle
#

or fake players

#

sus

#

what's the IP for 👀

#

that's much less fun than timezones

#

guh no one is gonna do player based time detection based on their timezone!

soft tendon
#

Hey, quick question - does this take into account that 1.20.2's ClienboundLoginDisconect packet can be both a raw string or a component?
According to a decompiled 1.20.2 client, the client tries to read the received string leniently & deserialize accordingly to what was received (raw string, or component)

slender elbow
#

the reason field in the packet is a Component and is serialized as such

#

the server can only send a component

soft tendon
#

For the normal disconnect packet yeah, but isn't the login disconnect one a special case for backwards compat?

slender elbow
#

the 1.20.2 login disconnect packet is also just a component

soft tendon
#

Sure, that's what it is internally, but the reason is deserialized differently with the login disconnect packet vs the normal disconnect packet - atleast affording to a decompiled jar with e.g. yarn mappings

#

Not sure if allowed here, ill delete if it isnt - but see here how the serialization happens

alpine swan
#

does getNearbyEntities (world class) only get entities where the center of their hitbox is within the getnearbyentities hitbox or can any part of the hitbox of the entity be within the getNearbyEntities hitbox
also, is entity.getnerabyentities more optimised than world.getnearbyentities?

lost matrix
alpine swan
lost matrix
river oracle
#

smile beat me too it 😦

lost matrix
alpine swan
slender elbow
pine forge
#

Does anyone know how this protocolllib code would work in 1.19.3 and higher where you have to use the getDataValueCollectionModifier. Not sure what would be the equivalent to this setEntity of the datawatcher

WrappedDataWatcher watcher = new WrappedDataWatcher();
watcher.setEntity(player);
watcher.setObject(DW_ARROW_INDEX, WrappedDataWatcher.Registry.get(Integer.class), arrowCount);

packet.getWatchableCollectionModifier().write(0, watcher.getWatchableObjects());
lost matrix
pine forge
#

Okay thanks ill try that out

#

are the indexes equivalent to the ones specified in wiki.vg?

#

Number 12 would be the correct one if i want to control the number of arrows in an entity right?

dull goblet
#

I am currently hosting a websocket server through vertx in my spigot plugin. When i connect it works, but when i try to send a message from client to server, I get INVALID_STATE_ERR in vertx-eventbus. Now normally when this happens, it's because an error happened on the server side. But for some reason vertx server side isn't throwing any errors in the spigot console. How can I make it so that happens, or is vertx just not throwing any errors?

alpine swan
#

you cant add chatcolors?

#

or do you need to put an empty string first if you want to add multiple at the start of a string

dry hazel
#

correct

sterile token
dry hazel
#

redis requires you to have an instance of it, a (web)socket goes point to point

echo basalt
#

A websocket needs to be secured but it's slightly faster

lost matrix
#

websockets can get really messy really quick with multiple conversation participants

shadow night
#

websockets are a mess by themselves

quaint mantle
#

Websockets just transfer json?

lost matrix
#

You can also just tranfer binary data *if you have the right protocol to deserialize it on the other side

shadow night
#

binary data is kinda ass

dry hazel
#

protobuf is alright

echo basalt
#

A <-> B is whatever

eternal oxide
#

binary data is great when you have to pay for the amount of data transfered

echo basalt
#

But messaging systems are purpose built for a reason

quaint mantle
#

Everyone(mostly) have unlimited internet access plan

eternal oxide
#

many businesses dont

#

in fact many people don;t

lost matrix
#

Lets use the foreign memory api to transfer data directly through memory smileybolb

alpine swan
#

when would this have not been initialised? how else can i cancel a task inside a task or achieve the same thing

eternal oxide
#

Business contracts pay by quantity of data in most cases

lost matrix
twin venture
#

How i can get a Chest block from a location instance?

alpine swan
twin venture
#

so for example :
-GameStartEvent -> get save location for the specfic Chest and just fill it when game start

lost matrix
alpine swan
lost matrix
lost matrix
lost matrix
lost matrix
sterile token
#

I just recommended Redis because managing multiple conversations at the same time with Sockets is a mess, even when need performance

lost matrix
#

Runnable is simply just this

glad prawn
alpine swan
#

either way, the error message that it might have not been initialised yet made no sense

lost matrix
#

I really dont like this approach because you can get caught up in confusing scopes like that

alpine swan
lost matrix
glad prawn
#

choose other name your variable name is task

lost matrix
alpine swan
#

i guess it isnt gonna go though the entire bukkit source to figure out if its gonna execute instantly

alpine swan
lost matrix
#

Because this is not deterministically analyzable. Its a specification of spigot.

lost matrix
glad prawn
#

ig u doesnt know how to use lambda

lost matrix
#

I really dont like the excessive use of lambdas. Creating a concrete implementation is the safest way for newer devs to get a hang of it.

glad prawn
#

yes but i talk to him

shadow night
#

Lambdas are weird

alpine swan
lost matrix
#

Remove the variable declaration

alpine swan
#

it gets dumped into a hashmap

lost matrix
alpine swan
chrome beacon
#

Deprecated (in the scheduler) also not very clean

alpine swan
#

actually this is a mess im making my own class

lost matrix
zealous osprey
#

Eyyy, even more bit stuff, here I go again:)
I have a mask, so I can get some data back from a long:
X_ONE_MASK = 0xFF00000000000000L
And I have a long of data: 0000110100001011000010010000000000000111000000000000010100000011
I want too get the first 8 bits of the data long, the ones that overlap with the mask. No probleme, a simple & Operator. But now I have this long as a return value:
0000110100000000000000000000000000000000000000000000000000000000 But I want that as a byte? So how can I move the bits too the right? Ik I can use >> but how would I get the amount of shift form the mask?
In the worst case, I'll just create hardcoded values.

chrome beacon
#

Shift and cast?

#

or am i missing smth

lost matrix
zealous osprey
#

kk

alpine swan
lost matrix
# alpine swan what is wrong with the player reference?

You shouldnt keep references to game objects like entities, worlds, chunks and players because you can easily
create memory leaks if you are not careful. Its better practice to use an indirect reference like their UUID and
request them from Bukkit. This has almost no performance impact.

alpine swan
#

i understand your point but i dont see why its valid in my specific use case

#

i might just do it to be safe tho

zealous osprey
lost matrix
lost matrix
#

*This gives you the left most byte in this long

zealous osprey
#

In my case I can't really do that, I'm mixing sizes. So my long is split into 2x8 Bits, 4x4 Bits and 2x16 Bits

lost matrix
#

Hm. So the hard part is probably the 4x4 Bits...

#

The rest are done like the method above

storm crystal
#

should I make separate utility handling class for PDC tags?

lost matrix
storm crystal
#

so I thought about making a method for both entities and items

lost matrix
storm crystal
#

like set, read etc.

zealous osprey
lost matrix
#
int firstSegment = (int) ((value >> 56) & 0xFF);
int secondSegment = (int) ((value >> 48) & 0xFF);

Ok so those are the first 2x8 bits

#
int fifthSegment = (int) ((value >> 32) & 0xFFFF);
int sixthSegment = (int) (value & 0xFFFF);

Those are the right most bits.
The middle can probably be extracted with a loop. Let me test something real quick

lost matrix
#

I mean... you could also just hard code the values and not use a loop.

#

Thats probably easier

#

Just make sure to use a 0x0F mask for your 4 bits

zealous osprey
#

ye

wet breach
#

you could just split the long first into the appropriate sizes

zealous osprey
#

I love how you were a "man on a mission".
Me 2 messages ago: "Yeah, I have a solution, thanks though"
You: hold my beer, I wanna show you something

lost matrix
dull goblet
#

A while ago i found a spigot resource where you made 2 maven profiles one build and one dev, and in the dev you put outputpath as your plugin folder, but i don't seem to find that resource back

chrome beacon
#

If you’re using maven for your Spigot plugins (which you should do), it’s easy to make maven automatically save your plugin’s .jar in your plugins folder. There’s two ways of doing this: 1. The lazy way (not recommended) If you only work alone on one computer, you can just directly declare the output location in...

dull goblet
#

yes that one thanks

weak meteor
#

So, im working on cooldown and stuff, and i wanna know if using long as ticks is the best option:

#

and i know 20 ticks is a second

#

so i can make if (Long % 20) {
seconds = seconds-1
} or smth like that

lost matrix
#

I would suggest using a Long but as a unix timestamp. (ms)

rotund ravine
#

Keeping track via ticks is a bad idea

chrome beacon
#

You can use a tick timestamp instead if you want the cooldown to match the game time

weak meteor
#

how should i do it?

#

cause it was smth like this:

#

or that i was thinking

sterile breach
#

Hello, I have a question
When I Register a command using plugin.yml. spigot register the command in the global command map is that correcte ? So the command will be registered like if we register it without plugin.yml?

dull goblet
#

How to structure a controller that is bidirectional? For example, i have a controller with function broadcast, which broadcast to my website, but the website can also broadcast to my spigot plugin. Do I make a seperate controller for that?

weak meteor
#

if you doesnt register the command in plugin.yml it will not work

#

dont register*

sterile breach
#

We can using the commandMap directly

onyx fjord
#

yes you can forcefully register with reflection

#

make the map accessible and add your command

sterile breach
#

Spigot just add the command from plugin.yml in command map or its another system ?

onyx fjord
#

idk, what you wanna do?

sterile breach
#

No I am just asking about handling of commands

young knoll
#

Yes spigot adds them to the command map

sterile breach
#

So a command added with plugin.yml will work just as well as a command added directly in commandmap?

Or will there be a few differences?

young knoll
#

yes

onyx fjord
sterile breach
onyx fjord
#

it will work just as well @sterile breach

sterile breach
#

Ups srry

#

I've noticed that commands are added directly to the command map. If I make them a permission set for example. And low the permissions will not apply and at the time of executing the command spigot will not check if the user has permission and it will trigger the handler directly. Is this correct?

timid hedge
#

I know it isnt the right place but i dont know where else to get help

But does anyone know why i cant use keyBindForward.isPressed? (mcp 1.8.8)
if(mc.gameSettings.keyBindForward.isPressed){

ocean hollow
#

Is it possible to play sound from a resource pack in a plugin?

young knoll
#

Yes

#

You can play a sound by name

ocean hollow
#

that is, you can launch a custom sound without replacing the vanilla ones?

young knoll
#

Yes

young knoll
#

No idea

timid hedge
#

Okay fair

pseudo hazel
#

mcp is ancient

chrome beacon
#

and so is 1.8.8

#

also you can't distribute what you make with MCP

weak meteor
#

String#isEmpty refers to if its null?

#

cause, im making a cmd where 'arg' is the first element in the array of strings on the command

pseudo hazel
#

no

eternal oxide
#

if String is null it has no #isEmpty

pseudo hazel
#

== null refers to if its null

weak meteor
#

okay

#

thanks

#

still the same error

#

where strings is the array of subcommands in onCommand method

#

what should i do?

eternal oxide
#

does element 0 exist?

weak meteor
#

well, no

eternal oxide
#

then you can;t read it can you

weak meteor
#

i cant

#

but idk how to manage that

eternal oxide
#

of course you can;t, it doesn;t exist

weak meteor
#

thought with == null its okay

eternal oxide
#

arg = string{0} is impossible

weak meteor
#

it is

#

but then how can i identify if it has a arg or not

eternal oxide
#

as 0 does not exist, it's not null, it does not exist at all

#

length

weak meteor
#

oh

#

so

#

strings.lenght > 0?

eternal oxide
#

if args.length >0

#

yes

weak meteor
#

k

#

thanks

eternal oxide
#

if it's 1 you have an element 0

weak meteor
#

im using Duration#toString but PT is like weird

river oracle
#

if you want to format, more perfectly you'll need to make something yourself

eternal oxide
weak meteor
weak meteor
#

well, it doesnt exist #toSeconds()

#

weird

eternal oxide
#

there is a Duration section in the loink I gave

weak meteor
#

getSeconds

#

ye

ornate patio
#

Hello, I have a question. When I import spigot 1.20.1, it doesn't find the JavaPlugin class ?

hazy parrot
#

how do you "import" it ?

ornate patio
hazy parrot
ornate patio
#

Maybe because it doesn't display the source line, but I don't see how to fix it.

smoky anchor
#

Do not depend on this jar with IJ, use maven to manage the dependency instead

#

(or the other one, forgot name)

ornate patio
#

Do you know of any documentation for adding it?

remote swallow
#

?bootstrap

undone axleBOT
#

Bootstrap Jar
The main spigot-1.18.jar is now a bootstrap jar which contains all libraries. You cannot directly depend on this jar. You should depend on Spigot/Spigot-API/target/spigot-api-1.18-R0.1-SNAPSHOT-shaded.jar, or the entire contents of the bundler directory from your server, or use a dependency manager such as Maven or Gradle to handle this automatically.

Please read the release notes for further information: https://www.spigotmc.org/threads/9-years-of-spigotmc-spigot-bungeecord-1-18-1-18-1-release.534760/#post-4305163

ornate patio
#

it works the same way for version 1.20.1 ?

remote swallow
#

yep

ornate patio
#

okay thanks, I'll take a look at it

storm crystal
#

how can I make a zombie wear custom player head?

young knoll
#

get their equipment and use setHelmet

storm crystal
#

oh yeah I get that part but idk how to set up custom player head

young knoll
#

From a player name or what

alpine swan
#

is there any way to detect when a player opens their own inventory

using packets is fine, i just want to know if there is any possible way of detecing it, ive found conflicting stuff online

worldly ingot
#

There is not, no. No packet is sent to the server for that because it doesn't really need to be

#

Server doesn't particularly care whether or not that screen is open, just if a slot in the player's inventory changes, for which there is a packet :p

hazy parrot
#

What would be most convenient way to pass logged user from spring to react frontend. I don't like the idea of having separate endpoint (/user/me for example). Is passing trough thymeleaf actually alright ?

olive vault
#

I've been using nms for a while now but all of the sudden it just breaks on me, i've tried restarting, reinstalling buildtools and more but nothing? anyone help

alpine swan
worldly ingot
#

I don't recall that being the case

chrome beacon
olive vault
#

oh

chrome beacon
#

That code has nothing to do with nms as far as I can tell

storm crystal
#

I asked here earlier if its possible to make several plugins use same custom config but it's not really the best practice, what could I do to make them use same source of information such as custom enemy, weapons etc. data that was initially stored in plugin's custom configs?

#

since now I basically stuff everything into one plugin but that doesnt sound optimal at all

storm crystal
#

do you have any resources on that?

trim lake
#

I have this CryptoManager class Im adding to cryptoGraphGuiPlayers map data. If I print them in class where Im adding that data, data are there, but in runnable there are there only for first run of it. Im not removing that anywhere. Can someone tell me why?

    public HashMap<UUID, CryptoCoin> cryptoGraphGuiPlayers = new HashMap<>();
    private BukkitTask updateRunnable;

    public CryptoManager() {
        this.startRunnable();
    }

    private void startRunnable() {
        int interval = 10; //in seconds!
        updateRunnable = new BukkitRunnable() {
            @Override
            public void run() {
                updateStats();
            }
        }.runTaskTimer(RPComputer3.instance, 20L, interval * 20L );
    }

     private void updateStats() {       
        System.out.println("graph: " + cryptoGraphGuiPlayers );
        System.out.println("graph: " + this.cryptoGraphGuiPlayers );
        System.out.println("graph: " + Set.copyOf(Map.copyOf(getCryptoGraphGuiPlayers()).keySet()) );
        for (Map.Entry<UUID, CryptoCoin> entry : Map.copyOf(getCryptoGraphGuiPlayers()).entrySet()) {
            UUID playerUUID = entry.getKey();
            Player player = Bukkit.getPlayer(playerUUID);
            CryptoCoin crypto = entry.getValue();
            this.getCryptoGraphGuiPlayers().remove(playerUUID);
            if (player == null) continue;
            System.out.println("for run");
            new PCCCryptoGraph(player, crypto).show(player);
            System.out.println("---");
        }
    }```
Other class where Im taking instance of CryptoManager :
```java
private final Plugin pluginInstance = Plugin.instance;
private final CryptoManager cryptoManager = pluginInstance.getCryptoManager();
public void initialize() {
  cryptoManager.getCryptoGraphGuiPlayers().put(this.guiPlayer.getUniqueId(), this.crypto);
  System.out.println("graph added: " + cryptoManager.getCryptoGraphGuiPlayers().get(this.guiPlayer.getUniqueId()));
}
chrome beacon
#

?paste

undone axleBOT
grand flint
#

what is this being held on?

#

but are the horse armors too? and how are they so large

echo basalt
#

display entities

grand flint
#

what is that?

#

nvm found it thanks 💋

trim lake
#

yeah, but this should run the other class again new PCCCryptoGraph(player, crypto).show(player);

trim lake
#

I maybe missing something? idk... I guess Im accessing same map every time, Im kinda new in java so idk

strange rain
#

I've got a quick question if I do Block.getType().equals(Material.OAK_SIGN) will it still work for wall signs?

quaint mantle
#

Anyone here good w/ gradle? I have an issue where this is my runtimeClasspath but there is other shit included in final jar

#

I'm not sure if this is why but I tried to make this ocmpileOnly (this is in my gradle project allprojects block)

weak meteor
#

Can someone help me with apache http server? i got some doubts

quaint mantle
#

Guys

#

When it comes to SOLID principles

#

for the D does that mean I make an interface for everything

#

Even like plain old java objects

#

data objects

echo basalt
#

Dependency Inversion

#

basically you want to make interfaces for everything

#

and make your code rely on interfaces rather than specific implementations

quaint mantle
#

Ok so yes

obtuse wigeon
smoky oak
obtuse wigeon
smoky oak
#

idk how to use other peoples plugins lol

valid burrow
#

?whereami

hollow lagoon
#

Hello, I have a problem with the placement of my structures, I can get them from the StructureManagaer but not do the .place, I have no console error and the code which is after is executed correctly, could someone help me ?

System.out.println(Main.getInstance().getServer().getStructureManager().getStructure(new NamespacedKey(Main.getInstance(), "tir-a-arc-1")).getSize());
            Main.getInstance().getServer().getStructureManager().getStructure(new NamespacedKey(Main.getInstance(), "tir-a-arc-1")).place(player.getLocation(), false, StructureRotation.NONE, Mirror.NONE, 0, 0f, new Random());
#

and I am also sure that the structure exists and that the rental does too

smoky oak
#

not sure on this one but i assume Main is your JavaPlugin instance. The structure would need to be registered to PluginName/StructName if i remember this correctly

hollow lagoon
#

yes the Main is where I extend my JavaPlugin

#

and my structure is indeed registered because otherwise I would not be able to get the size of it

shadow night
#

(don't ever name your plugins main class Main, might cause issues from what I know)

hollow lagoon
#

In this case it is useful and does not pose any problems

shadow night
#

It might not cause any issues right now, but it's bad practice to name your main class Main in a plugin. Just saying. It's up to you what to name your main class ¯_(ツ)_/¯

smoky oak
#

might be an idea to store the structure and check with a debugger what's stored in it

#

do you have ur debugger setup yet?

hollow lagoon
#

no

smoky oak
#

should be pretty similar with other IDEs

hollow lagoon
#

i never try this

#

But in fact what I did worked yesterday that's why I don't understand

shadow night
hollow lagoon
#

yes but this is for testing and it doesn't really pose a problem to call it 3/4 times

shadow night
#

Makes sense, but saving it to a variable saves some time.

desert tinsel
#

Is there a difference by using JavaPlugin with dependency injection by constructors, / using it with static methods like that from above: Main.getInstance();?

candid galleon
#

I find that using the singleton pattern (static) is more convenient

#

technically there's a difference

hollow lagoon
#
System.out.println(plugin.getServer().getStructureManager().getStructure(new NamespacedKey(plugin, "tir-a-arc-1")).getPalettes());
            plugin.getServer().getStructureManager().getStructure(new NamespacedKey(plugin, "tir-a-arc-1")).place(player.getLocation(), false, StructureRotation.NONE, Mirror.NONE, 0, 0f, new Random());
candid galleon
#

but for spigot plugins i wouldn't worry abou tit

shadow night
#

I prefer dependency injecting my instances just because yes

candid galleon
#

I try to stick to DI

#

but sometimes you get stuck in a corner

hollow lagoon
#

i dont hacve constructor on this, it's command and i juste have onCommand

shadow night
#

you can add a constructor with no issues

candid galleon
#

getInstance can't be that performance impactive

ivory sleet
shadow night
hollow lagoon
#

But that's not the question, I just came for the place() Structure at the base, can you help me with that?

ivory sleet
#

I mean there are some cases where its like, let's use static instead of instances, for instance why AtomicFieldUpdater exists

desert tinsel
#

sometimes I just use for example in a command / listener class something like this:

public CommandClass(Main plugin){
  this.plugin = plugin;
  plugin.getCommand("command").setExecutor(this);
}``` and then just call ```java
new CommandClass(this);``` in onEnable()
ivory sleet
desert tinsel
#

but Bukkit.getPlugin(); or something like this should work too

shadow night
candid galleon
#

What do you mean by but not do the .place, ?

#

does the method not show up?

ivory sleet
#

Anyway, the point of passing the instance instead is that you don't tightly couple your code to rely on specific instances. Since a singleton binds a class to a specific instance. Avoiding that may be resourceful if you care about not making your code spaghetti long term, now that doesn't mean singleton is inherently bad since it definitely has its use-cases. We get more re-usability, flexibility and testability when we avoiding design patterns that tightly couple our code, on the other hand we may have to compromise the simplicity of the code architecture or other properties at times. @desert tinsel

hollow lagoon
#

I hear that the function is executed but nothing has been done in the world

desert tinsel
#

at the moment I pass the instance, but I used to work with static values too

ivory sleet
#

yes as said, both works

#

but just because a design works doesn't really imply its the best one to use in that said context

#

sometimes not using the most suitable design is fine ofc

echo basalt
#

mr lube you never answered me

ivory sleet
#

sorry, what did I miss? ,:)

echo basalt
#

.

desert tinsel
upper hazel
#

This is probably going to be a complicated topic, but I'll still ask how I can make a chunk generator that will ADD to the vanilla generator, and NOT CHANGE it.

#

use minecraft code?

ivory sleet
#

A common mistake is to use short names for variables, such as "p" for player, or "i" for index. This is a bad practice, as it makes your code harder to read and understand. Instead, use descriptive names, such as "player" or "index".
Yeah well that's partly true, the industry convention is to name variables proportionally to the scope they're declared within. For instance a for loop that doesn't do much and isn't exposed to much doesn't need its increment variable named "index", just "i" is fine there.

Re-use variables when possible:, Avoid repeating collections calls:, Perform the most performant checks first, Don't expose mutable collections, the principles etc are all good, I suppose you could just try to use wrapped types when u want primitives with nullability else yeah good stuff, some but not all is basically effective java items 😅

echo basalt
#

i for index is a weird edge case

shadow night
#

Maths

echo basalt
#

single letter variables make sense in context (x, y, z)

ivory sleet
#

yeah well you have the try catch (Exception e)

#

also

thin iris
#

exception e is valid

shadow night
#

Exception caughtException

echo basalt
ivory sleet
#

yea, well there was only one subtitle I had something crucial to say about

ivory sleet
#

else its pin-worthy :>

echo basalt
#

homie about to pin my entire index

echo basalt
shadow night
#

I like how half the pins are messages from @echo basalt

echo basalt
#

also serves as portfolio

smoky oak
#

i just clicked the pins and im like 'tf that's a thing in java'?

#

like is there seriously a transient keyword in java

echo basalt
#

I don't see anyone else making big ahh posts in discord

#

oh shoot I forgot native3

quaint mantle
#

hi i have a stupid question

smoky oak
#

?ask lol

undone axleBOT
#

If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!

quaint mantle
#

im typing 😭

#

are animation limit to one mob

#

for example does the piglin dance animation work on a zombie

echo basalt
#

probably not

quaint mantle
#

or is it hardcoded

echo basalt
#

mobs don't follow a generic model, animations and bounding boxes are coded per model

rotund ravine
#

Probably

smoky oak
#

its worth a try tbh
aren't animations handled disjunct from the entities?

#

or does every entitiy have its own arm swing animation

echo basalt
#

pretty sure it's just poses

quaint mantle
echo basalt
#

@ivory sleet fixed it

#

is it good now

rare ether
ivory sleet
desert tinsel
#

wdym

ivory sleet
#

well actually, do u mind sending the utility method?

echo basalt
#

Also added a block for premature optimization

#

ow that command manager

desert tinsel
# ivory sleet well actually, do u mind sending the utility method?
public static void openInventory(Player p, BossEvents plugin) {
        Inventory voteInventory = Bukkit.createInventory(null, 27, "Buy an item");
        voteInventory.setMaxStackSize(3);
        for (Item item : plugin.getItemsManager().getItems()) {
            ItemStack is = new ItemStack(item.getMaterial());
            ItemMeta meta = is.getItemMeta();
            meta.setDisplayName(item.getName());
            meta.setLore(Arrays.asList("Price: " + item.getCost()));
            is.setItemMeta(meta);
            voteInventory.setItem(item.getSlot(), is);
        }
        p.openInventory(voteInventory);
    }```
ivory sleet
#

so well, I wouldnt call that a utility method

#

its more a clumsy static helper method

desert tinsel
#

idk these names

ivory sleet
#

well, a utility method is pure and stateless, meaning that it wont ever return void

echo basalt
#

Also added guard clauses at the top

ivory sleet
#

a static helper method just does a bunch of stuff, in principle

echo basalt
#

got a solid 10 characters to spare

#

should be good now

echo basalt
#

also you pinned the wrong msg

#

mr lube

quaint mantle
#

mr lube 💀

ivory sleet
#

😒

pure stag
#

Hello everyone, I do custom enchantments, if I add Lore in English, then everything is displayed perfectly, but if I output it in Russian or Ukrainian, then random symbols appear there like at the enchantment table

#

How to fix is?

lost matrix
pure stag
#

It is compiled using UTF-8

eternal oxide
#

Files (yml) have to be created/saved as utf-8 too

pure stag
#

For tests I changed displayName in code

eternal oxide
#

Then you can't be compiling in utf-8, or your IDE is not set to utf-8

upper hazel
smoky oak
eternal oxide
#

no

#

not always

lost matrix
upper hazel
eternal oxide
#

probably old

upper hazel
#

damn I didn't find more recent tutorials

#

Did I understand correctly that the successor of chunkGeneration is the chunk itself in Minecraft and all its methods are overridden to fill the chunk with their own systems?

#

if so can I override the vanilla generator and change it a little?

sullen marlin
#

Sorry don't understand the first part

#

But yes you can override vanilla with the should methods

icy beacon
ivory sleet
#

e is fine

icy beacon
#

Idk looks a bit ugly

#

I have a habit of naming Exceptions at least ex because I used to do stuff like Player p back in the day, and so exceptions would clash with entities lmao

shadow night
#

lol

icy beacon
#

I do use kotlin now

#

Primarily

#

The habit has stuck though

#

Wasn't spigotcraft pfp yellow

rotund ravine
#

Never

icy beacon
#

Shit. Solo Mandela effect

shadow night
#

not solo

#

duo

icy beacon
#

yOU ALSO THINK IT WAS YELLOW??

#

We gotta find some old screenshots of this server

#

Like year-old ones

#

It was gray. Welp

eternal oxide
#

Ouchie

echo basalt
#

bro sending finger pics

quaint mantle
#

Its6am

smoky oak
#

its 12 am

rotund ravine
#

Some post from alex ages aho

#

Ago

lost matrix
#

Yeah that looks about right...

echo basalt
#

wait this is not general

#

explains why 7smile is here

lost matrix
smoky oak
#

this is general what are you on about

inner mulch
#

Is there an event for when a player middle clicks a block in survival?

rotund ravine
#

What does that even do

inner mulch
#

Nothing, but it works in creative

shadow night
#

in survival it'll take the same block from your inventory into your main hand if you have it, obvioulsy

grim hound
#

is there somewhere a general method where the server sends the packets to all the channel handlers?

rotund ravine
#

What

ivory sleet
#

but to answer ur question, prob not (speculation only)

grim hound
#

what if there's a like a player list update packet it's sent to everyone equally

ivory sleet
#

hmm, iirc there are some helper methods to dispatch a packet to a certain chunk or level etc, and then that level/chunk will just delegate those packets to the players contained within them

#

something like that at least

upper hazel
#

is the vanilla chunk generator registered in the same way as in the plugin through the abstract class chunkgeneration?

rotund ravine
#

Probably not

upper hazel
#

As I understand it, you need to convert the Minecraft code to bukkit api methods?

echo basalt
#

You just described craftbukkit

upper hazel
#

ah?

#

oh yea

#

craftBukkit load

#

this all

ember estuary
#

What are the most common mistakes when making a plugin, in regards to server performance?

(For example (atleast I think that‘s bad): creating a scheduler for each player instead of having a single scheduler in which i loop over all players)

rotund ravine
#

There’s so many

ember estuary
#

My MSPT is at ~48 and i wanna get it down a bit, so I‘d like to check my plugin for such mistakes.

ember estuary
#

Is using PlayerMoveEvent a lot bad?

hybrid spoke
#

dont do unnecessary shit, dont do shit twice, dont do expensive shit in high frequency events

ember estuary
#

Say i want to detect when a player is in a certain area. Should i have a 1 second repeating scheduler that checks all players, or should I just check it in the MoveEvent

hybrid spoke
#

not having common sense is the biggest mistake

deft thistle
#

(i believe)

ember estuary
#

Hmm yea that makes sense

#

But on the other hand, the moveevent is triggered like 20 times per second per moving player, whereas the loop will only run once per second

rotund ravine
#

PlayerMoveEvent is very expensive due to it being called an absurd amount

hybrid spoke
#

multiple times per tick

rotund ravine
#

Generally just avoid moveevent

#

If you really really need it make sure it’s cheap logic

young knoll
#

If you really want to know what’s going on

#

Make a spark report

grim hound
#

PlayerMoveEvent, the performance graveyard

eternal oxide
#

early exit unless to and from blocks are different

hybrid spoke
# rotund ravine Hm?

to avoid evaluating jumping, movings inside the same block or crosshair movement

rotund ravine
#

Oh yeah i get what he meant now

grim hound
#

which one should I go for?

#

the second one executes the tasks always a tick late but there is no need for synchronization at task addition

#

both work

#

(probably)

rotund ravine
#

ahaha

valid burrow
grim hound
#

but the first one is how you should properly handle multi-threading

valid burrow
#

multi threading? minecraft is entirely single threaded though isn’t it

young knoll
#

no?

#

It hasn't been for a long time

#

Netty has threads, chat is another thread, worker threads are used for worldgen

valid burrow
#

damn

#

when did tht change

#

what did i miss

rotund ravine
#

Ages ago

valid burrow
#

damn

grim hound
slender elbow
#

the tick loop is single threaded, that's about it

grim hound
#

so like

#

2011

#

or 12

slender elbow
#

i mean, chat is another thread on (craft)bukkit (+ forks), it's sync on vanilla lol

valid burrow
#

i believe yall over reddit and google but all sources i find say its still single threaded xd

young knoll
#

Wait the chat thread is a bukkit thing?

young knoll
#

huh

valid burrow
slender elbow
#

but the entirety of minecraft does not run on a single thread

#

that would be horrible

grim hound
# valid burrow

single-threaded is used here for the meaning that the main server logic is synced

valid burrow
young knoll
#

I think the main benefit that could be introduced is threaded entity ticking

grim hound
#

unlike Folia for example

young knoll
#

Look out for my new fork

young knoll
#

DeluxeAsyncEntityTickingSpigot™️

wet breach
grim hound
#

the entire netty communication is async

valid burrow
#

2023, 2021 etc

wet breach
#

idk what those dates mean

grim hound
valid burrow
#

im not saying i disagree

#

its just that i cant find anything about it and i wanna read about it xd

young knoll
#

Not really much to read

#

Communication is handled by the netty threads

#

Worldgen does some wacky passing between worker threads

#

And chat is just chat

quaint mantle
#

Just imagine what would be if netty channels are synced

rotund ravine
river oracle
wet breach
rotund ravine
river oracle
shadow night
rotund ravine
#

Poor chat

#

Lol

#

It's such shit ahaha

river oracle
#

Just freeze the sever until we get the next chat packet

young knoll
#

Might be fun to try and make entity AI async tbh

rotund ravine
#

anyone

young knoll
#

Did they do that?

young knoll
#

I never used it

rotund ravine
rotund ravine
rotund ravine
#

Nothing

river oracle
young knoll
#

Placebo effect

grim hound
#

what does this even do?

young knoll
#

Very stronk

rotund ravine
#

Nothing other than printing messages

young knoll
#

Nah man Nest uses a custom chunk loader called Nester, which improves chunk loading by determining where players spend the most time.

rotund ravine
#

Suure

river oracle
#

I hate all these performance plugins I'm about to make AsyncMemoryLeakPremium

rotund ravine
river oracle
#

Make memory leaks on a whim

#

You can leak a certain amount of memory on a timer

#

Omg I'm going to be rich

grim hound
young knoll
#

New server shutdown timer

river oracle
young knoll
#

Slowly leaks memory until OOM

#

Yes we will leak the memory async

river oracle
#

Thank god

grim hound
#

Behold

#

my newest creation

#

ServerOptimizerPremium 1.0 BETA

wet breach
remote swallow
#

You dont run it

shadow night
young knoll
#

How many threads is that

#

Someone do the math

shadow night
#

like a fuck ton

remote swallow
#

Ur a helper help us by doing the math

grim hound
grim hound
#

?

wet breach
young knoll
#

Okay well, how many does it try to make

rotund ravine
#

Coroutines go stonks

wet breach
#

Will probably try to make an infinite amount lol. But at 64gb of memory and the system using 2gb of it you could have like 200k threads if my math is correct

grim hound
#

Yes, it approaches infinity

pine forge
#

Hey, im trying to hide a player's equipment with protocolllib and im getting this exception:
This is my code:

PacketContainer packetContainer = new PacketContainer(PacketType.Play.Server.ENTITY_EQUIPMENT);
packetContainer.getIntegers().write(0, player.getEntityId());
packetContainer.getItemSlots().write(0, slot); <- error
worldly ingot
#

There’s api for this in modern versions

#

Player#sendEquipmentChange()

pine forge
#

ah okay thanks

lost matrix
worldly ingot
#

Also, yeah, for future reference, ProtocolLib operates off of fields in the packet class, not the actual protocol data

pine forge
#

okay what would be the correct field for this then?

worldly ingot
#

Not sure off memory. Probably getItemSlotPairs() or something

pine forge
#

getSlotStackPairLists?

worldly ingot
#

That's the one

#

You are best to use API though because it does all this for you and faster

pine forge
#

Yea, ill use that one

#

Thanks for the help

lost matrix
#

Which translates to something like

    PacketContainer container = new PacketContainer(PacketType.Play.Server.ENTITY_EQUIPMENT);
    container.getIntegers().write(0, someId);
    
    List<Pair<EnumItemSlot, ItemStack>> slotStackPairs = new ArrayList<>();
    slotStackPairs.add(new Pair<>(EnumItemSlot.MAINHAND, new ItemStack(Material.DIAMOND_SWORD)));
    
    container.getSlotStackPairLists().write(0, slotStackPairs);
pine forge
#

yea

#

ill use the api though

rough drift
#

Can you stop chunks from being sent to a player without using ProtocolLib/NMS

weak meteor
upper hazel
#

By the way, why is interacting with the chunkLoadEvent chunk more expensive than creating your own chunk generator?

rotund ravine
#

Think about it

grim hound
wet breach
#

you would have to stop the server from reading the chunk in the region file

#

if the server can't read that information or its incomplete, it doesn't get sent

rough drift
#

can I also just cancel ChunkLoadEvent

wet breach
#

sure

rough drift
#

ohk

wet breach
#

just not sure what you were wanting was all 😛

#

I was under the impression without using the api, what other ways could you stop a chunk from being sent lol

slender elbow
#

i mean you can still make the player load the chunk on the server and get it ticking normally without sending the chunk info to the client, but that does require nms or {packets library of choice}

#

which falls outside of the presented constraints

rough drift
#

Thanks ya'll

rotund ravine
#

Ur welcome

twin venture
#

Hi i have a question about something iam working on so i have been working on a Default kit for Each user and it will be saved in the mysql database .

so i started by making a PlayerKit class it hold :

  • PlayerData class
  • String kit name
  • ItemStack[] contents
  • ItemStack[] armors
    ..
    what would be the best way to serlize the itemstacks and desrlize?
#

playerData class hold 2 methods :

  • void setPlayerKit(PlayerKit playerKit);
    and a PlayerKit playerKit();
#

with other methods and stats ofc

lost matrix
#

Serialize them to a single String and store them as Varchar

twin venture
#

what if a user changed kit ? how would it remove only that kit items and add the new one?

twin venture
#

i do have a tag on kit items its called : Kit

twin venture
lost matrix
#

Are kits unique to players or can multiple players have the same kit?

twin venture
#

the latter one

lost matrix
#

Where are kits loaded from?

twin venture
#

each kit have its own .yml file

lost matrix
#

In that case, you should not store all items in your DB but only the name of your kit

twin venture
glad prawn
#

ay Key

twin venture
lost matrix
#

Why are KitItems addressable via an UUID?

twin venture
#

each item have its own uuid

twin venture
lost matrix
twin venture
#

so i can just do that

#

or other stuff

#

but its not important i can remove it anywhy

rotund ravine
#

UUID seems overkill

#

Unless ur doing some duplicate protection

glad prawn
#

yeah name is enough

pine forge
#
System.out.println(event.getAction() + " " + event.getModifiedType());
System.out.println((event.getAction() == EntityPotionEffectEvent.Action.ADDED) + " " + (event.getModifiedType() == PotionEffectType.POISON));

Why doess this comparison of potioneffecttypes not work

rotund ravine
#

?jd-s

undone axleBOT
rotund ravine
#

Use equals

#

try that? Not sure

dry hazel
#

reference equality works just fine on enums

lost matrix
#

PotionEffectType is not an enum

dry hazel
#

if it is one that is

lost matrix
#

^^

dry hazel
#

yeah

rotund ravine
#

Seems to be a constant though

#

So it shooould work

dry hazel
#

not necessarily

lost matrix
#

But i feel like spigot should make sure to reuse those instances instead of creating new ones...

rotund ravine
#

Agreed. Guess not?

pine forge
#

okay thats weird

#

why is it not an enum

lost matrix
#

Most enums will be replaced by constants in the future because it is needed to reflect the underlying structure mojang is going for.
Everything aims to be data driven, and enums are simply too rigid for that.

pine forge
weak meteor
#

why

#

-.-

rotund ravine
#

Do it

pseudo hazel
#

can I show images of a minecraft item in chat or on like the scoreboard (using resourcepacks)

hybrid spoke
pseudo hazel
#

so I can also show vanilla items that change texture if you apply another resource pack? like I know you can just create images but I wonder how I would use existing images

#

idk if what I said makes any sense but I may have solved my problem xD

river oracle
#

if you were to create another font, however if YOU as a server were to apply a resource pack something like this could be achieved you'd just need to change the relevant chat textures within your pack

pseudo hazel
#

well yeah but I meant if I can reference a vanilla texture location

hybrid spoke
pseudo hazel
#

well the items have a model and stuff

#

which is also what the custom items get

icy beacon
#

Anybody experienced with programming for Android? I'm trying to set sdk level to 30 because that's what my phone is at (Android 11) but apparently Google Play requires that apps target API level 31 or higher. Does this mean that the app will not work on my phone? My minSdk is set to 26, and compileSdk & targetSdk are at 30 (presumably I'll have to set them to 31)

hybrid spoke
icy beacon
#

I'm asking primarily because my app is currently crashing on start and I'm trying to see whether that could be the reason

hybrid spoke
#

if you dont use newer api yes

icy beacon
#

Tyty

hybrid spoke
#

its backward compatible

hazy parrot
weak meteor
#

maybe

slate tinsel
#

Is it possible to retrieve how high a block is somehow?

rotund ravine
#

Yes

candid galleon
#

getY() ?

slate tinsel
slate tinsel
candid galleon
#

:nanithefuck:

#

what do you mean

#

how high

#

like get what drugs its taken?

#

i dont think blocks have a BAC

slate tinsel
#

sorry if i'm unclear you know blocks have pixels like i want to somehow be able to measure how many pixels a block has or somehow get the height of a block

rotund ravine
#

Like a slab is 0.5 and a full block is 1