#help-development

1 messages · Page 1267 of 1

sly topaz
#

you'd just check whether an item has the item model in question and apply the abilities on interact/damage

white drift
sly topaz
#

also don't cross-post

cursive haven
sly topaz
orchid brook
#

Hello can someone help me fix that dump:
https://paste.md-5.net/qajonuwume.md
I don't understand why the server was stuck more than 10s on my createFromConfigSection method. I can't even reproduce the crash 😦
I'm a little desperate not to find it. We have a server with quite a few players. The crashes are annoying.

cursive haven
#

I've already added 3D weapons to my server using ItemsAdder, but I'm wondering how to assign special abilities to those weapons.

orchid brook
#

Im never using while(true) in my plugins

white drift
sly topaz
orchid brook
#

First of all Am I wrong? We agree that the dump shows that the server crashed because it stayed too long in the createFromConfigSection method right ?

white drift
mortal arrow
#

hey guys

cursive haven
#

guys, thank for the support very good idea

orchid brook
cursive haven
#

I will do that

orchid brook
# sly topaz ?whereami

the isssue doesn't come from paper this is related to one of my plugin dev using the spigot api

white drift
thorn isle
#

there's no guarantee that it was stuck for 5 seconds on that particular method

#

the stack trace is just a snapshot of what was happening at that instant

orchid brook
thorn isle
#

unless the stack repeats multiple times, it probably isn't the issue

white drift
#

best way - add logging

#

:)

sly topaz
pure dagger
#

when i need to execute something after 1 hour should i check every second or so, if the time has passed, and then do it? i think setting a task for 1 hour may result in it being executed too early or too late

orchid brook
white drift
thorn isle
#

tlantisLibs-1.0.9.jar//com.nours.atlantisLibs.tasks.DistributedTask.run(DistributedTask.java:89)

#

this occurs in every stack trace

#

so whoever is responsible for this piece of code or the code run by this piece of code, is probably responsible for the issue

#

whether that's you or not idk

#

CMILib1.5.4.3.jar//net.Zrips.CMILib.GUI.GUIListener.clearIconItems(GUIListener.java:49)

#

it could also be interference with existing plugins doing something moderately dumb that you're exacerbating

#

here it seems like cmi scans through every opened inventory and scans the nbt for something something

#

and you seem to be opening a lot of inventories with a lot of heavy-nbt items

white drift
#

i have an a similar problem, when i didn't install RAM specifically

thorn isle
#

SuperiorSkyblock2-2025.1.jar//com.bgsoftware.superiorskyblock.listener.MenusListener.onInventoryCloseDupePatch(MenusListener.java:54)
there's also this which runs on inventory events and appears to be allocating many exceptions and filling stack traces through some cache library
com.google.common.cache.CacheLoader$InvalidCacheLoadException.<init>(CacheLoader.java:246)

#

the listeners from different plugins also seem to be interchanging in between stack traces, indicating that more than one, possibly more than intended, inventories are being opened

#

it could also be some sort of memory bandwidth/ram issue yes, maybe try running a memory test

thorn isle
#

the one from superiorskyblock seems the most responsible, since allocating stack traces rapidly is super expensive

#

and that looks like an outright programmer error

young knoll
#

Oh no not CMI lib

#

shivers

white drift
young knoll
#

Does it still update itself but never remove the old version

young knoll
#

It downloaded a new jar into the plugins folder but never removed the old one

sly topaz
#

what CMI is doing is pretty inefficient too, they're not caching their reflection

young knoll
#

Spigot won’t load multiple plugins with the same name, so it would just always load the old version anyway

#

Not exactly the most useful auto-updater

white drift
#

is it making cmi auto updater?))

thorn isle
#

imagine if there was an "update" directory or something like that where you could put updates and the server would swap them in on the next restart

sly topaz
sly topaz
#

just to look for a single string on the nbt, could've just been PDC but welp

thorn isle
#

CMI 🚮

white drift
#

really

sly topaz
#

I am honestly amazed at the quality of the code (not in a good way), wasn't Zrips the same dude who made the Jobs plugin?

white drift
#

(tried)

sly topaz
#

well of course, that's why the update folder exists, so plugins don't try to do that

young knoll
#

See: Every videogame ever

white drift
novel peak
earnest girder
#

can you have a command that doesnt have a name, just takes / to open? If you cant assign it as a literal command, how can you listen for it?

buoyant viper
#

what kind of command wouldnt be named

sly topaz
#

yeah, I also wonder lol

#

I do wonder whether you can do that without doing something hack-ish like listening for the chat event instead of the command event/registering the command as usual

chrome beacon
sly topaz
novel peak
chrome beacon
#

The little reload icon in the right

#

Or in the maven tab that's also on the right

buoyant viper
#

i imagine u would have to reflectively add it to the command map

knotty gale
#

Particle.REDSTONE

for some reason redstone doesnt exist, I am on 1.21.4

novel peak
knotty gale
#

oh so dust is just redstone now?

novel peak
sly topaz
#
commands:
  "":
    description: "empty command test"

if you like new lines

mellow edge
echo basalt
knotty gale
#

mmm ok

somber scarab
#

guys I got a problem with my paginator class.. specifcally with flushing and refilling the inventory when switching pages

#

every page is basically the first page

#

the outputs are correct:

#

only about 7 players on the second page should be shown

#

but the first page is always there

#

the reason I know it's the itemstacks not getting removed correctly is because the arrow on the left side (previous page) is added on the first time you enter the 2nd page but does not get removed when going back on first page

#

I tried inventory.clear() and creating a new inventory but nothing worked..

echo basalt
#

I could prob optimize this but this is how I handle pagination on my (old) menu systme

#
    public void forceUpdate(BaseMenu menu, int page) {
        int startIdx = (page - 1) * slots.size();
        int endIdx = startIdx + slots.size();

        for (int index = startIdx; index < endIdx; index++) {
            int slot = slots.get(index - startIdx);

            if (index >= elements.size()) {
                menu.setElement(slot, emptyElement);
            } else {
                menu.setElement(slot, elements.get(index));
            }
        }
    }
#

hope this helps :)

sly topaz
#

tbf it's pretty much how they manage it lol

#

the issue doesn't seem to be with the pagination itself but something about the inventory instances or so I'd like to believe since the issue isn't immediately clear from the given code

#

perhaps reusing the inventory instance or whatever the InventoryGui#createInventory method does is causing the inventory to not be properly updated, but I wouldn't be able to say without the whole thing

somber scarab
#

I've been thrown for a loop forever now

#

but I fond the core issue

#

in GuiManager.handleOpen if (handler != null) is false

#

the problem only happens when going to page 2, from my Paginator.nextPage()

#

on line 107. manager.openGUI(this, player);

#

this should be correct

#

yet the handler which is a PlayersToInvite instance extending paginator

somber scarab
#

the core issue is that InventoryGui.decorate on page 2 doesnt get called therefor no items show up and page two registers no events and shows no items

sly topaz
#

rather than adding so many debug messages, just use a debugger

somber scarab
#

?debug

sly topaz
# somber scarab how do I use one? <.<

create a debug configuration in intellij, add the params it tells you to add in the configuration popup to your test server's startup script and add breakpoints where the issue lies

#

also set timeout-time to 999 or something in spigot.yml as well as player-idle-timeout to some big number in server.properties

#

that way when the breakpoint suspends the server, it doesn't make a thread dump nor kicks the player due to inactivity

somber scarab
#

which kind of configuration?

sly topaz
#

remote jvm debug

somber scarab
#

that should be correct?

sly topaz
#

yeah, copy the command line arguments for remote JVM and paste it in your start.bat or whatever you use to start your test server

somber scarab
#

I use another configuration

#

so I paste them in program arguments?

sly topaz
#

ah, if you have a configuration to start the server, just hit the debug button on IJ

somber scarab
#

bruh

sly topaz
#

you don't need the remote JVM debug for that

somber scarab
#

okay lemme try

#

okay so I just test a breakpoint rq

#

okay works

#

great

sly topaz
#

now put a breakpoint in the nextPage method and step through it to see where it breaks

#

if you're running paper you can use -Ddisable.watchdog=true to avoid getting watchdog thread dumps btw

somber scarab
#

in VM options?

sly topaz
#

yes

somber scarab
sly topaz
somber scarab
#

ah okay

sly topaz
#

if you're fancy, you can also get Jetbrains Runtime and run your configuration with it, and also add the -XX:+AllowEnhancedClassRedefinition VM option so that you can do enhanced hotswapping (means you don't have to reload/restart to make changes to your code)

#

well, as long as it is code that doesn't require of any initialization hooks/events, anyway. You'd still have to restart if you're changing something that's already initialized like at world init or onEnable

somber scarab
#

hm I still get timed out

#

weird

young knoll
#

Yeah you will

#

The client has a timeout too

slender elbow
#

gotta install the TimeoutOut mod

sly topaz
#

was that always a thing

slender elbow
#

yes

sly topaz
#

I remember just setting idle timeout and not getting kicked out before, though I might just be misremembering lol

slender elbow
#

client (and server) has a ReadTimeoutHandler(30s) in the netty pipeline

young knoll
#

Isn’t idle timeout infinite by default

somber scarab
#

why is this happening now?

#

I don't think I did anything different

#

my breakpoints just stopped working suddenly

#

ah wait

#

I forgot to rebuild prolly

#

Okay I found the issue

#

but I still have no idea why it's behaving like that

#

so...

#

because the logger on the next line logs the <K, V> pair to be <PlayerToInviteInv, null>

#

so handler is null here.. even though when I debugged it, it is there

#

not null

#

is the problem with the types or smth?

#

😪 im too tired to even type, ima go sleep its past 3am

grand flint
#

should i just give up 🙏

clever zephyr
#

I'm creating a very simple sumo 1v1 plugin

#

how can i detect when someone falls in water ?

#

I'm looking for a very performance friendly approach, so im not planning to use PlayerMoveEvent

random compass
#

cant u just use command blocks to detect the player reaching a certain y level which triggers a command, which could be from the plugin

random compass
# clever zephyr how can i detect when someone falls in water ?

take this with a pinch of salt, i started learning java last week

use 2 command blocks

1st
/scoreboard objectives add yCheck dummy

2nd
make a repeating command block with
execute as @a store result score @s yCheck run data get entity @s Pos[1] 1

3rd - chain command block on the repeating one
execute as @a[scores={yCheck=..50}] run <your_command, eg trigger fellInWater which will be a command in your plugin that will possibly reset the match or change the score and reset player positions>

#

and obviously when u have a repeating command block u do gamerule commandblockoutput false so it doesnt clog ur console

buoyant viper
clever zephyr
#

thank you tho

random compass
clever zephyr
grand flint
grand flint
buoyant viper
#

unless u use a Task that checks at a lower frequency than PlayerMove

echo basalt
#

as long as you filter stuff out

#

Minigames having a loop task yikes

#

We usually just have a task scheduler per game instance and run a million tasks there for sep things

#

Makes the code cleaner and stuff

drowsy helm
faint locust
#

may i ask if anyone know how to randomly sort the playernames on the tablist 🙂

blazing ocean
#

Player#setPlayerListOrder or sth

#

shuffle the online players and then set the order to their idx in the shuffled list

faint locust
#

in 1.16.5

blazing ocean
#

why would you ever use 1.16.5

#

that's like one of the worst possible versions you can choose to use

faint locust
#

i am developing with a bukkit and forge hybrid core 🙂

blazing ocean
#

yeah no

#

that is one of the worst possible decisions you can make

faint locust
#

😦

#

i guess 🙂

#

then may i ask if there is anyway i could be on 🙂

mortal vortex
#

they cant work around what a modpack is built on

blazing ocean
#

what

#

hybrids are not supported here

faint locust
blazing ocean
#

no idea

faint locust
#

the hybrid worked likewise the spigot 🙂

molten hearth
#

🙂

livid tundra
#

How do I disable xaero's minimap?

#

and


PotionEffectType minimapEffect = 
PotionEffectType.getByName("xaerominimap:no_minimap");
PotionEffect effect = new PotionEffect(minimapEffect, Integer.MAX_VALUE, 0, false, false, false);
player.addPotionEffect(effect);
#

and


NamespacedKey effectKey = NamespacedKey.fromString("xaerominimap:no_minimap");
PotionEffectType effectType = Registry.EFFECT.get(effectKey);
PotionEffect effect = new PotionEffect(effectType, Integer.MAX_VALUE, 0, false, false, false);
player.addPotionEffect(effect);

based on https://modrinth.com/mod/xaeros-minimap#:~:text=Potion effects to control the usage of the minimap

#

first one just doesn't work, for the 2nd and 3rd, effecttype ends up as null

eternal night
#

its a client mod adding potion effects on the client side

#

they do not exist on the server side

livid tundra
#

?

#

it says

Potion effects to control the usage of the minimap or some of its features for the players on your server/map. The following potion effects exist as of writing this: xaerominimap:no_minimap, xaerominimap:no_entity_radar, xaerominimap:no_waypoints, xaerominimap:no_cave_maps. The effects are of the neutral type by default, but you can also specify a harmful type by appending _harmful to the end of the effect ID, for example xaerominimap:no_entity_radar_harmful.

eternal night
#

Yea

#

the mod adds these potion effects to the game

#

you are not running this mod on spigot tho

#

it is only running on the client

#

the server does not know about these potion effects

livid tundra
#

there has to be some way to disable it, as I've seen other servers do it

eternal night
#

idk why the message would not work ¯_(ツ)_/¯

#

might want to delay sending it by a tick or something

livid tundra
eternal night
#

Well, spigot might be trying to Parse the message then,

#

Which won't end well for you given most of these colour codes don't exist

livid tundra
#

brh

eternal night
#

Omg it tellraw commands it kekwhyper

rough drift
#

I mean

#

it works

eternal night
#

Yea I guess

#

Component.literal or smth

undone axleBOT
#

This account is already verified!

sullen marlin
#

Anyone interested in being banned?

#

Stop advertising

alpine urchin
#

LMAO

#

unfortunately i dont know what server to avoud from now on

#

jk

jagged thicket
#

Asspixel

#

ass

somber scarab
#

why is my handler not null but also doesn't get inserted into the map?

        FloorIsLava.getInstance().getPluginLogger().info("Registering inventory: " + inventory + ", Handler: " + handler);
        if (handler == null) {
            FloorIsLava.getInstance().getPluginLogger().warning("Handler is null for inventory: " + inventory);
            return;
        }
        this.activeInventories.put(inventory, handler);
        FloorIsLava.getInstance().getPluginLogger().info("Active inventories: " + Arrays.toString(this.activeInventories.keySet().toArray()));
    }```
#

this is so annoying

#

have no idea what's wrong

#

other inventories work

#

its a specific gui that doesnt work

eternal oxide
#

what doi you mean it doesn't get inserted to the map? The logger clearly shows it is in the Set

somber scarab
#

it should read the key and value

#

on other inventories it shows

[11:37:35 INFO]: [FloorIsLava] Active inventories: [org.bukkit.craftbukkit.inventory.CraftInventoryCustom@68e72816, org.bukkit.craftbukkit.inventory.CraftInventoryCustom@2347a944]```
eternal oxide
#

you are only reading the KeySet

somber scarab
#

see?

#

huh

eternal oxide
#

the paste shows two inventories, not a key and value

sly topaz
#

you are using Inventory as key?

eternal oxide
#

you are logging an array of keys, not a key and value pair

sly topaz
#

it's most likely just the hash changing when you reopen that inventory, since a different Inventory instance was created when you opened the Inventory again

somber scarab
#

well

#

class instance

#

but this makes it so that the mapped inventories get decroated properlly based on their class

#

but page two of PlayersToInviteInv doesnt get mapped correctly

eternal oxide
#

That would be an issue with yor PlayersToInviteInv, not the inventory key map

somber scarab
# eternal oxide you are logging an array of keys, not a key and value pair

okay now im logging the entry set

[11:50:57 INFO]: [FloorIsLava] Registering inventory: org.bukkit.craftbukkit.inventory.CraftInventoryCustom@17e340c, Handler: com.bluenova.floorislava.util.gui.inventories.lobby.LobbyInv@36e488a4
[11:50:57 INFO]: [FloorIsLava] Active inventories: [org.bukkit.craftbukkit.inventory.CraftInventoryCustom@17e340c=com.bluenova.floorislava.util.gui.inventories.lobby.LobbyInv@36e488a4, org.bukkit.craftbukkit.inventory.CraftInventoryCustom@42e61815=com.bluenova.floorislava.util.gui.inventories.lobby.LobbyInv@12658685]
```this is a healthy key value
#
[11:51:40 INFO]: [FloorIsLava] Active inventories: [org.bukkit.craftbukkit.inventory.CraftInventoryCustom@77abc32=com.bluenova.floorislava.util.gui.inventories.util.PlayersToInviteInv@62d3b97c]```this is the broken one (paginator page 2)
#

paginator is an abstract class allows me to make paginated inventories based on an Iteratable (or however its spelled)

somber scarab
#
        boolean condition = (itemList != null && (currentPage + 1) * itemsPerPage < itemList.size());
        if (condition) {
            currentPage++;
            updateInventoryContent();
            GuiManager manager = FloorIsLava.getInstance().getGuiManager();
            FloorIsLava.getInstance().getPluginLogger().info("Next page clicked, THIS:" + this);
            FloorIsLava.getInstance().getPluginLogger().info("Next page clicked, THIS Inventory:" + this.getInventory());
            manager.openGUI(this, player);
        }
    }```

Logs seem fine here too

```[11:57:36 INFO]: [FloorIsLava] Next page clicked, THIS:com.bluenova.floorislava.util.gui.inventories.util.PlayersToInviteInv@5978556a
[11:57:36 INFO]: [FloorIsLava] Next page clicked, THIS Inventory:org.bukkit.craftbukkit.inventory.CraftInventoryCustom@38c50690
[11:57:36 INFO]: [FloorIsLava] Registering inventory: org.bukkit.craftbukkit.inventory.CraftInventoryCustom@38c50690, Handler: com.bluenova.floorislava.util.gui.inventories.util.PlayersToInviteInv@5978556a
[11:57:36 INFO]: [FloorIsLava] Active inventories: [org.bukkit.craftbukkit.inventory.CraftInventoryCustom@38c50690=com.bluenova.floorislava.util.gui.inventories.util.PlayersToInviteInv@5978556a]```
sly topaz
#

what does openGUI do?

#

at this point it'd be easier to check if you put the thing on github so I can run it myself and check lol

somber scarab
#

[12:02:12 INFO]: [FloorIsLava] Active inventories: [org.bukkit.craftbukkit.inventory.CraftInventoryCustom@57e6908d=com.bluenova.floorislava.util.gui.inventories.util.PlayersToInviteInv@7ba36a8d]
[12:02:12 INFO]: [FloorIsLava] No handler found for inventory: org.bukkit.craftbukkit.inventory.CraftInventoryCustom@57e6908d

#

OMG WDYM NO HANDLER FOUND ITS RIGHT THEEREEEE

sly topaz
#

it is most likely the hash code being different as I told you, but yeah

somber scarab
sly topaz
#

that is the class's hash code, not the Inventory instance

somber scarab
#

huh I just pushed and it isnt showing me my gui branch

#

it's called feature/gui-system-framework

sly topaz
#

yeah, that one doesn't exist there

somber scarab
#

oh wait it taking so long

#

it's still writing

#

wtf

sly topaz
#

if you do it through the IDE often times it is just the annoying pre-commit hooks that it adds

somber scarab
sly topaz
#

oh no it is just git being ass

#

or your internet being slow, one of the two lol

somber scarab
#

my internet is not that ass, no way

#

lemme try it again or just wait

sly topaz
#

just let it finish, don't wanna push a ref twice accidentally

somber scarab
#

yt is working fine

#

its github

somber scarab
#

also you need two players on a server at least

#

<.<

#

or you can just remove line 114 allOnlinePlayers.remove(player1); // Remove the player themselves

#

from LobbyInv

#

and you can test it solo

sly topaz
#

okay let me clone it

somber scarab
sly topaz
#

I don't think I've ever played floor is lava gamemode lol

#

isn't it pretty much like tnt run

somber scarab
#

every game is a random vanilla generated plot and sometimes you get resources and sometimes they're scarce

#

its my lifes work

sly topaz
#

Hopefully the versions of the plug-ins you have in the tmp-plugins folder work properly with 1.21.5 or I’ll have to go dependency hunting lol

#

Wait, is your plug-in paper-only

#

Either that or you didn’t shade in adventure platform

somber scarab
#

I thought I only needed to do that if Im on spigot

#

I still gotta shade it if spigot servers wanna play?

sly topaz
#

Well, yes

somber scarab
#

welp.

#

im yet to publish a fully functional version I guess

sly topaz
#

The plug-in seems to work still though logging is probably borked so I am gonna ignore that for now

somber scarab
sly topaz
#

Okay no it seems I got to fix that since the commands aren’t doing anything lol

somber scarab
#

oh man mb

#

its my first project

sly topaz
#

I’ll just run it with paper for now

#

Though you also seem to be depending on paper-api instead of Spigot’s, that’s fine if you don’t want to support Spigot but if you plan to publish it in SpigotMC, then you’re probably gonna want to do that

somber scarab
#

lmao yea i know now

sly topaz
#

It’s harder now that paper has hard-forked to support both platforms, but just depending on spigot-api so that you don’t accidentally use paper-specific API still works

somber scarab
#

so all i need to do is reshade adventure api back again?

sly topaz
#

You’ll want to shade adventure-platform-bukkit or whatever it is called if you want to use adventure on Spigot

#

Though that means you’ll have to wrap audiences and what not on Paper too unless you create a separate module just for handling that

somber scarab
#

ugh

sly topaz
#

It is very annoying, yeah

somber scarab
#

i was so happy to remove that when i switched to paper

cinder abyss
#

Hi, is there an API / a website to get all Minecraft versions released in a json, txt or a format like this ?

valid basin
#

Does someone know why this doesn't show the hurt animation (red outline on player)?

        PacketContainer status = protocolManager.createPacket(PacketType.Play.Server.ENTITY_STATUS);
        status.getIntegers().writeSafely(0, victim.getEntityId());
        status.getBytes()   .writeSafely(0, (byte)2);

        protocolManager.sendServerPacket(victim, status);
        for (Entity e : victim.getNearbyEntities(10, 10, 10)) {
            if (e instanceof Player p) {
                protocolManager.sendServerPacket(p, status);
            }
        }
    }```
somber scarab
#

PAGINATOR paginator is my bane

buoyant viper
#

might need to send a damage packet

valid basin
valid basin
#

but somehow stopped working on 1.21.5

buoyant viper
#

thats a lot of updates since then

sly topaz
#

I was still debugging it lol

somber scarab
#

all I had to do was not reopen the gui from the gui manager.. so it's the same inventory but I change the contents

#

here is the new paginator

#

ull notice I simple just removed the openGui from nextPage and previous page functions

#

and call decorate instead

#

so a paginator is always one inventory that just clears and refills without closeing and opening a new inventory

#

which is annoying cuz I would've liked to add a page number in the inventory name

#

but i honestly will not complain right now. later I can revisit it and revamp it

#

omfgg

somber scarab
sly topaz
#

That method has been deprecated in Paper

somber scarab
#

I legit was on the brink of destroying everything and starting from the ground up

sly topaz
#

It’ll also open a new inventory so be warned

cinder abyss
buoyant viper
somber scarab
#

where do you guys publish your plugins?

#

what's the most popular platform? is it modrinth nowadays?

robust helm
#

spigotmc?

cinder abyss
#

but there is more people looking on spigotmc for plugins

buoyant viper
#

spigotmc, hangar, modrinth, planetminecraft, curseforge

buoyant viper
somber scarab
halcyon hemlock
#

I'm still alive for anyone worrying.

blazing ocean
cinder abyss
#

that's your opinion x)

quaint mantle
#

Does maven not let you have mutliple modules with the same artifact and group id?

chrome beacon
#

Why would you do that

#

Two modules with the same information makes no sense

quaint mantle
#

Ah

#

Okay

somber scarab
#

is this some sort of memory leak?

#

oh nvm its good

#

I think?

kind hatch
#

If your graph looks like it has "sawtooths", then you are just fine.

chrome beacon
#

yes that's how the GC works

kind hatch
#

Those sharp drops are the gc working.

somber scarab
#

yeah I thought so

drifting bluff
#

Im currently working on an leaderboard system that will display the top 15 players with the most clicks ( clicks is an pdc value stored as an big int )

Somehow when I do /topclicks it doesnt spawn an armor stand and only Command executed will be logged

https://pastes.dev/9mb0nSXhG2 ( Command )
https://pastes.dev/1j6SH6rDZi ( Funcs )

smoky anchor
#

Does "Before spawn" get logged ?
If not then you have problem with the value saving probably
And you're not doing PDC anywhere

chrome beacon
#

You're never adding to the storage anywhere

#

So it will always be empty

#

Wait it's loading from file in the constructor mb

#

Still though that would require it to be in the config at startup which is an odd choice

drifting bluff
#

Hm Ig ima rewrite it then

#

I got other files where I can add clicks

kind hatch
#

How is this PDC?

#

This is file storage

chrome beacon
#

Yeah it's not PDC

drifting bluff
#

hm

kind hatch
#

Which is fine btw, I am just confused

drifting bluff
#

Yea how do I get like an array with all pdc stores or like all data tho?

smoky anchor
#

?pdc this is PDC

drifting bluff
#

yea Ik Im using that

#

but like how do I get the data from all players

smoky anchor
#

well not in what you showed

kind hatch
#

^

#

Can PDC be accessed via offlineplayer?

drifting bluff
#

yea and like I said im rewriting it rn

smoky anchor
#

why even mention it then, you're just confusing us

kind hatch
#

?api

#

?docs

chrome beacon
#

?jd-s

undone axleBOT
drifting bluff
chrome beacon
drifting bluff
#

then how could I even make an leaderboard?

kind hatch
#

Then file storage would be their best bet then.

#

I wonder if that could be a decent PR.

drifting bluff
#

pr?

kind hatch
#

Or if it's even possible right now

smoky anchor
#

manually open the player file :D

drifting bluff
#

naw

#

hm idk

kind hatch
drifting bluff
#

the thing is I dont I just store pdc values on the player and then modify them like I dont save them

kind hatch
#

That is not what your ClickDataStorage shows.
Where do you actually use PDC then?

smoky anchor
#

I say: ignore PDC, store it all in the config file.
Save the config file every few minutes instead of on every update.

chrome beacon
#

sqlite database instead of yaml

#

or your own data format*

#

Using yaml like you're doing will load the entire file in to memory which isn't ideal

drifting bluff
#

Like I tried it before with the code I send up in the message from the start and I did it like 40% me 60% chatgpt and tried but it doesnt work and now I do realize that you cant acess offline players pdc data. And yes I got other like classes that add or remove clicks from an pdc value

#

But Idk how good its going to be if I like store all data in an file

chrome beacon
smoky anchor
#

"chatgpt" ah

chrome beacon
#

so that's not really required

drifting bluff
chrome beacon
#

Yeah waay too many people rely on GPT or other AI nowadays

drifting bluff
#

Ig I could make an leaderboard that only displays the top 15 players of clicks that are currently online

chrome beacon
#

Don't need to.

#

You know what clicks people have when they quit so if they qual for the leaderboard or not

#

So you'd just store that in to the leaderboard

#

There is no need to loop every player every time to make the leaderboard

#

Just calculate what's changed

drifting bluff
#

So when someone joins it will add thier clicks to an file and when someone leaves it will add them too but like they wont change till they rejoin? and then the leaderboard just updates like every minute sorting all data?

chrome beacon
#

Using PDC for clicks is fine

#

Use a file for the leaderboard though

#

as for updating the leaderboard it can probably just be done in real time

#

Wouldn't be too expensive nor hard to do

#

(Just save the file every couple minutes)

#

Largest downside of doing it that way would be if a player for some reason has their clicks reset while on the leaderboard. Could be a bit of a problem finding replacement player on the leaderboard

heavy sentinel
#

Looking for tech admin, write in PM

undone axleBOT
drifting bluff
#

How do I modify the display name of an entity that has an specific tag?

smoky anchor
drifting bluff
#

I want to change the name of an armorstand that has the tag clicks_lb

smoky anchor
#

Setting the name is literally just entity.setCustomName

drifting bluff
#

no how do I find the entity via tag

smoky anchor
#

I believe: use getEntities in World, use stream to filter by tag

clever zephyr
#

Hey guys i have a question

#

is there a way on legacy versions like 1.8.8 to disable crop item natural drop when it gets in contact with water ?

sly topaz
#

you'd also have to listen to the block place or interact event when the water gets placed directly onto the crop ig

sly topaz
#

LivingEntity#playHurtAnimation exists

valid basin
worthy yarrow
#

Hey @sly topaz (sorry for the ping) you wouldn’t happen to know about world gen do you? Just curious cuz I posted in the review thread and perhaps you’re more versed with the api and I’m still figuring how to integrate my obstacle generation

sly topaz
#

try it and see ig

sly topaz
#

I'll check it out still, but I don't think I'd have any valuable input on it lol

wet breach
worldly ingot
#

(because yes, that tilt does depend on where the damage came from)

worthy yarrow
#

All that’s in the review thread btw

worthy yarrow
wet breach
#

you will need to look at Mojang code for the world generation

worldly ingot
#

I wish you luck

#

It's a coupled nightmare

#

Abstracted to all shit

young knoll
#

The game just does it in stages

#

First it builds the base shape, then it creates the surface (grass, dirt, etc) then it adds decorations on top of that (trees n shit)

wet breach
#

yep using the seed to come up with variables that plug into the algo to generate stuff

worthy yarrow
#

Yeah I figured, my impl isn’t too awful, just integrated my internal course generation with chunk generators so at least I’m not crashing the server forcing block type changes to thousands of blocks kek

#

The decorations/obstacles still look a bit unnatural

sly topaz
#

I feel like I've seen that before about some golf course generation

worthy yarrow
#

Literally been stuck up on this aspect of the project for like 4 months

#

End goal: randomized but seeded course gen so you’ll never get bored playing a handful of courses, my physics are randomized a bit so you’ll never be able to just play a certain way on a certain course either so

#

Really just trying to emulate real life disc physics

#

Real life physics and play style rather, obviously you can’t throw the exact same way every single throw

clever zephyr
#

or stop entirely if crops are infront of it

sly topaz
#

waterlogged state didn't exist back in 1.8.8 so you can't have crops inside of water but you can stop it from touching crops

clever zephyr
clever zephyr
#

so basically
if next block is CROPS or even SOIL
event.setCancelled(true);

#

i also debugged

sly topaz
#

what is next block here

clever zephyr
#

the debugging was weird:
current block : WATER
next block: STATIONARY WATER

#

So i was thinking of getting the block below the NEXT BLOCK

#

check if its SOIL or CROPS

sly topaz
#

but what did you use to get the next block

clever zephyr
somber scarab
#

is there a way to mark an arrow and detect when that specific arrow or snowball hits another player?

ivory sleet
#

maybe PDC?

somber scarab
#

PDC?

#

?pdc

ivory sleet
#

PersistentDataContainer

somber scarab
#

Packet Data Control

#

damn

#

what is that

ivory sleet
#

its like the nbt api abstraction spigot provides

#

thats ofc one way

#

another way is to just store the entity in some reference

somber scarab
#

well I dont care about saving the items

#

they're short term abilities

ivory sleet
#

and then make sure the call .remove() on it onDisable, or whenever suitable and then once its removed u de-reference from it

somber scarab
#

in a minigame

somber scarab
ivory sleet
#

its very easy

somber scarab
#

even when detecting a specific arrow being used?

ivory sleet
#

var entity = world.spawn(blah...);

// when I wna remove it
entity.remove();

#

yea

somber scarab
#

holy shit I thought this was another person with an invisible pfp

ivory sleet
#

lol

#

well u can ofc put it in a list/set/map or some collection also I suppose, maybe its smarter to use UUID or to go by entity id (integer) instead tho

somber scarab
ivory sleet
#

u wna make sure the player is holding the right item in order to then summon the right projectile entity?

somber scarab
#

yes.. or so I thought the easiest way is

#

I can make a snowball with custom lore and maybe check for the lore?

#

or is there a cleaner solution

ivory sleet
#

u can use PDC on items maybe?

somber scarab
#

yeah ur right, does this run the risk of bloating data if I don't remove them properly?

ivory sleet
#

na not rly

somber scarab
#

oh okay so its perfect

ivory sleet
#

the data is just stored inside the custom item data component iirc

somber scarab
#

nice thankss

ivory sleet
#

^^ nws

buoyant viper
remote swallow
buoyant viper
clever zephyr
#

After hours and days of debuggings
I have achieved something incredible in a legacy version
An obsidian formation detecting algorithm.
by the combination of multiple events with the ability of detecting 99% of formed obsidian blocks from water and lava interactions.

rotund ravine
#

Grats

compact haven
#

99%?

#

you still have days of debugging left that's not good enough

mortal vortex
#

Is there a clear cut way to obfuscate a client's coordinates without strictly teleporting them?

#

@alpine urchin you're the packet guy, perhaps you know?

alpine urchin
#

wdym

mortal vortex
#

Like, is there a way to change the player's coordinates, to show up as like 6969, 69, 6969, while they are really at 420, 69, 420?

#

without actually making them move to 6969, 69, 6969, is there a way to make it appear as though they are. like through their F3?

fallow saffron
#

No, that's client sided, you cannot modify what the client sees

#

Pretty sure it's hard coded into the client

mortal vortex
#

You sure?

#

i thought the client gets its position from the server itself?

fallow saffron
#

You could try packets

mortal vortex
#

thats like how the server tps you

fallow saffron
#

notice how if you lag, and move your position in f3 still changes

mortal vortex
#

oh yeah gng

#

u right

fallow saffron
#

yeah, try packets, but I doubt it would work

rotund ravine
rotund ravine
fallow saffron
#

Perhaps, but it's not guaranteed to work, I think it won't, due to the rendering also dependant on x y and z

rotund ravine
fallow saffron
#

Fork the jar at that point lol

wet breach
#

after that, its all on the client and its the client that tells the server where its moving to

mortal vortex
fallow saffron
#

yes but the client will still try to render what coords it gets so you will have a buggy mess

wet breach
#

probably, but you would have a weird desync in positioning lol

mortal vortex
#

Wasnt there some whole base on 2b2t that used a proxy to offset user coordinates?

#

that was all serverside

wet breach
#

idk, I don't follow what groups like 2b2t or others do

#

I just go by what I know of the source code

#

the problem you will encounter is if the client or the server realizes the coords are messed up

#

and either one tries to correct it

#

end result player gets disconnected

#

but what would be the purpose of spoofing coords though?

fallow saffron
#

Could a resource pack modify the debug screen?

wet breach
#

sure, you can even send reduced debug info. But it doesn't completely remove the information rather just obscures it from easy access. If you have a mod you would still be able to see that info

fallow saffron
#

Yeah, I'm not sure he can do anything about it other than creating a custom client

wet breach
#

but it would help though to know why spoofing coordinates would be needed

#

or what the goal is of it

#

like if you wanted to confuse players as in their compass can't be relied on, then you could just change up the region file ordering instead

#

this would cause chunks to load in an area that they are not originally from

#

thus changing the landscape and making it appear they are not at the right coords when really they are

fallow saffron
#

But then internally wouldn't the chunks save in that position

#

Idk, don't know why he wants to spoof f3 position

wet breach
#

no, coords for the chunks I don't recall are saved as they are saved in the region file as region files have their own coordinates

fallow saffron
#

yes chunk coordinates

wet breach
#

no

#

region files have their own coords in the name of the region file

#

which stores 1024 chunks

fallow saffron
#

Really?

wet breach
#

yes, from chunk coord you can figure out which region file it belongs to

echo basalt
#

hi frosty ty for lunch

wet breach
#

by the same process in how you get chunk coord from a position coord

echo basalt
fallow saffron
#

ah yes

#

haha we are discussing this but he's not even responding

fallow saffron
#

Any idea how I can set a comparator to on and subtract mode via NMS

echo basalt
#

why nms

#

Look at its code for player interacts

fallow saffron
#

Because it reads a custom inventory fullness

echo basalt
#

no bukkit?

fallow saffron
#

of a block location, there's an inventory instance

#

nope, atleast not in 1.8

echo basalt
fallow saffron
#

Basically, I've got it to turn on and output a signal, but subtract mode, I got no idea

#

NMS is required to change the nbt tag of the tile entity (not block) "outputSignal"

echo basalt
#

them being tile entities hm

#

Output signal is part of the tile entity but mode is a block state

fallow saffron
#

yeah, I tried setting mode to subtract, but then it gets turned off

#

it needs to be on and subtract

#

So this works for outputting a signal atm:

    WorldServer worldServer = ((CraftWorld) block.getWorld()).getHandle();
    BlockPosition blockPosition = new BlockPosition(block.getX(), block.getY(), block.getZ());
    IBlockData iBlockData = worldServer.getType(blockPosition);
    net.minecraft.server.v1_8_R3.Block b = iBlockData.getBlock();

    if (signalStrength > 0) {
        worldServer.setTypeAndData(blockPosition, iBlockData.set(BlockRedstoneComparator.POWERED, true), 3);
        worldServer.b(blockPosition, blockPosition);
        worldServer.a(blockPosition, b, Integer.MAX_VALUE);
    } else {
        worldServer.setTypeAndData(blockPosition, iBlockData.set(BlockRedstoneComparator.POWERED, false), 3);
        worldServer.b(blockPosition, blockPosition);
        worldServer.a(blockPosition, b, 0);
    }

    TileEntityComparator tileEntityComparator = (TileEntityComparator) worldServer.getTileEntity(blockPosition);
    NBTTagCompound tag = new NBTTagCompound();
    tileEntityComparator.b(tag);

    int signal = tag.getInt("OutputSignal");

    if (signal != signalStrength) {
        tag.setDouble("OutputSignal", signalStrength);
        tileEntityComparator.a(tag);
        worldServer.update(blockPosition, b);
#

I tried using IBlockData for both enum POWERED and SUBTRACT

#

doesn't work :/

echo basalt
#

that code looks a lot like uh

fallow saffron
#

Went through the NMS classes but found nothing that can help :/

#

no mappings for 1.8 either makes it difficult

echo basalt
#

uh

wet breach
#

?mappings

undone axleBOT
echo basalt
#

I can reverse engineer the mappings fairly well

fallow saffron
#

It exists for 1.8.8 wow...

#

not official from mojang but helps regardless

wet breach
#

its one of those things highly requested all the time in here so someone made a link to a nice website for it

fallow saffron
#

Well give that person a raise!

echo basalt
#

pretty sure you just need to call k with an updated blockstate

#

here's a somewhat remapped version of 1.8

#

oop didn't rename those flags

#

Which is precisely how the interact method works

fallow saffron
#

but subtract isn't done there, and I am manually modifiying the comparator tile entity as you saw

echo basalt
#

the tile isn't enough

#

Subtraction is just an operation that runs to calculate signal strength

#

basically goes a bit like this

#

Mode == SUBTRACT ? max(getInputSignal(...) - getAlternateSignal(...), 0) : getInputSignal(...)

#

Specifically

#

And that's called on refreshOutputState

#

You can just pass the block data on the method you're calling and it'll update and update the tile entity, not the other way around

fallow saffron
#

Let me try that way then, thanks for the info

somber scarab
#

I have an issue with my gui

#

the slots in the players own inventory share the mapping of the slots inside my gui inventory

#

as if the button mapping is reflected onto the player's inventory

#

these buttons shown here are the spots where clicking inside the player's inv does the same bahvior as the button in the custom gui

#

hope that makes sense.. I saw a solution to this before but I totally forgot what it was

#

because I was yet to run into the issue myself

#

ah okay easy fix, just make sure clickEvent.getSlot() == clickEvent.getRawSlot()

short pilot
#

help spigot nms get world ID

#

how can I convert an entities' NMS info into Bukkit, are there any existing helper functions for that?

#

Like converting a blockpos into location, etc

wet breach
#

believe there is in the server code, CraftBukkit.toLocation or something like that, same with entities. Just have to look

#

been a while since I messed with the server code and I don't have it up at the moment

short pilot
#

sounds like a plan

blazing ocean
winter jungle
#

What's the best way to use hex colors in the nametag of an player?

blazing ocean
#

display entities

#

meaning either NMS or <the fork that must not be named>

winter jungle
#

Why was it decided to support Hex-Colors everywhere so easily, except in Nametags ._.

blazing ocean
#

It's just the legacy team system

#

It doesn't support any more than the 16 legacy named colours

#

It also uses player names and stringified entity UUIDs, so...

winter jungle
#

I would have used NTE now, but it hasn't been updated since 1.20. Then I'll probably have to use NMS or find another API xd

blazing ocean
#

NTE?

winter jungle
#

nametagedit

hollow vessel
#

Hi, how can I glow player for specific player? I mean only player X see glowing player Y and the other way

eternal oxide
#

teams or packets

blazing ocean
#

Player#sendPotionEffectChange

eternal oxide
#

Nice, I didn't know you could now do individual effects per player

hollow vessel
blazing ocean
#

just a normal effect

hollow vessel
#

I do not have this method on 1.20.1

#

@blazing ocean

blazing ocean
#

Sucks to be on 1.20.1 then

proven fern
#

Is there any translator for remapped class names and not remapped? For example what is eqivalent of EntityPlayer

eternal oxide
#

EntityPlayer is now ServerPlayer

#

?mappings

undone axleBOT
eternal oxide
#

?nms to auto map

proven fern
eternal oxide
#

yes

proven fern
#

I am scared of this 1.21.4 version fr

somber scarab
#

it's amazing

blazing ocean
#

How does one even get used to spigot mappings

#

They suck and are horrid

somber scarab
#

or are you talking about smth else

#

thought they need to be in order for paper and spigot to work interchangeably

proven fern
#

PacketPlayOutNamedEntitySpawn

What happend to this packet?

worthy yarrow
#

Most likely the name changed

blazing ocean
#

Spigot has its own mappings plus mojmaps whereas paper only uses mojmaps

undone axleBOT
proven fern
#

Problem is it disapeard

#

And what i am asking is if it's got replaced? No need for that?

worthy yarrow
#

I thought there was a section in wiki that had the name changes listed

proven fern
#

Microsoft could care more about us developers :>

worthy yarrow
#

I can’t find it so either I’m full of shit or not looking in the right place

proven fern
#

What revision version is 1.21.4 it's R3?

wet breach
proven fern
wet breach
#

don't ask me, it is basically the same packet as the one you were asking about, just the one you asked about was a stripped down version.

somber scarab
#

I need to shade in adventure api if I want my plugin to work with spigot servers.
That I know how to do.

But I was told I also need to make wrappers around my MiniMessage components. what does that mean?

wet breach
#

a wrapper is just a class that wraps the object

#

IE, making a player wrapper for example your player class would just have the player object as part of the contructor and you would just add your information in that class you wanted to be part of it, etc etc. Nothing fancy really

somber scarab
#

and then change the mappings imported in all of the classes that use Player?

#

but do I need to do this with every audience that my plgin uses? aka lore, and inventory and all that?

wet breach
#

what? why would you need to change mappings?

somber scarab
wet breach
#

a wrapper doesn't change how the object functions, rather just makes it easier to access and add information without changing the base object. As for using it elsewhere you can use the base object still just it wouldn't include the additional info from your wrapper class.

#

and which you want to use would depend which you need. However ideally you would just use your wrapper object everywhere to keep it clean

proven fern
#

@somber scarab do you just want to store some extra data inside a Player obj?

rough drift
somber scarab
proven fern
#

Fuck adventure api

somber scarab
rough drift
#

unless you re-implement paper's player object and forward it to spigot's

wet breach
rough drift
somber scarab
#

I jsut forgot how to do it again xd

proven fern
# somber scarab I jsut forgot how to do it again xd

In Adventure api there is something called LegacyCompoentSerializer.

Pass as argument always a Component and check if engine is paper. If paper send component, if not use LegacyCompoentSerializer and send string

somber scarab
#

does paper not render LegacyComponents? why couldn't I just seralize everything?

blazing ocean
#

Just use adventure-platform-bukkit

#

Handles everything for you

#
public static Audience audience(Player player) {
  if (isUsingPaper) {
    return (Audience) player;
  } else {
    return bukkitAudiences.player(player);
  }
}
short pilot
#
Group group = api.getGroupManager().getGroup("duke");

            if (group == null) {
                player.sendMessage(ChatColor.RED + " group does not exist!");
                return;
            }

            api.getUserManager().modifyUser(player.getUniqueId(), (User user) -> {
                // Create a node to add to the player.
                Node node = InheritanceNode.builder(group).build();

                // Add the node to the user.
                user.data().add(node);
                targetPlayer.sendMessage(ChatColor.GREEN + "You have been promoted to Duke. " +
                        "You can now add, remove, and banish players, as well as access the kingdom store.");
                player.sendMessage(ChatColor.GREEN + "Player has been successfully promoted.");
            });

Yo quick question for those with LuckPerms API experience, I'm trying to do a group update here to group.duke

But after I run this, I get the success dialogue but running /lp info on my target player shows that they have not changed groups

#

any help?

somber scarab
#

stupid question, if I run a paper server.. then I switch the jar to spigot with the same server files.. could it work?

#

so I can choose on what platform I want to run my server and change between them for testing

blazing ocean
#

if you're using paper specific functionality, no...

somber scarab
#

well that's the point.. I wanna make sure my plugin works on spigot as well

blazing ocean
#

then develop it on spigot

somber scarab
#

that#s why

#

I think we both mean the same thing

worthy yarrow
#

@blazing ocean even after the hard fork, paper still claims it can run spigot plugins yeah?

blazing ocean
#

Yea as long as you're not using any API added after the hardfork

worthy yarrow
#

So then yeah just make a module for paper specific functionality and write the rest with spigot

blazing ocean
#

why tho

#

is this for NDG?

worthy yarrow
#

Not for me, nova

proven fern
#

Anyone have a util class that allows to get input from sign?

#

on 1.21.4

somber scarab
#

soooo I added adventure-bukkit-adapter and shaded it in...
and I added both of these in my main class

public void onEnable(){
    this.adventure = BukkitAudiences.create(this);```

```    public @NonNull BukkitAudiences adventure() {
        if(this.adventure == null) {
            throw new IllegalStateException("Tried to access Adventure when the plugin was disabled!");
        }
        return this.adventure;
    }```
blazing ocean
#

okay

somber scarab
#

now whenever I need an Adventure Player for example

#

do main.getInstace().adventure().Player

somber scarab
#

?

somber scarab
#

also I don't just need a player from adventure

blazing ocean
#

your BukkitAudience instance

#

🥣

glossy laurel
#

What are all the possible reasons for one player not appearing for another specific players (like being in /vanish, but still appearing on tab)?

somber scarab
#

do I check for paper using this?
isUsingPaper = Bukkit.getServer().getClass().getPackage().getName().contains("paper");

rocky violet
#

where i can download bungeecord for 1.21.1

chrome beacon
#

?notworking

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.

blazing ocean
rocky violet
blazing ocean
#

paper does not move everything to their packages lol

rocky violet
#

bungeecord

chrome beacon
#

You downloaded Bungeecord but don't have Bungeecord

rocky violet
#

i put in plugins

chrome beacon
#

???

chrome beacon
#

Bungeecord is not a plugin

rocky violet
#

where i need to put it

chrome beacon
#

You run it like a server

#

so another folder where you want it

somber scarab
blazing ocean
#

If you want to have your plugin work on spigot, you'll have to use spigot...

somber scarab
#

what if I want it to work on both?

#

also spigot no?

blazing ocean
#

spigot plugins will work on paper

somber scarab
#

okay yeah so I'll have to switch back

winter jungle
#

I use NMS to set the prefix and suffix, the hexcolor also works there, but the player name remains white. Is it even possible to change the player name color to a hex color?

blazing ocean
#

not without a text display

winter jungle
#

;-:

somber scarab
#

so what do I do with all these again?

#

public static final MiniMessage miniMessage = MiniMessage.miniMessage();

eternal night
#

you also shade mini message

somber scarab
#

I shaded in adventure

#
                                    <pattern>net.kyori.adventure</pattern>
                                    <shadedPattern>com.bluenova.floorislava.libs.adventure</shadedPattern>
                                </relocation>```
eternal night
#

adventure-platform isn't mini message

somber scarab
#

weird.. before the last merge when I switched to paper, I didnt need to shade in MiniMessages and it worked

somber scarab
#

ahhh as a dependancy

#

mb

#

okay perfect that solves that

#

another thing is my TagResolvers

#

oh now I can jsut import them

#

sickk

worthy yarrow
somber scarab
#

oops

#

back to square 1

#

so How did I make items and Inventories format their text as well?

#

if I am using spigot adventure api

eternal night
eternal night
#

use the legacy serialiser

somber scarab
#

IT WORKSS

#

💃

blazing ocean
#

?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

blazing ocean
#

just put it on github, also:

#

?codereview

undone axleBOT
steep siren
#

aight thx

clever zephyr
clever zephyr
compact haven
#

💀

robust helm
#

am i tripping or does the world spawnlocation(from /setworldspawn) ignore yaw and pitch?

rotund ravine
#

Probably

robust helm
#

hmm ill try making my own /setworldspawn

#

works :)

somber scarab
#

would I be stupidly ambitious if I wanted to make a custom world generator for my own plugin use?

#

how easy would that be?

drifting bluff
#

How do I block the /plugins command? Because just like canceling it doesnt work cus some players with hack clients can still acess it

chrome beacon
#

The permission node is bukkit.command.plugins

#

Also the clients don't use /plugins they simply parse the namespace prefix

drifting bluff
#

the namespace prefix?

chrome beacon
#

/minecraft:give

drifting bluff
#

ah okay

chrome beacon
#

minecraft is the namespaced prefix

#

You can disable that by setting send namespaced to false in the spigot.yml

young knoll
#

Just rename all your plugins by editing the plugin.ymls

drifting bluff
#

Lol

drifting bluff
still vortex
#

does anyone know any good Book UI prompt api?

young knoll
#

Smh you made a hacked client

buoyant viper
#

its where i learned most of my java lol

#

like a solid 90-95%

young knoll
#

And it’s ARR

#

:(

buoyant viper
blazing ocean
quaint mantle
iron night
#

I was testing things and made a plugin that sets result of craft to 2 Dirts on any inventory interaction event. If you click this dirt when valid recipe is formed - you get the dirt and every item in grid decreases by 1. if you click this dirt when no valid recipe is formed - you get the dirt but every item in grid after decreasing by 1 also doubles, even going above 64. why does this happen and how do i make it decrease every item in grid by 1 and nothing else? (1.21.4)

young knoll
#

PrepareItemCraftEvent

iron night
winter jungle
#

Is there a way to change the enforce-secure-profile setting via a plugin?

chrome beacon
#

hm? why

young knoll
iron night
#

but its only called when recipe is formed

#

i need to update things on every grid change

winter jungle
# chrome beacon hm? why

Because I use a cloud and a template is used per server, but I cannot use the same server.properties for each subserver

young knoll
#

I thought you just wanted to replace all recipe outputs with user

iron night
# iron night i need to update things on every grid change

basically i want to make some custom recipes but api doesnt let you make custom recipe choices (whyyyy it isnt there yet) so i thought the easiest way to do it is to check whether or not there is valid custom recipe on every grid change and if there is - change output but strange things happen if this output is taken as i explained above

thorn isle
#

Bukkit.addRecipe(new ShapedRecipe(...))

#

or is that paper only?

iron night
#

as i said api doesnt support custom recipe choices

#

it only supports material predicate and exact predicate

#

but i need other things

thorn isle
#

uuuh what do you need specifically

iron night
#

i want ingredients to be itemstack predicates

#

so i can make ingredient require some nbt tag

#

for example

young knoll
#

That’s what exact choice is

worthy yarrow
#

What’s preventing you from just using pdc?

thorn isle
#

it looks like there is a PredicateRecipeChoice, but that's internal to paper

iron night
#

there is no predicaterecipechoice in paper

thorn isle
#

it's internal

iron night
#

do i need to like use nms

#

dont really get it

iron night
young knoll
#

In that case

#

Register a recipe with just the generic items without NBT and use the prepare craft event to validate them

#

If they don’t match you can set the result to null

thorn isle
#

it doesn't look like vanilla shaped crafting really supports arbitrary predicate ingredients, either

#

there are exact matches and type matches

young knoll
#

Hell, before 1.20.5 there weren’t even exact matches

iron night
thorn isle
#

nms.Ingredient is final and implements test by ```java
@Override
public boolean test(ItemStack stack) {
// CraftBukkit start
if (this.isExact()) {
return this.itemStacks.contains(stack); // Paper - Improve exact choice recipe ingredients (hashing FTW!)
}
// CraftBukkit end
return stack.is(this.values);
}

blazing ocean
#

Paper

young knoll
#

Make a custom crafting system like hypixel skyblock

#

Sadly you can’t implement RecipeChoice

#

Well you can but it won’t work

iron night
thorn isle
#

yes

#

but the reason why is that the recipechoice is converted to nms.ingredient

#

and the reason why no "predicate choice" exist seems to be that nms.ingredient itself doesn't support it

iron night
thorn isle
#

so it seems even going into nms won't help you here

echo basalt
#

unless

#

bytebuddy interceptor moment

thorn isle
#

nms.ingredient does seem like a fairly simple patch would have it support predicates

#

so maybe open an issue about it

young knoll
#

MD has already expressed concern about it

#

A plugin adds a recipe using a custom ingredient predicate, then that plugin is disabled

#

Now what

thorn isle
#

you unregister the recipe

#

or, if that has issues with backwards compatibility, have the predicate choices themselves be registered in a plugin -> choices registered by plugin mapping, and have the choice de-reference the underlying predicate on plugin unload, subsequently always returning false

young knoll
#

Make a feature request and describe all that :p

iron night
# thorn isle so maybe open an issue about it

in paper issues on gh was some attempts on implementing PredicateRecipeChoice but they failed and it seems like because of Shapeless recipes. i might be wrong about what the problem is, but if its about that some itemstack can match multiple predicates i dont understand why noone just used the kuhn algorithm

thorn isle
#

seems rather silly

#

paper features always run into and fall on their face over the most trifling and inane issues

#

clown

sly topaz
#

?services

undone axleBOT
iron night
thorn isle
#

i don't really remember what we were talking about or what your issue is, but if the issue was that when taking out the recipe result "weird things happen", have you tried listening to that click event and changing the cursor/active item?

sly topaz
thorn isle
#

the recipe registry is ephermal anyway

sly topaz
#

though in this case it's a bit more far fetched as the changes aren't going to be persistent, yeah

#

I do believe there should be something that allows plugins to clean up after themselves even after removal

young knoll
#

Tbf predicates work a bit better than a custom class that implements RecipeChoice

iron night
young knoll
#

Since it makes a magical little method that isn’t tied to the plugins classloader

thorn isle
#

i think yes you can pass an array of stacks into some api method somewhere and itll' give you the matching recipe, if any

#

at least i very vaguely remember it being a thing

sly topaz
iron night
#

i hope it uses hashmap or something and not iterates over every recipe

#

thx

sly topaz
#

there's also Bukkit#craftItem if you want to give it an array and have it adjusted to what's left after crafting

thorn isle
#

and yes, it is shit

sly topaz
#

I mean, considering the dynamicity of recipes, I don't find it all that unreasonable

young knoll
#

Big modpacks have entered the chat

#

At least there is a cache iirc

sly topaz
#

big modpacks mess up everything in regards to performance since they just (ab)use of the existing systems that aren't made for their behaviors anyway

iron night
#

what is shaped/shapeless recipe ratio in vanilla?

thorn isle
#

probably like 10:1 or more

sly topaz
#

most recipes are shaped if my memory serves me right, don't think there's that many shapeless recipes

iron night
#

then hashmaps should speed it up at lot ig

thorn isle
#

i did reimplement the recipe matcher as a pet project

#

the biggest trouble is that many recipes accept material tags rather than exact items or materials

#

so a naive hashmap based implementation will swell to billions of entries from the combinatorics

iron night
#

oh

#

sad

thorn isle
#

i did however manage to make it O(1)* except for a few malignant cases like iirc slabs and stairs, that required 2 hashmap lookups rather than 1

#

at the same time it would have thrown arbitrary predicates like what you want largely out of the window

iron night
#

is there a limit on how many material tags item can have?

thorn isle
#

a material could be listed in every tag and a tag could list every material; no

#

in practice the ones that are involved in crafting usually only list 4-10 materials

#

biggest one is i think the one that lists all logs and stripped logs

iron night
#

how did you make it O(1) then

thorn isle
#

well, O(1)*

#

as in if someone makes a recipe that only uses material tags that list every material, there will be 2 map lookups minimum

#

in practice however with vanilla recipes, 99% of recipes completed in one lookup

iron night
#

like

#

lookup of what

#

what exactly was keys

thorn isle
#

it's a bit complicated but i basically inspect all material tags used by recipes and their specific layouts in the grid to compute token keys that, when substituted for any given material in an array used as a key to represent the recipe matrix, will find at least the recipes they were used in, but may return more recipes if the material tags align/overlap

#

for example, in the bottom row of the 3x3 recipe matrix, all materials used to craft a furnace will map into a single token key

#

this means that no matter which type of stone you put in those slots, the furnace recipe will always be found