#help-development

1 messages · Page 403 of 1

analog thicket
#

Yo does anyone have a good "Tutorial/Documentation" on using Packets for armor stands.

worldly ingot
#

That doesn't really narrow it down

vagrant stratus
#

If you're trying to do holograms packets aren't needed lol

torn shuttle
#

god going to bed sounds so good rn

torn shuttle
#

I just can't get any sleep lately

vagrant stratus
#

You can do animations w/o packets lol

analog thicket
#

I know, I just want to use packets cause theres gonna be alot..

vagrant stratus
#

?paste

undone axleBOT
analog thicket
#

I kinda get it, but there are just a few things I'm missing.

vagrant stratus
analog thicket
#

Ill take a look Thanks

vagrant stratus
#

Not packets, but it's how I deal w/ animations multiple armorstands

#

I want to rip out the hologram stuff & put it into a proper open source library, just haven't gotten around to it

undone yarrow
#

I changed my code to add a msg saying which item you received, but it broke everything. Here's the changes I made to the code with some annotations from what works and what doesn't. Can someone please help bcs I havent a single clue why this isnt working.
https://paste.md-5.net/vibemesuxu.cs

torn shuttle
#

someone remind me real quick, how do I put several BaseComponents together to string a message together?

modest garnet
vagrant stratus
undone yarrow
torn shuttle
#

gotcha thanks

worldly ingot
#

Or ComponentBuilder

vagrant stratus
torn shuttle
#
            if (SpecialItemSystemsConfig.isAnnounceImportantEnchantments() && ItemTagger.getEnchantmentCount(upgradedItem) > 10)
                if (!SpecialItemSystemsConfig.getSuccessAnnouncement().contains("$itemName"))
                    Bukkit.getOnlinePlayers().forEach(player -> player.spigot().sendMessage(
                            ChatMessageType.CHAT, TextComponent.fromLegacyText(
                                    ChatColorConverter.convert(SpecialItemSystemsConfig.getSuccessAnnouncement()
                                            .replace("$player", ((Player) event.getWhoClicked()).getDisplayName())))));
                else {
                    TextComponent itemName = ShareItem.hoverableItemTextComponent(upgradedItem);
                    String[] text = SpecialItemSystemsConfig.getSuccessAnnouncement().split("$itemName");
                    BaseComponent[] baseComponent1 = TextComponent.fromLegacyText(ChatColorConverter.convert(text[0].replace("$player", ((Player) event.getWhoClicked()).getDisplayName())));
                    BaseComponent[] baseComponent2 = TextComponent.fromLegacyText(ChatColorConverter.convert(text[1].replace("$player", ((Player) event.getWhoClicked()).getDisplayName())));

                    ComponentBuilder componentBuilder = new ComponentBuilder();
                    componentBuilder.append(baseComponent1);
                    componentBuilder.append(itemName);
                    componentBuilder.append(baseComponent2);

                    Bukkit.getOnlinePlayers().forEach(player -> player.spigot().sendMessage(ChatMessageType.CHAT, componentBuilder.getCurrentComponent()));
                }

aw yeah that's hot, that's hot

sullen marlin
#

.getCurrentComponent?

orchid gazelle
#

hi how do I register a Listener for a Class that has a normal Constructor already?

sullen marlin
#

should it be .build or whatever

torn shuttle
#

should it?

#

hm

#

there is no build

sullen marlin
#

.create

#

idk

#

the one that does the thing

torn shuttle
#

there is a create

#

i'll test with that

orchid gazelle
orchid gazelle
#

I have a class, which has a Constructor. But it also implements Listener. The issue is that I cannot construct it as a Listener for my event-registering

modest garnet
orchid gazelle
modest garnet
vagrant stratus
#

Also why do plugins have a static instance usually e.g. PluginName.getInstance(), doesn't Bukkit.getPluginManager().getPlugin("") accomplish the goal of a singleton instance?

orchid gazelle
#

I cannot just create an Object for the Listener

#

that will mess up things if I'd just create it with nulls

modest garnet
#

why do u need a Object

torn shuttle
#

interesting, that $ is a regex anchor?

#

hm

vagrant stratus
#

What's the problem w/ that though lmao

orchid gazelle
torn shuttle
#

huh

modest garnet
#

so u just place the args there

torn shuttle
#

is $ a special character in regex?

vagrant stratus
#

forces people to use Bukkit.getPluginManager().getPlugin kek

modest garnet
torn shuttle
#

any ideas as how to escape that?

orchid gazelle
#

infact it is 100x more unorganized to have extra classes for every Listener

rotund ravine
#

\

torn shuttle
#

IDE says that's illegal

orchid gazelle
#

its not random

modest garnet
orchid gazelle
#
    private ArmorStandSelection() {
        
    }
    
    public static void registerListener() {
        Bukkit.getPluginManager().registerEvents(new ArmorStandSelection(), LoopCityScript.plugin);
    }

What about that?

#

no just no

vagrant stratus
#

I sometimes self-register via the constructor

orchid gazelle
#

thats so unorganized and ugly

orchid gazelle
modest garnet
#

no way your registering a listener in a listener class

orchid gazelle
#

I don't see any issue with that as long as I think its way more beautiful and organized

vagrant stratus
#
public class Example implements Listener {

    public Example(Plugin plguin) {
        Bukkit.getPluginManager().registerEvents(this, plguin);
    }

}
rotund ravine
#

Why do you need that static method? @orchid gazelle

modest garnet
orchid gazelle
rotund ravine
#

Why would you do that? And what harm is it gonna cause?

vagrant stratus
#

Sup Jan 👋

rotund ravine
#

Heya optic

orchid gazelle
vagrant stratus
#

I have so much to do, currently working on a HologramAPI while waiting for a response for #1082384260754841610 lol

rotund ravine
#

Prefix your listeners with something then @orchid gazelle

orchid gazelle
#
    private ArmorStandSelection() {
        Bukkit.getPluginManager().registerEvents(this, LoopCityScript.plugin);
    }
    
    public static void registerListener() {
        new ArmorStandSelection();
    }
``` better?
rotund ravine
vagrant stratus
rotund ravine
#

Some people here knows math

#

Might be better off on tph

vagrant stratus
#

Yea, but this is more than math considering it's not Point A -> Point B, but a full on nav mesh

rotund ravine
#

Ye

orchid gazelle
#

I gotta say one thing is definitely annoying me about the Bukkit API. I really want event.cancel(); instead of event.setCancelled(true);

vagrant stratus
#

I could do parts of it with Pathfinder goals, but not all of it, plus they'd be messy 😐

rotund ravine
#

@orchid gazelle why?

orchid gazelle
#

ugly

vagrant stratus
#

It would be best to do a from scratch library which properly takes into account what I'm looking for lol

rotund ravine
#

@orchid gazelle Doesn’t seem very versatile.

orchid gazelle
#

some things are just ugly

dry yacht
# orchid gazelle ugly

The reason seems to be that you should be able to "un-cancel" events that have been cancelled. It's not a latch, might be only in some instances.

orchid gazelle
#

well im fine with it existing

#

but I want an additional event.cancel()

vagrant stratus
#

Ah @dry yacht, I'm actually working on publicizing the hologram API so you'll also be able to help improve it lmao

untold jewel
#

I have a rank system with every rank having a list of strings aka permissions. Everything works, adding someone to a rank, chat prefixs, permissions showing up in the yml and gui. But when I'm rank (example: admin) I'm not allowed to use those permissions admin is holding. I have never worked with permissions like this before so if someone could please explain?

dry yacht
dry yacht
vagrant stratus
#

Well, it'll be os anyways lmao

orchid gazelle
#

bruh I forgot to register this command dammit

#

gonna straight up gonna make the CommandAPI after a bit of this one lol

dry yacht
orchid gazelle
#

you already said it, ease of use

rotund ravine
#

You can use manifold to add extension functions

dry yacht
#

...

orchid gazelle
#

almost thought my code works first-try lol

#

oh lol my code works now, insane!

brave sparrow
# untold jewel I have a rank system with every rank having a list of strings aka permissions. E...
BukkitWiki

This tutorial will guide you through how to create your own permissions plugin that sets permissions using the new Bukkit permissions API. This tutorial assumes you have a good understanding of the Java language, and general plugin development. This tutorial will only cover the specifics of the Bukkit permissions API. Everything that can have pe...

orchid gazelle
#

?slots

river oracle
orchid gazelle
#

uhm wasnt there some graphic of where each slot is?

smoky scroll
#

is there a general do in order to create a inventory.yml for a trading villager inventory?

river oracle
#

No

dry yacht
orchid gazelle
#
        } else {
            System.out.println("=(");
        }
``` best debugging
dry yacht
orchid gazelle
#

I found the point where it breaks lmao

dry yacht
orchid gazelle
#

xd

rotund ravine
dry yacht
tardy delta
#

he is probably iterating over his listeners package, instantiating each one

dry yacht
#

Oh, I don't do that, as I use proguard for dead code elimination. I need actual uses of classes. I had that system once, but it's needlessly complex.

pseudo hazel
#

where is that inventory tutorial from slime again?

tardy delta
#

anyways i need opinions

#

dont really want to have maps floatin around

pseudo hazel
#

why not xD

#

cuz its messy?

dry yacht
#

You're only "exposing" the manager in further steps anyways, I'd assume, so don't overcomplicate that intermediate step to be pattern conform...

tardy delta
#

hmm

dry yacht
vagrant stratus
#

also yea, just gonna re-do that thread I made lmao

dry yacht
#

Minestom is all about control

tardy delta
#

well it doesnt let me control the internal recipemanager so i gotta make my own 💀

#

hardcoded

dry yacht
#

:(

tardy delta
dry yacht
#

What a beauty.

tardy delta
#

a CopyOnWriteArraySet copies its internal array on every #add invocation right?

orchid gazelle
#

wtf is removing my entry out of the map without removing the entry out of the map???

tardy delta
#

ugh

hazy parrot
#

should also do same on remvoe

tardy delta
#

copying its array a 1000 times then

ivory sleet
#

yes usually fourteen

tardy delta
#

dammit minestom

orchid gazelle
#

ahhh yess sure... items.put(0, testBow); items.get(0) is null yes yes

ivory sleet
#

otherwise, you can if u want use a reentrable read write lock

orchid gazelle
#

well its working when calling in the same constructor but on the event its null lol

tardy delta
#

oh i cant modify impl

#

i can always fork it but whatever

orchid gazelle
#

im literally raging right now lmao

vagrant stratus
ivory sleet
#

also fourteen

tardy delta
#

time to copy their code into my version of it 💀

ivory sleet
#

ConcurrentHashMap.newKeySet()

vagrant stratus
#

It is, for the most part, a 1:1 port currently lol

ivory sleet
#

if u want a concurrent set impl

orchid gazelle
#

I cannot see ANY reason why this should EVER be null

tardy delta
#

oh i dont, i was just wondering if it really went brr cuz im adding 1000 recipes and it looks like its copying itself a thousand times then

ivory sleet
#

yea

tardy delta
#

addAll still slower 💀

ivory sleet
#

I mean, what does the name CopyOnWrite suggest to u lol

tardy delta
#

🥵

vagrant stratus
#

Oh, seems like I also left some of the original code in it lmao

modest garnet
#

anyone know how to create regions with fawe

tardy delta
#

rare footage of optic in this channel

vagrant stratus
#

yea, still have to do a lot of work but once I fix the issue of leaving some of the original code in, it would at least be enough to look at @analog thicket

analog thicket
vagrant stratus
#

Watch this simple change break everything lmao

orchid gazelle
#

omg reflection error imma shit myself lol

#

ahh there we go

#

how do I use #getClass().getMethod() on an Object?

dry yacht
dry yacht
#

First arg is instance, null for static, remaining args are params

orchid gazelle
#

im trying selection.getClass().getMethod(hItem.getExecutorName()); but yeah its the wrong object

#

getting java.lang.IllegalArgumentException: object is not an instance of declaring class

vagrant stratus
#

@analog thicket
With the current API as is

// Basic Hologram
Hologram hologram = new Hologram(location, text);
hologram.setSubtitle(string);

HologramManager manager = (HologramAPI) Bukkit.getPluginManager().getPlugin("HologramAPI").getHologramManager();
manager.addHologram(hologram);

// Animation
AnimationManager handler = hologram.animationHandler();
handler.addAnimationTask(new HoverAnimationTask(plugin, hologram, seconds, player));

hologram.activate();
hologram.deactivate();

Removing from the manager is a bit annoying, but that'll get fixed in the next commit since I plan on making this more friendly for public plugin

tardy delta
#

ah ye sure my coding is going brr anyways

orchid gazelle
#

method.invoke(method);

#
    public void onBowClick() {
        player.sendMessage("Clicked UI-Element | Bow");
    }```
dry yacht
orchid gazelle
#
            java.lang.reflect.Method method;
            try {
                  method = selection.getClass().getMethod(hItem.getExecutorName());
                  method.invoke(method);
                } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException | NoSuchMethodException | SecurityException e) {
                    e.printStackTrace();
                }
        }
#

selection is an Object which is this Class

tardy delta
#

Suspicious call to 'List.contains()' bro

orchid gazelle
dry yacht
dry yacht
#

What made you think invoking the method on itself would work, xDD

orchid gazelle
#

it has no args

#

it gets all data it needs from the Object

dry yacht
#

Great, then that'll work

tardy delta
#

cant even find a contains method on an inv object lol

#

what is this

orchid gazelle
tardy delta
#

this is to be threadsafe ig?

#

they using a varhandle instead of a normal array lookup

dry yacht
torn shuttle
#

look at that

#

I finished

#

I can go to bed now

orchid gazelle
#
[22:00:03 WARN]:        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[22:00:03 WARN]:        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
[22:00:03 WARN]:        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[22:00:03 WARN]:        at java.base/java.lang.reflect.Method.invoke(Method.java:568)
[22:00:03 WARN]:        at LoopCityScript-1.0.0.jar//de.dafeist.loopcityscript.entity.armorstand.ArmorStandSelection.onInteract(ArmorStandSelection.java:77)
...

dry yacht
terse ore
#

could someone explain me how to add a jar as dependency

orchid gazelle
#

wait maybe I forgot recompiling lol

#

LMAO I DID

#

im so sorry

dry yacht
orchid gazelle
#

but hey at least it works now lol

#

so I won

#

are you winning son? YES IM WINNING

#

Happy to say I made progress today

tardy delta
#

damn atleast something of my code works

#

but im doing two streams over a method that gets called 1000 times when a player joins 💀

wary topaz
#

event.getInventory().remove(Material.NETHERITE_INGOT, 2);
As you can see the 2 is redundant, how can I makeit work?

Thisis in the event playerpickupitem

#

or should I just add -2 items to the inventory (how would I do this)

smoky oak
#

is strings[] null if no parameters are given?

chrome beacon
#

In the main method?

smoky oak
#

ye

#

onCommand

chrome beacon
#

Should be an empty array

smoky oak
#

uh

#
 String numberString = strings.length == 0 ? "1" : strings[0];

causes
ArrayIndexOutOfBoundsException: Index 0 out of bounds for length 0

tall dragon
#

ye cuz the array is empty

smoky oak
#

isnt the three element (condition ? true : false)

#

it should give "1" if the arrays empty not strings[0]

tall dragon
#

ah i read that wrong

#

thats weird indeed

#

inline if statements are indeed (condition ? true : false)

smoky oak
#

ikr

#

so whats goin on here

chrome beacon
#

Make sure that's actually where the error is from

eternal oxide
#

Nothing wrong with that code

smoky oak
#

?????????

#

recompiling fixed it

#

wtf

eternal oxide
#

you may want to (strings.length == 0)

#

readability

safe ibex
#

How would I pass in item IDs as args to a command?

#

Like what's the best way to make sure the Item ID is an actually valid ID rather than not just nonsense?

#

@eternal oxide would you know?

#

Like is there an interface or enum thingy I can use to check if the ID is valid

chrome beacon
#

You can use the material enum

safe ibex
#

Oh wait how would I do that?

#

Wait are they all of the items?

chrome beacon
#

It's every material, so it's both blocks and items

safe ibex
#

oh yes ok that's good

#

also Java solved some of my problems 💀

modest garnet
#

anyone know how to create regions with fawe

chrome beacon
#

Regions?

#

You mean like WorldGuard?

clever musk
#

Does spigot have an access widener, like this?

opal juniper
#

for plugins?

clever musk
#

Yes

clever musk
#

I was hoping for bytecode stuff

opal juniper
#

you will need mixins for that

clever musk
#

great..

#

Time to do research

analog thicket
#

Is there a way to make the animation of the chest opening, without opening the chest?

#

If that makes sense

clever musk
#

packets

#

or maybe spigot has a thing for that

analog thicket
#

Already using them no problem then

#

Is there a Stackoverflow post somwhere?

clever musk
#

1 sec

clever musk
analog thicket
#

Yep

clever musk
#

I'm fairly sure you can find what you're looking for in net.minecraft.world.level.block.ChestBlock

analog thicket
#
    public void playChestAction(Chest chest, boolean open) {
        Location location = chest.getLocation();
        World world = ((CraftWorld) location.getWorld()).getHandle();
        BlockPosition position = new BlockPosition(location.getX(), location.getY(), location.getZ());
        TileEntityChest tileChest = (TileEntityChest) world.getTileEntity(position);
        world.playBlockAction(position, tileChest.w(), 1, open ? 1 : 0);
    }

Found this, altough how the hell do i get the Chest varible?

#

Is it just the clickedblock

clever musk
analog thicket
#

Aarh thx

clever musk
#

get tilestate

#

cast to chest

#

Does anyone know if spigot has a mixins API?

analog thicket
#

nvm ill just loook it op

#

look*

clever musk
#

Probably use an enderchestblock class

analog thicket
#

What the heck my google isn't responding and i got kicked from my server, but still have discord available -.-

eternal night
clever musk
#

RIP

eternal night
#

exists however

analog thicket
clever musk
#

run same method with false

#

?

#

That should work...

analog thicket
#

Well changed some stuff, i just have to set the byte to 0

#

oh im stupid lol

#

Forgot there was a boolean -.-

#

I'll head to bed, thanks for the help @clever musk

modest garnet
regal scaffold
#

What's permissionattachment instead of just permission

undone axleBOT
quaint mantle
#

hey I'm trying to update a 1.16 plugin (unfortunately I am rather stupid and don't know anything about plugin development) could I possibly have some help?
I was told by a friend that the issue is related to an outdated plugin library
although idk if that's true or not

wet breach
#

permission, is just a single permission, but a permissionattachment can hold multiple permissions

#

or information in regards to such

#

an analogy would be like Chunk. Chunk is just the holder of the blocks of a given area where as a block is just a single block

regal scaffold
#

Run a timings report

hazy parrot
#

Parts of this code doesn't makes sense

#

You have while loop, yet instantly changing one of flags

modest garnet
hazy parrot
#

Yeah, but you cancel it instantly

#

No reason to use tasktimer then

frank kettle
#

Why is that a listener?

#

Has no event on the class

#

Also your loop to play a sound plays them all at the "same time" since they are not being set to take longer depending on the loop value

#

Why a cancel on the end of a task itself doesn't make sense like goksi said

#

@quaint mantle you removed the messages but did you find your issue?

warm mica
#

miau

frank kettle
#

Also make sure the "queue" the class was getting from the main class exists.

frank kettle
warm mica
#

🐈

frank kettle
#

🐱

warm mica
frank kettle
#

yus

#

Pwetty sky

modest garnet
#

anyone know how to create regions with fawe

ivory sleet
#

Yes

#

But you can use normal we api?

dry yacht
quaint mantle
# dry yacht Would be helpful to know what plugin it's about and whether it's source is avail...

the plugin link is https://github.com/HalfQuark/BlastResistanceOverride

This is the error I get when I try to run the plugin on 1.19.3
[22:32:34 INFO]: [BlastResistanceOverride] Enabling BlastResistanceOverride v2.0
[22:32:34 WARN]: java.lang.ClassNotFoundException: me.halfquark.blastresistanceoverride.blockoverride.v1_19_R2BlockOverride
[22:32:34 WARN]: at org.bukkit.plugin.java.PluginClassLoader.loadClass0(PluginClassLoader.java:179)
[22:32:34 WARN]: at org.bukkit.plugin.java.PluginClassLoader.loadClass(PluginClassLoader.java:126)
[22:32:34 WARN]: at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
[22:32:34 WARN]: at java.base/java.lang.Class.forName0(Native Method)
[22:32:34 WARN]: at java.base/java.lang.Class.forName(Class.java:375)
[22:32:34 WARN]: at BlastResistanceOverride2.1.1.jar//me.halfquark.blastresistanceoverride.BlastResistanceOverride.onEnable(BlastResistanceOverride.java:26)
[22:32:34 WARN]: at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264)
[22:32:34 WARN]: at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:371)
[22:32:34 WARN]: at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:544)
[22:32:34 WARN]: at org.bukkit.craftbukkit.v1_19_R2.CraftServer.enablePlugin(CraftServer.java:578)
[22:32:34 WARN]: at org.bukkit.craftbukkit.v1_19_R2.CraftServer.enablePlugins(CraftServer.java:492)
[22:32:34 WARN]: at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:637)
[22:32:34 WARN]: at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:436)
[22:32:34 WARN]: at net.minecraft.server.dedicated.DedicatedServer.e(DedicatedServer.java:303)
[22:32:34 WARN]: at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:1103)
[22:32:34 WARN]: at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:318)
[22:32:34 WARN]: at java.base/java.lang.Thread.run(Thread.java:833)
[22:32:34 ERROR]: [BlastResistanceOverride] Startup - Version Not Supported

#

wait wrong link

#

okay fixed the link

dry yacht
quaint mantle
opal frigate
#

Hello, I am currently trying to get the block state id for packet use:

        CraftBlockState blockState = (CraftBlockState) location.getBlock().getState();
        int blockId = Block.getId(blockState.getHandle());

However, blockId is always 0, does anyone know why? Thanks.

sullen marlin
#

Why are you using packets

opal frigate
worldly ingot
#

We have API for this

worldly ingot
# worldly ingot We have API for this

Unfortunately the name of the enum is a tad misleading (because event purposes change from version to version) but what you're looking for is

world.playEffect(location, Effect.STEP_SOUND, Material.WHATEVER);
opal frigate
#

Oh, I didn't know this was a thing, thanks

graceful oak
#

Im just starting to look into packets and using protocollib and I understand how to do simple things like getting player locations and a few things I saw yt videos on but not im trying to play around with breaking animations and im kinda lost. Would anyone be able to point me in the right direction? Not really sure how to work it

wet breach
#

Right direction in regards to what?

#

Just using packets?

#

https://wiki.vg this site is going to help you and pretty much everyone uses it to reference the protocol and packets. As for protocollib goes they have their own api.

graceful oak
#
ProtocolManager manager = ProtocolLibrary.getProtocolManager();

        manager.addPacketListener(new PacketAdapter(plugin, ListenerPriority.NORMAL, PacketType.Play.Server.BLOCK_BREAK_ANIMATION) {
            @Override
            public void onPacketSending(PacketEvent e) {
                Bukkit.getConsoleSender().sendMessage("Sending Packets");
            }
        });

Im a little confused because when I was using the location packets and other packets I was able to get messages to send to the player / server by doing the action but I dont think im getting the packets because im not receiving any messages did I do something wrong? .

marsh burrow
#

Hey mates, would anyone know how to set the helmet of an armor stand inside of a mob spawner?

cobalt thorn
#

Hi, how can i make load a task when the first only join?, this idea is for a bar that only works with players only and to not work load the server.

tawdry echo
#

Isplayedbefore

#

!

cobalt thorn
#

And none else is there

dry yacht
#

Check the size of Bukkit.getOnlinePlayers() in the JoinEvent handler

dry yacht
#

I guess it should be one, maybe also zero, I forget how the event is called. Try and see, xD

analog thicket
#

Sometimes yes other times it spits out junk

rotund ravine
graceful oak
# rotund ravine Why do you need packets for that?

Well dont I need to get the packets so I can delay/change them while someone is mining the block? How would would I know when the player is mining the block if I just had a left click event I wouldnt be able to tell if they are holding left click right? I could be wrong kinda still figuring out all this packet stuff

quaint mantle
#

How to change player hitbox size?

chrome beacon
#

It won't be perfect and a bit laggy

chrome beacon
#

Start by finding where it came from

vital sandal
#

How to disable reflection logging ?

chrome beacon
#

Reflection isn't logged by default

wet breach
#

Called everytime when they are breaking the block

#

And then there is an abort event if they stop as well

eternal oxide
#

He's probably talking about the Java 11 warning about reflective access

#

and no that can't be muted

chrome beacon
eternal oxide
#

ah

chrome beacon
#

It looked like they were using some reflection lib or smth

#

Not enough information to help though

vital sandal
torn shuttle
#

what's up losers, anyone know of a quick way to sort text alphabetically?

vital sandal
ivory sleet
torn shuttle
#

yeah

chrome beacon
vital sandal
torn shuttle
#

well not just the first word

vital sandal
#

like for an hour

torn shuttle
#

I probably have no real shortcut for it but I have a bunch of identical things with 1-20 at the end of them and it sure would be cool if they weren't in an arbitrary order

#

and on top of that they start with letters which would also be cool to have in alphabetical order

#

I'm probably screwed aren't I

echo basalt
torn shuttle
#

hmm

echo basalt
torn shuttle
#

oh lit

#

alright let's see

#

do I even remember how my own code works

echo basalt
#

or you can just compareTo

#

and fuck off

torn shuttle
#

I can't fuck off yet, god put me on this earth for a reason and I have not as of yet thrown you off a cliff

echo basalt
#

pull up then

#

got a lil cliff next to my house

chrome beacon
chrome beacon
torn shuttle
#

oh I once again see I was smoking some fine crack cocaine while writing this code

#

oh well who cares about efficiency for a method that only ever runs once

torn shuttle
#

man I am not awake enough for this one

heavy mural
#

Hey, is there a way to disable netherite armor's knockback resistance through spigot?

wet breach
#

Think you will have to mess with attributes or something similar

heavy mural
#

As in the item attributes of every netherite armor piece to remove the knockback resistance attribute (if there is one)?

pseudo hazel
#

yeah

heavy mural
#

Alright I'll give that a try, thank you :)

torn shuttle
#
List<EMPackage> rawEmPackages = EMPackage.getEmPackages().values().stream().toList();
        List<String> alphabeticalSort = new ArrayList<>();
        rawEmPackages.forEach(iteratedPackage -> alphabeticalSort.add(iteratedPackage.getDungeonPackagerConfigFields().getName()));
        List<EMPackage> emPackages = new ArrayList<>();
        alphabeticalSort.forEach(entry -> rawEmPackages.forEach(iteratedPackage -> {
            if (iteratedPackage.getDungeonPackagerConfigFields().getName().equals(entry))
                emPackages.add(iteratedPackage);
        }));

get yourselves some code that can complete in O(wacky) time

#

oh wit did I even sort

#

lol

remote swallow
#

go to or bnack to bed

torn shuttle
#

no I just need more coffee

remote swallow
#

no you dont

echo basalt
#

coffee doesn't replace brain cells

dry yacht
#

Any ideas on why that supplier is executed, even if logging on that level is not even active? I'm passing down JavaPlugin#getLogger to all of my instances. The messages aren't logged, but the debug print still shows up.

pseudo hazel
#

idk maybe it gets the supplied result before checking if it should be used in the first place

dry yacht
#

The thing is... it actually checks. So isLoggable has to return true, but it still doesn't log the message. That's kinda besides the point of a logger, as I'm literally loosing processing time on building all those messages. There are many FINEST logs, which are all needlessly computed. I'm only using that logger since very recently, as I've been using my custom logger before. Maybe I'm just using it wrong, haha

pseudo hazel
#

hmm

dry yacht
#

logger.setLevel(Level.INFO) did the trick, the suppliers are no longer invoked. Seems like the plugin logger was wrongly configured by default, and the messages didn't come through because the parent logger (Bukkit#getLogger, I guess) was configured to a higher level.

Dude, that literally wasted 3 full seconds of CPU time, I'm glad I found it through the JProfiler, xD

wispy wyvern
#

guys, i am just starting and when i created my spigot project, i cant debug the plugin

#

it has no run configurations

regal scaffold
#

Does anyone use ACF in their plugin releases?

#

Or just for testing

regal scaffold
#

What does that even mean lol

#

How you doing today bytes

smoky oak
#

LOL GPT3 knows spigot


Inside the method, we get the player who triggered the event using event.getPlayer() and the armor piece that they are trying to equip using event.getNewItem(). If the armor piece is a diamond helmet, we cancel the event using event.setCancelled(true) and send a message to the player using player.sendMessage().```
wet breach
#

Well it has existed before the time limit that the ai has for knowing things

smoky oak
#

well yes but if i ask it for specific things it usually doesnt know it

wet breach
#

Depends on what those specifics are lol

smoky oak
#

point

#

iirc i asked it about my name

#

and it was like

#

'nope'

wet breach
#

Not sure why it would know your name unless instead you wanted the etymology of your name

#

But in either case you would still have to tell the ai your name lol

smoky oak
#

i meant the name of this account

#

i know the etymology of my name

wet breach
#

You must not been popular enough before the time the ai has then

smoky oak
#

fat chance lol

#

HAH

#

i asked it about your name

#

'an error has occured'

#

so for me it says idk for you it just breaks

#

tf did you do

remote swallow
#

hes too powerful

wet breach
smoky oak
#

i didnt ask it about your name

wet breach
smoky oak
#

i asked it about your alias

#

im fairly sure it couldve spat out what your name comes from but i asked it about what it knew about the alias 'frosthalf'

wet breach
#

Half?

#

Not sure why everyone misspells my name lol

smoky oak
#

cuz we just look at your name

#

we dont read it

wet breach
#

And yes my alias derives from norse and also there is a game named after me as well

#

So probably doesnt help much

#

Frost alf means cold elf in norse

#

But kind of funny it errors though if you ask it about me

wispy wyvern
#

hey, what's the 1.19.3 api version link?

buoyant viper
wispy wyvern
#

i tried compileOnly 'org.spigotmc:spigot-api:1.19.3-R0.1-SNAPSHOT' and didn't work

wet breach
#

Did you add the repo?

buoyant viper
#

u added the repo?

wet breach
#

?maven

undone axleBOT
buoyant viper
#

wonder if theres a

#

?gradle

dry yacht
buoyant viper
#

damn.

dry yacht
regal scaffold
#

Is acf really that bad?

#

Good thank you!

wispy wyvern
#

i'm building the plugin using gradle

#

not maven

dry yacht
#

It's trying to be way too much for what it's worth

regal scaffold
#

What command implementation do you use then?

wet breach
dry yacht
regal scaffold
#

May we get a little sneak peak O.o

buoyant viper
#

laffs in using the built in Bukkit commands api AbsoluteHalal

smoky oak
#

i mean

wet breach
#

Acf is good if you need something like acf. Odds are you probably dont and just need something smaller and light weight that doesnt require much

smoky oak
#

99% of people dont need a command implementation beyond that

wispy wyvern
#

should i build the plugin in maven or gradle?

buoyant viper
#

doesnt matter

smoky oak
#

i know how to do maven so i do it in that

regal scaffold
#

Whatever your heart desires

buoyant viper
#

u probably just need to add the spigot repo to ur build.gradle if it cant find spigot-api

wet breach
#

The link above should give you the repo link for the api

remote swallow
#

am i late

remote swallow
#

someone said gradle

wispy wyvern
#

i commented one of the repos by accident

regal scaffold
#

Thoughts on this?

buoyant viper
regal scaffold
#

Surely there's a better way than having to write 3000 lines for commands lol

wet breach
regal scaffold
#

I mean ACF does make it simpler

regal scaffold
#

What do you use frost, lets take a look

buoyant viper
#

i dont like the lack of @Override

wet breach
#

I use my own stuff

buoyant viper
#

i know its not necessary but

regal scaffold
#

Can we take a looky

wet breach
#

Well it sometimes is if the compiler doesnt know you indeed want to override

regal scaffold
#

If you had to pick one of your gh repos to showcase your command implementation

remote swallow
#

epic spigot lib

#

100%

regal scaffold
#

Which one are you proud of

remote swallow
#

totally

regal scaffold
#

No thnaks

remote swallow
#

deffo modifies the entire command system

#

totally

regal scaffold
#

xd

#

I've seen it

wet breach
regal scaffold
#

Extends TabExecutor

floral drum
#

meow

buoyant viper
#

hannahs spigot lib best spigot lib (doesnt exist)

regal scaffold
#

So you prefer using that than splitting into classes or using acf frost

wet breach
#

Never used acf

#

And i do split between clases

regal scaffold
#

Oh yeah you do

#

I mean

#

What if you want 50 commands lol

#

Is it really worth to do 50 classes

wet breach
#

Not hard. Just make a new class and add it to the list

regal scaffold
buoyant viper
regal scaffold
#

Can't be easier than that

floral drum
#

I like builders for commands

#

similar to lucko ig

#

but… different

wet breach
#

But it depends. Sometimes i might combine 2 or more commands into the same class if they are similar or relatwd

regal scaffold
#

But like acf does look convenient

#

Even if it's not the best

wet breach
#

No all those classes in that repo i linked the majority are sub commands

#

There is only like 3 commands total

regal scaffold
#

hmmm

#

idk what to chose

#

On one hand acf is maintainted and usefull

#

On the other hand, libraries

wet breach
#

Acf is handy if you are not going to know the commands ahead of time

regal scaffold
#

ooooo that's a good point

#

So like adding commands later on is definately easier cause don't have to change anything

wet breach
#

But if you already know the commands might as well just implement it yourself or invoke the thing that has the command

regal scaffold
#

You know, gonna give acf a try

#

Why not

wet breach
#

Wont hurt anything for you to try it. It is very extensive

regal scaffold
#

It does seem that way

wet breach
#

Even though i havent used it, i watched it get created uwu

remote swallow
#

alex uses acf the most here i think

regal scaffold
#

I haven't seen alex around in a few days

#

Is he ded?

wet breach
#

No

#

Taking personal time

regal scaffold
#

Oh

#

Good for him

#

I hope he's doing well

#

We do miss him around these parts

#

Chat isn't the same without ?mpdc spam

wet breach
#

Welp time to drive home now

regal scaffold
#

You have a 9-5?

wet breach
#

No

regal scaffold
#

Oh, I thought you had another job tech related

wet breach
#

I work nights monday through thursday. 10 hour shifts

#

I am a tire technician

regal scaffold
#

Oh sheesh

wet breach
#

I get paid like $23/hr to just remove and install tires on semi trailers and trucks

regal scaffold
#

tf

#

Sign me up

wet breach
#

Lol

regal scaffold
#
    @Subcommand("list server")
    @Syntax("[player] [page]")
    public static void onServerList(Player player, String[] args) {
        if (args.length == 0) {
            Residences.listResidences(player);
        } else if (args.length == 1) {
            if (NumUtil.isInteger(args[0])) {
                int page = Integer.parseInt(args[0]);
                Residences.listResidences(player, page);
            } else {
                Residences.listResidences(player, args[0]);
            }
        } else if (args.length == 2) {
            int page = NumUtil.isInteger(args[1]) ? Integer.parseInt(args[1]) : 1;
            Residences.listResidences(player, args[0], page);
        }
    }
#

I'm trying to figure out

#

Why would be have those parameters if [page] can only be a integer and there's no more arguments

#

Oh I just did, cause not giving a page will do all

#

Weirdly done

#

Yeah not using acf, back to class separation

remote swallow
#

no need for String[]

regal scaffold
#

Do you use acf or did you just look?

#

ngl shit feels confusing

regal scaffold
#

Ok blatantly stealing from alex

remote swallow
#

i wrote that code

#

after asking alex

regal scaffold
#

o

remote swallow
#

i just poked his brain for it

regal scaffold
#

So he does use acf

#

I'll give it a longer try this time

remote swallow
#

he uses a mix of everything im pretty sure

regal scaffold
#

... why lol

remote swallow
#

alcohol probably

#

which should hopefully stop

regal scaffold
#

rip

#

I want to see a diehard-acf user

remote swallow
#

akair

regal scaffold
#

LOL

#

I just pulled his gh up

#

Indeed

#

he doesn't make plugins

remote swallow
#

makes plugin libraries but no plguins

regal scaffold
#

ik

regal scaffold
#

yeah idk

remote swallow
#

why make them ifyou dont use it

wispy wyvern
#

why didn't my project create a main plugin class?

remote swallow
wispy wyvern
#

oh ok

remote swallow
#

true

#

so true

wispy wyvern
#

do you guys know a good docs for plugins?

remote swallow
#

?jd-s

undone axleBOT
wet breach
sage patio
#

v1_19_R2 = 1.19.3
v1_19_R1 = 1.19.2
v1_19_R0 = 1.19.1
??? = 1.19

remote swallow
#

not always

twilit roost
#

how do I copy gamerules from one world to another one?

sage patio
remote swallow
#

thats not always how the versioning goes

sage patio
#

then what is 1.19 called

#

in that format

remote swallow
#

should be this im guessing

sage patio
#

thanks

#

mine is for nms not spigot

remote swallow
#

those are for underlying nms spigot

dry yacht
#

version strings are such a headache, :(

sick edge
#

Hi!
I am trying to work with Player Data files to achieve different Inventories (and all the other stuff stored in the data file) per World. My idea was to store the different player NBT files in NBT form like minecraft does it but in each world and then just load it from the current world. My problem is that I only found loadData() and saveData() which doesn't allow any file paths and always loads the files from the main world....I could move the files in and out of the main world folder but that seems very resource intensive...

(I don't want to use any other plugins but feel like this should be possible as for example the "MyWorlds Separate World Inventories" plugin states they use the same general idea)

Thx in advance

wet breach
#

?pdc

twilit roost
#

is there some gamerule that stops lightning strikes from creating fire?

sick edge
# wet breach ?pdc

Yeah I know PersistentDataContainers and thought they might help but it still limits me to one nbt file and I would have to make it huge if I had many worlds or am I missing something

#

*one per player

wet breach
wet breach
twilit roost
#

and some way for me to summon one without creating fire?

dry yacht
#

Swapping out files is not a good idea, if you're not using locks, it's not guaranteed that players load in serialized, synchronous order, I guess. If you lock the files for each player and swap them out (could even only be links, which is not that intensive), you'd still be messing up other processes which expect the vanilla file layout. So while the idea is creative, I don't think it's viable in the real world.

From having a quick look at the implementation, I saw that it's hardwired to the main world's files. There's nothing you can do about it. It basically works like this:

Player#loadData -> CraftServer#getHandle's WorldNBTStorage#load(EntityPlayer) is called, which then responds with the NBTTagCompound. The WorldNBTStorage is likely created the following way: Convertable.createDefault(path).createPlayerStorage().

So you could load that yourself. But on the other hand, it looks like a lot of version dependence and work on your end, which is why I'd just advise to use https://github.com/tr7zw/Item-NBT-API to load the file yourself and manipulate the player as needed. You can use the NBT file of other worlds to save the data, and just need to write on world change.

GitHub

Add custom NBT tags to Items/Tiles/Entities without NMS! - GitHub - tr7zw/Item-NBT-API: Add custom NBT tags to Items/Tiles/Entities without NMS!

regal scaffold
#

Hey,

I'm trying to use a plugin like ShopGUIPlus to get the prices for items for sale. For example to make a autoseller.
I assume I also need vault to be able to get the economy storage plugin.

sick edge
regal scaffold
#

How would this implementation work. I'm kinda lost

wet breach
#

not sure why you would try using the player data file which isn't designed what you are wanting

#

the player data file is tied to the main world because the player only has one inventory, that is the vanilla mechanic

sick edge
wet breach
#

if you want something more then vanilla, you are going to have to make use of either PDC which can be per-world or you implement something else like using a DB

dry yacht
wet breach
remote swallow
#

in spigot they arent

#

iirc

dry yacht
#

No, but you can easily make them be. There's nothing wrong with that

#

If you move the world, the data moves with it. PDCs are also going to be bound to the world anyways, if you implement them properly

#

I would never use a DB for that

wet breach
#

PDC has nothing to do with player data files

#

just because you wouldn't use a DB doesn't mean it isn't a valid solution

dry yacht
#

No, but it also just boils down to NBT compounds. What would be the PDC handle? The world, if you do it right

sick edge
wet breach
#

world

#

the world has a PDC container

sick edge
#

ah I see

dry yacht
# wet breach just because you wouldn't use a DB doesn't mean it isn't a valid solution

No need to feel attacked personally. It's just a bad solution, as you're needlessly dispersing the data. The DB has no notion of ItemStacks at all, what's the point of stuffing an opaque base64 string in there, when there's the whole concept of NBT already existing within minecraft? You could even make use of the vanilla implementation for playerfiles, which provides automatic data fixing. If somebody renames or moves a world on their server, they're gonna expect the inventories to move with that.

wet breach
#

no it is not a bad solution

#

you are obviously terrible at implementing a DB if you think it is one

#

one of the best inventory plugins that allows you to have virtual inventories uses a DB

dry yacht
#

Wow, great point, xD. Alright, let's leave it at that so you can feel better about it.

sick edge
dry yacht
dry yacht
wet breach
#

the only downside to using PDC is that your world files are going to bloat

#

and in terms of backing up inventories you won't be able to do so independent of the world

#

Personally I would either use a proper DB or go with with binary storage with memory mapping

#

In both those cases you can easily back up player inventories if need be and it be separate from the world itself since you know worlds are capable of corrupting and all, and who knows maybe you want to reset the map without resetting inventories. But those are things to consider

sick edge
#

Would binary storage be using Javas Serialization or what is it 😅 ?

wet breach
#

you could, or you could just use NBT for it

#

NBT is binary storage in itself

sick edge
#

and whats the difference to using PDC then?

wet breach
#

PDC is an API and stores the information in the world files

sick edge
#

ah so I could store it anywhere and my world files would be smaller

dry yacht
# sick edge Would binary storage be using Javas Serialization or what is it 😅 ?

PDCs are NBT and thus already in binary format. I'd just advise to save the data in a separate file within the world folder, I have no idea if PDCs can do that. Otherwise, just use the NBT-API I've sent you. I don't know what other value PDCs would bring to the table.

It's your decision whether you want to bind the data to world folders, just because I would doesn't mean that this is what you want.

sick edge
wet breach
#

wouldn't consider PDC something scalable. DB's are scalable by default unless you implement your DB terribly

#

PDC is just something that is convenient to store some data, not something where you take it to the extremes because it was never designed for that lol

dry yacht
sick edge
wet breach
#

the more players that play on your server the more data

#

whether its loaded or not

#

difference is, one is overall storage, and the other is runtime memory

#

more players on at any given time, that is more memory needed to keep their stuff loaded, and over time the more unique players you have the more in storage there is going to be

#

but the runtime memory is dependent however also on how you decide to code it and what you decide to use

sick edge
wet breach
#

nothing you create will really beat a proper DB though in terms of scalability. Not even MC was designed vanilla wise to scale otherwise we wouldn't have things like spigot or even paper.

#

if you could design something to beat a proper DB in scaling wise you also wouldn't be here either

sick edge
kindred valley
#

Stop

#

Using

#

Static variables and done 👍

molten hearth
#

Stop using parsers

kindred valley
molten hearth
#

Even better

wet breach
# sick edge Yeah I got that 😂 but I don't need huge scalability but want to implement some...

best bet is to just go with NBT in per player files in a plugin directory separated by world. I wouldn't bother try messing with adding in files into the world directories as this only introduces the possibility of causing problems as the world directories are setup in a particular way and are not designed to really be messed with vanilla or api wise. Besides there is no additional benefit beyond convenience in doing that vs just storing them in the plugin directory as described

kindred valley
#

Oh my gos

#

This guy insults me

kindred valley
#

What did i say

#

I dont accept that my friend dont use static variable. That is an og recommend from me.

wet breach
#

?abuse

hazy parrot
#

Lmao

wet breach
#

guess we don't have that anymore

molten hearth
#

I don't see why a method shouldn't be static by default unless it referenced non constant variables from its class

kindred valley
#

Rude mate.

molten hearth
#

Yes well too bad you're still using it by the classname

#

Its not like you can just call the method and it will point to it

#

So i dont see the issue

wet breach
kindred valley
#

Marry with static keyword

wet breach
#

but the other problem you have, is anything static never gets GC'ed either

#

it will always persist throughout runtime

kindred valley
#

Mate why didnt you block me

molten hearth
#

Hm interesting

kindred valley
wet breach
#

probably best if both stopped now 🙂

sick edge
wet breach
#

you would use an NBT library

#

I have this, but it requires you to implement yourself

#

there is other NBT libraries out there as well just have to look

regal scaffold
#

Hey

sick edge
#

I'll look into it

regal scaffold
#

How does this line actually work?

new testTask(plugin)).runTaskTimer(plugin, 20L, 20L);
#

That creates a repeating task every 20 ticks

#

But what exactly is what's getting repeated

eternal oxide
#

whatever is in the testTask run method

#

if you fix the syntax

regal scaffold
#

Is it recursive?

#

Like if what I have is

    @Override
    public void run() {
        if (plugin.getChestManager().getUltraChestsList().isEmpty())
            return;
        handle();
    }
bleak comet
#

hello, how can i find the number of iron ingot will be drop : if (blockLoc.getType() == Material.IRON_ORE) {

                                          blockLoc.breakNaturally(new ItemStack(Material.DIAMOND_PICKAXE));
                                          blockLoc.getWorld().dropItemNaturally(blockLoc.getLocation().add(0.5D, 0.5D, 0.5D), new ItemStack(Material.IRON_INGOT));
regal scaffold
#
    @Override
    public void run() {
        if (plugin.getChestManager().getUltraChestsList().isEmpty()) return;
        for (UltraChest ultraChest : plugin.getChestManager().getUltraChestsList()) {
            if (sellTasks.containsKey(ultraChest)) {
                sellTasks.remove(ultraChest);
            } else {
                sellTasks.put(ultraChest, new SellTask(ultraChest));

            }
        }
    }

changed to this instead of handle

bleak comet
regal scaffold
#

I'm trying to make a clock that just runs in the background and every X amount of time it will do something

#

And each object has it's own timer

#

I'm pretty sure return does not cancel execution of the next task

#

ok disregard I fixed it all lol

#

I am idiot

eternal oxide
#

block#getDrops will not get you what the block is actually going to drop, only what it can drop

#

^

regal scaffold
#

BlockDropItemEvent like they said

ItemStack item = event.getItems();

I usually always use a iterator so you can use modify the list in a loop

#

@bleak comet

bleak comet
#

thx all for your help

quaint mantle
#

Anyone knows why this is not working?

@EventHandler public void onPlayerJoin(PlayerJoinEvent e) {
  Player p = e.getPlayer();

  
  Bukkit.getScheduler().runTaskLater(Main.getInstance(), new Runnable() {
    @Override public void run() {
      p.setPlayerListName("example");
    }
  }, 1*20L);
}

its not changing my tablist name

#

I've tried without the scheduler too . Also listener is registered

regal scaffold
#

Make a empty event handler method, and use System.out to print anything

#
@EventHandler 
public void onPlayerJoin(PlayerJoinEvent e) {
  System.out.println("Event was called");
}
#

See if that works

quaint mantle
#

it works i've tried before

regal scaffold
#

Don't matter it's a debug

quaint mantle
regal scaffold
#

So what doesn't work is the p#setPlayerListName?

quaint mantle
#

I've no idea thats why i am here

regal scaffold
#

Wut?

#

You don't know what doesn't work?

quaint mantle
#

do you even read the first message? its not setting the name

regal scaffold
#

its not changing my tablist name
just saw it

#

Relax man

rotund ravine
#

Give us a list of your plugins @quaint mantle

smoky oak
#

how float work

worldly ingot
#

There's just no constructor for that

#

What are you trying to do

smoky oak
#

creating a list whose size i know will not exceed 3

#

for three timestamps

worldly ingot
#

Then just passing 3 should work fine

smoky oak
#

kthx

worldly ingot
#

ArrayLists don't have load factors like Maps do. They don't resize the same way

#

An ArrayList will just add one element to the backing array

#

So if you really don't want that resize you can give it a size of 4

pseudo hazel
#

or just use an array xD

worldly ingot
#

Also an option

smoky oak
#

which im not sure is a good idea

worldly ingot
#

ArrayUtils should make that significantly easier

#

There's an ArrayUtils.insert() iirc

#

(or ArrayUtil. I always forget whether or not it's plural)

pseudo hazel
#

is it always ever going to be 3?

#

like for a specific reason?

#

or just because thats a good number

smoky oak
#

value set in config

#

only changes on reload

pseudo hazel
#

okay

#

then just using an arraylist with some extra checks should be good enough

heady spruce
#

why do i have no particle class in 1.8.9

worldly ingot
#

Because it was added in 1.9

smoky oak
#

im suddenly very glad im not backporting my particle system

#

would you use protocollib then?

worldly ingot
#

That or the particle lib that was around at the time

trim lake
#

Its matter if I use persistent data container or NTB? What should I use?

remote swallow
#

pdc where you can

pseudo hazel
#

which is like everywhere

remote swallow
#

still no built in block pdc

pseudo hazel
#

oh

#

sad

undone yarrow
#

I want to add sandstorms and snowstorms to mc, but Im wondering how someone would even start with that. Also, you know the new powder snow block and the freeze "effect"/particle you get on your screen? Is it possible to add that screen-freeze-thingy when there's a snowstorm.

smoky oak
pseudo hazel
#

sounds more like something for a mod

undone yarrow
#

Summoning a billion particles doesn't sound very good

undone yarrow
smoky oak
#

no i meant only a few near the player

#

reduced sight, reduced movement speed, color the sky darker

undone yarrow
#

Hmm alright, but it's for a server

trim lake
# remote swallow pdc where you can

Thanks. I was recently using NBTapi, and just started thinning about. Why use something external if I can use PDC for transferring data in GUIs, items and staff.

undone yarrow
#

So Ill have to summon it for all players in a certain area

pseudo hazel
#

yes there would be no way around that

smoky oak
pseudo hazel
#

pdc works perfectly fine for inventory and item stuff

trim lake
#

I was just thinking why there are 2 thinks to do practically same staff 😄

quaint mantle
#

i can't

#

why

kind hatch
#

?img

undone axleBOT
quaint mantle
#

why

regal scaffold
#

oh god

quaint mantle
#

what

kind hatch
regal scaffold
#

If I use this line a lot

                    Bukkit.getScheduler().runTaskLater(plugin, () -> {
                        plugin.guiManager.openGUI(//GUI STUFF HERE);
                    }, 1L);

How could I optimize this, or reduce the amount of code?

ivory sleet
#

looks pretty non-optimizable apart from that it violates your abstraction hierarchy, but thats enterprise pov sorta

regal scaffold
#

How would I make it not violate the abstraction?

ivory sleet
#

basically that class is directly depending on ur plugin

#

to "decouple" that you would do sth like

#
class PluginScheduler {
  Plugin plugin;

  PluginScheduler(Plugin plugin) {
    this.plugin = plugin;
  }

  BukkitTask runTask(Runnable runnable) {
    return Bukkit.getScheduler().runTask(this.plugin,runnable);
  } 
}

class Main extends JavaPlugin {
   PluginScheduler pluginScheduler = new PluginScheduler(this);

   void onEnable() {
     var other = new OtherClass(pluginScheduler);
   }
}

class OtherClass {
  PluginScheduler pluginScheduler;

  OtherClass(PluginScheduler pluginScheduler) {
    this.pluginScheduler = pluginScheduler;
  }

  void someMethod() {
    this.pluginScheduler.runTask(() -> plugin.guiManager.openGUI(...));
  } 
}```
#

as said tho

#

this is from an enterprise pov

#

and somewhat, if u're religiously committed to OOP then u might enforce this type of design on urself

pseudo hazel
#

so no, you can only add code, not remove it xD

regal scaffold
#

Hmmm

#

I like what you did there

#

Looks clean

regal scaffold
#

Very nice indeed, thanks conclure

ivory sleet
#

Yeah, all good, however it should be noted, sometimes you end up doing
//in Main
PluginScheduler scheduler(){
return this.pluginScheduler;
}

And then OtherClass still takes ur plugin instance, this is what is called a design compromise and you sacrifice design for usability, its extremely hard to balance between the two

tardy delta
#

🥰

remote swallow
#

is it worse than mine

#

i wrote this one

if (x.toLowerCase().equals("Something") {}

hasty blaze
#

Hye guys I have a question. Is there a way to make potion uncraftable?

remote swallow
#

it didnt

hasty blaze
#

Okay how?

#

Okay where can I find them?

#

At my host

#

or?

remote swallow
#

intellij doesnt like me

#

like most things and people

hasty blaze
#

Okay I don't have that at my host from my server

remote swallow
#

are you not making a plugin

#

because host shouldnt matter about iterating over or removing a recipe

hasty blaze
#

I can't find it at my host

unique bronze
#

Can someone check this math, I'm getting this weird offset on the negative Z axis, do I literally just offset it or am I bad at maths and forgot something?

for (double theta = 0; theta < 2 * Math.PI; theta += step)
{
    double x = radius * Math.cos(theta);
    double z = radius * Math.sin(theta);

    location.getWorld().spawnParticle(particle, location.clone().add(x, height, z), count);
}

Resolved, Location center = location.clone().add(0.5, 0, 0.5); then use Center if you're copy pasting

#

pardon the choice of particle, it's white on white...

tardy delta
#

Locale.ROOT for commands 🤔

hasty blaze
#

Still can't find it

#

Sorry

#

Why Can't I put screenshot in here?

unique bronze
hasty blaze
#

Okay but I only want them to be uncraftable but I still want to sell them in my shop

remote swallow
hasty blaze
#

I have found the achievements of the Minecraft server but not Recepice

#

Nevermind

#

Got them

#

Thanks for the support

solar mauve
#

hello there, i just wanted to modify player's kb to minemen (limiting the knockback vector by a chosen length) and now the funny thing is, whenever i check on PlayerVelocityEvent, the x & z parameters are 0

hasty blaze
#

I have set brewing to false is that enough?

unique bronze
solar mauve
#

intereseting

#
double d0 = entity.motX;
double d1 = entity.motY;
double d2 = entity.motZ;
boolean flag2 = entity.damageEntity(DamageSource.playerAttack(this), f);

if (flag2) {                                                                                                                                                                                         if (i > 0) {

entity.g((double) (-MathHelper.sin(this.yaw * 3.1415927F / 180.0F) * (float) i * 0.5F), 0.1D, (double) (MathHelper.cos(this.yaw * 3.1415927F / 180.0F) * (float) i * 0.5F));
this.motX *= 0.6D;
this.motZ *= 0.6D;
this.setSprinting(false);

}

                        if (entity instanceof EntityPlayer && entity.velocityChanged) {
                            // CraftBukkit start - Add Velocity Event
                            boolean cancelled = false;
                            Player player = (Player) entity.getBukkitEntity();
                            org.bukkit.util.Vector velocity = new Vector( d0, d1, d2 );

                            PlayerVelocityEvent event = new PlayerVelocityEvent(player, velocity.clone());
                            world.getServer().getPluginManager().callEvent(event);

                            if (event.isCancelled()) {
                                cancelled = true;
                            } else if (!velocity.equals(event.getVelocity())) {
                                player.setVelocity(event.getVelocity());
                            }

                            if (!cancelled) {
                                ( (EntityPlayer) entity ).playerConnection.sendPacket( new PacketPlayOutEntityVelocity( entity ) );
                                entity.velocityChanged = false;
                                entity.motX = d0;
                                entity.motY = d1;
                                entity.motZ = d2;
                            }
                            // CraftBukkit end
                        }
[... more]
#

i think i found he issue, bukkit is getting the previous kb of player

#

nice

#

or i misunderstood the event

#

or idk

charred blaze
#

What do i enter in SDK?

#

i just downloaded "Minecraft Development"'s new update

#

and its weird

solar mauve
rotund ravine
#

The one you gave?

charred blaze
solar mauve
#

Download JDK

charred blaze
solar mauve
solar mauve
charred blaze
#

isnt it first one

solar mauve
#

or adoptium, or anything you like

solar mauve
charred blaze
solar mauve
solar mauve
charred blaze
solar mauve
# solar mauve ```java double d0 = entity.motX; double d1 = entity.motY; double d2 = entity.mot...
    @EventHandler(priority = EventPriority.HIGHEST)
    public void onPlayerVelocity(PlayerVelocityEvent event) {

        Player player = event.getPlayer();

        Vector velocity = event.getVelocity();
        velocity.setY(velocity.getY() - 0.00001F);

        double length = velocity.length();

        System.out.println("velocity = " + velocity);
        System.out.println("length = " + length);

        event.setVelocity(velocity);
    }

ah yes, this code seems to cancel the knockback, ok any suggestions?

solar mauve
charred blaze
#

this now

solar mauve
#

sorry, i can't help from now, use gradle or maven itself, add the repositories and dependencies, plugin.yml and stuff manually

quaint mantle
#

I'm having trouble working out how I can use the key and value from the map to then enable the selected database...

#

Any ideas?

smoky oak
#

?scheduling

undone axleBOT
analog thicket
#

My brain isn't working doing math, I need some help. I want to move an armor stand around a center lock in a circle. I know I must use cos and sin, but my brain isn't braining -.-

#

Oh and im using packets.

solar mauve
solar mauve
#

w8

charred blaze
eternal oxide
#

its really simple, just read that stackoverflow

remote swallow
solar mauve
#

use fisagores

#

x^2 + y^2 = 1

#

this is the equation of circle

remote swallow
#

that gui came out recently

#

so no idea how you are on that version with the new gui

eternal oxide
charred blaze
solar mauve
#

ill send code

eternal oxide
#

I already gave him code

remote swallow
eternal oxide
#

how to plot points on a circles radius

hasty blaze
charred blaze
#

oh gradle is really better in performance

remote swallow
#

yeah

charred blaze
#

is it easy to build with gradle?

remote swallow
#

gradlew build

charred blaze
warm mica
charred blaze
pseudo hazel
#

standard doesnt mean good or the best

warm mica
#

and i get extremely annoyed whenever each 10th person decides to just use gradle

analog thicket
warm mica
charred blaze
#

so they are equal?

pseudo hazel
#

no

#

they are different

charred blaze
#

can someone explain

warm mica
#

it's like saying java is better than c#

#

or eclipse is better than intellij

charred blaze
#

so gradle compiles c#??

remote swallow
#

gradle can compile a lot

tawdry parcel
#
    @Override
    public List<String> onTabComplete(CommandSender sender, Command command, String label, String[] args) {
        return null;
    }
```why is it still tab completing the command?
charred blaze
#

so its better?

pseudo hazel
#

~but intellij is better than eclipse though~

remote swallow
tall dragon
#

return an empty list

charred blaze
warm mica
remote swallow
#

if you know how to use it sure

warm mica
#

the tool you can work the best is the best, and not what other say

pseudo hazel
#

yeah

tawdry parcel
# tall dragon null = all player names

oh wait that's good to know, i guess now I don't need to write ```java
for (Player onlinePlayer : Bukkit.getOnlinePlayers()) {
arguments.add(onlinePlayer.getName());
}

pseudo hazel
#

thats why intellij is the best, cuz I use it

pseudo hazel
#

i didnt say it was the best for everyone

charred blaze
#

lel

#

so gradle is better? (in performance)

remote swallow
#

after 1st build yes

charred blaze
#

why

tall dragon
#

too bad it always needs to init for 25 years

charred blaze
#

why isnt maven faster?

hazy parrot
#

🤔

tall dragon
#

the difference isnt big enough to care