#help-development

1 messages · Page 761 of 1

rotund ravine
#

Isn’t that a doc pfp?

#

dog

ancient plank
#

Wooks kinda wike a seawion if u wook hawd enuf

rotund ravine
#

It hurts my brian to read that at 5 am wow

wet breach
echo basalt
#

re-reading this, separate classe

#

A command class is exclusively responsible for command behavior

halcyon hemlock
opaque scarab
#

Anyone know a good way to set the damage appearance of an anvil. I don’t know if Google hates me or something, but I can’t find an answer

rotund ravine
#

Damage appearance?

opaque scarab
#

How cracked the anvil appears.

rotund ravine
#

Ah

#

?spigot-jd

#

They’re materials

opaque scarab
#

Thanks

halcyon hemlock
ivory sleet
quaint mantle
#

@wet breach now im getting Check the info you entered. It doesn't match the info for this card whenever I switch my card lol

#

Even tho the detatils 100% correct

#

I have a feeling thats another way of saying card is blocked from being added

wet breach
#

Nice. It probably is another js that needs to be invoked to make it do proper checking. Like it probably doesnt validate until a click or tab key pressed

#

Or it could be what you said

quaint mantle
#

Nah its after the button is clicked to add it

#

I get that

sharp cargo
#

Hello, I'm trying to make a Kits plugin. But the system I made doesn't work at all... Does anyone have an idea?

kits:
  diamond:
    delay: 50
    items:
      - DIAMOND: 1
  iron:
    delay: 30
    items:
      - IRON_SWORD: 1
      - IRON_CHESTPLATE: 1
        if (sender instanceof Player) {
            Player player = (Player) sender;
            if (args.length == 1) {
                String kitName = args[0];
                
                if (main.configKit.contains("kits." + kitName)) {
                    for (String itemName : main.configKit.getStringList("kits." + kitName + ".items")) {
                        int amount = main.configKit.getInt("kits." + kitName + ".items." + itemName);
                        ItemStack itemStack = new ItemStack(Material.getMaterial(itemName), amount);
                        
                        player.getInventory().addItem(itemStack);
                        player.updateInventory();
                    }
                } else {
                    player.sendMessage("Le kit n'existe pas !");
                }
            } else {
                player.sendMessage("Utilisation incorrecte. Utilisez /kit <nomDuKit>");
            }
        }
        
        return true;
#

I have no errors, nothing...

quaint mantle
#

what the hell is this

pseudo hazel
#

whats delay

#

also wtf is main

#

you would usually save items as item stacks, not strings

#

maybe try sending some debug messages to see where it breaks

shadow night
pseudo hazel
#

yeah that too

halcyon hemlock
#

Ok

earnest socket
#

is there any event for when a you draw a block on the map?

#

My server uses custom blocks which are just retextured note blocks

#

I want some way to detect if a note block is being drawn onto a map and if it's a custom block I want to change its color

eternal oxide
#

you mean when a Player places the block?

pseudo hazel
#

im pretty sure maps are rendered client side

eternal oxide
#

I think he's refering to worlds as a map

pseudo hazel
#

ah okay

eternal oxide
#

perhaps not though 🙂

pseudo hazel
#

I got confused by "draw on the map"

eternal oxide
#

same

pseudo hazel
#

I know from modding that each block has a color that is used for drawing the map item maps

#

but idk if spigot exposes any of that

eternal oxide
#

If he is talking about Maps then he's probably going to have to render his own image

earnest socket
#

Maps

#

like the item

eternal oxide
#

Then yes you will have to render your own image to the map

#

there is no event

pseudo hazel
#

or pick base blocks with the color you want

earnest socket
#

I know there is an event for map initialization but can I get the map that would normally be drawn from that event or does it just give you an empty canvas or something like that to draw on

eternal oxide
#

it gives you a MapView

pseudo hazel
#

its probably used to determine what region of the world the map should draw? im not sure

eternal oxide
#

it should be initialized but not drawn yet

#

so it's location shoudl already be set

fluid river
pseudo hazel
#

does anyone know how to change terrain generation such that biomes are smaller, without reinventing terrain generation as a whole?

#

I asked this some time ago but the conclusion was that I basically have to rewrite how minecraft generates biomes

#

and thats not a good solution

fluid river
#

and it's the only one i know fr 🙂

#

you don't need to rewrite entire generator, but probably need to work with BiomeProvider

#

my old post on spigotmc

pseudo hazel
#

well that messes with the biomes only though doesnt it?

fluid river
pseudo hazel
#

like, mountain generation will be wacky

#

idk if block generation for atuff like mountains will change too if I just change the biome

fluid river
#

idk for sure

pseudo hazel
#

and even then, vanilla has like 5 noises for just biome generation

fluid river
#

well for that you probably need to also override ChunkGenerator

pseudo hazel
#

sad

#

im not good enough to just redo all of generation xD

fluid river
#

well, i'm also only capable of making void world 🙂

slate tinsel
#

Can I use intellij ultimate to get, for example, a command updated in the game as soon as I change something in the code without restarting the server, ie running the server in intellij.

chrome beacon
#

You mean hot swapping

#

Then yes you can

pseudo hazel
#

can you do that with community edition too?

chrome beacon
#

Yes

slate tinsel
chrome beacon
#

Yes

slate tinsel
#

Okey

spare hazel
#

why am i unable to build my bungeecord plugin?

#

and why am i unable to send the pom.xml in discord?

fossil flax
#

someone know how i can fix this?
I tried upgrading the clien version in the pom.xml but nothing change

inner mulch
#

Is it possible to save arraylists in a yaml file?

spare hazel
#

why am i unable to build my proxy plugin with this pom.xml

fluid river
#

tho you would have to manually cast your stuff to the type you need

short raptor
#

Hey since Bukkit.getOfflinePlayer returns object for any uuid, even if the player is not real, how can we tell whether the player is real?

wet breach
sharp cargo
# fluid river you parse your list wrong way ```java for (String item : main.configKit.getStri...

This still doesn't work, is there anything else I need to change?

kits:
  diamond:
    delay: 50
    items:
      - DIAMOND: 1
  iron:
    delay: 30
    items:
      - IRON_SWORD: 1
      - IRON_CHESTPLATE: 1
        if (sender instanceof Player) {
            Player player = (Player) sender;
            if (args.length == 1) {
                String kitName = args[0];
                
                if (main.configKit.contains("kits." + kitName)) {
                    for (String item : main.configKit.getStringList("kits." + kitName + ".items")) {
                        int amount = Integer.parseInt(item.split(": ")[1]);
                        ItemStack itemStack = new ItemStack(Material.matchMaterial(item.split(": ")[0]), amount);
                        player.getInventory().addItem(itemStack);
                    }
                    player.updateInventory();
                } else {
                    player.sendMessage("Le kit n'existe pas !");
                }
            } else {
                player.sendMessage("Utilisation incorrecte. Utilisez /kit <nomDuKit>");
            }
        }
        
        return true;
fluid river
#

what's the error tho

wet breach
fluid river
young knoll
#

That only checks if they have joined your server before

fluid river
#

if you need that for your server ofc

fluid river
young knoll
#

Idk

alpine urchin
#

such info

#

out of curiosity

fluid river
#

world data ig

young knoll
#

Nah it’s a file

fluid river
#

i used to uncover it from world nbt

young knoll
#

I think it’s offlineplayers.json or something

fluid river
#

in older versions

alpine urchin
#

interesting

young knoll
#

Actually

#

Thats where the data for getOfflinePlayers is

#

HasPlayedBefore just checks if they have a player.dat file

fluid river
#

oh true

#

it's in world folder

#

at least for 1.19.3

young knoll
#

yep

pseudo hazel
young knoll
#

Biomes no longer effect terrain

pseudo hazel
#

yeah thats my issue

#

I can now have a mountain with like 20 biomes if I just scale down the biomes

young knoll
#

mhm

pseudo hazel
#

but instead I would rather have a small mountain with 1 biome xD

alpine urchin
#

i c

#

what else is in that player dat

#

just curious

young knoll
#

All the players data

quaint mantle
#

What's the best way to convert degrees into yaw

alpine urchin
#

@young knoll yes

#

but another example

quaint mantle
#

x / 2

alpine urchin
#

what kinda math is this

sharp cargo
alpine urchin
#

bros waffling

quaint mantle
alpine urchin
#

@quaint mantle it already is in degrees

#

so wdym

quaint mantle
#

ok have u ever heard of 343 yaw tho

alpine urchin
#

how high can yaw go again, havent played this game in a while

quaint mantle
#

-180 <= x <= 180

short raptor
#

So you subtract 180?

alpine urchin
#

are you in the client

short raptor
#

Then it's in the acceptable range no

quaint mantle
#

bro what

#

subtracting 180 will change it

alpine urchin
#

are you dealing with yaw on server or client

quaint mantle
#

client

alpine urchin
#

subtract 360 till its in range

#

thats a full rotation which in effect is no difference

quaint mantle
#

that just won't work

#

-90 deg in yaw is 0 degrees in our conventional system

#

converting yaw to deg is easy with just + 90

#

More like converting 2d world to 3d

sharp cargo
# fluid river you parse your list wrong way ```java for (String item : main.configKit.getStri...

I receive messages "1" "2" "4"

        if (sender instanceof Player) {
            Player player = (Player) sender;
            if (args.length == 1) {
                String kitName = args[0];
                
                player.sendMessage("1");
                
                if (main.configKit.contains("kits." + kitName)) {
                    player.sendMessage("2");
                    for (String item : main.configKit.getStringList("kits." + kitName + ".items")) {
                        player.sendMessage("3");
                        int amount = Integer.parseInt(item.split(": ")[1]);
                        ItemStack itemStack = new ItemStack(Material.matchMaterial(item.split(": ")[0]), amount);
                        player.getInventory().addItem(itemStack);
                    }
                    player.updateInventory();
                    player.sendMessage("4");
                } else {
                    player.sendMessage("Le kit n'existe pas !");
                }
            } else {
                player.sendMessage("Utilisation incorrecte. Utilisez /kit <nomDuKit>");
            }
        }
        
        return true;
quaint mantle
wet breach
quaint mantle
#

why is it made like that

#

-90 means ur going in the positive x axis

wet breach
#

Negative should be up and positive should be down

quaint mantle
#

that's pitch

wet breach
#

Right tired lmao. So negative should be going left and positive right

quaint mantle
#

double theta = Math.atan2(-x, z);
yaw = (float) Math.toDegrees((theta + _2PI) % _2PI);

#

what bukkit does

wet breach
#

But the reason for doing it like that is because you dont need to do anything fancy to know the direction someone is turning such as messing with vectors lol

#

Would be such a pain if we had to mees with vectors to just determine the direction of rotation

lost matrix
onyx fjord
green plaza
#

Why ServerSetSlotPacket spawn sword like this? Its weird my camera is maximum down to see this normally u cant even see it

#

When instead of sword i send map its nearly invisible

storm crystal
#

Anyone got tutorial on how to use scoreboards...? Ever since they got introduced I got no idea how to use them correctly, especially with plugins.

green plaza
#

And unable to read what is on the map

#
    @Override
    public void join(ProxiedPlayer proxiedPlayer) {
        proxiedPlayer.sendAndFlush(new ServerLoginSuccessPacket(proxiedPlayer.getUUID(), proxiedPlayer.getName()));
        proxiedPlayer.getChannel().pipeline().get(NettyPacketCodec.class).setConnectionState(ConnectionState.PLAY);

        proxiedPlayer.getChannel().eventLoop().schedule(() -> {
            proxiedPlayer.sendAndFlush(new ServerJoinGamePacket(proxiedPlayer.getPlayerID(), Gamemode.SURVIVAL, proxyEngine.getDimensionRegistry().getDefaultDimension_1_16(), Difficulty.PEACEFULL, 1, "default_1_1", false));
            proxiedPlayer.sendAndFlush(new ServerPlayerAbilitiesPacket(false, true, true, false, 0.0f, 0.0f));
            proxiedPlayer.sendAndFlush(new ServerSpawnPositionPacket(new Position(0, 70, 0)));
            proxiedPlayer.sendAndFlush(new ServerPlayerPosLookPacket(new Position(0, 70, 0), 0, 0, 0x2));
        }, 250, TimeUnit.MILLISECONDS);
    }

If anyone interested this is code that sends packets after player join limbo

lost matrix
storm crystal
upper hazel
#

how to overlap a plugin event with another plugin

lost matrix
#

I would use screenshots and gimp or photoshop.
Makes it easy to change the transparency when overlapping.

upper hazel
#

what

slender elbow
#

i'm sure you could use mspaint with some dedication

lost matrix
#

Exactly

#

What

upper hazel
#

i can cancel if use preority

#

?

lost matrix
# upper hazel i can cancel if use preority

Ah ok. Yes, so the server fires one event and every plugin gets this event, one after another.
So if you get the event after another plugin has already cancelled the event, then you can simply
uncancell it if you whish. This can be ensured by having a higher priority than the other plugins listener.

wet breach
#

lowest priority gets the last say and action

#

highest priority goes first and gets to do something first

echo basalt
#

uhh no

#

it's opposite in bukkit

#

just read the javadoc and you'll understand

pseudo hazel
#

thanks bukkit uwu

echo basalt
#

"highest priority runs last because it has the final say"

pseudo hazel
#

hmm that does make sense in the context of events yeah

echo basalt
wet breach
restive abyss
#

how would I go about making an Inventory type for PersistentDataContainers?

lost matrix
#

I see what you are doing. Complex objects cant be serialized by just getting some random bytes.
getMSB and getLSB are methods exclusive to UUIDs because they are essentially just random 128 bit numbers.
And java has no primitive representation, so it gets split into two 64 bit longs.

#

The most significant 64bit and the least significant 64 bit

restive abyss
restive abyss
lost matrix
#

Yeah, they serialize UUIDs here

lost matrix
restive abyss
#

hm..

lost matrix
#

Well Strings also just because they are essentially a char[]

lost matrix
# restive abyss hm..

So your task now is to find an intelligent solution to serializing:
InventoryType -> some primitives
ItemStack[] -> some primitives

#

And back ofc

restive abyss
#

hmmm

lost matrix
#

PDCs support String as their primitive backbone. This means you could just serialize anything to json and throw it in there.

restive abyss
remote swallow
#

to put a itemstack array in pdc you need to use bukkit object output stream

lost matrix
#

This does all the heavy lifting for you. I would try to write one yourself first.

remote swallow
restive abyss
scenic onyx
#

?paste

undone axleBOT
scenic onyx
lost matrix
scenic onyx
scenic onyx
# lost matrix By not calling queries with closed connections...
public void openConnection() throws SQLException, ClassNotFoundException {
        if (connection != null && !connection.isClosed()) {
            return;
        }

        synchronized (this) {
            if (connection != null && !connection.isClosed()) {
                return;
            }

            //Class.forName("com.mysql.jdbc.Driver");
            connection = DriverManager.getConnection("jdbc:mysql://" + host + ":" + port + "/" + database, username, password);
        }
    }
echo basalt
#

connection.isValid innit

lost matrix
#

CP = Connection Pool
It manages connections for you

scenic onyx
remote swallow
#

no

echo basalt
#

no

remote swallow
#

you close the connection when you finish and you only assign it once

valid burrow
#

what is the max lengh for a username in minecraft

remote swallow
#

16

valid burrow
#

arl

lost matrix
#

You should never use the same connection twice. Having to do all the validation work by hand is asking for trouble.
Just let something like Hikari handle all that nonsense.

wet breach
#

the job of the pool is to keep connections open for use

#

there is a max time connections can be opened, so they will eventually die, but the pool will detect this

#

and make a new connection to take the place of the one that died

scenic onyx
wet breach
#

using a connection pool just reduces the over head in opening and closing connections by reusing connections as much as possible before it dies 🙂

uncut needle
lost matrix
#

Anyways gtg

wet breach
#

lol, cya later

echo basalt
#

buff smile

robust fable
#
    public void onRespawn(PlayerRespawnEvent event) {
        String playerName = event.getPlayer().getName();
        Player player = event.getPlayer();
        player.addPotionEffect(new PotionEffect(PotionEffectType.FAST_DIGGING, 1000000, 1, false, false));
        player.addPotionEffect(new PotionEffect(PotionEffectType.SLOW_DIGGING, 1000000, 0, false, false));
    }
}```

fsr this doesn't give me any effects, but the event is triggered
scenic onyx
#

@lost matrix i have do it

public void reloadConnection() throws SQLException {
        stopConnection();
        closeConnection();
        connection = DriverManager.getConnection("jdbc:mysql://" + host + ":" + port + "/" + database, username, password);
    }
#

I do this every time I make a Query

echo basalt
#

just use hikaricp already ffs

#

bro just went from a flaky 30ms to a guaranteed 1.5s

quaint mantle
#

Reconnection comes with cost

#

If your server has slow connection to db you should not do it.

smoky oak
#

Is it possible to move the action bar message down? It's a bit too high for my purposes atm

pseudo hazel
#

no

#

because I think thats where the item name pops up

#

and its like a client side thing too

slender elbow
#

resource packs

smoky oak
#

cant

slender elbow
#

funny width stuff

#

sucks

#

then no

glacial narwhal
#

So i am learning the spigot API for 1.12-1.20.2 but there something else than ChatColor ? because its deprecated

smoky oak
#

?whereami

smoky oak
#

ur on paper aint u

pseudo hazel
#

use bungee chatcolor

#

and ask in paper server xD

glacial narwhal
#

My bad

pseudo hazel
#

but anyways bungee chatcolor is better in all regards

remote swallow
#

paper still deprecate it

smoky oak
#

hm

#

different topic, how do i export my plugin in a way someone else can be like 'i build on this'?

chrome beacon
#

?

#

wdym

remote swallow
#

like an api?

smoky oak
#

like, im working with someone else, i want to give him the ability to make his stuff interface with mine

#

yea

chrome beacon
#

If you're using maven you can use the install task to add your project to your local maven repo

#

Then you can depend on it like normal

smoky oak
#

wellllllllllllllll I can do that
but that guy isnt even on the same side of the ocean as i am

chrome beacon
#

As long as you both have access to the project that shouldn't be an issue

#

if you want easier access you can host your own maven repo

quiet ice
#

Just use git?

chrome beacon
#

^^

smoky oak
#

i am but that'd still require for him to install it wouldnt it?

pseudo hazel
#

if you are both working on the same plugin ,just use source control like git

#

yes

#

thats kinda how git works

quiet ice
#

If you want to modify the same project, use git. If one project depends on the other, use a maven repo and automatically deploy nightly builds to it

smoky oak
#

see i dont build PAPI when i use it

#

its a dependency

wooden hearth
#

If I want a module system within my core should I use CommandMaps instead of putting them in the plugin.yml?

quiet ice
smoky oak
#

i mean maven install

smoky oak
#

the idea here is that he doesnt have to build the plugin

quiet ice
#

For maven you'd want to do mvn deploy

smoky oak
#

wym

quiet ice
#

The easiest solution is to deploy to an FTP repo, but other ways exist

smoky oak
#

i was told here to run mvn install to get it into my .m2 folder

quiet ice
#

That is if you want it to be done privately

#

But if you want to deploy it publicly, deploy it is.

smoky oak
#

is there setup required or does it just end up on maven central?

#

also can u explain the ftp repo please?

quiet ice
#

Deploying it to Maven central/OSSRH isn't that intuitive tbh

smoky oak
quiet ice
smoky oak
#

hm so it requires a dedicated server, bummer

quiet ice
#

You can also do it via file://, I think (at least you can do it via gradle)

#

OSSRH/Maven central does not need a dedicated server, but you need to register a group id and all. It takes a good day to figure out

smoky oak
#

i probably should do that before someone steals my name again

#

the woes of choosing a name that sounds random but is an actual word

pseudo hazel
#

but what is this person gonna help with if he cant build the plugin

smoky oak
#

well..... because thats not how you distribute API stuff....?

#

i put the maven dependency in and hit build

pseudo hazel
#

or are they making a separate plugin with yours as a dep

smoky oak
#

again, yes

pseudo hazel
#

okay my bad

#

I didnt see that the first time

smoky oak
#

lol its fine

#

time to suffer in maven ig

#

hey geol is there a 'get started here' link or is this 100% pain ?

quiet ice
#

As you need to show proof of ownership of a domain name or of a github account

smoky oak
#

i see, interesting

#

do i just search for maven central?

quiet ice
smoky oak
#

kthx

#

uh why is intellij marking this as an issue but not saying what it thinks the error is

quiet ice
#

then there is no error

smoky oak
#

ye but why does it highlight it

chrome beacon
#

It tells you

worldly ingot
#

Doesn't look like it is highlighting it

#

Unless you mean the background highlight which is just an instance highlighter

quiet ice
#

^

smoky oak
#

no it was lit while the cursor was elsewhere

chrome beacon
#

You're trying to instantiate a class that looks like a utility class?

#

Which is what it's warning you for

quiet ice
worldly ingot
#

If you clicked on instance it would highlight those 4 instances

smoky oak
#

yea but in green

#

whats that yellow highlight for?

#

is that the same thing just for the method?

quiet ice
#

green?

worldly ingot
#

Probably the same thing

smoky oak
#

if the cursors on it its green

remote swallow
#

thats usage

worldly ingot
#

Yeah same thing different colour

remote swallow
#

anywhere you have ReachAPI it shows

quiet ice
#

I see no difference

#

I may be colourblind

worldly ingot
#

You could be because those are different colours lol

smoky oak
quaint mantle
#

What is bro waffling about

smoky oak
#

IJ being werid

#

weired

#

er

#

questionable

worldly ingot
#

Yellow highlight: #52503A
Green highlight: #344134

#

I think you should take a test geol KEKW

smoky oak
#

you have a colour picker at hand?

worldly ingot
#

Yeah

quaint mantle
smoky oak
#

i cant type sue me

remote swallow
#

windows powertoys

quiet ice
worldly ingot
#

ShareX has some great tools, one of which is a color picker

quiet ice
#

Could be my autism idk

smoky oak
#

autism shouldnt affect your eyes

worldly ingot
#

Could also be yellow-green colourblindness

smoky oak
#

wait idea brb

smoky oak
quiet ice
worldly ingot
#

Yes

lilac dagger
#

i can achieve the same with 2 apps

smoky oak
#

ill do a very fast test

#

i do have an image editor

lilac dagger
#

default apps

smoky oak
#

if it would open that is :/

worldly ingot
#

tbf those colour codes are probably slightly desaturated because of your black background

quiet ice
#

The main problem I have are if the color isn't "intense" enough my brain cannot pick them out

worldly ingot
#

Definitely colour blindness :p

quiet ice
#

I mainly have this problem on thin lines

lilac dagger
#

might be the monitor

quiet ice
#

Usually when screens or projectors are employed

smoky oak
lilac dagger
#

people assume monitors are built the same in 20223

worldly ingot
#

These are common tests

lilac dagger
#

they're not

worldly ingot
#

7, 13, 16, 8, 12, 9

#

top left, bottom right

lilac dagger
#

8 14 17 9 13 10

#

did i get it right?

worldly ingot
#

You tried

lilac dagger
#

damn

quiet ice
lilac dagger
#

try again on your phone @quiet ice

smoky oak
#

i see the numbers choco wrote but now yall got me doubting myself

lilac dagger
#

try on 2 devices at least

remote swallow
#

what if my green looks nothinglike your green because im colourblind but that is what green look slike

worldly ingot
#

Those are red-green colour blindness tests

smoky oak
#

dog

quiet ice
smoky oak
#

i cant recall if those dots have the same brightness, they should tho

glad prawn
river oracle
#

Good job you aren't red green color blind

glad prawn
#

😛

quiet ice
#

When I magnify it I can tell the colors of the dots

remote swallow
#

maybe you have cateracts

river oracle
smoky oak
#

oh thats curious, you might not be totally blind if thats whats happening here
iirc theres a lot of partial blindness types

#

*red-green blind

quiet ice
#

But uh, at some point my pattern recognition is just 404ing

lilac dagger
quiet ice
#

Doubt so.

smoky oak
#

zoom in and move the image around?

quiet ice
#

Bruh. My brain can't even see the 1 even though I now see each dot that is part of the 1

smoky oak
#

oh that's curious. I think there's one part where my pattern recognition fails too, but its on those 3d card thingies

#

i... have no idea how to describe them

quiet ice
#

hm, I think I know what you mean

smoky oak
#

like the ones that are just ink on cardboard

#

not those hologramm things but those that look like people descibe lsd

quiet ice
#

Ah uh then yeah no idea

smoky oak
#

found em

#

if you focus on a point closer to your eyes than the image, the regular patterns overlay. they arent exactly equal giving the illusion of holes in it

#

oh are u shitting me this one says LSD bruh

lilac dagger
#

can i get a 1440p version?

#

or the name of the illusion

smoky oak
#

this one has 800 by 500 pixels

#

uh its 'squint cards' i think

echo basalt
#

I don't see it

quiet ice
#

Hm. I've seen those before...

#

Or rather said, I've already been to this wikipedia article

short pilot
#

What's the best way to store a set of member UUIDs for a faction in a SQLite database? Should I add this set to my table of all the other faction attributes (such as name, description, etc) or make a separate table for it?

pseudo hazel
#

you store the factionid in the player table

lusty cipher
#

what event will be called when a block (shulker box) is broken by a piston?

short pilot
#

so a separate table just for players

quaint mantle
#

Hold on i will confirm that for you. Jus gettin on pc

valid burrow
#

why cant i do this NamespacedKey key = new NamespacedKey("minecraft", "Tag");

eternal oxide
#

lowercase

valid burrow
#

im tryig to recreate the tag that is being added to items when using /give @s nametag{Tag:"what ever"}

#

And as far as im concernd its uppercase there

eternal oxide
#

rules for NamespacedKeys is all lowercase

slender elbow
#

raw nbt are not necessarily namesoaced keys

quaint mantle
eternal oxide
#

Spigot auto converts all to lowercase

valid burrow
slender elbow
#

nbt is not api so idk what you're trying to use

lusty cipher
echo basalt
valid burrow
#

cause the only information i found was that when creating an item like that the info is saved in a pdc

slender elbow
#

pdc is not full nbt access, and it uses namespaced keys to discern plugin ownership of a tag

quaint mantle
# lusty cipher hmm thank you very much

Yes, the event is called pretty frequently according to spigot docs, on a busy server can be called up to 1000+ times per second..

Also it is fired when a block changes state
So you can work with the piston by getting it BlockState

echo basalt
valid burrow
#

well tell me how else i could possibly test for that then

slender elbow
#

it depends exactly what you want to "test for" exactly

quaint mantle
#

Does anyone know how to give yourself Armor Trim in the new version (1.20.2), would somebody be able to provide a code snippet of how to do so?

slender elbow
#

with pdc you can only access other tags put by your or other plugins

valid burrow
#

if an item has a certain item tag

slender elbow
#

not raw full nbt

#

it depends on the tag

eternal oxide
#

PDC will not allow you to check nbt tags

lusty cipher
valid burrow
#

a item tag created by this command /give @s nametag{Tag:"nicknamer"}

eternal oxide
#

PDC is a wrapper around a Spigot NBT

quaint mantle
lusty cipher
valid burrow
#

i understood by now that my method doesnt work

quaint mantle
valid burrow
#

yall told me that 10 times

quaint mantle
#

their is also BlockPistonRetractEvent you can use

#

to get the piston^

eternal oxide
#

you would need to access teh raw nbt, so one of the nbt libraries

pseudo hazel
eternal oxide
#

not sure if there is any capture for the vanilla /data command yet

#

if there is you could parse that

valid burrow
#

whats the easiest way to change a persons nametag

#

i found somethng about teams but either im too dumb for that or it doesnt work

young shell
#

Is the Stash and Jira only really slow for me or is there something going on there

kind hatch
#

Only seems slightly slower for me. Only like a second or so.

lost matrix
shadow night
#

I wonder if changing the users name in tab and above their head requires the use of packets

valid burrow
#

cause my chatbuilder has the nicknames of all online players stored anyways

lost matrix
#

Do you need this for changing the name completely or do you only want to decorate the players name.
Because for the former, you would want the player to also be recognised by the server with a different name
for consistency. (Auto completion or targeting someone with a command)

lost matrix
#

In that case you probably need a more radical approach. Are you ready for some NMS and possibly reflections?

valid burrow
#

so i have a choice? xd

lost matrix
#

Wait, let me check the protocol. Maybe you can spoof the name there already.

valid burrow
#

x)

alpine urchin
#

looks so weird to me

#

i think its not incorrect

#

just reflection sounds better

#

why did it get that name anyway

#

reflection

#

anyone know

#

and not injections

#

or so

alpine urchin
#

would be beyter

echo basalt
#

probably on the tablist packet

alpine urchin
#

player info packet yeah

#

you can change their name by passing a chat component

hazy parrot
lost matrix
# echo basalt solid chance

Problem is that the server uses the players name to lookup the UUID. I thought it would be the other way around...

chrome beacon
#

Reflection isn't just for injecting things

hazy parrot
alpine urchin
lost matrix
#

bc oracle named it like that :)

alpine urchin
#

do you have kids

chrome beacon
lost matrix
alpine urchin
#

if you wanna go that far you can intercept such packets

valid burrow
#

that wont work in my situatiin

#

i need to be able to change the name WHILE the player is connected too

lost matrix
#

Alright, then making the server also aware of that might be a journey.

valid burrow
#

alright xd

lost matrix
#

Im in the mood for some nms digging actually. Let me see what consequences simply changing the GameProfile on playtime would have.

valid burrow
#

has no one made an api for all this yet??

#

like

#

i thought changing the players name is nothing outoftheworld type stuff

lost matrix
#

I mean there are plenty of apis for chaning a players name tag etc. But changing a players name, even with server side recognition is
something you see very rarely.

#

Only with a few hacks. I mean you could listen to command and tab complete events and simply replace the names.
But it would be fun to completely change a players name on the fly

valid burrow
#

alright then lets try it

#

couldnt you also just somehow reconnected the player and then have a new playerloginevent

#

or what ever event comes before the player profile is created

lost matrix
#

Just running BuildTools real quick to build a remapped project so i can explore without decompiled garbage

valid burrow
#

alright

lost matrix
#

Okay uhm, did nms always have so many unused imports?

#

Ah... the patches made some slight changes 🙂

valid burrow
#

damn

storm crystal
#

can I change how fishing works

lost matrix
#

Hm. It looks like it could be possible to add a name change to the AsyncPlayerPreLoginEvent. Doubt it would get accepted tho.

lost matrix
storm crystal
#

like force fish event but do something else for it when I actually catch a fish

#

or change time values needed for fish to be fished

lost matrix
#

Yeah you can do all of that

storm crystal
#

lol

#

do plugins work with mods?

#

like getting metadata of a modded item and such

lost matrix
#

I mean... if you make them work together

storm crystal
#

as in?

lost matrix
#

If you program code that works together. 🤷

storm crystal
#

I mean

#

can I just idk

#

if you give item to a player

#

and I have mod installed

#

can I give a modded item

lost matrix
#

This is a complicated question. In general: No

#

You need a modded server to run mods

molten hearth
#

How necessary is it to tell the client about dimension codec

#

can the client smoke copium or does it throw a fit when you tell it to spawn in one of them

lost matrix
valid burrow
alpine urchin
#

did you try turning it off and on again

echo basalt
#

Can't you intercept that packet and then inject the new username?

lost matrix
#

Then the server looks up the UUID for that new username

#

And skin etc

echo basalt
#

what about changing the name of the gameprofile after the entire login process?

#

I've definitely messed with something like this before

lost matrix
#

It would be theoretically possible to add a setPlayerName() method in the AsyncPlayerPreLoginEvent but i doubt it would be accepted.

echo basalt
#

hacky reflections :)

lost matrix
#

The problem is that the gameprofile gets passed around like a cheap... pencil
Its quite hard to figure out where it is used.

#

But it looks like the only place is the PlayerList. So inside the EntityPlayer itself.

#

Im still wondering why the player list needs to be a list as there is never any relevant random access via index anywhere

#

Jo, strong encapsulation?

lost matrix
#

Let me try a quick example

valid burrow
#

alright thank you

scenic onyx
#

how i can get The depth of the hitboxes

lost matrix
#

?paste

undone axleBOT
lost matrix
lost matrix
scenic onyx
lost matrix
#

I mean. Here

scenic onyx
#

mm

lost matrix
#

All sides have the same length when looking from above

#

Thats what i mean

#

Wait let me double check. This might be old information.

scenic onyx
#

yes

lost matrix
#

Yeah, looks about right

scenic onyx
quaint mantle
#

hey, pathfindergoals wont work on newer mobs right

valid burrow
#

i dont know which ones to use for like half of those objects xd

lost matrix
valid burrow
lost matrix
# valid burrow sure...
import com.google.common.base.Preconditions;
import com.mojang.authlib.GameProfile;
import net.minecraft.network.protocol.game.ClientboundPlayerInfoRemovePacket;
import net.minecraft.network.protocol.game.ClientboundPlayerInfoUpdatePacket;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.server.network.ServerGamePacketListenerImpl;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftPlayer;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.plugin.java.JavaPlugin;

import java.lang.reflect.Field;
import java.util.List;

Those are my imports

ember estuary
#

When I build my plugins (no matter if Gradle or Maven plugin), my server crashes.
Does anyone have an idea why that is?

#

The players get this kick message

#

No error in server log

valid burrow
#

like the mojang dependency

#

where is that locateed

dry hazel
valid burrow
lost matrix
#

?nms

edgy oak
#

maybe a silly question but how do i add line breaks to this?

#

this is for the kick message

edgy oak
#

thats what i thought but it doesnt seem to be working for whatever reason

valid burrow
#

give me 1 sec

#

im gonna check my code

edgy oak
#

👍

lost matrix
valid burrow
#

if you wanna read lines from config just make a string list

#

and use a string joiner

lost matrix
#

You would have to do something like

String replaced = loaded.replaceAll("\\n", "\n");
valid burrow
lost matrix
#

Or you can allow a String list, yeah

edgy oak
#

ahhh i see, thank you it works now :)

valid burrow
#

like this for me

lost matrix
#

temporär ist ein Adjektiv -> klein schreiben

valid burrow
#

das mag sein

lost matrix
#

Same goes for permanent

valid burrow
#

das mag auch sein

lost matrix
#

🙂

glad prawn
#

I often use this

  text a
  text b```
quaint mantle
#

hey how do i make a piglin attack chickens

lost matrix
#

Have you tried just setting the chicken as a target via the api?
If this doesnt work then you need some nms

gray merlin
#

... I... I accidentally have been packaging my plugin with its 1.7.10 version using the spigot library in compile mode...

#

...

#

No wonder it was 12.2MB big...

lost matrix
#

I would be more concerned about the fact that there is someone still writing code with the 1.7 api

valid burrow
#

i dont know if im just like

#

really stupid

#

but

#

?paste

undone axleBOT
valid burrow
chrome beacon
lost matrix
#

You need to run BuildTools
-jar .\BuildTools.jar --remapped

gray merlin
#

I have to change a lot of code, sure, and sometimes I take a while to offer 1.7.10 compat, but It's a nice exercise and I get there

valid burrow
lost matrix
valid burrow
gray merlin
#

(Also, I started writing plugins for an 1.7.10 server in crucible, so it sensibilised me to it)

lost matrix
valid burrow
chrome beacon
valid burrow
lost matrix
#

Thats about 10%

#

Actually scrap 1.13
1.16.5 is low enough 😛

young knoll
#

Why’s no one on 1.10.2

#

The best version

gray merlin
#

For new plugins, I start them in the latest version an then make my way downards; If I don't have to change any code, great! If I do, then shucks, will come a bit later
My project structure is as it is specifically so i can build plugins for every version, and honestly, maven modules are carrying lol

#

Though my projects end up looking like this

lilac dagger
#

1.7?

#

why?

gray merlin
valid burrow
#

isnt hypixel 1.7 for example?

gray merlin
lost matrix
young knoll
#

Wtf is crucible

valid burrow
#

well this is still red

gray merlin
#

The only difference between spigot and crucible are the nms mappings

wooden hearth
#

What's my peeps upto today?

chrome beacon
#

So a fork of cauldron I assume

gray merlin
worldly ingot
# valid burrow isnt hypixel 1.7 for example?

Hypixel has a dedicated team of some of the top Minecraft developers where they have control over their own server software KEKW Not at all comparable to an NMS method you want to call and backporting that call to Minecraft 1.7

echo basalt
gray merlin
#

Can I set an external download link for my spigot app to modrinth?

valid burrow
#

Could not find goal 'remap' in plugin org.apache.maven.plugins:maven-compiler-plugin:3.8.1 among available goals compile, help, testCompile -> [Help 1] what do i do i hate maven

storm crystal
#

how to spawn a custom mob at a certain location, I know how to spawn a mob at a location but I dont know how to give him custom attributes

gray merlin
#

Or is this against the rules?

storm crystal
#

like name, equipment, and such

valid burrow
storm crystal
#

I have this so far

valid burrow
#

infront of the last line

#

put

#

Entity entity =

#

and then you can use the entity object to do whát ever

ivory sleet
slender elbow
valid burrow
storm crystal
#

Entity entity = what

echo basalt
valid burrow
echo basalt
#

actually I don't remember hitboxes ever being rotated

slender elbow
#

oh no they don't lol

echo basalt
#

except for the dragon maybe

#

even then

slender elbow
#

they're fixed

echo basalt
#

yeyeye

eternal night
#

wouldn't be much of an AABB would they

slender elbow
valid burrow
#

@storm crystal like this forexample

echo basalt
#

So you don't need a third axis in the aabb

quaint mantle
#

does anyone know better way of doing ?

entries.parallelStream()
                .collect(Collectors.collectingAndThen(
                        Collectors.groupingByConcurrent(entry -> entry.getProvider().getMetadata().getId(),
                                Collectors.mapping(
                                        EntrypointContainer::getEntrypoint,
                                        Collectors.toUnmodifiableList()
                                )
                        ),
                        ($) -> $.entrySet().parallelStream()
                                .collect(ImmutableBiMap.toImmutableBiMap(
                                        Map.Entry::getKey,
                                        entry -> new PluginContainer(entry.getKey(), entry.getValue())
                                ))
                ));```
echo basalt
#

you just need width and height

echo basalt
#

length is the same as width

ivory sleet
#

$ as lambda parameter variable name, myes

echo basalt
#

try a regular for loop

quaint mantle
eternal night
slender elbow
#

_ as a lambda parameter name 🥺

lost matrix
storm crystal
eternal night
#

but WHENN

quaint mantle
eternal night
#

not yet

worldly ingot
next stratus
#

I'm going to assume block display's don't work in spigot? 🤔

worldly ingot
#

Why would you assume that?

echo basalt
#

they do

valid burrow
ivory sleet
next stratus
#

I've been trying to spawn them the past few days and none have worked unless I'm just real dumb.

worldly ingot
#

Could be a multitude of reasons why it wouldn't be working

lost matrix
worldly ingot
#

Positioning, poor affine transformations, etc.

next stratus
valid burrow
#

show code and errors

next stratus
#

affine transformations?

worldly ingot
#

#setTransformation()

next stratus
worldly ingot
#

Could also just not have a block state assigned to the display and it's using air instead

#

Like I said, lots of reasons it wouldn't be showing

next stratus
#

I tried

    BlockDisplay entity = (BlockDisplay) location.getWorld().spawnEntity(centre, EntityType.BLOCK_DISPLAY);
    entity.setBlock(Material.DIAMOND_BLOCK.createBlockData());
    entity.spawnAt(location);
worldly ingot
#

entity.spawnAt()?

next stratus
#

Yeah, is that not correct?

valid burrow
#

npo?

young knoll
#

spawnEntity already spawns the entity

next stratus
#

I'm just trying to get it to spawn into the world at this point lol.

young knoll
#

Hence the name

worldly ingot
#

That's a Paper method as far as I'm aware and not necessary

next stratus
#

Alright, I removed it

valid burrow
#

Are you using paper DevBukkit

next stratus
#

On my server or?

lost matrix
worldly ingot
#

Yeah that should work fine

#

If not then just make sure your Location objects are in the correct place as you expect

next stratus
#

I've debugged the locations and it came out fine 🤔

valid burrow
#

are you sure your method gets executed?

next stratus
#

I mean the rest of the code is being executed so yeah, I'm confident it is I'm trying smiles a sec.

valid burrow
#

and a print statement after it

#

thats the easiest way to check

#

also

#

try teleporting the player to the entity

#

it should trow an error if it doesnt exist

next stratus
#

Why is the spigot api so wacky sometimes 😅

#

I'm trying to teleport thing atm, it doesn't show visablly unless it's just super tiny if that's possible

storm crystal
#

how can I give entity armor and potion effects?

chrome beacon
#

Do you want to spawn an entity with armor and effects or do you want to give an existing entity armor and effects?

storm crystal
#

spawn

lost matrix
#

Uh oh. Dont we have a guide for entities?

chrome beacon
#

and then you can modify the entity

storm crystal
echo basalt
#

you clearly aren't a regular

#

p sure we don't

chrome beacon
#

^^

chrome beacon
valid burrow
#

what is the newest maven compiler

next stratus
lost matrix
#

Not every entity has equipment. Only LivingEntities

chrome beacon
#

^^

chrome beacon
storm crystal
#

w/e ill figure it out tommorow im tired

chrome beacon
#

My guess is that you're still trying to spawn a BlockDisplay

#

Which isn't a living entity

quaint mantle
#

or they forgot to cast it or something

chrome beacon
#

No need to cast

storm crystal
#

its being spawned correctly btw

chrome beacon
#

It's a generic method

#

It could also be that they didn't use the spawn method that takes a consumer

valid burrow
#

@lost matrix

#

help me

#

why is there so many

lost matrix
storm crystal
# chrome beacon It could also be that they didn't use the spawn method that takes a consumer
    @EventHandler
    public void onFish(PlayerFishEvent event) {
        Player player = event.getPlayer();
        Entity entity = event.getCaught();
        FishHook hook = event.getHook();
        if (entity != null) {
            player.sendMessage("§8[§6Server§8] §7You caught a monster.");
            event.setCancelled(true);
            hook.remove();
            Location location = player.getLocation();
            location.setX(location.getX()+1);
            location.setZ(location.getZ()+1);
            Entity monster = player.getWorld().spawnEntity(location, EntityType.ZOMBIE);
            if (monster instanceof LivingEntity livingEntity) {
                monster.setCustomName("§8[§6H§8] §7Monster");
                livingEntity.setHealth(20);
            }
        }
    }
#

here I got this so far

valid burrow
lost matrix
chrome beacon
#

You didn't use the spawn method that takes a consumer

valid burrow
storm crystal
#

great I certainly know what it means

#

I dont

valid burrow
lost matrix
storm crystal
#

it works

lost matrix
valid burrow
#

i know

#

but

#

i dont want it to compile the other ones

#

can i turn that off somehow

#

it annoys me

storm crystal
#

it works but I gave up at setting custom armor and potion effects for now

lost matrix
lost matrix
wooden hearth
#

Do you think having a module system in a server core would be useful so they can enable and disable if they want too and I was thinking to it so it's part of the API so people can expand on it for there on server?

inner mulch
#

Is there a way to implement cooldowns other than using bukkitrunnables?

wooden hearth
worldly ingot
#

If you're not wanting to display a message the moment a cooldown ends, you could just store timestamps and compare

inner mulch
#

hmm

wooden hearth
lost matrix
inner mulch
worldly ingot
#

Oh then yeah, timestamps easily

#

No need to send messages or anything when cooldown is up, you can send the time remaining in chat if a message fails to send

wooden hearth
worldly ingot
#

I don't think that would happen, but it is overkill for this situation :p

inner mulch
#

so timestamps are the only way?

wooden hearth
#

I would use timestamps if you have never used them, here's a time to learn 🙂

worldly ingot
wooden hearth
#

I'm using timestamps for my ignore command and mute command

inner mulch
#

lets say i mute somebody and save it in a db so its serverwide, wouldnt it be extremely ineffiecnt to compare it everytime the player tries to speak?

lost matrix
inner mulch
#

and you said i cant display remaining time with timestamps, therefore players cant know when their mute is gone, wouldnt that be frustrating?

wooden hearth
lost matrix
#

It is very important to define a scope for your data. Load into memory when a player joins and save it back when he quits.

lost matrix
wooden hearth
lost matrix
#

Depends how you implement the parsing

wooden hearth
lost matrix
#

A common format would be /mute bob 1d10h30m30s

wooden hearth
inner mulch
#

@lost matrix i dont quite understand the ressource, if i use the "crud" method and delete the data everytime, how can i efficiently store data that will be permanent?

lost matrix
wooden hearth
inner mulch
#

lets say i have 10000 players with levels in a skill

lost matrix
#

Save it when the session ends

inner mulch
#

oh so only save it once the player leaves

#

so that the database doesnt get flooded

worldly ingot
#

I would at least update experience periodically and levels immediately ¯_(ツ)_/¯

#

Depends on how important that data is I suppose

storm crystal
#

is it possible to make player NPCs just like in Hypixel?

inner mulch
#

what if the server crashes tho :(

lost matrix
#

And additionally saving all loaded data every few minutes. Or for really important data you can use a write-behind method like choco suggested

storm crystal
#

or is it something too difficult/complex?

inner mulch
#

okay

lilac dagger
lost matrix
wooden hearth
#

?paste

undone axleBOT
wooden hearth
storm crystal
valid burrow
#

i get this error btw @lost matrix

storm crystal
#

well I was more asking out of curiosity if that's like actual player standing

lost matrix
valid burrow
inner mulch
lost matrix
inner mulch
#

ok

#

thank you for all the data related information

wooden hearth
inner mulch
#

what do i use for caches, the only cache i know of is a hashmap?

lost matrix
#

Caching is a whole layer that needs careful consideration

wooden hearth
#

I know I was just saying for an extra option

tribal quarry
wooden hearth
#

I think everyone uses citizens

lost matrix
#

But i would use Caffeine for local caching and Redis for remote caching

valid burrow
#

@lost matrix I FINALLY GOT IT TO WORK TYSM

lost matrix
storm crystal
#

I dont know a lot about already existing plugins that people use

wooden hearth
lost matrix
valid burrow
lost matrix
#
Cache<String, DataObject> cache = Caffeine.newBuilder()
  .expireAfterWrite(1, TimeUnit.MINUTES)
  .maximumSize(100)
  .build();

This is how a cache from caffeine could look like

#

Its just a map

inner mulch
#

ok so a next level hashmap

wooden hearth
#

pretty much yeah

inner mulch
#

what is the maximumSize for tho?

#

max size of characters?

echo basalt
#

just found one of the most cursed jdk classes

#

Grapheme

wooden hearth
#

Dose anyone use Trello to plan there work?

lost matrix
inner mulch
#

oh thats smart

ivory sleet
lost matrix
echo basalt
lost matrix
chrome beacon
wooden hearth
#

I've used it to plan my plugin that I want to release

ivory sleet
tribal quarry
lost matrix
#

Ill let them know when they want to add listeners to this thing :=

valid burrow
echo basalt
#

thank you jdk real cool

tribal quarry
#

@storm crystal I would suggest this tutorial, its pretty same for 1.17.1+ versions:
https://www.youtube.com/watch?v=mnUVroXsyG8

In this episode of the Spigot MC Plugin series, I show you how to create an NPC with NMS and Packets. First, we make a fake player with a skin. Then, we give that NPC some items and a helmet. Finally, we make it look at you when you move around it. #Spigot #SpigotTutorial #MinecraftNMS

Brain.fm 20% off: http://brain.fm/kodysimpson?via=kodysimps...

▶ Play video
sterile token
young knoll
echo basalt
#

something something emojis in regex

wooden hearth
#

Should I allow papi placeholders in all my messages so then the people can customize them more or only ones that are needed?

sterile token
wooden hearth
sterile token
#

In my case i use an utility method, which check if PAPi is enabled and replace them using it (PAPI). If not just return the text directly without replacing

wooden hearth
#

well I'm making it if they don't have papi then it disables the plugin so PAPI is a depency for me

sterile token
#

right that perfect, would do the same haha

wooden hearth
#

yeah haha

sterile token
#

because if not is a mess working with placeholders, you have to replace them manually i neach thing. Because the values are different

wooden hearth
#

yeah exactly

slender elbow
ivory sleet
#

YEAH

#

oops caps

dry hazel
#

YEAH

sterile token
#

coclure, whhat lazy abour caffeine?

#

I read that somewhere

ivory sleet
#

well

#

you need to use Builder#scheduler if u want it to do it eagarly

sterile token
#

its something about concurrency right?

ivory sleet
#

yeah, for it to be eager it needs to be done async in principle

sterile token
#

eager? 🤔

dry hazel
#

eager is the opposite of lazy

sterile token
dry hazel
#

I mean, that's the proper terminology, lazy initialization is on demand and eager is right away

#

I'm not a native speaker by the way, english is my third language

inner mulch
cursive kite
#

Is a new Chunk object created when they unload / load

#

For player claims I save a list of Chunk but they seem to randomly reset

#

But there are still objects in the array

river oracle
#

I would be cautious storing things like Chunks and Locations in arrays

#

moreso chunks than Locations

#

If you need a chunk you might be best off instead storing just the chunk coordinates

cursive kite
#

Got it

#

Whats the best way to map them so i can grab a given claim without looping thru all them

#

I was doing Chunk -> ClaimObject

#

It's kind of sloppy but I guess the only option is a string? I can do like worldname+x+z

river oracle
#

you should really only store worldname, x , z

#

as you said above

#

also don't use a string use an object

#
public class SimpleChunk {
  private final String world;
  private final int x;
  private final int z;

  // constructor nd stuff
   
  public Chunk toBukkt() {
    // bukkit code here
  }
}
#

you may think this seems redundant but chunk stores a lot more than a world name and x and z coordinateds

cursive kite
#

So map SimpleChunk -> ClaimObject

#

Because I need to be able to pull a claim object quickly as it is checked when they enter chunks, break blocks in chunks, etc

river oracle
#

pretty much

cursive kite
#

Whats the best way to compare it, if i make new SimpleChunk(world, x, z) during setup, when i am checking the chunk during move event if i do new SimpleChunk again the key will not match

river oracle
#

yes it will

#

implement equals and hashcode

#

allow the equals method to take in a bukkit chunk too

#

that'll limit creating temporary objects

sterile token
#

Why people work with Chunks when talking about regions? I seem them as a mess i prefer cuboid areas using locations
im curious about this

lost matrix
#

There is also a slightly faster way with a smaller memory footprint when using a Long2ObjectMap and bit shifting x and z into a single long

cursive kite
#

But then world

river oracle
#

its pretty much a uid

lost matrix
sterile token
lost matrix
lost matrix
storm crystal
#

how can I displace entity?

#

as in change their location but dynamically, not teleport them

thin iris
#

like velocity?

storm crystal
#

yes

lost matrix
# river oracle its pretty much a uid

Unless the old world is deleted and created again with the same name. Then you would have a different UUID but are left with your (invalid) name mapping.

thin iris
#

setVelocity(..)

#

it takes in a vector

storm crystal
#

I mean, I want to push entity in a certain direction

#

a few blocks