#help-development
1 messages · Page 1300 of 1
okay
it is important because you can't send a login plugin message after the login process
Its Block#getBlockData().getMaterial().isInteractable() reliable to disable interaction with blocks, or would be better to have list of intractable materials? I want players still be able to place block but not interact with anything.
Does setting useInteractedBlock to deny in the interact event also disable placing?
I will check if that clicked block is interactable, not item/block in player hand. It will be disabled anyway. For example if you right click chest you are not placing what ever block you are holding
don't ask me lol
Where can I find the non-obfuscated 1.21.8 nms mappings?
Fella Plugin Creators, if you see this dm me!
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/
?ask
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!
have you looked into https://github.com/Tofaa2/EntityLib
just skimped the readme, doesn't look as fancy as ClientEntities but does the job ig
lol
I also really confused by that repository
idk how maintained cliententities is, you suggested its not, but entitylib is more popular
why is there a discord bot there
turns out it just has lots of integrations
wtf is that supposed to mean
the discord bot is just the bot for their discord server, the blockbench folder is a blockbench addon for the lib
I hate monorepos
Simply reaching out to creators to talk to them
you can talk here
as long as it's dev related
as for dm's about non dev related things, i doubt anyone is going to slide into your dms from here to share their life story or whatever you're after
I have this Velocity plugin code that sends a packet to my Fabric mod:
public void onLogin(LoginEvent event) {
WrapperLoginServerPluginRequest request = new WrapperLoginServerPluginRequest(1, CHANNEL, new byte[0]);
logger.info("Sending token request to player " + event.getPlayer().getUsername());
PacketEvents.getAPI().getPlayerManager().sendPacket(event.getPlayer(), request);
}```
The mod receives it:
```ClientLoginNetworking.registerGlobalReceiver(HANDSHAKE_CHANNEL, this::handleHandshake);
private CompletableFuture<PacketByteBuf> handleHandshake(
MinecraftClient client,
ClientLoginNetworkHandler handler,
PacketByteBuf buf,
Consumer<ChannelFutureListener> responseSender) {
try (FileReader reader = new FileReader(TOKEN_FILE)) {
String token = readToken(reader);
PacketByteBuf responseBuf = prepareTokenResponse(token);
return CompletableFuture.completedFuture(responseBuf);
} catch (IOException e) {
LOGGER.error("Error reading token", e);
return CompletableFuture.failedFuture(e);
}
}```
buf structure:
``` private PacketByteBuf prepareTokenResponse(String token) {
PacketByteBuf buf = new PacketByteBuf(Unpooled.buffer());
if (token.isEmpty()) {
buf.writeInt(0);
} else {
buf.writeInt(1);
byte[] tokenBytes = token.getBytes(StandardCharsets.UTF_8);
buf.writeInt(tokenBytes.length);
buf.writeBytes(tokenBytes);
}
return buf;
}```
But I don't understand how to receive the response from the client mod in my plugin.
Add a listener on PluginMessageEvent
Why are you asking this again
you've already been answered
Use the API
and move to the Paper discord for further questions
since this is the discord for Spigot and Bungeecord
Is it safe to use a plugin that has spigot 1.21.8 nms shaded into it on a 1.21.7 server?
From what I've seen, all of the mappings I use are unchanged between the two versions
try it
spigot plugin
:D
if there is its really big lmao
a single line has a 256 character limit
pretty sure total lines would be 256 as well
you got it mixed up
there is a 256 limit for the total amount of lines, not characters
isnt there a line limit
i'm sure there is, but it's probably beyond anything that'd be practical to render on the screen anyway
yeah excatly
looks like it's measured in terms of the nbt length of the component and defaults to 2097152, presumably in bytes
there's also a max component length constant somewhere set to 262144
Yeah at some point you’ll overload the networking system
Especially if it’s a packet that has multiple items with big lore together (not sure if such a thing exists)
i think the old inventory click packet was like that, for drag events
now it's a list of HashedItemStack which is i think lighter
yeah it's just a funny hashcode
she hash on my item till i stack
What about the window items packet
yeah but that's just a List<ItemStack> network codec
they are still individually encoded
Ah
I thought the entire packet could run into a limit if you had a full chest of items with huge lore
yeah there is a limit for how big any one individual packet can be
i don't remember what it was but isn't that how the typical chunk ban or whatever works? give someone shulkers full of written books and stuff
Maybe? I figured the server would refuse to send it if it knows it’s too big for the client
Seems weird to kick the client
Just put them in the empty void of nothingness! Much more fun
brain fart that ill test later but does UUID#fromString care if the string has hyphen separators or not?
oh hi @tender shard lol
im also having issues w recaf rn LOL
my fault i was using an old launcher version woops
yes
recaf launcher
failed to launch recaf
YOU ONLY HAD ONE JOB
Sadly it doesn’t accept strings without the -
D:
user issue
i was running an outdated launcher that doesnt limit the version for JFX, bc apparently its kinda broken
runtime event trace toggling 😄
That cause could do with some formatting
Yeah, I was being lazy
That raw info would be displayed when you click a particular event though, otherwise a summed up format is in order ofc
Oh weird, it gets the data of the block post event if you will... should be stone but it's shown as air
does it show who cancelled it and a stacktrace of when
or is it literally an event logger
I asked a staff and I have got permission :D
Rn it just logs and shows basic information
Good idea tho
Hey yall
Im making a graves plugin
I have everything ready
I just wanted to know
That
How can i make it
So
The grave chest block
is shown as a grave texture
Without making a resource pack
and overriding another block's texture
you'll have to mess around with block displays
So, just overwrite the chest's texture but not all chests
Okay, elaborate please
not much to elaborate, you'll have to use many block displays to make a grave. It won't actually be a chest because therse no way of overriding the chest's texture with vanilla
just put a barrier, listen for player interact and open a menu
Ohh i have already researched that way too haha
I was just wondering
If theres a way
to either make the chest invisible
but still interactable
and place a custom block over it
or either
a way to overwrite the chest's texture with custom metdata
Okay
But with the resource pack
Im not against the resource pack yk
But
Im just afraid
that it will make all chests the grave texture
which we dont want
Basically what i want is
The chest with a specific metadata
to be shown as a grave
I dont mind if its a resource pack
@drowsy helm
yeah dont think thats possible
Can we talk in dms rq
I have a few ideas id like to discuss regarding this
That i researched
you can discuss it here
Alright
So basically
- Was the resource pack but then it'd overwrite all chests
2nd. Was a unused/custom block, but then i'd have to make a custom inventory which is just wayy too timetaking as of now
So
Is there any work around you can suggest for this?
I was trying to use custom model data
but turns out
when you overwrite the textures using custommodeldata
it still places as its original
model texture
and i couldnt find a workaround
yeah chests on the ground dont have custom model data
yeah
you're going to have to do a custom inventory solution any way you do it if you don't want to use a chest
Im gonna try to go into mcreator and see if that has something
Oh, alright. Thank you for your help
we do something like this at work
it looks fucking awful tho because MEG is shit
and I think our model is backwards
hello everyone! I've been trying to implement custom auth via a token (fabric client and spigot), but nothing works.. I've tried sendPluginMessage (nothing appears on the client), protocollib with custompayload (complains that there's no strings or minecraftkeys - how do I set a channel?), what's the best way to do that? I can't find practically any documentation on plugin messaging
Did you register the plugin messaging channel?
yes, both outgoing for request and incoming for reply
Cool
chat should I block him
idk 💔
What have you got so far
I'll send snippets rn rq
Also I'm under the impression you're using different channels for different data types?
yeah, I never worked with modern networking, only on beta 1.7, so idrk how this works
registering channels in onenable
getServer().getMessenger().registerIncomingPluginChannel(this, "geckex:auth", ah);
getServer().getMessenger().registerOutgoingPluginChannel(this, "geckex:authrequest");
ah is AuthHandler
Right so in that case you're saying the server will RECEIVE data on the auth channel and send it through authrequest
and here's the authhandler (yes, i did register events)
@EventHandler public void onJoin(PlayerJoinEvent e) {
Player p = e.getPlayer();
p.sendPluginMessage(plugin, "geckex:authrequest", new byte[0]);
}
that's what i want, yeah
please use proper naming 🙏
it's empty because it's just a way to signal fabric mod to send back token on auth channel
wdym?
Check pins and scroll down a lil
Ah ok i see
just an old habit of working with bukkit haha
here's whats on fabric
void init()
PayloadTypeRegistry.playS2C().register(Payload_AuthRequest.ID, Payload_AuthRequest.CODEC);
PayloadTypeRegistry.playC2S().register(Payload_AuthResponse.ID, Payload_AuthResponse.CODEC);
handler = new PlayPayloadHandler<Payload_AuthRequest>() {
@Override
public void receive(Payload_AuthRequest payload, ClientPlayNetworking.Context context) {
context.client().player.sendMessage(Text.literal("Got authrequest"), false);
ClientPlayNetworking.send(new Payload_AuthResponse(System.getProperties().getProperty("beeshield.token")));
}
};
ClientPlayNetworking.registerGlobalReceiver(Payload_AuthRequest.ID, handler);
}
and the request/response:
public record Payload_AuthRequest() implements CustomPayload {
public static final Identifier CHANNEL_ID = Identifier.of("geckex", "authrequest");
public static final Id<Payload_AuthRequest> ID = new Id<>(CHANNEL_ID);
public static final PacketCodec<RegistryByteBuf, Payload_AuthRequest> CODEC = PacketCodec.unit(new Payload_AuthRequest());
@Override
public @NotNull Id<? extends CustomPayload> getId() {
return ID;
}
}
public record Payload_AuthResponse(String token) implements CustomPayload {
public static final Identifier CHANNEL_ID = Identifier.of("geckex", "auth");
public static final Id<Payload_AuthResponse> ID = new Id<>(CHANNEL_ID);
public static final PacketCodec<RegistryByteBuf, Payload_AuthResponse> CODEC = PacketCodec.tuple(PacketCodecs.STRING, Payload_AuthResponse::token, Payload_AuthResponse::new);
@Override
public @NotNull Id<? extends CustomPayload> getId() {
return ID;
}
}
i'm calling the init in onInitialize in ModInitializer
underscore in the class name is diabolical work
i've thought of modifying login packet to include the token, but didn't want to get into that yet, i would have to modify bukkit server too then (or do heavy fuckery)
this is temporary i swear i'm not that bad 😭 🙏
also basically 0 documentation about this on fabric docs, one singular example snippet and that's it
I'm under the impression he's registering his own packets instead of payloads
not sure yet
(again, i have no experience on modern networking, so forgive me)
Are you receiving the request on the server?
fabric "packets" are custompayload, they just look strange bc of what fabric makes u do i guess
No, I send response only when I get the request packet, and server's handler is not getting hit
I'd say
just rip this
aha
so i had to tweak some stuff here and there to clientplaynetworking for example
haven't fucked around with fabric in a while but your bukkit code is "fine"
i will clean it up when i get it working i promise
just tried to send a single byte, still nothing
can someone help me with finding code? all i see is .java files called IIIIIIII
Looks like you're trying to decompile an obfuscated plugin
im sorry what does that mean?
someone put in effort to make sure you can't decompile / reverse-engineer the plugin
nothing's impossible it's just impractical
is there a way to deobfuscu something it
well you can manually change names back to something legible thru something like enigma
(given that logic is intact and not obfuscated, so you can make sense out of whatevers there)
so is there anything i can do? i just need to communicate between fabric and bukkit
any idea why i always have to manually import Latest version of spigot?
1.21.8 will get imported correctly when a new version is released, but now then its the latest? no
(this project is not mine so its on maven, but the latest spigot its always the same on maven)
What
because it's not already cached on your system so Intellij can't detect it
also I have no idea why you've changed the group id
whe previous ones wasn't cached either, this is the only maven project i have
to import multiple spigot imports? thats what the project it self said
You should be using multiple modules
say hello to MTVehicles which it was and still it is a pain
i'll build and import the latest one manually then
how can i get the display name of a Material in a specific language?
for example
BREAD would give me Pain
you can't, the server only ships en_us
doing the annotation in the same line is a crime
have you tried gluten free bread instead
spigot and spigot-api are different
spigot is build with BT and cached in mavenlocal
and sometimes illegally distributed through other maven repos like <REDACTED>MC and some others
heck I have a private repo with some folia devbuilds and other goodies myself
Also what's with the ......
he was thinking about it
help me
no
nah
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!
hmm, lemme try that
I have never heard of the dot thing, sounds like a fun hack
oh. fu-
no workaround?
except ofcourse manually making a config file with the translated name of each material
why are you trying to translate it manually
first of all, THE CODE IS NOT MINE xd (https://github.com/MTVehicles/MinetopiaVehicles)
seems it needs spigot
typically you create a translatable component and then have the client translate it to the correct locale
that works too, how would i go about doing that?
depends on the context in which you are trying to display the text
what in the
in an inventory
with adventure, you create one with Component.translatable(translation key), you can get the translation key from an itemstack/block
i don't remember how bungee components on spigot work anymore since it's been too many years since i last used them
my favorite hack is softdepending on zZZZzZZzZzZ so your plugin initializes last without depending on "first-tick" stuff
depends on how you do it
i basically wanna return the display name of a material i choose through a papi placeholder
now i could do this easily IF i was allowed to do it in only en_us
but its in another language
still using this master peace to build spigot xd
so you choose the material with the placeholder?
papi doesn't support components afaik
but you can run the result through minimessage elsewhere
1_21_R5 is 1.21.7/8
the code chooses what material
the placeholder is just a placeholder
it doesn't directly, but yeah minimessage works
yea i'm building the versions i want to use one by one
already build 21.8
ima be real, never used minimessage
how would i do this?
i don't remember
basically minimessage is a string format that supports defining components with like <hover> and <translatable> tags, which you'll need to use since papi works with strings rather than components
so you take your raw string, parse it through papi, then parse it with minimessage into components
and then you shove the components in the item lore or send them in chat or whatever
pretty sure kyori also has a translation thing where you can use the player's locale
that way you skip translatable components entirely and decode them on the server
as long as the server has access to the lang data
he's just very dramatic
i'm going to take a wild guess and say that the PlayerJoinEvent is called before the client sends the channel registration request, on the server the earliest you can send a payload for any given channel is for the respective channel's PlayerRegisterChannelEvent
instead of sending in the join event, send in the other event i suggested, making sure the event is being called for the channel you are registering (auth or whatever)
yes
Its not my code / project, i was just trying to get it to work
😭
Also i dont know much about maven
What does that work? That's kind of a big brain move (if not profoundly stupid) lol
a big brain move to improperly structure your project yes
how does that work with so many duplicate classes on the classpath?
That's why I also said profoundly stupid 
anyone can give me an idea for make a pluin
steal a brainrot
grow a garden
a plugin of steal a brainrot?
yeah
Tell me something else like what you want me to do
Roblox unironically is probably a good place to find inspiration
bomb your neighbor (in minecraft)
yeah even
roblox steals from steam
minrcraft steals from roblox
ez
Cheap or free ah plugin that comes with bedrock and Java support that gets consistent updates (is like none of these/very few)
I'm sure is plenty of people willing to pay 5,10 prob even 20$ for it
15$
but I still can't publish a paid plugin
ok
why would an ah plugin need consistent updates
seems like a pretty feature complete concept, no?
you put things up for sale and people can buy them
you could probably write one against 1.8 and have it work on 1.21.8
noo way
"bump version"
lmao
peak me
What would be the best way to disable a specific item from being crafted?
anyone is bedrock for taste mi plugin
Let me taste your plugin
Can everyone help me with my plugin
package de.WombedCone.minecraftServerPlugin;
import de.WombedCone.minecraftServerPlugin.commands.testCommand;
import org.bukkit.plugin.java.JavaPlugin;
public final class MinecraftServerPlugin extends JavaPlugin {
@Override
public void onEnable() {
// Registrierung des Befehls
if (getCommand("testCommand") != null) {
getCommand("testCommand").setExecutor(new testCommand());
getLogger().info("testCommand erfolgreich registriert.");
} else {
getLogger().warning("Fehler: testCommand wurde nicht in plugin.yml gefunden!");
}
}
@Override
public void onDisable() {
getLogger().info("MinecraftServerPlugin wurde deaktiviert.");
}
}
name: Minecraft Server Plugin
version: '1.0-SNAPSHOT'
main: de.WombedCone.minecraftServerPlugin.MinecraftServerPlugin
api-version: '1.21'
commands:
testCommand:
description: Ein Test
aliases:
- test
permissions:
Test:
description: Erlaubt Zugriff auf den testCommand
default: op
package de.WombedCone.minecraftServerPlugin.commands;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
public class testCommand implements CommandExecutor {
@Override
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
if (sender.hasPermission("test")) {
sender.sendMessage("§aDas ist ein zweiter Test");
} else {
sender.sendMessage("§cDu darfst das nicht tun.");
}
return true;
}
}
ich wollte nur mal testen zu programieren
und es funktioniert nichts
?paste
We have it for a reason
what do you need help with specifically
Thanks!
do we do == or equals to check if 2 inventories are the same? cause i think they have to be the same object
They should be referentially comparable, but if you're ever unsure, there's no real harm in calling equals()
Except an NPE I guess lol
Objects.equals
okay so its better to use == ?
if you want to make sure it's the same object, sure
i guess i do
otherwise equals is always the better option
i wanna check if the inventory is a gui, so i can cancell event, but im not sure if this can be 2 objects but same inventory
if you know what imean
this uses equals for example https://www.spigotmc.org/wiki/creating-a-gui-inventory/
who the hell decided that this is a good idea
"Im gonna waste hours in debugging because i wont tell you what broke" ahh moment
i hate visual studio
ofc it was a caching issue in visual studio
because WHY WONT THE CLEAN AND REBUILD OPTION WONT CLEAR THE CACHE
who would have thought that it would clean the project
What are you doing in visual studio
including the cache
im forced to use it for x++
i'd have to say it was the worst experience i ever had in programming
x++?
Is that like some weird language made by Elon musk
for dynamics 365
the tooling for is like made out of twigs
it barely works
and always throws errors even if you didnt do anything wrong
for example i had to edit xml file manually because visual studio has a bug where regenerating it doesnt append parameters properly
that's how awful it is
The heck is dynamics 365
i thought i've seen everything ,but then i saw x++ ecosystem and it was new low for me
legacy axapta ported to webclient that's now rebranded as dynamics 365 finance & operations
its ERP system basically
its slow, lacks basic functionality, tooling for it is awful
i cant see a single reason i would use it
So why are you forced to use it
work related
Some company that never migrated after 20 years?
nope. im talking about modern stack
that's the modern stack im describing of Dynamics/Axapta
its awful
I assume the old one was just chalk on a slate
its like getting segfaults everywhere but its not that you cause it but some weird visual studio bug does it
and you're the bug hunter for bugs which caused visual studio xml generators for that system
there's no LSP for it in visual studio code, it there was i would never use that pile of crap
the worst i've seen is that you need to use visual basic to generate reports for certain records
and its ok, its legacy right, its understandable
but then you realize that that sometimes it deletes the whole design from the project for no apprarent reason if it fails to load it
and now you have to redo the design all over again just because visual studio craps itself
and this is why, if something works you probably shouldn't change it
all of tech which d365 f&scm uses is kinda legacy in a way but with new layer of paint (GUI was ported from desktop app to web UI which is kinda awesome)
buttt.... i would expect legacy components be stable as a rock (backend stuff)
yet its either visual studio which is buggy or the build tools for it
Just saw today that the bungee TextComponent is depreciated, I almost never need to use it, does this mean that spigot is getting Adventure as a replacement?
Ur using the paper api aren’t you
No, but I am trying to send players rich text on Spigot, Paper and Folia.
Well I assure you it’s not deprecated
I see, loaded another project, still getting used to Intellij switched from eclipse. Good I don't have to relearn how to do components. whew.
are you using paper?
no, but i am using paper
mfw
but yeah Paper+Folia might just complain bc it recommends u use Adventure, but until they hard break their API ur basically fine using Bungee components
@sullen marlin Can we talk privately? I would like to talk to you about trying to contribute more too the SpigotMC project and its infrastructure.
I have alot of unused equipment and 10 static ip addresses.
been here for 9 and 1/2 years now.
I am quite invested in this marketplace and its future.
Hi
Hey guys
I will be done with my graves plugin today
Just adding polishes
Anyone who'd be down to help me find bugs in the plugin and test it?
DM
I could swear I have read a message like this before
If at first you don't succeed, try try again.
i might be wrong but i think spigot infra is already subsidised by a sponsor\
and not to throw a shot at you, but nothing in your website really shows that you're a reputable host
how much time it takes?
5-7 years
what are the prerequisites for using api provided by another plugin, just setting as a [soft]depend in your plugin.yml, and the Plugin classloader will do the rest?
Yep
going to try my best to prevent cyclic dependencies, but how are those handled?
iirc i know a cyclic hard depend just fails
but i remember reading somewhere recently that cyclic softdepends are "handled arbitrarily"
iam dead :e
for paper plugins yes; for bukkit plugins it is arbitrary
hey i want to make a plugin for 1.21.1 and i have coded it .zip can someone tell me how to make it be .jar?
I assume you vibe coded it
as you've been answered in general you can use maven or gradle
Change the extension from zip to jar
I'm going to assume they just zipped the .java files
Good enough
Let me tell you about graalvm
when i set the display name of an itemstack, it makes that name italics
how can i remove the italics?
&r in front?
yes its because when you name an item in an anvil its italic so people know its different from the underlying name
Pretty much
that's so cool
Back before we had components and all that fancy stuff
1.6? :p
1.4
When you retexture an elytra, the texture curves at the edges, not to mention that it needs to be in a very specific location to even render
Does anyone know how you could render some bigger elytra texture that does not curve on the edges?
?? really?
wtf
is that really? lol
They are the same thing
really?
Like 4 people told you so already
a jar is just a zip, the format is the same
omg
but a jar of course needs to have the correct things in it to function as a plugin
which, if you vibecoded it and it's like .txt and .java files, is not what'll happen
I thought we needed a meaven to assemble and build it.
that is preferred, but just compiling .java files through javac into .class files and then zipping them up works as well
it's just a lot more effort to do that, so maven is used to automate the process
so i still would recommend you look up how to set up maven and gradle and use that to build
changing the texture won't be enough, you'll have to change the model to have a different transformation, specifically scale
i think that should be possible with modern versions; it used to be that equipped item models, like armor or elytra, weren't remodelable/texturable with custommodeldata
but i vaguely remember support being added for that in i think 1.21
Ah
I see what you mean
So basically creating a high resolution elytra texture and put my own texture on the part that's always rendered flat
And just increase the scale somewhere
I wonder, will minecraft pixelate it or does it not do any bs and just renders the vertices as they are?
vertices are a model thing, pixels are a texture thing
I am aware
you can't pixelate vertices
can you rephrase your question
Basically elytras
They render the major part of them on a flat surface
However, if you texture goes beyond a certain point
It will become 3d
As in: the texture will wrap around a 3d block
However, this seems to be correspondent to specific parts of the elytra texture
Some won't render at all
different portions of the texture are UV mapped to different faces of the model
this should work the same say as upscaling regular block textures does
Now I want to render wings, which should be only on a flat surface to look good
my recommendation would almost be to get one off of mcmarket to get your hands on a wings model, or make one in blockbench
the standard elytra model won't do
it has a fixed shape and size and changing the texture only changes what colors that shape look like
Yeah I know
But you can just put the texture on only one face
(altough not sure where that is)
No wiki on that
Since I need to make it look "flat"
Just having trouble getting it right, since it seems to often get into the other faces at the edges
And when made smaller, it just intersects with itself when rendered for some reason, and well, is smaller, much less noticeable
are you trying to make the wings appear visibly larger ingame than the vanilla elytra is?
Nope
smaller?
you just want them to be higher resolution?
Well bigger and not intersecting
Since resolution can be probably solved by just using a higher multiple of the 2:1 ratio of the elytra texture for the canvas
if you want them to be larger, you have to change the model
same if you want to change the shape otherwise, i.e. make them not intersect
i can't find the specific model in the assets with a quick search, you might be better off asking in some modeling discord like blockbench
or mythicmobs, but they will probably tell you to buy one of their 500 copy-paste $25 wing asset packs
Blockbench it is
how can i go about supporting color codes like #ffe400
minimessage
how exactly?
Components
either with ur own way of formatting it, or with a prebaked solution like MiniMessage like others mentioned
minimessage is quickly becoming the new industry standard
i really advise against a homebrew solution of parsing it yourself
so i have a component now, which i got from #deserialize()-ing a string with a color tag
now how would i use this component to set the name of an item, or to send this message to a player
besides gradients and "actionable" components (hover, click) i support mm-esque formatting :p
For sending a message to a player you can use adventure platform
Bukkit
if you mean the § thing, yeah, though you'd probably want to regex the #rrggbb into that so the end user doesn't have to deal with the §s
For an item name, either NMS or just use the legacy serializer to go back to a string
i would've just uh
how the heck does it get the color from the hex
Components handle that magic for me internally lol
i just supply spigot with the String format it expects
so how exactly am i support to use this
done replaceAll with (?i)#([a-f,0-9])([a-f,0-9])([a-f,0-9])([a-f,0-9])([a-f,0-9])([a-f,0-9]) and §$1§$2§$3§$4§$5§$6
i have to turn the string i get into a component?
But that’s not a compiled regex!!!!111
idk how regex actually performs in java actually
yeah, i have an unpushed commit that cleans it up with regex instead of the manual by-char handling i do there
the strinbuilder scan method might be more efficient
I found one that actually compiles the regex to a pattern a while ago
Don’t remember where it was, somewhere on the forums
i mean you can just toss that into a Pattern.compile and then do new Matcher(str).replaceAll() or something
String::replaceAll is just api sugar for matcher anyway
@buoyant viper what exactly do you do with the output of #convertHexTags to make it work?
you pass the string to one of the spigot methods that handle color codes
I think this was it
Doh that doesn’t link to the exact reply
myeah that's how you'd do it
those matcher methods were the best thing added in java 9
so the string that method gives me is formatted in a way that i can just use it straight up?
public String translateHexColorCodes(String startTag, String endTag, String message)
{
final Pattern hexPattern = Pattern.compile(startTag + "([A-Fa-f0-9]{6})" + endTag);
Matcher matcher = hexPattern.matcher(message);
StringBuffer buffer = new StringBuffer(message.length() + 4 * 8);
while (matcher.find())
{
String group = matcher.group(1);
matcher.appendReplacement(buffer, COLOR_CHAR + "x"
+ COLOR_CHAR + group.charAt(0) + COLOR_CHAR + group.charAt(1)
+ COLOR_CHAR + group.charAt(2) + COLOR_CHAR + group.charAt(3)
+ COLOR_CHAR + group.charAt(4) + COLOR_CHAR + group.charAt(5)
);
}
return matcher.appendTail(buffer).toString();
}```
Though you should move the pattern to a static field
this is roughly what my new method looks like
or no that doesn't use the new java 9 methods
but with the regex pattern being a constant yeah
that uses the old ugly java 8 while find
The method itself should probably be static too
Also isn’t StringBuffer the fancy threadsafe one
StringBuffer in the big 2025
Ye
Should be a StringBuilder
oops mention, sos
yeah
Technically it’s in the big 2020
And we all know that year was a mess, so the code fits
public String translateHexColorCodes(String startTag, String endTag, String message) {
final Pattern hexPattern = Pattern.compile(startTag + "([A-Fa-f0-9]{6})" + endTag);
Matcher matcher = hexPattern.matcher(message);
return matcher.replaceAll((MatchResult match) -> {
var group = match.group();
return COLOR_CHAR + "x"
+ COLOR_CHAR + group.charAt(0) + COLOR_CHAR + group.charAt(1)
+ COLOR_CHAR + group.charAt(2) + COLOR_CHAR + group.charAt(3)
+ COLOR_CHAR + group.charAt(4) + COLOR_CHAR + group.charAt(5);
})
}
tldr; just use minimessage
i just have a custom solution because i hate myself and reinvent the wheel
But minimessage has to parse it to a component and then back to a string!!!!111
Muh cpu cycles
private final static char COLOR_CHAR = '§';
private static final Pattern HEX_PATTERN = Pattern.compile("<#([A-Fa-f0-9]{6})>");
public static String color(String message) {
return HEX_PATTERN.matcher(message).replaceAll(mr -> {
var hex = mr.group(1);
var sb = new StringBuilder(COLOR_CHAR + "x");
for (char c : hex.toCharArray())
sb.append(COLOR_CHAR).append(c);
return sb.toString();
});
}
now ur creating a new array no?
this may be almost exactly what mine is, minus directly using .replaceAll there
i don't think you need an extra stringbuilder here
the group(1) in place of group() is correct
I mean, it is the same thing except you're using the + symbol instead of an explicit string builder
but it gets translated down to a string builder anyway
mmm i don't think it does anymore
it was in like java 9 or 16 or something that string joins were optimized a bit
it tries to estimate the length ahead of time now and does it all with just a single string construct if it can
in this case the length can be determined ahead of time since the joined bits are all either string constants or char primitives
I don't think that would impose any performance issues tho
if we're counting allocations and shit the while find stringbuilder is probably the most efficient approach (replaceall still needs to splice together a bunch of strings), but this is a bit less verbose
I do wonder whether it gets optimized away
Ye definitely
you can get rid of the array clone with the String::chars iterator i think
Does compiler explorer have a JITted Java output? lol
it might get optimized away by jit yeah
seems like a viable case for escape analysis maybe
looking at how shit gets jit'd is a bit more complicated than bytecode since it depends on runtime heuristics
you usually just run the program with a benchmark with the some arcane jit debugging flags on that i don't remember that dump the c1 and c2 compiled code and display inlining info and shit
There is no possible way a color message method is called enough times that it gets optimized out but I do wonder
and then you look at it with some assembly viewer
i last did this a few years back when trying to optimize server AABB allocations and i was like blackout drunk so i don't quite remember the process anymore
all i remember is that i'm very disappointed in jit escape analysis
almost every allocation of AABB could be eliminated with competent escape analysis, but jit gives up because there are like 50 nested overloads on the AABB resize methods, so they can't be inlined
i'll eventually maybe try submitting a pr to paper that straightens out the overloads directly into the ctor
Tbf that is not something a JIT would take care of
They need to be fast, and escape analysis of that level is probably not
i mean it would work if jit would inline the entire call
but it goes over the default instruction length for inlining
it works fine when you crank it up to like 10x
but that has other issues
I wish we had compiler intrinsics in Java
That way we could just hint the jit to in-line stuff as necessary
there's @ForceInline but it's restricted for internal jvm classes only
because regular java devs can't have nice things
what do you mean you want more control over your code and how it runs? no, fuck you, also we're getting rid of unsafe because fuck you
you could accidentally BREAK SOMETHING if we let you use these things
They do treat us pleb Java devs like babies
Then there’s languages like Nim which just let you do whatever you want
whats wrong with the new gpt
on august 2nd new EU laws kick into action that start regulating ai companies
its pretty smart if u ask me
depends how u ask it though
like if u just say code me a plugin ur just stupider than the ai 🙏
whats the law
starting tomorrow any new models that come out have to say where they trained from
so models are trying to do a big last push in the next 24h
seemingly the idea would be to have gpt 5 out before the new deadline hits
neat
there's other stuff as well but that's probably the biggest immediate change
much funnier is how they're fighting against microsoft
they have a contract with microsoft where microsoft has a bunch of rights and owns 49% of their business but only until openai achieves AGI
@lost matrix remind me, did you have some sort of distributed map that would do instant reads/writes to a local cache with eventual replication?
I highly doubt they have gpt 5 ready
I need something with instant reads, eventual writes and distributed
so now microsoft is already saying gpt 5 is kinda bad while altman is out there claiming it's literally going to destroy all of human civilization the moment it comeso ut
and if they launch, it si gonna be the most mid launch ever
TTL etc are nice-to-haves
it's just very, very funny
honestly the main thing I want is just for them to slash api costs by a lot so other providers do the same, api prices are still way too high
it's going to be another nothingburger i'm sure
eh I mean it'll probably just be a bit better
I don't find any of the gpt models to be better than claude right now
maybe it'll meet claude, or maybe beat it by a bit
I did hear they are finally doing 1 million context size though which is nice
that sounds like you want Hazelcast
I mean google has been doing 2 million for months but it's still nice
Does Hazelcast populate the map on startup?
if you agree to share traffic with them they give you something like 10m free daily tokens, and you can enable it for specific projects so you can do both
trying to do guilds with claims without having to worry about latency
you can configure it to, but it isn't the default
i use it for the deep research models because i don't really care if openai trains their shit on the specific bearing sizes or spare part specs i'm trying to find online
and it saves me lots of money because the deep research models eat up tokens like crazy
My AI's suggesting this
how does eventual replication with instant writes work
I don't care about instant writes
what if two parties write a value to the same key
they can have locks idm
in short I need instant read access to "loaded guilds" across the entire network, can do async / locked writes and once a guild becomes unloaded it gets removed from the maps and yeeted into the db
I have a map that synchronizes local caches between several instances.
Its using redis. Want me to send it?
if you're already using redis then LocalCachedMap is probably your best bet
I don't see why I should care if whoever trains their models on my code honestly
problem with LocalCachedMap is that the data is only cached when it gets hit
Let me document it real quick
yeah, if anything, it just means the next model might be marginally better at what i'm trying to do
the AI solution could work
where it just gets every key and calls get
for shits n giggles
but if you use it to like process personal information of other people it might be illegal or something
I know it trained on my data because there's some specific patterns I do it recognizes really well
I love putting static classes as listeners inside of other classes
I don't know really anyone else does that but the ai definitely sees it coming when I start typing it
it is gonna populate the map eagerly, however you'll have to put in a strict cache eviction rule in order for that to not get stale
it can get stale idm
out of curiosity, what is this for
inb4 1.8 cannon factions
are those still popular
I can't remember the last time I have seen one
I wonder why
you're right, we should ban you here as well
maybe a mod can wake up and deal with that
i think i implemented this myself a while ago for generic network-wide player data, like nsfw filter toggle status
@young knoll maybe you wanna take a look at this
though it was a sort of homebrew solution on top of rabbitmq rather than redis, because i don't like redis
but redis is probably the more appropriate tool
I don't think anyone actually likes redis anymore
or well, valkey now
it seems like it's a jack of all trades and kind of shit at them all
I jiat realized making feature flags with it becomes effortless
were they ever?
i remember there being two or three big ones
but they all went bankrupt
they come and go
i don't think it's any less popular than like say towny, just setting up a good rpg server that's worth playing takes way more money and effort than the alternatives
so they all go bankrupt and run out of manpower in like a year
even if you make a good rpg experience, they all end at some point
unless someone starts working on a WoW type beat in minecraft which you'd have to be insane to try

at some point you have just reached the end of the experience
if it isn't super massive you can probably churn through new players as old ones leave, rather than try keeping up with new content
a new one is born every minute
sure
there's some servers out there that kinda do it but they don't tend to stay in the zeitgeist for long
even if it's new to someone, it no longer is news
if HP Skyblock could get popular with MMORPG-like features, I am pretty sure other gamemodes could as well
well yeah i don't think churning through players and staying hip with the mainstream are mutually compatible
or god knows
the mainstream seems dumber and dumber every year
that literally looks like you reinvented RLocalCachedMap
is that still a thing, I was amazed that got any popularity
it seems to be more popular than ever
I never got the concept right, is it just like, mining? Lol
With the exception that it provides computation methods that utilize RLocks to lock down states while they are being modified by one of the cache holders.
I'd take an incremental game over a gacha game any day of my life
it has evolved to "dungeon" servers where instead of generating things you auto-attack progressively more damage-spongey mobs that stand still and don't fight back, for incremental weapon upgrades
I love gacha, I am sadly too poor to actually enjoy it though
i.e. stand in place and pick a new mob to auto-attack once a minute or so as the old one dies
that's just poor execution on a concept that could work
they're all like this, this is the mainstream execution
i think because it's functionally just a reskin of the already popular generator/idle bullshit
making it actually a game would defeat the point
so like, vampire survivors but in minecraft
or holocure
you can make something like that fun imo, you just have to do it right
is that some mobile game i'm too old to know about
even if it's autofarming mobs
Looks dope, only improvement I'd make for it would be adding update / removal listeners
vampire survivors is a whole genre on steam now, and a pretty wildly popular one at that
it autoattacks and you just pick from upgrades while dodging enemies
in a sense you could see it as a spiritual successor to those 2d space shooter games
a lot of those also just always had guns shooting
Yeah probably a good idea. The methods are there anyways, and adding just a List<BiConsumer<K, V>> is not a huge problem 😄
Ill add that right now actually.
And maybe some configuration system where I can pass a default executor or something
really vampire survivors is just a bullet hell game where you have to pick your powerups as you go
I wouldn't mind turning this into a full library with sets and other collection types
man I really am putting off working on my resourpack pack hosting ysstem
fml
I should get back to that
I went down that rabbit hole. A little bit like an ODM.
Imagine you could use mongoDB with a simple Map<K, V> interface. Or Files.
This makes my persistance trivial.
I wouldn't take it as far as hooking into mongo or whatever
HoloCure is the highest rated free to play game in steam, and it is essentially vampire survivors but vtubers instead of vampires
just something with configs and whatever else
maybe something that implemented Map instead of just a couple methods
Done. That felt good.
Crap that wasn’t a softban
lol
also line 56 could be reworked to invoke loadFullRemoteState
private final Map<String, SomeData> localMap;
private final Map<String, SomeData> mongoMap;
public SomeClass(MongoDBDataHandlerFactory mongoFactory) {
this.localMap = new HashMap<>();
this.mongoMap = mongoFactory...;
}
public void load() {
this.localMap.putAll(this.mongoMap);
}
public void save() {
this.mongoMap.putAll(this.localMap);
}
Example. It can serialize practially anything automatically.
**Syntax:
**```
?cleanup
after Delete all messages after a specified message.
before Deletes X messages before the specified message.
between Delete the messages between Message One and Message Two...
bot Clean up command messages and messages from the bot in the...
duplicates Deletes duplicate messages in the channel from the l...
messages Delete the last X messages in the current channel.
self Clean up messages owned by the bot in the current channel.
text Delete the last X messages matching the specified text in...
user Delete the last X messages from a specified user in the cu...
Crap
The staff here is of questionable quality i must say
Hey wait a second
I think I've seen my dad more than you, smile
Is that a euphemism for something? I dont get it.
milk joke
he does
What?
dad went out for milk and never came back joke
I saw that
Ah
perv
worse than perv
although rather than doing locked/synchronized writes, they were instant and local, but could only be performed on the "authoritative" server, typically the one the player was currently connected to
don't worry I saw it too
cross-server writes were locked and used futures
Delusional peple here. Shaking my head.
smh my head
I ain't no coward, I'll say it: the mods think @echo basalt milks his dad, and I think that is very funny
as for the events it might be worth knowing if they came from a resync vs whatever else
Anyways, no idea why i even went there. I got stuff to do. Hf spigoteers 
this was actually a little difficult to get right since on velocity, a player connects to the target server before they disconnect from the source server
tell his dad hi on my behalf
The AsyncPlayerPreLoginEvent is fired before he disconnects from the previous server.
That is such a mess to deal with.
thankfully there is a time window during which the client goes through the config phase and that's more than enough to update network state for who is the authoritative server
can we get a removeIf pls :3
ok I need to actually look at this resource pack hosting code again, fml
yeah, but in practice any network message sent by the origin server on player disconnect reaches the target server before joinevent so it kind of works out
though only because it takes some time for the client to reconfigure and talk with the target server before properly joining in
which is kind of unreliable in principle but in practice it works with good enough margins for me to trust it
if it ever develops into a problem, i can always drop and resend some config packets to keep the player in between login and play for as long as i like, making sure the network state is all set
for now though, no need
Also @lost matrix your library fails in some cases if there is remote data that isn't locally cached
I'm also changing the thread-safe methods to return futures
Might be worth adding remoteValues and localValues methods as well
Is there any way to manually check wether a client is official (not cracked) and currently on a valid auth session with microsoft without needing online mode to be on? (so I'd avoid to require /login for these users)
I already tried keeping online mode to true and preventing kicks via asm (redirecting to login instead), but this really messed up uuids.
u kept saying bruh
literally what fastlogin does ..?
bro u speak like an idiot
?ban @thorny furnace continued racism
Done. That felt good.
@molten hearth
xDDDDDDDDDD
LMAO
Bot are you gonna get those messages?
dont bro that shit is so funny
how can I check player interactions with display entities if they have no hitbox?
use interaction entity
@torn shuttle what is this code doing? https://hub.spigotmc.org/jira/browse/SPIGOT-8077
at org.bukkit.craftbukkit.v1_21_R5.CraftChunk.getEntities(CraftChunk.java:127) ~[spigot-1.21.6-R0.1-SNAPSHOT.jar:4518-Spigot-d5ca3f8-98f7fa2]
at com.magmaguy.elitemobs.CrashFix.delayedChunkCheck(CrashFix.java:65) ~[?:?]
at com.magmaguy.elitemobs.CrashFix.onChunkLoad(CrashFix.java:85) ~[?:?]
iirc checks for persistent data containers to check identifiers
as in iterats through entities in the chunk and checks their pdc
so ChunkLoadEvent -> event.getChunk().getEntities()
ages ago?
?paste
why would Chunk.isLoaded be returning false during ChunkLoadEvent
yeah
but very inconsistently
last I verified the issue was a while ago so I don't have any code that has currently verified that for 1.21.8
at this point I no longer design anything to depend on vanilla chunk loading because it will actually double load or double unload at random, messing things up
should be as simple as picking a random non spawn chunk somewhere to track then going to it and away from it repeatedly to see if it's still happening while logging the result
or keeping a set of loaded chunks based on loads / unloads then checking if it ever tries to add something twice or remove something twice
Aren’t you supposed to access entities in the EntitiesLoadEvent
maybe, this is really old non-critical code
the other stuff I was checking was locations, not entities
I don't like using persitent entities, I make my own
I suspect the issue is more for some reason Chunk.isLoaded is false in ChunkLoadEvent in that stack trace (but not what I can repro)
the ChunkLoadEvent code scares me
The world code scares me
you are scared of a digital world?
can someone help with this packet? I can't find it in protocollib
It'll be some sort of movement packet
looked at their packettype class, looks like to be PacketType.Client.LOOK
guys, i may have a collaboration planned with dmulloy2
any ideas, a packet debate would be kinda nerdy and lame
talk about packet abstractions instead of raw networking
generic wrappers vs your version specific stuff
procotollib's a buggy mess figure out the problems it faces
the real goat is comphenix his bukkit posts still pop up from time to time
link some bukkit posts
what kind?
we are finally getting protocolevents and packetlib
🙏🏻🙏🏻🙏🏻
protocolevents 😭
I don't know how to make furnaces to smelt items faster, how can i achieve that in a plugin?
Also, eg, https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/inventory/FurnaceStartSmeltEvent.html
declaration: package: org.bukkit.event.inventory, class: FurnaceStartSmeltEvent
Ok thanks
Everything eggs?
im stacking them racks to acquire spigotmc for $1,000,000 SOON™
as unofficially agreed according to my understanding
i have a feeling if md ever sells spigot whoever buys it will get so many gdpr requests
yeah from woolies
Nah I already have a plan for that
(I’m going to invade the EU)
Slay
thanks queen!
I think you can buy it online too, but if you're ever in Melbourne there's this Lebanese supermarket called oasis bakery that has 10/10 duqqa too
Probably even better than the eggs
ill be in melb next week so sure thing
thank you
Whatcha doing in Melbourne
I wanted to watch the Annie Musical...
@ the princess theatre
It's a hard knock life
so true
that didn't work for me at all
sus md5
What's your code
should i use some kind of runnable to set the speed every time, or should i use it once for every furnaces?
Set the cook time in the event
declaration: package: org.bukkit.event.inventory, class: FurnaceStartSmeltEvent
@EventHandler
public void fasterSmelting(FurnaceStartSmeltEvent e){
int normalCookTime = e.getTotalCookTime();
e.setTotalCookTime(normalCookTime / speedMultiplier);
}
speedMultiplier is 8
i'm not really that good into programming, thought this thing would be easy
yes
Are you getting any errors
Is the code running
well the plugin has some other listeners which work
oh nvm
it doesn't
i'm stupid
didn't check that
oh okay it works
i added some line of code that i thought wouldn't change anything
and it didn't give out any errors in the intellij
thank you guys
Is there a way to get entities in a world that are not loaded?
Who knows how to correctly use @code tag in javadoc here?
* {@code @Service
* @Test({LoggerService.class, ConfigLoader.class}) //<- closes here
* public class DatabaseService {
* // ...
* };
* }
how can i bind the server to a different ip in tasks.runServer{} in build.gradle?
nvm default works
you can put classes in annotations?
sure
this is actually super useful for my annotation config system