#help-development

1 messages · Page 1287 of 1

trim quest
#

which is also didnt work

#

i remember javier said maybe i need older version of BuildTools or smth

ivory sleet
#

I used Loading BuildTools version: git-BuildTools-844940e-193 (#193)

#

which im pretty sure is the latest one

trim quest
#

yeah i also have same

ivory sleet
#

sounds like trouble though, id imagine u wna favor portablegit for reproducibility

trim quest
#

for my scenario

ivory sleet
#

did u try fiddling around with other java binaries?

trim quest
#

will try jdk8u452

#

there are no version of452

ivory sleet
#

actually u can prob get em from archives

#

^^ (and yea, clear the work files and just run everything on fresh btw)

trim quest
#

yeah

#

it didnt work also

#

the same error keep continue to exist

ivory sleet
#

brutally annoying

#

hmmm

trim quest
#
[--rev, 1.8.8]
Loading BuildTools version: git-BuildTools-844940e-193 (#193)
Java Version: Java 8
Current Path: C:\Users\rokel\Documents\Minecraft-Folders\BuildTools\BuildTools
*** Could not find PortableGit installation, downloading. ***
Starting download of https://github.com/git-for-windows/git/releases/download/v2.45.2.windows.1/PortableGit-2.45.2-64-bit.7z.exe
Downloaded file: PortableGit-2.45.2-64-bit\PortableGit-2.45.2-64-bit.7z.exe with hash: 851a15074dea6b272785b2a2a4697a72970256de2afe7b8e4a9c5e168c27ccdd
Extracting downloaded git install
*** Using downloaded git PortableGit-2.45.2-64-bit\PortableGit ***
*** Please note that this is a beta feature, so if it does not work please also try a manual install of git from https://git-for-windows.github.io/ ***
git version 2.45.2.windows.1
openjdk version "1.8.0_452"
IBM Semeru Runtime Open Edition (build 1.8.0_452-b09)
Eclipse OpenJ9 VM (build openj9-0.51.0, JRE 1.8.0 Windows 10 amd64-64-Bit Compressed References 20250504_1243 (JIT enabled, AOT enabled)
OpenJ9   - 31cf5538b0
OMR      - 9bcff94a2
JCL      - a00de86921 based on jdk8u452-b09)
Attempting to build version: '1.8.8' use --rev <version> to override
Found version
{
    "name": "582a",
    "description": "Jenkins build 582a (hotfix 2)",
    "refs": {
        "BuildData": "838b40587fa7a68a130b75252959bc8a3481d94f",
        "Bukkit": "01d1820664a5f881665b84b28871dadd132deaef",
        "CraftBukkit": "741a1bdf3db8c4d5237407df2872d9857427bfaf",
        "Spigot": "21fe7077d9140e0f9db01587a39c2ffec29e3ec8"
    }
}

#
Applying CraftBukkit Patches
Patching BiomeTheEndDecorator.java
Patching Block.java
Exception in thread "main" java.lang.RuntimeException: Error patching Block.java
    at org.spigotmc.builder.Builder.lambda$startBuilder$2(Builder.java:617)
    at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
    at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175)
    at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
    at java.util.Iterator.forEachRemaining(Iterator.java:116)
    at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
    at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:497)
    at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:487)
    at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
    at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
    at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:241)
    at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:485)
    at org.spigotmc.builder.Builder.startBuilder(Builder.java:568)
    at org.spigotmc.builder.Bootstrap.main(Bootstrap.java:60)
Caused by: difflib.PatchFailedException: Incorrect Chunk: the chunk content doesn't match the target
    at difflib.Chunk.verify(Chunk.java:86)
    at difflib.ChangeDelta.verify(ChangeDelta.java:78)
    at difflib.ChangeDelta.applyTo(ChangeDelta.java:44)
    at difflib.Patch.applyTo(Patch.java:43)
    at difflib.DiffUtils.patch(DiffUtils.java:70)
    at org.spigotmc.builder.Builder.lambda$startBuilder$2(Builder.java:605)
    ... 13 more

#

java version is doesnt matter

trim quest
#

this happens between 1.8-1.9.4

Applying CraftBukkit Patches
Backing up NMS dir
Patching Block.java
Exception in thread "main" java.lang.RuntimeException: Error patching Block.java
    at org.spigotmc.builder.Builder.lambda$startBuilder$2(Builder.java:617)
    at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
    at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175)
    at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
    at java.util.Iterator.forEachRemaining(Iterator.java:116)
    at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
    at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:497)
    at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:487)
    at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
    at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
    at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:241)
    at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:485)
    at org.spigotmc.builder.Builder.startBuilder(Builder.java:568)
    at org.spigotmc.builder.Bootstrap.main(Bootstrap.java:60)
Caused by: difflib.PatchFailedException: Incorrect Chunk: the chunk content doesn't match the target
    at difflib.Chunk.verify(Chunk.java:86)
    at difflib.ChangeDelta.verify(ChangeDelta.java:78)
    at difflib.ChangeDelta.applyTo(ChangeDelta.java:44)
    at difflib.Patch.applyTo(Patch.java:43)
    at difflib.DiffUtils.patch(DiffUtils.java:70)
    at org.spigotmc.builder.Builder.lambda$startBuilder$2(Builder.java:605)
slender elbow
#

intriguing

mortal hare
#

what is your guys opinion on Interface Segregation Principle
like what granularity do you guys prefer or you just straight up model interfaces by grouping behaviour independent from its use case (instead of PasswordReader/Writer you use PasswordRepository with read and write etc)
at that case, how do you mock interfaces?

trim quest
trim quest
mortal hare
#

sure what i ask how do you generally manage it, it pollutes your codebase quite quickly if you model class specific interfaces for each

trim quest
#

it is depends to your use cases.

#

There is no silver spoon in oop

slender elbow
#

for me it will depend whether i'm writing a library or framework, a service, or an end-user application

#

shit's just structured differently

mortal hare
#

granural interfaces sounds good as if you're making them as granural as one method interface just like in go, you can make use of lambda implementation but then you have massive constructors which do nothing but declare methods it uses

#

i like how programming is literally a game where you have to write shitty code no matter what you choose because every decision has pros and cons

#

it depends™

slender elbow
#

well yes

#

that's what i'm getting paid to do lol

trim quest
#

clean coders try to implement things loosely coupled and highly cohesive

pliant topaz
#

Personally I try, just as serteranon said, to create meaningful interfaces. I might have one that only contains one method, but it's easier to have this one interface to check for on backend instead of a couple dozen which could have the same funcitonality

ivory sleet
slender elbow
#

i could use a mojito rn

ivory sleet
#

what im sayin init

slender elbow
#

i'm lacking that mint punch

trim quest
#

@mortal hare for example which one is more clean to you

ivory sleet
#

That’s a very unrealistic example

trim quest
#

class A -> Represent Anemic domain entity model -> JPA entities (we call this Database entity object in DDD)
class B -> Represent Rich domain entity model -> Player, Entity etc something that has behaviors. This way behaviors are not spreaded in services.

#

they both are usefull

#

but both depends to your use case

#

if you want to fast developed product -> you go anemic

#

if you want to more maintainable system -> you go rich

trim quest
slender elbow
#

i mean

#

you don't go neither nor the other exclusively in the entirety of whatever code base you're working on

#

you mix and match depending on the needs of the current problem you're trying to solve

trim quest
#

You have to write technology-agnostic code, when you want to write code that doesnt break easily. The infra code. Developers who use this idiom and write backend APIs even count the web frameworks they use as technology.

#

persistence api is also technology

#

anemic domains are dependent to persistence apis

ivory sleet
#

In practice its also not very useful to just boil it down to a duality such as rich vs anemic, there are almost always more important factors at play.

trim quest
#

in web its pretty usefull

#

but for game dev, game modding

#

its a bit a lot of abstraction

slender elbow
#

You have to write technology-agnostic code
you certainly do not

trim quest
#

im speaking oop general.

slender elbow
#

it really depends on the problem you are solving

trim quest
#

yes it is depends

trim quest
slender elbow
#

it's not a fact lmao

#

what

trim quest
#

DDD abstract the code from technology

ivory sleet
trim quest
#

for example spring framework forces you to use its container. but you can rid of him easily with this perspective.

#

nor persistence apis

hybrid spoke
#

tbh it really sounds like you‘re throwing around with catch-phrases without any context

trim quest
#

i give resources before

#

if you want to resource

#

im not debating, im just trying to insipire

slender elbow
#

idealised textbook examples are useful in idealised textbook situations

hybrid spoke
#

inspire with false information?

trim quest
#

:))

slender elbow
#

saying that something "is a fact" doesn't make it one if you haven't worked in the field professionally

trim quest
#

k im not gonna explain more

#

im not insulting anyone, im just trying to be explain myself. im not native english speaker

#

i fallow this philosophy and trying to use them, they are very hard to understand but they are exists.

slender elbow
#

you are repeating what this or that book have said like they should be treated biblically

trim quest
#

you are right

slender elbow
#

and that's a problem

#

it's not a bible

ivory sleet
#

Serterano, DDD is certainly quite used in the industry, enterprise, but I do think if you preach about its cons and values, perhaps its worth teaching us, those that you want to inspire, about DDDs cons such as its prerequisite of a well understanding in regards to the business domain and the business requirements. Though that’s just my thoughts on it, take it-… inspirationally

slender elbow
#

they are guidelines

trim quest
#

for me DDD is the max level that OOP dev can learn atm.

#

im not expert on this, nobody is

#

because every domain has its DDD best practices

#

there are hundreds of domains

ivory sleet
#

I mean DDD and OOP are linearly independent to a great degree

hybrid spoke
#

oop is a paradigma, ddd is a design decision

ivory sleet
#

DDD becomes a religion if you try hard enough

trim quest
#

yes im not telling its silver spoon

#

i said

#

both of the domain models purpose are different -> rich and anemic

hybrid spoke
ivory sleet
ivory sleet
trim quest
#

you can use whatever fits to your needs

slender elbow
#

precisely

trim quest
mortal hare
#

if you're working in memory sure, but when it comes down to persistence from/to database it sucks

#

you still need to have anemic services for actions to orchestrate persistence between domain models and persistence apis, if you do rich domain entities from database, you end up with inefficient sql queries between the server and your application, unless you implement aggressive caching, batching etc which might clutter your codebase and make it harder to maintain than just maintaining a transaction script/service in one place and be done with it

#

my dogma is that less code = better, if its maintainable

trim quest
#

writing anemic will spread business logic into services.

#

"in larger systems"

trim quest
#

wait i wil lshow you some repo

#

ddd is basically you dont give a fck about technologies but you can implement all of it.

#

for spigot its totally waste of time because there is a spigot-api

#

you dont have to write infra code again

thorn isle
#

every time i look in here its you and that other guy arguing about anemic that triple-d that

trim quest
umbral ridge
#

hey

robust helm
#
        Vector direction = player.getLocation().getDirection();
        for (float i = 0; i < distance; i += 0.2F) {
            player.sendMessage("dirX " + direction.getX() + "; dirY " + direction.getY() + "; dirZ " + direction.getZ() + "; yaw " + player.getLocation().getYaw());
            Location loc = player.getEyeLocation().subtract(0d, 0.2d, 0d).clone().add(direction.multiply(i));
            player.getWorld().spawnParticle(Particle.CRIT, loc, 0);
        }

im trying to code bullet particles for a gun, by spawning a particle every 0.2 blocks.
When I use the code above, for some reason the direction-{x,y,z} values are 0, yaw works though

#

its called in PlayerInteractEvent

#

oh and the negativity of the direction vector is correct too, so its either 0 or -0

lilac dagger
#

you should do the following changes

#

Location eyeLocation = player.getEyeLocation();
Vector direction = eyeLocation.getDirection().multiply(0.2);
for (float i = 0; i < distance; i += 0.2F) {
eyeLocation.add(direction);
player.getWorld().spawnParticle(Particle.CRIT, eyeLocation, 0);
}

#

try this out

#

@robust helm

robust helm
#

on it

lilac dagger
#

wait

robust helm
#

shouldnt it behave the same?

lilac dagger
#

one small think

#

Vector direction = player.getLocation().getDirection(); this line should work

#

but the others i'm not sure

#

you're constantly changing the vector

#

when instead you should update the location each step by a little

robust helm
#

it works!!

lilac dagger
#

as you can see the use of objects is minimal

#

better performance too

robust helm
#

i see

lilac dagger
#

also

robust helm
#

but why didnt mine work?

lilac dagger
#

i figured it out why yours won't work

#

you multiply by 0 at first

#

so everything becomes 0

#

all 3 coords

echo basalt
#

yeah that'd do it

robust helm
#

ooooh

lilac dagger
#

of the vector

robust helm
#

im stupid

echo basalt
#

not cloning the vector

#

bleh

robust helm
#

well thanks a lot

lilac dagger
#

but my way is the better way

echo basalt
#

bleh

lilac dagger
#

it's the minimal way to not stress the gc

echo basalt
#

stressing the GC is my #1 priority

thorn isle
#

the jit is surprisingly effective at getting rid of trivial allocations like these with escape analysis

#

but that of course requires the code to run pretty hot and get c2'd and is sensitive to unrolling/inlining limits

#

even then you'd be surprised by how many aabb/blockpos allocations the jit eliminates from the server tick loop

lilac dagger
#

That's interesting

#

Good to know

echo basalt
#

if you do a heapdump and look it up you don't see that many blockpos yeah

#

it's mostly long[] which I always assume is lighting data and NOT some sort of networking leak

thorn isle
#

long array sounds like it could be block data as well since the palette container for chunk sections is backed by one of those

echo basalt
#

could be yeah

#

I wonder if they do that smart shit where it only uses as many bits as it needs

#

or if they just store palette ids as longs because fuck you

thorn isle
#

it uses only the bits it needs, more or less

#

more or less as in the nibbles can't be split between two longs, so if 64 isn't divisible evenly by the bit count, there'll be some padding

slender elbow
#

new Object() tanking my tps

worldly ingot
#

me when i new object

slender elbow
#

hell yeah

#

me using string literals as monitors :trollface:

mortal hare
#

i guess you're right

#

its a balance between coupling and cohesion

#

if you decoupled into one method interfaces you will essentially have low cohesion, low coupling system, which is harder to maintain

slender elbow
#

just use Haskell at that point

mortal hare
#

if you use meaningful interfaces you would make codebase which consists of high cohesion, medium-low coupling classes which is easier to maintain overall but a introduces some unnecessary coupling, which is ok since you can just refactor that interface whenever needs fit, its just not worth it to split it until you need it, since you usually expose interfaces and not the implementation classes to the client code

#

i should really buy that ebook

#

it only 6$ but seems like there's good tips there for good api design

mortal hare
#

just bought it, damn it is good

#

finally someone that literally understands my takes

oblique furnace
#

When I try to compile my java code It opens "Config.java" which was, as I believe, auto generated due to the minecraft development plugin and the compiling wont work. Can anyone help me compile the code?(I am still new to minecraft plugin development😅 )

noble lantern
#

When you created this during the setup phase for the Minecraft Plugin, did you select forge lol

#

Config.java is strictly forge (As well as all those classes being used)

oblique furnace
#

And a second question: where do I find the compiled file?

mortal hare
#

where did you got this color scheme

#

i dont like its blueish dark native theme

mortal hare
#

not a spigot plugin 😄

#

that's not the same

oblique furnace
#

already changed it😅

bright root
#

Hi
Would I get help here with Custom Model Data?

mortal hare
#

not even sure what Config.java does in this case

#

i think you can just delete it?

#

its used for forge mod configuration not for spigot

#

spigot bukkit api has its own configuration file api's

oblique furnace
#

looks like this now... I have compiled it but dont know where to find the compiled file😅

mortal hare
#

show me your pom.xml file

#

im not too familiar with Maven as i just use Gradle, but you should execute package maven task to produce jar file inside target directory

#

iirc you can enable package task in Maven by appending <packaging>jar</packaging> inside pom.xml file

oblique furnace
mortal hare
#

well im blind its already there lol

#

just click on package task inside maven sidebar list

#

and it should generate plugin .jar inside target directory

oblique furnace
#

It has made 2 .jar 😅

mortal hare
#

probably one is shaded and another not, but not too sure as i've last used maven like back in 2018

oblique furnace
#

one normal and one with "original-" infront

mortal hare
#

probably that's because shading maven plugin, which appends your project libraries to the .jar file, essentially makes a .jar file which contains all the classes your project needs

#

try using non prefixed one in spigot server

#

and see if that works

oblique furnace
#

ok

mortal hare
#

note that if you only want to produce .jar files you only need to invoke package task as it will invoke compile task automatically. Maven essentially has hierarchy of tasks, it usually chains them, you can also make your custom ones (99% use cases do not need that), its just a glorified interface for javac command line tool with an ability to download dependencies from the internet automatically 😄

oblique furnace
#

It worked🙂 Thanks alot for your help🤗

echo basalt
thorn isle
#

this is how it used to work, but they changed it somewhat recently so they don't carry over

#

it did make the logic a bit simpler and maybe faster, since there's no longer a need for an edge case where you splice two longs together

#

i do wonder whether the new memory segments api would allow for a split nibble to be read from two longs by just fiddling with the offsets, but based on how addressing works in hardware i suspect that'd have to be done in software anyway and might not end up being any faster

echo basalt
#

hear me out

#

instead of storing data in long arrays

#

what if we do a blockstate

#

and just compute all possible scenarios

slender elbow
# thorn isle i do wonder whether the new memory segments api would allow for a split nibble t...

https://docs.oracle.com/en/java/javase/24/docs/api/java.base/java/lang/foreign/MemorySegment.html#get(java.lang.foreign.ValueLayout.OfLong,long)

IllegalArgumentException - if the access operation is incompatible with the alignment constraint in the provided layout

you can't use the method intended to get it as a long (or any of the provided varhandles to trick around that, it's all the same api), you could however do a copy into a single long-lengthed segment and get that as a single long

#

something like

try (var arena = Arena.ofConfined()) {
  var longs = arena.allocateFrom(ValueLayout.JAVA_LONG, -1L, 0L);
  var copy = arena.allocate(ValueLayout.JAVA_LONG);
  copy.copyFrom(longs.asSlice(4L, 8L));
  long l = copy.get(ValueLayout.JAVA_LONG, 0L);
  assert (l == 0x00000000ffffffffL);
}
#

(or well it would be 0xffffffff00000000L if your platform is big endian, but lmao)

#

hm actually

#

the alignment is provided in the layout

#

scratch that

#
try (var arena = Arena.ofConfined()) {
  var longs = arena.allocateFrom(ValueLayout.JAVA_LONG, -1L, 0L);
  long l = copy.get(ValueLayout.JAVA_LONG.withByteAlignment(1L), 4L);
  assert (l == 0x00000000ffffffffL);
}
thorn isle
#

it'd be interesting to try this out, but not really tenable since the longs are sent to the client as-is, and the client will explode if they don't have the padding it expects

#

we could convert them before we send them but that'd make sending chunks quite a bit more expensive than it is right now

thorn isle
#

not sure if it's worth the tradeoff

slender elbow
#

probably not lol

thorn isle
#

and even then i sort of suspect the reads not aligned with a word boundary are handled in software behind that value layout abstraction, so there might not even be an improvement

#

could be interesting to benchmark still i suppose

#

never really know with these things without trying

slender elbow
#

thinking about using jmh: 👼 😊
setting up and running jmh: 😴 😠

sly topaz
#

I don't remember it being all that bad

#

I believe using it is harder considering you have to consider which knobs to adjust to get a meaningful benchmark

#

well, that's probably just me not being bothered to properly look at JMH's documentation in order to understand that

slender elbow
#

yeahhh

#

there are a lot of things to set up and configure and it all depends on what you want to benchmark

#

benchmarking bias something something

#

idk

thorn isle
#

it's like trying to test a random number generator

#

you can easily get numbers out of it but being confident in that they mean anything takes time and fiddling with the parameters

mortal hare
brazen ether
#

I have a problem: i just started create a plugin to add some items and blocks to my server. I create a Tomato and i want a texture with a RessourcePack but idk why, this dont work. If u have any idea, ping me or send me a MP. Thanks

sly topaz
#

if you want to set the item model, use ItemMeta#setItemModel

#

nevermind that, I read it wrong

brazen ether
sly topaz
#

I still get confused with the new and old format

brazen ether
#

oh okay

sly topaz
#

are you developing for 1.21.4?

brazen ether
dawn flower
#

if i want to display an image on a map, what should be the res of the image?

lilac dagger
#

Where do you guys learn about the jit compiler?

young knoll
#

If you want the image on a single map

#

128x128

sly topaz
#

if you want keywords to look for, I recommend just searching up java's tiered compilation pipeline and something will pop up

dawn flower
#

why is blue more purple when putting an image on a map

sly topaz
sly topaz
#

then again, as far I remember it is an 8-bit color depth palette so you're probably just seeing what the lossy conversion looks like

#

the left is a normal 24-bit depth color palette and the right is what it ends up looking like in a map

dawn flower
#

how do i convert it properly

sly topaz
#

don't bother reading the rest of the blogpost unless you want to implement their approach, the color conversion part is the important bit

dawn flower
#

k

paper viper
#

It's more like 100 colors, I forgot

#

The one they use in the forum is euclidean distance, which won't look that great if you want to display it

#

if you want better results, you should use error diffusion dithering

young knoll
#

Maps have a bunch of fixed colours

#

There’s 60 base colours which can each be in one of 4 different shades

#
  • transparent
#

That’s the full colour palette

sly topaz
#

so 241 colors if we count transparency as a color

young knoll
#

Mhm

#

Technically transparency also has 4 shades

#

But they’re all still just fully transparent

slender elbow
#

so there's like, 5 colours?

#

at least

mortal vortex
#

i dont see color

#

#endracism

left copper
#

#youmightwannaseeadoctor

echo basalt
#

They are using a weighted color conversion algorithm which can produce different results

#

it emphasizes the yellows more

#

the one thing I did, which they didn't is the whole idea of centering and overlapping frames

#

Their entire system revolves around having a single block for a single frame, while mine uses transparency to allow for the overlap of frames and for them to be offset to be in any position

#

also their raycasting algo looks off

scarlet shard
#

I need a custom worldborder so that Bedrock players can see it and I can also have a horizontal worldborder in general. My first thought would be to make it like the server MMCIsland with particles. But my minigame starts with a border radius of 1000 blocks, which would significantly affect performance, does anyone have any ideas or things I'm overlooking?

echo basalt
#

I remember working on this when I last did minigame work

#

In short it's really easy to make a fancy particle border that looks good

#

But you'd need some kind of algorithm to decide what parts of it should render

#

For example, you can say that you can render a border in a 48x48 radius around each player

#

I wrote this a while ago, might help

young knoll
#

Bedrock doesn’t have display entities, right?

#

I was thinking text display wall

echo basalt
#

don't ask what any of this means I don't remember

#

it's been like a solid year or two

spare hazel
#

Guys 2 questions:
Is it okay to host my minecraft server using docker compose or k8s
And should i have one database for each plugin/gamemode (e.g. 5 mongodb instances) or should it all be in one database (e.g. 1 mongodb instance with 5 sub DBs)

sullen marlin
#

1 database should be fine to start

young knoll
#

Mongo moment

sullen marlin
#

And yes you can host it with whatever you like

spare hazel
#

Ah nice

sullen marlin
spare hazel
#

Thank you mr spigot developer ❤️

#

So i should NOT use mongo and use something like postgresql?

sullen marlin
#

If it's just for you,use whatever you want

#

If it's a public plugin, use mysql

spare hazel
#

So like mysql has the most compatibility?

sullen marlin
#

It's the most widely used

spare hazel
#

Alright then

#

Thanks

young knoll
#

Ideally relational data should use relational databases

#

However I do understand the convenience of just shoving everything into mongo

spare hazel
young knoll
#

You can store POJOs directly in MongoDB

spare hazel
#

Whats that

scarlet shard
young knoll
#

Plain old java objects

#

Basically a class that doesn’t extend or implement anything and has basic data types in it

#

Primitives, strings, lists, maps, etc

spare hazel
#

And then you can serialize&deserialize them?

young knoll
#

Yes

spare hazel
#

Thats cool

young knoll
#

It’s similar to gson

spare hazel
#

So heres what im gon do:
Mysql: 1 instance for basically everything: authme, luckperms, friends&party, lobby gadgets
Mongodb: one instance per custom game mode: skymines, roleplay, blahblahblah

#

It would be cool to store inventory data and player data in mongodb too and make the server state fully ephemeral but i wouldn't want to go through the hassle

slender elbow
#

rare correct spelling of luckperms moment

echo basalt
#

luckyperms

mortal vortex
#

This is a shot at you @crude zephyr

crude zephyr
#

wait it's luckperms and not lucky perms?

chrome beacon
#

yes

crude zephyr
#

lmao

#

I'm stupid

slender elbow
#

lmao

brazen ether
#

Hey, one question. I started build my own minecraft server from zero. Can i build one big plugin with all features ? (more simple for me)

spare hazel
spare hazel
#

You can but if you wanna implement everything from scratch its gonna be very hard.

#

Like i get it if you are making an smp and make the features yourself

#

But if youre making a network and wanna manage perms, economy, admin tools yourself its gonna be hard

brazen ether
brazen ether
#

but my question was for server stability, idk if it's better 50plugins or 1plugin but big

spare hazel
#

You gotta leave the hard stuff to the ones who know it

#

If you got the time and resources then you can

brazen ether
spare hazel
#

Some things are too hard to make by yourself so its best to use a plugin someone else made

#

Like you cant simpky make an anticheat urself

brazen ether
#

with some logic, and by using existing open source project

spare hazel
#

Bruh

#

@mortal vortex i need backup here

mortal vortex
#

you're on ur own ayatollah

spare hazel
#

Bruh

flint coyote
#

:D

#

The question wasn't about coding skills at all. It was simply a performance question.
To answer that: Yes you can make a big monolith

spare hazel
#

You can but it will be really hard

#

You arent hypixel blud

flint coyote
#

Leave that to the owner of the server. Maybe they don't need or want an anticheat, maybe they want a challenge, maybe it's more than one developer.
The question was if they can put THEIR OWN code all in one plugin instead of multiple, to which the answer is yes.
They can still throw thirdparty plugins in where they need them

#

Technically they can even copy a full open-source plugin into their own with some adaptations.
Although that would just make maintenance a lot harder

brazen ether
mint nova
#
package pl.benycz.core.Commands;

import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.jetbrains.annotations.NotNull;

public class PlayerMessage implements CommandExecutor {

    @Override
    public boolean onCommand(@NotNull CommandSender commandSender, @NotNull Command command, @NotNull String s, @NotNull String @NotNull [] strings) {
        return false;
    }
}

how i can change the argument names like commandSender to sender? like when im importing it, i dont need to do it manually

lilac dagger
#

the only other way is if you use import the sources i think

#

it'll use the names on the parameters instead of infering them from the type

remote swallow
#

Import the sources

lilac dagger
#

ah right sources*

grand flint
#

honestly whenever @crude zephyr asks anything it just blows my mind

wooden bay
#

lucky perms

thorn isle
spare hazel
#

Luck

#

Nobody is lucky around here

echo basalt
sly topaz
oblique furnace
#

Hi, can someone tell me why it's marking the event.getJoinMessage message wrong and help me fix it?

rough drift
oblique furnace
#

oh oops😅 Thanks tho

thorn isle
#

i remember fiddling with the color conversions back before paper built in that 16mb lookup table

#

iirc i used range encoding to compress it down to 2mb, lossless and from my benchmarking it wasn't any slower than the 16mb lookup table; memory locality helps with caching

#

i also vaguely remember trying some lossy compression methods

#

let me see if i can find my numbers

#

got it down to 500kb with ~3% of input colors mapping to the wrong of the two adjacent palette colors

#

looks like i also tried an approach that wasn't o(1), requiring in the worst case searching through 13 possible colors to match to, but that was lossless and 77kb

#

i originally used it for my own map image thing but since paper bundled in that 16mb cache i figured i might as well use it since it's sitting in my heap anyway

#

i also vectorized the color matching so those 13 color comparisons were done with one or two vector register ops

#

an absolute waste of time

sly topaz
#

I am surprised you still have these projects around to take a look

#

I either have forgotten my pet projects in some cold storage that’s never going to see light again or just delete them when I am done

young knoll
#

Nah you gotta keep em all

#

You never know when you’ll need that thing you found out how to do 5 years ago

thorn isle
#

pretty much

#

having somewhat descriptive project names helps, although even then i usually end up just brute force searching for strings recursively in my projects directory

#

it does turn out to be useful surprisingly often to have old things lying around

buoyant viper
#

not that the code itself would be useful to me anymore, but the ideas would be fruitful

weak wasp
#

Thank god for easy Java decompilation, m I right?

spare hazel
#

guys is this genius or dumb asf?

vocal cloud
#

So it generates a docker compose file? Why can't it be manually created?

spare hazel
true salmon
#

tutorial for how to make a plugin ?

wet breach
#

?learnjava

undone axleBOT
#

For Beginners:

Codecademy - Learn Java: Interactive Java programming course from basics to more advanced concepts. Perfect for absolute beginners.
https://www.codecademy.com/learn/learn-java
JetBrains Academy - Java Developer Track: Learn by doing with projects and challenges. It covers Java fundamentals to advanced topics.
https://www.jetbrains.com/academy/
Udemy - Java Programming Masterclass for Software Developers: Updated courses that cover Java 8 to Java 17 features. Suitable for those who prefer structured learning.
https://www.udemy.com/course/java-the-complete-java-developer-course/

For Intermediate to Advanced Learners:

Oracle Java Tutorials: The official guides by Oracle for Java programming—great for understanding the depth of Java.
https://docs.oracle.com/javase/tutorial/
Baeldung - Learn Java and Spring: Focus on Spring Framework and modern Java technologies. Best for intermediate learners aiming to expand their knowledge.
https://www.baeldung.com/

Practice and Hands-on Learning:

Exercism - Java Track: Solve exercises and get feedback from mentors. Great for practicing coding skills.
https://exercism.io/tracks/java
LeetCode: Practice your coding skills and prepare for technical interviews with Java.
https://leetcode.com/

Free Resources and Documentation:

Java Programming and Documentation: A comprehensive collection of Java programming guides, tutorials, and API documentation.
https://docs.oracle.com/en/java/

Community and Support:

Stack Overflow: A vast community of developers. Great for getting help with specific problems or understanding concepts.
https://stackoverflow.com/questions/tagged/java
r/learnjava on Reddit: Join the community of Java learners and get advice, share resources, and discuss projects.
https://www.reddit.com/r/learnjava/

Remember: Learning to program takes practice and patience. Don't hesitate to experiment with code and participate in community discussions. Happy coding! 🎉

true salmon
#

im looking for more like a youtube tutorial because im looking to make a simple mod unless you guys dont have a command for that

young knoll
#

Mod?

#

Or plugin

slender elbow
#

yes

unreal meadow
#

So guys I wanted to create an loan system in aternos where people can loan virtual currency for 1 day and if they didn't pay on time they are /jailed

#

Is it possible?

slender elbow
#

holy shit it's tony stark

#

no way

unreal meadow
#

Point but I need help

#

I wasted my 2-3 hours

#

Creating loan system

#

And it's still not working

#

In my mc server

chrome beacon
#

Is it your plugin

unreal meadow
#

No it's on aternos

#

I am trying with my commands and better gui

chrome beacon
#

Then this is the wrong channel

unreal meadow
#

Ok

chrome beacon
#

and don't post in every channel..

unreal meadow
#

Ok

karmic sonnet
#

Im trying to make a client sided glow effect but cant figure it out. Im using protocal lib currently but everything I do just disconnects me and says im sending invalid or incomplete metadata. so can anyone help me figure out packets and how to make entities glow

im on 1.21.5 and protocal lib is on 5.4.0 (a dev build that supports 1.21.5)

chrome beacon
#

Could you show your code

#

?paste

undone axleBOT
spare hazel
unreal meadow
#

@chrome beacon

#

Question

#

Do you know shopkeeper plugin?

spare hazel
#

I know ask me

pseudo hazel
#

random tag xD

spare hazel
#

And dont mention pls

unreal meadow
#

Ohh

#

Sirry

#

Sorry*

karmic sonnet
unreal meadow
#

So yea see I have essential x economy in my server how can I make shopkeeper trade for virtual currency

#

Instead of some physical item

spare hazel
#

Thats not possible i believe

#

Are you making a roleplay server?

unreal meadow
#

Yes

spare hazel
#

If you are then making the shopkeepers trade some form of physical currency would work

unreal meadow
#

Yes its diamonds currently

spare hazel
#

Like make a bank and use essentialsx signs to convert balance to diamonds

#

Like the [buy] and [sell] signs

unreal meadow
#

Ye we have /shop which sells diamond for some rupees

spare hazel
#

No like in game

#

Converting game balance to diamonds

unreal meadow
#

Ye we have done it

pseudo hazel
#

with q custom plugin you can do a lot of things

unreal meadow
#

Aternos doesn't support tht type of shit

spare hazel
unreal meadow
#

Otherwise I would have done lot of things

pseudo hazel
#

well thats an L

young knoll
#

The free version doesn’t allow custom plugins

#

You do have skript thought

pseudo hazel
#

you can still probably do it if you have skript

#

yeah

unreal meadow
#

Skript id not working for 1.21.5

#

Is*

pseudo hazel
#

oof

#

dead plugin

spare hazel
#

And if you wanna do serious stuff you gitta get away frim aternos

thorn isle
#

lol

unreal meadow
#

Which host is free except from aternos?

thorn isle
#

you get what you pay for

young knoll
#

Skript 2.11.2 supports Spigot or Paper servers on versions 1.19.4 to 1.21.4, with tentative support for 1.21.5.

chrome beacon
pseudo hazel
#

your pc probably, but its not gonna be on 24/7

unreal meadow
young knoll
#

Oracle free tier

thorn isle
#

the server is a computer program

young knoll
#

Good luck getting one though

thorn isle
#

put it into your computer and make it run

unreal meadow
#

What's that? U can host mc server from ur computer

#

?

young knoll
#

Sure

pseudo hazel
#

yeah

spare hazel
pseudo hazel
#

what do you think the server runs on

young knoll
#

Just make sure no one has it out for you

unreal meadow
#

It's free?

young knoll
#

Well you have to pay for electricity

unreal meadow
#

That's another part

young knoll
#

And data assuming you don’t have an unlimited internet plan (Do those get offered much anymore?)

unreal meadow
#

I have unlimited data plan and electricity is not the problem

#

But can it allow tlauncher user my friends are tlauncher user

#

I'm the only one with original mc

chrome beacon
#

it can

unreal meadow
#

And what abt plugins?

chrome beacon
#

it can do that too

pseudo hazel
#

it can run any plugin you get your hands on

unreal meadow
#

Ooh

#

Dang thx

#

I ll search on it

chrome beacon
#

?bt

undone axleBOT
thorn isle
#

which one of you is going to show him how to port forward

pseudo hazel
#

ig the one downside if you want it to be on 24/7 that means your pc needs to be on 24/7

#

chatgpt can teach him how to port forward

thorn isle
#

one can hope

spare hazel
unreal meadow
#

How about I connect to railway

#

For 24/7

spare hazel
#

Railways are for trains and not minecraft servers sadly

young knoll
#

I mean I suppose you can put it on a train

unreal meadow
#

Bro railway platform

young knoll
#

Might make the ping a bit inconsistent

thorn isle
#

don't do that, it'll get run over by a train

unreal meadow
#

I connected my discord bot to it which used to run on my pc

#

And it's 24/7

#

Till now

#

It's abt to be month

spare hazel
#

I think you dont notice that its not 24/7 cuz when u turn off ut pc u cant see that its offline

grand flint
#

LMAO

unreal meadow
grand flint
#

if i dont see it offline

#

it means its online

unreal meadow
#

24/7*

grand flint
#

what r u guys even on baout

#

just go host it somewhere

#

go pebblehost it has cheap bot hosting

spare hazel
young knoll
#

Cheap is not free

#

They want free

unreal meadow
#

Aternos free hosting with potato server and 30 mins waiting

grand flint
#

ohh

#

what a bot

grand flint
unreal meadow
#

We want flexibility

grand flint
#

what

young knoll
#

I think it’s finally time to ask wtf railway is

grand flint
#

its time to ask

young knoll
#

I assume you aren’t talking about a train

grand flint
#

what this guy actually wants lmao

unreal meadow
young knoll
#

Even though I like trains

unreal meadow
thorn isle
#

he wants a loan plugin on his 1.21.5 server

grand flint
#

what kind of stupid fucking sentence was trhat

thorn isle
#

i don't quite know how we got here from there

grand flint
#

"check google what railway is"

unreal meadow
spare hazel
#

Please note that this guy wants a production ready setup cuz he said he sells in game money for da indian dolla dolla

thorn isle
#

lol

grand flint
#

W

unreal meadow
#

Railway.app

#

Go to this

grand flint
#

why

unreal meadow
#

This is tht platform

grand flint
#

if u cant even host ur bot 24/7

#

why would u need railway

young knoll
grand flint
#

i think ur focusing on the wrong things here

thorn isle
#

it's some python discord bot hosting thing i'm guessing

grand flint
#

how about make a working bot first

young knoll
#

Yeah idk how well that’ll handle a minecraft server

grand flint
#

with a good insfracture

unreal meadow
grand flint
thorn isle
#

lol

grand flint
#
Railway

Railway is an infrastructure platform where you can provision infrastructure, develop with that infrastructure locally, and then deploy to the cloud.

unreal meadow
#

I hosted my 24/7 discord bot from here

grand flint
#

good for u

young knoll
#

1GB of ram is rough for a server

unreal meadow
grand flint
#

come ill host ur bot if u ask nicely

young knoll
#

Probably the same as what aternos gives tbf

spare hazel
thorn isle
#

iirc you can sorta barely run a paper server on 1gb but you definitely have to pregenerate chunks

spare hazel
young knoll
#

Ooh aren’t we fancy

unreal meadow
young knoll
#

They used to give like 0.5

unreal meadow
#

We boosted till 5 gb

#

Hehehe

grand flint
#

500 ram boosts

#

what

unreal meadow
#

Bro

grand flint
#

i dont think ur very familiar w ur vocab

thorn isle
#

it's aternoid vocabulary

unreal meadow
#

500 mb per boost

spare hazel
unreal meadow
#

500 mb per boost

grand flint
#

bro

#

i do not care 🙏

spare hazel
#

Just dont say ur namr is jishuana

unreal meadow
#

So like 2.5 gb for 5 boost

grand flint
#

it will be a good prank

young knoll
#

I mean that’s not even my name

unreal meadow
#

😭 I need loan system for aternos which I can't do using my commands plugin too

thorn isle
#

well

#

eyeballing your situation i'm not sure if there's a way to get what you want without forking over some money to someone

young knoll
#

I mean skript claims to have tentative support for 1.21.5

#

Whatever that means

unreal meadow
#

What will skript do

#

Like I have to add .yml files right?

thorn isle
#

it will let you write a loan system, but it will most likely be you learning skript and writing it yourself

young knoll
#

Skript is basically a full programming language

#

Despite being a bit strange

thorn isle
#

you could try browsing spigot for a premade loan skript and see if any match your requirements

spare hazel
unreal meadow
#

Ok thx

thorn isle
#

like 80% of the resources on spigot are skript apparently

grand flint
young knoll
#

Well it is Turing complete

spare hazel
thorn isle
#

one of these days aternos is going to put a limit on the number of skripts you can load and the entire skript ecosystem will collapse overnight

young knoll
#

Granted if you’re going to learn skript I don’t see why you wouldn’t just learn java

young knoll
thorn isle
#

🤡

spare hazel
young knoll
#

They only give you like 4 hours a day for free

#

But you can use custom plugins so there’s that

minor urchin
#

minehut used to be free

cursive kite
#

How do I stop players from picking up arrows?

#

My Attempt:

    public void vanishPickupItem(PlayerPickupItemEvent event) {
        User user = Server.getUser(event.getPlayer());
        if (user.isVanished())
            event.setCancelled(true);
    }```
worldly ice
#

use PlayerPickupArrowEvent instead of pickup item

cursive kite
#

When was that added?

worldly ice
#

1.12? not entirely sure

#

it didn't exist in 1.8

#

it looks like it was added in 1.9

noble niche
sly topaz
cursive kite
#

I just dont want players in creative picking them up

#

The pickup event works for gm 0 cancelling but not in gm 1

sly topaz
#

Then set the pickup status

rugged stream
#

NEED MY PLUGIN TAKEN DOWN I WAS TRYING TO POST IT FOR $ AND NOW I CANT EDIT OR DELETE IT PLEASE DM ME STAFF

worldly ice
#

i believe you need to turn on 2FA to update plugins on spigotmc

icy imp
#

lmao

twin venture
#

hi , what is this? (write-behind queue) ?

#

and how i can use it for saving data into database?

drowsy helm
wild zenith
#

looking for a good developer can make towny hes own plugins we have pre made server + list

young knoll
#

?services

undone axleBOT
mortal vortex
fickle mantle
#

whats the most efficient way to destroy a block a few seconds after it was placed? I don't think a Scheduler for each placed block is a good idea

cobalt peak
#

Hellooo does someone know how to add unicodes without shadow in the 1.21, obviously with a resurce pack

young knoll
#

You could use a single scheduler and timestamps/instants

thorn isle
#

doesn't make a practical difference at such a low volume of tasks

#

the bukkit scheduler is kind of shit, especially for one-off tasks, but even then you'll need hundreds or thousands of one-off tasks per tick to make a dent in timings from scheduler overhead

hybrid spoke
#

then wait until users find out

fickle mantle
#

so if 15 players spam blocks

thorn isle
#

that'll be at most 15 tasks per tick

fickle mantle
#

you mean it wont affect my performance?

thorn isle
#

the impact is negligible

#

and cooking up your own scheduler will probably just perform even worse than the bukkit scheduler

hybrid spoke
#

go with the save solution, not the lazy one. having a central space where your tasks are handled is better anyways maintenance wise

#

what jishuna told you is your way to go

fickle mantle
thorn isle
#

the bukkit scheduler api is fine for things like these, there's no point to creating your own scheduler for it

trim quest
#

anyone knows how to generate javadoc for spigot server jars? i mean for remapped internal stuff NMS & OBC

thorn isle
#

you'll just have to maintain and benchmark your own scheduler rather than gain any benefit from it

trim quest
#

im using decompilers atm but need javadoc, ( i dont want spigot-api javadoc )

chrome beacon
#

There is no javadoc for nms

trim quest
#

im observing jd-cli but dont know how to use it.

#

there is way to generate javadoc from jars

chrome beacon
#

Do you just want a list of methods

trim quest
#

i want to see that which class implement which

chrome beacon
#

?mappings

undone axleBOT
chrome beacon
#

^ should show inheritance of classes

trim quest
#

thanks

#

this would help actually, im looking for this website for a 2 day.

ancient vapor
#

Hi how to use dialogs on a plugin, is there any documentation? And is it possible to use dialogs dynamically? Basically, I want to be able to create buttons as I want from Java code.

pseudo hazel
#

iirc the api isnt done yet

hybrid spoke
#

dialogs api?

pseudo hazel
#

yes

#

the 1.21.6 dialogs

hybrid spoke
#

damn i missed stuff

#

can i imagine it as typical UI dialogs or what exactly?

pseudo hazel
#

i guess

#

oh wait it looks like it may be done actually

#

the dialog is defined in bungee

hybrid spoke
#

oh thats cool

pseudo hazel
#

player.showDialog

pseudo hazel
#

depending on how dynamic we are talking

pseudo hazel
alpine solar
#

$800?

#

Where

echo basalt
#

Any idea if changing the damage in EntityDamageByEntityEvent can affect ItemDamageEvent

#

because ts aint firing when someone takes damage

trim quest
#

Anyone knows which classes should i look when i learning how nms network (a.k.a packets) works

slender elbow
#

it depends, sending packets or intercepting incoming/outgoing packets?

echo basalt
#

I removed my listener entirely and items don't take damage when I fuck with the damage event

slender elbow
#

hm, I wonder if there are resources in the spigot forums for that

trim quest
#

i want to learn both.

slender elbow
#

I've heard good things about PacketEvents library, but I've never used it myself

trim quest
#

today i observed Packet, PacketListener, PacketFlow, ConnectionProtocol etc

slender elbow
#

no no, PacketEvents

#

in my experience protocollib is kind of.. meh

pseudo hazel
#

packetevents is goated

slender elbow
#

you can totally deal with internals yourself but many people seem to like PacketEvents

thorn isle
#

these days i've sort of started to lean towards just injecting into the netty pipeline myself and using nms to mess with the packets

echo basalt
#

apparently my issue has to do with the damagemodifier api

#

calling setDamage fucks with ALL the modifiers

eternal night
echo basalt
#

and that affects how much item durability the damage does

slender elbow
#

typical broken api

thorn isle
#

ever since paper's mojmapped server builds i completely abandoned using protocollib or any sort of wrappers for the packet classes themselves, and only used protocollib to intercept them

slender elbow
#

yeah only reason I haven't used PE is because paper is just mojang mapped + channel init listener hook so it's dead easy to work with that

#

but if I had to work for spigot, well, I'd refuse lmao

#

otherwise I'd go for PE

young knoll
#

I’ll spigot your paper

thorn isle
#

💀

echo basalt
#

bro fuck this damagemodifier api can't even set the damage without affecting durability

#

got me fucked up

#

api older than half of us

young knoll
#

Isn’t that api deprecated

echo basalt
#

still used internally

#

it's been deprecated for ages

thorn isle
#

i always had a gut feeling something like this would be the case and avoided the api from afar

#

i'm willing to bet you're almost better of calculating and applying all damage yourself with your own damage modifier system

echo basalt
#

I do that

#

but it just calls event.setDamage

#

which fucks with item durability

#

with fucks with something else

#

I don't need this crooked system but I also don't want it fucking with my item durabilities

#

in this case I make the damage zero because some ability mitigates it

#

shouldn't make the armor unbreakable

mortal hare
#

im wondering if there's any implications splitting your fat interfaces into slim ones and then using type parameter to specify the narrowed type for the client class to depend on, like this:

@NullMarked
public class CachedPasswordRepository<T extends PasswordWriter & PasswordReader & PasswordChecker> implements PasswordWriter, PasswordReader, PasswordChecker {
   private final T repository;
   private final LoadingCache<UUID, Optional<String>> cache;

   private CachedPasswordRepository(final T repository, final LoadingCache<UUID, Optional<String>> cache) {
       this.repository = repository;
       this.cache = cache;
   }
   // now you can access only read, write and check methods for password store
   ...
}

what do you guys think of this kind of go-ish approach where the class doesnt care what implementation or interface it is as long as it implements atomic interfaces it accepts it

#

you can future proof your code in a way you dont hardcode fat interfaces and only provide interface type which is really needed for implementation

#

kind also works with ISP principle of SOLID

#

its the best of both worlds, you can keep your API contract future proof by not tying it into bigger than needed interfaces and also encapsulate it for internal implementations if specific implementation relates operations between each other (for example caching reusing the same cache object, or database operations by relying on the same datasource reference/connection)

#

also you dont need to come up with weird names for such implementation specific interfaces

lilac dagger
#

i think this looks more complicated than it has to be

mortal hare
#

its like in go, where you declare what you need in the implementation side:

type Reader interface {
    Read(p []byte) (n int, err error)
}

type Writer interface {
    Write(p []byte) (n int, err error)
}

func process(rw interface {
    Reader
    Writer
}) {
    // You can call both Read and Write on rw here
}

that way you declare what you only need in the code unit, sure this looks complicated, but then you have the ability to not tie in the implementation specifics into higher level class since you declare the contract in the client class not outside of the class

#

you can also design narrow mocks for specific use cases without implementing whole fat interface, you can also implement one fat interface mock and reuse it since it accepts any interface which has corresponding functional interfaces extended

icy imp
#

within constraints this is actually a pretty elegant approach.

mortal hare
#

this looks very flexible, imagine if new collections api would be made of atomic functional interfaces like Addable, Iterable, Deletable, Clearable, Readable, Writable etc, then you declare what you want on the class. for example you can make immutable collection which you can only read via static factory methods like this:

var collection = Collections.builder(Foo.class)
  .add()
  .contains()
  .build();

and then use specific collection like this:

public <T extends Addable<Foo> & Containable<Foo>> add(T collection, Foo foo) {
  if (!collection.contains(foo)) {
      collection.add(foo);
  }
  collection.remove(foo) // compile time error since type parameter doesnt infer Deletable functional interface
}

the implementation of collection could be JRE vendor specific it can either downcast from AIO collection or implement specific one using some kind of chaining

#

i wonder if there's a lib like this yet

icy imp
#

hmm

slender elbow
#

that just looks annoying to use for client code ngl

icy imp
#

I see you getting forced back to using combining interfaces

mortal hare
#

why, it just that type infers of IDE's would probably struggle, but its future proofing your code dependencies to the narrowest types possible

icy imp
#

you cannot polymorphically store or pass around collections like this

mortal hare
#

you can supply more fatter collection interface and it will still accept

mortal hare
icy imp
#

You're forced to propagate the generic type parameter everywhere tho

mortal hare
#

is that bad tho

slender elbow
#

if java allowed for type aliasing and declaring union types on 3rd party types, maybe, but otherwise, what shaikko said

slender elbow
icy imp
#

highly annoying

slender elbow
#

having to write the same thing over and over again

mortal hare
#

maybe java spec could introduce some syntax sugar to this but hell i like this

#

lets see if i could utilize this properly in my plugin

slender elbow
#

at that point i'd rather just use another language that allows for this more nicely

#

like scala

icy imp
#

^

slender elbow
#

this is not the kind of design that would be easily taken in java

#

and that's fine

#

it fits in other languages so i'd rather just use them in that case

icy imp
#

this got me thinking about witness pattern/phantom types

#

Slick does this I believe, think it would be enormously overkill for this.

minor urchin
#

Hey dumb question, but what event fires when a player clicks a bounding box

#

is it PlayerInteractEntityEvent

young knoll
#

Yes

slender elbow
#

except for armour stands where it calls PlayerInteractAtEntityEvent

hard socket
#

whats a good way to get an area that is in the edge of my set of areas

#

AAAA
AAAB
AAAA

#

like in here I want ot get B

#

each area has a BoundingBox

paper viper
#

what do you mean, like find the boundaries?

hard socket
#

I want to get the whole thing

#

the boundigbox

buoyant viper
buoyant viper
#

oh :(

hard socket
#

my example was not exactly great

#

there is a scenraio that it will look like this

AAA
AAAB
AAAAAAAAAAAA
A
A

mortal vortex
#

Wonderful depiction

hard socket
#

there isn't exactly a central area

hard socket
#

my goal is to get all the areas in the edhe

young knoll
#

Would that not be every area in the example

hard socket
#

is this example yes

young knoll
#

Every one is adjacent to at least one non-area

#

Then what is B

hard socket
#

AAAAAAAAAA
AAAAB
AAAAAAAAA
AAAAAAA

young knoll
#

So do you want every one on an edge

#

Or specifically B

hard socket
#

well if I can get B I can get every edge

young knoll
#

For each box, check if it is surrounded on each side by another box

#

If it isn’t, it’s on an edge

#

(Or corner)

icy imp
#
    check north, south, east, west neighbors
    if any direction has no neighbor:
        A is an edge area```
hard socket
#

how do I check the neighbors

icy imp
#

I use R-tree spatial indexes in my plugin

#

thats probably highly overkill for what it sounds like you are trying to do. If you provide more context I can point you in the right direction

#

There are many ways to do what you are asking, not all are good for each use case

#

I would suggest maybe doing some research into how you could implement this for yourself, and if you have specific questions, ask them here. this is not really an area where we can just give you code solutions to the problem with minimal context.

hard socket
#

I just want to be directed to the right direction, I don’t need the code

#

Well thanks for the help

#

I will do some research

hybrid spoke
#

aha, 4 am realization. right direction to research, not anything ingame

#

we're dumb @icy imp, i spotted you

icy imp
#

I would look up boundry detection, spatial adjeceny queries, etc

#

pathfinding is not this

hybrid spoke
#

yeah figured, but tired it sounded like it lol

icy imp
#

R tree does this very well, but requires some knowladge

#

to implement properly

digital moat
#

I'm pretty new to development but love trying out new things. I had a couple of questions about dialogues and their availability on Spigot.

Why are dialog only on Bungeecord? Will they be added to the Spigot API? How do I use them? These might be silly questions, but I'm still learning!

young knoll
#

The bungee chat api is part of spigot

digital moat
#

oh ok

young knoll
#

Player#showDialog

#

Or openDialog, something like that

digital moat
#

yeah

#

ty

#

All the Bungee API ?

young knoll
#

Only the chat api

digital moat
#

ok

young knoll
#

?jd bcc

undone axleBOT
digital moat
daring light
#

If I wanted to disable another plugin's EventHandlers for a specifc event for a specific condition, how would I go about doing that? I need to override McMMO's EntityDamageByEntity EventHandlers to not modify the damage in specific scenarios

#

I already tried unregistering the RegisteredListeners of the event, however that does it permanently and makes it so that their EventHandlers don't listen for any subsequent EntityDamageByEntity event, which isn't what I want

#

I thought about passing the event manually to their EventHandlers, but they're not static, so I can't do that

sullen marlin
#

There's not a built-in way to interfere with other plugins event listening.

sullen marlin
daring light
# sullen marlin Can't you keep it when you unregister it? Not sure what you mean by not static

Ah, I meant that the EventHandlers aren't static methods, so I can't just call them directly. I did find a possible solution though. McMMO offers constructors for their listeners, so I did it this way:

...
        for(RegisteredListener listener : EntityDamageByEntityEvent.getHandlerList().getRegisteredListeners()){
            if(listener.getPlugin().getName().equals("mcMMO")){
                EntityDamageByEntityEvent.getHandlerList().unregister(listener);
            }
        }

        mcMMO instance = (mcMMO) Bukkit.getPluginManager().getPlugin("mcMMO");
        EntityListener listener = new EntityListener(instance);

        mcmmo_entity_listener = listener;


    }


    public static void passEventMcMMO(EntityDamageByEntityEvent event){
        mcmmo_entity_listener.onEntityDamageMonitor(event);
        mcmmo_entity_listener.onEntityDamageByEntity(event);
    }
rotund ravine
#

Why not

daring light
daring light
rotund ravine
sullen marlin
#

Why can't you just keep and call the listener you got from the loop

daring light
rotund ravine
#

Basically just overwrote an executor.

So u could take out mcmmos executor, and package it up in a nice package of ur own with some conditional check of whatever u want and simply only invoke the mcmmo one if the check passes/fails

trim quest
#

guys SPI or reflection ?

slender elbow
#

SPI all the way, it is the clean and intended way of, well, finding and choosing a service provider
it might use reflection under the hood (it does, but that's not the point lol)

dark moth
#

i wanna make a dropkick ability. but i cant decide if i should use animations (idk how they work) or go back to sketchy ahh armorstands and #setPose thingies

young knoll
#

What animations

alpine solar
#

What's the right way to detect the java version a server is running?

slender elbow
#

Runtime.version()

alpine solar
#

Isn't that like java 9+?

slender elbow
#

sure

#

what about it?

alpine solar
#

Well yeah

#

That's the problem 😔

#

I'm on 1.8 😔

slender elbow
#

:p you asked "what's the right way to detect the java version", and, well, that's the right way

#

in that case System.getProperty("java.version") probably, but idk the format of that in java 8

alpine solar
#

Thanks

#

I was gonna note both either way

slender elbow
#

i mean if the Runtime class exists then it's definitely java 9+ so there isn't much to test if it doesn't exist, it's just java 8

#

err, the method Runtime.version(), not the class

trim quest
#

what is the proper way to configure SPI in DIST Project?

#

i mean we have to add meta-inf stuff but how to configure it in shade plugin?

empty comet
#

Still didn't find anything about that 😅

kind hatch
trim quest
#

meta-inf should be in each sub-module right ? Because all nms sub modules have my api as dependency

zealous osprey
#

finest use of OOP design pattern

#

Ah you used it as a submodule; Sorry, didn't see that

empty comet
kind hatch
#

Ah, looks like all those new flags were added in 1.21.5

kind hatch
oblique furnace
#

Is there a way, that I can kill a player if he does something specific? If yes, what is the code to do so?

oblique furnace
#

It should just kill the player that does a specific thing

chrome beacon
#

Either set the player hp to 0 or deal damage to them

wooden bay
#

Try using player.setHealth(0.0)

oblique furnace
#

ok, thanks

empty comet
slender elbow
#

hide_additional_tooltip should work fine

#

what's your current code like?

#

also output of /version

rotund ravine
empty comet
empty comet
# slender elbow what's your current code like?
EnchantmentStorageMeta meta = (EnchantmentStorageMeta) book.getItemMeta();
...
meta.addItemFlags(ItemFlag.HIDE_ENCHANTS, ItemFlag.HIDE_ADDITIONAL_TOOLTIP, ItemFlag.HIDE_ATTRIBUTES, ItemFlag.HIDE_UNBREAKABLE);
...
book.setItemMeta(meta);
return book;

and i'm running paper latest 1.21.4, but coding on the actual spigot api, not the paper one.

#

also feel free to ping me if you reply, otherwise i won't see your messages 😅

eternal night
#

running on paper is what could be the issue omegaroll

empty comet
#

Since when? i've worked like that since the 1.8 days, so everyone can use my plugins even if they're on spigot or paper

eternal night
#

paper hardforked from spigot in version 1.21.4

empty comet
#

oh ffs, why would they do that

#

it's gonna be impossible to maintain two apis

eternal night
#

read their blog post on it

#

tl;dr for this support discord tho, replicate stuff on spigot not on paper even if you are using the spigot plugin API

empty comet
#

yeah well i can't work like that, it's already hard maintaining a multi-version plugin without breaking anything on ONE api, and now i need to actually compile and maintain my stuff agains't another api who's gonna change everything

#

ffs i hate changes

wooden bay
#

drop old versions ez

eternal night
#

Well, stick to either paper or spigot then.

#

or do the extra work

echo basalt
#

petition to make a fromHex method on bukkit's color class

#

fucking java awt color always assume the alpha as 255 when I call Color.decode

wooden bay
#

Who even uses old versions I pretty sure people use mostly 1.8 or latest

eternal night
empty comet
echo basalt
#

and bukkit's color just shits itself instead of ignoring it

#

so I have to write this ugly code

wooden bay
#

ew

echo basalt
#

ew

empty comet
echo basalt
#

bukkit my day1 op

eternal night
#

you only do double the work if you want to support both

#

(not that the paper and spigot API have diverged a lot since the hardfork, the things diverging is new API added to spigot and paper respectively)

empty comet
#

yeah that's also why i don't understand my code not working, it should be the first version from the hardfork (and the itemflags didn't change since like 1.13 iirc)

#

i don't think paper changed much with their first version hardforked, but i could be wrong ofc

empty comet
eternal night
#

for enchantment bookes specifically, HIDE_STORED_ENCHANTS is the thing you'd want to add

wooden bay
eternal night
#

this one

empty comet
eternal night
empty comet
eternal night
#

uh

empty comet
#

and they didn't change the itemflags on .4, it's still the old system

eternal night
#

probably a thing in that version too?

#

idk how to get spigot javadocs for older versions

eternal night
#

Welp

#

rip

empty comet
#

ffs paper changed it on their first hardfork

empty comet
#

it's a difficult issue

#

anyway guess i'm dead for that issue, i can't rewrite an entire plugin for a new api and re-check thousand of lines for next week

slender elbow
#

you don't need to check thousands of lines

eternal night
#

I mean, at least for 1.21.4 the solution should be easy enough still

slender elbow
#

it's not like the paper api has changed in its entirety since hard fork

empty comet
#

yeah but i need to support both 1.8 and 1.21.4

eternal night
#

check if you are running paper, ItemFlag.valueOf("HIDE_STORED_ENCHANTMENTS"), otherwise HIDE_ADDITIONAL

slender elbow
#

that still doesn't mean you need to check thousands of lines lol

echo basalt
#

anyone versed in the cloud command framework? I'm trying to make an greedy list of strings that come from a specific collection

#

it dies after the first input

#

and I think it's something to do with suggestions

empty comet
#

anyway it's fine, it's just a small thing, but now i'm worried about other things

slender elbow
#

as time goes on, the APIs will be more and more divergent since they will differ on new API features

#

existing things won't really change for quite a while

eternal night
#

|| ItemFlags seem to disagree run ||

wooden bay
#

Such depth

empty comet
#

yeah they said that but look, itemflags changed on the first version of the hardfork.

echo basalt
#

itemflags my bae

#

only api worse tha nitemflags is damagemodifier

eternal night
#

well that system diverged even further in 1.21.5

#

idk spigots item flag stuff now is a giant list of all data components types

empty comet
#

i'm also using damagemodifier 💀

wooden bay
#

cooked

empty comet
ancient vapor
#

How to handle items resulting from the Shift click event, I want to get the distribution of items in an inventory after the Shift click and modify them

thorn isle
#

until i eventually forgot to add an if check somewhere that made the plugin explode on spigot, and after not checking the resource page for a few weeks I found it was deleted with seemingly no option for recovering it

#

it was something of a shame, but that particular plugin was at the end of its lifetime anyway, since fucking billy stole the entire feature into purpur, so i didn't bother making a fuss about it