#help-development

1 messages · Page 893 of 1

tender shard
#

ofc you can but it's easier to convert it to maven

#

then you only have to add spigot-api to the pom and then hope that it doesnt require any further dependencies

lost matrix
#

Pls tell me that the Extensions folder doesnt contain the whole compiled spigot jar.

ocean hollow
lost matrix
#

I see. Whats in the bin folder?

ocean hollow
#

plugin.yml

lost matrix
#

Weird name. Well at least he didnt push his dependencies with the project.

#

But you wont be able to compile it like this PES_CringeGrin

peak jetty
lost matrix
#

Why no extension sad

inner mulch
lost matrix
peak jetty
#

i even tried not to even move

lost matrix
zealous osprey
#

why is there a "," missing there ?

lost matrix
tender shard
peak jetty
lost matrix
# peak jetty

p.getLocation().getChunk() and chunkGlobal. Before
if (p.getLocation().getChunk().equals(chunkGlobal)) {

peak jetty
#

but i put chunkGlobal = chunk;

lost matrix
#

Yeah, what i expected

peak jetty
tender shard
lost matrix
# peak jetty but i put `chunkGlobal = chunk;`

Add this constructor and tell me how often you get this msg

private static int counter = 0;

public CommandExecutor() {
  System.out.println("> Command instance created: " + (++counter));
}
#

Also: Make your fields all private

peak jetty
#

it works

#

i made them all private static

#

thanks for the help

lament maple
#

Can someone tell me how i can get my YamlConfig out of another class then main?

ivory ivy
#

Anyone else?

upper hazel
#

Is it possible to somehow reflect fake online in the server menu when the player sees the title icon, etc.? nms

lost matrix
undone axleBOT
lament maple
rotund ravine
#

Read the link

lost matrix
lament maple
rotund ravine
#

Like the server list?

#

Quite easy there

lament maple
upper hazel
#

which ?

lost matrix
upper hazel
#

if anything I'm not talking about the tab when logging into the server

rotund ravine
#

This ? @upper hazel

upper hazel
#

yes

lament maple
undone axleBOT
lament maple
#

ok-

lost matrix
peak jetty
#

i tried just private and it didnt work

shadow night
#

what was the modt event called again?

peak jetty
#

static works just fine

upper hazel
#

oh

rotund ravine
#

Default spigot does not expose it in the ping event

lost matrix
# peak jetty why

Because static is dangerous and it masks your actual problem.
You are probably creating multiple instances of your command class. Dont do that.

upper hazel
#

i have 1 server

#

not multi

rotund ravine
#

Intercept the Server Ping packet

#

And return smth else

upper hazel
#

this in nms or spigot

rotund ravine
shadow night
#

is there a way to just deny the ServerListPingEvent event? So that the pinger never gets an answer

shadow night
#

well

#

ig I can test that one packet lib I got recommended now

upper hazel
#

and what can replace ClientboundPlayerInfoPacket in versions starting from 1.19.4

wet breach
rotund ravine
#

Not able to be cancelled or denied

shadow night
wet breach
#

hmmm, I guess it doesn't have cancellable

#

nvm about the event, however though you can use the event to change some things

rotund ravine
#

Kinda outdated

shadow night
wet breach
#

However, if the packet is not sent, it makes the server show up as not online

rotund ravine
wet breach
#

but it doesn't prevent a client from connecting

rotund ravine
shadow night
#

why would I use a proxy

rotund ravine
#

Well proxies have better events for it so you would be in luck

upper hazel
lament maple
#

Would this work? i put that in my main class

rotund ravine
#

getConfig and saveDefaultConfig / saveConfig works

lament maple
#

i just want it to work

rotund ravine
#

Well

#

Why is there 3x Location

wet breach
lament maple
#

yea sorry

wet breach
#

and don't understand how objects can be manipulated

lament maple
#

i see i only need one im dumb

wet breach
#

I wouldn't necessarily call someone dumb who lacks knowledge and understanding of what they are using

#

just you need to learn more about the basics though

lament maple
lament maple
undone axleBOT
lost matrix
#

You pass your JavaPlugin instance throgh the constructor of your SetLobbyCommand class

rotund ravine
lost matrix
#

new SetLobbyCommand(this)

lament maple
wet breach
#

just use the same coords for all the worlds 😄

lament maple
tender shard
#

who needs dependency injection when you can easily store the memory address to "this" in the system properties, and then in another class get the address from System.getProperty("my_super_plugin_instance_address") and use Unsafe#getObject(...) to get the instance? isn't this much easier?

lost matrix
lament maple
grave vigil
#

I have a yaml config that looks similar to this:

group:
  leader:
    canExplode: true
    amount: 1
    leadTimeInMinutes: 10
  citizen: 
    canExplode: false
    amount: 10

How would I go about grabbing the information from the config and putting it into an array? The creator of the config would be able to create additional groups, and I want my plugin to be adaptable to that.

tender shard
#
ConfigurationSection groups = myConfig.getConfigurationSection("group");
for(String groupName : groups.getKeys(false)) {
  // groupName is "leader", "citizen", ...
}
grave vigil
#

ty

lost matrix
upper hazel
#

1.19.4

#

1.20

tender shard
#

?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.

upper hazel
#

?

tender shard
#

it is possible

#

if something is not working with your code, then tell us what exactly doesn't work and whether you get any errors

upper hazel
#

well, the problem is that the package with data about the fake player is not displayed in the tab

#

even if I send it to the player

#

the code seems to be correct

#

Maybe some package is missing?

devout kite
chrome beacon
#

Yeah

#

What part do you need help with

devout kite
#

all of it 😄

#

i need to know how to do it i thought about making a item for every number from 0-9 and coding something that formates it to the items. but i realy hope there is a easyer way

chrome beacon
#

How close to that image do you want it to look? And do you plan on using a resource pack?

devout kite
#

i have a costume resource pack so ya

#

it should display the balance it does not have to be a beauty

chrome beacon
#

So you just want to show items as numbers?

sterile token
#

How do you do when you have to work with multiple git branches and have ignored dist, node_modules and package-lock.json files in each branch. But when you switch branches, the damn ignored folders and/or files still persist in directory you changed branch what's the solution to this?

devout kite
chrome beacon
#

also just npm install when you switch branch

sterile token
tender shard
chrome beacon
devout kite
chrome beacon
#

Come up with a design and then start implementing it

sterile token
inner mulch
#

hey i dont quite get what modules are used for, as in my case i cant even access the modules classes without having it as a dependency even tho they are in the same project?

sterile token
timid dove
#

How do I get started making plugins?

tender shard
timid dove
timid dove
tender shard
#

ok so, here's a guide on how to setup your IDE using maven, to get a basic project layout for spigot plugins: https://blog.jeff-media.com/how-to-create-your-first-minecraft-plugin-using-the-spigot-api-and-maven/

After that, there's a ton of guides on the forums, e.g. how to listen to events: https://www.spigotmc.org/wiki/using-the-event-api/
or how to create a simpe command: https://www.spigotmc.org/wiki/create-a-simple-command/

Learn how to create your first Minecraft plugin for Bukkit/Spigot!

wintry lynx
#

They get different pretty fast

tender shard
#

and here's also some basic general java stuff:

#

?learnjava

undone axleBOT
#

For Beginners:

Codecademy - Learn Java: Interactive Java programming course from basics to more advanced concepts. Perfect for absolute beginners.
https://www.codecademy.com/learn/learn-java
JetBrains Academy - Java Developer Track: Learn by doing with projects and challenges. It covers Java fundamentals to advanced topics.
https://www.jetbrains.com/academy/
Udemy - Java Programming Masterclass for Software Developers: Updated courses that cover Java 8 to Java 17 features. Suitable for those who prefer structured learning.
https://www.udemy.com/course/java-the-complete-java-developer-course/

For Intermediate to Advanced Learners:

Oracle Java Tutorials: The official guides by Oracle for Java programming—great for understanding the depth of Java.
https://docs.oracle.com/javase/tutorial/
Baeldung - Learn Java and Spring: Focus on Spring Framework and modern Java technologies. Best for intermediate learners aiming to expand their knowledge.
https://www.baeldung.com/

Practice and Hands-on Learning:

Exercism - Java Track: Solve exercises and get feedback from mentors. Great for practicing coding skills.
https://exercism.io/tracks/java
LeetCode: Practice your coding skills and prepare for technical interviews with Java.
https://leetcode.com/

Free Resources and Documentation:

Java Programming and Documentation: A comprehensive collection of Java programming guides, tutorials, and API documentation.
https://docs.oracle.com/en/java/

Community and Support:

Stack Overflow: A vast community of developers. Great for getting help with specific problems or understanding concepts.
https://stackoverflow.com/questions/tagged/java
r/learnjava on Reddit: Join the community of Java learners and get advice, share resources, and discuss projects.
https://www.reddit.com/r/learnjava/

Remember: Learning to program takes practice and patience. Don't hesitate to experiment with code and participate in community discussions. Happy coding! 🎉

timid dove
wintry lynx
timid dove
#

That's what I was downloading with a free trial, was it worth buying in hindsight?

sterile token
timid dove
sterile token
river oracle
#

How do you get CLI arguments passed into a gradle.kts task e.g. if I want to run task ExampleTask how would you retrieve/verify the arguments. My current setup in buildSrc

open class ExampleTask : DefaultTask() {

  @TaskAction
  fun testAction() {
    // how to verify / get CLI arguments here?
  }

}
#

^ nvm had wrong search terms found the answer I was looking for on the web

fleet badger
#

What happened to EntityCombustByEntityEvent? It doesn’t exist anymore and breaking my plugin along with others when I update spigot to latest. Did it get renamed or removed?

tender shard
#

you can either pass properties like -PmyVar=asd

#

or what do you mean exactly with CLI arguments?

flint coyote
river oracle
# tender shard well the other args are also tasks

I got this to work, but thie tutorial was java I wonder how you could minimize this with kotlin

    private var sourceVersion: String = "v1_20_R3"

    @Option(option = "sourceVersion", description = "sets the version to copy the NMS source from")
    fun setSourceVersion(sourceVersion: String) {
        this.sourceVersion = sourceVersion
    }

    @Input
    fun getSourceVersion(): String {
        return this.sourceVersion
    }

    @TaskAction
    fun upgradeNMS() {
        logger.info(sourceVersion)
    }```
tender shard
river oracle
#

not sure lemme check

tender shard
#

both annotations can be used on fields, that I'm sure

river oracle
#

yep @tender shard thx

tender shard
#

does this actually allow you to do gradlew upgradenms 1.2.3 or how do those options work?

river oracle
#

I need to still make a java parser so I can give out a document of changes

slender elbow
#

@get:Input
var blah

is the correct way

river oracle
#

parsing java for type tokens and parsing it through MojMaps is still quite a pain though

#

so I'm saving that for further down the line

#

its something that will need to be done in a separate project way to hefty for a simple buildSrc script

#

I will probably add it inside of our remapper along with our upgrader and such

#

if @remote swallow would ever finish the remapper :P

remote swallow
#

i will get to it

#

sh

river oracle
#

🤔 now what the fuck did I do wrong lol

#
> Command-line option '--source' does not take an argument.
    @set:Input
    @get:Option(option = "source", description = "sets the version to copy the NMS source from")
    var source: String = "v1_20_R3"

    @set:Input
    @get:Option(option = "target", description = "the version to copy the NMS implementation to")
    var target: String? = null
remote swallow
#

get input

river oracle
#

maybe its a conflicting name

remote swallow
#

iirc

river oracle
#

that does it

slender elbow
#

it goes on the getter yes

#

and option on the field or setter

#

lol

river oracle
#

yeah I had it switched around lmao

mellow pebble
#

?paste

undone axleBOT
mellow pebble
#

can someone help me on which version should i build my plugin if im running 1.16 server and plugin is using spigot api for 1.16 i changed sdk version accidentally and i dont know to which version should i reverse it back to also bonus question do i need to change something in pom.xml also or no only in project structure of intellij

https://paste.md-5.net/miyinazivi.sql

#

any help myb ?

#

yes

#

i need to know on which version of java should i compile plugin for it to work to get enabled

#

i run server on java 8 and i compile plugin on java 8 but it doesnt enable plugin properly

#

where can i find that

#

yes

#

if it is this <source> and <target> i set it to 11 and it is not working

#

it worked until now until i changed on which sdk it is compiling it on

#

so you are saying in maven i should set target and source to 1.8 and in project structure i should set it to 1.8

#

no no it is still the same thing

#

?paste

undone axleBOT
mellow pebble
#

here

#

ok

#

i can paste it again

#

wait

#

yes ikd what to do

rotund ravine
#

Post if new pom

#

Also make sure you clean package

mellow pebble
#

how would i do that

#

oh yeah done

#

yup

#

that seems to work

#

nice

#

ty guys

tender shard
#

which version of hikari?

#

4.8.3 is the latest that works with java 8

#

you're probably using a newer JDK to run maven

#

but set it to 8 in IJ

#

hikari 5 requires java 11

eternal night
native ruin
#

Is there a good guide on menus? I have heard that menus are very easily exploited if done wrong

remote swallow
#

command when

spare mason
#

there's any guide about hotswap?

remote swallow
#

download jebtrains runtime, download hotswap agent and put it inside lib/hotswap start the server with -XX:+AllowEnhancedClassRedefinition -XX:+AllowRedefinitionToAddDeleteMethods -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005 -XX:HotswapAgent=fatjar and jetbrains runtime, create a debug task in intellij then set a keybind for compile and reload then press that every time you want to hotswap

devout kite
peak depot
#

are there any good tutorials for ACF?

chrome beacon
peak depot
river oracle
young knoll
#

Uhhh

#

?gui

peak depot
#

whats the event for like water expanding sand falling etc

valid burrow
#

Math problem:

for (int i = 0; i < totalPlayers; i++) {
            double angle = 2 * Math.PI * i / totalPlayers;
            double x = centerX + circleRadius * Math.cos(angle);
            double z= centerZ + circleRadius * Math.sin(angle);
            Player player = alivePlayers.get(i);

            Location location = new Location(world, x, spawnHeight, z);
            Location blockLocation = new Location(player.getWorld(), x, spawnHeight - 1, z);
            blockLocation.getBlock().setType(Material.BEDROCK);
            player.setVelocity(new Vector());
            player.teleport(location);
        }

I need to spawn the player in the middle of the block not next to it, not on the edge, in middle

peak depot
young knoll
#

Yeah just add 0.5 to the x and z

#

Assuming they are integers

#

If not just floor them then add 0.5

valid burrow
#

i tried that

#

it didnt work xd

#

some people spawned in the middle

#

some spawned 1 block away in the middle

wet breach
#

It rounds down to next whole int

valid burrow
#

its arlguth i found the problem

#

and a fix

#

i used the location objects i generated using pi

#

so instead of using them

#

i got their block

#

and then the location of their block

#

and did +0.5 on them

#

it works now

wet breach
#

There you go. But was explaining the discrepancy you experienced lol

#

So it doesnt seem so mysterious lol

valid burrow
#

lol nother match problem

#

i have x locations

#

all looking west

#

i need them all to look to 0-0

#

face*

young knoll
#

Set yaw and pitch to 0

winter schooner
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

rotund ravine
#

?support

undone axleBOT
drowsy helm
winter schooner
#

One message removed from a suspended account.

#

One message removed from a suspended account.

drowsy helm
#

?ask

undone axleBOT
#

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

valid burrow
#

i need them to look at the cord 0-0

young knoll
#

Oh

undone axleBOT
young knoll
#

Get the vector between the location and 0,0 and then use that to set the rotation

valid burrow
#

how do i do that :3

#

math is hard

young knoll
#

You can get the vector between two points by subtracting them

#

And you can convert a location to a vector with .toVector

valid burrow
#

ah okay thx

#

yh makes sense

#

now that i think about it

restive mango
#

Anyone know what "your-plugin-handler" would actually be from?

ChannelPipeline pipeline = ((CraftPlayer) player).getHandle().playerConnection.networkManager.channel.pipeline();
pipeline.addBefore("your_plugin_handler", player.getName(), channelDuplexHandler);

#

Like... what is it? Just the plugin .tostring?

young knoll
#

Some sort of unique string for your plugin

#

Could just be a string representation of a namespaced key to keep it simple

restive mango
#

hrm

#

but it still throws this error:

wet breach
restive mango
#

[20:22:40 ERROR]: Could not pass event PlayerJoinEvent to AesopianProject v1.3.0
java.util.NoSuchElementException: aesop_proj_handler
at io.netty.channel.DefaultChannelPipeline.getContextOrDie(DefaultChannelPipeline.java:1073) ~[netty-all-4.1.68.Final.jar:4.1.68.Final]
at io.netty.channel.DefaultChannelPipeline.addBefore(DefaultChannelPipeline.java:302) ~[netty-all-4.1.68.Final.jar:4.1.68.Final]
at io.netty.channel.DefaultChannelPipeline.addBefore(DefaultChannelPipeline.java:290) ~[netty-all-4.1.68.Final.jar:4.1.68.Final]
at co.lotc.aesopianproject.PacketTestClass.injectPlayer(PacketTestClass.java:39) ~[AesopianProject.jar:?]
at co.lotc.aesopianproject.listeners.SpellListener.injection(SpellListener.java:94) ~[AesopianProject.jar:?]

#

etc

slender elbow
#

the first string in addBefore is the handler you want to add yours before

restive mango
#

@young knoll

#

ah

slender elbow
#

e.g. timeout, packet_handler, packet_decoder, etc

restive mango
#

hrm

#

oh okay

slender elbow
#

or w/e the names are

restive mango
#

i have no idea what the names are

slender elbow
#

the ones already in the pipeline

restive mango
#

or where to find them

#

do you uh

#

know where a list of those would be

slender elbow
#

if you have nms set up you can find them in the Connection class

#

where the pipeline is configured

restive mango
#

I do have nms set up but they don't seem to be like an immediate subclass of the connection class

slender elbow
#

they aren't subclasses afaik

#

there's a static method where the pipeline is configured but i don't know what it's called

restive mango
#

eh

#

let me just see if any of the three you listed

#

as strings

#

work

#

works

#

sweet

#

ah

#

damn

#

i was hoping for a way to drive an entity i was spectating

#

but it seems like all my packets for movement really are dead

#

@slender elbow you wouldn't happen to know a way to get spectate shaders while still being able to move, would you? ;p

slender elbow
#

hm while in spectator, i think not

#

it seems like the client skips all movement packets entirely when it's spectating another entity

restive mango
#

yeah

#

sadly

vagrant nebula
#

Help

#

if (blockUnderPlayer.getType() == Material.TNT) {
System.out.println(player.getName() + "玩家移动到了TNT上");
Vector direction = player.getLocation().getDirection().multiply(1);
direction.setY(knockback); // 设置击退的力度,可以根据需要调整
player.setVelocity(direction); // 对玩家施加击退效果 if (blockUnderPlayer.getType() == Material.TNT) {
System.out.println(player.getName() + "玩家移动到了TNT上");
Vector direction = player.getLocation().getDirection().multiply(1);
direction.setY(knockback); // 设置击退的力度,可以根据需要调整
player.setVelocity(direction); // 对玩家施加击退效果

#

#欢迎使用本插件

#设置TNT击退的强度
knockback: 2.5

#

saveDefaultConfig();
FileConfiguration config = getConfig();
// 从配置文件中读取击退值并传递给 TNT_Listener
double knockback = config.getDouble("knockback", 1.0);

#

Is there a problem with my 3 pieces of code?

#

Why did I change the knockback value to knockbackWhy did I change the knockback value to knockback

rough ibex
#

You are repeating your things?

#

Please use a code block

ivory ivy
#

It didn’t work, because I was printing out the block every time this event was called and it just printed out the block above the hopper. But I think I have a solution to this. Each time this event happens get the below block of the hopper and check if it’s a PLAYER_HEAD and then trigger a function with the rest of the logic

heavy void
#

(Offline Server) Is there a way to change player name? I mean literally player name, not display name. (Idk, something with packets, reflection or only normal functions)

heavy void
rough ibex
#

You can use protocollib

heavy void
#

What packet

#

Needs rejoin?

rough ibex
#

PacketType.Play.Server.PLAYER_INFO

#

I can cook you up a minimal example for how to do it but it'd be kotlin

heavy void
#

No problem

#

Oh wait

#

When i said packet method, i mean a packet that direct changes player name for joining offline server, something that impacts on serverside

rough ibex
#

class PacketLoginListener(private val instance: JavaPlugin) : PacketAdapter(
  instance, ListenerPriority.LOWEST, PacketType.Play.Server.PLAYER_INFO
) {
    override fun onPacketSending(packetEvent: PacketEvent) {
            if (packetEvent.packet.playerInfoAction.read(0) != EnumWrappers.PlayerInfoAction.ADD_PLAYER) return

        val newPlayerInfoDataList: MutableList<PlayerInfoData?> = ArrayList()
        for (playerInfoData in packetEvent.packet.playerInfoDataLists.read(0)) {
            // Work on each player.
            if (playerInfoData?.profile == null || Bukkit.getPlayer(playerInfoData.profile.uuid) == null) {
                // Unknown player, add it to new players.
                newPlayerInfoDataList.add(playerInfoData)
                continue
            }
            newPlayerInfoDataList.add(
                PlayerInfoData(
                    playerInfoData.profile
                        .withName(NAME)
                        .withId(UUIDSTRING),
                    playerInfoData.latency,
                    playerInfoData.gameMode,
                    playerInfoData.displayName
                )
            )
        }
        packetEvent.packet.playerInfoDataLists.write(0, newPlayerInfoDataList)
    }
}
#

something like this

rough ibex
#

This changes the login packet

#

the server will see the modified packet

#

and will register accordingly

#

how I got this, I don't remember

#

but I've had this snippet in a plugin I'm working on for a while

#

and I know it does work

heavy void
#

Hmmm, so, i will make a verification if the player is a cracked player or not, if it is, a "#" will be placed on name

I want other plugins that save data on nicks instead UUID, save "Nick#" instead "Nick"

It will do it?

rough ibex
#

It should, yes.

#

This modifies the player's actual UUID and name

#

and gets rid of the old one

heavy void
#

Hmmmmmm

#

This is cool

#

No need to rejoin?

rough ibex
#

It will intercept the login packet

heavy void
#

Oh

#

Its a listener

rough ibex
#

I don't think it's possible really to change the player's name and UUID while they exist still

#

that would be... hard.

heavy void
#

Xd

#

No problem

#

Ty bro

#

I will save your code

#

And try to convert to Java

#

Bro, im thinking right now

#

Its useless if its used on a network

#

Yes or no?

heavy void
rough ibex
#

I suppose

heavy void
#

Ill try to find an alternative using Protocolize

wet breach
rough ibex
#

Not sure if the client would be aware of it though

wet breach
#

However i dont really see why it would be necessary to change their uuid though

wet breach
rough ibex
#

Fun to know

wet breach
#

Because if you were in offline mode the client doesnt send a uuid and its the server that makes one up but doesnt tell the client the uuod either except to other players in the tab list

#

Same is true for online mode, but in online mode the client does send uuid to say hey this is me, server takes that and then asks mojang servers if that is true and then after that server doesnt really care about the uuid except for consistency in stuff

#

Now it may be a pain though to make something work for changing player uuids though because nms and there is a lot of places that you might have to check lol

#

Like for example, when you ban a player via name the server does a lookup of the uuid of said name to ban

rough ibex
#

I never really looked too hard into the whole packet pipeline, a lot of back and forth and keeping track

terse ore
#

what could be some reasons my config file is generating empty?

pure stag
#

how can I make the spawner work at any time of the day?

warm mica
#

Mob spawners care about the time of day?

pure stag
#

they depend on the level of light

pseudo hazel
#

they just depend on the spawning conditions of the mob they spawn

#

which for monsters means it needs to be dark

pure stag
#

delay does not decrease when there is light, is it possible to ignore it somehow?

upper hazel
#

Do you need a player to listen to the package or is it not necessary?

shadow night
upper hazel
#

Is it possible to somehow bind the listener to the server?

shadow night
upper hazel
#

I'm talking about reading packets

#

nms

smoky anchor
inner mulch
#

does somebody know how i can get both the shaded and unshaded jar when i use the mvn install command?

eternal night
#

-original should be the non-shaded one

inner mulch
#

okay, thank you

smoky anchor
#

Why the heck are you trying to use NBT for that
I checked and Spigot does have API for this......

#

(also, what version are you using, better be something sensible like 1.20)

#

and in any way, I think you did it wrong, you forgot to set the spawnPotentials to the compound
But again, use the API for this lol

smoky anchor
#

well then you do not have acccess to that I think

#

gotta implement that yourself

pure stag
#

cool

dire marsh
#

outdated version moment

sullen wharf
#

Is there any particular reason for PlayerInteractEvent to not trigger when right clicking air with an item?

dire marsh
#

pretty sure it does

pure stag
#

send it anyway, maybe I can get the code from there?

upper hazel
#

Tell me what kind of package is used when sending information about an online player to the client menu

sullen wharf
#

🤔

upper hazel
#

approximate name

dire marsh
#

I mean we're using tens of interact events and checking the item for our abilities

#

so it def works

#

unless some spigot commit broke it

pure stag
dire marsh
#

¯_(ツ)_/¯

pure stag
#

oh, addPotentialSpawn(SpawnerEntry spawnerEntry)

sullen wharf
#

uhmm

pure stag
#

can I somehow disable the spawner update?

agile hollow
#

i'm getting that error from like 2h but idk what is the cause

    public void onEnable() {
        instance = this;
        MongoClient mongoClient = MongoClients.create("link to the db");
        MongoDatabase database = mongoClient.getDatabase("sews");

        ItemManager = new ItemsManager();
        gangmanager = new gangmanager();

        String collectionName = "playerdata";
        if(!collectionExists(database, collectionName)) {
            database.createCollection("playerdata");
        }

        if (getServer().getPluginManager().getPlugin("Vault") != null)
            economy.register();
        if (getServer().getPluginManager().getPlugin("PlaceholderAPI") != null)
            PlaceHolderAPIHook.registerHook();

        this.configFile = new FileManager(this, "config.yml");
        loadlisteners();
        loadCommands();

    }```
dire marsh
#

spawner update?

#

like a block update?

dire marsh
pure stag
agile hollow
dire marsh
# pure stag yes

maybe something like blockphysicsevent, I'm not too sure, block update api is a mess (this is where I love Sponge's Cause API)

hushed spindle
#

is there some way to force the players attack cooldown to start? trying to make dual wielding a thing but attacking with offhand (uses LivingEntity#attack()) is not starting an attack cooldown and so you can use things like axes without attack cooldown

#

nope

agile hollow
dire marsh
hushed spindle
#

blocks dont have a PersistentDataContainer, all data is lost when placed

#

you can use jeffmedia's block pdc library though and apply pdc to a block anyway

#

but you'd need to place the item as pdc on that block and have it drop it again when broken

#

etc.

dire marsh
undone axleBOT
hushed spindle
#

events like that usually happen before the thing actually happens, thats why they're cancellable

#

so the player will still have the item

dire marsh
agile hollow
hushed spindle
#

also afaik BlockPlaceEvent does have a getItem() method

tall dragon
#

yes

#

ur correct

tall dragon
#

did u just setup the host maybe?

agile hollow
#

it was working like 3h ago

rough drift
#

show more code

#

We can't figure it out from just this

inner mulch
#

what do u need?

rough drift
#

I guess at least the ForwardedRedisPacket class

#

where is the error happening

#

i.e.

#

the stack trace

inner mulch
#

13,9

rough drift
#

show your stack trace

inner mulch
#

in the constructor

#

its while compiling

rough drift
#

top left -> file -> invalidate caches -> invalidate and restart @inner mulch

#

not really

umbral ridge
#

RedisPacket?

inner mulch
umbral ridge
#

what tf is RedisPacket

inner mulch
#

i made my own packet system with redis, to synchronize data across servers

#

no

tall dragon
#

data sent over redis pub/sub

inner mulch
#

yes

inner mulch
rough drift
#

that is why I made you invalidate and restart

#

show the full compilation error

inner mulch
#

its all german

#

but

#

it says it takes no arguments

#

even tho it takes 1

inner mulch
rough drift
#

@inner mulch just send it

#

we are not going to steal anything we really don't care

inner mulch
#

i can send it, but its still in german

#

as i said

rough drift
#

I don't mind

inner mulch
#
[ERROR] /C:/Users/ichma/IdeaProjects/ServerNetwork/ServerNetwork-CorePaper/src/main/java/de/mars/servernetwork/corepaper/friends/commands/user/ForwardedPacket.java:[13,9] Konstruktor ForwardedRedisPacket in Klasse mars.sql.RedisBuilder.ForwardedRedisPacket<P> kann nicht auf die angegebenen Typen angewendet werden.
[ERROR]   Erforderlich: keine Argumente
[ERROR]   Ermittelt:    de.mars.servernetwork.corevelocity.networking.FindPlayerPacket
[ERROR]   Grund: Liste der tatsächlichen Argumente hat eine andere Länge als die der formalen Argumente
[ERROR] 
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException```
rough drift
#

run mvn clean

#

then re-run mvn package

#

or just run mvn clean package

quaint mantle
#

Guys I'm not a yaml expert but essentially it's just a key value map right

#

With lists

rough drift
#

it's slightly more

quaint mantle
#

Ik there's comments

#

But what else

rough drift
#

yaml is like a map of object or map

#

i.e. each value can hold N amount of values

#

not a list

#

example

quaint mantle
#

ok here

rough drift
#
section: # Holds multiple named values
  valueA: A
  valueB: B
  etc: etc
quaint mantle
#

yeah so key value

#

map

rough drift
#

I guess so

#

if a map is a value

quaint mantle
#

mhm

rough drift
#

yaml is key-value if a map is a value

#

I guess so

fluid river
#

How does minecraft sync local coop with mods

rough drift
#

what

#

Ah, local coop you mean LAN?

fluid river
#

Yeah when you just host your world

rough drift
#

A map can be a value

fluid river
#

Without bukkit stuff

quaint mantle
#

and the value can be another map

rough drift
#

it just starts a server @fluid river

quaint mantle
#

or it can be a list of maps

rough drift
#

If you're running fabric it's basically just a fabric server that starts up

fluid river
rough drift
#

It doesn't

#

you need to have the same mods installed

shadow night
#

Sync mods?

rough drift
#

if you're talking about bedrock edition then that's another story

fluid river
#

Yeah i got it but the sync between clients

rough drift
#

No

rough drift
quaint mantle
#

nah lol

#

you're forcing the value to be a map

fluid river
rough drift
#

Map<Object, Object> according to SnakeYAML @quaint mantle

fluid river
#

One player places modded block

shadow night
#

Packets, all packets

fluid river
#

Another player sees that the block is placed and can interact with it

rough drift
#

Yeah it just sends to the server "hey I placed this block with this ID", if the server knows about it cool and sends the change to the other clients

#

it's no different from vanilla blocks

fluid river
rough drift
#

LAN is the same as a normal server

shadow night
#

Most interaction is done client side, the only thing the server knows is when you put shit into slots

rough drift
#

you just don't start a dedicated server

#

you start an integrated server

fluid river
#

So when you start lan server, server is also "modded" then

rough drift
#

yep

fluid river
#

So server knows block id

rough drift
#

yep

shadow night
#

Did you know your client needs to send packets to itself in singleplayer

rough drift
#

Yes

shadow night
fluid river
#

Yeah ig

rough drift
#

A single player world is just a one player server, and when you open to LAN it accepts outside connections

fluid river
#

One guy on Fishnet told me about it

shadow night
#

Registries and init events

fluid river
#

i'm coding a multiplayer moddable game on unity

shadow night
fluid river
#

and so i need a way to make lan coop with mods possible

#

i already made mods working for some scenarios

shadow night
#

Now rewrite the whole game

fluid river
#

but i haven't coded the game itself

#

i just coded the modloader

#

and a test mod

#

which just works on app launch

#

and writes everything to log file

rough drift
#

@fluid river the best way is to assign each mod an ID and a client-side, server-side or both tag, the clients load only with client-side and both, the server loads only with server-side and both, if a client is missing one of the mods tagged as both that the server has then deny the connection

#

i.e.

fluid river
#

yeah true

rough drift
fluid river
#

kinda

rough drift
#

Nope

#

that is a security flaw

shadow night
#

Bugrok editio'

rough drift
#

let the users download manually

shadow night
#

Ye

fluid river
#

so well, what do i actually start with rn

shadow night
#

You can make dynamic mod reloading hopefully

fluid river
#

I have a button "LAUNCH COOP" where you set difficulty and that's all

rough drift
fluid river
#

one minute

rough drift
#

you need to probably provide an API and have something to load and initialize the mods

#

also keep track of them and relevant metadata

inner mulch
#

?paste

undone axleBOT
rough drift
#

what is FindPlayerPacket

inner mulch
#

no casting

#

anywhere

rough drift
fluid river
inner mulch
fluid river
#

or new mob creatures

inner mulch
#

or am i wrong?

fluid river
#

which spawn in zones

rough drift
inner mulch
rough drift
#

Types are only things for the compiler

minor junco
#

Generics are casts, nothing else

rough drift
#

runtime doesn't have them

inner mulch
#

ok so just redispacket<?>

fluid river
#

but i haven't coded the game itself

#

so it's useless

#

it just does nothing

minor junco
rough drift
inner mulch
rough drift
#

How so

inner mulch
#

processData, needs to have the exact packet

rough drift
#

instanceof

inner mulch
#

oh no, but thats ugly

#

casting it every time?

rough drift
#

But this doesn't work

#

it already does cast it

upper hazel
#

what site i need for check remapped values nms

rough drift
#

1s

inner mulch
rough drift
#

seems to work for me

#
public interface Packet<P> {
}
public class PacketA<P extends Packet<P>> implements Packet<P> {
    public PacketA(P packet) {
        System.out.println(packet);
    }
}
public class PacketB implements Packet<PacketB> {
}
#

@inner mulch

inner mulch
#

so it works?

rough drift
#

that works yes

inner mulch
#

so the casting happens somewhere else 😠 but i dont cast anything :(

rough drift
#

@inner mulch stop deleting stuff

#

we won't steal your shit

#

and we can't help you if you keep deleting

inner mulch
#

ok

fluid river
# fluid river for example explosive arrows

so well:

  1. Start Game
  2. Press Multiplayer button
  3. Create new LAN world with difficulty preset
  4. Open the lobby(you get to the "Awaiting players..." screen) -> Here the server should start
  5. Another player presses Multiplayer button
  6. He finds your lobby, clicks join -> Here is where modcheck should happen
  7. If passed, both players are loaded to Intro scene, where they create a character and add a name to it
  8. They just play
rough drift
#

does it happen at compile time or runtime @inner mulch

inner mulch
#

runtime

#

when the command is ran

rough drift
#

send me the error @inner mulch

inner mulch
#

do you wnat it as pasted?

rough drift
#

Ah

minor junco
#

What is your code looking like now?

#

Is it still the same?

inner mulch
#

yes thats the error from befroe

#

nothing changed

fluid river
# rough drift yep

so in case i start a singleplayer, i also start a server(but private for 1 player), right?

rough drift
#

just don't accept outside connections

minor junco
#

Could u start a separate thread for this issue

inner mulch
minor junco
#

There's a lot of writing in this channel

rough drift
fluid river
#

gl cya

echo basalt
#

Hmm having a weird issue rn

#

It seems like registerEvent(Class<?>, Listener, EventPriority ...) doesn't work for PlayerInteractEvent somehow

chrome beacon
#

Show code?

echo basalt
#

The debugs for registering work fine and I never dispose the items or the event bus

upper hazel
#

what the packet i need listen for get olnline count in minecraft menu

#

were located econ

worn totem
#

Is there maybe a plugin that lets u change the entities size like pehkui

hushed spindle
#

there isnt a packet to get the online count it doesnt work like that

hushed spindle
upper hazel
#

then how client get online info lol

rough drift
#

what

#

ah

#

@hushed spindle the server replies with an online counter

hushed spindle
#

but that isnt a packet sent to the player right

rough drift
#

it is

hushed spindle
#

but the player isnt online

rough drift
#

wdym

hushed spindle
#

he means in like the server select menu i think

rough drift
#

@hushed spindle

upper hazel
#

the player does not necessarily need to send the packet

rough drift
#

it returns the players connected to the server

rough drift
#

sent already

#

you can estimate how many people are looking at your server list based on how many IPs ping

upper hazel
#

does it take information from a file?

rough drift
#

nope

next plume
upper hazel
#

what this a packet

rough drift
rough drift
#

i.e. lets you change the data before it is sent to the player

hushed spindle
next plume
#

Maybe he should tell us what he wants to actually do, instead of asking about packets.

hushed spindle
#

attributes are minecrafts way of doing stats

#

so things like attack speed and attack damage are attributes

upper hazel
#

I need to receive an information package
about online players sent to the client.

worn totem
#

oh

next plume
#

Why? What are you trying to accomplish?

upper hazel
#

i need change count

#

not max

hushed spindle
#

so you want to spoof your player count

upper hazel
#

yes

#

not in tab

hushed spindle
#

to increase or what

next plume
#

I sent you a link with the packet.

upper hazel
#

in client menu

upper hazel
next plume
rough drift
#

wait no nvm

#

doesn't let you set

#

so yeah just use protocollib

upper hazel
#

i in 1.20

#

not can

echo basalt
#

TIL that if you have an abstract class that implements Listener, its event handlers wont register

upper hazel
#

thenks

shadow night
#

I swear he has been told the same before

next plume
#

I'm sure there are plugins which already let you spoof the player count, so either use one of them or borrow their code.

hushed spindle
#

are you hoping your server looks more active than it actually is or what

upper hazel
#

bc protocolLib not exists in 1.20

#

they use protocol

hushed spindle
rough drift
hushed spindle
#

super duper popular server

#

but uh anyway, anyone know of a way to get the player to attack something and starting their attack cooldown appropriately

upper hazel
#

this not my server

#

this is an order

hushed spindle
#

using LivingEntity#attack() attacks, but no cooldown

rough drift
#

attackspeed is attacks/s

hushed spindle
#

i know

rough drift
#

1 / attackSpeed to get the cooldown

hushed spindle
#

no i dont need to get the cooldown

#

i need the players cooldown to start

rough drift
#

you need to do it manually

hushed spindle
#

darn

meager wolf
#

Hey, so i want to use a library, but i dont wanna add that extra plugin to my plugins directory, so i want to "include" it in my own project/plugin, how can i do this ?

rough drift
#

is the library a plugin or nah

meager wolf
#

ye its

hushed spindle
dire marsh
meager wolf
hushed spindle
#

yeah and i wanted to see if there was a solution anyway

dire marsh
#

isn't there a resetcooldown

hushed spindle
#

unfortunately not

hushed spindle
#

man

dire marsh
#

just look at the implementation of that and do it manually using reflection or something ig

hushed spindle
#

maybe i can use some nms stuff then

#

yeah

#

well that was easy

#

it doesnt give the player the visual attack cooldown bar but it does seem to work

tender shard
#

lol copilot - why?

#

yeah it kinda became worse

rough drift
#

It's trained on it's shitty outputs

eternal oxide
#

Its seen too much. It's having flash backs

rough drift
#

degenerative AI

tender shard
#

huh why does this happen? I get there could be an ambiguity between Consumer<Item> and Item -> Unit, but why also with the method that doesn't take a Consumer?

#

but it can't be the first one, that'd need 2 parameters and not 3

#

sad

#

is there any better solution than to wrap the dropItem(Naturally) call into a separate function then?

tardy delta
#

also location param was first

tender shard
#

aaay that was the issue lol

#

with the proper order it works kek

#

but wouldn't I then have to duplicate the marked line?

    val dropMethod: (Location, ItemStack, Consumer<Item>) -> Item =
        if (naturally)
            world::dropItemNaturally
        else
            world::dropItem


    val droppedItems = mutableSetOf<Item>()

    for (item in remaining.values) {
        item?.let {
            droppedItems += dropMethod(location, it, consumer) // I#d have to duplicate this line
        }
    }
tardy delta
#
val dropItem = world::dropNaturally if (naturally) else world::dropItem
dropItem(location, item)```
minor jetty
#

My friend told me to not use InventoryHolder to indentify inventories why?

tender shard
#

ofc you can do that

#

you just shouldnt craete your own inventory holders

quiet ice
#

You shouldn't extend bukkit interfaces

minor jetty
#

Why

quiet ice
#

ABI incompatibility

tender shard
minor jetty
#

And what will happen if i do that?

tender shard
#

have you not read it?

minor jetty
tender shard
quiet ice
#

Application binary interface

tender shard
#

there is 0 benefit of using a custom inventoryholder though

#

a better solution is to create a normal data class that hols all the information you need for an inventory, then store it in a Map<Inventory,MyInventoryData> or whatever

minor jetty
#

OMFG

#

Did you just finished Java Online Course and you are speaking?

quiet ice
#

Wha

tender shard
#

no, I never properly learnt java, I'm a lawyer

minor jetty
#

and

tender shard
#

embed fail

quiet ice
quiet ice
minor jetty
#

Simple answear yes/no

quiet ice
#

Yes, but if an interface receives a new method, ABI breaks: This error at link time (runtime in the case of JVM languages)

tender shard
#

bukkit api doesn't guarantee that the methods etc of the InventoryHolder interface change in the future. Hence your stuff would become incompatible if bukkit changes that interface. it doesn't even guarantee that it will stay to be an interface, it might be an abstract class in the next updatre

quiet ice
tender shard
#

but it could

quiet ice
#

As invokevirtual and invokeitf are two different opcodes

quiet ice
#

Like yes you could migrate the relevant invokeitf instructions to invokevirt - but why?

minor jetty
quiet ice
#

Why is that stupid?

#

Do you go around breaking userspace in your free time?

minor jetty
quaint mantle
#

can you advise me a server selector plugin? whitout bungeecord

quiet ice
#

If you are fine with the above - fine by me, but that is like breaking userspace

minor jetty
#

And then you check inventory by title

#

Like Vulcan did

quiet ice
#

If you stay on 1.8 and maintain your own spigot fork: why the hell did you ask?

#

1.8 is a whole different world: everything goes

minor jetty
#

How do you know that i maintain my spigot fork? I never said so

quiet ice
#

Well unless you are using abandonware (or simply never updating your software, which has the same effect) the only way to ensure the ABI never breaks is to maintain said ABI

minor jetty
#

🤣 🤣 🤣 🤣 🤣 🤣 🤣 🤣

quiet ice
#

Look I am an API designer, I know this shit better than you do

minor jetty
#

And if i am not mistaken while you are API designer you know when InventoryHolder will receive new method?

#

Or you can avoid giving InventoryHolder new method

#

And leave open gate to the deveopers leaving them a easy way to check for inventories

quiet ice
#

Not if you are reliant on others

#

And if you don't develop some software you are reliant on some aoftware

minor jetty
#

What the fuck

quaint mantle
#

can you advise me a server selector plugin? with bungeecord even for a fee it's fine

minor jetty
#

@worldly ingot do you in hypixel implement InventoryHolder? You i mean whole development team

young knoll
#

Hypixel actually checks inventories by name

proud badge
#

Is it better to try and put as many features as possible in 1 plugin, or spread it around?

minor jetty
proud badge
#

I think its best to check inventories by PDC

#

Though I never do that because too lazy

shadow night
proud badge
#

My server barely has any inventories either way, and I check for if player has permission on InventoryClickEvent

shadow night
proud badge
#

Cant you apply PDC to an Inventory?

#

Pretty sure you can

shadow night
young knoll
#

No

shadow night
proud badge
#

Ok I guess I was wrong

#

How should one check for inventories then

young knoll
#

By the inventory instance

shadow night
#

A list (or something) with all currently open invs of a type ig

minor jetty
#

Implement InventoryHolder and hope for gual to not add method to this interface

shadow night
minor jetty
#

But if you are making for 1.19 and less just implement it XD

young knoll
#

Do not do that

#

I will personally come smack you

shadow night
minor jetty
#

if you are scared of implementing inventory holder just do something like PlayerAction and make InventoryAction and save it in user

minor jetty
worldly ingot
#

Most people on the team understand why that's a bad idea

#

That too

minor jetty
shadow night
worldly ingot
#

Yeah sure lemme just violate my NDA for you KEKW

eternal night
#

😏

#

storing an inventory instance surely is rough NODDERS

minor jetty
worldly ingot
#

Yeah I mean just from experience, all you really need to do is keep reference to an InventoryView

shadow night
young knoll
#

Yeah can you just send me the entire codebase

#

I won't leak it I promise

minor jetty
shadow night
minor jetty
#

Nothing wrong with that i can do that

#

The other thing is that you need skill to implement that

#

Of course i can not say everything

#

But i could save how we manage inventories

#

Didn't know hypixel have that strict NDA

worldly ingot
#

One of the main stipulations in an NDA is to keep trade secrets lol

young knoll
#

The secret is the spaghetti

inner mulch
#

inventory.getTitle().equals("title")

minor jetty
topaz cape
young knoll
#

Don't worry that could never cause any exploits

#

👀

shadow night
topaz cape
worldly ingot
#

But really, if you want to create a GUI, it comes down to this:

// Somewhere, store this in a map
InventoryView view = player.openInventory(inventory);
theMap.put(view, new MyGuiClassThing());

// In a listener
@EventHandler
private void onClick(InventoryClickEvent event) {
    MyGuiClassThing gui = theMap.get(event.getView());
    if (gui != null) {
        // You have your player's GUI view thing, yeah, do your thing
    }
}
shadow night
inner mulch
worldly ingot
#

No, this isn't Hypixel code, this is just how I would do GUIs personally

young knoll
#

@Simon !!!1111

shadow night
#

Lol

topaz cape
#

@hypixelbigman

minor jetty
#

Or am i solo

worldly ingot
#

No probably not lol

#

It's generally understood as not a good idea to implement Bukkit interfaces

inner mulch
#

implements Listener :(

minor jetty
#

Okay thanks

#

Cya

shadow night
young knoll
#

Nope still not allowed

#

Don't question it

proud badge
#

which one should I do

ivory sleet
#

what does data functions do?

grave ridge
#

Hi I am looking for plugin that with commands turn on and off pvp and nothing else do someone know something?

proud badge
#

CRUD

proud badge
ivory sleet
#

in general I think its more reasonable, and often necessary to have the initialization part inside onEnable, primarily since ur classes usually demand a fixed order in how they're created

proud badge
#

ok 33 ill do that

shadow night
#

No need to post that everywhere

hazy parrot
#

"scared of implementing" KEKW

quaint mantle
#

Imposter syndrome

minor junco
# minor jetty Then do you check it by names?

At least how most applications handle it is by keeping a reference to the inventory itself or it's content. My GUI library for example handles it that way. When interacting you just use referential equality and you're set

river oracle
inner mulch
minor junco
#

😵🤢

#

Exactly. Just use uuid as titles

#

¯_(ツ)_/¯

shadow night
#

Lmao

river oracle
#

10,000,000,000,000,000 IQ

minor junco
icy beacon
#

Because when a new one appears, someone makes a new video on it

#

And then I can have lunch while watching it

minor junco
icy beacon
#

What

#

Lmao

#

Woke AI

river oracle
#

no u

#

how the fuck is Files#create throwing a NoSuchFileException>???

#

yeah no shit it doesn't exist lmao

#
    private fun replaceFileContent(originalFile: Path, file: Path, replacements: Map<String, String>) {
        var content = originalFile.readText()
        replacements.forEach { (key, value) ->
            content = content.replace(key, value)
        }
        if (Files.notExists(file)) {
            Files.createFile(file)
        }
        file.writeText(content)
    }```
#
Caused by: java.nio.file.NoSuchFileException: spigot-v1_20_R2/src/main/java/sh/miles/pineapple/nms/impl/v1_20_R2/inventory/scene/PineappleSceneFactory.java
        at PineappleNMS.replaceFileContent(PineappleNMS.kt:78)
#

line 78?? Files.createFile(file)

tame wolf
#

You're just not creating it good enough

river oracle
#

smh I did a fail

#

no

#

the path doesn't exist smh

#

I supplied a bogus absolute path

shadow night
river oracle
#

fr

inner mulch
#

How would I create a HashMap<>() that returns something, based on if .get() is invoked with 1 item that is present in the keys Set()?

river oracle
#

what are you trying to do

inner mulch
#

Im creating a event system for my packet system, and i allow that every listener can subscribe to as many topics as he'd like (topic = different packet channel) and when a topic is called that has been subscribed to, then the listener should be called.

#

So Im storing every listener in hashmap, that has a set of topics as key.

river oracle
#

so why can't you just run something like

private val EMPTY_SET = Set.of()
private val map = HashMap<Class<TopicThingy>, Set<Things>>

fun callOrWhatever(topic: Class<? extends TopicThingy) {
  map.getOrDefault(topic, EMPTY_SET).forEach { value ->
    value.execute()
  }
}

// ORRR

fun getCallers(topic: Class<? extends TopicThingy>) : Set<Things> {
  return map.getOrDefault(topic, EMPTY_SET);
}
#

ofc this is simplified and excludes any objects you need to insert, but what stops you from doing something like above

inner mulch
#

thank you for helping, but i think i found a different solution, i will just register the listener for each topic, instead of trying to create a set of topics

eternal night
inner mulch
#

its probably the easiest way

inner mulch
#

:(

eternal night
#

listener for each topic ?

inner mulch
#

topic = packet channel

#

packet channel = different server sending packets