#help-development

1 messages · Page 551 of 1

young knoll
#

Tbf from legacy text is kinda black magic

worldly ingot
#

My whole test plugin is filled with comments testing out all the component stuff

young knoll
#

So yeah

worldly ingot
#

It's all in the command part lol

river oracle
#

well time to sleep, hopefully that Pr get accepted I want my components >:D

young knoll
#

Let’s worry about getting 1.20 stable first :p

#

(But I also want my components)

worldly ingot
#

MY STUFF IS STABLE >:I

river oracle
#

someone check out smithing table i'm pretty sure its broken (according to paper)

young knoll
#

I’m currently just using the enum constant for items as lore

river oracle
#

specifically the Recipe's

young knoll
#

And it works, but it’s not ideal

tranquil prairie
#

anyone?

noble lantern
young knoll
#

Probably

#

And after I suppose

noble lantern
#

huh trying to use it in the respawn event and it want to remain null odd

young knoll
#

Ah it might get cleared then

#

For non players it probably remains

noble lantern
#

sad, wonder why it gets cleared

#

guess i can just add a small listener for death too, just a tad annoying :p

#

yeah seems like it does get cleared just retried it sadge

severe folio
#

I'd just add both the victim and killers uuids to a map in the death event, and then check if its in the map in the respawn event

noble lantern
#

ehh i need a slightly different use case, im just gonna store a list of uuids of dead people, map useless for my purpose :p

severe folio
#

Fair enough

noble lantern
#

its rly gonna make me do this r_baby_cry imma cry my beautiful code just got all shattered apart

unreal willow
#

how to create a plugin

remote swallow
#

do you know java

wise mesa
#

and then they never replied...

inland siren
#

i wonder if like

#

file based gui creation

#

would be cool and feasible

#

adds another layer of customizability to bigger plugins to let static guis just be file based

remote swallow
#

doubt it would be hard

#

just a list with letters then have an items section where you define items

#

name: Cool &6GUI name
format:
  - "#########"
  - "####a####"
  - "#########"
items:
  - id: "#"
    type: black_stained_glass
  - id: "a"
    type: blue_stainted_glass
quaint mantle
#

do chunks have any kind of unique idetifier

sullen marlin
#

Their position

#

Lol

rough ibex
#

quantum minecraft

cerulean schooner
#

Hey , may i ask If anyone have the ability and the experience of being a Minecraft Staff + experience of plugin and configuring and expertise (Please DM me) there well be offerings + based on your knowledge.

undone axleBOT
quaint mantle
rough drift
#

is it safe to remove from PDC when iterating over it's keys?

quaint mantle
#

Like a serializable map?

rough drift
#

Not quite but ig, if you edit the keys you get back it doesn't reflect any changes so ig it's a clone?

#

It just has a key to serializer & val

quaint mantle
#

I attempted doing my own PDC so 1.9 - 1.16 structures could also store stuff. As far I remember, a Map was the most ideal way to store stuff, that's why I am asking.

rough drift
#

I don't know if it still is tbh

#

I mean most likely it is

#

Eh fuck it i'll just test it

quaint mantle
#

Props to shynixn for structureblocklib 👍🏻

zealous osprey
round finch
rough drift
#

if I keep a reference to that itemstack, and then change it, will it also change if it gets dropped and picked up again or nah?

#

like item X is stored as an instance temporarely, if X is dropped, can I still change it from that same ref?

#

and if X is picked up again, can I still change it?

quaint mantle
#

It should not

#

hi

#

i have problem with java vm

#

a jni error has occurred

rough drift
quaint mantle
#

and a java exception has occurred

#

By the way, what you mean is that if you store a specific ItemStack's reference, whenever dropping it and picking it up again, if the game will still preserve the reference or if it will like clone it or something

rough drift
#

if it gets cloned that's sadge

quaint mantle
#

I got kind of confused with your question

#

Yeah

#

By the way, don't ItemStack#clone

rough drift
#

yeah

quaint mantle
#

Just ItemStack::new and pass the old ItemStack in the constructor

rough drift
#

yeah ik

#

now I have a problem though

quaint mantle
#

Didn't know about it and was wondering what was going on lol

rough drift
#

Well so now I know how to handle my issue

quaint mantle
#

What are you trying to do?

rough drift
#

Custom item stuff

quaint mantle
#

What's your project's goal?

rough drift
#

It's an api for custom items

quaint mantle
#

How so?

remote swallow
#

ike do you not work for socksfor1 anymore

rough drift
#

I do there's just nothing to do there lmao

remote swallow
#

lul

quaint mantle
#

I mean, how an API for custom items?

#

I never imagined an API for it

rough drift
# quaint mantle How so?

Example

class FireballItem extends Item {

    @Override
    public void onRightClick(ClickContext context) {
        var clicker = context.clicker();
        var world = clicker.getWorld();

        // Get the variable "power" from the ItemStack, if it is not present, use the default of 1F.
        var power = context.variables().getFloat("power", 1F);

        world.spawn(clicker.getEyeLocation(), Fireball.class, fireball -> {
            fireball.setYield(power);
            fireball.setDirection(clicker.getEyeLocation().getDirection());
        });

        context.consumeItem();
    }

    @Override
    protected Material getMaterial() {
        return Material.FIRE_CHARGE;
    }

    @Override
    protected void setupItemStack(SetupContext context) {
        context.variables().setFloat("power", ThreadLocalRandom.current().nextFloat(0.5F, 3F));
    }

    @Override
    protected boolean isStateless() {
        return true;
    }

}
```Something like this
#

And then

#
var fireball = new FireballItem();

var stack = fireball.createItemStack(new ItemData.Builder()
        .displayData(
                new DisplayItemData.Builder()
                    .displayName("§6Epic Fireball")
                    .lore(List.of("§7Right click to shoot a §6fireball§7!", "§r", "§7Power: ${power}")) // Use ${name} notation to get a variable from the item
                    .build()
        ).build()
);
```*There are more things in an item data
remote swallow
#

wouldnt it in that context be better to have a .builder() method that returns a new instance

quaint mantle
#

Why do people override Interface methods?

rough drift
#

wdym

#

It's not an interface

remote swallow
#

bc thats how interfaces or abstract classes work

rough drift
#

It's not the standard spigot item class

quaint mantle
#

u right

#

extends

#

lol

#

But still

#

If it's an abstract class

#

And you declare the method as abstract

wet breach
quaint mantle
#

People (I did it before so I know it from first hand) use to Override the method even though there's no need

quaint mantle
#

Yes

rough drift
#

IntelliJ just puts that for me lmao

#

idc tbh

lilac dagger
#

how do i remap an library and make the users see it as remapped?

quaint mantle
#

If you provide javadocs to the implementation or the abstract method, if you override it, you are basically forcing yourself to write the javadocs again

lilac dagger
#

i tried shading but it's not working

remote swallow
#

and who puts javadocs on interface or abstract impl

quaint mantle
#

I do

#

lol

wet breach
quaint mantle
#

Because I expose interfaces in the API

lilac dagger
#

i think so

quaint mantle
#

Not the non abstract classes

wet breach
#

For relocating you specify a pattern to match, if pattern is matched it will move that package or class to the pattern you specifies

quaint mantle
#

Don't you think?

wet breach
#

I believe i might have a pom that shows this

lilac dagger
wet breach
#

It should yes

lilac dagger
#

alright, i'll look it up

#

thank you

wet breach
rough drift
#

can I technically use PersistentDataType.STRING to deserialize any type?

hazy parrot
#

technically

rough drift
#

I mean as long as I get a string version of the value I'm chilling

quaint mantle
rough drift
#

Was asking if the string type could also just parse other ones, which it should be able to right?

quaint mantle
rough drift
#

I don't need that

#

I literally just need to read any value from pdc as a string

tardy delta
#

byte array uwu

spiral fox
#

Before I ask a question about this I just want to make sure that I never learned how to code and this code is generated by an ai. What is wrong with this code?

pseudo hazel
#

then this is not the right place to be

#

this chat is for mainly for (plugin) developers

#

also bukkit is dead

remote swallow
#

bukkit isnt on any repos. use spigot api

pseudo hazel
#

also you will likely not get very far without any programming experience, ai isnt that good yet 😛

misty current
#

can I store open inventories in a weak hashmap?

agile anvil
#

As key or value ?

#

I don't know how are inventories managed in spigot

#

You should try by yourself (and I'm interested for the results if you don't mind)

hybrid spoke
#

they aren't lul emote but i dont boost anymore

quaint mantle
remote swallow
#

bit shifting be like

hybrid spoke
#

¯_(ツ)_/¯

quaint mantle
remote swallow
#

no

#

each block has an xyz coord

#

each chunk has an xz

#

the first 16x16 is 1, 0, 2nd is 2, 0 etc

hybrid spoke
#

indicates the direction and how far away it is

misty current
#

i think that it would not work since CraftInventory wraps the actual inventory, but we'll see

hybrid spoke
#

what are you trying

misty current
#

i'm making a gui library and I need to store active inventories to listen for slot clicks and get rid of them when the gui is closed, else i would be leaking memory

hybrid spoke
#

another gui library

misty current
#

so i have a map that stores inventories as keys and an object that holds gui info (the gui object, the current page) as the value

remote swallow
#

store the instance then listen to the global inv close event then remove it

misty current
#

that's what i'm doing right now but i was wondering what would happen if i were to use a weakhashmap

#

it seems to work fine with a weakhashmap

agile anvil
#

How did you test ?

misty current
#

sending the hashmap with a console command while having the gui open

#

tho for some reason even when i close the inventory the map still holds a reference to the object

#

i guess it's because the gc needs to run

#

yeah exactly, now the map is empty

#

tho i wonder if it would gc open inventories

#

need to test hold on

#

i'll leave it open for a few mins

#

nope, the gc only removed the old reference

pseudo hazel
#

makes sense, since there would still be a reference to an open inventory

ocean hollow
#

Hello, how can I use the CitizensAPI? I need to make the NPC turn towards the player, where can I find such a method?

crimson wharf
#

quick question. When I start up the server, my /spawn command isn't working, because he can't read the location. But if I do /reload after that, it is working again
How can I fix that

eternal oxide
#

you are accssing yoru config/data before the worlds are loaded

#

No worlds = broken location objects

crimson wharf
eternal oxide
#

don;t touch your config until onEnable

crimson wharf
#

when then

pseudo hazel
#

in onEnable

crimson wharf
#

?

remote swallow
#

do you not have an on enable

pseudo hazel
#

dont do it before

crimson wharf
#

I do

pseudo hazel
#

thats what elgarl means

remote swallow
#

so do it in that method

crimson wharf
#

I do

eternal oxide
#

all objects in your config are deserialized the first time it is accessed.

#

If you assign a field for your config it will be accessed at class instantiation and not in your onEnable.

crimson wharf
#

I just do:

        getConfig();
        saveDefaultConfig();

in my onEnable

eternal oxide
#

You can have a field, but you can;t assign it until onEnable

#

wrong way around

#

saveDefault shoudl be the very first entry

crimson wharf
#

okay?

#

I saw that in a video

eternal oxide
#

?paste now post your javaplugin class

undone axleBOT
crimson wharf
#

the onenable part?

vast ledge
#

the entire

#

ibe

remote swallow
#

whole class

eternal oxide
#

the whole class

vast ledge
#

one**

crimson wharf
vast ledge
#

So wats the issue?

#

if its the command not execute, you haver to put it in the plugin.yml

crimson wharf
#

The plugin is executing

#

with an error

#

but ONLY if i restart the server

hybrid spoke
#

show us the error

crimson wharf
#

if I do /reload after the server starts up, it is fixxed

remote swallow
#

does the TablistManager class access the config

crimson wharf
#

no

#

config is currently only for the spawn

hybrid spoke
#

GodCipher — heute um 11:53 Uhr
show us the error

crimson wharf
#

Jo, warte. Muss server starten

remote swallow
#

move saveDefaultConfig() to the 2nd thing onEnable does, below instance = this

eternal oxide
#

Where are you reading your locations?

crimson wharf
#

Caused by: java.lang.IllegalArgumentException: location

#

when I do /spawn or onJoin

remote swallow
#

?paste the error

undone axleBOT
crimson wharf
remote swallow
#

whats JoinQuitEvent.java ln 54

hybrid spoke
#

dont answer that, just sent the whole class and mark line 54

eternal oxide
#

paste the whoel event class

crimson wharf
#

public void teleportToSpawn(Player player) {
FileConfiguration cfg = SKGaming.getInstance().getConfig();
Location loc = cfg.getLocation("spawn.main");
** player.teleport(loc);**
player.playSound(player.getLocation(), Sound.ENTITY_PLAYER_LEVELUP,1, 1);
}

eternal oxide
#

JoinQuitEvent class

crimson wharf
hybrid spoke
#

your spawn location is probably not set

crimson wharf
#

It is

#

If I do /reload it is working fine, like I said

eternal oxide
#

What you are describing does not fit the code you are showing.

crimson wharf
#

What should I do

#

the config is set

#

on startup it doesn't work

#

after /rl it does

eternal oxide
#

if spawn.main exists in your saved config.yml there is no way your current code can break on first load

hybrid spoke
#

show us your config

crimson wharf
#
spawn:
  creative:
    ==: org.bukkit.Location
    world: creative
    x: -38.244765003921
    y: -60.0
    z: 30.247893054514456
    pitch: -1.2999984
    yaw: 61.049038
  main:
    ==: org.bukkit.Location
    world: main
    x: 5.0
    y: 38.0
    z: 7.0
    pitch: 3.1497862
    yaw: -129.89755
eternal oxide
#

oh one sec

pseudo hazel
#

hmm, I have noticed my config failing sometimes for first start up too, but idk what I did to fix it

eternal oxide
#

have you set a silly load order in your plugin.yml?

crimson wharf
eternal oxide
#

if you set LOADBEFORE in plugin yml, it will break on startup

crimson wharf
#

nothing like that in there

eternal oxide
#

you don;t have load: STARTUP ?

crimson wharf
#

no

eternal oxide
#

then your error description makes no sense

crimson wharf
#

you want to see?

eternal oxide
#

is your world actually called main?

crimson wharf
#

yeah

#

multiverse

eternal oxide
#

is main set as your first world in your server settings?

#

add a depend: [multiverse] in your plugin.yml

crimson wharf
#

level-name=world

eternal oxide
#

thats why

#

you are loading before multiverse

crimson wharf
#

so no

eternal oxide
#

your main world doesn;t exist

crimson wharf
#

okay

eternal oxide
#

add a depend or softdepend

crimson wharf
#

just anywhere?

#

I'll try

#

that doesnt fix it actually

eternal oxide
#

did you depend or softdepend?

#

?paste your plugin.yml

undone axleBOT
crimson wharf
eternal oxide
#

depend not depends

#

my mistake I typed depends

chrome beacon
#

Is it case sensetive?

#

The plugin name I mean

eternal oxide
#

I don;t believe so

crimson wharf
#
Could not load 'plugins/SKGaming-1.0-SNAPSHOT.jar' in folder 'plugins'
org.bukkit.plugin.UnknownDependencyException: Unknown dependency multiverse. Please download and install multiverse to run this plugin.
        at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:269) ~[spigot-api-1.19.4-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.craftbukkit.v1_19_R3.CraftServer.loadPlugins(CraftServer.java:430) ~[spigot-1.19.4-R0.1-SNAPSHOT.jar:3762-Spigot-7d7b241-2270366]
        at net.minecraft.server.dedicated.DedicatedServer.e(DedicatedServer.java:219) ~[spigot-1.19.4-R0.1-SNAPSHOT.jar:3762-Spigot-7d7b241-2270366]
        at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:975) ~[spigot-1.19.4-R0.1-SNAPSHOT.jar:3762-Spigot-7d7b241-2270366]
        at net.minecraft.server.MinecraftServer.lambda$0(MinecraftServer.java:304) ~[spigot-1.19.4-R0.1-SNAPSHOT.jar:3762-Spigot-7d7b241-2270366]
        at java.lang.Thread.run(Thread.java:1589) ~[?:?]
eternal oxide
#

it's pushed to a map using lowervcase for lookups

#

is it Multiverse or Multiverse-core?

crimson wharf
#

-core

eternal oxide
#

I forget it's depend

#

oh no Snake changed in 1.20

#

no SafeConstructor anymore it seems

crimson wharf
#

depend: [Multiverse-Core]

#

worked

#

I guess, I'll try again

#

it is case-sensitive I guess. Bc I wrote that before, but in lowercase

#

Yes, it is working

#

Thank you very much

eternal oxide
#

?jira

undone axleBOT
crimson wharf
#

what's that?

eternal oxide
#

for me

#

looking to see if there are any reports about SnakeYAML empty SafeConstrutor

#

seems it no longer exists in Spigot 1.20 but it used to be use to prevent code injection

chrome beacon
eternal oxide
#

bummer, breaks GroupManager

#

easy to fix, just annoying

chrome beacon
#

Why not use the config api?

eternal oxide
#

GM never has

chrome beacon
#

but you can change that uwu

eternal oxide
#

I can

#

but that means work 😛

chrome beacon
#

Well moving major version could also mean work

#

Also this allows you to keep compat with old versions without any extra work

eternal oxide
#

I just added SQL.

#

well two years ago, but still not full released yet

eternal oxide
#

ah ok

#

So no need to specify

sullen marlin
#

Don't quote me on it

#

But I think that's the point of 2.0

eternal oxide
#

🙂

livid dove
#

Day 2 of using lombok.

That's it... I can never go back....

tardy delta
#

once had to convert a project using public variables everywhere to use lombok

chrome beacon
#

Day 2 of learning Dart
Great language uwu

tardy delta
#

day 5 of learning odin uwu

tardy delta
#

i remember it took 10 minutes for intellij to process a few thousand files

#

gradle then decided to reject the annotation processing

livid dove
#

Lmaooo

#

Maven master race

tardy delta
#

stupid gradle

#

well i dont like maven much better cuz it uses xml

#

i dont like that old stuff

livid dove
#

You shut your damng mouth! 🤣

quaint mantle
#

Guys

livid dove
#

Maven my beloved

quaint mantle
#

i got a question

#

so

livid dove
#

Yes?

tardy delta
#

sometimes to improve stuff you have to think about it differently

chrome beacon
#

Here we go again the build system war

#

🍿

tardy delta
#

im not that bad

quaint mantle
#

I get the error cannot resolve symbol

#

evry time

#

how can i correct it?

chrome beacon
#

Probably means you forgot to import something

tardy delta
#

would be more useful to say what symbol

livid dove
quaint mantle
eternal oxide
#

is 1.20 only an RC for MC at the moment?

tardy delta
#

cannot find symbol java :/

quaint mantle
#

yes

chrome beacon
tardy delta
#

send screen

eternal oxide
#

odd, it doesn;t show up in MultiMC

drowsy helm
#

usually means your syntax is wrong

livid dove
#

Unlike popular rumor...

We don't have trojans on ur pc bro.

Shows us rhe damn codew

quaint mantle
#

can i ?paste my code so that u guys see the error?

chrome beacon
quaint mantle
#

?paste

undone axleBOT
quaint mantle
tardy delta
#

formatting tools exist

eternal oxide
#

yeah not showing 1.20 in MMC

#

odd

livid dove
#

And the error?

quaint mantle
#

lol so many

chrome beacon
#

You forgot to select and SDK (jdk) for the project

#

Open project settings

drowsy helm
#


public final class RandownPoints extends JavaPlugin {
public class SpawnListener extends JavaPlugin implements CommandExecutor {```?
tardy delta
#

you think x1, y1 and z1 come out of thin air?

drowsy helm
#

did you copy paste this

chrome beacon
#

Yeah there are so many things wrong with this code

livid dove
#

Hold on. Was this chat gtp?

#

This was chat gtp

quaint mantle
#

ye it is

livid dove
#

//add your spawn points here

quaint mantle
#

i wanted to make a simple plugin where the plugin chose for the first joined player gets randomly 4 spawnpoints

livid dove
#

Chat gpt does that when it doesn't know specifics

quaint mantle
#

L

#

where he'll spawn (4different spawnpoints)

chrome beacon
#

Hire someone to make it

#

or learn java

#

?services

undone axleBOT
chrome beacon
#

?learnjava

undone axleBOT
quaint mantle
chrome beacon
#

I know this isn't the first time we've told you to learn Java

remote swallow
#

i remember them from before

chrome beacon
#

You can't write an essay without knowing how to write

livid dove
#

Chat gpt will not make good code. Its a good debugger or novel concept bouncing board at best

quaint mantle
#

guys can u help at least?

tardy delta
#

good debugger? ugh ugh

remote swallow
#

i used to make chatgpt do what i couldnt be arsed all the time

chrome beacon
remote swallow
#

now it doesnt understand what i mean

quaint mantle
quaint mantle
#

💩

quaint mantle
#

pay me and i will make you the plugin

quaint mantle
remote swallow
#

this reminds me that someone was making plugins in webstorm

livid dove
#

CuriosityCore would wack it together too

wet breach
#

That is horrible

remote swallow
#

i have no clue

quaint mantle
remote swallow
#

i told them use to atleast use ij instead but they disappeared

tardy delta
#

use neovim

remote swallow
#

no

#

use notepadd

livid dove
#

Ewwwww

tardy delta
#

straight to hell

wet breach
livid dove
#

Pirce of paper and a word scanning app on ur phone or nothing you losers

remote swallow
#

oh god

#

writing code with pen and paper

#

that just feels awful

tardy delta
#

i used to do that

drowsy helm
#

anyone who uses a text based IDE has a god complex

chrome beacon
livid dove
#

This is why I still want a dev general.

I wanna put on daft coding challenges with prizes n shit

drowsy helm
#

they never stop talking about how good their ide is

chrome beacon
#

Java on Paper uwu

wet breach
remote swallow
#

what happened if you messed up

tardy delta
#

be careful with the word paper here matey

wet breach
#

They just write on the whiteboard and that is it

chrome beacon
#

Thankfully it was an easy short method and not an entire program

remote swallow
livid dove
#

I heard if you say it 3 times , a purpur fork appears

wet breach
livid dove
chrome beacon
#

hm why would you be muted for that?

wet breach
drowsy helm
livid dove
#

Because this channel is officially for dev help and casual chit chat floods the channel

drowsy helm
#

or ask questions in it

livid dove
#

I don't believe in async

remote swallow
#

we have just normal convos here a lot, sometimes people ask stuff we either miss it and come back later or all of us end up helping

livid dove
#

Main thread or nothing

remote swallow
#

way too warm

#

literally melting

livid dove
#

Fellow brit uwu?

remote swallow
#

yeah

tardy delta
#

28°C tomorrow

livid dove
#

Ayo my people

drowsy helm
#

13deg celcius rn for me and im freezing my ass off

remote swallow
#

13 is cool

#

20 is warm

#

30 is roasting

#

40 is dead

sullen marlin
#

It's not that cold bruz

tardy delta
#

you clearly never had 40

remote swallow
#

we had 40 for a week like last year

drowsy helm
young knoll
#

As a Canadian

remote swallow
#

it normally doesnt go higher than 30

livid dove
#

Spigot Code Challenge Idea

young knoll
#

Y’all are cowards unless you wear shorts in 0°

drowsy helm
#

25 degrees is perfect temp i reckon

livid dove
young knoll
#

Nah

remote swallow
#

what happens with me is im wearing long trousers most of summer, then by the end im in shorts and then all winter im in shorts

young knoll
#

20°

livid dove
#

Also see guys? Threads don't work. Check mate

remote swallow
wet breach
sullen marlin
#

22.5°

remote swallow
#

hmmmmm

#

do i write the discrd part of my plugin

#

or do i impl sqlite

drowsy helm
#

Both

#

Simultaneously

remote swallow
#

idk

young knoll
#

When in doubt, report it

#

Although make sure to check for existing tickets

remote swallow
#

also check that it works on 1.19.4

#

(can i just suggestion you put the error on a paste before someone screams)

chrome beacon
#

Was about to say

#

Don't share text in screenshots :kekw:

wet breach
sullen marlin
#

you are calling getBlockData where hasBlockData is false

#

hmm though docs say that should be OK

#

are you sure it was ok?

#

the code doesnt look like it has changed

young knoll
#

Because latest means latest stable

sullen marlin
#

[21:11:33] [Server thread/ERROR]: Error occurred while enabling TestPlugin v1.0-SNAPSHOT (Is it up to date?)
java.lang.NullPointerException: Cannot invoke "net.minecraft.nbt.NBTTagCompound.e()" because "nbttagcompound1" is null
at net.minecraft.world.item.ItemBlock.getBlockState(ItemBlock.java:177) ~[spigot-1.19.4-R0.1-SNAPSHOT.jar:dev-Spigot-7d7b241-2270366]
at org.bukkit.craftbukkit.v1_19_R3.inventory.CraftMetaItem.getBlockData(CraftMetaItem.java:930) ~[spigot-1.19.4-R0.1-SNAPSHOT.jar:dev-Spigot-7d7b241-2270366]
at net.md_5.TestPlugin.onEnable(TestPlugin.java:66) ~[?:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:266) ~[spigot-api-1.19.4-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:342) ~[spigot-api-1.19.4-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:480) ~[spigot-api-1.19.4-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_19_R3.CraftServer.enablePlugin(CraftServer.java:541) ~[spigot-1.19.4-R0.1-SNAPSHOT.jar:dev-Spigot-7d7b241-2270366]
at org.bukkit.craftbukkit.v1_19_R3.CraftServer.enablePlugins(CraftServer.java:455) ~[spigot-1.19.4-R0.1-SNAPSHOT.jar:dev-Spigot-7d7b241-2270366]
at net.minecraft.server.dedicated.DedicatedServer.e(DedicatedServer.java:220) ~[spigot-1.19.4-R0.1-SNAPSHOT.jar:dev-Spigot-7d7b241-2270366]
at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:975) ~[spigot-1.19.4-R0.1-SNAPSHOT.jar:dev-Spigot-7d7b241-2270366]
at net.minecraft.server.MinecraftServer.lambda$0(MinecraftServer.java:304) ~[spigot-1.19.4-R0.1-SNAPSHOT.jar:dev-Spigot-7d7b241-2270366]
at java.lang.Thread.run(Thread.java:833) ~[?:?]

#

computer says no

eternal oxide
#

Does Sigot site take a while to update from external site download to Direct Download once you upload a jar and push an update?

young knoll
#

Lol I made the same mistake

eternal oxide
#

Its been like 2 years since I updated the spigot site 😛

young knoll
#

Setting an Item with an itemstack with count 0 worked for me in 1.19.4

#

Turns out that was a paper thing too

#

My fault for testing on paper

remote swallow
#

choco nerd

#

use Material.LIGHT.createBlockData() probably

chrome ferry
livid dove
wet breach
#

Maybe because you were using paper?

onyx fjord
#

is there a method to get itemstacks from a container but only those which arent null?

chrome ferry
onyx fjord
#

without filtering using streams ofc

chrome beacon
#

Filter using for loop uwu

onyx fjord
#

i thought theres a native method in the api

#

that would be more performant

onyx fjord
sullen marlin
chrome ferry
#

but i guess its not stable

sullen marlin
#

I honestly dont know why that has latest as 1.19.4

young knoll
#

Is 1.20 latest now?

sullen marlin
#

thats maven

#

nothing to do with buildtools

young knoll
#

Ah

chrome ferry
#

dw md_5 i've added a fix

remote swallow
#

do i rewrite it or just leave as is

livid dove
#

@young knoll u should vote 😉

#

I value ur opinion:L

chrome ferry
#

idk why if i use json as storage i have to use mongo

#

i dont like json files

wet breach
chrome ferry
#

i dont use json for storage what

wet breach
#

Ok then why are questioning about using json for storage

chrome ferry
#

im not lol

wet breach
#

Did you not read what you typed?

chrome ferry
#

i said, when i use json i prefer to use mongo

river oracle
#

Mongo is a real db

chrome ferry
#

as someone was talking about rewriting their code for json

river oracle
#

:P

wet breach
#

That is not what you said

river oracle
#

Yes it is

#

They meant json format frostalf

#

Not the actual files

chrome ferry
#

let me add punctation:

idk why, if i use json as storage.I have to use mongodb. I dont like json files.

wet breach
#

If they use json as storage. Which it shouldnt be. It should generally just be used to transport information but not for storing

#

Not sure what you think the definition of storage is. But if you are not using json to store data, then maybe wise to use a different word then storage

river oracle
#

Mongo uses a json like format they simply meant they prefer json format in mongo vs actual json files

#

Don't look into it too much lol

chrome ferry
chrome ferry
river oracle
#

You both are misunderstanding eachother it's pretty funny

remote swallow
livid dove
#

*the god

remote swallow
#

hm

livid dove
#

Also how much kf the code is repeated in both methods

#

I'm on phone u see

hybrid spoke
livid dove
#

GOD DAMNIT GOD

hybrid spoke
#

D:

quaint mantle
onyx fjord
#

what was the easy way to make item unstackable? random pdc value?

young knoll
#

Yes

onyx fjord
#

and for best randomness i guess random string?

young knoll
#

Convert a UUID into 2 longs and shove it in there

remote swallow
onyx fjord
#

what about current system time?

livid dove
# remote swallow hm

Wait no i misread...

My brother in christ you should of made the UUID / long a generic and had a guard check that would of converted the long to UUID lmao

remote swallow
#

yeah well

onyx fjord
remote swallow
#

my brain didnt think of that

young knoll
#

System time works

livid dove
#

No worries lad but imo when 60% or more of a method is repeated, it usually means there is savings to be had

young knoll
#

As long as you don’t make 2 items in the same millisecond

onyx fjord
#

hmmm

livid dove
#

If you drop me q message I'll have a proper look when I'm home ^_^

quaint mantle
remote swallow
#

so i wasnt talking abou tyou

quaint mantle
#

ok cool

noble lantern
#

manipulating ItemStack asynchronously is chillin' right? just adding em to players inventory needs to be on main thread?

chrome beacon
#

Should be fine

livid dove
#

Doesn't bukkit scream at you naturally if you try?

#

Even if its safe

chrome beacon
#

Not always

#

Those errors only catch the most common bad things

noble lantern
#

some things that are safe are fine, ie ChunkSnapshot

Just didnt want to write this chunk of code out using async and get let down kek

livid dove
#

Async is a beautiful, horrible and unforgiving bitch

gloomy thunder
#

Does anyone know how to change a /setspawn?

chrome beacon
#

Change how

gloomy thunder
#

The /spawn command to move it

chrome beacon
#

Is that your plugin

gloomy thunder
echo basalt
#

itemstack is a data object

#

inventories I wouldn't do async

#

there's a lot that you can do async tho

#

I'd hate myself if you couldn't send messages async

noble lantern
#

yeah im planning -> grab inventory contents -> edit everything async -> back to main to add edited items

And excuse me

eternal oxide
#

not good

echo basalt
#

that better be one expensive edit

eternal oxide
#

player could drop items or offload in some way while you are making changes

noble lantern
#

oh hmm true

wise mesa
#

Is this a plug-in that you are making?

#

Or are you asking for server help?

livid dove
echo basalt
#

I'm not talking about adventure

wise mesa
#

If you need server help you’re in the wrong Channel this is for plug-in development help

livid dove
#

I know but they use async

echo basalt
#

It's literally just the process of sending a packet

#

I use async everywhere

#

All my plugins are love

gloomy thunder
echo basalt
#

all my plugins are life

livid dove
echo basalt
#

my plugins are team players

#

proper managers

#

make their cpu cores do work together

gloomy thunder
livid dove
#

Haha

Re doing dies brewery plugin rn

#

Because async is desperately needed.

Tbh... a flame thrower is desperately needed lol

echo basalt
#

imagine redoing code lmao

#

only code I'm ever redoing is all the nms I use

livid dove
#

Whe I say redoing, I mean making from scratch

echo basalt
#

I'm aware

livid dove
#

Cause his plugin makes me cry

hybrid spoke
#

lol nah add add add but never change

livid dove
#

*imagine using lists in search functions that grow over time

echo basalt
#

✨ tech debt ✨

echo basalt
hearty zenith
#

Any plugin for spigot 1.8 which allows the mobs to not burn in daytime?

echo basalt
#

prolly worldguard

livid dove
#

Oh no its when he is loading refipies he grabs em from config and some of the 'caches" he makes are lists thst need to be searched through via loop

echo basalt
#

?1.8

undone axleBOT
livid dove
hearty zenith
livid dove
#

I'm sure they have it back dated that far

#

Maybe I'm wrong

hearty zenith
#

I don't think I can see that they are 1.13+ on the spigot page

hybrid spoke
#

doesnt matter. wrong channel, wrong spigot version

livid dove
hybrid spoke
#

1.5k loop is not much

livid dove
#

It is when it's constantly being called for each drink on the servwr

#

Player roll up to wars with shulkers full of em

#

it's called O(n) cause its what server owners say when it bites huge chomps into their tps... "Oh.... no..."

smoky anchor
#

O(n)o

livid dove
#

Also he makes a new water bottle every time he wants a blank Potion meta 🤣

#

My brother in christ .clone exists

hybrid spoke
#

you do know that clone does effectively the same

livid dove
#

Yes but he makes a new Potion every time

#

To get the meta

hybrid spoke
#

.clone wouldnt change that

#

rather have a constant

livid dove
#

Why not just clone the meta...

#

Rather than the whole bottle

hybrid spoke
#

doesnt matter if you create one or two throwaways with one call

livid dove
#

It does when every scrap of performance counts.

All he wants is the meta.

potionMeta.clone is better than new itemstsck and then .getitemmeta

hybrid spoke
#

if every scrap of performance counts you shouldn use java

livid dove
#

BRB lemme get my Assembly Spigot API

#

Lmao

hybrid spoke
#

dont overengineer your software to get the very best performance possible

#

premature optimization is the root of all evil

livid dove
#

.clone is cloning an itemeta instance is better than grabbing a new item every time and getting a meta

hybrid spoke
#

do you now really want to argue over that 1ns of performance

livid dove
hybrid spoke
#

because you made one object more

livid dove
hybrid spoke
#

oh yeah, it shows that if you create 100k instances of something, that it slows down your program. damn it

livid dove
#

Look man its a plugin that's poorly optimized and is an ongoing issue with several servers.

I'm plugging a gap and I'm gonna do every bit I can to ensure a quality product innit

hybrid spoke
#

look man, idc whats your intention. your comments before were just bs

livid dove
#

That's cap

hybrid spoke
#

alright

livid dove
#

When the issue is in the constant creation of a new item on scale, halfing the processes is a smart move, even if it , on a singular scale, isn't the biggest deal in the world.

echo basalt
#

you don't know if the code underneath clone is heavier than the code to create something

hybrid spoke
#

still bs. you do know that the JVM is optimized for that

#

rather, as said before but ignored from you, make a constant of the meta

#

and use that if you dont need to change it

#

thats your best practice

#

but hey use your clone

livid dove
#

I'm optimised for taking a piss in a Bush when camping. I'd still prefer a portalloo

echo basalt
#

now your stance is changing

#

something tells me you're trying to sound smarter than you are

eternal oxide
#

he's a young lad. He used "cap", so not much more than a teenager

echo basalt
#

so am I

livid dove
#

27 🤣
I blame the server communities I'm around when developing

echo basalt
#

I turned 18 a couple months ago

eternal oxide
#

I heard cap for teh first time yesterday

livid dove
#

It's spread so bad even the adult groups in those communities are saying it

eternal oxide
#

I've not heard anyone in the real word say it

#

Kids and their new lingo, get off my lawn!

orchid trout
#

🧢

echo basalt
#

elgar's the definition of a really ancient rock

livid dove
#

But yeah to sumnerize :

The dude was making an item stack of a Potion

Then taking thst item stsck and grabbing its meta.

I just wanted to grab the meta, save as a field and clone.

Now if I've missed a trick with constants I'm happy to hear it.

Only ever used constants to help in math or grab config data.

So respectfully and happily would apologise and have poo on my face from being dumb, is there a trick with constants I've missed that would allow the creation of a new Potion meta instance via that constant?

orchid trout
#

detritus

echo basalt
#

getItemMeta returns a new insteance every time you call that method

#

Overall negligible given the amount of random crap the server does anyways

#

if you were to save it as a constant and constantly clone that item meta, it'd be weird

livid dove
#

But once again its the scale.

You say overall negligible but I've seen sweats cooking 400 + of these bad bois at a time in 1 group, and there's around 20-30 brewing groups.

Then consider those checks keep getting made ever few ticks as the dev was a bit brain dead, negligible becomes significant

#

I figure go in, fix any little thing and come out with a better product regardless.

hybrid spoke
#

then you are at the wrong spot

#

you should rather work at the distribution then what actually happens

livid dove
#

How so?

hybrid spoke
#

you will figure it out. who knows how the current state is

livid dove
#

?

echo basalt
#

but yeah you should fix the source of the issue

livid dove
#

And what if the source is death by 1000 cuts?

echo basalt
#

do the larger cuts first

eternal oxide
#

Then burn it with fire

hybrid spoke
#

sounds like a you problem to me

echo basalt
#

yeh p much

#

never really had an instance where I thought cloning itemstacks was the performance killer

#

it was always stuff like thread pool exhaustion

#

and reading blocks

livid dove
#

Well I'm just going through one step at a time. I'd love a second opinion from yall if u fancy. Could wack the repo in and see if u find any huge problems

echo basalt
#

not interested in reading your code after all this

#

might be the biggest headache

hybrid spoke
#

give us code pieces and we code review

#

but i wont scour a whole big ass repo

#

and if its complex to understand because its shit i wont review anymore

livid dove
# livid dove Also he makes a new water bottle every time he wants a blank Potion meta 🤣

That's sort of the point with this.

I'm in the exact same boat as it isn't my code. It's a public repo for a well used plugin and I'm going back through step by step improving it as i build a new one. (Looking at the downfalls from that one, and using better practices and approaches).

I noticed something silly, as I'm coding and comparing, and commented on it.... briefly...

I said "haha he makes a new item, to grab its meta next line, when he could just clone the meta itself" .

As another example... of a poor practice... with the first one being half his shit is O(n).

I genuinely don't know how this turned into the back and forth it did.
I'm sorry.

echo basalt
#

premature optimization

#

at its core

livid dove
#

Aye you are most likely right.

Fell into the strong foundations trap

#

It's just driving me mad trying to figure out whats causing the problem

#

Either way sorry u 2

#

Do respect and appreciate ur opinions 🙏

remote swallow
#

illusion

tardy delta
#

some good class names

echo basalt
#

I'm no shader dev

remote swallow
#

become one

eternal oxide
#

I've done a few shaders in my time, they are far from easy

tardy delta
#

opengl shaders are even worse

eternal oxide
#

I've only done opengl

grand magnet
#

I use React with NextAuth. I get a weird error with async authorize(credentials)(see link) that I haven't seen in any tutorial yet. I have also googled etc but have not found anything and am hoping for help.

Link: https://paste.md-5.net/ruhacorene.coffeescript

next flicker
#
ItemStack[] items = new ItemStack[6];
        items[items.length - 1] = CAGE_POS_ITEM;
        items[items.length - 1] = GOAL_1_ITEM;
        items[items.length - 1] = GOAL_2_ITEM;
        items[items.length - 1] = BOT_FIRST_BRIDGE_ITEM;
        items[items.length - 1] = NEVERMIND_ITEM;
        items[items.length - 1] = CONFIRM_ITEM;

im using player.getInventory().setContents on the above array, but it's only registering the 'CONFIRM_ITEM' item and other items arent added in inv

chrome beacon
#

Well yeah

#

You're setting the same array index

#

Set item 6 to cage pos item
set item 6 to goal 1 item ... etc

next flicker
#

oh

#

the length in an array is fixed

#

thank you

chrome beacon
#

Yeah you set the size when you created the array

tardy delta
pseudo hazel
#

idk either but its insane what you can do with it 😱

tribal quarry
#

hello, are there any ways to use bukkit with mcp mappings and obfuscate on build?

eternal oxide
#

Spigot uses Mojmaps

#

?nms

remote swallow
#

update to latest spigot version

#

(re run buildtools)

fossil wraith
tribal quarry
eternal oxide
#

You are not using spigot then

remote swallow
remote swallow
eternal oxide
#

oh true

zenith lintel
#
[INFO] Total time:  22.459 s
[INFO] Finished at: 2023-06-08T14:11:21Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project spigot: Could not resolve dependencies for project org.spigotmc:spigot:jar:1.20-R0.1-SNAPSHOT: Could not find artifact org.spigotmc:minecraft-server:jar:1.20-R0.1-SNAPSHOT in minecraft-libraries (https://libraries.minecraft.net/) -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :spigot
Error compiling Spigot. Please check the wiki for FAQs.
If this does not resolve your issue then please pastebin the entire BuildTools.log.txt file when seeking support.
java.lang.RuntimeException: Error running command, return status !=0: [sh, /home/container/apache-maven-3.6.0/bin/mvn, -Dbt.name=3777, clean, install]
        at org.spigotmc.builder.Builder.runProcess0(Builder.java:1062)
        at org.spigotmc.builder.Builder.runProcess(Builder.java:993)
        at org.spigotmc.builder.Builder.runMaven0(Builder.java:962)
        at org.spigotmc.builder.Builder.runMavenServer(Builder.java:931)
        at org.spigotmc.builder.Builder.main(Builder.java:742)
        at org.spigotmc.builder.Bootstrap.main(Bootstrap.java:27)

i cant download

eternal oxide
#

pretty sure it never used mcp though

fossil wraith
# remote swallow there was a bug with api-version: 1.20

iv use the rebuild tool and build the api again
did i miss anything for migrate from 1.19.4 to 1.20?
i'v chaged this

<dependency> <groupId>org.spigotmc</groupId> <artifactId>spigot-api</artifactId> <version>1.20-R0.1-SNAPSHOT</version> <scope>provided</scope> </dependency>

remote swallow
#

backwards compat should remain so unless you used nms your good to go

fossil wraith
lucid gazelle
#

?paste

undone axleBOT
remote swallow
#

nms is the only thing that would need updating for spigot stuff

quaint mantle
#

Hello, Is it possible to remove hit cooldown in spigot plugin?

#

I mean is it possible to remove a cooldown for players to getting damaged?

#

like if you stick next to the catus, you die in 0.1 sec

fossil wraith
tardy delta
#

just figured out x % y is the same as x & (y - 1) 💀

lucid gazelle
#

??? is this an IDE error??

remote swallow
#

reload maven or gradle

lucid gazelle
#

the first one yea?

remote swallow
#

yea

worldly ingot
#

If you set that to 1, it should damage the player each tick

lucid gazelle
remote swallow
#

check the package is correct at the top of the class

lucid gazelle
#

i can import the other classes from the same package just fine

#

this particular one is broken for some reason

tardy delta
#

just build the project, jetbrains products all begun the have the same bugs

lucid gazelle
#

i just remade the class lol and it works now

stoic niche
#

when came 1.20 ?

remote swallow
#

yesterday

stoic niche
#

i know but for spoigot 😄

chrome beacon
#

Yeah

remote swallow
#

yeah, it came out yesterday

chrome beacon
#

Yesterday

warm fulcrum
#

can gportal play spiggot with 1.20 ?

chrome beacon
remote swallow
#

paper and spigot are both on the mc server options

warm fulcrum
#

can you send me a link bruv

stoic niche
#

have you a link for spoigot 😄 ? the download

undone axleBOT
chrome beacon
#

As always the only offical way to get Spigot is with BuildTools

hybrid spoke
#

we need an equivalent to paperclip

#

spigotpipe maybe

worldly ingot
#

Never used it nor do I know if it even still works, but it exists lol

remote swallow
#

retro used to make spigotclip jars

#

but ended in 1.17.1

shy sundial
remote swallow
#

iirc that repo has been down for a while

river oracle
wild cedar
#

Hey, I am a bit confused about this Open Sign Editor packet which is client bound
https://wiki.vg/index.php?title=Protocol&oldid=18242#Open_Sign_Editor (it is for 1.19.4)
But now in 1.20, if you have tried, the sign editor doesn't get opened automatically, which means Open Sign Editor doesn't get sent automatically from server. But in wiki.vg, it says it still gets sent. (Or could be that they are wrong/forgot to change it?)
https://wiki.vg/Protocol#Open_Sign_Editor

And also the ones who know, does this change mean client will ignore open sign editor packets sent from the server and just sends update sign only now?

remote swallow
shy sundial
#

oh alright, thanks

ocean hollow
#

How can I change the Transformation for an ItemDisplay?

#

like changing scale, rotation

quaint mantle
#

is using import static and then your main class a valid way to get an instance of your main class

#

?

chrome beacon
#

?di

undone axleBOT
chrome beacon
#

^^

quaint mantle
#

i know but would it be valid

tardy delta
#

yes but i dont recommend it

#

using dependency injections makes dependencies more visible and it also results in cleaner code

quaint mantle
#

ok cool

vast ledge
#

So, im getting an error when running mvn clean install, as seen in the screenshot below, im not sure what im doing wrong, any help is appreciated

vast ledge
#

Projekt is 10 i think

#

and the mvn is using 8

#

that explans the issue

chrome beacon
#

Yeah that won't work

vast ledge
#

im running this from the command line, is there an arg i can add to the command?

#

to change the version of mvn

chrome beacon
#

It's a setting in your pom

vast ledge
#

The maven compiler is set to 10 tho

chrome beacon
#

Yeah

#

but your jdk is 8

#

JDK can't compile for newer versions than itself

vast ledge
#

do i change the marked one to 10 then?

chrome beacon
#

Set target to 8

#

1.8*

#

source and target need to be 1.8

vast ledge
#

can they not be 10?

chrome beacon
#

You're probably not using any of the Java 10 features

#

if you compile to 10 every user needs to use Java 10 or above

vast ledge
chrome beacon
#

Depends on how your lib is loaded

remote swallow
#

projects and server

chrome beacon
#

Server yes

vast ledge
#

im installing the lib to my .m2

chrome beacon
#

project maybe

vast ledge
#

and running it on the serbve

orchid gazelle
#

@cobalt thorn dich kenn ich

zenith lintel
#

are there any spigot plugins out yet for 1.20 ?

river oracle
#

Spigot has no breakages in api natively so all plugins not using nms directly work

orchid gazelle
cobalt thorn
#

Hi, im making a "weekly shop" inside a plugin and by testing it in a week and the trader didn't spawn

Code: https://sourceb.in/xdXRDk0ifa
No error

cobalt thorn
orchid gazelle
#

Oh

#

Sorry I know a German guy that is a dev that is named exactly like you and has a similar pfp

cobalt thorn
#

oh lol

echo basalt
cobalt thorn
echo basalt
#

type sout in intellij and see what comes up

cobalt thorn
echo basalt
#

you sure?

cobalt thorn
#

and for the code "if it work the spawn and despawn" works just fine so in theory everything should work

#

i don't know if it is the scheduler not working

grand otter
#

Does any of this need to change for 1.20?

    compileOnly "org.spigotmc:spigot-api:1.19.4-R0.1-SNAPSHOT"

}```
chrome beacon
pseudo hazel
#

probably xD

grand otter
#

I dont think 1.20 is out. I looked on the repository and it isnt there

pseudo hazel
#

it is

chrome beacon
pseudo hazel
eternal oxide
#

Choco, are updates to resource jars often this slow? I'm hoping not but I can understand if it's a backlog due to the release of 1.20

#

Did one on GM a few hour ago but the Site still links to external

worldly ingot
#

Uh, not sure. I've not released any updates nor heard anyone complain about them being slow

eternal oxide
#

odd

#

did it 5 hours ago today. Pretty sure I did nothign wrong, other than change from external site to an uploaded jar

#

update shows, but no jar, still external link

remote swallow
#

its up to date for me

eternal oxide
#

Its not, look at teh download button

remote swallow
#

the download button takes me to github for the 1.20+ release

eternal oxide
#

exactly

#

I changed it to a jar on Spigot site

remote swallow
#

oh

eternal oxide
#

I uploaded a jar and set to download from Spigot not external

quaint mantle
#

anyone know why it just overwrites, instead of adding the updated amount it just sets it to whats passed into the agrumnet

int currentAmount = uuid.getInt(crate, 0);
        int updatedAmount = currentAmount + keyAmount;
        uuid.set(crate, updatedAmount);
        try {
            keyData.save(virtualKeyData);
        } catch (IOException e) {
            e.printStackTrace();
        }
eternal oxide
#

what is uuid? what is crate?

lilac dagger
#

what is , 0?

quaint mantle
#

locations:
89172e41-e9fe-41c0-8ce9-e83a58eca756:
event-crate: 44

#

this is an example

eternal oxide
#

I'm assuming uuid is a map and 0 is a default

quaint mantle
#

no i think the getInt method is wrong

lilac dagger
#

but a map doesn't have getInt

eternal oxide
#

yeah no clue

quaint mantle
#

uuid is the players uuid as a configurationsection

eternal oxide
#

what?

quaint mantle
#

locations:
89172e41-e9fe-41c0-8ce9-e83a58eca756:
event-crate: 44

see the uuid

#

thats uuid in that code

remote swallow
#

uuid is a config section im guessing

quaint mantle
#

yeah

eternal oxide
#

use better names. descriptive

quaint mantle
#

yeah my fault

eternal oxide
#

if it's a player uuid in a config then uuid shoudl be playerSection

quaint mantle
#

that doesnt matter rn

eternal oxide
#

it does if we can;t understand your code

vapid lake
#

Umm hello i want to know why nms not work in ubuntu

quaint mantle
#

i have the players uuid in a variable, how do i access the integer 44 from this config

locations:
  89172e41-e9fe-41c0-8ce9-e83a58eca756:
    event-crate: 44
#

i thought it was uuid.getInt

remote swallow
#

config.getInt("locations.89172e41-e9fe-41c0-8ce9-e83a58eca756.event-crate")

quaint mantle
remote swallow
#

or if you have the uuid section, uuidSection.getInt("event-crate")

quaint mantle
#

yeah thanks

#

i do have the uuid section

eternal oxide
#

Please pick better names. It's really important for YOU in a years time when you look back at teh code.

quaint mantle
#

I will thanks for the suggestion elgar

eternal oxide
#

k

quaint mantle
#

I usually name the variable with their datatype but in camelCase

#

If datatype is a primitive, I name it in lowercase first letter of the primitive

pseudo hazel
#

better names for a uuid?

eternal oxide
#

it wasn;t a uuid

quaint mantle
#

Just be sure that if method is exposed at any time, document it well with /** comment (javadoc comment)

#

doesnt work, ill rename everything nicely and ask again

remote swallow
#

xyzIdSection

eternal oxide
#

it was a ConfigurationSection

pseudo hazel
#

wdym by exposed

quaint mantle
#

private String name;

pseudo hazel
#

also if its obvious what a method does, there is no point int writing docs for it

quaint mantle
#

That's encapsulated

#

Ok let me ask the question again

#

But whenever you do

public String getName(){
return name;
}```
#

You are exposing it since it was encapsulated before

pseudo hazel
#

what docs are you gonna write for this function

quaint mantle
#

It not only applies to private keyword

gilded bronze
#

How can I put Java 18?

quaint mantle
pseudo hazel
#

i see

#

thats 200% useless

quaint mantle
#

I know

#

I have this method here

public void addVirtualKeys(@NotNull Player player, @NotNull String crate, @NotNull int keyAmount) {
        if (data == null) {
            data = keyData.createSection("data");
        }

        String playerUUID = player.getUniqueId().toString();
        data.createSection(playerUUID);
        ConfigurationSection playerUUIDWhereCrateKeysAreStored = data.getConfigurationSection(playerUUID);
        int currentAmount = playerUUIDWhereCrateKeysAreStored.getInt(crate);
        int updatedAmount = currentAmount + keyAmount;
        playerUUIDWhereCrateKeysAreStored.set(crate, updatedAmount);
        try {
            keyData.save(virtualKeyData);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

This code should take "45" from this config for example:

locations:
  89172e41-e9fe-41c0-8ce9-e83a58eca756: # playerUUIDWhereCrateKeysAreStored 
    event-crate: 45

And then add the argument "keyAmount" to it and then save the file.

But all it does now is set that "45" to whatever is passed in the "crate" argument.

Any ideas?

#

There

remote swallow
#

yeah that seems a bit pointless in that case, im pretty sure most of us just call the variable and the getter exactly what it is, so its self explanatory

quaint mantle
#

But sometimes whenever you are exposing, you are writing an algorithm

#

So in the Javadoc is where you document such algorithm

pseudo hazel
#

docs become important when you have a specific use for your method

#

or when the method is really complex, but then you would just do the comments in the code block usually

remote swallow
quaint mantle
#

You can also document in the getter (also in the setter) what the String name attribute is used for. So in the setter document how it affects the object.

quaint mantle
remote swallow
#

data.createSection returns the config section

#

you dont actually have to create the section

quaint mantle
#

oh

pseudo hazel
remote swallow
#

you can just set the sub key

pseudo hazel
#

imo its useless to suggest to always write docs, as mostly, its not needed and leads to reading even more

quaint mantle
#

so whats the error then

grand magnet
#

I use React with NextAuth. I get a weird error with async authorize(credentials)(see link) that I haven't seen in any tutorial yet. I have also googled etc but have not found anything and am hoping for help.

Link: https://paste.md-

vapid lake
#

Pls i want to know why nms not work in ubuntu

remote swallow
quaint mantle
quaint mantle
pseudo hazel
#

yes but you dont need it for everything

#

thats all im saying

#

im not saying it cant be usefull

quaint mantle
#

Remember you wrote the code

remote swallow