#help-development

1 messages ยท Page 8 of 1

wet breach
#

all before you get to execute anything

proven ocean
#

connection.prepareStatement("SELECT playerId FROM Hsmp.stats WHERE playerId = '3c7fe390-3f61-4078-a8ea-b6ea302ea00b'");
if I'd just run that, wouldn't it work?

wet breach
#

it should, don't see anything wrong with that query except you might want to change from single quotes to double quotes on the end

wet breach
#

it should work as is, I just don't understand your code where you are trying to make use of stringbuilder and that odd loop

#

which is what is most likely breaking everything ๐Ÿ™‚

#

also, you need to have a try catch block too, to catch any SQLExceptions thrown

proven ocean
#

I do

#

but I print out the stackTrace

wet breach
#

thats fine, just didn't see it in the code you presented was all

proven ocean
#

๐Ÿ‘Œ

fossil lily
#

Is it possible to get who threw a damage potion when the entity gets hit with it with EntityDamageEvent?

quaint mantle
#

how would i use BlockMask? This returns 0 because theres no baseblock but how would i make a baseblock? I couldn't find anything on google about it

#
Mask mask = new BlockMask();
int amountblocks = editSession.countBlocks(region, mask);```
sterile token
#

Im interested on it

quaint mantle
sterile token
#

Oh ok

quaint mantle
#

well FAWE

#

but

#

same thing

ocean lion
sterile token
#

Yeah same thing

vocal cloud
quaint mantle
#

mike you know anything about worldedit api?

#

because i wanna finish this soon

#

get it over with

ocean lion
#

this is wrong?

vocal cloud
#

Did you read what I said? I said next time you're sending a class send the whole class. The issue you're having is that you're getting the error because you don't check if the array length is zero before accessing it

ocean lion
vocal cloud
#

What does get attribute return?

ocean lion
#

Gives me that message ingame. I try to return the string value of a players generic max health attribute but I dont know how to convert it to int in a string

vocal cloud
#

Is it an int? I'll ask again. What does getAttribute return.

#

?jd-s

undone axleBOT
ocean lion
#

of course

vocal cloud
#

?

opal wedge
#

Is there any way to make a firework live forever? I can currently set the power to 127 via the meta, which makes the life of the firework 64 seconds. Is there a way to increase the time even more?

delicate lynx
#

yeah you're getting the attribute

#

that is correct

wet breach
#

you could just check which item it is

#

alternatively you can check if the item is an instance of Damageable

#

if it is, then it has durability and can take damage

#

it wouldn't work if you are using outdated versions

#

but if you do indeed have a valid item from the inventory, then you can do an instance check on that

#

the instance check will be true for items like you are wanting, false otherwise

shadow zinc
#

Why does my callback not add all the data to my chunks list even though I know there is data?

#
    private static final List<Chunk> chunks = new ArrayList<>();

    @Override
    public void generate() {
        ChunksScanner.getChunksWithMostEntities(1, chunks::addAll);
    }```
#

or

#
    private static final List<Chunk> chunks = new ArrayList<>();

    @Override
    public void generate() {
        ChunksScanner.getChunksWithMostEntities(1, result -> chunks.addAll(result));
    }```
#

same thing

#

never mind its an args problem

mystic sky
#

lambda โน๏ธ

drowsy helm
#

or none at all

shadow zinc
#

no its my getchunkswithmostentities method

#

forgot to pass the worlds lol

#

so it just did nothing

#

big brain

drowsy helm
#

pog

wet breach
#

because boats have damage

#

you hit it enough times and it dies

shadow zinc
#

yay I cant format for shit

wet breach
#

lol

tender pond
#

Hey guys! So I think there's a problem with ChatColor.valueOf(). I am using <version>1.19-R0.1-SNAPSHOT</version> and for some reason no matter what string I put into this it won't return anything whatsoever.

Just to confirm there are NO whitespace in my string and I am doing colour names such as WHITE in full caps as requested, but it won't send anything

kind hatch
#
  1. What import are you using?
  2. How are you calling it?
#

Cause, I'm using ChatColor#of() just fine on 1.19

tender pond
#

Code:

Bukkit.broadcastMessage("Suffix: " + metaData.getSuffix());
Bukkit.broadcastMessage("Saved Colour 1: " + AllianceTagFile.fileConfig.getString("Alliances." + alliancename + ".Colour"));
Bukkit.broadcastMessage("Saved Colour 2:" + ChatColor.valueOf(AllianceTagFile.fileConfig.getString("Alliances." + alliancename + ".Colour")));
Bukkit.broadcastMessage("Boolean: " + metaData.getSuffix().equalsIgnoreCase(ChatColor.WHITE + " | " + ChatColor.valueOf(oldchatColor) + alliancename));

Result:

[02:05:49] [Server thread/INFO]: Suffix:  | Lol
[02:05:49] [Server thread/INFO]: Saved Colour 1: RED
[02:05:49] [Server thread/INFO]: Saved Colour 2:
[02:05:49] [Server thread/INFO]: Boolean: false
  1. import org.bukkit.ChatColor;
  2. Not sure what you mean by this
#

It just won't return anything whatsoever with ChatColor.valueOf(), it's so weird

#

Could it be because I'm using 1.19 API on a 1.18.2 Server?

kind hatch
#

Possibly, but ChatColor#valueOf() should work the same. The only difference that could possibly be is the transition from an enum class to the normal class setup.

wet breach
tender pond
#

Gonna go try on 1.19 now

silk ether
#

Do mc players enjoy skyblock or factions more?

kind hatch
# tender pond Gonna go try on 1.19 now

Also, it looks like the old enum methods like #name, #ordinal, #valueOf, etc are all deprecated in 1.19. Not sure if there are going to be replacement methods, but I'd recommend changing your setup to use ChatColor#of() instead of ChatColor#valueOf().

tender pond
#

Can't see that? Unless I need to use the Bungee API ChatColor

kind hatch
#

Yep, gotta use that one for that specific method. However, I just realized that you are dealing with normal chat colors. ChatColor#translateAlternateColorCodes() should be enough unless you have hex color codes. In which case, you will have to import the net.md_5.bungee.api.ChatColor class instead of the org.bukkit.ChatColor class.

tender pond
#

translateAlternateColorCodes() only translates characters like '&' though right? I'm checking for capitalised words like: RED, WHITE, BLUE

worldly ingot
#

It needs a character, yes. You can't translate names

kind hatch
#

It does, (it can technically be whatever character you want, but the standard is &), but you could make your own conversion layer if you need the names.

kind hatch
worldly ingot
#

Because it's a legacy method to translate legacy colour codes

#

If you want to replace strings, "<green>Hello world".replace("<green>", ChatColor.GREEN.toString());

tender pond
#

Alright waduhek... so the ChatColor.valueOf() thing is working, but it doesn't print anything out? I'm honestly so confused...

#

Cause it changed my Colour with no problems whatsoever, but won't print it in chat

kind hatch
#

Are you printing out to the player or your console?

#

Oh

tender pond
#

I'm just doing Bukkit.broadcastMessage()

worldly ingot
#

Because #toString() of a ChatColor is just the legacy format code

#

If you're printing that out on its own, it's going to be an empty message

kind hatch
#

That's because the symbol is automatically converted to the one minecraft uses to display colors. It won't show up in the game chat if it's proceded by a color char.

tender pond
#

Ahhh

kind hatch
#

It'll show up in your console though.

#

Or at the very least in your logs.

lunar python
#

Are we allowed to ask questions about NMS here?

kind hatch
#

Yes, but you may not get much help as many people here only have certain experience with specific parts of NMS.

lunar python
#

Okay, my question is:
Is there a method ran every tick in the nms Entity or the nms EntityLiving in 1.18.2?

left isle
#

Hi, How can I detect triggers?

kind hatch
#

Triggers?

kind hatch
left isle
#

those who use datapacks

quaint mantle
#

Cannot resolve symbol 'ENDER_DRAGON'

#

anyone can help me with dis error?

#

?paste

undone axleBOT
quaint mantle
#

I even installed nms thing

#

but still

lunar python
#

Did you add the SpecialSource plugin to your pom.xml?

quaint mantle
#

wym

kind hatch
#

He's using 1.8

lunar python
#

oh

lunar python
worldly ingot
#

There's actually tick(), baseTick(), and postTick()

#

Though tick(), by default, just calls baseTick()

#

Either way, call the super method first before doing anything if you intend on overriding lol

quaint mantle
#

also hi choco

lunar python
quaint mantle
#

nooo

#

then what do I do?

quaint mantle
#

anyone :quack:

lunar python
#

idk that's weird

#

ยฏ_(ใƒ„)_/ยฏ

echo basalt
#

but it was natively so like

#

player.sendMessage("%%red%%You do not have permission!") would automatically parse colors

#

I wonder if it's possible to do that without modifying outbound packets or spigot itself

lunar python
echo basalt
#

yeah I know they do

kind hatch
worldly ingot
#

they use their own server.jar

#

They can patch that in natively

kind hatch
#

Makes sense. Would be the smarter approach. lol

echo basalt
#

found it in a twitter post

kind hatch
#

Now that the class has changed from an enum, things will probably have to be adjusted in some plugins.

worldly ingot
#

It's still an enum. BungeeChat's ChatColor is a class though

#

Though the replacement for legacy chat is text components. So Bungee Chat is its replacement

#

Paper makes use of Adventure

#

For the record, the ChatColor enum (and BungeeChat's ChatColor class) are also legacy formats

kind hatch
#

Well is there an easy way to work with text components then? Cause when it comes to complex color strings, it's a little easier to just type out your short color codes rather than creating several text components, setting the color, and repeating for every character that has/needs a different color. Hex color codes are also another hurdle.

I'd like to use the modern standards, but the legacy ones are easier to work with atm.

compact haven
#

the only way

worldly ingot
#

It's easier, yes, but no there's no better way to do it

#

If you're working with Paper's Adventure library, MiniMessage is provided so you can actually parse it out with the tags like I mentioned above

#

BungeeChat doesn't have an equivalent, however

compact haven
#

honestly yeah, if you are making your messages configurable (highly recommend) then minimessage is the best choice

#

gives users all of that freedom

#

(without reinventing the wheel to support complex texts)

worldly ingot
#

The second one will always be true

#

|| should be an &&

#

Depends on what you're doing though. If you're checking for right clicking air, there are some items that just don't tell the server about that anymore. Exception to things like fishing rods, but if you right click air with a sword or an empty fist or something, the client doesn't send a packet

compact haven
#

also, please change the .equals() to an ==

#

you can use == on enums, it's guaranteed to only have 1 instance

carmine nacelle
#

Hey so I have a list of items in my config. I need to load and grab one of the items based off their chance. Currently trying this but its grabbing the same item every time

    public RewardItem getRandomReward() {
        //Define a sum variable that we change with each loop
        int currentSum = 0;

        Random random = new Random();
        for(RewardItem rewardItem : getRewardItems()) {
            int rewardChance = rewardItem.getChance() / 100;

            int randChance = random.nextInt(0, 1);

            currentSum = currentSum + rewardChance;

            if(currentSum >= randChance) {
                return rewardItem;
            }
        }

        return null;
    }
hive-rewards:
  1:
    type: gold_nugget
    name: '&6Golden Nugget'
    amount: 1
    chance: 25
    lore:
      - '&eA golden nugget... how original.'
  2:
    type: gold_nugget
    name: '&6Golden Nugget 2'
    amount: 1
    chance: 25
    lore:
      - '&eA golden nugget... how original.'
compact haven
#

could I suggest a much more beautiful configuration instead

#
hive-rewards:
  - type: gold_nugget
    name: '&6Golden Nugget'
    amount: 1
    chance: 25
    lore:
      - '&eA golden nugget... how original.'
  - type: gold_nugget
    name: '&6Golden Nugget 2'
    amount: 1
    chance: 25
    lore:
      - '&eA golden nugget... how original.'
carmine nacelle
#

its still in development...

#

but that isnt my issue

compact haven
#

indeed, I like to stop problems early

#

โš’๏ธ

carmine nacelle
#

how is it a problem?

compact haven
#

because then if a user wants to insert something in the middle of their reward list, for organization, then they need to change every number downwards to look right

#

must think of the user experience !

carmine nacelle
#

yea... ok fair but then how would i get "type"

compact haven
#

getList and cast to a List<ConfigurationSection>

carmine nacelle
#

ideally i wanted to use gson for this but i cant cause thats hard to edit in configs

compact haven
#

well you can use configurate if you want the pojo -> yml serialization

carmine nacelle
#

this whole "chance to get item" thing is confusing to me

void dawn
#

I need some help. I suck at Java but I want to make the riptide tridents in the way they work in MCC. Basically you can hold down right click and it auto launches the trident with no collision (adds velocity and plays the sound) anybody know if there is a way to check if a trident is fully charged? Cause if they let go before its fully charged I dont want it to launch them.

compact haven
#

in any case, this is some old code for doing this basically

worldly ice
compact haven
#

the chances do not need to add up to anything, it's x/(total chance)

worldly ice
#

so random.nextInt(0,1) would always return 0

carmine nacelle
#

why would it always be 0?

#

should be 0 - 1

worldly ice
#

because getting a random number is exclusive

#

as in

#

if you get a random double

#

it'll be between 0 and 0.9999999...

#

it would never be 1

compact haven
#
Map<HiveReward, Integer> chances = ...;

int total = chances.values().stream().mapToInt(Integer::intValue).sum();
int count = random.nextInt(total) + 1;

while (count > 0) {
  for (HiveReward reward : chances.keySet()) {
    count -= chances.get(drop);
    if (count <= 0) return drop;
  }
}

that's what I had (adapted to your purpose)

carmine nacelle
#

๐Ÿ‘€

#

uhhhhh

compact haven
#

but yes, datasianboi is correct

carmine nacelle
#

slightly confusing

compact haven
#

nextInt(0, 1) will always be 0

#

the upper bound is exclusive, the lower bound is inclusive

carmine nacelle
#

so i need 0-100 then instead

compact haven
#

so it's anything up to that number, which for a number without decimals is 0

#

idk am not a debugger

kind hatch
#

Ah yes, truncation doing its work here.

carmine nacelle
#

that part makes sense now

compact haven
carmine nacelle
#

it needs to be 1-100 then

#

or a double but my chances are plain ints so

worldly ice
#

well you could just make the upper bound 2

#

so it would pick a random number between 0 and 1

kind hatch
#

You could also try random weighted selections if you don't want to deal with chance.

worldly ice
#

^ that too

compact haven
#

that's exactly what he's doing now though

#

just named "chance"

#

no?

kind hatch
#

It doesn't look like it. At least to me.

compact haven
#

Perhaps I'm just confusing the term

#

when I hear of chance I think /100, then a weighted selection would be x/total

#

which is his end goal

kind hatch
#

Hmm, maybe I'm also being pedantic with semantics, but from what he shared, it looked like he was doing something different with his math. Maybe I just read it wrong, but using weights would be easier than trying to calculate numbers totaling up to 100.

compact haven
#

ah yeah I have no clue what the code was doing

carmine nacelle
#
    public RewardItem getRandomReward() {
        //Define a sum variable that we change with each loop
        int currentSum = 0;

        Random random = new Random();
        for(RewardItem rewardItem : getRewardItems()) {
            int rewardChance = rewardItem.getChance();

            int randChance = random.nextInt(0, 100);

            currentSum = currentSum + rewardChance;

            if(currentSum >= randChance) {
                return rewardItem;
            }
        }

        return null;
    }
#

Alright well now its giving me null items

compact haven
#

I just know looking at the config he's taking a random reward with a chance, but the total of the chances is not guaranteed to add up to 100

carmine nacelle
#

correct

compact haven
#

use what I sent

#

literally just copy the code

carmine nacelle
#

well, gotta make a function out of it

#

the chances are stored in the RewardItem object btw

void dawn
#

I need some help. I suck at Java but I want to make the riptide tridents in the way they work in MCC. Basically you can hold down right click and it auto launches the trident with no collision (adds velocity and plays the sound) anybody know if there is a way to check if a trident is fully charged? Cause if they let go before its fully charged I dont want it to launch them.

kind hatch
#

Riptide tridents can only be charged if the player is in water, or the area they are standing in is raining, and they aren't in one of the "hot" biomes. Otherwise, if you want them to work anywhere and everywhere, you'll have to delve in to NMS for a manual call to the riptide effect.

carmine nacelle
# compact haven I just know looking at the config he's taking a random reward with a chance, but...
    public RewardItem getRandomReward() {
        //Define a sum variable that we change with each loop
        Map<RewardItem, Integer> chances = new HashMap<>();
        Random random = new Random();
        
        for(RewardItem rewardItem : getRewardItems()) {
            chances.put(rewardItem, rewardItem.getChance());
        }

        int total = chances.values().stream().mapToInt(Integer::intValue).sum();
        int count = random.nextInt(total) + 1;

        while (count > 0) {
            for (RewardItem reward : chances.keySet()) {
                count -= chances.get(reward);
                if (count <= 0) return reward;
            }
        }

        return null;
    }
#

Alright here's my current setup. Pretty sure I just need to add the chances for each item to the map and such beforehand (edited above)

void dawn
kind hatch
carmine nacelle
#

It always needs to give something

kind hatch
#

I also have a class for this, but you would need to modify your code to work with it.

#

?paste

undone axleBOT
kind hatch
carmine nacelle
#

Some of this is new to me so im kinda lost a lil bit hold on..

#

never used NavigatableMap

#

or RandomCollection

kind hatch
# kind hatch https://paste.md-5.net/ivuzetokum.cpp

For usage, it would be something like this.

RandomCollection<HiveReward> rc = new RandomCollection<HiveReward>()
        .add(80, new HiveReward(1))
        .add(35, new HiveReward(2))
        .add(25, new HiveReward(3));

for (int i = 0; i < 10; i++) {
    System.out.println(rc.next().getI());
}
#

RandomCollection is a custom class.

carmine nacelle
#

Guessing the 80, 35, 25 are the chances

kind hatch
#

Yep

carmine nacelle
#

should be able to do this in a loop right?

kind hatch
#

You could pass in your chance variable instead.

kind hatch
#

But, yes. You could easily do this in a loop.

carmine nacelle
#

what is "E"

kind hatch
#

"E" is one of the Generic types you can use.

carmine nacelle
#

ah..

#

alright so I dont wanna go changing my whole class structure here so to adapt that...

kind hatch
#

You shouldn't need to change much of your class to adapt that new class.

carmine nacelle
#

So can I keep my getRandomReward function? the part you sent seems like its making a new instance of the entire class with parameters

compact haven
#

heh

#

u dont touch the RandomCollection class code

carmine nacelle
#

Oh..

compact haven
#

just put that into ur project and then use the class with generics, you only need the generics in that 1 spot

carmine nacelle
#

Alright so literally copy paste

compact haven
#

pretty much

#

just change it to for loop and call the add method

kind hatch
#

Adapting your code to use the RandomCollection class wouldn't be that hard.

List<HiveReward> rewardList = new ArrayList<>();
rewardList.add(new HiveReward(35, "Gold Ingot"));
rewardList.add(new HiveReward(25, "Iron Ingot"));
rewardList.add(new HiveReward(10, "Diamond"));

RandomCollection<HiveReward> rc = new RandomCollection<>();

for (HiveReward reward : rewardList) {
  rc.add(reward.getWeight(), reward);
}

for (int i = 0; i < 10; i++) {
  System.out.println(rc.next().getReward());
}

You already have a way to get your list of reward items, so you would just need to adapt this code to fit your needs.

#

Sry, wrong output.

carmine nacelle
#
    public RewardItem getRandomReward() {
        //Define a sum variable that we change with each loop
        RandomCollection<RewardItem> rc = new RandomCollection<RewardItem>();

        for(RewardItem rewardItem : getRewardItems()) {
            rc.add(rewardItem.getChance(), rewardItem);
        }

        for (int i = 0; i < 10; i++) {
            System.out.println(rc.next().getI());
        }
    }
#

What's getI?

kind hatch
#

I was throwing classes together real quick for example purposes. It represents the weight. So you're more than welcome to change the method names to something sensible.

carmine nacelle
#

well I want to return my entire RewardItem object

#

so

#
        for (int i = 0; i < 10; i++) {
            System.out.println(rc.next());
        }
#

?

kind hatch
#

Then just return RandomCollection#next() and cast it to the proper object.

carmine nacelle
#
    public RewardItem getRandomReward() {
        //Define a sum variable that we change with each loopd
        RandomCollection<RewardItem> rc = new RandomCollection<RewardItem>();

        for(RewardItem rewardItem : getRewardItems()) {
            rc.add(rewardItem.getChance(), rewardItem);
        }

        for (int i = 0; i < 10; i++) {
            System.out.println(rc.next());
            return rc.next();
        }

        return null;
    }
#

alright

#

well

#

i dont need the for i loop do i

kind hatch
#

Probably not.

carmine nacelle
#

Only wanna return one item

kind hatch
#

That was just there to show what the output would be like if you were doing multiple rolls.

carmine nacelle
#

gotcha

#

well, I do need to guarantee an item returned

kind hatch
#

As long as that RandomCollection isn't empty, it'll return something.

carmine nacelle
#
    public RewardItem getRandomReward() {
        //Define a sum variable that we change with each loopd
        RandomCollection<RewardItem> rc = new RandomCollection<RewardItem>();

        for(RewardItem rewardItem : getRewardItems()) {
            rc.add(rewardItem.getChance(), rewardItem);
        }

        return rc.next();
    }
#

looks good to me I think

#

IT WORKS

#

LETS GOOO I LOVE U

#

yes homo

#

โค๏ธ

#

got both items now

echo basalt
#

mm thatt structure that just prays on garbage collection

carmine nacelle
#

what

kind hatch
kind hatch
#

Fair enough.

carmine nacelle
#

It'll never be anywhere even near 1000

carmine nacelle
#

and are loaded from it

kind hatch
#

Yea, but when the method is called, it creates the object again. So instead, you could have that list stored outside the method and just update it on startup/reload and you'll only create it once.

carmine nacelle
#

The RandomCollection? @kind hatch

kind hatch
#

Yes.

carmine nacelle
#

bet, ez

#
private RandomCollection rc;
    public RewardItem getRandomReward() {
        if(rc == null) {
            rc = new RandomCollection();
            for(RewardItem rewardItem : getRewardItems()) {
                rc.add(rewardItem.getChance(), rewardItem);
            }
        }

        return (RewardItem) rc.next();
    }
#

WAIWT

kind hatch
#

Not quite.

carmine nacelle
#

there

kind hatch
#

Still not what he was getting at.

#

The goal is to not create the list object in the method.

carmine nacelle
#

well with this way it would only make it the first time its called

kind hatch
#

But to instead access an already existing list.

#

1 sec and I'll show you what it should look like.

carmine nacelle
#

ok

kind hatch
#

@carmine nacelle https://paste.md-5.net/azezejiyiw.cs
This is an example of how this would look. I obviously made this in a normal java context, but I think you can get the idea from it.

carmine nacelle
#

ah right right, that does the same thing just in different places

#

ill use that tho

#

thx guys

#

Now back to the idea of changing my confg layout around..

#
hive-rewards:
  - type: gold_nugget
    name: '&6Golden Nugget'
    amount: 1
    chance: 25
    lore:
      - '&eA golden nugget... how original.'
  - type: gold_nugget
    name: '&6Golden Nugget 2'
    amount: 1
    chance: 25
    lore:
      - '&eA golden nugget... how original.'
#

id now getstringlist

#
        ConfigurationSection section = hiveRewardsConfig.getConfigurationSection("hive-rewards");

        section.getKeys(false).forEach(reward -> {
            String itemType = section.getString(reward);
            String itemName = section.getString(reward + ".name");
        });
#

Am I on the right track there...?

#

itemType would be "item" on the top level, then name would be the "name"

quaint mantle
#

does WorldGuard Region Events have a dependency, if so where?

carmine nacelle
carmine nacelle
quaint mantle
#

i just need the on region exit

drowsy helm
#

isnt that part of the regular api

quaint mantle
#

not that im aware of anyways

carmine nacelle
#

oh

quaint mantle
#

i couldn't find it for like an hour :/

carmine nacelle
#

it was in the comments of the original

quaint mantle
#

ahhh

#

i never checked there

#

also if i do this will it automatically save?

#

wg api ^

carmine nacelle
#

no idea havent used it in a while

drowsy helm
#

i dont think so

quaint mantle
carmine nacelle
#

@drowsy helm do you know anything about my above question

kind hatch
carmine nacelle
#

hmmmmm..

drowsy helm
#

yeah i think that just means the key is missing

carmine nacelle
kind hatch
#

No, only the first one.

drowsy helm
#

use yaml lint

carmine nacelle
#

hmmmm..

#

idk then

drowsy helm
#

which is line 41

#

ConfigurationSection section = hiveRewardsConfig.getConfigurationSection("hive-rewards"); this?

carmine nacelle
#
        section.getKeys(false).forEach(reward -> {
#
        section.getKeys(false).forEach(reward -> {
            String itemType = section.getString(reward);
            String itemName = section.getString(reward + ".name");
            int itemAmount = section.getInt(reward + ".amount");
            int itemChance = section.getInt(reward + ".chance");
            List<String> itemLore = section.getStringList(reward + ".lore");

some stuff after it

drowsy helm
#

oh section is null

carmine nacelle
#

yeah

drowsy helm
#

why isnt it throwing an npe though

carmine nacelle
#

idk why the section is null it shouldnt be

drowsy helm
#

interesting

carmine nacelle
#

it is

drowsy helm
#

oh mb

carmine nacelle
#

oh wait

#

no

#

oh wait

#

yeah

drowsy helm
#

lmao

carmine nacelle
#
[00:36:19] [Server thread/ERROR]: Error occurred while enabling CadiaBees v${project.version} (Is it up to date?)
java.lang.NullPointerException: Cannot invoke "org.bukkit.configuration.ConfigurationSection.getKeys(boolean)" because "section" is null
        at com.squallz.cadiabees.managers.configmanagers.HiveRewardsConfigManager.loadHiveRewardsConfig(HiveRewardsConfigManager.java:41) ~[?:?]
        at com.squallz.cadiabees.CadiaBees.onEnable(CadiaBees.java:50) ~[?:?]
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264) ~[spigot-api-1.19-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:342) ~[spigot-api-1.19-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:479) ~[spigot-api-1.19-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.craftbukkit.v1_19_R1.CraftServer.enablePlugin(CraftServer.java:523) ~[spigot-1.19-R0.1-SNAPSHOT.jar:3545-Spigot-475f600-4230f8f]
        at org.bukkit.craftbukkit.v1_19_R1.CraftServer.enablePlugins(CraftServer.java:437) ~[spigot-1.19-R0.1-SNAPSHOT.jar:3545-Spigot-475f600-4230f8f]
        at org.bukkit.craftbukkit.v1_19_R1.CraftServer.reload(CraftServer.java:922) ~[spigot-1.19-R0.1-SNAPSHOT.jar:3545-Spigot-475f600-4230f8f]
        at org.bukkit.Bukkit.reload(Bukkit.java:801) ~[spigot-api-1.19-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.command.defaults.ReloadCommand.execute(ReloadCommand.java:27) ~[spigot-api-1.19-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:149) ~[spigot-api-1.19-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.craftbukkit.v1_19_R1.CraftServer.dispatchCommand(CraftServer.java:831) ~[spigot-1.19-R0.1-SNAPSHOT.jar:3545-Spigot-475f600-4230f8f]
        at org.bukkit.craftbukkit.v1_19_R1.CraftServer.dispatchServerCommand(CraftServer.java:816) ~[spigot-1.19-R0.1-SNAPSHOT.jar:3545-Spigot-475f600-4230f8f]
        at net.minecraft.server.dedicated.DedicatedServer.bg(DedicatedServer.java:419) ~[spigot-1.19-R0.1-SNAPSHOT.jar:3545-Spigot-475f600-4230f8f]
        at net.minecraft.server.dedicated.DedicatedServer.b(DedicatedServer.java:395) ~[spigot-1.19-R0.1-SNAPSHOT.jar:3545-Spigot-475f600-4230f8f]
        at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:1197) ~[spigot-1.19-R0.1-SNAPSHOT.jar:3545-Spigot-475f600-4230f8f]
        at net.minecraft.server.MinecraftServer.v(MinecraftServer.java:1010) ~[spigot-1.19-R0.1-SNAPSHOT.jar:3545-Spigot-475f600-4230f8f]
        at net.minecraft.server.MinecraftServer.lambda$0(MinecraftServer.java:291) ~[spigot-1.19-R0.1-SNAPSHOT.jar:3545-Spigot-475f600-4230f8f]
        at java.lang.Thread.run(Thread.java:833) [?:?]
drowsy helm
#

is ConfigurationSection section = hiveRewardsConfig.getConfigurationSection("hive-rewards"); initialized correctly?

carmine nacelle
#

initialized?

drowsy helm
#

like set up correctly

#

try just put a string in your yaml and get it

#

not in a section or anything

carmine nacelle
#

this was working before I changed the yml format and tried to adapt this to work

#

1s

quaint mantle
#

how would i fix this?

carmine nacelle
#
hive-rewards:
  1:
    type: gold_nugget
    name: '&6Golden Nugget'
    amount: 1
    chance: 25
    lore:
      - '&eA golden nugget... how original.'
  2:
    type: gold_nugget
    name: '&6Golden Nugget 2'
    amount: 1
    chance: 25
    lore:
      - '&eA golden nugget... how original.'
#

my old layout

#

new

hive-rewards:
  - type: gold_nugget
    name: '&6Golden Nugget'
    amount: 1
    chance: 25
    lore:
      - '&eA golden nugget... how original.'
  - type: gold_nugget
    name: '&6Golden Nugget 2'
    amount: 1
    chance: 25
    lore:
      - '&eA golden nugget... how original.'
#

trying to make it more user friendly

drowsy helm
#

yeah

#

String itemType = section.getString(reward); wouldnt you do .type?

#

i dont use yaml much so im not too familiar tbh

carmine nacelle
#

well since its the top/main line i didnt think so..but maybe?

drowsy helm
#

im just throwing out ideas lol im probs wrong

carmine nacelle
#

idk but were gonna see

#

yea wasnt it

quaint mantle
#
C:\Users\josh9\IdeaProjects\EmbarkkCore\target\classes (Access is denied)``` help lmao
drowsy helm
quaint mantle
#

dependency:

        <dependency>
            <groupId>com.github.NetzkroneHD</groupId>
            <artifactId>WGRegionEvents</artifactId>
            <version>1.7.3</version>
        </dependency>```
drowsy helm
#

show your entire pom

#

might just be a bad dependency

quaint mantle
#

trigger warning

#

lmao

drowsy helm
#

its fine

quaint mantle
#

i haven't removed some dependencies so

drowsy helm
#

looks fine to me

#

make it provided

#

you dont need to shade it right?

quaint mantle
#

i mean i do, but i can download the plugin

drowsy helm
#

and possibly go into your .m2 and delete the dependency

#

and re download it

carmine nacelle
#

mvn clean

drowsy helm
#

does clean delete it aswell?

carmine nacelle
#

not sure

drowsy helm
#

yeah do that then

quaint mantle
#

that means i gotta redownload them all

#

fastasyncworldedit takes like 10 minutes for no apparent reason

drowsy helm
#

probably shitty repo

quaint mantle
#

probably xD

drowsy helm
#

wait that error is when you compile right

quaint mantle
#

now it shows this

carmine nacelle
drowsy helm
#

dont shade it i reckon

quaint mantle
#

yeah when i add scope it removes the error

#

weird

drowsy helm
#

isnt it just an api

quaint mantle
#

ye its also a plugin

drowsy helm
#

or is it a rework of the actual plugin

#

ah

quaint mantle
#

i implemented the plugin into my server

#

should fix the problems

#

hopefully

#

hm

#

it seems like the event isn't working at all now

#

it creates it but whenever i go over the threshold it doesn't activate the event

#
public class RegionExit implements Listener {

    @EventHandler
    public void onRegionExit(RegionLeaveEvent e) {
        Bukkit.broadcastMessage(e.getRegion().toString());
    }
}```
drowsy helm
#

surely you could just make your own event

quaint mantle
#

i mean i could

#

but i have a feeling i'll make a laggy one

drowsy helm
#

nah its not too hard

#

just have to be careful how much you use sqrt

quaint mantle
drowsy helm
#

nah

quaint mantle
#

never noticed that before

drowsy helm
#

wait sqrt would be for circles

#

bounds are even easier

quaint mantle
#

ye

drowsy helm
#

minX > x < maxX

#

same for all axis

#

pretty cheap calc

quaint mantle
#

should i just make my own bounds system then?

#

store them in like bounds.json or something

drowsy helm
#

idek waht this is for tbh

carmine nacelle
#

would still have to get the wg regions

quaint mantle
#

well its just for private mines. So players can't go over the bound. I would use barriers but people hack yk so i'd rather cancel the event. And plus it looks more professional

drowsy helm
#

ik its sorta reinventing the wheel but when i was working on my rpg i just made my own region and anti grief system

#

way more control over stuff

quaint mantle
#

yeah i was debating if i should just make my own bounds system for what i need it for

#

theres pros and cons about both so

drowsy helm
#

yeah it was reasons like this that i did

#

they just forget stuff in api

#

so you have to do stupid work arounds

quaint mantle
#

ye

#

or i could just add an anticheat lol

carmine nacelle
#

:/

#

so lost on this

#

Anyone know why im not able to loop over this

hive-rewards:
  - type: gold_nugget
    name: '&6Golden Nugget'
    amount: 1
    chance: 25
    lore:
      - '&eA golden nugget... how original.'
  - type: gold_nugget
    name: '&6Golden Nugget 2'
    amount: 1
    chance: 25
    lore:
      - '&eA golden nugget... how original.'
        ConfigurationSection section = hiveRewardsConfig.getConfigurationSection("hive-rewards");

        section.getKeys(false).forEach(reward -> {
#

"section" is not a valid configurationsection

compact haven
#

tis tis tis

#

List<ConfigurationSection> sections = (List<ConfigurationSection>) hiveRewardsConfig.getList("hive-rewards");

#

@carmine nacelle ^

carmine nacelle
#

hmmm

#

but I cant use getString

#

@compact haven

#

oh I might actually be stupid

#

probably

#
List<ConfigurationSection> sections = (List<ConfigurationSection>) hiveRewardsConfig.getList("hive-rewards");

        for(ConfigurationSection section : sections) {
java.lang.ClassCastException: class java.util.LinkedHashMap cannot be cast to class org.bukkit.configuration.ConfigurationSection (java.util.LinkedHashMap is in module java.base of loader 'bootstrap'; org.bukkit.configuration.ConfigurationSection is in unnamed module of loader java.net.URLClassLoader @18769467)
        at com.squallz.cadiabees.managers.configmanagers.HiveRewardsConfigManager.loadHiveRewardsConfig(HiveRewardsConfi
#

REEE

ivory sleet
#

getListMap or if it is getMapList

#

Returns List<Map<?,?>>

compact haven
#

I couldve sworn that worked

#

my bad

carmine nacelle
shadow zinc
#

?paste

undone axleBOT
shadow zinc
#
java.lang.RuntimeException: java.util.ConcurrentModificationException```
carmine nacelle
#

ur changing the value of something while iterating over it.

shadow zinc
#

im aware, i mean its in the error name

#

but what?

compact haven
#

it gives u a stack trace no..?

shadow zinc
#

yeah

#

?paste

undone axleBOT
shadow zinc
#

nvm fixed it

#

i used a if redstone is being restored and then stopped anything else

#

big brain

carmine nacelle
#

so i basically need to get a list of configurationsections then loop over each one..

balmy valve
#

Just out of curiosity is it possible to tell if a player is looking at a entity/block

#

Iโ€™m assuming yes, by checking the pitch and other associated values

vocal cloud
#

I believe you can raytrace it

balmy valve
#

Ah Alr cool

#

Ty just wanted to know before brainstorming something impossible

shadow zinc
#

How do I know when the server has fully started up?

#

like all plugins are loaded and all worlds are loaded?

#

is there an easy way?

#

or do I need to loop through all the plugins and check?

tender shard
shadow zinc
#

because my plugin is messing up peoples servers at boot

tender shard
tender shard
shadow zinc
#

Can I copy and paste this?

tender shard
#

Sure

young knoll
#

Schedule a task in your onEnable

#

The task scheduler doesnโ€™t start processing until startup is finished

shadow zinc
#

as so

#
        new BukkitRunnable() {
            @Override
            public void run() {
                Logger.info("Server finished starting, registering performance optimisers");
                plugin.getServer().getPluginManager().registerEvents(new HaltServer(), plugin);
                plugin.getServer().getPluginManager().registerEvents(new LagPrevention(), plugin);
                new HeartBeat().start();
                if (!(getLagNotifierData().getRunInterval() < 1)) {
                    new LagChecker().start();
                }
            }
        }.runTaskLater(NeoPerformance.getInstance(), 1L);```
#

but it isn't really doing it

burnt sand
#

Why are you doing @override ? just do run() in onEnable

shadow zinc
#

I like my main class to be as small as possible

#

just a preference

burnt sand
#

Look at the code

shadow zinc
#

Is it seriously a problem?

#

like serious?

burnt sand
#

Yes because run() is not a standard thing

vocal cloud
#

Wait why are you registering stuff in a thread when you could run it in enable?

echo basalt
#

it would be acceptable if you wanted to wait for the worlds to load

shadow zinc
#

so it is

echo basalt
#

but even then just load those sensitive classes then

charred blaze
#

im trying to create two configurations.
25.07 07:12:49 [Server] ERROR java.io.FileNotFoundException: plugins/MultyBot/bans.yml (No such file or directory) 25.07 07:12:49 [Server] ERROR at java.io.FileInputStream.open0(Native Method) 25.07 07:12:49 [Server] ERROR at java.io.FileInputStream.open(FileInputStream.java:195) 25.07 07:12:49 [Server] ERROR at java.io.FileInputStream.<init>(FileInputStream.java:138) 25.07 07:12:49 [Server] ERROR at net.md_5.bungee.config.YamlConfiguration.load(YamlConfiguration.java:77) 25.07 07:12:49 [Server] ERROR at net.md_5.bungee.config.YamlConfiguration.load(YamlConfiguration.java:71) 25.07 07:12:49 [Server] ERROR at MultyBot.Main.onEnable(Main.java:40) 25.07 07:12:49 [Server] ERROR at net.md_5.bungee.api.plugin.PluginManager.enablePlugins(PluginManager.java:315) 25.07 07:12:49 [Server] ERROR at net.md_5.bungee.BungeeCord.start(BungeeCord.java:290) 25.07 07:12:49 [Server] ERROR at net.md_5.bungee.BungeeCordLauncher.main(BungeeCordLauncher.java:67) 25.07 07:12:49 [Server] ERROR at net.md_5.bungee.Bootstrap.main(Bootstrap.java:15)

echo basalt
#

also calling a singleton on the main class ..?

vocal cloud
#

The KISS method of programming.

undone axleBOT
echo basalt
#

yeah so your ban file doesn't exist

#

you gotta like

#

file#createNewFile

burnt sand
#

Do it like that then its gonna work

echo basalt
#

it's a bungee plugin

#

you notice that immediately by the way the configs are loaded

#

and also the stacktrace

burnt sand
echo basalt
#

did you even bother to read his code

burnt sand
shadow zinc
#

so do I do this?

#
    public void registerOptimizers() {
        //Register ability listeners
        if (ServerUtils.getLifePhase() == ServerUtils.ServerLifePhase.RUNNING) {
            Logger.info("Server finished starting, registering performance optimisers");
            getServer().getPluginManager().registerEvents(new HaltServer(), this);
            getServer().getPluginManager().registerEvents(new LagPrevention(), this);
            new HeartBeat().start();
            if (!(getLagNotifierData().getRunInterval() < 1)) {
                new LagChecker().start();
            }
        }
    }```
#

do I need a run later?

#

if its not loaded?

tender shard
#

Why cant you just register your listeners โ€žright nowโ€œ?

shadow zinc
#

because they detect if the server is lagging

tender shard
#

Then just wait a tick to register them

solid cargo
#

What could be the cause of this problem? I went to sleep yesterday and still am in bed. I can get you the code only in like 7 mins

shadow zinc
#

I was, but someone using it was still having double with it

solid cargo
#

Uhhh

#

There should be only one โ€œSketchy blocksโ€ line

shadow zinc
#

return; problem solved

quaint mantle
#

bro tf

#

intellij just set my project to a paper plugin

#

not a spigot plugin and broke half the plugin

solid cargo
#

Paper has more events tho

quaint mantle
#

anyway how to fix dis

shadow zinc
#

lol

tender shard
#

you mean this weird "Minecraft development" plugin?

#

That's the worst intellij plugin ever

solid cargo
#

Pom.xml

shadow zinc
#

what does it even do?

tender shard
solid cargo
#

And google โ€œSpigot dependencyโ€

tender shard
#

it does nothing useful and always only causes problems

quaint mantle
#

i have it doe

solid cargo
tender shard
#

is there any "paper" thing left in your pom?

quaint mantle
#

i need them for worldedit api doe

#

or do i, it just said to add it

tender shard
#

whut? you dont need paper for worldedit

quaint mantle
#

then it lied to me

tender shard
#

I use worldedit API frequently and I always only use spigot, never paper

solid cargo
#

its because paper is lighter thus spends less resources on WE

shadow zinc
#

๐Ÿ˜ถ

tender shard
#

also, why do you have spigot 1.17 but paper 1.19? o0

quaint mantle
#

i have my ways

#

lol

tender shard
#

lol ok

quaint mantle
#

stupid ways

#

idk worldedit told me to add it so i did

#

ยฏ_(ใƒ„)_/ยฏ

vocal cloud
#

Sigh.

quaint mantle
#

lol

#

bro intellij is on crack

tender shard
#

I love my Burchard's constructor

quaint mantle
#

illegal character: '\ufeff' tf does this mean

#

lmfao

#

i have no such thing

tender shard
#

show code

quaint mantle
tender shard
#

you have a "zero width space" somewhere

#

the full error should tell you the location

quaint mantle
#

so how would i fix this?

shadow zinc
#

hey mfnalex

#
        if (ServerUtils.getLifePhase() != ServerUtils.ServerLifePhase.RUNNING) {
            return false;
        }```
#

Is that okay if I run that every second?

#

because its in my is server halted method

#

true for halted false for not

quaint mantle
#

bro now im getting this

#

tf is happening

#

everything is self destructing on me ๐Ÿ˜†

vocal cloud
#

Did you copy paste someones code?

quaint mantle
#

no

#

idfk

#

i haven't touched the project since i've reopened intellij

vocal cloud
quaint mantle
#

yeah that wont work

vocal cloud
#

You tried it?

quaint mantle
#

yeah

#

only whitespace content allowed before start tag and not \u0 (position: START_DOCUMENT seen \u0... @1:1) pom.xml

#

any idea?

vocal cloud
#

I'd copy the contents somewhere, delete the original, then remake it.

quaint mantle
#

sad

#

okay

vocal cloud
#

it's a 2m venture

tender shard
tender shard
quaint mantle
#
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>```
#

i haven't even touched it. idk what's going on

vocal cloud
#

If you remake it then that should fix it. If it doesn't you most definitely need to strip special characters cause you have a problem with one

quaint mantle
#

yeah

#

ig i'll do that

#

probably the easiest way of fixing the error

#

weird

#

okay so

#

i copied a pom.xml from another project of mine

#

and edited it for the current project

#

and its still the same

tender shard
#

spigot mappings are so weird, lmao.
on NTTagCompound, it's setString, getString, setInt, getInt, etc, but for a long[] its called getLongArray and a()

#

lmao

vocal cloud
#

Unusuable

quaint mantle
#

i've found where it is located

#

so how would i fix this

tender shard
#

the whole <?xml tag

quaint mantle
#

i've literally copied from another pom.xml without the error

tender shard
#

remove the whole first line

quaint mantle
#

do i not need it?

tender shard
#

no

#

my poms always look like this

onyx fjord
#

or isit?

quaint mantle
#

okay im back to this error

#

illegal character: '\ufeff'

#

in my main class

tender shard
tender shard
quaint mantle
#

like what doe

tender shard
#

\ufeff is an invisible white space

quaint mantle
tender shard
#

do ctrl+r, then enter \ufeff to replace, and nothing as replacement

#

no idea if replace works for unicode, though

quaint mantle
#

na, it doesn't

tender shard
#

are you on linux?

quaint mantle
#

na

#

windows

tender shard
#

hm

#

do you got git bash?

#
sed $'s/[^[:print:]\t]//g' file.txt

this removes all "weird" characters from file.txt

quaint mantle
#

no, but i can download it

eternal oxide
quaint mantle
whole stirrup
#

Is there a list somewhere of all the Java APIs that are shaded into the Spigot JAR by default? (e.g. mysql-connector, yaml, etc.)

tender shard
#

but you can just open the .jar and check the libraries folder

whole stirrup
#

Oh yeah, thanks.

quaint mantle
#

i've had no problem with this until i reopened intellij

eternal oxide
quaint mantle
eternal oxide
#

odd, its fine in Eclipse

quaint mantle
#

i totally agree, it is very odd

#

i've had no trouble with this until now

tender shard
#

well

#

try sending the whole file instead of copy pasting it

#

I bet that eclipse will then be angry

eternal oxide
#

he did

tender shard
#

discord probably strips stuff like invisible whitespace

tender shard
eternal oxide
#

he sent the whole file

tender shard
#

you can see that because it's callef "message.txt"

#

it is copy paste, not the actual file

eternal oxide
#

ah

quaint mantle
eternal oxide
#

well I sent back after reformatting and he says it still bad

tender shard
#

huh

#

that is indeed very weird

eternal oxide
#

Works just fine in Evlipse

tender shard
#

have you tried to run sed @quaint mantle ?

quaint mantle
#

one moment

eternal oxide
tender shard
#

problems like these are the worst, lol

grim ice
#

man

urban mauve
#

hello! i have a problem with BuildTools, so...
I had installed java 8, 16 and 17 versions before, and i want to build 1.19 via BuildTools, but it choose only java 16, how to choose 17?

quaint mantle
#

sed

tender shard
urban mauve
#

tq im going to try that

hybrid spoke
tender shard
#

I usually use a bunch of aliases in .bash_aliases so I can just do java18, java17, java11, ...

tender shard
#

I think I havent written any code myself since I got github copilot lol

#

it's basically only "pressing tab" since then lmao

urban mauve
#

i think i cant write somewhat really useful but im trying

tender shard
#

everything

#

it suggests code

#

and in 99% of cases its exactly what you wanted to write

#

yikes, I only got 4 GB of LTE left and my current phone invoice is already at 177 โ‚ฌ o0

hybrid spoke
#

is it worth the money?

tender shard
#

not at all

#

fucking telekom

#

oh wait

#

github copilot is totally worth it

drowsy helm
#

Is there any good alternative to reusing noteblock states for cusotm blocks that won't eventually end up running out of space for textures?

tender shard
#

copilot is so absolutely worth it!!!! for real

tender shard
#

there are mainly 3 ways:

  1. noteblock blockstates
  2. mushroom block blockstates
  3. armorstands with heads
drowsy helm
#

yeah idk how good mushroom is and armour stands are just gonna get laggy

tender shard
#

IIRC mushroom blocks are better than noteblocks because you dont have to cancel any events, but they have less blockstates to use. and armorstands are laggy

hybrid spoke
#

if its not worth it

#

you scammed me

quaint mantle
tender shard
quaint mantle
#

copilot seems cool

tender shard
drowsy helm
#

corrupted world?

tender shard
#

nah it's a new one. I only tried to save some NBT data to an entity and then everything died lmao

quaint mantle
#

yeah tf

#

notepad++ doesn't know either

#

bruh

tender shard
#

what happens if you run "mvn package" anyway?

#

does intelliJ itself show anything about that file?

#

have you tried the "sed" thing?

queen pewter
#

"Error loading plugin Mainlobby" What my going to do

hybrid spoke
#

?notworking

undone axleBOT
#

"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.

queen pewter
#

?paste

undone axleBOT
quaint mantle
#

@hybrid spoke you got any other ideas on how i can fix this? ( illegal character: '\ufeff' )

hybrid spoke
hasty obsidian
#

Modifying mobs

quaint mantle
#

yeah ig

urban mauve
#

can i ask a question? i need to get net.minecraft.server.v1_19.ItemStack, but i cant get ItemStack, cuz with v1_19 its not exist, so... how to did that

quaint mantle
#

finally!

#

took an hour

chrome beacon
urban mauve
#

?

tender shard
#

does anyone know why my whole server dies whenever I load a CompoundTag into an entity? :X

tender shard
tender shard
queen pewter
#

Okay

queen pewter
#

But my in bungeecord server there is no logs folder

chrome beacon
tender shard
# urban mauve (

wtf is NBTTagCompound? Are you using obfuscated / spigot mappings? o0 because the class is just called CompoundTag in the proper mappings

chrome beacon
#

Yeah Spigot mappings

tender shard
#

FFS use mojang mappings lol

queen pewter
#

?help

undone axleBOT
#
CafeBabe Help Menu
*Red V3*
**__Admin:__**

selfrole Add or remove a selfrole from yourself.

**__Cleanup:__**

cleanup Base command for deleting messages.

**__Core:__**

embedset Commands for toggling embeds on or off.
info Shows info about CafeBabe.
licenseinfo Get info about Red's licenses.
mydata Commands which interact with the data CafeBabe has about...
set Commands for changing CafeBabe's settings.
uptime Shows CafeBabe's uptime.

**__Downloader:__**

findcog Find which cog a command comes from.

**__Mod:__**

names Show previous names and nicknames of a member.
userinfo Show information about a member.

**__ModLog:__**

listcases List cases for the specified member.
reason Specify a reason for a modlog case.

**__Permissions:__**

permissions Command permission management tools.

queen pewter
#

?paste

undone axleBOT
crisp estuary
#

What is the best website for new Java developers?

mystic sky
#

what

#

What you mean by "best website"

#

Website of what

crisp estuary
#

Like to code on

#

Like the script

mystic sky
#

Wtf

rough drift
#

you need an IDE

mystic sky
#

You need an ide, you can't really write

rough drift
#

and a development environment

#

It's not just a website

mystic sky
#

xD

hybrid spoke
#

use your text editor

supple elk
#

Is there anyway to make it so that an inherited method must call the super method?

supple elk
#

it's the best IDE 100000%

hybrid spoke
#

just call what you need before using the inherited method anywhere

supple elk
#

wdym?

tender shard
undone axleBOT
crisp estuary
hybrid spoke
# supple elk wdym?

well, at some point you need to invoke the method they just implemented and if you really need to execute something right before, just call it

tender shard
supple elk
#

it's a bit weird

supple elk
#

so the obvious solution would be to make a new method which is inherited, then have the listener method not inherited, run the extra code then call the inherited method

hybrid spoke
supple elk
#

however I don't think this would due to either type erasure or annotations not being inherited

#

lol

#

I'll just show the code

dusk flicker
supple elk
#

there are kinda two ways to use this class, it's strange, ignore the second constructor

hybrid spoke
#

and why dont you just invoke whatever you need before you call onEvent?

supple elk
#

I don't call onEvent

#

it's a listener

#

it triggers when an in game event happens

#

the best thing I can think of is to have a higher priority event which runs the code and cancels the event

#

then in the inherited methods check if the event has been cancelled or not

hybrid spoke
#

as i can see in your constructor

supple elk
#

ignore the second constructor

#

that's not how I normally use the class

queen pewter
hybrid spoke
#

this is a very weird design anyways

queen pewter
#

I reinstall ny server

supple elk
#

yes I know lmao

hybrid spoke
#

just throw it up

#

and redo better

supple elk
#

how would you suggest?

hybrid spoke
#

depends on what you are trying to do

noble lantern
#

or yknow

#

dont overcomplicate things for yourself cx

supple elk
#

I use it like this

supple elk
#

basically I'm making a bunch of map editing tools for different minigames

#

that code is going to appear in all the tools

#

or very similar

#

it can be abstracted

#

I don't really want to copy and paste that every time

#

or I might forget one time to do it

#

so then it could be at best not consistent and at worst dangerous

tender shard
#

uuugh fuck NBT

#

I hate it so much

#

and it's not even working properly

eternal night
#

Just don't use it 5Head

tender shard
#

I don't

#

I am just bored and so i decided to add some NBT stuff to my lib

#

turns out that NBT is even shittier than I thought though, lol

#

doesn't even save custom tags

eternal night
#

Smh almost like there is a spigot API to save custom stuff

hasty obsidian
#

can someone help me

eternal night
#

But yea, nbt is just parsed into proper fields

#

?ask

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!

hasty obsidian
#

well im trying to make the warden stronger but I have no idea how to modify the warden, im not sure if there is like an event or something but what im trying to do is to make it immune to explosions/potions

eternal night
#

Well you can listen to entity damage event

native nexus
#

Is anyone familiar with guice and providers?

tender shard
eternal night
#

For potions iirc there is a potion effect applied event

tender shard
drowsy pawn
#

maybe something have idea place radius block?

tender shard
#

Because guice is a huge pile of shit

native nexus
#

Is it tho?

tender shard
#

and shit is disgusting and so I gotta vomit, lol

native nexus
#

What else do you suggest using?

tender shard
#

None of those weird workarounds, just properly provide instances to stuff you need yourself

eternal night
#

DI frameworks kekw

native nexus
#
@Command(label = CommandLabel.ACCEPT)
public class AcceptCommand implements CommandInterface {

    @Inject
    private CitizenService citizenService;

    @Inject
    private InvitationService invitationService;

    @Inject
    private SettlementService settlementService;

    @Override
    public void run(Player player, String[] strings) {
        if (strings.length == 2) {
            String string = strings[1];
            if (!invitationService.hasNoInvitation(player, string)) {
                player.sendMessage(Remote.prefix(Locale.INVITATION_NULL, string));
                return;
            }

            Settlement settlement = settlementService.getSettlement(string);
            if (settlement == null) {
                player.sendMessage(Remote.prefix(Locale.SETTLEMENT_NULL, string));
                return;
            }

            player.sendMessage(Remote.prefix(Locale.SETTLEMENT_JOIN, string));
            invitationService.removeInvitation(player, string);
            citizenService.add(player, settlement);
        }
    }
}
``` Literally have it working nicely and setup how I want it
#

I just wanted to know if anyone knows about providers...

tender shard
#

ugh

native nexus
#

But fine guess I am not going to ask here cause of salty responses like yours

#

Have a good day

tender shard
#

thanks

tender shard
#

also asked you to use a thread and you just ignored that, so what did you expect lol

eternal night
#

Couldn't you just look at their wiki o.o

tender shard
#

I am sure that you will get a proper response if you actually open a thread

eternal night
#

Guice is pretty well documented

tender shard
#

because if you don't rephrase it, my current answer would be "yes" and that's probably not very helpful

#

didnt we have a command for this

#

?ask

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!

proven ocean
drowsy helm
#

is there an event for when the palyer stops breaking a block or do i have to make a packet listener

tender shard
#

we are living in awesome times

#

1.19 has EVERYTHING

drowsy helm
#

oh shiet

#

why did that not come up in jdocs lol

tender shard
#

idk lol. I googled the BlockDamageEvent and then it was listed at "See also"

mental nymph
#

how to get no permission message from paper.yml?

tender shard
quaint mantle
#

ddoesnt SKULL_ITEM exsist in 1.16

tender shard
mental nymph
quaint mantle
#

ah so it does not exsist

#

alr man

tender shard
tender shard
#

both, the placed block, and the inventory item

ocean lion
#

First, I check if the target is null. Then trying to check if the first argument is a player. then trying to get /command add <player>

#

dont know how, me new

native nexus
#

I don't want your advice lol

mental nymph
#

how to get server platform like paper/spigot/bukkit?

ocean lion
#

on youtube

eternal night
#

Maybe they wanna fetch it programmatically from their plugin

ocean lion
#

Could b3e

#

be

severe turret
#

any idea why this doesnt work as intended?

#

the counter works

rough drift
#

or just use SMPCore and let it load that config for ya, because yes

severe turret
#

but the message just sends higher numbers than 5

#

like the initial message is you've been muted for 5 seconds

#

and then if they type again

#

it becomes like you're still muted for 16 seconds

#

etc

rough drift
#
if (original - (current - max) > 0) return;

removeMute(player)
#

try something similar to that

mental nymph
rough drift
#

download jar

#

start jar

mental nymph
rough drift
#

I did it there

tender shard
tender shard
#

oh you wanna check if the server is running paper?

#

just Class.forName some paper-only class

#

e.g. com.destroystokyo.paper.ParticleBuilder

rough drift
#

PARTICLE BUILDER

#

jesus

#

them jokes are nice

tender shard
#
public static boolean isPaper() {
  try {
    Class.forName("com.destroystokyo.paper.ParticleBuilder");
    return true;
  } catch (Throwable t) {
    returnn false;
  }
}
tender shard
rough drift
#

Imma loose my shit

#

particle builder

tender shard
#

why?

rough drift
#

Atleast make it a particle shape builder

#

to make circles/squares etc

tender shard
#

what's wrong with having a normal builder for particles lol

rough drift
#

it's useless

eternal night
#

It certainly is not

rough drift
#

isn't it just new Particle(type, data)

tender shard
#

i have similar stuff in my lib for sounds

#

and I dont think that its useless

rough drift
#

Builders are nice, I agree

#

but like

tender shard
#

but you do you, noonne forces you to use a ParticleBuilder lol

rough drift
#

one liners shouldn't be made into builders

mental nymph
# tender shard what?

will this work?

if (sender.getServer().getPluginCommand("spigot") == null){
                    // command not exists
                }
rough drift
#

I will unalive me

mental nymph
rough drift
#

how about checking the server software version?

tender shard
#

also what are you trying to achieve with that?

ocean lion
#

yeah what are you trying to do?

#

haha

rough drift
#

what aren't they trying to do

tender shard
#

lol

ivory sleet
rough drift
#

or just

#

you know

#

new lines exist

tender shard
#

yeah particle methods are really annoying

#

they always have like 10 parameters

rough drift
#

what's so big to do with particles

tender shard
#

I think a builder for that is very useful

rough drift
#

genuinely tell me

ivory sleet
#

Receivers, source, particle type, offsets etc

tender shard
rough drift
#

fair

#

alright

#

I forgot that

tender shard
#

it's really kinda messy

hard socket
#

I dont get that message

tender shard
#

then args[0] doesn't equal "list"

#

or the config doesnt have any keys

lilac pier
#

someone good with itemsadder here ?

tender shard
#

?ask

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!

drowsy helm
#

if you quickly look away from a block and back and start breaking BlockDamageEvent doesnt even get called lol