#help-development

1 messages · Page 307 of 1

crude loom
#

yes you can

round finch
#

i saw something about Handlers

remote swallow
#

point 3 explains about custom event stuff

tardy delta
#

that class gotta have a handlerlist field

round finch
#

what heck you can do Object::new

#

🤨

#

map

remote swallow
#

anyone know how i can convert the Generation ordinate back to Generation in bookmeta

round finch
#

syntax surprise

tardy delta
#
private static final Object LOCK = new Object();```
#

i didnt know you could create a raw object till a few moths ago either

#

as it has no state and wouldnt make much sense instead of using smth like Boolean.TRUE

round finch
#

what can you do with a raw object?

tardy delta
#

you can use it as a lock or smth

#

or dummy object

#

for the rest nothing special

round finch
#

an object with nothing in it lel

tardy delta
#
synchronized (LOCK) {}```
#

a hashset used an Object internally to associate it with keys

#

all keys are mapped to the same value

#

even in all hashset instances i believe

wet breach
glossy venture
#

only if its null

tardy delta
#

he proobably means Object o = new Something()

glossy venture
#

but why wouldnt you be able to construct a raw object

#

true

tardy delta
#

cuz it holds no meaningful state

#

not really a reason but whatever

glossy venture
#

except being an object

tardy delta
#

you are an object too

glossy venture
#

everyon eis an object

#

everything

tardy delta
#

i will garbage collect you

glossy venture
#

certified bruh moment

#

get unloaded

round finch
#

devs be processing roast modes

#

then your existence is a null state

#

hehe

tardy delta
#

/dev/null

#

lets actually call data word

round finch
#

what is the method for paying tax? nomie moment

#

tax.pay

tardy delta
#

time to implement new code and see if it breaks

hasty prawn
#

looks broken to me

tardy delta
#

seems to happen when i insert the max function lol

#

wtf have i done

#

thats a nice toString

abstract spindle
#

Hey Guys,
is there a way to get the remaining delay of a BukkitTask until it will be executed, which was scheduled with Bukkit.getScheduler().runTaskLater(myPlugin, myTask, 2400L); ?

tardy delta
#

store how many ticks have passed or smth

wet breach
#

just that the scheduler will try to execute it after that time period

sterile token
#

Object lock = new Object();

Synchronized(lock) {
}

#

I never could understand how doest work or what does

abstract spindle
wet breach
tardy delta
#

to avoid race conditions and stuff

wet breach
#

then you can use the task id to see if it has been executed or not, and since its in a map you can check how much longer it has left

sterile token
tardy delta
#

wha

#

you know what a thread is?

abstract spindle
sterile token
hazy parrot
#

Only one thread at the time can read/write inside of lock

sterile token
#

Okay i really get mess about that tho

.

#

Because from what i know on every read/write thread Is temporally paused until it's finishes. At leas thats how I/O operwtion works

hazy parrot
#

That is why multiple threads exist

sterile token
#

Because idk why i think threads related to processor ones

#

It's really common that mistake that why i ask the context

hazy parrot
sterile token
#

Let me ask the next if i have 2 one with 2 threads and another with 4, both having Java. The first JVM will support executimg More pocesses or not?

tardy delta
#

depends on how thread are mapped

sterile token
#

Defintly i think i Will fully understand Sync and async theory once i Start university. Cuz we have OS arquitectura

tardy delta
#

university lol

sterile token
#

?

tardy delta
#

why would you need university to learn that

sterile token
#

I'm not university tho, i have 16y

tardy delta
#

learnt it on my own

sterile token
#

Because there you have a subject wherethey fully explain you the "arquitectura de ordenadores" and there you learn about Sync and async I/O operaritions

hasty prawn
tardy delta
#

id just look at indian java tutorials

sterile token
#

Well my country used to export 70% of software to US

tardy delta
#

just read a book

sterile token
#

I know but I'm weird to learn

#

Because i can read something 100 times but i dont understand it

tardy delta
sterile token
#

I know because i tried many times to learn how async works on java and neve understand it

hasty prawn
#

I mean what do you not understand about it

river oracle
#

Async just makes stuff not stop main thread in simplest wording

sterile token
#

I just understand that:

Sync is running múltiple process in same thread, so on each I/O operation Is blocked until finish

Async Is the oposite from what i have said

hasty prawn
#

Yeah basically, what more do you need to know than that? KEKW

sterile token
#

I dont understand the fkg way of Java

tardy delta
#

huh?

river oracle
#

Just use complable futures?

#

Problem solved

tardy delta
#

im trying to find the book i read but all covers are different

hazy parrot
#

There are few apis in java for async programming

hasty prawn
#

CompletableFutures are a godsend once you figure out what their terribly documented methods do

sterile token
#

Because you have threads, runnables, executors and completable futures, tasks

hazy parrot
#

Most used ones are completable future and executors

#

Runnable is just funct interface

river oracle
hazy parrot
#

And never use pure Thread

hasty prawn
sterile token
#

Shity Java have many ways of Async which C# doesnt clntain for example

tardy delta
#

doesnt C# have the async keyword?

hasty prawn
#

Yikes, you're being mean to Java. That will not end well for you. It will not be nice back.

tardy delta
#

or dotnet in general

#

i read this book but cant find the english version lol

#

it tells alot of concurrency, atomicity, locks etc

sterile token
#

How does completable future works internally? Because i know it's take a generic param which is the object that Will return. But them for getting it you habe ti call CompletableFuture#get() which caused thread being blocked

hasty prawn
#

No, thats when you start using thenAccept()

tardy delta
#

dont

#

it uses a threadpool

#

whatever you do, dont look into the code

sterile token
#

So do you recommend me to read about OS arquitecture and then give a try to Java Async

hazy parrot
#

You don't really need to read os arch to understand concept of async actions

tardy delta
#

just concurrency in general

sterile token
#

Concurren y right

#

Async and Concurrenci

hazy parrot
#

Coroutines my beloved

tardy delta
#

what are that

sterile token
tardy delta
#

arent those kotlin lambdas or smth?

hazy parrot
#

Thingy present in unity and kotlin

#

Best thing ever

sterile token
#

Please don't mix kt and Java, totallt diff impls

hasty prawn
#

Kotlin DansChamp

tardy delta
#

syntax 🤡

rotund ravine
#

Coroutines are not stricly kotlin

tropic ingot
#

How can i Fix?

vale ember
#

key is char

tropic ingot
#

I mean this

hazy parrot
#

You can basically for example

scope.launch {
delay(20000)
Sout("hello")
}

And that code will execute after 20 seconds without blocking anything

sterile token
tardy delta
#

by looking at the docs

hazy parrot
#

And it's super lightweight

tardy delta
#

ok just a fancy async wrapper

rotund ravine
tropic ingot
#

As I said I'm an idiot, I forgot the ")" after the key, sorry

#

Now it work

rotund ravine
# tardy delta ok just a fancy async wrapper

Coroutines are computer program components that allow execution to be suspended and resumed, generalizing subroutines for cooperative multitasking. Coroutines are well-suited for implementing familiar program components such as cooperative tasks, exceptions, event loops, iterators, infinite lists and pipes.
They have been described as "functions...

#

Kotlin just have an implementation of it, wouldn’t surprise me if java also has one in the future

sterile token
#

So for understanding Async i Will need to start reading Completable future, executors and concurrency right? Smth else i miss

tardy delta
#

im not waiting im just wondering what advantages it will bring

rotund ravine
sterile token
#

Ok i Will do that first, concurrency oriented to Java Right ?

rotund ravine
#

They’re lowcost for one

rotund ravine
tardy delta
#

advantages that like really have impact

rotund ravine
#

It is a high impact you can have literal millions of co routines running

#

Threads not so much

tardy delta
#

im wondering how they are implementating those virtual threads

#

a different thread to os thread mapping maybe?

rotund ravine
#

Google it

tardy delta
#

yes mr google

humble tulip
#

method a(String) or b(String)?

tardy delta
#

what happened with wikipedia

remote swallow
tardy delta
humble tulip
#

ahh yes

#

ty

remote swallow
#

or use moj maps and special source

humble tulip
#

?screamingsandals

remote swallow
humble tulip
#

i was gonna use reflection

#

so i needed the real anme

#

ty

tardy delta
#

ah platform threads an os threads are mapped 1:1

#

who came even up with the name screaming sandals 💀

#

😱 👡

hasty prawn
#

Those 3 did

remote swallow
#

yeah

tardy delta
#

💀

#

id call it project harambe

paper falcon
#

guys can I add ench to an item that's not capped to 255

#

#addUnsafeEnchantment(Enchantment.SHARPNESS, 5000);

remote swallow
#

since 1.17.1 or something like that no

paper falcon
#

zero workarounds?

remote swallow
#

you could probably do attribute stuff

#

but that would require loads of math to get the right damage modifier

paper falcon
#

maths? oh hell no

#

yeah thanks anyway lol

warm light
#

is this the correct way to send data to bungee?

torn basalt
#

@tender shard i used your code its shows Player: sheduxdev Joined IP: 193.35.154.47:2556525565

#
    @EventHandler
    public void onJoin(PlayerLoginEvent event) {
        String hostnameUsed;
        String[] splitByColon = event.getHostname().split(":");
        hostnameUsed = event.getHostname().split(NULL_CHAR_STRING)[0] + splitByColon[splitByColon.length - 1];
        System.out.println("Player: "+event.getPlayer().getName()+" Joined IP: "+hostnameUsed);
        if(getConfig().getString("host").equalsIgnoreCase(hostnameUsed)) {
            if(event.getPlayer().isOp()) {
                getLogger().warning("Player: "+event.getPlayer()+ " Joined IP: "+event.getHostname()+" Is Op: true");
                List<String> lines = getConfig().getStringList("kick-message-op.");
                for (String linestring : lines) {
                    event.getPlayer().kickPlayer(ChatColor.translateAlternateColorCodes('&', linestring));
                }
            }
        }
        if(!getConfig().getString("host").equalsIgnoreCase(hostnameUsed)) {
            System.out.println("Player: "+event.getPlayer().getName()+" Joined IP: "+hostnameUsed+ " Joined with numerical ip");
            List<String> lines = getConfig().getStringList("kick-message-host.");
            for (String linestring : lines) {
                getLogger().warning("Player: "+event.getPlayer()+ " Joined IP: "+event.getHostname()+ " Not joined with "+getConfig().getString("host"));
                event.getPlayer().kickPlayer(ChatColor.translateAlternateColorCodes('&', linestring));
            }
        }
    }
#

how i can delete after :

#

i trying delete after :

tropic ingot
#

Why doesn't the Lore appear?

torn basalt
#

but its shows 25565 or 255652565

#

okay sorry

#

to where

#

to wheree

#
  String hostnameUsed;
        String[] splitByColon = event.getHostname().split(":");
        hostnameUsed = event.getHostname().split(NULL_CHAR_STRING)[0] + splitByColon[splitByColon.length - 1];
#

event.getHostname().split(NULL_CHAR_STRING)[0]

tardy delta
#

ah me being an idiot and trying to insert max twice

#

what

misty current
#
    public RepeatingTask(JavaPlugin plugin, BiFunction<RepeatingTask, Integer, Boolean> task, long delay, long period) {
        super(plugin, null, delay);
        this.period = period;
        
        this.task = new RepeatingTaskFunction() {
            @Override
            public boolean tick(RepeatingTask task, int iteration) {
                return task.apply(task, iteration);
            }
        };
    }

how can I make task.apply() inside the tick method refer to the argument of the constructor?

tardy delta
#

wrapper classes go brr

misty current
#

I did that, but I was wondering if there was another way

tardy delta
#

id make a class implementing runnable

#

its cleaner

#

ah wait i see what youre doing

misty current
#

RepeatingTaskFunction has other methods you can override inside it

#

but yes i guess i could override biFunction now that I think about it

tardy delta
#

abstract class

torn basalt
#

Hello how i can do this

tardy delta
#

?

torn basalt
#
kick-message-host:
  - "&e&l● &6&lIUMGUARD &e&l●"
  - ""
  - "&aLütfen sayısal ip ile girmek yerine &eplay.demirium.com &aadresi ile gir."
  - ""
  - "&6Support: &edeniz@foudrestudios.com"
List<String> lines = getConfig().getStringList("kick-message-host.");
event.getPlayer().kickPlayer(ChatColor.translateAlternateColorCodes('&', lines.toString()));
#

its not kicking player

tardy delta
#

what event?

torn basalt
warm light
#

if I want to catch data from a channel, do it need a bungeecord plugin or can do it from spigot plugin?

tardy delta
#

ArrayList#toString wont give you what you expect

#

it will give you smth like ["line 1", "line2", "line3"]

torn basalt
#

so how i can do that

paper falcon
#

ok guys this seems like a silly question I never thought of this, anyway

public class Main {
  @Override
  public void onEnable() {
    getCommand("stick").setExecutor(new Stick());
  }
}
```how can I make this command case insensitive? if other class is like this
```java
public class Stick implements CommandExecutor {
  @Override
  public void boolean onCommand(bla bla) {
    Player p = etc etc.
  }
}
``` now the command only works when typed all lowercase how can I fix it? (no args, only a single /stick)
tardy delta
#

easiest way is lines.stream().collect(Collectors.joining("\n")) or smth

tardy delta
#

why would you even allow that

#

?pluginmessages

#

blame staff

#

this one is the best

#

?learnjava!

undone axleBOT
tardy delta
#

thanks to imajin

torn basalt
#

like this?

quiet ice
#

no.

torn basalt
tardy delta
#

it returns a string

quiet ice
#

String s = lines.stream().[...]

tardy delta
#

use that

torn basalt
#

OH

#
            List<String> lines = getConfig().getStringList("kick-message-host.");
            String lineStrings = lines.stream().collect(Collectors.joining("\n"));
            event.getPlayer().kickPlayer(ChatColor.translateAlternateColorCodes('&', lineStrings));
#

i fixed it

#

let me try

#

oh

tardy delta
#

it has a notnull contract iirc

torn basalt
#

its not kicked me

tardy delta
#

i also told you to use what i said

tropic ingot
tardy delta
#

people not knowing you can set lore to an immutable list

tawdry parcel
#

I think I've ruined everything now :C At first, maven emptied my entire plugins folder of my server and now maven doesn't even compile anymore
pom.xml: https://paste.md-5.net/caqamoboga.xml

Can someone maybe just write me the pom.xml code that will compile my project into a jar file in the path C:\Koner\projects\minecraft\konercraft\plugins\konerutils.jar. Thank you!

tardy delta
#

💀

#

where is your backup son

tawdry parcel
#

I didn't do one, didn't think I could destroy the compiler that easily 💀

#

Is my project now lost?

tardy delta
#

i can smell that?

remote swallow
#

or find a project online and copy the format

tawdry parcel
#

And can someone help me maybe to write a pom.xml code that will compile my project into a jar file in the path C:\Koner\projects\minecraft\konercraft\plugins\konerutils.jar? Because the

<outputDirectory>C:\Koner\projects\minecraft\konercraft\plugins</outputDirectory>
```didnt't worked
radiant cedar
#

What would be the best way to spawn blocks in a boundingbox depending on its probability. The materials are mapped to their probability in a hashmap.

#

Right now im doing cumulative probability for each block in the bounding box.

radiant cedar
#

but I feel like there is a more optimized way

tawdry parcel
#

Line 20

hazy parrot
tawdry parcel
#

okay i'll try that thank you

torn basalt
#
kick-message-host:
  - "&e&l● &6&lIUMGUARD &e&l●"
  - ""
  - "&aLütfen sayısal ip ile girmek yerine &eplay.demirium.com &aadresi ile gir."
  - ""
  - "&6Support: &edeniz@foudrestudios.com"

https://prnt.sc/7CkKD9cduKgj

        if(!getConfig().getString("host").equalsIgnoreCase(hostnameUsed)) {
            StringBuilder sb = new StringBuilder();
            for(String kickmessage : getConfig().getStringList("kick-message-host")) {
                kickmessage = kickmessage.replaceAll("&", "§").replace("{HOST}", getConfig().getString("host"));
                sb.append(kickmessage);
                event.disallow(PlayerLoginEvent.Result.KICK_OTHER, kickmessage);
            }
        }
humble tulip
#

lmfao i just spend an hour trying to figure out why my plugin is pulling english values from the chinese lang.yml
turns out i didnt translate some of the keys

tawdry parcel
remote swallow
#

being intellij probably

tawdry parcel
#

can i delete it?

#

i looks like its something for maven

remote swallow
#

?tas

undone axleBOT
tawdry parcel
#

oh no

remote swallow
#

right click the pom and import it as a maven project

torn basalt
#
kick-message-op:
  - "&e&l● &6&lIUMGUARD &e&l●"
  - ""
  - "&aMerhaba, salak griefer kardeşim. Senin böyle bir salaklık yapacağını tahmin ettiğimiz için böyle bir sistem geliştirdik."
  - "&a&lHAA! &aSakın unutma Port Açığı gibi şeyler deneyeyim dersen onlar kapalı zaten sana iyi denemeler enayi. :D"
  - ""
  - "&3Bir kez yürünmüş bir yola düşenlerin sayısı çoktur, hedefe ulaşan az..."
  - "&b- Friedrich Nietzsche"
  - ""
  - "&6Support: &edeniz@foudrestudios.com"
#

without \n

tawdry parcel
torn basalt
tender shard
#

put the method to strip the hostname into its own method lmao

torn basalt
#

its works now

tender shard
#

have you ever heard of using methods? 😄

torn basalt
#

i fixed it

tender shard
#

yeah but still

#

you shouldnt embed logic like this into a listener

#

you should write a method like java public static String getActualHostName(String givenHostname) { ... }

humble tulip
#

How can i take a colorized string and convert it to a nms IChatBaseComponent?

torn basalt
# torn basalt ``` kick-message-op: - "&e&l● &6&lIUMGUARD &e&l●" - "" - "&aMerhaba, salak...

kick-message-op:

  • "&e&l● &6&lIUMGUARD &e&l●"
  • ""
  • "&aMerhaba, salak griefer kardeşim. Senin böyle bir salaklık yapacağını tahmin ettiğimiz için böyle bir sistem geliştirdik."
  • "&a&lHAA! &aSakın unutma Port Açığı gibi şeyler deneyeyim dersen onlar kapalı zaten sana iyi denemeler enayi. :D"
  • ""
  • "&3Bir kez yürünmüş bir yola düşenlerin sayısı çoktur, hedefe ulaşan az..."
  • "&b- Friedrich Nietzsche"
  • ""
  • "&6Support: &edeniz@foudrestudios.com"
                StringBuilder sb = new StringBuilder();
                for(String kickmessage : getConfig().getStringList("kick-message-op")) {
                    kickmessage = kickmessage.replaceAll("&", "§");
                    sb.append(kickmessage);
                    event.disallow(PlayerLoginEvent.Result.KICK_OTHER, sb.toString());
                }

how can i make new line without \n

remote swallow
#

way too much whitespace

humble tulip
#

I tried taking the colorized string using the bungee chat, convert it to json and then convert the json to IChatBaseComponent using the Serializer subclass

tender shard
humble tulip
grim oak
#

Hi I was looking at making custom items and was following this video as a guide https://www.youtube.com/watch?v=5npPUMrYaYE
But for the event handler when it checks for the item meta, if the player has renamed the item in an anvil, won't that have changed the meta, so it wont work as expected?

humble tulip
grim oak
#

Thanks ill look at that

pine cipher
#

hi can someone tell me how i can make 2d icon in inventory but 3d model in hand for item ( like spyglass is)?

tender shard
#

Note, this is using Mojang mappings as of 1.19.3

#

For example "Component" is the proper name of IChatBaseComponent

tardy delta
humble tulip
#

I'm even sending the BaseComponent[] to myself and its working

#

wait i see the problem 💀

daring lark
#
        for(Class<?> clazz : new Reflections(plugin.getClass().getPackage() + "listener").getSubTypesOf(CakeListener.class)) {
            try {
                CakeListener<T> listener = (CakeListener<T>) clazz.getConstructor(JavaPlugin.class).newInstance();
                Bukkit.getServer().getPluginManager().registerEvents(listener, plugin);
            } catch (Exception exception) {
                Logger.error("Failed to load listener from " + plugin.getClass().getPackage());
            }
        }
    }```

why am i getting NoClassDefFoundError(second line)?
humble tulip
#

when calling newinstance you gotta pass plugin

#

like Constructor#newInstance(plugin)

tender shard
humble tulip
#

it only works in chat

daring lark
humble tulip
#

can you tell us which line gives the error?

#

not first or second

#

paste the line itself

vale ember
tardy delta
#

dont create a new Reflections object every time

humble tulip
#

or paste all the code and the stacktrace

daring lark
daring lark
# daring lark still second

this one for(Class<?> clazz : new Reflections(plugin.getClass().getPackage() + "listener").getSubTypesOf(CakeListener.class)) {

humble tulip
#

Argecraft gave you your answer

#

no . before listener

daring lark
vale ember
daring lark
sterile token
#

Oh right

daring lark
#
        for(Class<?> clazz : new Reflections(plugin.getClass().getPackage().getName() + ".listener")
                .getSubTypesOf(CakeListener.class)) {
            try {
                CakeListener<T> listener = (CakeListener<T>) clazz.getConstructor(JavaPlugin.class).newInstance(plugin);
                Bukkit.getServer().getPluginManager().registerEvents(listener, plugin);
            } catch (Exception exception) {
                Logger.error("Failed to load listener from " + plugin.getClass().getPackage());
            }
        }
    }```
#

code now

vale ember
#

could you send the full stacktrace?

tardy delta
#

?formatting

vale ember
#

?paste

undone axleBOT
sterile token
#

Why are You doing that tho

daring lark
vale ember
#

the entire error

sterile token
#

Sorry for asking but hacen You learnt Java before coding? - It's a questions don't get mád

vale ember
#

not just one line

sterile token
#

Lol really weird tho

daring lark
#

ok

sterile token
#

Because stractrace are the most basic thing You have

daring lark
#

error

#

for me

sterile token
#

I mean when You ask for Helo most of the time ppl Will answer really theorical so should know the correct mames

vale ember
#

it might be the issue

#

(if you don't)

sterile token
#

Are

buoyant viper
#

if compilers are so good at finding errors in my code, why can't they fix them for me? who cares if i forgot a semicolon, put it in for me.

sterile token
#

Would registering listeners like that cause issue? Because what about if tour listeners contains params on the constructor?

daring lark
vale ember
vale ember
daring lark
#

maven

vale ember
#

you need to shade reflections library'

vale ember
daring lark
sterile token
#

How so?

vale ember
daring lark
#

how to shade library

sterile token
#

From what i know di is based on passing isntances thru constructors

daring lark
#
            <groupId>org.reflections</groupId>
            <artifactId>reflections</artifactId>
            <version>0.10.2</version>
        </dependency>```
vale ember
sterile token
#

How would that knkectil. Works

#

Can i seeM

#

I'm really mád with this Shity Word cellñhone it change eceythung i type ok English

vale ember
sterile token
#

I'm not wondering to be maf but i woudltn code without learning how depdencies nor stractrace works and most other things

daring lark
#
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.1</version>
                <configuration>
                    <source>16</source>
                    <target>16</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>3.2.4</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <createDependencyReducedPom>false</createDependencyReducedPom>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
            </resource>
        </resources>
    </build>``` 

i have sth like this
vale ember
#

yeah, does it work or not?

daring lark
#

no

vale ember
#

same error

#

?

daring lark
#

yes

#

i mean

tardy delta
buoyant viper
daring lark
#

pom.xml was always the same

vale ember
#

can you please send full error?

daring lark
#

but how do you use fileds to register events?

tardy delta
#

should probably assume the user wants to insert the whole word

vale ember
grim oak
#

When i created a namespaced key, how should i name it, is there a convention/ a way it should be named or can it just be anything

daring lark
#

you said that you were using fileds to register events

#

or not?

grim oak
#

but for the actual name of the key

vale ember
vale ember
grim oak
#

okay then

#

thats all ty

#

wait I mean, could i just call it 'key' or is there anything i would want to call it in particular

tardy delta
tender shard
undone axleBOT
vale ember
buoyant viper
tardy delta
#

bruh moment when doing maths with chars

tardy delta
buoyant viper
#

i keep mine in Program Files 🙄

sterile token
tender shard
buoyant viper
river oracle
tardy delta
#

a lil bloat innit?

sterile token
grim oak
buoyant viper
sterile token
#

Lol what happen to you i2k

tardy delta
#

dont you like fuck?

buoyant viper
grim oak
tender shard
#

it can be whatever you like

#

if you want to store a name, use "name"

#

if you want to store the age of a user, use "age"

#

it's like a variable name that this key represents

grim oak
#

okay thanks

tardy delta
#

talking to verano

tender shard
#

Keys may only contain lowercase alphanumeric characters, periods, underscores, hyphens, and forward slashes.

sterile token
# grim oak okay thanks

NamespacedKey are just a key-value for entities, You just put a name and assign a value to it

tender shard
#

and what does it have to do with entities?

river oracle
#

Nothing

#

PDC is on many things

tardy delta
#

literally only thing copilot is good for is to write good javadocs

tender shard
#

a NamespacedKey is simply a "namespace:key" thingy.
"minecraft:unbreaking"
"myplugin:username"
"minecraft:sound/music_disc/stal"

sterile token
#

From what i know everythimg in mc are entities, players, mobs, items, worlds

#

🤔

buoyant viper
#

how is a world an entity

tender shard
#

it's just a string that has a namespace, left of the :, and a name, right of the :
and the namespace is used so that different plugins / data packs don't get naming conflicts when both use the same name

buoyant viper
#

some sort of cosmic being?

grim oak
tender shard
grim oak
#

oh right

#

okay

tender shard
sterile token
#

Wait i thoguth he was talking about PDC, NamespacedKey are for recipies

tardy delta
#

in minestom a world is an Instance :kekw:

tender shard
#

these are all entities, and nothing else

grim oak
#

So if i were to make several custom swords, I could set the namespaced key to 'sword_type', and then the persistent data value would be a value corresponding to which sword it is

grim oak
#

okay tyy

tardy delta
#

another custom items plugin? \👀

sterile token
tender shard
#
private final NamespacedKey swordTypeKey = new NamespacedKey(myplugin, "sword_type");

public ItemStack getCoalSword() {
  ItemStack item = ...;
  ItemMeta meta = item.getItemMeta();
  meta.getPersistentDataContainer().set(swordTypeKey, PersistentDataType.STRING, "coal");
  ...

like this @grim oak

sterile token
#

Oh the problem Is that i treat entities as api related. Like discord treat User, Guild, etc as entities

tender shard
# grim oak awesome, thanks!

if you ever need to store arrays, lists, maps or custom objects in a PDC, check out MorePersistentDataTypes: https://www.spigotmc.org/threads/more-persistent-data-types-collections-maps-and-arrays-for-pdc.520677/

tardy delta
#

damn i completely forgot about the plugin i was busy with

#

kde plasma?

grim oak
zinc egret
humble tulip
#

@tender shard turns out 1.8-1.13 uses ChatComponentText for inventories

#

which is basically strings with chatcolor chars

humble tulip
tender shard
#

then no idea what you're talking about

humble tulip
#

?paste

undone axleBOT
onyx fjord
#

when 2 foreach and when 2 for loop or theres no difference

humble tulip
onyx fjord
#

and which one faster

humble tulip
tender shard
#

it's the same except that in foreach you cannot see the index

onyx fjord
#

im guessing foreach lets you do oneliners

sterile token
#

Let say i have the next code for working with mongo

class StorageManager {

 void open();

void close();

CompletableFuture<Model> find(UUID uuid);
}

Why would server get blocked until the future is completed?

humble tulip
onyx fjord
#

rly?

humble tulip
tender shard
#
for(int i = 0; i < myArr.length; i++) { Object o = myArr[i];
  // do stuff
#

lol

#

you can always put everything into one line

warm light
#

anyone can tell me whats wrong here? its not sending data

humble tulip
tender shard
humble tulip
#

you gotta use the bungee channel

wicked badge
#

how do i disable every player appearing on the player list?

humble tulip
#

unless you create a bungee plugin which registers your custom channel and forwards the data

warm light
#

umm

sterile token
humble tulip
#

get blocks the thread till the result is returned

#

use the whenComplete methods

wicked badge
#

how do i hide everyones names

warm light
sterile token
tender shard
tender shard
tardy delta
#

i did a good job

tender shard
#

wanted to reply to verano

wicked badge
#

dw

humble tulip
wicked badge
#
- "&6&l----------"
- "&6Welcome To..."
- "&6we don't have a name yet lol"
footer:
- ""
- "&6no players for you :)"
- "&6&l----------"``` this is what i have and players still appear
zinc egret
sterile token
warm light
humble tulip
#

just dont call get

humble tulip
sterile token
#

🤔

humble tulip
#

it tells the thread you called get from

#

to wait

sterile token
#

Oh ok

#

What a shity Docs have the Completable future

#

😂

tender shard
humble tulip
#

CompletableFuture#thenAccept()

#

use thenAccept instead

tender shard
humble tulip
#

to accept the result async

sterile token
#

I read the get and just said that get method Will block the thread, but if You read before that they use a thread pool, then it cannot be blocked it's like really 🤡

humble tulip
#

LOL

#

they told you it's blocking

#

yes it uses a thread pool

tardy delta
#

wondering what i was doing

hazy parrot
#

Well, do you expect whole internal logic of future to be written in docs

humble tulip
#

but if you tell your current thread to wait till the result is ready(by calling get()) your main thread will wait

hazy parrot
#

It will block thread get is called from

#

And wait for completion

sterile token
#

Yeah but Docs don't tell that

#

💀

#

Just tell that Will block the thread

#

It's not specific

hazy parrot
#

Isnt it logic?

humble tulip
#

yes it does

tardy delta
#

google it

humble tulip
#

it says it waits

tender shard
humble tulip
#

if necessary

tender shard
#

it even throws InterruptedException

#

obviously it waits

sterile token
# hazy parrot Isnt it logic?

No, because if they first.told that they use a thread pool, they telling indirectly that i will never block Main thread

tender shard
#

should it just get your data out of nowhere RIGHT NOW without waiting?

#

through magic

#

would be nice if that'd work

tender shard
#

what does the one thing have to do with the other?

hazy parrot
sterile token
#

Oh lmao Java Async is definitly so shity

humble tulip
#

lmfao dude

hazy parrot
#

It's really not

humble tulip
#

stop complaining abt java

#

this applies to every language

sterile token
#

I would love to have C# Async just a keyword and no messe with blocks nor nothing

hazy parrot
#

Have you ever done async programming in c#?

#

My bet is no

tardy delta
#

fun thing to use an async keyword if you dont know what it does

sterile token
#

Doesnt make senses

tardy delta
#
@Async```
#

could use that at my pojo mapper

#

but i kinda quit it

sterile token
#

Lmao stop latghing at me

#

You are making me mad

tardy delta
#

im not laughing

tardy delta
#

fun thing about designing a database library is that you don't have to care about speed :)

sterile token
hazy parrot
tardy delta
#

is there smth like

async {
  Console.WriteLine("this got executed async");
}```
hazy parrot
#

Not that I know of

#

There is in kotlin 😛

tardy delta
#

kotlin looks already cursed enough

#

but it has some interesting features that java needs

sterile token
hazy parrot
#

Syntax wise

hazy parrot
tardy delta
#

what even was the question

humble tulip
#

Bro you can't ever expect an async value to return sync

tardy delta
#

heeheehee

sterile token
tardy delta
#

now steal the site

hazy parrot
humble tulip
tardy delta
humble tulip
#

without blocking

tardy delta
#

isnt () => console.log blablabla valid here too?

humble tulip
#

the current thread must always wait for the other thread to finish up

hazy parrot
sterile token
#

So how does the spigot Schedule system works without blocking nor using Completable Future

hazy parrot
tardy delta
hazy parrot
#

You just can't return a value

hazy parrot
tardy delta
#

here you go with the new pfp

sterile token
tardy delta
#

cuz that value is computed async and the sync code doesnt wait on the async code to return

#

thats where completable futures come in

sterile token
#

From i what know threads queue each process, then execute it, wait for result and finally return it

#

🤔

hazy parrot
tardy delta
#

dont even know what the question was smh

#

just talking shit

humble tulip
#

You schedule a task async

worldly ingot
#

Beat me to it lol. I was just about to reply to that

#

Scheduler doesn't return a value

humble tulip
#

When you get your result, you schedule a sync task

worldly ingot
#

You can use the scheduler to process something asynchronously and return a value, but you'd need to create and return a CompletableFuture

tardy delta
#

this feels like the same conversation i had two years ago

#

wait the whole jvm uses the same common pool for cfs right?

#

unless you pass in an executor

worldly ingot
#

I believe so, yes

sterile token
tardy delta
#

hmm i was just thinking about optimisations but whatever

#

imagine geol joining this conversation now, he would freak out

hazy parrot
rough drift
#

So, I need to delete a world, however spigot doesn't let me if there are players, I figured that sending players to the hub using bungeecord works, just to make sure, does Player#sendPluginMessage have some sort of block or do I have to wait until the world is empty?

hazy parrot
#

if you want to go and get coffie, you would have to stop programming

humble tulip
#
            CompletableFuture.supplyAsync((Supplier<String>) () -> {
                //return something here
            }).thenAccept(s -> Bukkit.getScheduler().runTask(plugin, (Runnable) () -> {
                //use string sync here
            }))
hazy parrot
#

if you want me to get you coffie when im done, you use something called callback

sterile token
#

🤔

hazy parrot
#

?

humble tulip
#

????

#

Let's break it down.

tardy delta
#

give the thread some coffee

humble tulip
#

You have a slow task to do like getting something frm a db

#

You dont want to wait so you want to get it on another thread

sterile token
#

No no i mean i must understand Async un Java because in future i Will make Big projects

#

Which Will need Async

humble tulip
#

You do CompletableFuture.supplyAsync(() -> { return "DB Value here"; })

#

that will get the db value async

#

you understand this much?

sterile token
#

Yes that i understand

humble tulip
#

it's done on a separate thread from the one you called it on

#

ok

#

great

sterile token
#

Yeah this i know

humble tulip
#

if you have code after the compleablefuture

#

maybe something like 1+1;

#

that code will continue executing on your main thread while the completable future is working on your db

#

but what's the point in getting something frm the db if you cant do anything with it?

#

That's why compleablefuture has methods like thenAccept

#

which allows you to do something with the result from the compleablefuture

sterile token
#

Ok

tardy delta
#

where did my boo go to

sterile token
#

Just don't understand the diff between returning the value itself and future itself, if both of them You have the value

humble tulip
#

Both dont have the value

tardy delta
#

i probably have to add a hook to it

humble tulip
#

the future will have the value in the "future"

#

that's why its a future

tardy delta
sterile token
#

Okay def won't touch the project until i Start unicersity, we're we have OS Arch and programming

humble tulip
sterile token
#

Yes

#

I have seen many impl of Async that why i'm mix

humble tulip
#

look at this class

#

it's similar to a compleablefuture

#

i also made it before i knew compleablefuture wasa thing

sterile token
#

Someone of them use Executors, others Threads, others Completable future, and a few CompletableFuture with an executor

tardy delta
#

whers moo

#

id say jvm exited before cf finished but those arent daemon threads

humble tulip
sterile token
#

Yes

tardy delta
#

i looked through that whole plugin back in the days

humble tulip
#

so is a compleablefuture

tardy delta
humble tulip
#

lmfao

sterile token
#

Oh right i understand promises

humble tulip
#

ok so basically

sterile token
#

Cuz of Ts

humble tulip
#

when you get something using a compleablfuture its like saying im gonna get this and i'll get it to you in the future

#

so when you do CompleableFuture.supplyAsync(), a new CompleableFuture is returned to you

#

the supplier is then run on a separate thread

#

and when the result is gotten on the thread, compleablefuture.complete(result) is called

sterile token
#

Promises takes an I/O operation, queue each thread, compute each thread and return the result

tardy delta
#

it returns a new CompletableFuture object and in the meantime it starts executing the code you gave it and when its finished it places it in the future and runs thenAccept, thenRun hooks etc

#

once made my own cf

#

it was a piece of shit tho

humble tulip
#

does anyone know how to setup pterodactyl?

hazy parrot
humble tulip
#

i tried once, and gave up

#

just continued using screens

sterile token
#

Also really sorry for how i refer to You all, i was a bit stressed because i want able to understand how it works

hazy parrot
jagged salmon
#

#1 int rightArmX = plugin.getConfig().getInt("rightArm", 1); int rightArmY = plugin.getConfig().getInt("rightArm", 2); int rightArmZ = plugin.getConfig().getInt("rightArm", 3);

#2 List<Integer> rightArm = plugin.getConfig().getIntegerList("rightArm"); int rightArmX = rightArm.get(1); int rightArmY = rightArm.get(2); int rightArmZ = rightArm.get(3);

I'm trying to get the config values for "rightArm" which are integer values I've tried these metods above and they don't work? the #2 gives an error when run but shows nothing in my parser.
The config:

  x: 270
  y: 0
  z: 0```
humble tulip
#

nms 1.8-1.19.3 is a pain in the ass

#

rightArm.x

tardy delta
#

thats not a list

humble tulip
#

rightArm.y

#

rightArm.z

sterile token
tardy delta
#

i have to be honest but the spigot wiki about config files absolutely sucks

sterile token
#

Yeah

tardy delta
#
BukkitWiki

The Configuration API is a set of tools to help developers quickly parse and emit configuration files that are human readable and editable. Despite the name, the API can easily be used to store plugin data in addition to plugin configuration. Presently only YAML configurations can be used. The API however was designed to be extensible and allow ...

jagged salmon
#

ok thanks

sterile token
#

That it's completly fucking stressin to read

tardy delta
#

lol

sterile token
#

Yeah because you can't extends the config

#

Like You do on bukkit with YamlConfiguration

jagged salmon
#

plugin.getConfig().getIntegerList("rightArm").get(1);
something like this would work right

tardy delta
#

no thats not an integerlist

#

its a config section

sterile token
#

Yeah

jagged salmon
#

so stringList?

chrome beacon
#

No

#

a config section

tardy delta
#

an int list would be ```yml
path:

  • 1
  • 2```
    or
path: [1, 2]```
#

you need the child node of rightArm

tawdry parcel
#

Should I use the IntelliJ Build Artifacts Option or should I compile with marven, or is that the same?

chrome beacon
#

Use maven

tardy delta
#

so rightArm.x, rightArm.y etc

#

. is used as a separator

jagged salmon
#

alright thanks a lot 😄

tawdry parcel
sterile token
#

This are list

MyList: [1, 2, 3]

MyList:

  • 1
  • 2
  • 3
chrome beacon
sterile token
chrome beacon
#

If it isn't a maven project you're free to use artifacts

#

but I would still recommend maven or gradle as it makes managing dependencies easier

sterile token
#

If not a gradle nor maven project, You must artifact

tardy delta
#

people are blind

sterile token
tardy delta
#

im not exactly laughing here

#

and the world is hard, get used to it

sterile token
#

Well i dont care it's simple if someone fuck i just ignore that ppl

tardy delta
#

whos pol?

tawdry parcel
sterile token
#

No?

tawdry parcel
#

But thank you :D

sterile token
#

Before i learnt maven i used to compile with Ant

worldly ingot
#

Are you okay?

#

I'd imagine that would have given you some form of PTSD

rough drift
#

Scoreboard#getTeams()#forEach(Team::unregister); should work right?

quaint mantle
#

How to remove an offline player from an ArrayList

sterile token
quaint mantle
#

?

rough drift
quaint mantle
#

OFFLINE Player

rough drift
#

well yes

#

player extends offline player

sterile token
rough drift
#

so you can pass in a player or offline player

hazy parrot
rough drift
#

though you should store UUIDs and call Bukkit.getOfflinePlayer(UUID) or Bukkit.getPlayer(UUID)

quaint mantle
tawdry parcel
sterile token
#

I'm pretty okay, just a bit upset because i don't understand Async on Java

rough drift
#

that's how it works

#

use maven or gradle

hazy parrot
rough drift
#

You can't not use it

hazy parrot
rough drift
#

you shouldn't use just java or intellij to compile anything

#

a build tool is way better

hazy parrot
#

^

sterile token
tawdry parcel
#

oh okay thank you so much guys

zinc egret
tardy delta
chrome beacon
rough drift
#

If I iterate over a scoreboard's teams and call unregister on each team, does that cause a CME?

chrome beacon
#

Sounds like a try it and see moment

rough drift
#

I hoped someone knew already lol

#

sometimes it's faster to ask

tardy delta
#

dammit

hazy parrot
tardy delta
#

too lazy to use an IntFunction<Node> cuz casting and stuff

eager yew
#

Hi, how do i get the Vanilla Chunk Generator, or the code of the vanilla ChunkGenerator?

tardy delta
#

lets just use di

#

ok got rid of that NodeFunction and made it a Function<IntPredicate, Node>

topaz cape
#

does anybody know why NMS world doesn't change for a server player after a world switch

worldly ingot
#

what

undone spindle
#

?permissions

undone axleBOT
#
CafeBabe Help Menu
Syntax: ?permissions 
Command permission management tools.

**__Subcommands:__**

canrun Check if a user can run a command.
explain Explain how permissions works.

undone spindle
#

uh....

#

?permissions explain

undone axleBOT
#

This cog extends the default permission model of the bot. By default, many commands are restricted based on what the command can do.
This cog allows you to refine some of those restrictions. You can allow wider or narrower access to most commands using it. You cannot, however, change the restrictions on owner-only commands.

When additional rules are set using this cog, those rules will be checked prior to checking for the default restrictions of the command.
Global rules (set by the owner) are checked first, then rules set for servers. If multiple global or server rules apply to the case, the order they are checked in is:

  1. Rules about a user.
  2. Rules about the voice channel a user is in.
  3. Rules about the text channel a command was issued in.
  4. Rules about a role the user has (The highest role they have with a rule will be used).
  5. Rules about the server a user is in (Global rules only).

For more details, please read the official documentation.

undone spindle
#

okey did not help....

#

okay so hello sharks i have a question i have been trying to work with permissions but it no work

public void onPlayerFish(PlayerFishEvent event) {
        if (event.getState() != PlayerFishEvent.State.CAUGHT_FISH) {
            return;
        }


        Player player = event.getPlayer();

        if (!player.hasPermission("Fishing.Fish")) {
            System.out.println("no bitches");
        return;
        }

        String region = RegionManaging.getRegion(player).iterator().next().getId();
        FishingRegions fishingRegion = FishingRegionManager.getFishingRegion(region);

        if(fishingRegion.getStatus() == FishingStatus.NO){
            event.setCancelled(true);
            return;
        }

        if(fishingRegion.getStatus() == FishingStatus.OFF){
            return;
        }

        event.setCancelled(true);
        FishHook hook = event.getHook();

        FishingItems randomItem = fishingRegion.GetRandomItem();
        ItemStack rItem = randomItem.getItem().clone();
        rItem.setAmount(randomItem.getRandomAmount());
        Entity droppedI = player.getWorld().dropItem(hook.getLocation(), rItem);
        player.giveExp(Math.round(randomItem.getRandomxp()));
        hook.setHookedEntity(droppedI);
        hook.pullHookedEntity();
        hook.remove();

    }

as you can see here it should cancel if player does not have permissions
but it does not. cus i dont have permissions and it still lets continue's on the code and gives me a random item

tawdry parcel
#

what does this error mean:
@Override is not allowed when implementing interface method

worldly ingot
#

No clue because that's blatantly false given no context

#

What's your code look like?

tawdry parcel
#

oh sry i forgot 😅

package com.koner.konerutils.nickname;

import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;

public class NicknameCommand implements CommandExecutor {
    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        Player player = (Player) sender;
        String nickname = args[0] != "default" || args[0] == "" ? args[0] : player.getName();
        player.setDisplayName(nickname);
        player.setCustomName(nickname);
        player.setPlayerListName(nickname);
        player.sendMessage("Display Name: " + player.getDisplayName() + " Name: " + player.getName() + " Custom Name: " + player.getCustomName() + " PlayerListName: " + player.getPlayerListName());
        return true;
    }
}
#

and it underlines the @override

undone spindle
#

yellow or red?

worldly ingot
#

Either way it shouldn't be underlining lol. That's correct

tawdry parcel
#

red

worldly ingot
#

Only thought would be that you're compiling against Java 5 or something

#

Are you using Maven? Because J5 is the default

worldly ingot
#

Yeah, so make sure you have (at the very least) Java 8 selected

tawdry parcel
#

dou you mean that <java.version>19</java.version>

worldly ingot
#

Yeah, though that does nothing unless you use that property elsewhere

undone spindle
#

uh in your external libraries

#

you should see java 19 there

worldly ingot
#

If your Maven is using Java 19, then make sure your project is also set to use language level 19

undone spindle
undone spindle
tawdry parcel
#

how can i change the maven java version in the maven-jar-plugin?

#

cause <source> und <target> is not working

undone spindle
#

what is your source and target now?

tardy delta
#

array[char] being a thing smh

undone spindle
tawdry parcel
#

where do i need to add the source and target?

undone spindle
#
<build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>3.3.0</version>
                <configuration>
                    <outputDirectory>C:/Koner/projects/minecraft/konercraft/plugins</outputDirectory>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                </configuration>
            </plugin>
        </plugins>
worldly ingot
#

^ Yeah, you're missing the thing that actually uses those properties

fading spindle
#

do you need to install minecraft development plugin in intellij for it to work

worldly ingot
#

(though remove the outputDirectory from that example above. Rest is fine)

#

No, you can write plugins without it. It does greatly simplify things though

#

Note it's unofficial however

undone spindle
undone spindle
worldly ingot
#

Oh, sorry, thought that was yours lol

undone spindle
#

nope i copied konor's pom.xml from pastebin XD

tardy delta
#

oh i see why im getting an error

#

children[' ' - 'a'] hmm

frank kettle
#

what happens if a server has 2 of the same plugin jar but different versions?

worldly ingot
#

iirc it's just whichever one is loaded first

#

Depending on your OS, file system, and other factors, that will vary from server to server

median trench
#

Can I change the default world chunk generator without changing bukkit.yml, like to run from first-setup without touching anything?

frank kettle
#

oh okay, cause im naming my jars with its corresponding versions and I'm worried some people might just put the new jar in the plugins folder and forget to delete the previous. and this way miss out on the new update features and then be mad 😂

tardy delta
#

how does 'C' match c -> c >= 'a' && c <= 'z'

#

its an IntPredicate so maybe it does some weird internal conversion from char to int

olive lance
#

does this make sense to any one?

pseudo hazel
#

x == 3

olive lance
#

nbm

#

i was so confused but now i see

#

ty btw

worldly ingot
#

Even in an int predicate because chars are literally just ints

tardy delta
#

it seems to do so im confused

#

lemme see what goes wrong

frank kettle
#

🤔 is there a way to call out an event?

im doing a breakNaturally(tool) on a list of blocks but unfortunately this doesn't drop any experience. so i was thinking to try to "call" an event like new BlockExpEvent(block, experience).

is anythign like this possible?

tardy delta
#

Bukkit.getPluginManager().callEvent(Event)

worldly ingot
tardy delta
#

my logic is broken then

worldly ingot
#

Yes

tardy delta
#

please do me a favour and change that background

worldly ingot
#

No

tardy delta
#

i guess people get used to it

frank kettle
#

will test, ty

#

nope, not working

#

no error

tardy delta
#

what not working?

frank kettle
#

it's not dropping any exp

#

i guess i will remove the block the player actually breaks from the list of blocks to break with code and then sum up the experience of all the blocks that will be broken into this main block's experience dropped since this has a setExpToDrop function

#

🤔

tardy delta
#

ig just calling it doesnt drop xp

#

idk

#

doesnt block::breakNaturally already fire a blockbreak event?

frank kettle
#

no

trim creek
#

Something is completely wrong with my server, and I can feel it. Command Suggestion Blocking might have killed the tab completion feature of my lobby server, with me not knowing how to fix that. 🤣

#

Also I love how only certain commands are available even tho I do have the perms for them lol

undone spindle
#

why tab complete on normal commands

#

?

trim creek
#

I have been using this PlayerCommandSendEvent

undone spindle
#

they are automatically implemented in the command list

trim creek
#

and thus

#

I might have broken everything

tardy delta
#

im kinda wondering what happens when you call ::toLowerCase on things other than letters

#

seems to return the same thing for number

trim creek
#
@EventHandler
    public void onSuggest(PlayerCommandSendEvent e) {
        List<String> ownerCommands = new ArrayList<String>();
        List<String> managerCommands = new ArrayList<String>();
        ownerCommands.add("restart");
        ownerCommands.add("stop");
        managerCommands.add("luckperms");
        managerCommands.add("lp");
        if (e.getPlayer().hasPermission("rank.owner")) {
            e.getCommands().addAll(ownerCommands);
            e.getCommands().addAll(managerCommands);
            Bukkit.getConsoleSender().sendMessage("§aOwner");
        } else if (e.getPlayer().hasPermission("rank.manager")) {
            e.getCommands().addAll(managerCommands);
            Bukkit.getConsoleSender().sendMessage("§aManager");
        }
    }

This entire code sucks. Not just it, but the feature itself.

tardy delta
#

wheres the Arrays.asList

trim creek
#
  • oh and btw even without this code all my commands... are just gone xd -
trim creek
#

lmao

olive lance
#

is this some kind of sick trick question

#

why does the ascii code matter lmaoo

#

or will it print the ascii number in that case? lol

tardy delta
#

should work ig

humble tulip
tardy delta
#

and yet it doesnt throw

humble tulip
olive lance
#

i have no idea

#

i feel it will just say ABac

trim creek
humble tulip
#

But idk if it's gonna add the chars

tardy delta
#

what about ABac

humble tulip
#

Like the value

olive lance
#

the answer

tardy delta
#

left is a string and every string += gets added to it

olive lance
#

so then ABac yea?

humble tulip
#

System.out.println("AB" + 'a' - 'c'); isnt valid tho

#

yeah ABac is right

humble tulip
#

System.out.println("AB" + ('a' - 'c')); is the correct syntax which wuld give "AB-2"

olive lance
#

so it was a trick question then lol wow

humble tulip
#

If you put them in brackets

tardy delta
#

everything works fine, then it sees the C and it fails to detect it lol

humble tulip
#

System.out.println("AB" + ('a' + 'c'));
AB196

frank kettle
olive lance
trim creek
#

Using

@EventHandler
    public void onSuggest(PlayerCommandSendEvent e) {
        e.getCommands().remove("settings");
    }

removes the /settings command. How can I readd ALL the commands to remove the commands I want to "hide"?

tardy delta
#

not even sure if theres specific bytecode to work with chars

#

like there isnt bytecode for booleans either

#

just uses a byte

worldly ingot
#

The commands list can't be added to. It will always contain all the commands on the server (given no other plugin is modifying it)

#

If you want to show the player all the commands again as though you never removed them, you can call Player#updateCommands() which should re-send them to the client

tardy delta
#

lol it works here and in my impl it doesnt :/

trim creek
humble tulip
worldly ingot
#

Yeah that looks like it's working. You're doing assertTrue() but the condition is false

#

Therefore, error

tardy delta
#

works there but not in my actual code

#

its late and im clearly not seeing it XD

worldly ingot
#

mk well your test you just sent there is correctly throwing an error

trim creek
humble tulip
worldly ingot
trim creek
worldly ingot
#

So if you have some command removal in that event, yeah, it's going to remove it still

trim creek
#

I've tried a plugin for that, but it didn't work so I am making a custom one . xd

#

But even tho using player.updateCommands(), commands are still not shown.

humble tulip
#

just use permissions?

tardy delta
trim creek
#

Only certain ones.

humble tulip
#

idk wtf im watching

trim creek
tardy delta
#

which calls putChildIfAbsent which calls checkChar and assures c -> c >= 'a' && c <= 'z' matches wih 'C'

humble tulip
#

Lemme see checkChar and putChildIfAbsent

trim creek
tardy delta
#

seems to work when i hardcode intpredicate

#

dunno how that can be an issue

trim creek
tardy delta
#

im probbaly doing smth stupid

trim creek
tardy delta
#

im like giving each node the predicate so should work ig

worldly ingot
#

500IQ, negate the predicate and don't ask questions

tardy delta
#

i did, then 4/5 errors

#

now 1/5

mighty aurora
tardy delta
#

its probably true but how

trim creek
#

Aight I realised I fucked my server

tardy delta
#

poor server

trim creek
#

Like... How tf did I made /lp be unknown to players but /gm not?

tardy delta
trim creek
#

Time to reset every fucking possible file

tardy delta
#

hmm thats probably root node fucking up

trim creek
#

oh nevermind I all did shittly was another plugin blocking shit 🤣

tardy delta
#

its like playin around

trim creek
#

FUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUCK

frank kettle
#

how long does the spigotmc api takes to update a plugin's version? I'm using it to check if the server is using the latest version.

#

just for curiosity

worldly ingot
#

I think it updates every 6 hours, though that's based on rough information I vaguely recall from a couple years ago

frank kettle
#

just noticed it's not automatic so was asking just for curiosity

tardy delta
#

im stupid

#

first class idiot

#

forgot to set predicate for root node