#help-development

1 messages · Page 1232 of 1

chrome beacon
#

Could you dm me your plugin jar

latent rampart
#

sure

chrome beacon
#

Looks to be solved CARROT is called CARROT_ITEM in 1.8 forgot those poor names where a thing

ancient plank
#

yep

#

it's been so long since I've worked with pre-1.13 api tbh

#

I do not miss it

quaint mantle
#

.

slender elbow
#

lol

gray cedar
#

someone know how to get 1.20 remapped-mojang.jar? i used BuildTools with commands but doesnt work

chrome beacon
#

Did you run it with the remap flag

#

--remapped

#

or did you set it in the gui

gray cedar
#

yes but there always is the spigot-1.20.1 or something

#

"spigot-1.20.1.jar" and some directories is what i get

remote swallow
#

plain 1.20 got superceeded by 1.20.1

chrome beacon
gray cedar
#

but i need the remapped-mojang because nms imports are missing for example: import net.minecraft.network.protocol.game.ClientboundPlayerInfoPacket;
import net.minecraft.server.level.ServerPlayer;
import org.bukkit.craftbukkit.v1_21_R1.entity.CraftPlayer;

chrome beacon
#

Don't use jar dependencies

#

Use maven or gradle

gray cedar
#

i use maven

remote swallow
#

?nms

gray cedar
#

automatically in m2 directory right?

remote swallow
#

yeah

fallow violet
#

:3

kind coral
#

if i wanted to make a socket for data transfer, how would i handle broadcasting to all connected sockets to my serversocket? (in java ofc) i make a kind-of packet system to request data from other server to sync the plugins (its a party plugin)

#

package it.alessandrocalista.parties.network;

import java.util.UUID;

public interface Packet {

record CreatePacket(UUID owner) implements Packet {
}

record QueryMembersPacket(UUID partyUUID) implements Packet {
}

record MemberJoinPacket(
        UUID partyUUID,
        UUID member
) implements Packet {
}

record MemberLeavePacket(
        UUID partyUUID,
        UUID member
) implements Packet {
}

record DisbandPacket(UUID partyUUID) implements Packet {
}

}

chrome beacon
#

?paste

undone axleBOT
kind coral
#

oops

mortal vortex
#

Sending packets is as simple as:

public void sendPacket(Packet packet) {
    try {
        out.writeObject(packet);
        out.flush();
    } catch (IOException e) {
        e.printStackTrace();
    }
}
pseudo crypt
#

I am writing a plugin that allows whitelisted ip addresses to join via offline mode, otherwise online mode is required. I am using Protocol Lib but I don't know if thats all I need. Here is my player join code. Does anyone have any suggestion because this project is out of my comfort zone lol.

ProtocolLibrary.getProtocolManager().addPacketListener(new PacketAdapter(plugin, ListenerPriority.NORMAL, PacketType.Login.Client.START) {
            @Override
            public void onPacketReceiving(PacketEvent event) {
                if(event.getPacketType() != PacketType.Login.Client.START) return;

                PacketContainer packet = event.getPacket();

                try {
                    if(event.getPlayer().getUniqueId().toString().split("-")[2].startsWith("4")) {
                        // Microsoft account
                        return;
                    }
                } catch (Exception e) {
                    String hostname = event.getPlayer().getAddress().getAddress().getHostAddress();
                    if(OfflineWhitelist.whitelist.contains(hostname)) {
                        PacketContainer connectPacket = new PacketContainer(PacketType.Login.Server.SUCCESS);

                        connectPacket.getGameProfiles().write(0, new WrappedGameProfile(UUID.randomUUID(), event.getPlayer().getName()));
mortal vortex
pseudo crypt
#

This is a private server

#

The purpose is to allow our custom bot accounts to join so we don't have to buy a bunch of alts

#

So to answer your question, any username, no PW

#

or at least that isn't a current concern

torn shuttle
#

do you even need protocollib for this

#

I've never handled IPs but surely you can just use spigot's join event and player#getAddress for this

kind coral
#

Btw you could check if a player is offlineplayer if their UUID is made from the bytes of the string "OfflinePlayer:" + player.getName(), if that matches i believe its their offline UUID

#

else its their online UUID

#

then i guess just check the ip

torn shuttle
#

I woudln't even check the ip

#

I'd just force those accounts to write a shared password if it's a private server

kind coral
#

or maybe have a precise name

#

like botsecure_1

torn shuttle
#

assuming the people playing together aren't idiots there's no real chance of it becoming a problem

kind coral
#

if it starts with botsecure just let it in

#

or yeah let them in and just listen for the chatevent before they can do anything

#

so they send a "password"

torn shuttle
#

a shared password would still be better imo

mortal vortex
thorn isle
#

by the time the players are able to send passwords via chat or do anything like this your server is already compromised unless you are also filtering everything else with e.g. authme

#

from what i understood this is an online mode server meaning it won't have authme

#

and so any offline mode accounts allowed to do anything at all definitely need to be vetted before they can chat/command

torn shuttle
#

compromised seems like a strong word for what is a bunch of friends playing in a shared private server

thorn isle
#

might as well turn online mode off altogether at that point

torn shuttle
#

which is basically what they're are doing for their friends, yeah

thorn isle
#

for bots

torn shuttle
#

yep

thorn isle
#

are their friends bots?

torn shuttle
#

I mean yeah based on what they said

#

The purpose is to allow our custom bot accounts to join so we don't have to buy a bunch of alts

#

I assume the alts are for the friends

thorn isle
#

that's not what my first interpretation would be but i could see that too

pseudo crypt
torn shuttle
#

I think you're overcomplicating things for what it sounds like you're building

#

I'd just do what I recommended, have a shared password if you log in with a non-legit account and basically just hold the bot in place / kick it if it fails to do the secret handshake

pseudo crypt
#

Yeah I get that. My problem is getting the server to allow the bot/offline accounts to spawn in. I'll worry about auth once I get this done. Id like to keep online-mode set to true

#

So setting aside security, I want to allow offline accounts to join an online server

thorn isle
#

i don't know if spigot/paper lets you turn off auth in the login/prelogin event (you best check there) but if it doesn't, i know velocity does

pseudo crypt
#

The prelogin event is fired after the server tries authenticating with the user. So that event is never fired when an offline account tries to join

torn shuttle
#

if it's a private server for just a group of friends I don't think there's much harm in making it offline mode, but hey I won't criticize someone for trying to make things more secure either

thorn isle
#

there are a few concerns with flipping online mode off

#

notably, uuids will change

pseudo crypt
#

correct

thorn isle
#

name changes won't be supported

#

and some skin rendering issues

#

you can patch most of this with extra plugins but it'll be a good bit of work

pseudo crypt
thorn isle
#

you could get uh

#

authme, fastlogin, skinsrestorer

torn shuttle
#

yeah

thorn isle
#

with the correct setup this should preserve uuids, support name changes, and not require /login for premium players

torn shuttle
#

pretty sure that's how the russians I keep doing support for do it

thorn isle
#

the other option that i see is to start a velocity proxy and write a quick velocity plugin that turns off mojang auth in their connect event

pseudo crypt
thorn isle
#

although i'm not sure if velocity even works with spigot

#

geyser standalone or bukkit?

pseudo crypt
pseudo crypt
thorn isle
#

i have no experience with geyser bukkit, but i have a vague feeling that it might work

#

you best check with the geyser/fastlogin guys if you run into issues, but i don't foresee trying it causing any permanent damage

#

if it doesn't work, uninstall the plugins and things and start looking into other options

#

all that said i'm almost certain that running a velocity proxy with modern ip forwarding and a lightweight auth on-off plugin on the velocity server would be easier

wet breach
#

one that requires no plugins at all 🙂

#

use a proxy. Proxy is online mode and that is what everyone uses, the server has to be offline mode to connect to said proxy. Allow your bots to connect directly to the server. Use firewall rules for the ip address whitelisting to allow them to connect to the server directly

#

voila, players are online mode, bots are offline mode and all should be able to connect 😉

pseudo crypt
#

When a server is ran in offline mode, do you then add ip addresses to the whitelist?

thorn isle
#

not sure how this works apart from modern ip forwarding, but my understanding is that any setup that allows connections from sources other than the proxy will not work with ip/uuid forwarding, which would again break player inventories

#

i.e. if you do do uuid forwarding it'll reject connection attempts not made from the proxy, no?

#

and without uuid forwarding your player data is busted

wet breach
thorn isle
#

the issue with this by default is that the backend server will see an offline mode player and assign an offline mode uuid

#

likewise, it will see the proxy's ip rather than the player's own

#

to cope with this there are methods for ip/uuid forwarding, where the proxy communicates those properties to the backend

wet breach
#

idk what your talking about. Yes the bots would have an offline UUID but why is that an issue?

#

we are not talking players here

thorn isle
#

the server is in offline mode, yes?

wet breach
#

they have to be to connect to the proxy

thorn isle
#

since the server is in offline mode, it will assign offline mode uuids to ALL joining players

wet breach
#

not sure if you ever setup bungeecord with mc servers before?

thorn isle
#

including those coming from the proxy

thorn isle
#

only if you use ip/uuid forwarding

wet breach
#

you don't need to use that but can if you want

#

its not a requirement

thorn isle
#

if you don't use it, you will get offline mode uuids

wet breach
#

no

thorn isle
#

no?

wet breach
#

proxy handles the authentication and passes it to the servers

thorn isle
#

that's the "forwarding" part

wet breach
#

no

#

that is only if you want the players ip to be shown on the server or the proxies

#

other then that it has nothing to do with authentication

thorn isle
#

i'm fairly sure either both or neither ip and uuid are forwarded, not one or the other, but since i haven't used bungee since like 1.8 or something i'll defer to your judgement

wet breach
#

if players were instead to connect directly to the mc server without going through the proxy, then yes they would have an offline UUID

#

but this is why I said use firewall rules to whitelist the ip's you want to allow to do that so that not everyone can do that

#

so all players go through proxy for authentication, the bots directly connect to the mc server 🙂

thorn isle
#

is this outdated?

#

Without enabling IP forwarding, the proxy IP will be displayed for all players, possibly causing problems when it comes to IP bans and the UUIDs of your players will be in offline mode which will result in issues when a player changes his name.

#

this is how i remember it working, too

#

but this was last updated in 2018 so god knows 🤡

wet breach
#

sure enable it if you want, however it has nothing to do with directly connecting to an MC server

#

nor prevents it

thorn isle
#

if you connect to it directly you for sure get an offline mode uuid

#

what i'm talking about is you connecting through the proxy

wet breach
#

ok, but that isn't the issue here

#

the issue here is how to allow bots to connect without authenticating

thorn isle
#

without reverting regular players to offline mode uuids

wet breach
#

and it won't if you enable the thing you said

#

but it still doesn't prevent directly connecting to the mc server

#

which bypasses authenticating

thorn isle
#

then that's fine

wet breach
#

in otherwords what I have been saying solves their issue with the whole authenticating part for their bots without compromising their network and it being all in offline mode for the players too

#

so the players are still authenticated, and now they have a way to allow bots to join without dealing with the authentication since they are not players

#

@pseudo crypt you can if you want run a plugin for whitelisting on top of firewall rules if you want a bit more security

thorn isle
#

yeah i was just pointing this out because on paper+velocity enabling forwarding requires clients to connect with the velocity secret

#

but bungeecord seems to work differently

wet breach
#

well I don't care about those

#

this is spigot and bungeecord discord

pseudo crypt
thorn isle
#

sure, just saying what i know

torn shuttle
#

secret of velocity would make for a great name of a sonic movie

pseudo crypt
wet breach
#

they stated that what I described wouldn't work with velocity

pseudo crypt
#

oh rip

wet breach
#

you would need to use bungeecord. keep in mind this discord is for help with spigot+bungeecord

pseudo crypt
#

Fair

#

Im getting an issue where the whitelist is blocking players now. Using Bungeecord. I assume this is because the UUID isn't the same now?

wet breach
#

idk how you have the whitelisting setup

#

personally I wouldn't even use a plugin

#

I would just use the firewall to control who can or can't connect to the mc server directly

mortal vortex
wet breach
#

their goal is to allow their bots to connect to the MC server without the need of authenticating but still making it to where the players have to authenticate

leaden oracle
#

is this a server to ask random plugin questions at?

wet breach
#

this channel is specifically more towards coding/development stuff. #help-server is the channel for help relating to server and sometimes plugins

leaden oracle
#

alright ty

latent rampart
#

hi again everyone c:

#

im trying to use a custom item in a recipe, and i havent rly figured out how to and im not sure if im misunderstanding how nbt tags work or something is fundamentally wrong

#
    /* Enchanted Cobblestone */
    thisItem = new ItemStack(Material.COBBLESTONE, 1, (short)255); // Assigned data value 255 for later reference
    thisMeta = thisItem.getItemMeta();
    thisMeta.setDisplayName("§6Enchanted Cobblestone");
    thisLore = new ArrayList<String>();
    thisLore.add("Dissolves into 8 Cobblestone when put in a Crafting Table");
    thisMeta.setLore(thisLore);
    thisMeta.addEnchant(Enchantment.LUCK, 1, false);
    thisMeta.addItemFlags(ItemFlag.HIDE_ENCHANTS);
    thisItem.setItemMeta(thisMeta);

    thisRecipe = new ShapelessRecipe(thisItem);
    thisRecipe.addIngredient(8, Material.COBBLESTONE);
    shapelessRecipes.add(thisRecipe);

    thisRecipe = new ShapelessRecipe(new ItemStack(Material.COBBLESTONE, 8));
    thisRecipe.addIngredient(1, Material.COBBLESTONE, 255); // Use unique data value
    shapelessRecipes.add(thisRecipe);
#

i assign a tag with 255 to differentiate it from regular cobblestone

#

but when i use regular cobblestone it still acts the same lol

#

im using the 1.8.8 spigot api, so i dont have access to NamespacedKey

#

which is why im trying to do this

#

anyway, i thought adding a specifier to the recipe would make it look for the 255 when validating the recipe but i guess not

#

am i doing this wrong or is there some other approach i can go for?

worldly ice
#

isn't #addIngredient(int, Material, int) deprecated?

#

not sure if 3rd param is even referring to what you think it is

#

either way you'd have to manually listen to the craft event to do what you want to do

#

because you can't require custom nbt in crafting recipe ingredients

pseudo crypt
#

BungeeCoord isn't working for me. Is there a way I can listen for player authentication so I can add my own logic? The server is set to online-mode, but I want offline players to be able to join from a custom whitelist.

latent rampart
wet breach
latent rampart
#

im not sure

latent rampart
#

does this allow me to manually check the values in the crafting table and then do a deep comparison of the meta of the item?

worldly ice
#

yes

latent rampart
#

i feel like thats what id have to do

worldly ice
#

you can view the crafting matrix and determine if it matches your recipe or not

pseudo crypt
wet breach
#

how is it different from making a plugin?

latent rampart
wet breach
#

It isn't, this conversation goes back before you requested some help

latent rampart
#

oh okay :3

timber eagle
#

Hey guys is NBT data stored in the itemstack's itemmeta

#

I just recently did a test and it's confirming yes, I don't know if this is common knowledge or not

thorn isle
worldly ice
#

yes

thorn isle
latent rampart
#

so i can do #.getRecipe() and that returns the items used in the crafting table?

#

or no

#

probably getInventory

timber eagle
latent rampart
#

i guess the crafting grid is an "inventory"

latent rampart
timber eagle
#

okay thank you

latent rampart
#

but i was doing nbt and meta at the same time so it might not be mutually exclusive

sour mist
#

Hey, can someone help me? I've uploaded my first plugin and don't know how to update or upgrade it or do I need to be activated first?

remote swallow
#

Make sure you have 2fa on and the update button is where others download iirc

latent rampart
#

how do i "listen for an event"?

pseudo crypt
latent rampart
#

can i just define a function named the same as the event as like a callback? or do i need to do something more

worldly ice
#

wait that's bungeecord

#

gimme a sec

#

this one should be spigot

thorn isle
pseudo crypt
thorn isle
#

they are by default

#

whatever logic you use to allow someone to log on without mojang auth is up to you

#

it could be a list of names in a txt file

pseudo crypt
#

fair

thorn isle
#

or to require it to start with bot_

#

or you could listen to failed auth attempts and add those players to a list, allowing them to log without auth on retry

#

depends on your use case

#

which i still am not exactly clear on

#

when you say bot i imagine something that's used by something programmatic, like a plugin or a mod

pseudo crypt
#

gotcha

#

authenticated player UUIDs have a 4 at the start of the third 'chunk' unlike offline so I think I can go by that

thorn isle
#

depends a bit

#

iirc tlauncher specifically sends type 4 uuids even for offline mode players

#

has something to do with their custom skin system

pseudo crypt
#

dang nvm lol.

thorn isle
#

if you want to make sure, query the mojang api with the uuid and see if the name associated with it, if any, matches the player's

#

you could also base it off the address the player is connecting with, since the client reports that

#

but if it's just a private server with friends, you can probably just manage a list of allowed names manually

#

or tell them not to use tlauncher specifically

pseudo crypt
#

@thorn isle You've been a great help. Thank you

slim wigeon
#

I need this list checked, been searching on the internet and using ChatGPT. The list I finding is not up to date:``` public boolean isHostile(EntityType type) {
List<EntityType> hostiles = Arrays.asList(
EntityType.BLAZE, EntityType.CREEPER, EntityType.DROWNED, EntityType.ELDER_GUARDIAN, EntityType.ENDER_DRAGON,
EntityType.ENDERMITE, EntityType.EVOKER, EntityType.GHAST, EntityType.GUARDIAN, EntityType.HOGLIN, EntityType.HUSK,
EntityType.MAGMA_CUBE, EntityType.PHANTOM, EntityType.PIGLIN_BRUTE, EntityType.PILLAGER, EntityType.RAVAGER,
EntityType.SHULKER, EntityType.SILVERFISH, EntityType.SKELETON, EntityType.SLIME, EntityType.STRAY, EntityType.VEX,
EntityType.VINDICATOR, EntityType.WARDEN, EntityType.WITCH, EntityType.WITHER, EntityType.WITHER_SKELETON,
EntityType.ZOGLIN, EntityType.ZOMBIE, EntityType.ZOMBIE_VILLAGER, EntityType.ZOMBIFIED_PIGLIN
);

    return hostiles.contains(type);
}```
blazing ocean
#

please make that static

#

(the list)

slim wigeon
blazing ocean
#

never said that

pseudo hazel
#

i guess the only ones missing are bogged, breeze and creaking

smoky anchor
slim wigeon
#

This is what I talking about. There are mobs that does not belong in the hostile and some are missing from the hostile like Spiders is hostile

smoky anchor
#

Spiders are hostile only during night and neutral during day.

#

You thought it was gonna be that easy ? :D

slim wigeon
#

Yes, I always known spiders as hostiles

smoky anchor
#

Also, piglins are neutral if you wear gold. Don't despawn on peaceful but also don't attack you.
You may have to take these things into account depending on what you're doing..

pseudo hazel
#

brutes are not neutral

#

thats just the normal piglins

blazing ocean
#

yea ^

pseudo hazel
#

brutes can see through your golden facade and even rile up other piglins

slim wigeon
#

This is why I need the list but I have given up. Next task, how can I turn all these to player heads that shows the mobs faces?

smoky anchor
pseudo hazel
#

lol

#

but yeah your heads question is harder to answer

#

youll need to find the skin ids of the mob skins

#

presumably there is a usable set of heads online

slim wigeon
#

I tried to get their IDs but the websites they located won't load

#

Like someone is running DDOS on it, any other places that has these UUIDs?

blazing ocean
#

a website being down does not mean it is being DDoS'ed

slim wigeon
#

Its impossible to get these mob player heads?

#

I still searching and finding nothing

#

I found a russia site but that does not work

ashen crane
#

So I tried this, it seems to think that the item in that slot doesn't exist though. as the string returned us "air" I believe the item created by the anvil is a phantom item according to minecraft

blazing ocean
#

I think your best bet is to step through that with a debugger, it's extremely helpful for that kind of stuff

slim wigeon
#

Who?

blazing ocean
#

not you

jagged thicket
#

@slim wigeon

#

try "MHF_<mobname>"

#

like MHF_Creeper

smoky anchor
#

These are not updated with the 1.14 textures
And it does not include all mobs

jagged thicket
#

i see FF

slim wigeon
#

...

ashen crane
remote swallow
#

If ur on latest ur MenuType

young knoll
#

minecraft-heads is your best bet to get all the mob heads

#

You’ll have to manually map each one

ashen crane
slim wigeon
chrome beacon
#

1000 lines happens sometimes

#

and you shouldn't split things up just because of the lines (but it might be something worth thinking about for a bit)

wet breach
chrome beacon
#

You don't really have to think about that

slim wigeon
# young knoll You’ll have to manually map each one

I don't mind doing that, I just need a list of usernames and urls. I don't remember what each mob looks like. So it may be hard but I do know how some looks like. I can see how to make the player mob, I just need the list

chrome beacon
#

You're not going to hit that limit

wet breach
#

not in 1k lines no

ashen crane
#

im talking about the AnvilGUI plugin, not one i made myself, i tried looking at their code to see how they did it but tbh too high level for me im new to minecraft coding

chrome beacon
#

You could just use AnvilGUI and come back to it later

ashen crane
#

id like to but the person im working for requested that i do it myself

wet breach
#

also there is other considerations too, like stack size not entirely sure how many local variables you would need to hit the default stack size limit though

#

not quite something I have tried to test 🤔

remote swallow
slim wigeon
mortal vortex
#

You said you’re new though? What position are you in?

slim wigeon
# pseudo hazel but why though

Maybe the person don't want a DMCA so they are being cautious about other code. That is why I making my plugins, I don't want to get involved with that

pseudo hazel
#

hmm

chrome beacon
#

AnvilGUI is under the MIT license

#

So you're fine if you want use it

slim wigeon
#

Can I use my own player head and put a texture on it or do I still need the player username?

chrome beacon
#

You don't need the username

slim wigeon
#

Ok thanks, that makes things easier

mortal vortex
#

How has MrNate still not been banned or warned even for asking for an illegal copy of a premium plugin be sent to him.

dry hazel
#

no one is going to send it to them anyway

chrome beacon
#

ah I see they failed to listen to any of the things we told them and begged for the premium plugin so they could look at the code (or just use that plugin, idk)

remote swallow
#

they did get provided 2 other plugins but didnt use or look at them, or download the source and modify the source of the plugin they used to use

slim wigeon
#

My SSI Check better hurry the f*** up

tranquil pecan
blazing ocean
#

?fork

undone axleBOT
#

SpigotMC maintains the Spigot server. If you are using a fork of Spigot (such as Paper, Airplane, Purpur, or other derivative works), you should seek support in the appropriate Discord servers.

tranquil pecan
#

c'mon this is literally the same

blazing ocean
#

it really isn't

tranquil pecan
#

The server is using purpur not my plugim

blazing ocean
#

which is why you should ask purpur

jagged thicket
tranquil pecan
#

ok then

chrome beacon
#

🔥 infinite loop

#

We love recursion

tranquil pecan
#

I dont

chrome beacon
#

Plugin deals damage in the damage event

#

which triggers damage event

#

loop and repeat

tranquil pecan
#

oh

#

So, what if it was PlayerInteractEvent and not EntityDamageByEntityEvent

chrome beacon
#

Just change the damage of the damage event

#

Instead of triggering another one

tranquil pecan
#

Oh it's working

slim wigeon
tranquil pecan
# chrome beacon Just change the damage of the damage event

Oh never mind I got what you mean this is working now. I could do setDamage instead of target.damage ☠️

    public static void dealDamage(Player attacker, LivingEntity target) {
        boolean isCrit = hasCrit(attacker);
        double damage = calculateFinalDamage(attacker, isCrit);

        AeroPlayerDamageEntityEvent event = new AeroPlayerDamageEntityEvent(attacker, target, damage, DamageType.NORMAL, isCrit);
        Bukkit.getPluginManager().callEvent(event);

        if (event.isCancelled()) {
            return;
        }

        double finalDamage = event.getDamage() * event.getMultiplicativeMultiplier() + event.getAdditiveMultiplier();
        event.setDamage(finalDamage);
        plugin.getDamageIndicator().spawnMarker(target, finalDamage, isCrit);
    }```
river oracle
#

visual basic? that looks like java

tranquil pecan
chrome beacon
#

Code block is set as Visual Basic instead of Java for some reason

tranquil pecan
#

Yes cause i used vb and not java

slender elbow
#

yeah

#

why?

slim wigeon
#

I got one issue. When is the BREEZE be added to EntityType? I asking because its not being detectedtextures.put(EntityType.BREEZE, "80843a94f925b5598924ff9b52b7999c8d29d1b790ad487dd54e27956e540d20");But I on the server getting hit by one in godmode as I type

thorn isle
#

what do you mean by not being detected?

#

as in "cannot find symbol"? make sure you're building against the 1.21 api

#

also make sure your api-version in plugin.yml is set to 1.21

#

i'm not sure if it happens with the entitytype enum but i know the server does weird remapping shit with materials if it doesn't match what the server is running on

golden turret
#

how can i get the time the server was ready? i mean when the "type /help" message appears

worthy yarrow
#

Like how long it took the server to load up?

thorn isle
#

doesn't it print that somewhere by default

worthy yarrow
#

yea

#

Should print "took x ms to startup" or something similar at the bottom of your console when it loads up

golden turret
worthy yarrow
#

wot

thorn isle
#

mm fair point

#

he probably wants to get it programmatically

#

which, uh, i don't know

#

plugins are instantiated very early on

worthy yarrow
#

I don't think that's something rather publicly accessible...

thorn isle
#

so you could probably take a timestamp in your plugin ctor

worthy yarrow
#

^ you'd have to write the impl yourself

thorn isle
#

you'll probably miss out on the first few seconds while the jvm and server internals spin up, but that should be fairly negligible

worthy yarrow
#

hmmm new pr to get the startup time of the server

eternal night
#

can't you just like

thorn isle
#

looking at my logs, the time between the process being launched and first plugin clinit is about 13 seconds

eternal night
#

track that via your plugin?

#

oh

thorn isle
#

that's kind of difficult since plugins aren't loaded instantly

eternal night
#

sure but that difference is rather small no?

#

at least till onLoad hits

#

onEnable could take a while longer while other plugins enable

thorn isle
#

sure, it should be good enough for most applications

worthy yarrow
#

Yeah but ya never know what the use case is for so it's hard to say what they need from it I guess

thorn isle
#

ctor fires far earlier than onLoad though, so you'll want that

eternal night
#

but like, onLoad should be only a couple seconds after the server started

blazing ocean
thorn isle
#

you could maybe like read the file created metadata on latest.log or something ♿ but i doubt that's worth the 5-10 second skew in
numbers

remote swallow
thorn isle
#

the real winning move is to start loading shit asynchronously onLoad and then join that thread/future onEnable

remote swallow
#

or join in onLoad and blame paper for server startup taking so long smortbork

blazing ocean
#

make a paper bootstrapper

thorn isle
#

that way multiple plugins can do their heavy lifting in parallel, and you may save as much as 3 seconds of startup time

remote swallow
blazing ocean
#

even better

thorn isle
#

which doesn't sound like much, but over the course of a server's lifetime, it will add up to minutes

worthy yarrow
#

🤷 Just from onload -> enable of this plugin

chrome beacon
#

|| You can always read the log ||

worthy yarrow
#

I think vcs mentioned that

thorn isle
#

instant

eternal night
#

Terrible Sadge 1.7s vs 2.5

#

this is it 😦

thorn isle
#

try the ctor

#

that fires marginally earlier

trail cargo
#

I am developing a plugin where blocks are summoned in world, and players can right-click them to gain specific effects.
To distinguish interactable blocks, I store a specific value in the block's PDC (Persistent Data Container).

A. Use the library JEFF-Media-GbR/CustomBlockData to store PDC
Supports custom blocks, custom furniture, and all Minecraft blocks.
However, it is not compatible with WorldEdit and may have uncontrollable bugs.
(This library tracks most state changes, such as piston movement like B.)

B. Store PDC in BlockState, allowing only tile entity blocks
Limited to Minecraft's tile entity blocks.
Ensures compatibility without major issues.

Which option would be the better choice?

I'm currently torn between allowing only tile entity blocks to control uncontrollable bugs and code or taking the risk for more customization options.

-# transted to english from korean by ai

This plugin is simillar to supply box in PUBG
And block just spawn, not moving.

thorn isle
#

how many blocks are there? will more be added or will some be removed at runtime, or will they always be the same?

chrome beacon
#

Supply boxes are usually chests which are tile entities

trail cargo
trail cargo
thorn isle
#

are they all naturally tile entities like chests, or will there be non-TE blocks also?

#

visually, that is

thorn isle
#

generally

trail cargo
#

hmm...

thorn isle
#

if you limit it to support only TE's, this will be very simple

trail cargo
#

yeah

thorn isle
#

because all TE's support pdcs naturally

trail cargo
#

thats B option

thorn isle
#

i would recommend going with that unless you absolutely need something else

trail cargo
#

But some or many owners may want customizable supply box (like custom furniture from IA, Oraxen, Nexo)

thorn isle
#

no clue about IA or whatever nexo is but iirc oraxen listens to physics and other events to keep track of its own data

#

if your world map is static and won't allow explosions/pistons, you can just have a Block -> crate hashmap in memory

trail cargo
#

survival map

pure dagger
#
private ItemStack parseTool(ConfigurationSection toolSection) {
        if (toolSection == null) return null;
        String materialString = toolSection.getString("material");
        if (materialString == null) return null;

        Material material = Material.matchMaterial(materialString.toUpperCase());
        if (material == null) return null;

        int amount = toolSection.getInt("amount", 1);

        ItemStack item = new ItemStack(material, amount);
        ItemMeta meta = item.getItemMeta();
        if (meta == null) return item;
        String displayName = toolSection.getString("display_name");
        if (displayName != null) {
            meta.setDisplayName(ChatColor.translateAlternateColorCodes('&', displayName));
        }
        List<String> lore = toolSection.getStringList("lore");
        lore.replaceAll(line -> ChatColor.translateAlternateColorCodes('&', line));
        meta.setLore(lore);
        item.setItemMeta(meta);
        ConfigurationSection enchantmentsSection = toolSection.getConfigurationSection("enchantments");
        if (enchantmentsSection != null) {
            for (String enchantName : enchantmentsSection.getKeys(false)) {
                int enchantLevel = enchantmentsSection.getInt(enchantName, 1);
                Enchantment enchant = Registry.ENCHANTMENT.get(NamespacedKey.minecraft(enchantName));
                if (enchant == null) continue;
                item.addUnsafeEnchantment(enchant, enchantLevel);
            }
        }
        return item;
    }

is this ok?

trail cargo
#

if static I can use A option. but not

thorn isle
#

then you also need to write around 15 different listeners to handle physics, explosions, water, pistons, withers, endermen, so on and so on

dense falcon
#

When the player join I print the server name and I got this : Server Name: CraftBukkit, how may I edit this I mean rename the server name?

chrome beacon
#

How are you printing the server name

dense falcon
#
        String serverName = player.getServer().getName();

        System.out.println("Server Name: " + serverName);
chrome beacon
#

hm? why do you want to change that

dense falcon
#

To adapt my main plugin.

#

For multiple servers.

#

I would like to add to the player some items when he is in a lobby server and only in this type of serv.

chrome beacon
#

That getName method returns the name of the server implementation

thorn isle
#

that doesn't seem like the ideal way of going about this

remote swallow
#

fork the server then

chrome beacon
#

You can have a server name in your config or smth

dense falcon
#
    private void lobbyGiveItem(Player player) {
        String serverName = player.getServer().getName();

        System.out.println("Server Name: " + serverName);

        if (!serverName.toLowerCase().startsWith("lobby")) {return;}

        ItemStack compass_minigames = new ItemStack(Material.COMPASS, 1);
        ItemMeta compass_minigames_meta = compass_minigames.getItemMeta();
        compass_minigames_meta.setDisplayName(ChatColor.GOLD + "" + ChatColor.BOLD + "Mini-Jeux");
        compass_minigames_meta.addEnchant(Enchantment.UNBREAKING, 3, true);
        compass_minigames_meta.addItemFlags(ItemFlag.HIDE_ATTRIBUTES, ItemFlag.HIDE_ENCHANTS);
        compass_minigames.setItemMeta(compass_minigames_meta);

        ItemStack head_stats = new ItemStack(Material.PLAYER_HEAD, 1);
        ItemMeta head_stats_meta = head_stats.getItemMeta();
        head_stats_meta.setDisplayName(ChatColor.GREEN + "Informations & Statistiques");
        head_stats_meta.addEnchant(Enchantment.UNBREAKING, 3, true);
        head_stats_meta.addItemFlags(ItemFlag.HIDE_ATTRIBUTES);
        head_stats.setItemMeta(head_stats_meta);

        ItemStack emrald_shop = new ItemStack(Material.EMERALD, 1);
        ItemMeta emrald_shop_meta = emrald_shop.getItemMeta();
        emrald_shop_meta.setDisplayName(ChatColor.BLUE + "Boutique");
        emrald_shop_meta.addItemFlags(ItemFlag.HIDE_ATTRIBUTES);
        emrald_shop.setItemMeta(emrald_shop_meta);


        player.getInventory().clear();
        player.getInventory().setItem(0, compass_minigames);
        player.getInventory().setItem(1, compass_minigames);
        player.getInventory().setItem(8, compass_minigames);
    }
thorn isle
#

register a plugin channel and send a bungeecord message to fetch the server's configured name

#

then run logic on that

chrome beacon
#

Yeah that's probably a better idea

thorn isle
#

then again that means either the name to match needs to be configurable, or all admins need to set the lobby server names to some hardcoded value

dense falcon
#

But why is this a better idea than recovering from the local server???

thorn isle
#

the local server doesn't know

trail cargo
dense falcon
#

And if I use MOTD?

thorn isle
#

well like there is some server name property in server.properties i think, but i've never seen anyone use it

dense falcon
#

It's a "sub" server so.

thorn isle
#

no, that is stupid

dense falcon
#

No one can see it.

thorn isle
#

read a value from the config

#

"isLobby: true/false"

remote swallow
#

the developer of it is well known and will most likely fix any bugs found

thorn isle
#

i don't know anything about those third party plugins so my design would be to keep it as a furnace or something server-side, and then spoof a different BlockData for it using Player::sendBlockChange, or the third party plugin api where appropriate

trail cargo
thorn isle
#

will work with worldedit, block pistons, etc. all natively through minecraft's own block handling

trail cargo
#

okay, I gonna use option A!

#

thx for reply!

echo basalt
trail cargo
thorn isle
#

don't we all

#

what if the player teleports/disconnects/dies

#

entities might unload before the appropriate events fire, i don't think there are any guarantees around this

#

all that said it will be "safe" as long as you check isValid on the armorstand before doing anything with it

#

also, make sure to setPersistent(false) so it doesn't get left behind and saved in a chunk and stick there permanently if you somehow do happen to lose track of it

echo basalt
#

not safe

#

Even if the entity's invalid it's still prevent in memory

#

To be 100% certain just map UUID : UUID and call getEntity often

#

and do null checks ig

#

or use an IdentityHashMap iirc

#

or store weak references

thorn isle
#

sure, but to be fair entity instances are far, far smaller than player instances; you'll struggle to create a non-negligible memory leak even if you're keeping thousands of them in that map

echo basalt
#

entity instances track the world too

thorn isle
#

player instances are noteworthy because they hold onto statistics and other things

echo basalt
#

entities aren't that small

#

they have a hard reference to their chunk, world and data

#

Might also have, for example, a target player in their pathfinding goals

#

If you can minimize the scope of your leak why argue against it?

chrome beacon
#

Yeah weak ref if you really want to keep the entity in a map

thorn isle
#

there is a balance to be maintained between boilerplate and accounting for the 0.1% case of someone creating and unloading hundreds of worlds on the fly

#

personally i draw that between entity.isvalid and bukkit.getentity

#

but yes, you can use bukkit.getEntity with an UUID->UUID map if you like, that is safer

pure dagger
#

when server is stopped, first happend onquit event for each player and then ondisable() ?

thorn isle
#

i vaguely remember onDisable being called first

#

specifically because i had this per world inventory kotlin plugin at one point where the developer neglected to save inventories in onDisable, only onQuit

echo basalt
#

I vaguely remember onQuit not firing

thorn isle
#

so every time the server restarted, none of the inventories would save

chrome beacon
thorn isle
#

so i wrote a plugin that kicked everyone onDisable 🤡

echo basalt
#

prob after onDisable then yeah

chrome beacon
#

wait I no it's the kick event that gets triggered

#

mb

thorn isle
#

i suppose the idea behind designing them to fire this way around is that plugins can e.g. remove metadata from players on shutdown, in case the plugin will be uninstalled before next startup

pure dagger
#

oh,...

thorn isle
#

so all players are available for all plugins to process on shutdown

pure dagger
#

so i haveto do the same thing in ondisable

thorn isle
#

myeah

#

put your "player cleanup" logic in a separate method and call it both onquit and ondisable

#

repeating yourself is a grave sin after all

echo basalt
#

hm

#

I recall hypixel having a uuid wrapper called EntityId

#

bet it has getEntity methods

thorn isle
#

if i had to go about doing wrappers, it'd probably hold a weakref to the entity and re-reference the entity from bukkit.getentity if cleared/invalid

echo basalt
#

weakref costs memory and has some cpu time as well iirc

thorn isle
#

they're not that expensive

#

it's like maybe 10 extra bytes on top of the ref itself

echo basalt
#

Performance on my block scanning logic tanked after 1.13.2's location world -> weakref changes

#

because distance checks constantly spammed world ref get()

#

(yes, I profiled it)

thorn isle
#

oh for sure, it's an extra pointer deference, that will be noticeable compared to a direct reference in hot loops

chrome beacon
#

Weak ref shouldn't have that much of a perf difference 🤔

#

Sure it's some but it shouldn't tank it

thorn isle
#

however... i suspect making a call to bukkit's uuid -> entity map is even slower

echo basalt
#

it was like 50% of all the cpu time in my code

thorn isle
#

as you will be spinning uuid.equals, hashcodes, branching here and there, and potentially colliding all over the place

chrome beacon
#

???

#

50%

echo basalt
#

I did call it millions of times

thorn isle
#

the bigger practical cost with weakreferences is the cleanup, but that will happen once in a blue moon for entities, and block->world too

thorn isle
pure dagger
#

or do i have to get OfflinePlayer instances

thorn isle
#

what are you doing

pure dagger
#

hmm

#

good question

dense falcon
#

Main : ```java
public final class LupusLand extends JavaPlugin implements PluginMessageListener {
@Override
public void onEnable() {
...

    this.getServer().getMessenger().registerOutgoingPluginChannel(this, "BungeeCord");
    this.getServer().getMessenger().registerIncomingPluginChannel(this, "BungeeCord", this);
}

@Override
public void onDisable() {
    this.getServer().getMessenger().unregisterOutgoingPluginChannel(this);
    this.getServer().getMessenger().unregisterIncomingPluginChannel(this);
}

@Override
public void onPluginMessageReceived(String channel, Player player, byte[] message) {
    if (!channel.equals("BungeeCord")) {
        return;
    }
    ByteArrayDataInput in = ByteStreams.newDataInput(message);
    String subchannel = in.readUTF();
    if (subchannel.equals("GetServer")) {
        String serverName = in.readUTF();
        getLogger().info("Le joueur " + player.getName() + " est sur le serveur : " + serverName);
        System.out.println("Server Name: " + serverName);

        if (serverName.toLowerCase().startsWith("lobby")) {
            getServer().getScheduler().runTask(this, () -> {
                System.out.println("IN LOBBY");
            });
        }
    }
}

}


Join Event :
```java
ByteArrayDataOutput out = ByteStreams.newDataOutput();
        out.writeUTF("GetServer");
        player.sendPluginMessage(plugin, "BungeeCord", out.toByteArray());
        plugin.getLogger().info("Message envoyé au proxy BungeeCord pour obtenir le nom du serveur.");

I don't see other print, logs only from my join event.

thorn isle
#

where are you sending your bungeecord message?

#

for bungeecord to send you something (i.e. for onPluginMessageReceived to fire) you will need to send bungeecord something first

dense falcon
#

?

thorn isle
#

it's a response

#

there won't be a response without a query

pure dagger
# thorn isle what are you doing

when player enters a region: i give them new inventory and store their normal inventory, when they leave the region: i sell the items from the inventory and give them back their normal inventory with their items
but when onDisable() i wanna sell it and give them the inventory (as they would left the area), and in onEnable give all players that are in the region the new empty inventory

understand?

dense falcon
#

"Join event".

#

When the player join the lobby, it sending.

thorn isle
#

let's see that code

dense falcon
#

It's under the main code.

thorn isle
#

not in whole

dense falcon
#
        ByteArrayDataOutput out = ByteStreams.newDataOutput();
        out.writeUTF("GetServer");
        player.sendPluginMessage(plugin, "BungeeCord", out.toByteArray());
        plugin.getLogger().info("Message envoyé au proxy BungeeCord pour obtenir le nom du serveur.");
thorn isle
#

i can't see the method signature

dense falcon
#

The only print I have it's from the getLogger.

thorn isle
#

send your whole listener

#

and make sure you're enabling your listener

dense falcon
#
    @EventHandler
    public void onPlayerJoin(PlayerJoinEvent event) throws Exception {
        Player player = event.getPlayer();
        String username = player.getName();
        String uuid = player.getUniqueId().toString();
        String ip = (player.getAddress() != null) ? player.getAddress().getAddress().getHostAddress() : "UNKNOWN";

        registerPlayer(username, uuid, ip);
        kickIfBan(player, uuid);
        tabManager(player, uuid);
        lobbyGiveItem(player);
    }

    private void registerPlayer(String username, String uuid, String ip) throws Exception {
        ...
    }

    private void kickIfBan(Player player, String uuid) throws Exception {
       ...
    }

    private void tabManager(Player player, String uuid) {
        ...
    }


    private void lobbyGiveItem(Player player) {
        String serverName = player.getServer().getName();

        System.out.println("Server Name: " + serverName);

        ByteArrayDataOutput out = ByteStreams.newDataOutput();
        out.writeUTF("GetServer");
        player.sendPluginMessage(plugin, "BungeeCord", out.toByteArray());
        plugin.getLogger().info("Message envoyé au proxy BungeeCord pour obtenir le nom du serveur.");
        // ...
    }
}
dense falcon
#

"[LupusLand] Message envoy├® au proxy BungeeCord pour obtenir le nom du serveur.".

#

->
plugin.getLogger().info("Message envoyé au proxy BungeeCord pour obtenir le nom du serveur.");

thorn isle
#

if the player rejoins during the same server session, put the items back and remove the uuid -> items mapping

#

then ondisable go through that hashmap and process the items

#

this will rely on your economy backend supporting OfflinePlayers or UUIDs, however, as the Player instances themselves won't be available anymore

#

if it doesn't, it becomes harder

pure dagger
thorn isle
thorn isle
dense falcon
#
    @Override
    public void onPluginMessageReceived(String channel, Player player, byte[] message) {
        System.out.println("Received " + channel + " from " + player.getName());
        if (!channel.equals("BungeeCord")) {
            return;
        }
        ByteArrayDataInput in = ByteStreams.newDataInput(message);
        String subchannel = in.readUTF();
        System.out.println("SubChannel: " + subchannel);
        if (subchannel.equals("GetServer")) {
            String serverName = in.readUTF();
            getLogger().info("Le joueur " + player.getName() + " est sur le serveur : " + serverName);
            System.out.println("Server Name: " + serverName);

            if (serverName.toLowerCase().startsWith("lobby")) {
                getServer().getScheduler().runTask(this, () -> {
                    System.out.println("IN LOBBY");
                });
            }
        }
    }

[19:02:11] [Server thread/INFO]: Done (1.232s)! For help, type "help"
[19:02:13] [User Authenticator #1/INFO]: UUID of player Program is b6fe2775-5c19-404e-9df3-3c08a237c168
[19:02:13] [Server thread/INFO]: [LupusLand] Message envoy├® au proxy BungeeCord pour obtenir le nom du serveur.
[19:02:13] [Server thread/INFO]: Program joined the game
[19:02:13] [Server thread/INFO]: Program...

Nothing new 😭.

thorn isle
#

maybe try call flush on your byte array output stream 🤡 i don't remember if that makes a difference

#

also, check on the bungeecord side for errors in console

dense falcon
#

There is no error in bungeecord.

thorn isle
#
ByteArrayDataOutput out = ByteStreams.newDataOutput();
        out.writeUTF("GetServer");
        player.sendPluginMessage(plugin, "BungeeCord", out.toByteArray());
        plugin.getLogger().info("Message envoyé au proxy BungeeCord pour obtenir le nom du serveur.");
#

flush after write

long juniper
#

how can I contact moderators a guy is creating multiple accounts and leaving 1 star review on my resource promoting his resource in it

thorn isle
#

i think toByteArray calls flush automatically but best to be consistent with streams

pure dagger
# thorn isle yes

and ondisable() if they online i just give them their inventory back, if they are offline ... do i just get them by uuid ?

thorn isle
#

swap the inventories onQuit; so that the real inventory is back on the player, and the sellable inventory is in a uuid -> items map in memory

dense falcon
#
[19:04:43] [Server thread/INFO]: Done (1.282s)! For help, type "help"
[19:04:52] [User Authenticator #1/INFO]: UUID of player __Program__ is b6fe2775-5c19-404e-9df3-3c08a237c168
[19:04:53] [Server thread/INFO]: [LupusLand] Message envoy├® au proxy BungeeCord pour obtenir le nom du serveur.
[19:04:53] [Server thread/INFO]: __Program__ joined the game
[19:04:53] [Server thread/INFO]: __Program__[/127.0.0.1:14265] logged in with entity id 47 at ([world]-507.7455308037484, 89.36099020467965, -161.68707911163966)
>
        ByteArrayDataOutput out = ByteStreams.newDataOutput();
        out.writeUTF("flush");
        player.sendPluginMessage(plugin, "BungeeCord", out.toByteArray());
        plugin.getLogger().info("Message envoyé au proxy BungeeCord pour obtenir le nom du serveur.");

Nothing new.

pure dagger
#

okay but that will be incompatible with different plugins... when player leave the area there is other command executed (from another plugin, to give player the money), soo... now i dont know

thorn isle
#

onJoin, check the map and if you have a mapping, swap them again; so that the real inventory is stored in memory and the sellable inventory is on the player

#

i'm not sure what you mean

pure dagger
#

yeah im lost

thorn isle
#

the player can't leave the area if they're offline

pure dagger
#

but when server is disabled it is supposted to count as leaving the area, i need to use worldguard plugin and probably some economy plugin to give player the money, but can i do this in onDisable? what if worldguard is disabled first..... uhm

thorn isle
#

list it in depends in plugin.yml

#

any plugins that you depend or softdepend on are guaranteed to be enabled for the full lifetime of your plugin

pure dagger
#

wow

thorn isle
#

they will enable before yours will; and they will disable after yours will

#

as for the money

#

you should use vault, not a command

pure dagger
#

oh, but its configurable what command executes when player sells the items

#

so i dont really know the plugin

#

brruh

thorn isle
#

economy rewards are typically added separately

#

e.g.

rewards:
 money: 200
 commands:
 - give %player% apple 1
#

where money would be done through vault

pure dagger
#

so

#

i shouldn't make it configurable?

thorn isle
#

the money?

#

it's configurable alright, you can change the amount

#

change 200 to 400

echo basalt
#

money can also be done by the end-user

thorn isle
#

or are you talking about multi-currency support?

pure dagger
#

ok so player can use only vanilla commands in 'commands' section

echo basalt
#

eco give %player% 1

#

this has like no drawbacks

#

no dependency management, no nun

#

other than "oo performance"

pure dagger
thorn isle
#

i'd rather go with vault this is all besides the point, i think the main issue here is that his players are potentially offline when he wants to run these commands

echo basalt
#

what if I want playerpoints support

pure dagger
#

yeah but i found another problem

thorn isle
#

which is more like a design issue

echo basalt
#

or coinengine or whatever

echo basalt
#

he can prob just have a command queue somewhere in a db

thorn isle
#

i would honestly just recommend making it plain and simple; when players quit, run the commands, give the rewards, clear the temporary inventory, and boot them out of the region with a teleport

echo basalt
#

hardcore memo leak

thorn isle
#

location.getWorld().getNearbyEntities(location, 2, 2, 2)

pure dagger
#

when they rejoin just give them another empty inventory

thorn isle
#

this is ass

echo basalt
#

your task is gonna fail if I use an ender pearl or sumn

#

also this is likely gongas

pure dagger
#

im gonna make it simple as you say for now i think

echo basalt
#

portuguese name, no pfp

#

brand new account

thorn isle
#

don't search for nearby entities matching the UUID

echo basalt
#

code's still ass btw

thorn isle
#

iterate over the UUIDs, call Bukkit.getEntity, and check if it's in range

pure dagger
thorn isle
#

in other words do it exactly backwards

pure dagger
#

but if they type in some plugins command it could try to execute when the plugin is already disabled

echo basalt
#

dawg

#

why would you run commands when the plugin's disabled

thorn isle
#

he's trying to do shit in ondisable

pure dagger
#

yeah

#

she

echo basalt
#

100% gongas

thorn isle
#

sucks to run on a version that sucks

echo basalt
#

@worldly ingot get a load of this guy

thorn isle
#

your commands will fail if the players are offline anyway

#

no point doing it in ondisable

pure dagger
#

yeah but i jjust wanna know

chrome beacon
pure dagger
#

so using not vanilla configurable commands at ondisable wont work

chrome beacon
#

Why do you want to run commands in onDisable?

thorn isle
#

well... you can't really softdepend: ["*"] i don't think

echo basalt
#

if you want it to run last I believe you could softDepend zzzzzzzzzzzzzzzzzzzzz

pure dagger
#

yeah

thorn isle
#

so ondisable there's no guarantee that the plugins providing those commands are still enabled

pure dagger
echo basalt
#

learned that hack somewhere

thorn isle
#

that's quite curious

thorn isle
#

the more principled approach to this would be to run them on PluginDisabledEvent but that'd require you knowing which plugin provides which commands

#

and isn't 100% exact as plugins could be disabled by plugin managers at runtime

chrome beacon
#

People start adding 0s to make their stuff run last

#

Priority inflation

pure dagger
#

lol

thorn isle
#

they should ditch eventhandler priority enum and accept a double instead

chrome beacon
#

why

thorn isle
#

i told him to flush the stream

chrome beacon
#

Try with resources for that one

dense falcon
#

?

chrome beacon
#

flushing the stream does not mean writing a string to it

thorn isle
#

doesn't look like ByteArrayDataOutput has a flush method

#

i kind of just glanced over the code and assumed it was a bytearrayoutputstream

#

or a dataoutputstream

dense falcon
#

Well what I do then???

chrome beacon
slender elbow
#

you can't send plugin messages in the join event, it's too early for that

dense falcon
#

Well how then I'm supposed to know that the player is in a lobby server?

slender elbow
#

the earliest you can send one is the PlayerRegisterChannelEvent for the respective channel you want to send the message through

thorn isle
thorn isle
#

read the config and check if it's true

#

bungeecord doesn't really have a concept of "lobby server" either, the server names are arbitrary and at the discretion of the server admin

#

so you can't really ask bungeecord "am i lobby server" anyway

terse ore
#

How does the game know if the generated packed ice is from frost walker boots?

#

I want to be able to mine those

thorn isle
#

so the best you can do is just have a config for it

pliant topaz
#

just another block instead of some data valie

quasi gulch
#

How are my gifs i added with an external source in the editor like normal but in the preview they dont show?

chrome beacon
#

Are they too large?

dense falcon
#

Is it a problem to divide a single event into several classes, like for item interaction in a menu, if we make a class for each menu for this event for example?

solemn umbra
#

I'd like someone to code me a custom plugin basketball plugin for 1.21.4. I'm willing to pay a good amount of money based off of the quality and detail. The price can be negotiated. I'd also need a portfolio of past work you've done.

wet breach
#

seems, as per usual no one bothers reading -.-

#

seems we are bound to get more randoms advertising

#

?services

undone axleBOT
fickle spindle
#

is this a good way to make databases? https://paste.md-5.net/dufaqubuxo.java
and second question, if i aready have the file .db made with this method how can i update it if i create a new table without losing the old data?

chrome beacon
#

Your old data won't be lost if you make a new table?

#

or do you mean update the existing one?

echo basalt
#

CREATE TABLE IF NOT EXISTS is fine for sqlite but I'd avoid it for remote databases

#

can cause issues if you're using something like Planetscale which prevents breaking changes from executing in production dbs

#

(I've had to fork a few plugins and patch them because we use it at work)

fickle spindle
# chrome beacon or do you mean update the existing one?

like if i add this: (but i aready have a .db file without that in the folder)

    // Sql 3

    String sql3 = "CREATE TABLE IF NOT EXISTS arap(id INTEGER PRIMARY KEY AUTOINCREMENT, blabla TEXT NOT NULL , ecobla TEXT NOT NULL)";
    Statement st3 = this.connection.createStatement();
    st3.execute(sql3);

i will get only the old stuff or this one too?

#
        if(!file.exists()) {
            try {
                file.createNewFile();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        try {
            sql = new DataBase(file.getAbsolutePath());
        } catch (Exception e) {
            e.printStackTrace();
        }```

this is how i make the .db file within the onEnable
chrome beacon
#

CREATE TABLE IF NOT EXISTS will make the table if it doesn't exist

#

It won't touch your other tables

fickle spindle
ashen crane
#

My menu type seems to be in the "repairing" state as that is the name at the top, i presume it would want to be in a renaming state if that exists, but im not quite sure if im correct on that

timber eagle
#

Hey guys why is it when I left click on the PlayerInteractEvent it will change the e.getItem correctly after 200 ticks but when I right click it doesn't change any of the itemMeta but still prints it succeeded? for 1.8.8

#

@thorn isle you aren't helping me when you are reacting to my message with a clown emoji

eternal night
#

?howold 1.8

undone axleBOT
eternal night
#

omegaroll damn more than a decade

timber eagle
#

hypixel runs on 1.8.8

#

multiple others servers do

#

and the server im making is a 1.8.8 server and has to be a 1.8.8 server

river oracle
#

Lol

timber eagle
#

you guys literally always do this shit

#

it's fucking annoying

river oracle
#

This argument is more watered down than a lake

#

We wouldn't do it if you got out of the last decade

timber eagle
#

i literally can't

#

its not possible

#

i need the pvp mechanics

#

it's part of the game

river oracle
#

Nah I understand gotta capture that sweet sweet minority of the market share

eternal night
#

Well the issue is, no one here is going to remotely care to investigate why that might be broken in 1.8

timber eagle
#

you don't even know what i'm making

eternal night
#

1.8 minecraft code looked soooo different from todays

#

barely anything translates

timber eagle
#

i know

river oracle
#

Pvp server #10,0000

timber eagle
#

i've coded in both 1.20 and 1.8.8

#

and i have touched the mc src

grand flint
#

With the new update

#

You can have same pvp + swordblocking

river oracle
#

You know there are specialized 1.8 forks right why even bother asking here and not the guys who pour their lives into working on that god forsaken version

grand flint
#

i have it on my server 1 to 1

timber eagle
#

i've already done 30k lines in 1.8.8

eternal night
#

So asking in here for 1.8.8 support is like, you are probably better off just grabing spigot source and running debuggers

timber eagle
#

im not switching

grand flint
#

use a fork

timber eagle
#

everyone plays on 1.8.8 anyways dude

#

it's suppose to be 1.8.8

grand flint
#

like the

#

imanity thing

#

yeah use imanity3

#

thats the best one i found

timber eagle
#

Okay it's a community dude of 1.8.8 players

#

i just need help on this code

#

not to discuss me moving to 1.20

grand flint
#

yeah use imanity3 and ask there

river oracle
#

Lol

timber eagle
#

or later versions

grand flint
#

ok

#

use imanity3

#

and ask there

#

or is that not allowed

#

:3

river oracle
#

Average 1.8 moment please seek software that actually supports 1.8 lol

timber eagle
grand flint
#

@timber eagle any server running on 1.8

#

has their own fork

#

any small server running on 1.8

#

uses a fork that is maintaned

#

if ur using spigot 1.8

timber eagle
#

never knew this

grand flint
#

ur begging to be nuked

timber eagle
#

¯_(ツ)_/¯

remote swallow
#

Pick a popular 1.8 fork that's updated and use it

grand flint
#

go buy imanity3

eternal night
#

Yea you might find more luck with the discords of the forks

timber eagle
#

so i should use imanity3

#

okay

grand flint
#

yeah

eternal night
#

buy?

grand flint
#

then u can ask there for help

#

bc ur using their api

timber eagle
#

how different is it do you know

grand flint
#

plus imanity3 is pvp focused

eternal night
#

PandaSpigot is still maintained apparently

grand flint
#

nah panda is shit

remote swallow
grand flint
#

even the other one is better

#

i forgot name

eternal night
#

I mean, paid forks are complete and utter trash

#

everyone of them

grand flint
#

no lol

remote swallow
#

One of them has async cows

grand flint
#

i had better pvp and better performance w imanity3

grand flint
river oracle
timber eagle
eternal night
#

Honestly, I should start DMCA striking every last one of these forks omegaroll

remote swallow
#

The mooing is so heavy it needs async

eternal night
#

jkjk

#

no wolverness vibes here

thorn isle
#

@timber eagle 🤡

timber eagle
#

does async work with their api

timber eagle
grand flint
timber eagle
remote swallow
eternal night
#

but yea, "paid forks" are the most blatent licence violation on the planet

timber eagle
#

thanks

eternal night
remote swallow
#

Trueeeee

#

Gdpr pdc

river oracle
#

Wait is paper code MIT?

eternal night
#

something something GPL3 I have the right to source code

river oracle
#

Bruh what is this scam

eternal night
#

you can submit your work as MIT

remote swallow
eternal night
#

by default all contributors are submitting under GPL3 iirc

river oracle
#

I haven't looked because I dont care

eternal night
#

paid forks don't either 😉

river oracle
#

Lynx wanna make a paid fork with me

#

We'll do optimizations like unroll all streams

eternal night
river oracle
#

We can also make leaves async

eternal night
#

now you have my attention

remote swallow
#

Forced world for scrop

river oracle
remote swallow
#

Fireflies

river oracle
#

I was thinking probably the ender dragon

#

Fireflies are particles

eternal night
#

tick every part on their own thread

#

for maximum performance

river oracle
#

Obviously

remote swallow
grand flint
#

async every mob not in 1.8

river oracle
#

The networking threads already are

#

So get out of here nerd

remote swallow
#

Lynx can you stop fighting foxes, I can hear them

eternal night
remote swallow
#

Thanks lynx

eternal night
#

no problem

thorn isle
#

i do unironically want to look into doing async pathfinding/collisions/tracking/basic entity shit at some point

#

so that i can have a horde of 1000 zombies running a boid ai

eternal night
#

async pathfinding has already been done

molten hearth
#

async cow milking

eternal night
#

async collisions is

#

uhm

thorn isle
#

it's mostly the entity tracker that pisses me off

grand flint
#

not talking to u

thorn isle
#

that shit is backwards and far from optimal

molten hearth
#

IM TALKING TO THIS GUY

eternal night
#

fair enough, entity tracker truely do be annoying

molten hearth
#

I literally had this conversation today

timber eagle
#

yo do u know where i can find videos on other spigot forks and imanity3

#

can't find it anywhere on yt

grand flint
#

still not talking to u

grand flint
molten hearth
grand flint
#

and look at the page

thorn isle
#

videos? are you not literate?

grand flint
#

are u autistic

#

what are they gonna show

#

chunks generating?

#

go learn common sense before coding 30k lines

timber eagle
grand flint
#

oh wait wrong person

#

same thing iether way

thorn isle
#

a video of someone doing 1000 degree knife on random objects with a TTS of the api documentation on top

grand flint
#

why would anyone have a video of a jar?

timber eagle
#

holy fuck

#

im asking for a video on the features

#

why are u so hard to talk to

thorn isle
#

like chunks generating?

timber eagle
#

yeah

#

anything

thorn isle
#

now, this may come off as harsh, but

#

🤡

grand flint
#

lmao

#

🤡

#

x2

#

embed fail aswell

#

no aura

slim wigeon
#

How dare you?

timber eagle
#

why the hell

grand flint
#

bro why would u ever need

#

a video of a jar

timber eagle
#

dude

grand flint
#

read the features and buy it

timber eagle
#

not what i'm asking

grand flint
#

what would u need to watch?

#

which one of these for what reason would u need to watch

eternal night
#

Make sure to look at great performance graphs created by their authors typing

timber eagle
#

i literally

#

just wanted a fix to this

grand flint
#

this u want to watch?

timber eagle
#

event

#

that's all

timber eagle
grand flint
#

if u run a 1.8 server

young knoll
#

Manity Spigot3

grand flint
#

on spigot

young knoll
#

Wat

grand flint
#

ur doomed

timber eagle
#

okay cool

grand flint
#

do u genueinly think

#

hypixel runs on spigot 1.8

timber eagle
#

no

grand flint
#

or any other network thast on 1.8

timber eagle
#

cuz u told me so

grand flint
#

they use spigot

#

LOL

timber eagle
#

yeah

grand flint
#

not one server above 20+ on 1.8

#

uses spigot / paper 1.8

eternal night
#

hYpIxEl rUnS a 1.8 sErVeR

grand flint
#

shut it noob

young knoll
#

Technically hygot is forked from spigot

grand flint
#

yeah

#

imanity is forked from spigot too

#

but its maintaned

timber eagle
#

okay

#

so are u saying it's gonna fix all my problems

#

and weird ass issues

#

do u even know what i said to begin with

#

☠️

grand flint
#

im saying if u want to run a 1.8 server

young knoll
#

Are we buying stupid 1.8 forks again?

grand flint
#

use a fork

#

ye

ashen crane
timber eagle
#

okay

#

ill do that later

eternal night
grand flint
#

just use pandaspigot @timber eagle then u can ask in their server

eternal night
#

and best

timber eagle
#

but i still need a fix for this...

#

bro

grand flint
#

its free

timber eagle
#

im asking because i don't think it's a spigot issue

thorn isle
#

i actually run a 1.8 support server on the side

grand flint
timber eagle
#

it's a issue with my code dude

thorn isle
#

would you like an invite?

eternal night
#

oh

grand flint
eternal night
#

I read paper spigot KEKW

#

panda spigot is a good idea

grand flint
#

use panda spigot

#

and get support there?

eternal night
#

Yea

timber eagle
#

i want support here

#

🙂

grand flint
#

L ragebait

eternal night
#

Wait I have an emoji

#

for that

slim wigeon
#

Why you sent this @timber eagle ? Lucky I got Vancord because I forgot who posted it for a second. I not going to repeat what I saw but know, this is not a 18+ channel, this is a development channel for one

grand flint
eternal night
#

🤡

grand flint
#

L nudist

young knoll
#

Man I love paper spigot™️

eternal night
grand flint
#

@molten hearth still not talking to u

young knoll
#

You can’t hide from your past!

young knoll
#

You can take the paper out of the spigot but you can’t take the spigot out of the paper

#

Or something

molten hearth
#

oh fair enough

#

wait was I supposed to do something

timber eagle
#

yo should i get flamepaper

#

as my spigot fork

grand flint
#

YEAH

eternal night
grand flint
#

thats the one

molten hearth
#

YOO HAPPY BIRRHDAY

grand flint
#

flamepaper is good as well

remote swallow
grand flint
#

i used flamepaper for like 2 months had no issues w it

timber eagle
#

wait wait wait wait

#

are you saying

#

i can use java 21

#

on a 1.8.8 server and have no issues

grand flint
#

yeah

#

excatly??

timber eagle
#

does it support javascreipt

eternal night
#

isn't flamepaper from the person that made flamecord?

grand flint
#

💀

grand flint
timber eagle
#

w bait

eternal night
grand flint
#

L ragebait

timber eagle
#

no that was a w

#

i got you

#

haha

grand flint
#

shut up nudist