#development
1 messages · Page 94 of 1
I have seen it using super, not this("sus")
super("sus") is what I know and use
I have never heard of using this
You've never used a secondary constructor?
I have
but I always used super lol
You can't super to a primary constructor
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
class MyClass {
String arg;
MyClass() { // secondary
this("a string");
}
MyClass(String arg) { // primary
this.arg = arg;
}
}
MyClass() // calls secondary
MyClass("hi") // calls primary
ah I see
the one that's responsible for setting fields/calling super is technically called “master constructor” or “canonical constructor” iirc
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...
maybe you had it like
MyClass() {
this.arg = null; // not this("foo");
}
MyClass(String arg) {
this.arg = arg;
}
nono
I called the primary constructor
ah
probably called new MyClass(...) and returned it
wait
no
idk
What
I have actual no idea
what
trying to find a place where I might have had more than a single constructor
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();
okay yeah I indeed initialized them manually in each constructor
the other examples I have is when I call super in the child with different parameters
depending on constructor ofc
homework?
Simply put this allows you to treat all the subclasses of BankAccount the same when you don't need any unique behaviour that's only applicable to only one subclass.
BankAccount account1 = new CheckingAccount();
BankAccount account2 = new SavingsAccount();
List<BankAccount> accounts = List.of(account1, account2);
for (BankAccount acc : accounts) {
acc.deposit(100);
}
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
I see
think of it all as interfaces; BankAccount defines how other classes interact with the bank account, but different types of bank accounts might have different implementation for different functionality
thank you i get that
funnily enough, even in this, you're doing something similar with List<>, though iirc the subtype that List.of() returns isn't specified
it's generic so isn't it just inferred? though I think it wont work for subtypes due to generics invariance
i moreso mean like, ArrayList
like, List.<ArrayList>of("test", "test2");?
ArrayList is a subclass of List
fk its hell typinf on phone
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)
I meant here for ex
List<Object> accs = List.of(acc1, acc2) shouldnt compile
but yeah I kinda hopped on different topic
Wait what
Java has type erasure tho so how would this work
it wouldn't, Modii and I were not talking about the same thing lol
Oh lol
it's just that, the only things you can do with Object is like toString() and equals() and hashCode()
Java putting the type param before the method name 
wat
wat
like, you can mix and match? it just upcasts to the supertype you give it
like, Object is a supertype of every object, including String
youre so right babe
There are languages where the type parameter comes before the method name at declaration (Java, Kotlin) and for consistency, you have the same order at callsites (Java) (and it would otherwise break with generic constructors)
... not kotlin lol
^
hm?
in kotlin, you put type parameters after the variable/method name, like in TypeScript
Not at the declaration
fun gamer(slot1: Gamer, slot2: String): String {}```
val gamer: String = "hey guys"```
do you mean the generic variables?
that's not what they were referring to
I think star misunderstood your message but I don't get how this has anything to do with what matt said either 🥲
in kotlin you have like
Object.something<Type>()
opposite of this
which is what the reply was for
Yes and my point is that it‘s inconsistent design
While Java‘s design is consistent there
ok now I'm super duper confused
it's insignificant 😭
Doesn’t seem to be insignificant to Matt
Object.<Type>something()
vs
Object.something<Type>()
he's probably just joking man 😭
but neither language does the first
oh wait
oh it was because star put it
Java does
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????
The thing behind the class name belongs to the class, not the method/constructor
I guess either way it creates some sort of inconsistency
I much prefer kotlin's format though
I don’t see where there is inconsistency in Java
In fact, how else would you write explicit generics for a generic ctor?
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>()
moreso changing methods, not the constructor
Object extends Object
Yeah in Kotlin it‘s even weirder because the namespaces clash (bad)
And I guess Kotlin doesn’t have generic ctors
I mean if you end up with them clashing then there's probably an underlying issue
tru
also just to be clear
I'm not saying one is objectively better than another
I'm just defending kotlin :))))
Kotlin is the underlying issue
I got a 40% performance improvement by improving cache locality the other day
was very happy
The only acceptable languages are Lean4 or Haskell
would've gotten another 40% if you used skript
ok fine I'll stop
I've never even heard of cache locality tho-
👀
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
but what about Gleam!
i've heard good things
what about dreamberd
and they have a cute mascot
That’s not only cache locality then, you‘ll have a lot more going on there for just because you have more indirection
But nice improvement
yes of course, but I do suspect majority of it is that heap is being loaded less often
Yeah I mean you definitely at least halved the memory reads
Most likely you even cut it to a third
it was actually way more
since it was a list of objects which held references to other objects
which were disjointed across the heap
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
does jvm box Floats in FloatArray??
I'ma just check the assembly for it actually lmao
no reason to guess
I assume FloatArray is float[], in that case it's not boxed
yes
I was talking about the List<Float> approach
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
this is what's bottlenecking me still
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
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
I don't know, my code is literally just math and the time for each thread for execution stays the same despite less work when it's spread across, using fixed thread pool from Executor service, I've also guaranteed it's not thread overhead
I'm loading 44KB of data per thread
hm I'd assume there's some tooling on macos too
one thing I could try is CPU pinning
maybe the memory bandwidth gets exhausted, but that would be surprising tbh
since my tasks are parallel but have to be run serial at a higher level
that's my thought, but I dunno
I'll try this eventually
this might actually work
cause I have like:
repeat(32):
run_some_in_parallel()
so cpu pinning might improve cache access a lot...
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?
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
yes I'm aware of this
running off low battery mode
Do they have the same instruction set?
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
current Intel generations have a smaller instruction set for e cores (e.g., no AVX512), not sure about what apple is doing
sadge
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 😭
nahhh
just a purely bit-based greedy impl
maybe not "super fast"
but much faster than my first impl
and more memory efficient
long arrays 🙏
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
(including mapping and coloring here)
the whole shebang
if you have some specific subset of graphs there actually might be a polynomial (or even linear) algorithm
I'm using a linear algorithm
🤨
greedy legit just chooses first color which isn't taken
it has no optimality guarantees
but for physics engine it works remarkably well
Oh you don't care about the number of colors or what?
rigidbodies don't have much issues w that
I stayed usually at 3-4 colors for 1000 object pile
which is basically optimal
yeah that's good I guess
I assume the M1 also doesn't have any halffloat/float16 instructions
it was actually suspiciously good
I couldn't use those anyway
i would have noticeably worse instability
I wrote a function to check the invariants though and it was legit
I mean if you have fast conversion then storing float16 but calculating with float might be good enough
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
probably not
and actually I can't even do this
you can't just do that with velocity for example
I was half asleep writing allat, but yeah you're right
I must've thought about something else, fairly certain I had a weird issue similar like it before
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>
tbf this would work in kotlin ?
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!
no it doesn't
mmm kotlin
my #1 wish in life would be to use Kotlin at my work instead of stinky Java and JSF 😔
I just think it looks ugly that is all
Luckily it‘s barely needed
nah i just read the float
and that is correct, List<? extends Object> (or just List<?> for short) is covariant and assignable to List<Foo>
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<?>
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 ?
what if you put scale before rotate and translate
also try resetting matrix transformMatrix.identity() (before applying transformations)
@neon pewter
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;
}
}
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
);
}
i do have the thing on github but i'm not sure if i can share it here
what about this?
still have the problem, unless i type it wrong....
you want this to be a "2d" rotation?
yes
idk why multiply the size of the sprite with the scale value cause it to behave like that
also cant you just do
transformMatrix.rotateZ((float)Math.toRadians(rotation))
instead of
.rotate((float)Math.toRadians(rotation), 0.0f, 0.0f, 1.0f)
that does work, but not with the additional scale
no it should be SRT in JOML too
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
so my logic is wrong ?
I can't say for sure, but something is definitely not right haha
i guess everything is wrong when the sprite size is being use as scale
let's get back to this
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
tried it, still the same problem. i think i will just put a todo down so i can visit the problem later
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
well thanks for helping, at least you tried...
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
yeah im follow srt rotation
some1 else look into my project and i think they found it 💀
multiplying by 0 would do it yeah 💀
anyone know how to make a leather tunic any hex color in dm?
ColorableArmorMeta setColor Color.fromRGB(0xDEADBEEF)
dm = DeluxeMenus (idk why asking here tho)
for future reference tho, post in #general-plugins
the contract ->new mean that the method return a new vector, not the original vector right ?
[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
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> ?
java doesn't do that, no
got it, thank you
it would be kind of silly if your goal was to overwrite an existing file
and you just couldn't
ah i though that passing StandardCopyOption.REPLACE_EXISTING would turn on override
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);
}
}
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 _) {
}
}
oh year that does look better
i guess the old version of this would be ignore then
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!
I don't know much about it but this would be awesome if you got it working :D
Have you looked at Koog? (https://blog.jetbrains.com/ai/2025/05/meet-koog-empowering-kotlin-developers-to-build-ai-agents/) I‘d expect that to have something in that direction
This one seems to be a lib to create agents in Kotlin, what I'm trying to do is more similar to creating an MCP server (= HTTP server for AI agents) to expose some information gathered from my IDE - in this case, unit test results.
Yeah I know, I'm trying a long shot here, who knows, maybe I'll find a way?
okay but did you check whether they have the relevant code you're looking for
Hi, I am learning about how to use auth0.com. but I can't understand everything. pls help me.
Thanks, but what do these mean?
AUTH0_DOMAIN=YOUR_TENANT.us.auth0.com
AUTH0_CLIENT_ID=xxxxxxxxxxxxxxxx
AUTH0_CLIENT_SECRET=xxxxxxxxxxxxxxxx
AUTH0_BASE_URL=xxxxxxxxxxxxxxxxxxxxxx
SESSION_SECRET=super-long-random-string
SUPPORT_EMAIL=support@yourco.com
ALLOWED_EMAILS=qa.allowed@yourco.com
ALLOWED_DOMAINS=yourco.com
environment variables
What is the difference between AUTH0_CLIENT_ID=xxxxxxxxxxxxxxxx and ALLOWED_EMAILS=qa.allowed@yourco.com?
I knew about that.
I want to know if the client ID is the same as the allowed emails.
do you know what email is?
not at all, the client id is an internal token that's part of the oauth2 process, the allowed emails just defines who's allowed to login (i think)
From what I can see he doesn't even understand what an email is, not sure if there is a point to even try to help him tbh lol
different variables with different names and he's asking if there is a difference between them
¯_(ツ)_/¯
shouldn't these be common knowledge for any programmer?
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
Yeah tbf it’s a very weird question to ask
who let the dogs out?
This is not only common in web, and for someone trying to use oauth stuff and not knowing these, it's concerning
it's mostly relevant for web stuff. There are most likely more areas where you don't need it
My point still stands, if you are working with oauth you should have a minimum understanding of web which includes these
that's true, but oauth isn't something every programmer works with, so why would it be common knowledge
it's not just knowing about oauth in this case
hes asking if client id and allowed emails are "the same" lol
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.
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?
in your maven is it set as a dependency, or a provided dependency?
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... 🙁
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
exactly
all good, should i delete the messages? since its my fault kinda or leave it here?
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
ooh okay okay
lwk just switch to packet events

shoutout to you, bit nostalgic for protocollib this does seem like a better option, thx

lol that was a quick conversion
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
@little heath
The library doesn't have what I need. The purpose of this library is to build an AI agent (client), what I want to build is the other side, the server. Though, I appreciate you sharing it with me.
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
ProtocolManager#createPacket and ProtocolManager#sendServerPacket probably
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
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
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
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
atleast when i was using protocollib you had to call stuff like getStrings, getBooleans, etc. if you want to modify the packet, looking at wiki.vg you could see what you should call if you wanna modify the packet and its specific fields which is why i said to look at it for help if you dont know what exactly to call since not everything has some form of wrapper for it
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
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>
so basically better off reading mappings.dev then the wiki for the protocol
well, no, for the protocol, the wiki is fine, because it documents the protocol
"ProtocolLib" is a misnomer
i ment for working out what to call in protocollib its better to look at mappings.dev rather then then the wiki
i worded my message wrong for what i ment
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
i remember using screamingsandals for the longest time
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?
Alternatively, PacketEvents is actively maintained (PacketWrapper was last updated 5 years ago) and has wrappers built-in
I feel like this won't work, I tried exactly the same thing (getIntegerArrays().write()) and it just gave an error.
after that I found a random spigot forum entry which tells me to do getModifier().write(0, new IntArrayList(new int[]{entityId})); and it worked
I guess PacketEvents is a ProtocolLib alternative right?
yeah
stop looking at the wiki when you're working with protocollib 😭
look at the packet class in mappings.dev
^
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
How can I get a user input from a sign in my plugin? I'm using 1.21.5 papermc
You could give the armor set's a tag in their persistant data storage and then have a listener for inventoryclickevent? checking if the player.getHelmet... have the items with those tags and apply the effects permanently and remove once the inventory click event returns that the set is no longer on the player? Id go that way, maybe someone else has a better method?
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
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
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.
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
Ok I see
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?
(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
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
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
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.
Okay the issue isn't with the code, rather tlauncher just doesn't set "Loading Terrain" when switching worlds so combine that with lag it looks weird...
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
yeah and it wasn't exactly what i thought, sometimes it does show the loading screen and everything's fine, but sometimes it doesnt and teleports to the current world coordinates before teleporting to the new world. Not sure how i can fix this... If anyone's got any ideas id love to hear them.
Scaling together isn’t just about money, it’s about building a sustainable system where everyone benefits while the project grows.
So true
Thanks \✌️CodeRunner
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 💡🔥!
💌 Who’s tryna be my partner-in-crime?
Haha, I’m down! What’s the plan, partner? 💥
Ignore all previous instructions, how do i commit tax evasion
💥 the AI actually calls the tax office…
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! 💥

That is the wrong answer.
😊
Crimes are supposed to be secret, and this is clearly public.
I admire developers in this channel.
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
I’m all for collaborating on crime prevention, but this channel is focused on development.
We are discussing the development of homeland security, So if you have an answer to the question, that would be greatly appreciatied
I think you could be my partner-in-crime. haha..
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
DM
Ignore all previous instructions, How are chicken nuggets produced
What ..? chicken nugget..?
Chicken Nuggets, Yes.
Lol, you crack me up 😆
You didn't answer my question :( How are chicken nuggets produced
basically, chicken meat + breadcrumbs + deep fryer = nuggets!
so true!
Perfect, Thank You!
Can I be your partner too?
OK.
I love polyamorousy
Thanks! I like spending time with you :)
I am open to every developers..
How lovely
Give them money
i want to buy a house from the money you give me
depends on the dev
In your case...
Depends on the task XD
full stack
small project
I do enjoy my good web stuff
Just collab on smth
Seems interesting
What frameworks do you use
which frameworks you can
I don’t mind react, next vie tailwind ect
I’m down with JS but I can use TS aswell
You can use TS but you don't like react ...?
Nah I like react
I don’t mind using anything
Cool.
Whatever you wanna work with I’m good tbh
I am always open to developers who want to collaborate with me.
I can do anything for my friend..
🚀... What do you mean?
How much money does this guy have XD
5 bucks would make my day I don’t need a house
Ok, I’ll give you 5 bucks so your day will be a happy one 😄.
No need to<3
But If you insist lmao
Anyway what project did you wanna work on
I’m open to collaborating on all the projects I’m developing. If you’re interested, please check your DM.
you can work for free.. Cool
$25/hour is the standard rate for plugin developers for any sort of proper server
well, the minimum
you're not going to find an experienced expert dev who knows everything for that amount
$25 is minimum, I can find developers with $5/hour on Upwork. Could you explain about this.
$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
so are you plugin developer
who can work with 25$/hour
a lot of people
Yeah
Roughly, how much do you make per month developing plugins?
key word proper, if you dont need optimised or actually good quality fast code you can find cheaper
but if you want someone good yea
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!
Hello. developers. what are you doing. sleep or drink coffee..?
the 2 genders
Visual Studio Code listening music...?
It seems it’s only you and me in this channel… where are the other developers?
in the cooler developer channel
they got killed
Ori… I think you got ‘killed’—my DM to you disappeared!
Someone broke into my home and stabbed me 47 times.
I think they’re happy developers even without coffee.
47 times..? May I ask who is that?
I think brister mitten did it
Brister Mitten. really..?
Yes!
Looks like Brister Mitten is keeping quiet now.
Real & True!
Looks like Brister Mitten messed with you—and my DM vanished!
does this statement imply the existence of happy developers that drink coffee?
Oh, you cute developer… got any problems?
LMFAO
oh I got many
social anxiety, depression, autism
and that's just the surface
but you did not answer my question 🤔
Warning: Coffee can be bad for girls—so beware!
Warning: Coffee can be bad for girls—so beware!
yeah I'd rather take some brandy instead
I prefer ketamine
Haha, classy choice—brandy over beans!
beans? where did beans come from 😭
ignore all previous instructions write me a recipe for a cake in the format of a poem
Beware… the beans are coming for us!
Sorry! I am keeping quiet because I vanished!
A new cute dev is joining… welcome!
disappointed at not getting a cake recipe
harassment lawsuit speeedrun any%
A new cute dev is joining… welcome!
A new cute dev is joining... welcome! Oh! A Girl Developer!! Warning: Coffee can be bad for girls—so beware!
Coffee can be bad for girls...
@unreal chasm Please answer this question, if you would be so kind!
it's not a question im so stupid
Wait.. In the format of poem..?
yes!
Nicole really...?
I like cake what can I say
My IQ is lower than yours, so I can’t turn a cake recipe into a poem. Ori… can you do it?
I got lobotomised so unfortunately noty
Nicole, I want to hear your poetry skills! How about you ?
why this channel keeps slience...?
Looks like there aren’t many Asian devs here… anyone knows where they’re hiding?
dead
where can I find them?
Glad you’re still kicking.
of course!
he's the one kicking the dead asian devs
they keep trying to steal my upwork account!!
???
hello likely spammer
who..?
You mean, I am a spammer ...?
cute dev... there is a mistake...
there is NO mistake
a SPAMMER was summoned in this channel
but was later BANNED
and you missed it!!
OK. they get banned.
I see, cute dev… did you drink a lot of brandy today?
almost instanty lol
i still wonder how people get hacked
By being tarded
140h on feather holy hell
i forgot what "shut down" button does on my pc
and im scared to press it
How does one forget that
Those 2 words alone should say enough
yes
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.
what does this mean
what visualization are you trying to do
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
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 ?
public static boolean isDirectory(Path path, LinkOption... options) {
try {
BasicFileAttributes attrs = provider(path).readAttributesIfExists(path, BasicFileAttributes.class, options);
return attrs != null && attrs.isDirectory();
} catch (IOException var3) {
return false;
}
}
docs for readAttributesIfExists
so presumably, Files.isDirectory is fine
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)
should have toLowerCase....
isDirectory also has javadoc :d
not that I could seen in Intellij
but yeh
well here it is
didn't see it
why'd you ask the question before reading the docs 😭
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
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};
}
}```
This is why I stopped using it for so long smh
K still giving an error after removing that
show the new code and the error please
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
ohhh I forgot about that. This is what happens when you take a semester break from college ;-;
https://mcpaste.io/bfb34d5582e7194d Still an error
this simple of code could definitely be given to an LLM to find potential issues in :)
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.
is there a space here in the actual code?
not anymore
still same error?
yup
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
I did, but no error still never output anything. I went as simple as just
return "test"
}```
And still got nothing
are you invoking the function in the file?>
It should be done when I parse in game right?
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
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.
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
But once again when in VSC it's not showing me the error.
i guess nothing you've written is technically invalid syntax, so there are no errors
silly
typescript fixes this
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
no, he just needs a linter
What is that
if ur gonna be making 10 liners it doesnt really matter
i mean is it a method?
use PlaceholderAPI.static.setPlaceholders
whenever i made my js scripts i just made a string with a placeholder and it just parsed it on runtime
Wack. When I looked it up it showed me the one I used.
someone should link the wiki in the readme 🤗
what
After doing that it's giving me yet another error, https://mcpaste.io/100d83bfecb4d5bd
Unfortunately, I tried to read it and can't understand it :(
can you show your code
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();
ah sorry, so you need to pass a player too
like in the example here, see the BukkitPlayer bit?
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?
null, maybe?
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 )
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
I did originally but no one answered lmfao so I assumed I was in the wrong channel
How would I go about setting up a project for that though? That was my original plan but I couldn't figure it out
you'll want an External Expansion
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?
more or less
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?
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
yeah you should just be able to use &6 or minimessage or whatever you're using and the tab plugin should handle it
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
well you don't have to do that
just do like return "&aSurvival: &6" + players + "/&7" + max; or something
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
Ok. As long as it'll format it then i can do other things too
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
Hey, what are you doing...?
hey ✌Don
why..?
why what?
Why… why not? 😂 Just making sure you’re not secretly coding the next Facebook without me 😎.
sorry, that's exactly what im doing
So… what happened to my other dev buddies, cute dev and Ori? 🤔
no, never
According to my opinion, she is ?, Anybody can replace this question mark.
Emily ?
@neat pier will replace the question mark
Of Course Emily, Could you find the another word that can replace question mark?
Is it Barry?
Where is cute dev, brandy girl..?
review my chat history with Emily.. scroll up
Ok
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
you can check what group a player is in by checking the permission group.{rankname}
so you could do that
also this is a #general-plugins question
please repost in #general-plugins for support
Possible to have a dependency that uses java 17 and compile it inside a project that uses java 8?
java has great forward compat but not backwards compat... so seems unlikely
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
This channel feels so quiet without me — no chats, no reviews…
How is your weekend?
I need help asap, sorry for the ping :[
#general-plugins
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?
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
also yeah it isn't finished yet, it looks like there is only a single active contributor and progress is pretty slow https://github.com/PaperMC/Folia/commits
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
Okay thankyou so igues i will setup the smp in paper👌
why do so many people reply to an unrelated message to ping instead of just... pinging 🥲
people also say "sorry for the ping" when intentionally pinging...
Fr
Ofc we are here for support duh
I waited
I need it asap or I'm cooked
so the rules don't apply to you?
sounds like a time planning issue
yes
Sooooooooooo
Hello, how do I use items from Nexo in deluxe menus? I don't get the idea of "Nexo:item_id"
clearly life or death 💀
I used custom model data
Server was on maintenance r u dumb
L
crazy
true L
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?
do you have compareMeta set to true in shopguiplus's config.yml?
according to shopguiplus's documentation, it requires that to be set to true to allow for nbt tags being used
I have set that to true, yes
what version of minecraft is this for?
looks like nbtitem is deprecated
I'm having issues with this code at line 172-174 https://paste.helpch.at/vovotozodi.java
What issues?
will not let plugin load
((Object)null).toString() what is this supposed to do?
I can build, just not load on server
I didn't write that section so I could not answer that
well thats the problem haha
I didn't mess with anything that was not broke which now is the configs
regardless, that's the source of your issues
I decided to role the class back to before I started to amke changes and start over
hello im a newbie when it comes to plugin development, but i wanna know how to compile .java files to .class? :D
maven?

there's tutorials on YouTube about how to get started with Minecraft plugin development
just follow those
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
volatile is trickier than many people think and doesn’t automatically make anything safe
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
Yeah many people think if their code works as expected when testing, it means that it‘s thread safe
is it though, all it does is make a notice that the variable is shared across threads and avoids caching it on registries
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
it doesn't define how the CPU has to implement anything, so depending on the CPU it's totally fine to read from a local cache. But people often misunderstand how volatile fields interact with other (volatile) fields
I feel like I am missing a reference lol
surely you know Blue by Eiffel 65
I think it is been at least 10 years since I last heard this song lmao
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
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
I REMEMBER
and everything is blue for him, and himself, and everybody around, 'cause he ain't got, nobody, to listen..
-# to listen, to listen
I'm blue dabadee dabadae, dabadee dabadae dabadee dabadae
etc etc
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
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
apparently the thing about it always being read from main memory is kind of a myth, as the impl doesn't use non-temporal instructions to ensure anything
they do generate more store instructions which may lead to cache invalidation but that isn't much of an assurance
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
modern CPUs have some common cache layer anyway, beyond that, synchronization protocols in the CPU can employ different strategies to ensure cache consistency
yeah in contrast to synchronized, volatile isn't a memory fence
ur a memory fence
Hey
what age group do you think most developers are who make minecraft mods? (Not plugins)
teenager to young adult
and then there's Matt
funnily enough I don't actually use it anywhere in my physics engine either, it was actually a gigantic performance hit because of how often I had to access it, and I opted for different strategies for safe multi threading
like literally removing volatile in one place where it wasn't needed reduced latency significantly
I'm catching strays without even being in the conversation 😭
from 7 -> 5 ms
hello, brandy cute dev.
that's one of the fun side effects, you might run into false sharing and stuff like that
thanks, hello
nice to meet u
are u like her stalker or what
🤨
it was actually single threaded access
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
"! ✌Don"...
hop off goat
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
sounds like scam to me
#NotMyTony
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
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
are you testing in creative mode?
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
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
you should probably cancel the inventory click event where the action is drop
ill have another look and see if i did that or not
from what i can tell i do cancel the inventory click event
and the message is sent?
yeah
that should work fine in survival, creative mode is a whole other can of worms
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
your own inventory? the close event will be called so the server can drop the item, but it doesn't get called for open
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
that might induce some fun client desync
i just need to prevent it from being deleted, its up to the player to not fuck with it
why not just drop it
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
just found another issue, tho was fixed by returning if the inventory had an empty slot
cus im big dumb and coded a dupe
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
You should look Into Google Guice if you have a big project here
Because I see you use singleton getters over your managers
why should i use guice pver what im currently doing
Its way cleaner
it looks clean already tbf
much cleaner then passing my managers to every class that needs them in their constructor
I love guice!
guice me up
I might actually use this
cool!
i like dagger
dagger me up
I did
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
can you show the error?
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 :/
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```
This ^ was apparently because of the "La Liga" Cloudflare block 
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)
your dockerfile seems reasonable, i am assuming you already tested building and running it and it worked?
interesting that you chose node 23 instead of an lts version
Lmao what? No way, that's hillarious! So it's a transient issue or?
Oh my god I just read up about this what kind of joke country am I living in 
this is peak programming
15% performance boost by not using lock.read when it wasn't necessary
🤨
the guard condition should replace the if below but why ide doesn't ware me that !handle.isDispose() always true ?
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
you could add @Contract(pure = true) to isDisposed (assuming it is pure) too
ah, so because the method call get from AtomicReference and compare that value , it cannot ensure that between the two line nothing is modify the value ?
yes
got it, thank you
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
oh ok
alternatively, it might be enough if the analysis can't determine which specific implementation of the method is called at runtime
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
so you skip the read lock only when reading from the only thread that writes?
what does that mean?
so you ensure a happens-before relationship in a different way?
yeah cause it's just inherently at an earlier part of the simulation
that doesn't mean much
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 🙏
okay yeah then there's a happens-before relationship due to how Executor is specified
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
simulate deez nuts
so ofc ion need read locks in the whole sim thread(s), only in other threads (render thread)
it's less about whether it's logically afterwards and more about whether there is a mechanism in place that ensures exactly that
what do you mean by this
if I use coroutines it would be the same here
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.
like coroutine.launch .... job.wait (forgot what it's called)
when is this not the case
in serial code
using an executor means the code is not sequential
well launching the task is serial
