#help-development

1 messages · Page 71 of 1

frail swan
#

when a wither spawns with noai it freezes its spawning animation which happens to be on this frame

grim ice
#

so if im not wrong:

  • neural networks whose outputs cannot determine the success of the neural network, but the end result does, needs a Time delayed neural network e.g: for rock paper scissors
marble copper
#

public class SpawnRelocation implements Listener {
@EventHandler
private void onPlayerJoinEvent(PlayerJoinEvent e) {
}

@EventHandler
private void onPlayerChangedWorldEvent(PlayerChangedWorldEvent e) {
}
crude charm
marble copper
#

It changes my nbt

crude charm
#

use ```

tender shard
frail swan
#

dont use a summon command

tender shard
frail swan
#

it needs the spawning animation

drowsy helm
crude charm
#

Would pdc work for what I want? Changing entity size?

marble copper
#

My tag plugin is depend on nbt api

tender shard
#

PDC cannot access vanilla NBT tags

crude charm
#

Ah

tender shard
#

PDC can only access values inside the "BukkitValues" or "PublicBukkitValues" NBT tag

crude charm
#

I see

drowsy helm
#

Not talking about that

marble copper
#

If I use pdc will my tags work and also won't change my crate key nbt on restart?

drowsy helm
#

Nbt shouldnt change on restart

#

You are setting it wrong

marble copper
#

But my crate key doesn't work after restart

drowsy helm
#

Show your code

#

We cant tel by guessing

#

Where are you checking it

marble copper
#

I'm using golden crates

drowsy helm
#

Huh

#

What are you trying to do

#

Make a new key?

crude charm
#

What others? I can't find an entity it works for apart phantom? Slime and MagmaCube

crude charm
#

Aight ill keep looking, I've known for a long time about slimes and magma cubes as they're slime mobs with diff sizes but phantom is interesting

drowsy helm
#

I think phantoms vary the tiniest bit in size

#

Hard to tell when they are barreling at you

crude charm
#

Ah I see, I wouldn't know, I've never played survival before nor beat the game

drowsy helm
#

Funny how most plugin devs dont even play the game

grim ice
#

so if im not wrong:

  • neural networks whose outputs cannot determine the success of the neural network, but the end result does, needs a Time delayed neural network e.g: for rock paper scissors and tic tac toe

since the input will be the last player's game input, and the output will be the AI's choice, but how would it learn?

#

i also dont know whats a time delayed neural network i just heard it from someone

drowsy helm
#

I guess it would have to keep track of the opponents last choice and try and find an algorithm

#

Tic tac toe would be pretty hard I fee

grim ice
#

thats not what i asked for

drowsy helm
#

L

grim ice
#

im saying, how would it train

#

meaning, how would it know if what the AI did is bad

#

or good

drowsy helm
#

It wouldnt

#

Would have to train off of moves made until win or something

crude charm
#

you tell it

grim ice
#

resulted in a loss

#

wait cant i just do smth like dis

if (game lost) {
nn.train(game player's choice, good choice that would result in win)
}

glacial sphinx
#

Can someone tell me how to open a written book in front of the player in 1.12.2 ?

modern vigil
#

Is there a good plugin for generating a template for a minecraft plugin with Kotlin?

#

An IntelliJ plugin

glacial sphinx
#

idk

crude charm
#

Just dont use Kotlin

modern vigil
#

Why not?

#

Why can't I use kotlin?

crude charm
#

You can use it if you really want but you'll have;

0 documentation relating to spigot (you'll have to convert all java code)
No way to efficiently make new projects
Every spigot dev will hate u as we all use java
There is no reason to as Java is amazing
No support here

brave goblet
#

giant phantoms exist 💀

crude charm
brave goblet
#

yup those

#

and some medium sized ones

tardy delta
#

anyone knows how i define a byte array in sql syntax?

#

[1, 2] doesnt seem to work

agile anvil
tardy delta
shadow zinc
#

How can I get the permission node for any command of any plugin?

#

I was thinking of using the CommandMap but then I realised than not all developers assign a permission to each command

#

And that doesn't include subcommands (to my knowledge)

lost matrix
shadow zinc
tender shard
#

luckperms simply gets all registered permissions, it doesn't map them to any commands/subcommands, does it?

shadow zinc
#

well it worked on my plugins and I didn't register any permissions

#

so some wizardry is going on

#

I think Luckperms listens for permission node queries and maps them

#

but that still raises the question of. 1. How do I implement that or 2. How can I recreate that?

tender shard
#

check out the me.lucko.luckperms.bukkit.inject package inside the bukkit module

#

especially the PermissibleInjector class

#

it basically replaces a player's PermissibleBase with the luckperms one

shadow zinc
#

hmm

tender shard
#

do you want to write your own permission plugin, or what do you need this for?

shadow zinc
#

Its really dumb, I want to override the tab completor to exclude all commands that a player doesn't have permission to use

tender shard
#

Then just register your command permissions properly

shadow zinc
#

its not for my plugins

tender shard
#

Ah ok

shadow zinc
#

some developers keep doing that shit and its so annoying

#

All of this seems like a lot for a simple task (getting a commands permission node)

#

But I guess the only way to do it is to listen for a query?

#

Is that why they override the default PermissibleBase?

compact haven
# crude charm You can use it if you really want but you'll have; 0 documentation relating to ...

0 documentation relating to spigot (you'll have to convert all java code)
No way to efficiently make new projects
Every spigot dev will hate u as we all use java
There is no reason to as Java is amazing
No support here

mfw 1) you don't need kotlin documentation because it's completely interop
2) new projects in Kotlin can just be done with a IDEA template or similar (I just do it myself each time)
3) bullshit, not every spigot dev is blind
4) not really
5) lol ok mate

frank kettle
#

Hello. I been making plugins for years for fun but I've noticed that I've always done them in the same way in the past like 5 years(the management of the Main class, instance, how to create the commands, like people use some super(...) class that I've never touched for example) and with this I've always came across several different ways and how everyone does it different than me.

I believe my way of doing plugins are for smaller/simpler plugins but I'm now doing a project that is huge plugins and I don't want it to be bad managed because of my start.

So I'm here to ask if anyone has some written or video tutorial explaining how to exactly do a well created base for a plugin to work smoothly and with examples for commands.

Thank you for your time. 🙏

compact haven
#

anyone who knows kotlin, or any java dev who can decipher a method call which is incredibly similar to their own language can support here

#

it's not like kotlin is banned in help-development

shadow zinc
#

🙏

tardy delta
frank kettle
tardy delta
#

uhh i dont know any specific threads or something but you might just want to google "spigot commandframeworks" or smth

agile anvil
#

Yeah and feel free to have a look at known plugins sources, you'll learn some new ways of programming

tardy delta
#

^^

frank kettle
#

That's where I noticed this different ways but I was looking for something explaining what each part does and what is needed, etc

tardy delta
#

the best way to start writing a solid plugin is by writing code and improving it, writing new code, etc..

frank kettle
#

it's been so many years so I thought there was some good tutorials out there explaining those frameworks

shadow zinc
#

That takes some time though

quiet ice
azure hawk
#

why is this not sending aniything/playing sound

frank kettle
tardy delta
#

abstract your onCommand method away

agile anvil
#

If you've never played with interface and abstract stuff, have a look at it, there are bunch to do with these!

flint coyote
crude charm
#

I was originally checking for it with

if (args.lenth == 0)

and only added the try catch not for testing if that fixes it but I'm still getting an ArrayIndexOutOfBoundsException

public class UpdateGamemode {

//    public GameMode gameMode;
//    public boolean requireClearInventory;
//    public String[] commandArgs;
//    public Player player;
//    public Player target;

    public UpdateGamemode(GameMode gameMode, boolean requireClearInventory, String[] args, Player player, Player target) {

        try {

            if (target == null) {
                player.sendMessage(CC.RED + "That player is not online");
                return;
            }

            if (player.getGameMode() == gameMode) {
                player.sendMessage(CC.RED + "You are already in " + gameMode.toString().toLowerCase() + " mode!");
                return;
            }


            if (requireClearInventory) {
                if (!player.getInventory().isEmpty()) {
                    player.sendMessage(CC.RED + "Your inventory must be clear to enter" + gameMode.toString().toLowerCase() + " mode!");
                    return;
                }

                if (!target.getInventory().isEmpty()) {
                    player.sendMessage(CC.RED + target.getName() + "'s inventory is not empty so they can not be changed into" + gameMode.toString().toLowerCase() + "mode!");
                    return;
                }
            }


            if (args.length == 1) {
                target.setGameMode(gameMode);
                target.sendMessage(CC.GREEN + "Your gamemode has been updated to " + target.getGameMode() + " by " + player.getName());

                Bukkit.broadcast(Survival.STAFF_PREFIX + CC.GREEN + " " + target.getName() +
                        "'s gamemode has been set to " + gameMode.toString().toLowerCase()
                        + " by " + player.getName(), "survival.staff");
                return;
            }


        } catch (ArrayIndexOutOfBoundsException e) {
            player.setGameMode(gameMode);

            player.sendMessage(CC.GREEN + "Your gamemode has been set to " + player.getGameMode().toString().toLowerCase());

            Bukkit.broadcast(Survival.STAFF_PREFIX + CC.GREEN + " " + player.getName() +
                    "has set their gamemode to " + gameMode.toString().toLowerCase(), "survival.staff");
        } 
    }
tardy delta
#

} catch (ArrayIndexOutOfBoundsException e) {

crude charm
#

?

tardy delta
#

lets just check the args length

quasi flint
#

its

#

ourgh

crude charm
agile anvil
tardy delta
#

not as worse as catching nullpointers

agile anvil
#

noobpointer catching

crude charm
#

I dont see why you're making such a big deal out of something that isn't an issue

azure hawk
#

but my friend doesnt hear the sound

agile anvil
#

Yeah, but I mean I'm sure the exception is thrown before the updategamemode method

azure hawk
#

and if he does it i dont hear it to

#

and no we dont have some sound settings disabled

chrome beacon
#

Are they close to you

azure hawk
#

no

chrome beacon
#

That's the issue

agile anvil
#

You have to catch the exception before

#

it's because args[0] is called before the updategamemode

crude charm
#

which still give an error

agile anvil
#

I don't need the method, I need the area where you call the method

#

Well the constructor actually (strange)

crude charm
#
public class GamemodeAdventureCommand implements CommandExecutor {
    @Override
    public boolean onCommand(CommandSender sender, Command command, String s, String[] args) {

        new UpdateGamemode(GameMode.ADVENTURE, true, args, (Player) sender, Bukkit.getPlayerExact(args[0]));
        return true;
    }
}
tardy delta
#

:/

quasi flint
#

wtf

agile anvil
#

You see that args[0] ?

#

That's the problem

azure hawk
quasi flint
#

i smell indexoutofbounds

#

well

crude charm
quasi flint
#

u pass a method

#

smth maybe non existant

#

which

#

java doesn’t particularly like

crude charm
#

So I should pass the code through a method and get the values in a constructor?

agile anvil
#

Few advice:

  • move your UpdateGamemode constructor directly into the command method
  • check the args length before all of that
  • check the player exists
  • sender is not always a player
tardy delta
crude charm
tardy delta
#

sqlite is weird bruh

agile anvil
tardy delta
#

comparing two equal byte arrays and sometimes it matches and sometimes not

#

🤔

agile anvil
#

don't lie to me ^^

eternal night
#

throw away objects are not good

crude charm
chrome beacon
tardy delta
#

but i think its finally working

eternal night
#

that thing has no reason to be an object

chrome beacon
#

Your friend is too far away to hear it

eternal night
#

make it a method

tardy delta
#

a constructor shouldnt be handling a command 👀

agile anvil
tardy delta
#

also why the CC.GREEN instead of ChatColor.GREEN?

crude charm
quasi flint
#

Maybe custom RGB

eternal night
#

no

#

don't pass the vars with a constructor

azure hawk
#

your right

eternal night
#

pass them all to a method

crude charm
#

Ok

eternal night
#

creating an object just to directly throw it away again makes no sense

quasi flint
#

Why not directly to method

crude charm
#

Forgot, typed without thinking

quasi flint
#

Just

#

Wasting memory

tardy delta
#

what about brain memory 🧠

agile anvil
quasi flint
#

And when u checked there

agile anvil
#

and this is where the error should bring you actually

quasi flint
#

U can just delete the check in the updateGamemoee method

#

As your check already ran

tardy delta
agile anvil
quasi flint
#

Oh yea

#

Brainfart

eternal oxide
#

Thats annoying and bannable

quasi flint
#

Who tf is making all these reactions

brave goblet
#

there is no rule against it

eternal oxide
#

There is

brave goblet
#

oh?

quasi flint
brave goblet
#

alrighty

#

am done

tardy delta
#

/ban 728562222162247760 3D emoji spam

quasi flint
#

Ah yes

brave goblet
#

/ban 583252968497872900 no

quasi flint
#

The undercover mod

brave goblet
#

I read through the rules where does it say no emoji spam as reactions? or in general

tardy delta
#

cafebabe doesnt know yet

quasi flint
#

@undone axle wake up

#

XD

tardy delta
reef lagoon
#

Snitch

brave goblet
#

🤔

tardy delta
#

love how sqlite saves my uuid

quasi flint
#

Just don't and done

reef lagoon
#

love how java turns characters into the weirdest unicodes ever

tardy delta
#

i fucked up and now i can remove my whole database 💀

#

its comparing strings with byte arrays pff

#

that took me two days

brave goblet
tardy delta
#

no

brave goblet
#

all future and previous messages

tardy delta
echo basalt
brave goblet
reef lagoon
#

I'm aware, and it adds to that so it turns from \u00001 to something else

tardy delta
#

you can do .mode quote and then it shows them like this 💀

reef lagoon
#

the overuse of 💀 is crazy

ivory sleet
#

?kick @brave goblet reaction spam

undone axleBOT
#

Done. That felt good.

tardy delta
#

oof

#

btw hello conclure 👐

azure hawk
eternal oxide
#

Careful mrrioes you were in that too

golden turret
tardy delta
#

chat is weird today

open siren
#

How do I tag someone? I mean, how do I make it detect if the player has a tag like "test".

echo basalt
#

permission nodes can be a thing

#

or pdc

open siren
#

some code?

#

do you have

#

?

tardy delta
#

?pdc

tardy delta
#

pdc entries would consist of a key value pair so maybe permissions are better

chrome beacon
#

pdc is better

#

You won't run in to people with * perm or being op

tardy delta
#

both are weird ye

small current
#

how can i cancel creative middle click clone

agile anvil
#

You can't, it's client side stuff

#

But you can remove the items once he drops it or place it in the inventory

small current
#

can i cancel the nbt copy ?

agile anvil
#

What do you mean ?

chrome beacon
glossy venture
steep surge
#

How can I exceed the 16 characters limit in scoreboard title? I have seen other plugins achieve this, making the limit 32 characters

sly surge
#

This limit was removed in 1.13

steep surge
#

And so Im using 1.12

sly surge
golden turret
#

then fork spigot and create your own fast version

#

thank you

quasi flint
#

time for yet another fork

#

or just

#

use c++

#

to make it

#

better yet

#

brainfuck

reef brook
steep surge
#

Im completely fine with that since the moment I set it to run in offline mode

quasi flint
#

i still think he will use 1.8

quasi flint
#

😄

steep surge
#

Sure, then why does spigot have the option to support it?

#

Convincing is pointless. Numbers dont lie. 0.7 seconds vs 4.6 seconds is a goddamn huge difference

sly surge
quasi flint
#

because it doesnt need to provide an option

steep surge
#

Load times

agile anvil
#

who cares, your name is even longer to read

#

update to last version 🙂

quasi flint
#

the circle has completed

glossy venture
reef brook
glossy venture
#

it removes the limit

steep surge
glossy venture
#

but its still an older version

#

oh

quasi flint
#

but still

#

the point stands

steep surge
#

In my nation, the ratio of paid to cracked version of minecraft could easily be 1:1000, that is why I run offline mode

sly surge
golden turret
#

i think it has

#

65535

#

or something like this

glossy venture
#

why not just make it flexible

quasi flint
#

lets just stop guys

#

we got a pirate

golden turret
#

no

reef brook
glossy venture
#

put integer of length of string and then add the utf8 bytes in the packet

steep surge
quasi flint
#

offline-mode

agile anvil
golden turret
glossy venture
golden turret
#

and how online-mode: true will fix his problems?

glossy venture
#

yeah

#

who the fuck cares

steep surge
#

Ah yes, unfortunatelly, I have paid for my copy of minecraft. Not just once. Maybe a bit of reading would give you insight of my situation, but apparently that is not what smart people do. I never said I play on cracked copy.

quasi flint
#

ah i will just leave this as is

#

tho hackers will prob have fun with cracked mode

glossy venture
#

yeah thats a problem

#

and any name

#

but if you are willing to deal with that sure use offline mode idc

sly surge
steep surge
#

So it is literally not possible to exceed in 1.12?

quasi flint
#

hardly

steep surge
#

Featherboard does that

sly surge
quasi flint
#

u could try hacky nms

glossy venture
quasi flint
#

or spigot patches

glossy venture
#

idk why they would make a limit if itwasnt for packet size

quasi flint
glossy venture
#

yeah

#

so i dont think packets will work

quasi flint
#

i stated my concerns on offline mode enough for the next week 😄

glossy venture
#

lmao

steep surge
#

I do not need to update the imported jar in intellij idea from 1.12 to the latest one, right? If I just go with the long name and update the server it will work, or?

glossy venture
steep surge
glossy venture
quasi flint
#

i live happily in germany

#

thank you

glossy venture
#

assuming your intent is to keep the server version low for performance but allow newer clients

tardy delta
#

tutorials be like

#

just looking for ideas for my plugin lol

glossy venture
#

wtf

glossy venture
#

yeah

#

i assume hes using that

steep surge
#

Could ViaBackwards/Rewind prevent me from exceeding the limit, actually?

glossy venture
#

1.12 server -> 1.12 protocol -> 1.12 limits

quasi flint
#

same for 1.13

steep surge
#

Yeah, but I got the same error with 1.13, as I mentioned

glossy venture
quasi flint
#

1.13.2

#

not 1

steep surge
#

yeah

quasi flint
#

not 0

steep surge
#

.2

quasi flint
#

try newest 1.14

#

tho performance is terrible till 1.16 there

glossy venture
#

can you send the error

steep surge
glossy venture
#

true

quasi flint
#

Yea, but got better till 1.19

glossy venture
#

true

steep surge
glossy venture
#

they tested 2b2t on 1.16 and 1.18 i think

sly surge
#

In my experience, the performance of 1.19 is much better than 1.18, you should try

glossy venture
#

it ran fine

#

sometimes even 20 tps

tardy delta
#

does anyone know if i can set the output location for maven package to some remote server folder?

glossy venture
#

i recommend using gradle because of the programmablility

agile anvil
#

true

steep surge
#

I mean, Im willing to update my lobby servers, I will just have to live with it, but with minigame servers, I either will sacrifice load times or features

tardy delta
#

no

glossy venture
#

its nice

sly surge
tardy delta
#

idk how to do that in java lmaoo

glossy venture
agile anvil
#

I don't understand why all servers keep all version compatibility and 1.8 pvp. It has been now 10 years since we see that. we want something different now

glossy venture
#

yeah

agile anvil
#

No one really tried to exploit the new pvp

#

Except some servers which did an awesome work

#

I saw a Skywars like that, it's so pleasing

quasi flint
#

i judt wrote a fabric mod to port Combat Test Snapshot behaviour to 1.19

#

it was a pain

steep surge
#

java.lang.IllegalArgumentException: The name '§b§lTesting server' is longer than the limit of 16 characters

reef brook
agile anvil
#

Is the Combat Test Snapshot really great? I haven't tested this pvp

steep surge
#

yup

quasi flint
glossy venture
#

maybe bukkit didnt change it

#

try nms fuckery

steep surge
#

just to make sure, * after the plugin name means it is in some compatibility mode or something?

reef brook
agile anvil
#

But I hate this idea of making a 1.8 server possible for every version, we want the 1.19 features not the old school 1.8

agile anvil
reef brook
quasi flint
#

for those who cling to it

#

prob yes

#

or just

#

live with new pvp

#

or use my fabric mod :>

sly surge
agile anvil
#

That's the point: no one want to feature the new pvp because they think all the players will ignore it

quasi flint
#

curseforge doing curse things

quasi flint
quasi flint
quasi flint
agile anvil
#

Indeed it's really different, but it creates much more meechanics

sly surge
sly surge
steep surge
agile anvil
glossy venture
quasi flint
#

just know

#

its still wip

#

the qult mod

steep surge
#

                        for( Objective objective : scb.getObjectives( ) ) {

                            objective.unregister( );

                        }

                        Objective test = scb.registerNewObjective( "§b§lTesting server", "dummy" );
                        test.setDisplaySlot( DisplaySlot.SIDEBAR );
                        Score stest = test.getScore( "magic sauce" );
                        stest.setScore( 1 );```
quaint mantle
#

is there a way to check if a player is looking west

glossy venture
#

thats not the display name

#

thats the internal id

#

you need Objective#setDisplayName

steep surge
#

oh so the objective name IS limited to 16?

glossy venture
#

yes

steep surge
#

jesus christ

glossy venture
#

but not the display name

#

which is what you want to change

sly surge
steep surge
#

He left with 1.13

#

Or maybe with 1.9

#

didnt like the pvp

glossy venture
#

lmfao

sly surge
#

🤣

quasi flint
#

@sly surge @agile anvil there is a testserver for it. i will dm u both it so u can pvp each other

glossy venture
#

jezus is more of a 1.7 player

steep surge
#

block hitting it was?

steep surge
quasi flint
# agile anvil Amazing

i personally am proud of how well it turned out. the community of playing this snapshot every day said it was 98% accurate

#

we even had to unfuck

#

minecraft code

#

as it contained bugs

steep surge
#

I wonder what was Notch thinking when he was choosing a language to write minecraft in

#

together with the protocol

#

Im gonna ask this one ahead, you guys think 1.5.2 forge will connect to latest bungee/waterfall just fine?

agile anvil
#

And the protocol was find on the begginning

#

It's just that it never changed ^^

steep surge
eternal night
#

my minecraft runs pretty damn well o.O

steep surge
#

Well, its a voxel game afterall

eternal night
#

Well then what is the issue in choosing that language xD

steep surge
#

Drop a few big mods in and see the fps then 😄

eternal night
#

I mean, drop a few performance enhancement mods in and see it go up

steep surge
#

I guess that would work out

#

I havent even played the latest version tho

eternal night
#

tbf, to some degree I'd argue that choosing another language may have actively slowed down/prevented minecrafts popularity

#

so many people learn java, the entire modding scene would be a lot smaller

#

same for plugins on servers etc

steep surge
#

Well, it is true that c++ is less common

eternal night
#

cpp is also just, a lot less friendly

steep surge
#

I have learned javascript as my first language, to me everything is a lot less friendly ngl

#

Maybe lua would be good

eternal night
#

lua is pain

steep surge
#

I will make my own programming language

#

Call it English 2.0

#

maybe that would be easy enough

eternal night
#

I mean java worked our really well

#

not to mention the huge performance gains in java on the horizon

#

that will certainly benefit game development in java

steep surge
#

Well, if you look at it realistically, it worked amazingly, but looking at from our current standpoint.. well

#

The game would probably still perform better if rewritten in a c++ and a java plugin/mod interface would be introduced ngl

#

Maybe not so much on the server side

eternal night
#

Well, you can see how well even a plain rewrite worked out in bedrock

steep surge
#

Its microsoft...

eternal night
#

the version has enough bugs and issues for days to come

#

ah yes

#

microsoft

tardy delta
#

how is the world of a location null :/

#

got it via Player::getLocation

steep surge
eternal night
#

how is your self-developed OS doing ?

#

point being, things are not pretty easy, you have to also obviously respect the business side of things

eternal night
#

generally speaking, locations can have a null world

#

but if you grabbed it from a live player object that should not happen

tardy delta
#

uhh well actually, its for a home command, which creates a home object with the players location and the name etc, i later dereference it when saving it to the database

#

i created that home on the overworld and that world is still loaded :/

steep surge
#

Am I the only one who doesnt see any problem?

#

You could try to get players world and set the location to his current one

tardy delta
#

when creating a new home it seems to work

steep surge
#

Well, Im clueless

eternal night
#

what do you mean, when creating a new home

outer river
#

hello, i'm trying to save all section created in a config.yml files that contains "name:"(String) and in it "commands:"(StringList) and it send me this error for each "name:" & "commands:"...
Here is my methode:

public void saveConfig() {
            for (String section : getConfig().getConfigurationSection("Rewards").getKeys(false)) {
                String name = getConfig().getString(section + "name");
                if (name != null && getConfig().getStringList("Rewards.name.commands") != null) {
                        List<String> commands = getConfig().getStringList(name + ".commands");
                        rewards.put(name, commands);
                }    
            }        
    }
tardy delta
#

created a new home object and saved it, so the location::getworld::getUID is called

eternal night
#

and that seems to work ?

tardy delta
#

ugh when reloading server world is back null

eternal night
#

that just sounds like you are fucking up loading

tardy delta
#

is that cuz world reloading or smth?

kind hatch
eternal night
steep surge
#

Any ref of an unloaded world will throw an error so it has to be loading

tardy delta
#

i'm still on the world so that doesnt seem to be unloaded :/

eternal night
#

how do you load it from disk/db

#

if things work when you create it but then don't work once you reload the homes from the DB

#

your issue would be in said loading logic

tardy delta
eternal night
#

wtf are you doing with name based uuids

tardy delta
#

im saving those as a byte array to the db

eternal night
#

interesting concerning that named uuids are type 3

tardy delta
#

and that factory methods creates back an uuid from those bytes

eternal night
#

and worlds and everything else uses v4 uuids

tardy delta
#

uhh it works lol

eternal night
#

does it ?

steep surge
#

Is it because Im a shit java developer or is his code actually clean af for some reason?

tardy delta
#

not for the homes 😂

#

lemme show how i save uuids

#

that might be the reason why it breaks

#

lemme print out world after loading

eternal night
#

just properly reconstruct the uuid from a byte array

#

beyond that, by default byte buffer uses big endian

tardy delta
#

uh oh stackoverflow ig

steep surge
#

what does ig stand for, except instagram

eternal night
#

"i guess"

#

beyond that ```java
final byte[] uuids = ByteBuffer.allocate(16)
.putLong(random4.getMostSignificantBits())
.putLong(random4.getLeastSignificantBits())
.flip()
.array();

#

for a one liner

tardy delta
#

that would work for both v3 and v4 uuids?

#

"random4"

eternal night
#

yes

#
private static UUID fromBytes(byte[] bytes) {
    final ByteBuffer buffer = ByteBuffer.wrap(bytes);
    return new UUID(buffer.getLong(), buffer.getLong());
}

private static byte[] toBytes(UUID uuid) {
    return ByteBuffer.allocate(16)
        .putLong(uuid.getMostSignificantBits())
        .putLong(uuid.getLeastSignificantBits())
        .flip()
        .array();
}
lost matrix
tardy delta
#

not sqlite

#

so im savving it as a blob (byte array)

#

tried it

lost matrix
#

Does SQLite have a codec?

tardy delta
#

a what :/

steep surge
#

Do ChatColor variables represent a single character or more or tf is that even

lost matrix
#

They represent a ChatColor

steep surge
#

Aaaand when used in a string?

tardy delta
#

the § thing and your color char

steep surge
#

oh right

crimson scarab
#

is it possible to cancel projectile hit event and make the projcetile bounce

steep surge
tardy delta
#

ah

lost matrix
steep surge
#

Well, Im not, but I was thinking perhaps they are a single character when converted to a string

lost matrix
#

I mean if you are on older versions then they represent a single char prepended with §
So a white name would be "§fSomeName

steep surge
#

Unfortunate

#

Goddamn mojang

eternal night
#

components

quiet ice
ancient plank
#

I'm a fan of components in most situations and rarely I get slightly annoyed

eternal night
#

oh

#

yea you only need the flip if you pass it around

#

nice catch

quiet ice
#

I mean flipping may make sense if you have different endianess, but at that point you'd also want to flip the mostSig/leastSig bits

eternal night
#

I mean, you usually flip it if you want to read the stuff you threw into it right afterwards

#

flip is not really flip

quiet ice
#

Ah, just changes the read order? That is lame.

eternal night
#

Flips this buffer. The limit is set to the current position and then the position is set to zero. If the mark is defined then it is discarded.

quiet ice
#

That does not define whether the underlying array is modified or not

#

Which I assume it would because otherwise you'd be dealing with pretty complex logic there

#

Does anyone know of an efficent way to perform ant-like property placeholder replacements?
So like replacing the string ${groupId}:${artifactId} becomes my.group:artifact for the Map ["groupId": "my.group", "artifactId": "artifact"]

#

While yes - I could iterate over each entry in the map and replace it manually I'd rather not do it given that I have no control over the size of it

eternal night
#
final var buffer = ByteBuffer.allocate(2);
buffer.put((byte) 5);
buffer.put((byte) -5);

System.out.println(Arrays.toString(buffer.array()));
System.out.println(Arrays.toString(buffer.flip().array()));

yields

[5, -5]
[5, -5]
#

so at least the underlying array isn't mutated

#

adding a

System.out.println(buffer.get() + ", " + buffer.get());

after the flip also yields

5, -5
quiet ice
#

good to note

steep surge
#

Um.. is string "" equal to another string "", I cant really explain this well

tardy delta
#

looks like the whole uuid thing is working

#

"".equals("") -> true

#

"" == "" also true afaik

eternal night
#

Yea "" == ""

steep surge
#

then tf am I doing wrong

opal juniper
#

there is equalsIgnoreCase

tardy delta
#

;==;

quiet ice
#

Only if they are interned

eternal night
#

well "" == "" only because of a quirk

tardy delta
eternal night
#

you should never compare strings using ==

steep surge
#

its comparing memory locations isnt it

tardy delta
#

== is

opal juniper
#

objects

quiet ice
tardy delta
#

ye

eternal night
#

string pool lifestyle

steep surge
#

i mean

quiet ice
#

*Constant pool

opal juniper
#

let’s all use python

tardy delta
#

and "" == "" is true cuz of string pool right

#

or constant pool idk

quiet ice
#

*Constant pool

steep surge
#

even "l" == "l" wont return true will it

eternal night
#

it would

opal juniper
#

cause it gets them from the pool

quiet ice
steep surge
#

Aaaaaah

quiet ice
#

or if both are .intern()'d (which puts them in the constant pool)

tardy delta
#

literal strings are supposed to be in the pool iirc

eternal night
#

interned strings 🙏

tardy delta
#

does ::intern() place them in the pool or smth?

eternal night
#

killing performance one day at a time

steep surge
#

So when set to a variable they wont be equal

tardy delta
#

memory leaks 😎

quiet ice
eternal night
#

doesn't spigot still use intern

quiet ice
#

Hence the name - it's an internal operation for the JRE to use

eternal night
#

yea they do lol

tardy delta
#

well @eternal night thanks for helping it works

quiet ice
#

It does make sense if the string is going to be there for the lifetime of the application

#

e.g. plugin names

steep surge
#

I havent really given java too much thought, I just noticed sometimes identical strings werent equal so I use .equals() on every occasion

tardy delta
#

Bukkit.getWorld with my weird uuid was returning null

eternal night
#

ah no, they dropped the intern too

#

😭

quiet ice
#

Unless you REALLY know what you are doing

eternal night
#

I have not once ran into a situation where pushing a string into the constant pool is worth it

steep surge
#

Im a javascript user, I just write code and pray to god it works

#

Well, a cpp user, but cpp supports these comparisons

#

although it doesnt support changing the comparison behavior

quiet ice
#

However == is going to be only a bit faster (talking in fractions of nanoseconds there most likely) than .equals because .equals's first op is basically if (this == other) return true;

steep surge
#

but javascript is amazing, it allows you to do shit which breaks the whole thing

eternal night
#

sounds like cpp when you say it like that

steep surge
#

until i can var i = 0; i = ""; i = {} I am unstoppable

steep surge
tardy delta
#

meanwhile js function test(a, b) {} test(1)

quiet ice
#

Issue is that java has a verifier. Unless you make a seperate frame (which is harder than you think in this circumstance) redifining a variable is not going to fly by it. Although you can just cheat the system and internally just use a different variable

steep surge
#

true shit

frank kettle
#

Anyone knows what's the max characters size for a Sign line?

I'm trying to change the sign line text but if it's too much length it doesn't insert the last word(s).

quiet ice
#

The verifier is the culprit IMO

unique shuttle
#

"1" + "1" = "11"

steep surge
unique shuttle
#

xD

grim ice
#

js dumb

#

why would it automatically cast a string to a number

#

if it only has numbers

steep surge
#

I meant, it wont return 2 but...

#

It wont cast a string into a number automatically

#

but "1" + "1" == 2 looks like something javascript could do

#

if someone sent me this I probs wouldnt look twice at it lmao

#

But hey, everything is an object

#

Some hate it, some love it, I personally love it

bronze notch
#

Is there an alternative for PlayerInteractEvent#getClickedBlock() in 1.14?

steep surge
#

was that dropped?

eternal night
#

not all API methods existed years ago when 1.14 was relevant

bronze notch
#

I know, but I see now that it DID exist, but my IDE can't find it 😛

bronze notch
#

Haha @steep surge

eternal night
#

hope someone finds an exploits and RCE your ass

steep surge
#

The latest version for me is 1.12.2

#

I believe I havent even downloaded 1.16 yet

bronze notch
#

Oh @eternal night I found the issue, thanks anyway

eternal night
#

sweet 👍

eternal night
quiet ice
#

For bukkit 1.14 is the oldest bearable version

steep surge
eternal night
#

sounds more like masochism

steep surge
#

oh

quiet ice
#

Yeah in this case it's not that you annoy other people (which you still do), but rather that you will shoot yourself in the foot

steep surge
#

with 1.8?

#

I mean

eternal night
#

with 1.8.8 more like, in the foot, head, and chest

quiet ice
#

Yes, it has the worst possible API imo

steep surge
#

Aaaah, developmentwise

#

True

quiet ice
#

Especially the material API on that version is 🤮

steep surge
#

But Im not a 1.8.8 player

#

I quit minecraft a while ago, I just decided to make some plugins in my free time

frank kettle
steep surge
#

Although I wont act as if I wasnt playing 1.8 when 1.12.2 was out

quiet ice
#

And another issue with 1.8 is that paper isn't the beast that it is on 1.16+, so -believe it or not- you are suffering from sub-optimal performance

steep surge
#

If speaking of servers, Im using 1.12

#

Basically the last version that performed reasonably for me

#

yo btw a "" string from my array is not equal to "" string apparently

quiet ice
#

Eh still a version that does not accept Java 17 by default (unless you disable native transport) so not something I'd use

quiet ice
steep surge
#

new String[ ] { "...", "", "..." }

quiet ice
#

please don't say you got your indices messed up...

steep surge
#

then I for loop it as a string and use .equals( "" )

quiet ice
#

I wanted to see actual code, not pseudo-code

steep surge
#

Ah okay

quiet ice
#

as of now I can only guess where the issue is

outer river
steep surge
#

        Scoreboard scoreboard = player.getScoreboard( );

        for( Objective objective : scoreboard.getObjectives( ) ) {

            objective.unregister( );

        }

        Objective objective = scoreboard.registerNewObjective( "scoreboard", "dummy" );
        objective.setDisplayName( title );
        objective.setDisplaySlot( DisplaySlot.SIDEBAR );

        Score score;
        Integer i = 16;
        Integer rI = 1;

        for( String line : lines ) {

            if( line.equals( "" ) ) {

                System.out.println( "\n\nhaaa\n\n" );

                for( Integer x = 0; x <= rI; x++ ) {

                    line += "§r";

                }

                rI++;

            }

            score = objective.getScore( line );
            score.setScore( i );

            i--;



        }

    }``` - this is the function I compare the variable in
quiet ice
#

Best guesses are messed up indices or invisible 0-width chars

steep surge
#

brb with the array

kind hatch
outer river
quiet ice
#

And how have you determined that line.equals("") is false?

steep surge
#

well, because my haaaa is nowhere to be found

quiet ice
#

ah lol

kind hatch
# outer river

Well, you can't have a parent section with a variable if you have subsections. You would either need to use the name of the parent section itself or add another subsection called name.

quiet ice
#

Yeah then my only guess is that you have a zero-width char (or a special string such as color codes) in the line

steep surge
#

my IDE put spaces in the strings...

quiet ice
#

Wouldn't have happened with eclipse 😎

steep surge
#

Isnt eclipse like 1.8?

quiet ice
steep surge
#

You make me feel old

quiet ice
#

And well using tools from the stone age is the norm for programming

steep surge
#

I dont even have the latest discord installed

quiet ice
#

There is this xkcd about how most people use stone age tech to create bleeding edge stuff

agile anvil
#

That guy is a RCE test box

pine forge
#

Is there any way to parse markdown into minecraft formatting?

steep surge
#

markdown?

quiet ice
#

There is MineDown, but it isn't true markdown syntax iirc

pine forge
steep surge
#

Yeah I know

quiet ice
#

Also Minimessage and whatever - they are all Markdown inspired, so most should have similar syntax

steep surge
#

But

pine forge
#

So i wanna convert that markdown to display correctly in minecraft

quiet ice
#

Minedown is probably your safest bet however

agile anvil
quiet ice
#

Unless you want to operate with headers, list and all that stuff

steep surge
pine forge
pine forge
quiet ice
pine forge
#

Or ill check the code of other plugins :kek:

kind hatch
pine forge
#

you cant use extxernal emojis here?

#

oof

agile anvil
pine forge
pine forge
quiet ice
#

It has nice adventure interop - so it is nice to use on paper servers. No idea about the spigot interop

pine forge
#

is this the default option?

#

So like i dont have to specify open_url

#

that would make sense

#

Actually i dont even need to parse image links

quiet ice
#

That is the advanced syntax

pine forge
#

yeah i know

#

or this rather

#

but italic is this?

#

and not one underscore or one star

#

thats the standard md

quiet ice
#

There is no "standard" markdown

#

Everyone employs their own flavour of markdown

agile anvil
#

Anyone fan of custom ui GUI?

quiet ice
steep surge
#

Hey guys I updated discord

#

they added light mode

pine forge
agile anvil
#

Example:

pine forge
quiet ice
#

Probably was easier to implement. Shouldn't be too hard writing a regex to convert between the two

steep surge
pine forge
agile anvil
pine forge
#

Its kinda insane what you can do with resource packs

#

but just take a look at origin realms

agile anvil
steep surge
#

oh, that is achieved with data packs isnt it

agile anvil
pine forge
#

probably also a plugin additionally

quiet ice
steep surge
#

but you are still prompted to download the rp arent you

kind hatch
#

So, I am wanting to create a GUI where you can change the plugin's language files. As it stands, I have the GUI set up dynamically so that it can detect any new languages added or removed. However, I want the ability to order the languages in the GUI. Anyone have an idea how I could do this without adding extra data to the language files themselves?

agile anvil
agile anvil
quiet ice
#

I'll show you

steep surge
#

json -> commands i guess

quiet ice
steep surge
#

ayo

#

hallo mein freund

#

wie gehts

agile anvil
#

Indeed that's interesting

quiet ice
#

You can also make it interactive with click events and all that stuff

tardy delta
#

gnome 👀

steep surge
#

Thats cool and all but it isnt as clean as guis can be

quiet ice
#

I use it in all my plugins these days

steep surge
#

what a chad

tardy delta
#

im a kde man

quiet ice
#

This is an ancient video

steep surge
#

if it werent for my gpu drivers i would use linux as my daily driver as well

tardy delta
#

actually maybe heard once about that

quiet ice
#

Although I still look back fondly at gnome's stability

#

Although thankfully all my problems with LXDE have magically vanished after not using my computer for 2 weeks

steep surge
#

you just had to get a bit outdated you see

tardy delta
#

ah is lxde the default fedora desktop env?

quiet ice
#

No, gome is. LXDE is just a spin I wanted to try out

tardy delta
#

hmm

quiet ice
#

But yes, it's fedora

agile anvil
steep surge
#

are you shitting me

eternal night
#

fortunaltely not even that hard 🙏

#

tho some better support for that, looking at you bedrock, would be nice

quiet ice
steep surge
#

where are the old good days when having a custom gui in a goddamn forge mod was impressive

agile anvil
#

oops, well MP4 is standard I guess

quiet ice
#

mp4 is just a container

agile anvil
#

right

steep surge
#

but since we were talking about linux already

#

do you recommend gnome over xfce?

quiet ice
agile anvil
#

xfce is very used nowadays

agile anvil
kind hatch
#

Yea, that's the issue with chat based UI

agile anvil
#

It could be great to restore all the missed chat during the interaction after closing

steep surge
kind hatch
tardy delta
#

loud keyboard lmao

steep surge
quiet ice
#

Most servers I've played on had a dead chat so I cannot talk too much about it

agile anvil
outer river
steep surge
#

they either shut it for the entire game

#

or they dont close their mouths

quiet ice
#

Even when two players play at the same time there is 0 interaction

steep surge
#

I used to host a smp for a while and I saw more killed by creeper explosion death messages than you have player interaction

steep surge
#

wdym by order

#

like alphabetically or

tardy delta
steep surge
#

rp server?

tardy delta
#

uh oh im making some kind of kingdoms server

steep surge
#

oh cool

tardy delta
#

where i will be the only player fr

#

nothing better to do

kind hatch
# steep surge wdym by order

Any arbitrary order of the languagues themselves. For instance, instead of sorting alphabetically, I could have a custom order. Smth like
English, Spanish, Russian, Dutch
vs
English, Italian, Spanish, Dutch, Russian

steep surge
tardy delta
#

just implemented some basic skills where you can gain xp

quiet ice
#

I'd sort over locale.getISO3Language();

#

I personally use locale.getISO3Language ALL the time even though it might not be the best for performance but whatever

tardy delta
#

figuring out a way to hide that bossbar after some time tho

#

but get it back when i gain xp

steep surge
#

dunno havent worked with bossbars yet

#

I had an idea of a minigame I think will be fun to play so just like 2 days I got into plugin development xd

#

I consider myself an expert in getting the player object

quiet ice
tardy delta
#

had so many issues implementing persistent storage lol

#

gson fucked up so hard and sqlite decided to do that too

quiet ice
#

So something like

TreeSet<File> file = new TreeSet((f1, f2) -> f1.toString().compareTo(f2.toString()));

before parsing them into a kust

steep surge
kind hatch
steep surge
#

Certainly not the best approach but it does its job just fine

quiet ice
#

TreeSets are the most obvious choice there. If it needs to be concurrent go with ConcurrentSkipListSet

hushed pawn
#

How to understand knockback pvp system? And get exact values of kb multipliers

ancient plank
#

math

agile anvil
#

Dive into minecraft server code 🤿

steep surge
kind hatch
quiet ice
grim ice
#

anyone has an idea to use neural networks in?

quiet ice
agile anvil
hushed pawn
steep surge
quiet ice
#

HashMap is cometimes a good choice, sometimes not

grim ice
#

what

#

lmfao

#

if clients control kb

#

then pvp mc servers would die

quiet ice
#

For example for having a Chunk -> Data - like mapping, HashMap is not ideal performance-wise

agile anvil
kind hatch
quiet ice
grim ice
#

what are you talking about

#

no

hushed pawn
quiet ice
quiet ice
steep surge
quiet ice
#

although for non-player knockback that may be different

kind hatch
quiet ice
steep surge
#

cant on offline modeeeeeee

quiet ice
#

Use UUIDs

#

Unless you are in 1.5 world or whatever

tardy delta
#

🫂

quiet ice
hushed pawn
steep surge
#

Dont you get null as an UUID from a cracked client?

kind hatch
#

Every account has an online and an offline UUID.

steep surge
#

so it would a reliable identifier even for players with cracked clients

quiet ice
#

The offlien UUID is generated a bit like that

eternal oxide
#

Offline UUID is calculated from their name

steep surge
#

Oh thats cool, didnt know that

quiet ice
#

Even in vanilla

kind hatch
# quiet ice Yeah, that would need to be predefined in either a file or in code

One more thing to add on to this. If I make a predefined list of languages and their sort order, what about cases where I add or remove a language from the plugin?

I think adding is easy, something like taking the total amount of language files and then add 1 so that it's last in the list? But, what about removing language files?

steep surge
#

Either way, HashMap<String, Object> for player data, good approach?

quiet ice
tardy delta
#

Map<UUID, PlayerData> he said

quiet ice
#

^

steep surge
#

oh right it has its own class

quiet ice
#

Though don't necessarily use PlayerData

steep surge
#

I just have a native java object there

tardy delta
#

i'm doing a Map<UUID, KingdomsPlayer> to store a playerwrapper thing

quiet ice
cold tartan
#

Is there a way to remove entity AI, keeping their gravity, without using NMS? If not would replacing the entity with a custom one without any goals be feasible? I'm trying to prevent certain entities from causing lag with their pathfinding

steep surge
agile anvil
quiet ice
#

While that approach may be okay for you, it may become problematic once you want to store it persistently

steep surge
quiet ice
#

What are "native java objects" for you?

tardy delta
#

pojos i guess

quiet ice
#

The java/lang packages or are we talking about JNI?

steep surge
#

Object from java.lang

quiet ice
#

For reference "native" usually means native (machine-code) in java space

steep surge
#

oh

#

well thats useful to know

agile anvil
quiet ice
#

well really that isn't the issue

agile anvil
#

I see too much issues on doing that

#

You need more memory, your data is harder to store, manipulate

#

and co

quiet ice
#

Memory is cheap - programmers are not

#

(plus it is a teeny tiny bit faster since you avoided a GETFIELD/INVOKEVIRTUAL op)

steep surge
#

Im not too concerned about memory, afterall there arent gonna be their house schematics stored and about data manipulation, I mean..

#

Its quite easy to just playerdata.get( uuid ).get( "group" ) or whatever

#

it perhaps isnt as clean as it would be with classes but I dont think thats too much of an issue

steep surge
#

what the actual fuck is that class name

quiet ice
#

The best thing about this class is that I wrote it to save memory

quiet ice
agile anvil
steep surge
#

:DDD

steep surge
agile anvil
steep surge
#

Im gonna try my best in explaining then

agile anvil
#

Just show it ^^ like HashMap<....>

steep surge
#

ye ye

sacred basin
#

Hello, I want to know why tab completer doesn't work for capitalized words?

quiet ice
steep surge
#
        players.put( uuid, new Object( ) );```
#

smth like that

agile anvil
#

So if you want to save let's say :

  • it's first login
  • it's last login
#

How do you do?

steep surge
#

on login I retrieve data from mysql

tardy delta
#

just finished my whole loading impl

#

its on gh lol

steep surge
#

oh i see

#

wait

quiet ice
#

Don't ever touch mysql if you have never touched it before

steep surge
#

I have, dont worry

quiet ice
#

Too many people in this channel have issues with database servers

steep surge
#

its just java Im new to

steep surge
agile anvil
#

Yeah

#

You do that ?

quiet ice
#

Yes, but now do it persistently

tardy delta
#

looks like you are doing a map<uuid, map<String, object>> or smth

agile anvil
#

I've never seen that before x) Maybe it's my time to have a coffee

quiet ice
#

Loading and saving is a bit more complicated if you have multiple maps

#

However, you can just strap GSON onto it and call it a day

tardy delta
#

had so many issues with gson

#

i eventually needed so many typeadapters that i gave up

steep surge
#

When the player is joined, I query all this information and store the object until the player disconnects, then I just release it from memory. When something needed to be saved occurs, I just directly save it to the database (mysql)

tardy delta
#

it didnt know what to do with records, weakreferences, custom objects pff

steep surge
#

and of course update the locally stored variables

steep surge
quiet ice
#

Most of the stuff google releases are legacy software

steep surge
#

Actually, would there be any difference if done likewise, geollll?