#help-development

1 messages · Page 738 of 1

warped shell
#

i just need to read

#

its for spawning particles

#

tyvm

river oracle
#

e.g. you can't do Chunk.getChunkSnapshot() in an async task, but you can do Chunk.getChunkSnapshot() synchronously than pass it to an asynchronous task

warped shell
#

kk

river oracle
#

:3 do you know how to solve my problem

#

I just love pestering you!

kind hatch
#

I mean, I would say mvn install, but this looks like a multi module project.

river oracle
#

it is

#

maybe my caches are fucked up

#

it built once

#

it just didn't build one module for some reason

#

than I try to go back and redeploy and it won't deploy now

kind hatch
#

You do the deploy step?

river oracle
#

why wouldn't you deploy?

#

grrr it doesn't make sense

kind hatch
#

Well, do you have a reason for it? I thought deploy was usually used for uploading to a server.

river oracle
#

exactly what I'm doing

#

more pressingly though I can't even deploy seeing as bukkit-core module won't build even though all other modules do

kind hatch
#

Does it say why it failed?

#

Or was that what you posted earlier?

river oracle
#

.

#

how can it be absent. It doesn't even "need" to be there I'm simply depending on another module it doesn't have to exist yet until a later build step

#

adding scope provided doesn't help the fact either

kind hatch
#

Can you paste your poms?

river oracle
#

all?

#

?paste

undone axleBOT
kind hatch
#

Hmm, nothing looks out of the ordinary. All your versions match up.

I usually just use the parent version when I set up multi module projects. (${project.parent.version})
I also made the parent version a variable so I only need to change it in one spot.

river oracle
#

i use mojo version plugin so it changes versions for me

kind hatch
#

Maybe that's why? That plugin could potentially be causing that issue.

river oracle
#

nah I've been using it for a while

#

no reason it'd break now vs in the past when nothings changed

kind hatch
#

Tell that to my BT compilations. 💀

river oracle
#

I just don't get why it let me deploy once

#

could be my maven cache extension

#

Ig I'll try clearing that too

#

though mvn clean install doesn't work either

kind hatch
#

Do you have a suketto module?

river oracle
#

yeah

#

its the dist

#

artifactId != module name its so weird 🤷‍♂️

kind hatch
#

Hmmm

river oracle
#

it never gets to the dist module though as bukkit-core never compiles

kind hatch
#

Maybe try a mvn clean install -U

#

Then try and redeploy.

river oracle
#

nop 😢

#

same error when running mcn clean install -U

#

😭 found someone with a similar issue on stack overflow, 0 answers

#

@kind hatch clearing my build cache solved the issue

#

probably a bad file in there

kind hatch
#

What command did you use? I should try it for BT.

river oracle
#

maven only caches if you use the extension, if there is a build cache it'd be in .m2/build-cache
rm -r /home/[youruser]/.m2/build-cache

kind hatch
#

Rip. Guess I just gotta deal with my compiler.

warped shell
#

looking for suggestions, I want to display the light particle to players holding a certain item, similar to holding a light block in creative mode.

So far my idea is to put players holding the item in a list and iterate over the list to get the blocks around them which are light blocks.

Then just put the iterating into a bukkit runnable

Any suggestions to do it otherwise?

fossil lily
#

List is probably not necessary. You can just iterate through online players.

covert silo
#

ok i tried to solve this myself but i gave up lol. i logged in with git credential manager and am able to read/write for the repo so im not sure why i get this with buildtools: https://mihadkho2019_gmail.com@hub.spigotmc.org/stash/scm/~mihadkho2019_gmail.com/bukkit.git: Authentication is required but no CredentialsProvider has been registered

small iron
#

Can we make plugins on Mobile?
Honestly, I'm too lazy to get out of bed and open my laptop.😂

echo granite
covert silo
#

lol u cud create an app with chatgpt that takes in voice recognition and codes for you as u speak

echo granite
#

How are you going to compile the code into a jar file?

#

also install the spigot api dependency

slender elbow
#

ssh in shambles

covert silo
#

[HELP] BuildTools Authentication error when running jar

upper hazel
#

I wanted to know if it is necessary to every local object add final if I don’t want to pass a new reference to the object there

hazy parrot
#

What

slate tinsel
#

Anyone know how to make a code that creates a new world without it being a lag spike on the server?

eternal oxide
#

Not possible on Spigot, unless you do it during startup/shutdown

covert silo
#

you can emulate a new world probably by just restricting the players to a very far away quadrant on the map. ive seen a few plugins do that

slate tinsel
covert silo
#

oh a new dimension?

slate tinsel
slate tinsel
eternal oxide
#

that all depends on teh power of the server

#

on weak servers creating a new world can kick all connected players due to lag

slate tinsel
eternal oxide
#

no

#

Spigot worldgen can only be run on the main thread

slate tinsel
drowsy cosmos
#

is there an Event i can use to check when player equips certain items in any slots?

quaint mantle
#

In InventoryClickEvent, am I safe to use == instead of Inventory#equals to check if inventory reference matches the reference I am holding inside InventoryManager?
My idea is increasing performance but this wouldn't be possible if there would be a case that InventoryClickEvent creates a new instance of Inventory and passes it in the event

sullen marlin
#

try and see?

#

pretty sure its the same instance

drifting viper
#

guys what Minecraft 1.20.2 change in Networking ?

sullen marlin
#

stuff

#

do you have a more specific question

drifting viper
#

The majority of changelogs I've come across simply state "Improved Networking.". i just was looking more in depth and had to find out was they Changed

#

so do you think they acutally improved stuff ?

sullen marlin
#

Idk

warm mica
drowsy cosmos
#

If a player has a Slow 2, then I added a new potion effect Slow, with level 1. Now the player would have Slow 3 right? Is it possible to remove the recently added potion effect Slow 1, so it becomes Slow 2 again, instead of removing slow effect completely?

young knoll
#

If you add a higher level it will override

#

If you add a lower level it will be ignored

drowsy cosmos
#

I see.. Okay thank you!

sick edge
dawn flower
#

can u cancel an InventoryCloseEvent in 1.8.8?

young knoll
#

No

dawn flower
#

crap

#

what if i reopen it after 1 tick of closing it

young knoll
#

Sure

glossy venture
#

is this how you run commands as a player in bungee?

#

will this also dispatch to the proxy or only the server the player is on

#

this is meant to be called remotely from a server node to invoke network commands

#

ah great thanksl

fervent cobalt
glossy venture
#

intellij

fervent cobalt
#

Wait what theme is that?

#

Looks great

glossy venture
#

One Dark

#

with Fira Code font

fervent cobalt
#

Thanks

young knoll
#

Generation is already async

#

Kinda

#

I think the main issue is adding the world itself

#

Sure

#

Doesn’t stop a lag spike tho

hushed spindle
#

what is the difference between getEntity and getPotion in PotionSplashEvent? both return ThrownPotion

#

getEntity is there because it extends an ProjectileHitEvent but then getPotion seems sorta redundant

young knoll
#

Probably just for clarity

upper hazel
#

There is an abstract class A and B.
How to make B's descendant not inherit A's methods as well. But B extend A

glossy venture
#

how do i force a player to run a command through the proxy

#

from bungee

worldly ingot
#

I don't think you can

#

At least not anymore. Chat spoofing hasn't worked for a hot minute

glossy venture
#

aint no way

#

ill try to access the command handler code in bungee through reflection ig

#

why doesnt chat spoofing work tho

#

the signatures?

young knoll
#

Wait we can’t spoof chat anymore

#

Damnit

worldly ingot
#

Signatures, yes

glossy venture
#

new snapshots dont require a valid signature anymore th

#

tho

#

so it could be reintroduced maybe

#

lmao wtf

restive mango
#

Is there a way to store arbitrary information on any block, or only on blocks that are tile entities (and so have PDCs)?

young knoll
#

?blockpdc

undone axleBOT
restive mango
#

Ah, cool

ancient plank
#

I was about to send u that @restive mango

restive mango
#

Store everything in a string

#

It’s just locations after all

#

It’ll only be like 20,000 characters

smoky oak
#

can you make instanceof checks switch directly (ik i can do it with class names but thats most likely slower)

#

fuck u cant

#

elif it is

subtle folio
#

generic hell

young knoll
#

If you want to know about speed

#

Look at the compiled bytecode of each :p

smoky oak
#

pretty sure a switch on getClass.asString is slower than three instanceof checks

opaque scarab
smoky oak
#

irritating i cant make a unifying interface

#

wait

#

i can

opal carbon
#

yeah

opaque scarab
#

I've been able to compile this for months, and now for some reason it doesn't work

lilac dagger
#

== should be fine

#

Unless you cross check against multiple class loaders

#

Very unlikely

#

But i'm pretty sure even equals fails then

hazy parrot
#

Why do you cast on generic

dusky crane
#

For some reason maven is not putting the classes in my jar.

#

I run mvn package and it only adds pom.xml, plugin.yml and some other config stuff.

river oracle
#

?paste

undone axleBOT
river oracle
#

btw don't type it in chat

dusky crane
hazy parrot
#

You mean it doesn't compile your classes?

river oracle
#

why are you targeting java 21

#

when your java version is 8

#

what sense does that make

hazy parrot
river oracle
#

did you just copy and paste this configuration?

hazy parrot
#

Looks like it

river oracle
dusky crane
river oracle
#

you can't target 1.16 with java 21 anyways

#

the server won't run that

#

you need to use java 8

dusky crane
river oracle
#

well then target java 21 java.version = 21

dusky crane
#

It only includes META-INF and plugin.yml

river oracle
#

try clearing your cache

dusky crane
#

You mean invalidate caches in intelliJ?

river oracle
#

that and build-cache if you use it for maven

#

if you have no clue what that means just ignore ^

dusky crane
#

target folder and invalidate caches in intellij

river oracle
#

@dusky crane can you show your project structure too please

dusky crane
#

I can't upload photos

river oracle
#

?img

undone axleBOT
#

Can't send images? That's because you're not verified! Use !verify to complete verification.
Alternatively, you can upload screenshots to any image hosting site and share the link.

Here's some screenshot utilities that can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org

dusky crane
river oracle
#

try getting rid of maven compiler plugin

#

than recompiling

#

you don't technically need MavenCompiler plugin here as you don't need to configure it

#

<outputDirectory> is a valid configuration of maven shade

#

as well as <finalName>

dusky crane
#

Compilation failure.

#

I removed this from my pomxml <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.8.1</version> <configuration> <source>21</source> <target>21</target> <outputDirectory>~/Desktop/MCserver/plugins</outputDirectory> </configuration> </plugin>

river oracle
#

why did it fail

#

?paste

undone axleBOT
dusky crane
#

[ERROR] Source option 7 is no longer supported. Use 8 or later.
[ERROR] Target option 7 is no longer supported. Use 8 or later.

worldly ingot
#

Maven requires 8 minimum

dusky crane
#

I'm using java 21

river oracle
#

no you're not

worldly ingot
#

Sure but you're probably running Maven with Java 7

river oracle
#

you have lots going on here

  1. You're project java.version property is 8
  2. You're running maven with java 7
  3. you're trying to compile to java 21
#

as you could imagine this might cause some issues

dusky crane
#

I've set java.version to 21

#

<java.version>21</java.version>

river oracle
#

though I'd personally create the dependencyReducedPom

#

Many people who are using the maven-shade-plugin commonly set to false for reasons beyond my grasp. This is generally a bad idea, as it can lead to problems if you’re writing a library, and has absolutely no advantages. Here’s a rule of thumbs: If your project shades dependencies, it should create a dependency-reduced-pom.xml. The...

dusky crane
#

Thanks!

#

Works now.

river oracle
#

in the future make sure all your versions are consistent

#

always use the java version property for consistency

dusky crane
#

Now I'm gettings lots of errors 🙂

river oracle
#

as expected when using java 21 with 1.16

dusky crane
#

About the same problem when I have java version set to 1.8

#

What dependecy do I need to update in Spigot to make it work with Java 21?

zenith gate
#

would it be better to have multiple PlayerInteractEvents or combine them all into 1 and seperate the logic into their own methods? I'm not 100% sure on the performance impacts one recieves from going with 1 or the other.

dusky crane
#
    public ChunkGenerator.ChunkData generateChunkData(World world, Random random, int chunkX, int chunkZ, BiomeGrid biome) {
        ChunkData chunkData = createChunkData(world);
        chunkData.setRegion(0,0,0,15,0,15, Material.BEDROCK);
        chunkData.setRegion(0, 30,0,15, 60, 15, Material.STONE);
        chunkData.setRegion(0, 61, 0, 15, 64, 15, Material.DIRT);
        System.out.println("Stared generation");
        System.out.println("chunkX: "+chunkX);
        System.out.println("chunkZ: "+chunkZ);
        for (int x = 0; x < 16; x++) {
            for (int z = 0; z < 16; z++) {
                for (int y = 1; y <= 64; y++) {
                    System.out.println(x + " " + y + " " + z);
                    biome.setBiome(x, y ,z, Biome.BIRCH_FOREST);
                    if (y < 7) {
                        if (random.nextDouble() > 0.15) {
                            chunkData.setBlock(x, y, z, Material.LAVA);
                        }
                    }
                    if (y > 3 && y < 35) {
                        if (random.nextDouble() < 0.2) {
                            int i = random.nextInt(10);
                            if (i == 0){
                            chunkData.setBlock(x, y, z, Material.DIAMOND_ORE);
                            } else if (i < 6) {
                                chunkData.setBlock(x, y, z, Material.IRON_ORE);
                            } else if (i > 6 && i < 9) {
                                chunkData.setBlock(x, y, z, Material.GOLD_ORE);

                            }else {
                                chunkData.setBlock(x, y, z, Material.LAPIS_ORE);

                            }

                        }else chunkData.setBlock(x, y, z, Material.STONE);
                    }
                    }
                }
            }
        Bukkit.getLogger().info("Generation complete");
        return chunkData;
    }```
I think something here is calling itself
upper hazel
#

Can I cycle through players and locations around them asynchronously?

sacred schooner
#

https://wiki.vg/Protocol#Registry_Data Is this packet missing from ProtocolLib or am I misunderstanding? It's referenced as a separate packet in the MC source code as well however I was only able to find a reference to the PacketType.Play.Server.CUSTOM_PAYLOAD packet

#

okay nvm

#

it seems that the latest source does have this packet defined

#

but it hasn't been released yet?

#

oh wait nvm I'm being stupid

#

I should be checking protocol for version 1.20.1

worldly ingot
#

The configuration phase was only added in 1.20.2, so that would be why you're only seeing it there

young knoll
#

The breaking proxy’s phase

opal juniper
#

understandable have a nice day

upper hazel
#

Can work with the Player and Location object be performed asynchronously?

opal juniper
#

Location, 100%. Player you have to be aware the player can leave and the object can go stale

magic summit
#

hello, i need a function that returns a random entitytype that is a normal mob, but i dont know how to filter the entitytype enum corrently so it gives me like item frames, markers, amourstands etc

young knoll
#

First you want to filter EntityType#getEntityClass()#isAssignableFrom(LivingEntity.class)

#

That'll remove most non-mobs

#

Then filter out armor stands because they are special

#

Then filter out !EntityType#isSpawnable to remove non spawnable types (Probably only player)

young knoll
magic summit
#

OHHH

#

im using kotlin

#

btw

quiet ice
young knoll
quiet ice
#

Maven itself can even compile down to Java 6 for sure, probably Java 5 too but I did not try that out yet.

worldly ingot
#

You can only run Maven with Java 8+ though

#

You can compile lower, sure, but the JDK you have installed must be 8

magic summit
river oracle
potent atlas
#

My plugin name is showing before the command when I go to type the command in game. Like pluginname:command, is there a way to remove that? I searched google for hours >_<

young knoll
#

You can do it without the plugin name as well, it's for preventing conflict issues

#

You can disable it server wide or with some code in your plugin

potent atlas
#

I'd like to disable it in my plugin.

young knoll
#

Use the PlayerCommandSendEvent and remove the version with the prefix

#

I advise against it though, like I said it exists for a reason

potent atlas
#

Thank you, I will try that event

quiet ice
river oracle
quiet ice
#

Yeah this just had something to do with the JDK being more than 3 LTS versions ahead of the target version

potent atlas
quiet ice
#

In 3 years Java 8 projects will no longer be compileable [on the most recent JDK] and I don't quite like that...

river oracle
#

its about time java 8 dies

quiet ice
#

Yeah unfortunately I do not have that luxury. And for some dumb ass reason I'm getting people demanding Java 5 backports for my projects

#

Yes, Java 5.

river oracle
#

what projects?

young knoll
#

Have you considered violence

river oracle
#

I'd honestly ignore those demans unless its for your job then you can't

#

java 5 is dead

quiet ice
#

Micromixin.

young knoll
#

Ooh looks cool

quiet ice
#

I've already ruled out a J5 port though, J6 is the lowest I'm comfortable to go even though J11 (which is the only JDK my project now compiles on) is EOL at this point

#

However thanks to gradle toolchains Java versions are noone's concern anymore

young knoll
#

Does it work on spigot

#

:p

halcyon hemlock
#

How can I get title of an inventory object?

eternal oxide
#

The Inventory doesn't have a title, only the View does

halcyon hemlock
#

I need to use reflection?

eternal oxide
#

no

#

An Inventory doesn't have a title, only a View (getView) does

halcyon hemlock
eternal oxide
#

a view is when a player has an Inventory open

young knoll
#

It's only in events

halcyon hemlock
#

reflections worked

#

also inventory does have a title

#

you know when you create an inventory, you provide a title

#

let me show u, wait

#

No

#

I need because I'm making a wrapper

halcyon hemlock
young knoll
#

Idk why it's hidden if it's still there

#

¯_(ツ)_/¯

halcyon hemlock
#

the class isn't public lmao

#

istg who made mc

#

This worked, to get inventory name, if anyone else needs.

#

not the best way, but works

young knoll
#

Bukkti consumer is fully deprecated in modern versions

#

Idk, maybe it's from before java consumers

halcyon hemlock
#

Use java consumers

#

never tried bukkit consumers

river oracle
#

don't they're deprecated for a reason

#

they were added prior to java 8 because Consumers didn't exist

magic summit
halcyon hemlock
#

?

undone axleBOT
halcyon hemlock
#

What interact

magic summit
#

item.itemFlags.clear() it dont work though

river oracle
#

that's an in game tooltip

worldly ingot
#

It's not hide placed on. It's hide potion effects

halcyon hemlock
#

What r u guys talking about 😂💀

worldly ingot
#

Improperly named item flag but that's the one you want

#

Bukkit naming

magic summit
#

so how do i remove it

warped shell
#

looking for suggestions, I want to display the light particle to players holding a certain item, similar to holding a light block in creative mode or barrier block.

So far my idea is to put players holding the item in a list and iterate over the list to get the blocks around them which are light blocks.

Then just put the iterating into a bukkit runnable

Any suggestions to do it otherwise?

worldly ingot
#
ItemStack item = new ItemStack(Material.SPAWN_EGG);
ItemMeta meta = item.getItemMeta();
meta.addItemFlag(ItemFlag.HIDE_POTION_EFFECTS);
item.setItemMeta(meta);
player.getInventory().addItem(item);```
worldly ingot
#

Maybe instead of setting the blocks on the server, just Player#sendBlockChange() would suffice though as to not change the state of the world unnecessarily

warped shell
#

i wont need to change any blocks

#

just spawn a particle

#

on the block in async

worldly ingot
#

Oh, sorry, misread

warped shell
#

np

worldly ingot
#

Thought you wanted dynamic lighting

magic summit
#

\nickname Qualenski (uses Kotlin)

worldly ingot
#

Yeah no that's totally fine then

magic summit
#

fuck

#

admins change my nickname pls

#

nahh

#

dont have account

remote swallow
#

you cant

#

we cant change nicknames

#

that was changing their actual display name

#

bc their spigot name was the same as display/profile name they didnt get a nicknam

zenith gate
#

how could I set an IromGolems Path AI to be like a wolf? to follow its owner.

young knoll
#

Do they even have an owner

remote swallow
#

yeah you can spawn them

#

4 iron blocks and a pumpkin

zenith gate
#

so i could spawn set tham as spawn, and then set their owner key to the player? they will then follow the player?

young knoll
#

No you need to replace their ai

zenith gate
#

how am I to do that? Make my own IronGolem class? because setAI is just a boolean to turn it on or off.

river oracle
#

you'll need to use NMS

#

?nms

river oracle
#

setup tutorial here

young knoll
#

You don't need your own class, you can modify the existing one

#

Only problem is PathfinderGoalFollowOwner only accepts EntityTameableAnimal

#

Iron golem does not implement EntityTameableAnimal

zenith gate
#

Couldn't I make the IronGolem Tameable?

river oracle
river oracle
zenith gate
#

damn..

river oracle
#

you'll need to 1. Use NMS, 2. Make your own Pathfinder Goal, 3. Make some systemf or keeping track of the owner

young knoll
#

If I can find how the golem even stores it's owner

river oracle
#

it doesn't? Aren't Iron Golems having no owner

#

it wouldn't make sense if they did

zenith gate
#

normally they wouldn't have it.

#

Ive added it into their pdc petOwner.

#

because I thought that would work lol

river oracle
#

yeah no :P

#

if you need any help with nms you can try and come here though people aren't guarenteed to know as its more abstract

#

@young knoll coll pathfinder api when?

young knoll
#

Oh it doesn't store its target

#

It just stores that a player created it

#

So yeah you'll need to add a pdc tag for the owner, and then check that in the ai goal

zenith gate
young knoll
#

MojMap exists now

#

Consistent naming woo

zenith gate
#

intellij plugin or a standalone app?

river oracle
#

they are a thing

#

Mojmaps make life so easy read the blog to set NMS up

#

unless your on versions < 1.17.1 you'll be fine

#

if you're below that suffer 😈

zenith gate
#

im on the latest lol

#

i keep my stuff updated i dont like working in the woods lmao

river oracle
#

then follow the guide above

young knoll
#

The main problem is Mojang has like 200 existing pathfinder goals, and they all take different arguments

#

Which makes it hard to expose them in the API

#

Maybe if you want to set a record for the worlds biggest factory class

halcyon hemlock
#

I like raw nms

#

😔

river oracle
young knoll
#

Uhh

#

Not that I know of

river oracle
#

Couldn't you just make a bunch of pathfinder goals as records maybe? not sure how those work exactly

young knoll
#

PRs in the past have had this issue

river oracle
#

that there is a ton of PathFinder goals?

zenith gate
#

instead of all this looks to be hard and long work, could i possibly some how make an unbreakable and invisible lead on the iron golems?

#

Wait, if i cant change the length of how long they can go, i dont know if that would be worth it.

river oracle
#

wonder why choco declined it

#

ahhh

#

ic

minor crest
#

Personally I'm looking for a server host for a 2-3 gb server for friends. I know Shockbyte is really cheap but I heard it's terrible. Apex is double the price and is rated "alright".

Any recommendations?

young knoll
#

Bloom is good

timid spear
#

Hello, I need help with my pom.xml file.

halcyon hemlock
sterile token
halcyon hemlock
#

And reload maven

minor crest
halcyon hemlock
#

Also what theme is that? Send in dms

sterile token
halcyon hemlock
#

Alr that's clean

sterile token
#

I would ask why they dont already built the jars and provide the download

#

So far paper does that and they havent been punished 💀

tall dragon
#

paper gives you a bootstrap jar

#

which downloads the actual server

sterile token
#

But why spigot doesnt? I now spigot likes to over complicate

tall dragon
#

idk

sterile token
#

Thats my final theory spigot community likes to over complicate a lot haha

#

They over engineer the things too much

timid spear
halcyon hemlock
#

It will auto add

#

Make sure you run with remap flag cause I think you want it

timid spear
#

Alrighty, I'll try that.

#

Then I assume, I have to manually add that jar to the pom file?

sterile token
#

Because when you build tools, it will install the spigot jar into local maven repo

timid spear
#

Maybe I should update to latest maven 3.9.5?

sterile token
timid spear
#

I have Java 17 and Java 20 installed.

sterile token
#

right, should be working

#

let me see your error

#

That shouldnt be the only part

#

Can you send the whole issue in

#

?paste

undone axleBOT
pseudo hazel
#

I think the reason you cant download a .jar was like a legal reason or whatever

timid spear
#

I updated maven and it is now building

sterile token
timid spear
#

😉

restive meadow
#

Using NMS does anyone know how you can listen for packets without injecting the player? I mean from the server side what it's receiving and sending

sterile token
sterile token
#

Even plugin messaging packets are sent thru Player

restive meadow
#

But how can you then listen for packets before the player has joined? ;D

sterile token
glossy venture
sterile token
restive meadow
#

yeah

glossy venture
#

but im pretty sure each player has their own socket

#

so after the first packets i dont think you can listen for them on the server channel anymore

sterile token
glossy venture
#

idk tho

#

after a connection is established

sterile token
#

after the player log in, its own socket is created if im not wrongly

glossy venture
#

yeah

#

so if you want to listen for all packets i think there might be a list of all connections somewhere which you can inject into

#

im not sure though

sterile token
glossy venture
#

reflection?

sterile token
#

You must thousens of reflections

glossy venture
#

ah

#

rip

sterile token
restive meadow
#

Okay thank you I will try to figure it out ;D

sterile token
#

Yeah you will hate mc

#

hahaha

#

How they designed looks like a child with no knowledge trying to do something really difficult

#

Thats what i can say from Minecraft, they dont even use a proper protocol compression. They just use ugly varInts and those shits

#

LMAOO i thought you were calling me stupid haha 💀

#

What r u trying to do?

#

right, i cotninue listen

#

to execute the action you mean?

#

oh yeah i catch what you mean

#

I have happen by the same with this

#

Nothing related but what about this?

#

why extends Player? I would like to know hee

young knoll
#

You never know when Mojang will add another player class

halcyon hemlock
#

Make a custom item class amd have the type in it. And save the custom stack in a class like ParticleGUI, make an inventory with .createInventory and provide the holder as this. Then you can get inventory.getHolder and cast to custom class if you know what I mean

#

Very confusing yes but

sterile token
#

I was going to tell create an particle item wrapper for the item type and the action

sterile token
#

Yeah, because we are in the same mess. Because creating a wrapper item or doing what you mean is the same

river oracle
young knoll
#

Do we have a command for that

#

If not we should imo

river oracle
#

the gui Thing I think not

#

we really should its super useful

modern spade
#

how to make a title when you break a block?

timid spear
#

Heya, me again. I am now missing Spigot/Bukkit imports.

ivory sleet
#

You need to run build tools for 1.20.x

#

And then depend on the artifact spigot and not spigot-api

clear elm
#

how can i reset deaths and lives

halcyon hemlock
river oracle
halcyon hemlock
#

Hmm hashmaps

covert silo
#

hashmap is god

halcyon hemlock
#

What if I made my own inventory system

river oracle
#

I mean you could thats just a lot of NMS to maintain by yourself

halcyon hemlock
#

They're unefficient

#

6x slower apparently than match statements

#

I think

halcyon hemlock
#

Just

#

Iinvetory

#

IInventory

#

I'm already coding my own server (framework) in rust so it'd be a learning experience

river oracle
#

could be worse you could be using InventoryHolder

hazy parrot
#

HashMaps are really not inefficent

river oracle
#

inefficent 😭 I can't take unefficent anymore

sterile token
#

I dont really understand why you spill up something but not giving good reasons why not

hazy parrot
old cloud
#

for a second I thought java has friend classes now 😂

echo basalt
echo basalt
#

GUIs aren't something that's made to be hardcoded

sterile token
#

I mean more in detail if you are not busy

sterile token
#

I would like to improvee while coding guis and those things

halcyon hemlock
sterile token
#

you mean via code?

#

yeah, you are coding a spy system?

#

so this is incorrect channel

echo basalt
#

So if you want to, for example, load a menu from a config

#

You load a "mask selection", you map each item in the mask to a Button and assign actions to them

#

Placeholders are applicable on the entire menu or on the element

#

For pagination, the paginable layer holds multiple "paginable areas" which just render a selection based on the page selected

#

The page counter is bound to the layer

sterile token
#

right, thats really interesting i will give a deep into it. So far i will listen your messages

echo basalt
#

So if you want, for example, a battle pass menu, you just set 2 paginable areas on a single paginable layer

#

If you want independent scrolling you set 2 paginable layers

#

For example on hypixel skyblock's Skill menu where they have the little snake

#

It's just the slot order on the selection that changes

#

Which is why I use an ordered list rather than a generic collection

sterile token
#

okay, this makes better use of resources if thats what i udnerstand

#

Mainly what refers into scalability

echo basalt
#

Just decouples things

sterile token
#

oh right

#

What do you think about configuration serializable?

echo basalt
#

ehh I don't use it

#

ends up ugly

#

I just do all the reading myself

sterile token
#

oh right, sounds weird but makes sense

#

Atleast if you just wanna store data without human reading is okay

echo basalt
#

that's what databases are for

#

Configurations, in my opinion, are read-only formats

#

You only write to it if you're adding new content on an older config version

sterile token
#

Without server resources being into worst

young knoll
#

Turn it into bytes

sterile token
echo basalt
#

Homie has 0 idea of how performance works

#

Data has 3 states, only 2 of them are important in this context

#

In use <-> In memory <-> In storage

#

With more complex architectures "in storage" is wack and can be in a temporary cache server

#

Anyways

#

When data is going from "In memory" to "In storage", the entire process should be done async

sterile token
#

yeah i understand that. when doing I/O must always use Async

echo basalt
#

Serializing and tossing it in the database should never be done in the main thread

sterile token
#

I already knwo that, but binary serialization is not so fast. It has its downstunes

echo basalt
#

It's still done async

#

Which means..

#

Slower methods just end up in higher latency

#

But your TPS won't be affected

#

When you're managing your server and you see 100% in pterodactyl, keep in mind it's the mean of all cores

#

So if you have 6 cores, your max value is 600%

sterile token
#

but why hosts?

#

I dont use those shity panels

echo basalt
#

They're useful even if you self-host ¯_(ツ)_/¯

sterile token
#

Im taking about plain VP's and their usages, pen testing mainly

echo basalt
#

But yeah if you want something faster than binary serialization

#

Just make it yourself

#

NBT is quite simple

#

pretty sure paper has methods for that builtin

young knoll
sterile token
#

u have just broken me in 2

#

LMAOO how u can use paper worst thing i have ever seen

#

So far i dont see Paper following naming conventions, have u already seen them?

#

yes ofc, they are data classes

#

That sucks sorry for syaing

#

They call source to entities (to CommandSender and Player too) 💀

#

na dont worry i cant explain myself to paper lovers

#

oh thats true, my bad its not really good

#

wild isnt something is dangerous? Like lions are wild

#

but if sound rude really sorry, if thats what u mean

magic summit
#
override fun guiItem(): ItemStack {

        val config = Main.instance.config
        val item = ItemStack(Material.POTION, 1)
        val itemMeta = item.itemMeta

        itemMeta.addItemFlags(ItemFlag.HIDE_ITEM_SPECIFICS)

        itemMeta.displayName(Component.text("Random Effect Challenge").decorate(TextDecoration.BOLD))

        if (isActive) {
            itemMeta.lore(mutableListOf(Component.text("Enabled").color(NamedTextColor.GREEN)))

        } else {
            itemMeta.lore(mutableListOf(Component.text("Disabled").color(NamedTextColor.RED)))
        }

        itemMeta.lore()?.add(Component.text("Delay: " + config.get("challenges.random-effect-challenge.run-time-lower-bound") + "s - " + config.get("challenges.random-effect-challenge.run-time-upper-bound") + "s"))
        itemMeta.lore()?.add(Component.text("Level: " + config.get("challenges.random-effect-challenge.min-level") + " - " + config.get("challenges.random-effect-challenge.max-level")))

        if (config.get("challenges.random-effect-challenge.infinite-effect-duration") == false) {
            itemMeta.lore()?.add(Component.text("Duration: " + config.get("challenges.random-effect-challenge.effect-duration")))
        } else {
            itemMeta.lore()?.add(Component.text("Duration: ∞"))
        }

        item.setItemMeta(itemMeta)

        return item
    }
``` yo guys why doesnt this work?
sterile token
magic summit
#

the lore is just "Enabled" or "Disabled"

#

the other stuff is not there

sterile token
#

i mean, im not sure exaclty which is more effective

sterile token
magic summit
#

still spigot

sterile token
magic summit
#

got exposed

dry hazel
#

no, == is reference equality, equals is value equality

#

== works only if you're comparing the same instance

young knoll
#

Also unless .equals is overridden somewhere in your class hierarchy, .equals defaults to ==

sterile token
#

oh perfect!!

shadow gazelle
#

alright what the hell is Spigot smoking today

#
println(config.getString(Constants.Config.WORLD))
if (config.getString(Constants.Config.WORLD).isNullOrEmpty()) {
#

For whatever reason it seems like it's using the default config even though there's a config in the plugin folder

#

and it doesn't have the value I'm looking for at all

#

It's looking for world: something and somehow finding a value there for that even though this is all that's in the config

main-world: world
#

yes

#

and yes, it's specifically looking for world: someString and not main-world: someString

#

when I actually set the value to something random it worked right

#

but if it's not there at all it seems like it's just pulling the default config

#

well at least my error message formatting seems to be working

young knoll
#

Why would you use it

sterile token
#

So what the best way for custom ivnentories to conclude? Is it better to use equals() ?

#

yeah == is for comparing memory section / location and equals for content

pseudo hazel
#

wdym by conclude

sterile token
#

okay, but why, why not? i want to learn

#

Not just get a yes or a no

#

hmn right, we should check that so

#

Because we are not really sure so far

pseudo hazel
#

wdym

#

what is conclude

#

do you mean to compare Inventory objects?

sterile token
#

he?

#

what conclude?

sterile token
#

are you talking about conclure the staff?

pseudo hazel
#

im talking about what you wrote

sterile token
#

oh, conclude != conclusion?

#

arent the same

pseudo hazel
#

well

#

even then

#

thats not an english sentence afaik

#

what does it mean in this context

sterile token
#

just wanna get a conclusion about how to find custom inventories without them being able to de duplicated

#

If that whats you mean i understand my english is no the best

pseudo hazel
#

if they cant get duplicated then == will work

sterile token
#

what do you mean with that?

pseudo hazel
#

if you mean you want to make sure you are acting on the right inventory, which I guess in the context of a player, then it should be fine to also use == im pretty sure

#

like getOpenInventory

sterile token
#

I mean cant get duplicate via renaming in game, what most sever has the issue

pseudo hazel
#

if thats still a thing

sterile token
#

Just wanna learn better way to make sure the inventory interacted is totally custom and not fake via in game

#

Thats what i mean, im not sure i explain

pseudo hazel
#

hmm

#

I dont quite know what you mean by custom vs fake

sterile token
#

rgiht let me explain

#

Have you seen some servers you can replicate some of they inventories during game

#

For example i have seen a virtual crates plugin, where you renaming the items name and adding the lore could be used as the crate opening item - Do i explain now? I use it as an example, but happens the same on severs but with inventories

pseudo hazel
#

yeah you just mean to create an inventory using Bukkit.createInventory

sterile token
pseudo hazel
#

well if its not your own plugin its gonna be pretty hard

sterile token
#

no no, i mean im coding my own menus library. Just wanna learn practices for working with menus

pseudo hazel
#

because spigot is acting like the payer is opening a valid inventory

#

if its for your own plugin where all menu are yours, you can just keep a reference to the inventory when you create it and compare using ==

#

but iirc I dont do inventory comparisons like that in the first place xD

sterile token
#

So then if someone uses the menu api, you duplicate them via items. Do i explain what i mean?

#

I think im not explaining exactly what i mean

pseudo hazel
#

yeah I dont know what you mean by duplicating inventories using items

#

I assume you are just talking about opening an inventory when you use an item

valid burrow
#

how do i do this in the new versions (getting an inventorys name)

sterile token
# pseudo hazel yeah I dont know what you mean by duplicating inventories using items

I mean there are exploits that allow you to replicate the same inventory that some servers generate for certain things.

For example, it happened on an mc server. Where they used a virtual crates plugin where the inventory they used could be replicated using a normal chest, adding all the properties (title, size and items) everything like the menu would look like. And it was fully functional, that's why I ask. In order not to have the same error

#

Thats using translator that why looks better written

pseudo hazel
hazy parrot
#

Oh right lol

sterile token
#

Inventory apy has changed on newer versions

hazy parrot
pseudo hazel
#

oh right, well in that case, make sure to not create inventories based on the name of a chest I guess

sterile token
#

So goski you udnerstand what i mean?

pseudo hazel
#

rename chest in anvil

sterile token
hazy parrot
#

Inventory name will change in that case?

pseudo hazel
#

add pdc to the chest which will have all inventory information

sterile token
#

they were replicating custom menus form the server changing their name thru anvils and those type of things

pseudo hazel
#

yeah

sterile token
pseudo hazel
#

compat with what

hazy parrot
#

Lol, anyway inventories always have reference equality

sterile token
pseudo hazel
#

use itemmeta

hazy parrot
#

You can always compare them with ==

sterile token
#

inventories has item meta? 🤔

pseudo hazel
#

no the item

#

you are using the item to create the inventory are you not?

sterile token
#

no no the issue was not with the item, with the view of the inventory itself

#

not only happen with their items, with fully menus they have

pseudo hazel
#

my plugin creates a new inventory when I want to show it to the player

#

it doesnt do anything when I open some existing container that I dont have logic attached to

#

but like, if your code does that it is easy to test

sterile token
#

You could replicate custom menus just by adding the same name (with or without colors depending on the name of that menu), the exact items in exact positions. And it works identically to a menu of some command they had or whatever it was that opened it.

hazy parrot
#

That is why you don't compare inventories by name

sterile token
hazy parrot
#

Or anything that player control

pseudo hazel
#

by the actual inventory object

#

using ==

sterile token
hazy parrot
sterile token
valid burrow
pseudo hazel
#

not the holder

pseudo hazel
#

equals or == doesnt matter in this case

sterile token
pseudo hazel
#

of what

sterile token
#

But they wont be able to repicate the exact view right? Just in case i ask

hazy parrot
#

Custom inventory made with bukkit.createInventiry?

hazy parrot
#

Yes, they also have reference equality

sterile token
#

I have the next logic let me send the code

#

So far i was told that not matter how you find the menus, they will be find / detected as custom ones. If they add the same properties from the custom ones

#

That why i came and started this topic dicussion

pseudo hazel
#

well what properties are you talking about

#

a player cannot create a menu using Bukkit.createInventory

sterile token
pseudo hazel
#

unless you add that yourself

sterile token
#

there exploits to do that, replicate inventories

pseudo hazel
#

use ==

hazy parrot
#

For third time, that is why you check with ==

sterile token
#

but == compare the memory space?

hazy parrot
#

Yes

#

They will have same "memory space" if its same inventory

pseudo hazel
#

it checks the actual memory part of the computer to see if the inventory is stored at the same exact adress as they one you are comparing it with

#

you are comparing the adress, not teh actual object, since if the adress is the same, the object will be the same

sterile token
#

yeah that what i mean

modern spade
#

how do you make a title saying the block you broke for example coal_ore when you break a block

young knoll
#

Sadly we don't have components for titles yet

#

But you can use Material#name or Material#getKey#getKey

valid burrow
#

is there a way i can remove the premade ban thingy and only display what i want on recconect?

#

So it doesnt display you are banned from this server blablabla

#

and only the stuff i want

pseudo hazel
#

no

young knoll
#

You can edit the message in the player kick event

valid burrow
pseudo hazel
#

the minecraft clinet adds the other text

valid burrow
#

oh

#

so do i have to manually kick them?

young knoll
#

Does it?

pseudo hazel
#

I thought it did

young knoll
#

I thought the default message was just “You are banned from this server”

pseudo hazel
#

like the "Reason:" and You are banned from this server parts

#

and Failed to connect to server

#

I dont think you can change any of those

valid burrow
#

so i cant really ban them but need to kick them on every connect?

young knoll
#

If the kick event doesn’t let you change it

valid burrow
#

it does

#

i already tried

young knoll
#

Then do that..?

valid burrow
#

well thats what i just said?

pseudo hazel
#

why cant you ban them?

valid burrow
#

i can freely choose what it displays when i kick them

#

but not when i ban them

pseudo hazel
#

seems kinda pointless to make a system for it

valid burrow
#

and since i already have a database anyways its not a big problem to just kick them on every connect

pseudo hazel
#

but I guess yeah

young knoll
#

They should automatically get kicked on every connect

#

Which will fire the event

#

Unless that doesn’t count as a kick

valid burrow
#

oh thats what you mean

#

i can try<

#

if that fires the kick event

young knoll
#

If not you can still do it

#

AsyncPlayerPreLoginEvent -> check if banned -> event#disallow

valid burrow
#

thx

#

okay so it doesnt fire a playerKickEvent

#

so im gonna try the other thingy

#

what of the 10 million results do i use

#

do they decide what it says at the top?

#

yes, they do

#

thx for the help coll

#

ly

quaint needle
#

how do i add a channel in discord that shows the tebex store

sick edge
#

Hi, Im using a InventoryClickEvent and need to set /change the cursor but it says its deprecated as it can lead to inconsistencies. Are there any alternatives as I need it 🙂

young knoll
#

InventoryView has a non-deprecated setCursor

sick edge
#

Thx

sick edge
#

I have a problem..I am working on one InventoryClickEvent but the problem is that when I change the CurrentItem and Cursor and so on it triggers another InventoryClickEvent eventhough there is no new click and the event is cancelled

paper viper
slender elbow
#

nice

young knoll
#

You can just use the built in ban list

#

You don’t need a custom ban system

valid burrow
#

i needed a database anyways for cross server

#

and implementation of discord bots

#

so it was not really a lot of addittional work

sick edge
valid burrow
#

what event, what objects, what click

#

there is so much information missing

sick edge
#

Okay I have one handler for an InventoryClickEvent that checks if something is right clicked with cursor having air as object and then places an item at cursor

Then I have a second handler also for InventoryClickEvent that checks if something is right clicked with item in cursor and then it removes the item from the cursor

The Problem is if the remove event finishes the other event still happens even though there is no new click. The other way around it doesn't seem to be the case. But I don't get why the other event triggers

young knoll
#

If they are both listening for inventory click event they will both fire for every click event

sick edge
#

Yeah but at the exact time when the one click happens only one of them meets the condition (and the others condition is only reached after the other handler is executed)
Is the event the same instance?
Because then I see why it’s happening…should I try to set slot item and cursor through the player or smth like that 🤔

young knoll
#

You can always check if it’s the same instance

#

Or just refactor your code so you only need 1 handler

shy forge
#

Does anyone know why commands aren't registering properly at runtime? Here's my class: https://paste.md-5.net/dowigosene.java Ignore the print statements, that's just while I'm debugging. Anyway, the goal is to reload the commands (in order to change the command that's used to execute them) by un-registering the OG ones (using reflect) and then register new instances. The un-register thing is working, HOWEVER: If the name and aliases are different, it un-registers the old but doesn't register the new one. Anyone have any idea why this might be?

valid burrow
#

is there a way i can get an offline player from ther username ignoring case

#

cause the way i found only seems to work if i use the case correctly

quasi berry
#

So I save various data in a HashMap<String, PlayerInfo>. Occasionally I need to completely wipe an entry in the HashMap which works fine, however when I save the HashMap to config in a custom format after having deleted an entry, it ends up remaining in config. It seems to me that the Java configs retain info unless told to delete or override it, which makes sense. I wipe the config by deleting it on plugin shutdown and recreating it immediately afterwards, but it still retains the info. I moved the deletion to right after loading the config into the HashMap and it seemed to fix the issue (??????). Does anyone have any clue as to why deleting the config on plugin startup would have a different effect than on plugin shutdown? Do I need to implement a delay or something?

shy forge
covert silo
#

So how come CraftBukkit's .gitignore does not include NMS, even though it's never meant to be in the version control?

quasi berry
shy forge
quasi berry
#

able to vc? it's a bunch of seperate areas

shy forge
#

Instead, just check a couple of things for me:

#

First: When you're wiping data from the hashmap, are you just setting the value to null?

quasi berry
#

I'm using remove(entry)

#

and it's wiping properly from the hashmap

shy forge
#

So, #HashMap.remove(#String) right?

quasi berry
#

yes

#

this is a sample of the format I'm using to save data

shy forge
#

Okay, and how are you saving to your yml? Looping through the map?

quasi berry
#

so it ends up looking like this:

quasi berry
shy forge
#

Oh yh true

#

So anyway

#

You said you remove the value from the hashmap to wipe the data right?

#

So that for loop's never gonna call the String that you want wiping

quasi berry
#

I remove the entry in it's entirety not just the value but yeah

quasi berry
shy forge
quasi berry
#

I agree

shy forge
#

Is that just the only way it works?

quasi berry
#

I'm trying to figure out another method

#

And oddly the deletion only works if you delete after load

shy forge
#

IMO, either

#

A: Update the config when you wipe a players data. Like, as part of the wiping process, edit the YAMLConfiguration and save it

quasi berry
#

right

shy forge
#

B: Hold a Set of changes. Then, when you wanna refresh the config, cycle through them editing the config directly

quasi berry
#

alright

#

both make sense it just seems odd that there's no easier detection with the config package

shy forge
#

What do you mean detection? Like, something that listens for the hashmap being changed and then updates the config directly?

#

Tbh, you could make your own Map object that does that if you wanted, auto saves / removes data to the config whenever you .put or .remove from the map

quasi berry
shy forge
#

Though it does depend on whether you want people to be abel to edit the config during runtime or not

quasi berry
#

irrelevant to me

shy forge
#

In which case, I'd say use the save and load functions method. If you don't need to, not much point in saving and loading all the time. Too much unnecessary processing

quasi berry
#

thanks dude

shy forge
#

Np :D

wet breach
#

as for the issue of the config thing, you can save maps to yml since yml supports maps

quasi berry
#

within the maps

wet breach
shy forge
wet breach
#

maybe plugin.yml could be the source of the issue

shy forge
wet breach
#

but this is one of the reasons why I don't bother with reflection etc either XD

#

is what you are doing for some public plugin?

#

or is this just something for your own server

shy forge
#

For a published plugin, yh

#

Why?

wet breach
#

ah nvm then, was going to say if this is just for a server of yours could just modify the server code to make things possible like you want 😛

#

some people just forget that part lmao

shy forge
#

The server code? Wouldn't that be trickier than a wee bit of reflect?

#

i say, stuck

wet breach
#

no? buildtools gives you the server source code. The main reason reflection even exists is because you don't have the ability to change the source code or some other reason makes that impossible

#

but if you have your own server, then you have the source to change it freely thus no reflection needed ever lol

#

but since this is instead a public plugin you are making, that is obviously not an option for you so reflection it is

#

anyways for your problem its hard to say specifically what is interfering other then classes stuck loaded and not being cleared out

#

just because you unregister a command from the map, doesn't mean the class was unloaded from the JVM

shy forge
wet breach
#

yes there is a way to check. findLoadedClass(String) the reason being it doesn't unload the class is because all classes are loaded into the JVM not counting some niche scenarios. This is why its possible to remove a jar or replace a jar while the jvm is running and no changes being reflected until you do something that causes the jvm to unload the relevant classes and load the new ones up. IE restarting the server for example. The problem with unloading a class is that the classloader that was responsible for loading it, in this case the plugin class loader needs to get garbage collected. Every plugin has its own plugin class loader. So essentially you would need to unload your plugin entirely along with its class loader and then re-load it.

#

if you don't unload classes you end up with scenarios like what you have, as well as it will over time increase the amount of memory being needed since you are loading more classes but never unloading any of them

#

which means its a form of memory leak

shy forge
#

Right, think I got it

minor crest
#

Is bloom hosting good/legit? Looking into making a small private server for friends

lethal coral
#

so I have a custom spawn event and I need to have two statuses pre and post should I have a PlayerPreSpawnEvent and PlayerPostSpawnEvent or have PlayerSpawnEvent with a getter for the status?

lethal coral
#

their terms and privacy policy aren't invasive either

#
  • dedicated resources on mid & high tier plans
fossil lily
rare rover
#

ew

lethal coral
quaint mantle
lethal coral
#

Two classes to reduce unnecessary event calling and not requiring an extra if statement in every listener

#

Also had a moment for a while where I was considering if this was even necessary but ended up going with it for my use-case

#

Also the pre event is cancellable and the post isn't because... It already happened

#

Sort of just makes more sense

quaint mantle
#

I'm trying to set the display name via command but doing so prevents the player from chatting. How do I fix this? I can provide code if necessary.

covert silo
#

how do i go about testing craftbukkit/bukkit changes besides just the unit testing. like creating a plugin or something

eternal night
#

Yes

covert silo
#

im wondering how exactly can i go about that

#

is there a way to set up that environment

upper hazel
#

iterator vs removeIf ?

lilac dagger
#

from what i heard, only use removeIf if you don't wanna remove all the elements

short pilot
#

What is the best way to keep track of what faction a player is in? (Custom faction type I made)

I'm thinking of maybe adding NBT tag; is there a code way to do it better?

#

Names will be unique of the factions and all factions are in a hashset of factions

lilac dagger
#

hashmap

#

you need a separate map that has uuid as key and factionplayer as object

#

and in that object you're holding cool stuff like the faction the player is in or not

#

factions are best to be kept in an arraylist

#

assuming you'll loop through

short pilot
#

hmm

#

could I simply add the UUID of a faction to a player upon them joining/creating a faction? I could add this to the metadata couldnt I

#

that way I can access the faction the player is a member of

lilac dagger
#

usually via looping or a new map that has membered key factions

#

uuid as member and faction as value

#

this way you'll have fast access to all the users from the factions

#

skipping you the loop on join

#

the faction object should be shared, not a copy

short pilot
#

wait so why cant I keep track of the faction UUID in each player metadata

lilac dagger
#

oh

#

you're talking about pdt?

#

can you access pdt from the offline player?

#

i'm not aware

#

if you can this can definitely be a way

#

but i think it'll create a desync

short pilot
#

hmm ok

#

how does syncing work with this?

torpid rapids
#

Hello! Is it possible to have multiple worlds with their own nether and end? I don't need worldA to be linked with worldB just worldA linked with worldAnether and WorldAend, and WorldB linked with WorldBnether and WorldBend.
I tried to generate a nether and end matching the extra world base name but it still links to the default world. Just want to check if there's something easy before I use PlayerPortalEvent to build a solution

eternal oxide
#

just run up two servers with a bungee proxy. Its easier

lost matrix
sick edge
lost matrix
#

A players PDC should only contain data which is exclusively linked to his game session.
And a clan exists, weather a player is online or not.

short pilot
#

so synching issues happen ?

#

so i see, we want to use a global hashmap of mapping players to factions and it's still O(1) access time

#

hm

#

im interested in how synching issues could happen by editing player metadata

lost matrix
#

You cant access a players PDC via his offline player.
So kicking a player out of a clan when he is offline will be impossible if you use the PDC

shadow night
eternal oxide
#

all clan data should be maintained in memory and separate from any actual game data.

lost matrix
#

I agree

lost matrix
lavish hemlock
#

SQLite if the server doesn't have an SQL database

lost matrix
#

Where its persisted is irrelevant

lavish hemlock
#

Well technically it is relevant because game data is a form of persistence 🤓☝️

lost matrix
#

In most cases the File system will do just fine

eternal oxide
#

backend shoudl be an after thought

lavish hemlock
#

As a backend developer, I am offended (joking)

eternal oxide
#

Keep all data live in memory and push to a save queue when it changes

ocean hollow
#
Object val = entity.getPersistentDataContainer().get(GTHealthDisplay.getKey(), PersistentDataType.INTEGER);
                if(val != null && (int) val == version) {
                    entity.remove();
                }``` is it correct way to do this?
lost matrix
#

No

ocean hollow
#

what is correct then?

lost matrix
#

Use Integer instead of Object and if 'version' is of type int, then compare it with Integer#intValue() of your value (after the null check ofc)

young knoll
#

You can also use getOrDefault and use something like -1 as the default

#

If your value is never negative

ocean hollow
#
                if(val != null && val == version) {
                    entity.remove();
                }``` so like this
lost matrix
#
                if(val != null && val.intValue() == version) {
                    entity.remove();
                }
#

Never compare primitive wrapper with ==

ocean hollow
#

IDE says that is unnecessary to use "intValue()"

lost matrix
#

Does it prefer an int cast instead?

ocean hollow
#

just through "==" everything is ok

lost matrix
#

Integers get casted down to int implicitly when comparing with int, so that makes sense

glad prawn
#

it autounboxing for u ig

young knoll
#

Would this be autounboxing

#

Autoboxingn’t

sick edge
#

What is the best way to get the "last" item of an inventory? Do I really have to go through the entire contents or is there a more efficient way?
Thx in advance

pseudo hazel
#

wdym by last item

#

what is the last item

sick edge
#

The item in the highest slot that is not air

pseudo hazel
#

oh

#

well yeah just go over all slots

#

but start at the end

sick edge
#

Ok thats what I thought thx 🙂

lost matrix