#help-development

1 messages · Page 2071 of 1

radiant cipher
#

Like lets say i want a hopper at coords 100 100 100 to activate, how can i do that without setting a redstone block there?

noble lantern
#

You should be able to get the state of that block, cast it to whatever class your using (In this case Hopper) and setPowered(true) from there

radiant cipher
#

How do i get and change block states

noble lantern
#

Block#getState()

Checks if its instance of Hopper

Hopper hopper = (Hopper) block.getState();

hopper.setPowered(true)

should work for any other redstone powered blocks

radiant cipher
#

So... it just scans the entire world and checks for any hoppers?

#

Seems really resource intensive

zinc trout
#

How's it goin y'all!

vocal cloud
#

Just ask your question mmlul

zinc trout
#

Just started learning Java today. Successfully learned "HelloWorld"

vocal cloud
#

Gratz

wet breach
#

but now, if you already know the coords, then its a matter of checking to see if the chunk where those coords you have is loaded first

#

and then do your code thing

granite beacon
#

Is there a way to check when a dropped item is moved?

brave sparrow
brave sparrow
#

There’s no other way to do it

granite beacon
#

I could check when packets are fired for the item updating ig?

brave sparrow
#

Only if there’s a player in range to see it move

granite beacon
#

The end goal is to track when item enter chunks

wet breach
#

why do you need to track when an item enters a chunk?

granite beacon
#

Chunk hoppers

#

But I don't want to use a non-stop loop

vocal cloud
#

Is this for dupe exploits?

wet breach
granite beacon
#

I'm trying to account for items that don't spawn inside of the chunk itself

brave sparrow
#

You’re better off checking every item in the chunk once every x ticks

#

Chances are there won’t be that many items in each chunk

granite beacon
#

The problem is doing that in a survival server

brave sparrow
#

What’s the problem with that?

granite beacon
#

That would have a large impact on performance no?

brave sparrow
#

No

#

Lol

#

You just keep track of where the hoppers are

granite beacon
#

Right, but having 300+ hoppers that check every x would hurt performance?

brave sparrow
#

Not really lol

wet breach
#

really depends on how you code it

brave sparrow
#

300 executions is nothing

#

Unless you write the code in a really inefficient way

wet breach
#

300 checks every so many ticks as Alex has said

#

is really nothing

brave sparrow
#

^

wet breach
#

unless you have terrible hardware as it is

brave sparrow
#

We’re talking fractions of fractions of fractions of a second

#

You don’t start to see real slowdowns until we’re talking about millions of iterations per tick

wet breach
#

a simple hashmap is all you really need for this too, or a set

#

but probably better to go with a hashmap

brave sparrow
#

Why a map?

#

There’s no value

crisp steeple
wet breach
#

hashmaps are generally easier to work with, plus if you have custom objects you can have those for the values

#

but I suppose a set works just fine

brave sparrow
#

How are maps easier than sets

granite beacon
brave sparrow
#

We just gave you one

crisp steeple
#

so you're just trying to pick up any item entity ever?

brave sparrow
#

For each hopper, every x ticks check the dropped items in that chunk and do your thing

#

There won’t be any noticeable performance impact if you do it properly

crisp steeple
#

if you're trying to do chunk-specific hoppers

#

make a map with the chunk and whatever storage device you want it to go to

granite beacon
# brave sparrow We just gave you one

I think I'll just check when an item spawns in, get the chunk, check if there's a valid hopper in that chunk, and make it grab all the dropped items in the chunk.

crisp steeple
#

every time an item spawns check the location

#

thats what i was going to say

brave sparrow
#

That won’t be amazing for your case where the item moves after spawning in though

#

There’s really no performance impact for doing it properly

crisp steeple
#

it would get deleted though presumably

brave sparrow
#

Why would it get deleted?

wet breach
#

Alex is probably the one you should listen to 😛

#

they most likely have experience doing this sort of thing in a large scale fashion XD

crisp steeple
#

hes trying to hopper it into somewhere

brave sparrow
#

If an item spawns in and falls into some water and gets pushed into a new chunk that has a hopper, you’d want to know about that

#

But if you only check when items spawn in, you could have items that never get picked up

crisp steeple
#

What I'm assuming is that he's trying to make chunks that pick up every item in them

brave sparrow
#

You’re assuming incorrectly

granite beacon
brave sparrow
#

The question was originally about detecting when items move into a new chunk

crisp steeple
#

I see

brave sparrow
#

Clans is the product of too many cooks in too little time building a monster

#

Lol

#

That codebase is a nightmare

granite beacon
#

I can imagine from when I've talked to timmie

brave sparrow
#

Which is why I’m telling you how to do it properly

granite beacon
#

But yeah I'll probably go with that solution. Thanks Alex

brave sparrow
#

No worries

granite beacon
#

Idk if I can ask a question here that's off-topic but, what's happened to mineplex?
Have there been any new developments of anything? I haven't kept up with things.
No pressure to answer or anything, I was just curious.

crisp steeple
#

Think they moved to bedrock a while ago

#

Not sure how well that's doing

granite beacon
#

Java is still a thing though

#

Bedrock makes them a ton of money from what I've heard

crisp steeple
#

Yeah

granite beacon
#

Marketplace + Kids

brave sparrow
#

we're working on rebuilding the infrastructure

#

which is a massive undertaking

#

but that's getting close

granite beacon
#

Best of luck on that, Mineplex was a huge part of my childhood and I'd love to see it thrive again 😄

hasty prawn
#

^^ The amount of hours I dumped into Super Smash Mobs was...

#

many.

crude delta
#

ayo gamers

#

how do ppl look at nms mappings do I have to pull out ye ol buildtools or somethin?

#

or is there some online thingymahjigory

wet breach
#

?bootstrap

undone axleBOT
#

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

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

wet breach
#

surprised you don't already know @crude delta

#

and you should verify 😛

crude delta
#

I've never done nms and basically have borrowed code or examples for reflection so yea

#

im big dum

ornate patio
#

how do you remove all scores from an Objective

#

this is the only way i found

objective.unregister();
objective = mainScoreboard.registerNewObjective("deathCoords", "dummy", Utils.colorize("&c&oDeath Coords"));

but is it the most efficient?

crude delta
#

@wet breach I'm still dum I just wanna see where things are n stuff like where NBTTagCompound was moved to

#

Unless I really have to set up a new maven project or somethin

noble lantern
#

Since were on the topic of NMS

crude delta
#

I just wanna know where NBTTagCompound went

#

I'm using reflection

noble lantern
#

How am I able to merge 2 NBTTagCompounds into each other? With this only the entity tag is added and theres not any other methods i notice that put compounds into

noble lantern
crude delta
#

yea basically

noble lantern
#

net.minecraft.nbt.NBTTagCompound

noble lantern
#

Interesting, its what im currently using but im not using reflection

crude delta
#

tried adding nbt as I saw that in CraftItemStack but that was no dice

tender shard
#

the proper name is net.minecraft.nbt.CompoundTag

crude delta
#

ah ok, no server

#

guess I gotta add something to the reflectionutils

tender shard
#

basically everything has been moved out of n.m.s

#

the server packet now really only has "real" server stuff inside anymore

noble lantern
tender shard
#

CompoundTags can be merged using tag.merge(anotherTag)

#

i don't know what your "a" method is, but it's definitely not the merge(CompoundTag) method 😄

noble lantern
#

wait holdup

quaint mantle
#

What the fuck is 0x20

noble lantern
#

Lowkey this is my first time im using NMS lmao am i supposed to be using the mapped version?

hasty prawn
noble lantern
#

^

#

No spaces allowed in plugin names for plugin.yml

quaint mantle
#

Oh thank you

#

That helped

#

Yes it worked

#

thanks

tender shard
#

if you use remapped, you can simply recompile your code when a new version comes out and it'll still work

#

you won't have to change NBTCompoundTag.a(...) to NBTCompoundTag.c(...) on every new update

#

you can simply always use CompoundTag.merge(...)

noble lantern
#

By chance is there a blog for Gradle?

#

Im fine with switching to maven, just like gradle

tender shard
#

hm I haven't seen one about gradle

#

there's definitely a special-source plugin for gradle too, but I have no idea how to declare that in gradle

#

you can also in theory manually run the remapping tool but that's a bit annoying

noble lantern
#

Yeah i couldnt find one either so i just decided to depend on the non mapped jar, but using mapped jar doesnt give that merge method but ill worry about it later and switch to maven once i get this working

tender shard
#

the very last post seems to have a working solution

#

but

#

it's extremely dirty and requires you to manually put the remapping tool into a folder

noble lantern
#

Yeah ill just switch to maven seems a lot easier, i cant be bothered trying to get all that working lmao

tender shard
#

😄 yeah I guess that's indeed easier

noble lantern
#

Im just testing some things out as well, so im not even sure if im gonna keep using NMS however i did find the non mapped merge method gonna try that now

tender shard
#

are you on 1.18.2?

noble lantern
#

yessir

tender shard
#

yeah the method should indeed be called "a"

#

513:528:net.minecraft.nbt.CompoundTag merge(net.minecraft.nbt.CompoundTag) -> a

noble lantern
#

interesting

#

hold on gonna test one more thing

tender shard
#

you can see the obfuscated names in the mappings file at <yourHomeDirectory>\.m2\repository\org\spigotmc\minecraft-server\1.18.2-R0.1-SNAPSHOT...-maps-mojang.txt

#

but as said, that method name will change on every new update so I'd really use mojang mappings instead

noble lantern
#

Yeah im gonna switch to maven rn and then retry this, ill come back when im done!

#

BuildTools should automtically install into my .m2 correct? Appears its not doing that for me as it tells the dependency could not be found?

#

Also tried just using 1.18.2 but same thing (Thats what build tools tells me it was saved under)

wet breach
#

don't specify the api and the spigot jar

#

if you are going to depend on the spigot jar, you need to remove the api one, also you need the remapped jar and not just the server jar

#

?bootstrap

undone axleBOT
#

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

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

noble lantern
#

I see so i need to run the remap objective with the SpecialSource plugin? Then run install-remapped-jar?

If so i keep getting The parameters 'srgIn' for goal net.md-5:specialsource-maven-plugin:1.2.2:remap are missing or invalid

Ive ran build tools already so im not entirely sure what the issue is here, maybe im just stupid but for some reason this just seems overly confusing

wet breach
#

if you read the post from the link

#

it tells you how to setup your pom

#

to use the remapped jar

#

even tells you how to get the remapped jar too

#

if you don't already have it

noble lantern
#

ah i see i wasnt running it with --remapped my bad

warm dust
#

Hello, i want to use BukkitRunnable, but when i define Core plugin; it's doesn't work, where do i need to define it in main ? But how ?

noble lantern
#

Your bukkit runnable needs a instance of your class extending JavaPlugin

warm dust
#

Yes how can i define it to acces it everywhere ?

noble lantern
#

you can create a static getter for it

#

one sec

warm dust
#

Okay thx i don't find it 😂

noble lantern
#
public static YourMainClass INSTANCE;

@Override
public void onEnable() {
    INSTANCE = this;
}

public static void YourMainClass getInstance() {
    return INSTANCE
}

You would basically create a static instance of YourMainClass (The one extending JavaPlugin) and then set its instance in the onEnable method of your plugin

From there you make another static getter for YourMainClass (Again, one extending JavaPlugin) and make it return your INSTANCE

warm dust
#

I love you

#

Xd

#

Thanksss

#
public static void YourMainClass getInstance() {
    return INSTANCE
}

In the onEnable ?

noble lantern
#

no

#

thats a method

#

it goes in your class body

warm dust
#

So in event its does work ?

noble lantern
#

Youll need to pass YourMainClass.getInstance() as the plugin argument for BukkitRunnable

warm dust
#

Ok i test

noble lantern
#

maaaan

#

yall weird

#

jkjk

warm dust
#

Oh

#

So ?

noble lantern
# warm dust Oh

you can make your INSTANCE -> instance if you like, typically naming conventions prefer you have your variables camelCased

But it wont effect functionality, just for better readability is all

#

?namingconventions

#

mmbruh

maiden thicket
#

no i call it get() and my variable is plugin

#

:lmao:

noble lantern
#

?convention

#

bad bot

maiden thicket
#

?conventions

undone axleBOT
noble lantern
#

WOW

maiden thicket
#

W

noble lantern
#

bullshit

maiden thicket
#

LMAO

#

i just guessed it

noble lantern
#

ngl didnt know that was a command

#

but, it is

maiden thicket
#

i didnt either 💀

#

?help

undone axleBOT
#
CafeBabe Help Menu
*Red V3*
**__Admin:__**

selfrole Add or remove a selfrole from yourself.

**__Cleanup:__**

cleanup Base command for deleting messages.

**__Core:__**

embedset Commands for toggling embeds on or off.
info Shows info about CafeBabe.
licenseinfo Get info about Red's licenses.
mydata Commands which interact with the data CafeBabe has about...
set Commands for changing CafeBabe's settings.
uptime Shows CafeBabe's uptime.

**__Downloader:__**

findcog Find which cog a command comes from.

**__Mod:__**

names Show previous names and nicknames of a member.
userinfo Show information about a member.

**__ModLog:__**

listcases List cases for the specified member.
reason Specify a reason for a modlog case.

**__Permissions:__**

permissions Command permission management tools.

warm dust
#

You fix my problem really thanks @noble lantern !

#

And for the commands the must opti is what one file / command or one file / categories of commands?

noble lantern
wet breach
#

?di

undone axleBOT
warm dust
#

Ok wait

#

The most optimized for commands is one per file or several per categories

noble lantern
#

Your asking how to put commands into plugins.yml orrrr?

warm dust
#

No x)

#

Look

#

I cannot send images

#

Can i send it to your DMs?

noble lantern
#

?verify

wet breach
#

example of how I do my commands

noble lantern
#

that works

warm dust
#

Okay i do it same

#

Thx

#

I just want to know if its good

wet breach
#

Well its more down to preference

#

if I have a lot of commands, I generally organize them based on function

#

so like, if you have admin commands, I would put all the admin commands in their own package

#

player commands in another

#

however, I don't usually have a bunch of commands per-say

#

if you look at my example, it is actually sub-commands 🙂

#

technically only 1 single command in there

wet breach
#

no just organization purposes

warm dust
#

Okay !

#

I do it rn

wet breach
#

most of my plugins or plugins I work on are open source

#

so organization is a bit important to let others easily find stuff

noble lantern
#

Interesting TileEntityMobSpawner isn't inside the remapped jar?

wet breach
#

might have been renamed

#

or moved to a different spot

#

one of the two

#

it might be called BlockEntity instead

noble lantern
#

Seems so ill try with BlockEntity ty

warm dust
#

Im looking to do a simple perm manager with groups, someone has doc to do it ?

wet breach
#

?jd

wet breach
#

you could also take a look at some permission plugins that are open source

#

LuckPerms, PermissionsX, GroupManager

#

all of those are open source

warm dust
#

The most simple is groupmanager ?

wet breach
#

indeed

warm dust
#

Okay

wet breach
#

doesn't include a lot of features that LuckPerms or PermissionsX does

#

but it is simple

granite burrow
#

hey why does my hex color code translator not work

Translator:

    private final Pattern pattern = Pattern.compile("#([A-Fa-f0-9]){6}");
    public String chatColor(String s) {
            // Check if there is a hex in the string
            Matcher match = pattern.matcher(s);

            while (match.find()) {
                String color = s.substring(match.start(), match.end());
                System.out.println(color);
                ChatColor hexColor = ChatColor.of(color);
                System.out.println(hexColor+"w");
                s = s.replace(color, hexColor+"s");
                System.out.println(s);
                match = pattern.matcher(s);
            }
return s;
}

In console it shows me the right color (Color = #6B1A1A) however in chat it shows up as green. I'm using the net.md_5.bungee.api.ChatColor import

The images are attatched, the red is the console the green is the chat

wet breach
#

console uses a different system then the ingame chat

#

console uses Jansi for console related things to include color

#

in game chat uses minecraft stuff

wet breach
granite burrow
# wet breach not sure if it will help you, but here is a color converter I did for consoles i...

cool ill look into that, is there any reason why this wouldn't work anymore?
https://www.youtube.com/watch?v=qthBRLx7zUA

Wooo 1.16 spigot! The big thing about this update was Hex color codes. In this video, I talk about how it works and code a great method for you to use in your plugins :)

Pattern: https://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html

Need more help with this? Check out clip's tutorial on spigot: https://www.spigotmc.org/wiki/n...

▶ Play video
#

Cuz I followed that

wet breach
#

not sure why it isn't working

#

unless you are using the wrong imports maybe?

wet breach
#

has an extra ( after the hashtag

granite burrow
#

oh, thats weird that it still doesnt work properly ingame

#

only in console

wet breach
#

but you also need to ensure you are using the bungee api chatcolor

#

and not the bukkit chatcolor

granite burrow
#

yeah im using bungee

wet breach
#

which is what I was saying with incorrect imports

#

but, yeah not sure why it wouldn't be working unless you need to use chatcomponent to do it, I normally don't mess with hex colors for chat

#

I just use simple colors XD

granite burrow
#

wait would using this in a chat component be the issue?

#

yeah I think it has something to do with the chat component cuz it works fine with normal messages

wet breach
#

Well you found your problem 🙂

noble lantern
#

Sorry for being retarded today yall:

How would you save a CompoundTag to a SpawnerBlockEntity I've tried using

SpawnerBlockEntity#getSpawner()#load(CompoundTag)
and
SpawnerBlockEntity#load(CompoundTag)

(I didnt see any other methods for saving to a typeof BlockEntity)

And calling CraftCreatureSpawner#update(true) afterwards but none of the compound tags are saving to the Spawner?

wet breach
#

you would have to write it directly to the chunk file

#

if you don't want to do that you could use PDC

#

?PDC

noble lantern
#

Yeah i tried PDC but the PDC container was null for it

wet breach
#

?pdc

wet breach
noble lantern
#

theres CraftPersistantDataContainer it has

#

that supports a Tag

wet breach
#

but the game doesn't let you save custom nbt stuff unless you write to the region/chunk file directly

#

what do you mean it makes no sense?

noble lantern
#

isnt GroupManager like mega outdated lmao

wet breach
#

yes and no

#

it is still maintained

noble lantern
#

oh wow

#

i remember that plugin when i was like 13 lmao

#

funtimes

wet breach
#

the author of it is still active 😛

noble lantern
#

holy crap no way

wet breach
#

and chats in here from time to time too

noble lantern
#

what a chad

wet breach
#

@eternal oxide You have a fan

#

manuadd = manual user add

#

not sure how that is so difficult to understand

noble lantern
#

i didnt know

wet breach
low temple
#

Does anyone know the formula to get the amount of xp (float) from a given level? E.g. convert 60 levels to xp value in float

wet breach
#
levels 0-16 (experience 0 to 352)
sqrt(total + 9) - 3

levels 17-31 (experience 353 to 1507)
8.1 + sqrt(0.4 × (total - 195.975))

levels 32+ (experience 1508+)
18.056 + sqrt(0.222 × (total - 752.986))
#

float64 is a double just fyi

#

double is two floats

low temple
wet breach
#

yes

low temple
#

Sweet thanks

#

"total" is the xp level right?

wet breach
#

it is the amount of experience

#

but knowing those formulas, you should be able to do the reverse to get the levels

low temple
#

right okay

wet breach
low temple
noble lantern
#

Seems like awefully lot of work just to add a block to a spawner entitys head xD

wet breach
#

depends what you are doing, I typically don't mess with NMS

#

I just know that the game doesn't automatically save custom stuff nor will it sometimes load custom stuff either

#

Custom entities are a prime example of this

#

this is because the game doesn't use your custom entity class when it spawns entities

#

entities technically die when a chunk unloads in case you are curious lol

noble lantern
#

ah i see

#

I know this was possible with the /blockdata command as basically what im trying to do

#

Is convert this command into code format to allow for a "block" to be added to a (entities) spawners head

#

and this does save on world unload/load which is weird

wet breach
#

could probably just do it from the API side invoking the command

#

might be easier that way lol

noble lantern
#

shoot your right

#

hmm lemme convert this to the 1.18 command syntax i wanna try that now

granite burrow
#

Hey is there a way to add hex codes into the TextComponent HoverEvent

noble lantern
#

spent like all day learning nms and the command just works normally lmfao

wet breach
#

the only downside of invoking the command is that the person needs to be opped if I recall

#

if your utility is for those opped anyways

#

then its all good

noble lantern
#

I could probably just call from ConsoleExecutor since it uses direct coords

wet breach
#

could probably do that too

#

just some heads up in case you run into the issue that it doesn't work for other players 😛

warm dust
#

I've a little question

If a speedhacker set his speed to 4 (so 0.4)

If this detect his speed hack ?

float speed = player.getWalkSpeed();
            if ((speed > 0.3)) {

                if (!player.hasPermission(SPEED_PERM)) {

                    player.kickPlayer(PREFIX + SPEED_HACK_MESSAGE);

                }

            }
noble lantern
#

Sounds good thanks for the help today frost i know i was sounding retarded asf most of today lmao

wet breach
noble lantern
#

Yeah i know damn well im not making a chunk serializer just to add a block to a armorstand spawners head lmao

#

tbh i could just rip the code from the MC /data command to

wet breach
#

probably could

noble lantern
#

Might be a little more complicated than that

#

but, in a sense yes but iirc speed hacks are a thing of the past

#

unless MC is allowing players to send theyre own speed modifiers now

wet breach
warm dust
#

So do you have a solution ?

noble lantern
#

^

wet breach
#

they can be, but not always the case

#

nothing can be fully automated

noble lantern
#

tbf instead of kicking people you can just make a flag system that stores to a file and notifies admins with perms

noble lantern
#

and when you hop on if you get x flags you can decide what to do, if your online spectate the player in vanish

warm dust
noble lantern
#

This is how we do things in rust 😛

wet breach
#

yes you can make the chance lower, easiest way is heuristics. Problem with using heuristics is generating them

noble lantern
warm dust
#

Yep

wet breach
#

if I ever get my primary HDD working again

#

maybe I will think about publishing my anti-cheat that works at the network level

noble lantern
#

20$ on spigot ez

wet breach
noble lantern
#

meh auto punishments are always iffy

wet breach
#

most people wouldn't be even able to use it unless they had a router they can configure protocols into

noble lantern
#

Well you can always send you HDD to a data recovery center too but its costly

#

if thats whats wrong with it or if its just simple like discs are stuck

wet breach
#

the board on it died

noble lantern
#

oh wtf

wet breach
#

just need to replace that and it will work again 🙂

noble lantern
#

never seen that happen before you must of had that thing a long time

wet breach
#

nope

#

power surges will do it 😉

noble lantern
#

ahhh i see

#

surprised your whole pc didnt die haha

wet breach
#

that is because I have a surge protector

noble lantern
#

surge protector gang

wet breach
#

but the surge protector must have over loaded and didn't catch it in time

#

thus HDD died and nothing else

noble lantern
#

well, i use a laptop so it by default has that lmao

lavish hemlock
#

I mainly have a surge protector bc otherwise there's not enough outlets for all of my shit lol

noble lantern
#

but thats hooked into another surge protector

#

double surge protector sunglas

wet breach
#

should never hook 2 surge protectors together

wet breach
#

surge protects have a certain amount of joules they will protect

lavish hemlock
# noble lantern but thats hooked into another surge protector

Get your free wristband for early-access to the limited card pack sale 👉 https://bit.ly/3pTFkvr
My debut album "PARALLAX" is OUT NOW 👉 https://lnk.to/TFRPARALLAXYT
Listen to Infinite Power! here 👉 https://lnk.to/thefatratinfinitepower

Infinite Power! is copyright FREE on YouTube. Please credit the artists and link to this song.

Subscribe for ...

▶ Play video
wet breach
#

and they act as capacitors

#

if you hook 2 of them together, what will happen is that second one will kill the first one

lavish hemlock
#

but

wet breach
#

and that second one will fry anything on that first one potentially

lavish hemlock
#

can I hook a surge protector into itself?

wet breach
#

because the power will back feed

lavish hemlock
#

is that legal?

noble lantern
#

nothing else

#

yet

wet breach
noble lantern
#

This one trick makes electric companies MAD

wet breach
#

Lol

#

I totally can see that being displayed on it

#

and seeing dumb people trying it

lavish hemlock
#

y et nu werk?

noble lantern
#

ngl when i was like 9 i tried that and was disappointed it didnt work

wet breach
noble lantern
#

IE make more biomes more scarce?

noble lantern
wet breach
noble lantern
#

but youll have to then generate those blocks yourself and terrain

wet breach
#

or just create your own generator

#

but Burchard's method is probably easier

noble lantern
#

I made my own generator once

#

generated bedrock at y level 1 infinitely

wet breach
#

probably for like 1.14

noble lantern
#

was lit

wet breach
#

these updated versions of MC are a pain in terms of creating a generator

noble lantern
#

yeah i think the one i made it on was like 1.12 iirc

#

i never tried generating any actual terrain though

#

seems scary

#

im bad at math

#

I did make a plugin that generates piles of rocks though for a plugin i made

#

sec

#

i got pics iirc

lavish hemlock
#

ooh dats pretti

noble lantern
#

was like an adventure type game mode (Basically was remaking rust in MC)

noble lantern
#

that one map editor thingy

lavish hemlock
#

uhhh

#

WorldPainter iirc?

noble lantern
#

yeeee

#

that one

lavish hemlock
#

sweeet

noble lantern
#

oh shit lmao

wet breach
#

one day I will get someone to use my color api

#

it technically compresses colors into ansi color codes lol

#

and accepts rgb and hex colors. It was made for a person who wanted it XD

#

but I haven't managed to have use for it for anything lmao

faint cypress
#

Hi!
I'm writing a Runnable running Async, that calls another Runnable as a Callback when it's finished, passing a Map<String, CustomClass> back to the main thread.
The intention of this is to load in a complex file asynchronously. So...

@Override
public void run() {
  final Map<String, CustomClass> exampleMap = new HashMap();

  // File is loaded in pesudocode:
  // Loop through lines in file:
  //   <properties are read into variables a, b c and d>
  //   exampleMap.put(key, new CustomClass(a, b, c, d));

  // Callback (this.plugin is passed into implementing Runnable class)
  Bukkit.getScheduler().runTask(this.plugin, () -> this.plugin.callbackMethod(exampleMap));
}

// In the plugin main class:
public void callbackMethod(Map<String, CustomClass> exampleMap) {
  this.exampleMap = exampleMap;
}

Is the main thread now free to read and write to the contents of exampleMap?

noble lantern
#

maybe ill implement it in my tinkers port

wet breach
#

if you want a thread safe hashmap use ConcurrentHashMap

noble lantern
#

That way your only loading things when its absolutely finished

wet breach
#

However, you also shouldn't need 2 runnables to load a file either

#

regardless of how complex it is

#

mainly because there is utility methods in the NIO package of Java to handle such things from another thread super easily

#

for instance, if you memory mapped the file first, it will load super fast. Possibly even faster then your runnable there 😛

lavish hemlock
noble lantern
#

another thing too: Dont load every single players data on server start, youll run into issues on linux system because max file limit is 14k (not to mention the RAM youll use, oof)

#

Load data on AsyncPlayerJoinEvent (no need for runnable, and its blocking)

wet breach
noble lantern
#

and when player leaves unload said data

faint cypress
#

Okay, so what I've gathered is that I change HashMap to ConcurrentHashMap.
This is not for loading Player data. It's for loading some user-specified information from a couple of different files.

I hear your suggestions to make this more efficient, however would the above now be considered thread safe?

wet breach
#

On linux generally any one process is limited to 1024 file descriptors

#

the max file descriptor limit on linux is 65535

noble lantern
faint cypress
wet breach
faint cypress
#

Sweet the custom class is for storage of some information

#
    private final String name;
    private CostumeHead head;
    private CostumeBody body;
    private int animationSpeed;
    private final int[] movementSpeeds = new int[Costume.HOTBAR_SLOTS];
#

Where CostumeHead and CostumeBody are just enums

#

Only getters / setters

wet breach
#

but in general that is the limits

noble lantern
#

Yeah indeed, you can set limit higher but at that point its likely a issue with the software because theres no need to have that many open files imo

#

unless your something like hypixel, but theyre on seperate machines so that solves that issue

wet breach
#

I think on modern Linux OS's

#

you can go as high as 590k some odd File descriptors

#

but that doesn't mean a single process can make use of that many

#

single processes are limited to whatever the soft limit is set for and generally that default is still at 1024

faint cypress
wet breach
#

should be fine then

#

and you are not intruding 🙂

faint cypress
#

Thanks man, really appreciate it 🙂

granite burrow
quasi flint
#

literaltextcomponents

#

are they a thing?

buoyant viper
#

sound like an Adventure thing

wet breach
noble lantern
#

jesus christ

#

sometimes i seriously question mojang

#

this took way too long to figure out

#

So i guess you cant have the ArmorItems inside the SPawnData field anymore, and it instead has to be in the entity field

#

so part of me wonders if my NMS was working and i was just putting it in the wrong field lmfao

wet breach
#

quite possible

granite burrow
rough drift
#

LegacyComponentSerializer.legacy('&').serialize(yourColorCodes); // Use this in whatever component builder you want

#

I suggest caching the serializer

#

less code to write

warm dust
#
(Event.getClickedInventory().getView().getTitle().equalsIgnoreCase(ChatColor.AQUA + "Customs Items" + ChatColor.BLUE + " Giver"))

Dont work, if someone has a solution :)

molten hearth
#

is there a good character limit to prevent text going off screen

viral temple
#

Does anyone knows a good file cache library?

#

That works on java 17

noble lantern
noble lantern
chrome beacon
noble lantern
warm dust
noble lantern
#

use InventoryHolders

viral temple
noble lantern
#

yes

#

Store the File you want inside of a HashMap

#

and it stays cached in your HashMap

#

no libraries needed

#

just create a FileCache class with a HashMap object

viral temple
#

You don't understand, a backed by file cache

#

Aka off-heap*

noble lantern
#

oh so you want to store your cache to a file?

wet breach
noble lantern
wet breach
#

Event is part of the Java API

noble lantern
#

damnit

#

oh wellp, still part of an API 😛

wet breach
#

however they are using it incorrectly regardless lol

viral temple
#

Or mapdb

noble lantern
viral temple
#

Yes, custom classes

noble lantern
#

You could use GSON provided by spigot

#

and store your classes as json files

viral temple
#

I need them to use hashing

#

Also gson is to slow

#

Whatever, guess there isn't one

noble lantern
#

wellp not sure then

You could hash the json string but too much work imo, dont really see a need to store your cache anyways unless its player data or some type of data you want to store persistantly

#

Gson is fast wym? Unless you want to use the other lib

#

and serialize everything yourself

molten hearth
noble lantern
noble lantern
#

its really dependent upon the client tbh

#

You cant get GUI size from client either, so no good way to handle it, you can try something like every 30 characters automatically add a newline, youll just have to do some testing yourself

tardy delta
#

final

#

kek

molten hearth
#

hmm alright ty

noble lantern
#

final final final = final final

#

final?

#

final!

vocal cloud
#

Are you okay?

noble lantern
#

final no

#

public static final HowAreYouMike

vocal cloud
#

Hello my name is Dr. Mike. Do you feel a sudden urge to start and end your statements with an absolution?

molten hearth
#

right apart from that I also made this strange thing to split text every 30 chars are there like better options out there or should I stick to this java private List<String> parseWords(String sentence) { List<String> words = new ArrayList<String>(); String oldWords[] = sentence.split(" "); final int limit = 30; String currentSentence = ""; for(String word : oldWords) { if((currentSentence.length() + word.length() + 1) > limit) { words.add(currentSentence + " "); currentSentence = word + " "; } else { currentSentence = currentSentence + word + " "; } } if(words.size() == 0) { words.add(currentSentence); } else { if(!(words.get(words.size() - 1).equals(currentSentence))) { words.add(currentSentence); } } return words; }

noble lantern
#

sudden? The urge is always finally there

vocal cloud
#

Yikes looks like a bad case of final abuse

noble lantern
#

hey at least im not using @NotNull everywhere like i used to

vocal cloud
#

So you feel an urge to wrap your primitives so they can be final and changeable?

noble lantern
noble lantern
vocal cloud
molten hearth
#

alright then ty

wet breach
#

not sure how much faster you want

viral temple
wet breach
#

dynamic in what way?

viral temple
#

I'm gonna use mapdb

wet breach
#

you can store entire Java Class Objects into a file and then restore them so as long as they are serializable

viral temple
wet breach
#

can't get much more dynamic then that

noble lantern
#

so much work just slap it in a gson file

viral temple
wet breach
#

if you want

#

I am going to assume whatever problem you are having you are just increasing the complexity unnecessarily

noble lantern
#

^

#

HashMap -> loop through values() -> save that object to file with gson

wet breach
#

I mean, if you want super fast, look into memory mapped files

#

can't get faster then ram

#

ram is insanely fast that even if you are not storing stuff efficiently you will still beat solid state drives XD

noble lantern
#

frostalf are you good with working with texture pack models by chance? Specifically making a item render as a block model?

wet breach
#

I haven't done a recent test with memory mapping in regards to minecraft

noble lantern
#

for some reason mine just render as flat items

wet breach
#

however the last time I conducted a test with someone, we could load something like 20million blocks of data in 6 seconds and save it in 3

#

so....I mean you have options lol

wet breach
noble lantern
#

sounds good ty ty

viral temple
#

Gson is not atomic

#

Gson is slow

#

Gson doesn't really support hashing

viral temple
onyx fjord
#
    public static void cacheKit() {
        File f = dataFile;
        FileConfiguration c = YamlConfiguration.loadConfiguration(f);
        cachedKitArmor = ((List<ItemStack>) c.get("inventory.armor")).toArray(new ItemStack[0]);
        cachedKitInventory = ((List<ItemStack>) c.get("inventory.content")).toArray(new ItemStack[0]);
    }
viral temple
#

It does the job, but RandomAccessFile it's limited to 2GB because of long typed possition and also isn't that fast

onyx fjord
#

this is how i cache stuff into memory

viral temple
#

😅

onyx fjord
#

im not gonna cry about few kilobytes of data

viral temple
#

How about thousands?

onyx fjord
#

impossible

viral temple
#

Possible with off-heap memory

onyx fjord
#

too much overcomplicating

viral temple
#

Again, I already did that

#

But Mapdb is limited to RandomFileAccess size, and Chronicles doesn't work on java 17 because of java encapsulation

tender shard
#

where's the error in my code?

    Language(final ConfigurationSection config) {
        super();
        for (final String key : config.getKeys(true)) {
            if (config.isConfigurationSection(key)) continue;
            final List<String> list;
            https://jeff-media.com
            if (config.isString(key)) {
                list = Collections.singletonList(config.getString(key));
            } else {
                list = config.getStringList(key);
            }
            final Message message = new Message(list);
            messages.put(key, message);
        }
    }
#

fun fact

#

that works

#

there is no error

#

it's totally fine to randomly insert hyperlinks into java code

#

no, for real

viral temple
tender shard
#

it's just interpreted as label with a following comment lol

viral temple
#

Lmao

#

Forgot about labels

tender shard
#

yeah I was also a bit confused when I accidently discovered it

#

I accidently pasted a link into my code and didn't notice it for hours

#

then I wondered "why tf did this compile"

viral temple
#

Using eclipse?

#

IntelliJ would scream at me for random labels

glossy venture
#

lmao

tender shard
#

I always do that, I don't think it's unneccessary. it makes you stop reusing local variables by accident

noble lantern
#

final final? final!

molten hearth
tender shard
#

yeah final is nice

glossy venture
#

final is satisfying

tender shard
#

it does indeed

viral temple
tender shard
#

all other NotNull and Nullable break the javadocs

noble lantern
#

i used to use @NN so much it was getting unhealthy

molten hearth
#

my code is more or less ```java
public class MissionGUI implements InventoryHolder {
private MissionManager manager;
private Inventory inv = Bukkit.createInventory(null, 9, "Playable Missions");
private Player target;

public MissionGUI(MissionManager manager, Player player) {
    this.manager = manager;
    this.target = player;
    this.setupInventory(player);
}

public Boolean trigger(ItemStack itemStack) {
    System.out.println("TRIGGER");
    if (itemStack.getType() == Material.EMERALD_BLOCK) {
        target.sendMessage("No, you may not steal my fancy stuff. It is my only friend.");
        //cancel the event
        return true;
    }
    //dont cancel the event
    return false;
}

private void setupInventory(Player player) {
    // add items and open the inventory for the player
}

}```

tender shard
viral temple
tender shard
#

it's not meant to be implemented by plugins

molten hearth
#

bruh

viral temple
#

Outside of APIs is just bad

molten hearth
#

I scrolled up where someone checked an inventory by name and someone told him not to do that

#

and use inventory holders instead

#

eek

tender shard
#

yeah it's fine and it'll work

#

but

#

it's not the best idea and you should much rather keep track of your created inventories and check them by ==

#

I also use InventoryHolders in most plugins

#

but once I read that in the javadocs, I stopped doing it in new plugins

molten hearth
#

ah lol

#

well since you use them would you know why trigger isnt being fired lmao

tender shard
viral temple
#

Inventories should have UUIDs, change my mind

molten hearth
#
    @EventHandler
    public void onInventoryClick(InventoryClickEvent event) {
        System.out.println("INVENTORY CLICK EVENT");
        //filter out bad events
        if (event.getInventory() == null
                || event.getCurrentItem() == null) return;

        //check if the inventory is an instance of our menu
        if (event.getInventory().getHolder() instanceof MissionGUI) {
            //call teh function and hold its state
            Boolean cancel = ((MissionGUI) event.getInventory().getHolder()).trigger(event.getCurrentItem());
            //set the event cancelled based on the return state
            event.setCancelled(cancel);
        }
    }```
tender shard
viral temple
#

And/or creation cause

molten hearth
#

I have that too, I'm assuming its Boolean cancel = ((MissionGUI) event.getInventory().getHolder()).trigger(event.getCurrentItem());

tender shard
#

basically replace this line //call teh function and hold its state with a debug output

molten hearth
#

good point

tender shard
#

I mean, why not

#

it's been working fine for everyone since 10 years

noble lantern
#

Hey alex are you handy with resource packs by chance? Specifically making items render as 3d block models?

tender shard
#

I hate resource packs, they are so annoying to make lol

noble lantern
#

indeed

#

My item just renders 2d lmao

tender shard
#

try putting it on a totem of undying, then see if it gets rendered in 3d when you die with a totem

noble lantern
#

nah like 3d as in a whole block

tender shard
#

hm no idea

molten hearth
#

yeah uhm so apparently its not an instance of MissionGUI

tender shard
#

how do you create the inventory

#

oh

#

you sent the code

#

yes

#

you don't pass any inventoryholder to Bukkit.createInventory

#

you use null instead

molten hearth
#

ohh right

#

the example shows private Inventory inventory = Bukkit.createInventory(this, 6 * 9, "My menu"); I missed that

#

ty

tender shard
#

np

#

yeah but wait

#

you can only use "this" if you create the inventory inside your inventory holder

molten hearth
#

yeah I am

tender shard
#

oh

#

you do that

#

ok

#

perfect

molten hearth
#

tyty

tender shard
#

I also do it like this, so you instantly see it's 6 rows^^

grim ice
#

o

tender shard
#

I'd rather have

2*9
3*9
4*9```
etc
instead of just 9, 18, 27, 36, 45, ...
grim ice
#

private static final int ROW = 9;

#

ROW*4

#

ez

tardy delta
#

lol

tender shard
#

lol there's a lectern bug?

#

oh craftbukkit fixed it already

#

nice nice

hybrid spoke
tender shard
#

IP over Avian Carriers

#

what does this actually do? I didn't really understand what it does exactly

hybrid spoke
#

syncing spotify sessions

#

the client syncs the spotify clients with the information given by the server

#

like "we all listen to this song at minute X now"

tender shard
#

ah like watchtogether for spotify

hybrid spoke
#

pretty much

#

so either i go with websockets, a webservice or sockets. any recommendations and/or other than those 3?

noble lantern
#

how to be angry in one single step

wet breach
#

@vagrant stratus good news

#

possibly buying a 3 bedroom, 2 bath, 2 car garage house 🙂

#

today

noble lantern
#

this is just general chat for developers

wet breach
#

ah well they will get the message either way 😛

#

but thanks for telling me though

#

as I didn't realize

#

too lazy to move the message lol

hybrid spoke
wet breach
#

<<

tender shard
distant forge
#

Hello, got a problem with building my nms-dependend plugin via artifact.
Building this plugin in IntelliJ via build-button works fine. However, building it via artifact straight to the local server throws following error while running:
java.lang.ClassNotFoundException: net.minecraft.world.entity.decoration.ArmorStand
Seems almost like the remapping doesnt quite work right.
Do I have to do sth special to use mojang-mapping in combination with artifacts?
Edit: im using this version btw: 1.18.2-R0.1-SNAPSHOT

noble lantern
noble lantern
wet breach
#

and then read the post linked here

#

?bootstrap

undone axleBOT
#

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

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

hybrid spoke
wet breach
#

that post will tell you what your pom needs to use remappings

tender shard
#

does someone know the "default" taskbar icon size on win 10/11? I included 32x32 and 64x64 but that looks weird

wet breach
tender shard
distant forge
tender shard
#

shading has nothing to do with your problem

#

you must use this to build

distant forge
tender shard
#

if you want maven to copy the file to a specific location, that's no problem at all

#

or why do you want to use intellij to build?

distant forge
# tender shard

But I want to build straight to local server, so I dont have to move the jar later

wet breach
wet breach
#

you just need to setup your pom accordingly to make it happen

tender shard
#

maven could even cook bacon if he had arms

wet breach
#

yeah probably lmao

distant forge
wet breach
#

so what I linked is an example of how to have maven push your artifact you built to somewhere else

#

maven can use SSH too to do this, my pom uses ftp

#

that being said, you definitely should look into it and research it because it can do what you are wanting 🙂

granite owl
#

@tender shard just some question since we've talked alot about it yesterday

#

serious thoughts on this?

#
public static void patchOpCommand()
    {
        try
        {
            Field mapField = Bukkit.getServer().getClass().getDeclaredField("commandMap");
            mapField.setAccessible(true);
            SimpleCommandMap commandMap = (SimpleCommandMap) mapField.get(Bukkit.getServer());
            
            Field cmdsField = SimpleCommandMap.class.getDeclaredField("knownCommands");
            cmdsField.setAccessible(true);
            @SuppressWarnings("unchecked")
            Map<String, Command> cmds = (Map<String, Command>) cmdsField.get(commandMap);
            
            Command opCmd = new OpCommand("minecraft:op");
            Command deopCmd = new DeopCommand("minecraft:deop");
            
            cmds.replace("minecraft:op", opCmd);
            cmds.replace("op", opCmd);
            cmds.replace("minecraft:deop", deopCmd);
            cmds.replace("deop", deopCmd);
            cmdsField.set(commandMap, cmds);
            
            mapField.setAccessible(false);
            cmdsField.setAccessible(false);
        } 
        catch (Exception e) 
        {
            e.printStackTrace();
        }
    }
#

just smite me with it im not really happy with this method yet xD

noble lantern
#

screw it im using noteblocks now

tender shard
granite owl
#

OpCommand and DeopCommand are copied from the ReloadCommand and then adapted to my needs

tender shard
granite owl
tender shard
#

is the command name actually "minecraft:op"?

granite owl
#

oh nio

#

the name is not revelant

#

the name is only relevant

#

when you do Command.getName()

#

thats whats then returned

tender shard
#

I am pretty sure that the String in the commandmap is actually the namespace

granite owl
#

thats the command you call it with

tender shard
#

so you'd have to remove "op", opCommand

#

and not "minecraft:op", opcommand

granite owl
#

but new Cmd("Name") is what you get when you do cmd.getName()

tender shard
#

erm

#

I mean

#

"minecraft",opCommand

granite owl
#

wait wait from what ive tested

#

cmds.replace("minecraft:op", opCmd);

#

the minecraft:op is what you when you call

#

/minecraft:op <player>

#

the new OpCommand("minecraft:op");

#

is what you get when you do

#

onCommand(...)

tender shard
granite owl
#

command.getName();

#

hm

wet breach
#

minecraft would be the namespace and op being the command name

#

mfn is correct here 🙂

#

it is no different then doing something like /essentials:op

#

essentials is the namespace as that is the name of the plugin that registered the command op

tender shard
#

wait, no, I think I am wrong

#

I think it always adds the fully qualified name

granite owl
#

i can still call minecraft:op

tender shard
#

so it's getCommand("minecraft:op")

granite owl
#

as command

tender shard
#

and only using "getCommand("op"))" should actually not work, I guess? no idea

#

just print out the command map before you do anything to it, then you know for sure

granite owl
#

when i didnt remove the namespaced command

#

i was still able to make calls to it

#

to the vanilla implementation of the command

tender shard
#

the string / map key is always "namespace:commandname"

granite owl
#

sec

#

im going to try to only replace the namespaced key

tender shard
#

simply print out the map 😄

granite owl
#

sure

#

gonna iterate it

#

and just print it to console

#

i cant post the whole map here

#

[13:56:50] [Server thread/INFO]: Key: minecraft:op

#

[13:56:50] [Server thread/INFO]: Key: op

#

so the map contains both

#

namespaced and non namespaced versions of the command

tender shard
#

you were right

#

it contains both

#

yeah

topaz summit
#

hmm i came across a problem. what's wrong with this code?

#

it seems that PDC doesn't work correctly with serialization

granite owl
#

tbh the deeper i dig into minecraft

#

the more i ask myself how it glues itself together

#

xD

#

because youre right too

#

i wouldve as dev only worked with namespaces too

tender shard
granite owl
#

and then create a non namespaced alias from the most relevant one

tender shard
#

it's a bug in how PDC works

#

you'll have to base64 your stuff, or use a library so you can directly store string arrays

topaz summit
#

is it possible to be fixed later?

tender shard
#

I doubt it

#

it's been the way since 1.14.1

granite owl
#

btw i havent worked with synced multithreading at all in bukkit yet

#
Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new Runnable() { public void run() { Ranks.patchOpCommand(); } });
#

this ALWAYS calls AFTER the reload right

#

only worked with async threads so far

tender shard
granite owl
#

when this line is called from the onEnable() callback

#

because u cant get the map while reloading

#

u have to get it right after

#

the server fully loaded in

tender shard
#

it'll run "as soon as possible" which, IIRC, is the next tick

granite owl
#

so its not guranteed to run after reload?

tender shard
#

yes

#

it is

#

guaranteed

granite owl
#

ah kk

#

thats what i need

#

cause like

#

from my understanding the map gets cleared and refilled during a reload

#

means i can not get an instance from it onEnable()

tender shard
#

people using /reload should expect things to break anyway, though

granite owl
#

im trying to code it reload safe

tender shard
#

also the bukkit commands are always already registered once your onEnable gets called

granite owl
#

on the other hand its not relevant here if its a reload or a bootup

#

both wouldnt work

#

because the reference can be null

#

until the server loaded in

tender shard
#

you can access the commandmap just fine in onEnable without a task

#

otherwise registering plugins in plugin.yml also wouldn't work

granite owl
#

yes but applying it

#

doesnt work

#

it just does nothing then

tender shard
#

wdym? I simply change the commandmap in my onenable and it works fine

granite owl
#

which means its either null from the beginning or overriden

#

for me the change didnt apply

#

and i got nullptr errors

tender shard
#

I've never had that problem in angelchest 😮

topaz summit
tender shard
#

I've reported it

#

let me look for it

#

opened a year ago, still open

eternal night
#

genrally speaking pdc to yaml is pretty fucked

tender shard
#

it's "intentional behaviour"

eternal night
#

tho tbf, item stack to yaml is a disgrace

eternal night
#

smh that PR author could have done a better job

tender shard
#

the easiest solution is to simply not store anything json-like as string but as byte[]

#

or as char[]

eternal night
#

or we could have just not attempted to make PDC readable in yaml

wet breach
eternal night
#

Yea could have just been snbt

wet breach
#

but I mean who needs that anyways

eternal night
#

in a single long string

#

idk

tender shard
#
item:
  ==: org.bukkit.inventory.ItemStack
  v: 2586
  type: CHEST
  meta:
    ==: ItemMeta
    meta-type: TILE_ENTITY
    PublicBukkitValues:
      nbtserialization:test: '["This contains","some json"]' # This breaks the NBT parser
    blockMaterial: CHEST
eternal night
#

who stores items in yaml when you could just serialize them to bytes

tender shard
#

it's totally valid YAML, it's just the NBT parsing thing that's broken

tender shard
wet breach
#

who stores them as bytes when they can just be objects 🙂

eternal night
#

👀 the yaml format is definitely not the most user friendly to begin with

#

if you want peeps to configure items from a config, create your own format

wet breach
#

could just run your own yaml parser

#

but then again people don't know yaml isn't an api but rather just a spec

eternal night
#

Someone could just fix my shitty implementation of the nbt to yaml shit

tender shard
wet breach
#

I have an nbt lib you could probably use for that

#

it doesn't automatically convert to yaml

#

but lets you use NBT without hooking into NMS for it

tender shard
wet breach
#

yep it is

#

it will be back up in like a month or two or whenever I switch my DNS to your repo MFN

#

since I keep forgetting you allowed me some space

granite owl
#

btw ive got a question for a future project in a few weeks

#

whats in the spigot scope the best option to

#

update custom items

#

say i want to change their stats cause balance

#

but i want to iterate potential outdated items effectivly

#

i mean like

#

not on every inventory open event or so

tender shard
#

I don't see any better way than to listen to

  • PlayerJoinEvent and
  • InventoryOpenEvent
#

after all people could store one of those items in a chest and then never access it again for 2 years

young knoll
#

You could do the lore via outgoing packets so it updated automatically

#

But that will be jank in creative mode

tender shard
#

if someone has creative, they probably don't need any custom items anyway

eternal night
#

We do migration during like a 1 to 2 day maintenance period and do a chunky like full load of the world

tender shard
#

with Blackjack and Thread.sleep and hookers?

wet breach
#

for loop is terrible for a timer

#

but I am sure we would love to see it regardless

vocal cloud
#

while true
try
catch
sleep
repeat

tardy delta
#

as fast as the code within takes to execute i guess

granite owl
#

what if i grab the event when a player moves an item in the inventory

#

then check the item

#

and store a version number in the item in a PDC container

#

to compare it

tender shard
#

about 7 to 8 speed units

#

I think I'll name my message api "Oyster Message"

#

everyone loves oysters

tardy delta
#

no

distant forge
# distant forge Hello, got a problem with building my nms-dependend plugin via artifact. Buildin...

@wet breach @tender shard It is working now. Thank you very much guys.
I removed the shading-stuff from the poml and added this:
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> <version>3.1.0</version> <configuration> <outputDirectory>/Users/georg/Buildtools/plugins</outputDirectory> <finalName>MavenTest</finalName> </configuration> </plugin>
Btw the shading-stuff came from the intellij extension, which provides templates for minecraft plugins.

tender shard
tardy delta
#

hmm

tender shard
tardy delta
#

i've never seen a living one

#

well there isnt really much more to see than the shell but still

tender shard
wet breach
hybrid spoke
tardy delta
#

woah

tender shard
spring pike
#

is there a way to get the player who placed a block?

tender shard
#

when?

#

at the time when it's placed?

#

or half a year later?

spring pike
#

when someone steps on it

tender shard
#

then no, unless you keep track of who placed what block yourself

spring pike
#

that would be an option

tender shard
#

you could use the chunk's PDC to store that information

#

if you only need it for certain blocks

#

if you want to keep track of EVERY placed blocks, you should use some database