#help-development
1 messages · Page 1316 of 1
Hm? For what purpose
like i want to mirror the java chunks to a bedrock edition server, via tcp socket (local)
Why would you even do it that way
Just use Geyser
Or are you only after the Java chun generation?
yeah i only need the chunk generation
Aight just use the spigot api get chunk method
Cache the chunks on the bedrock server afterwards
And disable world saving on the spigot side
i felt like this was really slow, because its in sync, i switched to paper because of async chunk loading but im still not happy with the result
Should be good enough
You could just pregen a world and then use a converter
depends if you want to do this more than once
Builds 2834 .. 2840 use Bukkit commit:
09f10fd90008c556aafbfaaa256fd7199db45056 SPIGOT-5950: Add PrepareSmithingEvent
However build 2839 Uses Bukkit commit:
4722b5f1f62b672e6594bae1da36056dc8fa9be8 401 Unauthorized
I've also found the same problem with build 674 which uses Spigot commit:
3750b6bbf150e75ecb6254e979cd99fe7a3399e2 401 Unauthorized
What's the issue here? Were these commits deleted perhaps? These builds are invalid right?
must've been force-pushed out for one or another reason, who knows
why does it matter?
(it doesn't)
I’m trying to understand the Spigot versioning system
I found 2 bugs in the versioning I think
Why are you going off of build numbers?
What you found was a commit pushed and then rolled back due to problems
Build numbers come from the CI and the reason you have multiple builds with same commits is because the CI periodically builds
Sometimes because dependencies changed
i have this weird bug in 1.21.8 where comparing itemstacks i generate, storing it, then checking if a player clicked this item
it doesnt compare the brewing stand properly
changing it to something arbitrary like a grass block fixed it, and the other items worked, broke updating to 1.21.8
is there smth funny going on lol
how are you comparing it
item.equals
you should be using ItemSTack#isSimilar
works for everything else, im not really worreid i just changed the material and it works, i was just curious if anyone else experienced this or if its known i mean its probably something to do with my ecosystem
equals isn't reliable
hm ok
you never know how equals will act with different memory refs etc
i should jusst be using names lol
my menu manager needs an overhaul anyway
just old i cbf updating it
rn...
nooooo
names is even worse
never use names
If its for a ui use slot number or pdc value
pdc?
nbt wrapper
equals just calls isSimilar && amount == other.amount
It isn't suitable in most cases because different item amounts are often not something we care about
i do wish the pdc was a bit more suitable as a nbt wrapper
as-is it's okay i guess, but needing all keys to be namespaced is kind of ass
ideally, only the top-level keys would be namespaced; anything under them is already "under" that namespace anyway
i also don't think it supports lists of compounds, but i could remember wrong
that sounds wrong
i remember there being some "library" that added list-of-compounds support, but it basically worked by turning the list into a compound and assigning the elements to keys 0, 1, 2, etc.
which, since they need to be namespaced, were actually yourplugin:0, yourplugin:1 etc.
total clown show
lol
Pretty sure that library is just called spigot
i think it was this
looks like there is a PersistentDataType<PersistentDataContainer[], PersistentDataContainer[]> TAG_CONTAINER_ARRAY, maybe i missed it before or maybe it's new
we got list persistent data types now anyway
anyone know how i can use packetevents to make a glowing armour stand
i have the basic tutorial from the tutorial but yeah i have no idea how to edit the metadata of an entity
The entity meta data is a part of the WrapperPlayServerEntityMetadata packet
Set the meta data and send it
to find what the different data is look here; https://minecraft.wiki/w/Java_Edition_protocol/Entity_metadata#Entity_Metadata_Format
what i like to do is to use nms to hold a distinct entity instance in memory, one for each player, and then use them to construct whichever packets i need, swap out the eid, and send it to the corresponding players
The EntityDataTypes class will also be of use
is it possible to do a curled up armadillo
that is a baby
and make it invis+glowing
yes
how would one get into plugin development..?
and then learn how to code using spigot /minecraft stuff
?learnjava
For Beginners:
Codecademy - Learn Java: Interactive Java programming course from basics to more advanced concepts. Perfect for absolute beginners.
https://www.codecademy.com/learn/learn-java
JetBrains Academy - Java Developer Track: Learn by doing with projects and challenges. It covers Java fundamentals to advanced topics.
https://www.jetbrains.com/academy/
Udemy - Java Programming Masterclass for Software Developers: Updated courses that cover Java 8 to Java 17 features. Suitable for those who prefer structured learning.
https://www.udemy.com/course/java-the-complete-java-developer-course/
For Intermediate to Advanced Learners:
Oracle Java Tutorials: The official guides by Oracle for Java programming—great for understanding the depth of Java.
https://docs.oracle.com/javase/tutorial/
Baeldung - Learn Java and Spring: Focus on Spring Framework and modern Java technologies. Best for intermediate learners aiming to expand their knowledge.
https://www.baeldung.com/
Practice and Hands-on Learning:
Exercism - Java Track: Solve exercises and get feedback from mentors. Great for practicing coding skills.
https://exercism.io/tracks/java
LeetCode: Practice your coding skills and prepare for technical interviews with Java.
https://leetcode.com/
Free Resources and Documentation:
Java Programming and Documentation: A comprehensive collection of Java programming guides, tutorials, and API documentation.
https://docs.oracle.com/en/java/
Community and Support:
Stack Overflow: A vast community of developers. Great for getting help with specific problems or understanding concepts.
https://stackoverflow.com/questions/tagged/java
r/learnjava on Reddit: Join the community of Java learners and get advice, share resources, and discuss projects.
https://www.reddit.com/r/learnjava/
Remember: Learning to program takes practice and patience. Don't hesitate to experiment with code and participate in community discussions. Happy coding! 🎉
the 2 best IDE's to use is NetBeans and IntelliJ
well there is a third if you want to be old fashioned want a bit of a challenge and that is eclipse
tysm!
how hard do you think itll be for me to make a custom plugin with like custom items..?
depends on how well you can learn and understand concepts
fair point 🤷♂️
which out of the 3 for beginers do ya think will get me faster
or does it not rlly matter..?
sorry im a bit stupid 💀
difficulty isn't because of complexity when it comes to programming mainly because you can always break things down to something simpilar. What gets hard to do is balancing simplicity with efficiency and optimal. As I said the two best IDE's are netbeans and intelliJ however these days many prefer intelliJ so I think you will find more guides in regards to that however what works on intelliJ will most times work with Netbeans exceptions being plugins for the IDE's of course.
IntelliJ is significantly heavier than Netbeans, but if you can run it is most of the time worth it
alr alr
furtherst ive gotten is a custom texture pack 😭
better then nothing
ive used it once before so i think ill be fine...
yeaa
also, there is no rush when learning either. When something is getting you worked up or frustrated, just go play some games 🙂
to be honest, as someone who frequently uses super low end hardware, i've had more performance trouble with discord than intellij
true truee
it definitely is heavy but it's still manageable with a smidge of patience
👀
personally netbeans is more suited for low end then intelliJ is simply because netbeans allows you to tailor the java environment to your liking where as IntelliJ is limited in that regard
oh yes, intellij is heavier for sure, but in my experience discord is even heavier
even that confuses me-
so if you can run discord without lagging to shit you're probably free to pick either
but alr XD
yeye
I didn't mean heavier really, just that netbeans lets you specify any/all arguments for the JVM and plus some, but intelliJ doesn't allow that as far as I am aware.
yay my phone can run IJ (funnily enough, it actually can and I did do that before)
you can specify them in the runconfigs if you mean the processes you launch, not sure about the internal jvm processes used directly by intellij
I meant the environment the IDE uses, not processes the IDE launches
i'm sure there maybe is a setting somewhere in the abyssal depths of the config
both netbeans and intelliJ require the JVM to run
you can
opinion on using yt? if I more just want to like make one specific thing..?
up to you, just keep in mind though the majority of youtube tutorials/guides tend to leave out at times critical information or gloss over something that is important. They are great for helping to understand a concept, not so much in the best practices department.
fair point..
last one XD, is it the typa thing i can do in like a week... or should I just pay someone to do it lol
don't see why not
just don't expect there to not be issues with it 😛
you can easily make stuff without optimizing and the sorts, but you end up with lots of bugs. Good if you need something quick, and then fix over a bit of time lol
hmm
can apply the same with learning. As you learn more, your code quality hopefully will improve too
it took me like an hr just to make the files for the texture pack 😭
yeaa
holy trackers
i know this looks like a xy problem but this code worked in 1.20.3 and now (1.21.8) it doesn't. The problem is the long[] storage being an empty array even though it should contain all block states:
for (LevelChunkSection section : chunk.getSections()) {
ByteBuf buffer = Unpooled.wrappedBuffer(new byte[section.getSerializedSize()]);
buffer.writerIndex(0);
FriendlyByteBuf stream = new FriendlyByteBuf(buffer);
section.getStates().write(stream, null, 0);
buffer.readerIndex(0);
finalStream.putByte((byte) (section.hasOnlyAir() ? 1 : 0));
if (section.hasOnlyAir()) {
continue;
}
// blocks
byte bitsPerBlock = stream.readByte();
finalStream.putByte(bitsPerBlock);
if (bitsPerBlock == 0) {
BlockState state = blockRegistry.byId(stream.readVarInt());
finalStream.putString(stringifyBlock(state));
} else {
int valuesPerLong = (char) (64 / bitsPerBlock);
int blockPaletteSize = stream.readVarInt();
finalStream.putInt(blockPaletteSize);
for (int i = 0; i < blockPaletteSize; i++) {
BlockState state = blockRegistry.byId(stream.readVarInt());
System.out.println("reading: " + stringifyBlock(state));
finalStream.putString(stringifyBlock(state));
}
long[] storage = stream.readLongArray();
System.out.println(Arrays.toString(storage));
SimpleBitStorage bitStorage = new SimpleBitStorage(bitsPerBlock, statesStrategySize, storage);
finalStream.putInt(Math.min(4096, storage.length * valuesPerLong));
bitStorage.getAll(finalStream::putInt);
}
the error looks like this: net.minecraft.util.SimpleBitStorage$InitializationException: Invalid length given for storage, got: 0 but expected: 256 -> the long array is empty and so the size is 0
im trying to encode the chunk at the fastest way possible, this is what i used back then
remember that there are multiple implementations for the palette that differ in how they read the data
currently you are hardcoding the impl of the hashmap and linear palette's, but e.g. global palette is different
and iirc sections with more than n different entries in the palette will use the global palette, rather than either of hashmap or linear
public static final PalettedContainer.Strategy SECTION_STATES = new PalettedContainer.Strategy(4) {
@Override
public <A> PalettedContainer.Configuration<A> getConfiguration(IdMap<A> registry, int size) {
return switch (size) {
case 0 -> new PalettedContainer.Configuration(SINGLE_VALUE_PALETTE_FACTORY, size);
case 1, 2, 3, 4 -> new PalettedContainer.Configuration(LINEAR_PALETTE_FACTORY, 4);
case 5, 6, 7, 8 -> new PalettedContainer.Configuration(HASHMAP_PALETTE_FACTORY, size);
default -> new PalettedContainer.Configuration(PalettedContainer.Strategy.GLOBAL_PALETTE_FACTORY, Mth.ceillog2(registry.size()));
};
}
};
in practice you very rarely get more than 8 bits, however
aside from that, eyeballing your code, it looks about right
but since you're already using nms, why not use the PalettedContainers directly?
im trying to send the chunks to a bedrock server and im using my own serialization method as its more understandable to me
Well if it doesn't work it's a problem
Hello everyone! ! I am having trouble installing the latest version of Build Tools (1.21.9) to perform on some NMS tasks on my plugins. I tried installing it using the BuildTools GUI but it keeps giving me the same error:
https://pastebin.com/FDPsP67z
Has anyone ever experienced this error before? Thank you for your time!
Run BuildTools in an empty folder
Also keep in mind that building 1.21.9 will build 1.21.10 as it was superseded
I am going to try this asap and I will come back to inform you about the result.
Good news! It compiled successfully! Thanks a lot..What was the problem?
Why/is the CI private? And does every commit generally have a build? Or there's often commits that are skipped in builds
Still wondering about this too, ig it's all behind the details of the CI
but why?
what do you gain from understanding it? it's just standard ci and git stuff, it takes the commit hash, builds fail, numbers are skipped, commits are force-pushed out, the hash points nowhere, etc
Not my words
I'm curious, what may seem standard to you may not be to others. Idk why I have to justify myself tbh, I'm just curious. And clarifying the "nightmare" is important to me, and that's what I want to do
Does anybody know if the drop item packet gets sent if you have no item to drop?
alright Ive got a long weekend infront of me, I can try tackling this. I managed to get the environment working and wanted to start with just a simple plugin that echoes all the console messages back into the console, but I might be stupid.
I thought this would be the simple part but I cant even get this working lol
public void onEnable() {
getLogger().info("ConsoleEcho enabled");
Bukkit.getLogger().addHandler(new Handler() {
@Override
public void publish(LogRecord record) {
String message = record.getMessage();
if (message == null) return;
System.out.println("echo " + message);
}
@Override
public void flush() {}
@Override
public void close() throws SecurityException {}
});
}```
what are you trying to do again
Right now literally just read the console output and print it back into the console
just a simple echo script
that might crash on paper since paper intercepts sys.out from a plugin and forwards it to the plugin's logger which then calls this publish method and round and round it goes
Crash silently?
you are getting Bukkit's logger which plugins don't use, rather than your plugin's logger or fawe's logger or the root logger
crash as in the server thread will lock the cpu at 100% publishing and duplicating the same record over and over
but it doesn't happen since you're attaching the handler to the wrong logger
theres no way to just read the console output?
there's a root logger which all plugin loggers are children of and all console output will go through it
to be fair I am trying to collect the pieces on what events to use from like 3 different documentations so honestly I am pretty lost
but i'd probably recommend using the fawe api instead of trying to look at the logs
they have a discord as well, they'll help you for sure if you ask there
Using fawes api is way out of my scope if I cant figure this out, I am sure you can see that yourself too
I expected reading the console to be pretty trivial.
logging in general is nontrivial; logging a message can be simple, but it goes through a lot of loops and hoops like filters, handlers, formatters, and all of those are arranged in a hierarchy
off the top of my head you can call getParent or something on your plugin's logger and that should presumably get you the logger you want
alternatively get fawe's logger specifically by getting the plugin instance and calling getLogger on it
this is going ot be a long weekend indeed
Right so I managed to get the parent but of course I am super smart and if I echo the message back into the console it creates an infinite loop of echoes lol
But hey thats promising on its own haha
Yeah honestly I think I'll just give up. The amount of time I have already spent on this could have been used to work on my project manually and I would have been a quarter of the way done alreadyy..
if I was interested in plugin dev this might make sense but I literally just have one issue that needs a solution
what are you trying to do again? paste things into a world? have you tried worldpainter?
that's basically this but with a gui where you can click and drop down structures and shit
Copy and paste billions of blocks from one location to another.
every single tool I tried, either isnt made to handle such large selections, or straight up doesnt work due to my requirements.
Fawe is the only thing that does work, but the problem is, it has a bug that limits the selection of Lazycopy. I informed the devs about it, they told me it will likely not be fixed anytime soon.
So my only option is to split the selection into smaller chunks that are under this selection limit, this translates to roughly 500+ paste operations.
So I was just trying to make a plugin that would execute the commands from a file in order, while waiting for the paste operation to finish before executing the next command.
if the operations don't overlap, it shouldn't really matter if they run in order or not
that way I can at least leave it over night instead of waiting there inputting the commands one by one
do you have in mind a specific message emitted by fawe when it's done pasting an operation?
if you figured out how to get the logger, and you know the message, i can guide you through the rest
I dont trust Fawe to keep track of thousands of commands queued up.
Each operation consists of:
set position 1 command
set position 2 command
copy command
set paste position
paste command,
This for 500+ sections. If any of these are skipped or executed out of order, things break.
personally i would probably just try it; my gut feeling is it should work fine
either way, if you have the message and figured out the logger, everything else should be a cakewalk
Have you tried Amulet ?
I feel like that one should be able to do whatever you're doing
[11:58:01 INFO]: First position set to (-13600, 60, -256).
[11:58:08 INFO]: Second position set to (-14112, 255, -768) (51581124).
[11:58:15 INFO]: 51581124 blocks were copied.
[11:58:22 INFO]: First position set to (-13600, 252, -51456) (104013828).
[11:59:02 INFO]: The clipboard has been pasted at (-13600, 252, -51456)
[11:59:02 INFO]: 34.046s elapsed (history: 95898594 changed; 2816736 blocks/sec).```
Here are all the messages that Fawe returns in the console when executing those commands respectively.
But yes I figured it should be trivial once I can
1. read these messages by my plugin
2. execute fawe commands in a way that produces these messages by my plugin (because these messages appear in the console only if the commands are typed into the console, otherwise they dont show up in logs at all)
it estimated that copying a single segment (just copy not paste) would take around 40 hours. Pasting would likely take even longer.
oh- :D
So amulet isnt an option sadly
Are you moving whole chunks ?
I tried MCA selector, which was fast and worked. But it has one major limitation
the message won't be sent by your plugin, it will be sent by fawe
unless they're a particular strain of dumb it will also be sent from their logger
how are you reading the lines from the logger currently?
I am moving whole chunks, but I do have to translate them vertically. I have to move them about 255 blocks up when pasted, so tools that copy whole regions or chunks wont work because they typically dont support this
if you're moving them by a multiple of 16 in any direction, it should be pretty trivial, but you'll need nms for it and that's definitely not beginner territory
Well, I am not.
Logger rootLogger = Logger.getLogger("");
rootLogger.addHandler(new Handler()
I tried this, which seemed to work for some log messages, but Fawe was excluded from it, unless I am being extra stupid
try ```java
Plugin fawe = Bukkit.getPluginManager().getPlugin("FAWE")
fawe.getLogger()
courtesy of chat gpt if it wasnt obvious enough lol
i don't remember if the plugin name is FAWE or fastasyncworldedit
use whatever appears in /plugins
why are we moving entire chunks?
and a chunk extends the entire height
because its what I need? I am not sure whats confusing bout it. I am Copying an area thats several chunks big
copying an area several chunks big is not quite the same as saying, moving entire chunks
the nuclear option is to read latest.log directly
well, both ways of copying (individual blocks or whole chunks) will work for me, I am just trying to A solution
it sounds r🅱️tarded and it is, but it's also already done by e.g. the multicraft control panel which makes it 100% okay
well if they were really relocating an entire chunk, the easiest would just be to read the region file for the chunk and move it to another region file
I was honestly close to just making an autohotkey script that would do this and write commands into the game
the issue is that this is their first java project
but that would render my pc unusable during the whole process which I am not a fan of
and that might be a bit of a tall order
yeah this wouldn't be quite the decent first project lmao
so we're just going to jerryrig shit together so he can get it done one-off
There are already tools for this, like MCA selector, but these tools dont allow changing the height of the paste regions.
so if we are moving stuff, and if you can get the selections. Then move your selections into a schematic file.
once you have them in a file, you would delete the selection first
what exactly should I be doing with this? Its not obvious to me, is this someting that goes at the top of the class, or inside the enEnable event? and what dependencies does it need?
then, you paste your selection in at the resulting place
or paste first, and delete last
as long as we have the selection in a file, you can take time in the whole pasting thing
what exactly is your suggestion solving? I am a little confused
just told you, we move the entire selection you are trying to move to a file. Store all the data.
then we delete the selection (not the file) since we are moving it, then you start putting in the blocks where you wanted them
what tool would I use to do that? Fawe refuses to save such a large selection into a schematic, any gui based tool crashes because it cant handle a selection that big. Fawe also refuses to paste such large selections even if I somehow manage to make a schematic out of it
The deleting part can be skipped, I dont need to delete it from the original location, just need ot paste it somewhere else
if you are making your own plugin, you would not use anything else additional as its not needed
you need the opposing corners you want copied so we can figure out what chunks need to be loaded
and then you would use something similar to how world edit saves to schematics
which is not overly difficult
then you delete the selection you already have once the file is complete
then you just paste where ever you are wanting but since we have the data saved you can just slowly paste in. Do note that the server is capable of handling million block edits in one go.
largest edit I have done which took something like 4-5 seconds was like 100million
I am a little skeptical that if a tool like Fawe can not handle such a large operation, why would an amateur hacky plugin written by me be able to do so?
because your plugin will not have all the frills, bells and whistles that fawe has
Fawe already splits large pastes into smaller chunks that paste in an Async manner
so in short your solution would be to make my own world edit alternative so I dont have to work around fawes limitations
what fawe says is async is the true term of async in that it will pause every so often to allow the server to do other things. Spigot treats async as meaning multiple threads.
long history on that I suppose why its like that lmao
Now the areas I would be pasting, we are talking billions of blocks, likely many gigabytes in size, most likely wont fit into ram in its entirety
no its not gigabytes in size
an untouched world that is freshly generated that is 10kx10k in size is like 10gb?
the thing is that fawe has to account for things being moved in not just multiples of 16 blocks, but at any multiple
if you're only moving in multiples of 16 blocks, you only really need to change the coordinates of each chunk or chunk section, which is extremely cheap
yeah
iirc block entities hold their position in their data
and POIs exist
those should be handled as well for full translocation, unless you don't really care about those :D
would copying biome data also be possible?
Because Ideally I would like to keep this too
Java and the server is capable of loading millions blocks worth of data in mere seconds and saving them even faster. I know because I have tested such things years ago and that was with old Java versions. With newer ones with updated java versions I can only assume the same test would probably be done double the speed it took back then
mmm block entities are a valid point
pois are whatever, they're transient anyway
that said, most chunks only have a dozen or so block entities
block entities - chests, furnaces, other
and if a block entity goes missing, the server will re-generate a default one accordingly
so unless you care about the chest contents specifically, it's also whatever
which world edit tosses out such data anyways
There are no containers in the areas I want to copy unless crafting tables count as one?
they don't
but yeah i'm not gonna be the one who's tutoring them into nms/mca format as their first java project
so frostalf you better stick around if you want them to do it like that
Anyways, the problem I am mainlyy seeing now is, what youre suggesting sounds infinitely more complicated than reading out the console log. And if I cant figure out that, I dont understand how I could wrap my head around this lol
^^
wouldn't be necessary, but their skills lacking will still make this difficult regardless though
because there is concepts that need to be understood
whatever you're doing with the root logger, do with the logger you get from fawe.getLogger() instead
that's fawe's logger, and unless they're clowns, they will be writing the "x is done" message through it
so attach the handler to it and see if you can see the message there
when it comes to plugins, should never underestimate the clowning portion regardless of who or where the plugin comes from XD
i know for a fact that the fawe guys are fucking ultra-clowns
but hopefully not in this regard
lmao
I am pretty sure I am missing some core java understanding to even utilize your suggestion hah.
e.g. they look at the free heap every tick and if it's < some value, they run System.gc
yes and no, more like the basics
so if you use fawe you'll have to disable system.gc with a jvm flag or else you'll get random ass full-gc cycles lagging everything to shit because fawe thinks the server is out of memory
and things like fawe why many guides in the JVM flags always recommend disabling that lmao
replace Bukkit.getLogger() with fawe.getLogger()
fawe isn't the only one that does it but yeah
i usually like to keep system.gc enabled to be able to manually clear the heap for debugging issues
which you regrettably still sometimes have to do even on prod
well that api is only a suggestion to the JVM anyways
depending on how the JVM is tailored
Yeah, my only experience with programming was c# and LSL(if you even know what that is) and C++. Ive never made anything on top of existing systems so the way how everything is written for minecraft plugins feels extremely confusing and convoluted. When a simple hellow world script has like 40 lines of code I am a little overwhelmed
yeah, but with g1 at least it basically always does as told
Java is similar to C# since C# has its roots in Java
right I recognize the syntax, but thats not the confusing part
do you have questions regarding this?
its all the classes and libraries and dependencies haha
I am on it, sorry for stalling
it's fine, just, sometimes people don't dare to ask questions and just give up instead
well giving up is always easier
I am assuming Plugin is a variable type?
do I need a dependency to use it?
no, it's part of bukkit
i mean yes, but you are already using bukkit as a dependency since you got this far
I guess technically the answer is yes, and that is the server api but you wouldn't need to shade this into your plugin or anything
well I had to import org.bukkit.plugin.Plugin ... but I am guessing I am doing something wrong again lol
no, that's correct
you will also have to import core java classes like java.util.HashMap
that is normal. You have to import classes that don't belong to your plugin
is that... not a dependency? Is my terminology wrong?
lol
okay, so, in java, every class belongs to a package, so as to uniquely identify it
there are probably 10 million classes named Plugin for various purposes written by various people in all the world
to uniquely identify them, they are put in a package; in this case org.bukkit.plugin
When you send me code snippets like that, is there an obvious way to figure out what classes I should import to properly use them?
org.bukkit.plugin.Plugin is the fully qualified name of the class you want to use
since it is a very verbose name to type out every time you need to e.g. create a variable, java has a way to create a "shorthand" for it in a specific class; writing that import at the top of the class instructs the system that when you say Plugin, you mean org.bukkit.plugin.Plugin specifically
and not, say, me.vcs2.voxelgame.Plugin
and if you do want to use two Plugin's from two packages you can't use imports
doubt you will encounter that anytime soon
but you use fully qualified names instead
to bring up the list of imports, press ctrl-space after typing out Plugin, and it will suggest the various imports intellij is aware of
generally, if there's anything that says "bukkit" anywhere, that's what you want to use
a common rookie mistake is to import some opto.Block class instead of the bukkit Block class
or some html parser Location class instead of the bukkit Location class
yeah Location one I have seen where they import it from like JavaFX or something XD
where does intelliJ get these suggestions? Like can it suggest complete nonsense that isnt even related to minecraft?
Anyways, I'll build this and see what it does
worse case scenario it does nothing or it does do something just not sure what it did do
intellij doesn't really know that you're doing something related to minecraft
it only knows what dependencies you have added into the project
in your case, you will have bukkit and the standard java libraries
so it will suggest anything and everything from those
Cannot invoke "org.bukkit.plugin.Plugin.getLogger()" because "this.fawe" is null I guess fawes plugin isnt insternall called fawe?
use whatever you see in /plugins
right makes sense
that should probably be correct
like the plugins folder in my server?
oh
the actual plugin jar name can be anything and isn't tied to the plugin name
understandable
that is the directory where plugins are
relative to server root, that is
Plugin fawe = Bukkit.getPluginManager().getPlugin("FAWE");
this should work if all we are doing is wanting to get FAWE's logger
as long as fawe is loaded, it will work that is, can still get NPE if you just use that code snippet just as it is lmao
if it's actually called FAWE and is in your plugin.yml depend list, which i actually kind of doubt
or well i think in onEnable it should return the plugin anyway, even if it's not a depend, but it might not be enabled yet
Yeah still npe
its called FastAsyncWorldEdit
but I changed itto that, and it still returns null
open up your plugin.yml and add
depend:
- FastAsyncWorldEdit
to it
this will instruct the server to load fawe before your plugin
maybe they will eventually learn to not have to do that, but that suffices for now
dont worry this is likely my first and last java project and my last plugin.
i could maybe see paper guesstimating a plugin's dependencies based on its class references, since they asm everything anyway
OOO that did it
neat
always the simplist things
now see if the messages are going through the logger
public final class FaweBatchExec extends JavaPlugin {
Plugin fawe = Bukkit.getPluginManager().getPlugin("FastAsyncWorldEdit");
@Override
public void onEnable() {
getLogger().info("ConsoleEcho enabled");
Logger faweLogger = fawe.getLogger();
faweLogger.addHandler(new Handler() {
@Override
public void publish(LogRecord record) {
if (record == null || record.getMessage() == null) return;
// Echo back to console
System.out.println("[Echoed] " + record.getMessage());
}
@Override
public void flush() {}
@Override
public void close() throws SecurityException {}
});
}
@Override
public void onDisable() {
getLogger().info("ConsoleEcho disabled.");
}
}```
heres my echo class. currently its not printing out anything into the console so. I dont think its working lol
i guess they use the bukkit logger or something equivalently clownish
or, the world edit logger?
I think the entirety of world edit is just .. built into fawe
it's a total replacement, so worldedit shouldn't exist on the server at all
we could maybe read the latest.log, but instead of that, it might be simpler just to manually wait x minutes in between commands
it won't be as fast as it could be, but it should be good enough
I did try listening to the bukkit logger before and that didnt return anything either. so I am not sure if that is the case
the problem is, from the manual pasting I have done the commands vary in paste times massively. Sometimes 10 minutes sometimes 20
then set the time to 30
doesn't fawe depend on world edit?
i think it includes it in itself
unless I set a wait timer of like an hour I wouldnt feel safe knowing one paste might jump to an unreasonable time compared to the rest and break everything
it's a total replacement in the sense that you won't use worldedit as a plugin on the server; fawe replaces it
you get the fawe jar instead of the worldedit jar
and you use the fawe commands to use e.g. worldguard, instead of we commands
it's kind of what paper is to spigot, i suppose
or, well, was; they haven't hard-forked
I have an idea, I'll go into the fawe source and find the code that outputs the "The clipboard has been pasted" string and see what logger it uses
What's the fastest/most efficient way I can get information on the Spigot CI? Should I create a forum thread, send an email etc... My questions are:
- ✅
Is the CI logic public/private, and why, and who's in charge?- ✅
Its private: #help-development message - ❓
Who's in charge?md_5, anyone else?
- ✅
❓ How do you decide that each commits in the 4 repositories Spigot/Bukkit/CraftBukkit/BuildData are compatible/buildable? (🚀 Goal: So I can create a build myself when I contribute new code to Spigot on latest or earlier versions like builds ending with-<letter>)- ❓ Why are there certain consecutive builds with the same exact commits but different file hashes? (🚀 Goal: So I can display what changed from the previous build) Something about the CI, but unclear what exactly it could be (dependency change? From where exactly?, periodic builds, what's the logic of the periodic builds?, somethid did change though) #help-development message
- ❓ ~~What are the conditions for the builds to occur? (🚀 Goal: So I can better explain the questiona above / related) Its using Jenkins, every minute ~~#help-development message
- ❓
Generally, are all commits found in builds, or it happens that some commits are skipped? (example: commit 1, 2. Only builds at commit 2. Commit 1 is never referenced in a versions json)(You're right, this is a complete waste of your time I am sorry, I can answer this myself) - ❓
Whats the timezone used on the /versions/ page? (🚀 Goal: So I can display the correct time in my auto-updater) ITS IN LOCAL TIME!!!
?xy
But worse
People have spent a lot of time explaining things to you and you haven't said a word about what you're actually trying to do
I think you'll find some of the answers to your questions pretty obvious if you think about them for a second
Yeah like half of those questions have already been answered
^
off with their heads
is there such a thing as a Spigot logger?
The server overarchingly uses log4j since $someversion, so you can hook that if you want
Idk when $someversion is
Maybe see what versions were affected by log4shell haha
looking at the fawe code to get that message it calls a method that calls a method that calls a method and so on and at the bottom I just found spligot().sendMessage()
I'm not sure logging is a robust way to do whatever you're doing this
I just want a way that works, doesnt need to be robust anymore haha
Surely fawe has an API?
so it sends the message to the command senser
makes sense
something you can try is implementing the CommandSender interface and listening to the methods that send messages
Yeah but aren't they just trying to find out when a command completes?
they are, but this is also their first java project, and using the actual fawe api is well beyond their pay grade
Tbh isn't this all based on an assumption fawe can't queue commands? I'd check that assumption too
it should be able to but they don't have enough trust in it to work properly
I think the fawe is gonna be lower pay grade than hacking logging
Is there a reason to doubt it
well... they use worldedit's api, which is known to be obscure and obtuse
Jish said it so it must be true
Gottem
I'll do a quick test out of curiosity
Assuming there's no API, you could also edit fawe to add a start/end operation event
Though maybe that is a bit higher paygrade
Someone would probably do it for $30
well, it seems like fawe handled queueing up 15 or so commands, but I am still skeptical about thousands of commands
Is there a list of the most widely used Spigot plugins, particularly those commonly used as dependencies?
not really
There is an Api, and it likely has an event for this honestly
if it handles 15 there's no reason it can't handle 15,000
And to be fair Id happily pay someone to do this haha. I just reallyy didnt want to make an account on the forums haha
my recommendation is to maybe try to just running the commands all at once and hope the queue works, then take a look at it tomorrow morning
and then work on a plugin for it if it didn't work
I suppose its worth a shot, I just have to write a plugin that will execute all thsoe commands from a file then
simple enough
yeah we'll see if I figure it out lol
should work then
you'll want to get Bukkit.dispatchCommand(Bukkit.getConsoleSender(), <command>), and read the list of commands from getConfig().getStringList()
you may or may not have to shove getServer() in between some of those Bukkit calls, idr whether the method is on server or bukkit specifically
chatgpt ought to get it done
I don't think worldedit likes their commands to be ran from console
Did you just post about the forbidden site
why though
Just don't mention it by name
Documenting this sort of stuff helps people use the proper way to download/update securely Spigot vs using third-party virus-prone websites like The forbidden site.
Not sure how it does?
Did you read?
What part?
everything
An end user doesn't need to know about the exact internals of the ci pipeline
My team does
Doesn't matter much
And you've yet to explain why
Because the documentation is unclear
Pretty much you have convinced every one here that you are doing something dodgy by being so evasive.
I don't mean to, what am I doing wrong?
Your refusal to answer the question "why"
BY evading explaining why you need this.
proper way to download and update spigot is using buildtools. It is clearly documented on the spigot site.
?bt
we even have a command here just for that
I already explained the build numbers are not really relevant since they are just the sequence of order the CI built them. Occasionally you might be missing a build number which is rare but generally happens becaue it contained a fatal flaw of some sort that it was better to delete it then to have millions come here to complain.
So that me and my team can easily auto-update Spigot instead of using -DIReallyKnowWhatIAmDoingISwear and knowing what to do in case a build is not working with our server setup (rollback to a previous build, halt auto-updates) and knowing how to contribute to Spigot when we get into that
you can no longer get spigot from the CI since many years now, but before that the public could download spigot builds from the CI
buildtools is open source, you can easily automate the update process
and whatever it is you are doing is completely unnecessary in that endeavor
You don't need to about the ci pipeline to know when to update though
This ^
Yes, but its unclear the pros and cons of using BuildTools and using The forbidden website, I'm even considering making a better BuildTools or improving the existing one
unclear in what way?
That's an intent I have
I have contributed to buildtools, its open source
Auto update is a terrible idea. So many factors could kill your server
You can easily just run buildtools in a cron job for auto update
I need to understand the CI pipeline to know what each builds are about though, and how I can contribute to Spigot when the time comes
There’s a flag to only compile it changes were made
each build is from a commit, which you can pull from stash
You don't though
you don't need to know anything about the CI builds
you are not making much sense at all in this or seem to refuse to listen to those who are more well versed in what you are trying to do
--compile-if-changed
Only compile if changes were detected in the BuildTools repositories.
This is useful for projects that require NMS dependencies on a build server.
Exactly! So why are there certain builds with the same exact commit for instance? That's odd, and idk why. I found a few exceptions like this and would like to understand them, unless this is documented somewhere already
Why not? I'm doing prevention here
Prevention of what
because the CI has a timer to build periodically also people could request a build to happen on the CI as well
^ and sometimes builds fail
That I did not know, how am I supposed to know that? Is there documentation on this somewhere? I still don't know if the CI is public/private. How do you know that 😭
That too is not documented (unless I'm wrong) and can be confusing when there's a missing build number
Why would it need to be
well since the CI is no longer publicly accessible there is no point in much of anyone knowing about this. However, yes there is documentation if you knew that the CI is using Jenkins and the most common setup is to have a timed build start
VS BuildTools builds on jenkins clearly indicate that a build failed
Also builds failing sometimes is just common sense?
there was many reasons why builds failed, sometimes it was just because Jenkins was being stupid
so you just build it again
the reason I even know all this is because I have been around MC/bukkit/spigot since basically the beginning of MC
I did not know that Spigot uses Jenkins as it CI, is it documented anywhere? Idk what a "timed build start" exactly means. I just don't know these things, is there a ?ci command we could add 😭
but none of that is relevant to creating an auto-update mechanism because its not necessary information to make an auto-update system
why are you auto-updating again?
You don't need to know this to contribute at all. You, as a contributor, do not interface with or use Jenkins at any point during your contribution. You build locally with Maven
?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
All the info you need for contributing is here
I haven't, maybe I'd be beneficial to document this sort of stuff for people that haven't been around this long
Again no reason to
not really hence I never bothered
- a rollback system, that's where it becomes relevant
The SpigotMC Developer Hub, home to the continued development of Bukkit, CraftBukkit, Spigot, and a variety of other open source projects.
first link on the top left, says jenkins, thats the CI
none of this is hidden -.-
^ and BuildTools is on the jenkins as well
Right, but a question I had was:
- How do you decide that each commits in the 4 repositories Spigot/Bukkit/CraftBukkit/BuildData are compatible/buildable
#help-development message
Bukkit is the API and CraftBukkit is t he server, these get built first
Spigot-API is Bukkit API but with spigot additions
I've read those
Spigot-Server is the same just the server portion and then combines the api into it
therefore the only repos you really need to be concerned with is Spigot-API and Spigot-Server
that is it
don't worry about BuildData, that is for buildtools
They must be otherwise the compile will fail? Also they're just the latest at the time the of build
Or what do you mean by compatible?
Its not explicit that Spigot uses Jenkins though:
the word Jenkins is not enough for you in that left image?
Yes, but some of our projects and Spigot is not listed
if you click jenkins, it takes you to the CI where in the top left it says Jenkins
not listed for the public
Wait what's Spigot-RSS though 😭
you can not download spigot from the Jenkins for like a decade now
Well I don't know that 😭
Build tools exists for a reason
Again, I haven't been around that long to know that Spigot was on Jenkins and was kept there privately
You cannot share the Spigot jars
thats fine, but also not relevant to your goals either as you have stated
but you keep insisting for some reason they are
I know
I know, I also know there was a spigotclip proposal that was refused a while back which would simplify this process
anyways you are acting like the IDE matters in order to make plugins when it doesn't, same with all this stuff you are looking into. Not really relevant to what you stated you wanted to make, however some of us here have no issue in explaining the history of things either if that is what you really want.
YES please 😭 can I have a history lesson, that's all I'm asking for
simplify a process that is already simple? what is so hard about downloading buildtools and just running it? Did you know build tools has a GUI component now where you can just click?
A grandma for example will find it simpler to download and run Paper than to ||download BuildTools, run a java command, wait 10min, then move the jar in another directory, then run that. And when you want a newer version of Spigot, you need to go to your BuildTools directory and run another command, wait 1min, move the jar again||
yeah obviously we don't care about the grandma's who don't know technology
Or a 5 year old that wants to start a Spigot server, idk, just someone with low technical skills is what I mean
but do know this, 8 years olds know how to work buildtools
if you are older and can't then know you are dumber then an 8 year old
That's mean, and I know some people in that situation
Guys I'm just trying to make it easier, lower the barrier to all this
for who though?
My team, and ig everyone if this documentation is public
That's just a mean thing to say. I've got people in my team that just don't have a lot of technical skills
I still don't see how the ci pipeline works would make anything for your team easier
then they should be the ones here learning it seems
and what olivio said is true as well, nor would knowing about the build numbers lol
Just wrap BuildTools with your own jar that runs bt and then the server automatically
If you want a more paper like thing
Or just a shell script really
SpigotClip returns
Nothing too advanced needed
I had a cron job that would just invoke buildtools, once the jar was created it would create a symbolic link in another directory that was networked and all my servers could update from that
That works too
MyCustomServerJar
- Spigot.jar
- BuildTools.jar
Is what you mean? (A fat jar), and in which directory is BuildTools running?
no need to physically move the jar when Java is completely happy with using a shortcut to a jar
But you could use one if you wanted to
You'll run the risk of having an outdated BuildTools version then
Which will eventually stop working
Why can't I just understand Spigot build numbers simply like Paper does, why are you guys gatekeeping all this CI info 😭
md_5: 🍿
Pfft spigot has 4543 builds and paper only has 60? Trash
Yes I know they reset each version
Tell us in one sentence what your goal is
Otherwise no one is going to help you (to the extent they weren't already tired of this)
fun fact, to just further prove build numbers are not really relevant. There is more then 60 builds of paper
paper yeees
Answer to these questions #help-development message, I've updated them. Guys I just want to know this info, is being curious not allowed? I don't mean to be a problem.
answering questions is not a goal, sorry
oh yeah
that reminds me
where was i supposed to get in touch with when i want a deleted resource restored again
asking for a friend
Because you've wasted enough time without a goal
People are happy to help general curiosity but you've gone a bit overboard
No one here is interested in dealing with your questions in the abstract anymore
My goal got deleted I think because of the forbidden website being mentioned, can I post it with the word replaced?
I dont think I accept documentation as a goal either
Hm, maybe I can explain the reason behind each question too?
What why not? Making documentation is a valid goal, unless what's your definition of a goal here?
i just want all my (friend's) 5 star reviews back
Publically documenting an internal system that outsiders do not have access to is kind of pointless
how jenkins works: detects git change -> runs java -jar BuildTools.jar --dev -> if successful, put details in buildnumber.json
it feels like you are using documentation as a facade for pointless questions
what is anyone going to do with said documentation?
my goal is to find my goal
my goal is to flex with all the reviews
of your friends
yes
so basically flexing your friends
Thank you for this 🙏, ok so you guys don't want this CI system to be public info at all, that's why you don't want to answer my questions much?
friends are a fortune
there is literally no info, the entire system is Jenkins detects git change -> runs java -jar BuildTools.jar --dev -> if successful, put details in buildnumber.json
thats what makes your questions so infuriating
I have added goals to each of my questions, if they don't fit your definition of a goal, plz let me know: #help-development message
View the Bukkit, CraftBukkit and Spigot changelog.
Check how up to date a Spigot or CraftBukkit version is and easily view changes that came after it.
sounds like youre after this, both of which are open source and have nothing to do with build numbers
it feels like you are overcomplicating this steph
the number of downloads was also a pretty nice metric
🙏 Thanks! Maybe I was overthinking it, this actually makes a lot of sense. My questions might’ve sounded too simple, but this explanation really helps.
Just to clarify: does your setup have Jenkins trigger builds on each commit push, or on a time interval (like every hour)? I’m guessing it’s time-based, since some builds seem to include multiple commit changes (for example, Spigot and Bukkit commits together). That would also explain the skipped commits I noticed if it’s indeed using timed intervals.
I've seen those, these are great
it's more like every minute, but again entirely not relevant
Omg this is HUGE md_5 🙏 Thank you, I was able to infer answers to many of my questions from this. I've got a last question that I think I have a pretty good idea on how to infer aswell, so I won't waste anymore of you time. You time has been extremely valuable even if you don't think so ⭐ Thank you, Thank you, Thank you 🙏
...
no but really who do i have to throw a brick at to get my (friend's) resource resuscitated
In what way
the plugin got deleted on spigot
presumably because (my friend) accidentally made it depend on paper rather than spigot
Flagged as a traitor now
despair
they can probably just send an email explaining the situation at the support email and hope for the best
hopefully spigot does soft deletes and they can just bring the resource back without having lost download count/reviews lol
is there a way to link nether/end portals between worlds in a purely vanilla fashion? meaning if i had a world called test and i entered a nether portal in it, it would automatically create a world test_nether if it didn't exist (i've already done this part) and find a portal location for it, or link a nether portal if one was already there. i need to do this because my main level-name world is a void world and i dont want it to be used. despite this seeming relatively simple i cant find any answers online, i saw TravelAgent was a thing but it got removed
just use multiverse-core/multiverse-portals
vanilla doesn't have multiple worlds, just the one so connecting portals is something that has to be worked around
could you not just use PlayerPortalEvent? https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/event/player/PlayerPortalEvent.html with setCanCreatePortal and setting the creation and search radius to whatever the vanilla features are
im not sure if that event performs the same algorithm that vanilla does
I would recommend checking the source of multiverse-portals for any gotchas
but from a quick look at the event, I'd say yes
if their listener count is anything to go by, it does seem more involved than one would expect sadly
hopefully most of that is just unrelated features to the linkage and the actual linking of worlds comes down to something more sensible
i doubt it's spigot's fault that it's this complicated, but this is kind of ridiculous tbh. i feel like it shouldnt be this difficult to link portals between worlds
PlayerPortalEvent on its own does work... but only with players. with other entities it doesnt
i may just use multiverse
The system for it is simply not there in vanilla, so you have to hook into all the right places to have vanilla-like behavior
it just kind of sucks to add that extra dependency
The concept of multiple worlds just doesn’t exist in vanilla so there’s holes like this on the platform
Ideally the world creation API would have means of doing this since it is kinda crucial when it comes to dimensions but an API for registering dimensions would prove difficult for Spigot as it is right now
oh wait, it looks like EntityPortalEvent has the same methods as the player one, i thought it didnt. let me try this out https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/entity/EntityPortalEvent.html
edit for people in the future: the solution is to use both PlayerPortalEvent and EntityPortalEvent
That's pretty cursed
Multiverse-netherportals does world portal linkage out of the box
Including nether and end portals
I have a mannequin I want to equip with a sword.
Mannequin e = (Mannequin) ent;
e.getEquipment().setItemInMainHand(new ItemStack(Material.IRON_SWORD));
This code doesn't work because getEquipment() returns null.
How do I fix it?
Update Spigot
Yeah I thought that might be the case, already rebuilding 😅
Was fixed on the 13th
Mmm, I last built on the 10th. That'd do it.
Yep, that fixed it. I think I also need to update BuildTools, I selected 1.21.9 but it built 1.21.10
yes, that's correct
there's no reason to build 1.21.9
clients can connect to 1.21.10 anyways
right, the dropdown says 1.21.9, builds a file named 1.21.10, implementing 1.21.10. Just confused me when I re-ran my script and it was still running an outdated jar (it was pointed at 1.21.9.jar)
1.21.10 superseded 1.21.9
Building .9 will build .10 as there is no reason to use .9
https://modrinth.com/mod/scholar
how hard is it to make a book like this to make a recipe book but not override original book stuff
I don't believe it'd be achieveable even with resource packs given books have no click events
you could maybe do something really hacky with dialogs, since they got a text input and clickable buttons
just a lot of resource pack shenanigans either way
yes books have click events
you can not make the book be bigger than vanilla book - have 2 pages visible
datapack creators have made do with what they can and pushed the book to its limits tho - see The Creepers Code
hot take: PHP is great for startup PaaS/SaaS platforms. Sure its shittier experience to code and overall not as performant. but hear me out. PHP hosting is so much cheaper than KVM's. You can host microservices on php far more cheaper than on node or java for price/request ratio
I mean just look at Tebex monetization SaaS platform. They currently hire senior laravel php devs
that means that php do scale enough to handle payment processing internationally on a large scale
please counter argument me because i want to hear your opinions!
Right tool for the job type shit
it was php, im not sure if its still php, but they had AOT compiler developed for php so it converted to some kind of binary executables or smth
iirc
not as performant compared to what?
you do realize php has been handling millions upon millions of people long before javascript or most other things right? During a time where resources were scarce?
mostly due to async model
before we didnt separated data from the view
nowadays you have api's
and you want to convince me without evidence that php magically doesn't perform because you said so?
that's quite the opposite of what i wanted to say
in benchmarks it loses due to lack of multithreading
it has multi-threading, not sure what you are on
no?
its blocking per php process
there's php process workers usually which allows concurrent requests
but they're wasteful in terms of resources being allocated for each process
compared to threads
uh huh
so how much resources are we talking here?
anyways, you are right, php doesn't use multi-threading (technically can) however it was parellelism I was thinking about
if you look at the benchmarks node.js web servers could handle 1000's of requests per second due to async nature that allows to handle multiple requests at the same time especially if someone is blocking the thread thanks to the event loop
meanwhile with php if something is blocking nothing can run during that time
just know javascript doesn't support multithreading either
yes but it supports asynchronous operations, which allows to web server handle requests when something might be blocking at the time of another request
not sure what you mean by blocking?
DB calls, IO
ok, php can use ajax just like any other site
just fyi
who said use pure php for everything?
lets say http request hits a db call, you can queue it to the event loop via async promises, that means another web request can finish at the time promise is being completed instead of blocking the single thread of js
with php you cant do that unless you spawn another process
which handles php in parallel
sure and its cheap to spawn another process
yes really, php was in a time where resources were scarce and handled millions of requests
and thread pools in multithreading langs
those days websites weren't that dynamic
do you just like forget that when it comes to resources php actually stays under what you tell it?
seems like you actually don't have experience with PHP =/
elaborate
I already told you php comes from a time period where resources were scarce, it couldn't just hog up 4gb of ram out of nowhere
and that continues into today
it is the same thing with Apache
it is why php can hook into apache so easily compared to any other language
it cant hog out ram, but it can hog out cpu usage
you can scale memory more than CPU usage
thats never been an issue since like the mid 2000's
this was not true back then
you could have servers with 8 physical cpu's
but you still couldn't go over a certain limit per-mobo
for ram that is
beowulf clusters which are still used today was the answer really to all the problems. And Apache and PHP work very well in such an environment almost as if they adopted that and designed for such things. Today with updates to PHP the so called performance gap is negligble and at times php out performs(this is all what most care about and nothing else as if only that is relevant). What makes PHP great is its ease of use, it has one of the largest pools of resources, its cheap to hire someone to do php since its an easy language to learn and work with.
does it have its problems? sure so does every single other language
If you personally dislike PHP that is completely fine, you don't have to like it. But to try and say it some how doesn't perform without evidence that it doesn't (Also remember PHP is powering 70% of the internet as far as I know from last I looked it up. Think it was 70%)
A majority of that is wordpress, but yes php is powering a large part of the internet
Hosting php is dirt cheap though
php doesn't use a lot of resources when idle
So hosting is cheap for smaller sites that don't have a lot of traffic
[20:22:55 ERROR]: Thread Netty Server IO #19 failed main thread check: Chunk getEntities call
Did you call get entities on the network thread?
if protocollib packet interception counts, YES.
Don't do that, you need to be on the main thread
but i need to run checks
how should i do that
i need to check entity counts
for selectors
and flag if its too high
Command selectors?
why else would i use getSelector
No one said anything about getSelector
I cannot read minds
You need to be on the main thread
so how the hell do i do that while being able to cancel the packet
You can use the scheduler to run a task there
Where you the one trying to make an anticheat
anticrash*
Ah yeah
im tryina add a /execute crash detection
If you're worried about the selector selecting too many entities selecting that many entities isn't going to fix anything
Can’t you do that in the CommandPreProcess event
And also this ^
nah
nono
You could just cancel the command if it uses @e with no limits I guess
Why do you let random people use execute
“Only my admins can use it”
“Why do they need it”
“Uhhhh”
"Why are your admins crashing the server"
"Uhhhh"
Disgruntled with the management
idk i just try to prevent crashes
well, noone really does execute nesting >3 times
so that shouldnt be a worry at all
even if, no normal player should be able to use this command, meaning the one's using it don't (or hopefully) have any malicious intent
Yeah honstly this whole endevour was just a waste of time... It seems like just giving fawe all the commands at once works perfectly fine. Thanks a lot of the help and telling me to think about the problem in a different way <3
So i want to detect a player that strikes someone from the back
But idk how to detect if they strike from the back or from the front
get the vector from the attacker to the victim, turn it into a yaw-pitch angle and compare to the yaw of the victim
bro wants to know who hittin it from behind
Hnnm.
Ig ill try that out
the easiest but kind of clownish way to get yaw and pitch from a vector is to construct a new Location and then call setDirection on it; it accepts a vector, and updates the pitch and yaw of the Location
Alright
you could also do the math yourself but this is more concise and probably more understandable to others not as familiar with the math involved
?paste
Looking to paste something? Try a code block or one of the following websites:
- https://pastes.dev/
- https://sourceb.in/
- https://mclo.gs/ (best for server logs)
I was thinking if they were facing the same way it should count as a backstab
But idk if its reliable
Urs seems better tho.
This is what I used https://pastes.dev/ORboLLwsqu
well... maybe, not necessarily, e.g. the sword can do some area of effect attacks with the sweeping shit
Oh
Didnt thinl bout that :P
so where the attacker is looking isn't a super reliable indicator
For some reason it says 404 not found blablabla
yeah this is basically what i'm recommending except you did the math yourself rather than relegating it to Location
/**
* Is the Player behind the Entity?
*
* @param player
* @param ent
*/
public boolean isBehind(Entity player, Entity ent) {
Vector playerDir = ent.getLocation().toVector().subtract(player.getLocation().toVector());
Vector entityDir = ent.getLocation().getDirection();
double relativeAngle = (Math.atan2(playerDir.getX() * entityDir.getZ() - playerDir.getZ() * entityDir.getX(), playerDir.getX() * entityDir.getX() + playerDir.getZ() * entityDir.getZ()) * 180) / Math.PI;
return (relativeAngle <= 60 && relativeAngle >= -32);
// inFront return (relativeAngle <=-135 || relativeAngle >= 135);
}
Oh there we go it loaded
huh, it doesn't send md5s paste site anymore? lol
As soon as u sent that LOL
I believe he took it down
someone posted the epstein list on it
was md5 on it? Coverup!!!
It looks good and i dont understand the math at the same time!
actually, this could be achieved with just entityDir.angle(playerDir), no?
did vector not have that method back when you wrote this 50 years ago
that said i'm not sure if we really care about the vertical component of the angle, only yaw
No idea, I carved that out with stone tools
is it just me or enterprise java is so full of shit
its overcomplicated overengineered mess that barely works
Reflections everywhere
immutability thrown out of the window
instead we have bullshit JavaBeans spec classes which are mutable by design
Amen
that's the downside of building on top of legacy code
this is true
Is there an event for breeding or at least feeding mobs (cow, pig, horse, ...) ?
I need a reliable way to check if the player successfully fed a mob.
There is nothing specifically for feeding you will have to use the PlayerInteractEvent with additional logic, but there is a EntityBreedEvent for when they make babies...
I need a Java developer to help me with my inventory issue in Bukkit 1.12.2. Please message me in private.
Just ask your question here
not sure whether to clown emote yet
🤡
InventoryClickEvent
event.setCancelled(true);
final ClickType click = event.getClick();
if (click != ClickType.LEFT && click != ClickType.RIGHT && click != ClickType.SHIFT_LEFT && click != ClickType.SHIFT_RIGHT) {
return;
}
if (event.getClickedInventory() != null && event.getClickedInventory().getHolder() instanceof OwnedKitHolder) {
player.getInventory().addItem(clicked.clone());
event.getInventory().setItem(slot, null);
session.addTaken(slot, clicked);
OwnedAPI.updateContent(session.getOwnedId(), event.getInventory().getContents());
return;
}
if (event.getClickedInventory() == player.getInventory()) {
final Integer originalSlot = session.findTakenSlot(clicked);
final Inventory gui = ownedHolder.getInventory();
final ItemStack existing = gui.getItem(originalSlot);
gui.setItem(originalSlot, clicked.clone());
event.getClickedInventory().setItem(event.getSlot(), null);
session.removeTaken(originalSlot);
OwnedAPI.updateContent(session.getOwnedId(), gui.getContents());
}
This handler controls item transfers between the plugin’s GUI and the player’s inventory.
CLICK with SHIFT is intentionally enabled, but i'm need to prevent the unintended behavior where SHIFT + double-click triggers Minecraft’s built-in auto-stacking.
This causes all identical items across multiple slots to be bulk-moved at once, bypassing our custom logic and resulting in unintended item loss or duplication.
Maybe I didn't explain it clearly, I can send the video in a private message.
block the COLLECT_TO_CURSOR inventory action
I'll try now
Can I send you the video in private messages?
video of what
if collect to cursor isn't what you meant just print/check the inventory action and block what it is
Always printed MOVE_TO_OTHER_INVENTORY, but if this is blocked, then SHIFT clicks will also be blocked.
I tried to do checks on the item in getCursor, currentItem, but all this does not solve the problem that I described and showed you in the video
Hey everyone can someone review my plugin and give me some suggestions/ideas for future updates
Hiya! Trying to fix a relatively simple issue:
[17:43:53 ERROR]: Command exception: /create global SuitSnap -2.56 142.00 0.59
java.lang.RuntimeException: java.lang.NoClassDefFoundError: org/bukkit/craftbukkit/v1_21_R5/entity/CraftPlayer
at holoplayers-1.0.1-21.8.jar/dev.suitsnap.holoPlayers.core.HoloPlayersBootstrap.CommandAPIExecutor.execute(CommandAPIExecutor.java:99) ~[holoplayers-1.0.1-21.8.jar:?]
at holoplayers-1.0.1-21.8.jar/dev.suitsnap.holoPlayers.core.HoloPlayersBootstrap.CommandAPIHandler.lambda$generateCommand$0(CommandAPIHandler.java:261) ~[holoplayers-1.0.1-21.8.jar:?]
In the past, I've found the problem I was facing was not using the Special Source plugin but I'm pretty sure I am (albeit maybe not correctly)
https://pastes.dev/CMxMKTHrOt
As far as I know, I've compiled BuildTools correctly and it only errors in the runtime, not during compilation.
Any help would be appreciated, I think I'm just not seeing something simple that's causing the issue.
help please
my advice is to give up and not allow shift click at all
beyond that your best bet might be nms which isn't easy either
Castle Siege plugin review/suggestions
In general, a 30 millisecond delay on shift-click helped, but I don’t know how reliable it is.
not a fan of this
delaying click checks by a tick is how dupes are introduced
I personally did my menus at work with the nms route where we we listen for the Slot's mayTake and mayPlace methods
but it was such a hassle idk if emulating is the better approach
also holders 🤮
Will this work through ProtocolLib? Or do I need NMS specifically?
Does TabCompleteEvent actually work? It's not being fired
yes
Bumping this :3
Full stack trace
are you running the correct server version
I have another plugin on the server with the exact same spigot version and it works fine
r u using the same nms
Both have references to CraftPlayer yeah
"spigot version"
at net.minecraft.server.MinecraftServer.lambda$spin$2(MinecraftServer.java:310) ~[paper-1.21.8.jar:1.21.8-60-29c8822]
?whereami
As in they're both depending on the same version :p it is a Paper server yeah, but the problem isn't a paper issue if the error is in a Spigot library
how do you know the error is in a Spigot library?
Well my understanding was that anything NMS isn't in Paper so I'd be surprised if it's elsewhere. Maybe I'm conflating Bukkit and Spigot too generously but I wasn't the one who created the 17 different standardisations
Both Paper and Spigot modify nms
id like to guess that papers spigot build data ref wasnt updated in that version
maybe the problem is in that you're using a spigot library on paper 
and Paper does so way more than Spigot does
so paper wouldnt remap your plugin to run on mojang map
The way I've done it in the past has been the exact same, even on the same server so I apologise if it wasn't obvious to me that they shouldn't be used alongside eachother but I genuinely had never run into issues with it beforehand
Paper has hardforked of Spigot
paper normally has a running remapper that remaps your spigot mapped pluign (from special source) to run on papers moj map server
run your server as spigot or use papers paperweight plugin with gradle or one of their 3rd party maven plugins if you want to stay on paper
it didn't use to be as much of a difference before, but since paper has hardforked from Spigot, the differences are only growing in size
I just don't understand how a different plugin on the exact same version on the exact server with the same dependencies and build process can access the class fine but maybe I should just refactor it altogether
Do make sure you used the right jar from the build (the one without prefix and suffix)
that's a common issue people have
holoplayers-1.0.1-21.8.jar is the one I've uplodaded
which I believe is the right one
that's correct
i checked the commit of paper you are running, it wont be remapping your spigot mappings to mojang becuase the mappings were still for 1.21.7
So is the other plugin just beast moding it somehow
java version matters sometimes
as well as arguments for the JVM used
remember to add -Xint for extra integer support
I wholeheartedly and unequivocally endorse this recommendation. It is with great confidence and enthusiasm that I express my full support for this course of action. I have thoroughly evaluated the options available, and I am convinced that this particular choice is the most beneficial and appropriate one. I urge others to consider this endorsement seriously, as it is based on careful consideration and a comprehensive understanding of the situation at hand.
Fancified by apple intelligence, i did not proofread
This statement has been meticulously and artistically enhanced through the unparalleled capabilities of Apple Intelligence. I must confess, however, that I have not subjected this masterpiece to the rigors of proofreading, for its brilliance transcends the need for mere mortal revision. Should any imperfections be discovered, consider them not flaws, but the charming fingerprints of creative spontaneity, left intentionally to remind the reader of its human touch amidst digital perfection.
can someone help me remove the credits from executable items? made with executable items how i remove it?
no, it was cause i had the free plugin now i got the premium and its gone
Are there clients that can literally hack the server's GUI, extract items, dupe, and scam the Bukkit API?
And if so, how can I protect myself from this?
I'm currently working with inventories.
if you write terrible plugins, maybe
but usually, its works just as bad as minecraft itself
as long as your players are not in creative mode, its a lot harder to spawn in items
I'm currently writing inventories using the regular Bukkit API.
but if you are talking about taking the items out of a menu inventory, as long as you cancel the event they cant take out the items
if you want an alternative you could look into using dialogs instead of inventories of your menus allow it
Is it necessary to use NMS for simple inventories to protect against all this?
event.setChancelled(true) in InventoryClickEvent, that is, enough?
No client can get around this?
By sending fake packets or something like that
I dont know how you could get around it
whenever I see hackers on server they usually just fly, not have weird menu items in their inventory
setting cancelled to true happens on the server
you cant just make up items in survival
Ok tysm
Okay, thanks you
I'd probably recommend watching some duping videos on those horrendous P2W servers.
Some explain how they do the dupes, so you could learn from the mistakes of others.
Don't ask in multiple channels, this belongs in #help-server only
thats not a bad idea
unless you are making s horrendous p2w server in which case, do not do anything steve said
someone please help, i have a jobs gui menu with images etc . how i install the gui on the server please help.
By the way, I have a couple of questions about P2W.
Does it P2W if the server has strong weapon/armor kits that can be purchased both with in-game currency and on the donation site?
As for the game currency, it can be earned, but it can also be purchased on the donation site.
I think (and in my opinion) pay to win is when you can buy game progression with real money in any way
but youll have to read the eula I think its more clearly defined there
its def a gray area
usually the grind required on p2w servers to get close to someone who uses his moms credit card is so absurd that its pretty much pay to win or prepare to play for 2 years straight
Understood
That would imo be disallowed. Taking an example from hypixel skyblock.
When they implemented gems, they disabled any pvp features, and allowed only pve (player vs enviornment)
that's pretty much the definition of P2W and against the eula
afaik you are only allowed to sell decorative items to players, which are not from mojang or whatever
f.e. you can't just sell grass blocks
but an awesome diamond sword skin with the enchantment "Makes You Cooler +1000" is allowed
iirc that was the case at one point but i think they loosened the eula a lot some years back
oh yeah my knowledge could be outdated
last time i participated to large networks is quite some time back
personally i've never read it and i never will because i'm morally incorruptible and everything i do is just and right so i don't need a bunch of legalese to tell me what to do
"that being said, you can now purchase my user's data in the shop"
yeees
They only loosened it around non-competitive servers
So it turns out that as long as the server isn’t competitive, it can use P2W or something similar, right?
if it's not competitive, is it really winning ♿
What do you mean by competitive?
Reaching a certain amount of online players?
i don't compete because i always win
player vs player
or.. leaderboards. could also be on a building server - who has the best plot
something where you dont get a medal just for participating
Hey!
I recently created a library called SpigotX to simplify GUI creation, event handling, and command management in Spigot plugin development.
This is my first time publishing a library, so I’m still figuring things out. And currently I’m the only one using it 😅
I’d really appreciate it if you could take a look, try the syntax, and let me know what you think, any feedback, suggestions, or critique would be super helpful!
🔗 GitHub Repository:
https://github.com/AdamTroyan/SpigotX
Thanks in advance! ❤️
Whats the easiest way to check how long it will take (ticks) for a tool, to break a block with the Block#breakNaturally(tool) method? Its up to the player which tool is used.
to be fully accurate you also need to get the player's mining speed attribute and factor it in
from e.g. custom items or potion effects
If I use the "Block#breakNaturally(tool)" to break the block?
nms probably has a method for it
breakNaturally instantly breaks the block
iirc
The naturally means it will fire appropriate break events
Yeah, thats why I need to know how long it will take for the pickaxe to break the block (dont care about the players effects)
and there is no player involved at all in the method call, it physically couldn't know about a player's attributes
you can re-run the numbers from the mcwiki, or dig into nms
I want Block#getBreakSpeed but without the player paramter, instead a itemstack