#help-development

1 messages · Page 1292 of 1

young knoll
#

Yeah unfortunately you can’t just send your own graphics with core shaders

#

It has to be something minecraft already loads and passes to the GPU

wet breach
young knoll
thorn isle
#

i don't think you can do that with core shaders

young knoll
#

I also do not think you can

#

Sadly

grim hound
#

and it has 57k members

young knoll
#

Is this not for Minecraft?

thorn isle
#

but if you can access e.g. resourcepack assets, you could include a big item texture or something in your resourcepack and sample that; supposing you can get a pointer to it somehow

grim hound
#

this is so funny

grim hound
young knoll
#

It’s got a lot of people doing Iris/Optifine shaders

grim hound
young knoll
#

But it has a #vanilla-shaders channel

grim hound
#

ah aight

grim hound
thorn isle
#

i don't know

wet breach
#

lol

young knoll
#

You can include a big font texture I assume

#

Textures can be up to 256x256

#

Well, for fonts

wet breach
#

which is the size limit they are working with 🙂

#

so, might work lol

young knoll
#

That’s what

wet breach
#

256x256

young knoll
#

256 16x16 textures

grim hound
#

it's 64 16x16 textures

young knoll
#

You can fit 256 16x16 textures in a 256x256 pixel area

thorn isle
#

16x16 is 256

grim hound
#

meth

wet breach
#

oh that should work plenty for them as they need 16 frames

grim hound
#

like at least 64

young knoll
#

Well 256 > 64

wet breach
#

^

young knoll
#

Maffs

grim hound
#

and texture sizes at least 128

young knoll
#

Ah

#

That’s more of an issue

thorn isle
#

you could always try composing a larger image from multiple bitmap font characters

#

so you could split a large image into 16x16 chunks

young knoll
#

Mmyeah

grim hound
thorn isle
#

what for

grim hound
#

plugin

#

1 emoji = 1 char

thorn isle
#

just replace a single token character with the desired character sequence when parsing the plugin config or whatever

#

or if it's in chat, then in chat

grim hound
#

its never parsed

vast ledge
#

He really tried to add me xD

thorn isle
#

well parse it

grim hound
#

that's not the point, also it won't work vertically

thorn isle
#

you can do that with the magic offset bullshit e.g. happyhud uses

grim hound
#

and I really wanted to make the frames like the size limit, of 256x256

grim hound
#

betterhud, I mean

thorn isle
#

yeah whichever one of the hud plugins

#

i only remember happyhud because it's part of the mythic ecosystem and the mythic ecosystem makes me mad

#

as in everything in their orbit is 🚮

#

except libsdisguises

young knoll
#

I found this

#

No idea if/how it works

thorn isle
#

consider forwarding it instead of linking it as i think you need to be in the same guild + have access to the channel for links to work

#

at least i just see #unknown

young knoll
#

Oh hey it worked this time

#

Last time I tried to forward something discord said no

grim hound
#

damn, I will see the code

thorn isle
#

going by the description i'm not sure if that addresses the texture size issue but it might be worth a shot to look into

muted stag
#

Hi everyone, how do we deal with world operations in ChunkEvent listeners

#

i.e. doing getChunk().getEntities() when ChunkUnloadEvent & EntitiesLoadEvent

#

That's likely to cause trouble but it seems that we can handle it

young knoll
#

You should do them in the entity events

#

If you are working with entities that is

muted stag
#

Umm, it's a bit complicated but I'm trying to support plugins instead of coding the plugins myself

#

I dived into your implementation but I was too dumb to find out how you prevented this

young knoll
#

Prevent what

muted stag
#

I tried to write similar patches and apply them to support ChunkUnloadEvent

young knoll
#

I'm confused

#

Are you trying to make a server that implements the bukkit api?

muted stag
#

Yes

#

Sorry if that bothers you 😦

muted stag
#

ChunkMapDistance is ticked and ChunkUnloadEvent is triggered again for the same chunk and it repeats itself

young knoll
#

Not really sure what to suggest

#

Spigot internals are sort of a mashup of code written over the past 14 years

slender elbow
#

it needs a rewrite

#

in scala

#

from scratch

young knoll
#

I think you mean Python

slender elbow
#

too slow

worldly ingot
#

Should rewrite it in Lua

vocal cloud
#

COBOL it is

mortal hare
#

when you guys do lambdas do you prefer using standardised consumer supplier predicate or you instead define your own types of functional interfaces just for the sake of documentation and the clear usage

slender elbow
#

it depends

#

but generally ill just go with whatever is already available

#

AutoCloseable is just a throwing Runnable

echo basalt
#

I usually make my own if I'm planning to expand

#

Or just use what already exists if I'm not

slender elbow
#

for application or internal library code I'll definitely use what's available unless I have some very specific need

#

for me shit changes when making a public api

#

and even then, what kind of api it is

#

plenty of situations where Function, Predicate, Runnable are more than enough and self explicative for the given setting

echo basalt
#

I usually change my stuff down the line to add more features or whatever and having to change literally every Function<A, B> to a BiFunction<A, B, C> or whatever is much more work

lilac dagger
#

sometimes i make my own if the name is confusing

slender elbow
#

I'm not entirely sure what you mean

lilac dagger
#

like here

slender elbow
#

if you need to change from a Function<T, R> to a BiFunction<T, U, R>, whether you are using those interfaces or your own, it will break all existing lambdas anyway

lilac dagger
#

i don't usually pass it around to a different interface

hearty sparrow
#

Does anyone know how i could listen to the ClientIntentionPacket packet?

#

of course a normal packet listener won't work because the player hasen't been created yet

echo basalt
slender elbow
#

sure

potent crescent
#

Execution failed for task ':compileJava'.

Could not resolve all files for configuration ':compileClasspath'.
Could not resolve com.sk89q:worldguard:6.1.1-SNAPSHOT.
Required by:
project :
Could not resolve com.sk89q:worldguard:6.1.1-SNAPSHOT.
Unable to load Maven meta-data from http://maven.sk89q.com/repo/com/sk89q/worldguard/6.1.1-SNAPSHOT/maven-metadata.xml.
Could not get resource 'http://maven.sk89q.com/repo/com/sk89q/worldguard/6.1.1-SNAPSHOT/maven-metadata.xml'.
Could not GET 'http://maven.sk89q.com/repo/com/sk89q/worldguard/6.1.1-SNAPSHOT/maven-metadata.xml'. Received status code 522 from server: <none>

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --debug option to get more log output. Run with --scan to get full insights.
#

how to fix this proplem

young knoll
#

Must be an old project

echo basalt
#

worldguard 6

#

pog

#

prolly importing an old ass version of mcmmo

potent crescent
#

last update was before 5 years

young knoll
#

What

echo basalt
#

What

potent crescent
#

huh

#

what should i change rn ?

oblique furnace
#

I am currently working on a anti cheat plugin. I need help with the plugin, as I dont know how to let the plugin execute commands (like ban or kick) in the console

young knoll
#

Why

#

Player#kick and Player#ban iirc

oblique furnace
#

which context does it need?

young knoll
#

hmm?

potent crescent
#

also u can get src and edit it

hearty sparrow
floral pier
# oblique furnace which context does it need?

You have to add the command and it's arguments and permissions to plugin.yml then include a Java method annotaed with @EvenHandler IIRC that denotes your commands functionality. You then have to register the command to your plugin in onStart similar to events but I forget the specific method for that

rotund ravine
thorn isle
#

onStart

echo basalt
#

bruh just spent 20 mins at work debugging why applying a cooldown of Integer.MAX_VALUE doesn't work

#

int overflow moment

echo basalt
#

fuck rad's not here

#

does anyone have code for layering components on titles with negative space

#

the logic completely fucks itself because titles are center aligned not left-align

#

if I send some text back it sends the previous text forward

#

for some reason

misty ingot
#

mongodb just does not want to behave
and i have no clue what im doing wrong

java.lang.ClassCastException: class java.util.UUID cannot be cast to class java.lang.String (java.util.UUID and java.lang.String are in module java.base of loader 'bootstrap')

public void initMongoBounty(String uuid, Map<UUID, BountyData> bounties){
        Document doc = new Document();
        doc.put("uuid", uuid);
        doc.put("bounties", bounties);
        getBountyCollection().replaceOne(Filters.eq("uuid", uuid), doc, new ReplaceOptions().upsert(true)); <-- problem line
}
#

im not even casting UUID to string

potent crescent
#

how u did send message command like that?

#

t

#

ah alr

cinder abyss
#

Hello, how can I automatically publish a plugin jar to spigot with a gradle task ?

misty ingot
# misty ingot mongodb just does not want to behave and i have no clue what im doing wrong `ja...

meanwhile the spigot guide

public void initMongoRank(UUID uuid, String prefix, String suffix, int permLevel, ArrayList<String> permissions) {
        Document doc = new Document();
        doc.put(“uuid”, uuid.toString());
        doc.put(“prefix”, prefix);
        doc.put(“suffix”, suffix);
        doc.put(“permLevel”, permLevel);
        doc.put(“permissions”, permissions);
        getRankCollection().replaceOne(Filters.eq(“uuid”, uuid.toString()), doc, new ReplaceOptions().upsert(true));
    }
young knoll
#

It’s the map

#

It’s trying to convert the uuid key to a string

#

Iirc there’s a setting to enable complex keys

misty ingot
#

oh.

#

ofcourse

#

its my fucking map

pure dagger
#

how to make lighning make fire

#

world.strikeLightning(location);

young knoll
#

You can just set the block there to fire

pure dagger
#

but it lights random blocks right

pure dagger
#

in which directory do i put files like images ?

buoyant viper
#

whichever one u feel like

#

unless its server-icon.png, that one goes in the same directory as ur server jar

#

unless u set it dynamically, then it doesnt matter again

pure dagger
#

so i put it in resources/images

#

but

#

/images/img.png

#

how do i access it

buoyant viper
#

how are you obtaining the image in code

pure dagger
#

idk

buoyant viper
#

oh thats simple then

#

a <SomeClass>.class.getResource("/images/img.png");

pure dagger
#

uhmm

#

why class

buoyant viper
#

or getClass().getResource if ur accessing from an instance

#

its just how java decided to be idk

#

oh wait

pure dagger
#

i just wanted the path

buoyant viper
#

is ur image inside the jar or in the plugin directory

pure dagger
#

yeah inside the jar

buoyant viper
#

oh okay yeah u gotta access it from a class instance then

pure dagger
#

which class

buoyant viper
#

any class inside ur plugin actually

#

it shouldnt matter

pure dagger
#

uhm

#

why cant i just do /images/img.png

buoyant viper
#

like new File("images/img.png") ? its just not how java jars work sadly

pure dagger
#

i dont understand why

sly topaz
#

you could also use your plugin instance for it, as there is an utility method in JavaPlugin

#

(i.e. JavaPlugin#getResource)

pure dagger
#

so whats the difference between class.getResource and JavaPlugin#getResource

sly topaz
#

nothing, the one in java plugin is just an utility method that uses the PluginClassLoader directly

buoyant viper
#

getResourceAsStream my beloved

pure dagger
#

oh my god it worked

#

o o
U

buoyant viper
#
o o
 U```
#

nevermind that looks like a dick and balls

pure dagger
#

shush

royal onyx
#

hi guys, im making a core plugin which ofc needs alot of GUI's. Whats the best way to manage GUIS and the most useful GUI Builder API, or should i make a custom one? Thanks!

pure dagger
#

?gui

pure dagger
#

maybe this idk

buoyant viper
#

reinvent the wheel, u know u want to

young knoll
#

Nah all the cool people are using dialogs now

cinder abyss
#

Hello, how can I automatically publish a plugin jar to spigot with a gradle task ?

young knoll
#

You can’t afaik

#

Spigot doesn’t have any api for that

sly topaz
#

I believe some people have made automatic changelog generators for updates, if anything but you can't really do the update and publication automatically without doing some sophisticated scraping

young knoll
#

MD will bonk you

sly topaz
# young knoll MD will bonk you

anyone capable of doing that level of scraping wouldn't be asking how to do it anyway, so I don't think it is an issue lol

young knoll
#

He will find out

#

Probably when you mess up and it publishes 100 updates in the span of 5 minutes

sly topaz
#

I don't think most people would be able to get past cloudflare captcha, but who knows

#

that makes me think, are the internal endpoints captcha-protected as well, ig if you don't have the right cookies it just fails the request even if you provide a valid authorization header

echo basalt
#

if there's a gui lib that meets your needs go for it

#

I wrote all my own shit because there's no GUI lib that fullfils my needs

earnest girder
#

if I am listening to a teleport event for portal uses, and I use event#setTo, will players get a loading screen like they would traveling through a vanilla portal?

potent crescent
#

''' Execution failed for task ':compileJava'.

Could not resolve all files for configuration ':compileClasspath'.
Could not resolve com.sk89q:worldguard:6.1.1-SNAPSHOT.
Required by:
project :
Could not resolve com.sk89q:worldguard:6.1.1-SNAPSHOT.
Unable to load Maven meta-data from http://maven.sk89q.com/repo/com/sk89q/worldguard/6.1.1-SNAPSHOT/maven-metadata.xml.
Could not get resource 'http://maven.sk89q.com/repo/com/sk89q/worldguard/6.1.1-SNAPSHOT/maven-metadata.xml'.
Could not GET 'http://maven.sk89q.com/repo/com/sk89q/worldguard/6.1.1-SNAPSHOT/maven-metadata.xml'. Received status code 522 from server: <none>

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

'''

#

how can i fix this proplem ?

echo basalt
#

buddy posting the same exact shit again

#

why are you trying to import worldguard 6

#

it's like pre-1.13

potent crescent
#

im useing 1.12.2 bro

young knoll
#

Didn’t i give you the correct repo

echo basalt
#

?1.12

#

no command? bruh

sullen canyon
#

?howold 1.12

undone axleBOT
sullen canyon
#

?howold 1.12.2

undone axleBOT
potent crescent
potent crescent
sullen canyon
potent crescent
empty dove
#

Chat, Im learning

empty dove
#

So I fixed my issue with methods

rotund ravine
tacit coral
#

I'm trying to create a custom nametag with a combination of scoreboard teams prefix with a modified gameprofile name. I'm able to modify the gameprofile name using the PLAYER_INFO Add_player packet and and see the updated name, but doing this removes the teams prefix. Anyone know anything about this?

#

I'm sending a sequence of packets, remove entity -> player info add player (modified gameprofile created here) -> entity destroy -> entity spawn. The last two packets are to simulate a respawn so players can see the modified name

#

Wondering if I just need to send scoreboard packets in the sequence, or run some sort of refresh on the scoreboard since im using remove and add entities packet

sonic goblet
tacit coral
#

Doesnt that stop the player from teleporting

#

Since it has a passenger

sonic goblet
#

It does ya, we handle all the teleporting ourselves so we just respawn the nametags when they teleport. If you run other plugins that solution probably won’t work

empty dove
#

https://i.imgur.com/VdrM964.png

Heya! Im learning how to code Java and so I'm following the steps that the guide states however. As you see my Book class has encapsulated variables and so I use methods to change the objects data

Am I doing this all wrong?

Below is the usage for my methods:

https://i.imgur.com/mPEtyKC.png

I was wondering if I shouldn't return a value making my method type void or if I am doing it correctly because the video says to use void

young knoll
#

Generally setters return void

#

While getters return the value they are designed to get

#

And java conventions generally have them named getXyz and setXyz

noble current
#

anyone know how to make a mob spawn naturally in a mob he can't?

#

like spawning ghasts in the end

#

or any libraries that can help

young knoll
#
  1. Replace an existing mob when it spawns
  2. Make your own spawning system
  3. Hack away at NMS
buoyant viper
noble current
young knoll
#

?

noble current
#

with replacing an existing mob

buoyant viper
#

u could replace an enderman spawn with ghast at a random chance % idk

noble current
#

i did that and worked in a first time

#

but later i wanted to replace all enderman with a enderman which has a custom name and it started spawning infinitely

buoyant viper
#

ah, the good old infinite ghast glitch

#

(i made that up)

#

maybe u could check against the endermans name before u spawn the ghast? idk

#

like if the name is custom dont try to spawn ghast

noble current
#

the problem is that the endermans keep spawning infinitely too

#

im blessing chatgpt to help me and he said im cooked 🙏

buoyant viper
#

that is how the end works yes

noble current
buoyant viper
#

D:

noble current
#

it spawns like 5000 endermans in 10 seconds

buoyant viper
#

i dont even think once

#

idk how u managed the infinite enderman part

#

unless u do spawn an enderman for ... every enderman spawned

#

but atp u should replace said enderman in a creature spawn event then maybe check for custom name for the ghast part

#

i reckon a spawn overflow must be trivial to avoid

noble current
#

im gonna see that

young knoll
#

You cause a loop

#

Spawning something in the spawn event then triggers another spawn event

#

Check the spawn reason

buoyant viper
#

?jd-s hm

undone axleBOT
young knoll
#

(Or use a Boolean to ignore the spawn you explicitly cause)

buoyant viper
#

oh i thought u could outright replace the entity in CreatureSpawnEvent

#

i see now its immutable

noble current
#

chatgpt just broke it more than before

buoyant viper
#

this is why AI is a scam fr

noble current
#

fr

young knoll
buoyant viper
#

its only mutability looks to be cancellable

#

ohh u mean the entity itself

young knoll
#

Ye

noble current
#

im just gonna spawn the mob near the player every 20 seconds to simulate the natural spawn 🙏

buoyant viper
#

how did we come to this resolution

noble current
#

well

#

i did it

#

i added that 1 in 5 endermans spawns an extra mob which will be a creeper and in 1 in 10 endermans will be ghast

#

works good

buoyant viper
#

i should add random charged creeper chance to my smp

slender elbow
#

50% random enough

noble current
young knoll
#

Good enough

#

Ship it

empty dove
buoyant viper
#

today i will forego conventional databasing and instead store player configs directly inside PDC

worldly ingot
#

But generally yes

young knoll
#

Yeah there are definitely exceptions

#

Sometimes a setter may return a Boolean to indicate if it actually changed something

#

Or maybe the previous value

buoyant viper
#

Collection and Map go brrrrr

upbeat hornet
young knoll
#

Clearly we should just add a CustomItemRegistry to spigot itself!!1

echo basalt
#

I feel like if you're going to make a proper lib for this you should add support for item components and have some sort of legacy adapter that applies them to spigot meta

#

both paper and spigot modules because hard fork and whatever else

#

And at that point you're just reinventing itemstacks

#

Why stop at deserialization? What if I want to save an item to a config

#

what then?

carmine mica
#

and also... data version upgrades

noble saddle
#

Is it possible to change a player's item's item model via CUstomModelDataComponent, without having to re-set the item in-hand?

drowsy helm
winter crater
#

Hey, There I am Looking For A Experienced Server Devloper Who Is Willling To Help My Server Grow If You Are Intrested please do Dm Me thanks (:

undone axleBOT
smoky anchor
#

Why The Heck Would Anyone Type Like This

mortal vortex
#

smh pay ur devs

drowsy helm
#

and 50% revenue split (but they will make millions trust me)

alpine urchin
#

how about I pay you in equity

#

the company will make millions in thr futute

#

trust me

buoyant viper
#

for a map of <Object> whos key is a UUID [from <Player>], and <Object>'s life-time is only while <Player> is online, could i just make the key the <Player> for simplicity and avoid unnecessary lookup-by-UUID when accessing <Object> ?

drowsy helm
buoyant viper
#

ye <Object> is deleted in PlayerQuitEvent

drowsy helm
#

yeah thats fine

buoyant viper
#

Pog

pseudo hazel
#

isnt the reference also getting replaced when they die or something? or only when they leave?

buoyant viper
#

oh u know what

#

i think teleporting across worlds breaks persistence doesnt it

#

Fuk

distant pendant
buoyant viper
#

bros crafting diamond sword with emerald

distant pendant
buoyant viper
#

gah F it ill just keep lookup by UUID

pseudo hazel
#

yeah atleast you know the uuid lasts forever

#

or well, until microsofts servers are dead

buoyant viper
#

True

mortal vortex
lost matrix
mortal vortex
#

yea

distant pendant
mortal vortex
lost matrix
distant pendant
distant pendant
lost matrix
#

You might have a problem with cancelled events

lost matrix
distant pendant
# lost matrix Alright, now explain what we are seeing in this video. When are you clicking, an...

When i try to click Result slot in crafting inventory, will check if this inventory is really crafting inventory or not and check if slot inventory is the result slot. i expect that will reduce the item in crafting slot exactly as ingredient amount configuration, ex:

Example:
  Type: SHAPED
  Shape:
  - " E "
  - " E "
  - " S "
  Ingredients:
    E:
      Item: emerald
      Amount: 2
    S:
      Item: stick
      Amount: 2
    Result:
      Item: mythicmobs:example_item
#

i really dont know if this really explains it

#

if this cant fix maybe i will stick with this and not touch it, again.

#

because in basic it just works as what i expected but has an error on item amount visual

pseudo hazel
#

what format is that

distant pendant
sharp ether
#

hello i need some help with my account bc of a serious problem

#

who can help me?

drowsy helm
#

?support

undone axleBOT
sharp ether
#

i emaild them?

drowsy helm
#

yeah email them

sharp ether
#

ok thanks

potent heron
#

How can I upload my plugin?

south oracle
#

use Filezilla

pseudo hazel
#

I mean how big is it xD

potent heron
#

No, but I say in spigot to know how it's done

noble saddle
drowsy helm
#

its client side

smoky anchor
#

iirc you can with resourcepack

#

the model definition has some flag

#

ofc 1.21.4+

noble saddle
#

whoa, cool. I'll check it out

lunar bluff
#

whyy

smoky anchor
glacial narwhal
#

Caused by: java.lang.ClassNotFoundException: be.artex.rolesffa.items.ChooseRole
at java.net.URLClassLoader.findClass(URLClassLoader.java:445) ~[?:?]
at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:102) ~[patched_1.8.8.jar:git-PaperSpigot-445]
Caused by: java.lang.ClassNotFoundException: be.artex.rolesffa.items.ChooseRole

Any ideas why i get this error? the class is in the jar.

upbeat hornet
# buoyant viper /j /lh

What other library supports itemsadder, nexo and oraxen? If you know, tell me because I want to add this compatibility to my plugins

upbeat hornet
upbeat hornet
young knoll
#

Doesn’t handle all the fancy new components

#

Durability, equipable, custom model, glider, etc

thorn isle
#

what i did was just fork every other custom item plugin to use my centralized item definition plugin, and the latter has them definable as yaml which gets parsed as json which gets parsed by mojang JsonOps into itemstacks

#

very flexible and i don't have to maintain any part of the parser myself

#

e.g.

  components:
    minecraft:custom_name: '{"extra":[{"bold":false,"color":"aqua","italic":false,"obfuscated":false,"strikethrough":false,"text":"Reactor Coolant Cell","underlined":false}],"text":""}'
    minecraft:custom_data: '{PublicBukkitValues:{"slimefun:slimefun_item":"REACTOR_COLLANT_CELL"}}'
    minecraft:profile:
      name: CS-CoreLib
      id:
      - 357563355
      - -1042141084
      - -1799017745
      - 522968250
      properties:
      - name: textures
        value: eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZGU0MDczYmU0MGNiM2RlYjMxMGEwYmU5NTliNGNhYzY4ZTgyNTM3MjcyOGZhZmI2YzI5NzNlNGU3YzMzIn19fQ==
  DataVersion: 4189
sly topaz
#

why even use yaml when half of the file is going to be json 😭

thorn isle
#

the item definitions are expected to go into a yaml plugin config

#

plus yaml is nicer to work with

#

has anchors and shit

#

there's also snbt strings that you could put into a yaml config, but those don't get any linting and won't be validated by e.g. yamllint

sly topaz
#

I always thought json as easier since Gson/Moshi make it pretty great to deserialize, just pass a type token to it and it'll figure shit out

thorn isle
#

on the source code side, for sure

#

on the editing the text file side, not so much

#

yaml is much more free form

sly topaz
#

eh, json has much more wider coverage, even browsers have tree-like views for json files

#

but at this point it is just a matter of preference I guess

thorn isle
#

shore but there's e.g. exactly one way to escape things in strings and it gets quite unwieldy

#

yaml for comparison has 3 or 4 and each one is specifically suited for certain kinds of strings and things to escape

chrome beacon
#

If you want to use json you're free to do so

sly topaz
thorn isle
#

yes, valid json is valid yaml

sly topaz
#

I never really connected the dots but I guess you could write yaml as if it was json given it supports in-line blocks like json with braces

thorn isle
#

yaml is practically just a ton of syntax sugar and human-friendly syntax additions on top of json

sly topaz
#

anyhow, ItemStacks have always been quite annoying of an object to serialize, hopefully data components take over all of their properties so it can be more easily standarized into simpler formats

thorn isle
#

this makes it much more difficult to work with programmatically (compare the snakeyaml vs org.json parsers for example) but much more human friendly

#

aren't itemstacks already completely composed of components?

young knoll
#

Yes

sly topaz
#

I believe there is still some items which have special behavior that isn't described by components

young knoll
#

PDC is annoying to deal with in serialization

sly topaz
#

PDC should've just become a wrapper around the custom data component for items

#

API wise, nothing would change

thorn isle
#

in the sense that all functions aren't data driven? yeah, you can't make something into a fishing rod with a component; but everything about a stack is serialized and deserialized and stored in-memory as components

#

oh yeah i also registered an itemstack subclass into the bukkit serialization system so that any plugin that reads an ItemStack directly from its config can use the json item definition syntax and have it work out of the box

#

in this way i didn't need to fork mythicmobs in particular

ivory sleet
# thorn isle plus yaml is nicer to work with

Icl, comments do fuck it up, since by specification they can just be anywhere and a library may pick their own range of support

Anchors are nice but like hella easy to make a yml document a shithole

Its also the fact that u can use block and flow style unrestrained that makes yaml goofy, esp when you work w others and they opt to use the other style out of nowhere for the sake of it

ivory sleet
thorn isle
#

anchors are also an easy way to crash a parser

#

the leniency definitely makes it more difficult to reason about what's going on and what's actually valid and what isn't

ivory sleet
#

ye for sure

mortal hare
#

simple, standardized, no gimmicky logic with references mappings etc

#

i can bet that more than half of YAML features are not even known by average user

#

i prefer either json or toml, but i just use yaml for consistency with bukkit server implementations and plugins

ivory sleet
# mortal hare toml ftw

You gotta be rage baiting atp, like sure there are some advantages with toml, but also some disadvantages, both in general and compared to yaml, for example anchors, but also who thought it was a great idea to let [table] and then [[arrtable]] for example, quite confusing and easy to mix up due to becoming an illusion potentially

grand flint
#

toml is so fucking ass 😭

sly topaz
#

just like all of these formats, it just ends up looking strange when it comes to complex structures

ivory sleet
#

I mean json works decently for complex structures, well imo

buoyant viper
#

JSON is simply the king format

#

it never needed subsets

thorn isle
#

json is for programmers, yaml is for end users, and toml is for code hipsters

elfin isle
#

what about hocon

worldly ingot
#

edgy

elfin isle
#

fair

sly topaz
#

hocon is just json with comments, nobody using json cares about comments

#

{"success":false,message:"Failed to do the thing"} ftw

glacial narwhal
#

Caused by: java.lang.ClassNotFoundException: be.artex.rolesffa.items.ChooseRole
at java.net.URLClassLoader.findClass(URLClassLoader.java:445) ~[?:?]
at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:102) ~[patched_1.8.8.jar:git-PaperSpigot-445]
Caused by: java.lang.ClassNotFoundException: be.artex.rolesffa.items.ChooseRole

Any ideas why i get this error? the class is in the jar

sly topaz
worldly ingot
slender elbow
#

I like naming my json comment fields "choco"

fresh timber
#

I just made a simple code in Java to test how much faster it can be than Skript (a different plugin I used to use to customize my server). When I run like 10,000 loops, it will take like ~3-4 seconds to load, but then it tells me that it took like 200ms. In the attached picture it took easily over 2 seconds to run the command. Does anyone know why this would happen?

ItemStack item = new ItemStack(Material.DIAMOND, 100);
ItemStack item2 = new ItemStack(Material.DIAMOND, 1);

for (int i=1; i <= loops; i++) {
    p.getInventory().addItem(item);
    
    for (int i2=1; i2 <= 100; i2++) {
        p.getInventory().removeItem(item2);
    }
}
chrome beacon
#

How are you measuring time

fresh timber
#

with the System.currentTimeMillis()

echo basalt
#

any idea on how to stop command arguments from being sorted alphabetically with CCF

chrome beacon
#

And how do you know it's not the client having to keep up with the packets

fresh timber
#

I'm just wondering if this is an accurate test

#

because it doesn't seem accurate

chrome beacon
#

It's probably fine

glacial narwhal
potent heron
#

how can i upload a plugin in spigot

chrome beacon
#

You click the post resource button

slender elbow
potent heron
#

@chrome beacon

slender elbow
#

you should probably read that message at the top that is hidden behind the "RESOURCES" tab

noble saddle
# smoky anchor

Anyone know what website/wiki this information is located?

slender elbow
#

minecraft.wiki

noble saddle
#

thank you!

slender elbow
pure dagger
#
Vector vector = targetPlayer.getLocation().subtract(player.getLocation()).toVector();
                vector.normalize();
                vector.multiply(2);
                vector.setY(vector.getY()+0.2);
                targetPlayer.setVelocity(vector);

what is throwing exception here when 2 players are in the same location? what do i have to check

lilac dagger
#

Make sure player!=targetplayer

pure dagger
#

it isnt but im talking about the same location

#

what am i doing wrong here

lilac dagger
#

I think it has something to do with infinity

worldly ice
#

if they're in the same location you're normalizing a (0, 0, 0) vector which results in a divide by 0 error

pure dagger
#

why doesnt they say it in docs

worldly ice
#

ig it should mention that in docs but it's usually just implied that arithmetic errors can occur with normalization

ivory sleet
#

Ah, Maybe not explicitly tho

pure dagger
#
Vector vector = targetPlayer.getLocation().subtract(player.getLocation()).toVector();
if (vector.isZero()) {
    vector.setY(1);
} else {
    vector.normalize();
    vector.setX(vector.getX()*2);
    vector.setZ(vector.getZ()*2);
if (vector.getY()<0.3) {
    vector.setY(0.3);
    }
}
#

what do you think

ivory sleet
#

Ye looks good

#

But try n see

worldly ice
#

the good ol'

#

?tas

undone axleBOT
trim quest
#

i coded particle api that allows you to create particles between 1.8+ but im not sure which nms interface should i choose for 1.13.
i mean :

#

i have R1, R2 and R3

young knoll
#

Depends on the version

trim quest
#

i choose R1

#

3 implementation is enaugh

#

for 1.8, 1.13 and 1.19

young knoll
#

That’s 1.13.0

#

I assume

trim quest
#

because it is only changed in these versions

#

yes

#

ParticleNativeAPI also uses same tactic

#

he uses bridge pattern

#

for this 3 different versions.

#

differences between 1.13 & 1.19

#

so no need implementation for other versions i assume.

buoyant viper
#

does Player#get/setDisplayName persist across reconnect, or is it per-session?

young knoll
#

Per session I assume

#

Since the player instance is also per session

buoyant viper
#

need api doc to start specifying this sort of behaviour frfr

mortal hare
#

is there any way to force intellij to generate fluent getter/setters?

sullen marlin
trim quest
#

its just study purpose API in general

sullen marlin
#

wouldnt use nms...

#

the API runs in all versions

mortal hare
# trim quest wdym?

i found it, you just need to select records style in intellij generate dialog menu

trim quest
#

hmm

#

lombok?

mortal hare
#
    public Component name() {
        return this.name;
    }

    public Component description() {
        return this.description;
    }

    public ThemeLocations locations() {
        return this.locations;
    }
pure dagger
#

How to get players ping

mortal hare
#

it works until it doesnt

trim quest
sullen marlin
mortal hare
#

i just tend to use generate feature instead

#

since that's more compatible and ideally more readable for me since i see what class actually does without syntax sugar

trim quest
#

lombok is also bad

mortal hare
#

its verbose, and its clear what it does and its flexible enough for changes in the future

#

tbh ill just use record for this

trim quest
sullen marlin
#

Lombok hate? Ban

trim quest
#

:/

mortal hare
#

still waiting for java to add Pair<> into standard lib

sullen marlin
#

And Pair3, Pair4, Pair5... Pair9

mortal hare
#

have you seen collections static factory methods

#

its not as if they already do this

ivory sleet
#

I mean that’s just to optimize against varargs

echo basalt
#

static factory method my beloved

#

been messing with wacko generics

ivory sleet
mortal hare
#

i f*cking hate java collections api

#

its so dated

trim quest
mortal hare
#

why dont they do refactor just like they did with nio under different package

#

with different interface contracts like with splitting immutability

trim quest
#

Java Collection Framework -> Mutable
Java Stream API -> Immutable (OOPFP)

ivory sleet
#

give java 100 years and it might happen dovidas

wet breach
mortal hare
#

why does Iterator has remove() method by default

trim quest
mortal hare
#

you cant support enhanced for loop without implementing remove() since it depends on old wacky interface that expects all iterators to be mutable

trim quest
#

why you having problem with java i dont understand

ivory sleet
trim quest
#

i mean mutable state & immutable state is just collaborators. leaving some windows open is not gonna fail you.

#

it shouldnt

mortal hare
#

its just legacy contracts

#

java std lib is like microsoft windows - they keep painting new layers on top of rust

ivory sleet
#

I mean yea dovidas its a known issue that java “breaks against” LSP with the entire collection mutability/immutability thingy, unless you consider subtle changes in Javadocs that have gradually been added

mortal hare
#

kotlin handles std lib way better

#

they dont even expose constructors for collection types

trim quest
#

"Even Haskell supports controlled mutability with constructs like IORef and ST. Clojure has a Software Transactional Memory system. So even pure FP languages ​​leave the door ajar when it's necessary for performance or real-world modeling."

ivory sleet
#

Yea but isnt that still handled through an IO monad?

#

which makes it pure within the language still

trim quest
#

with immutability, you have to create new objects constantly. and this is one of the major problem of fully immutable languages

trim quest
#

because creating objects is not cheap

ivory sleet
#

I mean yes and no

mortal hare
#

we need compile time immutability, not runtime one

ivory sleet
trim quest
#

😄

#

wrong ?

#

for who

#

its subjective

mortal hare
#

If creating objects weren't cheap langs like java wouldnt even exist

#

that doesnt mean you should bash GC

ivory sleet
#

Haskell is so high level it doesnt have a control flow, if u specify creation of an object, it may not need underlying memory allocation just because u invoked some function or semantics that constructs an “object”

mortal hare
#

but still its not as if it takes seconds to create an object

trim quest
#

if you have ecosystem like java in other fp languages you cannot wait that performance from that languages.

ivory sleet
#

unlike java new Blah, haskell doesn’t impose object memory allocation

#

this is a very fundamental aspect of FP, there is no subjectivity here

mortal hare
#

you dont need full immutability, you generally target for immutability to support multithreaded operations, since read operations are by default thread-safe unless its values were cached in the CPU or in the registers (in which case if you care you can supply volatile keyword to fix that)

#

you just want to make immutability in a way that those threads cannot mutate at the time they're reading that

trim quest
#

when i need data i create immutable classes (records), and when i need lambdas i use Stream API. thats it for me

ivory sleet
mortal hare
ivory sleet
#

For one its a crucial aspect in functional programming that make FP programs heavily optimizable and possible to execute reasonably

trim quest
ivory sleet
mortal hare
#

if you make data immutable you dont need to synchronize codeblocks across threads since all the threads will receive the same information from the class/field

ivory sleet
#

but on a primitive level yea usually

ivory sleet
#

objectively, as said, look at haskell

trim quest
# ivory sleet Wrong again

can you explain creational design patterns intent, if objects creation is cheap. because you said its wrong

ivory sleet
#

side effects —> monads

#

You don’t need to involve no design patterns

trim quest
#

i mean creating objects creates memory leak in some languages -> more object == more leak. because manual memory mangement is hard to handle when you have tons of objects.

#

and abstraction creates less object use & creation.

ivory sleet
#

object creation does not alwaya imply that it footprints onto runtime in terms of ops, or memory allocation for that part, in procedural languages that is almost always true tho, tho severely untrue for logical or functional langs
(Ofc depends on what we define as an object)

trim quest
#

hmm

ivory sleet
#

Im not talking Java stream api fyi

wet breach
pure dagger
#

How do you save irregular areas? You cant just save from Loc1 to Loc2 cause its not cube. Any easy way to do it ?

#

I always wondered how that was made

#

Do you just save a bunch of location pairs

thorn isle
#

depends on what the area is like

#

since you mentioned area rather than volume i assume we are talking about a 2d shape

slender elbow
#

but volume is a big boy term

#

people in this server barely know trigonometry to spawn 10 particles

young knoll
#

What’s a triggernomitree?

mortal hare
#

is there any method inside bukkit api which returns Plugin's configuration file path?

#

i know that getConfig() returns plugin's directory config.yml, im just wondering if there's API way to know that

#

instead of relying on javadoc

buoyant viper
#

new File(getDataFolder(), "config.yml") xddd

mortal hare
#

i wonder if there's getConfig().getFilePath() or smth

buoyant viper
#

?jd-s

undone axleBOT
mortal hare
#

tbh it would be easy but good addition to FileConfiguration class to retrieve file path

#

it doesnt matter much since it won't change either way but its just good to enforce such constants into code

buoyant viper
#

i think it also accepts a Reader which could result in a no-file situation

#

FileConfiguration that is

mortal hare
#

well that sucks since Reader is not necessarily for files

#

bad design choice i guess

#

what can i expect from 14 yr old api

young knoll
#

That’s because it doesn’t need to be a file

#

Send yaml over http for funz

buoyant viper
#

i think a config constant also doesnt make sense since some plugins might not be configurable

#

so they too would have no file

#

or they may do config by other means than conventional config.yml

pure dagger
#

then how ?

mortal hare
#

you use Files.exist(path) to check it with nio

buoyant viper
#

yes i understand files in java

#

a file also need not actually exist with io.File either for stuff like File#exists

noble saddle
#

I have a method that successfully changes the current held item's Custom Model Data Component's Strings. However, it only works when I call it through the PlayerInteractEvent and not the PlayerSwapHeldItemsEvent, just curious why is that?

#

So I am guessing the PlayerInteractEvent sends a packet from server -> client, but is there a way to know which events send S2C packets?

sullen marlin
#

Doubt that's the reason. Probably something from your code

noble saddle
#

really? I just copy pasted the method to fire from that other event, i made sure it fired too.

echo basalt
#

welp redempt finally blocked me it only took what? 5 years?

pseudo hazel
echo basalt
#

which is what I call "storing a surface"

pure dagger
#

whatways

#

for example?

echo basalt
#

here's a really memory inefficient solution

#

store every point you need inside the cube

#

it's alright for really sparse cubes but not amazing

#

Here's another solution: store long lines

pure dagger
#

but how could you let user select that

echo basalt
#

that's a whole separate problem

pure dagger
#

;-;

#

or just in config change that

echo basalt
#

here's another solution: write a fancy algorithm that converts your points into a bunch of cuboids in a way all of the mfit

#

(gl with that one)

slender elbow
echo basalt
#

Here's another one: paletted container

#

it's basically storing your surface's points but instead of as a list of points, just a bunch of bits

#

and you just calc their position or something

#

really inefficient for sparse points but decent for something concentrated

#

there are a bunch of ways

#

some are great for disk storage but awful for cpu

#

some are great for cpu but awful for ram

#

some are average across all

pure dagger
#

do you also have mmany ways to handle user selecting the area 😭?

echo basalt
#

usually just involves worldedit and a mask

pure dagger
#

oh

#

worldedit

echo basalt
#

I did this for a prison server back in the day

#

basically fill the entire "mine" area with like glass or something

pure dagger
#

what's mask

echo basalt
#

think of it as a filter

#

or one of those baby toys with the shapes

#

that you gotta put the rectangle in the hole

#

that's basically a mask

pure dagger
#

in the square hole

echo basalt
#

only the right block fits

pure dagger
#

but what

#

what does it do exaclh

echo basalt
#

it just filters

#

if you make a mask for GLASS for example any block that is glass will pass it

#

any one that isn't gets left behind

pure dagger
#

you mean its selected?

shut field
#

how can you cleanly cancel a Player Jumping, now that they removed the Jump Boost 128 overflow thing?

echo basalt
#

can't you change the jump height with attributes?

slender elbow
#

yeah the attribute thingy

shut field
#

I saw "Jump_Strength" attribute but that is like "Horse_jump_strength" does that even work on players?

slender elbow
#

now it does

#

are you using an old version or something

shut field
#

I just never even tried using that on a player cause it specifically says horse 😆

slender elbow
#

you are soooo using an old version

shut field
#

I mean I'm on 1.21.5?

#

is it really that outdated

#

let me try to update

slender elbow
#

api version in your pom.xml/build.gradle?

shut field
#

there it iss thanks

#

had to update my version

empty dove
#

Experimenting with Client-Sided entities. Not bad

sly topaz
#

it hasn't been updated in a hot second but can probably come in handy for reference on a few things

empty dove
#

Cause I have ExecutableEvents. If I can just make a plugin that can convert normal entities to client-sided entities and vise-versa. it would be pretty neat and the possibilities would be pretty endless

sly topaz
#

tbh there's no need to make them client-side only, often times server-side entities which are hidden for most players using the entity visibility API works pretty well

#

client-side only entities are really only useful if you're like, doing custom entity tracking or the like where you don't depend on the server doing things

empty dove
#

Ah alright, That makes sense. Thanks for the insight.

tender shard
native bramble
#

is it a way to make BlockDisplay half-transparent? i was trying to add invisibility potion and add to one team player and this entity with team.setCanSeeFriendlyInvisibles(true), but BlockDisplay is not LivingEntity

young knoll
#

No

#

Afaik

pure dagger
#

can i detect players using multi accounts

#

idk if you call that like that in english but

#

coming to the server from a few accounts

grand flint
#

its just using the ip thats all u can do

#

block vpns

pure dagger
#

how to check ip ?

grand flint
pure dagger
#

is this Player#getAddress()#getHostAddress()
litebans

thorn isle
#

lol

#

i recommend querying against a few dnsbl's

#

most proxies/vpn's are blacklisted on one or more of them

hearty sparrow
#

Hello. I have been trying to listen to the ClientIntentionPacket. I have try alot of things but can't get something to work

val server = MinecraftServer.getServer().connection

        val field = ServerConnectionListener::class.java.getDeclaredField("f")
        field.isAccessible = true

        val orgininalInit: List<ChannelFuture> = field.get(server) as List<ChannelFuture>

        orgininalInit.firstOrNull()?.channel()?.pipeline()?.addFirst(UUID.randomUUID().toString(), object : ChannelDuplexHandler() {
            override fun channelRead(ctx: ChannelHandlerContext?, msg: Any?) {
                if (msg is ClientIntentionPacket) {
                    println("WOW")
                }
                super.channelRead(ctx, msg)
            }

            override fun write(
                ctx: ChannelHandlerContext?,
                msg: Any?,
                promise: ChannelPromise?
            ) {
                if (msg is ClientIntentionPacket) {
                    println("WOW")
                }
                super.write(ctx, msg, promise)
            }
        })

        field.set(server, orgininalInit)

Can someone have a look and see what i might be doing wrong?

thorn isle
#

Try doing it in java

hearty sparrow
thorn isle
#

It changes me being able to help

hearty sparrow
#

fine give me 5 min and i will change the code to java even thing its not that hard to read

hearty sparrow
# thorn isle It changes me being able to help
public void test() throws NoSuchFieldException, IllegalAccessException {
        ServerConnectionListener server = MinecraftServer.getServer().getConnection();

        Field field = ServerConnectionListener.class.getDeclaredField("f");
        field.setAccessible(true);

        List<ChannelFuture> orginalInit = (List<ChannelFuture>) field.get(server);
        
        orginalInit.get(0).channel().pipeline().addFirst(UUID.randomUUID().toString(), new ChannelDuplexHandler() {
            @Override
            public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) throws Exception {
                if (msg instanceof ClientIntentionPacket) {
                    System.out.println("WOW" + msg);
                }
                super.write(ctx, msg, promise);
            }

            @Override
            public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
                if (msg instanceof ClientIntentionPacket) {
                    System.out.println("WOW" + msg);
                }
                super.channelRead(ctx, msg);
            }
        });

        field.set(server, orginalInit);
    }
thorn isle
#

let me see if i can find my old project where i injected into the netty pipeline

#

though i don't think doing that is necessary; iirc protocollib should be able to intercept status/pre-login packets as well

#

there just won't be a player object, it's some protoplayer or some shit

sly topaz
#

you'll probably have to inject into the channel initializer considering it is a handshake packet

hearty sparrow
#

SOrry but i won't be using protocolib 😅

sly topaz
#

is there a reason you aren't using protocollib or packetevents other than just trying to do it by yourself

#

I'll tell you that doing this kind of thing by yourself becomes annoying if it is a public plugin, given setups that use viaversion/geyser stuff might need some more careful handling

#

you're also just using a random uuid as the handler which isn't optimal

hearty sparrow
#

Because i enjoying doing it myself. I learn more from doing it myself. I don't want to use depend on other peoples libs. I don't want to install unneed plugins on the server

sly topaz
#

PacketEvents is a library you can shade

hearty sparrow
hearty sparrow
#

I want to get something working before adding it fully

thorn isle
#

doesn't look like i have it on this machine

hearty sparrow
#

Thanks anyways for looking. If you had a quick look does anything stand out?

thorn isle
#

it looks fine at a glance but depending on where you are in the pipeline you might not be getting passed a constructed packet object but a bytebuf or something instead; also maybe check if you're seeing any other packets going through, just not the intent packet

hearty sparrow
hearty sparrow
sly topaz
#

what it does is take the connection list in ServerConnectionListener and replace it with InjectedList which is a list which injects their handler whenever a channel is added

#

the issue with yours is probably just the fact that by the time you read it, the channel was already added to the connection list, you need to inject into the ChannelInitializer in order to be able to inject channels as they join or do what PacketEvents does and just replace the list with one that will inject the channels as they are added to the list

#

I assume there's a reason PacketEvents does it that way, might be something around injecting into the ChannelInitializer being flaky but I wouldn't know

#

I know in Paper it is easier since they have an internal API to do this

potent crescent
#

guys can i chnage jar plugin to src? Or this is impossible

sly topaz
potent crescent
#

alr

sly topaz
#

it isn't impossible, but it is a lossy process

potent crescent
#

why

thorn isle
#

that's just how it works

sly topaz
#

when you compile a program, the compiler will strip things like parameter names, comments and mangle some syntax sugar in the code (i.e. converting lambdas into anonymous classes)

potent crescent
#

So there is no point in decompile it

sly topaz
#

given a good decompiler, the last one isn't too bad but it still ends up looking funny if you aren't used to reading decompiled code

slender elbow
#

huh

#

lambdas aren't anon classes

#

not the case in point

thorn isle
#

if you want decompiled sources (or any sources) you'll have to decompile it

#

and yeah it's generally the decompiler that sort of guesstimates the lambda into an anonymous class, as of java 9 or something they actually compile into distinct bytecode from anonymous classes

potent crescent
#

I've scrapped the decompile plugin idea. Lol

thorn isle
#

besides the point, though; point is that there's guesswork involved, because compilation intentionally "boils down" a lot of the things going on in the source code to get an optimal and concise representation of it in bytecode

potent crescent
#

i think if i make a new plugin its better 😂

thorn isle
#

depends a bit on the scope but if it's a small-mediumish plugin, probably yeah

#

and writing one from scratch is better practice anyway

potent crescent
#

All this happened because I took care of the jar file and deleted the src 😁

lean pumice
#

(player is not op)
why member can destory and place block?

pure dagger
topaz cape
#

can we inject into brigadier in bungeecord?

#

the whole tab completion for me is kinda not working tbh

#

idk if using brigadier would make it better

potent crescent
#

You can give priority to this area.

potent crescent
lean pumice
lean pumice
potent crescent
pure dagger
#

can you do something lke
Map<K, EntrySet<K,V>>

potent crescent
# lean pumice

As far as I know Owner can normally destory and place block

trim quest
kind hatch
undone axleBOT
#

Can't send images? That's because you're not verified! Use !verify to complete verification.
Alternatively, you can upload screenshots to any image hosting site and share the link.

Here's some screenshot utilities that you can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org

echo basalt
hasty rover
#

guys i have an question.... should i make an vault similar api? called VaultNext?

echo basalt
#

No

umbral ridge
#

sure you can make it yourself

#

like the original author did

#

it just takes time. there is always a better way to do things

echo basalt
#

The main point of Vault is that it's universal

umbral ridge
#

yea

echo basalt
#

Making a similar idea will not get any adoption because vault already exists

hasty rover
#

i want an higher performance version and more modern thats why

umbral ridge
#

yeah but if you want something for yourself. something unique. that you made.. then just do it xD

#

youll learn a lot.. and maybe redo a plugin a few times.. then itll be fine

echo basalt
#

Higher performance is wild

#

Vault just provides a dozen interfaces

hasty rover
#

Vault is a bit more bloated tho i mean it still supports dead plugins/apis

echo basalt
#

The plugins hook into vault it's not the other way around

torn shuttle
#

I want to change the world but also I don't know anything about the world

#

type energy

echo basalt
#

You can start by going outside

torn shuttle
#

you need to learn how to type faster if you want to place a zinger like that on me boy

echo basalt
#

On my phone rn

torn shuttle
#

on your way to the pizza place

echo basalt
#

Was drinking some compal from the fridge

torn shuttle
#

ah yes better get that 200cal in a bottle

echo basalt
#

I drank about 18 cal worth

torn shuttle
#

and then you did that 100 more times

#

man actually I can barely make fun of you right now, I'm back up to 95kg

echo basalt
#

And I'm back at the gym

torn shuttle
#

and I never left

echo basalt
#

Just had a long break

torn shuttle
#

it stops being a long break after a year

thorn isle
#

it's exactly what you want

#

it's "more modern" and "more performant"

#

in extreme double quotes

#

a reinvention of the wheel that nobody needed or wanted and only a few tangentially related plugins like towny support because vault already exists

hasty rover
#

ye i thought about it ngl the idea was shit

thorn isle
#

that said if you have a heavily customized server, i.e. you either maintain or have forks of most of your plugins in-house, a custom eco service can be handy

#

vault does have some multi-server related problems and while the offline player/non-player account support is technically there, they're all second class citizens

hasty rover
#

i just wanted to make an better economy api since it does not have the givemoney function.

thorn isle
#

that's not within vault's purview

#

that'd be the responsibility of the eco plugin that actually implements the economy service

hasty rover
#

i know but since they added deposit and withdraw it would still be handy

thorn isle
#

those exist mostly as a way to allow the implementation to make those atomic

#

that said i for sure would like there to be an api method in there that an implementation could override to implement atomic transactions between two accounts

#

but even then deposit is very rarely expected to fail so just doing withdraw first and deposit after is "atomic" enough in 90% of cases

torn shuttle
#

hey is version api access on spigot down right now

#

it's throwing 403

#

or did it change or something

#

it's been down for like a couple of hours I think

#

ok now mojang auth is down

#

the universe does not want me to work on plugins right now

thorn isle
#

i'm starting to regret implementing mojang auth on my cracked server

#

a good 40% of the players use it to skip authme and get locked out whenever this happens

potent crescent
#

How to delete my plugin in spigotmc web?

worthy yarrow
#

Report it and request it to be removed

worthy yarrow
potent crescent
#

Is the reason I want a plugin to be private enough?

worthy yarrow
thorn isle
#

i mean atomic as in uh

#

suppose a transaction between accounts A and B where A sends money to B

#

this is atomic if no other operation apart from that transaction can take place in between money being removed from A and being deposited in B

torn shuttle
#

we like having fun around here

worthy yarrow
#

Yeesh internet just took a shit

thorn isle
#

as-is vault makes this impossible because in order to ensure it's atomic, you need to do it in a single api call; but vault doesn't have a "from a move to b" api method, only "take from a" and "add to b"

worthy yarrow
#
@Override
    public boolean add(BigDecimal amount) {
        this.balance = this.balance.add(amount);
        return true;
    }

    @Override
    public boolean subtract(BigDecimal amount) {
        BigDecimal newBalance = this.balance.subtract(amount);
        if (newBalance.compareTo(BigDecimal.ZERO) < 0) {
            return false;
        }
        this.balance = newBalance;
        return true;
    }```
#

I'm just reassigning the object held in the balance object

torn shuttle
#

so you're saying my vault rewrite should use the blockchain then

#

that gives me an idea

potent crescent
#

I thought I couldn't delete it😂

#

How long does it take to delete it?

worthy yarrow
worthy yarrow
thorn isle
#

the check-set are atomic here, but as a whole the get-check-set isn't

#

in a threaded environment you're liable to read an outdated balance twice, subtract from it two different amounts and set twice, each overwriting the result of the other

#

e.g. if two threads subtract(50) and subtract(100) concurrently, the result will either be a subtraction of 50, 100, or 150, depending on a race

#

if you're certain this is only ever used from a single thread, it's fine, but otherwise i'd recommend doing compare-and-set or making the method(s) synchronized

worthy yarrow
#

Hmm yeah, I'm validating this after the fact the modification has occurred with the transaction object, should probably do this beforehand

torn shuttle
#

one of my favorite hobbies is making complex maps that ensure some things only happen once, then forgetting to register anything to them

#

I love doing it

#

I do it all day long every day

worthy yarrow
#

I mean to be fair my transaction objects are mainly used for audits

#

But the validation comes in when I compare balance objects against previous transactions that occurred within an account

sly topaz
#

I know the java devs already fixed that bug with virtual threads but I still stay away from them lol

thorn isle
#

to make it thread safe without synchronization you can


    private final AtomicReference<BigDecimal> balance;

    @Override
    public boolean subtract(BigDecimal amount) {
    
        BigDecimal witness = this.balance.getPlain();
        BigDecimal newBalance;
        
        do {
        
            newBalance = this.balance.subtract(amount);
            if (newBalance.compareTo(BigDecimal.ZERO) < 0) {
                return false;
            }
        
        } while (witness != (witness = this.balance.compareAndExchange(witness, newBalance)));

        return true;
    }
#

same with add, except without a limit check

worthy yarrow
#

right

#

https://github.com/NormalManV2/NormalAPI/blob/master/src/main/java/org/normal/common/java/economy/BankImpl.java

I'm wondering if it's a flaw to hold accounts under the same bank object, used as a central runtime manager for related operations... Though I've been told more people would rather this be the case than handling a bank per player... Accounts are separated based on currency type so honestly I'm not sure. Central manager is probably the way to go now that I'm actually typing this out kek

thorn isle
#

uh why it it a list

worthy yarrow
#

No reason to have a bank per player when accounts are already typed by different currency types

#

No clue honestly

#

I probably was just writing fast

#

Haven't actually touched this project in a while, but since you brought up that eco stuff I was intrigued lol

thorn isle
#

consider Map<UUID, Map<CurrencyType, Account>> or one of those fancy table classes from google collections

worthy yarrow
thorn isle
#

well i mean right now in Bank to get an account you have to manually loop over every account in the bank and one by one check if it has the right ownerId and currencyType

#

because you're storing them in a list

worthy yarrow
#

Yeah that's fair

thorn isle
#

not only is this inefficient (O(n) lookup time instead of O(1)), it makes it possible for there to be duplicate accounts with the same ownerId and currencyType

#

storing them in a map solves both problems

worthy yarrow
#

You are absolutely correct

thorn isle
#

apart from that, you're maintaining a ledger of transactions, which is nice

thorn isle
worthy yarrow
#

Yeah, like I said earlier, transactions are mainly used for auditing and a bit of validation but that validation of the transaction was meant to happen after the fact a modification to the balance has occurred so that's flawed

#

Modifications to the balance should be saved until all the validations have cleared...

#

QOL enhancement: Audit Log UI's for staff/bank managers depending on the use case... I was thinking about writing in some sub module features that use the eco to make like a banker sim kek

thorn isle
#

one of the reasons i ditched vault was precisely proper audit log/transaction ledger support

ivory sleet
#

The api is so goofy

worthy yarrow
#

My whole thing when writing this was to make it as user friendly as possible

ivory sleet
#

Too many overloaded methods imo

thorn isle
#

magmaman was joking about making the eco service use a blockchain but in reality a transaction ledger is one of the most robust and reliable methods of maintaining an eco database

worthy yarrow
#

Considering database implementation, it'd be cool to do what luckperms did and make a web ui

#

For auditing more so than anything else

#

I feel like in game UI's would be enough but it'd be a cool "perk" if you will

thorn isle
#

the new dialog ui shit would probably fit the bill pretty nicely

worthy yarrow
#

Forgot about all that, still have to get around with messing with it

thorn isle
#

i'll eventually get to it as well, but currently i'm in the process of mustering my courage to peek at all my nms projects to see how much of them has exploded since 1.21.4

#

definitely will be useful for many things

worthy yarrow
thorn isle
#

we'll see 🤡

worthy yarrow
#

5 yr minimum for sure

thorn isle
#

it's been fairly steady cruising recently but the item component update was a bit rough

#

hopefully paper devs haven't completely overhauled userdev again

worthy yarrow
#

I thought that was their specialty kek

#

Man I love talking shit about paper

#

Hmm I'm wondering if I shouldn't do 2 transaction objects, one for accounts and one for the bank, account transaction would hold the modification details where as the bank transaction would hold references to the account, type, description, etc

echo basalt
#

and string hashes? bruh

trim quest
#

how can i fetch one of those x,y,z

#

im confused

#

i assume that this is Map<String, List<Integer>>

#

or List<List<Integer>>

worldly ingot
#

List<Map<String, Object>>

#

I think there's a getMapList() if I'm remembering correctly?

torn shuttle
worldly ingot
torn shuttle
#

I always put my class listeners in an inner public static class to the class it's made for

worldly ingot
#

The Map key is generic too but it's always a string afaik

#

Value could be anything

#

In the case above they would be Integers, but you never know. User could enter shit data

torn shuttle
#

smh this man doesn't even know how to write static classes for event listeners inside of other classes

#

he has yet to master the forbidden jutsu

trim quest
#

i guess this is more reasonable what do you think ? @worldly ingot

worldly ingot
#

That's up to you. In that case it's a List<List<Object>>

trim quest
#

i mean List<List<Integer>>

torn shuttle
#

oh shit nvidia is the first to the 4 trillion evaluation

worldly ingot
#

Yeah, but again, any type. So <?>

trim quest
#

ok i understand

torn shuttle
#

man this thing is going to crash hard

worldly ingot
#

I personally prefer the explicit nature of x/y/z keys, but the way you format it is preference

#

The - [] is probably easier to format for end users

torn shuttle
#

maplist my beloved

#

what a loathesome format to manually parse

worldly ingot
#

It is really ass, yeah

#

It's useful, it just looks horrendous

torn shuttle
#

yes

#

I hate how I have to use it

#

sometimes I regret not just doing json

#

but then I remember that I also hate json

#

and all is right with the world

#

is anyone else feeling like ai has kinda stagnated for dev work

#

I feel like there hasn't really been any meaningful update since sonnet 3.7 in february

#

and that's just when they started doing reasoning models

thorn isle
#

idk i still use gpt-4.1 mini or deepseek r1 for most of my coding assistant things and they perform well enough