#help-development

1 messages ยท Page 361 of 1

remote swallow
#

you just forogt

echo basalt
#

uh ok

smoky oak
#

also chatgpt is still stuck on my question

#

hows your day going

echo basalt
#

uhh

remote swallow
#

whats ur server called illusion

echo basalt
#

woke up like 2 hours late

remote swallow
#

ndas havent been filed

echo basalt
#

took a huge dumpy

#

in school

remote swallow
#

its 5 pm

#

why are you at school

echo basalt
#

it's 4:21

#

I'm in class rn

smoky oak
#

wait

remote swallow
#

your in the same timezone as me

#

sus

echo basalt
#

today school ends a bit earlier

smoky oak
#

so youre a student and a business owner

echo basalt
#

at 5pm

remote swallow
#

why are you at school at 4:21

smoky oak
#

how tf did you manage that

echo basalt
#

I'm a student, developer, business manager

remote swallow
#

magic

echo basalt
#

school IT specialist

#

nearly homeless

remote swallow
#

deal more drugas

echo basalt
#

uhh

#

sure

remote swallow
#

you got melatonin

echo basalt
#

forgot but I'm also a disgrace

#

and a minor >:)

#

but not for long

echo basalt
remote swallow
#

wtf

#

it ends at 3pm here

echo basalt
#

8am - 6pm

remote swallow
#

8am -3pm

#

tf?

echo basalt
#

little homework

#

but we have lots of projects

echo basalt
twilit wharf
#

I am developing a system where players have a "potion bag" that holds potions. It is an actual item, and can be dropped and picked up. I was curious what would be the best way to verify that the "potion bag" is truly a potion bag, and what potions it contains. I have a few ideas, like saving the actual item to a DB and attach some sort of identification number to its lore or NBT data, or I could base it all off of what the lore say's it is and what it contains. Or, I could use a system that keeps track of the potions/potion bags inside of a players inventory (including a database). What would you say would be the best way to achieve this? (I am asking because I dont want to waste time on something that wont work or will be super inefficient)

echo basalt
#

there are like 5 pillars in my life

#

one of them is sleep

#

that pillar is very short

smoky oak
#

check the link ig

twilit wharf
#

and then I guess I could attach a string in a readable format for which potions it contains?

remote swallow
#

?morepdc

undone axleBOT
remote swallow
#

using that you can apply a list

twilit wharf
#

interesting

smoky oak
#

well either that

#

or you can make use of that object to and from B64String and store that

twilit wharf
#

alright. Thanks for the help, I appreciate it ๐Ÿ™‚

pliant flame
#

Oh I KNEW IT. He also contacted me at some point too

echo basalt
#

He doesn't work for free :)

pliant flame
#

Oh when he contacted me it was different kek

#

But cool dude

rough drift
#

@echo basalt I can't seem to figure it out, because if I multiply by 0.005 it's just slow in all directions, I can't figure out how to make movement faster in the velocity's direction and slower when against it lmao

echo basalt
#

you gotta multiply your speed

#

and not the player's speed + your speed

rough drift
#

entity.setVelocity(vel.add(toAdd.multiply(0.005)));

cunning canopy
#

Setting pitch, yaw and roll for minecart

rough drift
#

@echo basalt I found the issue

#

So Player#getVelocity always returns like 0 -0.07 0

echo basalt
#

Yeah that's gravity

rough drift
#

Yeah

#

but even if I move

#

only if I am in the air it updates the x and z

echo basalt
#

Ik

rough drift
#

is there any way to get around that?

echo basalt
#

No

#

Client sends packets for its own movement

#

You can just apply your constant vel

#

The client can battle it out naturally

rough drift
#

Yeah I got it working, only problem really is I want to aid the client to move against the vel if it's doing that

#

so I probs have to use PlayerMoveEvent, calc the vel, and store that myself

primal goblet
#

how to hide player's name tag with packets?

past vapor
#

Is there a way I can stop the primary world from saving chunks/entities, I know you can unload a world at onDisable, but that doesn't seem to work for the primary world.

patent fox
#

?paste

undone axleBOT
lost matrix
#

Hm but this does not prevent saving on shutdown

#

Well then simply create a zip file and replace the world folder onLoad()

patent fox
#
EnchantmentStorageMeta bookMeta = (EnchantmentStorageMeta) book.getItemMeta();
Bukkit.broadcastMessage("Counter: " + bookMeta.getStoredEnchants().values().size());
Map<Enchantment, Integer> bookEnchantments = bookMeta.getStoredEnchants();
if (bookEnchantments.isEmpty()) return;

i have this code that checks for custom enchants on an enchanted book, but it returns an empty map?
im using EnchantmentStorageMeta#addStoredEnchant

when i try "/data get entity @s Inventory[1].tag.StoredEnchantments" it says it has the custom enchant on it

lost matrix
real fable
#

Hey ! I have an armor stand with a gold block ad head.
Currently, only his head is visible and that's what I want.
But the problem come when the stand is glowing, all the rest of it's body become visible,
Is there any ways to make only his head (Gold Block) glowing ?

patent fox
lost matrix
patent fox
#

custom

lost matrix
# patent fox custom

I would have to look that up but im guessing that the spigot method does not account for custom enchantments
depending on how they are applied/registered

real fable
real fable
#

Thanks a lot ๐Ÿ˜„ !

real fable
past vapor
#

Wasn't aware that worlds finish saving before plugin onDisable is called

lost matrix
real fable
alpine swan
#

is there a way to remove 1 of an item from an itemstack

doing setamount(x.getamount()-1) works but wont remove the item if theres only one left

#

or should i just do an if statement and set it to null/air if theres only 1

lost matrix
alpine swan
cunning canopy
#

Is there a way to set yaw and pitch of a minecart without it resettling itself?

lost matrix
undone axleBOT
alpine swan
lost matrix
#

Use ancient APIs -> deal with the consequences

cunning canopy
alpine swan
#

if im using an old version, i know well that its old

cunning canopy
#

Yes, but then it's also up to you to deal with your item stack count removing and not spigot

tardy delta
#

just write an if statement then

lost matrix
#

1.8 is slowly vanishing every day and it makes me happy. Last time i checked it was 7% and now only 5.7%

tardy delta
#

where can i download 1.1?

cunning canopy
#

Is there a way to set yaw and pitch of a minecart without it resettling itself?

pseudo hazel
#

I would still like some help with this as I havent been able to solve it

remote swallow
#

are you shading it

#

maven = scope compile
gradle = compileOnly to implementation

pseudo hazel
#

oh I was using provided

#

since I did that for my other dependencies too

remote swallow
#

provided means the classes will be found, eg like spigot-api. compile means the classes are added into your jar

#

been as they dont exist on the server

pseudo hazel
#

hmm I see

#

still doesnt work

#

let me share my pom

remote swallow
#

read my mind

pseudo hazel
#

?paste

undone axleBOT
pseudo hazel
remote swallow
#

ohhhh

pseudo hazel
#

I want the decentholograms plugin to work

remote swallow
#

its dh, that should be scope provided but needs the decentholograms plugin on the server

pseudo hazel
#

oh

#

thats annoying

remote swallow
#

yeah

pseudo hazel
#

is there a way to avoid that?

remote swallow
#

not many standalone hologram plugins exist

pseudo hazel
#

like ideally I just want users to just download my one jar file to use the whole plugin

#

hmm

remote swallow
pseudo hazel
#

hmm

#

sad

#

maybe I will just another hologram lib

#

do you know any others?

remote swallow
#

decentholograms is the only good one that i know of

pseudo hazel
#

yeah thats what I fear

#

oh well, I guess I will have to make something quick myself ๐Ÿ˜›

remote swallow
#

holographic displays exists but doesnt support all features dh does

pseudo hazel
#

hmm

#

it looks good enough for me

#

thanks

#

oh

#

wait nvm it also doesnt work xD

#

same issue

#

im already tired of this dependency bs, I guess thats my up till now all the stuff I wrote doesnt rely on them xD

#

I will just make something myself

rough drift
#

Checking a project that uses 1.15.2 nms, what is Block.n on that version?

sterile token
#

Why the heck mongo doesnt allow parsing integer nor doubles? Is there something broken on new updates?

tardy delta
#

uh i forgot but does mongo have getDouble or smth?

#

im thinking about ((Number) x).doubleValue()

sterile token
#

I thinking lib is broken or something like that

tardy delta
#

what ex

primal goblet
#

how to let the armorstand in sneak state i need to change his nametag's opacity

#

is there's any method or packet?

sterile token
# tardy delta what ex

ClassCastException: class java.lang.Double cannot be cast to class java.lang.Integer (java.lang.Double and java.lang.Integer are in module java.base of loader 'bootstrap')

#

But what makes me laguth is that i never adding a integer to a double field

tardy delta
#

uh its a double then

#

and youre trying to get it as an int

sterile token
#

Doesnt make sense tho

#

I will clear the whole db and re check my code again, maybe the issue is with the db documents

tardy delta
#

json libraries tend to be stupid with numbers

#

chatgpt throwing a 403 lol

sterile token
#

sorry fourten, my pc crashed with no reason

#

๐Ÿ’€

sterile token
tardy delta
#

lol

#

windows moment

sterile token
tardy delta
#

what distro

sterile token
#

Ubuntu 20.04, its goes frozen and then just auto restarted

tardy delta
#

ew

sterile token
#

that why we should now a day work directly over the cables instead of having fkg OS, which just makes pcs to crash cuz of high resoruces requires

lost matrix
#

With latest java driver

sterile token
#

Right

#

But why wont work for document? Doesnt document already provide that?

tardy delta
#

doesnt document allow get("val", Number.class).doubleValue()?

lost matrix
#

Why would your ever use documents?

sterile token
#

I just that mongo has 3 ways of using it, documents, schema things and ORMs

lost matrix
#

I implement a good Codec<T> and then use a MongoCollection<T>

sterile token
#

Ohh right, you are using Mongo schema pattern

cunning bane
#

@Override
public void onEnable() {
// Register the event listener
getServer().getPluginManager().registerEvents(this, this);
}

@EventHandler
public void onChat(AsyncPlayerChatEvent event) {
    // Get the message and player who wrote it
    String message = event.getMessage().toLowerCase();
    Player player = event.getPlayer();

    // Check if the message is "hello"
    if (message.equals("hello")) {
        // Write "hello" back to the chat
        player.sendMessage("hello");
    }
}

}
What is wrong here ๐Ÿ˜ฆ

sterile token
cunning bane
#

how

lost matrix
sterile token
#

Okey really weird, OS crashed cuz of Mongo server ๐Ÿ’€

lost matrix
#

Run your DBs in a docker

tardy delta
#

mongodb cloud kek

sterile token
sterile token
#

Just saying an auth exception but credentials where okay

vivid skiff
#

?paste

undone axleBOT
tardy delta
#

i dont really like the ip whitelist

vivid skiff
#

What is causing this error:

[19:51:54 ERROR]: Could not pass event PlayerInteractAtEntityEvent to GTaser v1.2
org.bukkit.event.EventException: null
        at org.bukkit.plugin.EventExecutor$2.execute(EventExecutor.java:72) ~[patched_1.12.2.jar:git-Paper-1620]
        at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:78) ~[patched_1.12.2.jar:git-Paper-1620]
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[patched_1.12.2.jar:git-Paper-1620]
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:513) ~[patched_1.12.2.jar:git-Paper-1620]
        at net.minecraft.server.v1_12_R1.PlayerConnection.a(PlayerConnection.java:1682) ~[patched_1.12.2.jar:git-Paper-1620]
        at net.minecraft.server.v1_12_R1.PacketPlayInUseEntity.a(PacketPlayInUseEntity.java:49) ~[patched_1.12.2.jar:git-Paper-1620]
        at net.minecraft.server.v1_12_R1.PacketPlayInUseEntity.a(PacketPlayInUseEntity.java:6) ~[patched_1.12.2.jar:git-Paper-1620]
        at net.minecraft.server.v1_12_R1.PlayerConnectionUtils.lambda$ensureMainThread$0(PlayerConnectionUtils.java:14) ~[patched_1.12.2.jar:git-Paper-1620]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) ~[?:?]
        at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
        at net.minecraft.server.v1_12_R1.SystemUtils.a(SourceFile:46) ~[patched_1.12.2.jar:git-Paper-1620]
        at net.minecraft.server.v1_12_R1.MinecraftServer.D(MinecraftServer.java:850) ~[patched_1.12.2.jar:git-Paper-1620]
        at net.minecraft.server.v1_12_R1.DedicatedServer.D(DedicatedServer.java:423) ~[patched_1.12.2.jar:git-Paper-1620]
        at net.minecraft.server.v1_12_R1.MinecraftServer.C(MinecraftServer.java:774) ~[patched_1.12.2.jar:git-Paper-1620]```
#
        at net.minecraft.server.v1_12_R1.MinecraftServer.run(MinecraftServer.java:666) ~[patched_1.12.2.jar:git-Paper-1620]
        at java.lang.Thread.run(Thread.java:829) [?:?]
Caused by: java.lang.ArrayIndexOutOfBoundsException```

CODE: https://paste.md-5.net/fojibemaqi.java`
tardy delta
#

it doesnt work with dhcp

sterile token
lost matrix
#

My god PES_Yikes

cunning bane
#

@Override
public void onEnable() {
// Register the event listener
getServer().getPluginManager().registerEvents(this, this);
}

@EventHandler
public void onChat(AsyncPlayerChatEvent event) {
    // Get the message and player who wrote it
    String message = event.getMessage().toLowerCase();
    Player player = event.getPlayer();

    // Check if the message is "hello"
    if (message.equals("hello")) {
        // Write "hello" back to the chat
        player.sendMessage("hello");
    }
}

}();

sterile token
tardy delta
#

probably a nat thing, whenever my external ip changes, it complains and throws some stupid errors

cunning bane
kind hatch
#

No you didn't.

cunning bane
#

i dont know how it work

#

s

vivid skiff
kind hatch
sterile token
cunning bane
#

i tihnk i didnt understand

lost matrix
vivid skiff
sterile token
kind hatch
lost matrix
#

@cunning bane You can also paste your code here:

#

?paste

undone axleBOT
cunning bane
#
    public void onEnable() {
        // Register the event listener
        getServer().getPluginManager().registerEvents(this, this);
    }

    @EventHandler
    public void onChat(AsyncPlayerChatEvent event) {
        // Get the message and player who wrote it
        String message = event.getMessage().toLowerCase();
        Player player = event.getPlayer();

        // Check if the message is "hello"
        if (message.equals("hello")) {
            // Write "hello" back to the chat
            player.sendMessage("hello");
        }
    }
}```
#

i got it ๐Ÿ˜„

lost matrix
#

Just missing the java tag

cunning bane
tardy delta
#

ninjad me

cunning bane
lost matrix
cunning bane
#

im new sryy

vivid skiff
kind hatch
#

Wrong reply.

cunning bane
#

if someone write hello it should be say it back [hello]

lost matrix
sterile token
#

?paste

undone axleBOT
river oracle
#

?paste as well

undone axleBOT
lost matrix
cunning bane
#

you mean its ok?

kind hatch
sterile token
#

Also please mpiza if you will ask for help, provide thw hole issue and code too, if not its imposible to get helped

cunning bane
lost matrix
hazy parrot
lost matrix
sterile token
cunning bane
vivid skiff
#

i only have the class i pasted using that event

sterile token
lost matrix
river oracle
undone axleBOT
sterile token
#

And also ?paste your whole code

cunning bane
#

it is my first time in my life ๐Ÿ˜„

#

i right too much to not forget

kind hatch
sterile token
kind hatch
hazy parrot
lost matrix
tardy delta
sterile token
tardy delta
kind hatch
sterile token
lost matrix
tardy delta
#

๐Ÿ’€

sterile token
#

Paper ๐Ÿ’€

tardy delta
#

stfu

hazy parrot
# tardy delta

I was reffering to Listener interface, was sure that JavaPlugin implement it

lost matrix
sterile token
tardy delta
#

google it

river oracle
#

That's English English

sterile token
kind hatch
#

It's called slang. Spanish also has it.

river oracle
#

I'm not English xD

#

I'm American

sterile token
tardy delta
lost matrix
# vivid skiff java 11

Well we cant help you at all with this...
Add a huge try catch block around your method and catch Exception
Print the stack trace and show it.

kind hatch
tardy delta
#

it was a written one and it was full of cringe stuff

#

"i talk the same speed as my mom"

sterile token
#

okay, definitly mongo is broken, i have done the whole codec for working with Mongo Pojos, and stll persisting the parsing issue

#

Maybe has to do with the driver server or cliente, im not sure i will make a issue request tho

tardy delta
kind hatch
rotund ravine
tardy delta
#

๐Ÿ™„

vivid skiff
sterile token
kind hatch
lost matrix
sterile token
lost matrix
tardy delta
#

just throw the whole latest.log in a paste

vivid skiff
sterile token
lost matrix
kind hatch
grand flint
#

Will too many armour stands, custom mobs lag out my server?

rotund ravine
#

Maybe

vivid skiff
kind hatch
sterile token
grand flint
#

Like around 10,000 armour stands, being animated, moved and actions at a time

lost matrix
lost matrix
grand flint
kind hatch
lost matrix
grand flint
#

I don't mind waiting another update if it will help with performacnce ๐Ÿ˜‚

kind hatch
grand flint
#

There needs to be like 10k-20k custom mobs at a time

kind hatch
#

Geez, that many at one time just sounds like a performance nightmare.

grand flint
#

Is there better way to make custom mobs?

lost matrix
rotund ravine
lost matrix
#

Because there is no way this will ever happen

grand flint
lost matrix
#

And what do you need that many entities for?

grand flint
#

Well when it's night time, how many mobs are around you

#

10-20

kind hatch
lost matrix
grand flint
#

Yes, so I need the custom mbos to be like normal mobs

#

I want you to see them naturally around the world

#

Monsters at night, animals in the morning

lost matrix
#

Alright, still waiting for the calculation where you scale 10-20 to 10k-20k

grand flint
#

500-700 players

lost matrix
#

Ok

#

let me start right there

kind hatch
#

If you can run a single server with 500+ players on it at decent TPS, I'd be surprised if not awestruck in how you managed it.

lost matrix
#

There is no way on this earth you will ever have 500+ players on a single server.
You would need a highly optimized custom server jar to even reach 200 in a stable manner.

grand flint
#

No, we have that sorted, it's multiple servers, being copied to eachother from one main server

#

With a very very forked spigot jar

lost matrix
#

Spigot/Paper etc will never handle that many players. Especially not in a vanilla world.
A lobby can maybe hold 400 people if the backend runs on an extremely optimized 1.8 server jar

kind hatch
#

It likely won't be 10k for each server.

grand flint
#

But those mobs need to be disaplyed in all servers ๐Ÿค”

kind hatch
#

How you do that is up to you, but the point is, they aren't all going to be on one single server. Find the individual amount per server.

grand flint
#

I already got my servers, and jar sorted with experienced developers, but thank you for the knowledge

#

Are there better ways to make custom mobs?

lost matrix
#

You will need to handle the entities in a custom (multithreaded) layer then. The server can never know of those entities or it will die.

grand flint
#

This server is so much trouble for me ๐Ÿ˜‚

sterile token
#

Yeah, 10-20k of entties are too much for a single threaded server

grand flint
#

And very costy :(

sterile token
kind hatch
grand flint
#

Pretty sure it's synchronized, but I would need to ask my developers

sterile token
golden turret
grand flint
#

My admin, can join from a turkey server and I join from the germany server, and we both see everything same

sterile token
lost matrix
#

You basically proxy the packets in an extra layer. This is going to be very difficult.

sterile token
kind hatch
# golden turret what it does

Some new entities were introduced that are far less resource intensive. They also have some really cool properties like being able to scale and transform block states.

lost matrix
#

But now the entities need to know the state of the world in order to move

kind hatch
grand flint
#

Anyone interested in a job to lead my developers ๐Ÿ˜…

river oracle
#

?services

undone axleBOT
lost matrix
grand flint
#

What I just said? It already works

sterile token
grand flint
#

Or are you talkign about the mobs?

grand flint
lost matrix
#

Im talking about the scope and scalability you want to achieve

sterile token
#

Agree with smile, the project will have lof of scalabillity issues

grand flint
sterile token
grand flint
river oracle
#

My bad wasn't reading context

sterile token
#

Smile is refering to a profesional usage and future implementations

grand flint
#

I was already getting around 1000 players daily in our server before, almost everyone seemed to be interested when we introduced this

lost matrix
# river oracle Smh Verano

There where worse times with him. I still remember when he joined the server.
Left me speechless several times each day for weeks...

river oracle
#

I sometimes wonder how often the language barrier makes it seem dumb

grand flint
#

Well, thank you guys, I will continue working on this but I will be here often ๐Ÿ˜‚

sterile token
lost matrix
river oracle
quiet ice
grand flint
#

3rd time, I already have that sorted out ๐Ÿฅฐ, thank you

sterile token
kind hatch
# grand flint Pretty sure it's synchronized, but I would need to ask my developers

Well, it would be helpful to know exactly, but I can elaborate for both scenarios.

If you have a master/slave system, and assuming that each server is identical in specs, then the total amount of mobs per server will be identical to the master server. So if the master server has a cap of 50 players, then at max, the total amount of mobs will be 1000. Which should be fine given a standard spigot jar.

If you have a synchronized system, I hope that you have some sort of system that delegates mob spawning. Because copying from each server without proper management is a recipe for disaster.

river oracle
sterile token
grand flint
quiet ice
river oracle
#

I'll dm you in spanish gimme a minute I'm not on pc yet

grand flint
#

Wait, would 10k-20k NORMAL minecraft mobs lag out?

sterile token
grand flint
#

Okay, thank you

quiet ice
#

Probably not in a multithreaded env

#

You are using Minestom, right?

kind hatch
grand flint
#

Minestom?

sterile token
quiet ice
sterile token
#

My bad, wrong word

grand flint
#

Ah no we aren't, we have our own

quiet ice
#

And not even spigot. Spigot but coded from scratch would be glowstone

sterile token
#

We are talking about scalability, so without using multi threaded for your mc servers, you wont scale as you expect

grand flint
#

I'm not good with servers ๐Ÿ˜…
Can you tell me, what multi threaded is?

river oracle
kind hatch
#

Man, that's an old one.

sterile token
#

Minestone its called the mc server coded form Scratch

sterile token
quiet ice
#

Not really

sterile token
#

I just heard about Minestone, never about glowstone

quiet ice
#

Glowstone is a bukkit implementation, Minestom is a multithreaded minecraft server impl

sterile token
quiet ice
#

Well technically Minestom is much more since it's basically many small servers running as one big server but that is an implementation detail

kind hatch
sterile token
#

I was talking about future scalability, so i telling him that without custom multi threaded mc software he wont be able to scale how he will expact

lost matrix
#

Isnt glowstone dead? Havent heard of it for a while

grand flint
river oracle
quiet ice
river oracle
#

on the github page

lost matrix
#

Well not too dead

river oracle
#

there is a pr for 1.19.3

grand flint
#

I have 6 servers, they are all multi-threaded

kind hatch
quiet ice
#

The type of multi-threaded is perhaps the bigger question

lost matrix
quiet ice
#

If you just multithread things like work ticking to run in a parallel manner it isn't impressive

grand flint
#

Ah so, I need to split the tasks between the threads

quiet ice
#

But multithreaded block/entity/whatever ticking is impressive

lost matrix
quiet ice
#

Yeah, that would be the result of many months of hard work. Hence it would be impressive

#

And then you have the issue that no plugin will work with such a system

#

You'll basically have to redo everything from scratch

#

Hence why Minestom does not and will never support bukkit

lost matrix
#

Btw where is the old man? Havent seen him since i got back here.

grand flint
#

Pretty sure our jar has multithreading, but again I would need to check with the devs

sterile token
#

@grand flint To summarize everything we are telling you, is that without using a well designed mc server software which makes use of multi threaded and correctly implemented, your project will not be scalable in the future. Since as you have been told the entities are intensive operations, which consume too many resources. And without an experienced devs and engeeniers it wont success

quiet ice
lost matrix
quiet ice
tardy delta
#

<insert minestom here>?

eternal night
#

regionalised ticking of entities would fuck plugins to a point of no return kekw

lost matrix
kind hatch
# grand flint Ah so, I need to split the tasks between the threads

For minecraft specifically, you need to do a little more than that. The issue with the game is mostly single threaded. So by default, it's not taking advantage of the capabilities of a multithreaded environment. This is a little problematic when it comes to server jars since they have to abide by that rule. At least for the most part.

We can make our jars asynchronous, but we ultimately have to return the results of those threads synchronously. So if you wanted to make your jar multithreaded, you'd have to send things back to the main thread anyways. Otherwise you'd have to rewrite the game and that isn't allowed. Your devs have probably already run into this.

quiet ice
#

Or at the very least it should be easy to purge large amounts of these entities to be non-ticking (which is what paper does agressively with fishies) or to just lower entity rates to be lower

#

Alternatively, just reduce the amount of ticked chunks (i.e. reduce simulation distance)

eternal night
#

tbh, regionalised entity ticking is doable for sure

grand flint
#

Isn't rewriting the game, like mods kinda?

eternal night
#

or generally chunk ticking

#

the issue is plugins

kind hatch
rough drift
#

java.lang.IllegalStateException: This registry can't create intrusive holders

BuiltInRegistries.BLOCK.createIntrusiveHolder(this); Block.class

BLOCK = registerDefaultedWithIntrusiveHolders(Registries.BLOCK, "air", (var0) -> {
  return Blocks.AIR;
});
``` BuiltInRegistries.class

Minecraft, the confusing
quiet ice
sterile token
eternal night
#

yes

quiet ice
#

But would you want to?

eternal night
#

yes

quiet ice
lost matrix
quiet ice
sick ermine
#

why is this not working?

eternal night
#

the logic you extract is not that difficult to maintain

sick ermine
#

sub class

sterile token
# eternal night yes

I have seen an spanish dev which was punished my Mojang because he re writed a simple mc client in unity

quiet ice
eternal night
#

you can run whatever the fuck you want as a server

#

if the spanish dev writes a minecraft client in unity

#

and sells it

#

different story

sterile token
rough drift
#

^

quiet ice
#

And let's be honest: If it doesn't fit in a simple ASM Transformer, I ain't going to bother updating it

eternal night
#

so like

eternal night
#

not really an argument ๐Ÿ˜…

#

2k lines is fine

lost matrix
quiet ice
#

I mean 2k lines in mojang code

grand flint
#

So, I can make custom mobs from armour stands, if they are multithreaded properly?

eternal night
#

oh kekw

#

yea nah

quiet ice
#

There should be more in non-mojang code but that will be very static

eternal night
#

it is all very static yes

grand flint
#

Can plugins manage thread usage?

eternal night
#

you just redirect all of your server logic into a second implementation basically

#

and just use mojangs called methods as entry points

quiet ice
rough drift
#

Fun fact, multi threading chunks is actually somewhat easy

kind hatch
rough drift
#

Just update them at interval orders

eternal night
#

with a simple ```java
if(true) {
doOtherStuff();
return;
]

mojang code here

rough drift
#

no issues there

eternal night
#

you barely have any diff for the insertion

rough drift
#

Of course, editing the actual code, that's different

grand flint
sick ermine
quiet ice
sick ermine
#

@lost matrix

#

sorry ๐Ÿ˜ฆ

lost matrix
# sick ermine why

Because currently you have an ActionQuestRequirement<?> which means the generic
methods in there dont know what objects they are allowed to use. The type is erased on runtime
so you need additional checks for this. You should never have an ActionQuestRequirement<Event> btw.

eternal night
#

what do you mean "class the recompile"

lost matrix
quiet ice
# eternal night hm ?

You are likely to change some descriptor and in that case Mixin is insufficent and raw mass ASM is sorcery. So recompilation it is

eternal night
#

well yea

#

obviously

#

no one in their right mind would do that without a proper server fork

quiet ice
#

Ah right, you can just change paper's source code directly

#

I am a fool sometimes

eternal night
#

yeaaa kekw

sick ermine
#
    private void increase(Event event) {
        questRequirements.stream()
                .filter(requirement -> requirement instanceof ActionQuestRequirement<?> &&
                        ((ActionQuestRequirement<?>)requirement).getTriggerClass() == event.getClass())
                .forEach(requirement -> ((ActionQuestRequirement<?>) requirement).increase(event));
    }```
grand flint
#

Guys I got tons of options here
A) give up
B) spend more on experienced devs

eternal night
#

like leafs chunk patch is pretty nicely contained

#

the insertions into mojang codes are as small as possible

quiet ice
eternal night
#

obviously means now you have a secondary system

#

but that one is *fast ๐Ÿšค *

kind hatch
grand flint
quiet ice
#

that is the wrong mindset

grand flint
#

I have tons of other stuff I need work on, this minecraft project is like a side project

lost matrix
# sick ermine ```java private void increase(Event event) { questRequirements.strea...
    // Note: You need to STRONGLY encapsulate your unchecked casts
    @SuppressWarnings("unchecked")
    private <T extends Event> void increase(T event) {
        questRequirements.stream()
                .filter(requirement -> requirement instanceof ActionQuestRequirement<?> &&
                       ((ActionQuestRequirement<?>)requirement).getTriggerClass() == event.getClass())
                .forEach(requirement -> ((ActionQuestRequirement<T>) requirement).increase(event));
    }
grand flint
lost matrix
eternal night
#

exactly xD

#

tho leafs shit usually is rather functional

#

until you try to keep a minecart in a soulsand block

#

then shit explodes

kind hatch
quiet ice
grand flint
#

I can change it, which do you think is the best?

sick ermine
rough drift
#

Minecraft on it's way to be the most annoying possible

#

I have a goddamn total of 97+ tabs of github open, multiple intelli projects, trying to figure out how to register a fucking block to the block registry

Its fucking FROZEN

quiet ice
#

Chrome?

rough drift
#

No, the registry is frozen

#

not the browser lol

grand flint
#

opera gx struggling with 2 tabs ๐Ÿ˜Ž

kind hatch
# grand flint I can change it, which do you think is the best?

That isn't exactly up to me as your project sort of dictates that. If you need each server to be synchronized for certain reasons, then it is what it is. However, if you have one server that you are just copying from, then it changes how you can look at it.

It just depends on what you need. What's the server like? Is it a survival world that needs to be synchronized? Or is it something else?

rough drift
#

edge being the champ and running all of my tabs

quiet ice
rough drift
#

I am past the point of unsafe

quiet ice
#

I mean sun Unsafe

grand flint
rough drift
#

Unsafe rn lookin real safe

rough drift
quiet ice
#

Just unset the freeze flag through the unsafe

rough drift
#

if the registry is frozen then it literally deletes the hashmap

quiet ice
#

Then freeze it again after your modifications

#

If not, apply the modifications directly to the hashmap or copy the hashmap in interim

sterile token
#

Please something is not making sense

Error dispatching event PostLoginEvent(player=Alexito2060) to listener dev.alex.net.invites.bungee.listener.UserListener@3add81c4
java.lang.ClassCastException: class java.lang.Double cannot be cast to class java.lang.Integer (java.lang.Double and java.lang.Integer are in module java.base of loader 'bootstrap') at org.bson.Document.getInteger(Document.java:243)
kind hatch
rough drift
#

This gets called earlier than I can change it

lost matrix
# sick ermine ((ActionQuestRequirement<?>)requirement).getTriggerClass() == event.getClass( I...

I usually try to keep type safety with a Map<Class<?>, Something<?>> where something has to provide its generic as a class.
So

void <T> register(Something<T> something) {
  Class<T> typeClass = something.getTypeClass();
  this.map.put(typeClass, something);
}

void <T> consume(T event) {
  // This cast is fine because all map mutations are strictly monitored
  Something<T> something = (Something<T>) this.map.get(event.getClass());
  something.consumer(event);
}

This way i keep O(1) time complexity and im relative safe (as long as i strongly encapsulate the map).

But you are staying safe by iterating through all elements and checking for your type on each one, which is also fine.

rough drift
#

the exception is thrown due to freezing, and I can't do shit about that

quiet ice
#

That is false.

rough drift
#

I mean I can just do a bit of funki reflection magic

quiet ice
#

I personally would just obtain the underlying data structure directly (through reflection or unsafe) and modify it without going through NMS

rough drift
#

I am already using so much reflection and NMS

quiet ice
#

Well that is obvious

rough drift
#

why didn't I just use PDC ๐Ÿ˜‚

quiet ice
#

You can reduce the amount of mojmap hackery needed by using ASM to resolve field names and stuff, but that is a whole other can of worms

rough drift
#

also I can't really get the fields by reflection

#

since md's remapper plugin doesn't remap that

#

so I am just using types for now lmao

quiet ice
#

Hence ASM

rough drift
#

I.. I just wanted to texture a block lmao, welp ASM it is babiiiiiiiiiiiiiiiiiii

#

I have no clue how to use ASM tbh

quiet ice
#

get the bytecode for class X, then scan for what could probably be that field (i.e. do it via field accesses or something)

rough drift
#

Class literally be looking like this, I need the first nullable

#

I guess I can just scan until I find the first map w/ nullable

quiet ice
#

On the other hand I could probably port Starloader's @ReobfuscateReference to md's remapper plugin

cunning canopy
#

Is it worth switching to paper? Is it even that much more preformant?

rough drift
#

if you can that'd be amazing lmao, I would really need that lol

lost matrix
cunning canopy
#

Would you care to share some of the pros and cons?

lost matrix
#

I personally think paper is a cool piece of software

quiet ice
rough drift
quiet ice
#

Feel free to

cunning canopy
#

I just really need to use nms, and it seems very hard to get working with paper

rough drift
#

Only thing is that the remapper plugin already remaps strings

#

just not in reflection access

cunning canopy
#

But I dont know if spigots preformance will be enough for my project

rough drift
#

not in reflection access when assigning the result to a field*

kind hatch
quiet ice
cunning canopy
#

I am making fighter jets. Lots of entities. Something like 216. that needs to be updated every tick

lost matrix
#

You can make a fighter jet with just one single entity and a resourcepack

cunning canopy
#

I am aware, but I am doing it the hard way. On purpose

rough drift
#

there is just a bug when you assign the value it just doesn't

lost matrix
#

You can make them packet based. Im assuming that you are using FallingBlocks which are structured like a jet?

quiet ice
cunning canopy
lost matrix
cunning canopy
#

With paperweight?

lost matrix
#

Yes

rough drift
#

remembered reading a couple threads about it

#

should still be open wait

cunning canopy
# lost matrix Yes

I cant even manage to get started. I am getting an error just trying to build the thing

rough drift
quiet ice
#

I myself use (or similar)

    @StarplaneReobfuscateReference
    @NotNull
    public static String spaceDrawMethod = "snoddasmannen/galimulator/Space.draw(Lsnoddasmannen/galimulator/rendersystem/RenderCache;)V";

to remap obfuscated references, is much more reliable than inferring from context

rough drift
#

yeah

quiet ice
#

I also have another version of that annotation lying around that is superior to that format, but I don't think it managed to get out of the draft phase due to the surrounding project being canned

lost matrix
quiet ice
#

Thankfully not quite

#

The german education system is broke so the first 4 hours are cancelled. Hence I'd only need to get up at 9am

rough drift
#
try {
    if (UNREGISTERED_INTRUSIVE_HOLDERS.get(BuiltInRegistries.BLOCK) == null) {
        UNREGISTERED_INTRUSIVE_HOLDERS.set(BuiltInRegistries.BLOCK, new IdentityHashMap<>());
    }
} catch (IllegalAccessException e) {
    throw new RuntimeException(e);
}
Registry.register(BuiltInRegistries.BLOCK, id, block);
```Yeah it's just fucking with me at this point
#

Still crashes

rough drift
#

private java.util.Map net.minecraft.core.RegistryMaterials.m the field is also correct

quiet ice
#

The third and fourth hour are always irrelevant, however this time I got lucky and the first and second hours are gone too

#

I feel like at this point it'd be easier to write a paper fork

rough drift
#

Being honest

#

Yes

#

But I also hate paper

#

so you know

quiet ice
#

Then write a spigot fork

#

shouldn't be a lot harder if you don't open source it

rough drift
#

I mean I am doing this for work, and they want to use paper

quiet ice
#

Using a Mixin framework such as ignite is the other alternative here

rough drift
#

I actually just got on a call with my employer

#

I'll just ask em really quick

analog haven
#

If I send y'all this code that chatgpt just wrote can you tell me if it's actually gonna work or if it'll screw me over

#

I have no idea how to do this stuff

#

import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerDropItemEvent;
import org.bukkit.plugin.java.JavaPlugin;

import java.util.HashMap;
import java.util.Map;
import java.util.UUID;

public class DropTools extends JavaPlugin implements Listener {

private Map<UUID, Long> dropTimestamps = new HashMap<>();

@Override
public void onEnable() {
Bukkit.getPluginManager().registerEvents(this, this);
}

@EventHandler
public void onDrop(PlayerDropItemEvent event) {
Player player = event.getPlayer();
UUID playerId = player.getUniqueId();
Long lastDropTimestamp = dropTimestamps.get(playerId);

if (lastDropTimestamp == null || System.currentTimeMillis() - lastDropTimestamp > 10000) {
  event.setCancelled(true);
} else {
  dropTimestamps.remove(playerId);
}

}

public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (!(sender instanceof Player)) {
return false;
}

Player player = (Player) sender;
UUID playerId = player.getUniqueId();

dropTimestamps.put(playerId, System.currentTimeMillis());

return true;

}
}

quiet ice
#

The onCommand method may be invalid but otherwise it is good enough I guess?

#

It depends on what you want to achieve

analog haven
#

I just want players to not be able to drop tools unless they enter /droptools at which point they can for 10 seconds. Just to prevent accidental drops into the void

quiet ice
#

As of now this does the opposite

#

And affects tools as well as normal items

analog haven
#

oh no

#

how do I fix that

torn shuttle
#

yeah chatgpt really has no awareness of what it's doing huh

analog haven
#

I couldn't tell the difference if it did๐Ÿ˜‚ I've looked for an already made plugin for this and couldn't find one so I turned to chatgpt

rough drift
#

@quiet ice Almost fixed it

#

Doing weird shit

quiet ice
rough drift
#

IT WORKED

#

But not quite

#

Now I just need to make it send the proper block

#

and bim bam boom I'll be a happi boi

#

casually softlocked a chunk area

quiet ice
#

And now you suddenly see that you can't just add a block to a registry willy-nilly without the protocol overreacting at the same time

rough drift
#

I was already aware

#

I finally managed to add it to the registry

#

I now need to do the other 50%

analog haven
#

I was honestly shocked this plugin didn't already exist

safe ibex
#

Hi, how would I make a mute command/code to mute people based off their UUIDs in the chat for x time?

rough drift
#

Is there a Spigot Mapping -> Mojang Mapping tool?

eternal oxide
#

?nms

rough drift
lost matrix
eternal oxide
#

then screamingsandles web site

safe ibex
#

Done some Kotlin tho

rough drift
eternal oxide
#

it has every mapping

rough drift
lost matrix
tardy delta
#

is that whole chapter two of the bible in the lore?

lost matrix
#

I recommend this one if you know what a build tool is

#

Otherwise this one

#

After that you pretty much only need to know those three

echo basalt
#

man doesnt like gradle

lost matrix
#

I tolerate it

#

when using paper or forge

#

But spigot is maven territory

echo basalt
#

cries in fabric

upbeat hornet
#

Is there a good tutorial out there that explains how to create advanced holograms? By advanced I mean that we can easily edit the file, destroy/respawn the hologram if needed etc. There's none out there

lost matrix
upbeat hornet
#

Yes I'm considering using them. But then my users would have to download that plugin aswell

bold vessel
snow lava
#

What's the EntityInsentient class from NMS, and what it does?

bold vessel
remote swallow
#

you shouldnt check inventories by title

lost matrix
lost matrix
remote swallow
#

keep an instance of the inventory and check if that inventory is the same

lost matrix
#

Or a Set<Inventory> if you have multiple of that type

remote swallow
#

yeah

remote swallow
#

yeah

lost matrix
bold vessel
#

is this going to work ?

#

its not a chest

lost matrix
#

If 2 people open the inventory then the first one will break

bold vessel
#

How i fix that ?

lost matrix
#

Use a Set<Inventory> and check for contains or only create the inventory once in the constructor

bold vessel
#

okk

lost matrix
#

The former method also requires you to remove the inv from the set in the InventoryCloseEvent

sterile token
#

Dont check inventory by title, u should either use inventory holder or compare inventory object

lost matrix
#

?stash

undone axleBOT
sterile token
#

?

#

How do you serialize UUIDs with Gson?

#

I already created a type adapter for it, but its throwing an exception

lost matrix
#

String or 128bit int

sterile token
lost matrix
#

Looks good. What is the exception?

sterile token
#

java.lang.UnsupportedOperationException: JsonObject
at com.google.gson.JsonElement.getAsString(JsonElement.java:191)
at dev.alex.net.inviter.bungee.adapters.UUIDAdapter.deserialize(UUIDAdapter.java:17)
at dev.alex.net.inviter.bungee.adapters.UUIDAdapter.deserialize(UUIDAdapter.java:8)

#

Basically is expecting a JsonObject but i dont find the cause

lost matrix
#

Your data is malformed. Make sure you delete the data before retrying.

sterile token
#

Maybe is caused because i have a uuid field on custom, which then im serializing with Gson#toJson() and Gson#fromJson() ? i edit it

lost matrix
#

Wait how are you using your type adapter?

#

Does the specialsource-maven-plugin already work for 1.19.3 ?

#

Looks like it has problems with java 19

sterile token
# lost matrix Wait how are you using your type adapter?

I register it thru Gson builder, and create a Gson instance which im using to then doing smth like this:

class UserModel {

  UUID uuid;
  String name;
  bla bla;
}

Gson gson = GsonBuilder.
UserModel user = new Usermodel(bla, bla);
String userData = gson.toJson(user);
UserModel serialized = gson.fromJson(userData, UserModel.class);
#

Im thinking the issue came when trying to seriliaze/deserialize the UUID using it as a field inside a custom object

lost matrix
#

Where do you register your type adapter?

sterile token
#

On main class

lost matrix
#

Show how pls

sterile token
lost matrix
#

Serialize the data to json and show the result pls

sterile token
#

right

#

1m please

#

Okay it doesnt even serialize it into json string

#

Oh wait i forgot to remove a line ๐Ÿคฆโ€โ™‚๏ธ

safe ibex
#

Easiest way to store user data persistently in spigot? Is there like an example/docs example? Would be helpful :)

lost matrix
#

PersistentDataContainer of a Player. You can store quite a bit in there.

#

?pdc

half arrow
#

Hey! would anyone be able to help me with this error i'm getting with HikariCP?

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!

half arrow
#

I can't seem to post SS, so here's the error

kind hatch
#

?img

undone axleBOT
sterile token
#

Instead tell them to get verified with their spigot acc

half arrow
#

14.02 00:58:40 [Server] ERROR Error occurred while enabling IslandCore valpha-0.1 (Is it up to date?)
14.02 00:58:40 [Server] INFO java.lang.RuntimeException: java.lang.ClassNotFoundException: com.mysql.jdbc.jdbc2.optional.MysqlDataSource
14.02 00:58:40 [Server] INFO at com.zaxxer.hikari.util.UtilityElf.createInstance(UtilityElf.java:106) ~[main-alpha-0.1.jar:?]
14.02 00:58:40 [Server] INFO at com.zaxxer.hikari.pool.PoolBase.initializeDataSource(PoolBase.java:322) ~[main-alpha-0.1.jar:?]

#

Okay i'll get verified shortly

#

my maven setup, is this

#

<dependency>
<groupId>com.zaxxer</groupId>
<artifactId>HikariCP</artifactId>
<version>5.0.1</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.28</version>
</dependency>

sterile token
#

Please format your code

#

?formatcode

#

?codeformat

#

๐Ÿ˜ก

#

they remove it, it was such a nice command

#

Im 100 sure

kind hatch
#

I don't think there was a command like that in the first place.

hazy parrot
#

i remember there was one

sterile token
#

It used to tell you how to format proepr your code

hazy parrot
#

?codeblock

undone axleBOT
#

You can use the discord code block format to display code or just text in a more pleasing way:
```java
public class MyPlugin extends JavaPlugin {
@Override
public void onEnable() {

}

}```
Becomes:

public class MyPlugin extends JavaPlugin {
    @Override
    public void onEnable() {

    }
}```
hazy parrot
#

hehe

kind hatch
#

Ah

sterile token
#

Nice Goski ๐Ÿ‘

#

I didnt remember the name, short phase memory

kind hatch
#

Could of used that earlier. lol

half arrow
#

Sorry! does anyone have exp using HikariCP?

sterile token
hazy parrot
#

?ask

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!

half arrow
#

...

#

i did

sterile token
#

I didnt want to tell him the same again, i already toid the ask command

#

๐Ÿ˜‚

lost matrix
opaque latch
#

Anyone know what I can use instead of ItemMeta().hasPersistentDataContainer()?

half arrow
#
package prisonisland.main;

import org.bukkit.plugin.java.JavaPlugin;

public class IslandCore extends JavaPlugin {

    private MySQLHelper sqlHelper;

    @Override
    public void onEnable() {
        // Connect to MySQL database
        sqlHelper = new MySQLHelper("jdbc:mysql:/hostprefix:3306/databaseprefix", 3306, "databaseprefix", "userprefix", "passprefix");

        // Register event listener
        getServer().getPluginManager().registerEvents(new PlayTimeListener(sqlHelper), this);
    }

    @Override
    public void onDisable() {
        // Disconnect from MySQL database
        if (sqlHelper != null) {
            sqlHelper.close();
        }
    }
}```
kind hatch
opaque latch
#

Cannot resolve method 'hasPersistentDataContainer' in 'ItemMeta'

remote swallow
opaque latch
#

NBT data in config.yml file

lost matrix
opaque latch
#

no

kind hatch
opaque latch
#

I just don't know what the new version should be

#

yes

remote swallow
#

1.14

#

iirc it doesnt have hasPersistent only getPersisten

opaque latch
#

Does it do the same thing?

remote swallow
#

getPersistentDataContainer will just return the container

opaque latch
#

has returns true or false

remote swallow
#

an item will always have a peristent data container

half arrow
opaque latch
#

so can they be used interchangeably

#
return;
}```
lost matrix
remote swallow
#

it will always have a container, it will not always have values

lost matrix
opaque latch
#

Can't use the ! operator in getPersistentDataContainer

lost matrix
#

version 63 is java 19

half arrow
# half arrow just tried that, didn't seem to help :/

different error now

14.02 01:18:38 [Server] ERROR [com.zaxxer.hikari.pool.HikariPool] HikariPool-1 - Exception during pool initialization.
14.02 01:18:38 [Server] INFO java.sql.SQLException: Malformed database URL, failed to parse the main URL sections.
14.02 01:18:38 [Server] INFO at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:129) ~[mysql-connector-java-8.0.27.jar:8.0.27]

remote swallow
#
public static Map<String, NBTBase> getCustomDataTags(PersistentDataContainer container) throws IllegalAccessException, NoSuchFieldException {
        Field customDataTagsField = container.getClass().getDeclaredField("customDataTags");
        customDataTagsField.setAccessible(true);
        return (Map<String, NBTBase>) customDataTagsField.get(container);
    }
lost matrix
kind hatch
sterile token
#

Smile this is working perfect, so must be something related to either mongo or redis

lost matrix
#

Thats what i thought

kind hatch
lost matrix
half arrow
kind hatch
#

?paste the class please

undone axleBOT
lost matrix
kind hatch
#

Yes I am.

half arrow
lost matrix
#

Ok but this clearly looks like the plugin cant handle v63 class files...

#

But where are they coming from?

kind hatch
#

Uhh, these version numbers. I hate figuring these out. Personally, I'm still using Java 16, but writing in Java 8 for the time being. However, let me install Java 19 and I'll let you know if I have issues with it.

lost matrix
#

?paste

undone axleBOT
lost matrix
kind hatch
kind hatch
lost matrix
#

Alright so ive just switched to 17, cleaned and then installed

#

Which worked

half arrow
#

Did you notice anything Shadow?

kind hatch
# lost matrix Alright so ive just switched to 17, cleaned and then installed

Yea, how did you change the version? Cause you could of just set the compiler version and still have the project be labeled as 19 in the intellij project settings.

 <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven.compiler.source>17</maven.compiler.source>
    <maven.compiler.target>17</maven.compiler.target>
  </properties>
lost matrix
#

I've changed both

kind hatch
#

Fair enough.

#

You have any idea why the <java.version> tag won't ever work for me?

lost matrix
#

Alright 17 it is then. Not a big loss but still an ugly problem

kind hatch
#

Is that how it's supposed to be used?

lost matrix
#

Yes

kind hatch
#

That might explain it then. lmfao

worldly ingot
#

Yes. java.version means nothing to Maven. It's just a custom property

lost matrix
#

XD

#

I should actually add spigot.version to clean this mess up

#

Ah this looks nicer ๐Ÿ˜„
Sometimes i dont completely hate maven

kind hatch
half arrow
#

that was placeholder text...

kind hatch
#

Well your examples aren't exactly showing a clear picture. I'm working with what you're giving me.

#

Where do you replace the values then?

half arrow
#

i overtyped them before sending it through one sec i'll send the original

#

sorry for being a hassle!

sterile token
#

Smile im really confused about registering the custom codec for Mongo client

#

I already setup a custom codec for writing and reading

kind hatch
# half arrow https://paste.md-5.net/payuxukera.java

Oh I think I see part of the problem. You should be using the HikariConfig to be setting the values not Properties itself.
HikariConfig#setJdbcUrl()
HikariConfig#setUsername()
HikariConfig#setPassword()
HikariConfig#addDataSourceProperty() <---- For everything else that's not included.

HikariConfig config = new HikariConfig();
// Set the config values

HikariDataSource dataSource = new HikariDataSource(config);
sterile token
kind hatch
sterile token
#

for example: <method>://<user>:<pass>@<host>:<port>/db?authSource=admin

kind hatch
#

You could also set the values on the HikariDataSource manually, but the config options make it easier.

half arrow
#

Okay i'll try that thanks

lost matrix
# sterile token Smile im really confused about registering the custom codec for Mongo client

Im gonna treat you with one of my personal classes. A MongoDB Codec which is backed by a Gson instance:
https://gist.github.com/Flo0/2f751f875b040dae23a62379443d451e

You need to create a separate codec for every MongoCollection<V>

  // Very important to pass a good Gson instance here
  public TypedGsonMongoCodec(Class<V> typeClass, Gson gson) {
    this.typeClass = typeClass;
    this.gson = gson;
  }

Example:

    MongoCollection<V> mongoBackbone = ...;
    CodecRegistry customReg = CodecRegistries.fromCodecs(new TypedGsonMongoCodec<>(mongoBackbone.getDocumentClass(), gson));
    CodecRegistry codec = CodecRegistries.fromRegistries(MongoClientSettings.getDefaultCodecRegistry(), customReg);
    mongoBackbone = mongoBackbone.withCodecRegistry(codec);
#

The codec basically translates json to bson and back.

#

And Object -> json / json -> Object is handled by Gson

kind hatch
#

Hey 7smile, was there a reason you needed Java 19? Or are you just trying to stay on the bleeding edge?

lost matrix
#

Im using this so that i can use MongoDB like an actual Map<K, V> ๐Ÿ˜„ (With long get/put operations)

lost matrix
sterile token
hazy parrot
#

is loom out in java 19 ?

lost matrix
#

Isnt that scheduled for the next LTS?

hazy parrot
#

Idk, I'm asking

remote swallow
#

what came in j19

zenith pewter
#

Does anyone know of a plugin to generate a world of plots for 1.19?

hazy parrot
#

I remember seeing it for 19,but I see no hype for it, so probably next lts as you say

lost matrix
#

sadly instanceof pattern matching is only experimental PES_OhMyGod

remote swallow
#

whats instanceof pattern matching

lost matrix
#

19 mainly consists of incubations + RiscV port

zenith pewter
worldly ingot
remote swallow
#

i thought that was j16 or 17

sterile token
worldly ingot
#

Unless smile was referring to switch instanceof pattern matching

worldly ingot
#

In which case identical concept, but for switch cases

remote swallow
#

oh fun

kind hatch
remote swallow
#

does spigot change java version with mojank

worldly ingot
#
switch (value) {
    case Integer i && i > 10 -> /*whatever*/
}```
drowsy helm
#

you can do instanceof in swithces?

#

dang

worldly ingot
drowsy helm
#

is that a new thing?

hazy parrot
worldly ingot
#

It's been in incubation/preview for like 4 major versions

#

Probably J20

#

but who knows at this point

drowsy helm
#

oh awesome

lost matrix
#
    Animal animal = something;

    switch(animal) {
      case Cat cat -> cat.pur();
      case Dog dog -> dog.bark();
      default -> animal.doSomething();
    }

Something like this

drowsy helm
#

syntax looks a bit funny

hazy parrot
#
  override fun register(listener: Any) {
        listeners.add(
            when (listener) {
                is PteroEventListener, is ClientSocketListener -> listener
                else -> throw IllegalArgumentException("Wrong implementation of listener !")
            }
        )
    }

Kotlin ๐Ÿฅต

subtle folio
#

kotlin ๐Ÿคฎ

kind hatch
#

Hey wait, hold up. The is keyword. That would be a nice replacement for instanceof if you ask me.

hazy parrot
#

definetelly more human readable

drowsy helm
#

'is' is pretty ambiguous

hazy parrot
#

if (listener is EventListener)

drowsy helm
#

java loves verbose

#

instanceof doesnt really leave room for interpretation

hazy parrot
#

what can it mean

#

aside from instanceof

worldly ingot
#

implements > instanceof ๐Ÿ’ช ๐Ÿ˜ค ๐Ÿ”ฅ

if (value implements Something) {

}```
drowsy helm
#

people can interpret it as ==

#

if(number is 1)

upbeat hornet
#

So I have this little code here :

HashMap<int, ArmorStand> holograms = new HashMap<>();
ArmorStand hologram = (ArmoStand) location.getWorld().spawnEntity(location, EntityType.ARMOR_STAND);
holograms.put(1, hologram);

And I'd like to delete the armor stand at the key 1. How can I do this?
I tried this, but it doesn't work:

holograms.get(1).remove();
drowsy helm
#

if(a is b)

hazy parrot
#

well

#

ig ur right

hazy parrot
#

but i feel sorry for those people ๐Ÿ˜ญ

drowsy helm
#

it uses key value pair not index

worldly ingot
#

Maps aren't random accessible nor indexible

upbeat hornet
hazy parrot
#

also you can't have primitive

drowsy helm
hazy parrot
#

in hashmap

drowsy helm
#

hashmap has .remove(key)

hazy parrot
#

use Integer instend of int

upbeat hornet
#

oop my bad I use another key but I tried simplifying it

#

My key is correct

upbeat hornet
drowsy helm
#

by "remove" do you mean from the world or from the hashmap

hazy parrot
#

does those ints represent index or something other

drowsy helm
#

they said its a diff key

#

just simplifying

kind hatch
hazy parrot
upbeat hornet
drowsy helm
#

.remove() on the entity should work

upbeat hornet
#

before and after

#

It clearly did not delete the first one

kind hatch
#

How did you remove it?

upbeat hornet
#

oohh wait

#

I think I'm dumb

zenith pewter
upbeat hornet
#

ok it works now

#

Had a problem with my key (was deleting it right before I try to access it)

kind hatch
zenith pewter
#

If I buy the plugin are the updates free?

kind hatch
#

Yes

#

However they (the updates) are not guaranteed.

zenith pewter
#

I will trust the developer.
PS: I don't even know how they understand this translator, I don't know English

grand flint
#

Hello guys, is there a way I can let my players choose what texture pack they want, between the dark and light theme, and then it automatically puts the texture pack on

drowsy helm
grand flint
#

Yes, how do I send the texture pack to the user?

grand flint
#

That is like the server properties file? It will automatically load the texture pack?

drowsy helm
#

what?

#

wdym

grand flint
#

You know, how if I set the URL in the server.properties, and if they have resourcepacks enabled, it loads the texture pack

#

Does that function load the texture pack

drowsy helm
#

the method has nothing to do with server.properties

upbeat hornet
grand flint
#

I never said it did