#help-development

1 messages · Page 1790 of 1

fast onyx
#

says unreachable

ember estuary
#

thats inside the if

fast onyx
#

thats another cap

#

i already do that

ember estuary
#

show ur whole code

young knoll
#

put here

fast onyx
fast onyx
ivory sleet
#

ah

#

makes more sense now

acoustic pendant
#

conclure

young knoll
#

You return above, so the code is never reached

ivory sleet
#

the second outermost if statement wont ever be reached

#

this is due to that both branches above ensure code termination within method

acoustic pendant
#

How can i declare this outside the if statement and then calling it in the if statement?

#

i mean

fast onyx
ivory sleet
#

might wanna do that

ember estuary
#

outside what if statement adri?

ivory sleet
#

as code runs linearly (usually)

acoustic pendant
fast onyx
peak granite
#

player.teleport(new Location(player.getLocation().getWorld(), Double.parseDouble(args[0]), Double.parseDouble(args[1]), Double.parseDouble(args[3]))); throws an error in console

ember estuary
#

But normally you just do

BukkitTask task0;

outside and then task0 = ... inside the if

ivory sleet
#

send it caye

acoustic pendant
ivory sleet
#

?paste

undone axleBOT
ember estuary
#

but? o.O

fast onyx
acoustic pendant
#

the if i call task0 from other statement, it will have the task value?

ivory sleet
#

the entire method

acoustic pendant
#

let me send an example

ember estuary
#

yeah, it will, if you set it

sterile token
#

Hey please i need help. I dont why the data stream its not getting opened!!!

acoustic pendant
chrome beacon
ember estuary
#

where is that second picture at

ivory sleet
acoustic pendant
ivory sleet
#

check out that code

ember estuary
#

remove the second "BukkitTask"

ivory sleet
#

it solves the problem, take notes and learn

ember estuary
#

and make the task0 a "BukkitTask" and not "int"

#

above the ifs

fast onyx
acoustic pendant
#

to use it

fast onyx
#

cant resolve result symbol

ember estuary
#

what why

acoustic pendant
ivory sleet
#

which line caye?

ember estuary
#

oh

fast onyx
fast onyx
#

when return

ivory sleet
#

what does it say?

ember estuary
#

use scheduleSyncRepeatingTask instead of runTaskTimer

fast onyx
ember estuary
#

that will give u an int id

acoustic pendant
#

but

ember estuary
#

but?

acoustic pendant
#

i don't want that

ember estuary
#

is there a diff?

acoustic pendant
#

no

#

i just realized xD

#

ok, let me try

ember estuary
#

xD

quaint mantle
#

runTaskTimer().getId()😀

ember estuary
#

well

#

args[2] and not args[3]

fast onyx
ember estuary
#

@peak granite

#

you wrote args[3] by mistake

quaint mantle
#

1.8 ☹️

peak granite
#

wdym

ember estuary
#

i mean that you wrote "args[3]" instead of "args[2]"

peak granite
#

oh

#

lmfao

ember estuary
#

xD

chrome beacon
peak granite
#

sorry i'm going from skript to java

#

soo

ember estuary
#

i see :D

acoustic pendant
#

@ember estuarynow i can't cancel the task

ember estuary
#

you can also save the location in a variable and then use it:

Location whatEverYouWannaNameIt = new Location(player.getLocation().getWorld(), Double.parseDouble(args[0]), Double.parseDouble(args[1]), Double.parseDouble(args[3]));
player.teleport(whatEverYouWannaNameIt);
ember estuary
#

Bukkit.getScheduler().cancelTask(taskID);

acoustic pendant
misty current
#

can methods annotated with EventHandler be private/protected?

#

or would it cause problems

acoustic pendant
ember estuary
#

use this

quaint mantle
#

Yes but make them public so paper can optimize them at runtime

ember estuary
#

scheduler.cancelTask(task0);

#

that cancels it

ivory sleet
#

kill05 yes but it’ll have to use reflective invocations then

misty current
#

kk ty

acoustic pendant
#

and will this work 100%?

ember estuary
#

try it xD

#

it should

quaint mantle
#

Try and see

acoustic pendant
#

how can i check if it works? xD

quaint mantle
#

Run it

acoustic pendant
#

and btw

ember estuary
#

make a jar from it, and then put it in plugins folder, and then restart server

acoustic pendant
#

ye ye

#

but

#

setCold(+1);

#

is this great defined?

ember estuary
#

wym great

#

if you made a function named setCold, its defined

#

xD

acoustic pendant
#
public static void setCold(double cold) {
        PlayerHeight.cold = cold;
    }```

here the setter

```java
task0 = scheduler.scheduleSyncRepeatingTask(plugin, () -> {
                    setCold(+1);
                }, 0, 20 * 10);```
will this add 1 to cold every second?
fast onyx
#

help? 😦

ember estuary
#

well "+1" is not a thing

#

u wanna add 1?

acoustic pendant
#

every second

ember estuary
#

i see

calm star
#

when i do

@EventHandler
    public void onPlayerRightClick(PlayerInteractEvent e) {
        Player p = e.getPlayer();
        Action a = e.getAction();
        Block b = e.getClickedBlock();
        this.player = p;
        if (a == Action.RIGHT_CLICK_AIR || a == Action.RIGHT_CLICK_BLOCK) {
            firstCondense(p);
        }

    }
``` right clicking the floor runs `firstCondense` twice for some reason, how can i only make it run once. (Right clicking air is fine and only runs it once)
ember estuary
#

setCold(getCold() + 1)

#

is the usual approach to that

#

or make cold public and do cold++

acoustic pendant
#

i see

#

ty!

ember estuary
#

np

delicate raptor
calm star
#

no that cant be it

#

as it only runs once if I right click air

#

its just when i right click a block

delicate raptor
#

onRightClick seems good

sterile token
#

Im waiting to get my answer....

delicate raptor
#

Can you provide us firstCondense code?

acoustic pendant
#
  task0 = scheduler.scheduleSyncRepeatingTask(plugin, () -> {
                    cold++;
                }, 0, 20 * 10);```
so this will add 1 cold every second?
calm star
delicate raptor
#

No

#

It won't

#

Make it only every 20 ticks

#

Instead of 20*10

calm star
#

doing this

        if (a == Action.RIGHT_CLICK_AIR || a == Action.RIGHT_CLICK_BLOCK) {
            System.out.println("Hi");
        }
``` has the same problem
sterile token
#

If you are using a stream in java you should put the stream#flush()?

delicate raptor
calm star
#

yes when U right click block

#

When u right click air it prints Hi once

ivory sleet
acoustic pendant
fast onyx
calm star
#

when u look at block

acoustic pendant
#

that's why is executed twice

ember estuary
calm star
#

how can i stop that @acoustic pendant

fast onyx
#

fixed ty

ember estuary
#

np

delicate raptor
sterile token
calm star
delicate raptor
#

System.out.println(a);

calm star
#

oh ye\

sterile token
delicate raptor
calm star
#

Oh thats strange

sterile token
#

Allright i will post the code on paste md5 and i explain you what inssue im having

calm star
#

when u right click block it just prints
[22:47:00 INFO]: RIGHT_CLICK_BLOCK
[22:47:00 INFO]: RIGHT_CLICK_BLOCK

ember estuary
#

are item frames entities and can therefore be placed mid-block?

delicate raptor
#

I need to sleep rn

patent horizon
#

is there a equalsIgnoreCase for contains in a list?

misty current
#

i love how I made a packet listener nms class with a packetevent wrapper to listen to get the player loading the chunk and now i don't know how to get data from the packet ;-;

patent horizon
#

just grab from the var where you made the packet

misty current
ember estuary
#

list.stream().anyMatch("search_value"::equalsIgnoreCase);

#

@patent horizon

misty current
#

or make it all lowercased

delicate raptor
patent horizon
#

thanks

misty current
calm star
delicate raptor
#

I suggest to use ProtocolLib for that

misty current
#

it's just 2-3 classes that inject into the netty channel

patent horizon
ember estuary
#

yea, what ur searching

sterile token
#

Yes

misty current
#

protocol lib just slowed me down up until now

#

tbh

patent horizon
#

what am i searching...

delicate raptor
#

Since it's a powerful packet lib for now

ember estuary
#

xD

#

can be a variable too ofc

patent horizon
#

is it just like a string var or something for the elements in the list?

ember estuary
#

yea a string

patent horizon
#

ah ok

misty current
#

i need to learn more about streams

#

they're very cool

ember estuary
#

true

ivory sleet
#

Slow but readable

ember estuary
#

thats why i love javascript, its streams all the way

#

xD

ivory sleet
#

🤢

#

I mean it’s nice

ember estuary
#

xD

delicate raptor
#

Anyone knows a good YAML parser lib?

ivory sleet
#

But its lack of types is meh

ember estuary
#

true

patent horizon
delicate raptor
#

Since spigot's one don't save comments

ember estuary
#

xD

ivory sleet
#

Yes because yaml comments are a fucking pain

#

But eo yaml actually does respect some comments

#

Like commented nodes

patent horizon
ember estuary
#

wally use ()

#

(answ+".yml"):: ...

patent horizon
#

ah k

ember estuary
#

works?

#

idk, was just guessing

#

xD

#

but should be the issue

delicate raptor
#

I hope that's what do you want

patent horizon
#

ah floskater's thing works

#

thanks btw

fast onyx
#

i'm trying to play a sound but from 1.8 to 1.9 the sounds has changed so i dont know how to play the same sound on 1.8 server and 1.16 server using 1.13 api version

#

is possible ig?

peak granite
#

is it possible to open an anvil gui to a player

#

with a command

patent horizon
#

yes

peak granite
#

how

patent horizon
#

you gotta use anvilinventory instead of regular inventory

#

AnvilInventory anvilInventory = (AnvilInventory) Bukkit.createInventory(null, 27);

patent horizon
#

its difficult

#

are you using a multi version manager like protocolsupport?

fast onyx
#

nop

patent horizon
#

slots

fast onyx
#

im trying to make a plugin for 2 servers

#

lobby on 1.8 and survival on 1.16

#

but the sounds arent the same so..

patent horizon
#

i guess that doesnt matter in an anvil iventory

peak granite
#

anvil has 27 slots?

patent horizon
#

might wanna play around with it

#

no

#

what do you know

#

first thing on google

#

meets your exact criteria

patent horizon
#

they might be named differently

fast onyx
#

yea

#

im running 1.13 api

#

so if i put ORB_PICKUP on 1.8-1.13 server it works

#

but if i put entity.experience_orb.pickup or ORB_PICKUP on 1.14-1.17 doesn't

#

gives an error that the sound doesn't exists

peak granite
#

AnvilInventory anvilInventory = (AnvilInventory) Bukkit.createInventory(null, null); player.openInventory(anvilInventory);

#

doesn't work

#

no errors but errors in-game & console

patent horizon
#

i think entity experience pickup is under player now

#

nvmd

patent horizon
#

what are the errors

sullen marlin
#

null, null ?

maiden thicket
patent horizon
#

idk

#

lol

sullen marlin
#

suggest you look at the InventoryType argument

patent horizon
#
private static final Pattern patternUUID = Pattern.compile("/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/");

        if (skull != null) {
            SkullMeta skullMeta = (SkullMeta) iM;
            if (patternUUID.matcher(skull).matches()) skullMeta.setOwningPlayer(Bukkit.getOfflinePlayer(UUID.fromString(skull)));
            else {``` my regex pattern i found on the internet isn't working
#

it's supposed to check if a string is a player uuid for playerskulls

peak granite
#

still errors

peak granite
maiden thicket
#

show full code and error log

peak granite
#

kk

#
    @Override
    public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
        if(!(sender instanceof Player)) {
            sender.sendMessage("You cannot execute this command in console.");
            return true;
        }
        if(!(sender.hasPermission("anvil.use"))) {
            sender.sendMessage(Color.translate("&cYou don't have the required permission to perform this command."));
            return true;
        }
        Player player = (Player) sender;
        AnvilInventory anvilInventory = (AnvilInventory) Bukkit.createInventory(null, InventoryType.ANVIL);
        player.openInventory(anvilInventory);
        return true;
    }
}```
maiden thicket
#

sec

#

why are u on 1.8

peak granite
#

what type of question is that

#

bc i want to? lol

patent horizon
#

a good one

maiden thicket
#

🦧

#

anyways

peak granite
#

some ppl just want to run a server with good pvp

ivory sleet
patent horizon
#

'some people'

peak granite
#

?

maiden thicket
#

are u using the correct import

#

on AnvilInventory

patent horizon
#

pvp is one of if not the biggest server category on mc

maiden thicket
#

idk if theres more than one

maiden thicket
peak granite
#

not the same

patent horizon
#

BackToTheRoots

patent horizon
ivory sleet
maiden thicket
#

show ur imports rq

#

alisa

maiden thicket
#

are u providing a uuid to string

patent horizon
#

the players uuid

#

in a string yeah

#

the string can either be a uuid or a custom texture

maiden thicket
#

mmm

patent horizon
#

i found an old stackoverflow post for the regex pattern

#

doesnt seem to work

#

i did the debugging too, and it's caused by that condition

maiden thicket
#

u can probably just do UUID.fromString and if it throws an illegalargumentexception then its not a proper uuid string

patent horizon
#

like a try catch or?

maiden thicket
#

i havent tested it but u can try that probably

#

ya

patent horizon
#

alr

misty current
#

int z = chunkPacket.getClass().getDeclaredField("b").getInt(chunkPacket); is this the right way to get a field?

#

or do i have to make it accessible first

patent horizon
#

how can you shove a try catch into a condition

peak granite
#

fixed it

ivory sleet
peak granite
#

fix: player.openInventory(Bukkit.createInventory(player, InventoryType.ANVIL)); if anyone's interested

patent horizon
#

:|

ivory sleet
#

can you be a little bit more concrete wally? xD

patent horizon
#

the other dude said to use a try catch statement to see if uuid.fromstring() or whatever would be a real uuid

maiden thicket
ivory sleet
#

oh right

#

yeah that's probably better than regex

#

since regex is hella slow

patent horizon
#

oh so the try catch would essentially be my if else

maiden thicket
misty current
#
for(Field field : armorStand.getClass().getDeclaredFields()){
    field.setAccessible(true);
}

int x = chunkPacket.getClass().getDeclaredField("a").getInt(chunkPacket);
int z = chunkPacket.getClass().getDeclaredField("b").getInt(chunkPacket);

so something like this?

ivory sleet
#

it is sort of a conditional control structure

ivory sleet
maiden thicket
#

yeah

#

i dont think that would work

misty current
#

i don't really like having to do this since it's gonna get called for each chunk loading

maiden thicket
#

u'd have to use the same object probably

misty current
#

save the fields somewhere?

ivory sleet
#

yeah

misty current
#

so a private static array somewhere

#

in the class

#

oh actually i don't need it to be static

#

nvm

ivory sleet
#

well just to make it a bit faster, idk if it still goes thru security manager and stuff when just getting the field but yeah

maiden thicket
#
private int getInt(String field, Object obj)
{
//no idea what exceptions these throw i forgot
Field f = obj.getClass().getDeclaredField(field);
f.setAccessible(true);
return f.getInt(obj);
}```
ivory sleet
#

ReflectiveOperationException is enough

maiden thicket
#

when is java getting optional params like c# and js

#

😔

misty current
#

uh at this point i might as well go full api mode and develop a whole structure for getting fields

ivory sleet
misty current
#

before i compile, is there a better way to get what player loaded a certain chunk

maiden thicket
maiden thicket
#

or smthn

misty current
#

yea but no player

ember estuary
maiden thicket
misty current
#

and playermoveevent can detect for walking in a new chunk but doesn't get the exact loaded chunk

ember estuary
misty current
fast onyx
#

all the code is working on every version except this that isn't working on +1.13

ember estuary
#

not working cuz the string changed?

#

or the method changed?

fast onyx
#

nop, if you put ORB_PICKUP (example) then it works
if you put that on +1.13 is not working, even if you put: entity.experience_orb.pickup isn't working too on +1.13

#

im running 1.13 api version that someone recommended me for more stability

ember estuary
#

so what actually is working in 1.13 to play that sound?

#

u dont know?

ember estuary
#

so just lowercase?

fast onyx
#

uppercase

ember estuary
#

huh

#

didnt u just say it doesnt work on 1.13

#

"if you put that on +1.13 is not working"

fast onyx
#

if you put that on a server running 1.16 as example, it doesnt work

fast onyx
ember estuary
#

ah u mean higher than

#

1.14+

fast onyx
#

i mean 1.14, 1.15, etc, yea

ember estuary
#

i see

maiden thicket
fast onyx
#

yea but if you pur entity.experience_orb.pickup it doesn't work too

fast onyx
#

and not working

ivory sleet
#

no ofc not

fast onyx
#

maybe because im running 1.13 as api?

#

idk

ivory sleet
#

it has to be the enum name of it

maiden thicket
#

yeah

#

ur doing

#

sound.valueof

maiden thicket
#

meaning it has to equal the enum nane exactly

#

uppercase and everything

#

replace . with _

fast onyx
#

of the value that the player puts on config

young knoll
#

Wish we had a matchSound

ivory sleet
#

the string (from config) must be exactly equal to ENTITY_EXPERIENCE_ORB_PICKUP

ember estuary
#

Sound.ENTITY_EXPERIENCE_ORB_PICKUP

fast onyx
#

ill try

#

ty

peak granite
#

how do i set the amount of what the player is holding to x
so if i do /more 5 it sets my 1 dirt to 5 dirt

ember estuary
#

get the itemstack, add 5, set the itemstack

young knoll
#

.setAmount on itemStack

peak granite
#

kk ty

fast onyx
young knoll
#

They are mutable, so I don't think you need to set it

ember estuary
#

oh u can just do that and it updates? alright

ivory sleet
#

I don't think it normally updates?

ember estuary
#

same but idk

peak granite
#

is setAmount on 1.8

fast onyx
fast onyx
#

all sounds names changed from 1.8 to 1.14?

#

there isnt any sound with the same name right?

young knoll
#

IIRC they changed in 1.13

patent horizon
#
java.lang.NullPointerException: Cannot invoke "String.toCharArray()" because "text" is null
    at me.clip.placeholderapi.replacer.CharsReplacer.apply(CharsReplacer.java:44) ~[PlaceholderAPI-2.10.10.jar:?]
    at me.clip.placeholderapi.PlaceholderAPI.setPlaceholders(PlaceholderAPI.java:70) ~[PlaceholderAPI-2.10.10.jar:?]
    at me.clip.placeholderapi.PlaceholderAPI.setPlaceholders(PlaceholderAPI.java:98) ~[PlaceholderAPI-2.10.10.jar:?]
    at me.wally.guilds.GUI.ItemBuilder.itemBuilder(ItemBuilder.java:35) ~[Guilds-1.0-SNAPSHOT.jar:?]
    at me.wally.guilds.GUI.Menu.Format.menu(Format.java:19) ~[Guilds-1.0-SNAPSHOT.jar:?]
    at me.wally.guilds.GUI.Menu.Events.playerRightClickNPC(Events.java:24) ~[Guilds-1.0-SNAPSHOT.jar:?]```
```java
        String skull = PlaceholderAPI.setPlaceholders(player, config.getString("SkullOwner"));```
young knoll
#

The config string is null

#

Show the config

patent horizon
#

config.getString("SkullOwner") is %player_uuid%

peak granite
#

player.getInventory().getItemInHand().getItemMeta().setAmount(5); doesn't work

maiden thicket
#

where is "text"

patent horizon
#

nowhere

#

what

maiden thicket
#

what line does it say its one

#

on

patent horizon
maiden thicket
#

did u try printing SkullOwner

#

and see if it returns that

patent horizon
ember estuary
maiden thicket
patent horizon
#

[22![38](https://cdn.discordapp.com/emojis/909786321730543647.webp?size=128 "38")36 INFO]: [Guilds] [STDOUT] 5737b161-9c71-4095-878e-e41b0f6d8bb0

maiden thicket
#

so it sets the placeholder?

patent horizon
#

yeah

#

i souted it after the placeholder line

peak granite
#
            Integer amount = 64;
        } else {
            Integer amount = Integer.valueOf(args[0]);
        }
        player.getInventory().getItemInHand().setAmount(amount);```

"amount" on the last line is red (doesn't work)
maiden thicket
#

okay so then its not the like of code u showed

young knoll
#

Is String skull = PlaceholderAPI.setPlaceholders(player, config.getString("SkullOwner"));
me.wally.guilds.GUI.Menu.Events.playerRightClickNPC(Events.java:24)?

ember estuary
#

cuz it only exists inside the ifs

peak granite
#

oh

patent horizon
#
        String skull = PlaceholderAPI.setPlaceholders(player, config.getString("SkullOwner"));
        System.out.println(skull);

        ItemStack i = new ItemStack(material, count);
        ItemMeta iM = i.getItemMeta();
        iM.setDisplayName(name);
        iM.setLore(lore);
        i.setItemMeta(iM);

        if (skull == null) return i;
        SkullMeta skullMeta = (SkullMeta) iM;
        try {
            skullMeta.setOwningPlayer(Bukkit.getOfflinePlayer(UUID.fromString(skull)));
            i.setItemMeta(skullMeta);
        } catch (IllegalArgumentException e) {
            GameProfile profile = new GameProfile(UUID.randomUUID(), null);
            profile.getProperties().put("textures", new Property("textures", skull));
            try {
                Field profileField = skullMeta.getClass().getDeclaredField("profile");
                profileField.setAccessible(true);
                profileField.set(skullMeta, profile);
            } catch (IllegalArgumentException | NoSuchFieldException | SecurityException | IllegalAccessException error) {
                error.printStackTrace();
            }
        }```
ember estuary
#

int amount;
if(args.length == 0) {
amount = 64;
} else {
amount = Integer.valueOf(args[0]);
}
player.getInventory().getItemInHand().setAmount(amount);

young knoll
#

Which one is line 24

patent horizon
#

u talkin to me?

peak granite
#

still errors

ember estuary
#

which

peak granite
#

last line

#

Cannot resolve symbol 'amount'

ember estuary
#

u did it like i did?

young knoll
ember estuary
#

show ur code

peak granite
#
            Integer amount = 64;
        } else {
            Integer amount = Integer.valueOf(args[0]);
        }
        player.getInventory().getItemInHand().setAmount(amount);```
ember estuary
#

u didnt do like i did

peak granite
#

u edited ur msg

patent horizon
ember estuary
#

amount still only exists inside the ifs

#

i didnt

#

i only changed the indentation

peak granite
#

now it works

#

lol

young knoll
#

I don't think Events line 24 is blank

ember estuary
#

xD

patent horizon
#

oh events

#

new Format().menu(event.getPlayer());

young knoll
#

Oh wait I'm reading backwards

patent horizon
#

it just opens the gui the item is in

young knoll
#

at me.wally.guilds.GUI.ItemBuilder.itemBuilder(ItemBuilder.java:35)

peak granite
#

ty @ember estuary

ember estuary
#

no problem ^^

peak granite
#

if(player.getInventory().getItemInHand() == ItemType.AIR) {

#

AIR is in red

#

tried Item.AIR

#

as well

young knoll
#

The heck is ItemType

#

It's Material

#

Or is ItemType something you have made

peak granite
#

oh

#

Material

#

my b

young knoll
#

Also you should be checking getType, not the item itself

proud basin
#

How could I connect to a internet connection?

maiden thicket
young knoll
#

Also Material.isAir

peak granite
#

tyty

#

is it possible to something like this
set var to "" if executor is player, else ""

young knoll
peak granite
#

variable

maiden thicket
#

if (sender instanceof Player)

peak granite
maiden thicket
#

o

mortal hare
#

ok

#
package net.iso2013.mlapi.structure.transactions;

/**
 * Created by iso2013 on 6/13/2018.
 */
public abstract class StructureTransaction { }
#

why

#

do this

misty current
#

just because yes

young knoll
#

I would use an empty Interface instead

#

Spigot does that for example

mortal hare
#

why would you use this in the first place

#

you're not implementing anything

#

i get it

young knoll
#

Take a look at org.bukkit.event.Listener

mortal hare
#

you can put different objects

#

in a map

misty current
#

just to recognize if a class is something

#

yea exactly

#

polymorphism

mortal hare
#

but that defeats the purpose of the classes

misty current
#

tho why not an interface

#

🤔

young knoll
#

¯_(ツ)_/¯

mortal hare
#

that's not going to make it easier to do this since you would need to do if statements to check the type

#

that just seems unnecessary for me

ivory sleet
#

concrete class + strategy 😄

mortal hare
#

I would rather make a map containing Object as a type

#

its not as if you're not going to check the type anyways

proud basin
#

Does this work for anyone ```
<dependency>
<groupId>io.github.thanosfisherman.wifiutils</groupId>
<artifactId>wifiutils</artifactId>
<version>1.6.6</version>
</dependency>

noble lantern
#

Has anyone in here created custom worldguard flags before?

I made one that allows certain blocks to be broken in an area, however when i set the eventPriority to HIGHEST and setCanceled(false) it stills cancels the event, do you need to cancel another world guard flag or something?

noble lantern
proud basin
#

fr?

#

its in maven central though

noble lantern
#

oh then im not sure

#

since its io.github i assumed it was jitpack or something

ivory sleet
#

jitpack 🌞

young knoll
#

packjit?

noble lantern
#

jitpack is kinda godsend

#

when it works ofc

ivory sleet
#

"when it works"

peak granite
#

how do u kill a player

noble lantern
#

i have like... 10 versions that are all for jitpack fixes on my api xD

#

almost have more releases than commits now

ivory sleet
#

I tried setting up jitpack, I gave up after 9 hours

noble lantern
#

it really took that long?

#

For me it pretty much worked right away

#

my only issue is when i release tags, they arent available from jitpack servers even hours later, so i end up needing to make another release to get jitpack to register it...

ivory sleet
#

had a multi module project and some java version configurations

#

idk

noble lantern
#

oh yeah prolly too complex for jitpack

ivory sleet
#

my gradle setup and jitpack were just arch enemies

proud basin
#

I get Cannot resolve io.github.thanosfisherman.wifiutils:wifiutils:1.6.6

noble lantern
#

jitpack is good with things that are normal, but when it comes to switching compile options good luck

#

I had to create a file in order to fix mine, and it is a simple maven file too

ivory sleet
#

🥲

noble lantern
proud basin
#

well I'm def not doing it wrong

noble lantern
#

It has a jitpack option it seems

#

so try doing it that way

#

1.6.4

proud basin
#

I've looked at the jitpack one and it didn't work

noble lantern
#

1.6.5 is broken along with 1.6.6

#

try using version 1.6.4 unless those 2 version have something major in them

proud basin
#

Cannot resolve com.github.thanosfisherman:wifiutils:1.6.4

noble lantern
#

also, if its not importing it may be best to clear maven cache, as well as asking the author about it

young knoll
#

Don't forget the blood sacrafice

noble lantern
#

^

young knoll
#

No wait that's for gradle

noble lantern
#

especially if your using jitpack

#

oh

#

if its gradle idk i barely use it

proud basin
#

its not...

#

anyways

#

does it work for anyone else?

noble lantern
#

sec

proud basin
#

looks like the entire thing is broken

hollow bluff
#

If I may, what’s jitpack?

ivory sleet
#

the notorious repository

noble lantern
#

nope it doesnt

daring maple
#

Could I have multiple EventHandlers in 1 class?

young knoll
#

Sure

noble lantern
patent horizon
young knoll
#

Isn't that already a WG feature

noble lantern
#

suprisingly not

#

its on the board to be created as a flag

#

not WIP or anything just on a board

young knoll
noble lantern
misty current
#

the moment when you listen to all packets, broadcast them and the broadcasting calls a packet:

ivory sleet
#

oh my

young knoll
#

"Still working tested on 1.17.1 Survival Server working perfectly!
Hope it gets updates someday"

#

According to reviews anyway

noble lantern
#

only one thats there is mine

young knoll
#

You can look at their source at least

patent horizon
ivory sleet
#

when the todo list becomes a dont-do list

noble lantern
noble lantern
#

It will probably be 2022-2023 by the time that flags added

#

even though i could of used it way back in 2015

ivory sleet
#

Burchard maybe pr?

patent horizon
#

isnt worldguard managed by enginehub

#

such a sad little dev team they are

#

spends their days answering support questions in their discord

noble lantern
# ivory sleet Burchard maybe pr?

Idk if WorldGuard has any specific formatting for adding flags to theyre repo, but im only doing the BlockBreaking one since im making a quick regen blocks plugins

proud basin
ivory sleet
young knoll
#

Does Spigot have a TODO list :p

noble lantern
#

Mine is just 2 classes, static flag with register in constructor, and then class holding events for the flag

noble lantern
round finch
#

i got a problem i'm trying to create Files and folders it works fine on my pc

#

but then i run it on my hosted server

noble lantern
#

Its weird that flag doesnt show up on the extra flags plugin

round finch
#

it fails!

noble lantern
ivory sleet
ember estuary
#

i finally mastered relative teleportation, yay

noble lantern
ivory sleet
#

yeah indeed

noble lantern
#

Like it was just a few lines

However my method is a bit sloppy

young knoll
#

Spigot TODO list when

noble lantern
#

since im relying on the break blocks flags to be allowed when this flags is set

young knoll
#

What is that system everyone uses for TODO

#

Trello?

noble lantern
#

yessir

ivory sleet
#

todo comments lol

young knoll
#

Fair

round finch
#
  public static void CreateFile(File File_Input) {
    CreateFolders(File_Input.getParentFile());
    
    if (!File_Input.exists() && File_Input.getParentFile().exists())
      try {
        File_Input.createNewFile();
      } catch (Exception excep) {
        excep.printStackTrace();
      }  
  }
  
  public static void CreateFolders(File File_Input) {
    if (!File_Input.getParentFile().exists() && File_Input != null) {
      File_Input.getParentFile().mkdirs();
      try {
      File_Input.getParentFile().createNewFile();
      } catch (IOException e) {
        e.printStackTrace();
      } 
    } 
  }
noble lantern
#

whenever i have a todo comment it barely lasts 5 minutes

misty current
#

wait if there's a nullpointer or any exceptions on packet communication the player gets kicked? interesting

noble lantern
#

xD

#

okay lemme actually read the code

young knoll
#

Is 390 TODO too many?

ivory sleet
#

holy cow

noble lantern
#

wait why is that so complicated

ivory sleet
noble lantern
#

Does it have the JavaPlugin#getDataFolder() as a parent?

noble lantern
young knoll
#

I mean

#

I know it's too many

#

But it is a real number

peak granite
#

how do i get the size of players in a world

young knoll
#

World.getPlayers.size

peak granite
#

thanks

round finch
#

it does run

noble lantern
#

And it doesnt make any folders or files?

round finch
#

but it creates files and not the folders

noble lantern
#

oh

#

so just not the folders?

young knoll
#
     File_Input.getParentFile().mkdirs();
      try {
      File_Input.getParentFile().createNewFile();
#

Are you trying to make a file out of something you just made a folder?

peak granite
#

World world = args[0]; how do i convert this to a world

noble lantern
young knoll
noble lantern
#

You can look into my createFile method if you need to

peak granite
#

thanks

round finch
ember estuary
#

How can i require the type of a method parameter to be a class extending another class (Menu)?

public void myMethod(<T extends Menu> menu)
doesnt work xD

noble lantern
ember estuary
#

wait how

ivory sleet
#
static void createFile(Path file) throws IOException {
  if (!Files.exists(file)) {
    Files.createDirectories(file.getParent());
  }
  Files.createFile(file);
}

then just

createFile(getDataFolder().toPath().resolve("config.yml"));

or smtng

noble lantern
#

and then instanceof Menu check when you want the actual class instance

ember estuary
#

ah

#

but i dont want the original menu to be able to be inputted, only subclasses that extend it

ivory sleet
#

floskater what are you trying to do?

peak granite
#

how do i check if a world exists

round finch
noble lantern
misty current
#

showingTo.addAll(Arrays.asList(players)); can you not do something like this? (players is a Player... param)

proud basin
#

Is this how you do a text block? """ + networkSSID + """

ember estuary
# ivory sleet floskater what are you trying to do?

exactly what i asked for. theres no easier way to describe it xD

I have the method public static void openMenu(Player player, <T extends MapMenu> menu), which you must pass a class, which extends MapMenu

noble lantern
young knoll
#

Can't you just addAll an array

misty current
#

nope, needs a collection

noble lantern
ember estuary
#

"<T extends MapMenu> menu" is wrong tho

noble lantern
#

iirc you can cast or a static Collection method exists to convert

ivory sleet
peak granite
#

do i have to do bukkit.getOnlinePlayers to send a message to all players in a world

round finch
peak granite
#

okay

ember estuary
#

whats a typetoken

ivory sleet
#

static <T extends MapMenu> void openMenu(Player p, T menu)
static void openMenu(Player p, MapMenu menu)

#

1 or 2, they both would accomplish the same

mortal hare
ivory sleet
#

as they have the same erasure

ember estuary
#

but the first isnt void

#

is it

mortal hare
#

this project for me looks like wannabe great

ember estuary
#

oh wait it is

#

nvm lol

ember estuary
#

ok i see

#

java is weird

peak granite
#

no u

ember estuary
#

why would u put that in the front

#

xD

noble lantern
ivory sleet
#

anyways type tokens can make sure the type is not erased at runtime

ember estuary
#

i see

noble lantern
#

Converted a Collection of Chunks to a List of Chunks which was kinda stupid

ivory sleet
#

usually thru anonymous derivations

misty current
#

Collection<Player> collection = Collections.unmodifiableCollection(Arrays.asList(players)); i've found

#

not sure if it would work

ivory sleet
#

looks fine?

misty current
#

lemme test

noble lantern
#

Yep thats how it was done

misty current
#

best way

noble lantern
#

Arrays.asList takes anything iterable/loopable iirc

ivory sleet
#

it takes an array

noble lantern
#

or anything that an extension upon List

#

or that ^

misty current
#

oke testing time

#

Caused by: java.lang.IllegalAccessError: class me.kill05.cosmicprcore.utils.animations.PacketArmorStand (in unnamed module @0x23d61f66) cannot access class com.sun.tools.javac.util.List (in module jdk.compiler) because module jdk.compiler does not export com.sun.tools.javac.util to unnamed module @0x23d61f66 ugh

#

the line is the one that adds to the list

ivory sleet
#

you imported wrong list

#

I think?

misty current
#

oh that is very possible

#

lemme check

#

oh yea

#

umm

noble lantern
#

oh i figured out the worldguard thing

#

you use WorldGuard events not bukkit events smh

misty current
#

why tf does intellij prefer that over java's list

ivory sleet
#

top ten intellij mysteries developers are yet clueless about

noble lantern
#

intellij is braindead sometimes

misty current
#

dude i can count on my hand the times the right list was auto imported

ember estuary
ivory sleet
#

dovidas can help you with that as he seems to be writing smtng now

ember estuary
#

xD

mortal hare
ember estuary
#

irony? xD

ivory sleet
#

I dont think so lol

mortal hare
#

Class<? extends SpecialMapMenu>

#

iirc

ember estuary
#

ah

ivory sleet
#

flo if you for instance want to AT COMPILE TIME demand an instance to be conformable to by the type
use
<T extends MapMenu> void lol(Class<T> type, T instance);

ember estuary
#

works, ty!

public static <T extends MapMenu> void openMenu(Player player, Class<T> menuClass)

MapMenuAPI.openMenu(player, ClaimChunkMapMenu.class);

#

i hope thats right xD

ivory sleet
#

and then you have some sort of map which maps the class to the instance?

patent horizon
mortal hare
#

wildcards are runtime checked?

ember estuary
#

i use reflections

ivory sleet
#

but like the type param at Class is safe to use since yeah

#

then we got type token

round finch
#

i will try to change my java version!

ivory sleet
#

where essentially
TypeToken<Map<Integer,Collection<Map.Entry<String,Boolean>>>> TOKEN = new TypeToken<Map<Integer,Collection<Map.Entry<String,Boolean>>>>(){};

#

would keep the nested type

mortal hare
#

this looks really readable

ivory sleet
#

since its effectively same as
class O extends TypeToken<Map<Integer,Collection<Map.Entry<String,Boolean>>>> {

}

#

where the type must stay at runtime since the class needs it to define method signatures and such

mortal hare
#

imagine including this in public api

young knoll
#

What is this, DeluxeAsyncJoinMessages

#

Or whatever it is called

ivory sleet
young knoll
#

Oh no I have given him ideas

mortal hare
#

DeluxeAsyncJoinMessage is such a revolutionary plugin

#

Dev who created it should be hired by mojang studios

ivory sleet
#

lmao, yeah maybe I should make it inject itself into other plugins /s

young knoll
#
public final class FinalProUltimateDeluxeAsyncChatJoinMessagePluginImplFactoryAbstractCommonMainProviderBootstrapExecutorHandler
        extends @NotNull @Nullable @NonNls JavaPlugin implements @NotNull @Nullable @NonNls Listener,
        @NotNull @Nullable @NonNls Plugin,
        @NotNull @Nullable @NonNls CommandExecutor,
        @NotNull @Nullable @NonNls TabCompleter,
        @NotNull @Nullable @NonNls Serializable,
        @NotNull @Nullable @NonNls ConfigurationSerializable,
        @NotNull @Nullable @NonNls Executor,
        @NotNull @Nullable @NonNls ExecutorService,
        @NotNull @Nullable @NonNls TabExecutor,
        @NotNull @Nullable @NonNls BiConsumer<@NotNull @Nullable @NonNls FinalProUltimateDeluxeAsyncChatJoinMessagePluginImplFactoryAbstractCommonMainProviderBootstrapExecutorHandler,@NotNull @Nullable @NonNls FinalProUltimateDeluxeAsyncChatJoinMessagePluginImplFactoryAbstractCommonMainProviderBootstrapExecutorHandler>,
        @NotNull @Nullable @NonNls BiFunction<@NotNull @Nullable @NonNls FinalProUltimateDeluxeAsyncChatJoinMessagePluginImplFactoryAbstractCommonMainProviderBootstrapExecutorHandler,@NotNull @Nullable @NonNls FinalProUltimateDeluxeAsyncChatJoinMessagePluginImplFactoryAbstractCommonMainProviderBootstrapExecutorHandler,@NotNull @Nullable @NonNls FinalProUltimateDeluxeAsyncChatJoinMessagePluginImplFactoryAbstractCommonMainProviderBootstrapExecutorHandler>,
        @NotNull @Nullable @NonNls Supplier<@NotNull @Nullable @NonNls FinalProUltimateDeluxeAsyncChatJoinMessagePluginImplFactoryAbstractCommonMainProviderBootstrapExecutorHandler>,
        @NotNull @Nullable @NonNls Runnable,
        @NotNull @Nullable @NonNls Iterable<@NotNull @Nullable @NonNls FinalProUltimateDeluxeAsyncChatJoinMessagePluginImplFactoryAbstractCommonMainProviderBootstrapExecutorHandler>{
ivory sleet
#

😌

young knoll
#

It's beautiful really

patent horizon
#

yuck

young knoll
#

So beautiful it almost hits the discord char limit

ivory sleet
#

lol

mortal hare
#

Imagine parsing annotations of this plugin KEKW

young knoll
#

I wonder what it looks like when compiled

ember estuary
#

can you make fields abstract?

or would i have to use an abstract getter in that case?

ivory sleet
#

yes

young knoll
#

Surely the compiler must optimize a lot of the garbage quality code

ember estuary
#

ok :D

ivory sleet
noble lantern
#

exapsulation polymorphism inheritance abstraction

patent horizon
#

i would actually like to hear someone make a fluid song with the words encapsulation polymorphism inheritance abstraction

young knoll
#

DeluxeAsyncJoinLeaveMessage should use unsafe to change the constant false to true

noble lantern
#

if you know that term you should be able to get a job a google ngl

young knoll
#

Because apparently true and false are just constants in Boolean

ivory sleet
#

true

#

I havent touched it for a while

#

definitely needs an update

patent horizon
young knoll
#

Does it support 1.2.1?

mortal hare
#

DUDE

#

I opened

#

github repo

#

of deluxeasyncjoinmessage plugin

#

and my ungoogled-chromium crashed

young knoll
#

The heck is an ungoogled chromium

ivory sleet
#

lmao

young knoll
#

Isn’t that just edge

mortal hare
#

Google chrome without google shit

#

pure chromium without any trackers and google services

young knoll
#

So Firefox

mortal hare
#

basically yes, but on V8 rendering engine

patent horizon
proud basin
#

I just made something litty

mortal hare
#

thats four

patent horizon
#

no its not

#

cherries is plural

#

so it's 2 plural cherries

#

2 sets of cherry

patent horizon
#

ok ima just resend it at this point

#
java.lang.NullPointerException: Cannot invoke "String.toCharArray()" because "text" is null
    at me.clip.placeholderapi.replacer.CharsReplacer.apply(CharsReplacer.java:44) ~[PlaceholderAPI-2.10.10.jar:?]
    at me.clip.placeholderapi.PlaceholderAPI.setPlaceholders(PlaceholderAPI.java:70) ~[PlaceholderAPI-2.10.10.jar:?]
    at me.clip.placeholderapi.PlaceholderAPI.setPlaceholders(PlaceholderAPI.java:98) ~[PlaceholderAPI-2.10.10.jar:?]
    at me.wally.guilds.GUI.ItemBuilder.itemBuilder(ItemBuilder.java:35) ~[Guilds-1.0-SNAPSHOT.jar:?]
    at me.wally.guilds.GUI.Menu.Format.menu(Format.java:19) ~[Guilds-1.0-SNAPSHOT.jar:?]
    at me.wally.guilds.GUI.Menu.Events.playerRightClickNPC(Events.java:24) ~[Guilds-1.0-SNAPSHOT.jar:?]```
```java
        String skull = PlaceholderAPI.setPlaceholders(player, config.getString("SkullOwner"));```
ivory sleet
#

at me.wally.guilds.GUI.ItemBuilder.itemBuilder(ItemBuilder.java:35) ~[Guilds-1.0-SNAPSHOT.jar:?]
at me.wally.guilds.GUI.Menu.Format.menu(Format.java:19) ~[Guilds-1.0-SNAPSHOT.jar:?]
at me.wally.guilds.GUI.Menu.Events.playerRightClickNPC(Events.java:24) ~[Guilds-1.0-

#

actually wally

#

if you got it on gh, send the gh link

mortal hare
#

have you tried debugging config.getString("SkullOwner") its nullable and should be marked in yellow on your IDE?

patent horizon
#

heh

#

you expect too much from me

#

github is hard :(

patent horizon
#

so im not really sure where the error is coming from

ivory sleet
#

send ur itembuilder

mortal hare
#

show me line of ItemBuilder class - line 35

ivory sleet
#

actually

patent horizon
ivory sleet
#

send the entire stacktrace to begin with

patent horizon
#

wow

#

the stacktrace decided to go on a diet ig

mortal hare
#

😄

#

show me your whole playerinteractevent listener code block

patent horizon
#

wait i think that might be two errors

#

actually no it's just big

#

?paste

undone axleBOT
patent horizon
patent horizon
# mortal hare show me your whole playerinteractevent listener code block
    @EventHandler
    public void playerRightClickNPC(PlayerInteractEntityEvent event) {
        if (event.getPlayer().getWorld() != Bukkit.getWorld("ul_plex")) return;
        if (event.getHand() != EquipmentSlot.HAND) return;
        if (event.getRightClicked().getName().equalsIgnoreCase("npc-guildmaster")) {
            new Format().menu(event.getPlayer());
        }
    }```
mortal hare
#

can you send use the whole ItemBuilder class

patent horizon
mortal hare
#

sorry no idea what wrong is here and its 2AM for me so im going to bed

patent horizon
#

ok :(

mortal hare
#

gn everyone

ivory sleet
#

gn sleep tight

#

wally there should be a caused by clause in the stack trace

#

I think?

patent horizon
#

this is my config file

ivory sleet
#

send Format class

patent horizon
#
package me.wally.guilds.GUI.Menu;

import me.wally.guilds.GUI.Data;
import me.wally.guilds.GUI.ItemBuilder;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.inventory.AnvilInventory;
import org.bukkit.inventory.Inventory;

public class Format {

    ItemBuilder builder = new ItemBuilder();
    Data data = new Data();

    public void menu(Player player) {
        Inventory GUI = Bukkit.createInventory(null, 27, "Guilds");
        if (data.getGuild(player).equals("None")) GUI.setItem(12, builder.itemBuilder("Menu_guildUnset", player));
        else GUI.setItem(12, builder.itemBuilder("Menu_guildSet", player));
        GUI.setItem(14, builder.itemBuilder("Menu_guildInvites", player));
        player.openInventory(GUI);
    }

}```
ivory sleet
#

can you paste
ItemBuilder
Format
Events
and make sure the lines are correct

ivory sleet
#

?paste

undone axleBOT
ivory sleet
#

discord code blocks suck

#

since they dont display lines for some bizarre reason

ivory sleet
#

can you print config.getString("SkullOwner") (ItemBuilder line 35 or smtng)

patent horizon
#

it prints after the placeholder thing

noble lantern
#

When you inject a command twice to Bukkit's CommandMap will it get registered twice, or will any command registered after the first identical command is registered just be overwritten?

The scenario is a reload, i call onDisable and onEnable and it registers the Command in onEnable

ivory sleet
patent horizon
#

yeah idk what its problem is lol

patent horizon
#

its giving me errors for a line it was able to do

ivory sleet
#

Wally I mean not to be mean

#

but the design isn't good

patent horizon
#

it works

#

and thats what i need rn

#

what do you think is a good design

ivory sleet
#

oh I think we'll wait with my definition a bit

patent horizon
#

hm?

ivory sleet
#

anyways can you print config.getString("SkullOwner") also

patent horizon
#

well

#

now i feel bad about my design lmao

#

is there a better way to do this?

ivory sleet
#

there is

peak granite
#

Bukkit.getServer().getOnlinePlayers().hasPermission("").size doesn't work

ivory sleet
#

but I don't have the energy to go through it with you today

noble lantern
#

Tested it: It didnt thank god

patent horizon
#

oh ok

ivory sleet
#

tomorrow tho

noble lantern
patent horizon
#

alr

noble lantern
#

getOnlinePlayers is a Collection of Players

#

oh no adele has arrived

young knoll
#

WE COULD OF HAD IT ALLLL

ancient plank
misty current
#

when does the client render an entity?

#

when the entity is in render distance or is there a fixed distance?

#

i'm playing an entity spawn packet when a player loads a chunk

#

and the packet is sent but the entity is not there

proud basin
#

the spacing

quasi stratus
#

Does anyone know what seems to be wrong with my build.gradle file? It seemed to be working perfectly fine but now doesn't recognize the repository.

plugins {
    id 'java'
}

group 'org.example'
version '1.0-SNAPSHOT'

repositories {
    mavenCentral()
    maven { url "https://hub.spigotmc.org/nexus/content/repositories/public/" }
}

dependencies {
    testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.1'
    testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.1'
    implementation 'org.spigotmc:spigot-api:1.17.1-R0.1-SNAPSHOT' // Spigot API
}

test {
    useJUnitPlatform()
}```
ivory sleet
#

First of all, compileOnly for the spigot dependency

#

Not implementation

#

But yes that should work?

#

In case something’s not working

#

Might wanna try invalidate caches

#

And bump gradle version

ember estuary
#

How can i force someone extending my class to implement a specific static function?

#

i cant seem to combine static and abstract

#

but abstract is the only way i know of to force someone to create a function in the subclass

ivory sleet
#

No because static was never meant to be with inheritance

ember estuary
#

:/

#

that sucks

ivory sleet
#

¯_(ツ)_/¯

shut field
#

does anyone have any reasons that "section" can sometimes be null?

ivory sleet
#

Like a ConfigurationSection?

shut field
ivory sleet
#

Might be null due to representation of its absence

candid plover
#

is it harmful for the server to pull information directly from the database and not cache it?

shut field
candid plover
#

I'm making a house system but I don't know how to do it in cache, so I'd like to pull it directly from the database

ivory sleet
shut field
#

and I even check in the YML file to make sure it is there right before this code is ran?

ivory sleet
#

Well usually you just check if the data is in the cache, if not you get the data from the database and put it into the cache

ivory sleet
candid plover
shut field
ivory sleet
#

The compiler cannot guarantee that calling the same method twice results in returning the same object twice

#

From a theoretical point of view: calling the method a second time could give you another config section object

ivory sleet
#

Then ofc ensure entries get expired properly

ivory sleet
#

Variable

candid plover
#

Can you help me make a base?

#

I have a cache system to pull information from players, but I can't develop for houses.

ivory sleet
#

No not right now, but caching just means that you store objects somewhere

shut field
ivory sleet
#

no

#

That’s not the section is it lol

candid plover
#

    private UUID uuid;
    private String name;

    private Location loc;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Location getLoc() {
        return loc;
    }

    public void setLoc(Location loc) {
        this.loc = loc;
    }
}```
#

this is my class for home

ivory sleet
#

I mean

candid plover
#

How do I store multiple objects in a hashmap?

ivory sleet
#

are you even familiar with maps?

#

If not

#

Go and learn about that first

shut field
ivory sleet
#

I’m still very confused why you resorted to a loop

#

It makes -1 sense

shut field
#

cause like what if it again just set it to null again?

ivory sleet
#

Well

#

What do you want if the section is null?

#

Reassigning it won’t help

#

As it will presumably be null again

#

So it will end up in a freeze

shut field
ivory sleet
#

thus crashing the server

ivory sleet
#

if it’s not there

shut field
ivory sleet
#

Then how do you plan on giving it back?

#

but IF IT IS NOT

shut field
#

I thought that the .contains would do that for me

ivory sleet
#

Yeah then don’t do anything?

shut field
ivory sleet
#

That’s why need to handle the failure properly

#

So you can figure out what went wrong

#

if (section == null) {
// handle absence of section
}

shut field
#

what would you put in that statement for instance?

ivory sleet
#

Hugely depends on what you’re doing

shut field
#

I'm trying to make persistent data

#

it saves a few different values for a Class var

#

Ig I just wasn't reloading the config enough

#

so some changes were not taking effect

lean gull
#

can someone please help me with making this less laggy? i need to have a bunch of these methods

ember estuary
#

when i pass an ItemStack to the constructor of a class and then save it in a variable in that instance (this.itemStack = itemStack),
when i then do thatItemStack.setItemMeta(..) , does it also update it inside the instance?

#

it should, right?

summer scroll