#help-development

1 messages Β· Page 839 of 1

sterile token
#

I was goign to mention the same thing but i take my time to calm down hahaha

pseudo hazel
#

is it a big query?

sterile token
#

Why? Well the explantion is not big when you querying something your doing your thread to await until the query result, but what happen if you dont get a result? Well the main thread will be awaiting until its complete

pseudo hazel
#

yes, but it could explain why the server is freezing in this instance

#

if its not a big query there could be other issues

sterile flicker
#

in my world protected with worldguard, animals will not spawn is it possible that mob-spawning deny also prohibits animals from spawning?I used worldguard api to create a region that protects my mini game map

pseudo hazel
#

the mob spawning gamerule pertains to all mobs

umbral ridge
#

hey,
it's not possible to sprint if your flying is disabled?

pseudo hazel
#

but idk about worldguard

sterile flicker
#

how to allow a sheep to spawn, I need it for the mini-game sheepfreenzy

pseudo hazel
#

why not just spawn them yourself

#

idk what kinda minigame it is

sterile token
#

Because their discord is specialized to world guard i hope its help you, have a nice day!!

sterile flicker
umbral ridge
sterile token
#

if that what you mean via summon

pseudo hazel
#

maybe try eating first xD

umbral ridge
sterile flicker
#

I deleted the region and the sheep started spawning

sterile token
sterile token
proud badge
#

also are you that creator of MPDT?

sterile flicker
#

that is, from the side of the spigot api

remote swallow
chrome beacon
proud badge
#

morepersistantdatatypes

remote swallow
#

ah

proud badge
#

After moving to gradle it keeps giving NoDefClassFound stacktraces

remote swallow
#

yeah alex made that

remote swallow
chrome beacon
#

^^

proud badge
#

dk what that is, my friend moved it to gralde

#

He did mention shading yes

#

Is that bad?

remote swallow
#

add the shadow plugin

proud badge
#

what is the shadow plugin? Shadow dependency you mean?

remote swallow
#

no the plugin

#

v

proud badge
#

ok epic

#

they added it now

sterile flicker
# chrome beacon Listen to the entity spawn event

something like this? ```@org.bukkit.event.EventHandler
public void onCreatureSpawn(CreatureSpawnEvent event) {
if (event.getEntityType().isAlive() && !isAllowedAnimal(event.getEntityType())) {
event.setCancelled(true);
}
}

private boolean isAllowedAnimal(EntityType entityType) {
    return Objects.requireNonNull(entityType) == EntityType.SHEEP;
}```
chrome beacon
#

skip the require non null

#

also no need to check if it's alive or not

rapid scarab
#

Yeah I figured #get blocks the main thread, the queries I've worked with before were very very small (like this one actually), so I was running them on the main thread, which I'm trying to avoid now for the first time by using dbs async.

I guess I got this completely wrong then πŸ€¦β€β™‚οΈ, CF should be used on the actual actions that use the databases rather than the methods that simply return values from the db. Like the isEventRunning() method being in a CF is completely useless, it's rather in the GUIClick class (where I need the value from the db) where I should use CF, right? thanks for the help either way

sterile token
chrome beacon
#

CompletableFuture

rapid scarab
#

CompletableFuture

sterile token
#

oh right, thanks

rapid scarab
#

I fiddled around with node before but no real projects

chrome beacon
#

Basically there's no point in creating an async function and then forcing it to run on the main thread

#

What you want to do is create a basic loading state while it fetches the information from the database

#

also you really shouldn't query the database on every inventory click

sterile token
#

You should have some sort of catching because then you will over resource on every inventory click

#

No t sure if i made understand i will try to write it better

rapid scarab
sterile token
#

What we mean with Olivo is that is not a great idea calling the db all the time when each click is done

rapid scarab
rapid scarab
#

Oh? Even then? Because the value it's fetching always changes so I'd need to make sure it checks it

#

Basically the full code is that a player executes a command, a GUI opens, and then if the player clicks on a specific slot in the GUI, that's when I would use the CF to ask for the value from the database

#

Would that still cause issues?

rapid scarab
dry hazel
#

you need to ask for the value and act upon it whenever it's received, don't actively wait for it

chrome beacon
#

Could you explain what the database call is for?

#

is seems to be checking if an event is running

#

but why are you checking it on click

rapid scarab
#

Yeah the click on a specific item in the GUI attempts to host an event. That's when the plugin checks if an event is running or not. If it's running, GUI closes & server tells the player that they can't host an event, cause there's already one running.

If database returns that event is not running, plugin sets the eventRunning boolean in that database to true & then I just use spigot methods to run an event

#

The reason I use a database & not anything simple (internal) is because they're inter-server events on the network

chrome beacon
#

Sounds like you would want an in memory database instead

#

Like Redis for example

rapid scarab
#

I explored using other solutions like Redis, but I just built the entire thing around DBs months ago & it worked great. They're very very small queries

chrome beacon
#

if you want to keep the current approach just run your code when the query completes instead of waiting for the query

#

use thenAccept

rapid scarab
#

Can I use spigot code in the thenAccept?

chrome beacon
#

Depends on what you're doing

#

but if you're not sure use the scheduler to jump back to the main spigot thread

rapid scarab
#

Just regular spigot methods, sending a message etc

chrome beacon
#

?scheduling

undone axleBOT
rapid scarab
#

Ah yep

#

Perfect I understand. I'll have a go at it tonight & report back, thank you so much for your help πŸ’™ it means a lot!

river oracle
#

Likewise whenCompleteAsync runs it asynchronously instead of synchronously

rapid scarab
#

I see I see! Thank u πŸ’™

river oracle
#

Reminder you can't cancel events in in thenAccept or WhenComplete

#

Even of its synced it'll occur after the event has already outlived the ability to be cancelled

rapid scarab
#

Yep no need πŸ˜… the event is cancelled at the beginning

chrome beacon
#

if you're going to close the GUI do check that it's still open

#

and that it's the right inventory

rapid scarab
#

Ahh true! Will do. But the queries don't take that long do they? It's just one boolean

chrome beacon
#

It could

rapid scarab
#

Also, for setting database values (instead of getting), I also use CF right?

chrome beacon
#

It can be unpredicatable which is why I/O shouldn't be done sync

rapid scarab
#

Yep

rapid scarab
#

Yep perfect! Thank u πŸ™

#

I'm curious how the plugin running sync only crashed one server running a specific plugin but not another one πŸ˜…

quaint mantle
#

Why is "BlockPopulator" called twice in the same chunk?

#

I register my populators like that

    @Override
    public @NotNull List<BlockPopulator> getDefaultPopulators(@NotNull World world) {
        List<BlockPopulator> blockPopulators = world.getPopulators();
        blockPopulators.add(new MoonGrassGenerator());
        blockPopulators.add(new MoonOreGenerator());
        blockPopulators.add(new MoonStructureGenerator());
        return blockPopulators;
    }
chrome beacon
#

How do you know it's being called twice

quaint mantle
#

?paste

undone axleBOT
quaint mantle
#

Here is "MoonStructureGenerator" as an example

#

it somehow spawns the structure twice ontop of eachother, and i know that its not a problem of the function

#

because the same problem is also in grass generator

sterile sapphire
#

import org.bukkit.ChatColor;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.inventory.InventoryClickEvent;

public class MenuListener implements Listener {

    @EventHandler
    public void onMenuClick(InventoryClickEvent e) {
        if (e.getView().getTitle().equalsIgnoreCase(ChatColor.GRAY + "Land Shop")) {
            // Check if the clicked slot is empty
            if (e.getCurrentItem() == null || e.getCurrentItem().getType().isAir()) {
                return;
            }

            // Cancel the event to prevent item movement
            e.setCancelled(true);
        }
    }
}```
#

can someone please help as this wont work for some reason and idk why

quaint mantle
sterile sapphire
#

this is the Land Shop menu code

sterile sapphire
quaint mantle
#

its about my problem

gleaming grove
#

Is it possible to give player effect with custom name?

chrome beacon
shadow night
sterile sapphire
# sterile sapphire this is the Land Shop menu code

import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.entity.Player;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;

public class Menu extends CommandExecutor {

    // The Inventory Its Self
    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        Player player = (Player) sender;
        Inventory inventory = Bukkit.createInventory(player, 9, ChatColor.GRAY + "Land Shop");
        ItemStack item = new ItemStack(Material.GRAY_STAINED_GLASS_PANE, 1);
        inventory.addItem(item);

        // Nothing
        ItemStack Nothing = new ItemStack(Material.GRAY_STAINED_GLASS_PANE, 1);
        ItemMeta NothingMeta = Nothing.getItemMeta();
        NothingMeta.setDisplayName(" ");
        NothingMeta.addEnchant(Enchantment.DURABILITY, 1, true);
        Nothing.setItemMeta(NothingMeta);

        // Land Plot 1
        ItemStack LandPlot1 = new ItemStack(Material.GRASS_BLOCK, 1);
        ItemMeta LandPlot1Meta = LandPlot1.getItemMeta();
        LandPlot1Meta.setDisplayName(ChatColor.RED + "Plot 1");
        LandPlot1Meta.addEnchant(Enchantment.DURABILITY, 3, true);
        LandPlot1.setItemMeta(LandPlot1Meta);

        // Land Plot 2
        ItemStack LandPlot2 = new ItemStack(Material.GRASS_BLOCK, 1);
        ItemMeta LandPlot2Meta = LandPlot2.getItemMeta();
        LandPlot2Meta.setDisplayName(ChatColor.RED + "Plot 2");
        LandPlot2Meta.addEnchant(Enchantment.DURABILITY, 3, true);
        LandPlot2.setItemMeta(LandPlot2Meta);
#
        ItemStack LandPlot3 = new ItemStack(Material.GRASS_BLOCK, 1);
        ItemMeta LandPlot3Meta = LandPlot3.getItemMeta();
        LandPlot3Meta.setDisplayName(ChatColor.RED + "Plot 3");
        LandPlot3Meta.addEnchant(Enchantment.DURABILITY, 3, true);
        LandPlot3.setItemMeta(LandPlot3Meta);

        // Back
        ItemStack Back = new ItemStack(Material.GRASS_BLOCK, 1);
        ItemMeta BackMeta = Back.getItemMeta();
        BackMeta.setDisplayName(ChatColor.GRAY + "Back");
        BackMeta.addEnchant(Enchantment.DURABILITY, 3, true);
        Back.setItemMeta(BackMeta);



        // rest of the slots
        inventory.setItem(0, Nothing);
        inventory.setItem(1, Nothing);
        inventory.setItem(2, LandPlot1);
        inventory.setItem(3, Nothing);
        inventory.setItem(4, LandPlot2);
        inventory.setItem(5, Nothing);
        inventory.setItem(6, LandPlot3);
        inventory.setItem(7, Nothing);
        inventory.setItem(8, Back);

        player.openInventory(inventory);

        return true;
    }
}```
chrome beacon
sterile sapphire
shadow night
quaint mantle
#

InventoryHolders

#

I check inventories with inventoryholders

sterile sapphire
#

idk how to do that

quaint mantle
#

you implement InventoryHolder

#

then in Bukkit.createInventory change player with "this"

ivory sleet
#

InventoryHolder is also kinda meh

quaint mantle
chrome beacon
ivory sleet
#

yeah the issue is that you implement an interface not exactly meant to be implemented, moreover iirc it does end up yielding a ton of instance creations underhood thus it doesn’t exactly scale well

#

unless that was fixed ^^

quaint mantle
#

is that about inventoryholders?

ivory sleet
#

Yeaa

#

Olivo got the superior method here

quaint mantle
#

ok yea

sterile sapphire
quaint mantle
chrome beacon
#

or a weak one if you want it GCd

sterile sapphire
#

idk what any of that is, im learning all of this for the first time

ivory sleet
#

DracoCookie I agree its a bit dumb because on the surface it looks too good to be true

quaint mantle
ivory sleet
#

Like its so object oriented and looks to work well :^)

#

yeah well soon Y2K might get his pr pushed n merged

quaint mantle
#

anyways

#

we still dont know if the listener is registered

#

and that was my question

#

@sterile sapphire is your listener registered

#

Am i braindead or smth, i keep typing verified instead of registered

shadow night
#

Please verify your listener.

#

Is your listener verified?

sterile sapphire
#

import org.bukkit.ChatColor;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.inventory.InventoryClickEvent;

public class MenuListener implements Listener {

    @EventHandler
    public void onMenuClick(InventoryClickEvent e) {
        if (e.getView().getTitle().equalsIgnoreCase(ChatColor.GRAY + "Land Shop")) {
            // Check if the clicked slot is empty
            if (e.getCurrentItem() == null || e.getCurrentItem().getType().isAir()) {
                return;
            }

            // Cancel the event to prevent item movement
            e.setCancelled(true);
        }
    }
}```
#

i think was it

quaint mantle
#

WHY

shadow night
#

Did you verify your listener man?

quaint mantle
#

stop bullying me

shadow night
#

All your listeners shall be verified

steel swan
#

hey so, i'm trying to use a custom image for my scoreboard, using a special charactere. But its reaally small, how can i change that in the plugin?

sterile sapphire
quaint mantle
#

in main class or somewhere else

sterile sapphire
#

no i dont think so

river oracle
shadow night
quaint mantle
quaint mantle
sterile sapphire
#

i was waching a tutoial and trying to learn of that for the bit

steel swan
#

wont i just give a better resolution?

quaint mantle
#

NO I DID WRONG CMD AGAIN

sterile sapphire
#

ik what events r

quaint mantle
shadow night
# quaint mantle :(

In hallowed halls where murmurs gently tread,
A proclamation echoes, widely spread.
All listeners, aye, shall be verified,
Their hearts laid bare, no secrets to hide.

With solemn oath, they pledge their troth,
In words and deeds, the measure of both.
No guise or shadow shall obscure the way,
To truth and candor, they must obey.

A dance of whispers in the air,
Yet only those of honesty shall dare.
For falsehood's cloak, a frail disguise,
In scrutiny's gaze, it swiftly unties.

Let scrutiny reign, let honesty shine,
In every listener, a pledge divine.
For in the realm where words hold sway,
Verified hearts shall guide the day.

quaint mantle
#

still read it

quaint mantle
#

poem*

shadow night
#

Yes

#

But that doesn't matter verified listener bro

#

It's a poem

quaint mantle
#

who knows maybe the listener is a hacker

echo basalt
sterile sapphire
#

public class MenuListener implements Listener {

quaint mantle
#

he needs to be verified man

echo basalt
#

You might want a second character that's bigger

quaint mantle
echo basalt
quaint mantle
#

you are making it hard for us if you dont listen

echo basalt
#

whether it is inventory names or items

shadow night
# quaint mantle who knows maybe the listener is a hacker

In the realm where Bukkit reigns with might,
Verily, listeners, a task to sight.
To be verified, a decree profound,
In the coding's script, their trust is found.

Oh, Bukkit listeners, with code entwined,
In verification's embrace, assurance bind.
Through realms of digital, their presence true,
Verified they stand, with duty to pursue.

echo basalt
#

It's a dumb approach

sterile sapphire
sterile sapphire
echo basalt
#

So why do you insist

sterile sapphire
#

just that u shouldnt

echo basalt
#

Well

#

For item names, anvils exist

#

An exploit I've personally abused was just renaming items with a /rename plugin on servers and tricking plugins like Slimefun that they're the real deal

#

For inventory checks, it's just dumb

#

Relying on an implementation detail

#

If you want to change the inventory title due to a config or something you'd need to change your listener too

sterile sapphire
echo basalt
#

What if you could just give your inventory a tag or something saying "hey look this is my custom inventory"

river oracle
echo basalt
#

You're still abusing an implementation detail rather than just doing things the proper way

quaint mantle
#

caugh Essentials caugh

echo basalt
#

(inventory pdc when)

river oracle
#

πŸ’€ lol

#

no shot my mans

quaint mantle
#

just store it in variables inventories dont last forever

#

(I know it was sarcasm)

river oracle
#

You can store data in containers but only integers

echo basalt
#

For items what if you could just give them a tag saying "yeah this is my custom item" in a way where players wouldn't ever possibly be able to modify it

shadow night
echo basalt
#

That's PDC

#

As for inventories you can just put them in a map

#

and tie that instance to the inventoryview's lifecycle

#

When the inv opens, you put it in the map and when it closes you remove it

river oracle
#

yep and remember kids the Hashcode doesn't change ;)

shadow night
#

What's the purpose of the hashcode

echo basalt
#

Map<InventoryView, MyCustomInventory>

river oracle
#

HashMaps

#

HashSets

#

HashAnythings

echo basalt
shadow night
#

Kind of

quaint mantle
#

Can someone explain what hashing is

river oracle
#

you essentially are just reducing a classes data into a finite range of numbers

echo basalt
#

It's just a way to irreversibly convert data to a single number

river oracle
#

because under the hood many HashMap implementations are an array of LinkedLists

echo basalt
#

So a hashcode of a number is just itself

shadow night
#

I never got too deep into hashing, just that it's using maths to turn things into a number that you can't turn back into those things or something

echo basalt
#

A hashcode of an object is just a weird combination of all its objects' hashcodes

#

Now, you can use the hashcodes to see if 2 objects are(n't) equal

quaint mantle
#

If its turned into a number, how would hashmap.get work then

echo basalt
#

Hashmaps store objects in "buckets"

#

What bucket it's stored in depends on the hashcode

quaint mantle
#

Interesting

#

Thats why hashmaps are serializable huh

shadow night
echo basalt
#

this one's a bit better

#

Basically get the hashcode and get the bucket for it

#

int bucketIndex = hashcode & (bucketCount - 1)

#

That's your "bucket"

#

The bucket acts as a sort of linkedlist

river oracle
#

does java use separate linking?

quaint mantle
#

I am illustrating it in my head with water buckets πŸ€”

river oracle
#

I've never looked at the implementation

echo basalt
#

it changes in java8

#

But once the object count crosses a certain threshold it doubles the bucket count and re-hashes the entire hashmap

#

It also changes it from a linkedlist approach to a tree approach

ivory sleet
echo basalt
#

It does

#

that's the bucket index

ivory sleet
#

yea

echo basalt
#

Something like this

#

Once it crosses the load factor it switches bucket impls

#

I'll make Bucket an interface and switch it from a LinkedBucket to a TreeBucket :)

ivory sleet
#

Source bin, you in TSC a lot? :o

ivory sleet
pliant topaz
#

Hi, so I wanna get the player by uuid, but it always returns null, anyone knows why that could be?
here's my code:
Bukkit.getPlayer(UUID.fromString(CreateBoard.gamePlayerUUIDs.get(i)))
gamePlayerUUIDs being a ArrayList containing the UUIDs of the players, and the index is existing, so the UUID is being read correctly

ivory sleet
#

Tho practically in Java its used to determine whether X and Y is the same, thus you also need to override equals just in case of collisions which… happen more than what u think at times.

quaint mantle
shadow night
#

And is it the uuid of an online player?

quaint mantle
#

Returns:
a player object if one was found, null otherwise

#

Since its null, the player is probably offline

ivory sleet
#

Not just probably

shadow night
#

getOfflinePlayer exists I think

ivory sleet
#

It is null draco

#

It does

#

But if you create an offline player with just the uuid, there is no guarantee that it will have a name

pliant topaz
#

Well, I am the player

#

And I am certainly not offline when it triggers

#

that's why it wonders me

shadow night
pliant topaz
#

With player names it works fine

#

But that wouldn't work with name changes unfortunately

shadow night
#

Have you tried storing UUID objects instead of Strings with UUIDs

quaint mantle
#

Yea

pliant topaz
#

i'll try it

#

wonder how i didn't think of that lol

shadow night
#

Lol

#

Avg programming moment

pliant topaz
#

fr

#

Also just realized I have to completely change like every piece of code i have bc of that .-.

shadow night
#

I was solving an issue for 2 months to find out it was because I wrote byte instead of int

quaint mantle
#

How th did you do that

pliant topaz
#

bruh
Sat 7 hours there and realized I didn't clear one value which was why it didn't function

shadow night
#

I also recently had an issue, where the whole issue was that I used the wrong player object and it took me 2 days to realize

meager wolf
#

uh

#

i have a lil problem but i cant english

quaint mantle
#

Yes yes we cant english too

meager wolf
#

my english is not englishing

quaint mantle
#

What problem?

shadow night
#

Do you have issues we string to material

#

πŸ‘

meager wolf
#

hm

#

wait

#

nvm

#

gonna try smth first

shadow night
#

Ah yes

pliant topaz
#

Maybe I'm just dumb after all..
lmao

quaint mantle
#

Nah I once stored uuid as string too

#

But it worked for me so i didnt change it

zinc sundial
#

Hello does anyone can explain me how i can make this code to work

 @EventHandler
    public void onPlayerLogin(AsyncPlayerPreLoginEvent event) {

        plugin.getServer().getScheduler().runTaskAsynchronously(plugin, () -> {
            try {
                System.out.println(event.getAddress().toString());
                String response = plugin.getApiBase().user().isWhitelisted(event.getAddress());
                System.out.println(response);
                Gson gson = new Gson();
                BasicRequestResponse responseResult = gson.fromJson(response, BasicRequestResponse.class);

                if (responseResult.status != 200) {
                    System.out.println("here");
                    event.disallow(AsyncPlayerPreLoginEvent.Result.KICK_OTHER, "You are not whitelisted on this server.");
                }
            } catch (Exception e) {
                plugin.getLogger().info("Error checking whitelist status: " + e.getMessage());
            }
        });
    }

Now the issue is that the player not being kicked from the server in server console I can see System.out.println("here"); but player is still online

ivory sleet
#

Remove the run async

quaint mantle
#

Yea

zinc sundial
#

I see it worked, can I know the reason why it's so ? Does it's bzoc AsyncPlayerPreLoginEvent is already async ?

quaint mantle
#

yes

ivory sleet
#

yes

quaint mantle
#

what about that catch exception is that good practice

ivory sleet
#

Nah not rly

quaint mantle
#

im reading effective java rn cause i got no idea what to do with my library

ivory sleet
#

Lol

pseudo hazel
#

catching all exceptions is kinda useless anyways

zinc sundial
wet breach
#

And you should only catch the exceptions that are thrown not generic ones

pseudo hazel
#

yeah and the docs should tell you which ones it throws

quaint mantle
#

Or just peek into the code

#

i mean for his case I think he should disallow the user from joining if there's an exception

#

Near the function it should have "throws"

wet breach
meager wolf
#

now i can english

#

so im making a rewards system, and its configurabl, like this:

#

my problem is

#

how can i add custom items, that dont have special ID

#

like this item

#

its not just a normal player head, it does stuff

remote swallow
#

give it a tag and do stuff according to events and its tag

meager wolf
#

sorry, what do u mean?

remote swallow
#

use pdc and do stuff according to the stuff you add to the pdc

steel swan
#

Juste a question, for colors, i use chatcolor like CHatColor.BLUE, but how can i use colors from codes like #763297

eternal night
#

you don't

#

bungeecord chat color exposes a way to do RGB

#

idk if that properly translates to the somewhat cursed RGB format however

river oracle
#

There is some code in ChatColor.of() that does it

eternal night
#

perfect kekwhyper

river oracle
#

:/ my parser is cursed as fuck though

#

atleast its not slow and cursed xD

ionic terrace
#

Am I just stupid or is Category not a part of java or bukkit?

hazy parrot
#

what

river oracle
#

??

#

what is Category

ionic terrace
#

Forgot to send a ref

river oracle
#

look at the package

hazy parrot
#

we have no idea what Category is

#

yeah d4j thingy

ionic terrace
#

None of the deps are what I need it for, old stupid code πŸ€¦β€β™‚οΈ

river oracle
#

maybe they mean CreativeCategory??

#

who knows

trim lake
#

Hi, trying to implement vault in my plugin but getting this error on local server, its working on remote server with same vault.
Error:

java.lang.NullPointerException: Cannot invoke "org.bukkit.plugin.RegisteredServiceProvider.getProvider()" because "rsp" is null
    at me.marek2810.rpjobs.RPJobs.setupChat(RPJobs.java:58) ~[RPJobs-1.0.jar:?]
    at me.marek2810.rpjobs.RPJobs.onEnable(RPJobs.java:32) ~[RPJobs-1.0.jar:?]
    at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:281) ~[purpur-api-1.19.4-R0.1-SNAPSHOT.jar:?]
    at io.papermc.paper.plugin.manager.PaperPluginInstanceManager.enablePlugin(PaperPluginInstanceManager.java:189) ~[purpur-1.19.4.jar:git-Purpur-1985]
    at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.enablePlugin(PaperPluginManagerImpl.java:104) ~[purpur-1.19.4.jar:git-Purpur-1985]
    at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:507) ~[purpur-api-1.19.4-R0.1-SNAPSHOT.jar:?]
    at org.bukkit.craftbukkit.v1_19_R3.CraftServer.enablePlugin(CraftServer.java:577) ~[purpur-1.19.4.jar:git-Purpur-1985]
    at org.bukkit.craftbukkit.v1_19_R3.CraftServer.enablePlugins(CraftServer.java:488) ~[purpur-1.19.4.jar:git-Purpur-1985]
    at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:643) ~[purpur-1.19.4.jar:git-Purpur-1985]
    at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:442) ~[purpur-1.19.4.jar:git-Purpur-1985]
    at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:345) ~[purpur-1.19.4.jar:git-Purpur-1985]
    at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1120) ~[purpur-1.19.4.jar:git-Purpur-1985]
    at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:325) ~[purpur-1.19.4.jar:git-Purpur-1985]
    at java.lang.Thread.run(Thread.java:833) ~[?:?]```
#

code:

private boolean setupChat() {
        RegisteredServiceProvider<Chat> rsp = getServer().getServicesManager().getRegistration(Chat.class);
        chat = rsp.getProvider();
        return chat != null;
    }
river oracle
#

either way you should probably avoid CreativeCategory as its not synced to the server

ionic terrace
river oracle
#

you should install one or your plugin won't work

quaint mantle
river oracle
#

@trim lake you can find a list of common chat providers on Vault's resource page

#

others may also exist as well

quaint mantle
trim lake
#

Hmm, I dont have any (even Essentials chat, I have only essentials) on remote server and its working fine

#

But, thanks I know the issiue now.

tender shard
proud badge
#

ok epic

#

I use it all of the time

#

for GUIs and other stuff

ivory sleet
#

What is MPDT?

eternal night
#

MorePersistentDataTypes

ivory sleet
#

oh, yes ofc

eternal night
#

Reduced by half its types when I finally survive family visiting me and fix the last couple comments on PDC lists πŸ™ƒ

ivory sleet
#

;prayge;

#

Just imagine an emote there, discord mobile loads all 173 guilds with emojis eagerly

#

everytime I press the dumb emoji button

eternal night
#

skill issue pepe_hand_heart_2

ivory sleet
#

;-;

eternal night
remote swallow
#

Your a wizard lynx

ivory sleet
#

Yea he got a wizard hat

timid berry
#

where can i find documentations and tutorials to create bungeecord plugins?
i wanna make something that runs a command like /check user evertime a user joins, if the output matches a website from a file, it will kick them

worldly ingot
#

Bungee's API is relatively simple because you're working at proxy level and really there's not a whole lot you usually have to do there, so the documentation is also pretty simple

rough blaze
#

would it be possible to run 2 click events?

TextComponent acceptButton = new TextComponent(ChatColor.GREEN + "[Accept]");
acceptButton.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/tp " + playerName));

worldly ingot
#

Not in the same component, no. You would have to make some sort of temporary hidden command (e.g. a /<uuid> command or something) and have that command run the two commands you want them to run

#

A bit hacky, but there's not really another option with components

#

I guess technically you could supply a data pack as well and run a function but :p

timid berry
#
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <groupId>org.example</groupId>
  <artifactId>bunkeykord</artifactId>
  <version>1.0-SNAPSHOT</version>
  <packaging>jar</packaging>

  <name>bunkeykord</name>
  <url>http://maven.apache.org</url>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>

    <repositories>
        <repository>
            <id>bungeecord-repo</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </repository>
    </repositories>

    <configuration>
        <source>1.8</source>
        <target>1.8</target>
    </configuration>

  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test</scope>
    </dependency>
      <dependency>
          <groupId>net.md-5</groupId>
          <artifactId>bungeecord-api</artifactId>
          <version>1.19-R0.1-SNAPSHOT</version>
          <type>jar</type>
          <scope>provided</scope>
      </dependency>
      <dependency>
          <groupId>net.md-5</groupId>
          <artifactId>bungeecord-api</artifactId>
          <version>1.19-R0.1-SNAPSHOT</version>
          <type>javadoc</type>
          <scope>provided</scope>
      </dependency>
  </dependencies>
</project>

is this correct

timid berry
#
package org.example;

import net.md_5.bungee.api.ProxyServer;
import net.md_5.bungee.api.chat.TextComponent;
import net.md_5.bungee.api.connection.ProxiedPlayer;
import net.md_5.bungee.api.event.PostLoginEvent;
import net.md_5.bungee.api.plugin.Listener;
import net.md_5.bungee.event.EventHandler;

public class events implements Listener {

    @EventHandler
    public void onPostLogin(PostLoginEvent event) {
        for (ProxiedPlayer player : ProxyServer.getInstance().getPlayers()) {
            player.sendMessage(new TextComponent(event.getPlayer().getName() + " has joined the network."));

        }
    }

}

how can i make the plugin execute a command everytime a player joins?

river oracle
#

@quaint mantle I finished my parser I was talking about πŸ‘ it's beautiful

#

It's so awesome to see something you've poured so much blood into to make work finally do something properly

quaint mantle
#

Any nerds online wanna make a quick buck? I need help and am so confused on what im trying to do i need a good helping hand with this. I just want to buy your time to share my screen and walk me through until we solve this issue. I am working with Mongo and Inventory Menu to save kits for Player.
Budget: $10-20

I literally cant figure this out

echo basalt
#

?services

undone axleBOT
vocal cloud
#

Just share your screen in general.

#

I'll be there in a few to help. Don't need to ask for money lol

echo basalt
#

Here's the thing

echo basalt
#

I've already given him pointers on how to re-structure his data to not have weird concurrency issues

quaint mantle
#

I just want to know why this thing keeps happening,
side effect of wrong use of CF i assume.

quaint mantle
#

I am asking in general not you specifically

vocal cloud
#

Don't worry I'm a super critical dev KEKW

#

I'll clean it up 🧹 just gotta brush this cat first irl

echo basalt
#

Just saying we already went through problem areas

quaint mantle
echo basalt
#

I'm just surprised you didn't find a solution

#

You're welcome to ask for help

quaint mantle
echo basalt
#

Nah that's not the reality

quaint mantle
echo basalt
vocal cloud
#

Can you share in general? Or do you need to be verified

echo basalt
#

prob need to be verified

quaint mantle
echo basalt
#

basically just ?verify <forum name>

lament tree
quaint mantle
#

?verify

echo basalt
#

or whatever

#

./verify

#

there we go

timid berry
lament tree
# timid berry ``` package org.example; import net.md_5.bungee.api.ProxyServer; import net.md_...
import net.md_5.bungee.api.ProxyServer;
import net.md_5.bungee.api.chat.TextComponent;
import net.md_5.bungee.api.connection.ProxiedPlayer;
import net.md_5.bungee.api.event.PostLoginEvent;
import net.md_5.bungee.api.plugin.Listener;
import net.md_5.bungee.event.EventHandler;

public class Events implements Listener {

    @EventHandler
    public void onPostLogin(PostLoginEvent event) {
        ProxiedPlayer player = event.getPlayer();
        ProxyServer.getInstance().getPlayers().forEach(p -> {
            p.sendMessage(new TextComponent(player.getName() + " has joined the network."));
        });
        ProxyServer.getInstance().getPluginManager().dispatchCommand(ProxyServer.getInstance().getConsole(), "your_command_here");
    }
}
quaint mantle
#

Command noot found..

lament tree
#

this is why

#

im terry davis

vocal cloud
#

it's a slash command /verify

timid berry
#

Word

quaint mantle
vocal cloud
#

you need a forums acc

quaint mantle
#

I have one

vocal cloud
lament tree
#

πŸ’€

echo basalt
#

If you need reactions because you want to post premium stuff just answer ppl's questions like a maniac

quaint mantle
echo basalt
#

Or post resources

#

And you'll get them

vocal cloud
#

I suppose temporarily. It'd be better to verify for future help/reference

lament tree
#

dawg im new

echo basalt
quaint mantle
#

Added you

lament tree
#

do you even know how to revert a binary tree

vocal cloud
echo basalt
#

I've been doing java for 7 years

lament tree
#

step 2 gamble your house away

echo basalt
#

Only today did I decide to learn how hashmaps work

lament tree
echo basalt
#

you have an amount of "buckets"

#

Each bucket acts as a linkedlist in a way

lament tree
#

linkedlist

#

im scared

echo basalt
#
public class Node<K, V> implements Map.Entry<K, V> {

  private final int hash;
  private final K key;
  private V value;
  private Node<K, V> next;

}
#

type deal

#

Once the map has achieved a certain "load factor" it changes from a linked approach to a tree approach

#

The amount of buckets doubles

#

And all the nodes are recomputed

lament tree
#

interesting

#

key values

echo basalt
#

To get the "bucket index" AKA what bucket an object goes to

#

It just grabs the hashcode and does a % operation

heady apex
#

Hi guys, does anyone know why I am unable to reference certain new things like the cherry blossom biome? I am using IntelliJ and I just added spigot-1.20.4.jar to my libraries as an upgrade from 1.20.1 in an attempt to fix it, but that didn't seem to work (neither did invalidating caches)

distant wave
#

what does this mean?

#

this is how i init it

echo basalt
#

show me your entitychecker class

distant wave
heady apex
#

πŸ₯²

vocal cloud
#

mein got

sterile flicker
#
    public void onCreatureSpawn(SpawnEntityEvent event) {```could it be that the player will also enter this event
vocal cloud
#

Oh no is that 1.8

#

Anyways yes it should fire for players. You'd want CreatureSpawnEvent otherwise

heady apex
# distant wave

It's telling u to use .runTaskTimer(plugin this, long delay, long period) at the end, I don't see where you're doing that

sterile flicker
#

I want to disallow all mobs except sheep in my minigame world

#
    public void onCreatureSpawn(SpawnEntityEvent event) {
        if (!isAllowedAnimal(Objects.requireNonNull(event.getEntity()).getType()) && event.getWorld().equals(Map.party) && !(event.getEntity() instanceof Player)) {
            event.setCancelled(true);
        }
    }```
#
        return Objects.requireNonNull(entityType) == EntityType.SHEEP;
    }```
#

this is the right way to do it?

heady apex
# distant wave here

Hmm maybe that works, I've always done .runTaskTimer on the implementation of the runnable like new BukkitRunnable(){ // code }.runTaskTimer(....);

distant wave
#

well isnt that what im doing? on there?

heady apex
#

Do you have other runnables like this that work?

distant wave
#

i dont use any other runnables

sterile flicker
heady apex
#

Yeah it looks like it should work but you never know lol

distant wave
#

it works now for some reason

vocal cloud
sterile flicker
sterile flicker
#

thanks

heady apex
sterile flicker
vocal cloud
#

Objects.requiresnonnull sad you have no idea what that actually does do you

heady apex
#

Haha it's the autocomplete

sterile flicker
#

well, the ide recommends it to me

vocal cloud
#

Yes, it's super dangerous and it's a noob trap

sterile flicker
#

I literally saw the NPE stack trace associated with Objects.requireNonNull right now

#

...

heady apex
#

@sterile flicker if it's a spawn entity event your entity is not going to be null

sterile flicker
#

yes

vocal cloud
#

I'd read what the code actually does KEKW

heady apex
#

Do a if(event.getEntity() instanceof EntityType.SHEEP)

#

idk how to write code in discord lol

sterile flicker
#

EntityType.SHEEP

#

is not possible

vocal cloud
#

Wouldn't you do event.getEntity() instanceof Sheep?

#

since sheep is an entity class?

sterile flicker
#

(event.getEntity() instanceof Sheep)

#

work

vocal cloud
#

There you go

sterile flicker
#

How could I go down such an irrational path

#

thanks

vocal cloud
#

You're using 1.8 that's irrational enough KEKW

sterile flicker
#

well, I only made 4 plugins for 1.16 and 1.20

echo basalt
#

that sounds like an excuse

sterile flicker
#

I just joined the 1.8 server project

undone axleBOT
quaint mantle
#

8 years

vocal cloud
#

I'm still a believe in the idea that 99.9% of new 1.8 servers fail.

quaint mantle
#

and the 0.1% is hypixel

vocal cloud
#

If you use 1.20 or a newer version you gain access to new features that can create content that can actually compete with Hypixel

sterile flicker
#
    public void onCreatureSpawn(CreatureSpawnEvent event) {
        if (!(event.getEntity() instanceof Sheep) && event.getEntity().getWorld() == Map.party) {
           
            event.setCancelled(true);
        }
    }``` not working should i add  event.getEntity().remove();?
echo basalt
#

yikes world hard reference

sterile flicker
#

.equals()?

#
    public void onCreatureSpawn(CreatureSpawnEvent event) {
        if (!(event.getEntity() instanceof Sheep) && event.getEntity().getWorld().equals(Map.party)) {
            event.getEntity().remove();
            event.setCancelled(true);
        }
    }```
#

mobs continue to spawn

meager wolf
agile hollow
#

how can i place blocks in air

#

like on the placing of the block i can place It looking in the air too

sterile flicker
#
    static BukkitTask countdown;
public static void startCountdown(int seconds, long delayBetweenCounts, int minigame_id) {
        count2 = seconds;
        final BukkitTask task2 = Bukkit.getScheduler().runTaskTimer(SumeruParty.plugin, () -> {
            if (count2 > 0) {
                count2--;
            }
            if (count2 == 0) {
                    // Countdown has reached 0, cancel the task
                    Bukkit.broadcastMessage(ChatColor.DARK_RED+"[SumeruParty] Game ended.");
                    if (minigame_id == 1) {
                        SheepFreenzy.finish();
                    }
                    countdown.cancel();
            }
        }, 0L, delayBetweenCounts);
        countdown = task2;
}```  
                        Why when I call startCountdown(60, 20, 1); The inscription game ended is repeated several times
#

Is there a better way to cancel this?

#

I completely forgot about bukkitrunnable

proud badge
#

Does talking in chat abide by minecraft's tick system?

echo basalt
#

uH not necessarily

#

It's async I'd assume not

distant wave
#

can someone tell me what the double args in getNearbyEntities say? i dont really understand the docs

old sphinx
#

anyone got an example of a scoreboard/

#
public class MainScoreboard {

    public MainScoreboard(Player player) {
        Scoreboard scoreboard = Bukkit.getScoreboardManager().getNewScoreboard();
        Objective objective = scoreboard.registerNewObjective("scoreboard", Criteria.DUMMY, "scoreboard");
        PersistentDataContainer pdc = player.getPersistentDataContainer();
        String area = pdc.get(new NamespacedKey(Nebula.getInstance(), "area"), PersistentDataType.STRING);
        objective.setDisplayName("   Custom Scoreboard");
        objective.setDisplaySlot(DisplaySlot.SIDEBAR);

        Score first = objective.getScore("   " + area);
        Score second = objective.getScore("   Second Line");
        Score third = objective.getScore("   Third Line");

        first.setScore(2);
        second.setScore(1);
        third.setScore(0);
        player.setScoreboard(scoreboard);

    }

}```

i have a scoreboard here, how do i make it keep updating, this only gets rendered in when the player joins, whats the best way to make sure its always updated
dry hazel
echo basalt
#

.

#

@old sphinx

#

You can then have a Map<UUID, SimpleBoard> scoreboards

#

and tick those

distant wave
#

one more thing, is there any reason why .getLocation().distance(entity.getLocation()) <= 1 wouldnt work? i want to check if entity is max 1 block from the location

dry hazel
#

tried flooring/rounding the distance beforehand?

#

since, what if it's 1.1 or something like that

old sphinx
# echo basalt .

now im not the brightest and this is some complex code, but wouldnt a runnable in the scoreboard class work fine or will that cause some sort of issue

echo basalt
#

It wouldn't be right

old sphinx
#

how so?

echo basalt
#

Single-responsibility principle

#

The simpleboard class isn't meant to be a task

distant wave
echo basalt
#

You could make it work

dry hazel
distant wave
#

good idea

echo basalt
#

I'd grab the player's boundingbox and do checks with it

dry hazel
#

that's a better idea

distant wave
echo basalt
#

get the bounding box, add it by the player's location and loop through minX to maxX

#

and just floor the vals

sterile flicker
#
        for (String pl : SumeruParty.players) {
            Player p = Bukkit.getPlayerExact(pl);

            String kills = "Β§bKillsΒ§8: Β§7" + p.getStatistic(Statistic.PLAYER_KILLS);
            String deaths = "Β§bDeathsΒ§8: Β§7" + p.getStatistic(Statistic.DEATHS);
            String spacer = "Β§7Β§m-------------------";
            Objective objective = p.getScoreboard().getObjective("Party");
            objective.getScore(spacer).setScore(15);
            objective.getScore(kills).setScore(14);
            objective.getScore(deaths).setScore(13);
            objective.getScore(spacer).setScore(12);

            int balance = Vault.getPlayerBalance(p.getName());
            Score money = objective.getScore(ChatColor.GOLD + "Money: "+balance+"$");
            money.setScore(7);
            objective.setDisplayName("[" + (SumeruParty.current_minigame) + "/" + 12 + "] [" + Minigame.count2 + "]");
        }
    }``` please hep. When a player dies, the deaths field will split in his scoreboard instead of updating it.
#

can i use Scoreboard board = p.getScoreboard(); board.resetScores(p); before setScores

storm jungle
#

@vagrant stratus@austere cove@tender forge@smoky yoke

#

i want my resources to be immediatly deleted

austere cove
#

so report it on the forums, be patient, and don't tag random staff for no reason

storm jungle
#

i reported it pls delete them asap

tender forge
storm jungle
#

just need the resources to be deleted now thats why

#

and my other resource reported it too if u can delete it too πŸ˜„

storm jungle
#

how can i add premium resource?

rotund ravine
#

?premium

undone axleBOT
storm jungle
#

3 free resource LoL

rotund ravine
#

Doesn’t have to be anything big

kindred trellis
#

how can i set argument 0 of my command to string so i can do smthn like this: /command "string"

storm jungle
#

try 1

native ruin
#

arguments are already strings or are you asking something else?

kindred trellis
#

i wanted spaces in my argument but i figured it out with for loop and string builder

native ruin
#

nice

warm mica
vast raven
#

Why is the clickedblock I get in the PlayerInteractEvent always air?

#

when clicking trapdoors

#

v1.17.1

storm jungle
#

idk

vast raven
#

actually it considers the block as Openable

#

I printed the class name of the object and it seems fine

#

but the material it's air ever

tender shard
vast raven
#

1.17

tender shard
#

then idk

vast raven
#

:sad:

rotund ravine
#

What happens if u rigtclick them like on ghe ridge

#

So it opens but ur still looking at it

vast raven
#

actually I've even tried using the target block

#

actually same result

storm jungle
#

@vast ravenwatch dm

storm jungle
#

@austere covecan u also delete my other resource pls πŸ˜„

lost matrix
#

For me its

quaint mantle
#

Benchmark comparision

#

Functionality

#

Error testing

remote swallow
#

His will be faster, its already faster than actual minimessage

storm jungle
#

@austere covepls broo

slate tinsel
#

Hello! If I want to create a temporary BoundingBox to be used to check if a player can fit at a certain position, how do I do that? Should I clone the player's BoundingBox and try to move its position

distant wave
#

does the teleport method teleports in some randomness? player.teleport(basket.add(0, -2, 0)); just teleports the player like ~1 block away from the actual area

eternal night
#

it should not no

distant wave
#

that is weird hm

distant wave
ivory sleet
distant wave
#

also what would be a good approach to check if certain entity(not player) left an area?

distant wave
ivory sleet
#

Oh nvm

#

If its an entity

#

Then presumably you might have to run a bukkit task every tick

distant wave
#

well yeah but then i have to check for differences in a list full of entities inside the areas etc. is there really not a better approach

ivory sleet
#

Well I think thats the easiest one

sterile flicker
#

how to create a tnt explosion, not an ordinary explosion, namely tnt, so that worlguard allows the explosion to damage blocks with the tnt and other_explosion flag enabled

tropic saddle
distant wave
young knoll
sterile flicker
#

i have another problem

#
       public static void generate() {
           party = Bukkit.getWorld("party");
           if (party == null) {
               SumeruParty.plugin.getLogger().warning("ΠœΠΈΡ€ 'party' Π½Π΅ Π½Π°ΠΉΠ΄Π΅Π½. Π‘ΠΎΠ·Π΄Π°Π΅ΠΌ Π½ΠΎΠ²Ρ‹ΠΉ.");
               party = Bukkit.createWorld(new WorldCreator("party"));
           }

           party.setAutoSave(false);

       }
       public static void unload() {
           Bukkit.unloadWorld(party, true);
           Bukkit.getServer().reload();
       }```
#

and Map.unload(); Map.generate();

#

I want the world not to be preserved.

#

Well, it's a mini-game world, and I need to regen it.

quaint mantle
#

just recreate the world

sterile flicker
#

maybe Bukkit.unloadWorld(party, true); with save argument to false

#

?

dry hazel
#

just remove the world directory

quaint mantle
#

and make like a template_world directory

#

which you duplicate and load

sterile flicker
#

can't i make this one with the code I showed you?

dry hazel
#

unloading the world is not removing it from the filesystem

sterile flicker
#

I can create a copy of the world, but how do I load it to my main minigame world

quaint mantle
#

and delete the old one

sterile flicker
#

so i need

#

FileUtils.deleteDirectory

#

?

#

Apache Commons IO's

dry hazel
#

or any other method for deleting a directory recursively yes

quaint mantle
#

but before deleting make sure that you are unloading the world

sterile flicker
#

and there is a built-in

#

deleteDirectory

#

method

quaint mantle
#

getWorldFolder().delete()

#

no need for utils

sterile flicker
#

Bukkit#?

quaint mantle
#

no

#

World.getWorldFolder().delete()

sterile flicker
#

thanks

quaint mantle
#

so you should probably do

#
Bukkit.unloadWorld(world, false);
world.getWorldFolder().delete();
#

and that would delete the world

dry hazel
#

no, that won't work

quaint mantle
dry hazel
#

the directory needs to be empty for File#delete to work

#

so they should use the mentioned commons-io method

quaint mantle
#

alr

sterile flicker
#
            Bukkit.unloadWorld(party, false);

           FileUtils.deleteDirectory(new File(party.getWorldFolder().getAbsolutePath()));

            Bukkit.getServer().reload();
       }```
#

?

young knoll
#

Ohno please don't reload the server

quaint mantle
#

πŸ’€

#

you are turning a file into a file

quaint mantle
#

also reloading the server is like using the reload command. Not recommended

vivid thunder
#

Any idea why this does not work since 1.20.2? Skulls are only rendered if the player is currently online. Players list contains UUID's of different players, can be online/offline.

quaint mantle
#

@young knoll sorry for pinging but shouldnt it be called "calling this function" and not "calling this plugin"?

young knoll
#

probobaly :p

eternal night
#

gasps a javadoc mistake ?!

river oracle
quaint mantle
#

I really like calling plugins tho

#

new Plugin()

vivid thunder
paper rain
#

Hello, im tryna code plugin which detects when someone joins worldguardregion.(PlayerMoveEvent) But it sends same 3 messages, instand of 1..
May someone help me?

quaint mantle
#

?paste

undone axleBOT
quaint mantle
#

show code

paper rain
#

done

#

It just sends 3 messages

quaint mantle
#

save the uuid as string

paper rain
#

wdym?

quaint mantle
#

playerInRegion

#

change it from UUID to String

paper rain
#

Okay

#

but why?

#

now it sends 2 messages xD

quaint mantle
#

I use it exclusively for my Capture the flag minigame in my Games plugin.

paper rain
#

where can i find the api?

quaint mantle
#

Find which one works for you

paper rain
#

Okay

quaint mantle
# paper rain Okay

Their is documentation all their for you, just pay attention and youll be okay. If i figured it out trust me you can figure it out haha

paper rain
#

I found only the 1.9 version

#

i cant see 1.19 anywhere

#

:/

paper rain
proud badge
#
    public void onAsyncPlayerPreLogin(AsyncPlayerPreLoginEvent event) {
        OfflinePlayer player = Bukkit.getOfflinePlayer(event.getName());
        if(player.isBanned()) {
            BanList banList = Bukkit.getBanList(BanList.Type.PROFILE);
            BanEntry banEntry = banList.getBanEntry(event.getName());
            String banReason = banEntry.getReason();
            String message = "Β§cYou are permanently banned from this server for: \n"+banReason;
            event.disallow(AsyncPlayerPreLoginEvent.Result.KICK_BANNED, message);
        }
    }```
any1 know why it still shows the vanilla ban message?
#

nvm i forgor to register event

distant wave
#

tf im supposed to spawn there under one of the cobwebs, but now im just spawning completely randomly on y ~15

#

its caused by the .teleport method

#

but im just doiung player.teleport(basket.add(0.5, -2, 0.5));

glass mauve
#

are there common ways/setup of using database in plugins?
is it recommended to use jooq? best practices?

sterile flicker
sterile flicker
# quaint mantle no

And then what? i have ```public static World party;
public static void generate() {
party = Bukkit.getWorld("party");
if (party == null) {
SumeruParty.plugin.getLogger().warning("ΠœΠΈΡ€ 'party' Π½Π΅ Π½Π°ΠΉΠ΄Π΅Π½. Π‘ΠΎΠ·Π΄Π°Π΅ΠΌ Π½ΠΎΠ²Ρ‹ΠΉ.");
party = Bukkit.createWorld(new WorldCreator("party"));
}

       party.setAutoSave(false);

   }
   public static void unload() throws IOException {
        Bukkit.unloadWorld(party, false);

       FileUtils.deleteDirectory(party.getWorldFolder());
   }```
quaint mantle
#

do you have the world as a template?

sterile flicker
quaint mantle
#

Can you duplicate the world directory and call it "party-template"

sterile flicker
#

okey

quaint mantle
#

hold on

sterile flicker
#

what should I do when I want to load the world into OnEnable, for example, and when the server stops and the game is started in OnDisable unload the world

grim hound
#

can I use my own ChannelPromise to recognize my own packets at the channel handler?

quaint mantle
#

Otherwise not

#

You could try a hacky method, by splitting your packet in blocks, and send it as a CustomPayload packet

grim hound
quaint mantle
grim hound
#

but at the intercepting of the outgoing packets

#

it'd be the easiest option

quaint mantle
#

Wdym with mojang packet? Do you mean a minecraft one?

grim hound
#

mojang packet is more commonly used

quaint mantle
#

Anyway, as long as the packet is supported by the client, yes, you should be able to

#

I wouldn't recommend messing that much with packets btw, I had bad experience by doing it so

quaint mantle
#

Can help you with any trouble, im decent with packet listeners

#

Use Packet-Events & ProtocolLIB

quaint mantle
#

Not dangerous, but might end up with unexpected things to happen

quaint mantle
quaint mantle
#

I mean

#

org.bukkit.craftbukkit

dry hazel
#

lol

ivory sleet
quaint mantle
#

And spigot latetly has been implementing API to do almost everything you would need to

#

If we still were on 1.8 things might be different

#

Im on 1.7 HAHAH@

#

Sue me

ivory sleet
#

yeah, but 1.7 spigot software is not rly supported

quaint mantle
#

Ik but i know it very well

ivory sleet
#

i mean if u have ur own fork and so on… great for u :)

quaint mantle
#

1.7 don't have titles nor actionbars πŸ—Ώ

ivory sleet
quaint mantle
quaint mantle
quaint mantle
quaint mantle
quaint mantle
quaint mantle
#

Do whatever you want with it

#

I wouldn't recommend doing it anyway

#

As said before, 1.7 not longer supported

river oracle
#

@quaint mantle I tried making jmh for your components but it wasn't even running xD I got json malformed errors

quaint mantle
#

It doesn't use minecraft json format

quaint mantle
#

It uses a custom one

#

It doesnt feel right

river oracle
quaint mantle
#

The actionbars(legacy) would be better with item name

river oracle
#

how does that even work

quaint mantle
#

And titles can be hologram

quaint mantle
#

Yeah, I didn't think it very well

#

Anyway, @river oracle
I did some benchmarks and...

#

Not what I expected

rotund ravine
#

Did u suck?

quaint mantle
#

Mine were taking 0.009 ms

#

almost

#

Anyway, I don't really know how should I benchmark?

#

I still think that, for a parser, is too much time

river oracle
quaint mantle
#

Aight, I'll do it

river oracle
viral temple
#
            GameTestHarnessTestCommand.register(this.dispatcher);
            ResetChunksCommand.register(this.dispatcher);
            RaidCommand.register(this.dispatcher);
            DebugPathCommand.register(this.dispatcher);
            DebugMobSpawningCommand.register(this.dispatcher);
            WardenSpawnTrackerCommand.register(this.dispatcher);
            SpawnArmorTrimsCommand.register(this.dispatcher);
            ServerPackCommand.register(this.dispatcher);
            if (commanddispatcher_servertype.includeDedicated) {
                DebugConfigCommand.register(this.dispatcher);
            }
        }```
#

this is interesting

#

i never knew minecraft have such hidden commands

shadow night
#

hmm

#

is that mcp or something

viral temple
#

no

#

that's decompiled minecraft

quaint mantle
shadow night
viral temple
ivory sleet
#

Think these modding envs take advantage of it

river oracle
viral temple
shadow night
ivory sleet
#

I mean regardless of mappings, its still quite nice

viral temple
#

it's a public thing...

#

oh, wait, commands are registered before any plugin

shadow night
#

yes

viral temple
#

those commands at least xD

#

sad, we can't enable them using plugins

shadow night
#

why don't you just copy the minecraft code into your plugin or something

river oracle
#

don't even need to if the classes are public

#

you can register commands at runtime

#

and then update the player's command list

#

you just need some NMS and reflection

shadow night
#

sounds easy

river oracle
#

hell with reflection they don't even need to be public I suppose

#

they just need to exist

viral temple
shadow night
#

the command dispatcher is annoying to me

viral temple
#

funny thing is... they are stuck to the client

#

yet, the server have them too.

#

at least the "translatable component"

#

I see why bukkit doesn't have an API for those yet

river oracle
#

we

#

uhm

#

we do kinda

remote swallow
#

we blame choco

river oracle
#

Player#spigot

remote swallow
#

Player#components when

river oracle
#

allows you tos end components

#

ℒ️

grim hound
#

Why

viral temple
grim hound
#

are many items packets sent to the client

grim hound
river oracle
viral temple
river oracle
#

you can't send custom "translations" you have to rely on the vanilla ones

viral temple
#

oh

#

yes, read too fast

river oracle
#

e.g. if I send "container.beacon" in a translation component

#

it'll translate, but not "container.custom"

viral temple
#

you can't even send simple components

river oracle
#

yes you can

remote swallow
#

what

#

yes you can

river oracle
#

what era are you in

#

Player#spigot

viral temple
#

not that way...

remote swallow
#

Player#spigot.sendMessage(new TextComponent())

river oracle
#

granted we don't have all the bases covered yet :P

#

new API is in progress

viral temple
#

i mean a custom error message with custom argument types

river oracle
#

idk what you're talking about

viral temple
#

or you can't change existing error messages on existing argument types.

river oracle
#

what are these argument types

#

are we talking about Brig?

viral temple
#

IntegerArgumentType for example

#

it have INTEGER_TOO_LOW and INTEGER_TOO_HIGH errors

river oracle
#

well Brig doesn't have Bukkit API yet sure, but you can still kinda use it with Commodore

viral temple
#

hmm

trim elk
#

guys, is it better to make a plugin using kotlin or java?

viral temple
#

let me try something. If it works, I'm e genius

river oracle
viral temple
river oracle
#

if you don't know either language use java it'll allow you to get more support

trim elk
#

I like kotlin, but they say it has incompatibility problems with other plugins

river oracle
#

you should be fine as long as you use kotlin's stdlib

#

and whatever other things you need to make that weird ass language work

#

could be wrong, but pretty sure NMS is horrid with kotlin too afaik so if that's something you need you'll need to write your compatability layer in java than do whatever magic kotlin needs

trim elk
#

kkkk, so I can code using kotlin without worrying about the other plugins? because some people were saying that if you have different versions of kotlin on a server it might not work

river oracle
#

no clue πŸ€·β€β™‚οΈ

#

kotlang is weird

viral temple
trim elk
#

it's great to use it on android

trim elk
#

i'll use java then, safer

viral temple
#

take that @covert valve

#

java is safer.

covert valve
viral temple
#

i hate you :))

ivory sleet
trim elk
#

yes

rotund ravine
#

Java if u want to

#

Kotlin requires the stdlib

#

So even though kotlin makes everything easier

#

People still choose java

viral temple
trim elk
#

then it's best to opt for what's safest

covert valve
trim elk
#

kotlin is much easier

covert valve
#

and what do you even mean by safe?

rotund ravine
#

Indeed

river oracle
#

Null Safety πŸ€“

rotund ravine
#

Kotlin got le sugar babiesss

covert valve
#

kotlin supremacy

river oracle
#

don't worry guys I use Java Optional it makes everything better

viral temple
sterile flicker
viral temple
covert valve
river oracle
#

that is from his younger ignorant days

covert valve
#

its about 50% java 50% kotlin

grim hound
#

Does anyone know what packet I could wait for to receive from the client to ensure that the entity potion effect packet can be sent and applied?

trim elk
#

safe I mean, to run my plugin with others without worrying about incompatibility, as I said before, some people told me that 2 kotlin plugins on 1 server may not work if their version is different

viral temple
#

Then that's no kotlin supremacy

covert valve
covert valve
#

it's got 25000 lines of java and 20000 lines of kotlin

grim hound
covert valve
#

but all my other plugins are in kotlin

river oracle
#

how big is kotlin standard lib xD

covert valve
#

libreforge for example is 100% kotlin

covert valve
viral temple
covert valve
viral temple
river oracle
quaint mantle
#

Ok @river oracle I'm running the benchmarks (had to convert your code to java 1.8 πŸ—Ώ)

viral temple
#

Look at those utility classes written in java

rotund ravine
covert valve
quaint mantle
river oracle
quaint mantle
#

Anyway, yours will probably be faster than mine

river oracle
#

jmh takes so long xD poor soul

sterile flicker
trim elk
#

if you're saying it won't make any difference, then I'll do it in kotlin, that's it

quaint mantle
#

guess what you can do to fix it

sterile flicker
viral temple
#

Tbh kotlin std should be included in spigot just for the sake of those that write plugins in kotlin, and use different versions of the std

quaint mantle
#

read the error msg

sterile flicker
tender shard
#

why not just use new File(Bukkit.getWorldContainer(), "party-template")

ivory sleet
# trim elk yes

Ime I feel like shading the std lib is a bit annoying, else both are nice :)

quaint mantle
#

But still

#

guess why it doesnt work oml

#

Because "party-template" doesnt exist!

sterile flicker
#

its strange

quaint mantle
#

are you kidding me

#

i just told you

#

It doesnt exist

quaint mantle
sterile flicker
peak depot
#

how can I make it so on my bungeenetwork it doesnt need to always reload the texture pack on every server switch if its the same texturepack?

sterile flicker
#

I have /root/ on my hosting instead of /home and the hosting name instead of /container