#help-development

1 messages ยท Page 340 of 1

glossy venture
#

i understand the theory but in practice when i get 3 triangles and 2 circles shoved in my face i dont have a single fucking clue what to do

tardy delta
#

what kind of math

glossy venture
#

you can use a function like

/**
 * Shapes the current progress.
 */
public double shape(double curr) {
  return /* achieve the shape */;
}
minor garnet
#

in this case I wouldn't need it like a location with the x and z axis, I would really only need the height of the curve

glossy venture
#

idk what formula youd use

#

wait do you want to change the shape of the progress

#

or of the coordinates

glossy venture
#

just do some math on the progess value, like a square or smth

#

to achieve the shape

minor garnet
#

i just want get the values vertical of 1 to 0 understand

glossy venture
#

yeah

minor garnet
glossy venture
#

you linearly interpolate between 1 and 0, then pass those progress values through a function which transforms them

tardy delta
#

math ๐Ÿ’€

glossy venture
tardy delta
#

i should be doing tabcompletion for my parser

warm light
#

is it possible to remove this log?

tardy delta
#

why would you

#

people thinking console should be fancy

dry yacht
#

Looks like you want to have a parabolic equation which is constrained to go through A and B, but I didn't understand a single word of your explanation, xDD

warm light
glossy venture
#

yeah parabole

glossy venture
#

use pow

dry yacht
minor garnet
dry yacht
minor garnet
#

dude tf

glossy venture
#

@minor garnet

for (float rt = 0f; prog < 1f; prog += step) {
  float t = Math.pow(rt, 1.5f);
  // use t
}
glossy venture
#

if his englishabd

#

bad

tardy delta
#

bro i using translator ๐Ÿค“

#

man speaking google translator

warm light
dry yacht
tardy delta
#

uh oh dont use color codes in the console cuz it looks fancy

#

if you use a proper terminal, the warnings and errors etc will be in red by default

minor garnet
#

resuming

glossy venture
#

they could make a linear interpolation between two values (distance between points), but they want a quadratic interpolation

minor garnet
#

i intend to create a sound system that when played in a location, its sound decreases based on the distance of the player with the location of the sound

tardy delta
#

bruh mongodb crashed with 2k lines stacktraces

minor garnet
tardy delta
#

temporary failure in name resolution ๐Ÿ’€

minor garnet
#

but i wanted the sound to be based on a curve so f way

glossy venture
#

try math.pow

#

have u tried what i setnt

twilit roost
#

How can I sort Teams?
Like the order they are displayed in Scoreboard

glossy venture
#

did it wrk

minor garnet
#

i just wanted to make it specific to this smart

glossy venture
#

oops

#

forgot to replace prog with rt

minor garnet
#

progress can be the distance and..

glossy venture
#

and i just noticed youre just using a function

minor garnet
#

so need be to ''0 from 1''?

#

wait

glossy venture
#

so i guess you would use

// the distance of complete falloff
private static final int MAX_RANGE = 10;

public static double getVolume(double distance) {
  return Math.max(0, 1 - Math.pow(distance / MAX_RANGE, 1.4f));
}
minor garnet
#

alr

dry yacht
glossy venture
glossy venture
#

though thats not the correct shape

#

log is prob the shape ur looking for

#

or

minor garnet
glossy venture
#
// the distance of complete falloff
private static final int MAX_RANGE = 10;

public static double getVolume(double distance) {
  return Math.max(0, Math.pow(1 - (distance / MAX_RANGE), 1.4f));
}
dry yacht
minor garnet
#

and one doubt if this is from left to right

#

and about that blue curve

#

that I would need to do the reverse

dry yacht
glossy venture
#

tweaked the values a bit

#

looks like the right shape

#

sort of

subtle folio
#

By accessing the Configuration section?

quaint mantle
#

Hi, I have this little error and I wonder how to fix this ^^ (I use bedwars1058)

tardy delta
#

what version

subtle folio
dry yacht
# glossy venture tweaked the values a bit

I was kinda thinking about something like this. It's a pretty good difference in comparison to a linear interpolation, but it's nothing too crazy. I think this should compensate enough for the logarithmic nature of our ears.

subtle folio
#

Yes, a plugin could be interfering with it.

quaint mantle
haughty granite
quaint mantle
#

On the scoreboard?

#

For the scoreboard?

frank kettle
#

Scoreboard prefix and sufix changed on the Minecraft api, not java

frank kettle
#

Try adding a color on those blank rows to make then different

#

And what exactly is not working?

#

Ah I saw above

#

Then you changed Minecraft api version, not java.

#

U can type 16 max characters. So u use prefix, sufix and name for a total of 48

#

Using Teams ๐Ÿค”

quaint mantle
frank kettle
#

U can only type max 16 characters on each "string"

dry yacht
# dry yacht I was kinda thinking about something like this. It's a pretty good difference in...
private static final double MAX_DISTANCE = 10.0;

public static double getVolumeForDistance(double distance) {
  distance = Math.abs(distance) / MAX_DISTANCE;
  if (distance >= 1)
    return 0;
  return -1 * Math.log10(distance * .9 + .1);
}

Oh btw, this would be how I'd implement it. It's thus a symmetrical function around the origin and doesn't need any additional calls to min or max. There's also the fast-exit of the distance exceeding the max-distance.

quaint mantle
#

is there a player entering a boat or player entering a minecart event?

tardy delta
#

optimisation bruh

dry yacht
#

Is segmenter a valid english word? Or is it segmentator? Or segmentor? Man, what do you call something which segments something? My lord

tardy delta
haughty granite
#

in the same way as the config.yml file, I have to create a new one in the resources folder to save it in the plugin folder but the saved file is empty

#

any idea why ?

tardy delta
#

wdym its empty

quaint mantle
#

what would be the event for player trying to trade with a villager?

haughty granite
#

the .yml file in my resources folder has content, but when creating the file in the plugin folder the content does not paste

#

but I don't understand how to tell it to copy the file to my resources folder

hazy parrot
#

There is saveResource method in JavaPlugin

quiet ice
hazy parrot
tardy delta
#

uh i forgot about smth so might not be so wise

quiet ice
#

If anything it should be .getCodepoints, but null terminating stuff is asking for issues

tardy delta
#

whats getcodepoints?

quiet ice
#

Ah, doesn't exist - stupid java devs

#

.codepoints() exists, but it returns a stream

#

And it's J9+ only

tardy delta
#

ok fixed it but looks kinda weird

quiet ice
#

now let's just hope you don't get non-ascii input

river oracle
#

I barely use arrays

#

Only ever really use arrays if I'm trying to be super memory efficient

twilit roost
#

How can I display players ping in scoreboard?
The most effective way of it?

tardy delta
#

actually that null terminating is useless, i was trying to improve performance but it doesnt change

#

still need to check smth else so it stays the same

quaint mantle
#

hi, is there a way to set a column by column index?

tardy delta
#

is there a way to a column by column?

#

what columns are we talking about?

#

sql?

quaint mantle
#

i have been working for a few hours.

#

yep, sql.

tardy delta
#

i dont see any direct method for that

#

as those indices refer to the nth ? character

quaint mantle
#

can sql store arrays?

tardy delta
#

yes

quaint mantle
#

hm.

#

nah, its just strings.

odd adder
#

Hello , how can i provide the syntax hint but not make it be an option like the screenshot when typing command with ACF (Annotation Command Framework)?

tardy delta
#

looks like brigadier

#

i know they have brigadier support, or its just the paper command manager idk

odd adder
#

i tried many examples in the examples in ACF's github page , but they are become an option to use , are not just a hint.

quaint mantle
#

i am storing a lot of data in a sqlite database and i wanna edit the data. It's just a command separate string. An array of booleans pretty much but there a lot of em.

#

is there a way to edit one character in sqlite?

#

since this operation may happen a lot as the database is active.

#

or is there a better way to store arrays in sqlite?

tardy delta
#

what are you trying to do?

quaint mantle
#
    public static final int PLANT_TREES = 0;
    public static final int USE_ENDER_CHEST = 1;
    public static final int USE_ANVILS = 2;
    public static final int USE_LEVERS = 3;
    public static final int USE_FURNACES = 4;
    public static final int USE_BOATS = 5;
    public static final int BREAK_CROPS = 6;
    public static final int USE_PRESSURE_PLATES = 7;
    public static final int USE_FENCE_GATES = 8;
    public static final int USE_BEDS = 9;
    public static final int CHOP_TREES = 10;
    public static final int USE_BUTTONS = 11;
    public static final int OPEN_SHULKERS = 12;
    public static final int USE_ENCHANTING_TABLE = 13;
    public static final int KILL_FRIENDLY_MOBS = 14;```
#

if this answers the question.

tardy delta
#

no

quaint mantle
#

i am just trying to store an array of booleans, that is it.

tardy delta
#

permissions for each player?

quaint mantle
#

well for the plugin i am currently working on, permissions for each chunk.

#

this is kinda what it looked like

tardy delta
#

im thinking about a bitset

#

but dunno how to store it in sql

#

blob probably

quaint mantle
#

pretty much just wanna do it O(1) time per element.

#

instead of having to change the entire array.

tardy delta
#

what is one element? one bit?

hazy parrot
#

im afraid that is not possible

#

i mean it also depends on your scheme setup, but if its in bitmask or whatever, you would have to read whole bitmask, do operation with it and write it again

#

unless im missing some feature of sql

quaint mantle
#

i am using sqlite.

tardy delta
#

saw this

hazy parrot
quaint mantle
#

i am just storing array of booleans right now but if i wanted to store more data than this, i may wanna know an efficient way to do it.

tardy delta
#

are you using a boolean[] in your java code?

quaint mantle
#

yep.

#

and the constants i posted earlier are indexes for that array.

tardy delta
#

n boolean will take n bytes, use a BitSet where each boolean will take 1 bit

#

but ye just optimisations, doesnt matter too much

pseudo hazel
#

I would just update the db in batches

haughty granite
#

I don't understand the error

tardy delta
#

isnt it .spigot().broadcast()?

quaint mantle
#

sqlite probably should provide a better way for storing arrays though.

pseudo hazel
#

but yeah its best to just use a binary int that is just the amount of bits as you have options, maybe group certain stats together so you can grab it, edit it and send it back

hazy parrot
haughty granite
#

thank you

hazy parrot
#

i would personally do what fourteenbrush suggested, bitmask

tardy delta
#

hmm anyways which one of the three is the cleanest?

#

me trying to optimize reading times for each char

pseudo hazel
#

the first one

hazy parrot
#

1st

pseudo hazel
#

clearly

tardy delta
#

atleast that one hides the ugly code ๐Ÿ’€

pseudo hazel
#

yeah but we dont care

#

if we cared we didnt have that option in the first place

tardy delta
#

now i can blame java a CharConsumer doesnt exist

#

๐Ÿ’€

quaint mantle
#

yep bitmasking is probably the way to go here.

#

just googled it though.

#

well

#

i knew what it was but was just unfamiliar with the term.

#

so basically like if i have 32 booleans to store, i can store in a 4 byte int or something and just set the bits of that int individually, right?

tardy delta
#

shrug int and char maths, '0' is 49 ๐Ÿ’€

#

and you believe that

hazy parrot
#

I swear gpt was better when it was released

quaint mantle
#

btw, how do i go about manipulating individual bits in java?

twilit roost
#

How can I check if Team is registered?

quaint mantle
twilit roost
quaint mantle
#

sorry, i have not really used this feature before.

hazy parrot
twilit roost
#

my dumbass always though that x ^ y
is equivalent of Math.pow(x,y)

tardy delta
#

dammit

#

^ is binary xor

hazy parrot
tardy delta
#

if value & flag != 0 => flag present

hazy parrot
#

๐Ÿ‘†

tardy delta
#

#general message

#

ij probably wont have my code changes history from 3 hours ago so cant reformat :(

#

bruh how 2 chars break my code

#

wait what exactly are you trying to do?

#

and what exactly is a generator?

#

so you're trying to have one generator for a bunch of different file types?

#

and storage is just database/ yml files?

desert loom
#

you could provide an abstract method in BaseDataApplication<D> that produces instances of D.

For example,

protected abstract D newBaseData(YamlConfiguration config);

And then you can have the extending class provide the implementation.

serene sigil
#

hi, how do you create a void world? i want to make a waiting world (kina like hypixels afk world or 2b2t queue) that doesnt take up a lot of memory, how do you do that?

#

does this take up much memory?

#

cuz basically i want to make an afk world where ppl get tped to that are afk

#

and a lot of ppl need to be there so it should not affect memeory

#

no, i mean when like ppl get tped there

#

also how does hypixel do it?

#

do they have multiple worlds?

remote swallow
#

im pretty sure hypixel uses like 1 of their dedi's around the world to host so many limbo worlds/servers and each world is like millions of blocks big

#

and its just repeating the same thing

#

for miles

#

yeah

serene sigil
remote swallow
#

hypixel dont care

#

they probably have like 500gb or something like that or more per dedi

#

they probably give a mode like 5/10gb

#

wonder if they get to petabytes of ram

worldly ingot
#

They post stats for all that stuff every year iirc

remote swallow
#

they do?

hazy parrot
#
tardy delta
#

6TB lets go

hazy parrot
#

1.7 tb of ram in 2013

#

incredible lmao

remote swallow
#

43 terabytes of ram

#

my god

hazy parrot
#

๐Ÿคฉ

#

2PB of data transferred in the last week

remote swallow
#

that seems low

#

i wonder how many of those db nodes are just backups

worldly ingot
tardy delta
#

80TB ram ๐Ÿ’€

#

we can only dream of that

remote swallow
#

i bet thats around 150tb ram

tardy delta
remote swallow
#

43 to 79

tardy flame
#

๐Ÿ˜ฌ๐Ÿ˜ฌ

remote swallow
#

they have to be a registered company so there might be some numbers online

#

1.2 million dollars a year

hazy parrot
#

2015

river oracle
#

That was 2015

hazy parrot
#

imagine now lmao

remote swallow
#

what if it was like 1.2 million a month now

#

they dont tell us cpu

#

sadly

#

one second

#

im gonna do some math

hazy parrot
#

im which country is hypixel registered

remote swallow
#

if we take a guess that hypixel use 2pb of network a week

#

in a year they use 104 petabytes

#

top one is hypixel

#

but i wonder if the 2nd is too

#

2nd one isnt

#

not registered to simon

quiet ice
#

it's the comany created for hytale iirc

remote swallow
#

do other people own it

#

or something like that

quiet ice
#

not entirely sure - it is likely that the ownership structure is a bit different for the studios one

remote swallow
#

im guessing its a high up staff member in hypixel that owns it

#

or its a hypixel partner

#

trade marks are owned on all of them

slender kiln
#

Does anyone know anything about playerdata and stats?

hazy parrot
#

I assume someone here know about it

remote swallow
echo basalt
#

which is now merged with riot

#

Is not really owned by simon

#

he has a business partner

remote swallow
#

what actually is hytale

echo basalt
#

their own game

remote swallow
#

they have a game?

echo basalt
#

working on it

remote swallow
#

it looks mc esque

woeful flicker
#

ok this feels like a very stupid question...but how i can use a duration for a command argument, such as a ban or mute, there is 1d, 25m, 15m, 2h etc.

#

i've been doing this for a while and unfortunately have not done this before

#

i.e. in my case im doing BossBars...so would like to have /bossbar create <color> <style> <duration> <title>

vocal cloud
#

Depends. If it's preset times then you can add a list of them to auto complete and have a HashMap that matches that to minutes or w/e time unit. Otherwise write a parser

woeful flicker
#

alright, thank you.

rough drift
#

can I run Bukkit.getWorld(uuid).getPlayers() async? (Made it a one liner to display everything I need there)

alpine swan
#

how could i explode an ender crystal from a plugin

rough drift
#

Using some blocking operations on players

rough drift
#

Alright then

chrome beacon
#

Time for task chain

rough drift
#

Yeeee

#

I just chained two tasks together

#

var players = getWorld().getPlayers().toArray(Player[]::new); and I run the loop on an async task

#

should work

#

(toArray to make sure it doesn't change in iteration)

chrome beacon
#

You shouldn't really use the player object either

chrome beacon
#

Grab what you need sync

remote swallow
#

var user

glossy venture
remote swallow
#

yeah

sterile token
#

What would be the equipvalent for the calling default a rank? Cuz default is a Java keyword

chrome beacon
#

Call the class DefaultRank or smth

raw prairie
#

!learnjava

#

whats the command again

#

lol

#

?learnjava

undone axleBOT
raw prairie
#

there

sterile token
trim creek
# raw prairie there

This is

  1. rude
  2. unrelevant, since VERANO probably knows why they can't use "default"
haughty granite
#

how to retrieve my variables declared in TimeVoterCommand in the VoteUtils file?

haughty granite
#

DI ?

sterile token
#

DI - Dependency Injection

#

So in that case i would pass your command instance directly to VoteUtils, instead of passing your plugin instance

haughty granite
#

but I need both

humble tulip
#

defaultRank

sterile token
haughty granite
#

it's in the case that I have to have two that I don't know how to do

#

I have no idea how to use DI in this case

sterile token
#

how you were doing it

#

Instead of passing your plugin instance, pass directly the command instance

haughty granite
#

I need the instance of my main file, how can I make a second instance of another file?

sterile token
#

okay

#

Let me explain how DI works

remote swallow
#

?di send this

undone axleBOT
sterile token
#

DI is a designed pattern which allow you to pass instance/s thru constructors

#

That the simpliest way to explain it

timber crescent
#

how come this isnt a uuid?

[20:59:32 WARN]: java.lang.IllegalArgumentException: Invalid UUID string: 3a8a6c51b01b4a98b387c693957b21e3
[20:59:32 WARN]:        at java.util.UUID.fromString(UUID.java:194)
[20:59:32 WARN]:        at me.hyptex.kitpvp.DisguiseHandler.setDisguise(DisguiseHandler.java:51)
[20:59:32 WARN]:        at me.hyptex.kitpvp.commands.DisguiseCommand.disguise(DisguiseCommand.java:31)
[20:59:32 WARN]:        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[20:59:32 WARN]:        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[20:59:32 WARN]:        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[20:59:32 WARN]:        at java.lang.reflect.Method.invoke(Method.java:498)
[20:59:32 WARN]:        at me.vaperion.blade.container.impl.BukkitCommandContainer.lambda$execute$7(BukkitCommandContainer.java:254)
[20:59:32 WARN]:        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
[20:59:32 WARN]:        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
[20:59:32 WARN]:        at java.lang.Thread.run(Thread.java:748)```
remote swallow
#

UUID strings have dashes

#

that would just be a UUID

timber crescent
#

its cause im getting it from the mojang api but theirs dont have dashes

haughty granite
undone axleBOT
sterile token
sterile token
haughty granite
remote swallow
# timber crescent https://paste.md-5.net/hugokoveyo
sterile token
haughty granite
#

I am completely lost with DI

remote swallow
#

pass in the command instance

#

get the plugin instance from the command

hazy parrot
#

Why would you have your utils class as an object

haughty granite
remote swallow
#

that getPlugin method is pointless because you need an instance of the class to call it, you can pass this in instead of plugin, pass the command instance to utils which is just wrong

#

utils methods should really be static

haughty granite
#

sorry but I don't understand what I'm supposed to do

sterile token
haughty granite
#

yes and what you are trying to explain to me

remote swallow
haughty granite
remote swallow
#

no

haughty granite
#

๐Ÿ™ƒ

remote swallow
#

make the utils not need initilizing

haughty granite
#

in the tutorial he puts all the variables in the main class so he doesn't have this problem, but I wanted it to be in the command file

#

that's why I'm totally lost

remote swallow
#

Utils.doSomething(plugin, "cool info thing");
&
public class Utils {
    public static void doSomething(JavaPlugin plugin, String string) {
        plugin.getLogger().info(string);
    }
}

``` instead off```java
new Utils(plugin).doSomething("cool info thing");

public class Utils {
    private JavaPlugin plugin;
    public Utils(JavaPlugin plugin) { 
        this.plugin = plugin;
    ]

    public void doSomething(String string) {
        plugin.getLogger().info(string);
    }
}
sterile token
#

Right, utils classes should mostly have static methods

haughty granite
sterile token
#

static should be used for utility methods and some other things

haughty granite
#

ok I will try to adapt my code

trim creek
haughty granite
#

in fact, class Utils are only there to get data more easily/quickly, not so much to execute?

quaint mantle
#

how to prevent player from closing inventory

#

i get stuck in a loop when i make it reopen on closeinventory event

#

it's when players join btw

#

I feel like the inventory gets naturally closed for some reason

#

then opens again..

#

it's weird...

wet breach
#

whether a util method or class needs to be static depends on where or how you want it used

#

it being static would allow it to easily be used say in Anonymous inner classes without much issue

#

just note that anything static never gets GC'ed

humble tulip
quaint mantle
#

i tried opening it like 60 ticks after they join and still same problem

#

@humble tulip

humble tulip
#

Huh

quaint mantle
#

i feel like the inventory automatically closes before it shows up for some reason

humble tulip
#

No reopen the inv 1 tick after they close it

#

Ohh

quaint mantle
#

idk im not sure

#

because im opening it for them onJoin

#

so maybe it closes and opens again

#

and that would explain the infinite loop

#

so idk what to do

#

Hi can someone help I am trying to make the code put in block location a bed but I don't know how to do it

sterile token
#

Also take in knowledge that using Player#closeInventory() can bug the cursor when you open it again
@quaint mantle

tender shard
#

it should just drop the item if you had an item on the cursor while it's being closed

sterile token
#

oh right, but sometimes happen to me that they just disappeared

quaint mantle
#

this seems like such an easy thing to program bruh

#

how could it be so impossible

#

even chatgpt cant find a solution to my problem

wet breach
#

I think this is about the time you show how you are doing it

sterile token
#

agree with frost

#

Please share your code

#

?paste

undone axleBOT
quaint mantle
#

there

#

infinite loop in the console as a result

#

when player joins

#

any idea? @wet breach @sterile token

echo granite
quaint mantle
echo granite
#

How do you know there is an infinite loop?

quaint mantle
#

it just spams errors in the console

echo granite
#

Send the errors as well

#

Otherwise I can't know what went wrong

quaint mantle
#

Ok

wet breach
#

first and foremost don't compare inventories using titles

#

hold a reference to your inventory object and compare the inventory object player has opened with the one you have in memory

#

reason for this is that inventory titles can be changed client side with a packet

#

well not changed, but sent

#

second I need you to elaborate what is the goal with re-opening the inventory

#

do you not want them to close it?

quaint mantle
#

yes

#

that is the goal

wet breach
#

ok so to prevent the two events from conflicting with each other

#

set a boolean that both check

#

so, when they join, the boolean can be false or 0

#

and then when the inventoryclose event handles it, have it set to 1

#

then this way anytime the open inventory event fires it can see it doesn't need to do anything

quaint mantle
#

if(e.getInventory().equals(GUISelection())) is false

#

doesnt work

remote swallow
#

hold an instance of the actual inventory

delicate lynx
#

you have to store it

pseudo hazel
#

cant you cancel inv close event?

quaint mantle
#

Alright

quaint mantle
pseudo hazel
#

sad

wet breach
#

if at anypoint there is a time where the inventory does need to be closed you could use a different boolean for that too

#

this way your inventory doesn't just keep opening indefinitely when it does need to close ๐Ÿ˜›

#

and you just make that boolean a global thing that is kept in memory so it doesn't get lost and the events just check it

#

this should stop your indefinite opening and closing of the inventory lol

quaint mantle
wet breach
#

well before you worry about that, lets get your inventory working

quaint mantle
#

e.getInventory().equals(inv) is just true and same stuff happens

wet breach
#

and then from there you can fix it to be proper

quaint mantle
#

I'll try the boolean thing

remote swallow
#

.equals should be used for strings, == for that use case

wet breach
#

.equals works but both have to be the exact same content wise with nothing changed

#

== works if they both point to the same memory instance

#

or should say they both reference the same memory

quaint mantle
#

btw chatgpt suggested same thing u suggesting@wet breach

#

lol

#

tried it didnt work

#

lemme see again

wet breach
#

well it could be how you are implementing it

#

not that it wouldn't work

quaint mantle
#

Alright hold on

#

so when its true not open it again?

#

@wet breach

wet breach
#

depends what you need, but essentially what you have going on is two events trying to do the same thing

#

so the boolean is just to keep one event from doing something if the other has it handled

quaint mantle
#

onjoin oncloseinventory

wet breach
#

so, it would be wise to have the onCloseInevntory handle what you are wanting since it contains the most code and checks

#

so you would in in onJoin check if the boolean is true, if its not do its thing then set it to true

quaint mantle
#

basically the goal is:

#

player joins, opens inventory

#

when they try to close it, it opens it again

wet breach
#

yes but when they try to close it, the close event should handle that

#

but not before join event has handled anything

#

therefore the boolean

#

and then once the boolean has been set, onJoin shouldn't try to do anything. I would improve on this to make it a per-player boolean

#

but as I said lets get your thing working first ๐Ÿ˜›

quaint mantle
#

oh i am already doing per-player boolean

#

with a map

wet breach
#

oh nice, anyways just a simple stall check just prevents multiple events that get fired at once from doing everything at once XD

#

this should solve your infinite loop of inventory opening

quaint mantle
#

e.getPlayer().openInventory(inv);
players.put(e.getPlayer(), true);

onCloseInventory:

if(e.getInventory().equals(inv)) {
    if(players.get(e.getPlayer())){
e.getPlayer().openInventory(inv);
            }
        }```
#

what i have

wet breach
#

first check the boolean before checking the inventory

quaint mantle
#

nah, endless loop still

wet breach
#

it is a faster check to check for the boolean, because if its set for the close event to do nothing, why do we need to check the inventory?

quaint mantle
#

StackOverflowError

wet breach
#

you don't have any other plugins?

quaint mantle
rotund ravine
#

@quaint mantle Lol

wet breach
#

you forgot to have the onJoin check the boolean

quaint mantle
rotund ravine
#

Itโ€™s just funny, ignore me

quaint mantle
wet breach
#

I know it doesn't make sense, but do have onJoin check if the boolean is set, if it is do nothing. the Close event should only do something if it is set, if not do nothing

quaint mantle
#

alr

wet breach
#

multiple join events can be fired when joining, is why that would make sense ๐Ÿ™‚

quaint mantle
#

so check if map doesnt contain key player

#

then put player and boolean in there

#

could be done with a list too when u think about it

rotund ravine
#

Might be fun to use metadata too.

wet breach
quaint mantle
#

i tested and if i just open an inventory when the player joins, it instantly closes and opens again

#

by puttin sendmessage in oncloseinventory to the player to show when it has been closed

#

there's something going on where the inventory gets closed automatically

#

and also we know that whatever we put in events happen before the event is triggered

wet breach
quaint mantle
#

true, I'm using spigot 1.18.2

rotund ravine
#

The JoinEvent gets run a lot of times before the client actually loads properly in.

quaint mantle
#

then that's the issue

wet breach
#

well, I could see mojang implementing in 1.18 some kind of inventory close thing

quaint mantle
#

it opens the same inventory mutlitple times

wet breach
#

in case maybe the player wants to leave?

quaint mantle
#

would explain why it closes

wet breach
quaint mantle
#

it's not gonna change anything

#

is it ?

wet breach
#

it will because if the inventory closes the inventory close event will handle it from there

quaint mantle
#

oh i see

#

alright

wet breach
#

you had 2 events trying to do the same thing

#

and thus conflicting with each other

#

just it was automatically happening as opposed to done by user input ๐Ÿ˜›

#

adding the boolean check to both events allows both events to escape the indefinite loop ๐Ÿ˜‰

quaint mantle
#

should i change the boolean in the onclose event

wet breach
#

So, in onJoin since you are using a map, you should first check if the player is there. If not add them there and the boolean. If they are present in the map, check for the boolean if set, do nothing

#

if it is set, that means onJoin already fired and did its thing and it should no longer do its thing for that player

#

And then inventoryCloseEvent should pick up from there

haughty granite
#

how can I get the keys from eventsMenuGUI (in config.yml) to put them in an array, and then forEach on them?

wet breach
quaint mantle
#

if(!players.containsKey(e.getPlayer())) {
players.put(e.getPlayer(), true);
e.getPlayer().openInventory(inv);
}

#

enough like that ?

#

in onjoin

wet breach
#

that checks the boolean

quaint mantle
#

and then ?

wet breach
#

if its set, return

kind hatch
wet breach
#

or just do nothing below that block of code

#

either or works

#

or should

quaint mantle
#

i dont see how it could change anything ?

#

i tried without it

#

it doesn't work: endless loop again

rotund ravine
wet breach
#

you could add some debugging messages to be outputted too

haughty granite
wet breach
#

just send messages to console or the chat that states where in the code is what is being executed

quaint mantle
wet breach
#

but you definitely should check for the boolean in onJoin.

quaint mantle
#

it's not gonna change anything though

#

i don't get why

#

here

#

good?

rotund ravine
#

Try waiting a few ticks, that is always great.

quaint mantle
#

where

#

before if statement?

wet breach
#

have the if statement ran in a scheduler and schedule the task a couple ticks out ๐Ÿ™‚

quaint mantle
#

i already tried this

#

๐Ÿ˜ฉ

dry yacht
wet breach
#

but you should add debug messages

#

so you know what code pieces are being executed

#

can even output data too along with it

kind hatch
# haughty granite something like that?

I don't use lambda mainly cause I don't understand it, but I think you're on the right track.

for (String section : config.getConfigurationSection("path.to.your.sections").getKeys(false)) {
  System.out.println(config.getString("eventsMenuGUI." + section + ".worldName"));
}
quaint mantle
#

or console

#

because it spawms the overflowstack error

wet breach
quaint mantle
#

damn you want me to go to logs

#

and scroll all the way up there til i find my strings in this mess

wet breach
#

you can use cat and grep to find what you are looking for

#

cat will just output the text to console without opening the document, grep to filter

haughty granite
quaint mantle
#

such a pain

wet breach
#

lol

quaint mantle
#

over some inventory shit

#

seriously

wet breach
#

welcome to plugin development when it hits the fan

kind hatch
kind hatch
wet breach
#

deprecated doesn't necessarily mean unusable unless it states as such

kind hatch
#

Really think there should be a different annotation at that point, but I guess that's just me.

dry yacht
dry yacht
kind hatch
#

Exactly, that's what I interpret it to mean as well. I don't get why it isn't annotated differently to represent it as such. We all know that Bukkit#getOfflinePlayer(String name) has legitimate usecases, but because it was misused so much they went and marked it as @Deprecated.

wet breach
#

warnings are not errors

#

magic numbers means hardcoded values

#

they are generally bad because it enforces a design principle that is highly discouraged

dry yacht
# wet breach there is no requirement to suppress them

Of course there's no requirement, still I don't know why I have to look at them each time. They shadow real warnings I'm interested in. This way, I have to check the warnings manually each time and cannot just rely on zero warnings.

dry yacht
wet breach
#

Mojang has moved away from using things like magic numbers to strings, however not everything is quite like that or can be just yet

ember crag
kind hatch
#

It was. It's just a little annoying that it's still marked as deprecated. I'm pretty sure most people get that storing uuids instead of names is the way to go now.

ember crag
#

its way easier imo, it helps ease comparison checks since UUIDs dont change

wet breach
tender shard
wet breach
#

if they download the log they could

#

from console it doesn't work

tender shard
#

even nano has a search feature

#

vi ofc too

wet breach
#

indeed

tender shard
#

every app has

quaint mantle
#

found the issue btw @wet breach ๐Ÿ™

wet breach
#

yes and in GUI form it is more easier to use such things

#

for others that is

quaint mantle
#

i mean, found a solution

#

we good

kind hatch
#

Marking things as deprecated because of misuse just seems like the wrong approach.

wet breach
#

sure for the experienced it becomes a nuisance I guess about those warnings, but you can always tailor your IDE to ignore such things

#

especially if you are doing MC development

#

does your IDE not support profiles?

kind hatch
#

Lol no. It's just a gripe.

quaint mantle
# wet breach https://tenor.com/view/minions-woo-hoo-yeah-celebrating-happy-gif-16135630

just in case: i made it so player and boolean are always in map since first join, then if player has inventory on --> boolean set to true, if inventory closed --> boolean set to false. then i just made a scheduler that checks every 2 ticks if a player is in the map and has boolean set to false, if so it makes the inventory open again. no infinite loop and we celebrate

wet breach
#

just had to point you in the right direction

quaint mantle
#

thanks for the help

wet breach
#

and as for earlier, yes I am aware that I tend to give the same response or similar to that of chatgpt ๐Ÿ˜›

#

you are not the first to point that out XD

kind hatch
#

Can't believe frostalf is actually a bot! ๐Ÿคฏ

quaint mantle
#

ar eyou chagpt

#

i think he is

wet breach
#

you also wouldn't be the first to suggest that either lmao

#

I wish I could be like chatgpt though with all that other knowledge

#

One day, I want to have like an official class thing to teach programming and some IT related things

#

just so those who want to get into such things have somewhere to start

#

or maybe just want to be more informed

quaint mantle
#

ik you'll get there one day man

last sleet
#

Is there a way to spawn a firework "from a player", as though they launched it by right-clicking say, on the ground ? (I want to use this for elytra boosting)

kind hatch
#

Player#fireworkBoost()

#

Don't have to spawn one, but provide one.

last sleet
#

alright, thanks

wet breach
#

one day I will have my own business that does tech support and also provides classes to teach

#

I once got paid by a person in India for resolving their DNS issue they had going on. This was when was subcontracting with PhoenixNAP.

#

anyways that was interesting to do because I couldn't chat them live, so I had to resort to email and they were also not a native english speaker

#

so I had to resort to google translate at the time, which I made them aware. So I would send my message in both english and their native language, in case google translate didn't translate something properly lol

#

anyways, they paid me $500 when I charged them $200 for a week long conversation over email

#

I told them the DNS settings they needed and also explained to them what each of those settings are for and what they do

#

at first I thought it was a mistake and didn't accept the payment, and messaged them about it. They said it was correct because they felt $200 was too low because no one else could resolve their problem as well as provide explanations.

#

explaining why their problem was occurring as well as the various config options they needed

#

Anyways, enough of the rant I suppose ๐Ÿ˜›

weak kayak
#

reminds me, one time this friend of my dad's wanted to update his son's tablet, support for which had dropped at like 2012 or smth
i had to dig in old forums to be able to find out how to root it and find the appropriate rom to flash
it took me about a day or two and i got to name my price, but since i didn't do anything of the sort before i went super low at like 10 or 15 because i didn't know what the standard price would be and i didn't wanna scam anyone

dim bluff
#

Any ideia on how can I call getConfig() outside the JavaPlugin's extended class?

drowsy helm
#

if its outside of JavaPlugin then you're not doing it right

drowsy helm
#

oh you mean another class?

hazy parrot
#

He wants to access config

drowsy helm
#

thought you meant completely out of plugin

hazy parrot
#

If I understood right

weak kayak
dim bluff
#

I'm making a simple fly plugin to study, but I'd like to make fly persist on username, but the FlySpeedCommand class (which makes /fly have an use) is outside the main class (the one that extends JavaPlugin)

weak kayak
#

apologies if that's worded badly

drowsy helm
#

yeah, just use di

hazy parrot
#

?di is what erdi explained

undone axleBOT
dim bluff
weak kayak
#

you could also be lazy and have a static getter

river oracle
#

Meh di is better for beginners

dim bluff
#

oh ok

river oracle
#

Good habbit to reinforce

dim bluff
#

thank you

quaint mantle
#

Hi can someone help me I am trying to make the code put in block location a bed but I don't know how to do it

dim bluff
dim bluff
dim bluff
#

hey, I changed the config.yml file manually, added the arguments I'd like. But when I compile to the jar, the config.yml stays the same as before the changes, how can I debug that?

last sleet
#

When the server lags, sometimes the InventoryClickEvent is not cancelled properly, and players can get away with stealing items from GUIs that really shouldn't be stolen from. Is there a way to counter this?

weak kayak
#

i wasn't aware of that. are you positive the player actually gets the item? what if it only exists in the client

last sleet
#

It's not a "ghost item" that happens when you quickly shift+close. The player actually gets the item and it is usable. My friend and I are actually testing for an SMP plugin, and when /reloading, you can a short window where all plugin guis stop working, but he says that also happens when the server lags a lot

kind hatch
#

That "lag" sometimes gets perceived as the InventoryDragEvent. So you might want to cancel that too.

weak kayak
#

you could try and use InventoryMoveItemEvent

tender shard
#

oh wrong quote

#

no InventoryMoveitemEvent

#

that's for hoppers

kind hatch
weak kayak
#

oh

tender shard
#

kinda weird name

weak kayak
#

yea a bit unclear

last sleet
#

I remember from Hypixel Skyblock there were bugs tht happened when you activated touchscreen mode ( you could take some gui items, such as barriers )

kind hatch
#

No, it's when you drag a stack of items across multiple slots.

last sleet
#

ah

#

well ill try to make the changes and I'll see if the bug persists ;)

weak kayak
#

good luck

sterile token
#

Its worth doing a collector plugin for just $20 ?

crimson relic
#

collector?

sterile token
crimson relic
#

dont understand

sterile token
#

I honestly think that price is a tremendous offense, for 20 dollars I wouldn't make you any custom plugin. To consider that plugin, you should have at least offered me 50-60 usd.

crimson relic
#

if it isnt a lot of effort and you need the money i dont see the issue with taking it

sterile token
#

Something like that, but it isnt so simple to do it. In my case takes me too much time for the paid i get

crimson relic
#

then no

#

i agree with 50-60, maybe more

sterile token
#

oh atleast

#

the client got mad because he said that i was trying to steal him

#

๐Ÿ’€

crimson relic
#

lol then tell him to go somewhere else, his problem not urs

sterile token
#

yeah i instant blocked him

regal scaffold
#

Hey! Is proxy the same as current mc development? Use velocity or waterfall and build for bungee?

regal scaffold
#

That's a copy of what I made

#

Dm me the discord name plz

crimson relic
#

you arent the first to make it

regal scaffold
#

No like that looks identical to what I made

#

Like insanely similar

#

Just weird

crimson relic
#

well thats a premium plugin on spigot

regal scaffold
#

Oh damn I had no idea

#

Oh well

fierce whale
#

What specific method is unusable in async?
Some method work in async but some other method doesn't work.

sterile token
sterile token
regal scaffold
#

Yeah but current dev is use paper as base and build for spigot

#

Is that the same for proxy too?

#

Which one do I use and which one do I build for

sterile token
#

Proxies doesnt care about mc server, just depend the version of the game

regal scaffold
#

Not what I mean. I think I'm explaining it wrong

#

We build plugins for spigot but most servers are using paper

sterile token
#

oh you mean in terms of coding right?

regal scaffold
#

What's the case with the proxy? Do I use bungee jar and build for bungee? Do I use waterfall jar and build for bungee?

#

Yes, I do

#

Server base jar + coding for what

sterile token
#

If im not wrong bungee plugins, should work on BungeeCord and Waterfall

#

But they wont work for Velocity, because its recoded from the scratch

regal scaffold
#

And waterfall prob has the same improvement than paper vs spigot

#

So prob use waterfall and paper for server jars and code for spigot and bungee

sterile token
quaint mantle
# sterile token the client got mad because he said that i was trying to steal him

explain him minimum hourly wages in your country, explain him an average time it may take you to complete, then politely ask him to go and look for someone who may do the job for that price even if quality is not decent. if you were polite enough, there's a chance of him getting back to you in case he thinks you deliver the price/quality that he's looking for

tender shard
#

just block them

solemn frigate
#

Hi there's this weird thing that happens on my server every now and then where players get kicked like this: https://imgur.com/YRq2iWT

im trying to use the playerkickevent to try n do something when a player gets kicked for that, but it doesn't seem to fire for some reason? my code is:

    public void onDisconnect(PlayerKickEvent event) {
        System.out.println(ChatColor.GOLD + "Kick message for the disconnect above is " + event.getReason() + ChatColor.RESET);
    }```
#

but it doesnt print anything to console

#

for regular kicks it works but not for this specific disconnect

#

if it matters then im using bungeecord

worldly ingot
worldly ingot
#

Or proxy. Wherever that error log is from. Whichever program is running there needs more memory

solemn frigate
#

ik that and rn im saving up for a better host for my server but in the meantime i just wanna restart the server whenever anyone gets kicked for that

worldly ingot
#

Well the PlayerKickEvent is called when they're kicked via /kick. You're not really going to be able to get that kick reason

sterile token
#

Is there a way to assign something unique to player proxy? Or know when he joins / left the proxy

tender shard
#

bungee doesn't keep track of any playerdata. just create a Map<UUID, YourStuff> ?

sterile token
#

Hmn because i was thinking doing some rest api actions but i need to do it via Bungee

cunning sundial
#

Hello guys, i'm new to plugin development and i wonder if there is a way to regenerate chunks right from the plugin. Can you help please?

sterile token
cunning sundial
#

My plan is to check some parameters of a chunk when it is loaded, and then regenerate it

#

Like when a player loads it or smth

sterile token
#

What you final goal?

#

Load a chunk?

cunning sundial
#

Regenerate it

sterile token
sterile token
cunning sundial
#

Thanks so much

sterile token
#

There is no reload method, so maybe you will have to unload and load it again

cunning sundial
orchid gazelle
#

You mean you wanna delete it and regenerate it?

cunning sundial
humble tulip
#

Or a known set of chunks?

humble tulip
#

A little less actually

humble tulip
cunning sundial
humble tulip
#

Are some chunks broken or something?

cunning sundial
#

Kinda

humble tulip
#

You can use a region manipulator library to delete those chunks

#

This isn't spigot tho

cunning sundial
#

I wanted

humble tulip
#

It's just java and nbt

cunning sundial
#

But my dataset is big af

humble tulip
#
  • no work on your server
#

Since it doesn't run on the server, it just runs once, cleans your stuff up and done

cunning sundial
#

I don't think it will work

#

Since the chunks r bot corrupted or broken

#

They contain data

#

And it is full air

humble tulip
#

Yeah that's fine

#

So you just wanna delete all full air chunks?

cunning sundial
#

Yeah

humble tulip
#

That's absolutely what this is for

cunning sundial
#

Oh

humble tulip
#

Are you proficient in java?

cunning sundial
#

So it is called "region manipulator"?

cunning sundial
humble tulip
#

Add that to your pom

#

You're writing a public static void main program

#

But it may be frustrating if you don't know java well

#

Use nbteditor to help you figure out the nbt format

#

You just gotta check all chunksections are empty

#

And if they are, you can delete tje chunk

buoyant viper
humble tulip
#

Gotta clarify

cunning sundial
#

Thanks so much

#

Never thought for a dev community to be so nice to a newbie

cunning sundial
crimson terrace
#

Standard procedure should be to first ask ChatGPT now since it can answer most easy-medium difficulty questions

humble tulip
#

Chat gpt is pretty stupid

#

Never answers my questions properly

crimson terrace
#

it can answer most things asked here

#

you may have to be more specific

humble tulip
#

It's useful as a writing tool tho

#

Used it to help me write some essays

#

Makes sense since its a natural language model

#

It can help with easy spigot stuff

crimson terrace
humble tulip
#

True

tender shard
crimson terrace
#

I guess? but if nobody asks they wont be able to fix the problems, right ๐Ÿ˜›

tender shard
#

true

#

for example it suggests to use Main.getInstance() instead of DI. Obviously that's not wrong, but I am sure many people would be outraged now lol. I also don't understand why it waits until onEnable() to set the instance, instead of doing it in the constructor or in onLoad

#

however it's still an amazing thing

crimson terrace
#

it suggests it because its so common on the internet answers i think. for most people Main.getInstance() is also enough since they are just developing for private servers, etc.

buoyant viper
#

i feel like for most cases setting it on onEnable is sufficient

crimson terrace
#

never done any different

tender shard
#

yeah sure, just wanted to say it's still not perfect. I tried to find a plain wrong answer the last 5 minutes, but couldnt find any. A few weeks ago, that was still easy, so it already improved much

buoyant viper
crimson terrace
#

yeah. people who know DI can just plain ignore the wrong code and pull out the answer they need. also it can nicely explain DI ๐Ÿ™‚

tender shard
#

it's plain wrong but it took me over 5 minutes to find one

buoyant viper
#

Event.Type.PLAYER_JOIN

wat

#

thats a thing?

tender shard
#

no

crimson terrace
#

this is the example code for di it gives ๐Ÿ˜„
public class MyPluginClass {
private final Dependency dependency;

public MyPluginClass(Dependency dependency) {
this.dependency = dependency;
}

// ... plugin class code ...
}

public class MainPlugin extends JavaPlugin {
@Override
public void onEnable() {
Dependency dependency = new Dependency();
MyPluginClass pluginClass = new MyPluginClass(dependency);
// ... plugin logic ...
}
}

buoyant viper
#

o lol

buoyant viper
#

no google guava di or whatever the actual library is

tender shard
crimson terrace
#

I did ask it for dependency injection in the context of spigot plugins

hybrid spoke
buoyant viper
#

theres always whatever the fuck that google library does

#

or is it spring

crimson terrace
#

even di is getting the communist treatment now?

#

its OUR di

buoyant viper
#

our dependency injection

hybrid spoke
#

both are "framework DIs"

#

but there is also "constructor DI" and "setter DI"

#

not sure if the latter is the actual name

#

probably parameter injection or something

sullen marlin
#

enchantment?

crimson terrace
#

you mean unbreaking or protection?

#

thats not something spigot does by default

#

afaik you will need your own logic to apply potion effects when someone is wearing armor

#

I dont know that

#

?paste

undone axleBOT
buoyant viper
#

?jd-s

undone axleBOT
crimson terrace
buoyant viper
#

my Brother in christ

crimson terrace
#

its paste lmao

buoyant viper
#

ik

#

that popup is so annoying

#

wish i could disable it

sullen marlin
#

its the extension

buoyant viper
#

ive clicked plenty of pastes here before though and never got it

crimson terrace
#

same

sullen marlin
#

cause it detected it as .py

crimson terrace
#

makes sense

sullen marlin
#

its ok with other extensions

buoyant viper
#

sadge

sullen marlin
#

not .pl either tho

crimson terrace
#

whats .pl? polish?

buoyant viper
#

perl

sullen marlin
#

perl

crimson terrace
#

๐Ÿ˜„

cunning sundial
drowsy helm
#

no balls

humble tulip
#

Other than that it's only regionIO. ReadRegion and writeRegion

#

And the region class has some methods but they're self explanatory

#

The documntation for the region manipulator is broken

#

What i sent is a fork with a change to read region frm older and newer mc versions

cunning sundial
#

Ok

humble tulip
#

Main branch?

cunning sundial
#

Nvm

humble tulip
#

I dmed u

rough drift
#

is onEnable called after all onLoad methods are called?

chrome beacon
#

Yes

warm light
#

what is this?

#

on plugin.yml

eternal night
#

ignore it

#

it was meant to allow plugins to specify concepts "they are aware of"

warm light
#

can you explain it more? I am still confuse about this

#

Just found this today. so I am curious

eternal night
#

I mean, the only value there iirc is uft8

#

back in the day when not all plugins supported that

#

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

ripe lake
#

Hey, I am trying to use build tool mentioning version 1.9.4. However, impossible to succeed in the build, I have the following error:

[ERROR] Failed to execute goal on project spigot-api: Could not resolve dependencies for project org.spigotmc:spigot-api:jar:1.9.4-R0.1-SNAPSHOT: Could not find artifact net.md-5:bungeecord-chat:jar:1.9-SNAPSHOT -> [Help 1]

Could someone help me?

haughty granite
#

I have a config.yml file with my items, and a loop to get the items and insert them in my gui menu

#

but I have a problem with the description, where the lore doesn't accept the \n

#

Is there any other way than having to explode my description to insert them into an array and then looping back to insert it into the lore?

tawdry echo
#

String#split

remote swallow
#

^^

haughty granite
#

just .getString().split("\n") ?

remote swallow
#

Should do

echo basalt
#

or you can make the lore a stringlist in the config and move on with your life

tawdry echo
#

Prefer it ^

haughty granite
echo basalt
#

yes

#
lore:
- 'one'
- 'two'
- 'three'
#

List<String> lore = config.getStringList("lore");

#

then you colorize it ofc

#

then you just set it directly

#

instead of doing weird splitting

haughty granite
#

oki awesome i'll try it thank you

serene sigil
#

how do you make custom worlds load when u start the server? (i dont want to use /reload)

echo basalt
#

loading a world is easy

#

just new WorldCreator(worldname).createWorld();

ripe lake
echo basalt
#

did you add the spigot repo

serene sigil
#

u have to then do /reload confirm

echo basalt
#

uh... never had that before

tardy delta
#

let your plugin load together with the worlds?

#

uhh

serene sigil
#

oh wait

#

i have to add that to my yml?

tardy delta
#

just a guess

serene sigil
#

bruh goofy ahh chatgpt didnt tell me u have to do that lol

eternal night
#

โ˜ ๏ธ

tardy delta
#

๐Ÿ’€

river oracle
#

๐Ÿ’€chatgpt

haughty granite
#

just lore.toString() ?

tardy delta
#

what

#

config.getStringList()?

haughty granite
#

already done

tardy delta
#

you cant just add a list

haughty granite
#

but I have to loop to take into account the color codes in my list no?

tardy delta
#

yes

tender shard
#

why not just use a stream?

haughty granite
tardy delta
rough drift
tardy delta
#

stream yes

#

love it how CraftMetaItem#setLore does some internal bullshit

rough drift
#

what does it do

remote swallow
#

isnt there some stream.filter stuff

serene sigil
remote swallow
#

fuck discord

#

it said like 20 messages above was current

remote swallow
tardy delta
serene sigil
haughty granite
remote swallow
tardy delta
#

youre adding a list

#

could do list.addAll

#

if you're going to add something

serene sigil
#

just that?

tender shard
# haughty granite It works anyway, but do you have a better way?

I'd do it like this, but sure, a for loop works too

        List<String> existingLore = new ArrayList<String>();
        List<String> loreToAdd = getConfig().getStringList("lore")
                .stream()
                .map(line -> ChatColor.translateAlternateColorCodes('&', line))
                .collect(Collectors.toList());
        existingLore.addAll(loreToAdd);
remote swallow
#

did it for me

#

smh

serene sigil
#

wait actually i already have that

tender shard
#

no, you use add instead of addAll