#help-development

1 messages · Page 1796 of 1

tender shard
#

no, you'll have to use another way

#

or simply move the file after saving it

lost matrix
#

You need to get the resource as a Stream and write this Stream into an FileOutputStream

stone sinew
#

I use getResource() and Files.copy()
Ex; Files.copy(getResource("name"), <file>);

#

I use REPLACE_EXISTING

slim kernel
#

So I wrote some code(code.java). But now I need this one more often so I did a method(codeButInMethod.java). But in this code I need to return if something specific happens. Thats no problem in the code.java. But if I call the removeEssence Method in the standardAbility Method how do I tell my standardAbility Method I want to return then?
https://gist.github.com/ItzJustNico/df0d62c75f04c2f4176d515ebe42b40a

lost matrix
slim kernel
#

I hope thats better now

#

Really hard to explain

stone sinew
#

So... java public void generateResource(String filename, File file) { try(InputStream inp = this.getClass().getClassLoader().getResourceAsStream(filename)) { System.out.println("CanWrite: "+file.canWrite()); Files.copy(inp, file.toPath(), StandardCopyOption.REPLACE_EXISTING); } catch (IOException e) { e.printStackTrace(); } } Outputs: CanWrite: true yet still errors with java.nio.file.FileSystemException: .\authentication.yml: The process cannot access the file because it is being used by another process.

vague oracle
#

This is a example but if you wanted to return a Boolean you would in the inner method use return Boolean and when you call the inner method from the other method you would do an if statement

#

And do if Boolean from inner method is true return

slim kernel
vague oracle
#

That is the only way if I’m reading your question right xD

slim kernel
#

perfect haha

tender shard
#

Just check out the source for saveResource and adjust it

#
    public void saveResource(@NotNull String resourcePath, boolean replace) {
        if (resourcePath != null && !resourcePath.equals("")) {
            resourcePath = resourcePath.replace('\\', '/');
            InputStream in = this.getResource(resourcePath);
            if (in == null) {
                throw new IllegalArgumentException("The embedded resource '" + resourcePath + "' cannot be found in " + this.file);
            } else {
                File outFile = new File(this.dataFolder, resourcePath);
                int lastIndex = resourcePath.lastIndexOf(47);
                File outDir = new File(this.dataFolder, resourcePath.substring(0, lastIndex >= 0 ? lastIndex : 0));
                if (!outDir.exists()) {
                    outDir.mkdirs();
                }

                try {
                    if (outFile.exists() && !replace) {
                        this.logger.log(Level.WARNING, "Could not save " + outFile.getName() + " to " + outFile + " because " + outFile.getName() + " already exists.");
                    } else {
                        OutputStream out = new FileOutputStream(outFile);
                        byte[] buf = new byte[1024];

                        int len;
                        while((len = in.read(buf)) > 0) {
                            out.write(buf, 0, len);
                        }

                        out.close();
                        in.close();
                    }
                } catch (IOException var10) {
                    this.logger.log(Level.SEVERE, "Could not save " + outFile.getName() + " to " + outFile, var10);
                }

            }
        } else {
            throw new IllegalArgumentException("ResourcePath cannot be null or empty");
        }
    }
young knoll
#

If the input path is in a subfolder

#

The output will be too

tender shard
#

yeah that's of course also possible

#

I also just noticed that from the source code lol

#

just do saveResource("resources/yourResource") and also put it into "resources" in your jar file

#

definitely the easiest solution 😄

runic mesa
#

How do i get the item that broke the block with BlockBreakEvent

stone sinew
young knoll
runic mesa
#

got it

#

tyvm

tender shard
young knoll
#

Player#getEquipment#getItemInMainHand

karmic grove
#

whats the sethealth syntax

#

player.sethealth but then what do i put like a number or

tender shard
#

20 = 10 hearts

karmic grove
#

idk what this means

#

ok

quaint mantle
#

Player#getInventory#getItemInMainHand

runic mesa
#

isnt it

#

Yeah

#

Pmzs one

quaint mantle
#

I guess getequipment was for entities

#

Wait

karmic grove
#

so i put player.sethealth("20") for twn hearts

quaint mantle
#

Player is an entity

young knoll
#

That's a string

tender shard
undone axleBOT
quaint mantle
#

🗿

tender shard
#

@karmic grove

#

it literally says it expects a double, why do you want to provide a string?

quaint mantle
karmic grove
#

yea i saw with error

quaint mantle
#

They are the same

#

🗿

lost matrix
slim kernel
#

@lost matrix did you have time for this one already?

fast onyx
#

I'm getting this error

#

This is my pom.xml dependencies:

<dependencies>
        <dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot-api</artifactId>
            <version>1.13-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.jetbrains</groupId>
            <artifactId>annotations</artifactId>
            <version>22.0.0</version>
        </dependency>
        <dependency>
            <groupId>com.github.cryptomorin</groupId>
            <artifactId>XSeries</artifactId>
            <version>8.3.0</version>
        </dependency>
    </dependencies>
#

I'm using Titles#sendTitle()

#

No errors on IDE

runic mesa
#

does getting the drops from BlockBreakEvent include fortune?

young knoll
fast onyx
#

ig

karmic grove
#

whats top sethealth you can do

young knoll
#

Whatever the maxHealth is

karmic grove
#

oh you can set max health

#

does that have limit

young knoll
#

I think the default spigot.yml limits it to 2048

karmic grove
#

o ok

wide coyote
#

which statistics requires additional parameter? all except the untyped ones?

quaint mantle
#

damn

#

oooh i was looking for this for a long time
i had a trial version installed and i installed material ui for no reason
then deleted, and installd community and i forgot to install material ui

#

thanks

#

i deleted the trial version with the whole plugin thing

#

and installed community

#

and forgot to install material ui

#

and was looking for those icons

grim ice
#

@karmic grove

#

btw

#

if u wanna set health to 20

#

dont do that

#

i prefer getting the max health

#

x.setHealth(x.getMaxHealth());

karmic grove
#

oh

#

what does the x do

wide coyote
#

it is about the font

young knoll
grim ice
grim ice
wide coyote
#

try lucida sans or lucida console

karmic grove
grim ice
#

lmao what the fuck

#

LMAO

#

wha

#

show me ur code

karmic grove
wide coyote
karmic grove
#

ussally its this but randomly it doubles

grim ice
#

2048 is 1024 hearts

karmic grove
#

yea

#

but why does it change seemingly randomly

grim ice
#

wat u trying to do rn

#

it isnt

#

its just glitching so it doesnt show the first time

#

i think

karmic grove
#

oh

#

thats probally it

wide coyote
#

well you can change the font until you like it

#

np

tardy delta
#

my colorscheme is cool

#

see i scared everyone

#

whats wrong with this tho?

#

do i need to escape '

grim ice
#

ur yaml

tardy delta
#

is it the ' character?

grim ice
#

yes

scenic fable
#

How can I make all the players on a server teleport to one place, in a defined time

tardy delta
#

is " " even supported by yaml?

grim ice
#

yes

tardy delta
#

every time i set a string it changes to ' '

grim ice
#

just do it

#

try "whatev'er u'wan'ted t'o d'o"

#

idk

#

prob will work

left swift
#

how can i get player head texture (item)

ivory sleet
tardy delta
#

hmm

ivory sleet
#

Because yaml is quite uh inconsistent or rather allows various syntax

tardy delta
#

yea probably that

ivory sleet
#

I tried creating a parser for yaml, in conclusion I gave up

scenic fable
#

How can I make all the players on a server teleport to one place, in a defined time

ivory sleet
#

?scheduling

undone axleBOT
maiden mountain
#

So i'm facing an issue with retreiving a pending task. When i schedule a new task. I grab the taskId and store it for later use.
Then when i try to retreive the pending task using its ID it throws me this exception:

Caused by: java.lang.IndexOutOfBoundsException: Index 22857 out of bounds for length 0

And yes, the task is still running while i'm trying to retreive it.

#
BukkitTask task = Bukkit.getScheduler().getPendingTasks().get(this.timerTaskID);

This piece of code throws the error

#

Any idea to how this is happening?

ancient plank
#

that's a big number

maiden mountain
#

I use this code to start my task

this.timerTaskID = Bukkit.getScheduler().scheduleSyncDelayedTask(Main.getInstance(), () -> this.execute(), interval);
#

Any clue?

tardy delta
#

Scheduler#getTask(int)?

maiden mountain
#

No such method found

karmic grove
#

how do i open web config for luckperms

tardy delta
#

/lp editor

candid galleon
#

Bukkit.getScheduler().cancelTack(nameoftask);

tardy delta
maiden mountain
#

Yep it worked. Thanks to your both

quaint mantle
#

You may also use methods that returns BukkitTask

maiden mountain
#

Quick question, is there an event for when a MOB starts targeting a player?

west oxide
#

hey

#

i get this error when i try to run a command

tardy delta
#

am i looking for custommodeldata to use textures of texturepacks on a item?

#

or custom damage

west oxide
# west oxide

this is my code


import com.andrei1058.bedwars.BedWars;
import online.shakiz.BwCore.BwCore;
import online.shakiz.BwCore.files.NickManager;
import online.shakiz.BwCore.utils.utils;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;

import java.util.UUID;

public class Nick implements CommandExecutor {

    @Override
    public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
        NickManager nickManager = new NickManager(BwCore.getPlugin());
        String prefix = utils.chat(BwCore.getPlugin().getConfig().getString("prefix"));
        Player p = (Player) sender;
        UUID uuid = p.getUniqueId();
        String usedNicks = nickManager.getConfig().getConfigurationSection("Nicks").getValues(true).toString();
        if(!(sender instanceof Player)){
                sender.sendMessage("Command can only be executed by players.");
            }

        else if(!(args.length==1)){
                sender.sendMessage(prefix + "wrong usage please input a nickname to use");
            }
        else{
            if(!(BedWars.getAPI().getArenaUtil().isPlaying(p))){
                if(!usedNicks.contains(args[0])) {
                   nickManager.getConfig().set("Nicks." + uuid, args[0]);
                   p.setDisplayName(args[0]);
               }
                else{
                   sender.sendMessage(prefix+"the provided nick is used by another player.");
                }
            }
            else{
                sender.sendMessage(prefix + "cant use this whilst ingame");
            }
        }
        return true;
    }
}
smoky elbow
#

Caused by: java.lang.ClassNotFoundException: com.mongodb.MongoClient Can someone help me?

quaint mantle
maiden mountain
worldly ingot
#

EntityTargetEvent is supposedly a very terrifying event to listen to given how frequently it can fire

#

So, you know... bear caution

proud basin
tardy delta
#

i'm wondering how to set the data on itemmeta that these texturepack predicates need to apply textures on items

eternal night
#

that is a plain percentage from 0 to 1 in regards to damage

tardy delta
#

yea but i'm currently using a plugin which uses that number to apply the correct texture on it

eternal night
#

so what exactly is your issue here. As stated the predicates do not use custom model data but rather match the material being unbreakable and damaged

#

take the percentage and multiply it by the total damage the item can take

tardy delta
#

if there is a way in the api to set client side textures on itemstacks?

eternal night
#

no

#

there isn't

#

the resource packs is the one that has complete control over how items are rendered

#

(well if you don't count skulls I guess or other nbt reliant items such as banners)

tardy delta
#

well working together with resource packs i mean

#
  • the api
eternal night
#

Well if you take the screenshot you posted

#

you could have diamond boots look like grim_boots by making them unbreakable and setting the durability to whatever number that is multiplied by the max durability

tardy delta
#

uhu

quaint mantle
#

uhm custom model data exists

eternal night
#

^^which is the preferred way

young knoll
#

CMD is 1.14+ iirc?

quaint mantle
#

Yes

tardy delta
young knoll
#

Meta has a setCustomModelData

tardy delta
#

i've always based textures on that predicate

quaint mantle
#

ItemMeta.setCustomModelData
and see some guide on planetminecraft or youtube

eternal night
#

damage for textures is not not smart these days

tardy delta
#

but i dunno how to change the json if i use the .setModelData

eternal night
#

quick google should get you there

#

pretty well documented

tardy delta
#

ok great

eternal night
#

memory section is an implementation of configuration section ?

quaint mantle
#

I mean, MemorySection is an implementation of ConfigurationSection..

eternal night
#

:>

#

heh

#

racing manya day after day

quaint mantle
#

😅

ivory sleet
#

What’s not working to be more specific?

eternal night
#

validate that the config file is actually containing this (e.g. written to disk if you read from there etc)

#

you are calling the correct method

#

Are you setting that value during runtime ?

#

grabbing these section when before throwing in some map will fail

#

ah

#

hmm let me test it in a local setup

#

it should work

#

Is your yaml malformatted ?

eternal night
#

well, idk my setup returns a memory section as expected :/

#

you are not writing the file to disk are you?

#

like you aren't calling saveDefaultConfig somewhere

#

ah

#

and see what comes out

ember estuary
#

does the MapCanvas#render() function create a new CraftMapCanvas each time?
I get this output when printing it, that means yes, right?

[21:32:46 INFO]: de.MapMenu.master.Canvas@3a1dd9db
[21:32:46 INFO]: de.MapMenu.master.Canvas@729adcb1
[21:32:47 INFO]: de.MapMenu.master.Canvas@695fdea2
[21:32:47 INFO]: de.MapMenu.master.Canvas@2db092f5
[21:32:47 INFO]: de.MapMenu.master.Canvas@2d5ba98b
...```
eternal night
#

what is MapCanvas#render ?

#

I don't see that method

ember estuary
#

I meant MapRenderer#render, sorry

eternal night
#

😅😅 happens to the best, dang you outdated configs

ember estuary
#

i cant see where MapRenderer#render gets called from

#

can u? is there any trick?

eternal night
#

I just have a local version of spigot checked out in my IDE (well paper to be exact but pssh)

ember estuary
#

xD

eternal night
#

And in regards to creating new canvases, it does that if you changed the renderer

ember estuary
#

does it change automatically?

eternal night
#

not that I know of

ember estuary
#

cuz i dont see where i'd change it

#

hmm xD

eternal night
#

but your canvas you linked isn't even spigots canvas xD

ember estuary
#

it is lol

eternal night
#

Like de.MapMenu.master.Canvas is not spigot internal

#

no

ember estuary
#

ah

#

thats mine

#

its a wrapper

eternal night
#

Yea so you are creating a new wrapper

#

doesn't mean spigot is creating new instances

ember estuary
#

ooooh my bad lmao

#

gotta check if the internal canvas is the same

#

xD

tardy delta
eternal night
#

Well as with damage, you map a new texture onto the material

tardy delta
#

ah i understand

quaint mantle
#

how do i get a player's ping

tardy delta
#

now trying it out :yes:

tardy delta
quaint mantle
#

okay

tardy delta
#

((CraftPlayer) player).getHandle().ping

tardy delta
#

owh really

quaint mantle
#

i'm on 1.8.8

sullen marlin
#

sucks to be you

tardy delta
#

another one 🙄

red sedge
#

how can I shoot an arrow
and give the credit to player
ik launchProjectile
but it doesnt give the credit to player

tardy delta
#

shoot an arrow first uwu

sullen marlin
#

PLayer#launchProjectile

torn oyster
#
    public int getMinigameId(Minigame m) {
        for (int i : getActiveMinigames().keySet()) {
            if (getActiveMinigames().get(i).hashCode() == m.hashCode()) {
                return i;
            }
        }
        return -1;
    }```
#

this returns -1 even when the item is in the list

#

i've tried without hashcode as well

sullen marlin
#

that is a shocking method

torn oyster
#

lol it probs is

ivory sleet
#

Use a HashMap thonk

sullen marlin
#

how about just m.getId()

#

or, Map<Minigame, Integer>

torn oyster
#

so i swap around?

sullen marlin
#

depends what you are trying to do overall

#

could make it a Bimap even

torn oyster
#

assign an id to each minigame

red sedge
misty current
#

so you can get the key from a value

#

and the value from a key

sullen marlin
#

yes, its just two maps that are the inverse of each other

misty current
#

oh i always used to do it myself

#

didn't know there was a class already for that

#

also never thought of making it into a wrapper

torn oyster
#

the items in the hashmap extend minigame

#

would that affect it

#

i think it would

wide coyote
#

can i force suspend a tripwire

red sedge
sullen marlin
#

what do you mean credit

red sedge
#

like

#

whenever the arrow hits the attacker isnt the player

#

its CraftTippedArrow

young knoll
#

Of course

sullen marlin
#

Arrow#getShooter

young knoll
#

Because the player isn’t hitting them, the arrow is

red sedge
#

ok

#

thank you

torn oyster
#

if an object in the list extends <T> then would it be able to do .indexOf(itemthatextendsit)

young knoll
#

Sure

#

Pretty sure index of is just based on equals

torn oyster
#

lemme explain

#

there is a list of Minigames

#

instead of minigames in there, it is a list of HexHuntGames, which extend Minigame

#

but it is still a List<Minigame>

#

if i do indexOf(HexHuntGame)

#

it doesn't work

#

how do i fix it

wide coyote
#

try to cast your argument

#

not sure it will work

torn oyster
#

i can't cast hexhuntgame back to minigame though

#

and i cant cast the list to List<HexHuntGame>

last grove
#

hello, is there any way to build a 1.18-rc3 version of spigot.jar?

#

or is there gonna be a full release available tommorow?

torn oyster
#

it'd do nothing

sullen marlin
wide coyote
young knoll
torn oyster
young knoll
#

In the parent class

torn oyster
#

what would i make it be

young knoll
#

Something that can determine if they are equal

torn oyster
#
    @Override
    public boolean equals(Object o) {
        if (!(o instanceof Minigame)) return false;
        return o.hashCode() == this.hashCode();
    }```
#

oh lol

sullen marlin
#

gosh why

#

that's not how you should do that

#

hashcodes are not going to be unique

jade perch
torn oyster
sand gull
#

Hi! I am trying to move a custom client-side EntityPlayer to a certain location, while also accounting for the look rotations. This is all done in the same tick. I send three packets:

  • PlayServerRelEntityMove
  • PlayServerEntityHeadRotation
  • PlayServerEntityLook

For some reason when I add in the head rotation packet, the move packet just stops taking effect. Could it be that the head rotation and player movement can't be changed in the same tick? Or does anyone else have any possible insights on this? (I am using ProtocolLib and a packet wrapper, if someone has worked with NPCs using ProtocolLib, I'd really appreciate any help)

zealous osprey
#

I have a question regarding the fact to use reflections to call methods by their name. Is that a thing that's "ok" to do or should i discourage from doing so?
Also sincr all the articles I've read about reflections dont really give a nice or even consistent answer to the question "when to use them" could someone voice their opinion?

sullen marlin
#

'dont use reflection, use the API'

zealous osprey
#

Could you elaborate pls?

jade perch
#

He can not

sullen marlin
#

what are you trying to do

zealous osprey
#

Im trying to create an object in which I can parse a mathod to be executed

sullen marlin
#

be more specific

#

what object, what method, to do what

sand gull
zealous osprey
#

Lets say the Object "CustomItem"
I want it to execute a certain method when I right click with it.
So the constructor would gopefully look something like this:
new CustomItem(<name>, <eventId>, <methodToBeExecutedWhenEventHappens>)

sullen marlin
#

just use method refrences

#

Consumer<Event>

zealous osprey
#

Ah, thx, since I didn't want to use reflections, is there any "danger" Ill have to be aware of using refrencing ?

sullen marlin
#

no

zealous osprey
#

Sick

jade perch
peak granite
#

getKiller can only be instance of a player?

#

in the PlayerDeathEvent event

ivory sleet
#

yes

sullen marlin
#

no?

#

can be killed by lots of things

peak granite
#

intellij says Condition 'event.getEntity().getKiller() instanceof Player' is redundant and can be replaced with a null check

ivory sleet
#

Hmm thought the api only captures player instances

sullen marlin
#

oh

young knoll
#

LivingEntity.getKiller is always a player

sullen marlin
#

well maybe

young knoll
#

Or null

peak granite
#

is getHealth 20 or 10

#

the max

sullen marlin
#

20

#

also getMaxHealth or whatever

worldly ingot
#

Well, the attribute preferably

echo hound
#

hey

#

can someone help me

chrome beacon
#

?ask

undone axleBOT
#

If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Create a thread in case the help channel you are using is already in use!

echo hound
#

i want to create a scoreboard api where i can update scores more easy

chrome beacon
#

Okay and what do you need help with

echo hound
#

I have no idea how

#

Really.. no idea

chrome beacon
#

Do you know Java?

sullen marlin
#

what is 'more easily'

#

is there something wrong with setScore ?

echo hound
#

I want to use teams because of flicker and so on

peak granite
#

use fastboard

#

it's good

#

use its api

#

it uses packets tho

#

which is better

sullen marlin
#

no its not

peak granite
#

it is

sullen marlin
#

it also doesnt appear to use packets

worldly ingot
#

👀 the Bukkit API also uses packets

peak granite
#

someone told me it uses packets

sullen marlin
#

I just decompiled it

#

I dont see any packets

peak granite
#

teams?

chrome beacon
young knoll
#

Everything uses packets if you get down to it

quaint mantle
#

scoreboard api component support when

peak granite
#

what's the difference between FIRE and FIRE_TICKS (damage cause)

eternal night
#

standing in fire deals more damage than just burning

peak granite
#

ahh

ivory sleet
quaint mantle
#

Oh fr

#

eh

peak granite
#

can i store a location in metadata

#

can i do this? player.setMetadata("backLocation", new FixedMetadataValue(Core.getProvidingPlugin(Core.class), event.getFrom()));

eternal night
#

Yea, it can store any value

peak granite
#

Caused by: java.lang.ClassCastException: java.util.Collections$UnmodifiableRandomAccessList cannot be cast to org.bukkit.Location

grand flint
#

@ivory sleet Where do I learn some serious plugin development, like from the beginning to a pro level

young knoll
#

?learnjava

undone axleBOT
grand flint
peak granite
#

plugin development is done with java

#

lol

grand flint
#

I know enough java

peak granite
#

then learn the bukkit api

grand flint
#

Ye, where?

peak granite
#

bukkit docs

young knoll
#

?jd

karmic grove
#

whats the easiest way to store args when you run a command

#

for example when someone runs /command then i want to store this text

buoyant viper
#

store them where

karmic grove
#

in a variable would be fine

young knoll
#

Then just... store it to the variable?

karmic grove
#

how do i store the command input

buoyant viper
#

the args[] in a CommandExecutor's onCommand is their arguments so

karmic grove
#

that stores what they put after?

buoyant viper
#

yes

#

that is what the user put after the /command

eternal oxide
#

Store? explain store

buoyant viper
#

so "/command arg1 arg2 arg3"
args[] is { "arg1", "arg2", "arg3" }

young knoll
#

Yes

#

Well, [] technically :p

buoyant viper
#

shut

karmic grove
#

so i have this this will save it as variable args?

buoyant viper
#

u can use that to copy its values into another String array if thats where u need to store it

#

if ur just accessing it within its command execution then theres no need to store it anywhere, just use that array

karmic grove
#

i just want it to be a variable for a little bit then ill do somthing with it later

brisk estuary
#

Hi guys, I'm trying to create a new potion. What should I do? I had created a new class which extends the PottionEffect class and then I've implemented a new constructors that would pass the parameters to a super constructor. Am I going the right way?

quaint mantle
brisk estuary
#

Oh XD

#

okay, thanks

#

but I'm able to create a potion with stronger effects, right?

karmic grove
#

yea...

#

i mean if you have experience with datapacks that might be better

#

but idk

peak granite
#

when i do player.teleport((Location) player.getMetadata("backLocation")); it sends an error in console

#

full code:

    @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;
        }
        Player player = (Player) sender;
        if (!(player.hasMetadata("backLocation"))) {
            sender.sendMessage(Color.translate("&cCouldn't find your previous location."));
            return true;
        }
        player.teleport((Location) player.getMetadata("backLocation"));
        player.removeMetadata("backLocation", Core.getProvidingPlugin(Core.class));
        player.sendMessage(Color.translate("&aTeleported back!"));
        return true;
    }
}```
eternal oxide
#

getMetaData only returns a list, you have to extract teh values

peak granite
#

oh

#

how do i do that

peak granite
#
        player.teleport(location);```
#

still doesn't work

eternal oxide
#

you are doing nothing different

#

look at teh javadoc. See what the method returns

#

List<MetadataValue>

peak granite
#

player.teleport(Location.valueOf(player.getMetadata("backLocation")));?

eternal oxide
#

no

#

Stop guessing

#

getMetaData returns a List<MetadataValue>

peak granite
#

yes

eternal oxide
#

what shoudl you do with a List?

peak granite
#

get the value of it

eternal oxide
#

a List is a collection of values

#

each of those values is a MetadataValue

maiden thicket
#

how would i prevent an arrow from slowing down and stopping in water?

quaint mantle
#

Is metadata capable of storing complex objects

eternal oxide
#

so check each item in the list, get the value from the MetadataValue

eternal oxide
#

anything thats serializable

peak granite
#

how do i get the value

eternal oxide
#

iterate the list

#

in your case (if you only add one) getMetaData("tag").get[0].getValue()

young knoll
#

.get(0)*

eternal oxide
#

yep

#

and cast to Location

peak granite
#

getValue is in red

eternal oxide
#

value()

peak granite
#

ik

#

i did

#

it's in red

eternal oxide
#

then you typed something wrong

peak granite
#

player.teleport((Location) player.getMetadata("backLocation").get(0).getValue());

eternal oxide
#

.value() not getValue()

peak granite
#

tyy

echo basalt
eternal oxide
#

You could easily apply a fixed velocity ```java
/**
* Pass a Projectile and a destination
* to set its direction and new velocity.
*
* @param projectile
* @param targetLoc
* @return
*/
public void setTarget(final Projectile projectile, final Location targetLoc) {

    final Vector velocityVector = targetLoc.toVector().subtract(projectile.getLocation().toVector());
    velocityVector.normalize().multiply(projectile.getVelocity().length());
    projectile.setVelocity(velocityVector);
}```
echo basalt
#

yeah but a fixed velocity is different to "not slowing down in water"

eternal oxide
#

yes it is, you apply it repeatedly, until hit

#

or destination reached

echo basalt
#

Drag exists in minecraft

#

And it's a parabolic curve

eternal oxide
#

which is over come by applying a fixed velocity repeatedly

echo basalt
#

You'd have to apply that method every tick for the arrow

eternal oxide
#

yes

#

as he only needs to do it when in water

tender shard
echo basalt
#

How would you predict where the arrow is going to land if it wasn't in water?

echo basalt
tender shard
#

idk what you're talking about anyway right now, so don't mind me lol

crude charm
echo basalt
#

That would make a weird flat trajectory

tight tiger
#

Hey anyone willing to help me set up Residence I am new to this stuff.

echo basalt
tight tiger
#

Oops

peak granite
#

is it possible to add a value above 64 of stone to a player's inventory

echo basalt
#

With some hacky stuff you can

peak granite
#

not like a stack of 65

#

but 64 and 1

echo basalt
#

Ah

peak granite
#

whatever args[0] is

echo basalt
#
int stacks = amount / 64;
int remainder = amount % 64;
#

have fun with the rest

peak granite
#

when i type 65 it defaults to 1

echo basalt
#

yeah I thought you wanted a stack of 65 lol

#

was about to paste some code

quaint mantle
#

import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;

public class PearlCommand implements CommandExecutor {

    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {

        Player p = (Player) sender;

        if (args.length == 0) {
            sender.sendMessage("");
            sender.sendMessage(ChatColor.GOLD + "/givepearl <player>");
            sender.sendMessage("");

        } else if (args[0].equalsIgnoreCase()) {

        } return true;
    }
}```
#

how would i set arg 1 as a players name?

#

i dont specifically mean like "Notch"

peak granite
#

Bukkit.getExactPlayer

quaint mantle
#

oh

echo basalt
#
String playerName = args[0];
Player player = Bukkit.getPlayer(playerName);
quaint mantle
#

ty

peak granite
#

does anyone know how i can create a folder directory "playerdata" in my plugins folder on startup

echo basalt
#
File folder = new File(dataFolder + File.separator + "playerdata");
folder.mkdir();
peak granite
#

it's that easy

#

damn

#

thankss

#

how can i check if the directory doesn't exist first

echo basalt
#

if(!folder.exists())

#

smh just use autocomplete or something

#

It's quite intuitive

peak granite
#

what's "dataFolder"

echo basalt
#

your plugin's data folder .....

tender shard
#

Plugin#getDataFolder

peak granite
#

oh

#

so i do this.getDataFolder()?

tender shard
#

if it's in your main class, just use getDataFolder()

peak granite
#

ah

#

thank you

eternal oxide
#

Does your plugin have a config?

peak granite
#

yes

tender shard
#

btw instead of

new File(somePath + File.separator + "playerdata")

I'd rather use

new File(somePath, "playerData")
eternal oxide
#

then saveDefaultConfig()

tender shard
#

it actually doesn't matter but it's shorter and more intuitive imho

eternal oxide
#

it will auto create yoru folder, you then only need create the playerdata one

echo basalt
#

I generally use the first method for folders and the second for files

peak granite
#

what does File.separator do then

tender shard
#

it returns \ on Windows and / on other OS

echo basalt
#

File.separator is based on your operating system

#

yeah

peak granite
tender shard
#

why use the longer version when you can use the shorter form

echo basalt
#

Longer version is more intuitive for folders imo

#

You can also like

tender shard
#

just use what you like what more, it doesn't matter

echo basalt
#

new File(dataFolder + File.separator + "some_generic_folder", "myfile.someextension");

tender shard
#

I just wanted to mention that File(path,fileName) exists too

#
    public File(File parent, String child) {
        if (child == null) {
            throw new NullPointerException();
        }
        if (parent != null) {
            if (parent.path.isEmpty()) {
                this.path = fs.resolve(fs.getDefaultParent(),
                                       fs.normalize(child));
            } else {
                this.path = fs.resolve(parent.path,
                                       fs.normalize(child));
            }
        } else {
            this.path = fs.normalize(child);
        }
        this.prefixLength = fs.prefixLength(this.path);
    }
#

so yeah it's basically not exactly the same

#

it first checks whether the parent folder exists

#

and it might behave a bit different with symlinks depending on OS and/or filesystem

#

which is why I think that File(File,String) MIGHT be safer but tbh it just doesn't matter

echo basalt
#

man's trying his hardest to prove me I'm wrong

#

smh

tender shard
#

bro

#

I told you five times

#

that IMHO it doesn't matter what you use in 99.9% of cases

young knoll
#

You don’t even really need to use File.separator in the file constructor

tender shard
young knoll
#

I don’t know if other places handle it, but the file constructor does

tender shard
#

actually even using / on windows works as file separator IIRC

echo basalt
#

Not quite

tender shard
echo basalt
#

I've had exceptions on windows hosted machines due to hardcoding a "/"

tender shard
#

oh okay I might be wrong on that one then

peak granite
#

how do i create a file called "playername.yml" on join in the playerdata folder

tender shard
#

might also depend on the windows or java version and/or filesystem, no idea^^ safest way is to use File(parent,child) or concating strings with the separator

echo basalt
#

It might work on windows explorer but that's about it

#

alisa have you ever worked with files smh

peak granite
#

yes

#

not in java tho

tender shard
echo basalt
#

Or just use a utility like my very old and basic yml base class

tender shard
#

or new File(getDataFolder() + File.separator() + "playerdata" + File.separator() + "playername.yml").createNewFile()

echo basalt
#

Should skip half the figuring out

peak granite
#

how do i use it

tender shard
#

ugh

#

just google "java create file"

quaint mantle
#

?learnjava when

undone axleBOT
echo basalt
#

I usually extend the class

#

But you can do whatever

tender shard
#

tbh that's not even a java question but more like "how to google"

tender shard
echo basalt
tender shard
#

ah your YML class, I missed that link

echo basalt
#

Or what I usually do for simple config files

@Getter
public class SettingsFile extends YMLBase {

  private final String someValue;

  public SettingsFile(JavaPlugin main) {
    super(main, "settings.yml");

    FileConfiguration config = getConfiguration();
    someValue = config.getString("some-value");
  }

}
tender shard
#

Lombok features are probably not useful for someone who doesn't know how to create a file, otherwise the next question is "what's @Getter" ^^

echo basalt
#

let them figure it out

#

half their code disappears with lombok so less wasting time spamming unecessary code

#

you really have to bash on everything I do huh

paper viper
#

No, cause what he is saying is right lmfao

#

i would highly advise against using lombok for someone who is new

echo basalt
#

Fine

#

Spam alt+insert for the same result on intellij

paper viper
quaint mantle
#

when was it added?

paper viper
#

Very long ago

quaint mantle
#

because people said use file.seperator-

#

welp

#

ok

tender shard
paper viper
#

Yeah idk what hes talking about...

echo basalt
#

I've had exceptions regarding that literally this year

quaint mantle
#

im on java 16 hope it there

paper viper
peak granite
#

how do i specify the file is a YML

quaint mantle
#

welp test it out if you dont believe lol

peak granite
#

because it created a folder

tender shard
#

actually java.io.FileSystem should handle converting between file separators

quaint mantle
tender shard
#

at least that's what I thought

quaint mantle
#

or something i forgot

paper viper
tender shard
peak granite
#
        if(!file.exists()) file.mkdir();```
#

it created a folder

#

not yml file

paper viper
#

"With the Java libraries for dealing with files, you can safely use / (slash, not backslash) on all platforms. The library code handles translating things into platform-specific paths internally."

tender shard
#

I gave you two examples above that both show how to use createNewFile()

paper viper
#

ugh thats why i like nio paths better

#

lol

quaint mantle
tender shard
paper viper
quaint mantle
#

huh/

#

:/

tender shard
#

it probably won't print anything

#

although both a and b are "a"

#

well actually, also not 100% correct because the JVM caches strings

quaint mantle
#

use try it editor for fast testing

tender shard
#

but you shouldnt rely on string caching in the JVM

#

.equals checks whether two objects have the same "content"

#

== checks whether they are actually the exact same object

#

since strings are created everytime you type "something", it's everytime actually a new, not exactly the same object

paper viper
#

For example

String a = "hi";
String b = "hi";

System.out.println(a.equals(b)): // this prints true
System.out.println(a == b); // this prints false

b = a; // now we are assigning the reference of a to b

System.out.println(a == b); // this prints true now
quaint mantle
#

wow k

#

== for objects

tender shard
quaint mantle
#

while we need to compare what inside the string

tender shard
#

== to compare IDENTITY

#

.equals to compare CONTENT

#

e.g. I'd equals() to my twin brother but I woudln't == to my twin brother

#

bad example but I don't have a better idea

quaint mantle
#

👌 typoooooooooooooooooooooooooooooooooo

quaint mantle
#

best example in this year

hybrid spoke
worldly ingot
#

That's one hell of an example

tender shard
#

I don't even have any siblings

paper viper
#

I am == choco

#

/s

tender shard
hybrid spoke
tender shard
#

yeah but I invoked equals on me, not on my brother 🙂

#

and I'm quite sure I exist

#

not 100% sure, but quite

hybrid spoke
#

proof it

tender shard
#

don't make me send stupid videos of me again, not today

paper viper
#

If its incest, is that considered ==

#

Lol

hybrid spoke
#

its 2 am

#

and what i learned so far from HIMYM

tender shard
#

yeah my bf has to get up in 3 hours

hybrid spoke
#

go to sleep if its 2 am

#

otherwise crazy things will happen

tender shard
#

yeah but

#

HIMYM is in new york

#

it's only 8pm there

hybrid spoke
#

hm good point

tender shard
#

also they didn't specify when to get up again

#

i was in bed on 10pm and then stood up at midnight again

#

so basically I already was asleep

#

oh anyway, I have a question

#

imagine a cuboid like in worldguard, or like a BoundingBox

#

of course the BoundingBox has a contains(Vector) method that simply checks whether the vector is inside minX, minZ, maxX, maxZ etc

#

buuut

#

worldedit also has polygon regions

#

and I'm not sure on how to calculate whether something is inside of that

#

I basically have a class that has a list of vectors (we can ignore the height, so just X/Z) and now I need to know whether a given point is inside this polygon

#

does anyone have any idea?

hybrid spoke
#

ugh, maths

tender shard
#

I checked WorldEdit's source but I don't really get it and I don't wanna just copy it

peak granite
#

and how can i add a value to the yml file?

tender shard
#

or a YamlConfiguration?

young knoll
#

I’m sorry what is this about incest and .equals

tender shard
peak granite
#
        File file = new File(Core.instance.getDataFolder() + File.separator + "playerdata" + File.separator + "playername.yml");
        if(!file.exists()) {
            try {
                new File(new File(Core.instance.getDataFolder(),"playerdata"),"playername.yml").createNewFile();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }
}```
tender shard
#

and now incest is starting

young knoll
#

Okay then normal programmer talk

#

Carry on

tender shard
#

YamlConfiguration.loadConfiguration(File) will return a YamlConfiguration object

#

you can use it just like the config you get from JavaPlugin#getConfig

tender shard
tender shard
#

learn java

#

you know, there's a rule of thumbs

#

when you have a new question after EVERY new line of code you've been spoonfed

#

you should enter ?learnjava and click on one of those links

#

no offense, but tbh you should know what you want to do

#

also

#

?javadocs

#

oh

#

?javadoc

tender shard
#

go to the ConfigurationSection class/interface there

#

@peak granite

golden turret
#

i would like to do the collision physics

quaint mantle
#

new File(new File(

golden turret
quaint mantle
#

i wonder what is his ide?

golden turret
tender shard
peak granite
quaint mantle
#

?learnjava when

undone axleBOT
tender shard
#

what exactly do you want to do? calculate the vector? actually make the entity move?

quaint mantle
#

let it do t pose

golden turret
#

basically, if i hit an entity, it will move in the direction im looking with x force
then if the entity collides with a block, i would like to make it more realistic

golden turret
tender shard
#

is your entity a projectile? if not I believe that will be very hard to achieve

unreal quartz
#

i suppose detect a collision with the bounding box of the entity and a block face and invert the velocity of the entity with the direction of the block face

tender shard
#

yeah but it would probably require some scheduled tasks etc when not using projectiles right?

#

after all there's no "EntityHitSomethingEvent"

unreal quartz
#

i would imagine so

tender shard
#

however for projectiles, there is

unreal quartz
#

you will need to check each tick whether the bounding box intersects the block

golden turret
tender shard
#

so basically

#

you apply the velocity to a certain vector

golden turret
#

im not using projectiles

tender shard
#

then keep your entity in a running task timer

#

then check every tick whether it still got velocity above 0.01 or something

#

if not, cancel the task

#

if it's not cancelled and now interferes with something, calculate the new vector and velocity and apply it

#

if you're just wondering about how to get the rebound angle, there's many many examples you can google

#

but of course you'll have to do all the scheduling and hit detection yourself using the entities bounding box etc

quaint mantle
#

anyone here good with FileConfigurations?

tender shard
#

àsk

#

?ask

undone axleBOT
#

If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Create a thread in case the help channel you are using is already in use!

quaint mantle
#

?ask

undone axleBOT
#

If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Create a thread in case the help channel you are using is already in use!

quaint mantle
#

that isnt what i was asking

#

then ask it

#

i wasnt asking to ask, i was asking if anyone here is good with FileConfigurations

tender shard
#

yes, I studied FileCOnfigurations for 8 years

quaint mantle
tender shard
quaint mantle
#

so basically, i store player info in FileConfigurations

quaint mantle
tender shard
#

just ask what you have problems with, it's easier

quaint mantle
#

dont say that...

#

and so im adding some player info, manually

#

he will argue with you the whole day

#

and im reloading the configuration... in hopes it'll create?

tender shard
#

it'll create?

#

okay first of all

#

you have different FileConfigurations per player, right?

quaint mantle
#

it'll actually create the player's information

#

no

#

i have user-info.yml

tender shard
#

ok

quaint mantle
#

where each UUID is stored in sections

#

uuid:
the data here
uuid2:
more data

tender shard
#

yeah okay, so flatfile playerdata with UUIDs as keys

quaint mantle
#

not so good...

quaint mantle
quaint mantle
tender shard
#

and what's exactly your question now? 😄

quaint mantle
#

aren't my*

#

english moment

#

I Think Saying That To Me Is Not So Good...

tender shard
#

well, do you ever call save() on your FileConfiguration?

quaint mantle
#

yup!

#

i save() and then load()

#

not really sure why it doesnt do anything though lol

tender shard
#

can you show us some code pls?

quaint mantle
#

ye

tender shard
#

?paste

undone axleBOT
quaint mantle
#

screenshots work better :^)

#

mind the jank-ness of this

#

its not permanent lmao

tender shard
#

you probably reference UserInfo.fc somewhere else right?

quaint mantle
#

yep

#

is fc null, for whatever reason?

#

i mean its not in UserInfo

tender shard
#

well tbh from seing only such small snippets, I can't say anything

quaint mantle
#

bruh

#

idk what else you want to see

tender shard
#

like, the whole class

quaint mantle
#

the entire UserInfo class?

tender shard
#

that would be more helpful, yes

quaint mantle
#

i think not, im sending you the things that do not function as intended

#

because when a new player joins, it does create the section and treats everything right

#

its only when i try to manually create & save sections

tender shard
#

well there's one thing I don't get

#

you call it "reloading" playerdata

#

but all you do is save what's currently in memory

quaint mantle
#

so are you actually helping people?

tender shard
#

did you manually change the file, and want to load those changes?

quaint mantle
#

multiple times

tender shard
unreal quartz
tender shard
unreal quartz
#

do you actually want help?

quaint mantle
#

kill him 🔪 🥄

#

actually i think i figured it out thanks

tender shard
#
  1. You change your file using an editor
  2. You overwrite your changes with what you have in RAM
  3. You load that again so have in RAM what you already had there
unreal quartz
#

cool

quaint mantle
#

:thanks:

tender shard
#

just don't save the file before loading it again

quaint mantle
#

right now is 2am in ur time?

tender shard
#

also everyone here's trying to help but of course we need some input. we can't magically know what you're trying to do and what you're actually doing when you only give us 4 lines of code and no context @quaint mantle but ok

#

2.41

quaint mantle
#

it is 8:41 am

tender shard
#

@quaint mantle

quaint mantle
#

for me

unreal quartz
#

1:41am here

quasi patrol
#

How do I make it so when a user clicks a message in chat it copies a certain character/text (ik already how to use text components and setclickevent with it).

quaint mantle
#

programmer dont sleep...

unreal quartz
#

currently going through a lecture i should've gone through last week

tender shard
#

or somewhere near

quaint mantle
tender shard
#

at the very bottom you can see message.setClickEvent

#

that's what you're looking for

quaint mantle
#

Southeast Asia

ancient plank
#

"i dont wanna share my code because people are going to steal it"

tender shard
unreal quartz
#

comp sci

tender shard
ancient plank
#

i need to go make another gru meme

tender shard
unreal quartz
golden turret
#

how could i disable the natural movement from a mob but allow him to be hitted

tender shard
#

ever used NMS?

quaint mantle
#

succ

young knoll
#

Who’s code are we stealing?

golden turret
unreal quartz
#

yours

tender shard
young knoll
#

Ah man not my open source code

unreal quartz
#

too bad

#

already stole it

quaint mantle
#

or he just want fast answer

#

and being little too agressive

tender shard
#

I regularly paste whole classes of my paid plugins, I really don't get why beginners think their non-working code must be protected lol

peak granite
#
        file.set("player-name", player);```
#

"set" is in red

tender shard
#

because

#

YamlConfiguration.loadConfiguration returns a YamlConfiguration

#

you never store it inside any variable, but you should

#

then you could use that variable

#

tiny example:

#
YamlConfiguration myConfig = YamlConfiguration.loadConfiguration(someFile);
myConfig.set("player-name",player.getName());
tender shard
#

but yeah sometimes people get upset when you don't understand their cursed english within 2 seconds and have replied 1 second ago

#

maybe md_5 should charge new users 5$ before being allowed in this channel

quaint mantle
#

hope he dont do that with me

peak granite
#
        YamlConfiguration myConfig = YamlConfiguration.loadConfiguration(file);
        myConfig.set("player-name", player.getName());```

nothing was added in the config
quaint mantle
#

save when?

peak granite
#

oh

tender shard
quaint mantle
#

the bukkit yaml system want you to save

tender shard
#

to save it to disk, you also have to tell your plugin to save the file to disk

quaint mantle
#

i dont know why dont they just set it directly into the file

#

and remove the save method

tender shard
quaint mantle
peak granite
#

file.save() or file.saveConfig doesn't work

tender shard
#

no, of course not

#

you didn't understand basic java

#

let me explain

#

your "file" object simply represents a location/file on your hard disk

#

the actual CONTENT that you can manipulate is stored inside your YamlConfiguration object called "myConfig"

#

and that's the thing you want to save

#

sooo

paper viper
#

Yeah, its not like all the data is stored in that single object 😂

#

imagine a 5 gigabyte file

#

that would be 5 gigs of memory

tender shard
#

the save method is provided by YamlConfiguration (or, to be exact, by FileCOnfiguration, which YamlConfiguration extends

quaint mantle
tender shard
#

so you'll have to call that one

peak granite
#

myConfig.saveConfig(); ?

tender shard
#

I just asked for a bit of context

quaint mantle
#

i'll share as much as i can without breaking the guidelines that i setup^

tender shard
#

and you instantly went like "ugh do people even try to help here"

quaint mantle
tender shard
#

just imagine this

quaint mantle
#

i guess not though

tender shard
#
        PersistentDataContainer pdc = player.getPersistentDataContainer();
        if (pdc.has(Main.HAS_SEEN_MESSAGE_TAG, PersistentDataType.BYTE)) {
            pdc.remove(Main.HAS_SEEN_MESSAGE_TAG);
        }

#

Yo why doesn't this work?

#

no idea, you'd have to see the rest of the class

quaint mantle
#

the thing about that is, i should have shared enough to potentially get an answer -- i thought i shared enough context

tender shard
#

yeah and I asked for more and you went like "do you even try to help" instantly

#

let's just start over again and be friendly to each other, alrighty?

#

both you and me

quaint mantle
#

works for me

peak granite
#

myConfig.save(file); doesn't work as well

quaint mantle
tender shard
#

so, did you get it fixed? because you said "nvm I think I found the problem"

tender shard
quaint mantle
peak granite
#

o

#

wait

#

ok works now

quaint mantle
#

so what i think i might do is just make a reload() method in UserInfo

#

that just calls save() and load() tbh

tender shard
#

let me explain again and try to understand

#

you have your config loaded, then you change it on your HARD DRIVE although it was already loaded to RAM

peak granite
#

i fixed it

tender shard
#

and now you want the changes from your hard drive to your RAM, right?

#

then, you MUST NOT save the file before loading it again

#

otherwise you overwrite the changes you made on the hard disk

quaint mantle
#

from FileZilla

#

i'm adding them via FileZilla

peak granite
#

i had to put it in a catch

quaint mantle
#

not my harddrive specifically, i dont save my server's information on this pc

tender shard
#

basically: do not SAVE anything when it's just a RELOAD command

quaint mantle
#

or?

tender shard
#

yeah, that doesn't matter. don't save when you want to load

#

yeah exactly

quaint mantle
#

ahh

#

interesting

#

i'll try just load() then

tender shard
#

yep

#

it's like.... you open a file in some program (minecraft)
then you change that file meanwhile in another program (your editor)
now you want minecraft to load the changes you did in the other program. that of course only works if you don't overwrite the changes made in your editor with what you already loaded in the beginning in minecraft^^

#

I hope you get what I'm trying to say

#

I'm not very good at explaining at 3am

quaint mantle
#

ᵐᵉ ᶰᵉᶦᵗʰᵉʳ

#

ᶠᵒᶰᵗ ᵐᵒᵐᵉᶰᵗ

#

me neither

peak granite
#

mfnalex every time i want to edit the file, i would have to get it, then edit it, like editing a player's balance removing 500 i would have to get the value subtract by 500 thne set it again, then save the file?

quaint mantle
tender shard
#

you don't have to save and load it everytime

#

you just load it on startup once, then keep your YamlConfiguration and use that, and on shutdown, you save it

peak granite
#

oh, thanks

tender shard
#

imagine saving/loading like taking something out of your backpack in RL

#

when you go to a lecture, you get your notebook out (loading it) and write stuff on it. maybe you also read something from it again. you only put it back into your backpack (saving) when the lesson ends and you go home

#

^^

peak granite
#

great example

#

lol

tender shard
#

you don't take it out and put it back for every sentence^^

quaint mantle
#

didnt work @tender shard, tried just load()

tender shard
#

hm yeah then you'd have to do so debugging etc, but as said I can't help you without seeing more of the code

quaint mantle
#

i'll try the new UserInfo#reload() tbh

#

im sure it has to do with the static File and FileConfiguration 😳

tender shard
#

you were the one with the flatfile config that contains all user infos in one file, right?

quaint mantle
#

ye

young knoll
#

Big brain

tender shard
#

are you sure you always only have one instance of your UserInfo class?