#help-development

1 messages · Page 2174 of 1

iron glade
#

Always hide the enchants but add a lore to the item when being enchanted or smth like that

kind hatch
#

Eh, I do, but it's a pain to make custom enchantments. It's a little easier nowadays thanks to the pdc, but still. You'd have to create a listener for each custom enchantment, update the lore on the item, update the pdc with the custom enchant name, etc

#

It's worth it if you need it. I'm just saying it's a process.

bold copper
#

Line 4. Enum is more efficient to compare, as well as ordinary numbers. 16 and 24 - requesting a variable from the config each time is slow. save its result to a static variable, and that's better. I think sending an interactive message will solve your problem, clicking on which will execute a command that will already execute the desired piece of code.

kind hatch
quaint mantle
#

Can you ppl just tell me wen I place a beacon I want to place a block on it How can I dO that

bold copper
quaint mantle
pastel juniper
#

I want to create a kick gui but I can't get the target through events.

kind hatch
kind hatch
quaint mantle
#

how can I get the location up it

kind hatch
# bold copper 0_0

In that case, both the config and your separate value would sit in different parts of memory. The config would take up more memory, but when you get the value of each one, it's the same process.

kind hatch
iron glade
#

plugin.getConfig().addDefault("...", true);
plugin.getConfig().setComments(stuff);

plugin.getConfig().options().copyDefaults(true);
plugin.getConfig().options().parseComments(true);
plugin.saveDefaultConfig();

quaint mantle
#

?

iron glade
#

When I manually delete everything from the config and save and reload it's still empty

quaint mantle
kind hatch
quaint mantle
iron glade
kind hatch
#

You need to set the block at that location to something else.

quaint mantle
kind hatch
#

That location is just a location. You need to do something with it.

quaint mantle
# iron glade Show your code

import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.block.BlockBreakEvent;
import org.bukkit.event.block.BlockPlaceEvent;
import org.bukkit.scheduler.BukkitRunnable;
import org.bukkit.scheduler.BukkitTask;

public class Listeners implements Listener {

    private Magic_Armor plugin;

    BukkitTask task1;
    int task2;
    int task3;
    BukkitTask task4;
    BukkitTask task5;


    public Listeners(Magic_Armor plugin) {
        this.plugin = plugin;
        Bukkit.getPluginManager().registerEvents(this, plugin);
    }

    @EventHandler
    public void onBlockPlace(BlockPlaceEvent e) {
        if (e.getBlock().getType() == Material.BEACON) {
            Player p = e.getPlayer();
            Block block = e.getBlock();
                    if (e.getBlock().hasMetadata(ChatColor.GREEN + "Re" + ChatColor.WHITE + "ge" + ChatColor.GREEN + "nb" + ChatColor.WHITE + "og" + ChatColor.GREEN + "en-" + ChatColor.WHITE + "Le" + ChatColor.GREEN + "uc" + ChatColor.WHITE + "ht" + ChatColor.GREEN + "fe" + ChatColor.WHITE + "ue" + ChatColor.GREEN + "r")) {
                        Location loc = block.getLocation().add(0,1,0);
                        loc.getBlock().setType(Material.GOLD_BLOCK);
                        task1 = new BukkitRunnable() {
                        int c_color = 0;
                        public void run() {

                            if (c_color==6){
                                c_color=0;
                            }
                            switch(c_color) {
                                case 0:
                                    loc.getBlock().setType(Material.RED_STAINED_GLASS);
                                    c_color++;
                                    break;
                                case 1:
                                    loc.getBlock().setType(Material.ORANGE_STAINED_GLASS);
                                    c_color++;
                                    break;
                                case 2:
                                    loc.getBlock().setType(Material.YELLOW_STAINED_GLASS);
                                    c_color++;
                                    break;
                                case 3:
                                    loc.getBlock().setType(Material.GREEN_STAINED_GLASS);
                                    c_color++;
                                    break;
                                case 4:
                                    loc.getBlock().setType(Material.BLUE_STAINED_GLASS);
                                    c_color++;
                                    break;
                                case 5:
                                    loc.getBlock().setType(Material.PURPLE_STAINED_GLASS);
                                    break;
                            }
                        }
                    }.runTaskTimer(plugin, 20, 20);
                }
            }


    @EventHandler
    public void onBlockBreak(BlockBreakEvent e){
        if (e.getBlock().hasMetadata(ChatColor.GREEN + "Re" + ChatColor.WHITE + "ge" + ChatColor.GREEN + "nb" + ChatColor.WHITE + "og" + ChatColor.GREEN + "en-" + ChatColor.WHITE + "Le" + ChatColor.GREEN + "uc" + ChatColor.WHITE + "ht" + ChatColor.GREEN + "fe" + ChatColor.WHITE + "ue" + ChatColor.GREEN + "r")) {
            task1.cancel();
        }
    }
}
kind hatch
#

?paste it next time please

undone axleBOT
quaint mantle
#

ok

quaint mantle
crisp steeple
kind hatch
#

lmao

ivory flume
#

why do child classes called Spigot exist??

crisp steeple
quaint mantle
#

@kind hatch WHY IS IT NOT WORKING

slate mortar
#

just an idea

iron glade
kind hatch
slate mortar
iron glade
slate mortar
#

._.

#

no

#

just bought a normal boost lol

iron glade
#

-.-

#

just to get a pink name?

kind hatch
#

It may also be due to something with the block metadata. Not sure how long that lasts for.

slate mortar
#

i don't use the nitro features, so it'd be kinda useless to pay 5€ more

slate mortar
iron glade
#

ooof

kind hatch
#

You get any perks for boosting here?

slate mortar
#

idk

#

i dont think i get one for boosting myself

#

but everyone gets some things for the server having enough boosters

#

like higher upload limits etc

#

alltho i can't upload shit either lol

quaint mantle
#

@kind hatch I tried to place blocks but its not placing and I tried this:

    public void onPlace(BlockPlaceEvent e){
        if (e.getBlock().getType().equals(Material.BEACON)) {
            e.getBlock().getRelative(BlockFace.UP).setType(Material.GOLD_BLOCK);
        }
    }```
tardy delta
#

show code

quaint mantle
tardy delta
#

you registered it?

slate mortar
#

is it called?

crisp steeple
tardy delta
#

and dont compare enums with equals

quaint mantle
chrome beacon
slate mortar
quaint mantle
tardy delta
#

nope

slate mortar
#

lmfao

quaint mantle
#

ALL THIS FOR NOTHING

kind hatch
#

lol

#

It happens

slate mortar
#

i'm gonna kill myself today if that keeps happening

tardy delta
slate mortar
#

why do so many people forget registering stuff

#

main reason why i stuck every event in one class tho

tardy delta
#

oh god

kind hatch
#

They probs think the annotation handles it.

slate mortar
#

i'd probably forget registering that many events as well

tardy delta
#

or they forget it like i do 💀

quaint mantle
#

its working now

slate mortar
#

nice

tardy delta
#

how can people rebuild their project stop their server reinstall the plugin and load it back in that small time?

tardy delta
#

i mean 1 minute

kind hatch
#

SSD

tardy delta
#

server starting up is slow tho

chrome beacon
#

You can also use hot swapping 🙂

tardy delta
#

mye i tried that and i broke stuff

#

i dont think im doing it correctly

chrome beacon
#

Just use paper userdev. It comes with all of that setup iirc

tardy delta
#

paper what?

chrome beacon
iron glade
tardy delta
#

ye i ended up at that site but it isnt sayin me anything

bold copper
tardy delta
#

whats Graal

bold copper
tardy delta
#

a vm?

tranquil viper
#

What significance does public void onLoad() have? Is it any different from onEnable() ?

bold copper
tardy delta
#

onload gets called when your plugin is loading

native elbow
#

do I have to restart the server every time when building the plugin? or can i just reload it

tardy delta
#

onenable when it enables, as simple as that

kind hatch
humble tulip
kind hatch
#

So if you need to do anything before the plugins get enabled, use the onLoad() method.

chrome beacon
humble tulip
#

like veryy early on

bold copper
humble tulip
#

i think economy plugins hook into vault in the onload?? im not 100% sure though

uncut bane
tardy delta
native elbow
bold copper
tranquil viper
flint carbon
#

How can you mix
player.sendMessage() and player.spigot().sendMessage()
One is meant for hex color and one is for hovering messages, but idk how to mix

slate mortar
tranquil viper
#

So can it replace the onEnable() method though? Or do I still need onEnable()

slate mortar
#

well depends

chrome beacon
slate mortar
#

at which point you load your plugin

bold copper
slate mortar
#

if it's loaded after the worlds (default), use the onenable

tranquil viper
#

Ok thanks, was checking out the worldguard api and noticed they had the onLoad() method so I was interested

native elbow
slate mortar
#

i dont think the onload has any real use-case anyway

kind hatch
#

It can

#

LuckPerms uses it for database setup.

slate mortar
#

well true, that takes a bit of time

kind hatch
#

They also need to be loaded before other plugins

chrome beacon
slate mortar
#

isn't that what you use loadbefore for?

#

or whatever its called

tardy delta
kind hatch
#

Yes, but there is another flag that lets you choose if you want STARTUP or POSTWORLD. I forget the name

#

Either way, those features only sometimes fit the usecase

#

Sometimes, you need to use the onLoad because the loadbefore isn't enough.

slate mortar
#

yea, load: STARTUP or load: POSTWORLD

#

i think

kind hatch
#

PAPI is a good example of loadbefore not being able to work.

slate mortar
#

but if you load it on startup, i'm pretty sure that the onenable is called right after the onload, so idk if it's that much of a difference

flint carbon
kind hatch
#

All onLoad methods from every plugin are called first, then every onEnable method is called shortly after all of the world loads. Unless specified otherwise with the load flag

tardy delta
#

you can achieve that with the Player#sendMessage method and the ChatColor.of or something, look at the forum

slate mortar
#

i mean yea, it may be useful if you really need to load stuff before some other plugin... but i think there's a flag to load your plugin before all others

iron glade
#

Anyone knows a way to save comments in a config file after editing it and saving it?

kind hatch
#

If you are using 1.18.2, spigot does this automatically.

slate mortar
#

setComments i guess?

kind hatch
#

Anything below 1.18.2 won't save comments due to the functionality not being added.

slate mortar
#

imagine not using 1.18.2

vocal cloud
#

Just bump the version on spigots side of things for 1.8 obviously /s

tardy delta
#

im using 1.17.1 smh

slate mortar
#

like

#

why

#

is there any reason to use 1.17 and not 1.18

quaint mantle
#

does somebody know how can I add delay in spigot

#

before running a code

kind hatch
#

?scheduling

undone axleBOT
iron glade
slate mortar
#
Bukkit.getScheduler().runTaskLater(plugin, () -> yourtask(), 20L); // 20 ticks delay```
kind hatch
#

That's not true

#

What's your server version?

iron glade
#

1.18.2

#

saveConfig() wipes all comments

kind hatch
#

Run /version

iron glade
#

and it's f'ing annoying me

kind hatch
#

How many versions behind are you?

chrome beacon
#

Latest Spigot should save comments

kind hatch
#

It does and it has for a while

slate mortar
#

i remember saveconfig wiping all of my config's contents lol

iron glade
slate mortar
#

dunno what drugs spigot was on back there

humble tulip
#

contents or comments?

kind hatch
#

That's odd.

slate mortar
#

everything

kind hatch
#

I'm 31 versions behind and I'm able to save comments with #saveConfig()

slate mortar
#

even when onEnable doing nothing but calling saveConfig(), it always wiped the whole file

iron glade
#

but only comments are getting wiped

slate mortar
#

i dont mean comments

iron glade
#

ik

slate mortar
#

i mean EVERYTHING

iron glade
#

ye ik

kind hatch
#

Can you share how you are saving and loading your config?

slate mortar
#

change my mind: i still wish for a method to completely remove complete sections

kind hatch
#

Uhh, #set("section", null)?

slate mortar
#

it just sets the value to null

kind hatch
#

Since when?

#

It's always removed the section for me.

iron glade
#
    public void editDefaultConfig() {

        plugin.getConfig().options().copyDefaults(true);
        plugin.getConfig().options().parseComments(true);
        plugin.saveDefaultConfig();

    }``` this in onEnable()
slate mortar
#

it makes

my:
  value: true

to

my:
  value: null```
#

thats all it does for me

iron glade
#

with saveConfig().

tardy delta
#

hasnt alot of the api changed in 1.18 or were that only some aspects?

slate mortar
#

i dont remember having anything beeing worse

#

or even changed at all

#

maybe just me, idk

kind hatch
# iron glade with saveConfig().

I normally avoid config options as the defaults just work for me. Try removing them and just using the basic #saveDefaultConfig()

tardy delta
#

ah then probably it had to do with world generation

kind hatch
slate mortar
#

world generation was always changing between versions

#

nothing new

#

also, there's no good "documentation" about worldgen

#

except old ass outdated 1.8/1.12 ones

tardy delta
#

hmm i thought something had changed

eternal oxide
slate mortar
#

then why tf

#

does it never work

quaint mantle
#

is this fine for creating a delay:


                public void run() {
                    block.getRelative(BlockFace.UP).setType(Material.RED_STAINED_GLASS);
                    task1.cancel();
                }
            }.runTaskTimer(plugin, 20, 0);

            task2 = new BukkitRunnable() {

                public void run() {
                    block.getRelative(BlockFace.UP).setType(Material.ORANGE_STAINED_GLASS);
                    task2.cancel();
                }
            }.runTaskTimer(plugin, 20, 0);```
eternal oxide
#

It works fine

tardy delta
#

why are you not using the scheduler and using 2 tasks?

kind hatch
tardy delta
#

i want to see the whole code

slate mortar
#

this makes my head blow

tardy delta
#

?paste

undone axleBOT
slate mortar
#

i always use set("path", null)

#

not "null"

tardy delta
#

that will remove the path no?

slate mortar
#

it never did for me

#

it always made the value just null

eternal oxide
kind hatch
# slate mortar i'm sure, yes

Well the only other thing I could think of is encoding issues or YAML parsing options that are set to something else.

tardy delta
#

soo much wrong in that code

tardy delta
#

i mean wtf

kind hatch
#

Oh

#

Oh no

tardy delta
#

first param is the initial delay and the 2nd the time in between repeats

eternal oxide
quaint mantle
#

thats the plugin

eternal oxide
iron glade
quaint mantle
flint coyote
tardy delta
#

i mean that code isnt going to do much

slate mortar
#
            Bukkit.getScheduler.runTaskLater(plugin, () -> block.getRelative(BlockFace.UP).setType(Material.RED_STAINED_GLASS), 20L);
            Bukkit.getScheduler.runTaskLater(plugin, () -> block.getRelative(BlockFace.UP).setType(Material.ORANGE_STAINED_GLASS), 20L);

basically exactly the same

quaint mantle
slate mortar
quaint mantle
slate mortar
#

runTaskLater runs it once

quaint mantle
slate mortar
#

with the delay you pass, in ticks

tardy delta
iron glade
eternal oxide
slate mortar
tardy delta
#

what does ig mean again?

#

i always forget

slate mortar
#

i guess

tardy delta
#

ah bruh why do i keep forgetting that

iron glade
#

Instagram

slate mortar
#

instagram is shit

kind hatch
# iron glade They're not getting added for me without the options, also I just tried putting ...

You may want to try using the manual approach then.

Just run saveDefaultConfig() in your on enable so that it gets written to disk.
Then override the #getConfig() method with your own.

File configFile = new File("config.yml");
FileConfiguration config = YamlConfiguration.loadConfiguration(configFile);

config.set("whatever", true);
try {
  config.save(configFile);
} catch (IOException ex) {
  ex.printStackTrace();
}
tardy delta
#

😳

slate mortar
#

i dont use it for like 2 years or smt

tardy delta
#

it can be shit but i still use it

iron glade
slate mortar
#

i only use it to simp specific people

iron glade
#

so ur using it

slate mortar
#

technically yes

#

i don't like anything

tardy delta
#

lil simp uwu

kind hatch
slate mortar
#

i dont do anything except scrolling through profiles

flint carbon
#

i'm saving base64 heads in memory, but after my server restarts, it stops stacking with those heads and create a new stack, is there a fix to this?

iron glade
flint coyote
#

did they change it recently? I didn't know

kind hatch
quaint mantle
iron glade
slate mortar
#
            Bukkit.getScheduler.runTaskLater(plugin, () -> block.getRelative(BlockFace.UP).setType(Material.RED_STAINED_GLASS), 20L);
            Bukkit.getScheduler.runTaskLater(plugin, () -> block.getRelative(BlockFace.UP).setType(Material.ORANGE_STAINED_GLASS), 40L);```
fixed
slate mortar
#

i thought they'd stop the flow until the task ran through

slate mortar
#

apparently not? idk

eternal oxide
#

I just tested Comment saving in 1.18.2. It works perfectly.

kind hatch
iron glade
flint carbon
# tardy delta ur recreating them?

well i'm storing it so it stacks with other heads, but after i restart, it has different nbt because what was saved into memory with hashmap is gone and resets

slate mortar
#

for the plugin

kind hatch
slate mortar
eternal oxide
#

I did saveDefaultConfig() Saved as expected. I then called saveConfig() comments were still there. I thien addedjava getConfig().set("test-value", "this is a test."); saveConfig();Config saved with the extra entry and all comments preserved

iron glade
#

<version>1.18.1-R0.1-SNAPSHOT</version>

slate mortar
#

theres your reason

#

change it to 1.18.2

iron glade
#

why tf did this change back to 1.18.1

#

i changed it like 3 times to 1.18.2

slate mortar
#

you remember

#

buildtools

#

the "issues"

#

i'm sure it has something to do with your nms not working for 1.18.2

iron glade
#

-.-

flint carbon
tardy delta
#

dunno

#

probably

iron glade
#

Changed it to 1.18.2, exported the plugin, and still comments gone

kind hatch
#

I don't think using the 1.18.1 API to make a plugin that runs on 1.18.2 would be an issue in this specific case.
The #saveConfig() method is present in both, so when you use the API, it will be there. But when it actually runs on 1.18.2, it should save comments.

iron glade
#

ikr

slate mortar
#

apparently not

iron glade
#

it's just so weird

quaint mantle
#

but it goes to the last block

#

too fast

kind hatch
# iron glade it's just so weird

Well, the only other things you can try are as follows.

  • Update your spigot to the latest using buildtools.
  • Refresh your maven project and maybe restart IntelliJ
  • Restart your computer
iron glade
#
  • throw myself outta the window
quaint mantle
quartz ember
#

I have an issue with hashmap, I create a location based on a vector and a world, but it wont match the one that I retrieve with the PlayerInteractListener.
I checked (Logged) and both of them share the same hashcode (because they have the same value). I cant wrap my head around this.
When I try to retrieve it obviously it fail.

kind hatch
#

There aren't any hidden spigot.yml settings for comments are there?

eternal oxide
quaint mantle
#

wait Celina is typing

tardy delta
#

🤔

slate mortar
#
BukkitTask task = Bukkit.getScheduler().runTaskTimer(plugin, () -> {
  //place block 1
  //place block 2
  //place block 3
  // place block 4
  task.cancel();
}, 0L, 10L);

not tested obv

eternal oxide
#

you either use one runTaskLater for each, or you use a runTaskTimer and code delay logic in it

slate mortar
#

no wait

#

thats dumb

#

whats wrong with me

tardy delta
#

idk

#

👉👈

slate mortar
#

i'm dumb

eternal oxide
#

@quaint mantle you are placing blocks top and 4 sides. not below?

crude loom
#

I have a weird bug, I canceled items despawning at a specific world for a minigame Im doing and for some reason this causes a duplicated-unpickable item to spawn when I use the /give command
Any idea why?

#

This is my code

@EventHandler
public void onItemDespawn(ItemDespawnEvent e){
        if(MiniGames.bedWarsGame.isOngoing() && isBedWarsWorld(e.getEntity().getWorld().getName()))
            e.setCancelled(true);
kind hatch
#

If you cancel that event, you may need to manually call #remove on the items.

quaint mantle
crude loom
tardy delta
#

uhm private is a thing

kind hatch
# crude loom I want the items to not despawn

Well, there are options for despawn time in the spigot config. However, you may have to do something like respawn the item as it despawns to make it look like it never despawned.

quaint mantle
slate mortar
#

just another idea

    private BukkitTask task;
    private int blocksPlaced;

    private void yourMethod() {
        this.blocksPlaced = 0;
        this.task = Bukkit.getScheduler().runTaskTimer(Main.getPlugin(), () -> {
            switch (blocksPlaced) {
                case 0 -> placeBlock1();
                case 1 -> placeBlock2();
                case 2 -> placeBlock3();
                case 3 -> placeBlock4();
            }
            blocksPlaced++;
            if (blocksPlaced == 3) this.task.cancel();
        }, 0L, 10L);```
i'm tired, keep that in mind lol
tardy delta
#

aaaaaa indeed

kind hatch
#

A little old school, but would still work.

new BukkitRunnable() {
  List<Block> blocks = new ArrayList<>();
  int counter = 0;
      
  @Override
  public void run() {
    location.setType(blocks.get(counter));
    counter++;
  }
}.runTaskTimer(plugin, 0, 10);
slate mortar
#

looks better than mine lmfao

#

i need sleep

#

much

tall dragon
#

heres an idea

#

go sleep

slate mortar
#

if i could, i would do that

slate mortar
#

but i just woke up like 5 hours ago

kind hatch
#

OPTIC?

tardy delta
#

how late is it?

slate mortar
#

for me it's 8pm lol

tardy delta
#

oh

slate mortar
#

dont ask

tall dragon
#

and u woke up 5 hours ago?

slate mortar
#

yes

#

i know

tall dragon
#

dont even wanna know

slate mortar
#

good

eternal oxide
# quaint mantle ?
    @EventHandler
    public void surroundBeacon(BlockPlaceEvent event){
        
        if (event.getBlock().getType() != Material.BEACON) return;
        
        BukkitTask task = new BukkitRunnable() {

            Block block = event.getBlock();
            List<BlockFace> faces =  Arrays.asList(BlockFace.UP, BlockFace.NORTH, BlockFace.SOUTH, BlockFace.EAST, BlockFace.WEST);
            
            public void run() {
                
                if (faces.isEmpty()) {task.cancel(); return;}
                BlockFace blockFace = faces.remove(0);
                block.getRelative(blockFace).setType(Material.RED_STAINED_GLASS);
                task.cancel();
            }
        }.runTaskTimer(plugin, 10, 10);
    }```
kind hatch
#

Yooo, that's clean.

eternal oxide
#

He didn;t have Down

#

Should work so long as Arrays.asList is muteable

slate mortar
#

i mean, it won't place a block below the beacon

#

idk what the usecase is tho

tardy delta
#

instantiating bukkitrunnables aaaa

eternal oxide
#

Yes, he did say 5 blocks

slate mortar
#

okay, then my bad lol

quaint mantle
eternal oxide
#

then add down too 😉

quaint mantle
#

ok

iron glade
#

I ran buildtools and replaced the old jar with the new one and still comments gone

eternal oxide
#

oh sorry a mistake

kind hatch
#

Did you run it in a new directory?

eternal oxide
#

Should be if (faces.isEmpty()) {task.cancel(); return;}

iron glade
kind hatch
#

Maybe something in your code is setting other flags that are preventing comments from saving.

iron glade
#

I don't have anything else config or even file related beside that

eternal oxide
#

ah won;t work. see Arrays.asList is immutable

midnight shore
#

How can I make a player open a random inventory , like crafting grid enchanting table , enderchest, wardrobe etc…?

kind hatch
quaint mantle
tardy delta
#

doesnt Arrays.asList blocks everything that modifies its size?

kind hatch
#

Oh, that's why. The comments need to be above the section name, not below it.

iron glade
#

really?

kind hatch
#

Yes

iron glade
#

no way

slate mortar
#

lol

slate mortar
#

such an easy fix lol

kind hatch
#

If it's not directly above a section, it will be removed.

ivory sleet
#

It’s a fixed size array list

tardy delta
ivory sleet
#

Idk

#

Shouldn’t trust everybody

tardy delta
#

stackoverflow best site

#

i was wondering what the difference with List.of was

ivory sleet
#

Yeah List::of is 100% immutable

#

Arrays::asList is only size immutable

kind hatch
#

You can have block comments as well, but if there is a space like this:

# Test Comment <--- This comment isn't tied to any section due to the space below it.

section: "Value"

# Test Comment <--- This comment is registered to `section1` and will stay.
section1: "value1"
iron glade
tardy delta
ivory sleet
#

set

iron glade
#

is there still something wrong?

tardy delta
#

i shouldve said 'other things than operations that modify the size'

eternal oxide
#
List<BlockFace> faces =  Stream.of(new BlockFace[]{BlockFace.UP, BlockFace.NORTH, BlockFace.SOUTH, BlockFace.EAST, BlockFace.WEST}).collect(Collectors.toList());```
#

muteable 🙂

kind hatch
tardy delta
#

or #set isnt modifying the size?

#

idk i never use that method

ivory sleet
#

myeah altho Collectors::toList doesn't specify mutability, so it could change in the future although unlikely

#

no

#

set doesn't

#

it sets an elements to the given index

tardy delta
#

ah so set doesnt work in List.of

ivory sleet
#

nope

tardy delta
#

ah i understand what you mean now

tepid ore
#

I'm trying to make a 1.8 plugin, but keep getting Missing artifact net.md-5:bungeecord-chat:jar:1.8-SNAPSHOT in my pom. Any idea how to fix it?

iron glade
#

The comments stay if I remove getConfig().set("Test-String", true); saveConfig();

#

as soon as I add it they're gone

tepid ore
#

Do config.save(WhateverFile); instead

eternal oxide
iron glade
eternal oxide
#

It knows who you are 😄

quiet ice
#

Using a recent version of spigot?

tardy delta
#

its spying on you

#

disable the telemetry

iron glade
#
public void editDefaultConfig() {

        plugin.getConfig().options().copyDefaults(true);
        plugin.getConfig().options().parseComments(true);
        plugin.saveDefaultConfig();

    }

@Override
public void onEnable() {

editDefaultConfig();
getConfig().set("Test-String", true);saveConfig();

}
--> comments gone```
iron glade
eternal oxide
quiet ice
#

Yeah, generally they are not required

eternal oxide
#

in onLoad() saveDefaultConfig()
in onEnable add the section and saveConfig()

quiet ice
#

Why do they even exist 🤨

flint carbon
#

i'm saving base64 heads in memory with a variable, but after my server restarts, it stops stacking with those heads and create a new stack, is there a fix to this?

iron glade
#

jesus christ

#

it's working now

#
plugin.getConfig().options().copyDefaults(true);
plugin.getConfig().options().parseComments(true);```  those 2 piece of ****
tall dragon
kind hatch
robust zenith
#

hi guys, console doesn't spam errors but i don't know why this is not working

eternal oxide
iron glade
#

anyway, thanks for helping me with that struggle

eternal oxide
robust zenith
#

yep yep and I registered events

eternal oxide
#

add debug then. sysout

robust zenith
#

uh nope i have an error for real

#

pasting that

eternal oxide
#

COBWEB is not in yoru enum

eternal oxide
#

wrong server version I guess

#

?paste

undone axleBOT
robust zenith
#

sooooooo (?)

eternal oxide
#

sorry mistake again, remove the last task.cancel() line

quaint mantle
#

ok

eternal oxide
tardy delta
#

whats wrong with new ArrayList<>(Arrays.asList()) heh

eternal oxide
#

teh code uses .remove on teh list

#

well

#

yours would work

#

new ArrayList of a List 🙂

robust zenith
tardy delta
#

yesj

eternal oxide
tardy delta
#

Arrays.asList is just an array wrapper 🤤

robust zenith
eternal oxide
#

or you don;t have an api version so its defaulting to legacy

lofty belfry
#

is there any way to make custom structures or caves?

robust zenith
exotic jetty
#

how do i add a string to an array in a config?

config.set("clans." + clanx + ".members", config.getList("clans." + clanx + ".members").add((String)player.getUniqueId().toString());
#

this is what i have rn

#

problem = 'add(capture<?>)' in 'java.util.List' cannot be applied to '(java.lang.String)'

eternal oxide
#

config.getList returns a List. you need to store that to a local variable, modify it, then put it back

kind hatch
#

You need to do the steps individually.

exotic jetty
#

ty

rotund scroll
#

what event would i use to get when a player right clicks another player

kind hatch
#

PlayerInteractEntityEvent

#

Just check if the clicked entity is an instance of Player and there you go.

rotund scroll
#

how do i check that

#

event.getRightClicked().getEntityId() ?

tardy delta
#

rightclicked instanceof Player

quiet ice
#

config.getConfigurationSection("items").getKeys(false) returns ["pirates_compass", "cod"]

#

What happened to sysout-debugging?

patent horizon
#

but it's supposed to look into those branches for the values

quiet ice
#

And what value is "cod.rarity"?

patent horizon
#

“COMMON”

quiet ice
#

Look at your config again

patent horizon
#

do i need quotes?

quiet ice
#

Whatever: it is not set

alpine urchin
#

where'd i be without my slatts?

quiet ice
#

"COMMON" would be "items.cod.rarity"

alpine urchin
#

@onyx fjord

patent horizon
#

ohh

onyx fjord
patent horizon
#

looks similar, but it didnt error on load this time

quiet ice
#

what is the code?

patent horizon
#

it's an artwork

quiet ice
#

You never set the rarity to the PDC

patent horizon
#

which pdc?

#

i have a pdat var for the fishing rod's pdc

quiet ice
#

Well the PDC that is used in the line that errors

patent horizon
#

if (rarity != null) setString(item, new NamespacedKey(PlexPvP.get(), "rarity"), rarity.toString());

#

rarity isn't null for either of the available items

quiet ice
#

It is

#

Where the hell did you pull up that line anyways?

patent horizon
#

that entire class is just for loading all the items specified in the config file into the correlating lists

quiet ice
#

Fishable.trashItems.get(ThreadLocalRandom.current().nextInt(0, Fishable.trashItems.size()+1)); also, this is asking for an IOOBE

patent horizon
#

whats that

quiet ice
#

IndexOutOfBoundsException (or in C speak, segfault)

patent horizon
#

but i make sure the list's size isn't zero beforehand

#

if it's not zero, it'll work

quiet ice
#

Lists are 0-indexed, that is that list.get(list.size()) is guaranteed to throw an IOOBE

quiet ice
#

Considering that this did not happen, the else statement was invoked, creating a fresh itemstack with no PDC (or you just had enormous luck)

patent horizon
quiet ice
#

You have a +1 there

patent horizon
#

ohhh

quiet ice
#

I am not very experienced with the new switch tables, but chances are you may need to add a break in there

patent horizon
#

nah the new ones dont need em

#

i found the problem

#

i didn't add at least 1 item for every possible rarity in my config, so i just got lucky and pulled a legendary

fickle crater
#

i am currently trying to make an npc and when i try to import import net.minecraft.server.level.ServerPlayer; it says it doesnt exist. The net.minecraft.server.level part exists but ONLY THE SERVERPLAYER PART DOESNT EXIST

glass mauve
#

you use mapping?

fickle crater
delicate lynx
#

yeah it's EntityPlayer

fickle crater
rough drift
#

you mean those?

#

or do you mean

#
switch(thing) {
  case thong && thong instanceof Integer myInt -> stuff;
}
```these
quiet ice
#

Both

ivory sleet
#

well

#

switch expressions do not fall through thank god

rough drift
#

nope

#

they are going to mostly replace if/elses now

#

which is pog

ivory sleet
#

uh sorta

uneven fiber
#

any idea how to give an mob increased knock back

ivory sleet
#

yeah

#

could be done with attribute modifications

sterile token
#

Lol, when doing event.setCancelled(false) you can breaks plugins lmao

ivory sleet
#

depends on the definition of breakage but sure

sterile token
#

I just realized

#

And that its not specified on the docs...

#

I thik its somth rlly importanrt....

tardy delta
#

depends on their events priority

patent horizon
#

is there any way i can change the drop from fishing event

#

manually throwing an item at a player is finnicky

sterile token
patent horizon
#

drop event?

sterile token
#

?jd-s

undone axleBOT
patent horizon
#

there's .getCaught()

sterile token
#

There you have all events

ivory sleet
#

it is entirely up to plugin developers themselves to resolve event handler execution order

tardy delta
#

its how protection plugins work lol

sterile token
ivory sleet
#

its from the api

ivory sleet
#

I am talking about Cancellable::setCancelled

uneven fiber
#

good golly

sterile token
ivory sleet
#

wym?

sterile token
#

Is it from spigot?

ivory sleet
#

yes

#

lol

tardy delta
#

events that implement cancellable have the setCancelled method

sterile token
#

I thought it was defined like closeable

ivory sleet
#

similarly ig

#

but still

sterile token
tardy delta
#

what am i doing here lol

ivory sleet
#

why should it be documented?

#

its an accountability plugin devs have to take into consideration verano

#

nothing that needs or should be documented

sterile token
#

Becaue idiots like can use it and break others things just as stupidity

#

But meh

ivory sleet
#

I mean you can break the bukkit api in 200 different ways

#

Bukkit::setServer being the most obvious one

sterile token
ivory sleet
#

no they mustnt

#

its your fault if you're an idiot

sterile token
#

Not document libraries != not correct documented library

sterile token
ivory sleet
#

nope

sterile token
#

That why i love u <3

ivory sleet
#

but people who intentionally break stuff and expect documentation or fixing

sterile token
#

You have a completly different personality

ivory sleet
#

ig lol

sterile token
ivory sleet
#

yes tho I believe its not something that should be documented

#

if the implementation by itself can cause stuff to explode

sterile token
#

Okay

ivory sleet
#

then that must be documented

#

else, the api should only document the functionality of what its intent is

sterile token
#

Ahh because you break it in client side, not server side

#

I understand

ivory sleet
#

myeah sort of

sterile token
#

I was having a nithmare

ivory sleet
#

consumer-side to be nitpicky but ye

sterile token
#

The Flag.Build stills trolling me

#

Its amazing

ivory sleet
#

thought u fixed that ages ago

sterile token
#

Age ago?

#

Just passed 1 day

#

Less

#

Idk why most people are trolling all time

ivory sleet
#

most people trollformation

sterile token
#

Its really annoying, me is a specially case because i have the language barricade

#

So something i dont follow the indifications because i dont understand it, not because im trolling

ivory sleet
#

yeah altho your english has become significantly better since you joined tbf

sterile token
#

Oh nice to hear that

#

I have something strange

#

!((contion1 && contidion2)) return;

They 2 are true, why not returning

#

Im annoyed

crude cobalt
#

Why it's not work?

if(e.getPlayer().getInventory().getItemInMainHand() == new ItemStack(Material.AIR))
ivory sleet
#

because of the ! (verano)

tardy delta
#

compare with equals

sterile token
#

That can be really laggy sometime

sterile token
#

To negate the 2 inputs

#

🤔

#

Oh f** its not inside the first bracket

#

I just realized

ivory sleet
#

lol ye

sterile token
#

That why lmao

#

I was shiting the table

#

Because i get mad and just realized was that

maiden thicket
#

💀

crude cobalt
#

But that doesn't work either:

if(e.getPlayer().getInventory().getItemInMainHand().equals(Material.AIR))
maiden thicket
#

and ur comparing it to a material

ivory sleet
maiden thicket
#

you have to do getMaterial() on the getItemInMainHand

maiden thicket
#

💀

sterile token
#

Who is doing me ghost pings

#

Really i ill need to install better discord to see who is strolling

crude cobalt
sterile token
unreal quartz
#

What is an java

sterile token
#

They are documentions about every classes, methods, arguments, etc

hexed hatch
sterile token
crude cobalt
ivory sleet
#

There exists javadocs for the spigot api as well tho :3

undone axleBOT
tardy delta
#

what is spigot

crude cobalt
#

I said about this

sterile token
#

Oh is just realized he is one of the trollers group

#

He is strolling

uneven fiber
#

who

sterile token
uneven fiber
#

whatever daddy wants, daddy gets...

sterile token
#

Why ae yu tagging?

#

Do you think its funny

uneven fiber
#

that was the latmi guy

sterile token
#

Because me i dosnt think

#

Oh sorry

#

My bad

#

I thought you where tagging me

uneven fiber
#

lol, he is replying to you and tagging me

#

and then deleting for somereason

sterile token
#

He is trolling

crude cobalt
#

Who?

ivory sleet
#

Verano you really gotta stop these troll accusations

uneven fiber
#

no hes actually trolling lol

#

this latmi chap

sterile token
#

Really conclure check the logs

uneven fiber
ivory sleet
#

Ignore them then

tardy delta
#

its very simple

#

why dick i rightclick on conclure for this 🤔

uneven fiber
#

why dick you?

tardy delta
#

shouldnt you be asleep?

#

poor kiddo

crude cobalt
#

And you still call me a troll?

quaint mantle
#

why dick he call you a troll?

crude cobalt
#

What?

#

Why dick

uneven fiber
#

whatever daddy wants, daddy gets

sterile token
crude cobalt
#

I accidentally

ivory sleet
#

You sure?

sterile token
ivory sleet
#

Doesn’t look like a ghost ping

uneven fiber
#

it def was not an accident lol

ivory sleet
#

Checked the logs

uneven fiber
#

you were purposfully doing that

earnest forum
#

logs don't show deleted messages if it's from the owner of the message

#

because you don't need a permission to delete your own messages

tardy delta
#

what are the kids doing lol

crude cobalt
#

I admit that I pinged and deleted the post

ivory sleet
#

We log all messages lol

earnest forum
#

I mean in audit log

ivory sleet
#

Oh yeah

#

But we have a bot in addition

crude cobalt
#

But I just found it useless

earnest forum
#

yeah I forgot about that

crude cobalt
#

And it was 1 time

uneven fiber
#

yo how do i reset something AFTER a runnable

tardy delta
#

wdym?

uneven fiber
#

one moment

earnest forum
#

run a method after the runnable is finished

#

but inside the runnable still

uneven fiber
#

I want to set count back to zero after the runnable is finshed

#

but rn im failing to do so

earnest forum
#

finished doing what?

#

you never cancel the runnable

uneven fiber
#

egad

slate mortar
#

well yea.. the runnable doesn't ever end

chrome beacon
#

Why not use the sneak event

sterile token
#

Nice java still hatting me

crisp steeple
#

what happens when you teleport someone to NaN

#

🥸

tardy delta
#

what even is NaN in java?

quaint mantle
sterile token
crisp steeple
tardy delta
#

i know about Double.NaN but i forgot its value

crisp steeple
#

i think its like infinity / -infinity

#

nope its 0/0

#

it acts very strangely

tardy delta
#

¯_(ツ)_/¯

sterile token
#

Who had a library for cuboids and regions?

#

Was it redemp?

ivory sleet
#

ye

sterile token
#

Allright

ivory sleet
#

I mean there are many libs

sterile token
ivory sleet
#

which has volume framework classes

sterile token
#

Conclure im an ifull idiot

#

I realized again, the flags is applied when breaking, hich i never updated that event

#

I dont kno why i get annoyed easly instead of thinking quiet

slate mortar
#

ah now the random friend requests start coming again

#

almost missed it lol

sterile token
#

Celina talking to?

tardy delta
#

🥲

slate mortar
#

just random msg

sterile token
#

They are all virgins that way

slate mortar
#

i remember like when i was active in here i got like 10 random fr's per day

#

then when i wasn't booster anymore it stopped, and now it starts again

sterile token
#

its normal when they see a girl they all want to dm her

slate mortar
#

you don't have a female pfp

#

now imagine my dm's

sterile token
tardy delta
#

i get them sometimes i when i accept i get stuff like free nitro 💀

slate mortar
#

most of em i delete instantly

sterile token
#

Ah yeah

slate mortar
#

also it was on my other acc previously

sterile token
quaint mantle
tardy delta
#

im just curious

uneven fiber
#

how can they tell if ur a girl or not if you dont have a female pfp 🧐

quaint mantle
#

php

tardy delta
#

php yes

uneven fiber
#

🖖

slate mortar
#

i'd never accept random dm's

sterile token
#

oh ok

#

strange

slate mortar
#

most of them even come from people who never sent a message in here

sterile token
#

Are you young?

uneven fiber
#

LOL

slate mortar
#

what has my age to do with it? lmfao

uneven fiber
#

bro chill

#

dont ask people that

sterile token
#

Just curious

slate mortar
#

yea

#

dont ask

#

just check out my profile lmfao

sterile token
#

And sorry

uneven fiber
#

lmfao that was funny

pastel juniper
#

Is there any other way to check for custom inventories except checking the name???

sterile token
slate mortar
#

funny because you couldve just checked my profile with 1 click

#

and see it

uneven fiber
#

Are you young?

slate mortar
#

depends

quaint mantle
slate mortar
#

on how you see it

uneven fiber
#

whatever daddy wants... daddy gets

slate mortar
#

i'd say 20 is still pretty young

sterile token
tardy delta
#

olivo real bro talking about inv holders

quaint mantle
#

Whatever daddy wants, daddy gets.

slate mortar
#

daddy daddy

quaint mantle
#

ur weird

slate mortar
#

i know

crisp steeple
#

intellij is wrong

tardy delta
#

lemme see

sterile token
wet breach
slate mortar
#

but you're not female

sterile token
#

I was doing, a * a and he was telling me to do: a * 2

slate mortar
#

you can be as popular as you want to be

tardy delta
slate mortar
#

if youre not female, you'll never get the same amount of simp dm's

wet breach
uneven fiber
#

coding simp dms 💪

quaint mantle
#

savesta ^

tardy delta
#

boys with a female pfp 😎

slate mortar
#

just because the amount of virgin guys who send random dm's to girls is usually higher than the other side

wet breach
quaint mantle
uneven fiber
#

probably her own experince lol

slate mortar
#

knowledge mainly

humble tulip
#

#general

slate mortar
#

on my personal dm's i got in my life

wet breach
#

did you compare to a male?

uneven fiber
#

ok this is getting weird

quaint mantle
#

i've never got any simp dms pensive_cry

slate mortar
#

i didn't, but i'm pretty sure you don't get about 10 simp dm's/fr's per day

quaint mantle
slate mortar
#

if you do, i apologize

sterile token
quaint mantle
slate mortar
#

aight, then i'm very sorry

sterile token
#

Of course i will not do it if you dont want it

slate mortar
#

and i hope it gets better lol

wet breach
#

I used to be Bukkit Dev staff. When I was one, it was even worse 😛

slate mortar
#

well yea, that makes sense

#

dont wanna see choco's dm's/fr's

sterile token
wet breach
#

I applied and was accepted years ago

tardy delta
#

applications i guess

#

:o

sterile token
#

Are they till being done?

slate mortar
#

why aren't you staff anymore?

wet breach
slate mortar
#

ahhh the dmca thing

#

i remember

wet breach
#

Evilseph isn't exactly the best to talk to even wolvereness

slate mortar
#

good ol times

wet breach
#

they both had way too big of ego's

#

never believing that anyone else knew better

slate mortar
#

sounds like that could've been me

wet breach
#

they also would routinely make fun of people who made PR's and would reject PR's that were good but simply they didn't want to make the effort to implement or because they didn't think of it

#

very toxic people

slate mortar
#

got so toxic with the years

wet breach
#

Yes but it is what led to the downfall of Bukkit

#

Wolvereness did the DMCA because Evilseph forgot he couldn't make executive decisions anymore such as shutting the project down since he sold his rights to Mojang

#

Everyone that was employed by Mojang sold their rights to the project to them before being employed including evilseph

#

the only person who never had their rights bought was Wolvereness

slate mortar
#

i'm confused

#

again

wet breach
#

So some of the Mojang devs

#

they came from Bukkit Dev

tardy delta
#

o

wet breach
#

Those dev's had rights over code they contributed

#

However, Dinnerbone and Evilseph had rights to the entire project

#

which both were bought by Mojang

#

Evilseph didn't last at Mojang and is the one that was supposed to help develop the Minecraft API

#

and it is probably because of him that it never happened and was let go

#

technically he resigned but they didn't give him a choice lol

#

But, he came back to Bukkit Dev as the project leader/Manager. He attempted to shut bukkit down using the excuse of the whole EULA thing forgetting he doesn't have those powers no more, since you know he sold the project

#

and yeah, that is when the DMCA happened and then the mass exodus of the staff members

slate mortar
#

i see... i think...

#

that honestly reminds me a bit of the rockstar modding situation with t2

wet breach
#

lol

slate mortar
#

too dumb to make stuff themselves while earning millions per day, and then sending pi's to modders homes

#

gonna love it

wet breach
#

I wouldn't mind a pi

#

if it was free

slate mortar
#

they literally sent pi's to the homes of modders because of modding tools for singleplayer... thats so fucking dumb

#

if they mess with the multiplayer stuff okay, fine... but lmfao

wet breach
#

the main reason Wolvereness DMCA'ed though is because he was left out in terms of being paid for their code. He even attempted to sell his rights and was rejected. He didn't know I guess that his peers who were hired were bought out before being employed to include evilseph. And I guess was left out of the loop on that.

#

and just retaliated XD

sterile token
#

Fros tthat the story about plugins?

slate mortar
#

i mean, that makes a bit of sense at least

wet breach
quaint mantle
#

who ping

wet breach
#

the ghost

sterile token
quaint mantle
sterile token
#

@quaint mantle did you where the owner of purple server?

quaint mantle
#

what?

sterile token
#

Did you have mc server called purple network

quaint mantle
#

no lol

sterile token
#

Oh ok

wet breach
sterile token
#

Hmn there is a server called purple or purpur

#

Im not sure

#

Or my time where i play it existed

wet breach
#

ignPurple isn't even remotely close to the one that owns purpur

sterile token
#

Oh ok

#

My bad i confused him

tardy delta
#

-<

wet breach
sterile token
#

frost so evilpeh caused all the DMCA problems, with rights he have selled

wet breach
sterile token
#

In teory if you sell the rights, you cannot do anything because you are not anymore the owner

wet breach
#

Wolvereness I think was the only dev who was part of the original group or one of the main devs that had been there a while that was never employed by Mojang.

#

nor even knew that his peers who were employed had their rights bought out

#

I was there for the conversation when he did learn that was the case

sterile token
#

what means peers?

wet breach
#

others that were like him. in this case the other main devs of Bukkit

#

the ones that left for Mojang

sterile token
#

Also the story can be distributed? because most of time its confidentials information

wet breach
#

AKA Dinnerbone, Grum, etc

wet breach
sterile token
#

Was it mc designed by a man from USA?

#

I dont kknow the name know

slate mortar
#

uhh

wet breach
#

Markus "Notch" Persson

sterile token
#

yeah

echo basalt
#

he swedish

wet breach
#

and no they are not American

#

They are Swedish

sterile token
#

Oh sorry, for me every english speaker == usa

#

i dont know why

echo basalt
#

minecraft's main inspiration is probably ikea

slate mortar
#

i wonder what would've happened to mc by now if he would still be the "leader"

sterile token
#

Also, minecraft when where planned

wet breach
#

Minecraft just grew into its own thing after that

earnest forum
#

cave game

wet breach
#

Hep

#

Yep*

#

Even Markus has stated as such as well

earnest forum
#

the old herobrine jumpy things scare me

echo basalt
#

I wonder what cave game is about

wet breach
#

digging

#

that is it lmao

echo basalt
#

fuck I guessed wrong

earnest forum
#

you just dig and place

sterile token
#

Why still using C++ for games when there is a thing called C#?

echo basalt
#

because c# is microsoft's bootleg java

tardy delta
#

C++ is more low level

wet breach
#

C++ is used typically for backend

sterile token
echo basalt
#

unity runs on c#

#

there's that

earnest forum
#

and JavaScript but who uses JavaScript

sterile token
#

Me

echo basalt
#

ew javascript

#

do I look like a website to you

earnest forum
#

assembly

echo basalt
#

ew

sterile token
#

I use js, but im planning to change typescript

#

Do you recommend?