#help-development
1 messages · Page 421 of 1
yah
some of it's lambdas are still active though
no need to clear this then
Should still ig
there are 1091 hashmaps loaded so one more or less 🤡
Depends on what they hold
most of them are 0-10 elements lol
how heavy are said elements
dunno what that is lol
A hashmap has nodes
Caused by: java.lang.ClassNotFoundException: net.minecraft.network.protocol.game.ClientboundAddEntityPacket
shouldnt this be working in 1.19.4?
My crystal ball says that it should
what is doing this called?
private final Plugin instance;
public Listener(Plugin instance) {
this.instance = instance;
}
Isn’t that the mojmap name
Dependency / Constructor Injection
thank
we cant use the mojang name?
Yes ClientboundAddEntityPacket is the packet name for the mojang mappings
are you remapping it
It should be remapped
?nms
Mojang mappings are nice to use while developing, but for compatibility, spigot can not migrate old packets to new remapped names. Thus, you have to map back when packaging the jar, there's a maven plugin for that, IIRC.
is there any point in giving a hashmap a initial capacity and a loadfactor in the constructor? im planning to hold 1000 objects in there and id rather not resize it every time
its on server startup so probably doesnt really matter
if you know an estimate of how many items it will hold then you can give it an initial size
how would it look without the remapping?
it does increase speed a bit
wdym?
is that initial capacity the number of buckets or what?
I forgor tbh
in 1.19.4 the packet changed from 1.19.3 PlayOut to 1.19.4 Clientbound right? Assuming I wanted to get the packet directly using the ClientboundXXXPacket name how do I find the original class name before remapping?
Remapping is done on build time
you still see the moj mappings
initial capactiry of each bucket? buckets are linked list so whats the point of a capacity?
PacketPlayOutSpawnEntity
https://nms.screamingsandals.org/
do i have to create a variable in the main class to dependency inject?
If you ask the question like that: No
You can dependency inject anything everywhere
like when i do new Object(Something instance)
thx
i meant just do i have to create a variable
Every object that has an instance of your plugin can inject it as a dependency in a constructor.
JavaPlugin only has one instance at all times. And this instance is usually received the first time
in your onEnable.
Hey i am trying to use NMS in my 1.8.8 plugin ihave ran build tools am i missing a step?
Add it to your pom
Also
?1.8
Too old! (Click the link to get the exact time)
yea i know its for a commision
there a spigot page on what the pom should have?
Something like this
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.8.8-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
probably
i have that
Whats your artifactId?
brr some big ass spider entered my room
Again - does LEGACY_MOB_SPAWNER compile?
bad decision
mb lmfao
If so, run mvn dependency:tree
I'm lost in the sauce why ProtocolLib SPAWN_ENTITY listener isnt working, only that packet. Every other packet works fine
I have a geyser spigot server and idk why but when bedrock try to join this comes up can some pls pls pls help
sorry turns out gradle was using 1.13 for some reason. ive changed the project to maven now thanks for the help anyway sorry to bother
You should probably ask that on Geyses Discord server
If I had to guess that "for some reason" is vault
Did they not add the <scope>provided</scope> to their bukkit dependency?
They would need to add <optional>true</optional>
Oh, I just thought that blocking it from being transitive would be enough
my server keeps crashing
Honestly the fact that implementation/compileOnly (in contrast to to api/compileOnlyApi) doesn't exist in maven is the main gripe I have with maven
🥹
why so many duplicates?
dont ask me
And half of these magic values don't make any sense
seems to get used here
Encryption?
its in a chunk class so probably not
AH, it's bitmasks
heightmaps maybe
Since they store with uneven amounts of bits
Is that used to generate chunk packets?
or to store them within anvil
yah
bitsPerEntry reminds me of chunk palettes, which kind of act as a mean to compress the data by making indices smaller
That magic array still scares me tho
d-dont
I did, which is why it seemed familiar, xD. I'd still love to write a proper live chunk editing library.
It's not at all hard or complicated, I just really want it to be clean and simple.
That code is cancer
the moment you write ObjectPool.PACKET_POOL.use(buffer -> NetworkBuffer.makeArray(networkBuffer -> sections.forEach(networkBuffer::write)));
I've written plenty of bad code, but at least the numbers are comprehensible
someone didnt use ij 
looking at spigot stash is fun, comments of people that are close to their end
Now I want to dig out my chunk packet patcher project again, :-:
looks like minestom has builtin support for displaying images on maps
dont ask me how sharp they are though
i only stumbled upon a bufferedimage so i thought so ;-;
"sharp" (128x128)
lemme try out tmrw
ig this is smth
Would be a lot more data per map tho
I didn't feel especially limited by the map color space, but well
Actually for some reason bedrock maps use 32 bits per pixel
Even though you only need 24
4x more, not that much
it already gets gzipped hard enough regardless
maybe encode it as jpg instead?
I mean you don’t need the alpha channel
Yeah, that's what makes being creative with them possible at all.
You only really need 1 bit for transparency then
But I guess working with 25 bits per pixel is kinda awkward
Do they allow for an 8 bit alpha channel, or is it just a 8 bit boolean? :-:
well
more like
bit isPresent
if 1 ->
bit isTransparent
if 0 ->
byte r
byte g
byte b

well
isPresent and isTransparent is the same shit
I'm idiot
dunno what any of those values mean lol
Or they could just hardcode 255,255,255 as transparent
I’m sure we’d live with 1 less color
I'd appreciate it being 0,0,0 tho, as 0 is transparent in map colors too, xD.
Either works
Imma grab a flight to Stockholm and code that for em
Any other requests?
I still think that 4x more data is not viable at all. Even if it would be 25 bits, packed into something else
is there a dif between MAP and FILLED_MAP?
I mean it seems bedrock gets away with it fine
One is an un-created map
MAP is, yep
It’s just a normal item and doesn’t render a proper map when held
It's that paper-looking thingy
Mhm
It sucks for both sides that there are still parity difference between java and bedrock
Smh mojancrosoft
its a beaty
"blue noise"
Are you sure it takes map color IDs? Looks like shades of blue
last param is rgb
Not quite
Yeah... r<<16|g<<8|b, probably
There’s a bunch of hardcoded colors
oh
still blue with bound 10000 lol
Have you checked out the implementation? xD
Try 100_000, xDD
Just wrap your random generator in a while loop which tries to generate images until some ML network identifies it as a cat. Problem solved.
That goes straight into the art gallery
it has awt support lol
found those 61 hardcoded colors
Kind of funny that spigot hard codes shades
wondering why i cant just give it a bufferedimage through the constructor
Or colors at all, as they're available in the minecraft-server already and can be computed at runtime, version-independently.
gn id say
Screw performance, iterate all pixels and set them in the buffer, xD
meh
I just copied the code to put an image on a map to work directly with a byte array
weak
I bet they're going to have to expand their array datatype soon, if they keep on adding blocks like that. But not all blocks have a corresponding map color, right? There are more than 61 blocks, I guess...
Yeah
They have groups
Some get their very own though for no reason
Like block of raw iron or glow lichen
Each Terracotta color has their own too
Well, there is quite a difference tho. The terracotta blocks make sense, as those make up a lot of the color space already, and as it's based on blocks, you have to start out somewhere.
TERRACOTTA_WHITE is pretty close. Maybe they just have some maximum internal color distance (by whatever algorithm), which serves as a criteria to create a new group if exceeded.
It’s somewhat close to white terracotta
Yep, haha
I think terracotta used to use the same colors as wool and concrete and etc
But one update they decided to do a ton of new map colors
I think it was 1.16
they could easily add a color every single block so why dont they
Bandwidth, :-:
But, on the other hand... maps weren't intended to display live stuff, so I guess bandwidth would have been negligible.
I mean if they are worried about bandwidth from vanilla they can just update a map less often
And if they are worried about bandwidth from us, well that’s our problem :p
I'd love to know how big the overhead would be for full RGBA maps, if you internally constrain your color space and let the PacketCompressor chew away at your packet.
For single maps, yep, but people like to do displays and stuff, ;)
Yeah
But as I've said once already, compression really shaves off a lot. Not to be underestimated.
Black magic
Yeah, that's what zlib should be called.
how ugly is this on a scale of 1 to 10
addSubcommand(
ErisCommandBuilder.of(new ErisLabel("test", "spawnermaster.admin"))
.nativeExecutor((CommandSender sender, String[] args) -> {
if (!(sender instanceof Player player)) {
return false;
}
final SuperiorPlayer splayer = SuperiorSkyblockAPI.getPlayer(player);
final Island island = splayer.getIsland();
if (island == null) {
return false;
}
cache.get(island.getUniqueId())
.thenAccept((IslandDTO data) -> player.sendMessage("Island data: " + data));
return true;
})
.build().make());
Why build make
If you really need that builder, then please just extract the handler into a method and just supply a method reference as an argument to nativeExecutor
Lombok Builder annotations
just an optional thing tbh the only reason it exists is for building test commands lol
Damn, people actually use those?
yeah I'm lazy
Idk what is that lol
:P this is what the non builder looks like lol
addSubcommand(new ReloadSubCommand(reloader));
you don't know what lombok is
I guess if your a hotkey god its kinda optoinal as fuck
It's cursed, it creates a builder pattern based on your member fields
^ Exactly that
But I don't understand why it's .build().make()
I mean I guess you could do build().build()
I was an avid lomboker until very recently, when I decided to get rid of it again, xD. Tbh, I appreciate it to write the boilerplate myself, as it should serve as food for thoughts if your boilerplate escalates beyond a certain threshold. May be a design decision that's in your way then.
I think intelij can generate a builder for you
What do you use so far?
How does it look if you provide custom impl for getters and setters in lombok
IJ pissed me off multiple times recently, I might go back to eclipse too soon, lol
I use VSC, I know, don't kill m please
For example throw if settled value in setter doesn't meet criteria
I use Eclipse. Free, no features locked behind a paywall and does everything I need
🔫
I just really don't care about 90% of what the IDE does. I want VIM keybindings and some responsiveness. Just don't crash on me periodically, :,)
I've never had any issues with jet brains ides
I see many experienced people using eclipse... Might be something to it.
I had teh odd crash in eclipse 10 years ago, but none since.
personally not a h uge fan of the UI and how it feels
I get crashes in eclipse with the material enum
Eclipse feels really nostalgic to me, haha :D
But I think that’s to blame on my decompiler plugin
And the material enum being huge
and the fact it seems like people who use IntelliJ have to invalidate their caches a shit ton, I've used VSCode and have only had to invalidate my language cache once out of my 2 years of use
how does the enum crash for you? when viewing the source?
When generating completions
In IJ, I get crashes with most nms classes I try to decompile... Classes should be decompiled ahead of time and included in a sources jar, but I was too lazy to look into how that can be generated.
thats odd. I've never had an issue with it
I think the decompiler plugin is randomly trying to decompile it? Idk
I’ve never gotten a crash when actually decompiling with it though, works great
possible, I don;t use a de-compiler plugin in my ide
Gotta be able to CTRL click those NMS and CB classes for instant access
gd
I've only ever had one issue with IJ trying to open the Material class, but it was only because of me maxing out my ram capacity. Only ever had to restart the IDE to fix any small problems like syntax highlighting not loading or anything.
I really couldn't tell you what people are doing to force them to invalidate caches so often.
It has been a long time...
welcome home 🙂
Tbh, for some reason, Eclipse personally feels more like home than IntelliJ does to me.
because its old
Anybody know if ItemStacks deserialized via Bukkit's ConfigurationSerialization API are mutable within the config?
they will not update in teh config unless you put them back
the instances are separate
Okay, cool
There's nothing deserialized from the config which you can mutate, not set back, save and actually expect it to have caused changes to the file.
That would be... either weird or cool, depends, xD.
I figured it wouldn't be the case but thought to at least ask
The first version of IntelliJ IDEA was released in January 2001
Eclipse
Initial release date
November 29, 2001
:p
I guess they did a better job getting with the times imho
but like its whatever you prefer ig
To be fair, eclipse does look dated. If they ever updated their UI, it wouldn't feel so old.
It was just about deserialization tho, not direct access. If you get Lists or maps, which the ConfigurationSection retrieves from cache, and mutate it, I could imagine that the changes reflect in the config. I don't know how the YamlConfiguration operates, as I've wrote my own. But that would not be called deserialization then.
Iirc the collections are always clones
Tbh, I couldn't care less about the looks of an IDE, lol
I need a SerenityOS theme for eclipse, xD. That kind of look would 10x my productivity.
Yo, is there a way for my plugin to register all commands by itself?
I read something about it a while ago
Can't remember tho.
wdym register all commands by itself
if your thinking about interferring with other plugins commands don't
you dont' want to use plugin.yml?
what were you even talking abt
i think thats where it came from..
how do i learn how to make plugins
do you know java
no
?learnjava
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
ok then what
look at spigot docs
if you hate reading
This playlist contains all 87 video of thenewboston's(Bucky) Java (Beginner) Programming Tutorial Series. thenewboston's YouTube: http://www.youtube.com/user...
you should beable to make a decent plugin within a few months
need to be more descriptive
I found out, just me being tired lol
ACF is pretty handy too
I wouldn't want to go back to a stationary computer, a laptop is so comfortable
I hate laptops the battery life 💀
Why doesn't https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/block/data/type/Chest.html extend
https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/block/data/Openable.html
the same way Barrel does?
declaration: package: org.bukkit.block.data.type, interface: Chest
declaration: package: org.bukkit.block.data, interface: Openable
declaration: package: org.bukkit.block, interface: Lidded
Has anyone succeeded to transform a display entity yet? I'd love a code example if anyone has one please 😍
display entity?
ye 1.19.4
I thought that was a 1.20 things
time to get to work the nig
you can open a jira ticket for this like when they open a ticket for the barrel thing.
https://hub.spigotmc.org/jira/browse/SPIGOT-7069
thats sum lame stuff only time i look at spigot docs is if i forgot the name of a method
Then read the wiki
I just realized. Chests don't have openable in vanilla
point is if I tell him where to get the info immediatly just going to ignore the learning java part
and try to go straight into spigot which is a huge mistake
bros gonna start watching spigot tuts on yt
while you may not look at documentation, it doesn't mean it doesn't contain valuable information or should never be used
misread reply mb 4 ping
this is fun
I bet it is
does an nms version thing exist, like what versions would be handled in 1_19_R1 for example
I don't think so
I think everyone kinda does their own thing
I wish spigot had more standardized libs. Honestly I am going to start using some libs already made by people
I feel like there is no reason I should keep making my own shit with all the great libs out there
but rewriting the wheel
is it called immutable or mutable for stuff i can pass, modify and not need to return
yeah :P
I'm trying to make a plugin for 1.16.5 and I keep getting a "unsupported class file major version of 63." error
https://www.spigotmc.org/threads/approved-obfuscators.420746/
Why is this a thing? Just wondering
What jdk/jre etc. version should I be using?
to provide obfuscation?
No, like why limit what obfuscators we can use
No, those are just the ones you don't need to get permission to use
"Permission is not required to use the following obfuscators on any plugin."
ie. you don't need to contact the dev for permission to use it
some you might
Yes, but why do you need permission if the obfuscator isn't listed there
@remote swallow do you know any good inventory libraries
Also no, "No other obfuscator, whether public or private may be used on resources uploaded to this site. To inquire about adding an obfuscator to the above list, please contact staff and provide a sample plugin."
because obfuscation is fucking stupid
you aren't protecting much of anything
your just challenging those who feel like cracking it
you won't be protected against leaks
Which should be a good thing
Who wants their resource to be cracked
Not me :kekw:
so don't bother obfuscating
cuz it'll happen either way
granted that requires your resource be good
otherwise no one would bother cracking your obfuscation
Open Source and Keep your code public
most people who won't buy it on spigot will just compile, don't offer support to those who don't buy it, Everyone involved wins
sadly not
mm okay I saw Phoenix had one so I'ma try theirs
except the devs. because the people who compile it themselves will absolutely write bad reviews because of "bad or missing support"
Dealing with stupidity is going to happen anyways
what about the people who download it from a cracked site get a virus then leave a bad review because they got malware
etc etc
or they wont get support
you can't avoid stupidity, but you can help people avoid malware
there's no dealing with it, these reviews will not be moderated. also, how are you supposed to tell if someone who wants support bought the game
be like alex and add somthing-something.html
can't you not leave a review unless you buy it
for premium plugins
possible idk
so spigot review point would be pretty invalid
i guess
all you'd be doing is saving people who wouldnt buy it anyways from getting malware which is a huge win. Even if you spite that person for not buying your plugin
still, how would you tell if someone bough the plugin if they ask for support.
you can verify via your plugin page
the way Alex does it
uh
many other authors do it the same way
alex uses paypal api i think
you can also just check your premium plugin page iirc, I'm not sure as I've not posted any resources
his is auto but true
good luck doing that when your plugin is fairly big
wont that literally take 99% of your free time?
not really
I mean I'm assuming all bigger plugins will have helpers etc, also will automate shit where they can
nothing I said was impossible and an obfuscator won't fix any of the issues that you bring up
cracked versions will still be tampered with and distributed
ofc they will
my old plugin (non premium) had a very old buggy version on aternos, and they refused to at least update it.
which lead to many many people coming to me asking for support for their ages old version
essentially same for premium resources, people will ask for support with leaked old ass versions
I mean all of this is true, but I still fail to see how an obfuscator fixes this, which is what you were originally arguing no?
and nothing really to do about it, except automating 50 millions of things, or adding many many mods/helpers, which isnt really something many people want
it doesnt really
then I fail to see the point other than having a popular plugin can kinda just suck with moderating and verification
that was kind of the whole point lol
i still dont get why people go through the pain of paid plugins.
I don't think I'll ever release a resource on Spigot
even though I avidly do commissions lol
i will eventually release some plugins, but i'll probably never ever release a paid one
if someone wants to support me, they can donate, and arent forced to do.
If I ever released a plugin I'd need a PR guy because I snap so easily at stupidity
which is why I quit my one job doing Customer Service at a market
i will most likely do it as i always did.
i make my own stuff, and just refer people to my discord server for support. if someone runs it on aternos, i will probably straight up refuse support
even doing commissions always has me at my wits end
because honestly i dont wanna deal with that old versions
i personally could not do commissions
my head would go through so much rush and other pain
hasn't been too bad for me so far
i dont like having deadlines for development.
there are days where i work on something for 5 hours, there are days where i work on it for 2,there are days where i dont work on it at all
i don't like having to do something fairly quick
I have really bad work habits, but I tend to let people know ahead of time that I have really irregular work habits
I get really obsessive for a week and pump out an unholy amount of code
and then just can't code for 2 weeks
Wrong java version
compile against java 16 for 1.16
I'm using java 16
you sure
are you using intellij?
check java --version
1.16 is java 8
{
"java.configuration.updateBuildConfiguration": "interactive",
"java.jdt.ls.java.home": "C:\\Program Files\\Java\\jdk-16",
"java.configuration.runtimes": [
{
"name": "JavaSE-16",
"path": "C:\\Program Files\\Java\\jdk-16",
"default": true
}
]
}
vscode
what hell of a file is that
vscode
finally someone who is cultured
check your system version
well
pop open your terminal
java --version
make sure its java 16
otherwise you'll need to switch your env vars
you are worse than all these eclipse users 💀
ofc
yeah
1.16 should be java 8, 1.17 should be java 16 and 1.18 or higher should be java 17
iirc 1.16 does only work on 11
😭 this is so confusing
yup it is
w8 so what java version should I be using for 1.16.5
16
16 11 8 what is it lol
🤷🏽♂️ who tf knows
16 is 1.17
I think 1.16 is 16 and 1.17 is 17
its 1 off
mojang managed to break it by 1 version
Lord save us all
internet says to use java 11
hi.
i have a problem.
the BlockFromToEvent event handler seems to be running in unloaded or before the chunk loads.
and it seems to be causing issues.
can you elaborate further?
do you have a test plugin that shows this? If so, open a bug report
so
@EventHandler(priority = EventPriority.HIGHEST)
public void onChunkLoadEvent (ChunkLoadEvent event) {
Chunk chunk = event.getChunk();
Bukkit.getScheduler().runTaskAsynchronously(ChunkClaimsPlugin.getThisPlugin(), () -> {
new ChunkData(chunk);
});
}```
that loads the chunk and it creates a ChunkData object.
here is the constructor for the ChunkData object.
public class ChunkData {
private static HashMap<Chunk, ChunkData> chunkDataStore = new HashMap<Chunk, ChunkData>();
public ChunkData (Chunk chunk) {
chunkDataStore.put(chunk, this);
}
}```
its a more simplified version but that is pretty much what happens.
Ur keeping the chunk alive permanently btw
Your hashmap holds a reference to it even when it's unloaded
there is a whole bunch more than happens sql queries running to fetch data from the database, but that is the first line code that runs pretty much.
@EventHandler
public void onChunkUnloadEvent (ChunkUnloadEvent event) {
Chunk chunk = event.getChunk();
Bukkit.getScheduler().runTaskAsynchronously(ChunkClaimsPlugin.getThisPlugin(), () -> {
ChunkData.removeChunkDataStore(chunk);
});
}```
i know that i implemented that arleady.
Ok good
public class BlockFromToEventHandler implements Listener {
@EventHandler
public void onBlockFromToEvent (BlockFromToEvent event) {
Material material = event.getBlock().getType();
boolean ifMaterialValid = material == Material.WATER || material == Material.LAVA;
if (!ifMaterialValid) {
return;
}
Chunk chunk = event.getToBlock().getChunk();
ChunkData chunkData = ChunkData.getChunkData(chunk);
if (!(chunkData.getBoolean(ChunkData.WATER_FLOW) || chunkData.getOwnerUUID() == null)) {
event.setCancelled(true);
}
}
}```
here is the code for the event handler.
it says chunk Data is null.
java.lang.NullPointerException: Cannot invoke "me.pulsesapphire.chunkclaimsplugin.ChunkClaims.Data.ChunkData.ChunkData.getBoolean(int)" because "chunkData" is null
here is the line.
from the stacktrace.
is it a bug?
Ищу разработчика-java
Probably assume your code has a bug before spigot
Оплата ₽
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/
i know but i am not sure which part of this is bugged.
Неа
so, any ideas?
it was also happening with other event handlers too earlier, one with a creaturespawn event handler that i am not using anymore.
the event handler seems to be running even before the chunkload event handler runs probably.
@sullen marlinbtw, are you like the official maintainer of spigot or bukkit?
i feel like i have seen that name elsewhere probably.
?paste
oh yeah, there it is.
Yes
ok.
you're making your chunk data async
it is entirely possible the event triggers before your async chunk data task has run
i kind of need to because it fetches data from the database and i dont wanna like completely kill mspt by running it on main thread.
okay.
hm.
most plugins would keep all regions or whatever you have in memory
Make a pr
Spigot is always open for pr
i have been using a third-party library for anvil GUIs and it is kind of annoying.
While md is the maintainer you can make prs and they will be seen and looked over
?contributer
pr?
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
Fuck it
?contribute
You can find information about contributing to Spigot at the following links:
https://www.spigotmc.org/wiki/cla/
https://www.spigotmc.org/wiki/guide-contributing-to-spigot/
https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse/README.md
https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse/CONTRIBUTING.md
Yeah there it is
I mean there's a create inventory method, an anvil event and a getRenameText method, so probably?
Though some gui are super janky virtually
Casting probably from createainventory
I'd assume that'd work unless anvil inventory is specific to the block
are there any known multiversional libraries for spawning corpses e.g. https://www.spigotmc.org/threads/1-8-8-create-player-body-on-death.450557/ ?
a corpse is just an npc isn't it?
yeah with some tweaks ig
so presumably any npc library
AnvilInventory anvilInventory = (AnvilInventory) Bukkit.createInventory(null, InventoryType.ANVIL, "test");
this code did not work.
does the AnvilInventory class actually work?
i am not really that experienced with java to know how to do all that.
?stash
If you don't know java well you really should learn it's pretty vital to understanding a lot of spigot
well, i kind of use bukkit to not have to deal with that minecraft source code from mojang.
i mean i know how the game mechanics work, but i am not really too sure about the minecraft source code itself.
You don't need to be
I mean java the coding language
We just call it minecraft here because bedrock isn't supported
i tried to do some modding with the minecraft fabric mod loader and it looked so difficult.
It's harder than plugins
its so difficult.
Requires java knowledge 100%
With spigot you can get away with being a newbie
For better or for worse
Not with nms 😛
not just java knowledge, but like bytecode and stuff too and how the bytecode compiler and interpreter work probably.
How do I use ControllerLook 😭
and not to mention mojang just changing stuff around.
ok, anyway, i will be doing something else for now probably so bye.
Bytecode isn't super hard to understand
IMHO it's semi self explanatory
They provide you plenty with tooling to mixin
hi i want help 🙂
soo How to get how much exp a mob would drop?
given there is plenty of resources to look at to tell you what each bytecode is and what it means
Is there a way to have console run a command and send the results to the player?
Bump
because pixelmon permissions are stupid
i have this particle:
PacketPlayOutWorldParticles packet = new PacketPlayOutWorldParticles(
EnumParticle.a(1), true, (float) loc.getX(), (float) loc.getY(), (float) loc.getZ(),
0.05f, 0.05f, 0.05f, 5, 1
);
any idea why its a random size and not just big? any idea how to fix it aswell
Bit of a hail Mary but has anyone ever worked with the data long arrays in chunk sections?
I'm at my wits end with it 😅
Why are you using packets for particles
since im on 1.8
what do you need to know?
I am guessing there is an essay to this
I have a script that:
Turns the long array into binary
Re adds the 0s to the front as stinky java doesn't believe the zeroes that should be there deserve live lmao
Removes excess 0's on the end (if applicable) to get it to a length divisible by bits per block (decided by the highest ID in the palette. E.g a palette of 26 blocks would be 5 bits per block) and scans em.
Works great for 4 bit, but moment we hit 5 bit we are getting values up to 31 (which gives a major warning sign as 31 is 11111, which implies we are getting the scan outa phase by 1-4 bits.
But that doesn't quite make sense as any other start would lead to longs not divisible by 5
Dudes a prophet lol
I even sanity checked in matlab as they are, u know, clever and don't pretend the 0s on the front don't exist.
Same issue
why turn the long into binary?
Because the IDS are defined via binary bytes of 4-8 bits?
also if you have to re-add 0's the way you are turning it into binary must not be correct because Java doesn't strip 0's arbitrarily
Java works to longs that are 64 bits long, so if the number was 0 in binary, it doesn't add those other 63 0's.
It's their way of compressing the data
0000000001 is still the same as 1
so removing, the excess zeros to the left doesn't change its value
however if the 0's are on the right and it removes it, it will
how to do world generation? any tutorial not from 8 years ago?
Yes but the way the block ids work is it scans every X bits and that X bits is block.
So 00001 should be a 1. But if java removes the 0s , it can't scan 5 bits as there aren't 5 bits to scan
Hi its my first time trying to create a plugin for 1.19.3 I've added spigot to the build path but when I add extends JavaPlugin and press CTRL + Space to add the import it puts it in but I get the error: The type org.bukkit.plugin.java.JavaPlugin is not accessible
That's what I'm saying. We padded and clearly goofed up somewhere
byte Nibble4(byte[] arr, int index){
return index%2 == 0 ? arr[index/2]&0x0F : (arr[index/2]>>4)&0x0F;
}
int BlockPos = y*16*16 + z*16 + x;
compound Block = Palette[change_array_element_size(BlockStates,Log2(length(Palette)))[BlockPos]];
string BlockName = Block.Name;
compound BlockState = Block.Properties;
byte Blocklight = Nibble4(BlockLight, BlockPos);
byte Skylight = Nibble4(SkyLight, BlockPos);
But yet in matlab it doesn't make the 0s go poof. And it has the exact same error
chunk sections are 16x16x16
Correct
and there is 16 sections
the code above should be enough to get on the right track to get the palettes
You would think...
😅
But then we have the funny curveball
If the bits per block exceeds the length of the long... it moves that block completely to the next long down
it won't exceed the length of the long
Yes
if you do, you did something wrong
Correct
a long is really huge
No sorry exceeds the number of bits in the long
I.e. 64
don't see how you would exceed the number of bits unless you are just adding to it arbitrarily. The game doesn't even come close to exceeding the long unless you had infinitely generation of chunk coords
Say you have 16 blocks in a palette. What's the binary for 16?
nothing that will exceed 64bits
I don't know off the top of my head, but still comes no where close to not fitting in 64bits
it doesn't take 64bits to describe 16
After 12 blocks...
it takes a single byte
12*5
a byte can go up to 256
Give me a few mins
or maybe its a short don't remember
either way, 16 would never take up 64bits
so if you wanted to hold the entire bits of a chunk in a single long
Sayu hello to the long values
it does go above 32bits but still comes no where close to 64bits
not even close
Yeah... and there are 5 bits per block... and it has more than 1 block per line (in this case, 12 blocks per line)
you can fit the entirety of a chunk bit wise at 5 bits and still not come close to using anywhere close to 64bits
Can you give an example because not im confused
I will give you an example. IPV6 uses a long or 64bits. IPV6 gives you enough IP addresses to give everyone in the world 10 ip addresses to each individual and still not come close or have used a significant fraction of the amount of space 64bits gives you
Sorry when i say "bits" im talking about the space we have on the screen rigth now. 64 individual didgets
64bits is really large and the only reason a long is used here for the blocks is because the amount of space needed is slightly above 32bits but not large enough to need something like big decimal so long is sufficient
But then converted to binary...
how do i check if an item is an armor piece?
I been talking about binary the entire time
binary wise 64bits is huge
even more so when we factor in bitmasking
Well chief you tell me , right now on that screen to make sure ive somehow not understood the basics xD ... how many bits are on each of those lines
.
not 64bits because 0's to the left of any actual number is not considered
00001 is still 1 and still wouldn't take 64bits to describe it even if you could use a long to show a 1
and require padding yes?
so, lets say you have 1, but the method is expecting 5bits and not just 1
you would need to provide 4 more bits
but that is only because the method is expecting the 5bit size
*minecraft always assumes 64 bits so that way if a section just has 1 block type in the palete, you can put in a tiny number but have 64 bits worth of data crammed in
anyways not sure where you get the idea that a chunk is larger then a long can hold
as you gave the example above, 5 means 16, which is 10000 in binary. If you notice, from the 1 to the right is convieniently 5 bits
you can still use the 4 other bits to the right
just because the very left bit is set, doesn't mean the ones on the right are as well
if the very left bit is set, we already know it means 16 regardless if the right are set or not
because the only way to have it set would be to have reached 16
but this is where we get in the realms of bitmasking
and this is where you might be getting confused
How do I add a second argument args[1] that is a playerName?
second argument to where?
the arguments are anything after a command
and the argument index starts at 0
0 being 1 argument and so forth
ik
if you wanted an argument to mean player name, you would just grab that argument and check if its a player name
Bukkit.getOfflinePlayer(playerName)
I recommend using offline player because we have to assume that they can be offline
and with offline player you can check if they are online and if so just cast offlineplayer to a player object instead
if you need a player object
otherwise you can still do quite a bit of whatever it is you need with just an OfflinePlayer object
by learning the file NIO packages in Java and how to load and save files in general, the fact it is a json file is nothing special other then you probably want to extract json objects from the data after loading the file in which case you will need to use something like simpleJson or Gson to do such things
i'm trying to resolve a JSON file (https://paste.md-5.net/cexupidona.json) into a class (https://paste.md-5.net/fehutumatu.java) with GSON, but I want the primary keys (e.g. "cow", "sheep") to serve as keys for my Map (Map<String, AnimalDrops>). how can I do it? or, better yet, maybe there's a way to change my AnimalDrops class so that it holds the key instead?
chatsonic gave up on completing my request, twice 😭
why dont you put those 2 objects in a json array?
i could, actually
id just do it manually
one sec i'm trying to figure it out lol
do you mean do it like this?
https://paste.md-5.net/anejirevih.json
ye
yeah it now looks much cleaner and looks like it works, thanks a bunch i'll go test it now
how to do world generation? where can i find any new tutorial ?
are the servers for protocollib down cuz i cant connect to https://repo.dmulloy2.net/repository/public/
Bump
you dont have a param on your constructor
public DialogueCommand() {
this.plugin = plugin;
}
``` should be
```java
public DialogueCommand(Dialogue plugin) {
this.plugin = plugin;
}
then where you register it add this in the parenthesis
Hi, im having an issues where the plugin doesn't combine 2 potion effect like if i have speed I with 2 seconds and 5 seconds of Speed I, its just remain 2 seconds and not 7 seconds, there's a fix?
Well you have to get the current potion effects and their remaining duration and add your duration onto it in that case
how do I go about adding spigot now? Adding external jars doesent seem to work for me
?bootstrap
Bootstrap Jar
The main spigot-1.18.jar is now a bootstrap jar which contains all libraries. You cannot directly depend on this jar. You should depend on Spigot/Spigot-API/target/spigot-api-1.18-R0.1-SNAPSHOT-shaded.jar, or the entire contents of the bundler directory from your server, or use a dependency manager such as Maven or Gradle to handle this automatically.
Please read the release notes for further information: https://www.spigotmc.org/threads/9-years-of-spigotmc-spigot-bungeecord-1-18-1-18-1-release.534760/#post-4305163
gradle or maven is easier imo
However if only the spigot api is of concern for you, use https://hub.spigotmc.org/nexus/content/repositories/snapshots/org/spigotmc/spigot-api/1.19.4-R0.1-SNAPSHOT/ instead
The problem is adding the api as it never seems to recognise it and I always get errors
What kind of classes do you want to use?
I.e. do you want to use net.minecraft.server classes or just the plain old org.bukkit classes?
how to rotate schematic?
public static void pasteSchematic(String schematicPath, String schematicName, Location l, int yawRotation) {
File file = new File(schematicPath + File.separator + schematicName + ".schem");
ClipboardFormat format = ClipboardFormats.findByFile(file);
try (ClipboardReader reader = format.getReader(new FileInputStream(file))) {
clipboard = reader.read();
} catch (IOException e) {
throw new RuntimeException(e);
}
ClipboardHolder holder = new ClipboardHolder(clipboard);
holder.setTransform(new AffineTransform().rotateY(Math.toRadians(yawRotation)));
clipboard = holder.getClipboard();
EditSession editSession = WorldEdit.getInstance().newEditSessionBuilder()
.world(BukkitAdapter.adapt(l.getWorld()))
.build();
try (editSession) {
Operation operation = new ClipboardHolder(clipboard).createPaste(editSession)
.to(BlockVector3.at(l.getX(), l.getY(), l.getZ()))
.ignoreAirBlocks(true)
.build();
latestEdits.add(editSession);
try {
Operations.complete(operation);
} catch (WorldEditException e) {
System.out.println(ChatColor.RED + "OOPS! Something went wrong, please contact an administrator");
e.printStackTrace();
}
}
}
this doesnt work
?notworking
"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.
the clipboard is pasted but the rotation isnt
what's yawRotation?
org.bukkit classes I was following a tutorial as its my first time trying to create a plugin though the tutorial was like 2 years old because thats the latest I could find
the y rotation i want to apply to the schematic before pasting
right now im testing with 90 degrees
FAWEUtils.pasteSchematic(directoryPath, schematicName, roomLoc, -90);
and I can just right click build path > configure build path > add external jar that?
why don't you just use maven? it's so much easier
Yep.
how would I go about doing that?
Well doing it the JDT way is much easier for the first plugin
It's not like the plugin is going to be super relevant in two months time
After that sure, maven is better
I'll try that but usually I get the error org.bukkit is not accessible
Oh no. I think I know why this happens
what am I doing wrong
Why do you guys not know how to properly shade jars?????
I know it lol
@rare token Make sure to have it on the CLASS path - not the module path
I've never programmed a plugin and I'm new too. I've been trying for many hours to get the code that chatgpt programmed for the plugin to run on my server but it doesn't work. can someone help me?
Oh right thats why
watch a tutorial
do you already have a working maven project setup? https://blog.jeff-media.com/how-to-create-your-first-minecraft-plugin-using-the-spigot-api-and-maven/
I am 60% sure you forget to remove META-INF/versions/9/module-info.class
I have but I can't get it
i have a text file and there is the code but how do i get it to a .jar file?
anyone know if its possible to put comments in a yaml config pre 1.18
please help me guys
Please don't tell you don't use an IDE
||Regardless, this is the perfect proof why I am certain that AI will not kill our jobs.||
bro using notepad :D
i use a word document bcs i can colorcode my code which is very cool
wdym? where?
In your projects where you shade things in
I've added the spigot api you provided into the class path made a package with a Main.java and tried to add extends JavaPlugin added the import where I get the error org.bukkit.plugin.java.JavaPlugin is not accessible?
You almost gave me a heart attack
I don't see any .jar with a module-info.class
oh and I use light mode
even has the Jetbrains mono font going on hahaha
fr
just use maven and stop worrying about stuff like this
gotta make sure its similar to intellij
let me change the font to something fancy
Recaf automatically moves classes from META-INF/versions/* to the root directory
And also kills empty files. So that is the wrong place to look for
inner peace
Good for you. It seems you actually do know how to do that
damn whats that text editor
wordpad
to be fair I never saw anyone shading module-info.class
this one
Though the amounts of libraries that use Jigsaw/JPMS is limited
however I've seen people shade worldedit, or spigot-api, like every day
how do you use that
i dont actually use it, its just a joke
Placeholder API erroneously shades in adventure's module-info
i use cooler intellij
jokes? never heard of them
yikes
They refuse to fix that
how can i make the file .jar so i can use it on my server?
Only comment I got is "how is this a problem" (more or less)
compile it 💀
how
javac?
idk how
me neither. It has been ages since i used command-line javac
dude has memorized every blog
this is the third time I sent that link in the last 10 minutes lol
also it's my own blog, so not very hard to find the link lol
:o damn
i bought chatgpt plus and im not even using gpt4 💀
WAIT COULD YOU SHOW IT A PHOTO OF A GENERATED DUNGEON AND ASK IT TO REPLICATE IT? AYO
my brain workss
Hey, my goal with this plugin was to restrict the use of an item with a specific lore if a player is in a vehicle, however it gives me a NullPointerException in the commented line, but I don't understand why?
@Override
public void onEnable() {
// Plugin startup logic
Bukkit.getPluginManager().registerEvents(this, this);
}
@EventHandler
public void onItemSwap(PlayerItemHeldEvent e) {
Player p = e.getPlayer();
e.getPlayer().sendMessage("Test");
if(p.getInventory().getItemInMainHand() != null) {
ItemStack stack1 = e.getPlayer().getInventory().getItemInMainHand();
if (stack1.getItemMeta().hasLore()) { // NullPointerException because org.bukkit.inventory.ItemStack.getItemMeta() returns null
if (stack1.getItemMeta().lore().contains("a heavy longbow"))
if (p.isInsideVehicle()) {
e.setCancelled(true);
}
}
}
}
} ```
getItemMeta() is null
because the item doesn't have ItemMeta (because it's air), or because the "stack1" itemstack is already null
@pale ridge
cp SetSpawn.txt SpawnPlugin.java && rm spigot-api-1.19.4-R0.1-20230319.075423-16-shaded.jar && wget https://hub.spigotmc.org/nexus/content/repositories/snapshots/org/spigotmc/spigot-api/1.19.4-R0.1-SNAPSHOT/spigot-api-1.19.4-R0.1-20230319.075423-16-shaded.jar && javac -proc:none --class-path spigot-api-1.19.4-R0.1-20230319.075423-16-shaded.jar SpawnPlugin.java && zip SpawnPlugin.jar SpawnPlugin.class plugin.yml
oh that makes sense
So first I check if getItemMeta() != null and then I do the rest?
what do i do with it now?
yeah
and check if stack1 is null, too
do your null checks
Alright, thank you
any idea why it won't parse properly?
https://paste.md-5.net/nufupibija.java main class
https://paste.md-5.net/ahobulonux.cs AnimalDrops
https://paste.md-5.net/inibuyabel.json drops.json
wdym with "it's empty"?
any plugins?
what's the issue?
take a look at the comment in the main class
i expect it to be parsed according to what i have in my JSON file
but it's just two empty animal classes
how can i make money with making spigot plugins?
since there are two objects though, the file is probably read properly, because there are indeed 2 animals in my json file
?premium or take commissions
get intertwined with the spigot community - build reputation and trust at spigotmc.org and overall in the community, post questions to forums and answer the questons
in the meantime learn plugin development
when you're advanced, create a premium plugin that you geniunely put time and effort into
and after you've got stuff on your portfolio, you'll probably be able to get more commissions than if you didn't
how many sales i can make with 1 plugin approximately
cant say
depends on how unique it is and how well you "advertise" it i guess
And the price
and you need like 3-5 i dont remember how many before you can even list it on spigot
yeah
And how many people actually want it
?premium
80 messages
yeah
does anybody have a clue?
social interaction, yuck
xD
between 0 and thousands
how can people not have enough messages lol. I got over 3000 and I'm not even very active on the forums
josh you have 3 suggestions in discussion
How do I even have 52 messages
If only I had a library for config recipes
i use minestom 💀 and i made my own recipe code
no, it's worse
do you have any plugins
does the class work and do what you need
then use a better decompiler. which one do yuo use?
your decompiler probably doesn't support records
as I said, use a better decompiler
does anybody have a clue?
why do you keep saying it's not your decmpiler's issue? your decompiler does not support records. period
wait this also a class, alex what version u on?
why do you even ask here if you don't listen to what anyone says
FernFlower decompiles records just fine, use that
cant read that
org.spigotmc:sp1got:remapped-mojang:1.19.4-R0.1-SNAPSHOT
remapped moj
1.19.4
1.19.4
probably cuz i didnt decompile but build it
i dont remember that having an emote in it
it turned :spigоt: into an emote 😭

I can’t tell if Alex’s recipe lib supports multiple choices for one ingredient
yeah mean MaterialChoices?
Yeah, with more than one material
for the last time before I'll block you: because ClientboundSetEntityDataPacket is a record, while the other stuff are normal classes
and your decompiler cannot handle records
use FernFlower
try to call a method that must be there with reflection, if it works then it's definitely your dec
whats the package for it
then use a newer version
use latest FernFlower and run it using java 17, then it'll work fine
is your ide up to date
do you see a pattern here?
oh fuck
ok have a nice day
Are you even listening to anyone?
because he is right
try to call a method that must be there with reflection, if it works then it's definitely your dec
the pattern is that when everyone tells you it's your deocmpiler, it's probably your decompiler being the issue
I'll stop answering now, this is a waste of my time
alex could you answer me instead pwease? :3
I mean if there was nothing in it the server wouldn’t ever be sending entities to you
And last I checked the server does do that
this one
Do you understand what a Record class is?