#help-development

1 messages · Page 1651 of 1

solid cargo
#

hmu in dms if you want to

quaint hedge
#

How from PermissionCheckEvent i can get all the permissions of all the bungee plugins?

chrome beacon
#

You would need to index all plugins

tidal skiff
#

do Player variables delete when the player in question disconnects? cuz i have a hashmap which is a player that corresponds to an inventory but the player no longer corresponds to that inventory if the player disconnects

solid cargo
ivory sleet
vivid hill
#

Team timezone = board.registerNewTeam("timezone");
timezone.addEntry(ChatColor.GRAY+ "" );
timezone.setPrefix(ChatColor.GRAY+ TimeZone.getTimeZone("GMT+05:30"));

so i am trying to put time on a scoreboard error in 3 line

ivory sleet
quaint hedge
ivory sleet
#

However player objects become broken once their host disconnected

tidal skiff
ivory sleet
#

One way is to use UUID

chrome beacon
#

Why though?

tidal skiff
ivory sleet
#

It by default is persistent

restive tangle
#

i made a customentity , i want to check if that customentity exists in the world and if does not , do something

tidal skiff
#

no its a vault inventory

chrome beacon
#

Sounds like you want to leak ram

ivory sleet
#

Hmm you should store the vault inventory

chrome beacon
#

^^

tidal skiff
#

lmfao

quaint hedge
#

I hate this permissions topic.He is really annoying

chrome beacon
#

Save to a file

tidal skiff
#

yeah

chrome beacon
#

You can just use the configuration api

#

Saving things in yaml. Not the most efficient storage but will be easier

quaint hedge
#

I think i found a way!

#

Its really from PermissionCheckEvent

#

and i print every time when the event is turn on the permission that he check

solid cargo
#

yo i have thinked of all return combos

#

and still no luck

#

meh might be tuinity

tardy delta
#

if ! entity.isDead() ?

rare crater
plain scroll
#

So this is suposted to make a new selection in the config and + 1 when ever its ran - But instead it doesnt + 1 and it removes everything in the config ( like all other options? )

#

oh i think i get why
because each time i click on paper
its re-doing all that code right ?
SO
its remaking the value as 1

#

but im not sure

quaint hedge
#

@ivory sleetThank you so much man! apparently when a player is enter to the server the event is goes through on all the permissions of all the bungee plugins and thats the way to get all the permissions

ivory sleet
#

Cheers

grim ice
#

how to change config section name without deleting spigot

solid cargo
#

yo why does the command not execute? i returned it only at the end?

ivory sleet
#

Wtf

solid cargo
#

uh oh

#

dont tell me about efficency

#

ik its there is more efficent ways

quaint mantle
solid cargo
#

idc about how long it is

#

i just care why it doesnt execute

quaint mantle
#

the length of it is not the main issue...

solid cargo
#

i know

quaint mantle
#

anyway how are you registering it

solid cargo
#

it exectued before

#

in main class

quaint mantle
#

yes but how

#

like show the code

solid cargo
#

getCommand("bigkaboom").setExecutor(new BigKaboom());

rigid hazel
#

Hello. Can i set the GUI-Saize from the player on my server?

crude charm
#

my

#

fucking

#

god

quaint mantle
#

you also check for if the command equals "bigspecific"

crude charm
#

lmfao

lost matrix
solid cargo
#

i. dont. care, about. the. length. it executed. before.

crude charm
#

my eyes

#

LMFAO

grim ice
#

can u guys help him instead of this brainless argument

quaint mantle
#

so you need to register the "bigspecific" command

plain scroll
sullen dome
#

okay, so i got this code (probably messy, that's not the issue tho)

    private void breakOrePart(Block startBlock) {
        if (isOre(startBlock)) {
            startBlock.breakNaturally();
            for (BlockFace face : blockFaces) {
                Block newBlock = startBlock.getRelative(face);
                Block newBlock2 = startBlock.getRelative(face).getRelative(BlockFace.UP);
                Block newBlock3 = startBlock.getRelative(face).getRelative(BlockFace.DOWN);
                if (isOre(newBlock)) breakOrePart(newBlock);
                if (isOre(newBlock2)) breakOrePart(newBlock2);
                if (isOre(newBlock3)) breakOrePart(newBlock3);
            }
        }
    }```

it works nearly perfectly, except... it's not dropping any experience... and i couldnt find a way to drop xp.. is there a way?
solid cargo
#

but bigspecific is going as is

#

ah

grim ice
crude charm
quaint mantle
#

also that listener will never fire since you never implement listener in that class

crude charm
#

its gotta be a joke

solid cargo
#

guys

grim ice
#

help him or shut your disgusting mouth

solid cargo
#

IDFC ABOUT EFFICENCY

plain scroll
#

bruh dont argue in a fukin help server

quaint mantle
#

Oh My God

solid cargo
#

its my plugin and my choice. period.

crude charm
quaint mantle
#

Wtf

plain scroll
sullen dome
#

god, where did i got into

lost matrix
crude charm
ivory sleet
#

Pillow have you tried debugging with print statements or something?

plain scroll
plain scroll
ivory sleet
#

So the command isn’t performing at all?

lost matrix
sullen dome
grim ice
sullen dome
#

and with ItemStack, i don't see any way to drop xp

grim ice
#

im changing my config section name, ur changing its value

quaint mantle
grim ice
#

I disagree

solid cargo
#

like ik its not efficent

quaint mantle
grim ice
#

either help him with his question or shut your mouth

quaint mantle
grim ice
#

you're just annoying

lost matrix
quaint mantle
#

Look who’s talking

ivory sleet
sullen dome
#

Breaks the block and spawns items as if a player had digged it with a specific tool
items
i want experience :o

am i just as dumb as almost everyone in here rn?

grim ice
#

"LMFAO" "LMAO" on someone who's trying to learn isn't helpful

ivory sleet
#

I haven’t read the convo

quaint mantle
solid cargo
lost matrix
solid cargo
#

the console is clear

quaint mantle
#

and you registered both bigspecific and bigkaboom in your onEnable and plugin.yml?

rigid hazel
#

Hello. Can i set the GUI-Saize from the player on my server?

crude charm
#

this is a shit show

lost matrix
solid cargo
#

ah ok

ivory sleet
#

Anyways you can always determine the size at creation of an inventory

plain scroll
sullen dome
rigid hazel
solid cargo
sullen dome
#

imagine playing mc in german

rigid hazel
ivory sleet
lost matrix
rigid hazel
#

Please.

ivory sleet
#

Custom client

solid cargo
#

nothing, all i want to say that its my choice on what end i start

#

ok bye

rigid hazel
sullen dome
#

nope

quaint mantle
#

nope

sullen dome
#

except you scale it like 50 times smaller

#

so it looks ugly af

lost matrix
#

Why do you want to set this anyways?

sullen dome
#

but then items will be weird moved

rigid hazel
plain scroll
quaint mantle
#

mod or custom client, literally your only two options

sullen dome
#

yep

rigid hazel
sullen dome
#

you can use \n in descriptions

lost matrix
sullen dome
#

or use shorter descriptions

restive tangle
#

i want to check if a world has a custom entity that i made , how would i check

sullen dome
#

newest

rigid hazel
sullen dome
lost matrix
sullen dome
#

is there a method like dropExperience(amount)?

restive tangle
#

i am asking how would i scan for my custom entity

sullen dome
#

or just an instanceof?

crude charm
#

^

#

depends how you made it

lost matrix
solid cargo
#

yo i might have found the issue, i just wasnt careful

crude charm
undone axleBOT
crude charm
#

thats the issue

sullen dome
#

god, what a messy way... but if that works :3

solid cargo
#

dw

crude charm
#

you should learn it BEFORE spigot

solid cargo
crude charm
#

then fuck off

solid cargo
#

no u

crude charm
#

dont ask for help

grim ice
quaint mantle
#

it's his choice to do it his way if he wants

grim ice
#

@ivory sleet ^^

#

pls come and do smth to this weirdo

quaint mantle
#

there is no point in trying to convince him to do otherwise

grim ice
crude charm
#

his choice but he will suffer long term

grim ice
#

no one wants you here

crude charm
rigid hazel
#

Can I create a link, that redirects the player to the minecraft settings?

grim ice
#

?paste

undone axleBOT
rigid hazel
#

Or link that sets the gui size

plain scroll
crude charm
#

If he wont learn basic java then he is wasting peoples time by posting here

restive tangle
crude charm
#

whatever

#

idc

quaint mantle
restive tangle
#

dont be an ass to people and they wont be an asshat back

quaint mantle
#

nope

rigid hazel
#

Sad.

solid cargo
#

bro im like actually the most polite person in my class, and this is what i get lol

rare crater
grim ice
#

it changes the config to the next message he sends in chat

quaint mantle
# rigid hazel Sad.

shorten the lore to make it fit, and use less spacing or a word wrapping util

rigid hazel
grim ice
#

@restive tangle wait wtf

#

are you real quzack lmao

solid cargo
#

yeah btw i am sorry for asking these kinda basic q's

restive tangle
#

I'd think so , yes

grim ice
#

were you a mod in sound's world

restive tangle
#

maybe , why?

crude charm
restive tangle
#

its a discord server

grim ice
#

yes

crude charm
#

For spigot?

grim ice
#

and the item gets renamed too because the item name is based off the config

#

but the item just becomes "null"

#

and the config doesnt change

lost matrix
grim ice
#

7smile can u help ?

lost matrix
#

In a sneak event or something

lost matrix
grim ice
#

o

plain scroll
sullen dome
#

oh god, my bad, i'm just dumb asfuck

#
   private void breakTreePart(Block startBlock, int exp) {
        if (isLog(startBlock)) {
            startBlock.breakNaturally();
            for (BlockFace face : blockFaces) {
                Block newBlock = startBlock.getRelative(face);
                Block newBlock2 = startBlock.getRelative(face).getRelative(BlockFace.UP);
                Block newBlock3 = startBlock.getRelative(face).getRelative(BlockFace.DOWN);
                if (isLog(newBlock)) breakTreePart(newBlock, exp);
                if (isLog(newBlock2)) breakTreePart(newBlock2, exp);
                if (isLog(newBlock3)) breakTreePart(newBlock3, exp);
            }
        }
    }

    private void breakOrePart(Block startBlock, int exp) {
        if (isOre(startBlock)) {
            startBlock.breakNaturally();
            spawnExp(startBlock.getLocation(), ThreadLocalRandom.current().nextInt(100) <= 50 ? exp : 0);
            for (BlockFace face : blockFaces) {
                Block newBlock = startBlock.getRelative(face);
                Block newBlock2 = startBlock.getRelative(face).getRelative(BlockFace.UP);
                Block newBlock3 = startBlock.getRelative(face).getRelative(BlockFace.DOWN);
                if (isOre(newBlock)) breakOrePart(newBlock, exp);
                if (isOre(newBlock2)) breakOrePart(newBlock2, exp);
                if (isOre(newBlock3)) breakOrePart(newBlock3, exp);
            }
        }
    }```
i used it in the upper method... i should learn reading lmao
tardy delta
#

:/

ornate heart
#

How would I put a player in a swimming animation when they aren't in water?

sullen dome
#

Player#setSwimming

ornate heart
#

Tried that. Nothing happens. The API also explicitly states this

sullen dome
#

then...

#

no idea

#

what's with setGliding

ornate heart
#

I'll try that

sullen dome
#

wow, my ps5 controller is actually charged... wonderful

solid cargo
#

okay as it turned out i accidentally set /bigspecific for 2 commands

#

so it actually needed to be /bigkaboom

#

lmfao

thick tundra
#

Hello. Im currently using this code : ```
public double getAudioLRValue(Player p, Location target){
Vector look = p.getLocation().getDirection().normalize();

    Location head = p.getLocation().add(0, p.getEyeHeight(), 0);

    Vector direction = head.subtract(target).toVector().normalize();

    Vector cp = direction.crossProduct(look);
    return cp.normalize().getZ();
}

to calculate if the audio should come out of a right or a left speaker for my audioclient. but when i get behind a block it just flips. any way i can fix this code so it unflips the audio automatically if i get behind a block?
solid cargo
#

and also invalid plugin.yml but that was easy to fix

grim ice
#

pls some1 help

ivory sleet
#

?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.

grim ice
#

anyone

#

ooo nuxoria i remember you :D

vital ridge
#

From where :D?

#

Ill try to help you in a sec but from where ?

grim ice
#

u helped me before

#

lol

#

around a month ago or smth

quaint mantle
#

you need to get the item before you do the scheduler

grim ice
#

how? like wdym

quaint mantle
#

right after you check if the event is a shift click, get the item

vital ridge
#

Is anybody good at trigonometry?
Or decent
https://paste.md-5.net/izotohudiw.cpp
This code here is used to calculate the right yaw and pitch so the player will be looking at the target he is hitting, I dont understand a small part of the code, I'd need help with understanding it.

grim ice
#

uh

grim ice
#

can u tell me where did i mention the item inside the scheduler

quaint mantle
#

you get the item here ItemMeta meta = event.getCurrentItem().getItemMeta();

grim ice
#

oh that

#
        String warp = ChatColor.stripColor(event.getCurrentItem().getItemMeta().getDisplayName());

        if(event.isShiftClick()){
            ItemStack currentItem = event.getCurrentItem();
            ItemMeta currentMeta = currentItem.getItemMeta();
            chat.list.add(player.getUniqueId());
            player.sendMessage(ChatColor.GREEN + "Send Rename in chat (expires after 10s)");
            event.setCancelled(true);
            player.closeInventory();
            Bukkit.getScheduler().runTaskLater(plugin, () -> {
                String message = chat.message.get(player.getUniqueId());
                if (!plugin.getConfig().isConfigurationSection("warps." + warp)) {
                    player.sendMessage(ChatColor.RED + "This warp does not exist / is not a warp.");
                }

                FileConfiguration config = plugin.getConfig();
                RenameConfig.copyConfigSection(config, "warps." + warp, "warps." + message);
                currentMeta.setDisplayName(ChatColor.YELLOW + message);
                chat.list.remove(player.getUniqueId());
            }, 200L);
            return;```
#

is this better

crude charm
quaint mantle
#

yes

grim ice
#

frick off ^^

grim ice
crude charm
vivid temple
#

my data folder isnt getting created smh

thick tundra
#

What is the best way to check if a location is left or right of the players head?

thick tundra
#

so i can get values from 1 to -1 so that my audio pans from left to right

crude charm
#

I cant remember the math but smth like that

crude charm
thick tundra
#

ik ook

tardy delta
#

same 😳

thick tundra
#

maar het is echt heel lastig dit man

tidal skiff
#

so i have a Vault class to open a vault inventory and a VaultSaver class that is meant to save the players vault to the config when they close their inventory. the issue is that the event is just completely stopping when it reaches these:

        main.getConfig().set(p.getName() + ".VaultContents", vault.vaults.get(p.getUniqueId()).getContents());
        main.saveConfig();
        p.sendMessage("test");

the player will never receive the message "test" and the config file doesnt change at all so i need help

thick tundra
#

@crude charm ```
public double getAudioLRValue(Player p, Location target){
Vector look = p.getLocation().getDirection().normalize();

    Location head = p.getLocation().add(0, p.getEyeHeight(), 0);

    Vector direction = head.subtract(target).toVector().normalize();

    Vector cp = direction.crossProduct(look);
    return cp.normalize().getZ();
} ```
#

this is what im currently using**

tardy delta
#

this is an english chat smh

thick tundra
#

😂

grim ice
crude charm
thick tundra
thick tundra
#

dont bump please, im checking for you 🙂

tidal skiff
#

oh ok

thick tundra
#

okay can you send the entire class please?

thick tundra
#

because the issue is not coming from that piece of code you send here

tidal skiff
#

do u want the Vault class too

thick tundra
#

any errors in the console?

tidal skiff
#

nope

thick tundra
#

did you register the event ?

tidal skiff
#

yeah

#

getServer().getPluginManager().registerEvents(new VaultSaver(this), this);

thick tundra
#

weird. very weird

tidal skiff
#

indeed

crystal magnet
#

is player metadata saved if the server restarts?

eternal night
#

the metadata api does not persist

tardy delta
#

does is saves anything in the file?

crystal magnet
#

does it persist if the player relogs?

eternal night
#

it should

crystal magnet
#

thx

restive tangle
#

can you add a persistentdatacontainer for custom entities if so how?

tidal skiff
#

@thick tundra i did a little experimentation and i found out its the main.getConfig().set(p.getName() + ".VaultContents", vault.vaults.get(p.getUniqueId()).getContents()); thats causing it to bug out

#

idk why its causing that tho

tardy delta
#

wait did you create a new instance of Vault class?

tidal skiff
#

yeah

#

Vault vault = new Vault(this.main);

tardy delta
#

why not having a static map which contains the player uuid and the contents?

#

probably the contents aren't saved the whay you're doing

tidal skiff
#

should i make the hash map HashMap<UUID, Inventory> vaults = new HashMap<>(); static?

tardy delta
#

ItemStack[]

#

instead of inv

tidal skiff
#

why

tardy delta
#

to save the items

tidal skiff
#

ok but cant it just save an inventory? 🤔

tardy delta
#

you can save the contents

tired pendant
#

Hey guys, I haven't been up to date on MC in a while now and just looked up the MC 1.17 update. I was a bit shocked about it scolding developers using NMS instead of the API when there are so many things the API just doesn't offer a valid way to do. So I just looked through my old code and checked to see what I used NMS for in the past and the 3 simplest things I did in pretty much every plugin was item serialization/deserialization in human-readable form (like when using commands that involve items) and to get the actual Name of an ItemStack that is displayed in the game (as opposed to the name of the Material enum). Does anybody know if there is a non-nms way to do those things?

tardy delta
#

?paste

undone axleBOT
tardy delta
#

which prints something like this to the file

whole pasture
#

I saw that as well, but I figured that was for things like selecting multiple wood types or alternate ingredients.

grim ice
#

pls help

#

Someone pls help this is taking hours

crystal magnet
#

are playerquitevents fired when the server stops with players still on it?

tardy delta
#

When the server stops PlayerQuit and PlayerKick will be fired. When they leave, only PlayerQuit will be fired.

grim ice
#

RKGKJAOUEWFHBAWEUOFBAEFU[ABWEFPY9AUEBF

quaint mantle
plain scroll
grim ice
#

does the same thign

#

rgnjaongoaehniqweuhew

#

gawrgharog

quaint mantle
#

so it still shows as null or?

grim ice
#

it does

fleet cosmos
#

Is there a way to bypass that max charachter in tablist is 16

gusty bough
#

Is there a way to set a bed less respawn location in PlayerRespawnEvent ?

grim ice
#

SOME ONE

#

PLEAASE

#

wtf

tawdry cedar
#

YamlConfiguration#Set()

restive tangle
#

i got an idea of persistent data for entities , i need to know how i can scan the loaded chunks to see if the chunks contain my custom entity

quiet ice
#

wat the hell

quaint mantle
#

stop

#

spamming

sand bough
#

Hey Guys ive been creating a Backpack command but i dont know how to save the backpack even when the plugin ist restarted can someone help me at this point ?

tidal skiff
#

how do i read an ItemStack[] from a config

quaint mantle
tardy delta
#
ItemStack[] content = ((List<ItemStack>) ConfigManager.getDataConfig().get("safe_chests." + key)).toArray(new ItemStack[0]);
cloud berry
#

bro wtf

#

wat is input equevelent of System.out.println 🤣

#

pls tell me idont gotta use byte[]

tardy delta
#

scanner :/

cloud berry
#

._.

#

how?

tardy delta
#

idk what youre doing

cloud berry
#

i want

#

String input = System.in.getline();

tardy delta
cloud berry
#

but thers no getline, all th read metheds work wit liek byte[] liek idk they think dis that 1980s or smth

tardy delta
#

String input = scanner.nextLine()

cloud berry
#

o

#

tysm 😄 ❤️

tardy delta
#

System.in.getLine brrrr

cloud berry
#

🤣

grim ice
#

it becomes null

#

when u say any message in chat

cloud berry
#

iv literlt nevr had 2 use th system shit b4 lol dis mi 1st time outsied spiget

tardy delta
#

😳

quaint mantle
#

in the code you showed after your changes you were still doing that in the scheduler

grim ice
#

but

#

the scheduler

#

is for

#

the player to write

restive tangle
#

i got an idea of persistent data for entities , i need to know how i can scan the loaded chunks to see if the chunks contain my custom entity

quaint mantle
#

yes, but you're only setting the display name after the 10 seconds

grim ice
#

yes

quaint mantle
#

and by then they cant chat anymore so

grim ice
#

then what do i do

quaint mantle
#

have everything you need before the scheduler

lost matrix
grim ice
#

but i dont understand

#

@lost matrix can you help us

quaint mantle
#

i mean like this

lost matrix
#

Whats the issue

quaint mantle
#
if (event.isShiftClick()) {
    //item code here, setting the display name too
}
//scheduler here
restive tangle
#

oh , basically i have a custom entity called world border which is a pig , on enable i spawn the pig but i dont want duplicate entities of this custom entity and im not sure how i am supposed to do that

grim ice
#

nefjoabefubewfuowaebfuefbauoefbauoefbawuefob

quaint mantle
#

no, because in the scheduler you would still have the code you want to run after the 10 seconds, which is this:

Bukkit.getScheduler().runTaskLater(plugin, () -> {
                String message = chat.message.get(player.getUniqueId());
                if (!plugin.getConfig().isConfigurationSection("warps." + warp)) {
                    player.sendMessage(ChatColor.RED + "This warp does not exist / is not a warp.");
                }

                FileConfiguration config = plugin.getConfig();
                RenameConfig.copyConfigSection(config, "warps." + warp, "warps." + message);
                chat.list.remove(player.getUniqueId());
            }, 200L);
#

excluding the item/setting display name

lost matrix
#

I would scrap the approach. You should not tinker with configurations while the server is running.
onEnable -> load everything from the configs into proper data structures
onDisable -> save everything from the data structures into files
While the server is running you use your properly constructed objects.

grim ice
#

but um

#

the display name will get changed before the player writes wont he

lost matrix
#

Isnt there just a spigot config entry for that?

grim ice
#

@lost matrix u there

quaint mantle
grim ice
#

ajbgfuoabfuebf someone

quaint mantle
#

so then in that case, setting the display name in the scheduler is ok

grim ice
#

pls

#

ok

#

then why is i

#

not wokring

#

why is this taking so longjbriuubgrugregup9bsrugbwrgubhreugnehrgobsguseogsgseugsegsrogbserbgseorbgserobgseorubgsoebgrsuerbgseugserubgsegrser

chrome beacon
#

Just use PlayerFishEvent

restive tangle
#

i have a custom entity called world border which is a pig , on enable i spawn the pig but i dont want duplicate entities of this custom entity and im not sure how i am supposed to do that.

grim ice
#

Olivo do u know a solution

chrome beacon
hybrid spoke
chrome beacon
#

^^

grim ice
#

OH FINALLY SOMEONE

lost matrix
# grim ice <@!220605553368498176> u there

Yes. You are using a weakly consistent approach that relies on String keys.
I would highly recommend you to abstract away the whole configuration stuff and use objects
that get filled when the server starts and saved when the server stops or modifications are applied.

grim ice
grim ice
tardy delta
#

put all the things in objects

#

🥵

hybrid spoke
quaint mantle
#

alternatively, you could try using bukkit conversations

grim ice
#

and how

#

jfaoebnuogbrugjaabgrwegaergaerg

quaint mantle
#

although smiles approach is better

grim ice
#

yeah but h o w

#

maybe an example or smth idk

restive tangle
#

how do i check for duplicate custom entities

hexed hatch
#

By duplicate, I imagine you mean entities with the same UUID?

#

Guess you'd iterate through entities, put them in a list or something and check for duplicates

lost matrix
# grim ice yeah but h o w

Btw here is a proper example on how to program chat input reactively:

public class ChatInput implements Listener {

  private final Map<UUID, Consumer<String>> waitingInputMap = new HashMap<>();

  public void requestChatInput(final Player player, final Consumer<String> consumer) {
    this.waitingInputMap.put(player.getUniqueId(), consumer);
  }

  @EventHandler
  public void onChat(final AsyncPlayerChatEvent event) {
    final String message = event.getMessage();
    final Consumer<String> consumer = this.waitingInputMap.remove(event.getPlayer().getUniqueId());
    consumer.accept(message);
  }

  @EventHandler
  public void onQuit(final PlayerQuitEvent event) {
    this.waitingInputMap.remove(event.getPlayer().getUniqueId());
  }

}

Example usage:

    player.sendMessage("§ePls input something:");
    chatInput.requestChatInput(player, input -> player.sendMessage("§eYou replied: §f" + input));
chrome beacon
restive tangle
#

i made a custom entity which is a pig with a customname world border , everytime the plugin enables i spawn the entity but i dont want to spawn it if there is an entity already present in the world

#

do i just use a for loop?

plain scroll
#

pls someone help

lost matrix
# grim ice and to access the um

You dont access the message but delegate a function that is applied to the message as soon as the player writes something into chat.

grim ice
#

bruh

#

but like

#

whats the point

#

if i cant get the message

#

oh wait

#

but i still want the message as a string

quaint mantle
#

use a getter?

lost matrix
#

You dont "get" the message right away. You define a Consumer for the message that will later accept the message.

grim ice
#

player.sendMessage("§ePls input something:");
chatInput.requestChatInput(player, input -> player.sendMessage("§eYou replied: §f" + input));

#

ohhh

lost matrix
#

Inside this consumer you have the massage.

eternal oxide
#

Why are you even using a delayed timer?

grim ice
eternal oxide
#

your delay shoudl do nothing other than to reset everything if the player hasn;t entered a new name

#

Your onClick is only a trigger to set a flag.

#

Letting the chat handler know to watch for the players next chat.

rare crater
#

Hey,

#

i need to get the Type of a class using generic types

#

any idea ?

lost matrix
grim ice
#

o

#

timeout is useless

#

ok lemme test if it works now

lost matrix
rare crater
eternal oxide
#

You will want some kind of syncronization on waitingInputMap

lost matrix
rare crater
#

this is

lost matrix
eternal oxide
#

it could

lost matrix
#

You want something like byte[] or String as primitive type

rare crater
#

ask to mojang

#

they put

#

a serialize method

lost matrix
# rare crater a serialize method

They didnt. Serializable is a spigot interface. You can also just serialize objects into a json String with BukkitObjectOutputStreams.

#

But regardless using a map as primitive key type is not the way to go. Its not even possible,

rare crater
#

i've tried a bytestream

#

seems it was the wrong way

lost matrix
#

Try String.class as primitive and make it a PersistentDataType<String, PotionEffect>
Then serialize the PotionEffect as json.

grim ice
#

@lost matrix npe at line 27 lul

#

1s

plain scroll
grim ice
#

@lost matrix consumer.accept(message)

#

NPE'd

#

do i jsut check if message is null

lost matrix
#

Do you use the example that implemented a timeout?

grim ice
#

no

lost matrix
#

Then the message cant be null.

grim ice
#

why is it sending a nullpointerexception then

lost matrix
#

Show the npe and the code

grim ice
#

1s

#

?paste

undone axleBOT
grim ice
chrome beacon
#

Did you remove stuff

grim ice
#

maybe cuz im registering chat event before click event

#

i dont think i removed anything

vast sapphire
#

why is my tablist not updating? ```java
public static Integer getPing(Player p) {
return ((CraftPlayer)p).getPing();
}
public static void sendTab(Player p, String msg1, String msg2) {
p.setPlayerListHeaderFooter(msg1, msg2);
}
@Override
public void onEnable() {

    Bukkit.getScheduler().scheduleSyncRepeatingTask(this, () -> {
        Runtime r = Runtime.getRuntime();
        long memUsed = (r.totalMemory() - r.freeMemory()) / 1048576; //Converting

        score.registerNewTeam("default");
        Team team = score.getTeam("default");

        try {

            if(Bukkit.getOnlinePlayers().size() != 0){
                for(Player p : Bukkit.getOnlinePlayers()){
                    String message = "\n" + format("&aPing: "+ getPing(p)) + "\n" + format("&aOnline &d" + Bukkit.getServer().getOnlinePlayers().size());
                    if (memUsed > 999) {
                        sendTab(p, format("&3Outerlifex.minehut.gg"), format("&eMemory used: &c" + memUsed + " GB") + message);
                    }
                    else {
                        sendTab(p, format("&3Outerlifex.minehut.gg"), format("&eMemory used: " + memUsed + " MB") + message);
                    }


                }
            }

        } catch (Exception e){
            e.printStackTrace();
        }
    }, 10, 10);

}```
chrome beacon
#

?paste

undone axleBOT
grim ice
#

e

sinful edge
#

Not entirely certain if this question goes here or #help-server , but anyway:
I am trying to read the level data from a local spigot server. Problem is, the block states do not match expectations.

chrome beacon
#

How are you reading it?

grim ice
#

if(consumer == null) return;
if(message == null) return;

        consumer.accept(message);

@lost matrix this should fix it right

undone axleBOT
sinful edge
#

I build a program that basically reads the whole thing from the file and converts it according to the NTB tags. The problem can be recreated by NTBView, for example.

#

Sorry, NTBExplorer.

chrome beacon
#

Did you wait for the server to save before reading the data

restive tangle
#
        for(Entity mob : Bukkit.getServer().getWorld(overworld).getEntities()){
            Bukkit.broadcastMessage("test");
            if(mob.getCustomName() == null) return;
            if(!mob.getCustomName().contains("World Border")) return;

            plugin.i++;
            if(plugin.i > 1){
                mob.remove();
                plugin.i--;
            }
        }```

it does not remove the custom entities with name World Border , any help?
plain scroll
#

1

eternal night
#

If the entity is no longer loaded, world#getEntities will not include it

restive tangle
#

what do i do

sinful edge
# chrome beacon Did you wait for the server to save before reading the data

Yes. Server is currently shut down.
The problem is: From what i know the BlockStates are a bunch of long values that are basically the packed types for the 16x16x16 blocks in the section. This should be 16x16x16x n, where n is the smallest possible integer to satisfy (number of block types in section) <= 2^n. Since there are 28 different block types in this section i would expect (5 x 16 x 16 x 16)/64 = 320 long values. But for some reason BlockStates contains 342 long values. This screws with the rest of the program, because the logic extracts the wrong values from the BlockStates and attempts to access elements that are not in the palette.

eternal night
#

Delete in when it is unloaded

#

There should be a chunk unload event

chrome beacon
#

.-. Nvm

#

Anyway the 16x16x16 is a chunk section

sinful edge
#

Yes. This all works perfectly fine with levels created by the minecraft java client, by the way.

#

I just considered i could try to ignore the first 22 longs and see what happens.

grim ice
#

anyone pls help

#

@lost matrix ur thing doesnt work btw

chrome beacon
#

We can't your error doesn't match the code

grim ice
#

i did return; if its null

#

and it didnt do error

#

it just didnt work

chrome beacon
sinful edge
#

It looks like it does, but i do not know if it has any significance.

chrome beacon
#

I've never worked directly with the save before

grim ice
#

@eternal oxide r u there :D

chrome beacon
#

Does the map contain the player

eternal oxide
#

You either didn;t add a consumer or the message is null

chrome beacon
#

Because that code looks like it would fail quite often

eternal oxide
#

Show yoru onClick method

grim ice
#

wait

#

1s

reef wind
#

um, so I know I can turn off/on if particles get affected by explosions, but is their any way I can reduce it instead of turning it off?

chrome beacon
sinful edge
chrome beacon
#

Even if you don't I'd recommend going to their discord they know better when it comes to internals

eternal oxide
# grim ice 1s

Also this will trigger on all chat so don;t assume there is a consumer if (consumer != null) consumer.accept(message);

grim ice
sinful edge
#

Ok. I'll just see what happens if i skip the additional data and if that doesn't work try their discord.

chrome beacon
#

Aight

chrome beacon
quiet ice
#

alternatively try out mcdevs they definitely know these type of things

eternal oxide
#

Your requestChatInput put the consumer in teh map?

#

also after line 41 you should return as teh warp is invalid so you shoudl not be creating a consumer

grim ice
#

righ

#

right

lusty cipher
#

How can I make a itemstack seem enchanted without adding enchants?

grim ice
#

the order of registering the events doesnt matter, right

eternal oxide
#

not by the looks of yoru code

tardy delta
#

add an enchantment and hide it

lusty cipher
#

well how would I hide it

grim ice
lusty cipher
#

is it some itemmeta stuff?

chrome beacon
#

HideFlags

#

Yeah

eternal oxide
grim ice
#

ok

eternal oxide
#

only in some cases

grim ice
#

then why is the plugin failing

eternal oxide
#

show me your chat class

raw coral
#

how can i remove yaw from the player direction vector so theres no height

grim ice
#

?paste

undone axleBOT
eternal oxide
#

nm, you already have

grim ice
#

so

eternal oxide
#

probably, you are seeing an NPE from inside teh Consumer

tardy delta
#

if (consumer == null || message == null) return

grim ice
eternal oxide
#

add some debug to the consumer code

#

the message can;t be null, so either the consumer is or the NPE is from inside the consumer

grim ice
#

ok i added debuf

#

debug

#

lemme test

eternal oxide
#

I'm going to guess it is yrou player object and plugin thats null

#

probably just player

grim ice
#

how is the player null bruh

eternal oxide
#

what did yoru debug show?

grim ice
#

im gonna test

#

consumer is null

lost matrix
#

Removed all the blocks and null checked values annotated as NotNull

long river
#

Is VSC good for Java coding?

lost matrix
#

But you are on 1.8 anyways so who knows what kind of fked up bugs lurk inside this ancient piece of software

lost matrix
grim ice
#

bruh

#

@eternal oxide cosnumer is null btw

eternal oxide
#

Yeah, you need to provide variables to teh Consumer when it runs. If you look at 7smile7 original code he creates a final player

grim ice
#

i didnt change his code

cloud berry
eternal oxide
#

I just looked back and his code is a lot different to yours

grim ice
#

WHAT

cloud berry
#

4 somthin liek java i recammend big boi ide

#

eg

#

ellipse or intellaj

grim ice
#

I COPY PASTED IT WHAT DO U MEAN

grim ice
#

bruh what the fuck

eternal oxide
cloud berry
eternal oxide
#

See this line -> this.waitingInputMap.put(playerID, consumer);

#

he adds the consumer to the map using a local final field

lost matrix
#

Oh i forgot a null check there actually

grim ice
#

Cannot resolve symbol 'RequiredArgsConstructor'

eternal oxide
#

ignore that, remove that silly junk

lost matrix
#
  @EventHandler
  public void onChat(final AsyncPlayerChatEvent event) {
    final String message = event.getMessage();
    final Consumer<String> consumer = this.waitingInputMap.remove(event.getPlayer().getUniqueId());
    consumer.accept(message);
  }
  @EventHandler
  public void onChat(final AsyncPlayerChatEvent event) {
    final String message = event.getMessage();
    Optional.ofNullable(this.waitingInputMap.remove(event.getPlayer().getUniqueId())).ifPresent(consumer -> consumer.accept(message));
  }
grim ice
#

" private void timeOutMessage(final UUID playerID) {
final Consumer<String> consumer = this.waitingInputMap.remove(playerID);
if (consumer != null) {
consumer.accept(null);
}
}"

#

is optional

#

right

#

i can just delete it

eternal oxide
#

yes you can just null check

quaint mantle
eternal oxide
#

lombok way too advanced for most in this channel

quaint mantle
#

yeah

lost matrix
quaint mantle
#

or just dont allow null consumers

lost matrix
#

remove returns null if key is not in map

halcyon mica
#

Is there a way to enable the pathfinding debug plugin messages?

grim ice
#

oh also

quaint mantle
#
@Data
public class GalaxyShopAPI {
    @Getter
    private static GalaxyShopAPI api;

    private final Messages messages;
    private final ShopManager shopManager;
    private final GuiManager manager;
    private final EconomyHandler handler;
    private final GalaxyShop shop;

    {
        api = this;
    }
}

lombok very good

grim ice
#

i flipped public void requestChatInput(final Player player, final int timeout, final Consumer<String> consumer) {

#

consumer with timeout

lost matrix
grim ice
#

yeah so uh

grim ice
lost matrix
grim ice
#

u alredy have that

#

private void timeOutMessage(final UUID playerID) {
final Consumer<String> consumer = this.waitingInputMap.remove(playerID);
if (consumer != null) {
consumer.accept(null);
}
}

lost matrix
grim ice
#

@EventHandler
public void onChat(final AsyncPlayerChatEvent event) {
final String message = event.getMessage();
Optional.ofNullable(this.waitingInputMap.remove(event.getPlayer().getUniqueId())).ifPresent(consumer -> consumer.accept(message));
}

#

u changed it

eternal oxide
#

both work fine

grim ice
#

ok then

#

lemme retry

fluid cypress
#

the List#contains internally does a == i guess, right? is there any method that uses .equals()? do i have to define my equals method if its my own class?

lost matrix
#

List#contains uses .equals()

halcyon mica
#

I assume that is a no

lost matrix
halcyon mica
#

There is a internal plugin message channel used by mojang to transmit pathfinding information for entities

#

A client mod can enable the renderer for that

#

But by default, those are not being sent by the server in release

quaint mantle
#

Hello
I was trying to remove this, but when doing reload or reload pl, the file resets, I don't know what to do

lost matrix
lost matrix
quaint mantle
dense goblet
eternal oxide
#

The majority of plugins are not written with reloading in mind.

light heart
#

Looking for someone to help with full-time development for an SMP server. DM me with the price you want and your experience with Minecraft Servers & Development.

dense goblet
#

Neither is mine but reload seems to not break anything xd

undone axleBOT
eternal oxide
#

They fail to release resources properly which results in failure to intialize again

dense goblet
#

What kind of resources?

eternal oxide
#

all kinds, database handlers, their own instanced singletons.

dense goblet
#

Ah I see, interesting

quaint mantle
#

Hi
a question, how can I put the Iridium Skyblock plugin in another language?

dense goblet
#

All my static vars are reset correctly so weird that their singletons aren't

eternal oxide
#

or something so simple as not checking for online players on onEnable. as many plugins woudl need to deal with them upon a reload

quaint mantle
fluid cypress
# lost matrix ``List#contains`` uses .equals()

the someone explain this to me pls

[14:30:06 INFO]: a chunk is being unloaded...
[14:30:06 INFO]: parameter: -8892, -16738, 854fc072-c0f0-4fa1-b3cf-871953c1f84c
[14:30:06 INFO]: current list:
[14:30:06 INFO]: -8892, -16738, 854fc072-c0f0-4fa1-b3cf-871953c1f84c
[14:30:06 INFO]: returning false
public static boolean isUseless(Chunk chunk) {
    System.out.println("parameter: " + chunk.getX() + ", " + chunk.getZ() + ", " + chunk.getWorld().getUID());
    System.out.println("current list:");
    uselessChunks.forEach(pointer -> System.out.println(pointer.x + ", " + pointer.z + ", " + pointer.world));
//    if (uselessChunks.isEmpty()) return false;
    boolean result = uselessChunks.contains(new ChunkPointer(chunk.getWorld(), chunk.getX(), chunk.getZ()));
    System.out.println("returning " + result);
    return result;
}

do i have to define the equals method myself? inside my ChunkPointer class

lost matrix
fluid cypress
#

is hashCode necessary in my case?

dense goblet
#

Highly suggested

#

Especially if you wanna use hashmap or hashset

#

From what I can guess uselessChunks is a set

fluid cypress
#

its a list, but i think i should use a set

lost matrix
#

ouch... O(n) contains.

fluid cypress
#

yea i know, but i may need to add a chunk twice

grim ice
#

@lost matrix lol

fluid cypress
#

but idr why, ill use a set until i know why

dense goblet
#

If you add the same hash twice in a set you'll overwrite the initial instance

#

If you wanna keep track of how many times each chunk is added you could use a map<obj, integer> to make a histogram

grim ice
#

the message is "xd" but it becomes "null" @lost matrix

#

@eternal oxide u there

tardy delta
#

check what's null

eternal oxide
#

show your chat code

grim ice
#

?[aste

#

?paste

undone axleBOT
grim ice
waxen plinth
#

If you're gonna diss my library at least @ me

fluid cypress
#

ok, so, how would i make a hash code from two chunk coordinates and a world uuid? something about multiplying primes, but im not sure

public final UUID world;
public final int x;
public final int z;

just that

waxen plinth
#

The only part of RedLib which does this by default is the block data manager

bright quartz
#

is there any way to replace/delete plugins while the server's running? it takes ages to boot up and i don't want to start and stop it every time

waxen plinth
#

Which goes through SQLite, not MySQL

bright quartz
#

it tells me i need permission if i try to do it while it's running, despite me messing with ownership

grim ice
#

@lost matrix ur thing doesnt work lul

waxen plinth
#

SQLite is much faster and it also is set to not perform synchronous writes

eternal oxide
sand bough
#

Hey Guys ive been creating a Backpack command but i dont know how to save the backpack even when the plugin ist restarted can someone help me at this point ?

waxen plinth
#

It also caches aggressively

grim ice
#

should i just remove time out

#

and time out is a minute

waxen plinth
#

I have used the block data manager on big servers and it has never been an issue because it's designed around the sync SQL queries

fluid cypress
eternal oxide
lost matrix
waxen plinth
#

I would agree that under most circumstances it's a bad idea, but there's basically no way around it for the block data manager since it often needs to be used in events (like cancelling an event if the block has certain persistent data attached)

#

So you need to synchronously get the data for that block to determine if the event should be cancelled

eternal oxide
#

No don;t do that

fluid cypress
lost matrix
waxen plinth
#

I've mitigated the drawbacks of the synchronous SQL queries as much as possible to the point where they have almost no effect on the server performance

eternal oxide
grim ice
#

o

fluid cypress
lost matrix
fluid cypress
#

so i guess thats just magic

grim ice
#

ok

sand bough
lost matrix
tardy delta
#

yea a config file

waxen plinth
#

That's another of the mitigations

#

It doesn't load any data until it's told to

#

Loading the data for every chunk when the chunk is loaded would be a bad idea, so instead it only loads it when a plugin tries to access it

#

And I can assure you it's a non-issue

lost matrix
#

Ive noticed. I personally would not lazy load anything sync on the main thread.

lost matrix
waxen plinth
#

As would I, but asyncing it brings in a slew of new problems

#

It would be a premature optimization

#

I'd consider it if the block data manager had ever caused performance issues

#

But like I said, it never has

#

And I've used it on servers with hundreds of concurrent players

lost matrix
waxen plinth
#

If it ever caused issues I would address them, but it has never caused issues, and like I said, I've used it on servers with hundreds of concurrent players

#

So I'm confident in its performance

lost matrix
#

Its alright i got it.

grim ice
#

@eternal oxide Doesn't even send me "Renamed" LOL (because its null 100%)

waxen plinth
#

Oh, and also SQLite doesn't support async

eternal oxide
grim ice
#

lol

#

i dont have any clue

waxen plinth
#

Only supports single-threaded access, to async it I would need to switch to MySQL which would remove much of the advantage of SQLite, which is speed

lost matrix
grim ice
#

i have one for registering the events

#

and one in my click class

lost matrix
#

And i hope you use this exact instance everywhere

#

Because otherwise you will have two different maps and one wont be accessed by the events

grim ice
#

uhhhh

#

i have 2 in my onEnable

#

because its needed for click event parm

lost matrix
# grim ice uh

Create only one single instance. Register this instance and also pass it to the other classes.

fluid cypress
#
@EventHandler
public static void onChunkUnload(ChunkUnloadEvent e) {
    System.out.println("a chunk is being unloaded...");
    if (ChunksHandler.isUseless(e.getChunk())) {
        System.out.println("chunk is useless, setting save chunk to false");
        e.setSaveChunk(false);
    }
}
[15:01:05 INFO]: a chunk is being unloaded...
[15:01:05 INFO]: chunk is useless, setting save chunk to false
[15:01:05 INFO]: a chunk is being unloaded...
[15:01:05 INFO]: chunk is useless, setting save chunk to false
[15:01:05 INFO]: a chunk is being unloaded...
[15:01:05 INFO]: chunk is useless, setting save chunk to false

but it still generates like 300 region files, why?

fleet cosmos
#

How Can I Sort Players in tablist
Like admin then mod then ......

cuz they are being sorted through abc ...
I already created an int array of the group weights from higher to lower
and cleared the tablist and began to fill it
but it didn't fill through the ordor that I prepared

waxen plinth
#

I'm pretty sure loaded chunks can still be saved if autosave is set to true

fluid cypress
#

yes, but in the wrong location, now that im seeing it

#

im dumb

grim ice
lost matrix
#

Is ChatEvent your Listener class?

grim ice
#

yes it is a listener

lost matrix
#

Then yes. But i would recommend dependency injection instead.

grim ice
#

i have dependancy injection

#

private final Warps plugin;
private final ChatEvent chat;

public ClickEvent(Warps plugin, ChatEvent chat) {
    this.plugin = plugin;
    this.chat = chat;
}
public ChatEvent getPlugin(){
    return chat;
}
lost matrix
#

Then you dont need a getter like this

grim ice
#

oh right

#

lmao

#

Class.plugin

#

right

fluid cypress
#

bc now its not saving anything at all

grim ice
#

@lost matrix i only have it in my registration interface

#

and my onClick event

grim ice
#

so i dont need to access it from a

#

class

#

like you told me to

#

right

#

bro

#

public void requestChatInput(final Player player, final int timeout, final Consumer<String> consumer) {
final UUID playerID = player.getUniqueId();
this.waitingInputMap.put(playerID, consumer);

#

i just realized

#

why in the hell

#

are we passing player object

#

just to get it with uniqueID

#

cant we do final UUID Uuid or something

lost matrix
grim ice
#

but why is the message null

#

im so confused

lost matrix
grim ice
#

o

#

ok

#

ill use github

#

@lost matrix

vale ember
#

pls say wth is this "Cannot resolve method 'spawnEntity' in 'World'"

eternal oxide
#
pluginManager.registerEvents(new ChatEvent(plugin), plugin);
pluginManager.registerEvents(new ClickEvent(plugin, new ChatEvent(plugin)), plugin);```
grim ice
#

what

eternal oxide
#

Do you see anything wrong in that?

grim ice
#

hmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm

lost matrix
grim ice
#

fuck me

lost matrix
#
ChatEvent chatEvent = new ChatEvent(plugin);

Then pass this instance to the other classes.

grim ice
#

pluginManager.registerEvents(new ChatEvent(plugin), plugin);
pluginManager.registerEvents(new ClickEvent(plugin, chatEvent), plugin);

#

o i already did that lol

grim ice
#

its only in there

eternal oxide
grim ice
#

only other one is click event

#

wait frick

vale ember
#

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa help pls why intellij idea says "Cannot resolve method 'spawnEntity' in 'World'"

grim ice
#

pluginManager.registerEvents(chatEvent, plugin);
pluginManager.registerEvents(new ClickEvent(plugin, chatEvent), plugin);

eternal oxide
#

better

vale ember
#

i am using location.getWorld() and right location import

grim ice
#

show the import

lost matrix
eternal oxide
vale ember
lost matrix
#

What version are you on?

vale ember
#

1.17.1

grim ice
#

IT WORKS

#

SS

#

SS

#

SS

#

S

#

SD'GJONSEJOFBAEWGFANWEKFJABEGFIOAWEKNFAEBGAOWEGNABWOEUGBAEWNGABEGUWEJOGBW

vale ember
grim ice
#

RGBUOAERGNJERGERGSEN

#

ONLY TOOK 1 DAY OF MY LIFE

vale ember
#

it doesnt work

fluid cypress
# waxen plinth Potentially

it seems that it work, nothing is saved, and if i do save-all, only the chunks i want are saved (i think)
but, when shutting down the server, or when re-enabling autosave with save-on, all regions are saved, for some reason, and about 500 region files are created, any idea why?

vale ember
#

pls help i recreated project and still dont work

grim ice
quiet ice
#

unlikely

#

Got a larger spaghetti codebase to work on

unreal quartz
# vale ember

well your arguments are completely wrong so get rid of those and maybe intellij will show you the correct arguments to fill

unreal quartz
#

you're trying to create a new instance of an interface

eternal oxide
vale ember
#

ik but how to fix intellij

#

i closed

#

opened

#

deleted project

#

and created a new one

quiet ice
#

Pathetic.

vale ember
#

still not work

#

but in other projects it work fine

eternal oxide
quiet ice
eternal oxide
quiet ice
#

wat how

eternal oxide
#

he';s using EntityType

vale ember
#

code is fine

#

it works on another projects

#

problem is in intellij

eternal oxide
#

did you invalidate cache?

unreal quartz
vale ember
#

its just stupid autocomplete

unreal quartz
#

you're trying to make an instance of an interface...

#

for the third time get rid of the arguments and the correct method will resolve

eternal oxide
unreal quartz
#

it is

quiet ice
#

it is

unreal quartz
#

his latest video

#

play it back fully

eternal oxide
#

oh, I only looked at teh screenshot. Not watchign some stupid video

grim ice
#

why Inventory gui2 = Bukkit.createInventory(player, 54, ChatColor.GREEN + "Warps: (Page 2)");
gui2.setItem(53, next()); doesnt work

acoustic mural
#

do i need a library other than spigot-api to access MinecraftServer?

vale ember
#

Invalidating chache worked

grim ice
#

public static ItemStack next(){ ItemStack next = new ItemStack(Material.ARROW); ItemMeta nextMeta = next.getItemMeta(); nextMeta.setDisplayName(ChatColor.DARK_PURPLE + "Next Page"); next.setItemMeta(nextMeta); return next; }
why
Inventory gui2 = Bukkit.createInventory(player, 54, ChatColor.GREEN + "Warps: (Page 2)");
gui2.setItem(53, next()); doesnt work

unreal quartz
#

that is a completely ridiculously vague question

eternal oxide
#

and code blocks

median anvil
#

how do you unhook the fishing rod in playerFishEvent?

paper viper
#

God what has happened to this chat

tacit drift
median anvil
#

how would i do that?

tacit drift
#

it's an entity if i remember right

#

What do you want to do more exactly?

median anvil
#

im using PlayerFishEvent, im getting the state of the event, and if the state is IN_GROUND than i will cancel the event

#

i then want to remove the hook

toxic mesa
#

So i'm using this code

            plugin.getChecks().getConfig().getConfigurationSection(category).getKeys(false).forEach(key -> {
                if (plugin.getChecks().getConfig().isList(category + "." + key)) {
                    list.add(key);
                };
            });    

With category in this case being "Movement_checks"
In the file I have

Movement_checks:
  fly:
    A:
      enabled: true

And I got a null error
(ava.lang.NullPointerException: Cannot invoke "org.bukkit.configuration.ConfigurationSection.getKeys(boolean)" because the return value of "org.bukkit.configuration.file.FileConfiguration.getConfigurationSection(String)" is null)
I understand that I get that when it doesn't exist, but it is in the config. I'm probs being stupid so what am I doing wrong?

tacit drift
#

as that guy wrote

median anvil
#

okay but event.getHook() doesnt have a delete function lol

eternal oxide
#

its an entity

quiet ice
#

.remove()?

median anvil
#

oh shit id guess i just looked over it. Ill try it

wary harness
#

got this problem any one can help

quiet ice
#

Did you obfuscate your class?

#

It appears that you tried to break ASM, which ended up hurting you

wary harness
quiet ice
#

That is because this is mohist, not spigot

wary harness
#

could it be

quiet ice
#

They will need to perform more rigorous remapping, which (surprise) more or less requires ASM

wary harness
#

because it runs on java 8

quiet ice
#

If your Class borks ASM it crashes

wary harness
#

so problem is on there side

quiet ice
#

No, ASM is a well respected library, if your class is obfuscated, you should step down on your obfuscation

ornate heart
#

Any reason why ItemFlag.HIDE_ENCHANTS would work for everything except enchanted books?

quiet ice
#

It is not their job at deobfuscating your Class so it works, which is a process that can be illegal in certain countries

quiet ice
#

Then report this bug to md

wary harness
#

I only change path of hikaricp mysql api

quiet ice
#

Or ASM, idk who is at fault

#

honestly, might be an ASM issue

#

ASM did release an update a few days ago, could be that you accidentally replicated a bug that was solved then

chrome beacon
#

Avoid Mohist

#

It has bad practices breaking both Forge and Spigot. It's also a security risk

waxen plinth
#

If you check the enchantments with getEnchantments it will be empty

#

You have to get its ItemMeta and cast it to EnchantmentStorageMeta

#

Because they aren't enchantments applied to the item, they're enchantments stored on the item

#

The difference being that a book with looting will not yield more loot if you beat something to death with it

#

The enchantment is stored on the book, but has no effect

fluid cypress
#
Bukkit.getWorlds().forEach(world -> Bukkit.getServer().unloadWorld(world, false));

how can i load them again? there is no loadWorld method

waxen plinth
#

Use a WorldCreator

fluid cypress
#

what is that

waxen plinth
#

But you have to make sure you load them with the same generator they were originally loaded with

#

It creates a world if it doesn't exist, or loads one if it does

fluid cypress
#

and what is a generator?

#

something that depends on the seed i guess, right?

quiet ice
#

The thing that dictates the shape of the world

#

I. e. if it is flatlands it is a different worldgenerator than when it is a large_biomes world

#

Plugins can also define world generators

fluid cypress
#

ok, so, i want to disable auto save, generate chunks, prevent them from saving when unloading (unless i need them), and then enabling the autosave again, discarding all those chunks that i dont need. but when re-enabling the auto save, all those chunks were being saved. also when shutting down the server. so, doing Bukkit.getServer().unloadWorld(world, false) allowed me to discard those chunks that i dont want to save
but then to load those worlds again, i need the world creator, like this?

public static void disableAutoSave() {
    Bukkit.getWorlds().forEach(world -> world.setAutoSave(false));
}

public static void enableAutoSave() {
    Bukkit.getWorlds().forEach(world -> {
        WorldCreator worldCreator = new WorldCreator(world.getName());
        worldCreator.copy(world);
        Bukkit.getServer().unloadWorld(world, false);
        World reloadedWorld = worldCreator.createWorld();
        reloadedWorld.setAutoSave(true);
    });
}
#

well, it seems that it works, but now im worried about compatibility with other plugins

[18:04:34 INFO]: [Multiverse-Core] World 'world_nether' was unloaded from Multiverse.
[18:04:35 INFO]: [Multiverse-Core] World 'world_the_end' was unloaded from Multiverse.
[18:04:37 INFO]: [Multiverse-Core] World 'test' was unloaded from Multiverse.
[18:04:37 INFO]: [GroupManager] New world detected...
[18:04:37 INFO]: [GroupManager] Creating data for: test
[18:04:37 INFO]: [GroupManager] Don't forget to configure/mirror this world in config.yml.
grim ice
#

@lost matrix

#

what do i do if i want to stop the message from showing to people in @EventHandler
public void onChat(final AsyncPlayerChatEvent event) {
final String message = event.getMessage();
Optional.ofNullable(this.waitingInputMap.remove(event.getPlayer().getUniqueId())).ifPresent(consumer -> consumer.accept(message));

}
waxen plinth
#

Remove recipients

#

getRecipients().remove(player)

grim ice
#

will this work @EventHandler
public void onChat(final AsyncPlayerChatEvent event) {
final String message = event.getMessage();
Optional.ofNullable(this.waitingInputMap.remove(event.getPlayer().getUniqueId())).ifPresent(consumer -> consumer.accept(message));
if(this.waitingInputMap.containsKey(event.getPlayer().getUniqueId()))
event.setCancelled(true);
}

waxen plinth
#

That will stop itt from being shown to anyone

eternal oxide
#

remove all then add the player back in

#

the player themselves needs the feedback