#help-development

1 messages ยท Page 1281 of 1

mortal hare
#

sounds like a dumb idea but tempting to know ๐Ÿ˜„

sly topaz
#

it wouldn't be particularly hard

#

there's already fabric layers for it, and there's probably some fabric loader for minestom out there

mortal hare
#

bukkit api on minestom idea sounds like Wine on linux ๐Ÿ˜„

#

i mean it can allow you to execute bukkit plugins on non NMS servers, albeit if plugin doesnt use NMS

flat lark
#

Lemme see if my intelji needs updating or something

mortal hare
flat lark
#

HashMap

mortal hare
#

give me a complete type

#

with generics

#

?

#

is it HashMap<UUID, Consumer<String>> or something else?

flat lark
#


private Map<UUID, Conversation> awaitingInput = new HashMap<>();
mortal hare
#

and conversation is?

#

is it bukkit api Conversation type?

flat lark
#
package com.lewdmc.util;

public class Conversation
{
    private final ValueType type;
    private Object value;

    public Conversation(ValueType type) {
        this.type = type;
    }

    public void setValue(Object value) {
        this.value = value;
    }

    public Object getValue() {
        return value;
    }

    public ValueType getType() {
        return type;
    }
}

mortal hare
#

oh

flat lark
#

Yeah lmao

mortal hare
#

so you're passing a lambda function into conversation type value. that obviously doesnt work since <function lambda> != Conversation

#

do you want to compute value from lambda and then put into map

#

?

#

i dont get it

flat lark
#

So, where I was going with this Is I want a certain value back. Like String, Int or something else if I need it.

#

That's what my orginal code was using it for.

#

I could just remove that since I could use the param function to parse the value when its callback.

sly topaz
#

oh, I forgot to write out that part since I thought it'd be self-explanatory

#

you'd have to change the awaitingInput map from <UUID, Conversation> to <UUID, Consumer<String>>

flat lark
#

Just did it

buoyant viper
flat lark
#

what is manager suppose to be defined as?

sly topaz
#

whatever class your awaitingInput map is in

flat lark
#

Just had one more question how could I use a timeout (Bukkit Scheduler) function for this as it seems it keeps waiting for a valid input

chilly oriole
#

i wna join a bot in minecraft server from bothosting website can anyone gimme its codings

sly topaz
#

it has a composable version of the conversation method using completable futures which allow you to chain conversation inputs as well as some built in parsers to avoid some boilerplate

mortal hare
#

why does EssentialsX use separate file for storing locale information if it doesnt allow you to change the locale dynamically in the server

#

i mean what's even the point of that

sly topaz
#

I didn't test it so it probably has some issues, but you can base your thing off of it

#

I also made the examples with AI so they may also be wrong lol

flat lark
#

I don't like addtional clutter as I already have like 30 files lmao mainly GUIs and database classes and already have like 5 dependicies using for advancements, ui, etc.

sly topaz
#

that is fine too, you can just take it as reference

#

as you can see, you can infinitely scale this kind of thing lol

#

my next step would be to make composable parsers as well as introducing context objects

#

though, you shouldn't really worry about having too many files in Java

#

Java is very file-based when it comes to organization, so you'll see a lot of projects with classes on the hundreds even if they're relatively simple

#

on one hand it is Java being verbose enough to need multiple files and the other just being that enterprise standards leak into normal code

flat lark
#
    public <T> void createConversation(
            Player player,
            String question,
            Function<String, T> parser,
            Consumer<T> action
    ) {
        UUID uuid = player.getUniqueId();

        if (awaitingInput.containsKey(uuid)) {
            awaitingInput.remove(uuid);
            player.sendMessage(ChatColor.RED + "You had an unfinished input, it has been cancelled.");
        }

        player.sendMessage(ChatColor.WHITE + question);

        awaitingInput.put(uuid, input -> {
            try {
                T value = parser.apply(input);
                action.accept(value);
            } catch (Exception e) {
                player.sendMessage(ChatColor.RED + "Invalid input. Please try again.");
            } finally {
                awaitingInput.remove(uuid);
            }
        });

        Bukkit.getScheduler().runTaskLater(plugin, () -> {
            if (awaitingInput.containsKey(uuid)) {
                awaitingInput.remove(uuid);
                player.sendMessage(ChatColor.RED + "Input timed out.");
            }
        }, 15 * 20);
    }
#

This should be fine with the scheduler at the end?

sly topaz
#

looks fine to me

flat lark
# sly topaz looks fine to me
createConversation(
    player,
    "Enter a number:",
    Integer::parseInt,
    number -> {
        player.sendMessage("You entered: " + number);
    }
);

You showed this earlier but I want to set the value to an actual int It seems I can't do that in Consumer

sly flint
#

?paste

undone axleBOT
sly topaz
#

if you mean that you want an int and not the boxed class Integer, just do intValue on it

flat lark
#

like setting my values not the callback values


int myValue = 0

number -> {
   myValue = number
}
sly topaz
#

I am still not sure what you mean by that

#

ah, you mean you want access to the value outside of the lambda

flat lark
#

yes.

#

Sorry, mind is going brrrr rn

sly topaz
#

Java doesn't allow to do that directly, but you can do it if you wrap it around a class or an array:

int[] returnedValue = new int[1];
...
number -> {
  returnedValue[0] = number;
}
flat lark
#

Or is there a better way to returning just the value

#

like removing the consumer itself?

sly topaz
#

you could use a Function instead and make the return value of the method the returned value of the action

buoyant viper
chrome beacon
#

Wouldn't the code inside of the lambda run after the code outside of it

#

So grabbing it outside would be pointless?

buoyant viper
#

time to make it blocking IO

#

realized my issue

#

i was trying to configure application when i needed to configure tasks.run

sly topaz
#

@flat lark you're just meant to do everything you have to do in the action inside the Consumer object

#

but remember that Consumer is just a wrapper around a function, you could pass outside values into it

buoyant viper
#

haha callbacks go brrrrrr

slender elbow
#

callbacks? seriously? i get anxious enough when my phone rings and you expect me to call back now?

young knoll
#

I donโ€™t have a landline

sly topaz
#

the amount of code gemini can generate mind-boggles me

young knoll
#

Stop encouraging them to take our jobs!

sly topaz
#

of course, I haven't tried it myself so it is all for naught probably when I would actually put it to production use, however it really serves as a starting point if you don't feel like scaffolding all of this out

#

really tempts me to get a Cursor setup running

#

the start was more testing the AI whether it could recognize the reason SimpleFuture was more or less a dumb idea

#

I tried to nudge it into believing it is good even, but it still went with its guts, which is surprising to me since I am used to these models just going to extreme lengths to satisfy my wack prompting

sly topaz
#

I just can't be bothered to work on something after a few weeks when it comes to projects I start on a whim, but if I can just proompt away my problems with architecturing stuff out, then it might just be possible even if it might not be up to my standards of quality

#

then again, I would still just break even considering I'd have to spend actual money to use AI for actual production, so any money I'd get from these projects would just be for paying these services lmao

buoyant viper
paper viper
#

of course it does, ticks is not hard at all

nova notch
#

of course there's still the occasional schizophrenia but they're getting pretty damn good

ivory sleet
#

completely depends

#

in the aspect of being explicitly solution oriented, they tend to do quite well

tender shard
#

I hate gitlab-ci files

sly topaz
flat lark
#
    @EventHandler
    public void onPlayerChat(AsyncPlayerChatEvent event) {
        var player = event.getPlayer();
        var uuid = player.getUniqueId();

        var callback = awaitingInput.get(uuid);

        if (callback != null) {
            event.setCancelled(true);

            Bukkit.getScheduler().runTask(plugin, () -> callback.accept(event.getMessage()));
        }
    }
sly topaz
#

doesn't look like anything is wrong there, is the event handler being registered properly? Can you put a println on the top to check?

flat lark
tender shard
tender shard
flat lark
tender shard
#

I don't think the async chat event is meant to be blocked like that "forever"

#

why can't you cancel the event right away?

#

Look at the conversation API I linked above, it's exactly what you want to do

ivory sleet
#

I mean at least they wna revoke the mapping on callback- id guess at least?

clever zephyr
#

but ye it can be abstracted into a way better design

ripe falcon
chrome beacon
rough drift
undone axleBOT
ripe falcon
mortal hare
#

how do you guys organize classes in projects?

#

just curious

drowsy helm
mortal hare
#

underscores in class names

#

how dare you

wet breach
lethal kindle
#

Hello, i want to animate a block display entity from scale of 0 to 1 block size in 5 seconds

idk why this isn't working

                        BlockDisplay blockDisplay = (BlockDisplay) getWorld().spawnEntity(location, EntityType.BLOCK_DISPLAY);

                        Transformation transform = blockDisplay.getTransformation();
                        transform.getScale().set(1, 1, 1);
                        transform.getTranslation().set(-0.5, -0.5, -0.5);

                        blockDisplay.setBlock(Material.LIGHT_GRAY_WOOL.createBlockData());
                        blockDisplay.setInterpolationDuration(20 * 5);
                        blockDisplay.setTransformation(transform);
#

paper btw

wet breach
#

sometimes, I have stuff that just doesn't fit anywhere and I generally just toss those into either a util package or misc package

young knoll
#

You can't interpolate right when it spawns

#

Because idk that game just works like that

lethal kindle
#

oh

#

so what do i do?

young knoll
#

Wait a tick

chrome beacon
#

Also use the spawn method that takes a consumer

lethal kindle
#

what is the most efficient way to wait 1 tick

chrome beacon
#

so you spawn it with the right data

lethal kindle
#

Bucket scheduler thing?

chrome beacon
#

instead of spawning then modifying

chrome beacon
young knoll
#

?scheduling

undone axleBOT
lethal kindle
#

oh it's a command i thought you were asking me

#

ty btw

#
                        BlockDisplay blockDisplay = (BlockDisplay) getWorld().spawnEntity(location, EntityType.BLOCK_DISPLAY);

                        Transformation transform = blockDisplay.getTransformation();
                        transform.getScale().set(0, 0, 0);
                        transform.getTranslation().set(-0.5, -0.5, -0.5);

                        blockDisplay.setBlock(Material.LIGHT_GRAY_WOOL.createBlockData());
                        blockDisplay.setInterpolationDuration(20 * 5);
                        blockDisplay.setTransformation(transform);

                        new BukkitRunnable() {
                            @Override
                            public void run() {
                                Transformation transf = blockDisplay.getTransformation();
                                transf.getScale().set(1, 1, 1);

                                blockDisplay.setTransformation(transf);
                            }
                        };

so something like this would work?

lethal kindle
#

it didn't work, and i tried doing this:

                        BlockDisplay blockDisplay = (BlockDisplay) getWorld().spawnEntity(location, EntityType.BLOCK_DISPLAY);

                        Transformation transform = new Transformation();
                        transform.getScale().set(1, 1, 1);
                        transform.getTranslation().set(-0.5, -0.5, -0.5);

                        blockDisplay.setBlock(Material.LIGHT_GRAY_WOOL.createBlockData());
                        blockDisplay.setTransformation(transform);

                        new BukkitRunnable() {
                            @Override
                            public void run() {
                                Transformation transform = blockDisplay.getTransformation();
                                transform.getScale().set(1, 1, 1);
                                transform.getTranslation().set(-0.5, -0.5, -0.5);

                                blockDisplay.setInterpolationDuration(20 * 5);
                                blockDisplay.setTransformation(transform);
                            }
                        }.runTaskLater(plugin, 1L);

it's still just instantly going from 0 to 1, i need a smooth interpolation

worthy yarrow
#

Use the consumer method bukkit provides so you create and modify the display before itโ€™s spawned, then it should be smooth

#
ItemDisplay itemDisplay = world.spawn(throwLoc, ItemDisplay.class, display -> {
            display.setItemStack(new ItemStack(Material.POPPED_CHORUS_FRUIT));
            ItemMeta displayMeta = display.getItemStack().getItemMeta();

            displayMeta.setCustomModelData(1);
            display.getItemStack().setItemMeta(displayMeta);

            display.setBillboard(Display.Billboard.CENTER);
            display.setCustomName(ChatColor.translateAlternateColorCodes('&', this.getName()));
            display.setCustomNameVisible(true);
        });```
#

Also, you don't have to write the transformation bit twice, just once inside the loop and I believe that will work
@lethal kindle

worthy yarrow
young knoll
#

5 seconds is plenty of time

worthy yarrow
#

Well itโ€™d make it smoother

young knoll
#

Let's worry about having it work first

worthy yarrow
#

Psh if it doesnโ€™t then skill issue

#

Iโ€™m no expert on the display api but Iโ€™m pretty sure what he sent should work technically

brazen wing
#

Can someone help me make a smp server with mod or plugin? I want to play a private smp with my friend but donโ€™t know how to make a good one

#

For free :>

eternal oxide
#

Sure I'll do it fo fee. It will cost you $1000 per day

brazen wing
#

Ayo chill

#

Free man

eternal oxide
#

yep fee

brazen wing
#

Bro I said free not fee

eternal oxide
#

yep I saw fee

brazen wing
#

Da hail

eternal oxide
#

๐Ÿ™‚

brazen wing
#

๐Ÿ˜ฆ

eternal oxide
#

unlikely anyone will actually do it for free though. Youd best setup a pre-built modded (using a launcher, or setup a basic spigot server if its close friends you can trust

brazen wing
#

There are free server set ups?

eternal oxide
#

for modded yes

brazen wing
#

Where can I find it

eternal oxide
#

I haven't done it in years but I remember the moded launcher had a download for server files

young knoll
#

Depends on the modpack

#

But yeah you can get them on curseforge

#

For example

eternal oxide
#

FTB launcher

#

has a download server button

#

literally pick the pack you want and download the server files, then run it

young knoll
#

I think that screenshot might be older than them

eternal oxide
#

My PC might be. I just took the screen shot

young knoll
#

Oof

#

That's the legacy ftb launcher then

eternal oxide
#

maybe?!

young knoll
#

Curseforge launcher also has a download server button

#

Idk about the modern FTB launcher but it doesn't have that many packs last I checked

eternal oxide
#

yeah this looks like it only has old packs

#

show how long since I played modded

young knoll
#

FTB moved their packs to curseforge, but they didn't like curseforge so they remade their launcher

#

But then I guess they weren't getting any downloads because now they are on curseforge again

wet breach
eternal oxide
#

yeah I stopped using curse when they decided to insert adverts but no profit share

brazen wing
#

Thanks guys

#

Any recommended server hosting free?

lethal kindle
#

YES it works now

#

ty guys โค๏ธ

btw here is the code that worked:

                        BlockDisplay blockDisplay = getWorld().spawn(location, BlockDisplay.class, entity -> {
                            entity.setBlock(Material.LIGHT_GRAY_WOOL.createBlockData());
                            entity.setInterpolationDuration(20 * 5);
                            entity.setInterpolationDelay(-1);

                            Transformation transform = entity.getTransformation();
                            transform.getScale().set(0, 0, 0);
                            transform.getTranslation().set(-0.5, -0.5, -0.5);

                            entity.setTransformation(transform);
                        });

                        new BukkitRunnable() {

                            @Override
                            public void run() {
                                Transformation transform = blockDisplay.getTransformation();
                                transform.getScale().set(1, 1, 1);

                                blockDisplay.setTransformation(transform);
                            }
                        }.runTaskLater(plugin, 1L);

#

ik i made two variables for transformation but just for testing

#

i know that there is a better way but couldn't think of it rn

mellow edge
#

Hello, I noticed that ItemStack#getItemMeta is annotated as nullable, I never saw it being null, when could that be the case except by setting it to null manually maybe?

young knoll
#

Air

mellow edge
#

Ok, thanks!

sly topaz
#

on paper it is annotated as UndefinedNullability because of that lmao

autumn flare
#

Do you know how to do it, like for example I log in for the first time and I stay in survival and I log out and then instead of taking me to the lobby it takes me to survival, do you know how to fix it?

#

It is with the JPREMIUM plugin

somber scarab
#

we only help people who make their own plugins

autumn flare
thorn isle
#

capitalism

summer scroll
grand flint
#

He wants the persons server to save

summer scroll
mortal hare
#

he wants session based server switching, a.k.a when player joins a specific server, the server selection gets persisted somewhere and when he rejoins it puts him back to the same server instead of lobby

#

good idea actually i might steal that for my own limbo server dedicated for authenticating people lol

#

im wondering.. does gradle shadow plugin does some kind of treeshaking in order to remove unused class dependencies from uber jar?

grand flint
#

๐Ÿ’€

sly topaz
#

that's what minification is for

#

however people don't usually do minification since it is annoying to configure in some cases where your dependencies are reflectively depending on some classes

#

you can try adding minimize() to your shadowJar task configuration right now and see if anything breaks, if it doesn't then good, if it does then you got to check which classes error out and include them manually

#

this comes back to runtime dependency resolution and why it is bad, it doesn't allow safely excluding "unncessary" dependencies

summer scroll
mortal hare
# sly topaz not by default

this should work for utility functions and classes tho just fine, the problem is with jdbc drivers and such which use native java methods through JNI

sly topaz
#

jdbc drivers are easy because most people who are using them and are trying to minify their jars probably already have a minification configuration out there you can take

#

just gotta look for the right terms on github

#

or if you're too lazy to figure it out then just exclude the whole jbdc driver from minification and you're good

#

usually a good idea anyway, some jbdc drivers like the sqlite one do wacky shit

slender elbow
#

most jdbc drivers I've used don't make use of natives

#

sqlite is the only one that comes to mind

sly topaz
#

I say all of them as if there were many, I think there is an db2 driver that is still type 2 but other than that, I don't believe there are many anymore

#

and people discourage type 1 drivers nowadays

slender elbow
#

wtf is a type 1 and 2 driver

#

oh, odbc

#

i feel old

sly topaz
#

A JDBC driver is a software component enabling a Java application to interact with a database. JDBC drivers are analogous to ODBC drivers, ADO.NET data providers, and OLE DB providers.
To connect with individual databases, JDBC (the Java Database Connectivity API) requires drivers for each database. The JDBC driver gives out the connection to th...

#

the only place that still has some documentation on what type 1, 2, 3 and 4 drivers were is now Wikipedia, the oracle page about it vanished with time lol

mortal hare
#

its been two months and i still dont seem find a way to implement rich domain models which do not use ORM's which bloat sql queries with useless update data

#

lets say i have

class User {
  private final Email email;  
  ...
  
  public void changeEmail(Email email) { .. }
}

how would you persist only the change of email without trying to persist the whole entity (User), that would require to track changes somehow, or use some kind of service class which orchestrates persistence

wise mesa
#

is there a way to make it not run clean every time i package craftbukkit so i can test faster

#

also getting this error when I try to run the built craftbukkit
Error: Unable to initialize main class org.bukkit.craftbukkit.Main
Caused by: java.lang.NoClassDefFoundError: joptsimple/OptionException

#

do i need to run the bootstrap jar instead?

#

yes i do

lean pumice
#

i am doing a taser plugin, but i found an incompatibility that if i taser the player, it will no take damage if essential plugin is enabled, some of u know why? if i create a listener that listen EntityDamageByEntityEvent and send the damage direct to the player with player#damage it work. how i can fix this? I don't understand the connection between my plugin and the essential one

#

((the event is not cancelled))

chrome beacon
#

Are you teleporting the player

lean pumice
lean pumice
chrome beacon
#

The essentials plugin will apply damage protection for players that you teleport

chrome beacon
#

You can just disable the teleport invulnerability in the essentials config

lean pumice
lean pumice
chrome beacon
#

Forcibly removing all listeners is a much worse idea

lean pumice
lean pumice
#

it can be?

lean pumice
rotund ravine
#

U just said u did tho

mellow edge
#

Hi,
this is of course for the legacy versions, but behind the scenes this maybe still applies. Does CraftItemStack#asBukkitCopy also copy user-defined NBTCompound data already applied on the nms stack? Some forum posts say no, some yes...

thorn isle
#

try it and see

flat lark
#

So I am using a datapack to create my enchantments and wanted to do the coding in spigot. How could I detect the enchantment data on the item when interacting with a datapack?

mellow edge
slender elbow
#

you can get the Enchantment from the Registry.ENCHANTMENT by its key, then get the level with ItemMeta#getEnchantLevel(Enchantment)

flat lark
young knoll
#

Yes

slender elbow
#

They asked me, not you

young knoll
#

You wanna fight >:(

slender elbow
#

give me your worst

#

(cat pics)

waxen anchor
#

Where can I find the source code of spigot?

slender elbow
#

?stash

undone axleBOT
slender elbow
#

if you wanna have it in a nicer readable format you can just run buildtools

waxen anchor
#

please help

aSofian@H3R MINGW64 ~/Desktop/SPIGOTYARDIMI/spigot (version/1.8.8) $ ./applyPatches.sh Rebuilding Forked projects.... ./applyPatches.sh: line 40: cd: ../Bukkit: No such file or directory ./applyPatches.sh: line 11: cd: /c/Users/aSofian/Desktop/SPIGOTYARDIMI/spigot/Bukkit: No such file or directory fatal: ambiguous argument 'origin/spigot': unknown revision or path not in the w orking tree. Use '--' to separate paths from revisions, like this: 'git <command> [<revision>...] -- [<file>...]' fatal: repository 'Bukkit' does not exist ./applyPatches.sh: line 20: cd: /c/Users/aSofian/Desktop/SPIGOTYARDIMI/spigot/Spigot-API: No such file or directory Resetting Spigot-API to Bukkit... error: No such remote: 'upstream' fatal: ambiguous argument 'upstream/upstream': unknown revision or path not in t he working tree. Use '--' to separate paths from revisions, like this: 'git <command> [<revision>...] -- [<file>...]' Applying patches to Spigot-API... fatal: Resolve operation not in progress, we are not resuming. Applying: POM Changes error: sha1 information is lacking or useless (checkstyle.xml). error: could not build fake ancestor Patch failed at 0001 POM Changes hint: Use 'git am --show-current-patch=diff' to see the failed patch hint: When you have resolved this problem, run "git am --continue". hint: If you prefer to skip this patch, run "git am --skip" instead. hint: To restore the original branch and stop patching, run "git am --abort". hint: Disable this message with "git config advice.mergeConflict false" Something did not apply cleanly to Spigot-API. Please review above details and finish the apply then save the changes with rebuildPatches.sh

chrome beacon
waxen anchor
#

aSofian@H3R MINGW64 ~/Desktop/qwdqwdwqdwqdwq/Spigot (master)
$ ls
LICENCE.txt README.md pom.xml src/

aSofian@H3R

chrome beacon
#

yeah what about it

waxen anchor
#

Why Spigot-Server folder is not created

chrome beacon
#

probably because BuildTools didn't finish running

waxen anchor
#

How can I edit the HandshakeListener.java file and turn it into a spigot again?

chrome beacon
#

?xy

undone axleBOT
chrome beacon
#

What are you trying to do and why

waxen anchor
# chrome beacon probably because BuildTools didn't finish running

Exception in thread "main" java.lang.RuntimeException: Error patching Block.java
at org.spigotmc.builder.Builder.lambda$startBuilder$2(Builder.java:617)
at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(Unknown Source)
at java.util.stream.ReferencePipeline$2$1.accept(Unknown Source)
at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)
at java.util.Iterator.forEachRemaining(Unknown Source)
at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Unknown Source)
at java.util.stream.AbstractPipeline.copyInto(Unknown Source)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(Unknown Source)
at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(Unknown Source)
at java.util.stream.AbstractPipeline.evaluate(Unknown Source)
at java.util.stream.ReferencePipeline.forEach(Unknown Source)
at org.spigotmc.builder.Builder.startBuilder(Builder.java:568)
at org.spigotmc.builder.Bootstrap.main(Bootstrap.java:60)
Caused by: difflib.PatchFailedException: Incorrect Chunk: the chunk content doesn't match the target
at difflib.Chunk.verify(Chunk.java:86)
at difflib.ChangeDelta.verify(ChangeDelta.java:78)

waxen anchor
#

example bungeecord comamnd:

package net.md_5.bungee.protocol.packet;

import io.netty.buffer.ByteBuf;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import net.md_5.bungee.protocol.AbstractPacketHandler;
import net.md_5.bungee.protocol.DefinedPacket;

@Data
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = false)
public class Handshake extends DefinedPacket
{

    private int protocolVersion;
    private String host;
    private int port;
    private int requestedProtocol;
    private String authKey;

    @Override
    public void read(ByteBuf buf)
    {
        protocolVersion = readVarInt( buf );
        host = readString( buf, 255 );
        port = buf.readUnsignedShort();
        requestedProtocol = readVarInt( buf );

        if (buf.isReadable()) {
            authKey = readString(buf);
        } else {
            authKey = null;
        }
    }

    @Override
    public void write(ByteBuf buf)
    {
        writeVarInt( protocolVersion, buf );
        writeString( host, buf );
        buf.writeShort( port );
        writeVarInt( requestedProtocol, buf );

        if (authKey != null) {
            writeString(authKey, buf);
        }
    }

    @Override
    public void handle(AbstractPacketHandler handler) throws Exception
    {
        handler.handle( this );
    }

    public String getAuthKey() {
        return authKey;
    }
}
chrome beacon
#

Use the plugin messaging channel

#

It's made for that purpose

young knoll
#

Why are you sending a custom packet vs a CustomPayload packet

chrome beacon
#

^^

young knoll
#

(Which is what plugin messaging is)

waxen anchor
waxen anchor
#

Since I couldn't find any resources, this is what chatgpt suggested :(

chrome beacon
#

..

waxen anchor
#

inetaddress = InetAddress.getByName(ip);
GuiConnecting.this.networkManager = NetworkManager.func_181124_a(inetaddress, port, GuiConnecting.this.mc.gameSettings.func_181148_f());
GuiConnecting.this.networkManager.setNetHandler(new NetHandlerLoginClient(GuiConnecting.this.networkManager, GuiConnecting.this.mc, GuiConnecting.this.previousGuiScreen));
GuiConnecting.this.networkManager.sendPacket(new C00Handshake(47, ip, port, EnumConnectionState.LOGIN, "PASSWORD"));
GuiConnecting.this.networkManager.sendPacket(new C00PacketLoginStart(GuiConnecting.this.mc.getSession().getProfile()));

What should I write here?

graceful patrol
#

Hello, I'm trying to send a message to my spigot server, the channel should be fine, this is the code (im fairly new to bungee, sorry if the code is trash ๐Ÿ˜„);

Bungee side:

    ```getProxy().registerChannel("staff:vanish");

    getLogger().log(Level.INFO, "Staff ยงaEnabled");
}

@Override
public void onDisable() {
    getProxy().unregisterChannel("staff:vanish");
    getLogger().info("Staff Disabled");
}```

Spigot Side:

    public void onPluginMessageReceived(String channel, Player receiver, byte[] message) {

        try {
            DataInputStream in = new DataInputStream(new ByteArrayInputStream(message));
            String subchannel = in.readUTF();
            if (subchannel.equals("VANISH")) {
                String action = in.readUTF();
                String playerName = in.readUTF();

                Player player = Bukkit.getPlayerExact(playerName);
                if (player == null) return;

                getLogger().info("Received plugin message: " + subchannel + " - " + action + " for " + playerName);

                if (action.equalsIgnoreCase("on")) {
                    plugin.getVanishManager().vanish(player);
                } else if (action.equalsIgnoreCase("off")) {
                    plugin.getVanishManager().unvanish(player);
                }
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}```
chrome beacon
#

Could you show us how you send the message

graceful patrol
chrome beacon
#

yeah that's not going to work

#

I suggest you take a look

graceful patrol
#

okok, thank you very much! ๐Ÿ˜„
I tried to even put it in chatgpt, didnt help at all ๐Ÿ’€

thorn isle
#

google search is often more useful than chatgpt

chrome beacon
#

it's a dying skill sadly

graceful patrol
chrome beacon
undone yarrow
#

Hi, I was wondering if anyone here knew whether snowball projectiles (and egg projectiles) get knocked back by tnt explosions or not. I made this little plugin that would shoot a bunch of explosive snowballs with a block display. The issue is, sometimes these snowballs mysteriously bounce back or ricochet and land somewhere else. I have no idea what can be causing this...

#

I thought it would be the explosions but I can't seem to replicate the issue with normal tnt and snowballs/eggs

chrome beacon
#

explosions do launch projectiles

#

that's how enderpearl cannons work

undone yarrow
#

๐Ÿฅฒ Is there a way to disable that knockback?

#

(please don't say no)

chrome beacon
#

Probably

undone yarrow
#

I wasnt able to find anything on disabling projectile knockback

slender elbow
#

what if I say no?

undone yarrow
#

I get sad

slender elbow
#

will you go on a puppy killing spree?

#

oh okay

#

idk tbh

thorn isle
#

i can do that

undone yarrow
#

? How?

thorn isle
#

with great prejudice

chrome beacon
thorn isle
#

and connections to local kennels

#

i'm not sure if that applies here but it's worth a shot

buoyant viper
undone yarrow
#

Are there any projectiles that don't have knockback?

chrome beacon
#

just cancel the event

young knoll
#

You can also cancel the damage to remove the knockback

#

Actually the knockback event wonโ€™t work since itโ€™s only called for living entities

undone yarrow
#

snowballs don't trigger on the damaged event

young knoll
#

Rip

#

I hoped they would since the event just takes a general Entity not LivingEntity

thorn isle
#

easy solution

#

mount the block display on a baby villager instead

waxen anchor
#
                    inetaddress = InetAddress.getByName(ip);
                    GuiConnecting.this.networkManager = NetworkManager.createNetworkManagerAndConnect(inetaddress, port, GuiConnecting.this.mc.gameSettings.isUsingNativeTransport());
                    GuiConnecting.this.networkManager.setNetHandler(new NetHandlerLoginClient(GuiConnecting.this.networkManager, GuiConnecting.this.mc, GuiConnecting.this.previousGuiScreen));
                    GuiConnecting.this.networkManager.sendPacket(new C00Handshake(47, ip, port, EnumConnectionState.LOGIN));
                    GuiConnecting.this.networkManager.sendPacket(new C00PacketLoginStart(GuiConnecting.this.mc.getSession().getProfile()));

                    PacketBuffer buffer = new PacketBuffer(Unpooled.buffer());
                    buffer.writeString("password");

                    C17PacketCustomPayload authPayload = new C17PacketCustomPayload("MyAuthChannel", buffer);
                    GuiConnecting.this.networkManager.sendPacket(authPayload);

will my code be like this?

sly topaz
waxen anchor
# sly topaz what are you trying to do

What I want to do is to send a packet by the extra client when entering the server and if there is such a packet in bungeecord, it will put it into the game, if not, it will throw it from the server.

sly topaz
#

you want to send a payload for authentication from the client to the server and now you're asking how to receive that packet in the server

waxen anchor
#

how can i do this

#

I've been trying to do this for 2 days.

sly topaz
#

all you have to do is register a channel with netty in the bungeecord side

#

you could do it with plugin messages if you use the Bungeecord channel but seeing as you're doing this right on the login phase, it's probably too early to receive plugin messages

waxen anchor
#

How can I record a channel with netty? Is there a sample code?

sly topaz
#

may I ask though, what is the point of this? A plain-text password isn't providing a lot of security to a server

waxen anchor
#

to prevent other clients from entering the server

waxen anchor
sly topaz
chrome beacon
#

Does Bungee even use netty

#

oh yeah it does

sly topaz
#

it should, otherwise they'd have to reimplement the whole pipeline for receiving packets lol

chrome beacon
#

like Minestom does for example :p (iirc)

waxen anchor
#

and how do i get it with netty

#

Is there a sample code?

chrome beacon
#

have you considered just letting people type their password

#

like most offline mode servers do

waxen anchor
chrome beacon
#

so?

#

your custom packet thing is super simple to bypass

#

you will just loose out on players since they need to install your mod

waxen anchor
#

Don't worry, Turks are not that intelligent :)

#

If it was, they would pass the game servers like Sonoyuncu

sly topaz
#

I am suspicious of what you're trying to accomplish with this but alas

#

@waxen anchor do you have a bungeecord plugin already? If not then start there

waxen anchor
# sly topaz <@920031758928457778> do you have a bungeecord plugin already? If not then start...
package luaclient.server;

import net.md_5.bungee.api.plugin.Plugin;
import net.md_5.bungee.api.connection.PendingConnection;
import net.md_5.bungee.api.connection.ProxiedPlayer;
import net.md_5.bungee.api.event.LoginEvent;
import net.md_5.bungee.api.event.PluginMessageEvent;
import net.md_5.bungee.api.event.PostLoginEvent;
import net.md_5.bungee.api.event.ProxyPingEvent;
import net.md_5.bungee.api.plugin.Listener;
import net.md_5.bungee.api.ProxyServer;
import net.md_5.bungee.api.ServerPing;
import net.md_5.bungee.event.EventHandler;
import net.md_5.bungee.event.EventPriority;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;

import java.awt.TextComponent;
import java.io.ByteArrayInputStream;
import java.io.DataInputStream;
import java.nio.charset.StandardCharsets;
import java.util.Set;
import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.TimeUnit;

public class Main extends Plugin implements Listener {
    
    private final Set<UUID> allowedPlayers = ConcurrentHashMap.newKeySet();
    
    private final String CHANNEL_NAME = "MyAuthChannel";
    private final String EXPECTED_AUTH_KEY = "password";

    @Override
    public void onEnable() {
        getProxy().getPluginManager().registerListener(this, this);
        getLogger().info("Waterfall plugin etkin!");
    }

    @Override
    public void onDisable() {
        getLogger().info("Waterfall plugin devre dฤฑลŸฤฑ!");
    }
    
    @EventHandler
    public void onPing(ProxyPingEvent event) {
        ServerPing ping = event.getResponse();
        ping.setVersion(new ServerPing.Protocol("LuaClient", -94408)); // 1.20.4 protokol
        event.setResponse(ping);
    }
    
    @EventHandler
    public void onPluginMessage(PluginMessageEvent event) {
        if (!event.getTag().equals(CHANNEL_NAME)) return;
        if (!(event.getSender() instanceof ProxiedPlayer)) return;

        ProxiedPlayer player = (ProxiedPlayer) event.getSender();

        try (DataInputStream in = new DataInputStream(new ByteArrayInputStream(event.getData()))) {
            String authKey = in.readUTF();

            if (!"password".equals(authKey)) {
                // Authkey yanlฤฑลŸsa oyuncuyu at
                player.disconnect(new net.md_5.bungee.api.chat.TextComponent("AuthKey doฤŸrulanamadฤฑ!"));
                getLogger().info(player.getName() + " authKey doฤŸrulanamadฤฑฤŸฤฑ iรงin atฤฑldฤฑ.");
            } else {
                getLogger().info(player.getName() + " baลŸarฤฑyla doฤŸrulandฤฑ.");
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
#

yes i have

young knoll
sly topaz
#

that's all you need for it to work

remote swallow
#

whats lunar client up to with badlion now

waxen anchor
#

01:17:05 [SEVERE]       at java.base/java.io.DataInputStream.readFully(DataInputStream.java:215)

01:17:05 [SEVERE]       at java.base/java.io.DataInputStream.readUTF(DataInputStream.java:597)

01:17:05 [SEVERE]       at java.base/java.io.DataInputStream.readUTF(DataInputStream.java:555)

01:17:05 [SEVERE]       at luaclient.server.Main.onPluginMessage(Main.java:60)

01:17:05 [SEVERE]       at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)

01:17:05 [SEVERE]       at java.base/java.lang.reflect.Method.invoke(Method.java:565)

01:17:05 [SEVERE]       at net.md_5.bungee.event.EventHandlerMethod.invoke(EventHandlerMethod.java:19)

01:17:05 [SEVERE]       at net.md_5.bungee.event.EventBus.post(EventBus.java:49)

01:17:05 [SEVERE]       at net.md_5.bungee.api.plugin.PluginManager.callEvent(PluginManager.java:448)

01:17:05 [SEVERE]       at net.md_5.bungee.connection.UpstreamBridge.handle(UpstreamBridge.java:337)

01:17:05 [SEVERE]       at net.md_5.bungee.protocol.packet.PluginMessage.handle(PluginMessage.java:81)

01:17:05 [SEVERE]       at net.md_5.bungee.netty.HandlerBoss.channelRead(HandlerBoss.java:151)

01:17:05 [SEVERE]       at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:359)

01:17:05 [SEVERE]       at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:293)

01:17:05 [SEVERE]       at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)

01:17:05 [SEVERE]       at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:107)

01:17:05 [SEVERE]       at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:359)

01:17:05 [SEVERE]       at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:107)

01:17:05 [SEVERE]       at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:359)

01:17:05 [SEVERE]       at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:346)

01:17:05 [SEVERE]       at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:318)

01:17:05 [SEVERE]       at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:359)

01:17:05 [SEVERE]       at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1429)

01:17:05 [SEVERE]       at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:918)

01:17:05 [SEVERE]       at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:167)

01:17:05 [SEVERE]       at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.handle(AbstractNioChannel.java:445)

01:17:05 [SEVERE]       at io.netty.channel.nio.NioIoHandler$DefaultNioRegistration.handle(NioIoHandler.java:383)

01:17:05 [SEVERE]       at io.netty.channel.nio.NioIoHandler.processSelectedKey(NioIoHandler.java:577)

01:17:05 [SEVERE]       at io.netty.channel.nio.NioIoHandler.processSelectedKeysPlain(NioIoHandler.java:522)

01:17:05 [SEVERE]       at io.netty.channel.nio.NioIoHandler.processSelectedKeys(NioIoHandler.java:495)

01:17:05 [SEVERE]       at io.netty.channel.nio.NioIoHandler.run(NioIoHandler.java:470)

01:17:05 [SEVERE]       at io.netty.channel.SingleThreadIoEventLoop.runIo(SingleThreadIoEventLoop.java:204)

01:17:05 [SEVERE]       at io.netty.channel.SingleThreadIoEventLoop.run(SingleThreadIoEventLoop.java:175)

01:17:05 [SEVERE]       at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:1073)

01:17:05 [SEVERE]       at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)

01:17:05 [SEVERE]       at java.base/java.lang.Thread.run(Thread.java:1447)
chrome beacon
waxen anchor
sly topaz
waxen anchor
#

server

#

bungeecord

remote swallow
chrome beacon
#

luaclient.server.Main.onPluginMessage(Main.java:60)

remote swallow
#

this is gonna sound really wild, do you actually know java before attempting this?

waxen anchor
#
@EventHandler
    public void onPluginMessage(PluginMessageEvent event) {
        if (!event.getTag().equals(CHANNEL_NAME)) return;
        if (!(event.getSender() instanceof ProxiedPlayer)) return;

        ProxiedPlayer player = (ProxiedPlayer) event.getSender();

        try (DataInputStream in = new DataInputStream(new ByteArrayInputStream(event.getData()))) {
            String authKey = in.readUTF();

            if (!"password".equals(authKey)) {
                // Authkey yanlฤฑลŸsa oyuncuyu at
                player.disconnect(new net.md_5.bungee.api.chat.TextComponent("AuthKey doฤŸrulanamadฤฑ!"));
                getLogger().info(player.getName() + " authKey doฤŸrulanamadฤฑฤŸฤฑ iรงin atฤฑldฤฑ.");
            } else {
                getLogger().info(player.getName() + " baลŸarฤฑyla doฤŸrulandฤฑ.");
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
sly topaz
#

EOFException means it read more than it needed to

thorn isle
#

since that's the only call made to the reader i'd wager the byte array is empty and it threw that while trying to read the string length prefix

sly topaz
#

it's probably just the fact that it doesn't have a string length prefix

#

they didn't use a DOS when sending the packet from the client

waxen anchor
#

What can I do to solve this error?

#

my client NetHandlerLoginClient.java code:

public void handleLoginSuccess(S02PacketLoginSuccess packetIn) {
        this.gameProfile = packetIn.getProfile();
        this.networkManager.setConnectionState(EnumConnectionState.PLAY);
        this.networkManager.setNetHandler(new NetHandlerPlayClient(this.mc, this.previousGuiScreen, this.networkManager, this.gameProfile));

        PacketBuffer buffer = new PacketBuffer(Unpooled.buffer());
        buffer.writeString("password");  // authKey

        C17PacketCustomPayload authPayload = new C17PacketCustomPayload("MyAuthChannel", buffer);
        this.networkManager.sendPacket(authPayload);
    }
thorn isle
#

myeah

#

welcome to the world of binary shit encoding

sly topaz
#

just use a data output stream to send the string on the client

thorn isle
#

writeString on a buffer isn't the same as readUTF on a data input stream

sly topaz
sly topaz
waxen anchor
# sly topaz or change this to use a DataOutputStream to send the data
public void handleLoginSuccess(S02PacketLoginSuccess packetIn) {
        this.gameProfile = packetIn.getProfile();
        this.networkManager.setConnectionState(EnumConnectionState.PLAY);
        this.networkManager.setNetHandler(new NetHandlerPlayClient(this.mc, this.previousGuiScreen, this.networkManager, this.gameProfile));

        ByteArrayOutputStream byteStream = new ByteArrayOutputStream();
        DataOutputStream dataout = new DataOutputStream(byteStream);

        try {
            dataout.writeUTF("password");
            dataout.flush();

            PacketBuffer buffer = new PacketBuffer(Unpooled.wrappedBuffer(byteStream.toByteArray()));

            C17PacketCustomPayload authPayload = new C17PacketCustomPayload("MyAuthChannel", buffer);
            this.networkManager.sendPacket(authPayload);
        } catch (IOException e) {

        }

    }```

Did it happen?
sly topaz
waxen anchor
#

worked

#

01:35:42 [INFO] [LuaClient] Player792 baลŸarฤฑyla doฤŸrulandฤฑ.

thorn isle
#

i don't think it uses any native resources

waxen anchor
#
@EventHandler
    public void onPluginMessage(PluginMessageEvent event) {
        if (!event.getTag().equals(CHANNEL_NAME)) return;
        if (!(event.getSender() instanceof ProxiedPlayer)) return;

        ProxiedPlayer player = (ProxiedPlayer) event.getSender();

        try (DataInputStream in = new DataInputStream(new ByteArrayInputStream(event.getData()))) {
            String authKey = in.readUTF();

            if (!EXPECTED_AUTH_KEY.equals(authKey)) {
                // Authkey yanlฤฑลŸsa oyuncuyu at
                player.disconnect(new net.md_5.bungee.api.chat.TextComponent("AuthKey doฤŸrulanamadฤฑ!"));
                getLogger().info(player.getName() + " authKey doฤŸrulanamadฤฑฤŸฤฑ iรงin atฤฑldฤฑ.");
            } else {
                getLogger().info(player.getName() + " baลŸarฤฑyla doฤŸrulandฤฑ.");
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
sly topaz
#

welp, congrats then

waxen anchor
#

But how do we remove the ones that are not true from the server?

#

or those who do not send packages

sly topaz
#

any player without your mod isn't going to send the packet, meaning they're going to get disconnected as per your code

waxen anchor
#

It works when I log in from a different client.

#

It just doesn't log like the message below

01:35:42 [INFO] [LuaClient] Player792 baลŸarฤฑyla doฤŸrulandฤฑ.

sly topaz
waxen anchor
#

But it does not trigger the onPluginMessage event every time someone enters the server.

sly topaz
#

perhaps it is as I said and it is probably too early in the login process to receive the plugin message

young knoll
#

Wonโ€™t the message only be sent if they login with their client

waxen anchor
#

When I log in with my own client, there is no problem, it sends messages, but when I log in with another client, it does not send messages from the server.

young knoll
#

Otherwise no message is sent and therefor no player.disconnect gets called

waxen anchor
#

only my client triggers the onPluginMessage event

#

But since other clients do not send messages, they can bypass this event and log in to the server.

young knoll
#

Use the plugin message to mark that the player is allowed to join

#

Then use a join event or whatnot to prevent any other players from joining

waxen anchor
#

Can we check if the onPluginMessage code is coming in the onLogin event?

sly topaz
#

oh right that makes sense

waxen anchor
#

or onPostLogin event

waxen anchor
sly topaz
#

since you send the plugin message really early, you probably can get away by adding them to a map in the login event and then removing them from that map in the plugin message event, if they're still on the map on post login then you just kick them

waxen anchor
#

I will put my loop that controls it according to its uuid

young knoll
#

If the message arrives before the AsyncPlayerPreLoginEvent you can just stop them joining there

#

Otherwise you could stop them in the PlayerLoginEvent

waxen anchor
#

What should I do now in short?

sly topaz
#

add them to a map in the plugin message event, then in either of the events Jish mentioned you just check whether they're there or not, if not you disallow the connection

waxen anchor
#
private final Set<UUID> pendingAuthPlayers = ConcurrentHashMap.newKeySet();

    @EventHandler
    public void onLogin(LoginEvent event) {
        pendingAuthPlayers.add(event.getConnection().getUniqueId());
    }

    @EventHandler
    public void onPluginMessage(PluginMessageEvent event) {
        if (!event.getTag().equals(CHANNEL_NAME)) return;
        if (!(event.getSender() instanceof ProxiedPlayer)) return;

        ProxiedPlayer player = (ProxiedPlayer) event.getSender();

        try (DataInputStream in = new DataInputStream(new ByteArrayInputStream(event.getData()))) {
            String authKey = in.readUTF();

            if (!EXPECTED_AUTH_KEY.equals(authKey)) {
                player.disconnect("AuthKey doฤŸrulanamadฤฑ!");
                getLogger().info(player.getName() + " authKey doฤŸrulanamadฤฑฤŸฤฑ iรงin atฤฑldฤฑ.");
            } else {
                pendingAuthPlayers.remove(player.getUniqueId()); // BaลŸarฤฑyla doฤŸrulandฤฑ
                getLogger().info(player.getName() + " baลŸarฤฑyla doฤŸrulandฤฑ.");
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    @EventHandler
    public void onPostLogin(PostLoginEvent event) {
        UUID playerId = event.getPlayer().getUniqueId();

        if (pendingAuthPlayers.contains(playerId)) {
            event.getPlayer().disconnect("AuthKey gรถnderilmedi!");
            getLogger().info(event.getPlayer().getName() + " authKey gรถndermediฤŸi iรงin atฤฑldฤฑ.");
        }
    }

Does this work?

sly topaz
#

it could work, though you could probably kick them even earlier

#

doesn't really matter anyway, try it and if it works then good

waxen anchor
#

This time the plugin didn't send the message so he kicked everyone :(

#

I need to wait somewhere

#

But what will someone with bad internet do?

sly topaz
#

it probably wasn't that it didn't send it but rather that it was sent too late then

sly topaz
#

check at which point your payload packet is sent first

young knoll
#

You can block in the AsyncPlayerPreLoginEvent

#

For up to 30 seconds

sly topaz
#

what is the order of events in bungeecord for the login phase

#

what is called first, ServerConnectEvent or the login ones?

waxen anchor
#

I have no idea :(

sly topaz
#

ClientConnectEvent -> PlayerHandshakeEvent -> PreLoginEvent -> PostLoginEvent -> LoginEvent -> ServerConnectEvent -> ServerConnectedEvent -> ServerSwitchEvent this is the order apparently

#

you probably want either LoginEvent, ServerConnectEvent or ultimately the ServerConnectedEvent but I doubt you send the packet that late

waxen anchor
#

Which one should I use?

#

We are currently using PostLoginEvent

sly topaz
#

S02PacketLoginSuccess, you're sending your packet on the handler for this packet, to me that sounds like ServerConnectEvent/ServerConnectedEvent

plucky iris
#

guys, Im writing a purpur plugin, and I need to add an NMS. What is the best way to do this?

waxen anchor
#

ServerConnectedEvent

#

works

sly topaz
#

there we go

sly topaz
waxen anchor
#

Well, if we put the encryption as AES 256 and a date at the end, would that be ok?

chrome beacon
#

Kind of pointless since the client has the password anyways

waxen anchor
sly topaz
#

you can encrypt the password if you want, but it is pointless because the client mod has the password in plain text

waxen anchor
waxen anchor
#

then there is no need :)

sly topaz
#

even if you encrypt the password, it'll be part of the mod code, which they can just decompile to get, they don't have to decrypt it to use it

young knoll
#

Iโ€™m trying to think of what the proper method for this would be

#

The client gets an auth token from a central server that would only be valid for a few minutes?

#

And then uses that to auth with the minecraft server

waxen anchor
#

If it is not necessary, there is no need. The idea in my mind was something like I would encrypt a key + minute with AES256 and even if the password was captured, it would be canceled because 1 minute would pass.

sly topaz
#

the best thing you can do is just update the password regularly by updating the mod so that they can't access even if they decompile older versions of the mod

waxen anchor
#

I think so too

sly topaz
#

security by obscurity would be the reasonable choice here since you could make a really complex authentication algorithm but there is no way to prevent someone from spoofing it if it is generated on the client

#

the only way to make it secure would be the same way websites do it, by doing all authentication on the server

#

but for that you'd have to setup a registration and login process, which I imagine is something you wouldn't want to deal with

waxen anchor
#

I think it's enough for now, I don't think there are people who can find it.

#

I'm also wondering about something, how do some servers do the HD skin logic? For example, they sell HD skins for money. Even if we assume that we add it to the client, how do they add it to the server, especially to plugins like skinrestorer?

sly topaz
#

they don't have to do anything on the server to make it work

young knoll
#

wtf is an HD skin

sly topaz
#

though I have no idea what an hd skin is, the skin rendering logic is handled on the client

young knoll
#

Minecraft skins have a fixed size

sly topaz
waxen anchor
#

For example, there are 512x512 ones

#

They are what we call HD

#

Where can I upload a photo here? I want to upload a sample skin photo from a server.

young knoll
#

?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

sly topaz
#

?img

undone axleBOT
#

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

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

sly topaz
#

beat me to it yet again

#

if this was the wild west I'd have been shoot by you twice Jish, you won't get me again

waxen anchor
sly topaz
#

this is a thing apparently, never seen it myself though

sly topaz
young knoll
waxen anchor
#

How do they do it server side?

sly topaz
#

you can't do that server side

waxen anchor
#

How do they define this for plugins like skinsrestorer?

young knoll
#

If itโ€™s a custom client they can do whatever they want

#

Otherwise maybe some core shader magic could do it

sly topaz
#

all skin restorer does is ask the client to re-render a skin

waxen anchor
#

For example, what should I do to create an HD skin system?

sly topaz
#

they probably have their own skin services to handle this, though, since I doubt you can upload hd skins to minecraft servers

sullen marlin
#

๐ŸŒˆmodsโœจ

waxen anchor
sly topaz
#

did I just happen to find a spanish-only one

waxen anchor
#

:D

sly topaz
#

apparently this was made by the My Little Pony mod people

young knoll
#

You could in theory use some of the empty space in a normal skin to add more detail

sly topaz
#

makes sense

young knoll
#

Assuming you had a mod that count render it

#

Idk how much extra space there is though

waxen anchor
#

So how can I download Forge to MCP? (mods file will be closed to the outside)

sly topaz
#

you mean, hardcoding your mod into the client?

young knoll
#

Eh not that much

waxen anchor
sly topaz
#

there's probably resources online about that in the bukkit or forge forums, you'd just have to ask google to show everything before 2014

young knoll
#

lol

#

I know modern clients do it too

#

Somehow

waxen anchor
#

Can't we do it directly manually? Instead of mod, can we set a certain pixel number to 512?

sly topaz
#

just copy whatever the mod does into your client and you're good

waxen anchor
#

I didn't want to spoil my mcp now (my 50th spoil)

waxen anchor
sly topaz
#

the hd skins mod I linked above is open source

#

so you can just look at it

#

probably want to look at their earliest branch (the 1.12 one)

waxen anchor
#

but I'm using 1.8.9 :D

sly topaz
#

doesn't really matter, skin logic hasn't changed at all since then

young knoll
#

Well have fun backporting

waxen anchor
#

We tolerate it because our Turkish youth like 1.8.9 pvp more.

sly topaz
#

that's every community except the english one for whatever reason

#

here in the latin community everyone plays on 1.8.9 too

waxen anchor
#

It is loved very much :D

rough ibex
#

unfortunate

young knoll
#

Can I say the line

waxen anchor
#

Okay, I'll ask a very good question. How do I set this up? It seemed very complicated to my client. :(

young knoll
undone axleBOT
waxen anchor
#

:D

rough ibex
#

oh no 1.8 modding...

young knoll
#

I remember making a coremod back then

#

Now we have fancy mixins

sly topaz
#

mostly because you have to backport, otherwise it'd be easy

orchid gazelle
#

g'old times

sly topaz
#

had you made your authentication mod with legacy-fabric instead of hardcoding it into the client, it'd probably have been easier but no way around it now

waxen anchor
#

I'm watching a 12-year-old video right now and the guy is installing forge on MC 1.2.5 :))) he's a crazy guy

young knoll
sly topaz
#

and failing at it since I didn't understand the concept of having to make 3d models by myself

#

I just thought people calculated those in code or something, the idea of there being baked models didn't sit right with my mind

#

it still doesn't to this day, I use python to generate graphs

waxen anchor
#

What time is it there? I'm about to die of insomnia. :D

young knoll
#

Unreal Engine 6โ„ข๏ธ: Generate 3D models programmatically

orchid gazelle
#

turns out that it does not work really well when you don't build your plugins

#

weird right?

young knoll
#

Wait until you hear about skript!

orchid gazelle
#

oh no

sly topaz
#

I know more than one person that started off with Skript, honestly amazed it is still a thing today

orchid gazelle
#

I've always shittalked skript

#

always hated it

young knoll
#

:p

orchid gazelle
#

great Coll but I am not 6 anymore :p

sly topaz
#

it is good as an introduction to programming, if that were their focus then it'd probably be a lot more sucessful of a project

orchid gazelle
#

I've been able to use maven since I was 9 years old

young knoll
#

Pfft

#

Who needs to compile when the server can do it for you

orchid gazelle
#

lmao

sly topaz
#

did you make a repl for spigot

young knoll
#

Pretty much

sly topaz
#

that's cool, it's one of the things I was working on

#

I was actually working on a plugin called scratchpad which would let you load single-file java "scripts"

#

but it somehow diverged into a repl as well

young knoll
#

Itโ€™s actually pretty easy to get JShell to work with spigot

#

Just need a little bit of classloader suffering

sly topaz
#

oh I thought you had made one from scratch, didn't even think of hacking away jshell

#

since it is open source I guess you could just scrap the entrypoint and make it a plugin

slender elbow
#

gta 5 is older than minecraft 1.8

#

than 1.7.2 too apparently

young knoll
#

JShell is just part of the jdk

#

No hacking away needed, thereโ€™s api for it

sly topaz
#

it was definitely in 2013

slender elbow
#

yeah, September vs October 2013

waxen anchor
sly topaz
#

one month difference, crazy

slender elbow
#

god damn

sly topaz
#

SQLibrary

slender elbow
#

today is the feel older by the minute day

sly topaz
#

I always wondered why every single plugin back in the day used that library

#

were we just all kids back then and nobody but that one guy understood how to use SQL, who knows

waxen anchor
#

data save

#

SELECT * FROM table WHERE data = ?

#

:D

young knoll
#

Hot damn thatโ€™s a 1.5.2 plugin

waxen anchor
#

INSERT INTO :D

young knoll
#

Now weโ€™re going back

sly topaz
#

Jish, it is a spout plugin

waxen anchor
#

Off, is there any updated plugin? Up to 1.8 as I said.

young knoll
#

Oh damn spout

#

Another throwback

young knoll
#

?howold 1.5.2

undone axleBOT
slender elbow
#

lame

young knoll
#

12 years

#

1.5.2 is almost old enough to use discord

sly topaz
#

that doesn't sound right, 1.5 is 15 years old to me

#

that is the version I started playing on

young knoll
#

I started on 1.0

#

?howold 1.0

undone axleBOT
young knoll
#

Fuckin hell

rough ibex
#

grandpa

sly topaz
#

not a big difference, how many versions did minecraft release that year

young knoll
#

Quite a few back in the day

#

?howold 1.7.10

undone axleBOT
young knoll
#

Hmm

sly topaz
#

I remember trying out 1.3.2 first, but I couldn't figure out how to break wood

young knoll
#

I definitely remember starting to make plugins in 1.7.10

waxen anchor
#

Off HD skin why is it so hard

young knoll
#

But I swear it was longer than 11 years ago

sly topaz
#

i was too young to realize you could hold to break blocks, so I just didn't play until a friend actually taught me how to break wood

young knoll
#

Well no I would have been 15

#

I guess thatโ€™s about right

slender elbow
#

my first experience with Minecraft was in 1.4.2 with a friend who had TMI

young knoll
#

Werenโ€™t you like 3 back then

#

:)

buoyant viper
#

and then 1.8 happened n it was like how the hell do i download craftbukkit

slender elbow
#

when I got home I go ahead and get 500 viruses before I get a successful Minecraft install, launch the game, inventory menu looked nothing alike

#

much confusion

#

TMI was a necessity, the old creative menu was.. uh

#

uh

young knoll
#

I remember there was a cursed plugin that let your server have 1.8 features and allow 1.8 clients

sly topaz
#

TMI and Rei's minimap were THE mods back then

#

I remember when they added waypoints that were beacons in 1.8, it was amazing

young knoll
#

Now we have real waypoints

#

Kinda

slender elbow
#

oh yeah reis

sly topaz
young knoll
#

No

#

It was called carbon

slender elbow
#

then the redstone update came and ohmygod HOPPERS LOOK THERE'S HOPPERS AND A REDSTONE BLOCK, everyone bully coal for not having a coal block!!

sly topaz
#

what the fuck is this

slender elbow
#

then they added horses and donkeys and coal blocks in 1.6 and I stopped playing

young knoll
#

There was a big downtime between spigot 1.7 and 1.8

#

Due to the dramaโ„ข๏ธ

#

So that plugin happened

sly topaz
#

I still hold my belief that whenever hypixel closes bedwars 1.8, it's when I finially leave the minecraft community but still

young knoll
#

Ah

#

So never

slender elbow
#

oh man, I remember when hypixel opened The Walls

#

that was the shit

sly topaz
#

I also have way too much knowledge about minecraft, I get FOMO every time a new update comes and I don't know how it works

young knoll
#

I remember when hypixel opened

#

The end

slender elbow
#

oh don't ask me anything about new versions, name any thing that's been added in the past 5 major updates and I'm as good as dead

young knoll
#

I miss playing the adventure maps on the server

slender elbow
#

?????

#

isn't that a uh

#

fetish, what's it called

#

diapers

#

I wish I didn't know that

young knoll
#

Iโ€ฆ

slender elbow
#

yeah I know

#

me too

young knoll
#

Gonna pretend I didnโ€™t read that

slender elbow
#

huh ?

#

wood?

#

did they add frogs?

young knoll
#

Yeah

slender elbow
#

oh that's cool

#

I know there's fireflies I think

young knoll
#

Thereโ€™s firefly particles

#

The mob got cancelled

slender elbow
#

I know
I think

#

oh

#

sad

young knoll
#

Look at this dood

slender elbow
#

when I grow old, I wanna be just like him

young knoll
#

Heโ€™s happy because you saved him
You found his dried corpse in the nether, brought it home and moistened it

sly topaz
#

I am still wrapping my head around datapacks and how they handle worldgen

young knoll
#

Now he lets you ride him around and stand on his head to build

slender elbow
#

that's epic

worthy yarrow
torn shuttle
#

lookin like the kinda guy who'd invite you to a bbq and then grill some paddies

mellow edge
# young knoll

Why do I feel like I saw a dude with similar glasses somewhere else...?

mellow edge
undone yarrow
#

I made this plugin that spawns an airstrike where snowballs (invisible) with a block display mounted on it are pushed towards a destination and explodes on impact.
Issue is, the snowballs get knocked back by the explosions and fly in all sorts of directions. Spent 8 hours now trying to fix this bs.
I've tried:
Listening to the knockback event, but it does not check for snowballs being knocked back. (it does check for snowballs knocking something else back, besides snowballs)
Scanning for more snowballs in the radius of an explosion, then prematurely exploding those, but it's very unstable and unreliable.
Tried multiple projectiles, but they all have the same issue.
Listening to the entity damaged event, but snowballs apparently do not get damaged...
I don't know anymore

#

probably tried more things that I forgot about too

#

ok

#

what the f

#

I thought of just disabling the explosions to recreate my own with no knockback, but they still fly all over the place....

#

please help I'm going insane

buoyant viper
#

?jd-s

undone axleBOT
smoky anchor
undone yarrow
#

bunch of particles

#

but I found the issue

#

idk how to solve it yet but I'll find something. It's not knockback fixed it, finally

mortal vortex
undone yarrow
#

(don't ban me please)

mortal vortex
#

LOL

buoyant viper
#

๐Ÿซ 

undone yarrow
#

atm I'm using the following particles:
flash, explosion_emitter, large_smoke, lava, warped_spore, white_ash

#

some of them you can't see bcs I'm too far away

nova notch
#

crazy

hushed spindle
# undone yarrow Any suggestions to make it look better?

without resource packs and easily? just a few flashes ig
you could also look into adding like simulated rubble or smoldering projectiles that carry particle effects with them

there are some very cool things you can do with block entities like demonstrated here, but they're also rather difficult and probably not very performant with how many entities they use. can be quite laggy on clients https://www.youtube.com/watch?v=OKXTGbp6AMk&t=6s

with resource packs i reckon some impact flash frames could be cool, or some shockwave particles

#

this video also shows a lot in how you can use subtle effects to create a much more impactful feeling explosion

undone yarrow
#

Ive been wondering if I could do beacon beams and point it at things but what he did is great, I'll use that

hushed spindle
#

yeah its really cool isnt it

undone yarrow
#

yeah, but very complicated and performance heavy too haha

#

I'll use the beam idea though, I'll add that as an option to my airstrike. And I'll add some camerashake

drowsy helm
#

It wouldn't be that performance heavy

undone yarrow
#

and I'll see if I can do the magma blocks but idk

drowsy helm
#

at most its a few hundred block displays

undone yarrow
#

and all the block updates (removing them, replacing with other blocks or air) etc. takes some time to render too

hushed spindle
#

for the server its no big deal but clients can at times start lagging with hundreds of entities

young knoll
#

Who doth ghost ping me in here

#

๐Ÿ‘€

hushed spindle
#

that guy

undone yarrow
#

If I just use block displays they'll be kinda dark if there's no light shining on them

drowsy helm
#

He has the source in the descriptionm

hushed spindle
#

there's a BlockDisplay#setBrightness() method

#

i reckon he used that

undone yarrow
#

yeah I just found that, but it had a weird input. Fixed that now

graceful patrol
#

Hello, I'm trying to make a Vanish with Bungeecord (to learn), bungee instance sends the message, but the paper doesnt recieve it, someone knows why?

Spigot side:

        plugin.getLogger().info("onPluginMessageReceived() triggered! Channel: " + channel);
        try {
            DataInputStream in = new DataInputStream(new ByteArrayInputStream(message));
            String subchannel = in.readUTF();

            switch (subchannel) {
                case "blabla": {
                    //
                }

                case "VANISH": {
                    String action = in.readUTF();
                    String playerName = in.readUTF();

                    Player player = Bukkit.getPlayerExact(playerName);
                    if (player == null) return;
                    getLogger().info("Received plugin message: " + subchannel + " - " + action + " for " + playerName);

                    if (action.equalsIgnoreCase("on")) {
                        vanishManager.vanish(player);
                    } else if (action.equalsIgnoreCase("off")) {
                        vanishManager.unvanish(player);
                    }
                    break;
                }
            }

        } catch (Exception e) {
            e.printStackTrace();
        }
    }```
Spigot main:
```getServer().getMessenger().registerIncomingPluginChannel(this, "staff:vanish", handler);
getServer().getMessenger().registerOutgoingPluginChannel(this, "staff:vanish");```

Bungee side:
```private void sendVanishPluginMessage(ProxiedPlayer player, boolean vanish) {
        ByteArrayDataOutput out = ByteStreams.newDataOutput();

        out.writeUTF("VANISH");
        out.writeUTF(vanish ? "on" : "off");
        out.writeUTF(player.getName());

        System.out.println("Sending VANISH message for " + player.getName());

        player.sendData("staff:vanish", out.toByteArray());
    }```
#

I read the whole docs, yet I still can't figure it out, I'm probably just super dumb ๐Ÿ’€

lilac dagger
#

wait let me see

#

it looks fine on a first glance

#

i'm not sure if this is the correct way to send custom plugin messages tho

#

wait i found this

#

you must register on proxy channel too

#

@graceful patrol

graceful patrol
#

getProxy().registerChannel("staff:vanish");

lilac dagger
#

on plugin message side replace it with
ByteArrayDataInput in = ByteStreams.newDataInput(message);

#

so it's consistent

#

tho it should work nonetheless

graceful patrol
#

paper didnt recieve anything

#

the whole "event" is not firing for some reason

#

plugin.getLogger().info("triggered, channel: " + channel);

^
didnt fire at all, its on the start of onPluginMessageRecieved(), nothing should prevent it

lilac dagger
#

that's weird

#

it looks fine

#

does the class implements PluginMessageListener?

graceful patrol
#

yes

#

public class PluginMessageHandler implements PluginMessageListener {

wet breach
#

wonder if you could just do the whole vanishing from the proxy ๐Ÿค”

graceful patrol
#
  • i "delete" the join message for the staff member
wet breach
#

seems maybe you really don't need the proxy for this

#

unless you are going to handle all the stuff on the proxy and not on the server at all, which you technically could

#

but it wouldn't make sense to do all that work though lol

graceful patrol
#

i am making it as a proxy command, which will vanish the staff member even after he switched servers (using /server <name> etc.), that is why i need proxy, tbh you can do it through a database and not with proxy, but eh

wet breach
#

since most people have a DB for permissions

#

all you would do is enable the permission, then its a matter of checking that regardless of which server they go to

#

now, you don't have to deal with multiple DB tables and making use of what you already have ๐Ÿ™‚

#

this is probably the better method because you can't interact with a server that has no players using plugin messaging

#

and if the only player is the one who is joining, it can cause issues before the player fully joined if they are the only one

#

as for the join message, I would recommend you modify the plugin to still log that they joined, just not send the join message

#

this way when looking through logs you can still see your staff members joining in case something happens etc

brazen wing
#

Finding someone to make me a falixnode server (free server) for free

#

Dms me if can

wet breach
#

if its free why don't you make it yourself?

brazen wing
#

Itโ€™s country restrictions

wet breach
#

then use something that isn't restricting countries

graceful patrol
#

or use a vpn

wet breach
#

or the country you are from anyways

brazen wing
wet breach
#

wouldn't make sense to have somone make you a server you can't even connect to though

brazen wing
#

Wait what

graceful patrol
#

well if you dont need the server for anything special, you can just use localhost

brazen wing
#

Then how can I connect to Germany server like aternos

graceful patrol
brazen wing
graceful patrol
#

or use ngrok ๐Ÿคทโ€โ™‚๏ธ

brazen wing
#

And other from Java

wet breach
#

you said the host was country restricted hence you need someone who is from a country not restricted by the host right? if that is the case then only they could connect to the server and actually test anything, you might still have access to the web panel but that is it lol.

graceful patrol
#

well, use ngrok and just install geyser on it

brazen wing
#

What is Ngrok

graceful patrol
#

๐Ÿ˜ญ

brazen wing
#

Sry autocorrect

graceful patrol
#

thats wild

brazen wing
#

lol

wet breach
#

in case you were curious, Negroni is a cocktail

brazen wing
#

๐Ÿฅธ

wet breach
#

thats negroni ^

molten hearth
#

better than ngrok i can tell you that

brazen wing
#

What server hosting you recommend then

wet breach
#

none you can afford

brazen wing
#

Stop๐Ÿ˜ญ๐Ÿ˜ญ๐Ÿ˜ญ

wet breach
#

all the free ones are crap

young knoll
#

Oracle free tier

brazen wing
#

Fr

wet breach
#

Except I guess oracle

#

you can atleast do something with it

#

but its a pain to use so I have heard

young knoll
#

Hey skull it all you want it can run ATM10

molten hearth
#

ive been waiting over a month for them to restock their servers

graceful patrol
wet breach
#

lol

young knoll
#

Yeah getting it is the hard part

graceful patrol
#

you can register, but they dont restock ๐Ÿ’€

molten hearth
#

yeah lol

young knoll
#

But once you get one it's not too bad

molten hearth
#

restocking == users deleting their servers

young knoll
#

And you get to learn linux commands

#

I haven't rm -rf yet!

wet breach
molten hearth
#

recommending oracle is like recommending contabo bru

wet breach
#

I couldn't say since I never used an oracle free tier vps

brazen wing
#

Ok

wet breach
#

lol

brazen wing
#

What is a vps

molten hearth
#

they give you like a micro server at first and then you wait a few years and you get their arm server

wet breach
#

its a virtual private server. Means your server is not the only one on the box

wet breach
#

OVH specializes in renting entire boxes

molten hearth
#

we got ads in spigotmc help-dev now

sullen canyon
brazen wing
#

Ima try to make oracle server then

wet breach
graceful patrol
#

or a credit card

brazen wing
#

Oh I donโ€™t have a card

wet breach
graceful patrol
brazen wing
#

lol

molten hearth
#

no negroni for you

brazen wing
#

So what should I use then

sullen canyon
# brazen wing Ima try to make oracle server then

Wow, this is rude to say something like that in front of a person promoting their data center. I am hosting provider ANTON can supply you with the newest server components if you got a need of them

wet breach
sullen canyon
molten hearth
#

thats good

sullen canyon
#

the newest i5 4670k and 16 gigs of ddr3

molten hearth
#

i actually love sweet drinks ngl

brazen wing
#

You gonna sent it for free?

graceful patrol
molten hearth
#

moscow mules are probably one of my favourite cocktails since they tend to be so sweet

remote swallow
#

for 20$ a month i will provide a vps with 4 vcpus and 8gb of ram

wet breach
#

but how much space?

young knoll
#

Are you reselling an oracle vps

#

kek

remote swallow
wet breach
#

a bit over priced but within market prices though

remote swallow
#

i have to make some money on buying a hetzner vps

elfin isle
brazen wing
#

Negroni๐Ÿฅธ

remote swallow
wet breach
remote swallow
#

i also barely use my oracle vps i have an actual hetzner one now

young knoll
#

Are you paying for it with alpacas

remote swallow
#

no, great british pounds actually

brazen wing
wet breach
#

then what is the point of the restriction?

#

why couldn't you set it up if the restriction doesn't apply to you

brazen wing
#

Well I donโ€™t really know

brazen wing
#

For it to be exclusive and sell their paid plans

wet breach
#

in either case sounds like you shouldn't have an issue setting it up yourself then

brazen wing
#

It restrict to make a free server in my country

graceful patrol
#

someone knows why my onPluginMessageRecieved "event" does not fire at all?
it is registered in proxy:

getProxy().registerChannel("staff:vanish");

even in main class (in paper plugin):
getServer().getMessenger().registerIncomingPluginChannel(this, "staff:vanish", handler);
getServer().getMessenger().registerOutgoingPluginChannel(this, "staff:vanish");

the code:

    public void onPluginMessageReceived(String channel, Player player, byte[] message) {

        try (ByteArrayInputStream byteIn = new ByteArrayInputStream(message);
             DataInputStream in = new DataInputStream(byteIn)) {

            String subChannel = in.readUTF();
            if (subChannel.equals("VANISH")) {
                String action = in.readUTF();
                String targetName = in.readUTF();

                Player target = Bukkit.getPlayerExact(targetName);
                if (target != null) {
                    boolean vanish = action.equalsIgnoreCase("on");
                    for (Player p : Bukkit.getOnlinePlayers()) {
                        if (vanish) {
                            p.hidePlayer(plugin, target);
                        } else {
                            p.showPlayer(plugin, target);
                        }
                    }
                }
            }

        } catch (IOException e) {
            e.printStackTrace();
        }
    }```

(added a debugger to the top, didnt fire)
lilac dagger
#

is a player on the paper server?

#

no players no data communication

#

@graceful patrol

#

it's the reason why i went with sockets in one of my plugins

slender elbow
#

i would like to see the bungee plugin code

sly topaz
#

^ seeing how you're sending the data would be helpful, since just the part that registers the channel doesn't tell us much

plush sluice
plush sluice
lilac dagger
#

redis too

sly topaz
#

well, it does look like they're doing everything properly, so the only question left is whether there's is in fact a player in the receiving server

slender elbow
#

yeah no, they're sending the data to the player client, not the player's server

sly topaz
#

ah, that makes sense

slender elbow
#

@graceful patrol you need to get the server from the player, and call sendData on the server instead, not the player, that will send the payload to the client

#

classic deathtrap

buoyant viper
#

?jd-s

undone axleBOT
buoyant viper
#

?jd-b

#

?jd-bungee

#

this fuckin bot

#

?jd-bc

buoyant viper
#

oh sendData is on the bungee side

#

i was like why cant i find that method lol

chilly swallow
#

When making custom items, like a pickaxe that mines a 3x3 area, what's the best way of detecting if the item is custom or not? Using the name would be unsafe, surely?

chilly swallow
#

perfect, thank you :)

proven fern
#
---- Minecraft Crash Report ----
// My bad.

Time: 6/8/25, 7:36PM
Description: Exception in server tick loop

java.lang.AssertionError: TRAP
at net.minecraft.world.item.ItemStack.updateEmptyCacheFlag(ItemStack.java:247)
at net.minecraft.world.item.ItemStack.setCount(ItemStack.java:1282)
at net.minecraft.world.item.ItemStack.grow(ItemStack.java:1286)
at net.minecraft.world.item.ItemStack.shrink(ItemStack.java:1290)
at net.minecraft.world.item.FireworkRocketItem.useOn(FireworkRocketItem.java:54)
at net.minecraft.world.item.ItemStack.useOn(ItemStack.java:336)
at net.minecraft.server.level.ServerPlayerGameMode.useItemOn(ServerPlayerGameMode.java:625)
at net.minecraft.server.network.ServerGamePacketListenerImpl.handleUseItemOn(ServerGamePacketListenerImpl.java:1868)
at net.minecraft.network.protocol.game.ServerboundUseItemOnPacket.handle(ServerboundUseItemOnPacket.java:33)
at net.minecraft.network.protocol.game.ServerboundUseItemOnPacket.a(ServerboundUseItemOnPacket.java:9)
at net.minecraft.network.protocol.PacketUtils.lambda$ensureRunningOnSameThread$1(PacketUtils.java:51)
at net.minecraft.util.thread.BlockableEventLoop.doRunTask(BlockableEventLoop.java:156)
at net.minecraft.util.thread.ReentrantBlockableEventLoop.doRunTask(ReentrantBlockableEventLoop.java:24)
at net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:128)
at net.minecraft.server.MinecraftServer.pollTaskInternal(MinecraftServer.java:1394)
at net.minecraft.server.MinecraftServer.pollTask(MinecraftServer.java:1387)
at net.minecraft.util.thread.BlockableEventLoop.managedBlock(BlockableEventLoop.java:139)
at net.minecraft.server.MinecraftServer.waitUntilNextTick(MinecraftServer.java:1362)
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1243)
at net.minecraft.server.MinecraftServer.lambda$spin$1(MinecraftServer.java:318)
at java.base/java.lang.Thread.run(Thread.java:1583)

What can cause this error?

proven fern
chrome beacon
#

Could you send the output from /version

proven fern
#

/version is blocked

chrome beacon
#

That doesn't look like Spigot

proven fern
chrome beacon
#

and you forked Spigot

#

not Paper or anything else

proven fern
#

si

#

well not me i did some small changes only to overall fork

#

but lead is on vacations sooo yea

#

i am fucked

chrome beacon
#

Try with regular Spigot

proven fern
#

And now some player poked that exception

#

Thats the problem if i knew what caused it i would be able to fix it

#

But i have no clue, especially in context of fireworks

chrome beacon
#

My guess would be that they used a firework with a stacksize of 0

#

but I would have to check what the assert is

#

since you have it setup you could just look at the line the stacktrace is pointing at

short narwhal
#

hey, i have a plugin made by chatgpt that cancels some player events when they have a tag, but i dont know how to compile it. can someone do it for me or just explain?

pure dagger
#

how to install citizens to maven ??

slender elbow
#

it's hosted on their own maven repo

sly topaz
#

what is with that exclusions block on their wiki

slender elbow
#

i don't wanna know lmao

sly topaz
#

that sounds like they messed up their maven publishing and are working it around by asking people to exclude things

#

welp, if it works

pure dagger
#

<version>2.0.38</version>

#

and what exacly do i put htere

#

cause its red

chrome beacon
#

Did you reload maven

pure dagger
#

yeah

chrome beacon
#

and did you add their repo

sly topaz
#

hover over the error and tell us what it says

pure dagger
#

yes, only i chanegd the version and it became red

sly topaz
#

recommended version on their wiki is 2.0.35-SNAPSHOT

#

does 2.0.38 even exist

pure dagger
#

oh

#

so the api version is different than plugin ?

sly topaz
#

yes

chrome beacon
#

2.0.38**-SNAPSHOT** does exist

sly topaz
#

makes sense

pure dagger
#

ont really understand these things, where do i find that

sly topaz
chrome beacon
#

You'd read this

#

Which is right under the dep info

pure dagger
#

oh

chrome beacon
#

Common mistakes #4

pure dagger
#

so i thouh that its not snapshot cause it was not written on spigot

chrome beacon
#

also you can check the repo

#

like they say and link to

pure dagger
#

pokay thankss

sly topaz
#

-SNAPSHOT just means "latest artifact available"

#

in reality if they are using semantic versioning they shouldn't need to -SNAPSHOT it but alas

pure dagger
#

does it become not snapshot when theres new version

#

i mean from minceraft, snapshots were test verdsions for players to see and like give feedback before releasing the version

#

but thats spoilering ;

chrome beacon
#

-SNAPSHOT is used when you want to push updates without updating the version number

sly topaz
#

ah, I see where the confusion is from

#

yeah, it isn't quite the same as minecraft snapshots

lilac dagger
#

so does that mean i should remove -LATEST from my plugin?

sly topaz
#

why are you a new user