#help-development

1 messages · Page 1199 of 1

crude charm
#

for future projects

#

some of the new servers I've seen are crazy and defo not possible on 1.8

summer scroll
#

I can name few of them, custom model data to define the "textures" of certain item, persistent data containers.

#

?pdc

summer scroll
#

In 1.21.4 it's even crazier with food components, etc.

#

Basically you can make any items consumable

crude charm
#

oh wtf

blazing ocean
#

Resource packs are like the coolest shit ever

#

you can make custom shaders, fonts, textures, models, everything

young knoll
#

Eat the sword

crude charm
#

oh wow

#

shame I'm terrible with graphic design

#

so PDC is like a database? for storing plugin data

hushed spindle
#

kind of, not really

#

PDC is more or less used to add your own metadata to items and (block)entities

#

you should not store bulk data in here

summer scroll
#

Yes, kinda like nbt tag

crude charm
#

ahh like add a tag to it

#

ye

#

so when would I use that?

hushed spindle
#

if you're making custom items for example

#

and you wanna add functionality to them

#

you could just add that functionality by matching the item exactly on your custom definition, but that's not smart

summer scroll
#

Also many developers decide to store data on the lore previously, you can now use pdc for that

#

Previously comparing item it would compare display name, lore, etc

#

Now we can use pdc to compare it, less breaking

crude charm
#

like checking a right click of an item

hushed spindle
#

less breaking and less intrusive

crude charm
#

u would check the pdc

hushed spindle
#

prevents you having to add lore you might not want there

crude charm
#

not the name & type or smth

summer scroll
#

The craziest thing is the components, there are tons of new components on 1.21.4

crude charm
#

ye I gotta check this out it seems crazy

#

I remember when PDC dropped and people were going crazy I was just a 1.8 user so I never learned it

hushed spindle
#

components are great but there aren't all that many new ones on 1.21.4 yet

#

at least not exposed by spigot

crude charm
#

all good lol

#

also just wondering too is there util plugin people use? I know lucko's helper was popular a long time ago but idk what people use now

feral fiber
#

I have a problem that I want to create an interaction entity and a display item but... I don't know how to do this

private static final String[] playerHeads = {
            "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYWZmYjlmM2FhMWQxYmU5NmNhY2U3OTU3NGU3MmZiMzFiNjQ2Y2I2YTJkMTkxMDFlYTEyN2Y5MjBlZmUwOTkifX19"
};

double x = parseCoordinate(args[0], player.getLocation().getX());
double y = parseCoordinate(args[1], player.getLocation().getY());
double z = parseCoordinate(args[2], player.getLocation().getZ());

String worldType = args[3];
World world = player.getWorld();

int headIndex = Integer.parseInt(worldType) - 1;
if (headIndex < 0 || headIndex >= playerHeads.length) {
player.sendMessage("Invalid head type. Available types: 1, 2, 3.");
return false;
}
String texture = playerHeads[headIndex];

org.bukkit.entity.ItemDisplay itemDisplay = (org.bukkit.entity.ItemDisplay) world.spawnEntity(player.getLocation().add(x, y, z), org.bukkit.entity.EntityType.ITEM_DISPLAY);
itemDisplay.setItemStack(new org.bukkit.inventory.ItemStack(org.bukkit.Material.PLAYER_HEAD, 1));

org.bukkit.inventory.meta.SkullMeta skullMeta = (org.bukkit.inventory.meta.SkullMeta) itemDisplay.getItemStack().getItemMeta();
if (skullMeta != null) {
GameProfile profile = new GameProfile(java.util.UUID.randomUUID(), null);
profile.getProperties().put("textures", new Property("textures", texture));

skullMeta.setOwnerProfile(profile);
itemDisplay.getItemStack().setItemMeta(skullMeta);
}
tawny furnace
#

guys

#

christmas

young knoll
#

Yes

blazing ocean
#

wait really i didn't know

feral fiber
#

please help

undone axleBOT
#

"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.

smoky anchor
#

Also, some little formatting would not hurt anyone, your code lacks indentation and is really difficult to read.

feral fiber
#

there's a ds limit(

smoky anchor
#

?paste

undone axleBOT
smoky anchor
#

for longer code

feral fiber
smoky anchor
#

Google "guard clause", it reduces this ugly if-else chain.
Follow java naming conventions, classes start with capital letter.

Is your command actually executing ?
Do you have it registered and is it in plugin.yml ?

#

org.bukkit.entity.# why, just import it.

feral fiber
#

commands:
  makingGift:
    aliases:
      - mg
    usage: /makinggift <x> <y> <z> <type>
smoky anchor
#

and where do you register it ?
usually it is in onLoad

feral fiber
#
public void onEnable() {
        // Plugin startup logic
        getCommand("makingGift").setExecutor(new makingGift());
    }
smoky anchor
#

player.getLocation().add(x, y, z)
Are you inputting xyz as absolute values when you're running the command ?

#

'cause that won't work in your case

feral fiber
#

I can't create an entity

smoky anchor
#

you won't be able to create an entity if you're trying to spawn it in unloaded chunks

feral fiber
#

I create loaded chunks

smoky anchor
#

I still don't think the coordinates are correct
If you were to input /cmd 123 64 123 idk
And you were standing at 123 64 123
The entity will be created at 246 128 246
The same would happen with /cmd ~ ~ ~ idk 'cause again, you're adding the xyz to current player coordinate

#

Try to create new location instead

feral fiber
#

hmm

#

i send coordinate
player.sendMessage("Coordinates: X=" + x + ", Y=" + y + ", Z=" + z);
player.sendMessage("World Type: " + worldType);

smoky anchor
#

This may print the correct coordinates, but you're still adding them to player coordinates when you execute spawnEntity

chrome beacon
#

hm? setOwnerProfile doesn't accept a GameProfile?

#

How did that even compile

chrome beacon
#

Also where's the import for it?

feral fiber
#

well, I also tested with teleporting the player to the position, everything is fine, but the entity is not created because I don’t know how to normally create these display entities in them and there is probably a problem, there is simply no normal information on the Internet or I don’t know how to google

slender elbow
chrome beacon
#

true I was also thinking that 💀

smoky anchor
feral fiber
#

💀

unique meteor
#

im too lazy to check whats your problem, so give me 3 words of what youre trying

smoky anchor
#

attempting (to) summon entity

feral fiber
unique meteor
#

first of all, you cant interact with an display entity

smoky anchor
# feral fiber

Try spawning a pig instead of a display entity, just as a test ?
Assuming you fixed the thing I told you it should spawn a pig

unique meteor
#

second, show us your code

#

?paste

undone axleBOT
glossy laurel
#

Guys, I'm making launchable fireballs, but they collide with the player instantly after getting spawned. What are some possible fixes for this? Can I make it not collide with the player somehow?

unique meteor
#

either cancel the event or spawn it infront of the player

glossy laurel
unique meteor
#

just spawn it infront of the player

smoky anchor
#

Interestingly, summoning a fireball with a command does not make it explode right away. So there must be a trick to it.

eternal oxide
#

Player#launchProjectile

hybrid spoke
#

elgar coming to the rescue

glossy laurel
#

im so cool

#

I made my fireball have 1000 explosion power

#

and my server crashed

smoky anchor
#

side note: this is probably one of the things launchProjectile method does

glossy laurel
#

nc

short drift
sharp bough
#

replace LATEST with an actual version

short drift
sharp bough
#

gradle deps are a nightmare, i hate them

#

you have maven if you prefer

#

Why does this suddenly not work anymore?
what doesnt work

short drift
#

It used to work fine with the LATEST.

#

And it's also what the GSIT docs recommend doing.

sharp bough
#

if hes pushing both to the version and to a "latest" version then he either forgot, removed it or moved the repository

short drift
#

I don't know anything about Maven - or Gradle - I just copy paste this weird XML in my my pom.xml so I can do some coding.

sharp bough
#

hahah okay

#

send the entire pom

#

?paste

undone axleBOT
short drift
sharp bough
ivory sleet
#

im not sure, but maybe try latest.release or latest.integration

sharp bough
hybrid spoke
#

but its -SNAPSHOT

#

and for the latest commit, not release

short drift
#

Also. I'm having real trouble trying to find DiscordSRV plugin API. Does it even exist?

slender elbow
slender elbow
#

because you didn't pass the unsigned=false param

#

like the wiki page i linked mentions

grim hound
#

a

#

xd

#

okay

slender elbow
#

to get the actual texture image

#

the profile property contains the signature and the url to the texture

ivory sleet
grim hound
slender elbow
#

the property does not contain the texture image

#

it has the url to the image

grim hound
#

ah

#

nice

#

also, paper's FlushConsolidationHandler is ruining my day

#

I try to send a packet after transferring the player to the very same server with a transfer packet

#

and he just keeps on connecting...

grim hound
#

I do a bit of black magic under the hood

#

but c'mon

#

welp, I guess modifying the pipeline it is

#

not gonna do channel.unsafe().flush() every single time a login packet isn't sent

craggy moss
#

I need a professional plugin developer. I'm gonna pay...

undone axleBOT
kind coral
#

has anyone ever used MockBukkit? i am having issues of it saying Game Version not set, as i see from the issues i see the problem is because of paperweight, is there i way i could exclude it from testing?

#

idk if its actually the best idea to ask here for paperweight after the hard-fork, lol

chrome beacon
worldly ingot
#

wHiLe MoCkInG tHe SeRvEr

blazing ocean
#

me when I mock minecraft

glad prawn
#

minecraft me when mock i

tranquil shale
#

hello
how can I modify the .jar file inside my resource on spigotmc.org??

remote swallow
pseudo hazel
tranquil shale
pseudo hazel
#

you dont replace it, you upload a new one

tranquil shale
tranquil shale
chrome beacon
#

Like does it contain something you really need to get removed

#

if not just post an update

remote swallow
#

You can delete specific updates if there's a newer one afaik

chrome beacon
tranquil shale
#

or one of the versions of my project, only that part doesn't work and I accidentally uploaded it

chrome beacon
lean river
#

How to solve problem that my plugin freezes when i am creating a new world with that

#

I just want to make the same world same seed for players but if someone is creating a new one then plugin freezes for few seconds

mortal hare
#

I wonder if bounding box positions are usually calculated on the gpu or the cpu side

#

i guess its needed for collision so it should be computed on the cpu

#

no?

fleet pier
#

Try doing it in a scheduler runTask or runTaskAsync

chrome beacon
#

runTask will be on the main thread

#

Also I don't think it's supported doing it off the main thread

feral fiber
#

how to set the size for the interaction entity?

mortal hare
#

that was general graphics programming question but ok 😄

#

sorry for context loss

chrome beacon
#

You can calculate them on the GPU if you want to

mortal hare
#

yea but then you need to do branching

#

and we all know that's not what you want on shaders

chrome beacon
#

What do you want to use the boxes for?

#

Culling?

mortal hare
#

i will calculate them on cpu probs. im making my own trashy open gl game engine using lwjgl

#

where 2D sprites are being rendered using entity component system

#

its going to be slow af, but who cares

#

new Entity().setComponent(new Sprite("assets/tank.png'))
and then OpenGL renderer loops entities on each frame and checks if entity has a Sprite.class component. if it does it renders a quad and applies a texture from provided file path

#

that's very inefficient, but overall renderer is being decoupled from the game itself, so there must be penalty anyways

#

but oh well

#

i need to calculate bounding boxes because i have Position, Size and Rotation components, so they're going to be used for calculating collision between sprites and for calculating quad vertice positions

feral fiber
#

please help me

inner mulch
#

we cant help if you dont tell us what you need help with

feral fiber
#

How do I set the size for an interaction entity I have a simple code that creates it

Location loc = new Location(world, x, y, z);

Interaction interaction = (Interaction) world.spawnEntity(loc, EntityType.INTERACTION);
inner mulch
feral fiber
#

OMG

inner mulch
#

what?

feral fiber
#

when will i learn to google

#

...

inner mulch
#

its okay

feral fiber
#

sps

wraith relic
#

hello! I'm making a minecraft plugin and with a gui, when you type /uzinomanage <player> it will appear a gui where you can freeze, unfreeze and kill the player, the kill functionates but the freeze and unfreeze doesn't, is there anyway i can fix it?

inner mulch
#

we need ur code

wraith relic
#

which one

#

the listener's one?

inner mulch
#

i dont really know, i dont know what u are doing in ur code

#

we need to see everything relevant to ur problem

wraith relic
#

the listener

#

i entered a stupid code

#

it's just target.isFrozen()

#

package me.uzinoh.uzinomenu.listeners;

import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.inventory.InventoryClickEvent;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.Set;

public class MenuListener implements Listener {

private final Set<Player> frozenPlayers = new HashSet<>();

@EventHandler
public void onInventoryClick(InventoryClickEvent event) {
    if (!event.getView().getTitle().equals(ChatColor.GOLD + "Gestisci i giocatori.")) {
        return;
    }

    event.setCancelled(true);

    if (event.getCurrentItem() == null) {
        return;
    }


    Player player = (Player) event.getWhoClicked();
    Player target = Bukkit.getPlayer(event.getView().getItem(22).getItemMeta().getDisplayName());

    if (target == null) {
        player.closeInventory();
        player.sendMessage(ChatColor.RED + "Il giocatore selezionato non è più o non è mai stato online!");
        return;
    }

    if(event.getCurrentItem().getType() == Material.RED_DYE) {
        target.isFrozen();
        player.sendMessage(ChatColor.RED + "Sei stato freezato da uno staff!");
    } else if(event.getCurrentItem().getType() == Material.BLUE_DYE) {
        target.isFrozen();
        event.setCancelled(true);
        player.sendMessage(ChatColor.GREEN + "Sei stato unfreezato da uno staff!");
    } else if(event.getCurrentItem().getType() == Material.IRON_SWORD) {
        target.setHealth(0);
        player.sendMessage(ChatColor.RED + "Sei stato ucciso da un membro dello staff!");
#

this is the code

inner mulch
#

so isFreeze() checks if the player is frozen and doesnt freeze him + with freezing its meant when a player dies in powdered snow

#

i think with freezing you mean stopping them from moving

wraith relic
#

ye

#

i just want a simple little code not a large code like they show on youtube

inner mulch
#

okay

wraith relic
#

what code can i use?

inner mulch
#

there is no quick solution for that

wraith relic
#

wdym by quick solution

inner mulch
#

there is no code that you can use

wraith relic
#

how

inner mulch
#

you have to make it urself

wraith relic
#

how do i connect the code to the listener

inner mulch
#

what?

wraith relic
#

i mean, if i make a code in another class, how do i connect it to the listener

inner mulch
#

ur listener is a class, you can use dependency injection or create an instance of you other class

#

if you are having trouble with java, i would recommend watching yt videos

wraith relic
#

so basically the simplest way to "freeze" someone is just to put their walkspeed to 0

lilac dagger
#

Ye

#

And prevent moveevent

#

Because they can jump and move that way

#

Event set to event get from does it

wraith relic
#

what if i do Player.moveEvent event.setCancelled(true);

inner mulch
#

you need to only cancel it for the player

lilac dagger
#

I don't know what that did exactly

#

I always used the way I said earlier

#

Should work I think 🤔

wraith relic
inner mulch
#

as i said learn java

#

i will not spoon feed

chrome beacon
#

Don't detect inventories by their name 💀

wraith relic
#

wait wait

chrome beacon
#

inb4 someone renames a chest and starts freezing people

inner mulch
#

?gui

feral fiber
# inner mulch its okay

you don't know how to create a display item and hang a head on it and a texture for the head? Can you send display item link

inner mulch
mortal hare
#

hmm

#

what if i exploit function arguments for compile time safety for array elements..

#

surely for small amounts its not bad

ivory sleet
#

what exactly do you experience an issue with? (also is this Java?)

strange barn
#

Hey guys, I have a problem with my code. I'm making an item store with JSON storage, but I have an error in a part of my code when returning the price in a message.

#
public ItemModel fromItemStack(ItemStack item) {
            ItemMeta meta = item.getItemMeta();
            if (meta == null) return null;
            
            ItemModel.Builder builder = new ItemModel.Builder()
                .material(item.getType().name())
                .amount(item.getAmount());
                
            if (meta.hasDisplayName()) {
                builder.name(meta.getDisplayName());
            } else {
                builder.name(formatMaterialName(item.getType().name()));
            }
            
            if (meta.hasLore()) {
                List<String> lore = meta.getLore();
                if (lore != null && !lore.isEmpty()) {
                    // Asumimos que la primera línea es la descripción
                    builder.description(lore.get(0));
                    
                    // Buscamos el precio en el lore
                    for (String line : lore) {
                        if (line.startsWith(ChatColor.GOLD + "Precio: ")) {
                            try {
                                String priceStr = ChatColor.stripColor(line.substring(9));
                                double price = Double.parseDouble(priceStr);
                                builder.price(price);
                            } catch (NumberFormatException e) {
                                logger.error("Error parsing price from lore", e);
                            }
                        }
                    }
                    
                    // Añadimos el resto del lore
                    for (int i = 1; i < lore.size(); i++) {
                        if (!lore.get(i).startsWith(ChatColor.GOLD + "Precio: ")) {
                            builder.addLoreLine(lore.get(i));
                        }
                    }
                }
            }
            
            return builder.build();
        }
}```
#
private void handleItemClick(Player player, ItemStack item) {
            ItemModel itemModel = plugin.getItemConverter().fromItemStack(item);
            if (itemModel != null) {
                // implementar la lógica de compra
                player.sendMessage(ChatColor.GREEN + "Has seleccionado: " + 
                    ChatColor.WHITE + itemModel.getName());
                player.sendMessage(ChatColor.GREEN + "Precio: " + 
                    ChatColor.WHITE + itemModel.getPrice());
            }
        }


}```
#

in the json file it is saved like this

#

[
{
"name": "Pene",
"amount": 1,
"description": "Item dirt",
"price": 0.0,
"material": "DIRT",
"lore": []
},
{
"name": "Lananana",
"amount": 2,
"description": "Item wool",
"price": 0.0,
"material": "WOOL",
"lore": []
}]

#

and it gives me an error

#

could someone give me a suggestion?

#

[14:29:46] [Server thread/ERROR]: Error parsing price from lore
java.lang.NumberFormatException: For input string: "0,00"
at jdk.internal.math.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:2054) ~[?:?]
at jdk.internal.math.FloatingDecimal.parseDouble(FloatingDecimal.java:110) ~[?:?]
at java.lang.Double.parseDouble(Double.java:944) ~[?:?]
at me.manolo.ShopJs.utils.ItemConverter.fromItemStack(ItemConverter.java:86) ~[?:?]
at me.manolo.ShopJs.manager.InventoryManager.handleItemClick(InventoryManager.java:118) ~[?:?]
at me.manolo.ShopJs.manager.InventoryManager.onInventoryClick(InventoryManager.java:109) ~[?:?]
at jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) ~[?:?]

drowsy helm
#

the error is saying there is something in the config you haven't shown us

slender elbow
#
if (line.startsWith(ChatColor.GOLD + "Precio: ")) {
    try {
        String priceStr = ChatColor.stripColor(line.substring(9));
        double price = Double.parseDouble(priceStr);
        builder.price(price);

please for the love of god do not do this

#

use PDC to store data

strange barn
#
@EventHandler
        public void onInventoryClick(InventoryClickEvent event) {
            if (!(event.getWhoClicked() instanceof Player)) return;
            Player player = (Player) event.getWhoClicked();
            
            if (activeInventories.containsKey(player.getUniqueId())) {
                event.setCancelled(true); 
                
                ItemStack clickedItem = event.getCurrentItem();
                if (clickedItem != null && clickedItem.getType() != Material.AIR) {
                        handleItemClick(player, clickedItem);
                }
            }
        }
        
        private void handleItemClick(Player player, ItemStack item) {
            ItemModel itemModel = plugin.getItemConverter().fromItemStack(item);
            if (itemModel != null) {
                // implementar la lógica de compra
                player.sendMessage(ChatColor.GREEN + "Has seleccionado: " + 
                    ChatColor.WHITE + itemModel.getName());
                player.sendMessage(ChatColor.GREEN + "Precio: " + 
                    ChatColor.WHITE + itemModel.getPrice());
            }
        }```
slender elbow
#

?pdc

mortal hare
#

PDC back then didnt existed

slender elbow
#

what about that looks 1.8 lol

#

that could be any version

mortal hare
#

newer versions use chat components

slender elbow
#

spigot users don't

remote swallow
#

no

strange barn
#

is 1.8

slender elbow
#

good luck

remote swallow
#

its paper that force components, you can use components on spigot but most people dont still

mortal hare
#

im so used to paper's adventure that i didnt knew spigot still uses strings for text

remote swallow
#

you can use bungee components in some places

#

still waiting on that pr @worldly ingot

slender elbow
#

not for lore loll

#

yeah @worldly ingot

#

i miss you)

mortal hare
remote swallow
#

it might happen one day

mortal hare
#

i think 1.8 introduced chat components natively in nms

#

or smth

#

its been so long

#
    public void setMatrixUniform4(final CharSequence name, boolean transpose,
                                  final float value1, final float value2, final float value3, final float value4,
                                  final float value5, final float value6, final float value7, final float value8,
                                  final float value9, final float value10, final float value11, final float value12,
                                  final float value13, final float value14, final float value15, final float value16
    ) {
        GL33.glUniformMatrix4fv(this.getUniformLocation(name), transpose, new float[] {
            value1, value2, value3, value4,
            value5, value6, value7, value8,
            value9, value10, value11, value12,
            value13, value14, value15, value16
        });
    }
#

cursed code

#

this looks cursed, but it can really provide type safety at compile time, not allowing to pass bigger or smaller arrays to opengl state which expects 4x4 matrix

#

but i think i should remove it 😄 because that's way to much

#

🤢

mortal hare
#

but hear me out

#

you can get this compile time safety without any runtime checks

#

at the cost of ugliness

#

this kind of exploitation reminds me of SFINAE from CPP traits

ivory sleet
#

"in an ideal world we would be able to encode the size in an iterative type" - probably nobody

mortal hare
#

in c, cpp we have fixed sizes array references

ivory sleet
#

i mean yea

mortal hare
#

too bad java doesnt have it

ivory sleet
mortal hare
#

i means probs impossible due to how array live on heap

ivory sleet
#

for example haskell has this kind of type, but enforces it (which ig is comparable to strict)

mortal hare
#

finally i have something barely working with ECS

inner mulch
#

does any1 know an image that shows as an example what all of these mean? like for example what happens if i increase x on leftRotation

mortal hare
#

these are the values which are being applied to the matrix as transformations. basically by altering these vectors, you be able to scale, translate and rotate something

#

if i had to guess

inner mulch
#

thank you for the brief explanation, do you know any image having a visual representation of all of these?

#

scale is pretty obvious, but what does left and rightrotation do

worldly ingot
#

They're both rotation, it's just when the rotations are applied

mortal hare
#

this is not really related generally

#

but it explains it kinda great

inner mulch
#

okay

worldly ingot
#

iirc right rotation applies first (is the initial rotation), then left rotation applies after the scale and translation

inner mulch
#

ok

worldly ingot
#

Wouldn't quote me on that, but I believe that's the difference lol

inner mulch
#

okay

worldly ingot
#

I was close. Right rotation first, then scale, then left rotation, then translation

mortal hare
#

it depends on the shader

#

but yeah

worldly ingot
#

That's how Mojang has it defined

#

I guess more accurately, how Minecraft has it defined

#

Translation is just changing position along the x/y/z axis, rotation is rotation around the center of the model, and scale is size along the x/y/z axis

#
new Transformation(
    new Vector3f(0, 1, 0), // Translates the model up by 1
    new AxisAngle4f(Math.PI, 1, 0, 0), // Rotates the model by 180 degrees along the x axis (flips upside down)
    new Vector3f(2, 2, 2), // Scales the model by 2x on each axis
    new AxisAngel4f() // Confusingly, the first rotation to apply, but do nothing here. Angle = 0
);
worldly ingot
#

We should really add some Javadoc comments to that Transformation class, or maybe to Display somewhere, to indicate in which order the transformation applies

inner mulch
#

that would be great

worldly ingot
#

Mmm, useful tool

inner mulch
#

yes thank you olivo

sullen marlin
#

Need a mathematics and compsci degree to do anything in mc these days

worldly ingot
#

Or just any dummy like me who knows how to read a wiki page 🤓

#

and has WAY too much free time

ancient plank
#

owo

sly topaz
#
var transformation = display.getTransformation();
transformation.getTranslation().add(0, 1, 0);
transformation.getLeftRotation().rotate(Math.PI);
transformation.getScale().mul(2);

display.setTransformation(transformation);
crude charm
ivory sleet
#

ugh I mean there the gui ones, the command ones and then like just general utility like eco, helper, bkcommonlib

#

if i were u id look it up at an awesome-minecraft gh list or sth

#

or like awesome-spigot w/e

worldly ingot
pure dagger
#

what does 'const' do

worldly ingot
#

It's a keyword, but it does nothing

#

Ultimately superceded by final

mortal hare
#

missed opportunity to have an alias to final

worldly ingot
#

The last thing we need in Java is keyword aliases KEKW

mortal hare
#

i guess we have kotlin for shit like that

#

i cringed so hard when i saw full guide on kotlin for java devs was 3 hours longer than for rust on youtube

worldly ingot
#

mfw #define const int burn

#

No, other way around

#

#define int const

mortal hare
#

#define true false

#

classic

worldly ingot
#

That's just not nice

mortal hare
#

classic way to show your importance when corporate layoffs start

smoky anchor
lime pulsar
#

trying to catch PlayerInteractEvent RIGHT_CLICK_BLOCK while holding a bundle and its just not working

ivory sleet
rough ibex
#

You can do the same in Python

warm halo
#

hello, I have a problem with the keys in the getcase plugin, when I want to open the box it writes no key and I hold it in my hand

indigo orchid
#

any1 know the dependency for the latest world edit?

sly topaz
indigo orchid
#

So I can use the world edit classes and stuff in my own project

#

I can’t seem to find it

chrome beacon
unborn hollow
#

how do i set someone's scoreboard objective value through spigot?

indigo orchid
#

Thanks

sly topaz
#

but if you want to change it from the player's own scoreboard, then you get it from Player#getScoreboard

chrome beacon
#
  1. Get scoreboard
  2. Get objective
  3. Get score of player
  4. Get actual score value from score object
sly topaz
#

I guess Player#getScoreboard will return the main scoreboard if they hadn't set a new one anyway now that I think about it

unborn hollow
unborn hollow
sly topaz
#

that's often the entity's name

unborn hollow
sly topaz
unborn hollow
#

and thanks for all your help

sly topaz
#

aka event.getPlayer().getName()

echo basalt
#

Does CraftItemEvent get fired multiple times if you're shift clicking?

slender elbow
#

I think so

lime pulsar
#

EntitySnapshot ess = getServer().getEntityFactory().createEntitySnapshot(mdata);

#

null

echo basalt
#

null

lime pulsar
#

but why for?

mortal vortex
#

Does Java have a #define equavilent?

pseudo hazel
#

you mean macros? no

river oracle
#

Take a look at manifold

#

You'd need a IDE plugin too though

#

You need to use ASM too

#

So that's "fun"

pseudo hazel
#

okay, so its a "no*"

river oracle
#

But if you really want it it's worth it

inner mulch
#

you could also just have a class full of static methods

river oracle
#

Well that doesn't do the same thing define does

#

So kinda but no

buoyant viper
#

oh hey thats exactly what they did

unborn hollow
#

now i'm just struggling to wrap my head around how to check if someone's score is equal to 1

smoky anchor
mortal vortex
quaint mantle
quaint mantle
wise mulch
#

Is it possible to read data on the current data pack from a plugin? Or for a plugin to provide a datapack?

#

I'm gonna try to make my skygrid generator use custom datapack data to define stuff like what generates on the grid, what layers, what chances etc

hybrid spoke
quaint mantle
crude charm
#

why is ChatColour decripted? what do I use instead??

drowsy helm
#

its only deprecated in Paper

crude charm
#

why?

drowsy helm
#

read their docs

drowsy helm
crude charm
#

is there an advantage to coding on paper?

#

or should I just stick to spigot

#

like I know they have certain neiche events spigot doesnt have but idk apart from that

drowsy helm
#

That's something you'll have to decide for yourself. this place isn't really the right forum to advocate for a fork

crude charm
#

Well I mean idk what it has to offer

drowsy helm
#

not using spigot api does mean you can potentially break your plugin on spigot servers

crude charm
#

ic ic

#

I mean I'll be using a spigot fork anyway

#

that being purpur / paper

#

idk I just dont know what paper offers that spigot doesnt

drowsy helm
#

if its not a public plugin just use whatever fork you are using

#

paper has adventure, and a few other nifty api features

crude charm
#

alrighty

mortal vortex
#

Any idea whats up here?

#
shadowJar {
    relocate 'com.zaxxer.hikari', 'me.abbev.wardenCore.libs.hikari'
    relocate 'org.slf4j', 'me.abbev.wardenCore.libs.slf4j'
    relocate 'org.postgresql', 'me.abbev.wardenCore.libs.postgresql'
}
#

Yet:

java.lang.RuntimeException: Failed to get driver instance for jdbcUrl=jdbc:postgresql://XXXXXXXXXXXXXX:5432/mclink
        at WardenCore-1.0.jar/me.abbev.wardenCore.libs.hikari.util.DriverDataSource.<init>(DriverDataSource.java:113) ~[WardenCore-1.0.jar:?]
        at WardenCore-......
dry hazel
#

the jdbcUrl= shouldn't be there is my guess

mortal vortex
#
        config.setJdbcUrl(String.format("jdbc:postgresql://%s:%d/%s",
                getConfig().getString("database.host"),
                getConfig().getInt("database.port"),
                getConfig().getString("database.name")
        ));
eternal oxide
#

do you have postgresql shaded?

#

check in your actual jar

blazing ocean
#

you could use pgjdbc-ng, it's what I use

mortal vortex
dry hazel
#

that's only relocation

#

my second guess is that the service files are not getting relocated properly hence the driver is not discovered automatically

#

try specifying the driver class name manually

#

(org.postgresql.Driver)

mortal vortex
#

Thanks!

lean river
# fleet pier Try doing it in a scheduler runTask or runTaskAsync

It isnt solving problem CreateWorld() is always on the main thread is anyone know how is it possible to solve that when i am creating a new world my server is freezing for a half of second? its important to me because i will have lots of worlds dynamically created

chrome beacon
chrome beacon
#

That's not the world creator

lean river
#

oh

#

wait

chrome beacon
lean river
#

or here

chrome beacon
#

^ keep it like that

lean river
#

okay thanks i'll test it out

#

okay it doesnt change anything i guess i need to find some other way because i have a timer here and when someone is at game and another world is creating this timer is pausing for a half of second

young knoll
#

You need a fixed spawn location

#

Which means you need a custom chunk generator

lean river
young knoll
#

That’s much better

#

Since you avoid chunk generation entirely

lean river
#

because i literally want same seed for every player

#

so in my situation it can be copy paste

cedar flint
#

For my plugin I have custom items. When an item is generated with stats etc it get saved with an id in a yml file. When I give the item to the player I just give the id and a method creates the item with the lore etc.

Now I want to detect what id an item has when the player holds it. How can I do that?

The most obvious way is lore/nbt but serilization is a pain xd. Any other suggestions?

young knoll
#

?pdc

young knoll
#

Just store the Id in pdc so you can look up the other stuff

ivory sleet
#

^ basically an nbt abstraction

#

@young knoll check dms

#

Importante

blazing ocean
#

@ivory sleet check dms
Importante

young knoll
#

He invited me to a server that steals your account

#

(Real)

blazing ocean
#

omg is it the femboy server

#

concluwube's secret femboy kingdom

ivory sleet
#

Broo naah 😭

ancient plank
remote swallow
indigo orchid
#

any1 know why I am getting this error cannot access com.sk89q.worldedit.bukkit.WorldEditPlugin when I build my project

when I have the dependency and repo already loaded, im on maven and I pressed the little button that shows up to update the pom.xml file too so not sure why its showing up

            <groupId>com.sk89q.worldedit</groupId>
            <artifactId>worldedit-bukkit</artifactId>
            <version>7.3.9</version>
        </dependency>
<repository>
            <id>sk89q-repo</id>
            <url>https://maven.enginehub.org/repo/</url>
        </repository>
sly topaz
#

try 7.4.0-SNAPSHOT instead for the version

indigo orchid
#

still the same error

sly topaz
#

is the error shown in your ide or when you execute mvn package goal?

indigo orchid
#

mvn clean install / mvn clean package

cedar flint
#

I am trying to check for the item the player is holding and used PlayerItemHeldEvent, but that checks if you move way from the item in your hotbar i noticed instead of when starting to hold te item. Is there some sort of way to check if the player starts holding the item?

indigo orchid
sly topaz
indigo orchid
#

can I dm?

#

cant upload ss

sly topaz
#

?img

undone axleBOT
#

Can't send images? That's because you're not verified! Use !verify to complete verification.
Alternatively, you can upload screenshots to any image hosting site and share the link.

Here's some screenshot utilities that you can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org

indigo orchid
#

o

#

@sly topaz

sly topaz
indigo orchid
#

import com.sk89q.worldedit.bukkit.WorldEditPlugin;
import org.blamesafey.destiniaskyblock.commands.island.IslandCommand;
import org.blamesafey.destiniaskyblock.island.IslandManager;
import org.blamesafey.destiniaskyblock.listeners.PlayerJoin;
import org.blamesafey.destiniaskyblock.listeners.PlayerMove;
import org.blamesafey.destiniaskyblock.listeners.PlayerQuit;
import org.blamesafey.destiniaskyblock.listeners.PlayerRespawn;
import org.blamesafey.destiniaskyblock.tpa.TpaManager;
import org.blamesafey.destiniaskyblock.world.SkyBlockGen;
import org.bukkit.*;
import org.bukkit.permissions.Permission;
import org.bukkit.permissions.PermissionDefault;
import org.bukkit.plugin.PluginManager;
import org.bukkit.plugin.java.JavaPlugin;

public final class DestiniaSkyblock extends JavaPlugin {
    String worldName = "skyblock";
    public World world;
    public WorldEditPlugin worldedit;
    private static DestiniaSkyblock skyBlock;

    @Override
    public void onEnable() {
        skyBlock = this;
        this.worldedit = (WorldEditPlugin) Bukkit.getServer().getPluginManager().getPlugin("WorldEdit");
        if (worldedit == null) {
            sendMessage("ERROR, You must have worldedit on your server!");
        } else {
            makeWorld();
            new IslandManager();
            new TpaManager();
            registerPermissions();
            registerCommands();
            registerListeners();
        }
    }
#

just here

#

onEnable

sly topaz
#

I don't think that's how you get the WE instance

#

you do WorldEdit.getInstance() as far I remember

indigo orchid
#

oh I was just following some tutorial

#

but its like outdated as heck

sly topaz
#

you'd just use the PlayerItemHeldEvent#getNewSlot to get the item that the player started to hold

indigo orchid
sly topaz
#

you could also just use it directly whenever you need it

indigo orchid
#

well i don't want my plugin to load without it

sly topaz
indigo orchid
#

lol

sly topaz
#

perhaps you'll have better luck in the EngineHub server

#

perhaps you also have to depend on worldedit-core for it to work?

indigo orchid
#

bet, thanks tho I just thought ti was something to do w the pom.xml idk weird

sly topaz
#

not sure how modern WE API works tbh

sly topaz
#
<dependency>
  <groupId>com.sk89q.worldedit</groupId>
  <artifactId>worldedit-core</artifactId>
  <version>7.4.0-SNAPSHOT</version>
</dependency>
indigo orchid
#

ohh prob why

#

nvm xD

#

yup still does it

sly topaz
#

well I truly do not know now

indigo orchid
#

yeah, idk whats going on and I have never had to install it myself

sly topaz
#

try with a different version

indigo orchid
#

the server I work at already had it in the code base so idk how to do half these things, i just know how to fix bugs 😂 I have exp in java not mc

sly topaz
#

WorldGuard uses 7.3.0

indigo orchid
#

will it be okay if im using mc 1.21.4

#

well

sly topaz
#

WG supports 1.21.4 so I'd hope so

#

API doesn't really change that much anyway so it shouldn't be an issue

indigo orchid
#

so want me to use like 7.3.0

sly topaz
#

sure, give it a go

worthy yarrow
#

I would think WG works with 1.21x, WE does so

indigo orchid
#

actually

#

that worked

#

lmao

sly topaz
#

so it was just the version in the end, that's funny

indigo orchid
#

thanks a lot

indigo orchid
worthy yarrow
#

when you forget a ; and the whole project doesn't compile 😦

indigo orchid
tough umbra
#

is the entity spawn event bugged or smthing

eternal oxide
#

No?

worthy yarrow
tough umbra
#

So I have an event handler that creates a text display and makes the display a passanger to the entity that spawned. But anytime I join the server or I reload it, the server just has a masive crash.

#

The most recent crash log is 85.5 megabytes

worthy yarrow
#

?paste

undone axleBOT
worthy yarrow
#

send us errors

eternal oxide
#

stop listening to the spawn event to spawn a new entity

worthy yarrow
#

that too

eternal oxide
#

or, start ignoring YOUR spawned entites

tough umbra
#

ok

worthy yarrow
#

Spawn the entity then add a display

tough umbra
#

i just realized it

worthy yarrow
#

I'm pretty sure you'll have the entity object after spawning anyway so

tough umbra
#

yeah

worthy yarrow
#

you won't have to listen for the spawn

tough umbra
#

or just ignore if it is a text display

#

thx

#

i didn't think about that

#

@eternal oxide @worthy yarrow I fixed it thanks for the help

worthy yarrow
#

Elgarl is the smart one but no worries lol ❤️

eternal oxide
#

Sometimes 😛

worthy yarrow
#

well I'd have to see errors to be helpful in most cases

#

I feel like you've probably delt with enough weird spigot api stuff that you just know lol

tough umbra
#

yeah

#

i don't know how I didn't realize that

cedar flint
#

I am using the PlayerItemHeldEvent and want to detect what the player is holding in their main hand and in their offhand. How can I check for that because I cant seem to figure out how to integrate the getItemInMainHand with getNewSlow

worldly ingot
#

player.getInventory().getItem(event.getNewSlot()) will always be your main hand

#

Bear in mind also though that you might want to listen for InventoryClickEvent, PlayerPickupItemEvent, and PlayerDropItemEvent, for when items are moved around in the player's inventory. Depends on how in-depth you want to go into this

cedar flint
#

Alr thx

tough umbra
#

how can I stop mobs from being able to take damage, but you can still hit them and they take kb

inner mulch
#

just heal them when they take damage

nova notch
#

set the damage to 0

tough umbra
inner mulch
tough umbra
#

nvm i found it

dawn plover
#

Hello,
I am currently creating a spell casting plugin, and so your hotbar contains spells.
One of the ways to cast one is by selecting the slot of the ability, and it will cast it automatically.

   @EventHandler
    fun onItemHeld(event: PlayerItemHeldEvent) {
        val player = event.player

        val settings = PlayerContextSystem.getContext(player).settings
        if (!settings.quickCastEnabled) return

        if( player.inventory.heldItemSlot != Ability.Slot.PASSIVE.index)
            simulateClick(player)

        player.inventory.heldItemSlot = Ability.Slot.PASSIVE.index
    }

Basically, if you press 4 it goes to slot 4, then the spell in slot 4 is cast. and then it goes back to the passive slot
(we have to go back to the passive slot again, otherwise you cant cast 4 again since this event is only called when there is a change)
For a single press/cast, or a really short hold its all works fine.
Whenever you press 4 it imitialty goes back to its passive slot (8)
However, when you hold the button longer, then for some reason when you release it, it still goes with back and forth between 4 and 8 for the first second or so.

I think this has to do with the amount of requests that are being send by the client to move the selected slot to 4, while it constantly moves it back.
But i am not sure if this is true though

Anyways, i was hoping someone else would know a solution to this, since i looked on the internet and things like a debouncing or adding cooldowns for the slot reset, but it all doesnt work

#

(yes btw, its kotlin that i am writing, but i dont care if anyone gives a java response)

chrome beacon
#

What about the debouncing doesn't work?

dawn plover
#

that just completely breaks it, instead of constntly returning to the Passive slot, it now just sometimes returns to the passive slot, and sometimes not at all.

chrome beacon
#

Can't really recreate the issue on a localhost server 🤷‍♂️

#

Also I recommend you cancel the event so prevent the server from thinking the slot changed for a bit

dawn plover
#

wait, you dont have this problem?

dawn plover
dawn plover
#

if its the same, then i know its just something that really relies on the server performance (its a local server for me to, and my pc is bad af so it would make sence)

chrome beacon
#

Tested both event.setCancelled(true); and event.getPlayer().getInventory().setHeldItemSlot(0);

#

And that being the only code inside of the event listener

dawn plover
#

aha okay.

i wil ltry that, as the only line in the listener
I dont think it will make a difference since the other bits are not that expencive, but you will never know before you try

#

lol yea

#
@EventHandler
    fun onItemHeld(event: PlayerItemHeldEvent) {
      event.isCancelled = true
    }
#

This littaraly gives the exact same problem

chrome beacon
#

Are you testing locally?

dawn plover
#

yup

chrome beacon
#

what version are you on?

dawn plover
#

so it might be my bad copmuter

dawn plover
chrome beacon
dawn plover
#

(plugin has api for 1.21.3 though, but that should not make a difference)

dawn plover
#

XD

#

i have no idea where to look lol

#

oh i found this

chrome beacon
#

Yeah that's on the slower end

dawn plover
#

yea lol

#

But i feel like there should be a way to prevent this that it doesnt have to rely on server performance

#

or i will get back to this when i upgraded my pc. thats also an option

dawn plover
#

since if that is the case. then i will just leave it as is right now, and come back to this feature in 2 weeks or so when my pc got an upgrade

chrome beacon
#

Yeah worked fine for me

#

Running a 5600G

dawn plover
#

i am to dumb to know what that means

#

but i guess bigger number is better

chrome beacon
#

Newer mid range CPU

#

Average CPU

unborn hollow
#

Are you able to have an armorstand ride the player?

inner mulch
#

yes

unborn hollow
#

how would you go about doing that

inner mulch
#

adding the armorstand to the player as a passenger

unborn hollow
#

kk ty

inner mulch
#

player.addPassenger(armorstand)

tough umbra
#

can you hide the heart particles when you kill a mob?

unborn hollow
mortal vortex
#

Was there an error, or it simply did not happen?

unborn hollow
#

let me drop the code real quick

#

it didn't happen

mortal vortex
# tough umbra can you hide the heart particles when you kill a mob?

Try doing this:

    @EventHandler
    public void onEntityDeath(EntityDeathEvent event) {
        // You can try to disable heart particles by temporarily setting the mob's health above 0
        if (event.getEntity().getLastDamageCause() != null) {
            event.getEntity().setHealth(0.5);
            event.getEntity().remove();
        }
    }
unborn hollow
#
        if (event.getRightClicked() instanceof ArmorStand armorstand) {
            if (!armorstand.getName().equals("Hat")) {
                return;
            }
            event.getPlayer().addPassenger(armorstand);
        }
    }```
#

@mortal vortex

mortal vortex
#

try removing the if block, to see if any armor stand will ride the player

unborn hollow
#

kk

mortal vortex
#

So you got rid of this?

            if (!armorstand.getName().equals("Hat")) {
                return;
            }
mortal vortex
unborn hollow
#

should be "onArmorStandRightClick"

lime pulsar
#

ItemType.Typed<M extends ItemMeta> how do you use this?

river oracle
#

you don't on spigot

#

if you're using paper you ask for support there

young knoll
#

Use PlayerInteractAtEntityEvent for armor stands

unborn hollow
prime reef
#

Can I override the version of Jackson that Spigot uses? It's breaking one of my plugins.

#

I use 2.15.1

#

and uh

remote swallow
#

Shade and relocate

prime reef
#

java.lang.NoSuchMethodError: 'com.fasterxml.jackson.core.StreamReadConstraints com.fasterxml.jackson.dataformat.yaml.YAMLParser.streamReadConstraints()

Instead of reading from the shaded version in my jar

#

it's reading from the one bundled in the spigot install from buildtools

#

in the /bundler/libraries directory, relative to wherever you ran buildtools

remote swallow
#

Shade and relocate

prime reef
#

what do you mean "relocate"

#

elaborate

remote swallow
#

Do you use maven

prime reef
#

yeah

#

i already have it shaded

remote swallow
#

Google maven shade plugin relocating

prime reef
#

oh it's a maven thing

#

god I fucking hate Java. thanks though

#

this seems like it should work lmao

mortal vortex
#

You have to relocate

prime reef
#

it's a java dependency management thing*

#

alright this looks simple enough

mortal vortex
#

attaboy

prime reef
#

lmao

#

I actually enjoy raw Java, especially with the modern JDK features

it's the ecosystem surrounding it that makes my head hurt

mortal vortex
#

I hate JDK, i <3 java syntax,

#

I love Kotlin

prime reef
#

my one gripe with java - no pointers

mortal vortex
#

omfg i love kotlin

#

I love kotlin so much

prime reef
#

i was gonna try building something in Kotlin recently, is it that much nicer to work with?

mortal vortex
#

I worked on making an interpreted language in Kotlin

remote swallow
#

It's not used anywhere yet

lime pulsar
#

looks like the only way to put things in a bundle

river oracle
#

While this API is in a public interface, it is not intended for use by plugins until further notice. The purpose of these types is to make Material more maintenance friendly, but will in due time be the official replacement for the aforementioned enum. Entirely incompatible changes may occur. Do not use this API in plugins.

river oracle
river oracle
#

if you're using paper API they fully implemented this API a few versions ago

#

idk why spigot hasn't yet its kinda insane

mortal vortex
#

What is wrong here?

server.scheduler.runTaskAsynchronously(this) {
            runBlocking {
                try {
                    databaseManager.initialize()
                    logger.info("Database initialized successfully!")
                } catch (e: Exception) {
                    logger.severe("Failed to initialize database: ${e.message}")
                    server.pluginManager.disablePlugin(this@Main)
                }
            }
        }
#
Overload resolution ambiguity between candidates:
fun runTaskAsynchronously(p0: @NotNull() Plugin, p1: @NotNull() Runnable): @NotNull() BukkitTask
fun runTaskAsynchronously(p0: @NotNull() Plugin, p1: @NotNull() Consumer<in BukkitTask!>): Unit
river oracle
#

Kotlin can't tell whether you're trying to use the BukkitTask or Runnable method oyu can fix it like so

server.scheduler.runTaskAsynchronously(this) Runnable {
            runBlocking {
                try {
                    databaseManager.initialize()
                    logger.info("Database initialized successfully!")
                } catch (e: Exception) {
                    logger.severe("Failed to initialize database: ${e.message}")
                    server.pluginManager.disablePlugin(this@Main)
                }
            }
        }
#

you could also use the BukkitTask one if you need that

sullen marlin
#

Turns out what's wrong is in fact kotlin

river oracle
#

^

#

idk what your run blocking DSL is, but you could maybe just insert that directly too

#

more importantly I'm confused why you're initializing your database asynchronously. I feel like it'd be smarter to block the server start until your DB connects, its okay to send blocking requests during startup

remote swallow
slim elbow
#

Hi, when I create custom entity with nms to target any closest player it looks like it's deactivated and doesn't do anything for 5-15 seconds right until I try to interact with it or it will start attacking a player after being some time idle.

I am not sure why this is happening, but I believe this is not what is supposed to happen. It's a bit of a problem because a player can sometime run through entity and it won't do anything.

Here is my entity's class. Please forgive me for 1.12.2 nms
https://pastebin.com/fKELuqhR

autumn bramble
#

can anyone help precisely control the spawn rate of amethyst?

umbral flint
#

When a plugin is disabled, is it true that all its listeners are unregistered before the onDisable method is called

mortal vortex
#

I was getting an error:
Suspend function 'executeUpdate' should be called only from a coroutine or another suspend function

mortal vortex
# river oracle more importantly I'm confused why you're initializing your database asynchronous...

Could this do?

override fun onEnable() {
        saveDefaultConfig()

        val config: FileConfiguration = this.config

        val databaseConfig = DatabaseConfig.fromBukkitConfig(config)

        try {
            databaseManager = DatabaseManager(this, databaseConfig)

            runBlocking {
                try {
                    databaseManager.initialize()
                    logger.info("Database initialized successfully!")
                } catch (e: DatabaseException.InitializationException) {
                    logger.severe("Failed to initialize database: ${e.message}")
                    server.pluginManager.disablePlugin(this@Main)
                }
            }
        } catch (e: Exception) {
            logger.severe("Failed to create DatabaseManager: ${e.message}")
            server.pluginManager.disablePlugin(this)
        }
    }
river oracle
mortal vortex
#

without it, I get erros

river oracle
#

whatever your using for database is kinda silly then

#

imagine forcing someone to open a connection asynchronously, in practice sounds smart, but how often do you really need your connection to be added asynchronous

umbral flint
#

Is it possible to listen to a disable event in a listener (I made my own events in an attempt to do what I'm trying to do)

public final class KitListener implements Listener {
// ...
    @EventHandler
    public void onEnable(InvisPracticeEnableEvent event) {
        System.out.println(1);
        Bukkit.getOnlinePlayers().stream()
                .map(Player::getUniqueId)
                .forEach(this::cachePlayerAndKits);
    }

    @EventHandler
    public void onDisable(InvisPracticeDisableEvent event) {
        Bukkit.getOnlinePlayers().stream()
                .map(Player::getUniqueId)
                .forEach(this::saveAndClearCachedPlayerAndKits);
    }
// ...
}
opaque scarab
#

I’ll rephrase here… Is there any way to reliably control the speed of a player flying with an elytra, without any severe stuttering effect? (Deleted old question as it was badly phrased)

river oracle
#

pretty sure the client will predict movement

#

and then stutter back if the server readjusts

opaque scarab
#

Seems right! I’ve found ways to boost the speed of an elytra similar to rockets (rockets are server side velocity I think) but unfortunately I’m not seeing if there’s some way to get full control (also slowing down)… rip

worldly ingot
umbral flint
worldly ingot
#

If it's the current plugin, then is there a reason you're not using your onEnable()/onDisable() methods in JavaPlugin

umbral flint
#

Yeah I want to keep the logic inside that listener

worldly ingot
#

I mean you could keep the logic in that class if you want, and just call some methods

#

I don't think you'll ever receive the enable/disable events for your own plugin

umbral flint
worldly ingot
#

Exactly that, yes

public class MyPlugin extends JavaPlugin {

    private final KitListener kitListener;

    @Override
    public void onEnable() {
        this.kitListener = new KitListener();
        Bukkit.getPluginManager().registerEvents(kitListener, this);
        this.kitListener.onPluginEnable();
    }

    @Override
    public void onDisable() {
        this.kitListener.onPluginDisable();
    }

}
umbral flint
#

Hm ok

worldly ingot
#

Pretend I write all my code correctly lol, you get the idea

umbral flint
#

Yeah I do

#

thanks

worldly ingot
#

\o/

proper cobalt
#

so confused about how ACF args work

mortal vortex
#

4 Edits damn

worldly ingot
ancient plank
prime reef
#

So the relocate thing worked for the core plugin, but now building against that plugin is ass, because I have code that extends some methods in my core plugin

#

tl;dr I was using Jackson in my core library, and now Spigot bundles it in, except I'm using a later version, so some code breaks when it actually executes on the server

someone suggested I use the relocate feature in the maven-shade plugin, so I did, but that ensures unique bytecode generates for the relocated shaded dependency...so the plugin I had building against that core library, which extends a couple of serialization modules to serialize/deserialize things specific to that plugin, now won't build either unless I go and explicitly use all the shaded bits lol

#

It's doable it's just

#

hideous

#

Aight nvm this is utter hell

#

This would work fine if I were not relocating in a library but

#

@sullen marlin Sorry for the ping, but why are you guys using Jackson 2.13.4 specifically?

#

I wouldn't ping but there's a security flaw in older versions

#

and uh, this is one of them

wet breach
#

what security flaw?

river oracle
#

We have it transistively

#

If you think the security bug is insane enough make a bug report to them please

#

Though most of those "security vulnerabilities" aren't really severe and can be ignored

prime reef
#

there's a bug in the XML parser that can break shit

realistically speaking it's probably not a big deal for Spigot, but I have XML parsing as part of this library

#

yeahh this one's probably not severe enough to matter if I'm honest

wet breach
prime reef
wet breach
#

that would affect you

prime reef
wet breach
#

This vulnerability is only exploitable when the non-default UNWRAP_SINGLE_VALUE_ARRAYS feature is enabled.

river oracle
wet breach
#

if you are not using that you are fine

prime reef
#

ah I missed that

#

okay nvm, thanks

prime reef
# river oracle Tbh businesses always be like that

in our case it's because something in our code completely broke after they updated it, because their update was designed for people to not optimize SIMD instructions

which actually broke pre-optimized SIMD instructions

#

but uh. now we can't get support for shit anymore lol

wet breach
#

lol

prime reef
#

I have a set of changes designed to update + fix those issues but they never got approved 💀

wet breach
#

that sucks

prime reef
#

mm red tape

river oracle
#

Tbh no clue what SIMD is looked it up looks like "fun" to implement

wet breach
#

I don't use that library but I know the feeling of having a pr denied for no logical reasoning or something arbitrary

prime reef
#

It's fun in the same way writing ASM is fun

right up until it stops working

#

which in the case of ASM is on first launch

wet breach
river oracle
prime reef
#

Considering we have 10k+ employees, and many of them use these tools, we lose collective months to waiting on tools to run every year...but updating them so that we can do work to make them run faster isn't worth the time? corporate brainrot tbh

wet breach
#

I once submitted a pr for lockette when hoppers came out. Lockette was vulnerable against the hoppers. I submitted a pr for it, admitted it wasn't super optimal, but it got denied

prime reef
wet breach
#

and it annoyed me that they would rather let a plugin be vulnerable to something all because of a small performance hit and then release a proper fix later

prime reef
#

there are two extremes

wet breach
#

lol

#

well I just wanted to have a fix for the thousands that used that plugin

prime reef
#

I mean there's basic code quality like "don't make a HUGE mess" but it's like wiping dust off your desk and then not vacuuming it off the floor afterward

wet breach
#

they can make a proper fix later XD

prime reef
#

i daresay the hoppers themselves were causing more perf hits than whatever your PR did

#

hoppers are notoriously laggy

wet breach
#

indeed

prime reef
#

I think some modified servers do something about them, but Spigot tends to stick close to vanilla

#

not that there's anything inherently wrong with that, I stick to Spigot for that reason lmao

wet breach
#

my pr simply would use movement check on the hopper carts and since you could make the cart slide off the rail, even checked blocks around

#

and then for building it just checked if the player matched the lock

prime reef
#

is Lockette something to do with being able to lock chests?

wet breach
#

yes, it uses a sign and no DB

prime reef
#

i'm guessing hoppers could bypass those locks

#

that's extremely funny actually

#

ew @ the sign though

wet breach
#

and yes hoppers could bypass the locks because it was new functionality since mojang never had items empty out of a chest before

prime reef
#

I mean it definitely makes sense why that would happen

#

but that is also pretty annoying for anyone playing on a server running that plugin

wet breach
#

if they didn't know about it

#

anyways, later versions did get a fix, but like they weren't super quick about it

prime reef
#

unfortunately there's always the one player that will try anything to make other people sad lol

wet breach
#

just annoyed me of their reasoning was all and that they would much rather deny a pr fix then to accept one that works but would need fixing

#

well fixing if it is determined it wasn't to par in terms of performance etc

prime reef
#

Speaking of fixing

#

...how the hell do I explicitly use Jackson 2.15.1 in a plugin that depends on a library that has to use relocated code?

#

This code's in the library, so downgrading is...not an option

prime reef
blazing ocean
#

And exposed

mortal vortex
#

can Exposed be used with Postgres?

blazing ocean
#

Yeap

#

using pgjdbcng

#

just as an fyi, those try/catches are somewhat redundant as your plugin will disable anyway if you have a exception in your initialiser

lilac dagger
#

If you can depend on it then you can use build to reshade it

#

This is how I do it for my arcade addons

#

The game engine is reshaded in arcade and the add-ons depend on the game engine/arcade that are unshaded to the add-on module

#

So I apply another shade in the add-on to fix the difference

fading drift
#

1.8 how do I get the data from these skulls and then set the data

wet breach
fading drift
#

yeah but I dont know the name of the skin and skull.getOwner is null

#

and idk what that base64 data is when you lookup player skulls

wet breach
wet breach
#

as long as you know the name of the player you can obtain that data yourself manually

#

and that data just allows servers and clients to download the texture

fading drift
#

yeah skullmeta apparantly has the owner set to nothing

#

maybe I'm tripping

#

sorry skullmeta is item based

#

I need block info

#

skull.getOwner is null but hasOwner returns true

#

I figured it out

wet breach
fading drift
#

had to use reflection to set textures property

#

and also set owner to some random name

lilac dagger
#

There's the player profile api you can use

wet breach
lapis widget
#

I don't know if I should be proud of my self for this but oh well
couldn't figure out why nms was being a pain

lilac dagger
#

But i thought we don't support 1.8 anymore

wet breach
lilac dagger
lapis widget
#

Anyone have a better idea for what I'm trying to acomplish

lapis widget
lilac dagger
#

Since you're on 1.8 it means you have to get the profile's skin property

#

Ah wait

lapis widget
#

wrong reply hehe

lilac dagger
#

Dif person

lapis widget
#

Yep yep yep

lilac dagger
#

Create a version module where you keep the interfaces

#

And a module for each version

#

@lapis widget

lapis widget
lapis widget
blazing ocean
#

1.8 smh

lilac dagger
#

isn't it time consuming keeping compat for so many versions?

blazing ocean
#

probably

lapis widget
#

I don't usually add features to the calculation code
Just visual updates for the server owners to use

lilac dagger
#

so then it's this that has to be updated

lapis widget
#

its only broken on 1.21 thank god (the default method)

lilac dagger
#

why is that?

radiant plaza
#

help me Hello, who can help me with something, that is, create a menu with a kit for my paper server with the DeluxeMenus plugin, I hope you can help me, give me a config for a fine menu with a kit in private or even here in general

lapis widget
lilac dagger
lilac dagger
lapis widget
radiant plaza
lilac dagger
#

he asks for help with deluxe menu

lapis widget
#

oops lol

lilac dagger
#

it really isn't, keep trying

lapis widget
#

Maybe chatgpt can help

lilac dagger
#

chat gpt doesn't know what to do in this case

#

i don't think it ever saw a deluxe menu config

lapis widget
#

Im not gonna vouch for accuracy but it did provide me with a answer

lilac dagger
#

it doesn't work for me

radiant plaza
#

Hello, who can help me with the DeluxeMenus plugin, that is, give yourself a config with a Server Information menu

lilac dagger
#

you should try looking into the wiki above

lapis widget
blazing ocean
#

proompting moment

lapis widget
#

🎆

pseudo hazel
#

you should let the prompting be done by actual prompt engineers, its a whole field of work you see

#

so next time, hire prompt emgineers to gpt you the answer instead of a dev that can do it for you

sly topaz
#

all you have to do is provide it the necessary info to build up the structure

#

the result will be as good as the prompt you give it

sly topaz
pseudo hazel
#

I mean

#

if you have the money but not the time

#

thats how the world works

sly topaz
marsh hawk
#

Is there any way to teleport entities with passengers, or is that still not possible? Dismounting,teleporting and then mounting again does teleport, but its buggy when done every tick.

inner mulch
#

or am i wrong?

marsh hawk
#

Huh, that would be weird. When I tried it out, teleport wouldnt do anything unless I dismounted the passengers.

inner mulch
#

what entity are you teleporting?

eternal oxide
#

cant tp with passenger

marsh hawk
marsh hawk
inner mulch
#

i only ever tried players

#

thats probably why it worked

kind hatch
#

One day it will be

marsh hawk
blazing ocean
marsh hawk
blazing ocean
#

They have a seperate function for teleporting with flags, one of them is for allowing passengers. On spigot, the function just returns false when called with passengers mounted

kind hatch
#

Isn't there an open PR to fix that issue?

blazing ocean
#

¯_(ツ)_/¯

kind hatch
blazing ocean
#

Can't view it :p
Gonna have to sell my soul to daddy md_5 first

sly topaz
blazing ocean
#

I've never needed it

sly topaz
#

it's fun to look at what the status of some PRs are from time to time

sly topaz
kind hatch
#

:sadge:

#

Would be cool to see it revived

glossy laurel
#

how do I make creeper spawn eggs with a specific nbt tag get ignited on spawn

glossy laurel
young knoll
#

Sure

glossy laurel
young knoll
#

Not that I know of

glossy laurel
#

alr

quaint mantle
#

@jagged quail

chrome beacon
#

Why are you just pinging random people

slender elbow
#

fun!!

quaint mantle
quaint mantle
chrome beacon
#

No one will help you if you have that behaviour

quaint mantle
glossy laurel
#

How do I like get a block data of air or something

slender elbow
#

Material.AIR.createBlockData or something

glossy laurel
#

How do I create an entity snapshot without an actual entity? I want something like EntityType + a few methods applied to it

young knoll
#

World.createEntity

glossy laurel
worthy yarrow
#

It is

slender elbow
#

it's in RegionAccessor

#

which World implements

glossy laurel
#

oh

#

righ

#

t

slender elbow
#

createEntity + Entity#createSnapshot

glossy laurel
#

yeah alr

#

Quick question, what's the difference between BlockDataMeta and BlockStateMeta

slender elbow
#

you're not gonna believe this

#

one holds a BlockData and the other holds a BlockState

glossy laurel
#

crazy

slender elbow
#

ikr

worthy yarrow
#

He’s probably asking what’s the difference between state and meta

glossy laurel
#

actually thats a good question too

#

ik what state is

#

not what meta is tho