#help-development

1 messages · Page 1316 of 1

hollow reef
#

how can i get chunks the fastest, as if a player would fly around the world? i want to mirror the chunks to another server

chrome beacon
#

Hm? For what purpose

hollow reef
#

like i want to mirror the java chunks to a bedrock edition server, via tcp socket (local)

chrome beacon
#

Why would you even do it that way

#

Just use Geyser

#

Or are you only after the Java chun generation?

hollow reef
#

yeah i only need the chunk generation

chrome beacon
#

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

hollow reef
chrome beacon
#

Should be good enough

young knoll
#

You could just pregen a world and then use a converter

#

depends if you want to do this more than once

autumn cave
#

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?

slender elbow
#

must've been force-pushed out for one or another reason, who knows

#

why does it matter?

#

(it doesn't)

autumn cave
autumn cave
wet breach
wet breach
#

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

mighty wind
#

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

mighty wind
drowsy helm
mighty wind
#

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

drowsy helm
#

equals isn't reliable

mighty wind
#

interesting

#

when did that come out

drowsy helm
#

a long time ago

mighty wind
#

hm ok

drowsy helm
#

you never know how equals will act with different memory refs etc

mighty wind
#

i should jusst be using names lol

#

my menu manager needs an overhaul anyway

#

just old i cbf updating it

#

rn...

drowsy helm
#

nooooo

#

names is even worse

#

never use names

#

If its for a ui use slot number or pdc value

mighty wind
drowsy helm
#

persistent data container

#

?pdc

drowsy helm
#

nbt wrapper

mighty wind
#

ah

#

ok

echo basalt
#

It isn't suitable in most cases because different item amounts are often not something we care about

thorn isle
#

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

pseudo hazel
#

that sounds wrong

thorn isle
#

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

pseudo hazel
#

lol

young knoll
#

Pretty sure that library is just called spigot

thorn isle
#

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

slender elbow
#

we got list persistent data types now anyway

mighty wind
#

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

chrome beacon
#

The entity meta data is a part of the WrapperPlayServerEntityMetadata packet

#

Set the meta data and send it

thorn isle
#

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

chrome beacon
mighty wind
#

is it possible to do a curled up armadillo

#

that is a baby

#

and make it invis+glowing

chrome beacon
#

yes

mighty wind
#

lets GOOO

#

tiem to figure out how

magic grove
#

how would one get into plugin development..?

pseudo hazel
#

by learning programming

#

and then determining what kinda plugin you wanna make

pseudo hazel
#

and then learn how to code using spigot /minecraft stuff

wet breach
#

?learnjava

undone axleBOT
#

For Beginners:

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

For Intermediate to Advanced Learners:

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

Practice and Hands-on Learning:

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

Free Resources and Documentation:

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

Community and Support:

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

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

wet breach
#

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

magic grove
#

tysm!

magic grove
wet breach
#

depends on how well you can learn and understand concepts

magic grove
#

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 💀

wet breach
#

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.

shadow night
#

IntelliJ is significantly heavier than Netbeans, but if you can run it is most of the time worth it

magic grove
#

furtherst ive gotten is a custom texture pack 😭

wet breach
#

better then nothing

magic grove
magic grove
wet breach
#

also, there is no rush when learning either. When something is getting you worked up or frustrated, just go play some games 🙂

thorn isle
#

to be honest, as someone who frequently uses super low end hardware, i've had more performance trouble with discord than intellij

thorn isle
#

it definitely is heavy but it's still manageable with a smidge of patience

wet breach
thorn isle
#

oh yes, intellij is heavier for sure, but in my experience discord is even heavier

thorn isle
#

so if you can run discord without lagging to shit you're probably free to pick either

magic grove
#

but alr XD

wet breach
#

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.

shadow night
thorn isle
#

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

wet breach
#

I meant the environment the IDE uses, not processes the IDE launches

thorn isle
#

i'm sure there maybe is a setting somewhere in the abyssal depths of the config

wet breach
#

both netbeans and intelliJ require the JVM to run

shadow night
#

hmm

#

launch netbeans with a javaagent when

wet breach
#

you can

magic grove
wet breach
#

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.

magic grove
wet breach
#

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

wet breach
#

can apply the same with learning. As you learn more, your code quality hopefully will improve too

magic grove
#

it took me like an hr just to make the files for the texture pack 😭

slender elbow
#

holy trackers

hollow reef
#

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

thorn isle
#

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?

hollow reef
thorn isle
#

Well if it doesn't work it's a problem

charred pendant
#

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!

chrome beacon
#

Also keep in mind that building 1.21.9 will build 1.21.10 as it was superseded

charred pendant
charred pendant
autumn cave
#

Still wondering about this too, ig it's all behind the details of the CI

slender elbow
#

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

autumn cave
#

Not my words

autumn cave
echo basalt
#

Does anybody know if the drop item packet gets sent if you have no item to drop?

weak wasp
#

?tryitandsee

#

?tryandsee

undone axleBOT
umbral shoal
#

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 {}
        });
    }```
thorn isle
#

what are you trying to do again

umbral shoal
#

Right now literally just read the console output and print it back into the console

#

just a simple echo script

thorn isle
#

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

umbral shoal
#

Crash silently?

thorn isle
#

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

umbral shoal
#

theres no way to just read the console output?

thorn isle
#

there's a root logger which all plugin loggers are children of and all console output will go through it

umbral shoal
#

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

thorn isle
#

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

umbral shoal
#

Using fawes api is way out of my scope if I cant figure this out, I am sure you can see that yourself too

thorn isle
#

this is by no means the first thing to try either

#

as your first project, that is

umbral shoal
#

I expected reading the console to be pretty trivial.

thorn isle
#

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

umbral shoal
#

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

umbral shoal
#

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

thorn isle
#

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

umbral shoal
#

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.

thorn isle
#

if the operations don't overlap, it shouldn't really matter if they run in order or not

umbral shoal
#

that way I can at least leave it over night instead of waiting there inputting the commands one by one

thorn isle
#

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

umbral shoal
thorn isle
#

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

smoky anchor
#

Have you tried Amulet ?
I feel like that one should be able to do whatever you're doing

umbral shoal
#
[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)
umbral shoal
smoky anchor
#

oh- :D

umbral shoal
#

So amulet isnt an option sadly

smoky anchor
#

Are you moving whole chunks ?

umbral shoal
#

I tried MCA selector, which was fast and worked. But it has one major limitation

thorn isle
#

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?

umbral shoal
#

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

thorn isle
#

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

umbral shoal
thorn isle
#

try ```java
Plugin fawe = Bukkit.getPluginManager().getPlugin("FAWE")
fawe.getLogger()

umbral shoal
#

courtesy of chat gpt if it wasnt obvious enough lol

thorn isle
#

i don't remember if the plugin name is FAWE or fastasyncworldedit

#

use whatever appears in /plugins

wet breach
#

and a chunk extends the entire height

umbral shoal
#

because its what I need? I am not sure whats confusing bout it. I am Copying an area thats several chunks big

wet breach
#

copying an area several chunks big is not quite the same as saying, moving entire chunks

thorn isle
#

the nuclear option is to read latest.log directly

umbral shoal
#

well, both ways of copying (individual blocks or whole chunks) will work for me, I am just trying to A solution

thorn isle
#

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

wet breach
umbral shoal
thorn isle
#

the issue is that this is their first java project

umbral shoal
#

but that would render my pc unusable during the whole process which I am not a fan of

thorn isle
#

and that might be a bit of a tall order

wet breach
thorn isle
#

so we're just going to jerryrig shit together so he can get it done one-off

umbral shoal
wet breach
#

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

umbral shoal
wet breach
#

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

umbral shoal
#

what exactly is your suggestion solving? I am a little confused

wet breach
#

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

umbral shoal
#

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

wet breach
#

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

umbral shoal
#

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?

wet breach
#

because your plugin will not have all the frills, bells and whistles that fawe has

umbral shoal
#

Fawe already splits large pastes into smaller chunks that paste in an Async manner

wet breach
#

you can't paste into spigot, async

#

so that is not really relevant

umbral shoal
#

so in short your solution would be to make my own world edit alternative so I dont have to work around fawes limitations

wet breach
#

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

umbral shoal
#

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

wet breach
#

no its not gigabytes in size

#

an untouched world that is freshly generated that is 10kx10k in size is like 10gb?

thorn isle
#

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

wet breach
#

yeah

smoky anchor
#

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

umbral shoal
#

would copying biome data also be possible?

#

Because Ideally I would like to keep this too

wet breach
thorn isle
#

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

umbral shoal
#

I dont need to paste any entities

#

or block entities for that matter

smoky anchor
#

block entities - chests, furnaces, other

thorn isle
#

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

wet breach
umbral shoal
#

There are no containers in the areas I want to copy unless crafting tables count as one?

thorn isle
#

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

umbral shoal
#

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

thorn isle
#

did you try the thing i suggested

#

before everyone started arguing about whatever

wet breach
#

because there is concepts that need to be understood

thorn isle
#

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

wet breach
thorn isle
#

i know for a fact that the fawe guys are fucking ultra-clowns

#

but hopefully not in this regard

wet breach
#

lmao

umbral shoal
thorn isle
#

e.g. they look at the free heap every tick and if it's < some value, they run System.gc

wet breach
thorn isle
#

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

wet breach
thorn isle
wet breach
#

fawe isn't the only one that does it but yeah

thorn isle
#

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

wet breach
#

well that api is only a suggestion to the JVM anyways

#

depending on how the JVM is tailored

umbral shoal
#

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

thorn isle
#

yeah, but with g1 at least it basically always does as told

wet breach
umbral shoal
#

right I recognize the syntax, but thats not the confusing part

thorn isle
umbral shoal
#

its all the classes and libraries and dependencies haha

#

I am on it, sorry for stalling

thorn isle
#

it's fine, just, sometimes people don't dare to ask questions and just give up instead

wet breach
#

well giving up is always easier

umbral shoal
#

I am assuming Plugin is a variable type?

thorn isle
#

myes

#

all plugins are instances of Plugin, including yours and also fawe

umbral shoal
#

do I need a dependency to use it?

thorn isle
#

no, it's part of bukkit

#

i mean yes, but you are already using bukkit as a dependency since you got this far

wet breach
#

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

umbral shoal
#

well I had to import org.bukkit.plugin.Plugin ... but I am guessing I am doing something wrong again lol

thorn isle
#

no, that's correct

#

you will also have to import core java classes like java.util.HashMap

wet breach
#

that is normal. You have to import classes that don't belong to your plugin

umbral shoal
#

is that... not a dependency? Is my terminology wrong?

thorn isle
#

kinda sorta

#

definitions are drawn in sand

wet breach
#

well I guess what I said is wrong

#

because you can import your own classes too

#

XD

thorn isle
#

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

umbral shoal
#

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?

thorn isle
#

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

wet breach
#

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

thorn isle
#

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

wet breach
#

yeah Location one I have seen where they import it from like JavaFX or something XD

umbral shoal
#

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

wet breach
#

worse case scenario it does nothing or it does do something just not sure what it did do

thorn isle
#

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

umbral shoal
#

Cannot invoke "org.bukkit.plugin.Plugin.getLogger()" because "this.fawe" is null I guess fawes plugin isnt insternall called fawe?

thorn isle
#

use whatever you see in /plugins

umbral shoal
thorn isle
#

that should probably be correct

umbral shoal
#

like the plugins folder in my server?

thorn isle
#

it's a command that lists all plugins

#

run it in the console or whatever

umbral shoal
#

oh

thorn isle
#

the actual plugin jar name can be anything and isn't tied to the plugin name

umbral shoal
#

right right

#

I foolishly thought /plugins was a file structure for some reason

thorn isle
#

understandable

#

that is the directory where plugins are

#

relative to server root, that is

wet breach
#
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

thorn isle
#

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

umbral shoal
#

Yeah still npe

#

its called FastAsyncWorldEdit

#

but I changed itto that, and it still returns null

thorn isle
#

open up your plugin.yml and add

depend:
 - FastAsyncWorldEdit

to it

#

this will instruct the server to load fawe before your plugin

wet breach
#

maybe they will eventually learn to not have to do that, but that suffices for now

umbral shoal
#

dont worry this is likely my first and last java project and my last plugin.

thorn isle
#

i could maybe see paper guesstimating a plugin's dependencies based on its class references, since they asm everything anyway

umbral shoal
#

OOO that did it

thorn isle
#

neat

wet breach
#

always the simplist things

thorn isle
#

now see if the messages are going through the logger

umbral shoal
#
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

thorn isle
#

i guess they use the bukkit logger or something equivalently clownish

umbral shoal
#

or, the world edit logger?

#

I think the entirety of world edit is just .. built into fawe

thorn isle
#

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

umbral shoal
#

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

umbral shoal
thorn isle
#

then set the time to 30

wet breach
thorn isle
#

i think it includes it in itself

umbral shoal
#

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

thorn isle
#

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

umbral shoal
#

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

autumn cave
# autumn cave Why/is the CI private? And does every commit generally have a build? Or there's ...

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?
  • 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!!!
sullen marlin
#

?xy

undone axleBOT
sullen marlin
#

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

chrome beacon
#

Yeah like half of those questions have already been answered

sullen marlin
#

^

thorn isle
#

off with their heads

umbral shoal
sullen marlin
#

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

umbral shoal
#

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

sullen marlin
#

I'm not sure logging is a robust way to do whatever you're doing this

umbral shoal
#

I just want a way that works, doesnt need to be robust anymore haha

sullen marlin
#

Surely fawe has an API?

thorn isle
#

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

sullen marlin
#

Yeah but aren't they just trying to find out when a command completes?

thorn isle
#

they are, but this is also their first java project, and using the actual fawe api is well beyond their pay grade

sullen marlin
#

Tbh isn't this all based on an assumption fawe can't queue commands? I'd check that assumption too

thorn isle
#

it should be able to but they don't have enough trust in it to work properly

sullen marlin
#

I think the fawe is gonna be lower pay grade than hacking logging

#

Is there a reason to doubt it

young knoll
#

I believe log4j started in 1.7.10

#

Don’t quote me on that tho

thorn isle
#

well... they use worldedit's api, which is known to be obscure and obtuse

sullen marlin
#

Gottem

umbral shoal
#

I'll do a quick test out of curiosity

sullen marlin
#

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

umbral shoal
#

well, it seems like fawe handled queueing up 15 or so commands, but I am still skeptical about thousands of commands

queen radish
#

Is there a list of the most widely used Spigot plugins, particularly those commonly used as dependencies?

chrome beacon
#

not really

umbral shoal
thorn isle
#

if it handles 15 there's no reason it can't handle 15,000

umbral shoal
#

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

thorn isle
#

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

umbral shoal
#

I suppose its worth a shot, I just have to write a plugin that will execute all thsoe commands from a file then

thorn isle
#

simple enough

umbral shoal
#

yeah we'll see if I figure it out lol

thorn isle
#

however i'm not sure if the console can use fawe

#

presumably maybe it can

umbral shoal
#

well, if I write directly into the command line it works

#

so I think so

thorn isle
#

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

chrome beacon
#

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

autumn cave
#

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.

chrome beacon
#

Not sure how it does?

autumn cave
#

Did you read?

chrome beacon
#

What part?

autumn cave
#

everything

chrome beacon
#

An end user doesn't need to know about the exact internals of the ci pipeline

autumn cave
#

My team does

chrome beacon
#

Doesn't matter much

chrome beacon
autumn cave
#

Because the documentation is unclear

eternal oxide
#

Pretty much you have convinced every one here that you are doing something dodgy by being so evasive.

autumn cave
chrome beacon
#

Your refusal to answer the question "why"

eternal oxide
#

BY evading explaining why you need this.

wet breach
#

?bt

undone axleBOT
wet breach
#

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.

autumn cave
# chrome beacon Your refusal to answer the question "why"

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

wet breach
#

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

thorn isle
#

did i hear auto update

#

deploying clown nukes

wet breach
#

and whatever it is you are doing is completely unnecessary in that endeavor

chrome beacon
autumn cave
wet breach
#

unclear in what way?

autumn cave
wet breach
#

I have contributed to buildtools, its open source

eternal oxide
#

Auto update is a terrible idea. So many factors could kill your server

wet breach
#

?hub

#

?stash

undone axleBOT
young knoll
#

You can easily just run buildtools in a cron job for auto update

autumn cave
young knoll
#

There’s a flag to only compile it changes were made

wet breach
wet breach
#

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

young knoll
#

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

autumn cave
autumn cave
chrome beacon
#

Prevention of what

wet breach
chrome beacon
#

^ and sometimes builds fail

autumn cave
autumn cave
chrome beacon
#

Why would it need to be

wet breach
autumn cave
chrome beacon
#

Also builds failing sometimes is just common sense?

wet breach
#

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

autumn cave
wet breach
#

but none of that is relevant to creating an auto-update mechanism because its not necessary information to make an auto-update system

thorn isle
#

why are you auto-updating again?

worldly ingot
#

?contribute

worldly ingot
#

All the info you need for contributing is here

autumn cave
chrome beacon
#

Again no reason to

wet breach
#

not really hence I never bothered

autumn cave
wet breach
#

first link on the top left, says jenkins, thats the CI

#

none of this is hidden -.-

chrome beacon
#

^ and BuildTools is on the jenkins as well

autumn cave
wet breach
#

Bukkit is the API and CraftBukkit is t he server, these get built first

#

Spigot-API is Bukkit API but with spigot additions

wet breach
#

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

chrome beacon
#

Or what do you mean by compatible?

autumn cave
wet breach
autumn cave
wet breach
#

if you click jenkins, it takes you to the CI where in the top left it says Jenkins

wet breach
autumn cave
#

Wait what's Spigot-RSS though 😭

wet breach
#

you can not download spigot from the Jenkins for like a decade now

autumn cave
chrome beacon
#

Build tools exists for a reason

autumn cave
chrome beacon
#

You cannot share the Spigot jars

wet breach
#

but you keep insisting for some reason they are

autumn cave
wet breach
#

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.

autumn cave
wet breach
autumn cave
wet breach
#

yeah obviously we don't care about the grandma's who don't know technology

autumn cave
#

Or a 5 year old that wants to start a Spigot server, idk, just someone with low technical skills is what I mean

wet breach
#

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

autumn cave
#

Guys I'm just trying to make it easier, lower the barrier to all this

wet breach
#

for who though?

autumn cave
#

My team, and ig everyone if this documentation is public

wet breach
#

so your team is dumber than an 8 year old?

#

probably should get a new team then

autumn cave
#

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

chrome beacon
#

I still don't see how the ci pipeline works would make anything for your team easier

wet breach
#

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

chrome beacon
#

Just wrap BuildTools with your own jar that runs bt and then the server automatically

#

If you want a more paper like thing

chrome beacon
young knoll
#

SpigotClip returns

chrome beacon
#

Nothing too advanced needed

wet breach
#

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

chrome beacon
#

That works too

autumn cave
chrome beacon
#

Not really a fat jar

#

Your jar can download bt and run it

wet breach
#

no need to physically move the jar when Java is completely happy with using a shortcut to a jar

chrome beacon
#

You'll run the risk of having an outdated BuildTools version then

young knoll
#

Which will eventually stop working

sullen marlin
#

This conversation is insane

#

I'm glad I stepped away

autumn cave
#

Why can't I just understand Spigot build numbers simply like Paper does, why are you guys gatekeeping all this CI info 😭

chrome beacon
#

md_5: 🍿

sullen marlin
#

Gatekeeping what info?

#

You are yet to explain wtf you want

young knoll
#

Pfft spigot has 4543 builds and paper only has 60? Trash

#

Yes I know they reset each version

sullen marlin
#

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)

wet breach
thorn isle
#

paper yeees

autumn cave
sullen marlin
#

answering questions is not a goal, sorry

autumn cave
#

Ok so I need to have a goal?

#

Why though?

thorn isle
#

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

sullen marlin
#

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

autumn cave
sullen marlin
#

I dont think I accept documentation as a goal either

autumn cave
#

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?

thorn isle
#

i just want all my (friend's) 5 star reviews back

chrome beacon
sullen marlin
#

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?

hybrid spoke
#

my goal is to find my goal

thorn isle
#

my goal is to flex with all the reviews

hybrid spoke
#

of your friends

thorn isle
#

yes

hybrid spoke
#

so basically flexing your friends

autumn cave
thorn isle
#

friends are a fortune

sullen marlin
#

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

autumn cave
sullen marlin
#

sounds like youre after this, both of which are open source and have nothing to do with build numbers

hybrid spoke
#

it feels like you are overcomplicating this steph

thorn isle
#

the number of downloads was also a pretty nice metric

autumn cave
# sullen marlin there is literally no info, the entire system is Jenkins detects git change -> r...

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

autumn cave
sullen marlin
#

it's more like every minute, but again entirely not relevant

autumn cave
# sullen marlin 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 🙏

sullen marlin
#

...

rotund ravine
#

Lol

#

You have too much patience

autumn cave
#

I also want to thank frostalf Olivo Jishuna

#

Thanks guys

thorn isle
#

no but really who do i have to throw a brick at to get my (friend's) resource resuscitated

thorn isle
#

the plugin got deleted on spigot

#

presumably because (my friend) accidentally made it depend on paper rather than spigot

eternal oxide
#

Flagged as a traitor now

thorn isle
#

despair

sly topaz
#

hopefully spigot does soft deletes and they can just bring the resource back without having lost download count/reviews lol

autumn ingot
#

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

sly topaz
#

vanilla doesn't have multiple worlds, just the one so connecting portals is something that has to be worked around

autumn ingot
#

im not sure if that event performs the same algorithm that vanilla does

sly topaz
#

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

echo basalt
#

open your ide and type on your keyboard

#

nun crazy

autumn ingot
#

PlayerPortalEvent on its own does work... but only with players. with other entities it doesnt

#

i may just use multiverse

sly topaz
#

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

autumn ingot
#

it just kind of sucks to add that extra dependency

sly topaz
#

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

autumn ingot
echo basalt
#

That's pretty cursed

thorn isle
#

Multiverse-netherportals does world portal linkage out of the box

#

Including nether and end portals

pastel axle
#

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?

pastel axle
#

Yeah I thought that might be the case, already rebuilding 😅

chrome beacon
#

Was fixed on the 13th

pastel axle
#

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

smoky anchor
pastel axle
#

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)

chrome beacon
#

1.21.10 superseded 1.21.9

#

Building .9 will build .10 as there is no reason to use .9

ebon topaz
sly topaz
#

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

smoky anchor
#

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

sly topaz
#

oh, I guess written books do

mortal hare
#

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!

quaint mantle
#

Right tool for the job type shit

weak wasp
#

Pretty sure Facebook is/was PHP, it clearly scales well.

#

2 billion daily active users

mortal hare
#

iirc

wet breach
mortal hare
#

c#

#

go

#

node

wet breach
#

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?

mortal hare
#

mostly due to async model

mortal hare
#

nowadays you have api's

wet breach
#

and you want to convince me without evidence that php magically doesn't perform because you said so?

mortal hare
#

that's quite the opposite of what i wanted to say

#

in benchmarks it loses due to lack of multithreading

wet breach
#

it has multi-threading, not sure what you are on

mortal hare
#

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

wet breach
#

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

mortal hare
#

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

wet breach
mortal hare
wet breach
#

not sure what you mean by blocking?

mortal hare
#

DB calls, IO

wet breach
#

ok, php can use ajax just like any other site

#

just fyi

#

who said use pure php for everything?

mortal hare
#

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

wet breach
#

sure and its cheap to spawn another process

mortal hare
#

not really

#

it adds up

#

there's a reason there's php worker processes

wet breach
#

yes really, php was in a time where resources were scarce and handled millions of requests

mortal hare
#

and thread pools in multithreading langs

mortal hare
wet breach
#

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

wet breach
#

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

mortal hare
wet breach
#

yeah no one cares

#

we have multiple cores and the sorts

mortal hare
#

you can scale memory more than CPU usage

wet breach
#

thats never been an issue since like the mid 2000's

mortal hare
#

it does matter

#

and memory is cheaper than top of the line cpu's

wet breach
#

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

chrome beacon
#

A majority of that is wordpress, but yes php is powering a large part of the internet

quaint mantle
#

Hosting php is dirt cheap though

chrome beacon
#

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

wild mulch
#

[20:22:55 ERROR]: Thread Netty Server IO #19 failed main thread check: Chunk getEntities call

chrome beacon
wild mulch
#

if protocollib packet interception counts, YES.

chrome beacon
#

Don't do that, you need to be on the main thread

wild mulch
#

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

chrome beacon
#

Command selectors?

wild mulch
#

why else would i use getSelector

chrome beacon
#

No one said anything about getSelector

wild mulch
#

ok

#

im using getselector

chrome beacon
#

I cannot read minds

wild mulch
#

kk

#

anywas

#

anwyways

#

how do i do it

#

i can send u the code

chrome beacon
#

You need to be on the main thread

wild mulch
#

so how the hell do i do that while being able to cancel the packet

chrome beacon
#

You can use the scheduler to run a task there

#

Where you the one trying to make an anticheat

wild mulch
#

anticrash*

chrome beacon
#

Ah yeah

wild mulch
#

im tryina add a /execute crash detection

chrome beacon
#

If you're worried about the selector selecting too many entities selecting that many entities isn't going to fix anything

young knoll
#

Can’t you do that in the CommandPreProcess event

chrome beacon
#

And also this ^

young knoll
#

You could just cancel the command if it uses @e with no limits I guess

wild mulch
#

cause people nest them

#

like /execute as @e run execute as @e

#

and it overflos

#

brb

chrome beacon
#

Why do you let random people use execute

young knoll
#

“Only my admins can use it”
“Why do they need it”
“Uhhhh”

chrome beacon
#

"Why are your admins crashing the server"
"Uhhhh"

weak wasp
#

Disgruntled with the management

wild mulch
#

idk i just try to prevent crashes

pliant topaz
#

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

umbral shoal
dark moth
#

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

thorn isle
#

get the vector from the attacker to the victim, turn it into a yaw-pitch angle and compare to the yaw of the victim

buoyant viper
#

bro wants to know who hittin it from behind

dark moth
#

: D

thorn isle
#

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

dark moth
#

Alright

thorn isle
#

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

eternal oxide
#

?paste

undone axleBOT
dark moth
#

But idk if its reliable

#

Urs seems better tho.

eternal oxide
thorn isle
#

well... maybe, not necessarily, e.g. the sword can do some area of effect attacks with the sweeping shit

thorn isle
#

so where the attacker is looking isn't a super reliable indicator

dark moth
thorn isle
thorn isle
# dark moth For some reason it says 404 not found blablabla
    /**
     * 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);
    }
dark moth
#

Oh there we go it loaded

buoyant viper
dark moth
young knoll
#

I believe he took it down

thorn isle
#

someone posted the epstein list on it

eternal oxide
#

was md5 on it? Coverup!!!

dark moth
thorn isle
#

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

eternal oxide
#

No idea, I carved that out with stone tools

mortal hare
#

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

onyx fjord
#

true

#

i really dislike annotation based DI

thorn isle
#

Amen

hybrid spoke
chrome beacon
dreamy glade
#

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.

weak wasp
#

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

plain vessel
#

I need a Java developer to help me with my inventory issue in Bukkit 1.12.2. Please message me in private.

chrome beacon
#

Just ask your question here

thorn isle
#

not sure whether to clown emote yet

weak wasp
#

🤡

plain vessel
#

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.

chrome beacon
#

block the COLLECT_TO_CURSOR inventory action

plain vessel
plain vessel
chrome beacon
#

video of what

#

if collect to cursor isn't what you meant just print/check the inventory action and block what it is

plain vessel
plain vessel
south ibex
lean arrow
#

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.

thorn isle
#

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

south ibex
#

Castle Siege plugin review/suggestions

plain vessel
echo basalt
#

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 🤮

plain vessel
zealous scroll
#

Does TabCompleteEvent actually work? It's not being fired

eternal oxide
#

yes

sullen marlin
#

Full stack trace

lean arrow
waxen hound
#

are you running the correct server version

lean arrow
#

I have another plugin on the server with the exact same spigot version and it works fine

waxen hound
#

r u using the same nms

lean arrow
#

Both have references to CraftPlayer yeah

sullen marlin
#

"spigot version"

#
at net.minecraft.server.MinecraftServer.lambda$spin$2(MinecraftServer.java:310) ~[paper-1.21.8.jar:1.21.8-60-29c8822]
#

?whereami

lean arrow
#

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

sullen marlin
#

how do you know the error is in a Spigot library?

lean arrow
#

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

chrome beacon
#

Both Paper and Spigot modify nms

remote swallow
#

id like to guess that papers spigot build data ref wasnt updated in that version

thorn isle
#

maybe the problem is in that you're using a spigot library on paper inflatable

chrome beacon
#

and Paper does so way more than Spigot does

remote swallow
#

so paper wouldnt remap your plugin to run on mojang map

lean arrow
#

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

chrome beacon
#

Paper has hardforked of Spigot

remote swallow
#

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

sly topaz
lean arrow
#

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

chrome beacon
#

Do make sure you used the right jar from the build (the one without prefix and suffix)

#

that's a common issue people have

lean arrow
#

holoplayers-1.0.1-21.8.jar is the one I've uplodaded

#

which I believe is the right one

chrome beacon
#

that's correct

remote swallow
#

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

lean arrow
#

So is the other plugin just beast moding it somehow

wet breach
#

as well as arguments for the JVM used

slender elbow
#

remember to add -Xint for extra integer support

solid cargo
# slender elbow 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

mortal vortex
# solid cargo I wholeheartedly and unequivocally endorse this recommendation. It is with great...

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.

tribal rover
#

can someone help me remove the credits from executable items? made with executable items how i remove it?

pseudo hazel
#

sounds like a lore thing?

#

you can probably just overwrite that

tribal rover
#

no, it was cause i had the free plugin now i got the premium and its gone

pseudo hazel
#

oh

#

lol

plain vessel
#

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.

pseudo hazel
#

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

plain vessel
pseudo hazel
#

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

plain vessel
#

Is it necessary to use NMS for simple inventories to protect against all this?

pseudo hazel
#

no

#

actually if you use nms you are more likely to make mistakes

plain vessel
plain vessel
pseudo hazel
#

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

plain vessel
#

Okay, thanks you

smoky anchor
#

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

pseudo hazel
#

thats not a bad idea

#

unless you are making s horrendous p2w server in which case, do not do anything steve said

tribal rover
#

someone please help, i have a jobs gui menu with images etc . how i install the gui on the server please help.

plain vessel
pseudo hazel
#

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

plain vessel
#

Understood

solid cargo
hybrid spoke
#

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

thorn isle
#

iirc that was the case at one point but i think they loosened the eula a lot some years back

hybrid spoke
#

oh yeah my knowledge could be outdated

#

last time i participated to large networks is quite some time back

thorn isle
#

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

hybrid spoke
#

"that being said, you can now purchase my user's data in the shop"

thorn isle
#

yeees

young knoll
#

They only loosened it around non-competitive servers

plain vessel
#

So it turns out that as long as the server isn’t competitive, it can use P2W or something similar, right?

thorn isle
#

if it's not competitive, is it really winning ♿

plain vessel
#

Reaching a certain amount of online players?

thorn isle
#

as in there are winners and losers

#

competition

#

players compete

slender elbow
#

i don't compete because i always win

hybrid spoke
#

or.. leaderboards. could also be on a building server - who has the best plot

#

something where you dont get a medal just for participating

gusty obsidian
#

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! ❤️

slate tinsel
#

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.

thorn isle
#

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

slate tinsel
chrome beacon
#

nms probably has a method for it

#

breakNaturally instantly breaks the block

#

iirc

#

The naturally means it will fire appropriate break events

slate tinsel
#

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)

thorn isle
#

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

slate tinsel
#

I want Block#getBreakSpeed but without the player paramter, instead a itemstack