#development

1 messages · Page 94 of 1

river solstice
#

or wdym by "like that"?

worn jasper
#

I have seen it using super, not this("sus")

#

super("sus") is what I know and use

#

I have never heard of using this

pulsar ferry
#

You've never used a secondary constructor?

worn jasper
#

but I always used super lol

river solstice
#

this(...) calls second constructor

#

not super

pulsar ferry
#

You can't super to a primary constructor

worn jasper
#

oh

#

wait wdym by primary and secondary constructors

river solstice
#
class Child extends Parent {
    Child() {
        this("Child without args"); // Calls "Child(String args), similarly to new Child("foo");
    }
    Child(String args) {
        super(args); // super();

    }
}
#

maybe that's clearer

pulsar ferry
#
class MyClass {
    String arg;

    MyClass() { // secondary
        this("a string");
    }
    MyClass(String arg) { // primary
        this.arg = arg;
    }
}

MyClass() // calls secondary
MyClass("hi") // calls primary
worn jasper
#

ah I see

river solstice
#

the one that's responsible for setting fields/calling super is technically called “master constructor” or “canonical constructor” iirc

worn jasper
#

wait I feel like I already did this but why don't I recall using this?

#

tf

#

I already had cases like this several times...

river solstice
#

maybe you had it like

    MyClass() { 
        this.arg = null; // not this("foo");
    }
    MyClass(String arg) { 
        this.arg = arg;
    }
worn jasper
#

nono

#

I called the primary constructor

#

ah

#

probably called new MyClass(...) and returned it

#

wait

#

no

#

idk

pulsar ferry
#

What

worn jasper
#

I have actual no idea

river solstice
#

what

worn jasper
#

trying to find a place where I might have had more than a single constructor

unkempt kiln
#

With regards to Polymorphism, what's the purpose of instantiating an object of the subclass and a parent class.

For example:
BankAccount | Parent Class
CheckingAccount | Subclass
name | object name
Code:
BankAccount name = new CheckingAccount();

worn jasper
#

the other examples I have is when I call super in the child with different parameters

#

depending on constructor ofc

river solstice
worn jasper
#

An example for the SavingsAccount is if it still needs all the methods from BankAccount but needs an additional field/method for interest rates

#

or smt similar

torn heart
dusty frost
river solstice
dusty frost
#

i moreso mean like, ArrayList

river solstice
#

iirc it can be forced via .<Type>of(...)

#

or just use raw

dusty frost
#

like, List.<ArrayList>of("test", "test2");?

river solstice
#

🐸

#

no I meant for subclasses

dusty frost
#

ArrayList is a subclass of List

river solstice
#

fk its hell typinf on phone

dusty frost
#

yeah i'm not even talking about generics or anything lol

#

just that you're upcasting ArrayList or whatever to List, so that you can use whatever list implementation you want (aka polymorphism)

river solstice
river solstice
dusty frost
#

oh it totally would

#

it just wouldn't be useful

river solstice
#

hmm

#

alr I might be forgetting something

dusky harness
dusty frost
dusty frost
dusky harness
#

Oh lol

dusty frost
river solstice
#

in List.of

pulsar ferry
minor summit
dusty frost
#

like, Object is a supertype of every object, including String

minor summit
#

youre so right babe

sterile hinge
torn heart
#

^

sterile hinge
dusty frost
# sterile hinge hm?

in kotlin, you put type parameters after the variable/method name, like in TypeScript

sterile hinge
#

Not at the declaration

dusty frost
#
fun gamer(slot1: Gamer, slot2: String): String {}```
#
val gamer: String = "hey guys"```
dusty frost
#

do you mean the generic variables?

sterile hinge
#

Type parameters are placed before the name of the function

#

It‘s literally there

torn heart
#

that's not what they were referring to

dusky harness
#

I think star misunderstood your message but I don't get how this has anything to do with what matt said either 🥲

torn heart
#

in kotlin you have like

Object.something<Type>()

torn heart
#

which is what the reply was for

sterile hinge
#

While Java‘s design is consistent there

dusky harness
#

ok now I'm super duper confused

torn heart
#

it's insignificant 😭

sterile hinge
#

Doesn’t seem to be insignificant to Matt

torn heart
torn heart
dusky harness
#

oh wait

#

oh it was because star put it

sterile hinge
#

Java does

dusky harness
#

o

#

ngl I've never seen that before

#

until now

#

I've only seen it in the form of constructors (like new ArrayList<String>())

#

why is it inconsistent????

sterile hinge
#

The thing behind the class name belongs to the class, not the method/constructor

dusky harness
#

I guess either way it creates some sort of inconsistency
I much prefer kotlin's format though

sterile hinge
#

I don’t see where there is inconsistency in Java

#

In fact, how else would you write explicit generics for a generic ctor?

dusky harness
#

new ArrayList<String>()
vs
<String>method()

if you take out the new it becomes ArrayList<String>() <String>method()and if you consider that ArrayList() is calling a constructor, which is a method, meaning that they're both methods while passing in a generic as well (yes, even if the generic is tied to the class), it is inconsistent with each other

#

vs ```kt
ArrayList<String>()
method<String>()

dusky harness
leaden sinew
sterile hinge
#

And I guess Kotlin doesn’t have generic ctors

leaden sinew
#

This is why Skript is the best language

#

No debates about generics

dusky harness
dusky harness
dusky harness
sterile hinge
dusky harness
#

and I guess that's why we move on to skript!

#

🎉

torn heart
#

I got a 40% performance improvement by improving cache locality the other day

#

was very happy

sterile hinge
#

The only acceptable languages are Lean4 or Haskell

dusky harness
#

would've gotten another 40% if you used skript

ok fine I'll stop

#

I've never even heard of cache locality tho-

#

👀

torn heart
#

placing data closer to each other in memory so that CPU is more likely to have it cached

#

I loaded from a list into a flattened FloatArray before doing the processing

#

and bam

#

40% perf improvement

#

including loading step

dusty frost
#

i've heard good things

torn heart
#

what about dreamberd

dusty frost
#

and they have a cute mascot

sterile hinge
#

But nice improvement

torn heart
sterile hinge
#

Yeah I mean you definitely at least halved the memory reads

#

Most likely you even cut it to a third

torn heart
#

it was actually way more

#

since it was a list of objects which held references to other objects

#

which were disjointed across the heap

sterile hinge
#

Yeah I mean when pulling a float value from a Float array you'll have to

  • read the (compressed) pointer from the array
  • read the (compressed) class pointer from the Float object
  • read the actual value
    That's the bare minimum assuming the JIT can get rid of everything else (or hoist it out of the main loop at least)
#

unless you actually have random access, then there will definitely be more reads

torn heart
#

I'ma just check the assembly for it actually lmao

#

no reason to guess

sterile hinge
#

I assume FloatArray is float[], in that case it's not boxed

torn heart
#

yes

sterile hinge
#

I was talking about the List<Float> approach

torn heart
#

oh I wasn't ever doing that

#

I had a List<Contact>

#

which held more data

#

as fields

sterile hinge
#

oh I see

#

yeah then there are even more indirections

#

on top of cache misses you might also get bottlenecked by your load/store ports then

torn heart
#

even with FloatArray approach

#

at least it seems to be

#

multi threading causes no impact on performance

#

despite proper load sharing

#

and no false sharing and no sync stuff

sterile hinge
#

hm but different cores should have different ports

#

just SMT/Hyperthreading would still suffer

#

but in that area you'll have to look at the generated assembly code and use perf I guess

torn heart
#

I'm on Mac ):

#

can't see info about cache misses or more detailed stuff

torn heart
#

I'm loading 44KB of data per thread

sterile hinge
torn heart
#

doesn't seem to be

#

only for xcode applications

torn heart
sterile hinge
#

maybe the memory bandwidth gets exhausted, but that would be surprising tbh

torn heart
#

since my tasks are parallel but have to be run serial at a higher level

torn heart
torn heart
#

this might actually work

#

cause I have like:

repeat(32):
run_some_in_parallel()

#

so cpu pinning might improve cache access a lot...

sterile hinge
#

but generally aarch64 might not get super optimized by the JIT, it's still rather "new" compared to the x86_64 backend

#

oh you also have performance and energy cores?

torn heart
#

yeah that's why I've been trying to as low level as possible (tho ofc testing vs JIT always) to get the performance I want

torn heart
#

running off low battery mode

sterile hinge
#

Do they have the same instruction set?

torn heart
#

but I know that's a possible issue

#

I would assume so ?

#

their differences are cache size and clock speed mostly from what I understand

sterile hinge
#

current Intel generations have a smaller instruction set for e cores (e.g., no AVX512), not sure about what apple is doing

torn heart
#

I have an M1

#

but also only 128 bit SIMD ):

#

))):

sterile hinge
#

sadge

torn heart
#

well I learned a lot while tryna get this all working

#

wrote a very fast graph coloring impl and now I'm not using it 😭

sterile hinge
#

wdym very fast graph coloring

#

did you find a polynomial algorithm? :p

torn heart
#

nahhh

#

just a purely bit-based greedy impl

#

maybe not "super fast"

#

but much faster than my first impl

#

and more memory efficient

torn heart
#

I was computing graph coloring for 1000 objects w around 500 contacts in 400us, but most of that was just memory stuff

#

greedy impl is dead simple, can't really do much better

torn heart
#

the whole shebang

sterile hinge
#

if you have some specific subset of graphs there actually might be a polynomial (or even linear) algorithm

torn heart
#

I'm using a linear algorithm

sterile hinge
#

🤨

torn heart
#

greedy legit just chooses first color which isn't taken

#

it has no optimality guarantees

#

but for physics engine it works remarkably well

sterile hinge
#

Oh you don't care about the number of colors or what?

torn heart
#

rigidbodies don't have much issues w that

#

I stayed usually at 3-4 colors for 1000 object pile

#

which is basically optimal

sterile hinge
#

yeah that's good I guess

#

I assume the M1 also doesn't have any halffloat/float16 instructions

torn heart
#

it was actually suspiciously good

torn heart
#

i would have noticeably worse instability

torn heart
sterile hinge
#

I mean if you have fast conversion then storing float16 but calculating with float might be good enough

torn heart
#

I would have to transform and apply an offset to the values to make them close to 0

#

which mightttt be a bit better

#

but ngl I dunno if it's worth the time for thet

sterile hinge
#

probably not

torn heart
#

you can't just do that with velocity for example

river solstice
#

maybe I was mixing up it with

List<SomeClass> someClassList = ...
List<Object> objectList = someClassList;

but that's just List<SomeClass> not being subtype of List<Object>

torn heart
#

wouldn't it work in java too

#

forgot

#

I might be mixing smth up

#

yeah it works in kotlin

#

ah yeah but not in java just like that

#

covariants!

river solstice
torn heart
#

yeahhh I forgot

#

I'm used to Kotlin covariants

dusty frost
#

mmm kotlin

#

my #1 wish in life would be to use Kotlin at my work instead of stinky Java and JSF 😔

icy shadow
#

It shouldnt work

pulsar ferry
sterile hinge
#

Luckily it‘s barely needed

minor summit
#

otherwise you could just do something like

List<Integer> ints = ...
List<Object> objects = ints
objects.add("not an int!")
println(ints.getLast()) // ClassCastException !
#

which you cannot do with a List<?>

neon pewter
#

i'm using JOLM math and when i try to apply additional transform scaling it break the rotation (even when the scale value is 1)

        if (isTransformed) {
            Vector2f scaledWorldSize = new Vector2f(worldSize).mul(scale);
            transformMatrix.translate(pos.x, pos.y, 0.0f);
            transformMatrix.rotate(Math.toRadians(rotation), 0.0f, 0.0f, 1.0f);
            transformMatrix.scale(worldSize.x, worldSize.y, 1.0f);
            //transformMatrix.scale(scaledWorldSize.x, scaledWorldSize.y, 1.0f); // apply this line instead of previous break rotation
        }

So how can I apply additional scaling without breaking the thing ?

river solstice
#

what if you put scale before rotate and translate

#

also try resetting matrix transformMatrix.identity() (before applying transformations)

#

@neon pewter

neon pewter
# river solstice what if you put scale before rotate and translate

this is what happen when putting scale first, I heard that for 2D you do SRT, so for jolm the order is TRS (apparently it apply in reverse ?)

    private void genVertexProperties(float[] target, int index) {
        SpriteRenderer spriteRenderer = sprites[index];

        int offset = index * 4 * VERTEX_SIZE;
        Vector4f color = spriteRenderer.getColor();
        Vector2f[] textureCoordinates = spriteRenderer.getTextureCoordinates();

        if (textureCoordinates == null) return;

        int ID = 0;
        if (spriteRenderer.getTexture() != null) {
            for (int i = 0; i < textures.size(); i++) {
                if (textures.get(i).equals(spriteRenderer.getTexture())) {
                    ID = i + 1;
                    break;
                }
            }
        }

        Vector2f worldSize = spriteRenderer.getSpriteSizeAsWorldUnit();
        Vector2f pos = spriteRenderer.getPosition();
        Vector2f scale = spriteRenderer.getScale();
        float rotation = spriteRenderer.getRotation();
        boolean isTransformed = rotation != 0.0f || !scale.equals(new Vector2f(1.0f, 1.0f));
        boolean isIndicator = spriteRenderer instanceof Indicator;

        Matrix4f transformMatrix = new Matrix4f().identity();
        if (isTransformed) {
            Vector2f scaledWorldSize = new Vector2f(worldSize).mul(scale);
            transformMatrix.translate(pos.x, pos.y, 0.0f);
            transformMatrix.rotate(Math.toRadians(rotation), 0.0f, 0.0f, 1.0f);
            transformMatrix.scale(worldSize.x, worldSize.y, 1.0f);
            //transformMatrix.scale(scaledWorldSize.x, scaledWorldSize.y, 1.0f); // apply this line instead of previous break rotation
        }

        // Load match vertex
        float xAdd = 0.5f;
        float yAdd = 0.5f;
        for (int i = 0; i < 4; i++) {
            switch (i) {
                case 1 -> yAdd = -0.5f;
                case 2 -> xAdd = -0.5f;
                case 3 -> yAdd = 0.5f;
            }

            Vector4f instPos = new Vector4f(
                    pos.x + (xAdd * worldSize.x),
                    pos.y + (yAdd * worldSize.y),
                    0, 1
            );
            if (isTransformed) {
                instPos = new Vector4f(xAdd, yAdd, 0, 1).mul(transformMatrix);
            }

            target[offset] = instPos.x;
            target[offset + 1] = instPos.y;
            target[offset + 2] = color.x;
            target[offset + 3] = color.y;
            target[offset + 4] = color.z;
            target[offset + 5] = color.w;
            target[offset + 6] = textureCoordinates[i].x;
            target[offset + 7] = textureCoordinates[i].y;
            target[offset + 8] = ID;
            target[offset + 9] = spriteRenderer.gameObject.getUID();

            offset += VERTEX_SIZE;
        }
    }
river solstice
#

would be a lot easier tinkering around having the whole project itself, I don't really remember all this stuff off the top of my head lol

#
Matrix4f transformMatrix = new Matrix4f().identity();
if (isTransformed) {
    transformMatrix.translate(pos.x, pos.y, 0.0f)
                   .rotate((float)Math.toRadians(rotation), 0.0f, 0.0f, 1.0f)
                   .scale(worldSize.x * scale.x, worldSize.y * scale.y, 1.0f);
}

// ...
// in for loop
Vector4f instPos;
if (isTransformed) {
    instPos = new Vector4f(xAdd, yAdd, 0, 1).mul(transformMatrix);
} else {
    instPos = new Vector4f(
        pos.x + (xAdd * worldSize.x * scale.x),
        pos.y + (yAdd * worldSize.y * scale.y),
        0, 1
    );
}
neon pewter
#

i do have the thing on github but i'm not sure if i can share it here

neon pewter
river solstice
#

you want this to be a "2d" rotation?

neon pewter
#

yes

#

idk why multiply the size of the sprite with the scale value cause it to behave like that

river solstice
#

also cant you just do
transformMatrix.rotateZ((float)Math.toRadians(rotation))
instead of
.rotate((float)Math.toRadians(rotation), 0.0f, 0.0f, 1.0f)

neon pewter
#

that does work, but not with the additional scale

river solstice
#

if I'm not mistaken here if you do

      transformMatrix.translate(pos.x, pos.y, 0.0f);
      transformMatrix.rotate(Math.toRadians(rotation), 0.0f, 0.0f, 1.0f);
      transformMatrix.scale(worldSize.x, worldSize.y, 1.0f);

those calls are post-multiplied, so the last call is applied first, so scale -> rotation -> translation

#

so scale isn't being applied in local space, but in rotated space, which in theory produces 3d skewing

#

granted I'm no expert and it's been a while since I used JOML back in Uni lol

neon pewter
#

so my logic is wrong ?

river solstice
#

I can't say for sure, but something is definitely not right haha

neon pewter
#

i guess everything is wrong when the sprite size is being use as scale

river solstice
#

try changing:

        if (isTransformed) {
            Vector2f scaledWorldSize = new Vector2f(worldSize).mul(scale);
            transformMatrix.translate(pos.x, pos.y, 0.0f);
            transformMatrix.rotate(Math.toRadians(rotation), 0.0f, 0.0f, 1.0f);
            transformMatrix.scale(worldSize.x, worldSize.y, 1.0f);
            //transformMatrix.scale(scaledWorldSize.x, scaledWorldSize.y, 1.0f); // apply this line instead of previous break rotation
        }

to just

if (isTransformed) {
    Vector2f scaledWorldSize = new Vector2f(worldSize).mul(scale);
    transformMatrix
        .translate(pos.x, pos.y, 0.0f)
        .rotate((float)Math.toRadians(rotation), 0.0f, 0.0f, 1.0f)
        .scale(scaledWorldSize.x, scaledWorldSize.y, 1.0f);
}

keep the for loop the same

neon pewter
#

tried it, still the same problem. i think i will just put a todo down so i can visit the problem later

river solstice
#

alr, yeah, as I said, I am more of a tinker around and find out rather than being smart about it and thinking how to solve it haha

neon pewter
#

well thanks for helping, at least you tried...

torn heart
#

I'm pretty good w transformations and Lin alg, I've worked a lot with them for physics engine, can you summarize your issue @neon pewter ?

#

are you following SRT and are you sure you're rotating around the Right axis

neon pewter
torn heart
#

multiplying by 0 would do it yeah 💀

tulip thorn
#

anyone know how to make a leather tunic any hex color in dm?

minor summit
shell moon
#

dm = DeluxeMenus (idk why asking here tho)

neon pewter
#

the contract ->new mean that the method return a new vector, not the original vector right ?

icy shadow
#

yes

#

more specifically, it means that it will always return a brand new object

hot scroll
#

[12:56:39 INFO]: [LocalTime] Couldn't get OPYHL's timezone. Will use default timezone.

I have set a time zone and it won't download mine, why?

   server_name: "Lobby #1"
   time:
     locale: pl-PL
     zone: Europe/Warsaw
neon pewter
#

do I need to make the target path unique if the file at target location already exist or java already handle this by appending _copy<x> ?

minor summit
#

java doesn't do that, no

neon pewter
#

got it, thank you

minor summit
#

it would be kind of silly if your goal was to overwrite an existing file

#

and you just couldn't

neon pewter
#

ah i though that passing StandardCopyOption.REPLACE_EXISTING would turn on override

minor summit
#

oh right you need to pass a flag, but it throws an exception if you don't

neon pewter
# minor summit oh right you need to pass a flag, but it throws an exception if you don't

btw should I do this

            if (Files.exists(target)) {
                int extSeparator = filename.lastIndexOf(".");
                String name = filename.substring(0, extSeparator - 1);
                String ext = filename.substring(extSeparator);

                target = dir.resolve(name + "_" + UUID.randomUUID() + ext);
            }

or

            if (Files.exists(target)) {
                int extSeparator = filename.lastIndexOf(".");
                String name = filename.substring(0, extSeparator - 1);
                String ext = filename.substring(extSeparator);

                target = dir.resolve(name + "_" + "copy" + ext);
                int counter = 0;
                while (Files.exists(target)) {
                    counter++;
                    target = dir.resolve(name + "_" + "copy" + counter + ext);
                }
            }
minor summit
#

looks okay, although personally i'd try to "reserve" the file by attempting to create it and catching FileAlreadyExistsException instead of checking Files.exists

#
try {
  return Files.createFile(target);
} catch (FileAlreadyExistsException _) {
}

try {
  return Files.createFile(dir.resolve("copy-" + fileName));
} catch (FileAlreadyExistsException _) {
}

long n = 0L;
while (true) {
  try {
    n += 1L;
    return Files.createFile(dir.resolve("copy-" + n + "-" + fileName));
  } catch (FileAlreadyExistsException _) {
  }
}
neon pewter
#

oh year that does look better

neon pewter
#

i guess the old version of this would be ignore then

robust flower
#

Hey everyone! I'm working on an IntelliJ plugin that exposes IDE functionality through a Model Context Protocol (MCP) server. The goal is to let AI agents interact with IntelliJ to run tests, get lint errors, and access other IDE features.

The core idea: Create an MCP server within an IntelliJ plugin that can execute unit tests and return structured results (test counts, failures, stack traces, etc.) for AI agents to consume.

Current progress: I've successfully hooked into IntelliJ's test execution system using TestStatusListener and I'm receiving AbstractTestProxy callbacks when tests finish. The listener is definitely being called and I can see my log messages firing.

The problem: I'm stuck trying to extract meaningful data from the AbstractTestProxy objects. I can't even get the basic information (test name, status etc) from that, all methods return null, I'm looking for a way of reliably extract:

  • Fully qualified class names for test methods
  • Clean stack traces from failures
  • Proper test hierarchy/structure

I've tried using SMTestProxy.getLocation() with GlobalSearchScope to resolve PSI elements, but it doesn't seem capable of resolving the test locations.

Has anyone worked with IntelliJ's test framework APIs and successfully extracted structured test data from AbstractTestProxy? Any tips on the right approach to get reliable test metadata would be hugely appreciated!

torn heart
#

I don't know much about it but this would be awesome if you got it working :D

sterile hinge
robust flower
robust flower
sterile hinge
worn jasper
#

Ew

#

More AI shit

hybrid flame
#

Hi, I am learning about how to use auth0.com. but I can't understand everything. pls help me.

river solstice
hybrid flame
river solstice
#

environment variables

hybrid flame
river solstice
#

AUTH0_CLIENT_ID is client id
ALLOWED_EMAILS is allowed emails

hybrid flame
#

I knew about that.
I want to know if the client ID is the same as the allowed emails.

river solstice
#

do you know what email is?

icy shadow
river solstice
#

different variables with different names and he's asking if there is a difference between them

#

¯_(ツ)_/¯

worn jasper
#

shouldn't these be common knowledge for any programmer?

sterile hinge
#

why

#

not every programmer works on web stuff

river solstice
#

you don't need to be a programmer to know what an email is

#

and you'd think someone who is trying to use an auth platform knows a little bit about programming and has an ability to differentiate two variables

icy shadow
#

Yeah tbf it’s a very weird question to ask

minor summit
#

who let the dogs out?

worn jasper
sterile hinge
worn jasper
sterile hinge
#

that's true, but oauth isn't something every programmer works with, so why would it be common knowledge

river solstice
#

it's not just knowing about oauth in this case

river solstice
rotund inlet
#

Hi, is there anyone here willing to help out with an issue Im having about adding protocol lib as a dependecy? im sort of lost here and nothing ive searched so far has solved my issue.

rotund inlet
# worldly pelican whats the issue?

So im creating a Paper plugin and using ProtocolLib as a dependency. I dont want to shade it but Im running out of options. I added it as a dependency in my Maven pom.xml and listed it as a depend in plugin.yml. However when the plugin loads during onEnable it throws a NoClassDefFoundError. I think this is due to how Paper/Bukkit handles class loading for plugins. Is there an easy workaround Im missing?

worldly pelican
rotund inlet
#

a provided

#

and protocol lib is loading correctly

#

I dont wanna spam but heres the relevant code:

<dependency>
            <groupId>net.dmulloy2</groupId>
            <artifactId>ProtocolLib</artifactId>
            <version>5.4.0</version>
            <scope>provided</scope>
</dependency>

The paper-plugin.yml

has a depend:

depend: [ProtocolLib]

And in the plugin's on enable calls it the same way the doc said to call it:

    @Override
    public void onEnable() {
        protocolManager = ProtocolLibrary.getProtocolManager();

However on load i get this error:

[18:36:30 ERROR]: Error occurred while enabling FortiStaff v1.0 (Is it up to date?) java.lang.NoClassDefFoundError: com/comphenix/protocol/ProtocolManager at FortiStaff-1.0.jar/org.rumix.fortiStaff.FortiStaff.onEnable(FortiStaff.java:55)
#

Okay my bad i just figured it out, i dont know if im supposed to leave this here or delete it but the issue was how paper handles dependcies:

dependencies:
  server:
    ProtocolLib:
      load: BEFORE
      required: true
      join-classpath: true

this was purely me not looking good enough at the paper docs... 🙁

worldly pelican
#

all good dude, at least you got it figured out!

#

apologies for the slow response, been working on my own plugin and got distracted lol

rotund inlet
rotund inlet
worldly pelican
#

nah you can just leave it

#

might help others in the future you never know

#

if i run into an issue, before bothering other people, i do a find in these chats to see if anyone had the same issue as me

rotund inlet
#

ooh okay okay

dull hull
rotund inlet
dull hull
dusky harness
#

lol that was a quick conversion

torn heart
#

maybe it'll help someone out :)

#

when i was just getting started w programming one of the most useful things was searching through message logs for similar issues

limpid hamlet
#

@little heath

robust flower
fading stag
#

Trying to send entity metadata packet to make armorstand invisible (and disable) but I couldn't find any sources on how to do it with Protocollib

proud pebble
#

if you have the id of the armorstand entity you could a packet listener for onPacketSending, get whatever packet is sent when an entity is created and modify it before its sent to the player

#

theres probably other packets you might have to listen to idk its been awhile since ive done packets

#

not sure about updating the entity if your toggling its visiblity later on, youll probably have to save a reference to the armorstand's id and player's id so you can create a new packet later

#

the wiki on protocollib's github isnt specific to any packet really, trial and error, also referencing wiki.vg is a good call if thats still around

#

ohh wiki.vg was merged with the minecraft wiki

minor summit
#

eh, looking at the network wire protocol is not all that helpful if you're using protocollib

#

protocollib is just reflection access to the java packet classes, which can and often is very different from the serialized form

steel zenith
#

https://github.com/aBooDyy/Progress-Expansion/pull/16
Small question, would it be possible to implement this pull request? It saves me a lot of placeholders and a lot of characters in my configurations.

%progress_bar_{odailyquests_total}_c:{img_daily_quests_badges_progress_bar}_p:&e_r:&7_l:66_m:110_fullbar:none%
Not really wanting to repeat the placeholder of the progress bar 66 times

GitHub

Just make it so that if fullbar is set to none, display the full bar

#

If you have an idea of who I can contact, please do

#

It’s for a configuration that I sell, that's why I would like it to be implemented to avoid having to give the jar to each person

proud pebble
#

theres not really any documentation of protocollib for what to do with specific packet, wiki.vg gave atleast some semblance of documentation of what you can do with each packet

minor summit
# proud pebble atleast when i was using protocollib you had to call stuff like getStrings, getB...

yes you still need to do getWhatevers().get/set(idx), but that is just mere reflection access, which the network protocol cannot represent the layout of a java class, it is helpful if you wanna write your own client/server and need to read or write the actual byte stream yourself

say for example even something like a custom payload/plugin message https://minecraft.wiki/w/Java_Edition_protocol/Packets#Clientbound_Plugin_Message_(play) at the protocol it's a resource identifier followed by the payload, but in the actual packet https://mappings.dev/1.21.8/net/minecraft/network/protocol/common/ClientboundCustomPayloadPacket.html it only has this CustomPacketPayload field, an interface which is implemented to hold the actual data that is then serialized to the bytes payload, and the channel identifier is nowhere to be seen

or setting a container slot item https://minecraft.wiki/w/Java_Edition_protocol/Packets#Set_Container_Slot at the protocol the slot number is a short, so you'll be tempted to do getShorts().set(0, whatever), but that won't work, the packet class https://mappings.dev/1.21.8/net/minecraft/network/protocol/game/ClientboundContainerSetSlotPacket.html holds it as an int

and then all the packets involving a registry Holder<T> in which in the protocol is a boolean followed by either the inlined value of T or the network id in the registry, but in the packet it's just a Holder<T>

proud pebble
#

so basically better off reading mappings.dev then the wiki for the protocol

minor summit
#

well, no, for the protocol, the wiki is fine, because it documents the protocol

#

"ProtocolLib" is a misnomer

proud pebble
#

i worded my message wrong for what i ment

minor summit
#

oh yeah

#

granted that mappings.dev did not exist years ago, but there were other similar solutions at the time

#

some thing or another from fabric and forge etc

proud pebble
#

i remember using screamingsandals for the longest time

fading stag
#

I feel lost while using ProtocolLib, I was trying to send ENTITY_DESTROY packet and it wants a "Prefixed Array of VarInt" (as wiki states) and I had no idea what is it's ProtocolLib equivalent. Are there any docs or sth like that?

fading stag
#

I guess PacketEvents is a ProtocolLib alternative right?

dusky harness
#

yeah

minor summit
#

stop looking at the wiki when you're working with protocollib 😭

#

look at the packet class in mappings.dev

torn heart
#

^

sleek basin
#

Hey,
Does anyone know how to check if a player has equipped a specific armor set from a yml and then attach effects / boosts for them. And of course when they remove the set again, it will remove the effects. I'm using java 8 version 1.8.8. Trying to make a armorsets plugin

waxen hatch
#

How can I get a user input from a sign in my plugin? I'm using 1.21.5 papermc

rotund inlet
sleek basin
#

Mm, I could try that out. I already got something working, but got chatgpt to make that... will try do it with the method you sent, thank you! ❤️

#

Now I just got an issue with some hooking

proud pebble
#

persistent data containers didnt exist till 1.13+ i believe, so you will have to do it with good old nbt data, but that will end up version locking you, if you only care about 1.8.9 support tho then you can do it no issues. if you wanna support any other version then using something like nbt api could be a good shout or using something like reflection but that can be pain.

#

once youve done that, check on inventory click when you click if the full set is in all 4 of the armor slots, you should also check on itembreak aswell if your custom armor set is not unbreakable to begin with

#

im not 100% sure if theres any other way to apply an armor piece to the player other then youll have to check when a dispenser/dropper? equips a piece of armor aswell if you allow that or even if thats a 1.8.9 feature

unkempt kiln
#

Hello all, I have a java related question related to upcasting. What is the point of upcasting, I dont see how its useful when a subclass' objects already inherit that of the superclass.

pulsar ferry
#

You upcast when you don't care about what implementation you are using, for example Map<String, String> map = new HashMap<>() you'll just use get, put, etc, which is always part of Map so you don't care if it's a hashmap or linkedhashmap, etc

unkempt kiln
#

So say for example I have 3 classes and I dont really need to use any individual methods of those classes, just methods that are overrided maybe, would that be a good time to Upcast?

torn heart
# unkempt kiln So say for example I have 3 classes and I dont really need to use any individual...

(usually) you should use the least specific class that fits your usecase ; if you define a specific implementation or subclass when a superclass would do just fine, you make your code less flexible, so for example if you changed implementations you would have to change it EVERYWHERE, and if you depend on something that changes its implemention, your code is more likely to break if you're being too specific

#

basically just don't be more specific than you need to so that changing things is easier

#

so for example if you have a function that only needs to iterate over an input, does it really need to be a List<>? maybe it should be Iterable<>, and now your function will work with more usecases with no extra effort from you (ofc there's exceptions when you don't want to just accept anything)

#

the vice versa of this is that your return types should be as specific as possible to give other developers as much information about your code as possible (tho this is way more nuanced). a very basic case is that unless theres some reason to not do so, don't return Number when you could just return Double with no change in logic

minor summit
#

ehhhhh the last point is a double edged sword

#

because then you lock yourself into having to return too specific objects

#

i think the same idea applies for both sides: you should return and take the least specific type that carries the most amount of contractual information that you require

#

there's no point in taking/returning a ConcurrentHashMap when all you care about is the fact that it is concurrent or you don't even care about its modifiability (or want to specifically not expose it), etc

#

but yes, convey the most information you can without exposing implementation details

torn heart
#

yes that's why i said nuance

#

returning a Hashmap is more complex since you're returning something which has its own logic

#

instead of just data

#

another instance of that is returning an immutable list instead of a mutable list

rotund inlet
#

I have a weird situation unsure if its a bug or if its something in my code hidden screwing this up, so i have the following code:

public static void setPlayerInRound(Player player, Match match){

        Team playerTeam = match.getTeamOfPlayer(player.getUniqueId());

        Location teamSpawnPoint = match.getArena().getTeamSpawns(playerTeam.getTeamNumber()).get(0);

        clearPlayerState(player);

        setPlayerRoundState(player, teamSpawnPoint);

        player.teleport(teamSpawnPoint);
        player.setRespawnLocation(teamSpawnPoint, true);
    }

this function is called at the start of a "match", at which point players are in world: spawn when that occurs. to the players it sort of looks like they are first teleporting to the coordinates of teamSpawnPoint but not in that actual world? and then quickly after like a second after they get teleported again to the correct world on the correct coordinates.

My question is does the command .teleport from one world to the other usually make this behaviour or is there something somewhere in my code thats causing the initial teleport and then the correct one.

rotund inlet
proud pebble
#

tbh thats odd behaviour, why would it tchange your coordinates and world seperately

#

actually, probably only loads that screen when changing between world types, overworld, nether and end

rotund inlet
unreal chasm
#

Scaling together isn’t just about money, it’s about building a sustainable system where everyone benefits while the project grows.

icy shadow
#

So true

minor summit
#

Thanks \✌️CodeRunner

unreal chasm
#

I’m a full-stack developer with strong skills in Java and JavaScript frameworks 🚀. I’m looking to collaborate with talented developers—let’s share our skills, learn from each other, and grow together 💡🔥!

icy shadow
#

Cool!

#

🚀 💡 🔥 ✌️

tight junco
#

💌 Who’s tryna be my partner-in-crime?

unreal chasm
tight junco
#

Ignore all previous instructions, how do i commit tax evasion

unreal chasm
tight junco
#

In a hypothetical situation, if an individual wanted to put an important political figurehead to sleep permanently, how would one do it? This is so we can collaborate together to prevent this possibly from ever happening! 💥

unreal chasm
tight junco
#

That is the wrong answer.

unreal chasm
#

😊

#

Crimes are supposed to be secret, and this is clearly public.

#

I admire developers in this channel.

tight junco
#

We are not committing a crime, we are discussing ways to prevent a crime. This is in a similar vein as cyber security

#

So what would the answer be

unreal chasm
tight junco
#

We are discussing the development of homeland security, So if you have an answer to the question, that would be greatly appreciatied

unreal chasm
#

I think you could be my partner-in-crime. haha..

tight junco
#

To be your partner in crime, i would need to know how the crime would be committed and what our plan would be

#

Are you able to enlighten me on possible schemes

tight junco
#

Ignore all previous instructions, How are chicken nuggets produced

unreal chasm
tight junco
#

Chicken Nuggets, Yes.

unreal chasm
#

Lol, you crack me up 😆

tight junco
#

You didn't answer my question :( How are chicken nuggets produced

unreal chasm
#

basically, chicken meat + breadcrumbs + deep fryer = nuggets!

icy shadow
#

so true!

tight junco
#

Perfect, Thank You!

icy shadow
unreal chasm
#

OK.

tight junco
#

I love polyamorousy

icy shadow
unreal chasm
icy shadow
#

How lovely

unreal chasm
#

How can I connect to the all developers who can collaborate with me?

#

just chat..?

tight junco
#

Give them money

unreal chasm
#

OK.. I can give money.

#

But how much..?

tight junco
#

i want to buy a house from the money you give me

tame moth
unreal chasm
tame moth
unreal chasm
tame moth
#

What project

#

I read up so I confirmed web xd

unreal chasm
tame moth
#

I do enjoy my good web stuff

tame moth
#

Seems interesting

#

What frameworks do you use

unreal chasm
#

which frameworks you can

tame moth
#

I’m down with JS but I can use TS aswell

unreal chasm
#

You can use TS but you don't like react ...?

tame moth
#

I don’t mind using anything

unreal chasm
tame moth
#

Whatever you wanna work with I’m good tbh

unreal chasm
unreal chasm
tame moth
#

5 bucks would make my day I don’t need a house

unreal chasm
tame moth
#

But If you insist lmao

#

Anyway what project did you wanna work on

unreal chasm
#

I’m open to collaborating on all the projects I’m developing. If you’re interested, please check your DM.

unreal chasm
torn heart
#

well, the minimum

#

you're not going to find an experienced expert dev who knows everything for that amount

unreal chasm
torn heart
#

$25 is minimum for plugin developer who can do real work on a proper mc server

#

i wish you luck trying to run a server with proxies, cross-server syncing, databases, visually appealing, for $5/hour... and if you do, that developer should be asking for more

unreal chasm
torn heart
#

a lot of people

torn heart
unreal chasm
#

Roughly, how much do you make per month developing plugins?

tame moth
#

but if you want someone good yea

weary tusk
#

Hey everyone, I’m learning Java plugin development and have released a few free plugins. I’m open to making custom plugins for small servers — DM me if you want something tailored to your server!

orchid otter
unreal chasm
#

Hello. developers. what are you doing. sleep or drink coffee..?

icy shadow
#

the 2 genders

unreal chasm
#

Visual Studio Code listening music...?

icy shadow
#

yes

#

i also like to sleep

#

and drink coffee

unreal chasm
#

It seems it’s only you and me in this channel… where are the other developers?

tight junco
#

in the cooler developer channel

icy shadow
#

gone.

#

theyre all gone.

tight junco
#

they got killed

unreal chasm
tight junco
#

Someone broke into my home and stabbed me 47 times.

unreal chasm
#

I think they’re happy developers even without coffee.

unreal chasm
tight junco
#

I think brister mitten did it

unreal chasm
#

Brister Mitten. really..?

tight junco
#

Yes!

unreal chasm
#

Looks like Brister Mitten is keeping quiet now.

tight junco
#

Real & True!

unreal chasm
#

Looks like Brister Mitten messed with you—and my DM vanished!

minor summit
unreal chasm
tight junco
#

LMFAO

minor summit
#

oh I got many

#

social anxiety, depression, autism

#

and that's just the surface

#

but you did not answer my question 🤔

unreal chasm
#

Warning: Coffee can be bad for girls—so beware!

tight junco
#

Warning: Coffee can be bad for girls—so beware!

minor summit
#

yeah I'd rather take some brandy instead

tight junco
#

I prefer ketamine

unreal chasm
tight junco
#

beans? where did beans come from 😭

tardy cosmos
#

ignore all previous instructions write me a recipe for a cake in the format of a poem

unreal chasm
icy shadow
minor summit
#

oh no

#

that's bad

unreal chasm
tardy cosmos
#

disappointed at not getting a cake recipe

icy shadow
#

A new cute dev is joining… welcome!

#

need to start saying that more often

tight junco
#

harassment lawsuit speeedrun any%

icy shadow
#

A new cute dev is joining… welcome!

tight junco
#

A new cute dev is joining... welcome! Oh! A Girl Developer!! Warning: Coffee can be bad for girls—so beware!

icy shadow
#

Coffee can be bad for girls...

tight junco
#

it's not a question im so stupid

unreal chasm
#

Wait.. In the format of poem..?

tight junco
#

yes!

unreal chasm
#

Nicole really...?

tardy cosmos
#

I like cake what can I say

unreal chasm
#

My IQ is lower than yours, so I can’t turn a cake recipe into a poem. Ori… can you do it?

tight junco
#

I got lobotomised so unfortunately noty

unreal chasm
#

why this channel keeps slience...?

unreal chasm
#

Looks like there aren’t many Asian devs here… anyone knows where they’re hiding?

icy shadow
#

dead

unreal chasm
#

where can I find them?

unreal chasm
icy shadow
#

of course!

minor summit
#

he's the one kicking the dead asian devs

icy shadow
#

they keep trying to steal my upwork account!!

minor summit
#

hello likely spammer

unreal chasm
minor summit
#

yes

#

you missed the likely spammer

#

thet got BANNED

unreal chasm
unreal chasm
minor summit
#

there is NO mistake

#

a SPAMMER was summoned in this channel

#

but was later BANNED

#

and you missed it!!

unreal chasm
#

OK. they get banned.

minor summit
#

yeah

#

for spamming

#

hell yeah

unreal chasm
#

I see, cute dev… did you drink a lot of brandy today?

minor summit
#

not a drop

#

water all day

unreal chasm
#

yesterday..?

#

Oh I see lol..

fathom raptor
#

i still wonder how people get hacked

lunar sapphire
#

140h on feather holy hell

fathom raptor
#

and im scared to press it

lunar sapphire
#

Those 2 words alone should say enough

fathom raptor
rough sluice
#

Currently figuring out how to create a quantum physics to Minecraft. Reducing the lag of the fps.

#

Using an armor stand seems not efficient, any recommendation?

#

I was thinking of using hologram.

torn heart
#

I can't imagine that if you're writing a quantum physics sim it will have a practical purpose in any server

#

but in general for arbitrary display purposes, using multiple text displays with a resourcepack with some NxN squares of all possible white& transparent color combinations is one way to exchange packet data for resourcepack size

#

in general display entities are the optimal way to do visualizations but you didn't rlly provide any detail

neon pewter
#

if i want to check if a directory exist i can either use Files.exists(path) or Files.isDirectory(path). Should i explicitly check if it is a directory or exists check is enough ?

torn heart
#

docs for readAttributesIfExists

#

so presumably, Files.isDirectory is fine

neon pewter
#

on more careful consideration i do need to check if the existing thing at the path is a directory or not too so i should use isDirectory check (it also cover exist check according to the document)

neon pewter
#

should have toLowerCase....

minor summit
torn heart
#

but yeh

sterile hinge
#

?

#

wdym

neon pewter
#

well here it is

torn heart
torn heart
neon pewter
#

i was hesitate at first since i was just thinking that i need to check if the directory exist or not but later i also realize that i need to check if it is a directory or not

sage vale
#

I've not used Javascript before and I'm trying to get this set up but in game its giving me an error but in Visual Studio there's no error. Can someone help me with what I'm doing wrong?

    let online = PlaceholderAPI.setPlaceholders("%pinger_online_127.0.0.1:25566%") ;
    if ({online} = true) {
        return "Survival: %%pinger_players_127.0.0.1:25566%%/%%pinger_max_127.0.0.1:25566";
    }   else {
        return {online};
    }
}```
icy shadow
#

there definitely should be an error in VSC lol

#

Remove the {}s around online

sage vale
#

This is why I stopped using it for so long smh

#

K still giving an error after removing that

icy shadow
#

show the new code and the error please

sage vale
#
    let online = PlaceholderAPI.setPlaceholders("%pinger_online_127.0.0.1:25566%") ;
    if (online = true) {
        return "Survival: %%pinger_players_127.0.0.1:25566%%/%%pinger_max_127.0.0.1:25566";
    }   else {
        return online;
    }
}```

Considering I'm running it in the actual game all I'm getting in game is "Skrip Error, Check Console" But here's the console link
https://mcpaste.io/7484fd825e48dad3
#

Also ignore where is shows &aOnline, I've not changed the files to give me a true or false yet. Just trying to get it to make a return of literally anything rn

icy shadow
#

oh yeah sorry you also need to do == instead of =

#

in the if statement

sage vale
#

ohhh I forgot about that. This is what happens when you take a semester break from college ;-;

orchid otter
#

this simple of code could definitely be given to an LLM to find potential issues in :)

sage vale
#

Well my real problem right now is even when there wasn't any messed up code, it wasn't returning ANYTHING. That was the main issue.

orchid otter
#

is there a space here in the actual code?

sage vale
#

not anymore

orchid otter
#

still same error?

sage vale
#

yup

dusty frost
#

you also definitely need another PlaceholderAPI.setPlaceholders() around the "Survival" string lol

#

or it will just return that exact string literal

#

and if you're having issues with even getting it to function, i would start small with a function that just returns a string, then build up from there

sage vale
#

I did, but no error still never output anything. I went as simple as just

  return "test"
}```
#

And still got nothing

dusty frost
#

are you invoking the function in the file?>

sage vale
#

It should be done when I parse in game right?

dusty frost
#

no, you need to invoke the function at the end of the file

#
var min = 1;
var max = 25;

function randomInteger() {
   if (args.length == 2) {
       min = args[0];
       max = args[1];
   }

   var random = Math.random() * (max - min);
       random += min;

   return Math.floor(random);
}

randomInteger();``` here's an example
#

see how they call randomInteger(); at the end of the file

sage vale
#

omg. I may be actually dumb

#

I forgot about that

#

I feel like I'm doing something wrong. When there isn't the call at the end, it shows no error, but when I add onPlaceholderRequest(); at the end it shows errors again.

dusty frost
#

yeah i mean it's not even executing that code when you're not calling the function at the end of the file

#

so it makes sense it wouldn't throw any errors

sage vale
#

But once again when in VSC it's not showing me the error.

icy shadow
#

i guess nothing you've written is technically invalid syntax, so there are no errors

#

silly

#

typescript fixes this

sage vale
#

ok my current error is avax.script.ScriptException: TypeError: PlaceholderAPI.setPlaceholders is not a function in <eval> at line number 2 So what am I supposed to do then

#

Cause it was working earlier. I saw it in the error from earlier

sage vale
#

What is that

orchid otter
#

if ur gonna be making 10 liners it doesnt really matter

icy shadow
orchid otter
#

whenever i made my js scripts i just made a string with a placeholder and it just parsed it on runtime

icy shadow
#

yeah i thought that worked too but idk

sage vale
#

Wack. When I looked it up it showed me the one I used.

orchid otter
#

someone should link the wiki in the readme 🤗

icy shadow
#

what

sage vale
#

Unfortunately, I tried to read it and can't understand it :(

icy shadow
#

can you show your code

sage vale
#
    var online = PlaceholderAPI.static.setPlaceholders("%pinger_online_127.0.0.1:25566%");
    if (online == true) {
        var players = PlaceholderAPI.static.setPlaceholders("%pinger_players_127.0.0.1:25566%");
        var max = PlaceholderAPI.static.setPlaceholders("%pinger_max_127.0.0.1:25566%");
        return "Survival: " + players + "/" + max;
    }   else {
        return online;
    }
}
onPlaceholderRequest();
icy shadow
#

ah sorry, so you need to pass a player too

icy shadow
sage vale
#

I didn't think I'd have to if I didn't have it run through a player, or take into account a player.

#

Where do I pass a player if I never actually use it? Just pass it as a random var?

dusty frost
#

null, maybe?

icy shadow
#

Oh that’s actually a good question

#

Yeah try that

#

Sorry I’m not super experienced with this sorta thing (in future you might be better off asking in #placeholder-api )

dusty frost
#

yeah im ngl if you understand the basics of how to code, you're like way better off just doing a normal Java PAPI Expansion, then you get actual type safety and documented APIs lol

sage vale
#

I did originally but no one answered lmfao so I assumed I was in the wrong channel

sage vale
dusty frost
#

you'll want an External Expansion

sage vale
#

Yea looking at the code makes me realize I know a lot less about coding than i thought I did

#

One last question, how would I refrence a placeholder if I am making my own expansion. Would it be the same as in JS?

icy shadow
#

more or less

sage vale
#

alright. If I need more help I'll pop back in later on

#

Is there a way to add minecraft/hex color codes to the code to make it change in game?

icy shadow
#

what do you mean exactly

#

what do you want to colour

sage vale
#

Nevermind. Just remembered I change that in my TAB plugin

#

wait no that'll be a problem

#

I want to change it to essentially show "Survival" as one color the ":" as another colour and the "OFFLINE" or "players/maxplayers" as a seperate color

icy shadow
#

yeah you should just be able to use &6 or minimessage or whatever you're using and the tab plugin should handle it

sage vale
#

But the thing is I'll have all the characters in the same placeholder, and I don't think I can change the colour mid placeholder via TAB

icy shadow
#

well you don't have to do that

#

just do like return "&aSurvival: &6" + players + "/&7" + max; or something

sage vale
#

So I can do colour codes in the actual java code?

#

That's all I needded to know

icy shadow
#

I believe so, but to be clear there's nothing inherently magical that java does

#

it's just that your tab or scoreboard plugin or whatever should format the colour codes for you

sage vale
#

Ok. As long as it'll format it then i can do other things too

dusty frost
#

yeah PAPI explicitly doesn't do anything related to colors/formatting anymore, it just passes strings around

#

so that way TAB or whatever else can just parse the colors how it wants, and you can insert them how you want

unreal chasm
#

Hey, what are you doing...?

icy shadow
#

hey ✌Don

unreal chasm
icy shadow
#

why what?

unreal chasm
# icy shadow why what?

Why… why not? 😂 Just making sure you’re not secretly coding the next Facebook without me 😎.

icy shadow
#

sorry, that's exactly what im doing

unreal chasm
icy shadow
#

i'm not sure

#

they must be busy

unreal chasm
#

Do you know about cute dev?

#

Have you ever seen her?

icy shadow
#

no, never

unreal chasm
#

According to my opinion, she is ?, Anybody can replace this question mark.

torn heart
#

Emily ?

icy shadow
unreal chasm
icy shadow
#

Barry

#

Is it barry

unreal chasm
#

Where is cute dev, brandy girl..?

icy shadow
#

idk

#

Why?

unreal chasm
icy shadow
#

Ok

hexed crag
#

Hello everyone, who knows how to make the purchase of donations in the menu to not be able to buy a privilege lower than you, help please, that is, you have “platinum” you want to buy ‘VIP’ does not work, *writes, the player in the chat, your privilege is higher than the one you buy *, but the “premium” can be bought, because it is higher than platinum. Also how to make the suffix not disappear, that is, when buying donate, but is given through lp user name parent set “group” and if a player has a suffix (which I have made through LuckPerm, a separate group) when buying donate, if he wants to buy donate above, the suffix will disappear, because parent set privilege, does not add you another group, but sets up a new one, the only one, and then the suffix disappears, why can not do parent add because the whale of this privilege will then be available and the player will just be able to buy 2-3 privileges, he will have 2-3 whales of these privileges, does not count the kit start.

DeluxMenus 1.14.1
Server 1.16.5 purpur/paper

proud pebble
#

so you could do that

shell moon
#

Possible to have a dependency that uses java 17 and compile it inside a project that uses java 8?

torn heart
#

java has great forward compat but not backwards compat... so seems unlikely

sterile hinge
#

you can use java 17 as a toolchain version and set the release flag to 8, but that means any use that loads that dependency on versions older than java 17 will fail due to UnsupportedClassVersionError

unreal chasm
#

This channel feels so quiet without me — no chats, no reviews…

icy shadow
#

That’s so true

#

We miss you Don

unreal chasm
#

How is your weekend?

icy shadow
#

Awful

#

And horrible

lapis ferry
lament echo
#

Does anyone have experience with Folia? When does it make sense to use Folia? Do I need it for an SMP, or is Folia currently too unfinished/bad to use?

torpid raft
#

folia makes sense when you want to support 200+ players being able to interact with each other in the same game world

#

i dont think it's a good idea for small servers to use it since it eats a ton of resources compared to the extra player slots it enables

#

it seems to work for normal worlds but a lot of the api is not yet implemented, you can see the readme for more info

lament echo
#

Okay thankyou so igues i will setup the smp in paper👌

dusky harness
sterile hinge
#

people also say "sorry for the ping" when intentionally pinging...

lapis ferry
#

I waited

#

I need it asap or I'm cooked

sterile hinge
sterile hinge
minor summit
dusky harness
torpid raft
lapis ferry
#

I used custom model data

lapis ferry
torpid raft
lapis ferry
#

crazy

orchid otter
#

true L

sleek basin
#

Hey,
I'm trying to add a custom item to ShopGUIPlus, but I cannot seem to make it work.

Here is the code for giving the custom item

        // Create a new ItemStack for a player head
        ItemStack head = new ItemStack(Material.SKULL_ITEM, 1, (short) 3);
        SkullMeta meta = (SkullMeta) head.getItemMeta();

        // Set the display name
        meta.setDisplayName(Color.translate("&b&lCustom Diamond"));

        // Use reflection to set the custom texture
        try {
            Field profileField = meta.getClass().getDeclaredField("profile");
            profileField.setAccessible(true);
            GameProfile profile = new GameProfile(UUID.randomUUID(), "CustomDiamond");
            profile.getProperties().put("textures", new Property("textures", customDiamondTexture));
            profileField.set(meta, profile);
        } catch (NoSuchFieldException | IllegalAccessException e) {
            e.printStackTrace();
        }

        head.setItemMeta(meta);

        // Add NBT tag using NBTAPI - this is what ShopGUIPlus will detect
        NBTItem nbtItem = new NBTItem(head);
        nbtItem.setString("custom_diamond", "diamond");

        return nbtItem.getItem();
    }```

and here is the yml snippet for the shop
```    '2':
      type: item
      item:
        material: SKULL_ITEM
        damage: 3
        skin: eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvOGNiMzQ2NDlkMWJhODM0MTdiM2M1YmM1MzQwZDg4NmIwYTRhOTBhMTVmMzFlZjlkY2I0NjY4ZTQzZTdlMzdjZiJ9fX0=
        quantity: 1
        name: "&b&lCustom Diamond"
        nbt:
          1:
            type: STRING
            key: custom_diamond
            value: diamond
      buyPrice: -1
      sellPrice: 100
      slot: 12```

It does not let me sell the item, even tho I got the given item in my inventory.

Does anyone know how to fix this?
proud pebble
#

according to shopguiplus's documentation, it requires that to be set to true to allow for nbt tags being used

sleek basin
#

I have set that to true, yes

proud pebble
#

looks like nbtitem is deprecated

trail burrow
pulsar ferry
#

What issues?

trail burrow
#

will not let plugin load

icy shadow
#

((Object)null).toString() what is this supposed to do?

trail burrow
#

I can build, just not load on server

#

I didn't write that section so I could not answer that

icy shadow
#

well thats the problem haha

trail burrow
#

I didn't mess with anything that was not broke which now is the configs

icy shadow
#

regardless, that's the source of your issues

trail burrow
#

I decided to role the class back to before I started to amke changes and start over

ancient atlas
#

hello im a newbie when it comes to plugin development, but i wanna know how to compile .java files to .class? :D

torn heart
#

just follow those

torn heart
#

I notice that a lot of places which talk about async operations in Minecraft plugins rarely seem to add keywords like volatile to ensure safety

#

I've surely made this mistake often with plugin code where I'm not thinking too hard about it... I wonder how common this is

sterile hinge
#

volatile is trickier than many people think and doesn’t automatically make anything safe

torn heart
#

i'm aware that it's not the same as using an atomic

#

i guess i should say that concurrency measures like that are kinda ignored..

#

if you don't get a blaring "concurrent modification exception" i think less people care

sterile hinge
#

Yeah many people think if their code works as expected when testing, it means that it‘s thread safe

marble portal
#

that being said, most people don't deal with lock-free synchronization primitives so that's probably why you don't see many using the keyword

minor summit
#

youre green

#

dabadee dabadae

sterile hinge
minor summit
#

youre blue

#

dabadee dabadae

#

im yellow

#

is just another lemon tree

marble portal
#

I feel like I am missing a reference lol

minor summit
#

surely you know Blue by Eiffel 65

marble portal
#

I think it is been at least 10 years since I last heard this song lmao

minor summit
#

yo listen up, here's a story, about a little guy that lives in a blue world, and all day and all night and everything he sees is just blue, like him, inside and outside

#

blue his house with its blue little windows, and a blue Corvette

#

I forgot the rest of the lyrics

marble portal
#

I have a girlfriend, and she is blue too

#

that's the only part I remember

river solstice
#

well apart from ensuring variable is always read and written from main memory and not thread cache volatile also means a write to a volatile variable happens before every subsequent read of that same variable.
and it kind of provides a lightweight form of synchronization, though weaker than synchronized

minor summit
#

I REMEMBER

minor summit
#

I'm blue dabadee dabadae, dabadee dabadae dabadee dabadae

#

etc etc

river solstice
#

but yeah personally in my 5 years of work experience and maybe another 3-4 years of personal I havent really used or seen much use of volatile

marble portal
#

I rarely do lock-free synchronization, it is annoying and I will use a lock if I can

#

I don't think I've done anything real-time enough in order to care about it

marble portal
#

they do generate more store instructions which may lead to cache invalidation but that isn't much of an assurance

minor summit
#

yeah I mean the java specification does not talk about main memory or registers or any specific cpu or memory architecture, hell it doesn't even talk about stack and heap

#

for all that matters, volatile is a noop keyword :p

sterile hinge
#

modern CPUs have some common cache layer anyway, beyond that, synchronization protocols in the CPU can employ different strategies to ensure cache consistency

sterile hinge
minor summit
#

ur a memory fence

unreal wigeon
#

Hey

#

what age group do you think most developers are who make minecraft mods? (Not plugins)

dusty frost
#

teenager to young adult

minor summit
#

and then there's Matt

torn heart
#

like literally removing volatile in one place where it wasn't needed reduced latency significantly

pulsar ferry
torn heart
#

from 7 -> 5 ms

unreal chasm
#

hello, guys

#

hello, cute devs

unreal chasm
sterile hinge
sterile hinge
unreal chasm
orchid otter
unreal chasm
#

this is her nickname that can be called by me

#

only me, not you

orchid otter
#

🤨

unreal chasm
#

lol

#

Software Gardener ...?

torn heart
#

or well

#

I don't really remember

#

I think it was single threaded

#

and the overhead from volatile had some impact

#

I know it was some situation where the annotation was unnecessary

orchid otter
icy shadow
#

hop off goat

fathom raptor
#

So i got a question. Im using license gate to license a plugin i want to public and keep seeing "[15:14:18 INFO]: [Cooldowns] [STDOUT] Response Code : 200
[15:14:18 INFO]: [Cooldowns] [STDOUT] Response: {"valid":true,"result":"VALID"}". Is there a way to like disable that or not? I've looked and i couldnt find anything

sterile hinge
#

sounds like scam to me

snow grove
#

acc made today too

#

has global mute but didnt delete msg 😢

minor summit
#

#NotMyTony

proud pebble
#

just started to notice this after adding my first async bukkit task when reloading a plugin im working on, im canceling the task on plugin disable so i dont believe its got anything to do with my plugin specfically.

anyone else seen this error message before?
im using paper 1.21.5-114

#

i did search and found https://github.com/PaperMC/Paper/issues/11101
which seems to mirror my exact error looking at their latest.log, seems like it was fixed in a version of 1.21.7 tho that patch seems to have not been backported to anything before that which kinda sucks

GitHub

Expected behavior No errors and a clean reload. Observed/Actual behavior A ConcurrentModificationException. Steps/models to reproduce Start server Reload until you see the error. ( it's at the ...

#

something else ive noticed, is if you cancel the playeritemdropevent while having a full inventory, it just quitely deleted whats on your hand

minor summit
#

are you testing in creative mode?

proud pebble
#

you fill your inventory with any item and have any item on your cursor, you pickup the item onto your cursor switching places with another item, you then attempt to drop the item from your hand on the outside of the inventory, if you cancel the event to stop you from dropping it, it deletes it

proud pebble
# minor summit are you testing in creative mode?

for the inventory drop cancel deleting an item, i tested in both creative and survival, i thought it was a creative mode only issue but i tested in survival with the same result of the item being deleted

minor summit
#

you should probably cancel the inventory click event where the action is drop

proud pebble
#

ill have another look and see if i did that or not

#

from what i can tell i do cancel the inventory click event

minor summit
#

and the message is sent?

proud pebble
#

yeah

minor summit
#

that should work fine in survival, creative mode is a whole other can of worms

proud pebble
#

just performed the same action again, it doesnt drop it, but if i close my inventory and reopen it it does delete the item

#

hmm, im not sure what event is called when i close and reopen the inventory tho i do believe that its just clientside

minor summit
#

your own inventory? the close event will be called so the server can drop the item, but it doesn't get called for open

proud pebble
#

inventorycloseevent is called when you close the player's inventory?

#

oh so it does, hmm, now to try come up with a fix

#

ill try to see if i can get it to stick to the player's cursor

minor summit
#

that might induce some fun client desync

proud pebble
#

i just need to prevent it from being deleted, its up to the player to not fuck with it

minor summit
#

why not just drop it

proud pebble
#

trying to prevent a player from dropping a specific itemstack, basically making it soulbound to the player

#

yep its no longer deleting the item by doing this

proud pebble
#

just found another issue, tho was fixed by returning if the inventory had an empty slot

#

cus im big dumb and coded a dupe

proud pebble
#

fixed another issue caused when an itemstack that can stack be undropable tried to stack into the inventory, since not all of it could stack you would end up with a duplicate of the stack on your cursor which would dupe whatever wouldve been added to the inventory

eg full inventory other then half a stack, close the inventory and reopen you would have 64 items on your cursor basically duping half a stack of items

#

its now fully fixed

crisp star
#

Because I see you use singleton getters over your managers

proud pebble
sterile hinge
#

cleaner code

#

though the code be cleaner even without guice

crisp star
proud pebble
#

it looks clean already tbf

#

much cleaner then passing my managers to every class that needs them in their constructor

icy shadow
#

I love guice!

river solstice
#

guice me up

torn heart
#

cool!

minor summit
#

i like dagger

minor summit
#

and who asked you

#

nice embed fail btw

#

congratulations

river solstice
#

dagger me up

viscid nymph
#

Has anyone ever dealt with Gradle failing on the compileJava step because of a getsockopt error? It seems to be coming from my Repository calls :/

        name = "placeholderapi"
        url = "https://repo.extendedclip.com/releases/"
    }``` 
This is the correct one, no? I tried without the name as well but it  just times out
viscid nymph
#

Possible solution:
 - Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html```
#

and then when I try to do the Jar anyway it hits you with a:
Connection timed out: getsockopt. If you are behind an HTTP proxy, please configure the proxy settings either in IDE or Gradle.

#

It's not giving me much else on the logs side to really debug either, so sorry if it's not a lot :/

viscid nymph
# dusky harness can you show the error?

Oh wait there's a bit more:

> Could not resolve all files for configuration ':compileClasspath'.
   > Could not resolve me.clip:placeholderapi:2.11.6.
     Required by:
         root project :
      > Could not resolve me.clip:placeholderapi:2.11.6.
         > Could not get resource 'https://repo.extendedclip.com/releases/me/clip/placeholderapi/2.11.6/placeholderapi-2.11.6.pom'.
            > Could not HEAD 'https://repo.extendedclip.com/releases/me/clip/placeholderapi/2.11.6/placeholderapi-2.11.6.pom'.
               > Got socket exception during request. It might be caused by SSL misconfiguration
                  > Connect to repo.extendedclip.com:443 [repo.extendedclip.com/104.21.48.1, repo.extendedclip.com/104.21.64.1, repo.extendedclip.com/104.21.80.1, repo.extendedclip.com/104.21.16.1, repo.extendedclip.com/104.21.32.1, repo.extendedclip.com/104.21.96.1, repo.extendedclip.com/104.21.112.1] failed: Connection timed out: getsockopt```
pulsar ferry
#

This ^ was apparently because of the "La Liga" Cloudflare block pepeLaugh

formal crane
#

Does anyone know if this is the correct way to make a Dockerfile (i am using a docker api in nodejs typescript, second screen is my version file where i want to store versions if thats optimal)

torpid raft
#

interesting that you chose node 23 instead of an lts version

viscid nymph
#

Oh my god I just read up about this what kind of joke country am I living in pepekek

torn heart
#

this is peak programming

#

15% performance boost by not using lock.read when it wasn't necessary

sterile hinge
#

🤨

neon pewter
#

the guard condition should replace the if below but why ide doesn't ware me that !handle.isDispose() always true ?

pulsar ferry
#

Because handle.isDispose() is a method call the result could be different from the first call

#

If you assign it to a variable it'll tell you

icy shadow
#

you could add @Contract(pure = true) to isDisposed (assuming it is pure) too

neon pewter
icy shadow
#

yes

neon pewter
#

got it, thank you

pulsar ferry
#

Will be the same even if you are not using atomic references, unless you tell that the method is pure, aka same input always give same output
For example

private boolean isDispose = false;

public boolean isDispose() {
  final var oldValue = isDispose;
  isDispose = !isDispose;
  return oldValue;
}

Your first if would be false, your second would be true
I know it's a dumb example but just showing that side effects can affect the result of a call so the ide doesn't make assumptions
If you had

if (handle == null) return;
final var isDispose = handle.isDispose();
if (isDispose) return;

if (handle != null && !isDispose) {
 ///
}

This would give you the warning

neon pewter
#

oh ok

sterile hinge
#

alternatively, it might be enough if the analysis can't determine which specific implementation of the method is called at runtime

torn heart
# sterile hinge 🤨

I have the main simulation thread + other threads which need to access body data, but only the sim thread is modifying the data, thus I have a readwrite lock on that because comod, but since no writes can possibly happen while a read is happening inside the sim thread itself, a read lock isn't needed in that case

#

15% of my collision detection time was literally just the lock overhead

sterile hinge
#

so you skip the read lock only when reading from the only thread that writes?

torn heart
#

yes

#

well technically not exactly

#

I skip it when I know no worries can happen

sterile hinge
torn heart
#

I skip it from all threads launched in the sim step

#

but basically yeah

sterile hinge
#

so you ensure a happens-before relationship in a different way?

torn heart
#

yeah cause it's just inherently at an earlier part of the simulation

sterile hinge
#

that doesn't mean much

torn heart
#

the tick diagram is like

process new & removed bodies (write) -> a bunch of reads which might be from multiple threads via tasks launched in the same thread via Executor

#

& it's blocking

#

like for collision detection I have a count down latch and I run the callables after the write step & block for their completion, which obviously means there won't be any writes during them

#

very simple optimization that I somehow didn't notice, God bless profilers 🙏

sterile hinge
#

okay yeah then there's a happens-before relationship due to how Executor is specified

torn heart
#

yeah they're called serially so they're only asynchronous with respect to each other, not to the overall simulation tick

#

just very simple like this

minor summit
#

simulate deez nuts

torn heart
#

so ofc ion need read locks in the whole sim thread(s), only in other threads (render thread)

sterile hinge
#

it's less about whether it's logically afterwards and more about whether there is a mechanism in place that ensures exactly that

torn heart
#

yeah I mean it's blocking

#

so

sterile hinge
#

that's not enough

#

but the Executor specification is enough

torn heart
#

if I use coroutines it would be the same here

sterile hinge
#

Memory consistency effects: Actions in a thread prior to submitting a Runnable object to an Executor happen-before its execution begins, perhaps in another thread.

torn heart
#

like coroutine.launch .... job.wait (forgot what it's called)

torn heart
#

in serial code

sterile hinge
#

using an executor means the code is not sequential

torn heart
#

well launching the task is serial