#help-development

1 messages Ā· Page 722 of 1

young knoll
#

The set item packet

#

There is no packet to just send arbitrary text to that location though

pastel relic
#

no

#

It's not the item name

#

but its sort of placed on the same place

lost matrix
#

Thats the action bar

young knoll
#

There are only a few places on screen to show text

#

Boss bar, title, subtitle, scoreboard, action bar, and the item names

#

But the item names are client side*

kind hatch
young knoll
#

true

#

those too

pastel relic
#

this thing

lost matrix
#

Action bar

sullen marlin
#

That's action bar

#

Why do you think it isn't

pastel relic
#

oh so the other one is the boss bar?

young knoll
#

what other one

kind hatch
#

Boss bar is at the top of the screen.

pastel relic
#

The one on top

#

I thought thats called a boss bar

#

lol

young knoll
#

At the top of the screen is the boss bar

#

yes

#

well, boss bars

#

You can have up to 4 iirc

lost matrix
#

The bar which gets displayed to show the health of a boss, is indeed the boss bar.

pastel relic
#

how do i set the boss bar?

kind hatch
young knoll
#

Spigot has a boss bar api

#

Via Bukkit.createBossBar

lost matrix
#

And then you can add players to this BossBar

kind hatch
#

Then BossBar#addPlayer()

pastel relic
#

okay, thx

young knoll
#

If you use the method with a namespaced key you can make it persistant

smoky oak
#

public class NullShape extends AbstractShape
uuuuh..... help?

echo basalt
#

show code

lost matrix
#

You need better type constraints

echo basalt
#

p much yea

#

List<? extends AbstractShape> :)

smoky oak
#

er

#

is this a library thing

thin iris
#

how do i make a team and add a player to it

echo basalt
#

mm minecraft knockback code

quaint mantle
smoky oak
#

Unchecked generics array creation for varargs parameter
Whats this for?

lilac dagger
#

generics and arrays aren't really compatible

#

should be somewhat fine in a var arg tho

valid burrow
#

?paste

undone axleBOT
valid burrow
#

and dont tell me tas

#

i have a line of erros i just gotta find its source

#

and i think this might be it

lilac dagger
#

i don't think you can load a map like that

smoky oak
#

alright yall conundrum: I've a bunch of lists which may or may not contain the same fungible elements.
They get passed to a 'collector' which isn't interested in the lists itself, just that a list at spot a has the elements of the list that should be there.
My question here is: Should i store the references, so that i can paste the same list multiple times without eating much more memory, or should i copy them, in case someone decides to be 'smart' and edits the list after passing it?

thin iris
#

is there a way to get a players mc version

smoky oak
#

yea

#

dont use viaversion

#

also theres a method but idk if its in the api

thin iris
#

so where is it

valid burrow
#

it works with a normal string so why not with a string list

lilac dagger
#

Because the map as far as i know is of the form strimg object

#

And object can be any of the objects including i think a section

valid burrow
#

?paste

undone axleBOT
valid burrow
valid burrow
topaz cape
#

does minimessages support old color codes or does it remove them

#

like &a &b etc...

young knoll
#

iirc it ignores & codes

#

And if you use the actual color symbol it gets mad and throws an error

worldly ingot
#

I have no idea why you would want to use legacy codes if you have the option to use MM?

river oracle
#

legacy ftw šŸ‘

sterile sapphire
#

If on windows a tiny server takes 1gb ram u could u get away with using like 0.5gb ram with lynix?

#

Or is that not how it works

sterile sapphire
#

But if I used 1gb ram on a windows server could I use 0.5gb on Lynix and have it still work as good

river oracle
#

for what

#

your minecraft server?

#

that's not how that works if so lol

kind hatch
#

The only reason you should ever run a Windows server is if you need Active Directory integration for your business. Otherwise, stick with a linux server.

#

Nearly everything runs on it since it is quite literally the backbone of the internet.

#

Also, lower RAM usage means more headroom for your applications.

sterile sapphire
#

But if I had a world running of Linux that’s a 7x7 chunk world where even 95% of that is void, how much ram should I dedicate?

young knoll
#

same amount as windows

sterile sapphire
#

But doesn’t windows use more?

slender elbow
#

if an entity takes 2kB of memory on windows, it'll take the exact same 2kB on linux

kind hatch
slender elbow
#

the amount of memory the JVM will use up does not change

kind hatch
#

Also that for java programs ^

#

Other applications will vary

slender elbow
#

at worst it will vary by a very tiny amount, we're talking kB, maybe couple MB, but definitely not something to worry over

sterile sapphire
#

So If I used 1gb ram on windows I should use the same now

slender elbow
sterile sapphire
#

But if I have 8gb of ram

sterile sapphire
#

Like 0.5?

kind hatch
sterile sapphire
#

2gb for a survival world

#

I’m walking like no way near as big as a survival world

kind hatch
#

Is this a server for yourself? One to share with friends? Or are you trying to make it large scale?

sage patio
#

best launcher available! lol

sterile sapphire
#

Just a very very tiny world for no more than 10 ppl on at a time

kind hatch
#

Are you setting a world border?

sterile sapphire
#

No

#

Well

#

Just got barrier blocks

sterile sapphire
kind hatch
#

??

#

/worldborder

sterile sapphire
#

Oh

kind hatch
#

If you aren't going to set one, you'll want to provision a little more than 2GB. (Probably 3GB)
10 people is going to put strain on the server if you don't pregen the world, I'd recommend 4GB at first, then downgrade to 2GB once it's been pregenned.

sterile sapphire
#

What’s the different in having just barrier blocks?

young knoll
#

The worldborder looks nicer

kind hatch
young knoll
#

Also it extends past the top and bottom of the world

topaz cape
#

also does it support versions with no hex colors like 1.13?

kind hatch
#

They nuked it when they merged it into paper.

sterile sapphire
#

So there gonna be no more than 50K blocks there

#

And that’s a huge stretch

kind hatch
#

Oh, well if it's a void world, then 2GB should be plenty for your player count.

sterile sapphire
#

Even just for 10 players

#

Wait did I say like 10 spread other a few servers

#

Prob only every like 1-3 on this 1 at a time lol

kind hatch
#

Wut

young knoll
#

10 players on 3 servers takes more ram than 10 players on 1 server

#

Since you need 3 seperate servers

sterile sapphire
#

So 10 player max over 5 different 1gb servers is what I’m hoping for

wet breach
#

10 players max?

kind hatch
#

Can Spigot even run on 1GB?

wet breach
#

no

young knoll
#

Technically, yes

sterile sapphire
kind hatch
#

What about 1.5GB?

sage patio
wet breach
#

think the minimum is 2GB due the stack frame size being an issue and some other things

young knoll
#

1 way to find out

sterile sapphire
kind hatch
#

Ok, so I'm not crazy then.

wet breach
#

might be able to get it to run it with less doubt it will run very well if you do XD

sterile sapphire
#

I’ll help you all updated shall I šŸ˜„

kind hatch
#

Good to know

pastel relic
#

Can you set a max width to the popup when you hover over an item in a GUI so text doesn't overfloat and it wraps instead (like item lure)?

young knoll
#

Nope

sterile sapphire
kind hatch
young knoll
#

You have to shrink the lore

kind hatch
#

^

#

Can't re-render the tooltips programtically.

young knoll
#

Aka split it into more lines

#

Looks good to me

#

kek

pastel relic
#

how though? its annoying to do it using \n every time you want the line to wrap

young knoll
#

Use chatpaginator

#

It can automatically split lines over a certain length

#

(Without slicing words in half)

kind hatch
#

Some fancy stuff

sterile sapphire
young knoll
#

Technically

#

yes

sterile sapphire
#

Yay

pastel relic
sterile sapphire
#

Now let’s set 5 of them up

kind hatch
sterile sapphire
#

šŸ˜„

young knoll
#

It even has 3 plugins installed!

worldly ingot
# topaz cape simpler for users tbh

Users can, should, and will inevitably learn to like modern things better. Numeric block and item ids were "easier" for people too, but now you can just use the block's name. Raw text components are objectively more difficult but at least MM lets people use XML-style grammar which is way more user friendly. <red>Hello</red> is a lot more readable to the average person than &4Hello is. Is legacy text shorter? Yes. But it's far from readable nor is it easier if you just take the extra key strokes. Your fellow server administrators will thank you later for using it

sage patio
kind hatch
young knoll
#

Hey

#

The GC has to earn its pay

sterile sapphire
#

So gotta make do

young knoll
#

Simply get more

#

download more ram

sterile sapphire
#

How much cost?

wet breach
# kind hatch Ok, so I'm not crazy then.

last time I ran mc and spigot at less then 1GB think it was just above 512mb of ram. I had to modify quite a bit of jvm arguments to just get it to launch and then some more to even be able to play lol. Have to modify quite a bit for it to run on extremely limited ram

kind hatch
sterile sapphire
#

And I’ll prob have to ipgrade more stuff then

#

The pc Ik 20 years old

young knoll
#

I think RAM may be the least of your worries

wet breach
#

the cpu is going to die

kind hatch
#

20 years old? How is it even running minecraft?

wet breach
#

so what a pentium 4?

young knoll
#

20 years ago was 2003

wet breach
#

also don't know if 64 bit came out then, so you would be stuck at 32bit with 4GB of ram

young knoll
#

You may want to stick to roller coaster tycoon 2 on that thing

wet breach
young knoll
#

Yeah I don't trust my 10 year old CPU to run 5 servers

#

Let alone a 20 year old one

sterile sapphire
#

Maybe not 20, 10-15+

#

Very old

kind hatch
#

Soooo, an early gen i3?

sterile sapphire
#

I’ll send a photo tmrw

wet breach
sterile sapphire
#

It has a cbvd thingy in it

wet breach
#

yeah that is normal

sterile sapphire
#

To watch film in and the crap

kind hatch
#

You mean a disc reader?

wet breach
#

it would be better if it still had the floppy drive

sterile sapphire
young knoll
#

Like my old computers in elementary school!

wet breach
young knoll
#

... and high school

kind hatch
#

To be fair, I still had one in my tower up till 2019, so I get it.

wet breach
#

I have a 1999 computer that is a pentium 3, has 4GB of ram and runs windows 7 šŸ™‚

kind hatch
#

Rip. It's gonna be EoL by the end of the year right?

sterile sapphire
#

And we have a box full of 2gb ram

sterile sapphire
wet breach
sterile sapphire
#

And remember it’s a mini pc

sterile sapphire
kind hatch
young knoll
#

You should run 5 servers on it

sterile sapphire
#

And I’ve been planning on

opal carbon
#

wait is spawn player packet removed

#

in 1.20.2

young knoll
#

iirc yes

opal carbon
#

interesting

wet breach
#

right now its in storage but I typically use it to run random things on there and tests

#

if it can run on that old hardware

opal carbon
#

so im assuming instead of spawn player its just going to be move player?

wet breach
#

then those with nerwer should be able to run it XD

young knoll
#

I think it justs uses the normal spawn entity packet now

#

lemme check

#

Yeah it does

bitter rune
#

what would be the best way to get the players information for movement? only vector and velocity or are there other factors?

echo basalt
#

uhh

#

you logging stuff?

bitter rune
#

for now yeah

echo basalt
#

There are lots of factors

#

like if the player is swimming, flying with an elytra, just flying

#

sprinting, sneaking

bitter rune
#

... im not that advanced in math to understand the logic, its just for running around

echo basalt
#

No clue what you're trying to do

young knoll
#

Just store their position every tick and reconstruct from that

#

Kek

echo basalt
#

also you can't run if you have blindness

#

and some other stuff

bitter rune
#

im essentially trying to find out the numbers and what happens based on movement

opaque scarab
#

I tried to create a class that creates a display block at the location of a block, replacing it. I want to angle the position of the block, orbiting it around a centerpoint, the origin. The display does not seem to orbit around the origin properly.

#
public BlockNode(Location origin, Location loc, Block block) {
        this.origin = origin;
        this.loc = loc;
        this.block = block;

        this.radius = origin.distance(loc);

        display = (BlockDisplay) block.getWorld().spawnEntity(loc, EntityType.BLOCK_DISPLAY);
        display.setBlock(block.getBlockData());

        location = loc.clone().setDirection(loc.clone().subtract(origin).toVector());
        originYaw = location.getYaw();
        originPitch = location.getPitch();

        Bukkit.broadcastMessage("Yaw:" + originYaw + " Pitch:" + originPitch + " X:" + loc.getX() + " Y:" + loc.getY() + " Z:" + loc.getZ() + " Radius:" + radius);
    }

    public void setAngle(Float yaw, Float pitch) {
        Location newLocation = origin.clone();
        newLocation.setYaw(originYaw + yaw);
        newLocation.setPitch(originPitch + pitch);
        loc = origin.add(newLocation.getDirection().multiply(radius));
//        Transformation trans = display.getTransformation();
//        trans.getTranslation().set(new Vector3f(Float.valueOf(loc.getBlockX()),Float.valueOf(loc.getBlockY()),Float.valueOf(loc.getBlockZ())));
//        display.setTransformation(trans);

        loc.setPitch(0);
        loc.setYaw(0);
        display.teleport(loc);

        Bukkit.broadcastMessage("Yaw:" + originYaw + yaw + " Pitch:" + originPitch + pitch + " X:" + loc.getX() + " Y:" + loc.getY() + " Z:" + loc.getZ());
    }
bitter rune
worldly ingot
#

Rotation isn't done by pitch and yaw, it's done by the transformation

#

There's a rotation transformation

young knoll
#

2 actually

#

Left and right

worldly ingot
#

Right

young knoll
#

Setting them the same seems to be the easiest

opaque scarab
#

Alright, so what your saying is there is a method to create a transformation, set the origin, and input the angles, then apply the transformation to the display’s location?

#

My end goal here is to turn a structure into a series of block displays, and rotate them along an axis

young knoll
#

You’re already editing the displays transformation

#

Rotation is also part of that

worldly ingot
#

Commented out

orchid gazelle
#

Btw how performant are blockdisplays?

worldly ingot
#

They don't tick

#

As performant as you can get

orchid gazelle
#

Compared to like... entities

#

Especially for clients

worldly ingot
#

An entity is an entity

opaque scarab
#

I’ve seen plugins use hundreds of block displays with no lag

orchid gazelle
#

I tried to use FallingBlocks to display schematics, but then the game started to sa y "fuck this shit im out"

young knoll
#

Block displays are entities

opaque scarab
young knoll
#

Client side they are the same

orchid gazelle
#

So you think im fine displaying a 300x300 block of it?

worldly ingot
#

I would avoid it lol

young knoll
#

Wait wait

worldly ingot
#

That's thousands of entities

young knoll
#

Is that a solid block

#

Because that’s 90,000 entities

#

Lmao

orchid gazelle
#

I also tried using fake block packets, but that fucked the client with lighting updates somehow

opaque scarab
#

Maybe 200

young knoll
#

I did like

orchid gazelle
#

200 is nothing

young knoll
#

2k text displays before the game became unplayable

#

But yeah 90k is not happening

orchid gazelle
#

Then an issue would be that im testing with a really heavy GPU not counting in that players have GPUs dimensions dumber than mine

young knoll
#

I mean you can always test it

#

Spawn 90k display entities and see how your game likes it :p

orchid gazelle
#

When finally performant entities?

#

Game should EASILY be able to make 90k block display entities happen

young knoll
#

Can’t think of many games that handle dynamic entities that well

worldly ingot
#

TABS maybe

orchid gazelle
#

Client probably runs so much useless stuff on display entities that don't even transform and shit

weak meteor
#

whats this error?

bitter rune
young knoll
#

Yeah

#

TABS is a valid example

weak meteor
#

and the dependency is there

opaque scarab
#

So would this code make the display rotate around the entity’s true location? Transformation transform = display.getTransformation(); trans.getLeftRotation().set(new Quaternionf().rotateZYX((float) Math.toRadians(z),(float) Math.toRadians(y),(float) Math.toRadians(x))); trans.getTranslation().set(offset); display.setTransformation(transform);

dense geyser
#

I'm trying to load offline players by UUID who've never joined the server before (which I've done), then add them to the games internal save file for that kind of stuff. Where is that done in spigot so I can replicate it, or does anyone know how it's done?

young knoll
#

What internal save file

#

Like the offline player cache

slender elbow
worldly ingot
#

Talk about existential crisis

young knoll
#

This is one of the fundamental questions of life

woeful wind
#

Does anyone know about Recaf?

echo basalt
#

@vagrant stratus

#

Is your local expert

dense geyser
young knoll
#

Yeah

#

Should be easy enough to modify

#

It’s just json

dense geyser
#

is there a way I need to load it in though through like nms or cb, since cb has an internal offlineplayers map in CraftServer etc

torn oyster
#

would the best way to do a speedrun timer be increasing a double by 0.1 every 2 ticks?

#

or is there a better way to do it

kind hatch
#

Would system time not be good enough?

torn oyster
#

well i would like it to be shown on a placeholder using placeholderapi

#

so it has to be a variable of sorts

kind hatch
#

That can be done, but that's only gonna update as fast as the scoreboard can refresh. Which I think can be done quickly, but I haven't used scoreboards all that much.

young knoll
#

Can be done every tick

opaque scarab
#

I want to make a display entity orbit to a new position around a location, the origin. I’m told using a Bukkit transformation is best. I have a display entity at a starting point, and I want the display to be positioned at a specific angle from the origin through a vector. How might I do this? Here’s a picture to illustrate btw. Also, trans.getLeftRotation().set(new Quaternionf().rotateZYX((float) Math.toRadians(z),(float) Math.toRadians(y),(float) Math.toRadians(x))); Can rotate a display block around it's center, but not around a specified origin Location. Any ideas?

sullen marlin
vagrant stratus
undone axleBOT
#

If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!

woeful wind
#

Why does my .jar always give an error in the code?

vagrant stratus
#

what's the error?

echo basalt
#

I should prob learn rotation matrixes n stuff

candid galleon
#

get a tex bot in here

lilac dagger
echo basalt
#

I guess

#

Has the chat really been dead for 5 hours

sullen marlin
#

F

chrome beacon
#

F

smoky anchor
#

F

orchid gazelle
#

F

tall dragon
#

F

sage patio
#

F

woeful wind
#

F

dawn flower
#

at what version did nms become version independent with importing? i need it to use reflection for older versions cuz itll just throw an error if i do it the old way on a new server (net.minecraft.version) and itll throw an error if i do it the new way on an old server (net.minecraft.whatever)

gray merlin
#

For some reason I can't access my plugin's page

#

It tells me I don't have permission

#

Why is this? It doesn't seem to happen for other plugins

dawn flower
#

exactly 1.17 or like 1.17.1

chrome beacon
#

Not entirely clear by the Spigot release post

#

Try it and see

dawn flower
#

ill just do 1.17

#

ty tho

chrome beacon
sage patio
#

how can i get a font from the file?

sage patio
#

i checked this last night, nope didn't succeed to load it

grizzled sable
#

Ohh okay do you get some errors ?

sage patio
#

yea ig i've to implement some APIs or classes which i don't know how

grizzled sable
#

Have you Check all Imports Like in docs ?

sage patio
#

yea the problem is i don't have the library

#

i don't know where is it

gray merlin
#

I didn't get any alert or email about it though

#

And I don't understand why it would be deleted

eternal oxide
#

plugins only get deleted if you ask for it or its found to have a trojan/virus.

gray merlin
#

Then it definitely didn't get deleted

eternal oxide
#

link?

gray merlin
#

One sec...

eternal oxide
#

did you upload a jar for it?

gray merlin
#

I uploaded many versions, and it had jars for every version of mc in it

dawn flower
#

will this work?

    private static void sendPacket(Player player, Object packet) throws ClassNotFoundException, NoSuchFieldException, NoSuchMethodException, InvocationTargetException, IllegalAccessException {
        Class<?> craftPlayerClass = Class.forName("org.bukkit.craftbukkit." + getVersion() + "entity.CraftPlayer");
        Class<?> packetClass;
        Object playerConnection;
        Method sendPacketMethod;
        Object craftPlayer = craftPlayerClass.cast(player);
        Object entityPlayer = craftPlayer.getClass().getDeclaredMethod("getHandle").invoke(craftPlayer);
        if (getRawVersion() >= 17) {
            packetClass = Class.forName("net.minecraft.network.protocol.Packet");
            playerConnection = entityPlayer.getClass().getDeclaredField("b");
            sendPacketMethod = playerConnection.getClass().getDeclaredMethod("a", packetClass);
        } else {
            packetClass = Class.forName("net.minecraft.server." + getVersion() + ".Packet");
            playerConnection = entityPlayer.getClass().getDeclaredField("playerConnection");
            sendPacketMethod = playerConnection.getClass().getDeclaredMethod("sendPacket", packetClass);
        }
        sendPacketMethod.invoke(playerConnection, packet);
    }```
eternal oxide
#

?support

undone axleBOT
quiet ice
lost matrix
dawn flower
#

its 1 time per 30 mins

#

shouldnt affect it that much

lost matrix
echo basalt
#

pre-cache your variables n stuff

dawn flower
#

but idk if itll work if i shade it

#

people say it causes issues

echo basalt
#

ProtocolLib's listeners run on a separate thread

lost matrix
dawn flower
#

i told him it doesnt affect the server

echo basalt
#

ProtocolLib's packet sending can be called on the main thread but will just be added to a queue that's processed async

dawn flower
#

and he still doesnt want it

echo basalt
#

Your friend's an idiot but anyways

dawn flower
#

fr

echo basalt
#

Let's optimize this a bit at least

dawn flower
#

how?

gray merlin
lost matrix
dawn flower
#

i need multi version support

#

for 1.8.8 & 1.19 and above

lost matrix
#

That is a very weird line of versions. Does this plugin need to run on a 1.8 and a 1.19 server?

young knoll
#

If you want something shadeable there is always packetevents

dawn flower
#

not both

#

like

#

its not for 1 person only

#

like

#

idk how to explain this

lost matrix
#

Alright, did you check if sending packets is necessary?
Do you need this for only a specific use case or should this
be used for generally sending packets.

dawn flower
#

custom mining & block manipulation client side so prob necessary

lost matrix
#

Myeah for old garbage versions like 1.8 you need packets for that. Newer versions have APIs for custom block crack animations.

#

Hi there! Today I’m going to explain how to setup a multi-module project using maven to support different NMS versions. Important notes about this tutorial: Every step will have detailled screenshots using IntelliJ. I explicitly chose not to include everything as copy/pastable source code, but normal screenshots (you can click on them to show th...

#

This might be the better approach than using reflections.

dawn flower
#

alright

lost matrix
#

It lets you use NMS for different versions in one plugin.

quaint mantle
#

where can I ask questions related with bungeecord?

#

couldnt really find the server

chrome beacon
#

You're in the right place

young knoll
#

This is the server

sullen canyon
quaint mantle
#

oh alr

echo basalt
#
private static final Method GET_PLAYER_HANDLE;
private static final Field PLAYER_CONNECTION_FIELD;
private static final Method SEND_PACKET_METHOD;

static {
  Class<?> craftPlayerClass = Class.forName("org.bukkit.craftbukkit." + getVersion() + "entity.CraftPlayer");

  GET_PLAYER_HANDLE = craftPlayerClass.getDeclaredMethod("getHandle");
  Class<?> entityPlayerClass = GET_PLAYER_HANDLE.getType();

  if (getRawVersion() >= 17) {
    Class<?> packetClass = Class.forName("net.minecraft.network.protocol.Packet");
    PLAYER_CONNECTION_FIELD = entityPlayerClass.getDeclaredField("b");
    SEND_PACKET_METHOD = PLAYER_CONNECTION_FIELD.getType().getDeclaredMethod("a", packetClass);
  } else {
    packetClass = Class.forName("net.minecraft.server." + getVersion() + ".Packet");
    PLAYER_CONNECTION_FIELD = entityPlayerClass.getDeclaredField("playerConnection");
    SEND_PACKET_METHOD = PLAYER_CONNECTION_FIELD.getType().getDeclaredMethod("sendPacket", packetClass);
  }
}

private static void sendPacket(Player player, Object packet) throws InvocationTargetException, IllegalAccessException {
    Object nmsPlayer = GET_PLAYER_HANDLE.invoke(player);
    Object playerConnection = PLAYER_CONNECTION_FIELD.get(nmsPlayer);
    SEND_PACKET_METHOD.invoke(playerConnection, packet);
}
#

sum like this

#

optimized reflections way

#

took me forever

quaint mantle
#

alrighty so this code

package io.github.dungeonproxy;

import net.md_5.bungee.api.ChatColor;
import net.md_5.bungee.api.ProxyServer;
import net.md_5.bungee.api.config.ServerInfo;
import net.md_5.bungee.api.connection.ProxiedPlayer;
import net.md_5.bungee.api.event.ServerConnectEvent;
import net.md_5.bungee.api.plugin.Listener;
import net.md_5.bungee.api.plugin.Plugin;
import net.md_5.bungee.event.EventHandler;

public class EventListener extends Plugin implements Listener {

    @Override
    public void onEnable() {
        getProxy().getPluginManager().registerListener(this, this);
    }

    @EventHandler
    public void onServerConnect(ServerConnectEvent event) {
        ProxiedPlayer player = event.getPlayer();
        String serverName = "entrance_dungeon_floor";

        ServerInfo serverInfo = getProxy().getServers().get(serverName);
        int maxPlayers = serverInfo.getPlayers().size();

        if (!getProxy().getServers().containsKey(serverName)) {
            player.sendMessage(ChatColor.RED + "The server " + serverName + " was not found.");
            event.setCancelled(true);
            return;
        }

        if (getProxy().getServers().get(serverName).getPlayers().size() >= getProxy().getServers().get(serverName).getPlayers().size()) {
            player.sendMessage(ChatColor.RED + "The server " + serverName + " is currently full.");
            event.setCancelled(true);

            player.connect(ProxyServer.getInstance().getServerInfo("limbo"));

        }
    }
}``` throws the error
```yaml
Cannot invoke "net.md_5.bungee.api.connection.Server.getInfo()" because the return value of "net.md_5.bungee.api.connection.ProxiedPlayer.getServer()" is null``` 
can the fix be (#.getServer() == null)?
echo basalt
#

serverInfo can be null, yes

#

ProxiedPlayer.getServer can also be null when the player is first joining

#

at least I'd assume so

lost matrix
#

ServerConnectEvent is also called for a new player.
Which means getServer() returns null because the player wasnt connected to another server before

quaint mantle
#

oh

#

so

echo basalt
#

your containsKey check can be replaced with a nullability check

#

but it wouldn't reach that far

quaint mantle
#
 if (player.getServer() == null) {
            return;
        }```
#

?

echo basalt
#

getting the max player count would cause exceptions anyways

quaint mantle
#

pong ping

echo basalt
#

bim bim bam bam

quaint mantle
echo basalt
#

?tryandsee

undone axleBOT
quaint mantle
#

alr man

#

also was there ever a different server for bungeecord?

#

or am I trippin

echo basalt
#

no clue what you on about

quaint mantle
#

ops

echo basalt
#

black ops

quaint mantle
#

this

echo basalt
#

you mean Velocityā„¢ļø?

quaint mantle
#

na bungeecord

echo basalt
quaint mantle
#

hi epic

remote swallow
#

Or waterfalfal

young knoll
#

A different discord server?

#

No

echo basalt
#

DragonProxy pointandlaugh

quaint mantle
#

ig I was trippin

quaint mantle
echo basalt
#

no

#

damn someone left a docker instance running forever

young knoll
#

That spike up to 5 tho

#

Let’s go

quaint mantle
#

thought it was mine

glad prawn
#

ur Dungeon

quaint mantle
#

whats the thing called

#

I forgot

#

like it makes the message appear like that

#

can soemone embed that

young knoll
#

Subtitle

quaint mantle
#

na

#

uhh

#

the message appears on the players screen

young knoll
#

Yes

#

That’s a subtitle

quaint mantle
#

#sendTitle?

young knoll
#

Mhm

quaint mantle
#

o

young knoll
#

You can send an empty title to just show a subtitle

echo basalt
#

p much

sly heron
#

hey i have a minecraft server with velocity proxy

i get this error after few hours that server is online from proxy console and no one else can connect my server any more :

[15:36:31 WARN] [io.netty.channel.nio.NioEventLoop]: Failed to close the old Selector.
java.lang.InternalError: java.io.IOException: An existing connection was forcibly closed by the remote host
at sun.nio.ch.WEPollSelectorImpl.wakeup(WEPollSelectorImpl.java:238) ~[?:?]
at sun.nio.ch.SelectorImpl.implCloseSelector(SelectorImpl.java:183) ~[?:?]

[15:36:31 INFO] [io.netty.channel.nio.NioEventLoop]: Migrated 1 channel(s) to the new Selector.
[15:36:31 WARN] [io.netty.channel.nio.NioEventLoop]: Unexpected exception in the selector loop.
java.io.IOException: An existing connection was forcibly closed by the remote host
at sun.nio.ch.IOUtil.drain(Native Method) ~[?:?]
at sun.nio.ch.WEPollSelectorImpl.clearInterrupt(WEPollSelectorImpl.java:248) ~[?:?]
at sun.nio.ch.WEPollSelectorImpl.processEvents(WEPollSelectorImpl.java:186) ~[?:?]

how can i fix it ?

gray merlin
#

Yeah that makes sense

chrome beacon
gray merlin
#

Thanks for directing me to support! It's all fixed now.

echo basalt
#

homeboy seriously made a maven module for each minecraft version woeisme

upper hazel
#

wth with bukkitRunnuble why i have error when try check "isCanceled"

#

i mean i cant use it in start

#

when bukkitRunnuble not started

wet breach
upper hazel
#

lol then how do I check if a thread is running in a loop or not?

wet breach
#

because its set after it is scheduled. If something came along and cancelled it gets set because its scheduled. The only way you can have an instance of a runnable is if its scheduled or started

upper hazel
#

if i cancel this i can check this again

#

i mean if this canceled so is "null"

#

i not can

#

or

wet breach
#

as long as it hasn't been removed from the list that manages the tasks scheduled

upper hazel
#

and when it is removed

wet breach
#

so a task that is scheduled can get cancelled before the scheduler has time to run the task

#

and then once the scheduler has time to come across your task, it will then remove it from the list afterwards and not run it since its cancelled

upper hazel
#

so if i cancel runnuble this be erased ? end i again not can check

wet breach
#

after a bit of time yes eventually it will be erased, this is why you retain the task id

#

so you can ask the scheduler if a certain task id exists

#

and then if it does, you do another check to make sure its your task by grabbing the task via its id

#

and if its yours, check if its been cancelled or not

upper hazel
#

what a hassle omg

wet breach
#

well task id's can be resused

upper hazel
#

i create new runnuble

#

in start

#

i mean when it canceled i need erase it

#

or i have IlligalStateExeption

wet breach
#

the scheduler will erase it, you can schedule another task that is a duplicate btw

#

you are not limited to schedule a single task

upper hazel
#

oh cool

wet breach
#

so if the task you wanted to run was cancelled but then decide it should run, you instead just schedule a new task

upper hazel
#

It turns out you need to use task id?

wet breach
#

you use the task id so you can check if your task is still in the list

upper hazel
#

if not is be canceled

wet breach
#

either it was cancelled or it ran, in either case the scheduler ran your task in accordance of whatever was set

upper hazel
#

i see

torn shuttle
topaz cape
#

is there a simple method of disabling chat reports in paper?

river oracle
#
  1. This isn't paper
  2. This ain't a paper specific issue
  3. Yes just get a plugin
topaz cape
river oracle
#

Don't reinvent the wheel

hasty prawn
#

If Paper has fixed some workarounds that would work in Spigot, you'd be better off asking in their Discord

river oracle
#

The most sophisticated way to do this is packet interception Kaspers plugin is open source so you can look at his code

remote swallow
river oracle
#

Though if his plugin doesn't work on paper you should make an issue on github

solid cargo
#

Wait is paper ultra pro-chatreporting?

quaint mantle
#

Identity changed!

#

From mausaen to 7bytes

#

This is something I would've needed to post in general

echo basalt
#

No clue who you are anyways

shadow night
echo basalt
#

Don't argue with ahmed

#

No point in doing so

shadow night
#

Avg paper user?

echo basalt
#

Blud goes with the ignorance path

#

Tried flaming me for saying alhamdullillah out of context

#

ĀÆ_(惄)_/ĀÆ

#

lmfao 10/10 tebex live demo experience

candid loom
#

W

vast ledge
echo basalt
#

"click here to try this demo"

#

clicks

vast ledge
#

gives 403

#

No

#

you cant do that

#

Why gradle gotta be such a b**h sometimes

#

like just import this shit

#

stop complaining

#

maven is slower

#

how it better if it slower

lost matrix
vast ledge
#

I know how gradle works

lost matrix
#

Nice, anecdotal evidence

vast ledge
#

The first build takes a bit, but it caches the resources unlike maven

lost matrix
#

Was about to bring up the caches

hazy parrot
#

I suppose you do clean package always lol

vast ledge
#

no, i just use build

lost matrix
#

So this is the same argument that MongoDB brings regarding the performance relative to SQL dbs.
They add a huge cache and tell everyone they are just faster.

hazy parrot
vast ledge
#

I agree

lost matrix
#

I think its a bit more nuanced

vast ledge
#

You cannot compare those

#

that also applies to maven and gradle

#

cus one does something that the other doesnt

#

But I also dont agree with one being objectively better

lost matrix
#

Most comes down to preference. Unless its JS. Then its objectively rubbish.

tall dragon
#

any1 have a project using model engine 3 i could take a look at?

lost matrix
#

If i can still find it. But its a bit sewn together.

tall dragon
#

dont matter

#

anything is better than nothing

vast ledge
#

wait

#

no

#

ye

#

maybe?

#

noo

#

Do you also have something against TS

lost matrix
#

TS is acceptable

vast ledge
#

Phew, my api uses it

quaint mantle
vast ledge
#

I have so many questions

onyx fjord
#

God bless that guy

earnest socket
#

Anyone know what could be causing my world custom generator to go back to the vanilla one on some restarts? I don't get any errors so idk why it switches to vanilla

vast ledge
onyx fjord
#

so what

#

what he said was just unversally nice

earnest socket
onyx fjord
#

would you take "God bless you sir" on the street as insult then?

misty ingot
onyx fjord
#

nobody even has any idea what you believe in or you dont believe

gleaming grove
#

I don't know if it's an bug or what, but code gives different output for Release compilation and Debbug compilation.
I've never seen anything like this before, how could I deal with it?

onyx fjord
#

šŸ¤”

tall dragon
lost matrix
tall dragon
shell robin
#

how can i get custom head

chrome beacon
#

Spigot 1.18.1 added the new PlayerProfiles class, which finally allows us to use custom heads without needing any reflection! You can obtain them as normal items, or actually place them down into the world. I’ll show you how both works: Creating a new PlayerProfile First, we gotta create a new PlayerProfile object. To do so,...

echo basalt
#

hmm how the fuck would I make my database abstraction modular so that separate "modules" / subprojects can use my main database hmm

#

When you know what data you're working with it's somewhat fine

#

I also don't want to just have a codec because indexing and sorting operations are important

remote swallow
#

if i have a nms project, and i wanna distribute a -core that has the nms in how would i do that, bc the interface for nms would be inthat so the nms module would need to depend on that but it needs to depend on the nms module

echo basalt
#

shade it and init with reflections

#

hm

remote swallow
#

the init with reflections i would do already

#

just the dependency stuff

#

so i dont have nms doesnt have core and core doesnt have nms

young knoll
#

Wut

remote swallow
#

okay hold on

young knoll
#

In my projects the NMS modules all rely on core

#

But core doesn’t rely on any of the NMS modules

remote swallow
#

lets say i have my parent project, that is just empty, i have a core project that has the core stuff of my lib, i will make other modules i wanna distribute under their name and i wanna distribute core as core, but core should have nms shaded in except core will have the underlying stuff for nms, eg the interface of methods

#

i can make a shit diagram if you want

young knoll
#

Core doesn’t need to rely on NMS then

remote swallow
#

core has to shade it

#

bc core is the end one used

#

hold on

young knoll
#

You should have another module the bundles it all together

remote swallow
#

what could i call that

young knoll
#

Idk

#

dist

remote swallow
#

i dont like the name dist though

#

thats why i wanna do it with core

#

do i rename core to core-api and then new core with the deps?

young knoll
#

You can also just have the root project bundle it all together

remote swallow
#

i mean

#

would that get confusing

#

if you depend on xyz for the main lib, but you could have xyz-something as an extension?

young knoll
#

Generally people would only depend on xyz or xyz-api

#

Either the entire thing with implemention or just the api

#

Just like with spigot-api vs spigot

remote swallow
#

so i have my core, that has lib stuff, then im gonna make a storage module that could include stuff related to storage been as that might be huge

#

i wouldnt want to depend on xyz-storage and now have the core if i only need storage

#

wait

#

im not shading stuff thats that big so maybe i dont need that

#

hmmmmmmmmmmmmm

#

i need a brain

#

whos can i borrow

echo basalt
#

hm

#

doing my own database stuff

#

the decorator pattern isn't what I want

#

but some sort of inheritance thing

#

mm I can do this with 19 different abstract classes

#

shit..

remote swallow
#

thats like nothing

#

do it

echo basalt
#

pain

kindred sentinel
#

how to create particles

young knoll
#

Player.spawnParticle

#

Or World.spawnParticle

kindred sentinel
#

how to spawn particle of item?

#

like when you eat something

#

or break

young knoll
#

ITEM_CRACK I believe

#

Or BLOCK_DUST

kindred sentinel
#

and how to set an item for this?

young knoll
#

Pass it as the extra data

echo basalt
#

this is starting to get overly complex

#

can't wait to implement a weird inheritance chain

remote swallow
#

✨ hibernate ✨

echo basalt
#

no

kindred sentinel
echo basalt
#

fuck orm

remote swallow
#

no

kindred sentinel
echo basalt
#

but at least I can do

young knoll
#

There are methods that take extra data on the end

#

This is all in the javadocs

remote swallow
#

?jd0s

#

?jd0s

#

?jd0s\

#

?jd0s

#

?jd-s

undone axleBOT
remote swallow
#

there we go

echo basalt
#
SkyblockDatabase database = ...;

if(!database.hasTag(REMOTE)) {
  // refuse to load sharding stuff
}
#

:)

young knoll
remote swallow
#

sounds about right

#

cant use it, makes my life easier though\

echo basalt
#

and it's all inheritance based so I don't have to specify every single tag for every single database type

#

My idea is to segment this into niche databases now

#

instead of just storing player and island data, I have a mongo core and an island storage impl

#

wish me luck

#

I have to remake all of this

young knoll
#

Mongo is cheating

#

Kek

echo basalt
#

grr I have to split all of this

#

šŸ™

kindred sentinel
#

?

echo basalt
#

?tryandsee

undone axleBOT
kindred sentinel
#

i'm not sure that it should be so fast and small...

remote swallow
#

bc mc spawns multiple

#

thats 1

upper hazel
#

?paste

undone axleBOT
kindred sentinel
# remote swallow thats 1

i did

player.getWorld().spawnParticle(Particle.ITEM_CRACK, player.getEyeLocation(), 8, 0.01, 0.01, 0.01, usedItem);

but it's too fast..

upper hazel
lilac dagger
#

There's also speed

remote swallow
upper hazel
#

wdym

remote swallow
#

using a normal runTasskTimer with BukkitTask

upper hazel
#

i shold use nums?:?

echo basalt
#

time to rethink this all

kindred sentinel
lilac dagger
#

I think i have a method somewhere

upper hazel
#

scheduler

remote swallow
#

you still use scheduler

#

just not like that

kindred sentinel
remote swallow
#

wouldnt this need each block on a seperate timer

lilac dagger
#

it's for snowball particles

kindred sentinel
#

oh

#

so.. how to do that...

lilac dagger
#

but it should be the same thing

#

spawnParticle has a speed parameter

#

just set it to 0

remote swallow
kindred sentinel
#

like this?
player.getWorld().spawnParticle(Particle.ITEM_CRACK, player.getEyeLocation(), 8, 0, 0, 0, usedItem);

#

it doesn't work for some reason

grim hound
#

did you mean to spawn them where the player's looking at?

kindred sentinel
grim hound
#

then it still should be a little bit to the front I think

kindred sentinel
#

hmmm

remote swallow
#

the class Instant

upper hazel
#

oh i see

young knoll
#

I belive I got a fairly decent looking eat animation in the past

#

Lets see what values I used

kindred sentinel
grim hound
#

got it from the internet

#

and it works

young knoll
#
world.spawnParticle(Particle.ITEM_CRACK,
                        player.getEyeLocation().add(player.getEyeLocation().getDirection().multiply(0.7)).subtract(0,
                                0.75, 0),
                        0, -0.5 + rand.nextDouble(), 2.2 + rand.nextDouble(), -0.5 + rand.nextDouble(), 0.1f,
                        new ItemStack(edibleItem.getParticle()));
#

That's apperently what I used to use

grim hound
young knoll
#

yeah yeah it's old

#

But you can make use of the values

pseudo hazel
crystal swift
#

Hi can anyone check if this code works and why the getItemInHand is like this getItemInHand? https://ibb.co/kHZsd06

quaint mantle
#

Guys I need help

young knoll
#

Players have 2 hands

crystal swift
young knoll
#

probably

grim hound
young knoll
#

I belive getItemInHand just redirects to the main hand

#

But like

#

Fix it

crystal swift
#

how xD

grim hound
young knoll
#

Read the deprecation message

quaint mantle
#

I modified the spigot-api's code, only by creating a new listener class in it. I used maven local import to get the configured API work properly. I did only try a few methods, that were basically in the spigot-api, they all worked as expected. But when I was trying to access my custom class, I wasn't able to.

young knoll
#

Did you do all the steps properly

quaint mantle
young knoll
#

Run buildtools to get the source
Make your changes
maven install to push said changes into your maven local

young knoll
#

Are you depending on the right thing

quaint mantle
#

I wasn't using the repository anymore, only that local jar.

young knoll
#

If you modified bukkit you need to depend on bukkit

#

not spigot

quaint mantle
#

I changed it from org.spigotmc to org.bukkit

upper hazel
quaint mantle
#

But it didnt do anything

upper hazel
#

but when i check is return false always

kindred sentinel
worldly ingot
#

I would avoid the task ids and opt instead for the BukkitTask objects. They're a little easier to work with

#

Instead of scheduleSyncRepeatingTask(), use runTaskTimer(), same arguments, but returns a BukkitTask object on which you can call cancel() and isCancelled()

upper hazel
#

ok

worldly ingot
#

You also definitely do not need a ConcurrentHashMap here if you're running your task synchronously. Just a regular HashMap should be fine

young knoll
#

Make everything thread safe

#

Just incase another thread decides to poke it

worldly ingot
#

synchronize all the things burn

young knoll
#

You never know what those threads be doin

upper hazel
#

but there is a problem isCancaled cannot be used BEFORE starting the thread

worldly ingot
#

No of course not but at that point the task will be null

#

I guess in your case now you could check if the taskId is > 0 lol

#

But I'd still recommend using a BukkitTask

upper hazel
#

why this better

worldly ingot
#

Just nicer to work with an object and invoke methods rather than magic integer values

upper hazel
#

ok

worldly ingot
#
    public void stop() {
        if (task != null) {
            task.cancel();
            // Optionally you can also do task = null. Up to you
        }
    }

    public boolean isStarted() {
        return task != null && !task.isCancelled();
    }```
quaint mantle
worldly ingot
#

What version are you editing, how did you build Spigot, and what does your pom.xml/build.gradle look like?

#

And are you editing Bukkit? Or Spigot? There's a difference

quaint mantle
#

Hmm... from buildtools I copied the spigot-api folder. That contains both

crystal swift
#

Hey does anybody know how I can use player.getInventory().remove(player.getItemInHand()); to only delete one Item and not every one when its in a stack?

quaint mantle
#

<dependencies>
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>spigot-api</artifactId>
<scope>system</scope>
<version>1.20.1-R0.1-SNAPSHOT</version>
<systemPath>${project.basedir}/spigot/spigot.jar</systemPath>
</dependency>
</dependencies>

#

This is how it looks like

chrome beacon
#

Why is the group id still bukkit

#

also don't use systemPath dependencies

quaint mantle
#

Everything works except for that custom class

chrome beacon
#

They're deprecated

worldly ingot
quaint mantle
worldly ingot
kindred sentinel
#

I want to convert page from book to the list of lore, but i don't know how to divide lines in book ,_,

quaint mantle
worldly ingot
#

Books are fun. They're delimited by character width not by strict string length

kindred sentinel
#

YEAH

#

that's why idk how to divide it

worldly ingot
quaint mantle
worldly ingot
# kindred sentinel that's why idk how to divide it

I don't remember exactly the width a book uses for wrapping but you do have access to MinecraftFont.Font.getWidth(String) to get the width of a simple ASCII string (Font being a static field by the way, it's just named strangely)

quaint mantle
#

Idk why when I ctrl+right click on the method, I can clearly see that there is a listener

worldly ingot
#

You're still not answering the question. Why are you doing this in Bukkit's source rather than in a plugin? Are you just adding a listener?

public class MyListener implements Listener {

    @EventHandler
    public void eventListener(Event event) { }

}```
type thing?
quaint mantle
worldly ingot
#

Okay, so firstly, don't lol. Bukkit isn't meant to be the host of listener logic. It's just meant to provide an avenue to do so for plugins

quaint mantle
worldly ingot
#

Either way, if you're trying to add something to Bukkit, edit code in the Bukkit and CraftBukkit directories. You can probably leave the Spigot directories alone in 99% of situations. Once you've made your changes to source, in either the Bukkit or CraftBukkit directory (whichever ones you made changes to), run mvn clean install to build an install the project locally. Then you can depend on it in your pom.xml as you normally would

kindred sentinel
#

sooo i need to format text with spaces...

worldly ingot
#

It will override any existing installations or repo lookups

quaint mantle
worldly ingot
#
  1. Edit code in Bukkit or CraftBukkit folders
  2. Run mvn clean install in either of those two folders, whichever ones you edited
  3. Depend on the version you built just like normal
#

That's pretty much it

kindred sentinel
#

MinecraftFont.Font doesn't work with cyrillic

worldly ingot
#

Yeah it's just plain ASCII

#

Wonder if maybe there's some way we could have it support whatever vanilla supports

kindred sentinel
#

So i'm Ukranian that's why it's a bad choice for me ._,

kind hatch
shadow night
kindred sentinel
#

šŸ˜†

#

yeah

#

only of i

#

oh wait

#

i can know the width of "o"

#

That's 2/33

#

of all alphabet

quiet ice
#

Hello! I'm geolykt - and I have yet another stupid question:

            while (true) {
                int ctrl = this.ctrl;
                if (ctrl < 0) {
                    do {
                        Thread.yield();
                    } while ((ctrl = this.ctrl) < 0);
                }
                if (!BUCKET_CTRL.compareAndSet(this, ctrl, ctrl++)) {
                    continue;
                }
                break;
            }

I have following code. I basically want to wait until ctrl is a positive number (or 0). Once it is, I want to increment ctrl by 1 (this is done via BUCKET_CTRL which is a AtomicIntegerFieldUpdater).

Is there a better/more efficent way to do this?

shadow night
grim hound
quiet ice
#

what exactly is that?

#

And what is the usecase?

tame coral
#

format non integer numbers i'd assume

quiet ice
#

It seems to do something regex but the javadocs really are not clear

solar sparrow
#

Is it possible to create chat plugin using rgb in spigot 1.8.8_v03?

quiet ice
#

Yep

grim hound
grim hound
glossy venture
grim hound
#

"Player {0} has joined the server!"

glossy venture
#

otherwise looks good

quiet ice
solar sparrow
glossy venture
#

what are you trying to do tho, is this some kind of lock mechanism

quiet ice
#

My main concern are the two while loops

grim hound
glossy venture
grim hound
#

you still have to wait, it's not like you have a choice

glossy venture
#

can an atomic operation fail

grim hound
#

that's why it's atomic

quiet ice
# glossy venture wait what is the comparison for

Basically it's an RW-lock. Values under 0 denote that some thread is attempting to resize an internal AtomicLongArray and that all read threads should wait until it completes to do so (at which point it returns to 0).

young knoll
#

RGB is a 1.16 feature

glossy venture
#

oh wait nvm

quiet ice
#

It'd be great if I could hence I'm asking

#

Perhaps something VarHandle related? But it'd need to be atomic

glossy venture
#

why compareAndSet and not increment

grim hound
slender elbow
#

why not use one of the synchronization primitives? like a Phaser or smth

quiet ice
glossy venture
#

oh true

#

ig

quiet ice
#

It's been years since I have even heard of it. Never would have known it has something to do with synchronization. But I'll check

quiet ice
slender elbow
#

java.util.concurrent.Phaser or similar, it's kind of like a countdown latch or a cyclic barrier, but the other way around, parties are registered to the phaser when they do some operation, and they can arrive/deregister once they're finished, while other threads can await/block until all parties have arrived and the phaser goes back to 0, then the waiting threads are awakened

#

they can be reused and dynamically have parties registered as needed

#

the javadoc are great

quiet ice
#

Hm, looking at it I think I only partially understood that. I think I'll go forward with my current idea and once I've set up appropriate benchmarks look at perhaps using Phasers.

#

Especially considering that I don't quite understand what the Phaser means with "Parties"

#

Actually I think I can get rid of my first if statement by changing the do-while to a while so I'd say a few opcodes there which should probably more than suffice for JIT-inlining.

slender elbow
#

You can picture it as the typical scenario of a jar of tokens next to a door, someone can only go through the door if and when the jar is empty, whereas other people can put and remove a token whenever they want/need. Once all the tokens have been removed, the door is opened

onyx fjord
#

ij bug? complains about comparator (toint)

#

it compiles normally manually

#

oh wait

#

šŸ¤”

#

nevermind, its a double not int lol

grim hound
#

Is there a way to get the Channel object from a Player using ProtcolLib?

lilac dagger
#

isn't protocollib all about that but wrapped?

grim hound
#

uh

lilac dagger
#

or am i missing something?

grim hound
#

dunno I don't use it

#

chat gpt couldn't find like a map stored method they have

lilac dagger
#

i wouldn't trust chat gpt finding useful info about this kind of stuff tho

grim hound
#

it was my last resort

lilac dagger
#

search deeper

#

surely there is something somewhere

hearty flume
#

hi need help

#

File crates.yml couldn't be reloaded. Reason could not determine a constructor for the tag tag:yaml.org,2002:java.util.HashMap$Values
in 'string', line 1, column 9:
CRATES: !!java.util.HashMap$Values {}
^

tall dragon
#

is this a plugin you are making?

hearty flume
#

Crates forHCF

devout kite
#

Hey i am trying to let my code draw a image with Graphics2D but it only draws the line from g2d.drawline not the image from g2d.drawimage. The Image that it ment ot draw is located at the main folder of the server

        int width  = 64;
        int height = 64;

        File img = new File("./skin_black.png");

        BufferedImage bufferedImage = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
        image = ImageIO.read(img);
        Graphics2D g2d = bufferedImage.createGraphics();
        g2d.drawImage(image, width, height, null);
        g2d.drawLine(5,6,7,5);
        ImageIO.write(bufferedImage, "png", new File("./Char" + charid + ".png"));
        System.out.println("Char erstellt!");
    }```
Hope someone can help me with that
hearty flume
tall dragon
#

well you aught to show the code then

jaunty shuttle
#

Hey Guys, we are currently working on a minigame, for this we wanted to use the normal Minecraft Spectator mode, however we are experiencing the problem that invisible Armor Stands are above the heads of the players and the NPC's, what can be the reason for this, we would like to remove this ? We use the following plugins in addition to our plugin:
Triton
TAB
Placeholder API
Citizens
Protocol Lib
Luckperms

tall dragon
hearty flume
#

` @Getter
@Setter
@SerializableAs("crate")
public class Crate implements ConfigurationSerializable {

private final String name;
private final ChatColor color;
private Type type;
private ItemStack item;
private ItemStack key;
private ItemStack hologram;
private final List<Location> locations;
private Map<Integer, ItemStack> loot = new HashMap<>();

public Crate(String name) {
    this.name = name;
    this.color = ChatColor.WHITE;
    this.type = Type.CHEST;
    this.item = new ItemBuilder().from(Material.CHEST).name(this.color + name + " &7Loot chest").build();
    this.key = new ItemBuilder().from(Material.TRIPWIRE_HOOK).name(this.color + name + " &7Key").glow().build();
    this.hologram = new ItemStack(Material.DIAMOND_SWORD);
    this.locations = new ArrayList<>();
    this.loot.put(0, new ItemBuilder().from(Material.RED_ROSE).name("&cTEST").build());
}

public Crate(Map<String, Object> data) {
    this.name = (String) data.get("NAME");
    this.color = ChatColor.valueOf((String) data.get("COLOR"));
    this.type = Type.valueOf((String) data.get("TYPE"));
    this.item = new ItemBuilder().from(type.getMaterial()).build();
    this.key = (ItemStack) data.get("KEY-ITEM");
    this.hologram = (ItemStack) data.get("HOLOGRAM-ITEM");
    this.locations = (List<Location>) data.get("LOCATIONS");
    this.loot = (Map<Integer, ItemStack>) data.get("LOOT");
}

@Override
public Map<String, Object> serialize() {
    Map<String, Object> data = new HashMap<>();
    data.put("NAME", this.name);
    data.put("COLOR", color.name());
    data.put("TYPE", this.type);
    data.put("KEY-ITEM", this.key);
    data.put("HOLOGRAM-ITEM", this.hologram);
    data.put("LOCATIONS", this.locations);
    data.put("LOOT", this.loot);

    return data;
}`
#

is that a specific error I do not have

young knoll
#

Did you register it as serializable

hearty flume
eternal oxide
#

has to be registered before you make any access to the config

hearty flume
#

@Getter
public class Main extends JavaPlugin {

private FileHandler config, storage;
private CratesHandler crates;
private HologramsHandler holograms;
private CommandAPI command;

@Override
public void onEnable() {
    ConfigurationSerialization.registerClass(Crate.class);
    this.config = new FileHandler(this, "config.yml");
    this.storage = new FileHandler(this, "crates.yml");

    this.crates = new CratesHandler(this);
    this.holograms = new HologramsHandler(this);
worldly ingot
#

Should be done in a static initializer block

#

You can do the same thing in your plugin's class

gaunt sonnet
#

hey I've been trying for some time to send a player to another server with a spigot plugin when he joins, but unfortunately without success, the event is registered @EventHandler
public void cookiejoin(PlayerJoinEvent event){
Player player = event.getPlayer();
sendPlayerToServer(player,"citybuild");

  if (!CookieklickerManager.playerExists(player.getUniqueId().toString())){
      CookieklickerManager.createPlayer(player.getUniqueId().toString());
  }

}




public static void sendPlayerToServer(Player p, String server){
    ByteArrayOutputStream b = new ByteArrayOutputStream();
    DataOutputStream out = new DataOutputStream(b);

    try {
        out.writeUTF("Connect");
        out.writeUTF(server); // Target Server
    }

    catch (IOException e) {
        e.printStackTrace();
        System.out.println("Der Fehler!");
    }

    p.sendPluginMessage(BetterWorld.getInstance(), "BungeeCord", b.toByteArray());
}

getServer().getMessenger().registerOutgoingPluginChannel(BetterWorld.getInstance(), "BungeeCord");

tall dragon
#

well first of all your event is not annotated with @EventHandler so that event will never do anything

#

nvm it is

#

can u format your code?

hearty flume
gaunt sonnet
tall dragon
#

?format

worldly ingot
#

```java
your code here
```

tall dragon
#

what was it

#

how the heck u did that xD

jaunty shuttle
#

Hey Guys, we are currently working on a minigame, for this we wanted to use the normal Minecraft Spectator mode, however we are experiencing the problem that invisible Armor Stands are above the heads of the players and the NPC's, what can be the reason for this, we would like to remove this ? We use the following plugins in addition to our plugin:
Triton
TAB
Placeholder API
Citizens
Protocol Lib
Luckperms

worldly ingot
tall dragon
#

ah

#

smort

worldly ingot
#

And I did that with
\\\`\\\`\\\`java
\\\`\\\`\\\`

gaunt sonnet
#
public void cookiejoin(PlayerJoinEvent event){
        Player player = event.getPlayer();
        sendPlayerToServer(player,"citybuild");

      if (!CookieklickerManager.playerExists(player.getUniqueId().toString())){
          CookieklickerManager.createPlayer(player.getUniqueId().toString());
      }

    }




    public static void sendPlayerToServer(Player p, String server){
        ByteArrayOutputStream b = new ByteArrayOutputStream();
        DataOutputStream out = new DataOutputStream(b);

        try {
            out.writeUTF("Connect");
            out.writeUTF(server); // Target Server
        }

        catch (IOException e) {
            e.printStackTrace();
            System.out.println("Der Fehler!");
        }

        p.sendPluginMessage(BetterWorld.getInstance(), "BungeeCord", b.toByteArray());
    }
   getServer().getMessenger().registerOutgoingPluginChannel(BetterWorld.getInstance(), "BungeeCord"); //this is in main





#

so?

#

sorry i have forgott @ eventhandler

#

i will make a lobby system to send the player to another server but the test are not going

tall dragon
#

ru sure the server name is correct?

gaunt sonnet
#

and the server is alrady on

tall dragon
#

hm my knowledge is pretty limited on bungeecord

#

dont rlly see the problem here

remote swallow
tall dragon
#

sometimes stuff is weird in PlayerJoinEvent with stuff like this

quiet ice
#

Ugh, debugging concurrent code is extreme pain.

worldly ingot
#

That's correct. You can't send a plugin message in the join event

#

I've had that exact issue before with VeinMiner -,-

remote swallow
#

gradle plugin PES_Happy

worldly ingot
#

Waiting for Gradle 8.4 for J21 support šŸ¤ž

#

I want to use it for an upcoming project lol

remote swallow
#

how are we at 8.4 already

#

and whats coming in 8.4

worldly ingot
#

idk. J21 as far as I'm concerned

#

I don't Gradle enough to care about each detail on release

#

Hell I hardly care about Maven's release notes

vague oracle
#

Might be dumb question but do items with different persistent data stack šŸ˜‚ therefore could you limit a stack size by adding a random peice of data

worldly ingot
#

They do not. Different NBT

quiet ice
#

J21 doesn't have much interesting feature imo

worldly ingot
#

?????

#

You're high

remote swallow
#

you are high

worldly ingot
gaunt sonnet
quiet ice
#

FFI and Valhalla is the only thing I'm hyped for

worldly ingot
#

Record patterns, pattern matching, top level statements (in preview still though D:)

quiet ice
#

Sequenced collections are an ABI break too

worldly ingot
#

ALSO FINALLY A STANDARD Math#clamp() FUNCTION

remote swallow
#

YEAHHHHHHHHHHHHHH

young knoll
#

What about isNumeric

quiet ice
#

That is the main thing I'm concerned with

remote swallow
#

this is nice

quiet ice
#

Virtual Threads could be useful too but probably not worth it as of now

worldly ingot
#

I want to say you can also use unnamed parameter names

remote swallow
#

ye

worldly ingot
#

if (obj instanceof Point(_, int y)) should be valid too

quiet ice
#

Yeah I believe it is