#development

1 messages · Page 57 of 1

river solstice
#

true

wind tapir
#

btw I have no package with the same name 👀

spiral prairie
#

Yes you do

wind tapir
#

No.

#

bro i know better my plugins then you do

#

why would i put a package named fr.idaamo.ranks in a plugin that doesn't have the function of changing ranks

river solstice
#

what

#

that means you do, if it was the issue

wind tapir
#

no i never put a plugin with the same package name of another one

spiral prairie
#

Then tell us why you had that issue

river solstice
#

mf gaslighting

spiral prairie
#

Yeah

wind tapir
spiral prairie
#

Lol

warm steppe
#

why is reading this painful

river solstice
#

lol

inner bolt
#

hi, my math is really bad and I never worked with entity movement so I have this custom plugin for soccer in minecraft and I wanna make goal explosions like the ones in rocket league using falling blocks. So the main problem is velocity vector and I want it to have curvature like this https://prnt.sc/PIQsPTYVkRfN

#

can someone help xd

small arrow
#

what would be the best way to schedule a sync repeating task on my onEnable method to run every 15m to do the following:
Generate a random number 1-3 every time the task is ran
Access that number through a different class
Based on what that number is, a boolean is = true whereas the other 2 are still false
Send a countdown warning in chat (10m till... 5m till... 1m till...)
have the in game event last for 5m and then end
and then rinse and repeat every 15m

Essentially: Every 15m there will be a random 5m event that will happen in game

#

I would just like to know the best way to approach this would be 😄

spiral prairie
#

Just describe it directly without abstracting it to the moon we won't steal it

#

I didn't understand anything

small arrow
#

So sorry for the lack of clarity!
Essentially I want the following to happen

There will be 3 differnent in game events (2x harvest, 5x harvest, 2x sell)
I want a random one of these 3 in game events to occur once every 15 minutes for 5 minutes.
What would be the best way to approach this? I already have everything setup for the individual in game events, I just don't know how to set it up so that a random one of these 3 occur once every 15m for 5m

broken elbow
#

Is there a way to remove NBT tags from an CompoundTag? If so, any chance anyone has the method name before obfuscation and the names after?

dense drift
broken elbow
#

Thanks Gaby

dense drift
broken elbow
#

It seems to be r on every single version starting with 1.17

dense drift
#

in 1.14 it is r then in 1.15 is s, then in 1.16.1 is r again, idk

broken elbow
#

Yeah that's fine though. I only need it starting with 1.17

dense drift
#

good

#

dm or?

broken elbow
#

Yeah.

spiral prairie
tight junco
#

Would anyone bychance know the best method for mass modifying a large amount of blocks at once

#

Block#setType is so heavy and spigot doesnt allow async

#

even if it involves using nms to skrt past spigot

hazy nimbus
#

I would take a look into FAWE

tight junco
#

im trying but i have not a diddily clue how they do it

hazy nimbus
#

They modify blocks without triggering block updates

hazy nimbus
tight junco
#

plus thats such a big project its hard to find it dead

#

i feel at least

hazy nimbus
#

however, tbh, at this point I would just install FAWE and utilize it's API

#

since honestly this is just too much to tackle by yourself

tight junco
#

id rather see if i can get it done without requiring a third party dependency first

hazy nimbus
#

I wouldn't count on it

spiral prairie
#

Yeah no

craggy zealot
#

I have a question about apis
i wanna make a website that has a login when the player logs in the website their minecraft inventory shows up on the website
issue is in the database i encryt the items so how wuold i do it

#

do i have to do it like hypixel where each player needss a api key and when you search this api key up a bunch of items come up and i need to filter and stuff

spiral prairie
#

Why are the items encrypted?

craggy zealot
#

no encrypted

#

its so i can save it in mysql

#

i didint really know a better way

spiral prairie
#

I mean just load it again then

craggy zealot
#
 public String encodeItems(ItemStack[] items) {
        return itemStackArrayToBase64(items);
    }

    public ItemStack[] decodeItems(String data) throws Exception {
        return itemStackArrayFromBase64(data);
    }

    public static String itemStackArrayToBase64(ItemStack[] items) throws IllegalStateException {
        try {
            ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
            BukkitObjectOutputStream dataOutput = new BukkitObjectOutputStream(outputStream);
            dataOutput.writeInt(items.length);

            for(int i = 0; i < items.length; ++i) {
                dataOutput.writeObject(items[i]);
            }

            dataOutput.close();
            return Base64Coder.encodeLines(outputStream.toByteArray());
        } catch (Exception var4) {
            throw new IllegalStateException("Unable to save item stacks.", var4);
        }
    }

    public static ItemStack[] itemStackArrayFromBase64(String data) throws IOException {
        try {
            ByteArrayInputStream inputStream = new ByteArrayInputStream(Base64Coder.decodeLines(data));
            BukkitObjectInputStream dataInput = new BukkitObjectInputStream(inputStream);
            ItemStack[] items = new ItemStack[dataInput.readInt()];

            for(int i = 0; i < items.length; ++i) {
                items[i] = (ItemStack)dataInput.readObject();
            }

            dataInput.close();
            return items;
        } catch (ClassNotFoundException var5) {
            throw new IOException("Unable to decode class type.", var5);
        }
    }```
#

yeah but this is in a website

#

i dont have accese to bukkit api

forest jay
#

what do you have?

#

you have the encrypted base64 string right?

craggy zealot
#

yeah

forest jay
#

then the itemstack array from base 64 function should work fine

craggy zealot
#

okay wait

#

so im devloping a website

#

when its time to load in the items

#

how can i do that

#

without using BukkitObjectInputStream dataInput = new BukkitObjectInputStream(inputStream);

#

and ItemStacks

#

or i might not be the brighest

#

because all i have accces in the website is the encrypted base 64

#

but what i really wanna know that could make this work is in the onEnable from my plugin can i host a website and change things from inside the plugin and interact with the website

spiral prairie
#

yes

proud pebble
#

might be of use

#

from what i can tell, the heavy part isnt really the modifying of blocks themselves, its the block updates, lighting updates and packet sending

#

if you dont care about block updates and lighting updates being vanilla accurate, then you can just not do block updates, manually set the light values of each block and then send the chunk/section updates manually to the players

#

when working on my prison core i had to do exactly that to make the server not die on reset

tight junco
#

thank u

proud pebble
#

needs cleanup and some more testing but should get something mostly functional

tight junco
#

its still so silly how intense Block#setType is

#

and the fact it cant be async is even sillier (without nms)

proud pebble
#

block changes shouldnt be async afaik

#

tho ive seen something on doing stuff throughout the entire tick, what doesnt get done gets paused for the next tick until its complete

#

tho i cant remember the source on that

tight junco
#

I remember one person in this server had a really optimized system for it and put it in #showcase

#

not a fuckin clue who though

proud pebble
#

when it comes to prison mines ive given up trying to allow for tons of block changes, now im working on a packet based mine implementation of not actually modifying blocks, and to just have 1 area loaded at all times for all players since mines for the most part are the same for everyone

#

its not in a functional state yet so im not gunna show anything about it but hopefully thatll address a couple of the resource issues standard mines can have

craggy zealot
#
    @Override
    public void onEnable() {
        try {
            webServer = new WebServer(8888); // Set the desired port here
            webServer.start();
            System.out.println("TESTING SERVER IS UP");
        } catch (Exception e) {
            e.printStackTrace();
        }

    }```
#

when i go to my local host8888

#

it gives me the error 404 not found

river solstice
#

Well, Id guess because you havent defined any routes to accept and send response to

#

We cant magically know what library you're using

shy canopy
dusky harness
#

or only update physics on outside

#

and drag it out over some ticks

#

¯_(ツ)_/¯ (worked very well for me)

#

or FAWE, but that requires plugin dependency

spiral prairie
worn jasper
#

fr

signal grove
#

does anyone know what the friction option controls in custom knockback configs? (plz ping if you answer)

#

in laymans terms

hexed goblet
#

anyone know why I can't add dependency for PlaceholderAPI

<dependency>
   <groupId>me.clip</groupId>
   <artifactId>placeholderapi</artifactId>
   <version>2.11.3</version>
   <scope>provided</scope>
</dependency>
#

my repository

<repository>
  <id>placeholderapi</id>
  <url>https://repo.extendedclip.com/content/repositories/placeholderapi/</url>
</repository>
hexed goblet
#

I can't do import me.clip.placeholderapi.PlaceholderAPI; in my code

#

oof I can't send picture

neat pierBOT
hexed goblet
proud pebble
hexed goblet
hexed goblet
proud pebble
hexed goblet
proud pebble
#

then post the link here

#

could just be a formatting issues in the pom

hexed goblet
#

oh wait

#

nvm

#

by some magic way

#

When I turn off intellij and re-open it and dependency working now

#

weird

proud pebble
#

atleast its working now

#

thats what matters

hexed goblet
#

yes that all I need 😅 lucky you asking for pom.xml I planning to turn off intellij and go play game instead

dusky harness
#

ex 0.0 = ice-like?

#

wait

#

im dumb

#

thats knockback

#

ice knockback :)))

#

maybe air resistance? 🥴

#

no idea

signal grove
#

thats all handled clientside

#

slipperiness and air resistance

#

idk, maybe it means like momentum? where if you're moving in one direction, it reduces the velocity or something

dusky harness
#

like 0 and 100

#

🥲

signal grove
#

thats the best plan tbh

#

but i didnt feel like restarting the server

#

ill test it later tonight

#

see what breaks when i have 100 friction xD

worn jasper
#

wasn't there a builtin method in java utils or whatever to like, check if an object is null/0, if it is, return the provided text, otherwise return the value?

spiral prairie
#

Wot

worn jasper
#

Objects.requireNonNullElse()?

spiral prairie
#

Maybe you want an optional of nullable and use their functions

spiral prairie
worn jasper
#

wot

warm steppe
#

What could be the reason for span transition underline to just stop working occasionally? (i use tailwind btw)

#

This is the code of my blade component (laravel project) ^

#
<x-nav-link
    class="flex items-center"
    :href="route('zinas.index')"
    :active="request()->routeIs('zinas.index')"
    :color="__('blue')"
    :underline="true">
    <p class="ml-1.5">{{ __('Ziņas') }}</p>
</x-nav-link>

^ This is how I call it

#

It works when it wants to, idk how to explain it

dense drift
#

Does anyone have experience with paypal webhooks? I got a project that worked just fine until a few days ago, and now I don't get any events and they don't show up in the event logs either.

fading stag
#

I just realised there is JavaPlugin#getDatabase, is it something new?

river solstice
#

not really

dusky harness
#

d;JavaPlugin#getDatabase

uneven lanternBOT
worn jasper
#

tf is that

#

:-:

dusky harness
#

d;paper JavaPlugin#getDatabase

uneven lanternBOT
dusky harness
#

???

dusky harness
fading stag
#

I can't send ss lol

dusky harness
#

Besides spigot and paper

#

Or custom JavaPlugin

fading stag
#

I'm using org.spigotmc:spigot-api:1.8-R0.1-SNAPSHOT (I hate developing 1.8 plugins but this is my customer's server version)

dusky harness
#

Show code ig bc JavaPlugin get database doesn't exist

#

?paste

neat pierBOT
#
FAQ Answer:

Paste Services
When asking for help with a config/menu/code issue please use our paste bin:
(we prefer it over pastebin.com)
HelpChat Paste - How To Use

fading stag
#

since it is there

worn jasper
#

electroniccat[no-ping] — Today at 7:53 PM
Because it relied on a stupidly old version of ebeans nobody was using

#

^^ that's why it exists

fading stag
neat pierBOT
dusky harness
#

d;1.8.8 javaplugin#getdatabase

uneven lanternBOT
dusky harness
#

@fading stag ty Mr afonso

fading stag
#

oh this is not something new this is something old

worn jasper
#

xD

worn jasper
fading stag
#

it could be a cool feature maybe

worn jasper
#

def. not

#

I would probably never use it

#

lol

dusky harness
#

Spigot barely removes stuff for backwards compat so if they remove something it's probably for a good reason

worn jasper
#

no one used it lmao

dusky harness
#

🥲

worn jasper
#

like, no one

fading stag
#

I mean not Ebeans (I've never heard it before) but maybe something like HikariCP

worn jasper
#

don't think it's a good idea

#

I mean, maybe implementing it already in jar, so that we can access it through the api? maybe, but directly in spigot, def. not

#

don't like the sound of that

#

lmao

river solstice
dusky harness
dark garnet
hoary scarab
#

Anyone use Lands (Angeschossen) updated API?
His wiki doesn't really go into detail and it uses deprecated methods. Also doesn't tell how to use the new methods.

shell moon
hoary scarab
#

His wiki doesn't really go into detail and it uses deprecated methods. Also doesn't tell how to use the new methods.

#

Anyways I think I already figured it out. Gotta wait for the user to test it.

shell moon
#

i read it once a year ago and i think it worked correctly, anyways ¯_(ツ)_/¯

hoary scarab
#

Yeah user had their console spammed because the methods output to console to not use them.

small arrow
heady orbit
#

Im making a discord bot that uses a GUI to display the homes, but if i open the gui multiple times the things get executed multiple times.

I have 2 modes creation and deletion (and normal mode) whichz you can temporarily see in the chat. But sometimes they glitch and switch to a mode 2 times, how to fix that.

I cannot paste links, how to paste links to code and a video
https://pastebin.com/RNNLsv0Y
video is streamable com link
ryx6zf

barren mantle
#

well it's the plugin itself, i just added the plugin into the project

#

I had no problems when i started using it, but now i don't understand what's the problem

#

The menu is named literally "menu" in the files and i tried to rename the .yml to 'mainMenu' and i renamed it in the config.yml too and still doesn't work :D|
And if this is not weird enough, when i try #getAllMenus() it returns null (i have 21 menus loaded on my server)

dense drift
#

why do you want to use dm?

lyric gyro
#

Will PlaceholderAPI ever add Kyori/Adventure support?

#

Kyori/Adventure library supports hover event, click event, hex colors, etc... for chat messages, titles, etc, and can simply be casted to normal string. I think supporting Kyori/Adventure makes PlaceholderAPI's capability much stronger

dense drift
#

Probably, although I'm not exactly sure how. Atm if you need that, you can serialize the components with MM before returning them.

hoary scarab
# hoary scarab Anyways I think I already figured it out. Gotta wait for the user to test it.

Previously I was using;```java
LandsIntegration integration = new LandsIntegration(MinionMain.getInstance());
if(integration.isClaimed(location))
return integration.getAreaByLoc(location).canSetting(player.getUniqueId(), RoleSetting.BLOCK_BREAK);

Now I am attempting to use;```java
public static boolean canUserBuild(Player player, Location location) {
    LandsIntegration api = instance().getAPI();
    LandWorld world = api.getWorld(location.getWorld());
    if(world == null)
        return true;
        
    return world.hasRoleFlag(player.getUniqueId(), location, RoleFlag.of(api, FlagTarget.PLAYER, RoleFlagCategory.ACTION, "BLOCK_BREAK"));
}
```The user I have testing this got an error.
`java.lang.IllegalStateException: Flags need to be registered in onLoad of your plugin before Lands is fully enabled.`

I know what the error is saying... I just want to check if lands won't allow the player to do something. Don't want or need to register anything if the lands plugin already has the methods to check.
calm estuary
#

How can I have a command on a bungeecord plugin which then will use message channeling to send a message to a papermc plugin to open a gui?

minor summit
#

there are multiple questions here:

  • how to have a command on bungeecord
  • how to send a plugin message from bungee
  • how to listen for a plugin message on the server
  • how to open a gui from the server

which ones do you know how to do and which ones do you not know how to do?

calm estuary
#

I just need an example of how I can send a plugin message from bungeecord then listen to it on the papermc plugin and then an example of how I can execute things if thats possible as I don't know how to do that. thank you

dark garnet
dark garnet
icy shadow
#

dare I say legacy colour moment

elder bramble
dense drift
#

ew bukkit components

lyric gyro
#

is it possible to create a placeholder on a bungeecord plugin so it can be used on all servers or isn't that possible?

wind tapir
#

Hello, I have a problem, the block placed is not resetted after the player disconnected, someone asked me if the chunk was loaded, I answered no, bc there's no one, i think that may be the problem, can someone help me?

    @EventHandler
    public void onPlace(BlockPlaceEvent e){
        if(e.getBlockPlaced().getLocation().getY() >= 50){
            e.setCancelled(true);
        }else {
            if (isPlaying.get(e.getPlayer())) {
                int slot = e.getPlayer().getInventory().getHeldItemSlot();
                e.getPlayer().getInventory().setItem(slot, new ItemStack(e.getBlockPlaced().getType(), 64));
                main.getServer().getScheduler().runTaskLater(main, () -> e.getBlockPlaced().setType(Material.AIR), 600);
            }
        }
    }

dark garnet
elder bramble
#

smthing like that

dark garnet
elder bramble
dark garnet
lyric gyro
dark garnet
wind tapir
#

I think he replied to brister

#

im not sure

dark garnet
#

so maybe i did reply to her????

wind tapir
#

no embed

#

bruh

dark garnet
#

L

lyric gyro
wind tapir
#

nahh

dark garnet
lyric gyro
warm steppe
#

Has anyone ever had an issue where tailwind hover thing is not working?

warm steppe
#

(i am using laravel btw)

wind tapir
#

nahhhh

wind tapir
#

bro

dark garnet
wind tapir
#

how tf

river solstice
warm steppe
#

basically i have 2 buttons with identical style (except bg color). ones hover is working but other buttons hover is not...

river solstice
#

well

#

it has to know the color beforehand, what to revert to, as far as I know

#

or maybe you're concattinating string for the style?

river solstice
#

yeah, that's not gonna work

warm steppe
#

but when i press f12 on the site it has color set correctly

river solstice
#

ex. will not work:

const whiteColor = "#FFFFFF"; and className={`bg-[${whiteColor}]`}
#

will work

const whiteColor = "bg-[#FFFFFF]"; and className={whiteColor}
warm steppe
#

well the hover is working for one button

#

the same code is not working for the other button... thonking

leaden sinew
dark garnet
whole berry
#

hello, i saw that you can change the font, but i don't remember placeholder, would anyone have it please?

shell moon
ocean jasper
#

the GUI works for if you dont restart

#

but its wonky when u restart and then try to open the gui it just doesnt work

small arrow
#

https://paste.helpch.at/iwatipiyof.java
The issue lies on the following lines:
sellPrice = worth.getPrice(quantity, itemInHand);
Yes I understand that the getPrice() requires an instance of IEssentials, but how can I get and retrieve that? I am unfamilair with what IEssentials is, I thought everything was managed under Essentials?

smoky hound
lyric gyro
#

is it still the same for 1.20 for pluginmessagereceived for plugin messaging stuff

small arrow
#

Relevant Code: https://paste.helpch.at/yalokativu.java
Issue: Players don't get the broadcasted message (There is a message in the config that's not an issue) and there are no errors in console. Any reason why my code is not getting executed?

pure crater
#

but what's the goal of this? also maybe try printing out your conditional statements to see what they print out

river solstice
#

static access for a random number, weird case switch to with if, taskIdHolder single length array, atomic access

#

wtf

pure crater
#

You are honestly much better using the Java timer class or scheduledexecutor

#

i usually try to avoid the bukkit schedulers and runnables these days cuz they suck

#

and i think the scheduler is just an executor behind the scenes lol

topaz gust
#

The else if statements are fun

smoky hound
# small arrow Relevant Code: https://paste.helpch.at/yalokativu.java Issue: Players don't get ...
  • you probably could just use an int for the task id, don't need an int[] if its only 1 long
  • you could probably use a map<int, string> and store the random number to event name, and get rid of a lot of duplicate code
.replace("%event%", eventMap.get(randomNumber)
  • could even just concatenate the remaining minutes with the event-warning- string, and then do a null check in case nothing exists in the config (for example at 11 minutes). but this has the effect of allowing the user to add more warnings

  • use some print statements to debug why your code isn't ever entering the conditionals like pulse said

pulsar ferry
tough gorge
#

ok, sorry

small arrow
small arrow
small arrow
barren mantle
# dense drift why do you want to use dm?

because i made a custom plugin which generate automatically events every week and i use deluxemenu to update a specific item with details about the next event (e.g prizes, levels, etc..)

dense drift
#

Then make the player run the open cmd

pure crater
#

also the java executor gives you more flexibility

#

honestly it's not a big deal, but for me i usually try to avoid them unless i have to run something sync (like placing blocks) or if something relies on server ticks

pure crater
# small arrow The goal of this is to do the following: 1) generate a random numb 1-3, dependin...

So here is what I think you should do instead. This will be much more modular.

  1. Create a parent class called Event. Make all your separate events extend this class and implement all the functions. If needed, you can make an interface too for the methods.
  2. In your Event class, add a method like broadcastMessage(); Then in all of your sub-classes (or individual events), override the method and broadcast the message to players. Similarly, create an execute(); method and override in sub-classes as necessary.
  3. For picking a random event, make an Event[] with all the events and just pick a random one from the array.
#

That way, you get rid of the reliance of an integer for each event and you actually use classes the way they are intended to be used

#

It's also much easier to debug since your code is in separate files rather than all in a single block.

ornate vale
#

Hey!
So, I have a core plugin that contains some utilities and stuff like that, I'm using the core in all others plugins as a runtime dependency.
The core plugin has a class called "BungeeCorePlugin" which extends the Plugin one (necessary to work as a plugin in bungeecord) and this class is used in the others plugins aswell.

Here's how others plugins use the BungeeCorePlugin class:

public class MainClass extends BungeeCorePlugin {
       // plugin code
}

It should works well but I'm receiving the error "java.lang.NoClassDefFoundError: core/BungeeCorePlugin" and the plugin isn't loading. Is there any way to fix that?

What I've already tried:
Adding the core plugin as a dependency in the plugin.yml.
Trying to change the plugins load order on the bungeecord config file:

plugins:
    - core
    - others plugins here

Changing the plugin name to try to load the plugins in an alphabetical order:
This worked in my localhost but not on the host... My localhost uses the original bungeecord jar and the host uses waterfall.

I thought about adding the plugins into the core folder (only the plugins that uses the core) to load them after the core one is loaded, is it possible?

spiral prairie
#

What

river solstice
#

cool story

small arrow
formal crane
river solstice
#

wym rate

#

aint doing a code review for you blud

#

and this aint a competition

dusky harness
#

What
They just want some feedback

#

I assume

dusky harness
#

Using gitignore

#

Can't really look much since I'm on phone tho

tired olive
river solstice
#

no, thanks

formal crane
formal crane
warm steppe
#

Well hes using gradle, thats already a good sign

#

Well lombok + static abuse, but if it works it works

barren mantle
pulsar ferry
#

Not the right channel for that

pure crater
worn jasper
#

static abuse and lombok are illegal

dark garnet
#

and ur command classes should use camel case aka ClaimCmd instead of ClaimCMD

warm blaze
#

So I'm trying to display heads using Deluxe Menus and placeholder api, and i did it like
head-%myplugin_playername%
but in the event of a player-head owner not existing on fetch i wanted it to have it just display air.
i tried to do this by moving the head- into my placeholder so it looks like
return "head-"+ playerName; but that wouldn't even let me load the menu.
so it would just be like myplugin_playerhead
is there a obvious thing im missing like some built in feature or should i try encoding the heads differently like with base64?

dense drift
warm blaze
dense drift
#

ok if you are asking for support with a custom plugin, that might not be possible since the type of the material is parsed at load time, if the material starts with head- it will be threated different than an item with a normal material name (e.g. STONE)

#

I would suggest to have a fallback head if that fits your use case

warm blaze
#

good to know

#

ty

dense drift
#

np

leaden sinew
summer galleon
#

I am trying to add placeholder api to my tablist plugin but the placeholders aren't working, I followed the github steps to add it. Also when I uncomment the setPlaceholders line it breaks the entire plugin.

    @EventHandler
    public void onPlayerJoin(PlayerJoinEvent event) {
        String headerText = ChatColor.of("#0471FB") + "" + ChatColor.BOLD + "Welcome to the server!\n" +
                ChatColor.of("#D5D8D9") + "-------------------------------------------------\n" +
                ChatColor.of("#0471FB") + "There are currently" + ChatColor.of("#D5D8D9") + " %player_name% " + ChatColor.of("#0471FB") + "players online!";
        String footerText = ChatColor.of("#0471FB") + "MCMMO Mining Lvl:" + "%mccmo-mining-level%"
                "server store";

        //headerText = PlaceholderAPI.setPlaceholders(event.getPlayer(), headerText);

        String joinText = "%player_name% &ajoined the server! They are rank &f%vault_rank%";

        // Example: Set the player's tablist header and footer
        event.getPlayer().setPlayerListHeaderFooter(headerText, joinText);

        /*
         * We parse the placeholders using "setPlaceholders"
         * This would turn %vault_rank% into the name of the Group, that the
         * joining player has.
         */
        joinText = PlaceholderAPI.setPlaceholders(event.getPlayer(), joinText);

        event.setJoinMessage(joinText);
    }

Mainly the players online isn't working, I did the download command in game for player placeholders.

proud pebble
summer galleon
#

am i able to send pastebins here

proud pebble
summer galleon
#

thats what its called

#

i forgot

proud pebble
summer galleon
#
name: FigsTabList
version: '${project.version}'
main: figstablist.figstablist.FigsTabList
api-version: '1.20'
authors: [LitNotFig]
description: E

softdepend: [PlaceholderAPI]

Isn't that right?

#
    <repositories>
        <repository>
            <id>papermc-repo</id>
            <url>https://repo.papermc.io/repository/maven-public/</url>
        </repository>
        <repository>
            <id>sonatype</id>
            <url>https://oss.sonatype.org/content/groups/public/</url>
        </repository>
        <repository>
            <id>placeholderapi</id>
            <url>https://repo.extendedclip.com/content/repositories/placeholderapi/</url>
        </repository>
    </repositories>

    <dependencies>
        <dependency>
            <groupId>io.papermc.paper</groupId>
            <artifactId>paper-api</artifactId>
            <version>1.20.1-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>me.clip</groupId>
            <artifactId>placeholderapi</artifactId>
            <version>2.11.3</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>
</project>

and this?

summer galleon
#

Is there anything else you need?

proud pebble
#

actually it looks like it did load before your plugin

#

hmm

summer galleon
#

is it supposed to do that

proud pebble
sharp cove
#

Hey

#

If I save a file in Java and I have a few line of code after that, is that executed when the file is saved so the task is done?
Or are the few lines of code executed right after when the file isn't even saved?

For example:

                cfg_playerdata.set("Kingdom", Kingdom.instance.kGetConfig().NoKingdom_Name);

                try {
                    cfg_playerdata.save(playerdata);
                } catch (IOException e) {
                    e.printStackTrace();
                }
                
                player.sendMessage("MESSAGE)"

Is the player.sendMessage.. send when the first lines above it are succesfully done?

#

Sorry if its a little bit weird what I am asking, but I don't know how to say/ask it properly..

hoary scarab
#

It will wait until the previous code is complete.

sharp cove
#

Alright, that was the thing I needed

#

Thank you.

hoary scarab
#

👍

heavy wadi
#

Just got this email from curseforge after uploading a freshly compiled plugin jar:

The status of the file SMPtweaks-1.0.23.jar has been changed to Rejected

Notes:
Your file SMPtweaks-1.0.23.jar has failed processing, this could be caused due to obfuscated code or corrupt files. Please check Class HikariPool.class to find the issue and try to upload the file again

I never had issues submitting a plugin using HikariCP in the past. What am I supposed to do now?

hoary scarab
#

Contact curseforge. Ask what you need to do.

heavy wadi
#

Fair enough, thanks!

clever relic
ocean raptor
#

ah..

#

I thought lofi girl was real

clever relic
#

helpful

rare sorrel
#

hey, i know this is probably a simple answer but what is a mysql database? What do i actually need it for?

torpid raft
#

it's basically a convenient network accessible data storage

#

if you have multiple programs that all want to access the same data at the same time, you could use a MySQL server to facilitate that

#

you can interact with it using SQL, which is a very convenient and minimal way to get the data you want (instead of manually parsing a file and searching for stuff, etc)

rare sorrel
torpid raft
#

no websites or anything else needed

rare sorrel
#

https://imgur.com/a/2RhO7De

what exactly would i put in these sections? I've filled out password and username but not sure what goes here

torpid raft
#

for the type you should change it from SQLite to MySQL if you're planning on using the mysql server your host provides

#

(although tbh you really don't need to use MySQL in the first place as long as you don't need to access this same data on a different mc server)

#

what plugin is this for?

#

wait i'm silly it's better social

#

yeah from what i can see you should really only need MySQL if you have multiple servers with a bungeecord setup

#

but if you really want to use it, all you have left to do is set the ip and port to that of what your provider gives you for their MySQL server and that's really it

#

you could also just leave the config exactly how it is right now and it would also work just fine, except it would use SQLite instead of MySQL

small arrow
#

Hey! How would I be able to set up my plugin so that /sell hand works with EssX's /sell hand?
Essentially what I want to do is the following:
When players sell an item using /sell hand, its value is doubled

river solstice
#

use essentials api to get the amount that is set in the item prices, not much more to it

#

or just double the price in the config? 💀

#

what are you even trying to achieve

sleek wedge
#
@EventHandler
    public void onEntityResurrect(EntityResurrectEvent event) {
        LivingEntity entity = event.getEntity();

        if (!(entity instanceof Player player)) {
            return;
        }

        ItemStack totem = findTotemInInventory(player);

        if (totem != null) {
            event.setCancelled(true);
            totem.setAmount(totem.getAmount() - 1);
        }
    }

I'm trying to remove the totem event such as Resurrection and the item began removed from the inventory, the only thing wrong is the item it gettin removed, it's should be alright like this, if anyone can help me with that I'll be greatful

wind tapir
#

Hello, I made this:


String[] message = args[1].split(" ");
                    StringBuilder builder = new StringBuilder();
                    for(String s : message){
                        builder.append(s);
                    }

but when I execute the command:

https://i.imgur.com/4Rwa7Wr.png

can anyone help me please?

small arrow
small arrow
hoary scarab
wind tapir
#

StringBuilder builder = new StringBuilder();
                    for(int i = 1; i<args.length; i++)
                        builder.append(args[i]);

                    ProxiedPlayer to = main.getProxy().getPlayer(args[0]);
                    to.sendMessage("§bConsole §7» §7Moi§f: " + builder);

dense drift
#

you can use StringJoiner

wind tapir
#

thanks

dense drift
#

new StringJoiner(" ");

wind tapir
#

yes

#

it works, thank you !

dense drift
#

np

small arrow
sleek wedge
#

maybe like this is way easier to understand

formal crane
small arrow
sleek wedge
#

it's doesnt get dropped

#

nvm

#

it's does work like this, was just the server laggy

proud pebble
#

you need to loop over the entire args array not just the 2nd argument

#

args is a String[], just loop that

hoary scarab
proud pebble
lyric gyro
#

how should i approach changing someone's skin on a server

dusky harness
#

Using skins restorer 👍

lyric gyro
river solstice
#

idk, /skin set name name? no?

#

look at the plugin command usage

#

this aint a wiki

lyric gyro
#

what

#

i mean coding it

torpid raft
lyric gyro
#

ok ill look lmao ty

river solstice
minor summit
#

mfw Player.setPlayerProfile

wind tapir
#

Can anyone help me please?

proud pebble
#

apparently sending alot of ClientboundSectionBlocksUpdatePacket's cause client lag and im not entirely sure why

#

maybe its cus im sending an entire section worth of block changes instead of just sending ones that actually changed, no idea

hoary scarab
#

How does minecraft get the whole number from a coordinate? Does it round down or either direction?

hoary scarab
#

Thanks. Guess I could have just tested it xD

#

Yeap always rounds down. Thank you.

floral beacon
#

hello
i want to make player's character invisible (his hand in F5's first-person view and his character in F5's third-person view) except his item in his hand, on player join event
i don't want to use invisibility effect because that will make him see particle bubbles, i want to escape that

any ideas? this is what i tried so far

    @EventHandler
    public void on(PlayerJoinEvent event) {
        Player player = event.getPlayer();
        new BukkitRunnable() {
            @Override
            public void run() {
                player.hidePlayer(plugin, player);
            }
        }.runTaskLater(plugin, 5);
    }
floral beacon
#

@me whoever anwers, ty

dusky harness
#

Doesn't the /effect command have a param to hide bubbles

floral beacon
#

omg!

wind tapir
warm steppe
#

atomic integer

#

wait dude

#

what is ur code

#

variable name not needed?

#

or im trippin

dusty frost
#

already initialized?

#

/ static something

wind tapir
formal crane
#

Might be a dumb question but, why is spigot not multithreaded?

spiral prairie
#

Because Minecraft isn't

lyric gyro
#

what is the syntax to send a clientbound packet in 1.20?

spiral prairie
#

Huh

lyric gyro
#

trying to set the player's skin with playerprofiles. when i execute this, the first time i got. there are no errors but i can visibily see on tab i was removed, but i don't get added back.

ServerPlayer plyr = ((CraftPlayer)player).getHandle();

plyr.connection.send(new ClientboundPlayerInfoRemovePacket(List.of(((CraftPlayer)player).getUniqueId())));
profile.getTextures().setSkin(new URL("http://textures.minecraft.net/texture/b3fbd454b599df593f57101bfca34e67d292a8861213d2202bb575da7fd091ac"));
plyr.connection.send(new ClientboundPlayerInfoUpdatePacket(ClientboundPlayerInfoUpdatePacket.Action.ADD_PLAYER, plyr));```
warm steppe
#

Make sure that you are sending the packet

lyric gyro
#

yo any1 worked with dc webhooks in a plugin before? need some help

river solstice
#

yes

#

just ask

lyric gyro
#

oh right so I made a system which should send a message thorugh the webhook, had no luck lately doesnt send the message nor a console error is generated

lyric gyro
#

Does VaultAPI work on 1.20.1?

minor summit
#

yes

#

it doesn't really depend on anything particular to any version

lyric gyro
#

changing skins yet im being removed from tablist and my outer skin layer is not showing.
im still on the tab and have my skin layer for others, but not for myself
please help
https://paste.md-5.net/irogomaxah.cs

fading stag
#

What is the correct event to cancel Shift + Click item to put item to plugin's menu?

minor summit
#

InventoryClickEvent

dusky harness
#

Only events u need I'm pretty sure are click and drag event

minor summit
#

i don't think you need drag for shift click

dusky harness
#

Ye but to prevent putting items in Plugin menus

#

Unless u just disable all click events then that works too and is the safest

proud pebble
grave thorn
#

When making SQL calls ive heard its best to not do it on the main thread, but what i dont understand is if i do that, what if my code needs to access the user but they havent been fully fetched from the database yet because the database calls are run async

river solstice
#

well, there are multiple ways to approach this

#

it really depends on the situation

#

say you want to load player data on command /stats:

StatsCommand:

    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if (sender instanceof Player player) {
            StatsManager.fetchPlayerStatsAsync(player, stats -> {
                // Display stats
            });
        } else {
            sender.sendMessage("This command can only be used by players.");
        }
        return true;
    }

StatsManager:

    public static void fetchPlayerStatsAsync(Player player, StatsCallback callback) {
        Bukkit.getScheduler().runTaskAsynchronously(YourPlugin.getInstance(), () -> {
            Stats stats = new Stats(...);
            
            callback.onStatsFetched(stats);
        });
    }

StatsCallback:

public interface StatsCallback {
    void onStatsFetched(Stats stats);
}
icy shadow
#

alternatively just return a CompleteableFuture

royal hedge
#

or alternatively just return a Mono 😍

river solstice
topaz gust
#

Or a completable future there is a few ways to make a main thread task wait for an async thread to complete a task

royal hedge
river solstice
#

huh

grave thorn
river solstice
#

I'm not sure on how exactly taskchain works, but it runs the heavy calculations async and then gives you the result sync? no?

icy shadow
topaz gust
#

Used for heavy maths calculations is typical worldedit uses this theory

sleek wedge
#

how can i set custom Aliases to my commands using the config.yml?

river solstice
#

why config.yml?

#

use plugin.yml

sleek wedge
river solstice
#

people can open the jar file and edit the plugin.yml to add aliases cursed_fingerguns

sleek wedge
#

lmao

river solstice
#

PluginCommand#setAliases btw

sleek wedge
#

doesnt work

#

the aliases dont get added

river solstice
#

well, for each alias register the executor again?

#

haven't used setAliases, turns out

Sets the list of aliases to request on registration for this command. This is not effective outside of defining aliases in the PluginDescriptionFile.getCommands() (under the `aliases' node) is equivalent to this method.
Params:
aliases – aliases to register to this command
Returns:
this command object, for chaining
sleek wedge
#

i never used it

river solstice
#

nvm, it won't register if it's not in commands section

sleek wedge
#

nvm about Aliases

river solstice
#

I guess you can play with command arguments as command aliases

#

not sure, haven't really done that

sleek wedge
spiral prairie
#

Why the fuck does nobody know about commands.yml??????

tight junco
#

i have no fuckin clue

river solstice
#

never needed

torpid raft
#

useless

spiral prairie
river solstice
#

yeah ik personally never used it

sleek wedge
spiral prairie
#

Yes

sleek wedge
#

damn

#

never heard of it

warm steppe
#

Who even uses bukkit command stuff

elder swift
#

Use command map for you = based + epic;

dense drift
#

Anyone that uses exposed know how to export a database as .sql in a way that UUIDs (which are stored as BINARY(16) or smth like that) are displayed right? Rn I got a bunch of broken characters when I try to view the sql with VSC

torpid raft
#

maybe there's a function you can use with your flavor of SQL that converts binary data to hex

dense drift
#

And use where exactly? We are using MariaDB

torpid raft
#

not sure, but one scuffed solution might be to make a new column which is a copy of your uuid column except in ascii format, and then export that alongside everything else

#

idk much of anything about how exporting works and what settings there are with it tho so maybe there's something better

#

but also this seems like something you'd have to handle in VSC rather than on the side of exporting, maybe there's a plugin that lets you view binary data as text or as base16/base64?

dense drift
torpid raft
#

good opportunity to learn vscode plugin development then i guess

minor summit
#

or just any hex viewer, doesn't need to be a vsc plugin lol

grand island
dense drift
dusky harness
#

Or does sql/mariadb have a specific uuid type

dense drift
#

Thats how exposed stores it 😛

dusty frost
#

Exposed uses UNHEX() to store it, which is the opposite of that function lol

spiral prairie
#

its afaik the best way to store uuids

minor summit
#

unhex sounds funny

#

hex⁻¹

spiral prairie
#

Unhex should be called ahex

dense drift
#

Ahh I see.

river solstice
#

🥴

grand island
dense drift
#

Oh well =/ the MariaDB implementation simply extends MySQL, so I guess I have to deal with BINARY(16) :X

inland walrus
#

please

hazy nimbus
#

I use binary(16) too

#

Or you can just store it as varchar

#

Which is not ideal cuz indexing and stuff

atomic trail
#

Anyone got an idea why the server crashes with this error? Not sure what is causing it

java.lang.NullPointerException: Exception in server tick loop
    at net.minecraft.server.v1_8_R3.JsonList.load(JsonList.java:195)
    at net.minecraft.server.v1_8_R3.DedicatedPlayerList.z(DedicatedPlayerList.java:94)
    at net.minecraft.server.v1_8_R3.DedicatedPlayerList.<init>(DedicatedPlayerList.java:22)
    at net.minecraft.server.v1_8_R3.DedicatedServer.init(DedicatedServer.java:177)
    at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:688)
    at java.lang.Thread.run(Thread.java:748)
hazy nimbus
#

That's what you get for using 1.8.4(???)

dusky harness
#

im pretty sure thats 1.8.8
edit: it's 1.8.4 -> 1.8.8

hazy nimbus
#

I'm not sure why it's called _R3, but ok

dusky harness
#

its prob whenever theres a nms change that spigot has to change patches for

atomic trail
dusky harness
#

if thats a thing

#

im just looking at the source

#

banned-players.json

#

seems like it's from there

atomic trail
dusky harness
#

uhhh should be at the same directory as the server jar

atomic trail
#

Yeye I know but ahhhh

#

in the source

#

Where do you usually find the source?

dusky harness
atomic trail
#

Perfect, I'll try, thanks a lot

#

It's weird how this didn't catch the error then though

    private void z() {
        try {
            this.getProfileBans().load();
        } catch (IOException ioexception) {
            DedicatedPlayerList.f.warn("Failed to load user banlist: ", ioexception);
        }

    }
dusky harness
#

not NPE

dusky harness
#

so you could prob just open it and check it manually or delete the whole file (although I wouldn't recommend that)

atomic trail
dusky harness
#

kinda curious what part of it was messed up too

atomic trail
#

Yeah same, I'll let you know when it's fixed

dense drift
#

Is it still not possible to combine sub commands and options for Discord's slash commands? D:

dusky harness
dense drift
dusky harness
#

🥲

dense drift
#

so stupid tbh

#

just make each sub command have its own set of options, boom

river solstice
#

huh?

#

is this not what you mean?

#

you can have a base command, that has multiple sub-commands that have their own choice parameters

hoary scarab
#

As clean as that looks it feels like arrow code to me.

dense drift
river solstice
river solstice
#

or treat a subcommand as 'separated options'

dense drift
#

yeah hm

forest jay
#

I always separated my sub commands into separate variables and added them that way, to make it more readable and debuggable

fast glade
#

how would i check if the displayname on an item is equal to some text? I see .getdisplayname() is deprecated now, so want to use the .displayname() function

if(item.hasItemMeta())
    if(item.getItemMeta().hasDisplayName())
        if(item.getItemMeta().displayName() ... //text is equal to "cool name" )
            return true;
hoary scarab
icy shadow
#

it is in paper in favour of components

fast glade
#

i think i figured out how to do it using PlainTextComponentSerializer

icy shadow
#

@dense drift

hoary scarab
icy shadow
#

@fast glade why do you want to do this?

#

this is quite possibly a bad idea

torpid raft
#

maybe it's a filter thing

fast glade
torpid raft
#

scuff

icy shadow
#

i'd still say that using metadata or even slots is a better idea

#

comparing names is just liable to breaking if you ever change the name in future, or if the component's internal representation changes

#

set a metadata / PDC key with some constant string value and compare that instead

fast glade
#

well im hooking into another plugin, and pulling the name of the item from their language file, and the material from the config

#

and comparing if the item + name are the same

icy shadow
#

😵‍💫

#

sorry to hear that

fast glade
icy shadow
#

would recommend doing that yea - comparing names is always liable to break things

#

but i guess for now just use the legacy component serializer

hoary scarab
#

Welp... easiest option is @SuppressWarnings("deprecation") untill they actually remove that method 😉

fast glade
#

yeah, trying to do everything right with what limited options i got, making sure pulling the correct item type + item name from the plugin config (not hardcoding it) then its also being used in an area where players cant rename items, or interact with their inventory

fast glade
hoary scarab
#

👍

fast glade
#

incase ur curious

Component displayName = item.getItemMeta().displayName();
if(PlainTextComponentSerializer.plainText().serialize(displayName).equals("cool item name")
  return true
hoary scarab
#

🤮

fast glade
#

😄

#

deprecated method def alot cleaner looking, but atleast its nice to learn more about adventure api

hoary scarab
#

Also make sure you have the untranslated name when using .equals there.

icy shadow
#

plain text is a bit of an eyebrow raiser

#

&chello and &bhello would have the same plain text

fast glade
#

so im assuming those translations carry over?

fast glade
#

i can test it rn

hoary scarab
#

Does it remove the translations and just give the text?

icy shadow
#

yes, that's what it means by "plain text" and is why i suggested the legacy code serialiser instead

hoary scarab
#

👍

fast glade
#

hmmm, so then whats the adventure alternative

#

thats not deprecated (just for future use cases where im not looking at item names)

icy shadow
#

the legacy code serialiser

just use the legacy component serializer

🥲

#

LegacyComponentSerializer

#

will serialize to &c/§c

#

or of course do it the other way around, and instead parse a component from the config and just compare components

#

that might be nicer

digital palm
#

Wasn't this a thing aswell? ChatColor.stripColor("name with color")

fast glade
#

chatcolor is also being deprecated in favor of the adventure api

#

(in paper)

digital palm
#

nvm then

hoary scarab
#

Good old "deprecate everything" I mean PaperMC... I mean Paper.

fast glade
#

well, minimessage format is 100x nicer and easier to work with, both as an end user and developer for writing out messages

icy shadow
#

god forbid software improves

hoary scarab
#

I mean... Why deprecate everything and add to it? Just make a whole new software at that point.

icy shadow
#

we must continue using designs from 10 years ago that are totally orthogonal to how the game actually works

icy shadow
fast glade
icy shadow
#

also that

#

(for now at least)

fast glade
#

folia is their new software, but its still years out before it'll be mainstream

icy shadow
#

and folia is still based on bukkit

hoary scarab
#

Far from impossible.
Paper already tries to get people to switch from using spigot anyways. Don't know why they keep bothering to include its code.

digital palm
#

Unrelated to this convo, but can someone try to tell me what I'm doing wrong? I want to access the second argument of my command, but args[1] always yells about Array Index being out of bounds (kinda massive codeblock incoming, if its too much delete it idk)

fast glade
#

literally only for compatibility, but my guess is they will hard fork from spigot eventually

digital palm
# digital palm Unrelated to this convo, but can someone try to tell me what I'm doing wrong? I ...
                if (ZoneGui.getPermsManager().get().checkPermission(sender, "zonegui.user.gui")) {
                    if (sender instanceof Player) {
                        if (args.length == 0) {
                            Inventories.mainInv.prepareInventory((Player) sender);
                            Bukkit.getScheduler().runTask(ZoneGui.getInstance(), () -> Inventories.mainInv.sendInventory((Player) sender));
                        } else if (args.length == 1 && args[0].equalsIgnoreCase("edit")) {
                            if (args.length == 2) {
                                // Handle the case where no region name is provided
                                sender.sendMessage(ChatColor.RED + "Please provide a region name.");
                                return true;
                            }

                            String regionName = args[1];
                            boolean isOwner = WGUtils.isRegionOwner((Player) sender, regionName, "world");

                            if (isOwner) {
                                RegionEditing.setRegion((Player) sender, regionName);
                                Inventories.regionOptionsInv.sendInventory((Player) sender);
                            } else {
                                sender.sendMessage(ChatColor.RED + "You are not the owner of this region.");
                            }
                        }
                    } else {
                        sender.sendMessage(ChatColor.translateAlternateColorCodes('&', ZoneGui.getPrefix() + Messenger.getText("General.OnlyPlayer")));
                    }
                } else {
                    sender.sendMessage(ChatColor.translateAlternateColorCodes('&', ZoneGui.getPrefix() + Messenger.getText("General.NoPermission")));
                }
            }
hoary scarab
digital palm
icy shadow
#

arrays start at 0

fast glade
#

String regionName = args[1];

#

this needs to beinside ur if (args.length == 2) {

hoary scarab
#
else if (args.length == 2 && args[0].equalsIgnoreCase("edit")) {
icy shadow
#

a lot of this logic is kinda messed up

digital palm
#

I know it is

fast glade
#

idk the term for it, but nesting is generally harder to read

icy shadow
#
if (args.length == 1 && args[0].equalsIgnoreCase("edit")) {
  if (args.length == 2) {
    // this will never be true
  }
...
}```

hopefully it's clear why
digital palm
#

I'm an absolute noob at java, I'm glad it even remotely works

digital palm
#

Yeah I probably screwed up the nesting lol

#

Just looking at it, this should work (I think lol)

if (sender instanceof Player) {
                        if (args.length == 0) {
                            Inventories.mainInv.prepareInventory((Player) sender);
                            Bukkit.getScheduler().runTask(ZoneGui.getInstance(), () -> Inventories.mainInv.sendInventory((Player) sender));
                        } else if (args.length == 1 && args[0].equalsIgnoreCase("edit")) {
                            Inventories.worldRegionsInv.prepareWorldRegionsInventory(player, false);
                            Bukkit.getScheduler().runTask(ZoneGui.getInstance(), () ->
                                    Inventories.worldRegionsInv.sendInventory(player, "world", 1, PlayerStates.State.WAITING_REGION_SELECT));
                        } else if (args.length == 2 && args[0].equalsIgnoreCase("edit")) {
                            // Assuming args[1] contains the region name provided as an argument
                            String regionName = args[1];
                            boolean isOwner = WGUtils.isRegionOwner(player, regionName, "world");
                            if (isOwner) {
                                RegionEditing.setRegion(player, regionName);
                                Inventories.regionOptionsInv.sendInventory(player);
                            }
                        }
                    }```
fast glade
#

basically to help with "nesting" is to limit it, and get rid of the bad cases at the begining

so like

if(!(sender insteadof Player){
  // ur not a player code
  return ...; // <--- return prevents it from doing the rest of the function)
}

if(args.length == 0) {
  // logic etc
  return ...;
}

// rest of logic ....

this is easier to read than nesting it all

#

its not really right or wrong, just imo, helps ALOT with getting confused when nesting

icy shadow
# hoary scarab Far from impossible. Paper already tries to get people to switch from using spig...

Far from impossible.
it pretty much is, there's no other implementation that actually supports everything, in the latest version, that isn't based on the notchian / bukkit server. and it gets more and more impossible as time goes on

even if it's theoretically possible, it's a gargantuan amount of effort for zero benefits and multiple downsides (loss of plugin compatibility, far more maintenance requirements, some of the notchian quirks like redstone are pretty much impossible to replicate - even mojang cant do it, etc).

the whole point of open source is that people can take other code and improve it, which is exactly what paper is doing. by your same logic, spigot shouldve made a brand new implementation rather than forking bukkit

i know you love being contrarian but anyone can see that a full server rewrite from scratch would be such a terrible idea that it's not even worth considering

dusky harness
hoary scarab
#

@digital palm ```java
if(!command.getName().equalsIgnoreCase("zone"))
return false; // Wrong command, sends usage

if(ZoneGui.getPermsManager().get().checkPermission(sender, "zonegui.user.gui")) {
sender.sendMessage(ChatColor.translateAlternateColorCodes('&', ZoneGui.getPrefix() + Messenger.getText("General.NoPermission")));
return true;
}

if(!(sender instanceof Player player)) {
sender.sendMessage(ChatColor.translateAlternateColorCodes('&', ZoneGui.getPrefix() + Messenger.getText("General.OnlyPlayer")));
return true;
}

if(args.length == 0) {
Inventories.mainInv.prepareInventory(player);
Bukkit.getScheduler().runTask(ZoneGui.getInstance(), () -> Inventories.mainInv.sendInventory(player);
return true;
}else if(args.length == 1) {
sender.sendMessage(ChatColor.RED + "Please provide a region name.");
return true;
}

if (args.length == 2 && args[0].equalsIgnoreCase("edit")) {
String regionName = args[1];
boolean isOwner = WGUtils.isRegionOwner((Player) sender, regionName, "world");

if (isOwner) {
    RegionEditing.setRegion((Player) sender, regionName);
    Inventories.regionOptionsInv.sendInventory((Player) sender);
} else {
    sender.sendMessage(ChatColor.RED + "You are not the owner of this region.");
}

}

fast glade
dusky harness
#

bc yeah theres alternative redstone engines

#

i think paper has a config option for it

fast glade
#

they do, i think theres 2

icy shadow
river solstice
#

Alternating current?

icy shadow
#

and yeah in paper

digital palm
#

AC and EC, ye

fast glade
#

yeah and eigen

hoary scarab
#

Just because its hard to do doesn't mean its impossible... Someone can and might one day make a server from scratch. Look at minestom they started from scratch.

dusky harness
#

minestom is missing a huge amount of features

#

(on purpose)

digital palm
#

Glowstone did as well didnt they

upper jasper
#

Minestom started from scratch and is still very much there

icy shadow
#

yeah and minestom isnt trying to repliciate vanilla behaviour, it's not in the same league at all

upper jasper
#

No sane person will ever fully reimplement all vanilla features

icy shadow
#

no sane group, even

hoary scarab
#

Exactally... Imagine a a person or team that actually tried to recreate the vanilla server. It can be done. Nothing impossible about it.

dusky harness
#

Krypton 😔

icy shadow
#

bro im convinced you just didnt read my message

#

even if it's theoretically possible, it's a gargantuan amount of effort for zero benefits and multiple downsides (loss of plugin compatibility, far more maintenance requirements, some of the notchian quirks like redstone are pretty much impossible to replicate - even mojang cant do it, etc).

#

please name a single benefit of actually doing this

fast glade
#

hes not saying its impossible, it just be really dumb for them to do it

hoary scarab
#

I read it. Just doesn't matter. I'm talking about you calling it "Impossible" in your original message lol

#

Minecraft did it. It can clearly be done.

dusky harness
#

also pufferfish etc are already really optimized

icy shadow
#

i never said it was literally impossible

#

just "pretty much impossible"

dusky harness
#

i feel like even if you did make one from scratch, it'd be less performant unless you get like the whole paper + mojang dev team to make one

icy shadow
#

once again you're just proving you dont read the full thing

hoary scarab
#

I think you under estimate the term impossible. Saying "pretty much" doesn't really counter it lol

icy shadow
#

lmao

#

biggest straw grasp ive ever seen

dusky harness
#

"pretty much impossible" doesn't have to mean 100% impossible

upper jasper
icy shadow
#

"pretty much impossible" quite clearly means "with unlimited time and effort you could do it, but it's not practical"

fast glade
#

any infinite monkey theory enjoyers?

icy shadow
#

hell yeah

hoary scarab
#

Practicality or not it can be done. It wouldn't take a whole team to recreate the vanilla server, it would take time obviously.

icy shadow
#

nobody said it couldnt be done

#

you're arguing with nobody man

dusky harness
#

and a lot of time

#

mc took a lot of time to make

icy shadow
#

with a billion dollars of course you could do it

#

but paper does not have a billion dollars, so your initial message saying "waa waa why do they use spigot code" is clearly unreasonable

hoary scarab
#

🤦

icy shadow
#

so true man

fast glade
icy shadow
#

are you sure?

#

that doesnt sound right

fast glade
#
Component displayName = item.getItemMeta().displayName();
String rawDisplayName0 = LegacyComponentSerializer.legacyAmpersand().serialize(displayName);
String rawDisplayName1 = LegacyComponentSerializer.legacySection().serialize(displayName);
String rawDisplayName2 = PlainTextComponentSerializer.plainText().serialize(displayName);
Util.log(rawDisplayName0);
Util.log(rawDisplayName1);
Util.log(rawDisplayName2);

logging it to the console, and its just showing the name of the item, (which in game is colored yellow)

dusky harness
#

why are you using ampersand

fast glade
#

just trying them all

#

idk wat they do

dusky harness
#

ampersand = &

#

section =

#

oh

#

rip alt key

#

section = alt + 2 + 1

#

my alt key is broken

icy shadow
#

§

#

here you go copy that

dusky harness
#

ty

fast glade
#

all 3 log to the console with just the text of the item

dusky harness
#

section = §

fast glade
#

exact same

icy shadow
#

how is Util.log implemented?

dusky harness
#

i wouldn't trust Util.log

fast glade
#

its mine

#
    public static void log(String msg){
        MiniMessage mm = MiniMessage.miniMessage();
        Component parse = mm.deserialize(PREFIX + " " + msg);
        Bukkit.getConsoleSender().sendMessage(parse);
    }
dense drift
#

😬

dusky harness
#

😬

fast glade
#

whats wrong?

dense drift
#

if you are using paper-api, there is Plugin#getComponentLogger or smth

dusky harness
#

or Bukkit.getLogger if spigot

#

not bukkit

#

plugin

#

javaplugin#getlogger

fast glade
#

i want to make sure im compatible with paper and spigot

dense drift
#

well, sendMessage(component) exists only on paper

fast glade
#

im not sending a component

#

oh i am

#

hmm

icy shadow
dense drift
icy shadow
#

if you sysout the components i think theyll be different

dusky harness
#

what i used to do was convert it to ints

#

like char -> int

#

and print that out

dense drift
#

what

dusky harness
#

then use a kotlin script to convert it back

#

bc console did weird things with the color codes

fast glade
# icy shadow if you sysout the components i think theyll be different

ok just doing system.out.println(msg) in my util.log

Component displayName = item.getItemMeta().displayName();
String rawDisplayName0 = LegacyComponentSerializer.legacyAmpersand().serialize(displayName);
String rawDisplayName1 = LegacyComponentSerializer.legacySection().serialize(displayName);
String rawDisplayName2 = PlainTextComponentSerializer.plainText().serialize(displayName);
Util.log(rawDisplayName0);
Util.log(rawDisplayName1);
Util.log(rawDisplayName2);

prints out this:

[11:34:54] [Server thread/INFO]: [testplug] [STDOUT] Cool item name
[11:34:54] [Server thread/INFO]: [testplug] [STDOUT] Cool item name
[11:34:54] [Server thread/INFO]: [testplug] [STDOUT] Cool item name

the item is named "cool item name" but the color is yellow in game

dusky harness
#

print out the length as well

#

string length

icy shadow
#

i love minecraft

fast glade
#
                        Component displayName = item.getItemMeta().displayName();
                        String rawDisplayName0 = LegacyComponentSerializer.legacyAmpersand().serialize(displayName);
                        String rawDisplayName1 = LegacyComponentSerializer.legacySection().serialize(displayName);
                        String rawDisplayName2 = PlainTextComponentSerializer.plainText().serialize(displayName);
                        System.out.println("Length: '" + rawDisplayName0.length() + "'");
                        System.out.println("Text: '" + rawDisplayName0 + "'");
                        System.out.println("Length: '" + rawDisplayName1.length() + "'");
                        System.out.println("Text: '" + rawDisplayName1 + "'");
                        System.out.println("Length: '" + rawDisplayName2.length() + "'");
                        System.out.println("Text: '" + rawDisplayName2 + "'");

output:

[11:39:17] [Server thread/INFO]: [qHGTweaks] [STDOUT] Length: '14'
[11:39:17] [Server thread/INFO]: [qHGTweaks] [STDOUT] Text: 'Cool item name'
[11:39:17] [Server thread/INFO]: [qHGTweaks] [STDOUT] Length: '14'
[11:39:17] [Server thread/INFO]: [qHGTweaks] [STDOUT] Text: 'Cool item name'
[11:39:17] [Server thread/INFO]: [qHGTweaks] [STDOUT] Length: '14'
[11:39:17] [Server thread/INFO]: [qHGTweaks] [STDOUT] Text: 'Cool item name'
icy shadow
#

huh

#

does the item actually have any colours in game?

fast glade
dusky harness
torpid raft
#

good name

icy shadow
#

try just System.out.println(displayName)

fast glade
#
[11:42:08] [Server thread/INFO]: TextComponentImpl{content="", style=StyleImpl{obfuscated=not_set, bold=not_set, strikethrough=not_set, underlined=not_set, italic=not_set, color=null, clickEvent=null, hoverEvent=null, insertion=null, font=null}, children=[TextComponentImpl{content="Cool item name", style=StyleImpl{obfuscated=not_set, bold=not_set, strikethrough=not_set, underlined=not_set, italic=not_set, color=null, clickEvent=null, hoverEvent=null, insertion=null, font=null}, children=[]}]}
spiral prairie
#

Aren't these crystals default yellow?

fast glade
#

ah!

#

ding ding

#

netherstars are yellow

#

by default

spiral prairie
#

Lol

icy shadow
#

aw man i thought that too but second guessed myself lol

#

dunno why italic tho

fast glade
#

idk why either tbh

icy shadow
#

minecraft moment probably

spiral prairie
#

Because item names that aren't the default item names are italic by default

#

You have to tell Minecraft to not make it italic

#

I think

icy shadow
#

oh i thought that was just for lore

spiral prairie
#

Maybe it was

#

No idea

icy shadow
#

congrats

fast glade
#

gives u cookie

surreal kelp
#

my server keeps crashing and not starting

#

can someone help

surreal kelp
warm steppe
sweet scarab
#

Does anyone have an idea why my Bungeecord Plugin is not loading my config file?
I saw this method on a SpigotMC wiki. Am I doing anything wrong?

        Configuration configuration = ConfigurationProvider.getProvider(YamlConfiguration.class).load(TengokuBungeeCore.getTengokuBungeeCore().getConfigFile());
        ProxyServer.getInstance().getLogger().info(configuration.getString("database.host"));

It does just log an empty string.

And yes, the config is getting created.

sleek wedge
#
ConfigurationSection reportReasons = config.getConfigurationSection("reasons");
        if (reportReasons != null) {
            for (String reasonKey : reportReasons.getKeys(false)) {
                ConfigurationSection reasonConfig = reportReasons.getConfigurationSection(reasonKey);
                String reasonTitle = reasonConfig.getString("title", "null");
                String reasonText = reasonConfig.getString("text", "null");
                int slot = reasonConfig.getInt("slot");

                gui.setItem(slot, createItem(Material.BAMBOO, reasonTitle, reasonText.replace("%player", reportedPlayer.getName())));
            }
        }```

idk why this aint working help
#
reasons:
  hacking:
    title: "Hacking"
    text: "Click to report %player for hacking."
    material: "BOOK"
    slot: 11
  spam:
    title: "Spam"
    text: "Click to report %player for spam."
    material: "BOOK"
    slot: 12
  advertising:
    title: "Advertising"
    text: "Click to report %player for advertising."
    material: "BOOK"
    slot: 13
  other:
    title: "Other"
    text: "Click to report %player for other."
    material: "BOOK"
    slot: 14
#

i'm dumb or what

icy shadow
#

what does "aint working" mean

sleek wedge
#

sout donest print

#

so it's doesnt work

river solstice
#

¯_(ツ)_/¯

#

LGTM

#

push to prod

torpid raft
#

Lets Get This Monkey

#

It's Damaging Our Furniture

river solstice
#

😵‍💫

dusk crypt
#

Anyone using this to their code? May I ask if this can cause lag on the server?

for (Player player : Bukkit.getOnlinePlayers())
{
      //Player the sound for  player
}
#

I just want to add some bit of coolness but if it makes the server lag a little bit, I'd rather not use it

dense drift
#

If something will cause lag or not depends on how you use it. If you run something for all players every tick for instance, it could eventually cause lag, but if you play a sound from time to time you should be fine

dusk crypt
#

Thank you. I just want to trigger it only if I type the specific command..

icy shadow
#

something something premature optimisation

light pendant
#

Hi, is there a reason why the helpch.at website is missing the javadocs for 1.19.4 and 1.20?

dense drift
#

yes, it was not updated.

#

1.20 and 1.20.1 are the same anyways

light pendant
#

well they aren't "the same"

#

would be nice if it could get updated

dense drift
#

yes they are the same, iirc 1.20.1 was just a client update to fix some problem(s)

#

1.20.1 is a minor hotfix update to Java Edition, released on June 12, 2023,[1] which added a new language and fixed critical bugs related to 1.20.

river solstice
#

major.minor.bugfix cursed_fingerguns

light pendant
#

they are not the same, it's literally 2 different maven dependencies

river solstice
#

💀

light pendant
#

I don't wanna say that there was any changes in teh javadocs itself, but it's still 2 different maven artifacts

dense drift
#

in therms of api structure or whatever you want to call it

river solstice
#

in terms of API methods, they are the same

#

it terms of versioning, they are not the same

#

better?

light pendant
#

yeah but that's not the point, there shoul dbe one javadoc per version

#

there's also no difference between 1.8.7 and 1.8.8 still both are on the website

#

and 1.19.4 is missing completely although it was a big change

dense drift
#

sure I will let funnycube know about your request lol

light pendant
#

sorry didn't mean to be rude or anything lol

#

but 1.19.4 definitely was a big change (the display entities, etc) so that should definitely be uploaded if possible :3

river solstice
#

well, the thing is, there's no need to rush to add X version if it's the same as Y, for reference maybe, if you don't know, yeah, but you were just told that they are the same

light pendant
#

yeah sure I know that basically nothing changed between 1.20 and 1.20.1 but if someone is actually running 1.20, they will be looking for 1.20 docs and not for 1.20.1 docs

#

anyway, as mentioned, 1.19.4 was big update and it'd be nice if that could get added :3

river solstice
#

well, people don't get paid for it

dense drift
#

if someone is actually running 1.20, they will be looking for 1.20 docs and not for 1.20.1 docs
eh I mean you should know more ab the version you are running

river solstice
#

you can always look elsewhere fingerguns

dense drift
#

btw if you really need the docs for 1.19.4, you can unzip the javadoc jar

light pendant
#

... I know that I can get the javadocs, I was simply suggesting to add it to the website

dusky harness
#

wayback machine

#

idk

light pendant
#

no clue why you're all so hostile here

dusky harness
#

if u don't wanna unzip the jar

river solstice
#

tell that to funnycube

dense drift
#

jokes aside, I will let fc know ab this.

dusky harness
dusty frost
#

huh, i didn't actually know that 1.20 and 1.20.1 had separate spigotmc maven artifacts, but it turns out there is approximately 7kB of difference in the jars

#

md5 be weird af for sure

light pendant
dusky harness
light pendant
#

md_5 must have been drunk, idk

dusty frost
#

buildtools 💀

dusty frost
#

the day paper does the hard fork will be a good day 😌

light pendant
#

to get 1.20 one has to specify the actual commit from the git history

dusty frost
#

yeah cause like the actual protocol numbers in the game are the same, didn't know spigot actually changed some stuff

light pendant
#

even the mappings for 1.20 and 1.20.1 are exactly the same

dusty frost
#

i mean yeah, they should be lol

light pendant
dusty frost
#

there was no serverside changes

dusty frost
#

especially with stuff like Folia becoming actually pretty big

light pendant
#

but what's the purpose of "hardforking"

icy shadow
#

to not have to worry about spigot compatibility

dusty frost
#

being able to do whatever they want without having spigot compat

#

and following md5's insane reasoning and updates and stuff

#

and they can release before spigot for updates, instead of having to wait until spigot releases, then doing their release based on it

light pendant
#

can you explain what you mean with "insane reasoning"?

dusty frost
#

just all the crazy stuff md5 has done to make the spigot api weird

light pendant
#

yeah but what exactly do you mean?

dusty frost
#

i don't have any examples off the top of my head, but i know the paper guys want to change a bunch of stuff and they can't right now because they have to have spigot compat

#

ooh a big one is the loader setup, hence the whole paper-plugin things they're working on

light pendant
#

well paper already broke compatibility with spigot many times (remember the AdvancementDisplay stuff for example?)

#

would be easily fixable if paper would just contribute upstream sometimes 😄

dusty frost
#

ohhhh

#

you're an md5 simp, i see

dense drift
#

🤣

light pendant
#

nah I am not, I just wonder what the actual arguments are

#

e.g. when we made the buildtools GUI, md wanted to turn this into a separate .jar, I found that very stupid

#

I'm not an md5 simp but I prefer to discuss using actual arguments

dusty frost
#

here's a better articulated argument

light pendant
#

but it's debatable whether that's even allowed

dusty frost
#

Fabric and Forge both do it

dense drift
#

no more build tools ❤️

dusty frost
#

so I figure that's plenty prior experience lol

icy shadow
#

paper doesnt need buildtools anyway

#

paperweight clears

dusky harness
light pendant
#

I'd definitely like it if there'd be no more need for remapping .jars

#

however it'd break literally every plugin that uses NMS currently

dusty frost
#

I think people would be pretty amicable to that when the benefits outweight the negatives so much in the long run

light pendant
#

I don't really understand the "Improving the API" part of that article though

dusty frost
#

You should probably go ask some people about it in the paper discord then, as they have much more intricate knowledge of what they want to improve than I do

dusty frost
#

two big things are Adventure and the classloader setup, but I know they want to do a lot more

light pendant
light pendant
sterile hinge
#

Fixing typos doesn’t count

light pendant
#

I'm not talking about fixing typos

dense drift
sterile hinge
#

I mean, just look at the PR to deprecate the Material enum

#

For how long is it open now?

light pendant
#

I think it's open since 1.17.1

#

idk why it doesn't get merged

sterile hinge
#

🙂

dusty frost
#

I think that exact scenario is a big part of Paper's hard fork reasoning lol

#

and why Paper even exists

light pendant
#

on the other hand, I don't think it provides any advantage

icy shadow
#

whats it being deprecated in favour of?

light pendant
#

what are you talking about? Material is not deprecated in spigot at least

sterile hinge
#

The idea is to bring it (and other enums) closer to the dynamic nature of Minecraft

dense drift
sterile hinge
#

I.e. make it registry based

light pendant
#

I know that there are plans to replace EVERY enum that implements Keyed with normal classes, but thats all I know

dense drift
#

I remember asking in fabric discord how to get x material and they were like "wth is a material" 🤣

light pendant
#

lol

dusky harness
#

I would dislike having to type minecraft:stone every time

light pendant
#

ofc there'll be constants

sterile hinge
#

Also split up blocks and items because that’s just a huge mess atm

dusky harness
#

oh ok

light pendant
#

it'll work like the Enchantment class

#

a shit ton of public static final fields

#

only thing it'll break is if people use EnumSets or EnumMaps or similar

dense drift
#

That's the cost of a better api

icy shadow
#

9/11 for enummap fans

light pendant
icy shadow
#

the fandom will not recover from this

sterile hinge
#

Imagine using EnumSet/Map for Material

light pendant
#

well why not

sterile hinge
#

Waste of space most of the time

light pendant
#

waste of space?

sterile hinge
#

Memory

light pendant
#

how is an EnumSet using more space than a normal HashSet

sterile hinge
#

An EnumSet always has a fixed size, depending on the amount of constants the enum has

dense drift
#

yeah it is not just a fancy name for a HashSet xD

dusky harness
#

isn't the point of enumset to be better than a regular set?

light pendant
#

EnumSets uses some fancy math to avoid using the ordinary hashCode

light pendant
#

although it probably doesn't make any real life difference lol

sterile hinge
#

For small enums, definitely, if you only care about speed, depends