#development

1 messages · Page 53 of 1

sonic nebula
#

no reason really

#

imagine in big scale database get like 5k requests every 5 min

#

it goes theotherpig

dusky harness
#

why would it get 5k requests

#

also

sonic nebula
#

ask the plugin dev is devolopment section look at the resource spigot page

dusky harness
#

MySQL can run more than 50,000 simple queries per second on commodity server hardware
according to google 🤷

dapper jackal
#

yes I did not intend to turn to the yaml/json,

At first I was just thinking of doing it this way:
when something needs to be changed -> sql query
but for perfs it's not terrible, what was suggested to me,

create a hashmap which the uid (key) and in value an instance of a class which contains the equivalent of the columns,

then at the start of the server I transfer the database into my hashmap, and all my modifications I make them inside this one, then every 5 minutes I save the hashmap in the database.yes I did not intend to turn to the yaml/json,

At first I was just thinking of doing it this way:
when something needs to be changed -> sql query
but for perfs it's not terrible, what was suggested to me,

create a hashmap which the uid (key) and in value an instance of a class which contains the equivalent of the columns,

then at the start of the server I transfer the database into my hashmap, and all my modifications I make them inside this one, then every 5 minutes I save the hashmap in the database.
whhhat is the best?

#

ah i can use cafeine else

worthy basalt
#

sounds good

#

but saving might cause lag spike

#

is it possible to save using another thread?

icy shadow
#

If you mean save to a database, all database ops should be done off the main thread

worn jasper
#

database and IO ops

icy shadow
#

Mhm

dapper jackal
#

good so I cache memory with coffe, I add the player when he connects, but saving the cache may be laggy?

worn jasper
#

wdym saving the cache

#

updating things in memory is fast

icy shadow
#

well actually 🤓☝️

spiral prairie
#

Shut up, it is fast

dapper jackal
#

even if it's fast it will always be better to go through the cache no?

icy shadow
#

instead of what?

dapper jackal
#

directly from requests

hoary scarab
#

So I'm using reflection to get methods and because of mojangs obfuscation I can't just get method by name and return type.
So I made a method ```java
public Method getByParameters(String name, Class<?> returnType, Class<?>...parameterTypes);


The trouble I am having is I use `Arrays.equals(parameterTypes, method.getParameterTypes())` but if the parameter type is `t` or `Object` it fails. 
Is there a method in java I can use to test for that or should I just make another loop for parameters?

Examples of why parameterTypes have to be checked.
DataWatcher (1.8)
```public <T> void a(int i, T t0)
public boolean a()
public static void a(List<WatchableObject> list, PacketDataSerializer packetdataserializer)
public void a(PacketDataSerializer packetdataserializer)
private static void a(PacketDataSerializer packetdataserializer, WatchableObject datawatcher_watchableobject)```
royal hedge
hoary scarab
royal hedge
#

So you dont want it to work you just want to check if it doesnt work?

hoary scarab
#

... ?
If a methods parameterTypes contains t or Object Ex; [int, int, Object]
the passed parameterTypes will always be false. Ex; [int, int, Dog]

I want to know if there is already a method that checks parameterTypes or if I should loop through them myself.

royal hedge
#

Why would there be a method specifically for checking if any of the parameters are Object or a TypeVariable lmao

royal hedge
hoary scarab
# royal hedge Why would there be a method specifically for checking if any of the parameters a...

I don't think you're understanding the question...

I'm currently using Arrays.equals() to check of both arrays are equal to each other...
If the method parameterTypes contains Object nothing will match unless I specifically specify Object in the passed parameterTypes.

I'm asking if there is an already made method that matches Object to anything while also matching the arrays.

So far I'm leaning on just making another loop to do this myself but would prefer a cleaner option.

royal hedge
#

also you can't check for type variables using the Method.getParameterTypes() method

hoary scarab
#

... idk how else to explain at this point lol

Please just reread the initial message. I'm probably just gonna make my own loop.

tired olive
#

you want a method that is like Arrays.equals but if a parameter's type is a type variable or Object.class you want it to fail?

#

thats literally what you said

#

ignore me switching accs in the middle of this

dense drift
#

lol

tired olive
#

also good job yapper!!

#

also i found a method

#

its on Class[] and its called equalsAndNoObjectOrTypeVariables(Class<?>[])

#

it can detect if the class implements TypeVariable

tired olive
hoary scarab
tired olive
hoary scarab
# dense drift lol

Do you understand the initial question? I think sparky is finally catching on.

tired olive
#

maybe answering my questions would help

#

its pretty obvious why its not working

hoary scarab
tired olive
dense drift
#

Not necessarily

hoary scarab
tired olive
#

let me ask you a question

#

how are you going to check if one of the parameters is a type variable

#

if your using getParameterTypes

hoary scarab
#

I'm not on pc so can't check what it would return. Gonna assume it would just be object or class.

tired olive
#

and then how are you going to put the type variable in the getByParameters method

hoary scarab
#

Not the paramerTypes

tired olive
#

?

#

what

hoary scarab
#

sigh I'll explain it better when I get back on pc.

river solstice
#

smacks you on the face you fool

tired olive
#

cuz assuming the method does what you said it should work completely fine if the method is generic or has an Object parameter

river solstice
#

why are you cooking the man

tired olive
#

im also confused as to why getByParameters is needed when its pretty much the exact same as Class.getMethod

#

also am i a genius or how did this work

public Method findMethod(Class<?> declaringClass, String name, Class<?> returnType, Class<?>... parameterTypes) {
    for (Method method : declaringClass.getMethods()) {
        if (method.getName().equals(name) && method.getReturnType().equals(returnType) && Arrays.equals(method.getParameterTypes(), parameterTypes)) {
            return method;
        }
    }
    return null;
}

public <T> void method1(T t) {}

public void method2(Object o) {}

findMethod(AwesomeClass.class, "method1", void.class, Object.class);
findMethod(AwesomeClass.class, "method2", void.class, Object.class);
hoary scarab
#
private void getMethodByParameterTypes(Class<?> location, String name, Class<?> type, Class<?>...parameterTypes) {
    method = Stream.of(location.getDeclaredMethods())
            .filter(method -> name.equals(method.getName()) 
                    && (type == null || (type != null && !method.getReturnType().equals(type)))
                    && (Arrays.equals(parameterTypes, method.getParameterTypes())))
            .findFirst().orElse(null);
    
    if(method == null) {    
        methodLoop: for(Method m : location.getDeclaredMethods()) {
            m.setAccessible(true);
            
            if(!m.getName().equals(name))
                continue;
            if(type != null && !m.getReturnType().equals(type))
                continue;
            if(parameterTypes.length != m.getParameterTypes().length)
                continue;
            
            Class<?>[] methodParams = m.getParameterTypes();
            for(int i = 0; i < methodParams.length; i++) {
                if(methodParams[i] instanceof Object)
                    continue;
                if(!methodParams[i].equals(parameterTypes[i]))
                    continue methodLoop;
            }
            
            method = m;
        }
    }
}
```Went ahead and just made my own.
hoary scarab
#

1.8 and 1.16.5 working. Gotta do a bit more to get to 1.20 and versions in between.

royal hedge
#

6-7 years yeah?

#

Surely in ur 6-7 years you wouldve also heard of Objects.equals()

#

Also all those &&s can be changed into chained filter calls

#

And heard of enhanced for?

#

Also ur not reusing the arrays returned by getParameterTypes

#

Theres also a method for doing getParaneterTypes().length that doesnt require any array allocations

hoary scarab
#

I love watching the blocked messages counter go up xD

royal hedge
#

ok 6-7 years

mortal scaffold
#

how i can check external placeholder output like

if (placeholder.equals("1") {
    return "asd";    
}
if (placeholder.equals("2") {
    return "dsa";    
}
dusky harness
#

External? Do you mean PlaceholderAPI?

hoary scarab
mortal scaffold
trail burrow
#

In IDE it says this is OK Command entrycmd = (Command) entry.getKey(); but when I compile and run I get casting error

dusky harness
#

Need more info

sharp cove
#

Hey, maybe a random question.. but has someone here experience with php/laravel?

#

Got a short question

sterile hinge
dusky harness
#

That too yeah

neat pierBOT
#
FAQ Answer:
» Give the helpers some details
» Ask suitable questions
» Be polite
» Wait

Source

trail burrow
#

ok a good place to readup on understanding casting a command

dusky harness
#

Well

#

Uh

dusky harness
#

We have no clue what you're trying to do right now

trail burrow
#

I'm trying to check if a player has a perm to allow a sub command to be added to a list for tab completion

sharp cove
# sharp cove Hey, maybe a random question.. but has someone here experience with php/laravel?
    public static function addFavorite($user, $flight): bool{
        if (Favorite::where('flight_id', $flight->id)->where("user_email", $user->email)->first()){
            return false;
        }else{
            Favorite::updateOrInsert([
                'user_email' => $user->email,
                'flight_id' => $flight->id
            ], [
                'user_email' => $user->email,
                'flight_id' => $flight->id,
                'flight_number' => $flight->flightNumber,
                'airport_departure' => $flight->flightLegs[0]->departureInformation->airport->nameLangTranl,
                'airport_arrival' => $flight->flightLegs[0]->arrivalInformation->airport->nameLangTranl,
                'date_departure' => $flight->flightScheduleDate,
                'country_departure' => $flight->flightLegs[0]->departureInformation->airport->city->country->nameLangTranl,
                'country_arrival' => $flight->flightLegs[0]->arrivalInformation->airport->city->country->nameLangTranl,
            ]);
            return true;
        }
    }```

Whats wrong on these lines?
```php
                'airport_departure' => $flight->flightLegs[0]->departureInformation->airport->nameLangTranl,
                'airport_arrival' => $flight->flightLegs[0]->arrivalInformation->airport->nameLangTranl,```

An example of the JSON output it reads:
https://hastebin.com/share/nugacotila.php

Don't mind the code if it is that bad, bit new
dusky harness
trail burrow
sterile hinge
#

why do you have decompiled code there

trail burrow
broken elbow
#

well I'm blind as fuck

#

sorry about that

sharp cove
#

Hahaha no problem man

#

But solved the problem with chat gpt

#

didn't know that you could do that

#

awesome thing

tawny tree
#
 BossBar bossbar = null;
                        for (@NotNull Iterator<KeyedBossBar> it = Bukkit.getBossBars(); it.hasNext(); ) {
                            BossBar bossBar = it.next();
                            Bukkit.getLogger().info(bossBar.getTitle());
                            if (bossBar.getPlayers().contains(target)){
                                bossbar = bossBar;
                            }
                        }
#

Whenever i try to run it, bossbar is null, and the bossbar in the iterations title is also null

#

can someone help please

proud pebble
#

theres no need to do casting or anything like that, legit just a simple Player#hasPermission(String)

nova minnow
#
    @EventHandler(priority = EventPriority.HIGH)
    public void onInteract(PlayerInteractEvent e) {
       
        if(e.getAction() == Action.LEFT_CLICK_BLOCK && e.getClickedBlock().getType().toString().contains("SIGN")) {
            if(chestShopMethods.hasChest(e.getClickedBlock())) {
                Chest chest = (Chest) e.getClickedBlock().getRelative(0, -1, 0).getState();
                HashMap<Integer, ItemStack> returnedItems = chest.getBlockInventory().addItem(new ItemStack(signMaterial, amount));
                
            if (targetOnline != null && chainArray.contains("S")) {
                
                if (p.getInventory().containsAtLeast(new ItemStack(signMaterial), amount)) {
                    
                    for(ItemStack items : returnedItems.values()) {
                        if(returnedItems != null) {
                                p.sendMessage("Map contains Amount:" + items.getAmount());
                                p.sendMessage("Map contains Material: " + items.getType());
                                double rest = (amount - items.getAmount()) * unitPrice;
                                ItemStack removed = new ItemStack(signMaterial, amount - items.getAmount());
                                chest.getBlockInventory().addItem(removed);
                                p.getInventory().removeItem(removed);

                                p.sendMessage("Du erhälst: " + rest);
                        }
                    }
                    p.sendMessage("Hast alles verkauft!");
                    p.getInventory().removeItem(new ItemStack(signMaterial, amount));
                    chest.getBlockInventory().addItem(new ItemStack(signMaterial, amount));
                    
                } else
                p.sendMessage("Hats nicht genug zum Verkauf!");
                
            }
        }
        }
    }
}

#

I am creating a chestShop and now I want to create the sell section. So if the chest of the shop is full or can't fit the whole amount, the player sells the left free amount. However , even if the inventory of the shop is full, it still removes the items from the seller's (Player) inventory...

Here are my variables :

        String input = ChatColor.stripColor(s.getLine(0));
        String output = input.substring(input.indexOf('[') +1, input.indexOf(']'));


        Player p = e.getPlayer();
        Player targetOnline = Bukkit.getPlayer(output);
        OfflinePlayer targetOffline = Bukkit.getOfflinePlayer(output);
        Material signMaterial = Material.matchMaterial(ChatColor.stripColor(s.getLine(1)));
        String[] chain = s.getLine(3).split(" ");
        List<String> chainArray = Arrays.asList(chain);
        int amount = Integer.parseInt(s.getLine(2));



        double costs = Double.parseDouble(chainArray.get(chainArray.indexOf("S") +1));
        double unitPrice = costs / amount;
trail burrow
#

@proud pebblenot sure how to do that within the loop of tabcompletetion

proud pebble
#

only issue with that method really is the constant repeating yourself for each argument length

#

something id do is go look at another plugin's source and see how they handled multiple arguments autocompletion

trail burrow
#

what I have works, just don't filter out if player don't have perm

tepid sequoia
#

im still so glad i made my own shitty command lib

#

making it yourself is just super nice for if you want to change things later

proud pebble
#

i think alot of people will eventually make their own handling of commands eventually because the way i just described is actually quite annoying and repetitive

trail burrow
#

hence the reason I have been trying to make it work inside a loop

tepid sequoia
#

im just happy cause even though its almost definitely not the best it just works

#

and for like 2 plugins in a row it made things 10x more convenient

#

personally highly recommend making your own bad command lib

trail burrow
#

why a bad one? can I make a good one?

tepid sequoia
#

even if it's not the "optimal" way to do it

#

you can

#

but at least make a bad one

#

imo

#

if you want to make a good one go ahead though

proud pebble
#

also how do you suggest tab completion of any number?

tepid sequoia
#

wdym tab completion of any number

#

thats a lot of numbers

spiral prairie
#

Heloo I want to fake the item a player is currently holding and thus, want to send the WrapperPlayServerSetSlot packet, although I have no idea what windowID or stateID is
pls help thx

trail burrow
#

the current one I use has a tab completion for numbers

tepid sequoia
#

best i can think of is a list of numbers premade then just use that

proud pebble
tepid sequoia
#

does that even tab complete

proud pebble
#

i believe so

tepid sequoia
#

im not sure if it does i might be dumb though

proud pebble
#

ill quickly boot up a 1.19 client and send a screenshot of what i mean

tawny tree
#
 BossBar bossbar = null;
                        for (@NotNull Iterator<KeyedBossBar> it = Bukkit.getBossBars(); it.hasNext(); ) {
                            BossBar bossBar = it.next();
                            Bukkit.getLogger().info(bossBar.getTitle());
                            if (bossBar.getPlayers().contains(target)){
                                bossbar = bossBar;
                            }
                        }

Whenever i try to run it, bossbar is null, and the bossbar in the iterations title is also null
can someone help please

tepid sequoia
#

okie

proud pebble
tawny tree
#

what?

#

if it.next is empty?

tepid sequoia
tawny tree
#

i'm trying to identify a bossbar

pulsar ferry
tawny tree
#

why would it be empty at all?

tepid sequoia
#

if theres no more bossbars

tawny tree
#

cause the bossbar exists

tepid sequoia
#

but then the code in the loop wouldnt run

proud pebble
#

ok it seems like it doesnt actually autofill the number but it has the [<seconds>] thing

tawny tree
#

the for loop runs but returns empty

#

it sets bossbar to null again

#

and then the error is on the line where i try to set the bossbars progress

#

it says it's null

tepid sequoia
#

is it printing out the bossbar title

tawny tree
#

yes

#

the title is "Blood"

#

but it's printing null

tepid sequoia
#

where are you getting "target" from

tawny tree
#

it's a command

proud pebble
#

do
Bukkit.getLogger().info(bossBar.getPlayers().contains(target));

#

before the if check

tepid sequoia
#

args is a string

#

are you converting it

#

im confused

tawny tree
tepid sequoia
#

are you sure that player with that name exists then

tawny tree
tawny tree
#

cause it gets the scoreboard

#

it'd cause an error at the scoreboard if the player didn't exist

tepid sequoia
#

wha

tawny tree
#

here's the full script

#
Player target = Bukkit.getPlayer(args[0]);
                        Scoreboard scoreboard = target.getScoreboard();
                        Objective objective = scoreboard.getObjective(target.getUniqueId().toString());
                        BossBar bossbar = null;
                        for (@NotNull Iterator<KeyedBossBar> it = Bukkit.getBossBars(); it.hasNext(); ) {
                            BossBar bossBar = it.next();
                            Bukkit.getLogger().info(bossBar.getTitle());
                            Bukkit.getLogger().info(bossBar.getPlayers().contains(target));
                            if (bossBar.getPlayers().contains(target)){
                                bossbar = bossBar;
                            }
                        }
                        double number = Double.parseDouble(args[1]) / 100;
                        File userdata = new File("plugins/BloodBar/UserData/"+target.getUniqueId()+".yml");
                        FileConfiguration userdataconfig = YamlConfiguration.loadConfiguration(userdata);
                        bossbar.setProgress(number);
                        objective.getScore("Blood: "+ userdataconfig.getInt("BloodAmount")+"/"+userdataconfig.getInt("BloodMax")).resetScore();
                        objective.getScore(ChatColor.RED + "Blood: "+number+"/100");
tepid sequoia
#

ah okay

proud pebble
tawny tree
#

here's a screenshot for readbility

#

nvm i can't send

#

screenshots

proud pebble
#

if its from a command then send the whole command class?

tawny tree
tawny tree
#

and it returned null

proud pebble
tawny tree
proud pebble
tawny tree
#

the logger just said null idk

proud pebble
tawny tree
#

one sec

tawny tree
#

Cannot invoke "org.bukkit.boss.BossBar.setProgress(double)" because "bossbar" is null

dusky harness
#

it's basically just the param name

proud pebble
#

ooh interesting

high needle
#

Does MiniMessageAPI support 1.8.9 to 1.20?

dusky harness
nova minnow
#

Does the addItem Method also return a hashmap of the not added Items, when every Item could be stored inside of an Inventory?

dusky harness
#

so the map would be empty

nova minnow
#

ok, but there would be the value ItemStack(Material, 0) ?

dusky harness
#

ah, no it wouldn't

nova minnow
#

shit

dusky harness
#

why?

#

you can still identify which item it was

#

because of the key

nova minnow
#

Because I am trying to do a chestShop and I've also got the option to sell stuff. If the chest is full, the player won't be able to sell items. If there's a rest of space, then it sells the rest of the items

#
                    for (ItemStack items : returnedItems.values()) {

                        int rest = amount - items.getAmount();
                        double difference = unitPrice * rest;
                        ItemStack restItem = new ItemStack(signMaterial, rest);

                        chest.getBlockInventory().addItem(restItem);
                        p.getInventory().removeItem(restItem);

                        p.sendMessage("Du erhälst: " + difference + " für das Verkaufen von " + rest + " " + signMaterial);


                    }


                }


Variables:
Sign s = (Sign) e.getClickedBlock().getState();
        String input = ChatColor.stripColor(s.getLine(0));
        String output = input.substring(input.indexOf('[') +1, input.indexOf(']'));


        Player p = e.getPlayer();
        Player targetOnline = Bukkit.getPlayer(output);
        OfflinePlayer targetOffline = Bukkit.getOfflinePlayer(output);
        Material signMaterial = Material.matchMaterial(ChatColor.stripColor(s.getLine(1)));
        String[] chain = s.getLine(3).split(" ");
        List<String> chainArray = Arrays.asList(chain);
        int amount = Integer.parseInt(s.getLine(2));

#

That's my code

nova minnow
#

Oops, forgot some:

        double unitPrice = costs / amount;
Chest chest = (Chest) e.getClickedBlock().getRelative(0, -1, 0).getState();
                HashMap<Integer, ItemStack> returnedItems = chest.getBlockInventory().addItem(new ItemStack(signMaterial, amount));
dusky harness
#

it's either like sell none or sell all?

#

im confused

nova minnow
#

No, depends if there's space inside of the chest. If the chest is empty, you can sell everything. If it has space for a bit, it you can sell the items it can store and if there's no space, you won't be able to sell items at all

#

The chestShop does not belong to the player who wants to sell items

dusky harness
#

if I'm understanding correctly

nova minnow
#

my problem is that it won't remove the items of the player's inventory, the rest works

#

This method: p.getInventory().removeItem(restItem); should remove them from the Inventory, however it won't and I don't know why

spiral prairie
#

Du erhältst* btw

nova minnow
#

oops

spiral prairie
#

I still don't quite understand what you're trying to do

#

You want it to remove items but only those that fit into the chest?

nova minnow
#

Exactl

spiral prairie
#

Just add the returnedItems to the player inventory

nova minnow
#

It works only when he's not able to add all items into the inventory. If he's able to, so if the returned Items would be null, it won't remove the items from his inventory

dusky harness
#

null?

spiral prairie
#

Ohh I see

dusky harness
#

you should check if it's empty

minor summit
#

null collections are a sin

dusky harness
#

wait im so confused

spiral prairie
#

Just do player.getInventory().removeItem(new ItemStack(signMaterial, amount));

#

and dont add/remove the returned items

nova minnow
#

I am sorry, my brain is already rotting lol. I've been stuck for several hours now.

spiral prairie
#

try that please

nova minnow
#

but then it will remove all the items, even if the inventory is already full or not?

spiral prairie
#

oh holdon

#
var lostAmount = 0;
if (!returnedItems.isEmpty()) {
    lostAmount = returnedItems.values().stream().findFirst().get().getAmount();
}
player.getInventory().removeItem(new ItemStack(signMaterial, amount - lostAmount));```
#

@nova minnow

nova minnow
#

ok, yeah I am dumb. Thank you 😄

spiral prairie
#

Should work xD

#

And we should probably go to sleep pepela

nova minnow
#

I've finished school, so I've basically got holidays now fingerguns

spiral prairie
#

oh come on

#

which state?

nova minnow
#

Hessen

#

I had my abitur exams. so yeah... I am just waiting

spiral prairie
#

Did you do your Abitur or

#

ahh

#

yes

nova minnow
#

yep

spiral prairie
#

well congrats!

nova minnow
#

Thank you 😄

high needle
#

What do you guys recommend using minimessageapi or code support for hexolors,gradients and &colors

spiral prairie
#

minimessage

#

fuck & colors (you can still implement them but why)

hazy nimbus
#

I use codes for the basic things (like bold, or the original colors) and minimessage for the more advanced (hex, gradients etc.)

spiral prairie
#

why

hazy nimbus
#

it's shorter

spiral prairie
#

&lbold &agreen

high needle
#

I cant get it to work on lower versions.

hazy nimbus
#

define lower versions

high needle
#

Getting an error when i'm starting my server

hazy nimbus
spiral prairie
#

and send that error

high needle
#

I can't send files in there 😦

spiral prairie
hazy nimbus
#

yeah that's dumb

spiral prairie
high needle
spiral prairie
#

thats interesting

#

might want to ask kyori support

high needle
hazy nimbus
#

you're probably using a new version of minimessage that is not compatible with the old version of adventure in 1.16

dusky harness
hazy nimbus
dusky harness
#

depend on 1.16.4 api

dusky harness
hazy nimbus
#

They're very salty about older versions

#

like

spiral prairie
#

you just gotta salt back then it works

hazy nimbus
#

really salty

dusky harness
#

and shade adventure & minimessage etc

hazy nimbus
#

don't

spiral prairie
#

yeah just shade that and send via bungee components

dusky harness
hazy nimbus
#

adventure is already shaded inside paper

dusky harness
#

minimessage doesn't support that version

spiral prairie
#

bro never heard of spigot

dusky harness
#

that's why they're getting that error

hazy nimbus
#

well you need to use an older version of minimessage

high needle
#

So remove AdventrueAPI and just use Minimessage?

dusky harness
dusky harness
#

im 99% sure

#

I ran into this issue before and I checked the versions

hazy nimbus
#

shading a new version of adventure into an old server would probably break more things than it would fix

spiral prairie
#

if you have shaded stuff you wont need to depend on different versions

hazy nimbus
#

oh lol

spiral prairie
high needle
#

So remove AdventrueAPI and just use Minimessage?
And then i'm good to go I gues?

dusky harness
hazy nimbus
hazy nimbus
#

which kinda sucks tbh

dusky harness
#

you gotta choose one

#

minimessage or those

#

can't use both

high needle
#

I paid a dev to make the plugin XD

dusky harness
#

oh

spiral prairie
#

then ask them bruh

high needle
#

But i like to know things about it.

dusky harness
#

wait i just read your second log

#

you can't run this plugin in 1.8

#

unless you shade & relocate adventure and set (build tool) api version to 1.8

high needle
#

Ah okay! Yea i paid him like 90$ to make an trail plugin.

dusky harness
#

o

dusky harness
#

it's a simple fix

#

welll

spiral prairie
#

yea

dusky harness
#

if he's already using 1.9+ api

#

then you should've mentioned to him that you wanted 1.8 in the beginning

#

but if not

#

then it's a simple fix

spiral prairie
#

for whatever reason you want to support all versions

hazy nimbus
spiral prairie
#

shade it

#

oh

dusky harness
#

maybe not simple fix but not too difficult fix either
(kotlin = simple fix 😌)

spiral prairie
#

well

high needle
#

And Skyblocks support 1.12

spiral prairie
#

ohhhh

dusky harness
spiral prairie
#

^

hazy nimbus
#

fr supporting 1.8 in 2023 is cringe

high needle
dusky harness
dusky harness
high needle
#

1.8 to 1.20 Support.

dusky harness
#

then he should do that

high needle
#

Idk the best versions anymore for Skyblock, Factions, Prisons ect

dusky harness
#

since now you're paying for a plugin that doesn't even do what you asked

hazy nimbus
# dusky harness yeah okay maybe not simple, but time-consuming fix*

When I think about it, you could:
Serialize minimessage string with the shaded serializer into a shaded (relocated) component
Deserialize it back to legacy stirng with the shaded (relocated) deserializer
And then serialize the string back to the native component via the native serializer

high needle
#

It's via Fiverr so i'm safe if it's not what i ask for he doenst get paid and i get my money back

hazy nimbus
dusky harness
hazy nimbus
dusky harness
high needle
#

And it's basicly an copy from PlayerParticles.
I just want to be able to create the Particles in a config.yml
And people should be open the GUI en select an trail

dusky harness
#

I haven't used fiverr so idk how it all works

dusky harness
#

💀

#

I mean besides all the click/hover/etc I guess it'll work... 💀

hazy nimbus
#

I guess it's still better than editing all of those .sendMessage calls

high needle
#

And it's basicly an copy from PlayerParticles.
I just want to be able to create the Particles in a config.yml
And people should be open the GUI en select an trail

How much do you guys normally charge for this?

hazy nimbus
#

I don't do plugin development for money

#

9/10times you get scammed or paid a pittance

dusky harness
#

I just stick to the same person

hazy nimbus
#

yup

#

that works

dusky harness
#

I've only gotten scammed $2 i think

#

:)))))

hazy nimbus
#

yeah, you need to have upfront payments

high needle
#

True! I just want to know i'm not getting over charged 😛

hazy nimbus
dusky harness
hazy nimbus
dusky harness
#

first of all this kind of mc dev is different

hazy nimbus
dusky harness
#

50/hr is 1000% overcharging for this kind of stuff

#

imo

#

unless ur rich

hazy nimbus
#

Is MC plugin development easier than developing some website's backend?

#

I wouldn't say so.

high needle
dusky harness
# hazy nimbus Why?

i mean sure, you can charge it, but if ppl have the ability to search, you're getting no customers

hazy nimbus
#

that's true

hazy nimbus
#

Well, if you think so

#

However, working with backend frameworks seemed way less bullshity than working with bukkit api

leaden sinew
#

Not really

dusky harness
#

which is a lot compared to how much i charge

leaden sinew
#

You don’t have to worry at all about networking with plugins

hazy nimbus
#

Not the sysadmin part

high needle
leaden sinew
hazy nimbus
leaden sinew
#

All the programming for it and figuring out how to implement it

hazy nimbus
#

._.

leaden sinew
#

The Bukkit API also makes interacting with Minecraft pretty easy

dusky harness
#

in the end, it comes down to "supply and demand" or whatever it is

hazy nimbus
#

That is indeed true

leaden sinew
#

That too

dusky harness
#

if u can find customers with 50/hr and they are happy, then thats a good price

hazy nimbus
#

Yup

#

Most bukkit developers (including me) are students

dusky harness
#

yo same!!

hazy nimbus
#

People who have a 50$/hr work won't do bukkit plugins for 20$/hr

pulsar ferry
#

Advanced fast high qulity experienced plus ultra +++

pulsar ferry
worn jasper
dusky harness
#

varies ¯_(ツ)_/¯

worn jasper
#

average per hour

#

cause I charge like 20/h and I am not that experienced lol

#

you shouldn't devalue yourself tbh

dusky harness
#

idk
i dont go based off hourly because like for ex, if i spend an hour debugging an issue that takes a couple lines to fix, that's $20 for a couple lines

#

¯_(ツ)_/¯

worn jasper
#

still time you spent.

dusky harness
#

Idk

#

uh

worn jasper
#

and tbf I usually don't count the testing, etc.

#

only coding tracked time

dusky harness
#

like if you made a /baltop gui, how much would you charge for that
the features being previous/next pages and each item would be player heads - nothing too special

worn jasper
#

For instance, I work for a server, like 15 hours per month, and get paid 375$ per month

dusky harness
#

👀

worn jasper
#

actually more than 20 per hour lol

worn jasper
#

frameworks already have paginated guis

#

lol

dusky harness
#

ye

#

triumph gui

#

😌

worn jasper
#

exactly

#

I would only do the base, add proper configurations, async sorting if there is no specific api provided and voila

#

shouldn't be more than an hour

dusky harness
#

ah yeah i had to do async something

#

its been a while so i dont remember the details

worn jasper
#

happens

#

lol

dusky harness
#

¯_(ツ)_/¯

#

btw

#

have u tried non mc stuff

#

just wondering

worn jasper
#

website and stuff?

dusky harness
#

yeah

#

regular desktop apps, etc

worn jasper
#

not really, hard to find jobs on those areas, my portfolio isn't really the best, which is why I will be working in several projects this summer, both in and out of minecraft.

hazy nimbus
worn jasper
hazy nimbus
#

I always tell myself "Yeah, this is going to be done in a hour" Then I find out how short can an hour be

#

Probably a skill issue tho

worn jasper
#

in bigger projects, yeah, I have missed estimates several times

hazy nimbus
#

I usually multiply my ETA by four before I tell it to someone else

#

But yeah, this one should be simple

worn jasper
#

x4 seems too much

#

if the project is already over 15 hours

#

4x would be 60h lol

#

that's quite a massive difference

trail burrow
#

in this public Map<List<String>, AutorankCommand> getRegisteredCommands() { return this.registeredCommands; } is the getRegisteredCommands part of Spigot or?

dusky harness
#

so it can't be part of spigot

trail burrow
#

ok, just trying to understand this command manager, SO I can make changes

trail burrow
#

is there a way to add all commands to a list?

dusky harness
#

¯_(ツ)_/¯

trail burrow
#

thats to easy

dusky harness
#

i mean idk what commands u have

#

so

trail burrow
#
            cmdarray.addAll(commands);``` not quite liking that
dusky harness
#

uhhhhh

#

you can do new ArrayList<>(commands)

trail burrow
#

it don't seem to give me the results I'm looking for, guess I will keep reading

dusky harness
#

uh

minor summit
#

lol

sonic nebula
#

also 375$ for 15 hours

#

damn i need to apply as a dev somewhere

dusky harness
sonic nebula
#

using vault as dependecy?

#

or writing on economy

#

but lets say we have existing economy system

dusky harness
#

vault

sonic nebula
#

just a baltop with player heads

#

idk 10$

dusky harness
#

ok

sonic nebula
#

i can go even lower but nah i need money badly

#

how about u?

dusky harness
#

idk i did it before but i dont remember what i charged

sonic nebula
#

lets say now + -

stuck hearth
#

$10 💀

stuck hearth
worn jasper
worn jasper
sonic nebula
sonic nebula
#

the idiots here that do xy problem or hey can u code for me for free? both of those cases should never be asked here

#

and telling learn java first or so (at least java basics) and they will say no im good at java and will send us AI Generated code

worn jasper
worn jasper
sonic nebula
#

i also didnt ask for your opinion

worn jasper
#

"my attitude is fine"

sonic nebula
#

so please if u go that way rude way

worn jasper
#

you are a floating joke in this server

sonic nebula
#

and u r a pixels guy

worn jasper
#

?

sonic nebula
#

also not a joke im way better then most devs here

#

in many ways

worn jasper
#

😂

sonic nebula
#

why u laugh its a fact

worn jasper
#

😂

sonic nebula
#

most of people here are total dogshit

worn jasper
#

😂

sonic nebula
#

🐒

worn jasper
#

yes you are

sonic nebula
#

bttw why ur profile picture so blurry ?

#

if we go already offtopic

worn jasper
#

¯_(ツ)_/¯

sonic nebula
#

no no really why?

river solstice
sonic nebula
#

but that guy put his blurry ass everywhere

leaden sinew
leaden plume
#

@sonic nebula do I need to mute you

#

Be respectful

vestal talon
#

I'm trying to load a HashMap file like HashMap<String, Integer> from the FileConfiguration that I structured like

users:
  Me:
    food:
      Apple: 7
      Banana: 4
      Watermellon: 2

I tried to get them by List<String> and then iterate through them and put them into a new HashMap (and place user's food and amount) but I having hard time to figure a clean way to do that

hazy nimbus
#

I haven't used bukkit's configuration for like 2 years now, but there should be something like ConfigurationSection#getKeys

#

So get the keys and their values and parse them with Integer.parseInt

vestal talon
#

and why you not using configurationFile ?

hazy nimbus
#

I prefer configurate with HOCON

hazy nimbus
astral escarp
#

Hello

vestal talon
sonic nebula
#

u also can write custom file reader/writer cloud be easier to work with then bukkit snakeyaml shit which is full of problems anyway

vestal talon
#

But how?

for (String g : this.dataBase.getConfigurationSection("users." + u + ".food").getKeys(false)) {
}
#

how can I irritate through key value?

hazy nimbus
#

Have you ever used Java?

#

Also using YAML as a database 💀

worn jasper
#

essentials does it xd

#

its not that bad if done right

#

but db still better yeah

vestal talon
#

I'm trying to have Entry<String, Intenger> and irritate through entrySet but I can't figure the right way

hazy nimbus
#

oh you mean getting the values?

#

Just simply ConfigurationSection#get

vestal talon
hazy nimbus
#

huh

#

It's literally what you sent

vestal talon
#

nah

#

i can't figure out how to get the value

hazy nimbus
#

???

#

Moment

vestal talon
#

Oh i figured out

#

thanks

hazy nimbus
#
        var config = getConfig();
        // get the section
        var section = config.getConfigurationSection("users.user.food");
        // Iterate over the keys and values
        for (Map.Entry<String, Object> entry : section.getValues(false).entrySet()) {
            var key = entry.getKey(); //Apple, Banana or smth
            var value = entry.getValue(); // 1, 2 or smth
            if (value instanceof Integer integer) {
                // Do integer stuff
            }
        }
#

Here's one way

#

alternatively you could iterate over the keys and then just get their values

hoary scarab
#

Is there a way to asynchronously create EntityPlayer in newer versions?

sterile hinge
#

to achieve what?

#

also creating = adding to the world?

hoary scarab
#

Well I would like to keep all my create and spawn code together for my NPC's. I could create sync then spawn async but wanna know before I go down that route.

hoary scarab
sterile hinge
#

well then it's not safe to run it async

hoary scarab
sterile hinge
#

I don't know, but generally doing anything about entities async is just a guarantee for issues of some sort

hoary scarab
worn jasper
#

uh how would you check if a (paper) plugin was reloaded via /reload or reloaders like plugman?

hoary scarab
#

... actually I think you can check what class ran a method

worn jasper
#

how does viaversion or protcollib check it then?

#

couldn't find anything

hoary scarab
#

I think you can use a method from thread to see which class called the method. I'd have to dig for the code though.

worn jasper
#

what about plugman reloading?

dense drift
#

idk

#

does it detect plugman reloads?

worn jasper
#

to my knowledge no

#

hence why I am asking

dense drift
#

ahh

stuck hearth
# sonic nebula u also?

I don't know what "also" is meant to imply, but yes I also value my own time, and so should you, as much of a novice as you are, $10 is still shit.

minor summit
hoary scarab
#

@worn jasper
String calledBy = Thread.currentThread().getStackTrace()[2].getClassName(); Is how I check what called the method in a few cases.

minor summit
#

StackWalker.getInstance(StackWalker.Option.RETAIN_CLASS_REFERENCE).getCallerClass()
is way more performance-friendly

hoary scarab
#

I didn't check what was posted lol
Been digging for that variable for a bit .

dusky harness
#

like keep going "back in time"

minor summit
#

you can use the stackwalker for that yes

#

it evaluates the stack lazily

#

streams stuff

dusky harness
#

ohhhh i see

worn jasper
#

onDisable?

minor summit
#

you would use that to figure out what class called the current method

boreal drift
#

hey, if I want to check if the server supports 1.20 with xmaterial
XMaterial.supports(version), the version parameter should be just 20 right?
or how does it work? it is suposed to be an int

dense drift
#
    /**
     * Checks if the specified version is the same version or higher than the current server version.
     *
     * @param version the major version to be checked. "1." is ignored. E.g. 1.12 = 12 | 1.9 = 9
     * @return true of the version is equal or higher than the current version.
     * @since 2.0.0
     */
    public static boolean supports(int version) {
        return Data.VERSION >= version;
    }```
boreal drift
#

oh, my bad xd

#

thanks

dense drift
#

so yeah, just 20

dusky harness
#

the day minecraft 2.0 comes out

dense drift
worn jasper
#

imagine it comes out

#

full rewrite

#

java 21

#

would simply be pog

sterile hinge
#

full rewrite wouldn't be "pog" for anyone

dusky harness
#

what would have to happen to define 2.0.0

#

it has no api so it can't follow semver

#

🥲

worn jasper
#

its code sucks and is old af.

dense drift
icy shadow
#

eg redstone

sterile hinge
#

it would be a W just like the Netscape rewrite

dusky harness
#

i mean mc kinda already got a rewrite

#

it's bedrock edition 🙃

fading stag
#

Is there any way to run a async task using Bungee API

minor summit
#

or just use the bungee scheduler?

dusky harness
#

oh

#

ok

#

ignore what i said

minor summit
#

i mean you can use your own executorservice too

#

lol

dusky harness
#

oh

#

um

fading stag
minor summit
#

there is no "sync" in bungee

#

there is no tick thread

#

something is sync or async with respect to some thread
what are you trying to do exactly?

fading stag
minor summit
#

yeah realistically you can just dispatch them from any thread, since there is no tick thread you have to run that in sync with

fading stag
river solstice
#

🥴

dusky harness
#

I haven't used bungee in a long time but for ex if you run a 1 second operation on player join, then the player will have to wait 1 more second to join

minor summit
#

again, sync/async with respect to some other thread

#

you don't wanna be doing blocking tasks in sync with the netty threads, for example

#

I would be surprised if bungee didn't jump to its own thread to process packets and dispatch events
but, at the same time, I wouldn't

torpid raft
#

when in doubt, static cachedthreadpool 😌

fading stag
#

Doesn't bungee have SQLite drivers shaded? I get No suitable driver found for error

dense drift
#

That would be a no fingerguns_down

fading stag
river solstice
#

🥴

dense drift
#

You shade the driver by yourself

sonic nebula
small arrow
grim oasis
#

seems you're pointing to your class incorrectly in your plugin.yml

#

can you send the class

small arrow
grim oasis
#

and the class?

small arrow
#

there is only one class so far and it's called MobLag

grim oasis
#

Yes, you sent your plugin.yml

small arrow
#

oh you wanted me to send the class I'm so sorry

grim oasis
#

np

small arrow
grim oasis
#

open your .jar maybe with winrar or something, is the class in there?

small arrow
#

yup

dusky harness
#

change ur plugin.yml to MobLag

grim oasis
#

ah, missed that

#

the L

small arrow
#

ty

dusky harness
#

lol

#

np

small arrow
#

such a stupid thing to overlook lol

grim oasis
#

often is

small arrow
#

regardless thank you 😄

grim oasis
#

the missing } or ;

#

lol

small arrow
#

fr

grim oasis
#

yesterday I had success_commmands instead of success_commands

#

extra m

#

ofc

small arrow
#

famous typos

grim oasis
#

lovely stuff 😂

small arrow
#

and you just sit there mindlessly for god knows how long debugging the dumbest overlook ever...

grim oasis
#

🙃

dense drift
dusky harness
#

I'm gonna go crazy
in gradle, I have ```kt
plugins {
// stuff
id("io.github.dkim19375.dkim-gradle") version "1.3.4"
}
// stuff


But if I change that to version `1.3.9` (which is in mavenLocal()), it doesn't work!
This is my settings.gradle.kts: ```kt
pluginManagement {
    repositories {
        mavenLocal()
        gradlePluginPortal()
    }
}

rootProject.name = "DkimGradle"
```and the error: ```kt
A problem occurred configuring root project 'DkimGradle'.
> Could not resolve all files for configuration ':classpath'.
   > Could not find me.dkim19375:DkimGradle:1.3.9.
     Searched in the following locations:
       - file:/C:/Users/dkim19375/.m2/repository/me/dkim19375/DkimGradle/1.3.9/DkimGradle-1.3.9.pom
       - https://plugins.gradle.org/m2/me/dkim19375/DkimGradle/1.3.9/DkimGradle-1.3.9.pom
     Required by:
         project : > io.github.dkim19375.dkim-gradle:io.github.dkim19375.dkim-gradle.gradle.plugin:1.3.9

Possible solution:
 - Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html

Entire build.gradle.kts: https://pastes.dev/7vEnhpIIWr (latest not pushed to github)
Rest of the files: https://github.com/dkim19375/DkimGradle

where's it getting me.dkim19375.DkimGradle from?

#

ok I had to add ```kt
pluginManagement {
resolutionStrategy {
eachPlugin {
if (requested.id.name == "dkim-gradle") {
useModule("${requested.id.namespace}:${requested.id.name}:${requested.version}")
}
}
}
}

#

but why?

icy shadow
#

idk

dusky harness
#

and if I publish, then it also goes to io.github.dkim19375:dkim-gradle, but publishes to me.dkim19375:DkimGradle as well :(((((((((

tawny tree
leaden sinew
tawny tree
#

i know i have 2 different variables

dusky harness
#

like wherever the debug or errors are

tawny tree
#

it says the bossbar is null

dusky harness
tawny tree
#

it just says bossbar is null

dusky harness
#

where?

tawny tree
#

it says bossbar is null

dusky harness
#

what is "it"?

minor summit
#

my crystal ball

dusky harness
#

also I didn't really look too closely but a couple things

  • name bossbar to like playerBossBar just to prevent any errors
  • don't use contains(target), because each player might have multiple Player instances - instead, you can either use streams or loop through and compare the UUIDs
tawny tree
dusky harness
#

what's the error?

shell moon
#

I'll ask here maybe someone knows:
How to get player armor points in spigot 1.8.8? (No, cannot use Player#getAttribute as thats 1.9+)
I know i'll probable need nms or something, someone?

sonic nebula
sonic nebula
#

just write it bruh

#

no reason to make things more complicated

#

make an enum of amount of how much each piece is worth

dusky harness
dusky harness
# sonic nebula just write it bruh

they're wondering if there's an already-existing method/attribute/variable in 1.8 so that they don't have to rewrite it (also to prevent rewriting in the future)

#

that's the whole point of them asking - they likely already know they can just write it, but want to know if there's a built-in way too

stuck hearth
worn jasper
#

Tony is our god, he knows everything 😮

sonic nebula
#

and theree are only 16 armor parts in game

#

so ;l

dusky harness
#

so?

sonic nebula
#

so time > to trash?

dusky harness
#

you can just say something like "I'd recommend just making an enum of all of the armor pieces because I don't think there is a simple way"

sonic nebula
dusky harness
#

not "we wont help u"

sonic nebula
dusky harness
#

it's not helping anyone any more vs talking like how I suggested

sonic nebula
#

i always help when deserved dkim

dusky harness
#

this is HelpChat; if you feel they don't deserve it, simply say nothing

sonic nebula
#

when people ask correctly and nicely and provoide info and dont say its just say null

dusky harness
#

it's not DecideWhoShouldGetHelpedChat

sonic nebula
#

correct

dusky harness
#

if you think they don't "deserve" it, help them deserve it

sonic nebula
#

im wrong ur right but let us have free speech here please.

#

u asked him code or stacktrace he just man its null

sonic nebula
#

his code is nuclear power plant schematic or something we wont see the stacktrace or the code how should we help him

dusky harness
sonic nebula
#

i help other saving time with the monkey

dusky harness
#

if you don't want to help with these questions, simply say nothing

#

a lot of ppl who sees questions here do not respond

#

because they don't know how to help with the issue

#

if you don't know how to help with it, just don't respond

sonic nebula
#

u r right but its too hard to watch how someone beat old lady without stop him

#

u probably suggest to watch

#

i dont think so

dusky harness
#

"beating old lady"?

#

what

sonic nebula
#

yeah how you can tell a maniac to stop

dusky harness
#

if you don't know, don't say anything

sonic nebula
#

u cant they wont understand

dusky harness
#

then don't say anything

#

leave it to others

sonic nebula
#

dont know what we asked him for code or stacktrace 3 times

dusky harness
#

then ask again 🤷

sonic nebula
#

stop stop the old lady already bleeds to death

dusky harness
#

please just stop

#

you stop

sonic nebula
#

take action at right time.

#

please lets keep this chat for devs or who try to be and not for AI code which gives them nulls.

dusky harness
#

that's not AI code

sonic nebula
#

probably how can u null a bossbar

#

🤣

dusky harness
#

"we wont help u" does not help

sonic nebula
#

its legit begin applied to player

#

he probably did Player player;

#

that poop code printer AI

dusky harness
sonic nebula
#

u r right u won im out.

leaden sinew
#

Tony I haven't seen any of your code, how do we know you aren't an AI?

stuck hearth
stuck hearth
tired olive
stuck hearth
#

Doesn't have to be, hence the null?

tired olive
#

well it does have to be because you never assign anything to it 🤓

stuck hearth
#

I don't have the mental capacity to explain to you that you do not need to initialize a variable, it will just be null.

dusky harness
stuck hearth
#

I stg stop pinging me.

dusky harness
#

ok

stuck hearth
#

Not this guild anymore holy shit

tired olive
#

oh i didnt mean to ping u

dusky harness
tired olive
#

oh

hazy nimbus
#

I love that every support request eventually turns into a 100messages long argument with Tony

leaden sinew
#

It’s always the people who know the least that argue the most

hazy nimbus
#

The beating an old lady part got me laughing tho

#

Like wtf

dense drift
#

@sonic nebula stop being toxic and deviate from the dubject. Last warning.

tawny tree
hazy nimbus
#

What appeared in the console?

#

What's the stacktrace?

tawny tree
hazy nimbus
#

what's the stacktrace?

tawny tree
tawny tree
hazy nimbus
#

send the whole logs

neat pierBOT
hazy nimbus
#

In this code:

                        BossBar bossbar = null;
                        for (@NotNull Iterator<KeyedBossBar> it = Bukkit.getBossBars(); it.hasNext(); ) {
                            BossBar bossBar = it.next();
                            Bukkit.getLogger().info(bossBar.getTitle());
                            Bukkit.getLogger().info(String.valueOf(bossBar.getPlayers().contains(target)));
                            if (bossBar.getPlayers().contains(target)){
                                bossbar = bossBar;
                            }
                        }
#

The bossbar remains null

#

you need to find out why it hasn't been assigned

tawny tree
#

I really can't think of a way

#

the bossbar exists

hazy nimbus
#

I have a few questions

#

why are you using this sussy iterator loop?

tawny tree
#

i tried to use a for loop the same way i did for looping through players

hazy nimbus
#

you know you can just do

for (KeyedBossBar bossBar : Bukkit.getBossBars())
tawny tree
#

and my ide suggested this instead

tawny tree
#

i can't believe i sparked all of this through sheer stupidity

hazy nimbus
#

My bad, apparently getBossBars really only returns an iterator

#

just peak bukkit api stupidity ig

tawny tree
#

thank god

#

i thought my dumbass forgot to specify the type

hazy nimbus
#

Anyways, back to the original topic

hazy nimbus
#

what are you even trying to do?

tawny tree
tawny tree
#

so i thought to check every bossbar and check if the target player exists in that bossbar

hazy nimbus
#

Honestly I've never worked with bossbars before in Bukkit, so you may want to wait for someone who did. Anyways, I suggest you attach the debugger and add a breakpoint on the if condition

tawny tree
hazy nimbus
sterile hinge
sonic nebula
#

How do people turn Chinese chars into image from texture pack?

#

I prefer to not decompile an resource .

hazy nimbus
#

on this topic

#

is there any unified guide for all resource pack hacks?

sonic nebula
hazy nimbus
#

Like custom blocks, entities, guis, items, armors etc.

upper jasper
hazy nimbus
#

oh lol

sonic nebula
upper jasper
#

yeah those 2 are the best

sonic nebula
#

And writing custom hit box

hazy nimbus
#

thanks, will bookmark them

upper jasper
#

Using modelengine is generally the best (and most sane) way to add custom animated entities

pulsar ferry
hazy nimbus
#

thanks to that, the demo block can be removed in a few minutes

upper jasper
#

He doesn't care iirc

hazy nimbus
#

based

upper jasper
hazy nimbus
#

that's true

sonic nebula
#

Kinda sucks I think the custom armors won’t work in Dino versions

hazy nimbus
#

wtf are dino versions?

sonic nebula
#

According to what the guide says

upper jasper
#

Custom armor is 1.17+ yeah

sonic nebula
#

Below 1.7

hazy nimbus
#

below 1.7?

sonic nebula
#

But the text magic will work 🙂

hazy nimbus
upper jasper
sonic nebula
#

Nah 1.7.10

#

It’s 🦖

hazy nimbus
#

well honestly there's no reason to use anything older than the latest version unless you still didn't cope with the new combat mechanics

sonic nebula
#

It’s not about combat mechanics

hazy nimbus
#

Or you didn't cope with the horrible performance of 1.13+

upper jasper
#

Any good server finds their own way around the combat mechanics

sonic nebula
#

The combat mechanics are easy to rewrite

hazy nimbus
#

honestly the old combat mechanics was kinda boring

#

it just depended on who clicked faster

sonic nebula
#

^

#

False

#

It was limited anyway

#

Because hit delay that is applied to entity once it gets hitted

#

But old mechanics were shit and boring it’s true

prisma briar
#

So I have a method on my plugin to check all invalid generator, this is the code https://paste.helpch.at/ixoxubanov.typescript and I'm looking the more efficient way to approach this, currently this method is running on sync task once on plugin start and it has around 15k+ active generators so it would take long time to check all invalid generator and can possibly crash the server 💀.

dusky harness
prisma briar
dusky harness
#

but I'd recommend splitting it up then

#

into different ticks

#

ex 200 generators per tick

#

or 150 generators per tick - 5 total seconds to run

prisma briar
dusky harness
#

or do you intentionally have it on only once for a specific reason

dusky harness
prisma briar
#

That's a great idea honestly, how can I achieve something like that?

dusky harness
#

and then runTaskTimer

#

and then once it's finished with all the generators, you can cancel()

dusky harness
prisma briar
#

The plugin is MineGens.

dusky harness
prisma briar
dusky harness
#

ohhhhh

#

ohhh that's what you meant

#

I thought you meant the spark profiler is only started once

prisma briar
#

Yeah that's what I meant, so the spark profiler doesn't have the details anymore.

dusky harness
#

next time you restart the server 🥲
can you add like an /invalidate command? (for debug)
You could also test out the BukkitRunnable method

prisma briar
#

I don't have a test server right now but I tested it on my localhost, and it keeps crashing my thing so I need to delete the data

dusky harness
#

alr

prisma briar
#

I'll try the splitting up thingy.

worthy basalt
#

hello is there a way to execute command like a datapack?

#

Is there something like DatapackCommandSender?

lyric gyro
#

I have a plugin which stores stats to a database, the onPlayerJoin event is fine, it checks if the data exists if it doesnt then it inserts it otherwise it updates it, but my onPlayerQuit doesn't work, what am I doing wrong

    public void onPlayerJoin(PlayerJoinEvent event) {
        String playerName = event.getPlayer().getName();
        PlayerData playerData = getPlayerDataFromDatabase(playerName);
        double balance = VaultAPI.getEconomy().getBalance(event.getPlayer());

        if (playerData != null) {
            playerData.setBalance(balance);
            updatePlayerDataInDatabase(playerData);
        } else {
            playerData = new PlayerData(playerName, balance);
            playerDataMap.put(playerName, playerData);
            insertPlayerDataIntoDatabase(playerData);
        }
    }

    @EventHandler
    public void onPlayerQuit(PlayerQuitEvent event) {
        String playerName = event.getPlayer().getName();
        PlayerData playerData = playerDataMap.get(playerName);

        if (playerData != null) {
            Economy economy = VaultAPI.getEconomy();
            if (economy != null) {
                double balance = economy.getBalance(event.getPlayer());
                playerData.setBalance(balance);
                updatePlayerDataInDatabase(playerData);
                playerDataMap.remove(playerName);
            } else {
                Bukkit.getLogger().warning("Economy is null");
            }
        }
    }```
dense drift
#

You don't add the data in the map if it exists

        if (playerData != null) {
            playerData.setBalance(balance);
            updatePlayerDataInDatabase(playerData);
        }```
compact eagle
#

When I had the plugin working in game version 1.20.1, the console gave me the following warning.
My server core is paper-1.20.1-63.

[02:20:08 WARN]: java.lang.ClassNotFoundException: net.minecraft.server.v1_20_R1.MinecraftServer
[02:20:08 WARN]: at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:445)
[02:20:08 WARN]: at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:588)
[02:20:08 WARN]: at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
[02:20:08 WARN]: at java.base/java.lang.Class.forName0(Native Method)
[02:20:08 WARN]: at java.base/java.lang.Class.forName(Class.java:391)
[02:20:08 WARN]: at java.base/java.lang.Class.forName(Class.java:382)
[02:20:08 WARN]: at com.extendedclip.papi.expansion.server.ServerExpansion.<init>(ServerExpansion.java:61)
[02:20:08 WARN]: at java.base/jdk.internal.reflect.DirectConstructorHandleAccessor.newInstance(DirectConstructorHandleAccessor.java:67)
[02:20:08 WARN]: at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500)
[02:20:08 WARN]: at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:484)
[02:20:08 WARN]: at [占位符]PlaceholderAPI-2.11.3.jar//me.clip.placeholderapi.expansion.manager.LocalExpansionManager.createExpansionInstance(LocalExpansionManager.java:443)
[02:20:08 WARN]: at [占位符]PlaceholderAPI-2.11.3.jar//me.clip.placeholderapi.expansion.manager.LocalExpansionManager.register(LocalExpansionManager.java:173)
[02:20:08 WARN]: at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
[02:20:08 WARN]: at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179)
[02:20:08 WARN]: at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1625)

#

[02:20:08 WARN]: at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
[02:20:08 WARN]: at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
[02:20:08 WARN]: at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921)
[02:20:08 WARN]: at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
[02:20:08 WARN]: at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682)
[02:20:08 WARN]: at [占位符]PlaceholderAPI-2.11.3.jar//me.clip.placeholderapi.expansion.manager.LocalExpansionManager.lambda$registerAll$4(LocalExpansionManager.java:356)
[02:20:08 WARN]: at [占位符]PlaceholderAPI-2.11.3.jar//me.clip.placeholderapi.util.Futures.lambda$null$0(Futures.java:46)
[02:20:08 WARN]: at org.bukkit.craftbukkit.v1_20_R1.scheduler.CraftTask.run(CraftTask.java:101)
[02:20:08 WARN]: at org.bukkit.craftbukkit.v1_20_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:480)
[02:20:08 WARN]: at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:1112)
[02:20:08 WARN]: at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:318)
[02:20:08 WARN]: at java.base/java.lang.Thread.run(Thread.java:1623)

dusky harness
#

How can I fix the /\u2501 character from appearing as a question mark (in console/terminal, not MC-related)?
I tried both kt configureEach { if (this is JavaCompile) { options.encoding = "UTF-8" } } and kt withType<JavaCompile> { options.encoding = "UTF-8" } and put properties org.gradle.jvmargs=-Dfile.encoding=UTF-8 in the gradle.properties, and all my IJ stuff is set to UTF-8, but it's still showing as a question mark :/

#

trying to make a progress bar

proud pebble
#

nms hasnt included the version in the paths for quite along time

warm steppe
dusky harness
#

which opens in the same terminal (I think? Same window at least)

#

And it also doesn't work with java -jar Program.jar

dense drift
#

what happens if you add -Dfile.encoding=UTF-8?

dusky harness
#

java -Dfile.encoding=UTF-8 -jar Program.jar?

#

still not working :/

minor summit
#

nothing to do with your program

#

all to do with the terminal emulator

dusky harness
#

I'll try building a jar and running java -jar
edit: so those work, but not the original line from the original message

minor summit
#

err, sorry, not terminal emulator

#

the shell

dusky harness
#

when using gradle run

#

but it works when pressing the play button for some reason

minor summit
#

no idea

dusky harness
dusky harness
#

Anyone know how to disable the coroutine debugger or smth?
In my jar, I have a _COROUTINE folder, with the files _BOUNDARY.class, _CREATION.class, ArtificialStackFrames.class, and CoroutineDebuggingKt.class
It seems to be coming from org.jetbrains.kotlinx:kotlinx-coroutines-core, but I cannot find any information about those files (do I relocate them? are they important at all? Just seems like debugging stuff...)

worthy basalt
#

Guys how do I execute vanilla commands without outputing to console and broadcasted to ops using bukkit api?

signal grove
#

Anyone understand what the problem is? It should just be a basic config thing, but maybe I'm missing something

#
 public static void rewardPlayer(Player killer, Entity victim, Economy economy)
    {
        killRewardsConfig = Lithium.getInstance().getConfig().getConfigurationSection("kill-rewards");
        String targetType = victim.getType().getName();

        if(!killRewardsConfig.contains("rewards"))
        {
            Bukkit.getConsoleSender().sendMessage("kill-rewards.rewards : null");
            return;
        }

        if(!killRewardsConfig.getConfigurationSection("rewards").contains(targetType)) // ERROR HERE
        {
            Bukkit.getConsoleSender().sendMessage("kill-rewards.rewards." + targetType + " : null");
            return;
        }
...```
#
Caused by: java.lang.IllegalArgumentException: Path cannot be null
        at org.apache.commons.lang.Validate.notNull(Validate.java:192) ~[patched_1.8.8.jar:git-PandaSpigot-110]
        at org.bukkit.configuration.MemorySection.getDefault(MemorySection.java:718) ~[patched_1.8.8.jar:git-PandaSpigot-110]
        at org.bukkit.configuration.MemorySection.get(MemorySection.java:198) ~[patched_1.8.8.jar:git-PandaSpigot-110]
        at org.bukkit.configuration.MemorySection.contains(MemorySection.java:106) ~[patched_1.8.8.jar:git-PandaSpigot-110]
        at net.leonemc.lithium.utils.BalancingUtils.rewardPlayer(BalancingUtils.java:41) ~[?:?]
        at net.leonemc.lithium.listener.DeathListener.onPlayerDeath(DeathListener.java:164) ~[?:?]
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?]
        at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
        at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?]
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:300) ~[patched_1.8.8.jar:git-PandaSpigot-110]
        ... 35 more
leaden sinew
signal grove
#

if(!killRewardsConfig.getConfigurationSection("rewards").contains(targetType))

leaden sinew
#

targetType is null most likely

signal grove
#

yeah thats definitely gonna be it, thanks

leaden sinew
#

You're welcome

signal grove
#

i think its deprecated anyways

#

getType()

leaden sinew
#

getName() is deprecated

signal grove
#

thats the one

shell moon
#

.name()

signal grove
#

thanks

sonic nebula
lyric hound
warm steppe
#

i used to hate components because i didn't look in to them. then i tried them + minimessage and they're op

#

like >>>>>>>>

sonic nebula
#

u clearly have no knoweldge then with bukkit API

#

many thngs that dont have replacement are deprecatted in bukkit

#

ap

#

API

#

so

lyric hound
tired olive
sonic nebula
lyric hound
# sonic nebula please dont get into conversation without knowing backgrounds thanks.

For anyone reading this curious about getname(), I believe it was deprecated in 1.12 or maybe 1.13. It's been a long time. Instead of using getname() you should use getkey(). Effectively the same functionality, but not a magic number id, so it's much more powerful and does everything getname() did but better. I have no clue why TonyFalk is so upset over this. Probably just isn't confident in his own abilities or something...

sonic nebula
#

ill give u short answer many of bukkit methods are despracted before they release new

tired olive
sonic nebula
tired olive
#

are you real

sonic nebula
#

~out

lyric hound
#

tony please get your emotions under control I'm embarrassed for you.

tired olive
lyric hound
tired olive
#

if an element is deprecated it just means its use is discouraged