#help-development

1 messages Β· Page 380 of 1

rare rover
#

yes but they aren't all separate plugins

#

they are 1

lost matrix
#

Doesnt matter. EproCommon is also not a plugin.

rare rover
#

so which one is the main thingy

lost matrix
#

What are you trying to do?

sterile token
#

`--> Master (Parent)
--> Master-API
- src
- pom.xml
--> Master-Core
- src
- pom.xml

  • pom.xml`
#

there you have a more clarify example

rare rover
#

im trying to make nms in each module aka 1 class that contains all the version nms that is implemented into the main module

sterile token
#

If you see the parent, doesnt contain any src folder

sterile token
rare rover
#

yes

sterile token
#

and then each module per nms implementaiton

rare rover
#

yep

sterile token
#

take i ncare what i sent on top

sterile token
lost matrix
#

Bit outdated but the core concept is the same

rare rover
#

okay i'll check that out

#

but like im still a bit confused, since like will they all act the same with each one having an onEnable function that all run at the same time or is there a main one that only runs?

lost matrix
#

Only one needs an onEnable method.

#

The others are all shaded into the main project

rare rover
#

alrighty

#

i'll look at that resource and see if i can figure it out

worldly ingot
#

Remember when I said Maven modules are basically just subprojects?

rare rover
#

yep

worldly ingot
#

One project is nothing but utilities, classes, interfaces, etc., the other is an actual Bukkit plugin that extends JavaPlugin and whatnot

#

Or however you want to structure it

lost matrix
#

Its a pretty advanced topic. You basically need to define a bunch of Interfaces in your main project and
every module needs to provide an implementation. Like CraftBukkit provides an implementation for Spigot interfaces.

rare rover
#

okay but if the main src is removed which one would be the main one? That's all

worldly ingot
#

Both subprojects get built

#

They each get their own .jar

#

The parent project is empty. It's kind of like a dummy project that you can target build commands with to build all of its child projects

rare rover
#

oh okay

#

is there a way to make them all 1 .jar?

worldly ingot
#

Well you would shade one project into another, then the one that was shaded contains both

#

It's like when you shade in some other dependency from Maven central, only that dependency is the other module instead

rare rover
#

ahh

#

which has multi maven projects

#

ohh i see now

#

the first pom is just a dummy for all the modules

worldly ingot
#

And a common dependency for all the modules

rare rover
#

so which one would have the onEnable?

#

im guessing core

worldly ingot
#

Yes

rare rover
#

but this is all it has?

worldly ingot
#

That one's a bit of a bad example because it's a library, not actually a plugin lol

rare rover
#

which none of the classes extends JavaPlugin

worldly ingot
#

In theory, if it were a plugin, that core module would probably have a JavaPlugin class in it

#

This uses Gradle but it's a similar concept

rare rover
#

so technically, the first pom has every module which gets run? And then which ever one has the paper / spigot dependency and the JavaPlugin class will be the main?

worldly ingot
#

Well, "main", yeah

#

Then just shades them

rare rover
#

wait so instead of my making a paper project i make a "New Project?" and then add the paper on later?

worldly ingot
#

Your parent project is just a regular ole Maven project, yeah

#

You could include the Bukkit/Spigot/Paper/Whatever dependency in your parent pom.xml though because I'm sure your API and plugin will both use it

rare rover
#

okay so like this?

worldly ingot
#

Yep, and that Core would be your JavaPlugin class

#

Then you could create another module called API, and have your Core module's pom.xml depend on your API module. Then add Maven Shade

rare rover
#

!paste

#

oop

#

okay so

worldly ingot
#

The <parent> part is wrong if I'm not mistaken

#
    <parent>
        <groupId>me.outspending</groupId>
        <artifactId>core</artifactId>
        <version>1.0-SNAPSHOT</version>
    </parent>```
rare rover
#

yeah i see it now

worldly ingot
#

Shouldn't this be

    <groupId>org.example</groupId>
    <artifactId>PaperTesting</artifactId>
    <version>1.0-SNAPSHOT</version>```
rare rover
#

hmm

#

why would it be "org.example"?

#

it fixed it but why

lost matrix
#

<artifactId>PaperTesting</artifactId>

rare rover
#

well now how would this work?

#

still dont understand why its "org.example"

#

( this is another module )

lost matrix
rare rover
#

i must be missing something

lost matrix
#

This pom

rare rover
#

there is no "org.example"

#

yes

#

ohhh

lost matrix
#

ok

rare rover
#

but like

#

how

lost matrix
#

Show your 3 poms

rare rover
#

this is in the Testing module

#

alr one sec

lost matrix
rare rover
#

ohh im so dumb

lost matrix
#

This is inside your Main. Core and Testing need to define this as paren

#

Your Main pom should look like this

#

And your children only need to define another artifactId:

rare rover
#

wait so, how would i implement the Testing into the Core?

#

this is in Core

lost matrix
#

Core can depend on Testing

#

Just like usual

rare rover
#

huh?

lost matrix
#

I dont know the purpose of Core and Testing so i dont know where you are having difficulties right now

rare rover
#

it just ain't adding the dependancy

#

i need the things from Testing in Core

lost matrix
#

If you want to achieve a moduled nms setup then your Core never depends on any other module.

rare rover
#

then what should i do? Since im adding each nms version in a seperate module

#

then having a class that implements a interface

#

from API

#

( another module )

lost matrix
#

Ok then Core only depends on API
And every implementation module depends on API

rare rover
#

yes

lost matrix
#

Then you need another module named Distribution which depends on
all modules and throws everything into one jar file

rare rover
#

but how would i implement the things from another module to another

lost matrix
#

*But has no code in it

rare rover
#

this is so confusing, how would it throw everything into one jar while without any code? Couldn't i just implement everything into Core then put code in there?

lost matrix
lost matrix
rare rover
#

okay, but how do i use things from another module ;-;

lost matrix
#

Concrete example please

#

Which module needs to "use things" from another module

rare rover
#

well, if i need the access the interfaces from API how would i access them in Core?

#

because the dependency wont work

lost matrix
#

Core depends on API. Just add it in your pom

#

As a dependency

rare rover
#

ohhhhhhhhhhhhhh

#

couldn't thank you enough, sorry for taking your time

#

just some more practice and i should be good now i know the template

#

okay one more thing, how would i exactly put it all into 1 jar?

#

πŸ˜…

lost matrix
#

Extra module -> only has a pom which uses the maven shade plugin to throw all other modules into one jar

#

Click on the dist module

#

And then the pom

rare rover
#

so would that implement all code into that 1 jar?

worldly ingot
#

Yes. It shades everything into it

rare rover
#

ohhh, okay

#

my last question πŸ˜…

worldly ingot
#

Not entirely sure why they did that tbh. They could have done exactly that in the core one lol

lost matrix
#

Yeah

rare rover
#

my Core has the paper dependency so that means whenever i run the plugin that would be the main?

#

i removed the paper dependency from Testing

worldly ingot
#

There's really no concept of "main". They're all separate projects

lost matrix
rare rover
worldly ingot
#

Yeah the built .jar file would contain it

lost matrix
rare rover
#

okay

#

and i got this

#

i added the dist

#

which adds everything together

#

but it broke

#

it should have been found?

worldly ingot
#

tbqh I'd personally not have a dist module lol. I think it's a bit silly

worldly ingot
rare rover
#

meh, but why isn't it found?

worldly ingot
#

You probably just haven't built the dependency first. You would have to depend (and install) the -testing artifact

#

mvn clean install will install it to your local repo, then you can build the other project that depends on it

#

Order matters there

sterile token
#

Okay definitly i cant figure how to save the itemsπŸ’€

rare rover
#

okay so this jar should contain everything?

#

let me try to run it rq

worldly ingot
#

It should, yes. You could open it up with an archive viewer like 7zip or winrar and see the class files to double check

#

Or, yeah, just try and run it lol

sterile token
#

when saving the items

lost matrix
#

?npe

undone axleBOT
#

The NullPointerException, (commonly referred to as NPE), is thrown in the following cases, but not sealed to: 1. null is passed into a method or constructor which does not allow it; 2. When trying to access a field on an object pointing to null; 3. Casting null to a primitive. See https://stackoverflow.com/a/3988794/17047120 for information on how to debug NPEs.

sterile token
#

Hmn

#

I know how npe works

lost matrix
#

πŸ˜„ Recently learned about this

sterile token
#

But i cant understand the why i just want to fix this shit

lost matrix
#

Inventories can contain null values for empty slots

sterile token
#

haha

#

right

#

so i would check for null before

lost matrix
#

Yes

sterile token
#

okay im hopping i fix this

#

😬

winged anvil
#

anyone here use neovim as their primary ide ?

rare rover
#
org.bukkit.plugin.InvalidDescriptionException: Invalid plugin.yml
    at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:178) ~[paper-api-1.19.2-R0.1-SNAPSHOT.jar:?]
    at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:155) ~[paper-api-1.19.2-R0.1-SNAPSHOT.jar:?]
    at org.bukkit.craftbukkit.v1_19_R1.CraftServer.loadPlugins(CraftServer.java:423) ~[paper-1.19.2.jar:git-Paper-307]
    at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:278) ~[paper-1.19.2.jar:git-Paper-307]
    at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1100) ~[paper-1.19.2.jar:git-Paper-307]
    at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:305) ~[paper-1.19.2.jar:git-Paper-307]
    at java.lang.Thread.run(Thread.java:833) ~[?:?]
Caused by: java.io.FileNotFoundException: Jar does not contain plugin.yml
    ... 7 more ```
#

πŸ€”

#

which plugin.yml

#

lmao

#

help

lost matrix
#

Mysterious

rare rover
#

oh wait

lost matrix
#

What could this stack trace mean?

rare rover
#

yeah

lost matrix
#

^^

rare rover
#

but it does contain plugin.yml

#

...

#

where do i need to put it then?

lost matrix
winged anvil
#

i’ll be the first

lost matrix
# rare rover

Look into your compiled jar and see if the plugin.yml is in there

rare rover
#

hmm

#

πŸ’€

#

doesn't have anything

lost matrix
# rare rover

Also make sure your build section has the resources entry

rare rover
#

this is the dist pom

lost matrix
#

The Core pom

sterile token
#

Nop smile

rare rover
sterile token
#

till same issue, items are not getting saved, but now without NPE

lost matrix
rare rover
#

or all

lost matrix
#

only the dist

rare rover
#

all poms need the shade plugin correct?

#

or just the dist

#

still doesn't have anything in it

sterile token
#

smile, dude i cant fix this πŸ’€

#

Yesss it works

#

But keeps the old item

lost matrix
#

I got some stuff to do

sterile token
#

wait

#

1m please

rare rover
#

damn 😦

#

but why doesn't the dist jar have anything in it?

#

this is all i need

#

😒

sterile token
#

What the isuse josh?

rare rover
#

the dist has nothing in it

#

only the plugin.yml

lost matrix
#

How come we have Player#breakBlock(Block) but not Player#interact(Block)

sterile token
#

I just had an issue related to the menu items, when i select an item from the menu and drag it, in another slot, the item which i select to get drag still appear on the menu

rare rover
#

πŸ€”

#

;-;

#

it has the plugin.yml from Core but that's it

sterile token
#

josh re check everything

#

You must be forgettting something

#

Either plugin.yml not gettin inside the jar or the plugin.yml contains an invalid vlaue

rare rover
#

i dont think so? core and testing is good

round finch
#

Failing to decompile plugin.yml in jar

sterile token
#

GG

rare rover
#

but wont implement into the dist?

sterile token
#

I fixed!!!

round finch
#

?

sterile token
#

More than 6 hours coding a fucking editable menu

rare rover
#

core and testing has code but dist has nothing

vocal cloud
#

Lol

rare rover
rare rover
sterile token
#

Now your turn josh

rare rover
#

i'm so close!

#

i can feel it

sterile token
#

I wil ltry helping bro

rare rover
#

only dist is not working

#

that's it

sterile token
#

Send me a picture of all your modules showing the resouces and src of each

rare rover
#

everything else does

sterile token
#

basically i want to see your proejct structure and also send me the issue

rare rover
#

?paste

undone axleBOT
round finch
#

Did you remember to place plugin.yml in source

sterile token
#

yeah paste the issue there

rare rover
#

which is the only thing that isn't working

round finch
#

And not in random folder

rare rover
#

but i'll send Core and Testing

#

testing and core work

#

i think

#

...

#

...

#

im so dumb

#

nvm still didn't work

#

must be something with my maven config

#

would i clean the whole thing?

#

hmm

sterile token
#

wwhat are you doing??

#

dont modify the directories

#

I wouldnt do that

rare rover
#

okay, but why wont it add the code into the dist jar?

#

i thought it was something to do with the maven run config

sterile token
#

Hmnn

#

I would use maven shade plugin

rare rover
#

i am

sterile token
#

hmnn

rare rover
#

in all the poms

sterile token
#

can you upload whole project to github?

rare rover
#

yep

#

one momen

sterile token
#

Its better for me

#

right, tagg me pelase

#

Because im doing some things and i can forget

rare rover
#

πŸ‘

#

this is everything in the dist jar

sterile token
#

right

#

Parent pom, cant build any jar

#

dont call it dist

#

put a better name

rare rover
#

I built off dist

#

Using clean package

#

Only has the plugin.yml from Core? Which is weird

sterile token
#

wait

#

i will check all

#

explain what its what

rare rover
#

Core = paper plugin (main)
Testing = is just a test aka API
Dist = puts everything together in one jar

sterile token
#

Hmn right, i would make the core contai nall

rare rover
#

Core and Testing work fine has to do something with dist

sterile token
#

wait your strucutre is really confusing

rare rover
#

Ik

sterile token
#

also distrubution doesnt have any code

#

Really messy

rare rover
#

yes, that's what they told me to do

sterile token
#

Explain me your final goal

rare rover
#

put everything into dist jar

#

that's it

sterile token
#

And i wll make u the struture

rare rover
#

so i can run all the other modules into one

sterile token
#

i dont recommend using that structure

rare rover
#

what would you recommend then?

sterile token
#

you will use nms?

rare rover
#

yes

sterile token
#

so you will have many jars one for each nms?

rare rover
#

just 1 per nms

sterile token
#

yeah what i said

rare rover
#

there's going to be like 7 since 1.17 - 1.19.3

#

but

sterile token
#

I would do it like this:

Project-Name (Parent)

Api (Will only contain interfaces or abstract classes)
1.17 (will require modules, api, same for each different version you wan to support)
Core (will require all different versions, and will put them all together, also this module will be the only one contain the main plugin class)

rare rover
#

api will have an interface that will be implemented into the nms too

#

so i can set the nms version using the interface

#

ofc

sterile token
#

wait

#

1m

#

wait once i finish

rare rover
#

πŸ‘

#

okay but how do i implement all the classes in 1 jar?

sterile token
#

That is how must be work

#

So now recreate that structure first

rare rover
#

i just want to get dist working right now so i can make a good structure

sterile token
#

I cant help with that structure, its a mess

#

Harcoded?

#

You can make use of Configuration class for working with yaml files

vocal cloud
#

Hardcoded configs? You mean a data class?

sterile token
#

So check if the paths exists, if not getDefault() and add them

vocal cloud
#

If I understand they want to load a config into a specific class

#

Something like Jackson

sterile token
#

He wants to check if config path doesnt exists, then add it

#

thats what i dunderstand

#

Is that what you want sleepy?

#

Hee?

#

Please send your code

#

i cant udnerstand what you doing

#

Because harcoding doesnt mean that ΒΏ'

vocal cloud
#

Final really doesn't mean anything besides a statement of finality

#

If you do it right then anything can be final in a class

sterile token
#

final, means that a field cant be changed

#

final is used for fields which are not going to be modified

#

For example constants

#

If you mean what does final do on java

#

Then that field, can be modificable

#

Maybe mike explains better

vocal cloud
#

If it's a private field in a class you can prevent modification by only allowing it to be read

#

What are you trying to do here? Be as specific as possible

sterile token
#

more descriptive please?

vocal cloud
#

Yes anyone who decompiles can see it

sterile token
#

that has nothing to do with decompilation, all java code can be decompiled unless its obfuscated, but there ways to over engeenier it to get the code back

vocal cloud
#

You should use it because you're stating something is final. It should not be an excuse for bad programming though.

sterile token
#

I mean final is a Java acess modifier, which has nothing to do with decompilation

vocal cloud
#

Something that is final in nature can be made final without needing the value to be declared as such

sterile token
#

right

#

So core must depends on Bukkit_1_17_bla

#

let me find you an exmaple about something like that it will be easier for you

rare rover
#

okay so just implement all the modules into Main then get the jar from Main?

sterile token
#

wait

#

core depends on paper and must contain the plugin.yml

rare rover
#

yes

#

yes

sterile token
#

perfect

#

Then bukkit_1.17 depends on api and nms (or jar you need for that)

rare rover
#

API is in the NMS versions

#

and the API goes into the Main

sterile token
#

πŸ€”

rare rover
#

and NMS versions

#

into main

sterile token
#

you broken my brains

rare rover
#

since im implementing NMS for the NMS interface

#

here one sec

sterile token
#

uplaod current code

crimson scarab
#

does spigot have built in path finding

rare rover
#

this is V1_18_R1

#

that implements

sterile token
#

yeah perfect

rare rover
#

and then The NMS and API goes into core

#

so i can do

#

ect

#

and that's it

sterile token
#

Yes!!!

#

Like that

rare rover
#

πŸ˜„

sterile token
#

Now listen

#

NMS modules will depend on the paper jar for each version, but with scope provided, because you dont want to get them shaded

wet breach
#

It prevents it from changing later on. Non critical if you dont mark stuff as such but more to do with best practices as well as the conpiler and jit occasionally can optimize better when its marked as such

sterile token
#

so we talk easier

#

Multi modules

#

let move there

lost matrix
#

Should have asked me... My code looks like this for a reason πŸ˜„

#

Given this is a bit older and im not 100% into all this finality anymore

wet breach
#

Its mostly a compiler optimization then anything but should be used if you want to conform to so called strict standards lol

#

So to explain final for more thorough

#

There are 3 places it can be used

#

Objects, methods and classes

crimson scarab
wet breach
#

You use it on objects to make them constants. When used on a method it prevents the method from being overriden and when used on a class it prevents inheritance

#

@quaint mantle hope that helps better understand its use

lost matrix
proper notch
#

If ur asking what ppl prefer, I prefer gradle.

lost matrix
#

both are bad in their own little way

terse pumice
#

I'm using the destroy entity packet from protocollib but am struggling with inputting a list, they all come back with cast errors:
Cannot cast java.util.ArrayList to it.unimi.dsi.fastutil.ints.IntList at java.lang.Class.cast(Class.java:3889) ~[?:?]

terse pumice
#

i personally prefer gradle and am slowly moving over

lost matrix
terse pumice
terse pumice
#

I type "IntList" and it is just red and angry aha

lost matrix
#

Yes ofc you need to import it. But your IDE should do that for you

wet breach
#

Give it a try. Ignore people who want to compare in terms of performance. I say this because both can perform quite well. But unless you have something that is super large like compiling firefox for example you wont really see the difference. Also both have different ways they perform. Gradle will use all the resources available from the start and will only use less if you tell it to use less. Maven is the opposite. It will use the least resources and will only use more if you tell it.

terse pumice
lost matrix
terse pumice
#

5.0.0

lost matrix
#

Then you should have it. Its in Spigot even.

terse pumice
#

Hmm, not sure what's caused this then

lost matrix
#

What spigot version?

terse pumice
#

1.19.3

#

reloaded my maven just to check but no luck

wet breach
#

If on intellij and having issues, invalidate caches and or restart the ide. All others just restart the ide

terse pumice
#

Yeahh I restarted the IDE

lost matrix
#

Hm. Looks like spigot-api does not provide it. You need to include spigot in your project

wet breach
#

Well sometimes that isnt enough with intellij hence i mention invalidating caches

lost matrix
#

nope

#

Maybe it has a util for that

terse pumice
#

it may well do- sounds like a lot of digging haha

#

I'll swap out spigot-api for spigot then, easiest option

#

thank you for the help!

rare rover
#

anyone got a better way of doing this? Or is this fine?

private static void setNMSVersion() {
        String version = Bukkit.getServer().getVersion();
        switch (version) {
            case "1.17" -> {
                NMSVersion = new V1_17_R1();
            }
            case "1.18", "1.18.1" -> {
                NMSVersion = new V1_18_R1();
            }
            case "1.18.2" -> {
                NMSVersion = new V1_18_R2();
            }
            case "1.19", "1.19.1", "1.19.2" -> {
                NMSVersion = new V1_19_R1();
            }
            case "1.19.3" -> {
                NMSVersion = new V1_19_R2();
            }
            default -> {
                Bukkit.getLogger().warning("Your server version is not supported by HologramSK!");
                Bukkit.getPluginManager().disablePlugin(plugin);
            }
        }```
#

personally i dont think this is fine

#

and im lazy to use patterns

#

so like

wet breach
#

Could use enums instead

rare rover
#

true true

#

i could

lost matrix
#

Looks fine to me honestly

wet breach
#

You can stuff the new object creation into enum as well otherwise what you have is fine

lost matrix
#

Its only ran once, so no performance concerns.

swift drift
#

Does anyone know how to use mcedit or minecraft region fixer?????

wet breach
lost matrix
#

Yeah but going the extra step of using Enum.valueOf() is kind of whatever

#

But sure an Enum with a Supplier<NMSVersion> could work

wet breach
tender shard
lost matrix
#

Well it needs to be lazy

#

If you create an instance of an NMSVersion which is not on the classpath then everything breaks down

wet breach
#

Yeah only caveat to be careful with in regards to enum

tender shard
#

my nms thingy looks like this lol

    /**
     * Initializes NMS features. This needs to be called for all methods annotated with {@link NMS}
     *
     * @throws NMSNotSupportedException when the currently NMS version is not supported by this version of JeffLib
     * @nms
     */
    @NMS
    public static void enableNMS() throws NMSNotSupportedException {
        final String packageName = JeffLib.class.getPackage().getName();
        final String internalsName;
        if (McVersion.current().isAtLeast(1, 19)) {
            internalsName = "v" + McVersion.current().getMajor() + "_" + McVersion.current().getMinor() + ((McVersion.current().getPatch() > 0) ? ("_" + McVersion.current().getPatch()) : "") + "_R1";
        }
        else {
            internalsName = Bukkit.getServer().getClass().getPackage().getName().split("\\.")[3];
        }
        try {
            abstractNmsHandler = (AbstractNMSHandler) Class.forName(packageName + ".internal.nms." + internalsName + ".NMSHandler").getDeclaredConstructor().newInstance();
        } catch (final ReflectiveOperationException exception) {
            final String className = ClassUtils.listAllClasses().stream().filter(name -> name.endsWith(internalsName + ".NMSHandler")).findFirst().orElse(null);
            if (className != null) {
                try {
                    abstractNmsHandler = (AbstractNMSHandler) Class.forName(className).getDeclaredConstructor().newInstance();
                } catch (final ReflectiveOperationException ignored) {

                }
            }
        }
        if (abstractNmsHandler == null) {
            throw new NMSNotSupportedException("JeffLib " + version + " does not support NMS for " + McVersion.current().getName() + "(" + internalsName + ")");
        }
    }
wet breach
#

Thats too much for me

#

Good thing people like you create these nice libs though lol

rare rover
#

hmm

tender shard
#

i mean, how do you even access your NMS stuff? are you not using multiple modules?

#

I have to use reflection because otherwise the core module would depend on all NMS modules

tender shard
#

then how would one remap if all NMS stuff is in the same module o0

lost matrix
#

I told him that his classpath will be cluttered with all the nms versions. Choco told him that its fine.
Usually you would use a 3rd module which contains no code but only a pom with all nms modules and the core module.
It simply shades all nms modules and the core module into one jar

halcyon hemlock
#

Sup guys

wet breach
#

Dont need to remap if you dont deobfuscate

lost matrix
#

lol

#

And that too

tender shard
#

o0

lost matrix
#

But why would you not?

tender shard
#

yeah

halcyon hemlock
#

I use obfuscated code to increase my brain power and lower my brain cells πŸ‘

#

I'm now downloading linux to completely ruin my life as well

tender shard
#

imagine extending EntityInsentient, then overriding the x() method lmao

#

instead of using the proper names

wet breach
#

Since obfuscated code isnt anymore difficult for me to use or look at, i would be one of the few who wouldnt bother with the remapping stuff

halcyon hemlock
#

(EntityPlayer) ((CraftPlayer) player).getHandle().b.a.k is good code

lost matrix
#

If you dive deep into mojangs registry fkery you will beg for some mappings

wet breach
#

Suppose that is the advantage of knowing the code since essentially the beginning

halcyon hemlock
#

is ubuntu good?

wet breach
#

Depends

halcyon hemlock
#

It better be

#

I'm sacrificing my braincells for this

tender shard
#

e.g. to extend Entity

tender shard
#

as you can see in my picture, I did not declare any y() method

halcyon hemlock
#

Wait wtf

tender shard
#

it comes from the obfuscation of the super classes

halcyon hemlock
#

How tf is minecrafts own code clashing

tender shard
#

that's why one needs to use remapped for these things

halcyon hemlock
#

IntelliJ smoking smth again?

tender shard
#

no, it also wouldnt compile

halcyon hemlock
#

What happens if you 'Implement methods'

tender shard
halcyon hemlock
#

Β―_(ツ)_/Β―

#

Also why are you even extending that

wet breach
#

You dont need to use remapped. Obviously you setup your stuff to rely on such things so probably not going to be easy to just yank that out

halcyon hemlock
#

I can't even use remapped at this point, half of my codebase will burn

tender shard
halcyon hemlock
#

Could you tell me exactly what you're trying to do?

#

Also you could just extend the entity you're trying to make

tender shard
#

show people why using the "non-remapped" spigot .jar isn't always possible

lost matrix
halcyon hemlock
#

Let me try it

wet breach
halcyon hemlock
#

It just changes the names

tender shard
#

it might rename both "mySuperClassMethod" and "mySuperSuperClassMethod" to x() though

halcyon hemlock
#

Could you tell me what you're trying to achieve

tender shard
#

still, creating a custom entity

halcyon hemlock
#

NPC?

tender shard
#

for example, whatever

#

it was an example

wet breach
halcyon hemlock
#

Are you trying to create NPC or what?

lost matrix
#

He is doing holograms. I would honestly do holograms with ProtocolLib

halcyon hemlock
wet breach
#

I would wait till the update to do holograms

halcyon hemlock
#

Works fine for me

tender shard
wet breach
#

Anyways i was just providing a response to why someone might not use remap lol. I just dont use it as i dont need it

lost matrix
halcyon hemlock
#

I love obfuscated code, best ways to lose brain cells

tender shard
#

oh

halcyon hemlock
#

holograms, just use armorstands

tender shard
halcyon hemlock
#

packets and stuff

wet breach
#

Not saying people shouldnt use it. Use it if it helps you, its a tool like other many things lol

halcyon hemlock
tender shard
#

lol 1.17

#

now try it again in a proper version

#

1.19.3

#

on 1.19.3 you WILL see this

halcyon hemlock
#

1.17.1 is a good version

#

Don't hurt my poor feelings

#

I hate the new chat system

#

One second, It's indexing

lost matrix
#

Ugh, finally. Multiblock structures with a linked TileState are a logistical nightmare...

tender shard
#

this is the reason why "x() clashes with x()". one of the above is EntityInsentient, the other one is LivingEntity (which the first one extends)

halcyon hemlock
#

First of all, Why are you extending EntityInsentient?

#

When you can extend a proper Entity

tender shard
#

same thing when you extend the zombie directly

lost matrix
#

I dont see a single reason to not use moj mappings.

halcyon hemlock
tender shard
#

who would have guessed

halcyon hemlock
#

I'll redo it in 1.18.2

lost matrix
halcyon hemlock
#

I don't have build tools in 1.19.3

#

It takes a while

lost matrix
#

Hm does spigot have web hooks?
Im thinking about fetching BuildTools and running
remappings for every version every time there is an update.
On a private repo ofc

#

?stash

undone axleBOT
tender shard
#

old versions literally never get updates, so what's the point

#

and normal spigot gets updates like daily

#

so just run it for 1.19.3 every day and not bother for any old versions lol

halcyon hemlock
#

Ok

#

You win

#

I have no clue why it doesn't work on 1.17.1 +

#

Minecraft and spigot both are fucked I need to find a better thing to do

tender shard
#

because two methods with different return types out of two different super classes got renamed to the same name

halcyon hemlock
#

I'm not using remapped though, This is default

tender shard
#

exactly

#

if you'd use remapped, you'd see the original names

#

that don't clash

#

then you wouldn't see x() and x(), but swapHandItems() and createMobAttributes()

rare rover
#

would i have to send an entity packet every time the player changes the world?

halcyon hemlock
#

or just teleport

wet breach
halcyon hemlock
tender shard
#

it does work fine in remapped

wet breach
#

You can refer to methods snd objects by using their conplete path similar to how you use an import

tender shard
rare rover
#

is this good?

wet breach
#
net.minecraft.server.Entity entity``` to give example on using complete paths
tender shard
#

what does this have to do with remapped vs obfuscated?

wet breach
#

So of there was for some reason two imports for an Entity class that were different you would need to do this so the compiler can distinguish between the two in the code

tender shard
wet breach
#

You obviously dont understand

tender shard
#

maybe you can try to explain it again

wet breach
#

When you get things of differing types named the same thing, you have to use complete paths otherwise compiler doesnt know which you are trying to use

tender shard
#

how would I not understand this?

#

I am not using two different things that are called the same

#

i only wrote "MyCustomEntity extends EntityZombie" and that's enough for it to complain

halcyon hemlock
#

Just use 1.17.1 πŸ™

tender shard
#

i just use remapped, it's no problem at all

lost matrix
# rare rover is this good?
  1. Make it a marker
  2. You need to keep track of the entities ID or else you will never be able to modify the name or remove it again
halcyon hemlock
#

Ok now it won't complain

tender shard
#

are you using 1.19.3 meanwhile?

halcyon hemlock
wet breach
halcyon hemlock
#

it shows the error in 1.18.2 unless you override

tender shard
#

but it complains about y()

#

not x()

wet breach
#

Anyways its moot since you use remapped anyways

halcyon hemlock
halcyon hemlock
tender shard
#

so you are not using 1.19.3?

halcyon hemlock
#

super.y() would return the EntityLiving's y() so it should be all good

tender shard
#

how would I override that method? I would need to provide two methods of the same name with different return types

lost matrix
tender shard
#

so what should it return?

halcyon hemlock
#
    @Override
    public boolean y() {
        return super.y();
    }
#

return super.y() -> this returns the EntityLiving's y() method

tender shard
#

but what's the purpose, that would break everything that relies on "calling y()" on any of the super classes

tender shard
#

yeah imagine someone doing "yourCustomEntity.y()" now, while expecting that they actually wanted to use this:

lost matrix
tender shard
#

what even is that boolean y() method

halcyon hemlock
tender shard
#

ah I found it, it's Mob's shouldPassengersInheritMalus method

wet breach
halcyon hemlock
#

Good luck man

wet breach
#

I suppose you never done such things in code that required you to do that

halcyon hemlock
wet breach
#

Sometimes but its valid and sometimes required

tender shard
#

because it surely won't work by declaring y() twice in your own class

lost matrix
#

Bytecode injection into broken jar file

tender shard
#

lmao

#

what a great and "uncomplicated" way to fix a problem that could so easily be solved by erm... just using the proper mappings

lost matrix
tender shard
#

i still remember when I refused to use remapped in 1.17 because I didnt understand this maven stuff lol

lost matrix
#

Honestly it was quite the hustle at the beginning... And all the problems with the bleached wood fork as well...

halcyon hemlock
#

Override the conflicting method, I was just showing an example

#

if it is saying void y() is conflicting, override that instead ig

#

and do super.y()

warm light
#

how can I do runTaskTimerAsynchronously in bungeecord?

lost matrix
tender shard
#

what if I want to override both?

warm light
#

is there anything like ConsoleSender in bungeecord api?

tender shard
#

(System.out lol)

warm light
#

can't use color code there

halcyon hemlock
#

Btw I'm not sure

#

I'm pretty sure it shows in console

tender shard
#

nobody wants to have color in console anyway

#

you should only print stuff to console if something went wrong imho

lost matrix
# tender shard you should only print stuff to console if something went wrong imho
  ___   _                  _   _                                                                    
 |_ _| | | _____   _____  | |_| |__   ___  ___  ___   _ __ ___   ___  ___ ___  __ _  __ _  ___  ___ 
  | |  | |/ _ \ \ / / _ \ | __| '_ \ / _ \/ __|/ _ \ | '_ ` _ \ / _ \/ __/ __|/ _` |/ _` |/ _ \/ __|
  | |  | | (_) \ V /  __/ | |_| | | |  __/\__ \  __/ | | | | | |  __/\__ \__ \ (_| | (_| |  __/\__ \
 |___| |_|\___/ \_/ \___|  \__|_| |_|\___||___/\___| |_| |_| |_|\___||___/___/\__,_|\__, |\___||___/
                                                                                    |___/           

Those are the best. Why wouldnt i want to scroll twice as long to reach important messages.

tender shard
#

everyone wants to know that "ThisPluginThatOnlyAddsSomeTinyStuff" got enabled

#

it should also have some rainbow color to satisfy my gayness

#

and to fuck up the logs a bit more

#

gradle uses ant? o0

lost matrix
#

wut?

tender shard
#

idk, doing "gradlew -version" outputs sth about ant version

lost matrix
#

How do leashes behave? What are the conditions for a leash to not vanish.
Im trying to think of a way to display an electrical wire and i though i could just
attach two invisible armorstands to each other but the leash refuses to show on the client...

#

Do i need like a leash knot entity?

tender shard
#

they also easily disappear after a few minutes

#

same like falling blocks

lost matrix
#

Hm

tender shard
#

try AreaEffectClouds instead of armorstands

#

just a tiny idea

lost matrix
#

Well those wont work either. Maybe i need to send more data after the link entity packet...

tender shard
#

does it work when using just bukkit api instead of nms?

lost matrix
#

🀷

tender shard
#

try it

lost matrix
#

But good point ill try that first

tender shard
#

if that also doesn't work, it's probably client being a jerk again

#

damn how old is this plugin haha

#

i switched to nexus like 2 years ago

lost matrix
#

oof

#

ftp XDD

tender shard
#

ftps*

#

at least

#

i think it was ProFTPd or sth

lost matrix
#

Ok so ArmorStand -> ArmorStand doesnt work.
And leashing can only be done for LivingEntities.

tender shard
lost matrix
#

Ok i found my victims

#

Invisible slimes it is then

tender shard
#

oh yeah I've seen many people abuse slimes for things haha

tender shard
#

but does it still work when both are invisible?

#

check that using API before you waste your time on packets etc again

lost matrix
#

It better does...

tender shard
#

I'll meanwhile write another shitty blog post and watch some it crowd in the background lol

lost matrix
tender shard
#

nice, then it will also work with NMS

#

but

#

the particles

echo basalt
#

Bats have a smaller hitbox

#

In theory

lost matrix
#

Hello? Invisible byte flag?

#

Oh set the wrong bits...

#

Ok looks noice. Just some more fine tuning.

#

But why are they not aligned...

tender shard
tender shard
lost matrix
lost matrix
# tender shard what is that for btw?

Ah im updating my machines plugin. Introducing energy and polishing it a bit so that i can
actually write monetized content for it in good conscience.

analog thicket
lost matrix
#

Code

#

Just some packets. Invisible slimes with a leash.

tender shard
#

he spawned two slimes and leashed them to each other

lost matrix
#

Im just facing a big problem for when to actually show those lines.
Because if a line crosses a chunk border then i cant send the player both
entity locations, can i. Or can i? Wait the client doesnt throw away packets
for entities which are in unloaded chunks.

#

Well that makes it easier...

tender shard
#

light shot yes

#

I would have used the builtin tool if I'd be on the mac

analog thicket
echo basalt
tender shard
#

for myself:

#

?remapped

#

?nms

lost matrix
tender shard
#

yeah

#

paperweight is a huge mess and only made for gradle

#

oh and obv it's for paper api, not spigot

lost matrix
#

Just a few days ago i had a multi module maven project and halfway in i realised that i wanted nms.
Problem: I was writing against paper. I discovered that there is actually a maven userdev plugin from some guy

#

Almost tried hammering in a gradle module in my maven setup. Glad i found the maven plugin tho.,

tender shard
#

paper api D:

#

paper api would actually be nice if they only did additions instead of also removing/deprecating everything

#

or adding incompatible changes (Advancement api, for example)

#

also paper contributors should just man up and just sign the CLA lol

#

i dont get why everyone is so afraid of signing it

lost matrix
#

What cla?

tender shard
#

the spigot one

#

?cla

undone axleBOT
tender shard
#

this one ^

#

when you contribute to spigot, you have to promise that you wrote this code yourself and didnt steal it somewhere

lost matrix
#

Ah yeah. I think ive signed this one a while back.

tender shard
#

paper doesnt have anything like this

#

they accept pull request from anybody and risk it getting taken down again

lost matrix
#

Because i really wanted something in the api.

tender shard
#

I could never contribute to paper anyway though, they banned me for sending a soundcloud link months ago

#

and then never answered my ban appeal

lost matrix
#

lol..

tender shard
#

i understand that it was wrong, but I still expected to at least get a reply

lost matrix
#

Are soundcloud links forbidden?

tender shard
#

well the song was called "fucking a fat girl"

lost matrix
#

XDDDD

tender shard
#

it's a song I made myself lol

#

it's about me processing my last hetero relationship

#

I bet that if I would have sent a song made by snoop dogg that mentions the n word 20 times, I would not have get banned

#

and that's the only reason why I am upset

tender shard
#

they could have answered "yeah okay that's indeed a shitty song, maybe you deserve a ban for that, but yeah, you apologized and we'll unban you in 6 months", I wouldn't complain then

lost matrix
#

Why did you go into a relationship with a girl you dont find physically appealing?

tender shard
tardy delta
#

\πŸ‘€

#

pov: desperate male

tender shard
tardy delta
#

heya

tall dragon
tender shard
#

then I downloaded grindr and I found out, I can have anyone I want if I only just ignore their gender

eternal night
#

I think alex got into that relationship to start the "get banned on paper" speedrun

hybrid spoke
#

forced love is also love

tardy delta
#

πŸ‘Œ

lost matrix
#

Im actually glad i got no gf at the moment. I got so much more time for my hobbies. And more money ^^

tender shard
eternal night
#

πŸ’Έ

tall dragon
#

i always say u can either have a gf or a nice car

#

im going for the car

tender shard
#

I don't really think that I caused many issues. I did talk about alcohol and sent a soundcloud link, but it's literally the only discord that ever banned me for that

lost matrix
#

If my ex would only stop trying to get back every other week... Makes it hard to forget

tender shard
tardy delta
#

πŸ’ͺ

eternal night
#

most on topic convo in spigot gene-

tall dragon
#

gotta stay focused kings

tender shard
remote swallow
eternal night
#

mb mb

tender shard
#

I would stop venting about paper's community if I'd at least get a reply to my ban appeal

eternal night
#

yea we have been looking into improving that

tender shard
#

e.g. someone saying "okay but you should have read the rules BEFORE joining, so that's why you are still banned" and then I wouldn't say anything against them anymore

#

but I can only tell my experience with paper and that's how it is

eternal night
#

did you end up fixing your gradle intellij plugin issue btw

tender shard
hybrid spoke
#

when i appealed some guy just sent me a dm saying "heyo, we received your appeal but we cant unban you because your time hasnt come yet"

tardy delta
#

πŸ’€

tall dragon
eternal night
#

did the 7.6 and 1.13 version combo not work ?

terse ore
#

@tender shard do u remember the docs command that sent you the docs link?

tender shard
#

gradle 7.4.0 runs no tests, 7.6.0 fails with "NoClassDefFound" for junit, and 8.0 complains about "broken build.gradle" file without telling me what exactly is broken

eternal night
#

on 7.6 you need the runtimeDep

terse ore
tender shard
gleaming grove
wet breach
eternal night
#

they are missing a dpendency needed due to a regression in 7.5

lost matrix
tender shard
eternal night
#

gradle 7.6 supports java 19

wet breach
eternal night
lost matrix
#

java 19 JEPs are kinda meh. Only incubations.

tender shard
#

repo is now updated

eternal night
#

I am using java 19 rn o.O

tender shard
quaint mantle
eternal night
#

are you sure the repo does not just have an outdated wrapper

#

that does not support java 19

wet breach
#

I am sure

tender shard
eternal night
#

Β―_(ツ)_/Β―

tender shard
#

google "jefflib github" then check out the ToastMessage class

eternal night
#

docs say 7.6 is the first to support java 19

#

maps with my experience

wet breach
#

But this is why i typically dont use gradle. Something as small as that breaks everything

left depot
#

For custom spawn change for blocks

#

which tutorial is the best?

gleaming grove
lost matrix
eternal night
#

you need the launncher 😭

tender shard
quaint mantle
#

its ok thanks

wet breach
tender shard
#

only using the junit version you sent still fails with the exact same error

lost matrix
#

did you clean after changing versions?

tender shard
#

I didnt, lemme try

eternal night
#

alex

#

literally

tender shard
#

clean also fails

eternal night
#

bump intellij to 1.13

#

for god sake

tender shard
#

that is what IntelliJ created itself

eternal night
#

I already told you

#

don't trust the intellij wizard

tender shard
#

1.13.0?

eternal night
#

yes

tender shard
#

ok lemme try

left depot
#

the block despawns and doesnt work well like the others

tender shard
#

its gonna take a while, the weird gradle plugin thinks it must download 600mb

eternal night
#

it downloads the idea yea

#

ya know

#

for testing

tender shard
#

yeah but from a server that can only cope 1mb/s

lost matrix
eternal night
#

seems like a personal issue 😏

tender shard
#

maybe it's an issue with my ISP, because usually I can download with 1.7 gbit

#

maybe a routing issue, who knows

tardy delta
#

dutch lol

paper venture
#

Guys I need some advice, I need to glow everyone within some radius for one special player, but unglow when entities leave this radius. I know how to make individual glow, but the problem is I don't know how I should trigger unglow, I mean it's easy to glow everyone in range using player.getNearbyEntities(), but I don't know when to unglow them...

lost matrix
paper venture
#

What do you mean?

lost matrix
#

Check periodically

eternal night
#

@tender shard ```patch
diff --git a/build.gradle.kts b/build.gradle.kts
index c4fd7c1..0482c8a 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -1,6 +1,6 @@
plugins {
id("java")

  • id("org.jetbrains.intellij") version "1.8.0"
  • id("org.jetbrains.intellij") version "1.13.0"
    id("io.freefair.lombok") version "6.6.2"
    }

@@ -13,8 +13,7 @@ repositories {

dependencies {
implementation("org.yaml:snakeyaml:1.33")

  • testRuntimeOnly("org.junit.jupiter:junit-jupiter:5.7.1")
  • testImplementation("org.junit.jupiter:junit-jupiter:5.7.1")
    }

tasks.test {

paper venture
#

So I need to check every entity in the world?

eternal night
#

there you go

#

runs like butter

#

the runtimeOnly thing was for the launcher not the jupiter api

tender shard
# eternal night bump intellij to 1.13

damn thanks, that actually worked. I wonder how did you know that this is the fix when the intelliJ docs say to use the version that the wizard suggests

eternal night
#

because docs can be outdated and I use latest ?

#

1.13 is 2 weeks old

tender shard
#

but if the docs say "do X and Y" then isn't it obvious that I do X and Y instead of Z

eternal night
#

if they have a github, maybe leave them an issue to fix it ?

wet breach
#

I thought you learned already the docs were severely outdated. So why are you still trying to rely on them?

eternal night
#

^

tender shard
lost matrix
# paper venture So I need to check every entity in the world?

No. Keep a Set<UUID> for each player to check which entities are currently glowing for him.
On your next poll: Get nearby entities and create a delta Set. (Which entities are now no longer in range)
and unglow those. Also add glow for every new mob.

tender shard
#

besides the official docs

eternal night
#

not considering me a source of information is somewhat rude 😭

wet breach
#

Well dont trust the docs when it comes to issues then

#

Just assume the docs are wrong when you do lol

tender shard
wet breach
#

Source code

tender shard
#

not everyone is on this totally unrelated discord server

wet breach
#

Dont you know

tender shard
#

if the docs are outdated, the API is shit

eternal night
wet breach
paper venture
tender shard
#

are you using my MorePDCTypes lib?

eternal night
#

OMEGALUL

#

mr alex

#

my friend

lost matrix
eternal night
#

how is your reading skull

#

the thing

#

where it says

#

to upgrade

paper venture
left depot
#

alr found my issue πŸ‘

#

had to read the intire code again

lost matrix
tender shard
# eternal night

I am using File -> New Project -> IDE Plugin. In the IDE I am paying for, and not very little money. Then it shows the following dialog:

#

then I clicked on these "docs" link

#

is it too much to ask for these docs to work?

#

in the intelliJ version I use? that costs like 400€ per year?

paper venture
left depot
#

xd

eternal night
lost matrix
wet breach
#

I always love the self fixing bugs

tender shard
#

idk but sometimes I feel like I'm the only person on this planet that manages to write docs that are up to date

#

if the docs are outdated, they shouldn't be there in the first place

wet breach
tender shard
#

then they shouldnt write any documentation

wet breach
#

It takes time to make code and then more time to make docs and update

tender shard
#

not really

#

you usually write the docs like 2 minutes after you changed the source code

paper venture
wet breach
#

Yep totally takes 2 minutes to update and write docs for super large projects

eternal night
#

alex the page it linked you to literally has the page

#

like one chapter down

tender shard
#

wdym?

#

I followed everything step by step as explained in this link

left depot
#

Fixing errors always gives more errors πŸ˜›

tender shard
#

if that link is wrong, it shouldnt be there

eternal night
tender shard
wet breach
tender shard
# eternal night

it seems however still very shitty to me that it's explained in step 7 of some random tutorial, instead of the wizard doing it itself. the docs for "how to create a new project wizard" claim that one can just use a new empty project that was created by the wizard

eternal night
#

I mean, ehhh, would not call it very shitty

left depot
#

I hope that my error has been fixed πŸ˜„

eternal night
#

not ideal maybe

#

should have linked the other page maybe

wet breach
#

I suppose if you have outdated software the wizard isnt going to magically give you up to date info

left depot
#

Console error -> Respawn cant be NULL

lost matrix
# paper venture Sorry for disturbing, but what is a manager...
public class GlowViewer {

  private final UUID ownerId;
  private final Set<UUID> targets = new HashSet<>();

  public GlowViewer(UUID ownerId) {
    this.ownerId = ownerId;
  }

  public void update() {
    Player player = Bukkit.getPlayer(ownerId);
    // Check diff here
  }

}
public class GlowViewManager {

  private final Map<UUID, GlowViewer> viewerMap = new HashMap<>();

  // Call on join
  public void init(Player player) {
    GlowViewer viewer = new GlowViewer(player.getUniqueId());
    viewerMap.put(player.getUniqueId(), viewer);
  }

  // Call on quit
  public void terminate(Player player) {
    viewerMap.remove(player.getUniqueId());
  }

  // Call in a scheduled runnable
  public void updateView(Player player) {
    viewerMap.get(player.getUniqueId()).update();
  }

}
eternal night
#

tbh I digress, glad its working

#

probably worth to read the rest of the docs

#

before doing deeper in

tender shard
left depot
#

I made this plugin from 1.14 to 1.19 for my own use

eternal night
#

to avoid more confusion down the line

paper venture
#

Thanks!!!

tender shard
#

especially if I'm paying for IntelliJ Ultimate instead of using the community version

eternal night
#

Β―_(ツ)_/Β―

tender shard
#

yeah but you can probably understand that I'm upset about it

eternal night
#

its not idea and certainly not a write as you read guide

tender shard
#

and ofc I know it's not your fault, and I appreciate your help in helping me fix this