#help-development

1 messages ยท Page 1335 of 1

tender shard
#

that's also total garbage but there's nothing better

sly topaz
#

I do wonder how hard it would be to make a CoreProtect alternative that only supports latest

tender shard
#

I mean... supporting 2-3 older verions is totally reasonable

#

but everybody who tries to do "1.8 - latest" is just nuts

sly topaz
#

the issue with supporting more versions is that API shenanigans aside, the caveats you have to watch out also change so you end up doing a lot of debugging

vagrant stratus
#

Why exactly is PS garbage though?

tender shard
#

our own fork of PlotSquared has 31 changed files and over thousand lines of codes changed, but keeping it up to date is no problem because plotsquared itself never changes anyway, all they ever do is update dependencies

#

plotsquared is effectively dead. Well not dead, but they won't ever change a thing anymore

sly topaz
#

I mean, being in maintenance status isn't bad

vagrant stratus
#

I mean, it doesn't really need changes tbf

sly topaz
#

if anything it makes it easier to fork

#

you don't have to keep up with upstream changes for your features

vagrant stratus
#

As long as it works, there's no real reason to make an alternative

tender shard
#

same as HuskSync

sly topaz
#

plot servers are not that popular anymore so I guess there's also little incentive to keep improving the design anyway

tender shard
#

the HuskSync author relies on people like me to fix their shit

#

but at least he merges PRs from time to time

sly topaz
#

what was HuskSync about, sharing inventories across a network?

tender shard
sly topaz
#

I see, I guess that's a must for multi-instance SMPs

vagrant stratus
tender shard
timid jewel
#

Hi, I need help creating a boss. I want to create custom rewards, such as executing a command when the boss dies. Ideally, when the boss dies, it should give a reward to all players who damaged it. If that's not possible, I'd like it to give that same reward to players within a 100-block radius. For example, when the boss is killed, all players should receive 100,000. Is that possible?

sly topaz
#

it is possible, just not sure what a "boss" entails

vagrant stratus
#

I already had plans for recreating other plugins, but eh. we'll see what i actually get around to doing lol

tender shard
sly topaz
#

if it is just a buffed vanilla mob, then it should be easy

#

if it is more of a custom thing, you'd be looking in the direction of MythicMobs/ModelEngine as much as I hate it

timid jewel
#

I'm using mythicmobs premium

tender shard
#

are you asking about mythicmob stuff, or are you coding a plugin yourself?

#

If you're not coding, head over to mythicmob's discord please

timid jewel
#

I'm not that good at programming; I've only managed to make this boss like this, but when you kill him, he doesn't give any reward:

HyperBoss:
Type: WITHER_SKELETON
Display: '&6Skeleton King'
Health: 500
Damage: 10
Options:
AlwaysShowName: true
PreventOtherDrops: true

Skills:
- onDeath:
- delay 1
- consolecommand{c="eco give %player% 500000"} ~onDamagers true
- message{msg="&aยกHas recibido &e500.000$ &apor participar en la muerte del Skeleton King!"} ~onDamagers true

tender shard
#

you should head over to Mythic's discord

timid jewel
tender shard
sly topaz
#

we don't really have much knowledge on the specifics of mythicmobs, so we can't really help you with it. That's all

timid jewel
sly topaz
#

it should be in their site

timid jewel
timid jewel
tender shard
#

np

vagrant stratus
#

Speaking of replacing stuff. I've wanted to do my own world editing plugin still, just haven't gotten around to it lmfao

sly topaz
#

world editing as in something like Axiom/WorldEdit?

#

or more like worldgen

vagrant stratus
#

ye, but less poorly coded & more suited towards how everything I'm doing is coded lol

sly topaz
#

I think people are vastly content with Axiom, you should give it a go

#

Moulberry did an amazing job with it

tender shard
#

I only heard about Axiom like a few days ago

vagrant stratus
#

ugh gradle. no thanks since I'd be forking it lol

tender shard
#

anyway, I doubt that optic fusion could make a better worldedit

sly topaz
#

I mean, you don't have to build it to use it lol

vagrant stratus
#

Aye, private changes

sly topaz
#

the breaks with optifine badge is hilarious

tender shard
sly topaz
#

I think most mods that do anything with rendering do, fuck optifine

tender shard
#

optifine is total shit and deserves to die

#

optifine is a bad, closed source version of sodium, isnt it?

#

does it do anything better than sodium + iris?

#

If so, what exactly?

smoky anchor
#

Many resourcepack features
custom items, custom entities

vagrant stratus
sly topaz
#

I think custom items have been vastly covered by vanilla at this point

tender shard
sly topaz
#

custom armor models even

smoky anchor
sly topaz
#

only redeeming point is custom entity models but that's about it

tender shard
#

so it's shit

sly topaz
vagrant stratus
tender shard
vagrant stratus
#

I've been meaning to look into those since they seem interesting, but i'd really only be able to mess with datapacks lol

sly topaz
#

datapacks are cool, aside from functions which kill server performance due to people poorly using target selectors

tender shard
#

I mean... I'm working for a server that got bedrock + java crossplay and even we manage to get custom entities and textures done, for both platforms. So why would optifine exist lmao

#

I agree that datapacks are shit

vagrant stratus
sly topaz
#

yeah, I only ever used it for worldgen

tender shard
#

same

#

and only for pregenerated worlds

vagrant stratus
#

I mean, i do have a weightedrandom which more or less replaces loottables but ehhhhhh

Minecraft's already got the datapack right there so I'd rather use that

sly topaz
#

I can't really blame datapack makers though, they just try to do the most out of a limited DSL

tender shard
#

I'll give a quick example of datapack insanity in a few minutes:

vagrant stratus
#

Guess i do have the benefit of being able to make it better though ๐Ÿค”

#

Question is if i hate myself enough to rip out the entire data-pack system and replace it with my own data-driven library or merge the two lol

tender shard
#

datapack to disable elytras in end:

A function that runs every tick and scans every entity in the world.

#

proper solution: a tiny plugin that manipulates world gen directly

#

if mojang would have been smart, they would have added lua support instead of their shitty "datapack functions"

sly topaz
#

I'd have preferred tcl ๐Ÿ˜Ž

tender shard
#

why not REXX

ivory sleet
#

skript!

sullen marlin
#

perl

vagrant stratus
#

assembly

sullen marlin
#

java

tender shard
#

if only md5 wouldnt hate kotlin

#

it has so many nice things

#

like data classes, or extension functions

#

or reifed inline functions

#

null safety

#

less boilerplate

#

default function parameters

#

shall I go on?

#

oh and operator overloading

#

in kotlin you can e.g. do dur1 + dur2 where they are both regular java Duration objects

#

oh and kotlin differentiates by default between mutable and immutable collections

worldly ingot
#

Sometimes I like the boilerplate of Java

tender shard
#

how so?

worldly ingot
#

But it does really need default parameter values lol

tender shard
worldly ingot
#

The boilerplate lets me know exactly what's happening just by looking at it. There's no hidden code ๐Ÿ™‚

vagrant stratus
worldly ingot
#

It's why I don't fuck with Lombok

tender shard
#

you can also override equals and hashcode in kotlin so kotlin really doesnt take anything away from you

#

but yeah lombok is weird, at best

#

I used to like lombok but nowadays I also think it's a weird bullshit hack that tries to make java behave like kotlin

tender shard
#

it's not like a regular getter without anything except "return X" would be any magic

#

once I forced myself to use kotlin for a week, I have literally NEVER looked back a single time to regular java

#

and I really hated kotlin at first, so one cannot say that I was preoccupied or sth lol

#

kotlin is like a piano keyboard where you got ABCDEFG and you press the key, and it makes the sound.

java is like a piano keyboard where you got ABCDEFG but you first have to wire the A key to they three A strings that actually make the sound and watch out that it only happens synced, etc, and then repeat that for B-G

vagrant stratus
#

I mean, I've been programming in Java since 2019 w/o any major issues but ๐Ÿคทโ€โ™‚๏ธ

tender shard
#

I've also been drinking since 2008, doesn't mean it's good

vagrant stratus
#

Good enough for me to not think about switching lol

tender shard
#

you people just hate change

vagrant stratus
#

Nope, I just don't see the point in spending time learning something new if i don't have too

tender shard
#

learning it takes 2 days

#

at most

vagrant stratus
#

2 days which can be spent doing something productive, instead of learning a new lang

tender shard
#

2 days which will spare you 14 weeks in the future long term

#

unless you die next week

vagrant stratus
#

Meh. Again, i auto gen a lot of the code so it's not really a concern

#

alt+enter or whatever FTW

tender shard
#

640kb will be enough for everyone

vagrant stratus
#

Irrelevant to me

tender shard
#

you do you. I'd never go back from kt to java

vagrant stratus
#

if i have a digital book on kotlin, then I'll just do enough projects to finish the book.
Same with rust.

tender shard
#

lets not talk about rust

#

I hate it

vagrant stratus
#

And i hate both lol

tender shard
#

fun fact:

#

I recently compiled a rust project:

#

cargo build -> 500mb

#

cargo build --release -> 25mb

#

oh and both took about 20 minutes

vagrant stratus
#

eh. i found the time to finish annoying, but i just did other things in the meantime in other languages so it didn't really matter in the end lol

#

300-ish projects between C++, Java, Python, C, C#, JS, PHP, and a few other misc things is more than enough to keep me busy ๐Ÿ˜Ž

echo basalt
#

I won't speak ill of someone's religion

dry forum
#

https://pastebin.com/gAjh0aUF

code works for the most part, but when i activate the inputs in this order:

input 1
input 2
(XAND sign activates as it should)
input 2 (a 2nd input sign for channel 2)

then deactivate input 2, the XAND sign gets stuck on

echo basalt
#

sounds like an eventpriority problem to me

dry forum
#

wdym

echo basalt
#

both your listeners are running on the same priority

#

That can cause inconsistencies between who gets triggered first

#

just a lucky guess go figure

#

I've had cursed issues arise where restarting the server would fix them

#

restarting again would resurface

dry forum
#

but im only powering off 1 thing so only 1 event is firing

echo basalt
#

joeshrug debug it

zealous scroll
#

is there a way to disable item merge without changing the itemstack's data? if a player picks them up i want them to stack but I dont want the item entity to merge

echo basalt
#

There's an event for that

#

Gives you both the source and target items, from there just get the itemstack and compare

zealous scroll
#

i see, thanks

wooden wyvern
#

Could anyone help me set up my intellij?

lilac dagger
#

Hmm what do you struggle with?

#

Download intellij for windows and to set the jdk you could let intellij download a jdk

wooden wyvern
#

Im kinda struggling with it parsing my code

#

it doesnt have the added notations from spigot/paper

#

like the onEnable void or the getPlayer events

lilac dagger
#

Add spigot api as a dependency in your maven's pom

cloud perch
#

Use the "Minecraft Development" plugin

#

It does all that for you

wooden wyvern
#

Oh okay tysm

chrome beacon
#

?services

undone axleBOT
wise nest
young knoll
#

Then DM someone on the forums

#

And donโ€™t post in every channel

chrome beacon
wise nest
dry forum
#

if i have signs that do stuff when powered by redstone, and i activate them at the same time, it breaks them:

i have 2 input signs x1, x2, that go into an and gate sign, and the and gate sign doesnt activate since x1 and x2 happen at the same time, but it works when its not at the same time, whats the best way to fix this?

chrome beacon
#

Sounds like somethings off with how you're checking the sign on state

#

but we don't really have any information to help you

dry forum
#

ill send the code 1s

quaint basin
#

Has the player already been teleported in PlayerJoinEvent? Or if I use player#teleport in playerjoinevent, will the player only be teleported once?

#

I would like to teleport the player upon entry, but I don't want to teleport them to a new loc and then overwrite that (as this would take longer for the player to actually be teleported)

chrome beacon
#

Has the player already been teleported
Where would they be teleported exactly

#

If nothing you installed teleports them then no they won't teleport

quaint basin
chrome beacon
#

?

quaint basin
#

The problem is that, for example, if I want to override another teleport plugin that's in PlayerJoinEvent, I can always set the priority to HIGHEST, for example. The issue is that it takes longer for the client because they are teleported to to different locations but yea nothing to do

chrome beacon
#

Don't go overriding other peoples plugins

#

That is not your concern

#

Haven't we already had that discussion

quaint basin
chrome beacon
#

must have been someone else then ๐Ÿคทโ€โ™‚๏ธ

slender elbow
#

you aren't meant to teleport in the join event anyway

#

set the spawn location in the spawn location event

quaint basin
#

Is there a timeout in player#sendPluginMessage when redirecting a player to another server using this method?

sullen marlin
#

timeout of what

mortal vortex
#

what are you asking

#

The only timeout I can think of is the one at bungeecords end, like server_connect_timeout

quaint basin
# sullen marlin timeout of what

https://pastes.dev/ti12rZdouv If this method is called but the player is not teleported to the server for some reason, I would like to remove the lock (I remove the lock in the playerjoinevent for the server through which the server should be redirected, but this event may never be called for some reason). Therefore, I would like to set the TTL in the RMap (teleportLockStore) with a safe value. Let's say I set the TTL to 15 seconds. It's possible that player#sendPluginMessage redirects the player in 16 seconds. I don't know how sendPluginMessage works and I don't know if taking that long is possible

sullen marlin
#

not spigot code; not a minimum reproducible example, have you actually checked that async mess is doing what you want

quaint basin
quaint basin
mortal vortex
#

Maybe I misunderstand you

#

whats the concern? Are you worried about the time between sendPluginMessage being called on the Spigot/Paper side and the proxy actually receiving and acting on it??

#

#sendPluginMessage queues a packet for the proxy on the next tick, once the proxy receives it, the redirect is nearly instant. The proxy-side handling of a Connect message is simple, there's no queuing, retry logic, or anything else that could stretch that into a 16-second delay.

#

16-second delay would only realistically happen if the server was not ticking (in which case nothing is going to work anyways)

quaint basin
#

If the method had a TTL I would use it; but if it doesn't, that's fine too

random grove
#

Is MockBukkit recommended by developers?

mortal vortex
#

But, you need to understand that MockBukkit is a reimplementation of the API in a simulated envrionment. Meaning not all functions are 1:1 mapped

#

But MockBukkit dropped Spigot as well so its a Paper thing now

ivory sleet
#

MockBukkit is useful, but only if u really need that kind of simulated testing environment since it always needs to spin up a server instance. A lot of the times, you can get away with unit testing ur individual classes + QA testing on integration and system level.

umbral ridge
thorn isle
#

It's just a collection of paper thin wrappers implementing the most basic possible api methods in the most basic possible way

buoyant viper
#

Paper?

#

?whereami

quaint basin
#

I currently only use 'Executors.newVirtualThreadPerTaskExecutor()' to schedule tasks for the database, but I've seen that this can be bad because it can result in 1000 threads waiting for the Hikari connection pool to become free. Therefore, should I use a semaphore?

mortal hare
#

i personally dont mock

mortal hare
#

i just extract the parts which are part of my domain and only unit test those parts, since bukkit api implementations would get tested either way

thorn isle
#

which is fine, virtual threads are cheap and are expected to be numerous

quaint basin
mortal hare
#

isnt virtual thread essentially just an yieldable runnable on the main thread

thorn isle
#

using a semaphore will just make the 1000 virtual threads wait for a free semaphore ticket

mortal hare
#

something like javascripts async function

thorn isle
#

yes, having 1000 virtual threads is fine, as long as they are blocking or in other words waiting, not running

#

the semaphore that was mentioned earlier is to prevent all 1000 from running at the same time, by forcing all but at most n to be blocking for the semaphore instead of running

#

but as was said before already, hikari already does that by forcing them to wait for available db connections, so using a semaphore is redundant

quaint basin
#

I see

quaint basin
mortal hare
#

so its async function

#

async io

quaint basin
#

It is possible to create multiple virtual threads but OS threads no

#

I mean that virtual threads allow you to create much more

quaint basin
#

But async is different from another thread

mortal hare
#

async function in js is basically a function which can yield to event queue when something blocks its return (like db call) so that other code can run at that time on the same thread

quaint basin
#

From what I've seen, this function doesn't execute in another thread, but rather in the same thread; the only thing it does is execute asynchronously

mortal hare
#

yea that's what matches to async functions in js

quaint basin
#

So this function is completely different from the proposal of virtual threads

#

ig

mortal hare
#

ig js async event loop model differs from virtual thread only in that JVM maintains thread pool and doesnt use the main thread just like js does

#

but personally i dislike the idea of threads in a first place. process based concurrency has less bugs, are by design more modular, allows for better scalability from external tools like kubernetes, and easier to reason about overall

mortal hare
ivory sleet
mortal hare
mortal hare
#
public User authenticate(final Username username, final Password password, final Hash passwordHash) {
  // do logic here
}

instead of

public User authenticate(final Username username, final Password password) {
  this.repository.getHashByUsername(username);
  ///
}
#

leave the remaining part to the integration tests

ivory sleet
#

at some point you will have to depend on code that's not urs, let's say a database class that directly talks to the database

mortal hare
#

infrastructure should be integration tested

#

not mocked

ivory sleet
#

yes but perhaps you want to test whatever unit that is interacting with said database to work correctly

mortal hare
#

that's literally the definition of integration test

ivory sleet
#

no not really

mortal hare
#

Integration testing is a software testing approach that verifies how well different components, modules, or services work together after being combined.

ivory sleet
#

we're not testing the actual database

#

its one unit we're testing still

#

but that unit in prod would depend on the database, we want to isolate non incorrectness on said unit

#

not when said unit works w the prod database

#

its a unit test

#

if u have any real writing tests experience and not just theory in ur head, this is so obvious

mortal hare
#

you can just use inmemory database for this. I get what you mean, but imo its not worth to test couple lines of code in isolated manner when they only test the wiring but not the actual logic, i would just do integration test with inmemory database if i were so desperate for that

ivory sleet
#

wdym by an in memory database

#

not all code is going to strictly rely on some relational database if that's what u think

#

and sometimes you actually want to avoid decoupling too much because you're working with concurrency where keeping the code logic itself in one place is a necessity for readability

mortal hare
#

its just matter of taste, you can mock it and keep the components coupled, or you can decouple and dont care about wiring or if you care do a separate tests for this

ivory sleet
#

but also if u're using an in-memory database, you still haven't isolated that said unit

#

u're still on integration level

mortal hare
#

there's literally little to no gain from testing wiring

#

unless you couple your wiring with domain code

#

then you're forced to mock it

#

what i mean is that if you decouple good enough, the wiring part of that service function becomes miniscule enough to not be tested or be tested with integration tests, since all other logic is being unit tested, like parsing, hashing, validation. Only branching is what's left to be tested in that case

orchid gazelle
#

it's crazy how writing a fun project is like 50% actually writing code and 50% debugging, while writing professional enterprise backends seems like 5% writing code, 50% debugging and 45% writing tests

ivory sleet
#

as said already, not everything is going to look like a nice tree of hieachical components of different levels where you perfectly decouple everything, you're just talking nonsensical theory

as said already, some units may use external services directly and you have no control over it, sure you can decouple it into 25 different layers but ur fucking concurrency infrastructure will be a blood and hell nightmare to keep up with

a big part of unit testing is that we want test a unit in complete isolation because we want to be able with great certainty to assert the unit is not behaving incorrectly on its own, that is not useless at all, that is in fact very useful and there is a reason a lot of companies used to want tdd practice etc

and you're under the assumption we're using a simple in mem database, what if have a complex service that talks to a four layered cache system with a vectorized database, all the sudding testing the unit that directly invoked said database can become interesting, such that you can assert that unit is not causing any bugs, mind you this code base could be millions of lines

ivory sleet
#

like sure there might not be much other logic

mortal hare
# thorn isle snake oil

tell me how many conccurency bugs plugins had just because they called bukkit api from seperate thread

thorn isle
#

i am currently holding you personally responsible for my browser having 250 child processes and using like 60gb of memory

#

pipe bombs will be mailed shortly

mortal hare
thorn isle
#

redis is ๐Ÿšฎ

orchid gazelle
#

redis is awesome

#

shush

#

especially redis pub/sub ๐ŸŒž

thorn isle
#

most lacklustre messaging system ever created

#

redis is like a combination of halfbaked implementations of 5 other projects that do them well

orchid gazelle
#

oh yeah so that's the reason why the whole internet is based on redis, because it's halfbaked

thorn isle
#

the whole internet is also based on a whole lot of other pieces of garbage, it wouldn't be so shit otherwise

mortal hare
#

process based concurrency is also the reason php still exists

ivory sleet
#

I mean for an in mem database its good

#

it has atomicity contracts and is reliably fast

#

but like

thorn isle
#

it serves as an okay cache layer

ivory sleet
#

the pubsub is another story

thorn isle
#

but it's not a good enough database to be a database on its own, and it's not a good enough pubsub system to stand as a proper cache coherency system on its own

#

it's a spork

mortal hare
#

well i dont treat it as db

#

its just a fancy distributed hashmap

thorn isle
#

for caching, there are much more sophisticated cache coherency and control systems

orchid gazelle
#

of course there are

thorn isle
#

i'm not sure at all why redis in particular caught on

ivory sleet
orchid gazelle
#

but software is not always written by 5000 highly-experienced devs that began writing assembly when they were 5. Sometimes you just need decent stable software solutions that just work

#

for personal projects

thorn isle
orchid gazelle
#

and that's why I like redis

mortal hare
ivory sleet
thorn isle
#

well... process as in an os process

#

not process in the general sense

#

think multipaper vs folia

ivory sleet
#

yea os process

mortal hare
#

in my biased opinion IPC with multiple processes outweighs multithreaded apps

ivory sleet
#

isn't os processes very much of an impl detail in langs

thorn isle
#

somewhat yes

ivory sleet
#

or i mean ig not

#

most langs dont offer it

thorn isle
#

but it very broadly comes with much stronger memory isolation guarantees, unless you explicitly do something like shared memory

orchid gazelle
#

atp isn't this a #general thing? Just saying

thorn isle
#

nuh uh, we're talking dev

mortal hare
#

multithreaded apps only works for cpu bound tasks, even in that case separating those tasks by domain with proccesses is better

orchid gazelle
#

ok chef

thorn isle
#

mamma mia

ivory sleet
#

so dovidas whats ur issue with it, or i mean why do u like process based concurrency

orchid gazelle
mortal hare
#

you can scale it horizontally externally

#

like kubernetes

thorn isle
#

the two aren't really mutually exclusive

#

i'd rather scale the single process first which is enough for 90% of real life use cases if you're not google

mortal hare
#

it splits your project by domain

thorn isle
#

and then make use of the existing concurrency support in the codebase to scale further

#

look at the minecraft server for example; look at all the hacky shit people do over bungeecord messaging and have shit catch on fire

#

turning a completely single threaded not concurrency aware codebase into a multi-process, coherent, concurrent system is far more difficult, than taking an already concurrent system and spreading out further

ivory sleet
#

i think dovidas is more fond of the design principles behind os processes, than that he literally means os processes

mortal hare
thorn isle
#

java synchronization is an abstraction over concurrency in general, and intentional locking is easier to bring into a threaded domain than completely single threaded lockless code

ivory sleet
#

over synchronizing ur codebase to the brim of where there's so much contention is not ideal tho

thorn isle
#

e.g. a compare and set in local memory vs over the network is not principally any different

mortal hare
#

i just find threading is too brittle to be used daily in programming tasks. it should be left as a last resort thing.

ivory sleet
#

ugh

thorn isle
#

if i had image perms i'd post a "skill issue" gif

ivory sleet
#

very often when u write real world apps u will need some sort of async mechanic

thorn isle
#

but then again it is true that concurrency in general is probably the hardest thing in programming, right after naming things

ivory sleet
#

ui rendering, computationally heavy tasks, data fetching, web api wrapping etc

mortal hare
thorn isle
#

doesn't really matter whether it's threads or multiple os processes on a single node or a decentralized system, it's always difficult and any mistake will come to bite you in the ass

mortal hare
#

which can be solved without multithreading

ivory sleet
#

it definitely can

#

i mean this is why java added virtual threads

mortal hare
#

well it still maintains thread pool soo

#

but i dont blame them, they couldnt do it without it due to compatibility reasons

ivory sleet
#

i mean sure they have a carrier pool if that's what u meant

mortal hare
#

yea

thorn isle
#

i definitely would like some more control over which platform threads my virtual threads run on

#

but like emily brought up earlier, putting them behind a semaphore already gives you most of the control you'd need in practice, i.e. limiting parallelism

#

but someone else could still blow up the common fork join pool with 10,000 virtual threads and lock everything up

ivory sleet
#

minecraft is also to some extent cpu bounded, so using multiple threads (and by extension possibly cores/physical threads) is advantageous

#

if u need to scale

mortal hare
#

but again that's what proxies already had achieved basically

thorn isle
#

honestly like 90% of the tick loop could be made concurrent and even lockless

#

but the small indie studio that is mojang probably doesn't want to throw dev hours and money at it

#

after all, this means they can sell people more expensive realms

mortal hare
#

small indie studio lol

#

are you still in 2011's?

thorn isle
#

yeeees

ivory sleet
#

i mean they don't have THAAT many java devs as in code writers i believe

#

(correct me if im wrong tho)

thorn isle
#

certainly enough to refactor half of the nms i depend on every update, or so it feels like at least

ivory sleet
#

im not sure

mortal hare
#

the spigot community would scream if they refactored everything to be concurrent

thorn isle
#

mm yes levelchunk.level() is now levelchunk.level

mortal hare
#

that's why they're hesitant

thorn isle
#

no nevermind we switched it back to a method again next update

mortal hare
#

porting the minecraft client to vulkan already promises to break half of the mods

thorn isle
#

why are they doing it again?

mortal hare
#

let alone doing concurrency in nms

ivory sleet
#

just a small set of mods that invoked the graphics library explicitly no?

mortal hare
#

small set that everybody uses

#

like sodium

#

or shader mods

thorn isle
#

all shaders are out the window for sure

#

most of the rendering optimization mods will also explode, but only the mods that touch rendering

ivory sleet
#

yea but seems like that iris mod was going to be recoded either way?

thorn isle
#

they will probably either become redundant anyway or pretty quickly update i'd assume

mortal hare
#

i hope that after port we wont need those optimization mods

thorn isle
#

myeah exactly

mortal hare
#

since i think if they're investing into porting graphics pipelines i think they would invest into performance too

thorn isle
#

that's what we said when they rewrote the chunk system

#

but i suppose in this particular case the performance would be user-facing, not serverside

#

so they might actually care for a change

#

clearly they really don't care for any servers with more than 15 concurrent players

#

which just so happens to be about the size of a realm

ivory sleet
#

I mean yea

#

but trying to make nms multithreaded would break so many eco systems and it'd be expensive in terms of time also

thorn isle
#

yeah it's never happening

#

i don't necessarily want for most of it to happen, either

#

what i do want to happen is for the read-only entity logic like pathfinding and some goals to become concurrent

ivory sleet
#

it mustve been a hell to write folia

thorn isle
#

honestly i think they went in the wrong direction

#

they're already maintaining massive diffs, breaking most of the api, and breaking most of the expectations of the old api

#

at that point i think it would've been better to just make the tick loop itself more parallel

ivory sleet
#

you mean start from scratch? patching nms freshly?

thorn isle
#

i mean some concurrency patches on top of paper most likely; e.g. async pathfinding, async entity tracking, and proper api support for reading world state async

#

most of the writing would still be single threaded almost certainly

mortal hare
#

honestly at this point with all mappings are gone, minecraft nms should become open source with CLA agreements that contributors from like paper could contribute back into nms instead of trying to play cat and mouse game

thorn isle
#

perhaps some few and select spots could use compare-and-swap semantics

mortal hare
#

features could be still decided by mojang, but the minor updates could be maintained by the community

thorn isle
#

istg in a few years it'll be bukkit all over again and we learn that paper has been pocketed by mojang

ivory sleet
#

lol

ivory sleet
quaint basin
thorn isle
#

for which part of it?

#

my criticism of it is that it's a cobbled together middleground of like 4 different things that it does all, but doesn't do best

quaint basin
thorn isle
#

for pub-sub, I use rabbitmq

#

for cross-node caching, iirc mongobongo does it out of the box

#

but for that i just rolled my own solution with rabbitmq for messaging, chroniclemap for transient storage, and mariadb for persistent storage, basically reimplementing MESI

thorn isle
#

:skull

#

begone, e-thot factory

orchid gazelle
young knoll
#

yes

orchid gazelle
#

lol

worldly ingot
#

Ehhhh, it's more of a Mac thing than an OpenGL thing

dry forum
#

if i have a config file that i create the 1st time the plugin is ran

    public static void createResourceFile(String name) {
        File rf = new File(RedstonePlus.getPlugin().getDataFolder(), name);
        if (!rf.exists()) {
            rf.getParentFile().mkdirs();
            RedstonePlus.getPlugin().saveResource(name, false);
        }
    }```

whats the best way to go about updating changes to the config file if people already have the file created (if that makes sense) because ofc the people wont delete the config file then add the new plugin
young knoll
#

You can just add the new entries

#

Loop over each entry in your internal config and the one saved on the server, add any that are missing

dry forum
#

alr thanks, so basically js on enable, compare the config on the server with the one written in the plugin?

young knoll
#

Yes

wet breach
#

IE, larger the plugin you end up caching your configs in memory anyways ๐Ÿ˜›

#

the easiest way to detect what you are wanting is to load the configs and check for those things since you already know what the updated info is

#

if your loading of config doesn't detect the updated changes, add them in

#

another way, is to just rename the config and put the new config in place and tell the user that happened

echo basalt
#
String inputName = file.getAbsolutePath().replace(plugin.getDataFolder().getAbsolutePath() + File.separator, "");

try (InputStreamReader reader = new InputStreamReader(plugin.getResource(inputName))) {
    YamlConfiguration source = YamlConfiguration.loadConfiguration(reader);

    for (String key : source.getKeys(true)) {
        if (!configuration.contains(key)) {
            configuration.addDefault(key, source.get(key));
        }
    }
} catch (IOException e) {
    e.printStackTrace(); // or something better idk
}
#

It's basically this

wooden dove
#

I noticed that LivingEntity.getBodyYaw() does NOT reflect the rotation of the actual model

#

is there a body yaw value for the player which ACTUALLY represents how the body is rotated on the screen?

echo basalt
#

How bad is it?

#

Pretty sure the game does some weird clamping

#
float conversionFactor = 256/360f;
float reverseFactor = 1f/conversionFactor;

float clampedYaw = ((int) (yaw * conversionFactor)) * reverseFactor;
wooden dove
#

apparently it's not even the same between clients

lilac dagger
#

guys, do you guys know which repo the bungeecord chat is now on?

lilac dagger
#

thank you

#

i'll replace it with this everywhere

sullen marlin
#

It's also on maven Central

#

Just not really old versions

lilac dagger
#

I saw that

#

But my api is working with legacy as well which means old spigot is required

#

all good now ๐Ÿ˜„

pure dagger
#

i copied src form another project to my projoect, intellij says this ("OFF") and all classes are just raw... what does that mean?

lilac dagger
#

Not using maven or it's not marked as src?

pure dagger
#

yeah found the cause thank you

lilac dagger
#

There you go

#

๐Ÿ˜„

sullen marlin
#

Yo dawg I heard U like src

round finch
#

Mcp be like

Src/ minecraft.src/

vast ledge
#

src/namespace/minecraft/minecraft.src/

round finch
#

src/src.source.src would be funny

vast ledge
#

Dont give them ideas

vagrant stratus
#

src/src.src.src

Gotta keep it the same for all of them

vast ledge
#

nah src/src.src.src/minecraft/src

young knoll
#

Whyโ€™s it always src/main

#

When do we get src/secondary

mortal hare
#

devcontainers are so fricking cool

chrome beacon
#

src/test has been forgotten ๐Ÿ˜ญ

mortal hare
#

set up the compose.yml file with dev db and cache containers, slap java's devcontainer package and bam, you have reproducible dev environment which you can version control

mortal hare
#

they use players for their tests

mortal hare
#

yes, but at least this wasnt managed with weird language and just json

#

that alone makes me not use it

young knoll
#

Testing plugins is hard

#

Isnโ€™t mockbukkit paper only now

mortal hare
#

no one cares about stability as long as the plugin starts with Deluxe

chrome beacon
#

Don't forget the โญs around the name

thorn isle
#

nix ๐Ÿคก

mortal hare
#

ASYNC CRATE OPENING! 1.8-1.21

#

MULTITHREADING PERFORMANCE! PACKET GUI!

#

40$

thorn isle
#

i once had a guy give up trying to collaborate on a project because he couldn't figure out how to auth to our private maven repository without making the credentials part of his nix setup and publishing them

chrome beacon
#

The classic credentials problem of Nix

thorn isle
#

in the end he told me maven is dumb and java is dumb and the java ecosystem is dumb and that we should be using some vpn tunnel bullshit he would configure into his router instead

#

i would've just sent him the jar to use as an external library but i guess he probably couldn't do that either without publishing it

#

"no bro you don't get it it's a great os it makes everything easier"

#

so it would fucking seem

chrome beacon
#

You don't have to run NixOS to use Nix

thorn isle
#

well he was running the os, i don't really know anything about it except that it's stupid and makes me mad

chrome beacon
#

It's really not

vagrant stratus
young knoll
#

Whatโ€™s a nix

robust helm
#

its definitely possible

#

also nix is not made for desktops

#

or rather, it is made to solve deployment issues

#

you should read the phd thesis on nix!

#

(though i havent finished it)

mortal vortex
#

Plenty of people use nix for desktops because its immutable

robust helm
#

ik and it makes sense somewhere

#

i just mean that blaming nix for its usability in desktops is stupid

#

yes its slow to install packages, but its not the point to be fast as it doesnt really matter for servers

orchid trout
#

there is no way to remove tooltips completely with the api. where do i have to go to make a pull request?

smoky anchor
#

Probably doesn't since 1.21.5 'cause there have been some changes

orchid trout
#

it doesnt work since 1.21.6

mortal vortex
#

It does gang

#

u can iterate over the meta and just nuke it

thorn isle
#

i'd get it for e.g. a secure workstation you use for banking and other high-trust things that must be immutable

sly topaz
#

I can't imagine setting up credentials being any harder than just setting some environment variables for the user/password and afaik you can do that pretty easily with nix-shell

#

though I think nowadays you're supposed to use nix develop? Much of the same deal anyway

#

if it were for a deployment I would just bake the credentials onto the nix configuration though, no point in derivating every time if that's the only thing it is gonna be used for anyway

white briar
#
<repositories>
<repository>
<id>spigotmc-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.8.8-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
</dependencies>

Could not find artifact net.md-5:bungeecord-chat:pom:1.8-SNAPSHOT in spigotmc-repo (https://hub.spigotmc.org/nexus/content/repositories/snapshots/)

can someone help me please

chrome beacon
white briar
#

it only gives warnings now:

[WARNING] Failed to download maven-metadata-sonatype-nexus-snapshots.xml [https://oss.sonatype.org/content/repositories/snapshots/]
[WARNING] Failed to download gson-2.3.1.pom [https://hub.spigotmc.org/nexus/repository/public/]
[WARNING] Failed to download guava-18.0.pom [https://hub.spigotmc.org/nexus/repository/public/]
[WARNING] Failed to download guava-parent-18.0.pom [https://hub.spigotmc.org/nexus/repository/public/]
[WARNING] Failed to download guava-18.0.jar [https://hub.spigotmc.org/nexus/repository/public/]
[WARNING] Failed to download gson-2.3.1.jar [https://hub.spigotmc.org/nexus/repository/public/]
thorn isle
#

that's normal, maven tries to download everything from everywhere

white briar
#

okay then thanks for the quick help

#

it stopped appearing anyway

thorn isle
#

but the spigot repo doesn't serve e.g. gson, so it won't find it there; it'll eventually find it in some other repo, or if it doesn't, print an error about it

orchid trout
#

the configs are conflicting. is there any other way to fix it other than to rename them?

#

i shade both modules into 1 ar

orchid trout
#

yes

#

spigot config has redis login

wet breach
#

then why not combine them?

vagrant stratus
#

not really, unless maven has a plugin to merge conflicting files that are named the same

#

or that, yea

orchid trout
wet breach
#

but you are combining the jars together

#

so....not sure what difference it makes here

orchid trout
#

so ytou dont have to update every config

wet breach
#

then why are you combining the jars if you obviously have differences?

#

not sure what these configs here, have to do with production stuff

#

unless you got some weird setup

orchid trout
#

cause i didnt really think about i t

#

i just wanted 1 single jar

wet breach
#

anyways, your only solution if you need to keep them separate is to rename one of them

#

fortunately maven can easily do that during shading

mossy blade
#

Hey, are there any plugin/command experienced developers that could possibly help me fix and test my Minecraft server?

chrome beacon
#

?services

undone axleBOT
mossy blade
#

Are these developers trusted or randoms?

thorn isle
#

randoms that get paid

mossy blade
#

But it could be a scam no?

thorn isle
#

better than asking complete randoms who don't get paid on a discord

mossy blade
#

Okay

dark moth
#

I used buildtools gui to use 1.21.11 nms, i chose latest for version and ticked remapped mojang but when i try to use CraftPlayer#getHandle the server throws a NoSuchMethodError

#

How can i fix this

#

heres pom.xml

young knoll
#

You didnโ€™t set up reobfuscating

chrome beacon
#

^^

young knoll
#

?nms

chrome beacon
#

ded link

young knoll
#

That link is still dead isnโ€™t it

chrome beacon
#
JEFF Media Developer Blog

If you need to access NMS classes from inside your Spigot plugin, it is a very good idea to use the so called Mojang mappings. Disclaimer: This post is written for 1.20.4. If you use another version, you of course have to replace every occurance of ๏ฟฝ1.20.4๏ฟฝ with the version you actually use. What are...

dark moth
young knoll
#

We need to move that to the wiki or something

thorn isle
#

i bet choco has a pr for reobf mapping plugins at runtime but it never got merged

young knoll
#

Well it wonโ€™t matter in a month or so

#

At least for people on latest

lilac dagger
#

i was about to say

#

26 will hit soon

#

but i guess people won't use nms and keep themselves only to latest

vagrant stratus
#

tbf it depends on how easy md makes it to use NMS once 26 releases lol

thorn isle
#

if it's anything like paper, i foresee quite a bit of adoption

#

on paper, we're at the point of debating whether to can the paper-api altogether because it's increasingly becoming just a thin abstraction wrapper (marked experimental, of course) over nms anyway

#

i can see where they're going with generating api facets directly from nms; in a sense it's exactly the "nms in the api" that people have been asking for for years

#

but at the same time, with nms so easily accessible now, what's the point of using an (usually very poorly documented and quickly thrown together) abstraction over the real thing?

#

if nms changes, the generated facet changes with it, and everything breaks anyway

vagrant stratus
#

Yea, at this rate it's easier to do just the bare minimum to support plugins and then let people run wild with the NMS code itself kekw

sly topaz
#

one could argue that the parts of internals being used in datapacks more or less are fine in that regard since datapack/plugin interop is pretty much the same problem and so Mojang designs those in a way that is viable for plugins as well, but even in those parts there's some issues regarding what plugin touches what

thorn isle
#

i mean, look at the paper item components api

#

it's an incredibly thin wrapper over nms components

sly topaz
#

yeah, it is just a thin wrapper around NMS, but that's just because there is no need for it to be anything else, at least in the way it is right now

#

I am not sure we could say that about other parts of the server

thorn isle
#

that's exactly what i was talking about

#

we still definitely need the bukkit api, as in an event bus and a structured way for plugins to hook into places

#

but at this point there really isn't any point to using e.g. the paper item components api over nms, or perhaps even more complicated systems like ai/pathfinders

#

one promise bukkit/spigot have made, for better or worse, that it offers abstraction through time, like the worldgen api which has changed under the hood like 3 times, but still exposes the same interface to plugins

#

i really see no point to adding these thin wrappers or "datagen" style api features

sly topaz
#

the point is exposing them to the API in order to work with API objects

#

you could argue that's a way to sideway the problem of not being able to just add a lifecycle hook that works directly with the internal objects instead of thin wrappers, but that idea often falls apart the moment you need to consider how plugins work in Bukkit

thorn isle
#

i call your hand and raise you a getHandle

#

some of the registry spaghetti aside it honestly feels like some of the nms objects are easier to reason about than the paper wrappers

sly topaz
#

I agree on that note, I don't like RecipeChoice stuff at all when looking at the fancy RecipeBuilder internal API

#

it's just hard to find a balance

#

if bukkit was designed in a way where it would just be lifecycle hooks that directly work with internal objects, it'd be a different story however we all know how that ends up (looking at you, fabric)

#

it is nice and powerful but half of your modlist doesn't work with the other half so you have to pick and choose what will touch what

thorn isle
#
        Set<TypedKey<BlockType>> set = new HashSet<>();
        for (var mat : materials) {
            set.add(RegistryKey.BLOCK.typedKey(mat.key()));
        }
        itemStack.setData(DataComponentTypes.CAN_PLACE_ON, ItemAdventurePredicate.itemAdventurePredicate(List.of(BlockPredicate.predicate().blocks(RegistrySet.keySet(RegistryKey.BLOCK, set)).build())));

mmm yes my api interop

#

my blood pressure explodes just looking at this block of code

#

we went from a setter that takes a Set<Material> to whatever the fuck this is

worldly ingot
#

It's gross, yes, but a couple things:

  1. Minecraft itself is kinda headed in this direction. It's the nature of data-driven behaviour
  2. While I disagree with this design choice, Adventure's primary design philosophy is to use static imports, so it would look more like this instead:
itemAdventurePredicate(List.of(predicate().blocks(RegistrySet.keySet(RegistryKey.BLOCK, set)).build()))
slender elbow
#

ur gross

dull python
#

Why is "Unobfuscated" added to the version number 1.21.11?

young knoll
#

It's not

#

Unless you want the unobfuscated version

dull python
#

The issue isn't with importing obfuscation; rather, it's that the version number retrieval is incorrect because of an extra obfuscation flag. It should only show the version number, but now it's showing an obfuscation flag.

vagrant stratus
#

yes

#

Minecraft's doing unobfuscated & obfuscated jars now

dull python
#

Originally, it was supposed to check for 1.21.11 and process it into something like 12111, but because of an extra flag, it couldn't be detected. Therefore, an unobfuscated flag was added.

young knoll
#

Only for .11

#

26.1+ will be all unobfuscated

dull python
#

I understand this, but I don't understand why this marker is needed when getting the version number. Wouldn't it be better to just add it to the file itself?

slender elbow
#

what are you talking about

#

"getting the version number" where? "this marker is needed" where?

dull python
#

This is the version information obtained from the command: This server is running CraftBukkit version 4590-Spigot-da5d877-2746e0b (MC: 1.21.11 Unobfuscated) (Implementing API version 1.21.11-R0.2-SNAPSHOT)

#

My Bukkit.getServer().getVersion() function returns the line (MC: 1.21.11 Unobfuscated). Previously, it processed versions like 1.20.1 and 1.21.11, but now that it has added more, it's causing the problem to fail to process the later versions.

worldly ingot
#

I mean that's sort of the problem with parsing a string

dull python
#

Yes, this is exactly what caused the problem in my previous processing. I just don't understand why it's written in the version number instead of the filename.

thorn isle
#

it's written in the version because it's a classifier for the version number

#

versions aren't restricted to numbers

#

filenames mean nothing; it's the version that's supposed to encapsulate the semantic information about the build

worldly ingot
#

I mean even in your original message you mention it returning (MC: โ€ฆ)

orchid trout
#

why does intellij suggest to create a class and not just implement

thorn isle
#

do you have a project jdk set up

ancient plank
#

sometimes not updating intellij causes that too

pure dagger
#

(generally, not spigot or yaml-specific)
is it possible to serialize objects keeping their typed parameters?
would i have to make a method of List<Object> instead
i dont see a way to deserialize an object without knowing the typed parameter, just having the class<?>

thorn isle
#

strictly, yes, but it usually isn't what you want to do and will end up ugly

#

if you really don't have the type information at runtime, you'll have to embed it into the serial data itself, something like bukkit configs' ==: org.bukkit.Location entries

#

however doing that to the extent of e.g. type parameters in collections, something like ==: java.util.ArrayList<org.bukkit.Location> or god knows what horrid formulation once you start nesting type parameters, almost certainly isn't what you want or need

#

what's your use case?

pure dagger
#

im just making my format

#

considering this

#

should i just return a List<Object> or convert any parameterized class into <Object>

thorn isle
#

you should do what gson and other typed-at-runtime serialization systems do

#

which is to return T and take a TypeToken<T>

#

e.g. one can use Gson.fromJson(JsonElement, TypeToken<T>) to

List<Location> locs = gson.fromJson(myJson, new TypeToken<List<Location>>(){});
#

returning a List<Object> is probably strictly technically correct in most cases, at least as long as you don't involve arrays

#

but it will get nasty down the road

#

mostly because you don't know what the types of the object in the list are, and so won't be able to deserialize them without guesswork

whole mist
#

Inquiry: Interfacing Spigot/Java with OS-level Age-Assurance APIs (2027 Standards)

I'm looking into the feasibility of a plugin that can interface with the upcoming OS-level Age-Assurance APIs (relevant to 2027 standards like AB 1043).

As a sysadmin with a MySQL backend (using CoreProtect and Factions), I'm trying to figure out how to ingest these real-time age signals from the client OS to partition UUID data. Since the current Minecraft protocol doesn't include a metadata field for OS-level age-assurance flags in the Handshake or Login packets, has anyone looked into using a custom Netty transition or Plugin Messaging Channel to relay this from a modified client?

Receiving these signals triggers 'Actual Knowledge' liability (with negligence fines of $7,500), so I'm trying to determine if a Java wrapper or a Spigot-compatible API can even be built to read these signals. Or is the JVM sandbox effectively blocking us from reaching the OS API entirely, making geofencing the only technical solution for independent servers?

sly topaz
#

Mojang would introduce that in the client as that's the thing interfacing with the user, servers don't need to care about it

whole mist
#

Thanks. This helps out a lot.

young knoll
#

Such trash smh

#

Microsoft wants your Id

sly topaz
#

Microsoft didn't care till countries started pushing for age verification

#

so eh, I can't put this one on them

orchid gazelle
#

Age verification is the most useless thing to be introduced

#

โ€žOh no my 13 year old child can insult other 13 year old childs just like on any other internet platform in this worldโ€œ

chrome beacon
#

Not for the mega corpos funding it. Since it can help doge liability

orchid gazelle
#

Idk why a platform could ever be liable for such things

#

Thatโ€˜s also very stupid

sly topaz
#

they can be liable for not moderating the platform

chrome beacon
#

^^

orchid gazelle
#

Yeah sure and this sucks

sly topaz
#

it doesn't really, children should be supervised by parents ideally but that's not gonna happen so the governments around the world have to step in

whole mist
#

To clarify, the goal isn't just to see if the account is verified, but to manage the secondary data generated by the server.
Even if the client handles the initial handshake, as a server owner, I am persistently logging chat logs (moderation), player behavior (Factions/Bounties stats), and IP addresses into a MySQL backend. Once an age signal is triggered, these logs transition from 'anonymous traffic' to 'Actual Knowledge' of a protected user's data.
Iโ€™m looking for technical solutions or listeners that can:
Tag UUIDs based on that incoming age-bracket metadata.
Automate SQL triggers to apply different retention periods or auto-anonymization to those specific UUIDs in CoreProtect and other behavioral databases.

orchid gazelle
#

There are 2 possible cases:

  1. Your parents should be liable for moderating their childrenโ€˜s usage of the internet
  2. when the child gets old enough to chat on their own, they should be able to moderate themselves and should be liable for what they are typing
#

Itโ€˜s as easy as that

sly topaz
young knoll
#

It wouldnโ€™t be so bad if there was a way to verify without sending your ID to a third party

orchid gazelle
#

Well no, itโ€˜s straight up unnecessary to do age checks in the first place

sly topaz
orchid gazelle
#

Some 10 year olds are developed enough to chat on their own, some 16 year olds are not

young knoll
#

Canโ€™t we get like

#

Our bank or government to give us a document that confirms our age

#

Rather than sending our Id to Microsoft

sly topaz
#

in my country it is easy, there's a country-wide ID database controlled by the government

orchid gazelle
orchid gazelle
sly topaz
#

the data is controlled by the government so it is fine

orchid gazelle
#

Exactly

sly topaz
#

the companies only get a verification that we are indeed who we say we are

orchid gazelle
#

And using it for any other cases than currently defined by German law, would be hella illegal

#

Itโ€˜s very very strict

young knoll
#

See that should be the standard

#

Rather than the nonsense companies want currently

whole mist
#

I think weโ€™re veering away from the technical scope here. Regardless of where the responsibility lies, Iโ€™m looking at this as a System Administrator with a data-retention requirement.
My question is strictly about automation and API hooks:
Is there a listener in the Spigot API that can catch the account-level age signal during the PlayerLoginEvent?
If so, can that signal be used to trigger an automated SQL script (like an UPDATE or DELETE on a specific UUID) in my behavioral and chat databases to meet 2027 data-minimization standards?
I'm just trying to find out if the current server-side architecture allows for this kind of automated data partitioning.

orchid gazelle
#

Lol

#

Itโ€˜s not even countable how often I smuggled into partys that would be 18+

#

And I can freely say that because funnily you arenโ€˜t held responsible if you smuggle into it, the organiser is liable lmao

young knoll
#

I donโ€™t think the age verification status is sent to the server

#

Maybe you can query the Mojang api from the server to check, idk

quaint basin
#

If EntityUnloadEvent is called, and I set entity#setRemoveWhenFarAway=true, does that mean I don't need to use entity#remove in that event?

lilac dagger
#

i'd say to test it

vagrant stratus
#

?tas

undone axleBOT
thorn isle
#

Iirc that is the spigot name for isPersistent so yes

slender elbow
#

hm? that method is not about storage persistence, the entity can still be unloaded and saved and reloaded even if that property is set to true

thorn isle
#

then i must misremember it

quaint basin
slender elbow
#

yes

quaint basin
#

So what does this method do?

slender elbow
#

that property just controls whether an entity can be allowed to despawn naturally outside the player's spawn radius

#

even if the chunk it is in remains loaded

#

Entity#setPersistent controls whether the entity gets saved to storage when the chunk it is in unloads

quaint basin
#

The entity despawns even when the false flag is set no?

slender elbow
#

if the property is set to false, it is not allowed to despawn outside the spawn radius

#

it does despawn if the chunk unloads, of course, but it might get saved with it (if setPersistent is true)

thorn isle
#

i suddenly have this deja vu that this is the third time this happens

slender elbow
#

a radius around the player in which entities can spawn and exist

#

it's in the wiki

#

look it up

thorn isle
#

i'm like 90% sure i've confused persistent and removeWhenFarAway at least 2 times before and you've corrected it

slender elbow
#

it doesn't help that Entity#setPersistent is a spigot addition, and the internal name for the api's remove when far away isโ€ฆ persistenceRequired

quaint basin
slender elbow
#

got quite confused when I had to port a plugin to fabric

thorn isle
#

isn't the despawn radius separate from the spawn radius

slender elbow
#

idk

#

128 blocks that's all I know

thorn isle
#

and goes by mob category

slender elbow
#

might be dated info

#

yeah it changes from mob to mob that's true

thorn isle
#

iirc at least in paper, it goes by same category as mob spawn caps, and has 2 radii; a hard and a soft radius

#

soft radius makes them randomly despawn over time, hard despawns them instantly

slender elbow
#

ghasts are allowed to stay around for farther

thorn isle
#

defaults to like 48 and 128 or 64 or something respectively

#

iirc it is also spherical where the spawn radius is square

quaint basin
#

Well, I'm lost. I don't know what values โ€‹โ€‹I should set

thorn isle
#

what're you trying to do

#

i think paper at least disallows you from removing the entity in EntityUnload or EntityRemoveFromWorld Events

#

or used to

#

i remember running headfirst into it in my spawner plugin where i wanted to check things on entity unload to determine whether they should despawn or not

quaint basin
thorn isle
#

means nothing to me

#

hypickle something something

slender elbow
#

what values?

#

what do you want to do? what do you want to happen?

thorn isle
#

without knowing anything about what you're trying to do or how it should work, probably just set isPersistent to false and treat the entity as a transient one

slender elbow
#

yeah

quaint basin
#

That is, if someone loads the chunk again, then the entity will be there

thorn isle
#

then set it to true

quaint basin
#

the persistent flag?

thorn isle
#

yes

#

and removefaraway to false

silk elk
#

Hey so I'm just getting back into development and my bungeecord plugin isn't compiling. Says

> Could not resolve all files for configuration ':compileClasspath'.
   > Could not find com.mojang:brigadier:1.2.9.```
Using Gradle.
quaint basin
#

what about removeWhenFarAway?

slender elbow
#

setPersistent defaults to true already so you don't really need to touch anything to begin with

thorn isle
#

are monsters actually persistent? i think they aren't unless they have name tags or something

slender elbow
#

they are persistent, yes

thorn isle
#

odd

slender elbow
#

if you shut down the server while you're next to a creeper,

#

oh boy is it going to be there when you join back

silk elk
thorn isle
#

i could've sworn they disappear when i crank the despawn range up to higher values than view distance

slender elbow
quaint basin
#

I didn't know that

slender elbow
#

which internally is called persistenceRequired

thorn isle
#

๐Ÿ—ฟ

quaint basin
#

What is the default value for removedWhenFarAway?

slender elbow
#

it depends on the mob

#

just set it to false explicit

quaint basin
#

But I have no idea what that does yet ๐Ÿ˜ญ

#

I don't know if I want this to be false lol

thorn isle
#

when it's true, the entity will be removed when it's far away

#

when it's false, it will not be removed when it's far away

slender elbow
#

if it's set to true and you walk away, it gets deleted for all eternity

#

that's what it does

#

simple

quaint basin
slender elbow
#

most animals for example

#

but does it matter? just set it to false explicitly when you spawn your entity and forget about it

quaint basin
#

But is this option true by default for monsters?

thorn isle
#

for monsters without nametags or whatever, it's true i think

slender elbow
#

most

quaint basin
#

i see

thorn isle
#

excluding some special cases like elder guardians and shit

#

not sure if that implements monster but i'd say it's a monster

slender elbow
#

the wither boss sure as shit is a monster that doesn't despawn when far away

thorn isle
#

most monstrous

quaint basin
#

If EntityRemoveFromWorldEvent is called, then EntityUnloadEvent was guaranteed to have been called as well?

slender elbow
#

no, an entity can be removed without all entities in the chunk unloading

#

for example, a player kills the entity

thorn isle
#

you also can't call entity::remove on the entity of a removefromworld event, in case that's what you're thinking about

slender elbow
#

that would be stupid anyway

echo river
#

Hello, I want to create a small server in 1.8.9 and add some plugins to it should I be using spigot, and if so, where can I find the 1.8.9 jars ?

slender elbow
#

it's already getting removed

thorn isle
#

same goes for entity unload

chrome beacon
undone axleBOT
slender elbow
#

pretty sure you can do it in the entities unload event and it won't get saved, but atp just setPersistent(false)

quaint basin
thorn isle
slender elbow
#

hm true

thorn isle
echo river
quaint basin
slender elbow
#

is the event getting called at all for the chunk the entity is in?

#

could be the chunk is being kept loaded or anything, idk

thorn isle
#

or you forgor to set removewhenfaraway to false and it despawned before unloading

quaint basin
#

kk I'll look into it

quaint basin
thorn isle
#

i'd assume so

quaint basin
#

The EntityRemoveFromWorld event is called, but the EntitiesUnload event is not

thorn isle
#

that means it's getting deleted for one reason or another

#

make sure you do actually set removefaraway to false instead of relying on the default

#

if that's not it, it could be some other plugin

quaint basin
thorn isle
#

it could delete it

#

for whatever reason

#

i don't know

#

something something mob stacker deluxe 9000 will delete all faraway armorstands

quaint basin
#

maybe is slime paper causing this

thorn isle
#

you can try dumping a stack trace in the remove event

quaint basin
thorn isle
#

yes, the remove event is called whenever a mob ceases to be in the world for any reason

#

such as dying, unloading, despawning, or any other reason

#

it and the entityaddtoworld event are designed specifically with the invariant in mind that they can be used to bookkeep which entities exist in the world in a loaded state

quaint basin
#

Perhaps this is what I need then. The problem is that this event is only available in the paper

thorn isle
#

what are you trying to do

#

in that event specifically

quaint basin
# thorn isle in that event specifically

Several useful pieces of information, such as the minion's efficiency, the last time the minion was active so that when the minion is loaded, I can calculate the time difference to know how many resources to generate based on that time, and other informations

#

And remove it from the cache because if the server has 1000 minions placed but only 20 are loaded, I won't have everything in the cache

#

And if an entity that is a minion is loaded, then I put it back in the cache

thorn isle
#

that's the right place to do it, that's what the event, and its mirror counterpart in addtoworldevent, are for; entity lifecycle

#

especially useful for managing a cache

#

e.g. i used them in villager lobotomizatornator to maintain the lists of villagers to act on/update the trades of, so i wouldn't have to keep iterating over the world's entities to find the villagers

quaint basin
#

But EntityRemoveFromWorldEvent is only in the paper. How do I do that in Spigot?

thorn isle
#

i'll be honest, my real recommendation is to just drop spigot support; many if not most large plugins have already, specifically because of things like this, and spigot only has like a 10-20% market share now (on modern versions), so it isn't a problem financially

#

entities unload event should work for when the entities unload, but not for other removal causes

#

the "banging rocks together" type alternative is to loop over the cached entities each tick and check Entity::isValid

quaint basin
#

alright

thorn isle
#

i don't think heightmaps will do anything useful in the nether

#

i don't remember what i did for the nether in my rtp plugin

#

probably just picked a position at y 80ish and scanned down/up

quaint basin
#

Why isn't there a heightmap for bedrock in the Nether?

thorn isle
#

because it has a ceiling

#

what would the heightmap return?

young knoll
#

I would say it could ignore bedrock

#

But thereโ€™s basically always solid netherrack below the bedrock so that doesnโ€™t help

thorn isle
#

myes

#

one way of defining it that'd be sort of useful is the "highest air block on top of a solid block but under the bedrock ceiling"

#

but that is kind of difficult to keep up to date efficiently

echo river
#

Is there any tutorial / documentation for spigot plugin developement in older versions of mc ? like 1.8.9

lilac dagger
thorn isle
#

my best advice is to give up

quaint basin
echo river
#

ty

thorn isle
#

treating "bedrock as air" wouldn't help in the nether

young knoll
#

It would have to both consider netherrack and not consider netherrack

#

Depending on if there was air above it

chrome beacon
#

and if you skip the netherrack too there's not much left of the nether

random grove
#

Does player.openInventory() ever cause a moment where player.getOpenInventory() is null?

If a player already has an inventory open and I call:

player.openInventory(newInventory);

is there ever a moment during the transition โ€” between the old inventory closing and the new one opening โ€” where player.getOpenInventory() returns null? Or is the switch guaranteed to be atomic so itโ€™s never null?

chrome beacon
#

Don't think so

thorn isle
#

worrying about atomicity in bukkit is a bit redundant since just about everything you do happens on the main thread

thorn isle
#

it's not atomic in the sense that there's a compareAndSet loop somewhere that perfectly transitions the state from one inventory to another

#

but it's atomic in the sense that to you, the caller on the main thread, once openInventory returns, the inventory is open, and getOpenInventory will reflect that

#

notwithstanding any nonsense like a InventoryOpenEvent listener changing the open inventory

chrome beacon
#

^

random grove
#

Thanks

half heron
#

i'm trying to make it so that fishing rods in 1.8 will still cause kb/hit event, but no armor durability damage, is there any easy way to do this without shceduling events in the future (this will probably introduce exploits)

I'm looking at the possibility of grabbing the damage that causes durability on armor to decrement and if its 0 or caused by rod, cancel the decrement event, but idk how you would grab this. or ig you could make a java agent to manually rewrite the class, but i don't want to do that

are there any better methods or nah

#

actually ig i could just ask the spigot developer to make it an option

mortal hare
#

what's the point of enums when we have sealed interfaces with pattern matching in modern java?

#

like i can attach custom values to specific enums like objects now

young knoll
#

What spigot developer

weak wasp
#

John Spigot

#

Or is it Joe?

smoky oak
#

is it possible to pretend blocks have skylight access? or do i need to manipulate light blocks in an insane volume to even approach simulating that?

chrome beacon
#

what block?

#

Beacon?

smoky oak
#

the light block?

chrome beacon
#

? why do you want to pretend they have sky access

smoky oak
#

mostly to know if its possible tbh

chrome beacon
#

It's probably possible

#

worth the effort probably not

#

also depends on what you're really trying to achieve

mortal hare
#
package com.servedon.user.username;

import org.jspecify.annotations.NullMarked;

import java.util.regex.Pattern;

@NullMarked
public sealed interface UsernameValidationError permits UsernameValidationError.TooShort, UsernameValidationError.TooLong, UsernameValidationError.IllegalCharacter {
  final class TooShort implements UsernameValidationError {
    private final int minimum;

    private TooShort(final int minimum) {
      this.minimum = minimum;
    }

    public int minimum() {
      return this.minimum;
    }
  }

  final class TooLong implements UsernameValidationError {
    private final int maximum;

    private TooLong(final int maximum) {
      this.maximum = maximum;
    }

    public int maximum() {
      return this.maximum;
    }
  }

  final class IllegalCharacter implements UsernameValidationError {
    private final Pattern pattern;

    private IllegalCharacter(final Pattern pattern) {
      this.pattern = pattern;
    }

    public Pattern pattern() {
      return this.pattern;
    }
  }

  TooShort TOO_SHORT = new TooShort(3);
  TooLong TOO_LONG = new TooLong(32);
  IllegalCharacter ILLEGAL_CHARACTER = new IllegalCharacter(Pattern.compile("^[A-Za-z][A-Za-z0-9_]*$"));
}

i love pattern matching

chrome beacon
#

Could you not use records?

mortal hare
#

i want to enforce private constructors

#

thus why i didnt used them

chrome beacon
#

I see

mortal hare
#

if you dont enforce it, you couldnt make assumption that the constants are the only way to get proper values unless you execute the validation to get the object itself

ivory sleet
#

I mean it would be possible to use enums in conjunction with sealed interfaces

#

tho I do think there's very little reason to use enums in this day and era

mortal hare
#

unless you need ordinal generation i dont see of use tbh

thorn isle
#

sealed interfaces are sort of superior to enums in most ways

#

with enums you do still get ordinals however, which make for very efficient sets and maps

#

even then, it's not impossible to create ordinals for registry style objects at runtime, and create matching efficient set/map impls using them

#

so i would say enums still have their place as a convenience more than anything; representing a state that can be more than 2 things but doesn't require any per-state logic or behavior, and doesn't need to be open to e.g. addons registering their own constants

#

what i would campaign against is using enums as a major business code component, like in mcmmo where every skill is an enum constant, since it means you end up with either switch blocks everywhere, or a massive god-enum class; and addons won't be able to register their own skills

ivory sleet
ivory sleet
random grove
#

I have recently developed a database lazy loading utility: https://github.com/keywhale/Loader
If anyone wants to use it with Maven, feel free to add it via Jitpack.
Any comments or recommendations would also be appreciated.
Thanks

echo basalt
#

part1, part2 etc are horrible names if you don't have any context

#

But also splitting the serialization and saving steps and leaving it to be implementation dependant is incredibly error prone

#

Ideally return a Callback<byte[]> or have an encode(T object, ByteBuf buffer) or something

#

That way you can avoid the whole hassle of managing mutable arrays, which can be a nightmare for bulk operations

#

And still have some sort of system to manage successful vs failed encodes

random grove
#

Thank you

#

I also noticed that I got org.bukkit.plugin.IllegalPluginAccessException: Plugin attempted to register task while disabled when I did shutdownNow() on the onDisable of my shop plugin

#

I will probably have to detect when it's expediting, and then add the runnable to the set instead of scheduling

mortal hare
#
@NullMarked
public sealed interface PasswordValidationResult permits PasswordValidationResult.Success, PasswordValidationResult.Failure {
  record Success(Password password) implements PasswordValidationResult {}
  record Failure(PasswordValidationError error) implements PasswordValidationResult {}
}

is it possible to make this somehow a generic sealed interface, when i declare type parameters on the interface it seems it cannot apply them to the records

#

it would be neat to make this as a Result<T, V>

#

and then Result<Password, PasswordValidationError> for this concrete type

thorn isle
#

records are implicitly static, meaning they won't inherit the type parameters of the class they're enclosed in

#

so that warning is about you declaring a type variable T in the interface, which is never referenced again, because every nested record defines a new type variable T which hides the interface's T

mortal hare
#

is it possible to workaround this

ivory sleet
#

I mean ideally you'd probably just provide the constructed type Result<Password, PasswordValidationError>, but else you can have sth like

Type<T>
Subtype<T extends SpecialType> extends Type<T>

where you add additional constraint to the type parameter when using the subtype construction

thorn isle
#

i'd advise against trying to type errors with generics

young knoll
#

Pfft who needs typed errors

#

Everything is RuntimeException

ivory sleet
celest imp
#

Anyone able to help me? I can't post an image but there is a scoreboard I seen on another server, and it has like the &m strikethrough but it looks clean as if its 1.7, but it's a 1.21+ server, I was just wondering how they did it

#

As u can see the spacers looks like that, but the last time I seen strikethrough lines look like that was 1.7

orchid trout
#

&m

#

with spaces

orchid gazelle
#

any ideas how to hook all sounds to modify/cancel them? I am using ProtocolLib to process PacketEvent but many sounds are not handled/affected by it, for example dispensers or jukeboxes

slender elbow
#

many sounds are played by the client, not the server

celest imp
orchid trout
#

because youre putting dashes

#

just put spaces

celest imp
#

ok

orchid trout
celest imp
#

cool

#

gonna test now

celest imp
covert stump
#

Yall like my scoreboard and tab

ivory sleet
#

I'd give it a 5/10

orchid trout
#

id give it less

covert stump
orchid trout
#

you need to have talent or sum shi

covert stump
#

any feedback or smth

ivory sleet
orchid trout
#

nothing matches

covert stump
#

changing colors is easy

#

any referance or smth anyone has..

quartz sorrel
#

Was wondering if there is a known way of opening and handling dialogs on BungeeCord without relying on the API from it.
I want to add support for it, but currently have this issue here blocking any possible use for me: https://github.com/SpigotMC/BungeeCord/issues/3871

It could also be an issue within my plugin's code, so any help would be apreciated.

covert stump
quartz sorrel
#

Right now that's my assumption too (And that was also suggested last time I asked here)

#

So I'm looking for a way to make this work, even if it means bypassing the API itself.

#

Because having this block my progress isn't really nice.

covert stump
covert stump
#

Smth like hooking into channelInitializer and injecting a custom packet handler should let you bypass the api entirely..

quartz sorrel
covert stump
#

u tested on Velocity?

quartz sorrel
#

Velocity has no dialog support last time I checked

covert stump
#

ah

thorn isle
#

why does everyone insist on using this stupid smallcaps font on every server

chrome beacon
orchid gazelle
quaint basin
#

I'm building a server and that's why I'm taking inspiration from the biggest ones, but I think that was a mistake btw

chrome beacon
#

you do have to ask yourself; Why are they going to play on your server instead of the bigger one

thorn isle
#

because i have more gradients and smallcaps text

quaint basin
thorn isle
#

that said i think the overall design is alright

quaint basin
#

But for example, they support older versions, but older versions doesn't format well with the custom fonts

thorn isle
#

the main problems that i see are that

  • the icons and text aren't aligned; looks messy
  • the rank plate really does not fit in with the rest
  • the red-yellow gradient is a bit hard to read to me, but that might just be me
quaint basin
#

It seems they just installed ViaVersion and didn't even bother to check if it works correctly xd

covert stump
thorn isle
#

other than that i think it's pretty good, but it also is i think what i'd see on every other server i'd log on

#

blending in without being unremarkable in bad ways is a sort of quality of its own i suppose

#

rank & bank, especially with that gray color scheme, are a bit hard to tell apart

#

to align the icons, either throw 1-width spaces at it, or actually make sure the icon glyphs in the font all have the same width