#help-development

1 messages · Page 1326 of 1

quaint mantle
#

do you have any guide or anything written or a video to help?

#

there should be something 😭

cloud perch
#

What do you not understand exactly?

quaint mantle
#

theres a pom file in every folder

thorn isle
#

Those are submodules

#

This is a multi module project

quaint mantle
#

i dont understand the partitions and how theyre compiling different spigot versions and everything into one jar

thorn isle
#

Each module depends on a different spigot version

quaint mantle
#

so how do you compile it all into one jar file then?

thorn isle
#

Then at the end the main module bundles them together into one jar

thorn isle
#

First the submodulrs build individually, then get bundled together

#

Typically with maven shade

quaint mantle
#

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

thorn isle
#

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

brazen phoenix
#

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?

thorn isle
#

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

brazen phoenix
#

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?

thorn isle
#

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

brazen phoenix
#

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.

orchid furnace
#

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?

chrome beacon
#

Doesn't get more efficient than updating it in the reload command

orchid furnace
#

Fair enough then

chrome beacon
#

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

orchid furnace
#

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

real crater
#

where do i find the api download?

chrome beacon
#

?maven

undone axleBOT
chrome beacon
#

?gradle

#

no gradle command smh

real crater
#

?api

#

dang

grim hound
#

has anyone ever dealt with mariadb shading

#

cuz damn

#

and for some reason I can reference it in code

grim hound
#

...only for other mariadb classes not to be found later on

thorn isle
#

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

grim hound
#

can I tell the minimize to like, not do whatever tf it's doing

thorn isle
#

dunno

grim hound
#

I guess

thorn isle
grim hound
#

hmm, it broke alongside shadowJar relocating

#

the more you know

thorn isle
#

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

grim hound
#

it works with reflection

#

if you reference a full path, it'll find it

#

org.mariadb.jdbc in a string would get remapped

kind tendon
#

"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.

young knoll
#

Are you joining the backend directly

cursive kite
#

My players keep stating that cannons are not working properly on the server

#

But from what I know i do not edit cannons (tnt)

buoyant viper
#

sounds like something theyd break

#

?jd-s [for self]

undone axleBOT
buoyant viper
#

oh theres just a gamerule to disable spectators generating chunks

#

Based mojang

orchid brook
#

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?

sullen marlin
#

Probably an issue with the model?

orchid brook
#

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

sullen marlin
#

Compare what /data get says the nbt is for each

outer elk
pseudo hazel
#

minecraft has dialogs yes

#

idk if spigot has api for it

pseudo hazel
#

ah its bungee, makes sense

lilac dagger
#

am i crazy?

worldly ingot
#

Depends on what you need

#

Sometimes RegEx is just less complex than a lexer (believe it or not)

slender elbow
#

if the pattern is precompiled, the difference won't be really noticeable, like, at all

#

just keep your patterns in static final constants

worldly ingot
#

Especially if you're not in a hot spot

#

Translating text messages isn't that hot

lilac dagger
#

hmm

#

i'll give a try to patterns

worldly ingot
#

You could always test it 👀

thorn isle
#

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

slender elbow
#

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

lilac dagger
#

okay i got them both working

slender elbow
#

reminder that System.currentTimeMillis() is not a benchmark

lilac dagger
#

i'm gonna test it on 1000 elements

#

is this good?

slender elbow
#

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

thorn isle
#

actually nano time is sort of more unstable than millis, it can easily drift up to like a few µs between different cores

silver dirge
#

how can i setJoinMessage with color?

thorn isle
#

so if your benchmark thread happens to get tossed between cores in the middle of a benchmark, you can get odd results

slender elbow
#

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

silver dirge
#

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)!

thorn isle
#

sounds like some plugin

silver dirge
#

wym

lilac dagger
#

i got it to work

#

it takes a while

slender elbow
#

it does!

#

it spins multiple JVMs with wildly different configurations to each one

silver dirge
#

do you guys know any good learning aids

outer elk
#

@slender elbow i pinged u for nothing
bcs i want hgd

silver dirge
#
    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

cloud perch
#

eh

#

Use player#sendMessage

silver dirge
#

alr

cloud perch
#
@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 ^^

thorn isle
#

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

silver dirge
#

i mean its alright if it sends it only to the player

thorn isle
#

then the given approach is fine

silver dirge
#

i got errors but yk it works so dont touch it

cloud perch
#

I mean getting a error fixed in a 1 file 30 line class aint that big of a deal

silver dirge
#

i dont get an error in my file

#

its an error in my console

tranquil pecan
#

player.sendMessage("§Welcome " + name + " to the server!");

§W 👀

weak wasp
silver dirge
#
[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) ~[?:?]```
weak wasp
#

Oh, alright then.

cloud perch
#

Paper

silver dirge
#
    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
thorn isle
#

not related to your code if so

silver dirge
#

alr i just reload bukkit so thats mayb why

lilac dagger
#

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

thorn isle
#

does that include compiling the regex or just matching it

lilac dagger
#

Compiling is a static field, should i add it in the bench state?

thorn isle
#

i think that is fine

#

it being static, that is

lilac dagger
#

It is

slender elbow
#

what's the benchmark code look like?

lilac dagger
#

and the bench state

thorn isle
#

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

worldly ingot
#

I wrote that method Hypixel_Sad

#

The Javadocs seem clear enough to me!

thorn isle
#

💀

mortal hare
#

JETBRAINS

#

WTF DID YOU DO WITH GLOBAL SEARCH

#

wtf is this

#

why it has to be a sidebar panel

lilac dagger
#

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

silver dirge
#
    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
silver dirge
#

paper bad?

chrome beacon
#

You're asking for help with Paper in the wrong discord

#

This is the Spigot discord

silver dirge
#

mm

#

alr srr cya

thorn isle
# worldly ingot The Javadocs seem clear enough to me!

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

worldly ingot
#

Me when the block is sturdy

young knoll
#

Choco when the block isn’t sturdy (he fell in)

mortal vortex
buoyant viper
#

whats a "proper" way to obtain a plugin instance from another plugin

#

JavaPlugin#getPlugin(Class) ?

mortal vortex
#

ye but it fails if the class isnt loaded yet i think. Depends if ur softdepending

buoyant viper
#

im hard depending :V

mortal vortex
#

im hard too depending on the person

#

but not what i asked

buoyant viper
#

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

mortal vortex
#

The Services API is cool to look into if the plugin supports it

buoyant viper
#

i did think abt Services

#

may be Too useful for how i intend on using it

#

?services

undone axleBOT
buoyant viper
#

oh, right

#

dunno why i thought thatd give me the API wiki

#

?wiki

undone axleBOT
desert aspen
#

How can i make a playsound but the volume is higher than vanilla Minecraft?

drowsy helm
#

if it doesn't allow past max i would say thats a client limitation

#

not server

mortal vortex
#

Like volume = 1 means its audible for a chunk

mortal vortex
# drowsy helm just says the volume of the sound lol

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

drowsy helm
#

you benefit from this financially dont you

mortal vortex
ivory sleet
thorn isle
#

Yeah, PluginManager::getPlugin and cast is the ground truth

#

Passing classes could be affected by shade misconfigurations and such

buoyant viper
#

no shading just raw depend: in plugin.yml

#

xd

lilac dagger
#

wasn't there a bitewise operation for i / 2?

#

nevermind

#

it probably has to performance improvement

thorn isle
#

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

thorn isle
#

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

bright spire
wet breach
#

oh I see vcs2 already said the division one

#

I guess I will supply the odd even checking

#

i &1 (0 = even 1 = odd)

buoyant viper
wet breach
#

lol

thorn isle
#

now make it recursive

buoyant viper
#

not scientifically possible

#

the atoms in the microcode wouldnt line up

spice sapphire
#

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||

lilac dagger
#

i'll replace it with right shift

spice sapphire
mortal vortex
#

This is for development using the API

spice sapphire
#

oh then im not at the right place

#

my bad sorry again

buoyant viper
spice sapphire
#

maybe, im so sorry

thorn isle
#

i doubt anyone knows there either

#

better ask in some datapack/resourcepack guild

mortal vortex
#

Doesn’t ItemsAdder have a server though

thorn isle
#

or yeah that

spice sapphire
mortal vortex
#

Because you have an illegally obtained copy of items adder?

spice sapphire
#

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

mortal vortex
#

All good you too

crisp herald
#

how the fuck do I apply a b64 texture to a skull in this latest bitchass version

#

shits impossible

#

😭

young knoll
#

Same way you should be doing it since 1.18

crisp herald
#

nope lol

young knoll
#

Like this

chrome beacon
#

The base64 contains a piece of json with the url in it

#

if you're wondering where to get the url from

young knoll
#

I believe Minecraft-heads has the url directly

crisp herald
#

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

chrome beacon
#

The client does not fetch the skin from the server

young knoll
#

Yeah, the base64 literally has a url in it

chrome beacon
#

It fetches them from Mojang

#

The texture property is just an encoded url to Mojangs server

crisp herald
#

oh crazy

chrome beacon
#

Put it in a base64 decoder and you'll see :p

crisp herald
#

im a brick

young knoll
crisp herald
#

i just assumed it was straight texture data lol

#

my fault

thorn isle
#

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

crisp herald
thorn isle
#

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

crisp herald
#

ok well i did this shit in 1.20 or so and it was ridiculously easy and now its a nightmare lol

thorn isle
#

it's always been like this

crisp herald
#

nah

thorn isle
#

yuh

crisp herald
#

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

young knoll
#

Ew reflection

thorn isle
#

the values are still the same

young knoll
#

That’s basically what the api is doing

#

Minus reflection

thorn isle
#

i think the api might have changed slightly, but the underlying thing is the same

crisp herald
crisp herald
thorn isle
#

okay what specific texture base64 string are you trying to use

chrome beacon
#

?paste

undone axleBOT
thorn isle
#

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

lilac dagger
crisp herald
#

thats what i USED to use

#

it was like 1.20

#

or sum shi

thorn isle
#

haven't touched it since 2023

crisp herald
#

the texture is just the base64 string

thorn isle
#

paste the base64 string

crisp herald
#

again i havent touched head textures in like 2 yrs lol

crisp herald
# thorn isle paste the base64 string

was trying to use this one:
eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMTliZjMyOTJlMTI2YTEwNWI1NGViYTcxM2FhMWIxNTJkNTQxYTFkODkzODgyOWM1NjM2NGQxNzhlZDIyYmYifX19

#

basic right arrow head

thorn isle
#

so you're passing that directly to textures.setSkin(URI.create(texture).toURL()); as texture?

crisp herald
#

i assumed that was the move

#

yeah

thorn isle
#

well

crisp herald
#

dont flame me 😭

thorn isle
#

that's not a URL

crisp herald
#

tru

thorn isle
#

you need to decode it from base64 first to get a url

crisp herald
#

its not a url on its own

thorn isle
#

then pass it to URI.create

crisp herald
#

yea good point

young knoll
#

I usually just use the url directly

#

But it shouldn’t be too hard to decode and parse

crisp herald
#

wait hollup i might be a brick

thorn isle
#

i usually just use the texture hex and hardcode the url in

crisp herald
#

lemme try sum shi

thorn isle
#

on minecraftheads, scroll down to the bottom and copy the "Minecraft URL" instead of the base64 profile property

crisp herald
#

i tried that too btw

#

before i sent the stuff earlier

thorn isle
#

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

thorn isle
crisp herald
#

directly

crisp herald
#

it works now lmfao tyt

#

ty

mortal vortex
#

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

cloud perch
#

Packets

lilac dagger
#

i just use fly/allow flight and player#hidePlayer

#

as well as setcollidable with entities to false

cloud perch
#

Does that hide the player from tab?

lilac dagger
#

yes

cloud perch
#

What if features like spectators seeing other spectators

lilac dagger
#

and to not collide with blocks you can work with the allowbuild event

lilac dagger
#

tho i haven't done that with my plugin

cloud perch
lilac dagger
#

player#hidePlayer and player#showPlayer

cloud perch
#

So just check if the player is spectator if true then show if false then hide

lilac dagger
#

i also have a system that makes the players of a game to only see each other

#

yeah

#

loop through the spectators

cloud perch
#

I see i see

lilac dagger
#

and make them see the new spectator

cloud perch
#

I didn't know that method existed but now I do

cloud perch
lilac dagger
#

now you do 😄

cloud perch
#

Wait are you the creator of that one minigame plugin?

#

I forgot the name

cloud perch
#

Yess it is you

#

A server I used to work for used that minigames setup

lilac dagger
#

😄

mortal vortex
#

Or execute commands

lilac dagger
#

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

buoyant viper
#

spectators can open containers? wat

thorn isle
#

they can open containers but not modify them, or cause loot to be generated in them

lilac dagger
#

minigame spectator

#

not game mode spectator

buoyant viper
#

ah

tender shard
#

but they cannot generate loot, e.g. shipwrecks

kindred valley
undone axleBOT
#

For Beginners:

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

For Intermediate to Advanced Learners:

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

Practice and Hands-on Learning:

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

Free Resources and Documentation:

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

Community and Support:

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

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

cloud perch
kindred valley
#

That method exists ın the link I seng

#

Sent

pseudo hazel
#

what?

#

what do you mean bro

kindred valley
#

He says he didnt know the method exists so I sent the method to convince hım that method exists

pseudo hazel
#

what method are you talking about

kindred valley
#

dont disturb me

#

I am a business man

#

i dont have time for you

pseudo hazel
#

okay, then stop talking to me xD

mortal vortex
#

10/10 ragebait

#

good work @kindred valley

kindred valley
#

what ragebait

#

its your problem that you didnt understand anything

#

y'all stop playing with me

cloud perch
mortal vortex
#

true

warm mica
molten hearth
#

he's gotta go bald then maybe

kindred valley
#

thats true

#

Im so muvh hgiher

molten hearth
#

there's higher levels to being a pedo?

kindred valley
#

i dont wanna mention but i sold plugins to jeff

#

he wanted a refund and we got a beef

crisp herald
#

5/10 ragebait

kindred valley
#

shame on ya

fathom fable
mortal vortex
crisp herald
#

or whatever

mortal vortex
#

is that a problem?

crisp herald
#

yeah bro

#

big problem

wet breach
#

if so, you obviously are mistaken in which acronym it is

crisp herald
#

son

#

nah

#

i thought the t stood for trans, not "Testing Engineer"

wet breach
#

International Software Testing Qualifications Board (ISTQB)

crisp herald
#

😭 broseph stalin

crisp herald
#

i have yet to read a sentence this year that fits the nerd voice better than this

kindred valley
#

isnt there any mods here?

#

the fuck is this?!?!

fathom fable
#

i dont

#

thats actually a certificate

#

ISTQB® is the leading global certification scheme in the field of software testing

crisp herald
#

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

fathom fable
#

like obv joke

#

and as u read my message

#

i literally said "ew i dont"

ivory sleet
#

he is gone

fathom fable
#

😭

thorn isle
#

Are we arguing about the gays?

fathom fable
#

no

#

about istqb

fathom fable
thorn isle
#

What is that

fathom fable
#

just a certificate

#

for software testing

thorn isle
#

Sounds like something they would put into high fructose corn syrup to make people go bald

fathom fable
#

maybe im bald one day

#

because il ike to be it

#

anyway

thorn isle
#

You can get an XML programmer certificate from w3 schools

#

For the low price of iirc 95 usd

ivory sleet
#

xml programmr lol

fathom fable
#

what i have is actually world wide accepted

#

and i want to go deeper into that

thorn isle
#

Unfortunately they don't have yaml programmer certificates

lilac dagger
#

Xml has schemas and such

#

Makes sense

fathom fable
#

you can go in like 42 directions

fathom fable
#

but i would like to get the ITP-ATP certificate

#

but i just finished foundation 💀

#

which was pain in the ass honestly already

cloud perch
young knoll
#

XML gives me nightmares

#

Have you ever tried to comb through an entire game save of xml

kindred valley
smoky anchor
slender elbow
#

w3schools 💀

cloud perch
fathom fable
#

he reacted with a pregnant emoji

thorn isle
#

pregnant_man
lord have mercy

wet breach
#

not sure why a mod would need to do something here if discord already has a built in feature to block said things

ivory sleet
#

isnt there an ignore feature nowadays also

wet breach
#

which one?

cloud perch
ivory sleet
cloud perch
ivory sleet
#

yeee

wet breach
#

I suppose that works too

thorn isle
#

how does that differ from block

wet breach
#

lets you still see the messages

#

just doesn't notify you of anything of them

cloud perch
#

That guys just talk loud die loud

kindred valley
#

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

thorn isle
#

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

kindred valley
#

you all are done

#

ım telling you

cloud perch
lilac dagger
#

do you guys know why a project would fail to minimize?

#

it only say it fails, disabling minimising works

kindred valley
#

never use them

#

never

lilac dagger
#

hmm

#

might be a dependency

#

i'm not sure

lilac dagger
#

me: looking for an alternative to integer parse int
me: finds one in apache common lang
also me: looks inside

thorn isle
#

why would you need an alternative to parseInt

lilac dagger
#

i didn't needed to handle the number format exception

wet breach
#

don't really have anything else lol

lilac dagger
#

ik

wet breach
#

regardless both throw a number format exception

lilac dagger
#

either way, it looks cleaner than wrapping it in a number format exception

#

the check will return null

#

this was with the catch

thorn isle
#

personally i would probably just use a regex for this that'd also validate that it's a number

lilac dagger
#

this validates it either way

thorn isle
#

if (POSITION_PATTERN.matcher(placeholder).matches()) {

#

then extract the number and presence of _score from capture groups

wet breach
#

either the array accepts it or it doesn't 😛

lilac dagger
#

but then you could also have a loop and check each character with Character#isDigit

thorn isle
#

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

lilac dagger
#

true

#

i like how clean regex is

young knoll
#

There’s Ints.tryParse in guava

lilac dagger
#

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

buoyant viper
thorn isle
#

proper value types can't become a standard library thing soon enough

mortal hare
#

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 😄

wet breach
buoyant viper
# mortal hare

its amazing how even when its not minecraft, its still using the magenta-black tiled error texture

slender elbow
young knoll
#

Source engine uses it too

buoyant viper
#

thought source was the ERROR texture

#

or is that gmod exclusive

young knoll
#

That’s missing models

buoyant viper
#

damn

#

idk i never played gmod

cloud perch
#

Gmod shows error if the model is missing

rotund ravine
mortal hare
#

its universal iirc

rotund ravine
#

It’d look kinda dumb if the floor wqs choppy error signs

young knoll
#

Apparently some source games have slightly different missing textures

#

I believe it mentioned CS:GO and half life alyx

tranquil pecan
#
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

cloud perch
#

It looks okay

tranquil pecan
#

If you have any suggestions, please let me know

thorn isle
#

add beer

tranquil pecan
rotund ravine
rotund ravine
mortal hare
#

error signs are for missing models

#

not textures

mental drum
#

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.

rotund ravine
#

Sounds like you need some math

mental drum
#

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

mortal vortex
#

"Every tick"? Have you not heard abt events

mental drum
#

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

sullen marlin
#

Why do you need 250 levels

#

Is the difference between 249 and 250 meaningful

mental drum
#

Factory farm gamemode

#

its tycoon

mental drum
mortal vortex
#

sounds like slop

mental drum
#

Its for brain slop watchers, yes

#

Thanks for the help. I figured it out

pseudo tapir
#

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);
}
young knoll
#

What happens

#

Actually I can guess what happens, getSpawnedEntity is null

#

Create a new EntitySnapshot from a World and use that

lilac dagger
#

set spawn meta back

#

oh you do hmm

#

yeah what jishuna said

dense geyser
#

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?

lilac dagger
#

they're the same packet but one is using md mappings and one is using mojang mappings

dense geyser
#

so do I need to rerun but remap or can I get away with just using reflection?

#

not sure how much it changes

lilac dagger
#

if you wanna use remapped jars you also need to specify it in your module pom

#

?nms

dense geyser
#

that link doesn't appear to work, let me try archive org

lilac dagger
#

replace it for your version

#

you'll then be able to code in mojang mappings

dense geyser
#

ah, alright, thank you

lilac dagger
#

does anyone here use gradle?

#

is it faster than maven?

thorn isle
#

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

lilac dagger
#

i see

#

hmm, i'll give it a try in a project and see how it goes

shadow night
onyx fjord
#

I do it's the standard these days

thorn isle
#

i still prefer maven honestly

#

gradle feels sluggish and heavy to me

onyx fjord
#

It's much more powerful tho

lilac dagger
#

yeah, i like maven too, but i wanna try gradle as well

onyx fjord
thorn isle
#

a bit of both i'm sure

slender elbow
#

configuration cache 🤤

thorn isle
#

doesn't support half of the things you want to do with the config

#

definitely nice where applicable though

quaint mantle
#
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?

thorn isle
#

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

quaint mantle
#

oh

thorn isle
#

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

grave plover
#

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());
        }
young knoll
#

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

thorn isle
#

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

grave plover
worldly ingot
#

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

grave plover
worldly ingot
#

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

grave plover
#

what if I run a callEvent inside an Event?

worldly ingot
#

You can do that if you wanted, but if you're not careful you'll end up with some recursion

grave plover
sly topaz
#

you might create an infinite loop and your server will explode

worldly ingot
#

Need some sort of exit clause if you're calling a break event from within a break event listener

grave plover
#

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?

worldly ingot
#

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

grave plover
#

Ig I mixed up the priorities, what would be the case if the highest priority listener would use callevent?

worldly ingot
#

Monitor would get excluded but same thing

grave plover
sly topaz
#

I don't understand why priority matters here

#

you call the event, it triggers the listeners regardless of what priority schedules the call

grave plover
#

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

sly topaz
#

you should ultimately not call the event twice for the same the block break, but yeah

grave plover
worldly ingot
#

Yes

sly topaz
grave plover
#

omg then my method got so much shorter :DDDDD

    private void handleBlockBreak(Player player, Block block, BlockKey key) {
        player.breakBlock(block);

        cleanupBlock(block, key);
    }```
silk mirage
#

a quick question

#

when blocks explode

#

do each block get passed to

#

BlockBreakEvent

slender elbow
#

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

silk mirage
#

for a banner

#

that'd be block right?

slender elbow
#

banners don't explode last i knew

silk mirage
#

oh...

slender elbow
#

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

silk mirage
slender elbow
#

the game does it by checking the item_name component and checking the translation key is block.minecraft.ominous_banner

silk mirage
#

so like if the blocks surronding the banner is broken

#

the banner will still not break

silk mirage
#

ugh im yet to figure it out

#

i basically want to make "Floating Signs" but for banners

wet breach
# silk mirage Okay, is there anyway to make a banner "float"?

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

silk mirage
#

Is there anyway to track when a "banner" is dropped?

#

even during explostion or something

wet breach
#

item spawn event if the flag did not get destroyed.

silk mirage
#
    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);
wet breach
#

then it should be part of the destroyed blocks list from explosion event

silk mirage
#

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?

wet breach
#

I doubt it, but nott entirely sure. you can test it 🙂

silk mirage
#

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".

wet breach
#

try it out

silk mirage
#

okay i'll try this

kindred valley
#

there you go. I have some links for you.

#

?learnjava

undone axleBOT
#

For Beginners:

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

For Intermediate to Advanced Learners:

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

Practice and Hands-on Learning:

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

Free Resources and Documentation:

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

Community and Support:

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

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

chrome beacon
#

This is not a "learnjava" situation

clear elm
#

How can I remove the "Blaze"

lilac dagger
#

try different item flags

#

one of them could work

#

or create a spawner that's not blaze if that's possible

clear elm
clear elm
lilac dagger
#

hmm

#

actually i don't think it's this

clear elm
humble tulip
#

Did you try hide attributes?

clear elm
#

Yes

humble tulip
#

And hide potion effects?

mortal vortex
#

Yeah it’s ItemFlag#HIDE_POTION_EFFECTS

#

100%

clear elm
smoky anchor
#

You're on Paper aren't you

clear elm
#

no

humble tulip
#

Nah that’s latest spigot

humble tulip
clear elm
#

spigot 1.21.10

humble tulip
#

Not sure what it is

#

Lemme look through the flags

#

One sec

clear elm
#

thanks

mortal vortex
#

HIDE_ADDITIONAL_TOOLTIP

humble tulip
#

Try hide additional tooltip

#

Yup^^

clear elm
#

1sec

#

Thanks guys

#

it works

#

Also any ideas how I can remove the warning?

chrome beacon
clear elm
#

...

chrome beacon
#

It's clientside

clear elm
#

oh

chrome beacon
#

but it only shows for people who are op so it won't affect regular players

clear elm
#

Ah okay thanks

lilac dagger
mortal hare
#

i wonder how would bukkit api would look like if it had native support for reactive extensions

lilac dagger
#

what's a reactive extension?

mortal hare
#

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

lilac dagger
#

oh yeah

mortal hare
#

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

lilac dagger
#

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);

mortal hare
lilac dagger
#

you could make such a utility yourself if you like it more

mortal hare
#

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

lilac dagger
#

hmm

#

true

#

it'd be pretty modern

thorn isle
#

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

lilac dagger
#

i don't really understand programming when it comes to jit

#

so streams are slow?

wet breach
#

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

buoyant viper
#

pretty sure theyve gotten better over the years

wet breach
#

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.

mortal hare
#

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.

pseudo tapir
# young knoll Create a new `EntitySnapshot` from a `World` and use that
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. :/

sullen marlin
autumn zinc
#

What is better to use pluginInstance.getServer() or Bukkit.getServer() ?

buoyant viper
#

plugin, most likely?

#

sticking within the scope of what ur plugin is using 💪🏻🤞🏻

young knoll
#

Pretty sure the server instance is static

#

So it doesn’t really make a difference

pseudo tapir
# sullen marlin Snapshot won't be instance of axolotl. Check the methods in EntitySnapshot

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);
    }
}
ebon nexus
#

i am getting this error while trying to connect to mysql idk how to fix it i tried everything

mighty herald
#

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
chrome beacon
mighty herald
chrome beacon
#

M2_HOME is a very old name

#

MAVEN_HOME is what's used nowadays but BuildTools never got the update for that

silk mirage
#

I've been working as a SWE for more than 5 years

young knoll
#

Okay?

silk mirage
#

Hi jishuna

silk mirage
young knoll
#

If you only care about the item appearing

#

There’s an ItemSpawnEvent

silk mirage
#

I needed to get the underlying Presistent Data Container

young knoll
#

Of the block entity?

silk mirage
#

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.

young knoll
#

Ah yeah sadly you won’t be able to get the block if you just use the item spawn event

chrome beacon
#

It's still not a language issue 💀

thorn isle
#

lol

silk mirage
#

Ragebaits are insane

#

Alas this ragebait is more ragebaity then ones in linkedin

wet breach
ivory sleet
# mortal hare those observables would allow allow you to iterate through existing values and a...

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)

smoky anchor
#

Why is this troll still allowed to be here -_-

autumn zinc
#

Is it okay to use Plugin.getPlugin(Plugin.class) to get the plugin instance?

lilac dagger
#

should be fine

sly topaz
fickle spindle
#

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

pseudo hazel
#

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

slender elbow
#

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

fickle spindle
fickle spindle
pseudo hazel
#

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

fickle spindle
#

oh okay thank i thought there was something behind thanks

onyx fjord
echo basalt
#

Both owned by the same company

lilac dagger
#

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

thorn isle
#

futures get around this by distinguishing between accept and apply

lilac dagger
#

hmm

thorn isle
#

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

slender elbow
#

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

thorn isle
#

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

slender elbow
#

yeah I have no idea what you have in mind

thorn isle
#

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

slender elbow
#

you know you can just subclass CompletableFuture and override completeExceptionally

#

yes?

thorn isle
#

presumably, though most futures come about by the factory methods

#

i'm also not sure how that'll work with chaining

slender elbow
#

new MyFuture<>().completeAsync(task, executor)

#

newIncompleteFuture

#

completeAsync is a jdk method already so nothing to do on tha[ front

thorn isle
#

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

undone axleBOT
#

For Beginners:

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

For Intermediate to Advanced Learners:

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

Practice and Hands-on Learning:

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

Free Resources and Documentation:

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

Community and Support:

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

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

thorn isle
#

in what way specifically

ivory sleet
#

?ban @kindred valley repeated trolling

undone axleBOT
#

Done. That felt good.

smoky anchor
thorn isle
#

to be fair in this particular case it was a somewhat valid response

#

op did ask whether to use java or kotlin 🤡

ivory sleet
#

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

thorn isle
#

myes, and in-context it was pretty obvious that they were just doing the same thing they have been doing for a while

ivory sleet
#

yee

chrome beacon
#

They've been doing that trolling for years now

ivory sleet
#

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 :>

mortal hare
#

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

chrome beacon
mortal hare
#

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.

thorn isle
#

nosql is snake oil

mortal hare
#

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

mortal hare
#

apart from that yeah nosql is just bunch of snake oil tbh

thorn isle
#

for once we agree

lavish wing
#

Hello everyone!
Do someone have a copy of old md_5 repo? Please

chrome beacon
lavish wing
#

I have these

#

I need more

thorn isle
#

"all of them"

thorn isle
#

lol

lavish wing
#

@chrome beacon u were typing smthing

chrome beacon
#

Does that not just contain the vanilla jars

lavish wing
chrome beacon
#

Can just recreate them then

lavish wing
#

but where I can get bukkit mappings

chrome beacon
#

Time to do some digging on stash

#

I wasn't around back then so I'm not sure where they were stored

smoky anchor
#

\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

thorn isle
#

do it at runtime for maximum RCE potential

young knoll
#

Yay

smoky anchor
#

Great idea!
Ty for the help guys

#

oh maven just ignores the .git and .gitignore files when packaging
so all good ig

lilac dagger
#

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

thorn isle
#

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

lilac dagger
#

hmm, i do have a paper module

#

i might be able to cram this option in there if possible

thorn isle
#

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

lilac dagger
#

i don't think i'll shade in zstd in my plugins anytime soon

#

before ^

echo basalt
#

it's only 8mb fym

#

pterodactyl only starts getting shaky around the 30-50mb range

lilac dagger
#

it's still too much for me

#

i just send a simple json over a socket

#

1 megabyte maximum realistically

slender elbow
#

my mate's chat formatting plugin is like 60mb

#

grow up smh

young knoll
#

How much of that is a Bitcoin miner

slender elbow
#

none

thorn isle
#

shaded in gson (just in case) and apache math and probably all of netty on accident

slender elbow
#

it has, like, a few kotlin libraries

#

and a whole web framework

echo basalt
#

a plugin aint a real plugin if it doesnt shade spigot

shadow night
#

I once accidentally shaded the minecraft client in a fabric mod

#

I was like "huh why is the jar 100mb"

echo basalt
#

god move

shadow night
#

I thought it was like some sort of transitive dependencies or smth

#

turned out to be minecraft

#

happens Ig

fickle mantle
#

how do I get the PrimedTNT entity in the tntprimeevent?

worldly ingot
#

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()

umbral ridge
#

Choco you would be a good teacher uwu

sacred mountain
#

are unchecked casts fine as long as i know what im trying to do, or does that mean ive not following proper conventions