#help-development
1 messages · Page 1117 of 1
Maybe I do actually care
not using early returns
Maybe I actually care about someone learning
Perhaps I feel like teaching the man to fish rather than feeding him for a day
it feels good to help. but we can't help with basic java if we don't all wanna be here full-time...
?spoon
Spoonfeed a newbie for a day and they'll come back with more questions. Teach them to find their own answers and you'll both be better off: you won't get stuck answering the easy questions and they'll be much more productive than before.
spoonmoment
Works if the ghost item turned real
I'm assuming I did something wrong
you have your listener with InventoryClickEvent
nah just clickgui
Yes
Oh
you cancel it
do your code stuff
and in the listener after player.closeInventory()
you run
this
then the ghostitem will disappear
at least that's what the post said
Real
imma go google a bit
good start
?jd-s
For spigot documentation ^
ik
you can't even imagine how much you learn just by reading the Java documentation
Maven
For me I kinda clinged myself to the api. But eventually i started actually learning java and i could do SO MUCH more
Stuff like what
Stuff that’s not specifically dependent on spigot or another api
I can... do that ig?
abstraction, inheritance just plain new objects.
very basic java stuff that already provides a lot of functionality
For example in java there’s no “player” object, this is apart of nms code which abstracted to bukkit which abstracted to spigot and so on, that being said in regular java you could do player player = bukkit.getPlayer
You’d have to define what a player object is yourself
Etc
what does the error say?
mfw no effective java
Def not
I know this stuff
Oh but what’s that 1400 page java bible
oh right!!
my bad!
you have to pass the actual function
I got the 2nd edition for like 5 bucks
no offense but I didn't learn java yesterday
3rd edition is goated and you can find it on ytb
Bukkit.getScheduler().runTaskLater(Core.getPlugin(), Player::updateInventory, 1L);
Tbf I’ve only been using it for reference on concepts and what not
so? that's okay
oh
didnt
i cant read today
well
noone said that and noone is meaning to insult you.
"Non static method cannot be referenced from a static context"
For Beginners:
Codecademy - Learn Java: Interactive Java programming course from basics to more advanced concepts. Perfect for absolute beginners.
https://www.codecademy.com/learn/learn-java
JetBrains Academy - Java Developer Track: Learn by doing with projects and challenges. It covers Java fundamentals to advanced topics.
https://www.jetbrains.com/academy/
Udemy - Java Programming Masterclass for Software Developers: Updated courses that cover Java 8 to Java 17 features. Suitable for those who prefer structured learning.
https://www.udemy.com/course/java-the-complete-java-developer-course/
For Intermediate to Advanced Learners:
Oracle Java Tutorials: The official guides by Oracle for Java programming—great for understanding the depth of Java.
https://docs.oracle.com/javase/tutorial/
Baeldung - Learn Java and Spring: Focus on Spring Framework and modern Java technologies. Best for intermediate learners aiming to expand their knowledge.
https://www.baeldung.com/
Practice and Hands-on Learning:
Exercism - Java Track: Solve exercises and get feedback from mentors. Great for practicing coding skills.
https://exercism.io/tracks/java
LeetCode: Practice your coding skills and prepare for technical interviews with Java.
https://leetcode.com/
Free Resources and Documentation:
Java Programming and Documentation: A comprehensive collection of Java programming guides, tutorials, and API documentation.
https://docs.oracle.com/en/java/
Community and Support:
Stack Overflow: A vast community of developers. Great for getting help with specific problems or understanding concepts.
https://stackoverflow.com/questions/tagged/java
r/learnjava on Reddit: Join the community of Java learners and get advice, share resources, and discuss projects.
https://www.reddit.com/r/learnjava/
Remember: Learning to program takes practice and patience. Don't hesitate to experiment with code and participate in community discussions. Happy coding! 🎉
this is what I was doing when I just learnt java
Either way it seems clear to me that you’re not knowledgeable enough to use an api, so that’s why I told you to learn java… it wasn’t to be taken offensively but again that wouldn’t be my issue
you already changed it to what i told u?
can y'all shut the fuck up and understand that he knows the basics of java and the worldedit api is only kinda dogshit
Yes
Why did you asume i'm not knowledgeable enough to use an api?
Ok but he can read…
the docs are also inconclusive
And I’m pretty sure clipboards are explained in their docs
my bad, change Player::updateInventory to player::updateInventory
they're still a wonky concept to explain
Then play around with them?
They have 6 different classes, all of which are from world edit api, and I don't know what either of them does
🙏
Go and figure it out yourself man that’s the whole point we’ve been trying to make, he’s one of those people who look at it for 5 seconds then decide they don’t know what the fuck their doing
Then come here for spoon feed
haven't you also been doing that for the past 2 months
I’ve been here maybe 4 times for help?
sure, he's not exactly the nicest with his responses tho xd
tbh I saw constructor and constructor wasn't working, but I guess point taken
So no that’s not what I’ve been doing
I think I’ve been spoon fed twice actually not even 4 times
you can also come up with an explanation that isn't spoon feeding
@orchid tapir is it working now?
One time for legacy codes and mini message and another time for dependency tree structure
A clipboard is basically just "pastable content"
I don’t think even that would help
Worldedit is platform-agnostic which means that they just write a huge core and then make little adapters for each platform
Which is slightly ass because you gotta convert everything to their format
You’d have to explain to him what a clipboard is doing under the hood and how to use it and in which ways you shouldn’t use it etc, but that comes with doing it yourself
Ie: teaching the man to fish rather than feeding him for a day
no you don't lmao just explain how it's used and if he wants to learn he can look at the code
I just wanna know how to copy a location between 2 coordinates with we, that's all D:
A clipboard is used to gather contents as you put it, then your can use that clipboard to paste or save a schematic etc, that’s not shit I want to have to explain because it’s already explained in their fucking docs
Works
ik what a clipboard is 😔
10 minutes ago you said you didn’t
I mean… you essentially did, you said you didn’t know how to use one, sorry I got that wrong. But still my point of the spoon feed stands just go play around and figure it out
sure, ig
Experience is going to teach you what works and what doesn’t, that being said most people don’t like to explain this because it’s a waste of their time when you could have just followed the same process. It all comes with time and you just have to explore
You actually wasted way more time explaining all that
you could've explained how to use it quicker
OR
you could've just not started talking
and you're wondering why ppl didnt wanna bother anymore...
Don’t get stuck up on the past either, my intentions were to help. Sorry if I didn’t but I mean I promise you I was just trying to help
true though
yes, ik
It's hard to believe but I'll take your word for it
You’ve also gotta understand we get plenty of dumb shit people through here with no prior java experience looking for that sort of spoon feed and as an active spigoteer, I can say it gets tiring and a bit frustrating
we do have a lot of "hey pls spoonfeed man", please understand that nuclear is still kinda new to the world of helping people without helping people
That too
I know exactly what you mean, actually
It’s not that I mean to come off rude or offensive it’s just hard after so many times trying to explain “simple” stuff to someone and they still don’t get it makes me think they just don’t know anything (.) which is a flaw of mine for sure and should be worked on but at the same time I’d still rather put a little effort in being when I told you to learn more java or read documentation
nuclear you don't understand data structures go back to school
start over from 1st grade
let me know when you master quantum physics
That’s like the lowest effort help I could provide while still trying to help, and I just get tired of trying to explain that simple stuff all day ya know
does someone have a custom checkstyle for the intellij reformatter?
uh yeah
Understanding and applying are two different things, perhaps you should open a dictionary
I have one that yeets final into everything
I know skript, and I know exactly what you mean tbh
oh so you know data structures. name all of them
how do i apply it i have the intellij plugin and i selected the checkstyle.xml everywhere but it does not format in the checkstyle
(i use prettier bc i'm cool and now everyone will hate me on this dc)
spotless
Well then all that being said I hope we come to a resolution in that I was only trying to help and you were only trying to learn. Again there’s people here who are dickheads yes and I’m one of them lol, still I’d rather you learn to teach yourself than having to come back here every so often (more so for basic questions)
did you select that specific code style for your project
You're right, I was starting too ask a bit too much, call it a lesson learnt
different projects have different styles
now lemme go poke around a bit, be back in 5 minutes probably 🤣
i selected it all man
all projects have now the checkstyle
i tried everything
It’s not that you asked too much it’s just the fact that I see the time in between messages and that shows me you didn’t even try to play around, that’s the whole point is that you learn more from doing it yourself than someone just straight up telling you how. It’s also going to help with problem solving skills later on ya know?
yes, yes, ik what you mean
@alpine urchin Tbh the only thing I kinda muss is proper documentation on how to get the stuff for sending the packets. Like in WrapperPlayerServerRespawn: isFlat, isDebug and in general the Conversion stuff should be mentioned i feel like
wait nvm it works but only the half
it does not put spaces only new lines
Illusion is a master yeller
i want to use the bungeecord checkstyle
because you do a lot of dumb shit
in bungeecord
Don’t forget I had a traumatic brain injury
not an excuse to do dumb shit imo
don't all developers come with that?
Well
"I hit my head a bit and now I'm excused" ||jk||
I, too, use kotlin
XD
tbi?
Tbi
Also dumb shit while may be dumb can still work and that’s usually our end goal is it not?
Get something working before making it better is more or less what I’ve been told since I started programming
Anywans let's stop wasting everyone's time
Hi, any ideas about having different tick speeds for different worlds/players? The original vanilla command (/tick rate 20) is global.
There are no useful functions about tick rate in the paper documentation website. Would NMS somehow work? (I have no idea)
Some background you probaly don't care about: This is for a tas pvp server, where players can choose the tick rate to battle in. I have a decent amount of coding experience, but I'm a bit rusty when it comes to minecraft plugins
@glossy laurel a solid solution is to just look at how worldedit does it
Any directions would be appreciated
I'm lowkey so horrible at reading other's code unless its 3 lines
I can try though
This is kinda what you want
It’s almost as if that’s what I was implying the whole time o_O
Yeah but now we have more context than just "do your research"
Ok ok I’ll stop arguing
Good luck on your project pumpkin sorry for being a dickhead earlier
public static Clipboard copy(World world, Vector min, Vector max) {
com.sk89q.worldedit.world.World weWorld = BukkitAdapter.adapt(world);
Region region = new CuboidRegion(weWorld, toBlockVector3(min), toBlockVector3(max));
Clipboard clipboard = new BlockArrayClipboard(region);
ForwardExtentCopy copy = new ForwardExtentCopy(clipboard, region, clipboard, region.getMinimumPoint());
Operations.complete(copy);
return clipboard;
}
yeet
might work
try it out
thank you 🙏
did you make this
The server will still tick at 20TPS
Ew why did it include the com.sk89q
IntelliJ copy/paste thing?
real
What you want is to intercept the player's tick method and only execute it if the tick % tickRate == 0 or whatever
Oh I’m dumb
Bukkit world vs wedit world
two world classes
Yep just saw that
Which isn't really easy per se
Ideally you fork spigot itself
after /tick rate 5
/tps gives 5
That'll affect it for everyone
The server has a central tick method that ticks everything
the /tps command affects that
Illusion you keep me so humble I hate you and love you so much for that 🥲
wiki.vg/Protocol time let's go
what does the tick rate change in a player battle?
hit delay?
vector? Is it like that one thing from c++?
Nope
No different
some players might want to battle at 1 tick/s while others might want 1000 tick/s
In this case it's more about physics vectors
minigame network solution: run each match in a temporary server and yeet its tps wherever
physics vectors? i only know vectors from maths
maths, physics whatever
yea I though about that but I don't have a vps
why does google give me a list then
isnt that then bungee?
Interchangeable
okay
Does world edit use bukkit’s vectors or do they have their own? (Not b3vectors)
In maths / physics / games, a vector is basically just a representation of a translation
it's a panel server "面板服“ not sure if translation is correct
bad translation
you can only send command, see log, and use ftp for files
Panel service
chinese jumpscare
I'll look into this more
does it look like this
yea kinda
congrats it's pterodactyl
yayyyy
Reminds me of when blustacks started sending me windows notification ads of games in Chinese kek
Who tf hosts a website on ptero
all my 2 friends
oh
nginx and home server 😎
some people call it 翼龙面板
so you can probably make it run temp servers
Portainer ftw
hold up, that's actually what pterodactyl looks like? I legitimately thought that was what the host I was using looked like
翼龙is a kind of dinosor
Or just raw proxmox
yeah that's pterodactyl
what hosts do is just apply a skin
Most hosts use ptero
dayum alr
mine looks just like that
Thats default ptero
If you know a lil bit about pterodactyl and docker you can probably create an "egg" for your server
and then just create a million servers with that egg
Remember mcprohosting?
and do a lil networking with a plugin
maybe redis who knows
so that when the server starts up it knows its own id (env variable perhaps) and can fetch the tickrate
egg
Does nitrado offer hosting for Minecraft servers too I wonder
might make my own bootleg k8s in pterodactyl ngl
so specificly, how would I achieve this? I only have access to minecraft server files
not all files on the vm
nitrado, haven't heard that name in a while
had my first minecraft server on nitrado
felt like a god
What is that Vector class? Is it some WE thing?
Oh so they do? That’s kinda funny
bukkit vector
it's just a location but without a world
I only really know nitrado from my ark days
declaration: package: org.bukkit.util, class: Vector
I mean you gotta do some pretty hardcore nms
might even need to use a lil bytebuddy
ohh, alr
LMAO shows how long it’s been since I looked at nitrado
And block3vector is the same thing?
that's worldedit
tf is Block3Vector
We object
oh is that a WE thing?
well yes
An experienced dev would take a few hours up to a week for this
but essentially same thing right?
Learning it from scratch.. good luck
I think it’s handled a bit different under the hood, but you can derive block vector 3 from a bukkit vector
from scratch as in, knowing nothing about nms. or knowing nothing about code
nothing about NMS / limited spigot knowledge
isn't "using nms" literally just remapping the mojang stuff and casting the spigot stuff to the remapped objects?
Not just that
NMS isn't just a different format, it's actual internals
but doesnt spigot also just interact with the internals?
or bukkit
or paper
or any api
For example I'm working on a bedrock server. The Geyser API doesn't expose anything about custom entities or packets, so I gotta mess with the internals and inject stuff into the player's connection to then listen to packets and decode them with the same library that geyser does
TIL I dont need to pass 2 locations and then assert that they're from the same world
couldnt you THEORETICALLY do everything you can do in spigot with nms?
-_-
Honestly not sure if toBV3 gives you a usable we object, I just take the x,y,z values from the bukkit vector and create a new bv3 object this way
And then I cast all the geyser objects to their impls to get the entity tracker and loop through entities
etc etc
igth
BlockVector3.at(min.getBlockX(), min.getBlockY(), min.getBlockZ())?
Looks good to me
And as I understand min is the corner with the lowest X, Y, and Z?
(and max is the opposite corner)
pretty much
If I put any symbol in .yml, it turns it into an interesting text format in the chat. I don't understand how to fix it. What kind of filter should be made?
i don't quite get your situation, can you describe a bit more?
what yml, how are you using it, what does it store?
Are you saving it as utf-8?
Any of these here, for example, in word-settings.yml section,
death-messages: If I put "Killed (symbol)" it turns that symbol into an interesting text
Wordpad?
I'm wanting to use this anticheat's API and I decompiled it to look. I don't want to reupload the whole anticheat artifact to my repo but I can't repackage and upload just the API package because it references internal, obfuscated types (crazy). Is it insane of me to just make my own artifact with the same packages and classes, strip out the method implementations and just have the same method signatures, upload that and use it? 
Go for it
Yes, it is crazy lmao
But if it works, it works
public final class ViolationEvent extends Event implements Cancellable {
public final CheckType getType() {
throw new UnsupportedOperationException("you stink");
}
}
But like
IT WOULD WORK
yep
I once replicated android classes down to the method definition in order to make an SDK work in plain java
I mean I'm already hosting Spartan's API because it too isn't hosted anywhere so it's not like I'm not using my repo already
May as well add a new artifact lol
Like I said, make sure you’re saving as utf-8 but were gonna need more information
How are you loading and sending the config
What characters
uhm?
Send the whole error
?paste
okay thats no good
none of the imports compile
[ERROR] /C:/***/ArenaReset.java:[48,9] cannot find symbol
[ERROR] symbol: variable Operations
[ERROR] location: class pumkinhead.lendapvp.ArenaReset
[ERROR] -> [Help 1]
its just a bunch of these
and it didnt show any errors before I tried compiling
and yes, I did include the dependency
What build tool you using?
hm?
Maven or gradle?
maven
Try invalidate caches
I usually do all
OH RIGHT
silly me
I forgor to change java version to 21
now how do I do that
lemme google rq
Project structure
Project settings
Can’t you change it in the Pom too
Right
works now :)
One message removed from a suspended account.
When the server stops, your plugins on disable method will be called
What is the UUID in NPC#changeSkin for (PacketEvents)?
Where’s retro when you need him
https://discord.gg/djHpvubW might be more helpful
When working with (FA)WE/Worldguard etc, you can also try asking on enginehub, they are the people behind it
https://discord.gg/enginehub
Errors at the line which calls that function
ty
uhm
FastAsyncWorldGuard?
yeah
we all love the moment when our brains aint braining right haha, happens all the time to me 🥲
same error
do you have your dependencies defined correctly?
i think so?
I did it. Works for now https://github.com/2008Choco/VeinMiner/commit/48f1cfa6e6348951bb6316aed4448a62268ee59d
genius tbh
Should've used a d v a n c e d reflection instead
I didn't want to use reflection! I'm tired of using reflection!
Well, then just use the MH API and pretend it's not reflection
I still use reflection for AntiAura which I'm not happy about
Though AA's API is dog shit
I've offered on multiple occasions to make him a proper API but he keeps forgetting about me 🥹
Netty plz stop prepending my data with its length :c
netty doesn't do that, what are you doing 💀
You were killed by SinHa who still had 10,0 Ô?ñ
❤ --> Ô?ñ
Why did he turn it into this?
not utf-8
When opening the file, it opens as utf-8. Notepad ++ is also set,
A message is added with a command and when it is added, it is added with the Unicode code, but I want to add it directly as a symbol.
How can i fix this map?
https://paste.md-5.net/quduhetida.java
https://prnt.sc/I0il-FuI2kkY
be sure to compile as utf-8 too
what
hrmm
Firefox can handle the response fine but the minecraft client is ... unhappy
at ayf.a(SourceFile:137) ~[minecraft-1.21.1-client.jar:?]
at asl.a(SourceFile:107) ~[minecraft-1.21.1-client.jar:?]
at java.base/java.util.HashMap.forEach(HashMap.java:1429) ~[?:?]
at asl.b(SourceFile:103) ~[minecraft-1.21.1-client.jar:?]
at asl.c(SourceFile:140) ~[minecraft-1.21.1-client.jar:?]
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768) ~[?:?]
at bpk.h(SourceFile:91) ~[minecraft-1.21.1-client.jar:?]
at bpk.a(SourceFile:146) ~[minecraft-1.21.1-client.jar:?]
at bpk.run(SourceFile:102) ~[minecraft-1.21.1-client.jar:?]
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) ~[?:?]
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) ~[?:?]
at java.base/java.lang.Thread.run(Thread.java:1583) [?:?]
Caused by: java.io.IOException: Invalid Http response
at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1709) ~[?:?]
at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1599) ~[?:?]
at ayf.a(SourceFile:85) ~[minecraft-1.21.1-client.jar:?]
... 11 more```
http://localhost:25565 nice file
oh shite he found my ip
What are you even trying to download
It's sending a resource pack request to the server port itself, and I am intercepting it and responding with the data
What does "fix this map" mean
nvm already fixed it
🤨
what
Why
So plugins can host resource packs without any extra effort
Waaa
Guys
I have a question
Now I have prepared a few Ranks, all of them have different colors.
There is a kill message during pvp
It is specified as {Player}, now when this player writes his name, will he also specify which color his name is?
?nms
Plugins making resource packs are awesome
https://github.com/inventory-game-jam/code-red/tree/master/src/main/kotlin/com/github/inventorygamejam/codered/gui/resourcepack I have a whole system for this stuff
I especially love these bits
Show your pom.xml/build.gradle
alright
?whereami
🧻mc
Aye I got it working
i dont get it
Yeah but can it host itself :p
I do that for other things, not for this one
Is there no maven tab plugin?
I want to get the name color of the player, for example there are many Ranks and I want to get the name color, but when getting the name color it takes it with the prefix
?learnjava
For Beginners:
Codecademy - Learn Java: Interactive Java programming course from basics to more advanced concepts. Perfect for absolute beginners.
https://www.codecademy.com/learn/learn-java
JetBrains Academy - Java Developer Track: Learn by doing with projects and challenges. It covers Java fundamentals to advanced topics.
https://www.jetbrains.com/academy/
Udemy - Java Programming Masterclass for Software Developers: Updated courses that cover Java 8 to Java 17 features. Suitable for those who prefer structured learning.
https://www.udemy.com/course/java-the-complete-java-developer-course/
For Intermediate to Advanced Learners:
Oracle Java Tutorials: The official guides by Oracle for Java programming—great for understanding the depth of Java.
https://docs.oracle.com/javase/tutorial/
Baeldung - Learn Java and Spring: Focus on Spring Framework and modern Java technologies. Best for intermediate learners aiming to expand their knowledge.
https://www.baeldung.com/
Practice and Hands-on Learning:
Exercism - Java Track: Solve exercises and get feedback from mentors. Great for practicing coding skills.
https://exercism.io/tracks/java
LeetCode: Practice your coding skills and prepare for technical interviews with Java.
https://leetcode.com/
Free Resources and Documentation:
Java Programming and Documentation: A comprehensive collection of Java programming guides, tutorials, and API documentation.
https://docs.oracle.com/en/java/
Community and Support:
Stack Overflow: A vast community of developers. Great for getting help with specific problems or understanding concepts.
https://stackoverflow.com/questions/tagged/java
r/learnjava on Reddit: Join the community of Java learners and get advice, share resources, and discuss projects.
https://www.reddit.com/r/learnjava/
Remember: Learning to program takes practice and patience. Don't hesitate to experiment with code and participate in community discussions. Happy coding! 🎉
Have fun learning Java.
Thanks bro
yw darth
Ree, why does java not expose parsers for HTTP requests/responses
I know it has them smh
why does
FillBiomeCommand.fill(
((CraftWorld) loc.getWorld()).getHandle(),
new BlockPos(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ()),
new BlockPos(end.getBlockX(), end.getBlockY(), end.getBlockZ()),
Holder.Reference.createStandAlone(biomeRegistry.holderOwner(), preset.biome)
);
error in Trying to access unbound value 'ResourceKey[minecraft:worldgen/biome / sg:labrooms]' from registry net.minecraft.core.RegistryMaterials$1 and how to fix it
You can’t just create holders randomly
i want to get the biome holder
how can i do that
Get the holder from the biome registry
it returns Biome
There are methods that return a Holder<Biome>
there is no shot I'm so tired that I tried to open that link
I should rest 😭
In which file is the Persistent Data Container (PDC) actually stored?
is it stored in the world folder?
yeah I think either world folder or in the player data
Depends on what it's on
Chunk, Block Entity, (and World?) PDC goes in the region files
Entity PDC will be in the entity files
Player PDC is in the players data file
any way to increase the attack range of mobs?
Can I somehow avoid writing every single command into the plugin.yml file?
Use a command framework
he wants to tell you to get reflective access to the commandmap
wat?

Thanks for the reply, if I put worlds into vanilla Minecraft and then bring them to the server, will the PDC be affected?
no ™️
not a version apparently 
In theory, could I have a seperate console window for my plugin
why?
Don't think that'll work well on literally any host service
I somehow have the feeling that this is not the first time I read this message today
your aware that he ment you to learn java?
nah, that kid is a troll
they spam ?learnjava randomly here
well it fits pretty well here lol
Nah, I have them blocked so whatever they say has no legal basis whatsoever
who are you referring to?
@kindred valley
pinging people for smth like that :/
It's @silent - dw
tbh at first you ment that other scum lol
That other scum?
this guy
They are not blocked, so at least they are not being an idiot
welp he takes code from chatgpt, asks people to fix it and gets angry if they tell him to learn the actually thing not just copy ppaste without knowing what your doing 🤦♂️
Well I'm not too actively keeping tabs on spigot lately (given that I'm slowly moving over to other discords), so I'm not completely aware of all recent repeat offenders
that was on paper, that's why hes here now....
Also, I'm one of the few people that is actually ready to do at least medium amounts of spoonfeeding (that is, if one catches me on a good day, otherwise I plainly ignore requests or just skirt around them), so it's something I'll complain about the first time I see it
I’m pretty sure I already sent this spoon feed to him
Perhaps it wasn’t for him but I did send something of the sort and remember that exact question
To be fair there was a point in time where I used to reask my questions several days later because I deemed it to be answered insufficently. These days I know that for most of my questions the pool of people that could answer them is near nada so I learned that there is little point in doing that.
no nothing i was looking at it for myself
I even sent example usage (not that it's really hard to figure out but yeh)
Uhhh I got a small issue
why do you ping me?
"kid"
What would happen if you sent a block update on the chunk the player spawns on but the server hasn't yet sent any chunks to the player?
He just told the client the spawning chunk a position
didnt reply you, why did you take it to your side?
#bot-commands buddy
And I'm somehow experiencing the player phasing through existing blocks, because I spoof a teleport before the server actually sends the chunk data packet
i dont see any rule to put it in commands channel
are you moderator?
Yeah, this response seemed scummy
response to who?
The guy?
did i reply him?
myself?
#bot-commands
I really thought that you were just insulting him xD
#spigot
Has anyone ever done this type of trickery?
it's related to the topic
lol
"why can't i send images?" sends a command that instructs you on how to send images
that seems relevant no?
i dont know java so i send learnjava
I guess reading is an issue
#bot-commands
Yeah, okay, let's just leave it at that
Yes
why u so mad about it?
Because it can be used offensively
Like you're a dev, you ask a specific question
And someone just does ?learnjava
I am not the one with an anime pic on my profile
Uh
Also, is that sweet sugar life?
Or something like that it was called
It was caused by a misunderstanding
Cuz one guy used ?learnjava to get the links
But another guy was asking a question
💀
people weak
LOL
Yes, helping others is truly pathetic. Being upset about others helping is even more.
20k
Oh shit
cool
ill stay quiet
I don;t see him helping anyone. just randomly using it
Y’all need to grow up
i think you're the one not understanding it lol
It’s #help-development
Ye
Now that everyone is here, does anyone know what would happen?
yes
There is no deeper meaning to what you said. You simply tried using the amount of discord messages someone sent as an insult.
mf i am gay
What? xd
It's always the profile pic
Like I like anime, but not this much
I have a six pack if you wanna know
61 kg
Show code
why is this conversation in #help-development
Also, I've seen a lot of devs here being absolutely ripped
xD
Wait lemme send a pic then
Just will cut out my face
Alright guys, carry this to #general please
probably for a good reason
Waiting...
dude took off his clothes for making plugins 😳
It ain't much
ig thats how you get premium resources to work
But it's honest work
It starts at insults, ends at cuddles
The 🧠 rot
🗿
the rad rot
I think I'd need a gender swap for taking off a shirt to work
Can't send images? That's because you're not verified! Use !verify to complete verification.
Alternatively, you can upload screenshots to any image hosting site and share the link.
Here's some screenshot utilities that you can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org
buddy has a watch and a hairy arm
none of this is development-related
your arm is skinny tho
fr
was that like, you so skinny insult?
like I'm no mod but why are we sending shirtless pics in help development
I vote just ban shadow and kobasashi
wat
get em out
sent a shirtless picture in a dev help chat
then pretended like you did nothing xD
uhhh
Everyone stop feeding the troll
Convo carries over to general, everyone else will get consequences
nothing like that happened
you were just hypnotised
wait who is the troll
kobashi
o yeah
okay let's just move away from here
Does anyone here live by dependency injection
you mean depending on other plugins?
I find myself only using a Singleton if it's from another API
Often prefer it over singleton
😑
What do you mean by that? Spigot or another plugin.
Both
Singletons arent inherently bad. If you get a clean design out of them, and dont have any problems with circular dependencies, then go for it.
👍
dw about it
I just wanna know
some rude stuff
breh
he was just rude in general
He was the he
👋 having trouble finding a way to register the event handler (in the main class) that also passes 2 players to my gui class which also is an event listener
public class Gui implements Listener{
private final Inventory inv;
public Gui(Player sender, Player target) {
inv = Bukkit.createInventory(null, 27, Color.RED + "\uD83D\uDDE1 Duel vs. " + target.getName());
}
@EventHandler
public void onClick(InventoryClickEvent event) {
if (event.getInventory().equals(inv)) {
}
}
}
the issue is that it takes 2 params
the listener logic?
You should separate your concerns. Your GUIs should def not be Listeners.
Listeners should be registered once on startup and not during runtime. There is almost never a reason for that.
no its registering it
how would i access my inv class?
i feel like using the title would be bad practice no?
Yes that would be bad
That has also been a horrible approach in earlier versions because it copied the entire inventory on every single click,
cipher woke up and decided on violence
yeah but how would i find out if thats the right inv?
Write a GuiManager class which maps Inventories to your custom implementation.
Map<Inventory, AbstractGui>
yeah, you would compare holders, then you can cast it and call your handleClickEvent method which gets the event passed in so you can process it
but fair to say its api misuse
a good api misuse
public interface GUI {
void onClick(InventoryClickEvent event);
}
public class GuiManager {
private final Map<Inventory, GUI> guiMap = new HashMap<>();
public void handleClick(InventoryClickEvent event) {
Inventory inv = event.getInventory();
GUI gui = guiMap.get(inv);
if (gui != null) {
gui.onClick(event);
}
}
public void registerGui(Inventory inventory, GUI gui) {
guiMap.put(inventory, gui);
}
}
public class GuiListener implements Listener {
private final GuiManager guiManager;
@EventHandler
public void onClick(InventoryClickEvent event) {
this.guiManager.handleClick(event);
}
}
Here is a minimal example. Missing alot of pieces but it shows the idea.
ohhhh
PS: You can use the same tactic to delegate close, open and drag events to your GUIs
I think he asked about how he would register it even with parameters.
kinda
And my answer was that he shouldnt register it at all. 
But im guessing he didnt ask how to pass two params to an object...
yeah my code already works lol
Oh, sorry it's really late rn
nw
This but I'd opt to use InventoryView as the key instead of the Inventory itself
Interesting. Explain plox.
I can imagine that if i wanted to register a static GUI which multiple people can click on at any time, then InventoryView would require me to register each view regardless.
he just wanted to say that he'd rather use InventoryView instead of Inventory for the map key
very nice comment, thank you choco
>:( i never run
only jog
I believe InventoryView is referentially comparable whereas Inventory uses a hashCode() and equals() implementation. It may be faster to generate a hash and it's more unique to that viewer
I got that far 😅
But i was wondering why
I can imagine you're going to end up overwriting your registration if two players open the same inventory
But that won't be a problem if you use the InventoryView
Which probably isn't a huge issue if your GUI instance is constant, but if it contains any state, you might end up losing that state and mangling state between two separate players with the same GUI open at the same time
Hmm. Ill let that sink in. Thx for input.
But i cant see this happening if each GUI is strictly related to a single Inventory instance
-# IdentityHashMap
We love IdentityHashMap
still does a System.identityHashCode 🤷♂️
How can I add a LibsDisguises dependency in my project? (Maven)
get it from jitpack perhaps? doesnt seem to have a repo
precisely, unless i missed something, choco's point is that InventoryView being referentially comparable is faster to generate a hash than a custom hashCode implementation
IHM is entirely reference based
I think the uniqueness of InventoryView would be a bigger selling point
Yeah I care more about the uniqueness between players
But the IdentityHashMap offers some nice benefits too 😄
is the point of using an identityhashmap vs a normal one avoiding an invokevirtual Object::hashcode/equals?
thats what those docs essentially seem to say
I mean when you can guarantee identity uniqueness, why generate a hash code and potentially deal with hash conflicts?
i mean if its non overridden it has the same effect as System.identityHashCode \👀
i mean ye
Nah the implementation specifically doesn't use hashCode() or equals()
It does referential equality checks
Unsure how it stores things though. It might still use a hashcode for storage
The memory address is used as hash if i understood it correctly
What’s it censored
wtf that’s a different comment
uh i realized it mightve been more appropriate to use the openjdk21 mirror
Wait so which is right
buddy thought a shl would make it more clear, yet needed a comment to explain it
I'd personally prefer -((h << 8) - (h << 1)) but w/e
?ask
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!
I evidently don't, so cross me off from the list.
It’s all about cpu cycles
anyways back to work, gotta write a state of the art unit test to fix this mem leak
but oh no premature optimizations 😂
what about the jit compiler 😂
c2 will probably beat the living hell out of that code
I guess better than me waiving a runtime assertion in potentially security-critical code, only to then hinting at the fact that the lack thereof could be sub-trivial:
private static final long decrementReadCounter(AtomicLongArray array, int index) {
// We do not need to check for the read access mask as the read access mask is not meant to be unset
// if the amount of threads waiting for a thread is not 0. As we aren't supposed to decrement the
// read counter twice, nor decrement it if we do not hold the read lock, we are free to assume that
// there is at least one thread waiting.
long value;
do {
value = array.get(index);
} while (!array.compareAndSet(index, value, value - ConcurrentObjectInt32Map.VALUE_MASK_READ_LOCKS_LSB));
return value;
}
what a wonderfully nonsensical sentence you made there
looks amazing
really whimsical
A good compiler should realize that it's the same as h * -254 - the only issue is that doing it with bitshifts will inflate the method size, thus potentially forbidding inlining (though surely they have checked for that, right?)
Multiline comments are reserved for javadocs at my place
Smh
// meanwhile is reserved for "this is stupid, but hear me out"
Other types of documentation shall not exist
That seems questionable
Java docs are /** multi line comments are /*
shhh
And small profanity exclamations are //
what are these funny / characters, I heard comments are for cowards
Anyways,
if (Objects.equals(keys.get(index), key)) {
return (int) (ConcurrentObjectInt32Map.Bucket.decrementReadCounter(values, index) & ConcurrentObjectInt32Map.VALUE_MASK_VALUE);
} else {
// Some other value most likely
ConcurrentObjectInt32Map.Bucket.decrementReadCounter(values, index);
}
or
try {
if (Objects.equals(keys.get(index), key)) {
return (int) (values.get(index) & ConcurrentObjectInt32Map.VALUE_MASK_VALUE);
}
} finally {
ConcurrentObjectInt32Map.Bucket.decrementReadCounter(values, index);
}
?
Or in short: Do you think it's the job of a concurrent datastructure to properly handle faults in Object#equals implementations?
Do regular data structures do that
Wouldn't that be the job of your buildsystem?
They would not have permament effects, hence the error can bubble up without issues
Do you want to modify the content of an already compiled .jar?
Here, the datastructure would lock itself up permanently
What about other concurrent data structures
Generally use synchronized statements, which would relinquish the lock even on exceptional completion
That is generally a bad idea. Jars contain compiled code, so nothing you can cleanly edit as is.
You would have to decompile the jar, make sense of the decompiled code, and recompile it again, hoping that you have
all dependencies needed.
I mean you can technically modify .class files directly, but its gonna be very messy
reminds me of that one time i wanted to change a hardcoded string in a jar so i just opened it in notepad and changed it
that was like 7 years ago lmao
Did it work
yes
I spawn an invisible armor stand with a red custom head
I want to detect whether the player has tried to clicked that head
so basically, whether he's currently looking at it is what I need
I cannot use any InteractAtEntity stuff because they're always seperated by a (barrier) block and also the invisible armor stand doesn't have a bounding box
Two solutions I suppose. (a) Interaction entity at the armour stand's head, which is probably the cleanest way to do this, or (b) Raytrace on click against a would-be BoundingBox
Can you mount an Interaction entity on your head?
wdym?
well invisible armor stands don't have a hit box
so how would you do a?
We have invisible entities now which are specifically used for recording interactions.
but option a is just spawning an interaction entity, yeah
Position and scale it accordingly, listen for interactions
what's that tho?
declaration: package: org.bukkit.entity, interface: Interaction
and by "now", you mean it's a recent feature?
mmm
I'd need it like 1.12+
6 year old software, sadge
also, I do it 100% on packets, so no bukkit involved
api doesn't have packets ;-[
and would I use this?
Spawn it, mount it, scale it and listen for interactions
I can do everything, I just need to know when he's looking at it
Waiting for a followup
thatt might have been the case, like, a million years ago
but also, like, the gc is free to move objects around in memory and such so it's just not reliable
java 8 javadoc says "This is typically implemented by converting the internal address of the object into an integer", so it's some kind of address to identify the object, but those docs are long outdated anyway
Who said the GC could move my stuff :O
It may look like a mess but I know where everything is!
also the hashCode() is an int but memory addresses are... hopefully, 64 bit
😂
How can I add a LibsDisguises dependency in my project? (Maven)
Doesn’t it depend on 32 bit vs 64 bit java
Currently hunting it down. src/java.base/share/native/libjava/System.c
JNIEXPORT jint JNICALL
Java_java_lang_System_identityHashCode(JNIEnv *env, jobject this, jobject x)
{
return JVM_IHashCode(env, x);
}
Not really insightful...
That is the most Js I have ever seen together
you can configure the runtime to use one of a few implementations
That's why I said "hopefully" lol
by default it'll just generate a random number
Wait dont spoil it, im almost there
another setting is to always use 0!
0 factorial!?
so 1
I believe there was a motion to offer a 64-bit variant of hashCode
yeah
Not sure what happened to it, it's been a year or two since, surely.
hasherCode
https://openjdk.org/jeps/8201462 2018 :copium:
Im at a dead end. In which method is this defined?
In the meantime we can enjoy our round of nothing but preview features in the upcoming Java release!
i don't remember hehehaha
Did someone say markdown
space
shit
-# choco bad
do not shit in space
Bested by whitespace again. What is this? Python?
Hey the astronauts on the ISS have to do it sometimes
i'm pretty sure they don't
static inline intptr_t get_next_hash(Thread* current, oop obj) {
intptr_t value = 0;
if (hashCode == 0) {
value = os::random();
} else if (hashCode == 1) {
intptr_t addr_bits = cast_from_oop<intptr_t>(obj) >> 3;
value = addr_bits ^ (addr_bits >> 5) ^ GVars.stw_random;
} else if (hashCode == 2) {
value = 1; // for sensitivity testing
} else if (hashCode == 3) {
value = ++GVars.hc_sequence;
} else if (hashCode == 4) {
value = cast_from_oop<intptr_t>(obj);
} else {
unsigned t = current->_hashStateX;
t ^= (t << 11);
current->_hashStateX = current->_hashStateY;
current->_hashStateY = current->_hashStateZ;
current->_hashStateZ = current->_hashStateW;
unsigned v = current->_hashStateW;
v = (v ^ (v >> 19)) ^ (t ^ (t >> 8));
current->_hashStateW = v;
value = v;
}
So it falls back to some... pseudo random number generation. And it looks like that is added to an objects header.
had to be the same length then
I wonder how codebases are going to look in 2024. Are we going to see a rise in Markdown vs Traditional Javadoc comments in stylesheets? 👀 A mix of both for newly added methods?
I am not that old
I like the Markdown aspect a lot, I just wish they didn't do it with /// lol
(rust my beloved)
C# does the same, no?
yes
not sure, i don't use it
} else if (hashCode == 2) {
value = 1;
Lol this is my new favourite jvm flag
All hash codes are 1
Yeah they do some weird XML shit, https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/xmldoc/
yeah lol
xml 💀
I don't want my Java code to look MORE like C#!
But why tho
arbitrary value
wouldn't that just error with hashmaps since there's multiple of the same hashcode or would it return the first entry
There is a comment stating // for sensitivity testing 🤷
no, hashmaps also perform equality checks
That would just lead to collisions
they take into account hash collisions
So they would be O(n) all the time
Peak efficiency
technically not necessarily
for a HashMap, if the class implements Comparable on itself, it'll do a tree instead of a list
In theory there is an implementation where a hash bucket can be operated as a rb tree with sub-buckets
Yeah you sniped me
The object doesnt need to implement comparable even. You can use the hashCode int to build a tree.
Collision doesnt mean the hashCodes are identical.
until it does :Clueless:
Well in that case they are. Which would result in a tree with one bucket, where everything ends up being compared in O(n) again
Wait, the jvm doesnt impl trees using the hashCode right now?
Is this the time where i propose a JEP
this is the part where you send an email to core-libs-dev@openjdk.org
I will probably get backhand slapped for being a doofus bc the idea is somehow atrocious
as usually how it goes in software development
is there anyone here who handles reviewing resources submitted? i have a question
?ask
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!
ah, my resource was denied because "no text description", what exactly does it mean? that i need to have some sort of text in the resource, or that most of the description has to be text? im a bit confused
if you have a bunch of images with text you need to transcribe them
If only they knew my plans of using CMPXCHG16B on Java Object references.
Sadly, JNI is needed for that which has quite the terrible performance so I ended up going with a less performant solution instead
I have no idea what CMPXCHG16B is supposed to mean
ah okay
makes sense
Aw come on, it's THE funniest X86_64 assembly instruction
my entire description is just an image with all the stuff so i added a spoiler transcribing the whole image aswell as having some text at the bottom, hope that gets accepted 👍
You can't cast Object to long with FFM :(
idk if i'd call a CAS the funniest instruction lol
Yeah, it's cursed.
why's that
Because who the fuck would want to CAS an object and a primitive at the same time?
Geolykt does.
Compare and exchange 16 bytes
Aw, ruining the fun
well but that isn't really specific to the instruction tho?
it's just a CAS on two numbers
Nah, I was referring to the Object -> long "cast"/pointer conversion here
right right
I mean I ended up being able to use traditional CAS methods, but damn do I need a bunch more locks than actually needed
So considering I want to map players to roles within the islandImpl, would you guys say it is dumb to also reference an island role in the playerData as well?
I already hold their island in playerdata which you could derive the role from
tf is that wallpaper
I found it on wallpaperengine actually kek
do you really need the members set if you have the roles map
IMO you need to break it down into classes. Doubt there's a good reason to store roles on the player data itself
why would you want to make your code even more unreadable
if you want to touch grass go outside don't stare at a fake tree
cmon man I went disc golfing yesterday and last sunday
and I am going tomorrow as well
Why touch grass when you can look at fake grass
That is a fair point, haven't implemented playerRoles yet so, that was what I had before
Also given I go with playerRoles style, I feel like I would put every person's uuid in every island's playerRoles map as to account for visitors (and it's respective role)
I'm not sure how I feel about this but haven't really thought about it too much, so any ideas on how to handle this?
