#help-development
1 messages · Page 1326 of 1
What do you not understand exactly?
the project setup
theres a pom file in every folder
i dont understand the partitions and how theyre compiling different spigot versions and everything into one jar
Each module depends on a different spigot version
so how do you compile it all into one jar file then?
Then at the end the main module bundles them together into one jar
First the submodulrs build individually, then get bundled together
Typically with maven shade
theres weird flags that ive never seen before in poms too like <configuration><skip>true</skip></configuration> in plugin and <scope>provided</scope> and <scope>compile</scope> in dependencies
When using maven shade, you want to specify a scope for your dependencies
Provided dependencies are expected to be provided by the runtime, and so won't be bundled in
Compile scope dependencies are bundled into the final jar by maven shade
Hi, I’m currently working on a Discord-linked Minecraft event system.
The goal is to give server owners a clean way to manage
points, ranks, and interactive events without relying on chat commands.
Players interact through buttons,
while server logic stays controlled and predictable.
This helps reduce abuse, confusion, and command spam.
I’m still refining the system and would love feedback from
server owners or plugin developers:
does this kind of UI-driven control make sense for live servers?
Looks like an ingame dialog with extra steps
I suppose it's nice to be able to do things "offline" through a browser
But it does also take you out of the game; "third-party" applications like battlelog or forums are usually not very popular among casual players
That’s a fair point, and I agree with the concern.
The intention isn’t to replace in-game interaction,
but to provide an optional layer for things that don’t need
to happen during active gameplay.
For example:
- checking stats or ranks while offline
- managing points or settings without logging in
- reducing command spam or complex menus in-game
For casual players, everything can still remain in-game.
This kind of UI is mainly aimed at more engaged players
or server staff who already use Discord heavily.
I’m trying to keep it complementary rather than mandatory,
but feedback like this is exactly what helps refine that balance.
Out of curiosity, have you seen any Discord integrations
that worked well without hurting immersion?
Maybe like local voice chat systems, but that's for when you're already online
If it's a supplement to ingame systems rather than a replacement, it won't hurt
Yeah, that’s exactly how I see it as well.
It’s not meant to replace in-game systems,
but to act as a supplement for things that don’t require
the player to be actively online.
Anything that affects moment-to-moment gameplay
should still happen in-game.
This is more about convenience and management outside of play sessions.
That balance is definitely something I’m trying to be careful with,
so feedback like this helps a lot.
Hi,
I have a variable, configJoinAlert that is set to getConfig,getBoolean() of a value in the config,
This works fine, however if the config is edited and reloaded (reload command done using reloadConfig()) this variable does not update.
What would be the most efficient way to get it to update on reload? Would it simply be updating the boolean within the reload command's class or something else?
Doesn't get more efficient than updating it in the reload command
Fair enough then
but that ofcourse means what you mean by efficient here. I assumed you mean performance, but it could be efficiency to write code faster etc
I mean performance would be an aspect, but also what would make most sense in this kinda situation. If more context is needed then I can provide but if not then I'll just go with updating the variable with the command
where do i find the api download?
?maven
The home of Spigot a high performance, no lag customized Bukkit Minecraft server API, and BungeeCord, the cloud server proxy.
?gradle
no gradle command smh
The home of Spigot a high performance, no lag customized Bukkit Minecraft server API, and BungeeCord, the cloud server proxy.
has anyone ever dealt with mariadb shading
cuz damn
and for some reason I can reference it in code
and it also fixes this specific issue
...only for other mariadb classes not to be found later on
are you maybe minimizing after shade
minimize can't always detect things like reflection or Class.forName properly and ends up trimming out those classes since they're "unused"
the class being included only if you directly reference it in your code would strongly indicate that you're minimizing the fat jar and something like this is happening
alternatively, something something classloader visibility
oh yeah I am
can I tell the minimize to like, not do whatever tf it's doing
dunno

same deal as with minimize; relocate can't with perfect accuracy find some kinds of references to remap them
e.g. reflection using non-compiletime constant strings
or maybe any reflection at all, i don't remember
it works with reflection
if you reference a full path, it'll find it
org.mariadb.jdbc in a string would get remapped
"IP you wish to use IP forwarding, please enable it in your bungecoord"
Does anyone know what might be causing this error?
I have everything properly configured, including IP forwarding, and everything was working fine until I updated BungeeCord. Since that update, I’m no longer able to join one of my backend servers. However, I can still connect to the lobby without any issues.
Are you joining the backend directly
My players keep stating that cannons are not working properly on the server
But from what I know i do not edit cannons (tnt)
are u running Paper
sounds like something theyd break
?jd-s [for self]
Hi, I’m using setChestplate to equip a player with a chestplate that has custom model data. The item itself shows the correct custom model data, but when I equip it and look at it in third-person (F5), it displays as a normal armor piece rather than showing the custom skin from ItemAdder. Am I missing something?
Probably an issue with the model?
I mean this is working when i equip it manualy sorry. However, when I equip the same chestplate using setChestplate, the item appears correctly in the inventory with the right custom model data, but in third-person view it shows as a normal Netherite chestplate
But nvm i think i have to ask to itemadder tbh
Compare what /data get says the nbt is for each
guys, can we edit dialogues with spigotapi?
btw has minecraft added this feature?
https://www.spigotmc.org/threads/25w20a-customizable-native-ui.690020/
declaration: package: org.bukkit.entity, interface: Player
ah its bungee, makes sense
am i crazy?
https://pastebin.com/K88xQXqU this has to be faster than pattern compile -> matcher
Depends on what you need
Sometimes RegEx is just less complex than a lexer (believe it or not)
if the pattern is precompiled, the difference won't be really noticeable, like, at all
just keep your patterns in static final constants
You could always test it 👀
compile + match, maybe not, but just matching should probably be about the same
regex is a fairly mature thing
with possibly maybe at least in theory the jit/jvm doing vectorization to speed it up
in the end regex patterns are (usually) more readable than a nested if else switch == '§' blob and that's what matters more; for a hotspot, best to test it rather than assuming one is faster than the other
matching the regex also isn't any kind of voodoo magic, once compiled it turns into a sequence of simple matches you would end up doing manually if you were to test the same pattern; just, Pattern does it with a few more indirections, but JIT should take care of that fine too
okay i got them both working
reminder that System.currentTimeMillis() is not a benchmark
i'm gonna test it on 1000 elements
In this post, we take a look at how to benchmark Java code
is this good?
jmh is good :)
there's also the whole knowing how and what to benchmark thing so you're benchmarking the right thing to get correct results, and it has heaps of parameterisation options
that article seems fine
System.nanoTime() 💪
actually nano time is sort of more unstable than millis, it can easily drift up to like a few µs between different cores
how can i setJoinMessage with color?
so if your benchmark thread happens to get tossed between cores in the middle of a benchmark, you can get odd results
yeah it has nanosecond resolution but the precision is uhhhhhhhh yeah
something
i just reduced the run-time of my networking code by 50% by doing one simple trick!
(3ms)
by avoiding an unneeded lock
is there a way to disable the joinmessage pasting in console?
it just paste the same msg in the console like
[17:01:37 INFO]: §6Welcome back (player)!
sounds like some plugin
wym
do you guys know any good learning aids
Show code
@slender elbow i pinged u for nothing
bcs i want hgd
public void onEnable() {
// Register this class as an event listener so @EventHandler methods are called
getServer().getPluginManager().registerEvents(this, this);
}
@EventHandler
public void onPlayerJoin(@NonNull PlayerJoinEvent event) {
String name = event.getPlayer().getName();
boolean firstTime = !event.getPlayer().hasPlayedBefore();
if (firstTime) {
event.joinMessage(Component.text("§6Welcome " + name + " to the server!"));
} else {
event.joinMessage(Component.text("§6Welcome back " + name + "!"));
}
}```
its simple
but for some reason it sends it in console to
alr
@EventHandler
public void onPlayerJoin(PlayerJoinEvent event) {
Player player = event.getPlayer();
String name = player.getName();
// This will supress the default join message
event.setJoinMessage(null);
if (!player.hasPlayedBefore()) {
player.sendMessage("§Welcome " + name + " to the server!");
} else {
player.sendMessage("§6Welcome back " + name + "!");
}
}```
@silver dirge ^^
that uh will only be seen by the joining player which is different from the event join message, which is a broadcast
you could use Bukkit.broadcast but iirc that prints in the console as well; so perhaps just forEach sendMessage over Bukkit::getOnlinePlayers
i mean its alright if it sends it only to the player
then the given approach is fine
i got errors but yk it works so dont touch it
I mean getting a error fixed in a 1 file 30 line class aint that big of a deal
player.sendMessage("§Welcome " + name + " to the server!");
§W 👀
Isn't the console just pointing out errors in your file?
unless my "file" java and has 1K+ lines no
[17:52:28 INFO]: [PluginInitializerManager] Initializing plugins...
[17:52:28 ERROR]: Paper Async Command Builder Thread Pool - 5
java.util.ConcurrentModificationException: null
at java.base/java.util.LinkedHashMap$LinkedHashIterator.nextNode(LinkedHashMap.java:1024) ~[?:?]
at java.base/java.util.LinkedHashMap$LinkedEntryIterator.next(LinkedHashMap.java:1059) ~[?:?]
at java.base/java.util.LinkedHashMap$LinkedEntryIterator.next(LinkedHashMap.java:1056) ~[?:?]
at java.base/java.util.AbstractMap.hashCode(AbstractMap.java:499) ~[?:?]
at com.mojang.brigadier.tree.CommandNode.hashCode(CommandNode.java:145) ~[paper-1.21.10.jar:1.21.10-130-8043efd]
at java.base/java.util.HashMap.hash(HashMap.java:338) ~[?:?]
at java.base/java.util.HashMap.put(HashMap.java:619) ~[?:?]
at net.minecraft.commands.Commands.sendAsync(Commands.java:497) ~[paper-1.21.10.jar:1.21.10-130-8043efd]
at net.minecraft.commands.Commands.lambda$sendCommands$6(Commands.java:479) ~[paper-1.21.10.jar:1.21.10-130-8043efd]
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1090) ~[?:?]
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:614) ~[?:?]
at java.base/java.lang.Thread.run(Thread.java:1474) ~[?:?]```
Oh, alright then.
Paper
public void onChat(@NonNull AsyncChatEvent event) {
Player player = event.getPlayer();
String name = player.getName();
Component message = event.message();
Component formattedMessage = Component.text("§7[§a" + name + "§7]: §f").append(message);
event.message(formattedMessage);
}```
is there a way of removing the old style like the <username> now i get <username> [username]: msg
if you reloaded it with plugman or something, this typically happens
not related to your code if so
alr i just reload bukkit so thats mayb why
Benchmark Mode Cnt Score Error Units
Main.myFirstBenchmark thrpt 25 2338990,152 ± 25386,487 ops/s
vs
Benchmark Mode Cnt Score Error Units
Main.mySecondBenchmark thrpt 25 5366580,326 ± 43065,816 ops/s
my first benchmark uses pattern matching
and the second is my own impl
by the looks of it my own impl is twice as fast
does that include compiling the regex or just matching it
Compiling is a static field, should i add it in the bench state?
It is
what's the benchmark code look like?
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
and the bench state
BlockData::isFaceSturdy is the worst method name i've seen for a while
i wish javadocs had an "usages" search so i could easily tell which oddly named method on which of the 25 block data/state/world accessor classes i need to call to get a BlockSupport level, without having to do search usages in the paper userdev jar
which it apparently does, nevermind
💀
JETBRAINS
WTF DID YOU DO WITH GLOBAL SEARCH
wtf is this
why it has to be a sidebar panel
it works fine for me
i use this one
Benchmark Mode Cnt Score Error Units
Main.benchmarkHex thrpt 25 4489224,033 ± 30568,873 ops/s
Main.benchmarkHexNew thrpt 25 4876746,523 ± 45695,978 ops/s
i've improved the hex method 😄
i think i'll keep my own impl
it won't require maintenance, it should be fine to have it a bit longer if it can save performance
but then most strings are saved on plugin load so half the performance should still be fast enough for this
the only thing that requires runtime processing would be the placeholder api replace
public void onChat(@NonNull AsyncChatEvent event) {
Component prefix = getPrefix(event.getPlayer());
Component username = Component.text(event.getPlayer().getName()).style(prefix.style());
event.renderer((player, sourceDisplayName, message, viewer) -> {
return prefix
.append(username)
.append(Component.text(" §8» "))
.append(message);
});
}
public Component getPrefix(Player player) {
LuckPerms lp = LuckPermsProvider.get();
User user = lp.getUserManager().getUser(player.getUniqueId());
if (user == null) return Component.empty();
CachedMetaData meta = user.getCachedData().getMetaData();
String prefix = user.getCachedData()
.getMetaData(QueryOptions.defaultContextualOptions())
.getPrefix();
if (prefix == null) return Component.empty();
return MiniMessage.miniMessage().deserialize(prefix);
}```
why does my username not inherit the last color of my prefix
?whereami
paper bad?
i mean the javadoc comment is good but i would've expected the method itself to be named "canSupport" or "hasBlockSupport" or something, "sturdy" seems to come out of nowhere and at least for me it makes me think of the BlockSupport.RIGID type specifically, rather than an arbitrary support type
Choco when the block isn’t sturdy (he fell in)
Everything reminds me of her 😢
whats a "proper" way to obtain a plugin instance from another plugin
JavaPlugin#getPlugin(Class) ?
ye but it fails if the class isnt loaded yet i think. Depends if ur softdepending
im hard depending :V
i know i can access from a static field bc i tested it for quick&dirty code, but i want to use a proper accessor lol
The Services API is cool to look into if the plugin supports it
i did think abt Services
may be Too useful for how i intend on using it
?services
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
The home of Spigot a high performance, no lag customized Bukkit Minecraft server API, and BungeeCord, the cloud server proxy.
How can i make a playsound but the volume is higher than vanilla Minecraft?
doesn't the api take a volume variable
if it doesn't allow past max i would say thats a client limitation
not server
Isn't volume for the distance.
Like volume = 1 means its audible for a chunk
declaration: package: org.bukkit.entity, interface: Player
just says the volume of the sound lol
declaration: package: org.bukkit, interface: World
same for this
To be honest, I'm not sure, but if we are to assume that Player#playSound is the same invocation as the command (given that they take similar parameters), then volume is to be assumed as:
Specifies the distance that the sound can be heard [...] its audible range is multiplied by volume. There is always a gradual falloff to silence based on distance from the center of the sphere
-- https://minecraft.wiki/w/Commands/playsound
I think you're a dirty stinking liar
you benefit from this financially dont you
its on the wiki 😭
the adviced way is probably through PluginManager
Yeah, PluginManager::getPlugin and cast is the ground truth
Passing classes could be affected by shade misconfigurations and such
wasn't there a bitewise operation for i / 2?
nevermind
it probably has to performance improvement
you'd be surprised by how often people accidentally shade in things
and then you do something like JavaPlugin.getPlugin for a class, or use some static getInstance method on the thing you depended on, and it actually gets you the shaded copy of the classes, which is going to say something like "not initialized yet" because bukkit never loaded it
arithmetic right shift, >>
note that it behaves differently from integer division for negative numbers
that is, integer division rounds towards zero, arithmetic right shift rounds towards negative infinity
this is why you should never do e.g. int chunkX = blockX / 16, because for blockX=-10 the expected result (which you get with >>) is -1, but integer division gets you 0
in terms of performance, integer division on most cpus is i think like a latency of 4 clock cycles and throughput of 1-4 per cycle, where bitwise ops are 1 clock cycle each, so it is definitely considerably faster
but that's only when you're in a spot hot enough to be counting individual cpu cycles, and reasoning about it isn't easy since instruction pipelining can throw assumptions out of the window
plus where applicable the jit fairly reliably substitutes matching bitwise ops for other arithmetic ops
Thats so interesting to know!
for cheecking if its even or odd or just general division?
oh I see vcs2 already said the division one
I guess I will supply the odd even checking
i &1 (0 = even 1 = odd)
lol
now make it recursive
Hello hello, Im blocked on a problem I have since one month and a half and I really need some help. i hope I am at the right place, if not the Im really sorry.
Im using ItemsAdder to add items in minecraft so I have the model that is in the game but the texture isnt loaded and I dont know why.
I think I have the wrong path to the texture in the model's json but I cant manage to get the right one.
I hope someone here can help me with this, my dm's are open if needed.
Thank you a lot in advance !
||I hope my english isnt too bad, if not im really sorry||
i don't have negative numbers 😄
i'll replace it with right shift
Is this development related.
well im not sure if you can consider this as development. that's why i apologized if im not on the right discord
This is for development using the API
#help-server is probably the correct place to ask
maybe, im so sorry
Doesn’t ItemsAdder have a server though
or yeah that
yeah but i cant verify my account there so i cant post anything
Because you have an illegally obtained copy of items adder?
nope
we are 3 working on the project and its not me who bought the plugin
the person who got it doesnt reply to me so im kinda stucked
but anyway i wont bother you with this
thanks for your time and answers, have a nice day all
All good you too
how the fuck do I apply a b64 texture to a skull in this latest bitchass version
shits impossible
😭
Same way you should be doing it since 1.18
nope lol
Like this
The base64 contains a piece of json with the url in it
if you're wondering where to get the url from
I believe Minecraft-heads has the url directly
Im asking how to use it with just the b64 lol you shouldnt need to rely on the texture being hosted somewhere lol
before this version you could just edit the texture property
now you just cant
The skin is always hosted somewhere
The client does not fetch the skin from the server
Yeah, the base64 literally has a url in it
It fetches them from Mojang
The texture property is just an encoded url to Mojangs server
oh crazy
Put it in a base64 decoder and you'll see :p
im a brick
for mannequins and i think maybe skulls also, you should now be able to use assets from the resourcepack
that's the only alternative you have to uploading the texture to mojang servers and passing the client an url to load it from
I mean this still doesnt work anyway
the url must point to the mojang domain, the client will reject any other url
it also must be https
or, well, the destination must support https; so spoofing a local nameserver wouldn't work
ok well i did this shit in 1.20 or so and it was ridiculously easy and now its a nightmare lol
it's always been like this
nah
yuh
For the record this is how I used to do it
ItemStack head = new ItemStack(Material.PLAYER_HEAD);
SkullMeta headMeta = (SkullMeta) head.getItemMeta();
GameProfile profile = new GameProfile(UUID.randomUUID(), null);
profile.getProperties().put("textures", new Property("textures", url));
try {
Field profileField = headMeta.getClass().getDeclaredField("profile");
profileField.setAccessible(true);
profileField.set(headMeta, profile);
} catch (NoSuchFieldException|IllegalArgumentException|IllegalAccessException|SecurityException error) {
error.printStackTrace();
}
head.setItemMeta(headMeta);
return head;
ignore the weird indent
url was just the base64 url for the texture from minecraft-heads.com
Ew reflection
the values are still the same
i think the api might have changed slightly, but the underlying thing is the same
I get that but I have no clue how to use it now and i cant find any info on it lol
I tried this example and it at least runs without errors but doesnt apply the texture
okay what specific texture base64 string are you trying to use
Could you show your code
?paste
Looking to paste something? Try a code block or one of the following websites:
- https://pastes.dev/
- https://sourceb.in/
- https://mclo.gs/ (best for server logs)
people often get confused between the base64 url+texture, and the hex texture
both are strings
and passing one in place of the other won't work
This doesn't even work on modern spigot
yes i know
thats what i USED to use
it was like 1.20
or sum shi
to deal with this iirc i wrote some util that tries parsing it as both and just uses the correct one
haven't touched it since 2023
https://pastes.dev/OfhzxKf7l2
this was me trying to use the example that jishuna replied to earlier
the texture is just the base64 string
paste the base64 string
again i havent touched head textures in like 2 yrs lol
was trying to use this one:
eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMTliZjMyOTJlMTI2YTEwNWI1NGViYTcxM2FhMWIxNTJkNTQxYTFkODkzODgyOWM1NjM2NGQxNzhlZDIyYmYifX19
basic right arrow head
so you're passing that directly to textures.setSkin(URI.create(texture).toURL()); as texture?
well
dont flame me 😭
that's not a URL
tru
you need to decode it from base64 first to get a url
its not a url on its own
then pass it to URI.create
yea good point
I usually just use the url directly
But it shouldn’t be too hard to decode and parse
wait hollup i might be a brick
i usually just use the texture hex and hardcode the url in
lemme try sum shi
on minecraftheads, scroll down to the bottom and copy the "Minecraft URL" instead of the base64 profile property
that is something you can pass to URI.create directly; it's also shorter and more useful in code, since the developer can just copy it and go to the url to see what it is
well post code
The only difference is I just replace the texture string with "http://textures.minecraft.net/texture/bd69e06e5dadfd84e5f3d1c21063f2553b2fa945ee1d4d7152fdc5425bc12a9"
directly
like you said here
ok well im a little special i forgot to set the meta to the head item
it works now lmfao tyt
ty
How is the spectator-like state achieved on some minigame servers?
I.e, the player is hidden in tab and invisible in game, yet cannot clip through objects like in regular spectator
Packets
i just use fly/allow flight and player#hidePlayer
as well as setcollidable with entities to false
Does that hide the player from tab?
yes
What if features like spectators seeing other spectators
and to not collide with blocks you can work with the allowbuild event
just allow them to see each other
tho i haven't done that with my plugin
How would you achieve that?
player#hidePlayer and player#showPlayer
So just check if the player is spectator if true then show if false then hide
i also have a system that makes the players of a game to only see each other
yeah
loop through the spectators
I see i see
and make them see the new spectator
I didn't know that method existed but now I do
Yep makes sense
now you do 😄
😄
And what about not being able to open containers and shit
Or execute commands
you just write checks with events for that
for example on opening containers
use PlayerInteractEvent
check if player is a spectator
if it is set cancelled
spectators can open containers? wat
they can open containers but not modify them, or cause loot to be generated in them
ah
yeah that surprised me too once, lol
but they cannot generate loot, e.g. shipwrecks
?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! 🎉
How is that related to learning java?
He says he didnt know the method exists so I sent the method to convince hım that method exists
what method are you talking about
okay, then stop talking to me xD
what is your problem i said dont disturb me
what ragebait
its your problem that you didnt understand anything
y'all stop playing with me
true
My man sells spigot plugin and thinks he's on the same league as jeff bezos
he's gotta go bald then maybe
im not in same league as epstein friends
thats true
Im so muvh hgiher
there's higher levels to being a pedo?
i dont wanna mention but i sold plugins to jeff
he wanted a refund and we got a beef
5/10 ragebait
ıf you know ur one of them then
shame on ya
ragelait 9382 / 219
If only Marven was around to factcheck.
dawg why you got the gay pride acronym in ur about me
or whatever
is that a problem?
are you talking about ISTQB?
if so, you obviously are mistaken in which acronym it is
International Software Testing Qualifications Board (ISTQB)
😭 broseph stalin
🤓
i have yet to read a sentence this year that fits the nerd voice better than this
dont ever ping me again
isnt there any mods here?
the fuck is this?!?!
ew
i dont
thats actually a certificate
ISTQB® is the leading global certification scheme in the field of software testing
ok i know this may be a foreign concept to some of you since two people have replied like this
it was a joke
like bro
fark
i know
like obv joke
and as u read my message
i literally said "ew i dont"
he is gone
😭
Are we arguing about the gays?
oh thanks
What is that
Sounds like something they would put into high fructose corn syrup to make people go bald
You can get an XML programmer certificate from w3 schools
For the low price of iirc 95 usd
no please
xml programmr lol
Unfortunately they don't have yaml programmer certificates
you can go in like 42 directions
but i would like to get the ITP-ATP certificate
but i just finished foundation 💀
which was pain in the ass honestly already
Based
XML gives me nightmares
Have you ever tried to comb through an entire game save of xml
@young knoll warn this guy up
You're free to disable pings from this server
w3schools 💀
Goated tbh
are you preggo?
he reacted with a pregnant emoji
pregnant_man
lord have mercy
if you block them, the pings will not ping you
not sure why a mod would need to do something here if discord already has a built in feature to block said things
isnt there an ignore feature nowadays also
which one?
There is
yeee
I suppose that works too
how does that differ from block
i dont want to?
how would you react
if i ping you
all the time
im telling you all guys
if you ever do iy
it
i will scream as loud as i can
I once asked a guy with a deer avatar to stop pinging me here with every reply; he didn't care, nor did the mods
Now is your turn to suffer
do you guys know why a project would fail to minimize?
it only say it fails, disabling minimising works
thats because of static methods
never use them
never
me: looking for an alternative to integer parse int
me: finds one in apache common lang
also me: looks inside
why would you need an alternative to parseInt
i didn't needed to handle the number format exception
either you use parseInt() or you use valueOf()
don't really have anything else lol
ik
regardless both throw a number format exception
either way, it looks cleaner than wrapping it in a number format exception
the check will return null
this was with the catch
personally i would probably just use a regex for this that'd also validate that it's a number
this validates it either way
if (POSITION_PATTERN.matcher(placeholder).matches()) {
then extract the number and presence of _score from capture groups
since we are dealing with arrays, a dirty hack way to validate would just be to toss it into an array of int or create an array from the first array in that way automatically
either the array accepts it or it doesn't 😛
but then you could also have a loop and check each character with Character#isDigit
unless it's a perf hotspot, regex is much cleaner
position_(\d+)(_score)?
now there's no need to validate the number or handle a format exception, since it's always guaranteed to be a valid nonnegative integer
There’s Ints.tryParse in guava
the issue with that one is that it's boxed
totally fine too
but if i don't need it boxed i prefer the hidden apache catch
just open the box 🤨
proper value types can't become a standard library thing soon enough
anyone tried to mod hytale by this point now from here?
i've made example mods, but its so different from NMS or Bukkit API, so i need to adjust
added very borked version of crowbar for example 😄
looks more like a hockey stick then it does a crowbar
its amazing how even when its not minecraft, its still using the magenta-black tiled error texture
automatic unboxing is a thing
Tbf that came before minecraft
Source engine uses it too
That’s missing models
Gmod shows error if the model is missing
Yeah, and if the material is missing it becomes all purple and black as above.
its universal iirc
No
It’d look kinda dumb if the floor wqs choppy error signs
Apparently some source games have slightly different missing textures
I believe it mentioned CS:GO and half life alyx
recipes:
awkward:
input:
type: potion
effect: WATER
level: 1
duration: 0
splash: false
lingering: false
ingredient:
type: item
material: NETHER_WART
amount: 1
result:
type: potion
effect: AWKWARD
level: 1
duration: 0
splash: false
lingering: false
brew-time: 20
strength_base:
input:
type: potion
effect: AWKWARD
level: 1
duration: 0
splash: false
lingering: false
ingredient:
type: item
material: BLAZE_POWDER
amount: 1
result:
type: potion
effect: STRENGTH
level: 1
duration: 180
splash: false
lingering: false
brew-time: 20
I made a custom alchemy system and just wanted to know if this looks easy to use for you
It looks okay
If you have any suggestions, please let me know
add beer
I mean suggestion related to yml format
Make it all one line, but use AI to generate the potion format from real language
🤨
Am i wrong?P
doesnt this prove my point? source games literally uses the same checker pattern
error signs are for missing models
not textures
We have a custom Efficiency enchantment (levels 1-250) on tools and want it to visually speed up block breaking, but only for blocks matching the tool type (shovel→dirt, not stone). The problem is vanilla Efficiency enchantment only has ~10 meaningful levels before instant-break, and the BLOCK_BREAK_SPEED player attribute affects ALL blocks regardless of tool type (so a shovel with high efficiency insta-mines cobblestone). We need a way to control block break speed that scales smoothly across 250 levels and only applies to appropriate blocks - likely requiring custom break handling using Player.sendBlockDamage() to manually control the crack animation per-tick.
Sounds like you need some math
Has anyone encountered this or has a fix/workaround without needing to scan the block a player is looking at every tick because thats expensive
You cant incrementally increase native eff enchant over 250 levels which is the issue
"Every tick"? Have you not heard abt events
using Player.sendBlockDamage() ?
The other challenge is not being able to incrementally map eff levels 1 to insta break over something like 250 custom enchant levels
No but 220-250 is. Its a grindy tycoon game. Like a cookie clicker how you level every little stat up
sounds like slop
Hello, I'm trying to apply a variant to an entity that will be spawned from an egg, but it's not working. What is the correct syntax?
ItemStack itemStack = new ItemStack(Material.AXOLOTL_SPAWN_EGG);
if (itemStack.getItemMeta() instanceof SpawnEggMeta spawnEggMeta){
EntitySnapshot spawnedEntity = spawnEggMeta.getSpawnedEntity();
if (spawnedEntity instanceof Axolotl axolotl){
axolotl.setVariant(Axolotl.Variant.BLUE);
spawnEggMeta.setSpawnedEntity(spawnedEntity);
itemStack.setItemMeta(spawnEggMeta);
message(plugin, this.sender, "§aYou have received a Blue Axolotl Spawn Egg as a gift!");
} else {
message(plugin, this.sender, "§cFailed to create Axolotl Spawn Egg.");
}
player.getInventory().addItem(itemStack);
}
What happens
Actually I can guess what happens, getSpawnedEntity is null
Create a new EntitySnapshot from a World and use that
im slowly coming back towards spigot and i'm running into a small issue, im trying to use PacketPlayOutEntityEquipment, it exists in my buildtools but I get a CNFE on the server - I did some googling and found theres a new packet called ClientboundSetEquipmentPacket, but my buildtools doesn't appear to have this? when I ran buildtools for 1.21.11, was I supposed to run remapped?
they're the same packet but one is using md mappings and one is using mojang mappings
so do I need to rerun but remap or can I get away with just using reflection?
not sure how much it changes
that link doesn't appear to work, let me try archive org
ah, alright, thank you
gradle can selectively compile just the classes that aren't up to date
so if compilation is your bottleneck, potentially yes
but configuring the project usually takes longer, especially the first time since it has to start a daemon
configuring as in the time to parse the build script and get it going
I do
I do it's the standard these days
It's much more powerful tho
yeah, i like maven too, but i wanna try gradle as well
Are you sure it's Gradle and not paperclip ?
a bit of both i'm sure
configuration cache 🤤
doesn't support half of the things you want to do with the config
definitely nice where applicable though
public class SuperVanishHook {
// Prevent instantiation of the class
private SuperVanishHook() {
}
// Function to check if SuperVanish or PremiumVanish is installed and print a
// message
public static void checkVanishPlugin(Letters plugin) {
// Check if a supported vanish plugin is present
boolean superVanishFound = Bukkit.getPluginManager().getPlugin("SuperVanish") != null;
boolean premiumVanishFound = Bukkit.getPluginManager().getPlugin("PremiumVanish") != null;
// Determine which vanish plugin was found
String pluginName = null;
if (superVanishFound) {
pluginName = "SuperVanish";
} else if (premiumVanishFound) {
pluginName = "PremiumVanish";
}
// Only register the vanish event listeners if a vanish plugin is detected
if (pluginName != null) {
plugin.getServer().getPluginManager().registerEvents(new PlayerShowListener(plugin), plugin);
plugin.getServer().getPluginManager().registerEvents(new PlayerHideListener(plugin), plugin);
}
// Store config message path depending on whether a vanish plugin is present
String messagePath = (pluginName != null)
? "messages.system.checks.vanish-plugin-found"
: "messages.system.checks.vanish-plugin-not-found";
// Retrieve the message from the config
String message = plugin.getConfig().getString(messagePath);
// Return if the message is empty or null
if (message == null || message.trim().isEmpty())
return;
// Log vanish plugin status
if (pluginName != null)
plugin.getLogger().info(message.replace("<vanish_plugin>", pluginName));
else
plugin.getLogger().warning(message);
}
}
I have this function to log a message from the config. I tried changing the message in the config and it logged the correct message but when I comment or delete the line from the config, it starts logging the value I put in the default config instead of not logging anything, any reason why its behaving this way?
if the config is config.yml, then that has defaults pulled from your resources/config.yml in your jar
if an entry is absent from the config.yml on disk, the default from the jar will be used
you can get rid of all the defaults with Config::setDefaults and passing an empty config or maybe a null
but this also means that any new fields you add to the config will cause get's to return null on existing installs, unless you set up some kind of config upgrade/migrate system to add the missing entries in, or use getOrDefault everywhere
oh
the config cache isn't supported for some things, i forget exactly what; i think something to do with running scripts or referencing/persisting objects in the build scripts
i just remember running into it and disabling it
If I want to call an event with Bukkit.getPluginManager().callEvent and then check if the event would be cancelled or not, will I have to schedule the check for the next tick or is callEvent already aligning with the current tick? if I have to schedule, will one tick be enough? or do I need to run the check 2 ticks later as if the event call itself would take a whole tick and then my check?
GPT gave me this shi* but it is obviously stupid
BlockBreakEvent breakEvent = new BlockBreakEvent(block, player);
Bukkit.getPluginManager().callEvent(breakEvent);
if (!breakEvent.isCancelled()) {
block.breakNaturally(player.getInventory().getItemInMainHand());
}
Funnily enough ChatGPT actually got it correct
However if you want to break a block while respecting other plugins you can just do Player#breakBlock
yes, the event is expected to be at its final state once the call returns
that is, all listeners have seen it and done everything they need to do it, such as cancelling it
but isnt the if stmt completely useless there?
Why would it be? It's checking if the event wasn't cancelled, and if not cancelled, breaks the block
That cancelled state might have been changed by any listener
does this mean that from calling the event to the if stmt, all listeners for BlockBreakEvent are getting ticked and process their modifications?
Yes
callEvent() runs all the listeners
Though in this case, Jish is correct in saying that you can replace all that with just a Player#breakBlock(block) call because it will do all the event calling for you
Among other things like handling enchantments and drops
what if I run a callEvent inside an Event?
You can do that if you wanted, but if you're not careful you'll end up with some recursion
ye I will use this, sounds easier
you might create an infinite loop and your server will explode
Need some sort of exit clause if you're calling a break event from within a break event listener
what I meant is that if I have some listener with low priority and call an event there, wouldnt the high priority listeners be exluded from the called listeners?
when it really happens in the same tick?
Due to infinite recursiveness yes. The listeners are called in order of lowest to highest, so the lowest listener would get called, then your event would get called, then the lowest listeners for that would be called, repeat...
t
Oops sorry lol
Playing Rocket League at the same time trying to type lol
Ig I mixed up the priorities, what would be the case if the highest priority listener would use callevent?
Monitor would get excluded but same thing
how, didnt the low priority listeners not alr fire?
I don't understand why priority matters here
you call the event, it triggers the listeners regardless of what priority schedules the call
hm I think I got the intuition of it being bad for some plugins when I call two events for the same blockbreak e.g., I guess it is my responsibility to do it right so it cannot happen
you should ultimately not call the event twice for the same the block break, but yeah
btw, will this take item durability into consideration
Yes
javadocs do mention it
omg then my method got so much shorter :DDDDD
private void handleBlockBreak(Player player, Block block, BlockKey key) {
player.breakBlock(block);
cleanupBlock(block, key);
}```
a quick question
when blocks explode
do each block get passed to
BlockBreakEvent
no, BlockBreakEvent is when a player breaks a block
for explosions, EntityExplodeEvent and BlockExplodeEvent are called
depending on if what exploded was an entity or a block respectively
banners don't explode last i knew
oh...
the list of broken blocks is available in the explode event, that's what you'd check, but you probably want to listen to both events
how would you check if abanner is ominious?
the game does it by checking the item_name component and checking the translation key is block.minecraft.ominous_banner
Okay, is there anyway to make a banner "float"?
so like if the blocks surronding the banner is broken
the banner will still not break
ugh im yet to figure it out
i basically want to make "Floating Signs" but for banners
you would have to disable physics for it, and then afterwards continue disabling physics and would need to do checks to ensure the surrounding blocks don't cause the physics to update. Typically this is easier if you have a fake banner that doesn't actually exist but the client thinks it does
IE, packet manipulation
Okay
Is there anyway to track when a "banner" is dropped?
even during explostion or something
item spawn event if the flag did not get destroyed.
What if it did?
Banner banner = (Banner) event.getBlock().getState();
PersistentDataContainer pdc = banner.getPersistentDataContainer();
String markerId = MarkerUtil.generateMarkerName(event.getBlock().getLocation());
pdc.set(Keys.OWNER_UUID, PersistentDataType.STRING, player.getUniqueId().toString());
pdc.set(Keys.MARKER_ID, PersistentDataType.STRING, markerId);
pdc.set(Keys.MARKER_NAME, PersistentDataType.STRING, displayName);
banner.update(true);
then it should be part of the destroyed blocks list from explosion event
I need to retrieve these information from the banner before it drops, breaks or gets destroyed
Does ItemSpawnevent give me the banner's old state/presistent data container?
I doubt it, but nott entirely sure. you can test it 🙂
What about "BlockDestoryEvent"
ired anytime the server intends to 'destroy' a block through some triggering reason. This does not fire anytime a block is set to air, but only with more direct triggers such as physics updates, pistons, entities changing blocks, commands set to "Destroy".
try it out
okay i'll try this
its possible if you know java and spigot well
there you go. I have some links for you.
?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! 🎉
This is not a "learnjava" situation
How can I remove the "Blaze"
try different item flags
one of them could work
or create a spawner that's not blaze if that's possible
It needs to be Blaze
Do you know which one?
Do you have an idea how I could hide/remove the "Blaze"?
Did you try hide attributes?
Yes
And hide potion effects?
You're on Paper aren't you
no
Nah that’s latest spigot
This isn’t latest
spigot 1.21.10
thanks
HIDE_ADDITIONAL_TOOLTIP
You cannot
...
It's clientside
oh
but it only shows for people who are op so it won't affect regular players
Ah okay thanks
oh yeah, i use 1.18 api i forgot to mention
i wonder how would bukkit api would look like if it had native support for reactive extensions
what's a reactive extension?
imagine something like
World.getEntities().filter(entity -> entity instanceof Player player).subscribe(player -> player.sendMessage("Hello world!"))
its basically Stream API
but for async operations
its like bukkit events
but resembles more of handling things like Stream API from java
you would get the benefit of quick and easy event listeners, and at the same time more async compatible way of doing things on the server without breaking the synchronization
since some callbacks for those observables could just execute on the main thread instead
that would be pretty cool isnt it
it's cool
but i already found a cool pattern for my code
i just run an executor and if i need to run on main thread i just Bukkit.runTask(plugin, runnable);
yea but that's way uglier than stream api like notation
you could make such a utility yourself if you like it more
reactive extensions would allow to refactor NMS to support more async operations too since you dont expect users to get blocking snapshots of entities anymore
mmm yes lets put the streams back in nms after we've spent 5 years slowly replacing them with regular loops because they perform horribly
can be depending how they are being used
they are nice because they provide some conviences but conviences come at a cost usually you know
when they first came out they were known to typically perform worse than /traditional/ ways of performing the equivalent operations
pretty sure theyve gotten better over the years
yeah, but loops are still more optimal in most cases but that shouldn't be the primary factor in why you stick to a loop lol same goes with using streams.
there's concept of sinks, where you can building custom implementation of such async streams by just pushing the values like a buffer, only exposing it from outside through Observable interface, so this is not really relevant
im not saying replace everything in NMS
im talking about API surface
instead of having split bukkit event api and snapshots, why not just combine them both under one API
with observables from reactive extensions
those observables would allow allow you to iterate through existing values and also subscribe to new ones.
private record AxolotlImpl(
org.bukkit.entity.Axolotl.Variant variant
) implements VariantComponent.Axolotl {
@Override
public void apply(@NotNull ItemStack itemStack, @Nullable Player player) {
boolean applyBucket = ItemUtil.editMeta(itemStack, AxolotlBucketMeta.class, meta -> {
meta.setVariant(this.variant);
});
boolean applySpawnEgg = ItemUtil.editMeta(itemStack, SpawnEggMeta.class, meta -> {
EntitySnapshot spawnedEntity = meta.getSpawnedEntity();
if (spawnedEntity == null){
spawnedEntity = Bukkit.getEntityFactory().createEntitySnapshot("{id:\"minecraft:axolotl\"}");
meta.setSpawnedEntity(spawnedEntity);
}
if (spawnedEntity instanceof org.bukkit.entity.Axolotl axolotl) {
axolotl.setVariant(this.variant);
} else {
Logger.info("Spawned entity is not an Axolotl for item: " + itemStack.getType().name());
}
});
if (!applyBucket && !applySpawnEgg && Configuration.enableDebug)
Logger.info("Could not apply Axolotl variant to item: " + itemStack.getType().name());
}
}
I don't get any errors when creating the entity, but I get my log message saying that the spawned entity is not an axolotl. :/
Snapshot won't be instance of axolotl. Check the methods in EntitySnapshot
What is better to use pluginInstance.getServer() or Bukkit.getServer() ?
Good ty
For people who want :
EntitySnapshot spawnedEntity = meta.getSpawnedEntity();
if (spawnedEntity == null){
spawnedEntity = Bukkit.getEntityFactory().createEntitySnapshot("{id:\"minecraft:axolotl\"}");
}
if (player != null && spawnedEntity.createEntity(player.getWorld()) instanceof org.bukkit.entity.Axolotl axolotl){
axolotl.setVariant(this.variant);
EntitySnapshot axolotlSnapshot = axolotl.createSnapshot();
if (axolotlSnapshot != null) {
meta.setSpawnedEntity(axolotlSnapshot);
}
}
i am getting this error while trying to connect to mysql idk how to fix it i tried everything
I can't ping archive.apache.org, and BuildTools doesn't detect that I have Maven installed, so it tries to download it but can't. Is there any way to use BuildTools offline or to make it use the installed Maven?
Maven does not exist, downloading. Please wait.
Starting download of https://archive.apache.org/dist/maven/maven-3/3.9.6/binaries/apache-maven-3.9.6-bin.zip
Exception in thread "main" java.net.ConnectException: Connection timed out: connect
It should detect your local maven install if you have the M2_HOME environment variable set
Oh, thank you! My variable had a different name. 😅
M2_HOME is a very old name
MAVEN_HOME is what's used nowadays but BuildTools never got the update for that
This is the funniest shit I have heard today
I've been working as a SWE for more than 5 years
Okay?
Hi jishuna
PS: I got around the issue. BlockDestoryEvent does the trick even though it's not the most intuitive at the beginning.
I needed to get the underlying Presistent Data Container
Of the block entity?
Of the banner, yes.
BlockDestoryEvent glitched a little for me when integrating with Bolt and WorldGuard. I got through that with some maneuvers (a delay to check if banners still there)
To use, BlockPhysicsEvent, I would need to umm cancel the physics of the attached block rather than the banner itself.
Ah yeah sadly you won’t be able to get the block if you just use the item spawn event
It's still not a language issue 💀
lol
sadly as cool this is, it doesn't necessarily mean you know java or many languages for that matter. However you should at least know the concepts fairly easy though because you would need to know some languages to be a SWE
the problem with reactive programming and libraries like RxJava and Flux is first of all the debugging nightmare, those patterns are also contagious to the caller, if you use RxJava on an API level, then every api consumer is enforced to use it that way, contrary to if you offer some Collection for example. When we use bukkits event API its very specific in terms of the observer pattern and its intented use- you absolutely dont wanna enforce that everywhere just because it might be nice to add more chains of code on some event (however in the light of async and concurrency it is a more acceptable argument), more so implementing a reactive design natively is really complex especially if you use buffering/sinking techniques, mind you dealing with concurrent programming as is hardly ever trivial.
but another reason for example Flux (async reactive programming) was so favored involved Java not offering lightweight threads; that is scalability sucked, which as of j21 invalidates (virtual threads)
Why is this troll still allowed to be here -_-
Is it okay to use Plugin.getPlugin(Plugin.class) to get the plugin instance?
should be fine
is it okay? Yes. Is it recommended? I wouldn't be able to answer so decisively
Hello, i came here today to ask to all of you an important question. I'm wanting to create public plugins for help server overs to have more features in they server easy but before the creation of a plugin this question always come in my mind... What should i use Paper/Spigot, what should i use Java/Kotlin and which version i should use? Thanks for answering and if you need more information / you are more curious just let me know
if you know kotlin already you could use that, but it wont really make it easier
regarding spigot/paper that's a hard question
they both have different advantages and disadvantages
you are also likely to get a different answer if you ask here vs paper discord, lmao
go to a kfc and ask if taco bell is better
i mean it's really that big of a deal java / Kotlin? (as right now i mainly know java)
what about maven/gradle?
if you know mainly java, use java
kotlin is not like faster or better than java or anything
I prefer gradle
but this is preference pretty much all the way
oh okay thank i thought there was something behind thanks
they will tell you that both are amazing
first or second?
i like the first one because it encapsulates the write executor
but i don't like that Callable<Void> requires a return
futures get around this by distinguishing between accept and apply
hmm
personally i would just use an executor and completablefutures, there's no need to reinvent this wheel
e.g. CompletableFuture.runAsync(() -> output.writeUTF("keep-alive"), writeExecutor);
one of the biggest annoyances with futures is that it's very easy to swallow exceptions by fogetting to join/get/exceptionally a future anywhere, but you can get around with it by setting a default exception handler for your executor iirc
that doesn't work with futures precisely because they swallow them to be part of the future pipeline
so you can handle them downstream
and that code doesn't compile because exceptions
oh yeah
i usually wrap them in a sneaky runnable that sneakily propagates them up
i do remember there being a way to set a default exception handler for futures
though now that i think of it more, i think it was hacky somehow
yeah I have no idea what you have in mind
let me see if i can find the stackoverflow thread
ExecutorService executorService = new ThreadPoolExecutor(
1,
1,
0L,
TimeUnit.MILLISECONDS,
new LinkedBlockingQueue()
) {
@Override
protected void beforeExecute(final Thread t, final Runnable r) {
super.beforeExecute(t, r);
if (r.getClass().getName().equals("java.util.concurrent.CompletableFuture$AsyncRun")) {
try {
final Field f = r.getClass().getDeclaredField("dep");
f.setAccessible(true);
((CompletableFuture<?>) f.get(r)).exceptionally(e -> {
LoggerFactory.getLogger(ExceptionTest.class).error("Error in runAsync " + r, e);
UnsafeUtils.getUnsafe().throwException(e);
return null;
});
} catch (Exception e) {
System.out.println("Failed to hack CompletableFuture$AsyncRun to report exceptions.");
}
}
}
protected void afterExecute(Runnable r, Throwable t) {
super.afterExecute(r, t);
if (t == null && r instanceof Future<?>) {
try {
Future<?> future = (Future<?>) r;
if (future.isDone()) {
future.get();
}
} catch (CancellationException ce) {
t = ce;
} catch (ExecutionException ee) {
t = ee.getCause();
} catch (InterruptedException ie) {
Thread.currentThread().interrupt();
}
}
if (t != null) {
LoggerFactory.getLogger(ExceptionTest.class).error("Error in async task " + r, t);
}
}
};
mmmm yes
it indeed is hacky
you know you can just subclass CompletableFuture and override completeExceptionally
yes?
presumably, though most futures come about by the factory methods
i'm also not sure how that'll work with chaining
new MyFuture<>().completeAsync(task, executor)
newIncompleteFuture
completeAsync is a jdk method already so nothing to do on tha[ front
it'll be a bit awkward with chaining, ideally you'd only attach it at the end, but I suppose that doesn't work with the above hack either
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! 🎉
in what way specifically
?ban @kindred valley repeated trolling
Done. That felt good.
Thank you!
to be fair in this particular case it was a somewhat valid response
op did ask whether to use java or kotlin 🤡
im sure should they have wanted to guide said user whether to use java or kotlin, one couldve produced a more productive and meaningful answer
myes, and in-context it was pretty obvious that they were just doing the same thing they have been doing for a while
yee
ngl about time
They've been doing that trolling for years now
yea true, it shouldve been handed out long time ago, more so i had the impression they'd be helping out every so often (genuinely), but this goes beyond my leniency :>
i hate academics
this not right
NoSQL != Non-relational
NoSQL means not only sql, not "not sql"
sql also is just a query language it doesnt determine if something is relational is not
It does actually
NoSQL databases use a variety of data models for accessing and managing data.
nothing in that name imply that
it can use relational and non-relational model
and still call itself NoSQL
simply because it would have another API to access the data
that's not only SQL based
NoSQL database definition: NoSQL stands for “not only SQL,” meaning that these databases support more functionality than structured query language (SQL) only.
nosql is snake oil
well i dont see any of its use apart from CQRS
or data sharding with replication
where you would build more optimized readonly views of the data for the specific use case, but keep everything normalized in primary relational database
by offloading reads from main database and directing all reads to that nosql database instead, it would still need to write to replica when normalized database would be written, but those writes would be way cheaper due to lack of constraint enforcement and other stuff that sql based db's do by default
unless you're doing geoaware data sharding or you're meta or amazon this is useless because our shitty apps would never peak that much anyways
apart from that yeah nosql is just bunch of snake oil tbh
for once we agree
Hello everyone!
Do someone have a copy of old md_5 repo? Please
What artifact are you looking for?
minecraft_server
I have these
I need more
"all of them"
lol
@chrome beacon u were typing smthing
Does that not just contain the vanilla jars
It's vanilla jars deobfuscated with bukkit mappings
Can just recreate them then
but where I can get bukkit mappings
Time to do some digging on stash
I wasn't around back then so I'm not sure where they were stored
\o I have a Hytale mod but I'll ask here as the question is not Hytale specific :D
My mod uses Lua. Part of the Lua code is loaded from a git repository I depend on.
How do I properly bundle it in the mod, I don't feel that it's a good idea to just have the full git repository in resources of the jar.
Just feels weird.
ig I could just create a task that would update the git repo and copy the files I need into resources
but idk how to make such a custom task
do it at runtime for maximum RCE potential
Yay
Great idea!
Ty for the help guys
oh maven just ignores the .git and .gitignore files when packaging
so all good ig
i wish zstd compression tool was in java so i'd be able to replace gzip with it
i don't like depending on external libraries
it's worth it even despite the external library
and i think paper bundles it in for network compression or something anyway, so it's basically guaranteed to be present at runtime without bundling it into the jar
hmm, i do have a paper module
i might be able to cram this option in there if possible
i don't remember what i forked to switch backup compression from gzip to zstd, but the backups now compress into like one tenth of the size thrice as fast
maybe towny
it's still too much for me
i just send a simple json over a socket
1 megabyte maximum realistically
How much of that is a Bitcoin miner
none
shaded in gson (just in case) and apache math and probably all of netty on accident
a plugin aint a real plugin if it doesnt shade spigot
I once accidentally shaded the minecraft client in a fabric mod
I was like "huh why is the jar 100mb"
god move
I thought it was like some sort of transitive dependencies or smth
turned out to be minecraft
happens Ig
how do I get the PrimedTNT entity in the tntprimeevent?
You kinda can't. That event is called before the actual priming happens so the entity doesn't exist yet
Best you could do is run a task 1 tick later and get the closest TNTPrimed entity to the block that was ignited
Or better yet, you can use an EntitySpawnEvent if you don't care too much about the priming. You can still get the entity that ignited it with TNTPrimed#getSource()
Choco you would be a good teacher 
are unchecked casts fine as long as i know what im trying to do, or does that mean ive not following proper conventions

