#help-development

1 messages · Page 1863 of 1

hardy swan
#

Some design pattern just comes out naturally to describe what ik doing, instead of dictating what I should be doing

wet breach
#

and then if it manages to not crash, crash anyways by pushing a block outside the boundary

vagrant stratus
#

Just as it should be

jolly inlet
#

Do you wanna share some or do you have some specific tips, I am highly interested?

young knoll
#

Pushing tile entities should be possible server side

#

They may not render in motion on the client, but eh

jolly inlet
#

No, thats good.

modest shard
#

wot

vagrant stratus
modest shard
#

oh spigot jar is better?

quaint mantle
#

but can anyone answer me heh
do nested/inner record needs to be static?

jolly inlet
#

Then you make a new eclipse project like in the shown above tutorial.

wet breach
young knoll
#

Quark already does this with a few mixins

#

So it should be easy enough to do as a CB patch

jolly inlet
#

When you click on Spigot, is there another jar file?

modest shard
#

the spigot folder?

vagrant stratus
modest shard
#

the tutorial is 1.18.1 but im doing 1.18

hardy swan
#

but I don't sit down and think that I need that pattern

jolly inlet
modest shard
#

how so

#

just 1.18 in the version?

jolly inlet
#

Yeah.

modest shard
#

ye thats what ive been doing

#

but there is no craft bukkit jar file

quaint mantle
#

Let’s say I gave a player a block with the persistent data container of a key and the string key is hello

Is there a way to see if that key is there / get it if the block was placed and using the playerInteractEvent

Would event.getBlock().getMetaData work or no?

young knoll
#

PDC is in ItemMeta

modest shard
#

@jolly inlet what do i do if the craft bukkit is missing

quaint mantle
#

I see. Is there anyway to assign a value or data to that item and when they place that block/item I can check that blocks value when a user right clicks it via the event

modest shard
#

do i need to run the batch file again with craft bukkit specifications

hardy swan
#

Why is nms bell class implementation missing :'(

hasty prawn
#

BellBlock?

hardy swan
#

Under entity

#

One sec

hasty prawn
#

It's called BlockBell if you're using Spigot's maps

hardy swan
#

net.minecraft.world.level.block.entity.BellBlockEntity

hardy swan
hasty prawn
#

BlockBell and BellBlock are, yes.

#

What are you looking for?

hardy swan
#

Oopps bellblock it is

#

Im looking for its implementation

hasty prawn
#

Those are the implementations

hardy swan
#

I can find other classes' implementation other than bell in that package...

#

As in the methods' implementation

hasty prawn
#

Yes...? BlockBell and BellBlockEntity are the implementation classes.

hardy swan
#

That isnt what i meant

#

Im looking for how are the class's methods implemented

#

Or simply, the java file

hasty prawn
#

confusedCat I don't understand what you're asking for. Where the methods are called? The package that contains the BlockBell class file...?

hardy swan
#

I want to see the code of that class...

#

How else can i describe this

hasty prawn
#

So open the file LOL, I told you what it's called

hardy swan
#

You see, I can see how Beacon's method are implemented

hasty prawn
#

You want this?

hardy swan
hardy swan
#

hmm

hasty prawn
hardy swan
#

send me lmao

hasty prawn
#

net.minecraft.world.level.block.BellBlock, you're in the wrong package

#

It's not in entity

hardy swan
#

But there is indeed a BlockBellEntity class in the entity package, cuz I can import that class

hasty prawn
#

Well now how did you manage that KEKW What version are you using?

hardy swan
#

this is after i build 1.18 with --remapped

#

i think

hardy swan
hasty prawn
#

Hm weird, well if you end up needing the BellBlock you might just want to refresh your dependencies. It should be there.

young knoll
#

Bells are tile entities?

hasty prawn
#

No

young knoll
#

BlockBellEntity says otherwise

hardy swan
#

Or BellBlockEntity

#

Watever it is

hardy swan
hasty prawn
#

Oh yeah I guess they are

hardy swan
#

Welp anyone with the java file can send me plwase

#

I try running buildtools one more time

warm trout
#

Logging on, my friend can always see me glow

#

But I can never see him glow

#

I assume if the part that was throwing the error worked, he would see me glow as well]

#

You sure

dense heath
#

?jd

dense heath
#

Player docs

#

Spigot inner class on the player

warm trout
low temple
#

In mysql is it possible to only allow row selections through specific columns?

#

like if I have an "ID" variable am i able to make it so users can only retrieve rows through the ID variable?

low temple
#

cause doing SELECT * FROM TableName will display everything

#

id like to make it so people can only do Select * FROM TableName WHERE ID=?

young knoll
#

Don't think you can with just SQL

dense heath
young knoll
#

But you can limit them to interacting with it through an API

low temple
dense heath
#

I don't know of any SQL server implementations that allow per-column permissioning for visibility

low temple
#

im pretty new to SQL so i was just wondering if it was possible

#

time to learn JS for the api ig

dense heath
#

You don't need javascript to make a web api

low temple
#

oh i thought you did

dense heath
#

What are you most comfortable with?

low temple
#

Java

dense heath
#

Great, I there are a bunch of great Java web APIs

low temple
#

yeah ill see if i can learn some of it

quaint mantle
#

Javascript, often short as Java

dense heath
quaint mantle
#

he probably want to use java script not java lol

dense heath
low temple
#

ive done web dev stuff with js but im much more familiar with java

#

so if i can do it in java ill choose that

quaint mantle
#

the memes

tidal skiff
#

my main is greyed out and the server isnt seeing my plugin

#

ive had this problem before but i forgot how to fix it

dense heath
tidal skiff
#

something to do with plugin.yml

#

yeah ive chekced

dense heath
tidal skiff
#
name: Vanish
version: '${project.version}'
main: me.gamma.vanish.vanish.Main
api-version: 1.18
load: STARTUP
authors: [ Gamma ]
depend: [ProtocolLib]
low temple
#

did u try launching it?

dense heath
tidal skiff
#

maven

#

if thats what youre talking about

dense heath
#

Zip the whole project, send it here

tidal skiff
#

oh

#

aight

#

where do i find it again

low temple
#

@tidal skiff thats fine it should still run when you compile

#

its grey because its not used anywhere in the current project but will be used when the plugin launches

dense heath
tidal skiff
low temple
#

Just try running it on ur mc server, itll run

tidal skiff
low temple
#

Does it run?

dense heath
tidal skiff
#

lmfao

dense kestrel
#

mind sending the jar?

tidal skiff
#

do you mean left hand

tidal skiff
hardy swan
#

wont the jar corrupt if you send like this

dense kestrel
#

nah

tidal skiff
#

it was gonna be a vanish plugin originally but i started following a protocollib tutorial lol

low temple
dense kestrel
#

same for me

tidal skiff
#

ill try restart it

dense heath
low temple
#

I promise you that the greyed Main class isnt an issue

low temple
#

itll be an issue if there is an error in the console saying something about the plugin.yml not registering it properly

dense heath
tidal skiff
#

im just following the tutorial ngl so i have no idea

#

i probably am

dense heath
#

Today's mood

#

Send the part you have with the lambda

#

Just that whole onEnable block, even.

tidal skiff
#
    @Override
    public void onEnable() {
        ProtocolManager manager = ProtocolLibrary.getProtocolManager();

        manager.addPacketListener(new PacketAdapter(this, ListenerPriority.NORMAL, PacketType.Play.Client.POSITION) {
            @Override
            public void onPacketReceiving(PacketEvent event) {
                super.onPacketReceiving(event);

                PacketContainer packet = event.getPacket();
                Player p = event.getPlayer();

                double x = packet.getDoubles().read(0);
                double y = packet.getDoubles().read(1);
                double z = packet.getDoubles().read(2);
                boolean isOnGround = packet.getBooleans().read(0);

                p.sendMessage("INBOUND PACKET - x:" + x + " y: " + y + " z: " + z + " On Ground: " + isOnGround);

            }
        });

    }
lavish hemlock
#

hey that is a very nice looking API

#

reminds me somewhat of Fabric's

tidal skiff
#

thanks bro i made the api myself

#

the entirety of protocol lib

#

all me

hasty prawn
#

Impressive

tidal skiff
#

even spigot

#

i made spigot itself

dense kestrel
dense heath
tidal skiff
#

whats position_look

#

i assumed it was rotation

dense heath
#

Well, the client can send a couple different movement packets

#

Position look is when you move and turn at the same time. Some MC clients send this all the time instead of just the move

tidal skiff
#

im using badlion so ill try that and see if it works

buoyant viper
buoyant viper
#

ik

dense heath
buoyant viper
#

?

queen gulch
#

noob mistake most likely, but trying to setup spigot w/ gradle on eclipse, but i get the Unresolved dependency

#

maybe i forgot something? like running buildTools (but at where should i run it?)

buoyant viper
#

r u specifically trying to use spigot instead of spigot-api?

dense heath
tidal skiff
#

ok i fucked something up LOL apparently you need protocol lib in the plugins folder

buoyant viper
#

i

#

yeah

tidal skiff
#

i just had it in the build path

buoyant viper
#

u kinda need it

hasty prawn
dense heath
tidal skiff
#

ok well we're closer but now protocol lib is broken

hasty prawn
#

I mean as long as it isn't somewhere like OneDrive

buoyant viper
#

how 2 nms without buildtools? smh

hasty prawn
#

Which isn't technically on your computer, doesn't really matter. 🤷‍♂️

dense heath
#

compileOnly 'org.spigotmc:spigot:1.18-R0.1-SNAPSHOT'
should likely be
compileOnly 'org.spigotmc:spigot-api:1.18-R0.1-SNAPSHOT'

dense heath
buoyant viper
#

yeah but how tf u gonna know what u need without first looking at nms

queen gulch
#

i was reading off the documentation -- but if i was to

tidal skiff
dense heath
queen gulch
#

create a minigame, say, then shuoldn't i also be doing server logic, hence i should need spigot instead of spigot-api

dense heath
buoyant viper
tidal skiff
dense heath
dense heath
tidal skiff
#

oh probably

dense heath
buoyant viper
#

but what if i wanted to directly access nms components

tidal skiff
#

i set it to post world, same thing

dense heath
dense heath
hasty prawn
#

Why in the hell would you use reflection instead of just adding NMS into your classpath

buoyant viper
#

reflection is torture in its own right, but working directly is more fun

dense heath
# tidal skiff i set it to post world, same thing

It looks like that error is from accessing invalid stuff in the packets, though I'm not ProtocolLib guru.

I'd try filtering the packets like they GitHub for ProtocolLib examples show:

// Disable all sound effects
protocolManager.addPacketListener(
  new PacketAdapter(this, ListenerPriority.NORMAL,
          PacketType.Play.Server.NAMED_SOUND_EFFECT) {
    @Override
    public void onPacketSending(PacketEvent event) {
        // Item packets (id: 0x29)
        if (event.getPacketType() ==
                PacketType.Play.Server.NAMED_SOUND_EFFECT) {
            event.setCancelled(true);
        }
    }
});
hasty prawn
#

I don't support cross versions, any other reasons?

dense kestrel
#

cross versions would be the only reason to use reflection over just adding nms to classpath

dense heath
dense kestrel
#

😛

hasty prawn
#

Why should I?

buoyant viper
dense kestrel
#

i just made a core that handles all my cross version stuff

dense heath
dense heath
dense kestrel
dense heath
buoyant viper
buoyant viper
dense heath
buoyant viper
#

already did step 1

dense heath
buoyant viper
#

living is just expensive 😦

dense heath
hasty prawn
buoyant viper
dense heath
dense kestrel
#

I try to always avoid reflection and instead i end up just having a core with this

young knoll
#

Everything is expensive and I’m not even having a good time

dense heath
buoyant viper
hasty prawn
dense kestrel
hasty prawn
#

I update my stuff with MC, and drop old versions.

dense kestrel
#

all you do is add a new folder for new versions

dense heath
young knoll
#

Modules > Reflection

dense kestrel
#

and it runs much faster than reflection

dense heath
buoyant viper
dense heath
dense kestrel
#

:/

young knoll
#

that’s just not true

buoyant viper
#

reflection simply can not run as fast as direct access

young knoll
#

Even if reflection is faster in modern java versions, it will never be as fast as direct method calls

buoyant viper
#

it may come close, but thats all it ever could do

hasty prawn
#

My trust in what bk says: 📉

young knoll
#

I wouldn’t really call it bloat either

#

It adds like, a few kilobytes

buoyant viper
dense heath
dense kestrel
#

Spigot switching from Java 8 to Java 16 did force me to change how i handled my multiversion support

young knoll
#

Okay but like

dense kestrel
#

but thats about the only issue i had

young knoll
#

Who cares about a few kB

tidal skiff
buoyant viper
#

rip

tidal skiff
#

now it works

#

christ

buoyant viper
#

woo

dense heath
#

Reflection: 1,777,003,600 nanos, non-reflection: 1,422,204,200 nanos

#

One million runs.

dense kestrel
#

for what?..

lavish hemlock
#

what benchmarking are you using?

dense kestrel
#

one sec

dense heath
dense kestrel
#

ill write a benchmark

dense heath
#
    public static void main(String[] args) throws Throwable
    {
        Field outField = Class.forName("java.lang.System").getField("out");
        Method printMethod = Class.forName("java.io.PrintStream").getMethod("println", String.class);

        int runs = 1_000_000;
        long totalReflectionNanos = 0;
        for(int i = 0; i < runs; i++)
        {
            long startNanos = System.nanoTime();
            printMethod.invoke(outField.get(null), "Gaming! (reflection)");
            totalReflectionNanos += System.nanoTime() - startNanos;
        }

        long totalNonReflectionNanos = 0;
        for(int i = 0; i < runs; i++)
        {
            long startNanos = System.nanoTime();
            System.out.println("Gaming! (non-reflection)");
            totalNonReflectionNanos += System.nanoTime() - startNanos;
        }

        System.out.printf("Reflection: %,d nanos, non-reflection: %,d nanos%n", totalReflectionNanos, totalNonReflectionNanos);
    }
lavish hemlock
#

I'd recommend JMH as it shows more accurate results

young knoll
#

Even reflection requires 2 modules now

#

Plus a ton of reflection is ugly

dense heath
buoyant viper
#

a good abstraction of ur reflection can make it look tolerable

lavish hemlock
#

and also, how is that faster

young knoll
#

Fair

dense heath
young knoll
#

Theoretically you don’t need it anymore for NMS

#

Because mappings

lavish hemlock
#

ah so wait

young knoll
#

Actually no, the server still runs obfuse

lavish hemlock
#

ah right sorry

#

forgot less was better

#

benchmarks immediately make me go into an op/s mode as opposed to an s/op

dense heath
#

😂

#

You're looking at about a 350ns difference between reflection and non-reflection on average

lavish hemlock
#

try that with method handles

#

just out of curiosity

lavish hemlock
#

and also JMH is still going to be more accurate

waxen plinth
#

350ms??

young knoll
#

Doesn’t reflection break often now since spigot no longer maps anything?

waxen plinth
#

Fuck no

dense heath
waxen plinth
#

That would be truly insane

dense heath
waxen plinth
#

Reflection is going to use method handles internally in j18 I believe

young knoll
#

Fancy

lavish hemlock
#

ah yeah I saw that JEP

waxen plinth
#

Just to reduce the surface area of the jvm

lavish hemlock
#

'twas cool

waxen plinth
#

Very cool yes

#

Faster reflection 👍

lavish hemlock
#

also technically means reflection is gonna be somewhat faster

young knoll
lavish hemlock
#

I say "somewhat" cuz I dunno how they're gonna do caching

waxen plinth
#

Not that reflection is all that slow

lavish hemlock
waxen plinth
#

People really overestimate how much it matters

#

HotSpot 🤤

lavish hemlock
#

HotSpot 😖 😫

dense heath
#

There is essentially no reason why you shouldn't use reflection in your code when dealing with NMS

#

It is just the best choice.

waxen plinth
#

Eh

#

I don't see why

lavish hemlock
#

There is essentially no reason why you should use NMS

#

It is just the best choice.

young knoll
#

But what if the obfuscated method name changes from a to b

waxen plinth
#

It really doesn't help much

#

Yeah exactly

dense heath
waxen plinth
#

The names change constantly

dense heath
lavish hemlock
#

What if the server impl changes drastically?

waxen plinth
#

bk I'm sorry but the way you talk is so pretentious

dense heath
dense heath
young knoll
#

Not by that much means they still change

dense heath
young knoll
#

So you would need multiple modules anyway

dense heath
waxen plinth
dense heath
hasty prawn
lavish hemlock
buoyant viper
#

hey shawty i think ur program made a mistake

#

i thought reflection was supposed to be faster

dense heath
dense kestrel
#

The situation that is being tested is not really comparable to what would be done in normal plugins

buoyant viper
#

43 seconds vs 41 seconds

#

thats 2 seconds wasted

dense heath
#

Over a million trials on your slow boy computer ;)

lavish hemlock
#

holy shit I could've breathed in those 2 seconds

#

my life is over

young knoll
#

The small difference matters when you start doing it in hot locations

waxen plinth
#

<5% difference

buoyant viper
lavish hemlock
#

I typically love to over-optimize.

waxen plinth
#

Me too

lavish hemlock
#

There's something fun about making a program run in literally like a few milliseconds.

waxen plinth
#

But at the same time I love my super high level abstractions with reflection

#

I go both ways I guess

dense heath
buoyant viper
#

hm

#

our cpus arent terribly different, im just a gen lower

young knoll
#

You wanna over optimize my task that melts and places snow?

buoyant viper
#

ryzen 9 3900x

dense heath
buoyant viper
#

have some class, its more like a supra to a lambo

dense heath
#

It is at least one third faster lmao

#

Then you starting looking at the cores, and, well...

#

The "print two million 'Gaming!'s" benchmark speaks for itself.

hasty prawn
#

What'd yours take, less than 2 seconds each?

dense heath
#

I also ran my benchmark in the IntelliJ runner, which is notoriously slower.

#

Let me take a run in my terminal

hasty prawn
#

And theirs took, 40+ seconds each? peepoGiggles Yeah yours might be a tad faster. 🤏

buoyant viper
#

ah, java 8 is slow as fuck

#

my results still didnt improve but

#

at least it hit sub-30 now lol

young knoll
#

Huh

#

I expected it to be better with java not 8

hasty prawn
#

Speed running 1 million "Gaming!" prints

buoyant viper
#

xd

lavish hemlock
#

clearly our good main man bytekilo is just very bad at programming

young knoll
#

What the fuck is a java

lavish hemlock
#

a cofeee

buoyant viper
young knoll
#

Is it a glitchless run

hasty prawn
#

They're allowed

young knoll
#

Time for some backwards long jumps

wet breach
#

o.O

lavish hemlock
#

I ACCELERATED BACKHOPPED ON YOUR MOTHER'S FACE WOOOO

waxen plinth
#
System.out.print("Gaming!\n".repeat(1000000));```
#

Would be faster than looping println because no flushing in between

lavish hemlock
#

Engineer Gaming

hasty prawn
#

Genius

young knoll
#

That’ll be a big boy string

hasty prawn
#

Ruined with nerd explanation hypixel_sad

lavish hemlock
#

anyone ever new BufferedWriter(new OutputStreamWriter(System.out))?

dense heath
tidal skiff
#

does listening for packets have to be in the main class? im trying to do addPacketListener() in a new class and its just saying it doesnt recognise the symbol

#

or it cant resolve it

young knoll
#

No

buoyant viper
#

u could probably do it anywhere u can access ur protocolmanager from

#

so anmywhere

young knoll
#

As long as you have the protocolmanager

torn oyster
#

is intellij idea ultimate worth it?

lavish hemlock
#

ehhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh

tidal skiff
dense heath
#

I can't upload images here

#

Christ!

dense heath
#

Reflection: 1,762,114,253 nanos, non-reflection: 1,968,469,980 nanos

#

^ my results in console

tidal skiff
torn oyster
tidal skiff
#

which is stupid because ive never posted to the forums and am not planning on it

faint sage
#

gaming chat

tidal skiff
#

guys dont say the ch word its banned

young knoll
#

Children

dense heath
#

chad ?

tidal skiff
#

get him outta here

dense heath
#

cheese

tidal skiff
#

no, **eese

dense heath
#

eese?

tidal skiff
#

dont say ch**se or the mods will get mad

dense heath
#

Wack.

buoyant viper
#

oh hey it finally beat it

#

swapped out direct usage of Method for MethodHandle lol

dense heath
lavish hemlock
#

your mom

buoyant viper
#

reflection ran quicker than direct by less than a sec

#

xd

dense heath
#

It is the method caching

lavish hemlock
#

"I somehow managed to completely divert the topic of conversation with cheese." -Maow, 2022.

dense heath
#

God bless invokedynamics

buoyant viper
#

methodhandles r just 2 stronk

wet breach
young knoll
#

Share code

#

Gotta replace all my method calls with reflection now

dense heath
lavish hemlock
#

wow

#

loser

young knoll
#

🥄

lavish hemlock
#

I bet reflection beats his mom

#

xd

buoyant viper
# dense heath This guy wants to be spoonfed

lucky for him i want to be a milf

import java.lang.invoke.MethodHandle;
import java.lang.invoke.MethodHandles;
import java.lang.reflect.*;

public class Reflector {
    public static void main(String[] args) throws Throwable {
        Field outField = Class.forName("java.lang.System").getField("out");
        Method printMethod = Class.forName("java.io.PrintStream").getMethod("println", String.class);
        MethodHandle methodHandle = MethodHandles.lookup().unreflect(printMethod);

        int runs = 1_000_000;
        long totalReflectionNanos = 0;
        for (int i = 0; i < runs; i++) {
            long startNanos = System.nanoTime();
            methodHandle.invoke(outField.get(null), "Gaming! (reflection)");
            // printMethod.invoke(outField.get(null), "Gaming! (reflection)");
            totalReflectionNanos += System.nanoTime() - startNanos;
        }

        long totalNonReflectionNanos = 0;
        for (int i = 0; i < runs; i++) {
            long startNanos = System.nanoTime();
            System.out.println("Gaming! (non-reflection)");
            totalNonReflectionNanos += System.nanoTime() - startNanos;
        }

        System.out.printf("Reflection: %,d nanos, non-reflection: %,d nanos%n", totalReflectionNanos,
                totalNonReflectionNanos);
    }
}```
lavish hemlock
#

hear me out

#

what if

#

you used actual lookup and not just unreflect

#

y'know

dense heath
lavish hemlock
#

the findVirtual shebang

buoyant viper
#

i only know unreflect idk

lavish hemlock
#

fucking loser

#

anyway

wet breach
#

o.o

lavish hemlock
#

I'd write one myself but I don't feel like getting on my laptop

buoyant viper
#

sorry i dont work with reflections

lavish hemlock
#

lunatic

#

actual literal mistake

buoyant viper
#

as it was typically inherently slower on the version of java i worked with

dense heath
#

After using the IntelliJ console, I was able to get:

Reflection: 546,855,325 nanos, non-reflection: 348,793,429 nanos
young knoll
#

I didn’t even know about method handle until now

lavish hemlock
#

you

#

are a banana

sullen marlin
#

tfw you're printing different length strings in your benchmark

buoyant viper
#

nooooo

lavish hemlock
#

lmao

#

good benchmark

dense heath
lavish hemlock
#

also not using JMH still

buoyant viper
hasty prawn
#

Ah yes, he's the asshole

sullen marlin
#

also I wouldnt be using an io method as a benchmark if youre not intending to benchmark io

lavish hemlock
quaint mantle
buoyant viper
lavish hemlock
#

I can do that

buoyant viper
#

i know of a few kotlin librarys that can do that

lavish hemlock
#

LIBRARIES*

#

BOOM GET MAOWMENTED

buoyant viper
#

noooo

dense heath
#

Damn! IntelliJ really has my terminal beat right now in I/O speed.

quaint mantle
#

kotler 🙄

young knoll
#

I now know method handles

quaint mantle
#

ByteBuddy 🤝

lavish hemlock
#

what is kotler

young knoll
#

I’ve thought about using asm to modify internals, but it scares me

dense heath
young knoll
#

So I’ll probably stick to modifying spigot

lavish hemlock
young knoll
#

Why not

lavish hemlock
#

Java classes cannot be modified

#

there's a lot of safeguards

young knoll
#

Ah

lavish hemlock
#

well

dense heath
young knoll
#

Spigot internals, not java

lavish hemlock
#

I mean the classes can

#

but not the Java stdlib classes

#

there's safeguards against it in instrumentation and classloading

quaint mantle
#

Mixins for spigot when

lavish hemlock
#

now

#

mixin go brrrrr

#

SKREEEEE

#

crash

#

shit

young knoll
#

Mixins are great

lavish hemlock
#

I wuv mixins so much 🥺

dense heath
#

Jeez, if you like them so much then go program in C# and get extensions instead lmao

young knoll
#

I’ve done similar in C#

#

With harmony

lavish hemlock
lavish hemlock
dense heath
lavish hemlock
#

I've only used like IL injection tho

quaint mantle
#

can you modify existing class behavior with extensions

lavish hemlock
#

I'm pretty sure extension functions are just

dense heath
lavish hemlock
dense heath
lavish hemlock
#

shhhh that's the secret

#

you're not supposed to know that

#

I'm calling the FBI

dense heath
#

Speaking of which, time to go make fun of him for trying to dox me. Back later.

lavish hemlock
#

well you just gotta keep track of all your witnesses

young knoll
#

What a

#

... unique individual

lavish hemlock
#

thankies uwu

young knoll
#

I wasn’t taking to you

#

But sure, you can be unique too

lavish hemlock
#

:3

young knoll
dense kestrel
#

back

lavish hemlock
#

who the fuck are you

#

what are you doing in my house

dense kestrel
#

ummm what?

lavish hemlock
#

you heard me

wet breach
lavish hemlock
#

answer the question stranger

dense kestrel
#

ok, so basically you know how a massive percent of people on this earth believe in god?

#

well basically im god

#

but better

lavish hemlock
#

no I am

dense kestrel
#

Consider_Me_OP = god + 1

lavish hemlock
#

are you trying to steal my identity??

dense kestrel
#

i am better than god, you can feel free to be one below that though 😛

lavish hemlock
#

hell naw

#

we fightin' for the role of god rn

#

square up bitch

dense kestrel
#

im not god

#

im better

buoyant viper
#

was about to throw my pc out the window only to remember i forgot to run javac before running java again

dense kestrel
#

:/

lavish hemlock
dense kestrel
#

nah dont throw it out

#

rape it

lavish hemlock
#

we fight for the role of not god-

#

what

young knoll
#

You fuckin what mate

lavish hemlock
#

I haven't said "what" out loud in

#

a long time

#

in response to a public message

#

in a public server

#

y'know what I think I'm taking that W now thank ya very much good sir

#

you lose via the power of rape

dense kestrel
#

what? XD

wet breach
dense kestrel
#

you cant rape me, im the best + 1

lavish hemlock
#

nah nah

#

I was saying you lose

#

from the rape

dense kestrel
#

hmm

lavish hemlock
#

just "the"

dense kestrel
#

what?

lavish hemlock
#

no action

#

no action necessary

#

your statement was enough

dense kestrel
#

mhm

lavish hemlock
#

I'm crowning myself the best^2

buoyant viper
dense kestrel
#

I dont need a crown to be the best 😎

lavish hemlock
#

it's an expression, loser

dense kestrel
#
public class Benchmark {

    public static void main(String[] args) throws Throwable {
        int runs = 2_000_000_000;
        Method method = Benchmark.class.getMethod("addTwoNumbers");

        long totalReflectionNanos = System.nanoTime();

        for (int i = 0; i < runs; i++) {
            method.invoke(null);
        }

        totalReflectionNanos = System.nanoTime() - totalReflectionNanos;
        long totalNonReflectionNanos = System.nanoTime();

        for (int i = 0; i < runs; i++) {
            addTwoNumbers();
        }
        totalNonReflectionNanos = System.nanoTime() - totalNonReflectionNanos;
        System.out.printf("Reflection: %,d nanos, non-reflection: %,d nanos%n", totalReflectionNanos, totalNonReflectionNanos);
    }

    public static void addTwoNumbers() {
        int k = 1992131 + 1235431;
    }
}
Reflection: 2,237,045,200 nanos, non-reflection: 1,272,700 nanos
#

XD

wet breach
#

@dense kestrel your crown

dense kestrel
lavish hemlock
#

nepotism

dense kestrel
lavish hemlock
#

and that's why you're not the best ^

#

reflection can be just as fast as direct access if done properly

dense kestrel
#

I'll wait

lavish hemlock
#

challenge accepted

dense kestrel
#

🍿

buoyant viper
#

u forgot to clear the integer cache between calls

#

-1/10

wet breach
#

recursion can sometimes be faster

dense kestrel
buoyant viper
#

my reflect time is reporting 34mil NS but the program time in total is like 2s

#

wait

dense kestrel
#

just send the printed line

buoyant viper
#

yeah i forgot how nanosecodns work

#

lol

dense kestrel
#

:/

buoyant viper
dense kestrel
#
public class Benchmark {

    private static int added = 0;

    public static void main(String[] args) throws Throwable {
        int runs = 500_000_000;
        Method method = Benchmark.class.getMethod("addTwoNumbers", int.class, int.class);

        long totalReflectionNanos = System.nanoTime();

        for (int i = 0; i < runs; i++) {
            method.invoke(null, 1992131, 1235431);
            added = 0;
        }

        totalReflectionNanos = System.nanoTime() - totalReflectionNanos;
        long totalNonReflectionNanos = System.nanoTime();

        for (int i = 0; i < runs; i++) {
            addTwoNumbers(1992131, 1235431);
            added = 0;
        }
        totalNonReflectionNanos = System.nanoTime() - totalNonReflectionNanos;
        System.out.printf("Reflection: %,d nanos, non-reflection: %,d nanos%n", totalReflectionNanos, totalNonReflectionNanos);
    }

    public static void addTwoNumbers(int first, int second) {
        added = first + second;
    }
}
#

there, i changed it up a little

#
Reflection: 2,444,041,600 nanos, non-reflection: 9,794,300 nanos
wet breach
buoyant viper
young knoll
#

Accuracy

dense kestrel
#

using shit like System.out.println() to benchmark it is meaningless. 99.9% of the time is going to be spend running the code inside of the method

buoyant viper
dense kestrel
#

and 0.01% of the time will be spent actually calling the method

#

so ofc the times would be close

#

it means nothing to do it like that though and doesnt show the speed difference

buoyant viper
#
import java.lang.invoke.MethodHandle;
import java.lang.invoke.MethodHandles;
import java.lang.invoke.MethodType;
import java.lang.reflect.*;

public class Benchflect {
    public static final MyClass myClass = new MyClass();

    public static void main(String[] args) throws Throwable {
        Field mcField = Class.forName("Benchflect").getField("myClass");
        MethodHandle mh = MethodHandles.publicLookup().findVirtual(Class.forName("Benchflect$MyClass"), "sum",
                MethodType.methodType(int.class, int.class, int.class));

        int runs = 500_000_000;
        for (int i = 0; i < runs; i++) {
            // JVM WARMUP
            i++;
            i--;
        }

        long reflectTimeNs = System.nanoTime();
        for (int i = 0; i < runs; i++) {
            mh.invoke(mcField.get(null), 127 + i, 127 + i);
        }
        reflectTimeNs = System.nanoTime() - reflectTimeNs;

        long nonReflectTimeNs = System.nanoTime();
        for (int i = 0; i < runs; i++) {
            Benchflect.myClass.sum(127 + i, 127 + i);
        }
        nonReflectTimeNs = System.nanoTime() - nonReflectTimeNs;

        System.out.printf("Reflection: %,d nanos, non-reflect: %,d nanos\n", reflectTimeNs, nonReflectTimeNs);
    }

    public static class MyClass {
        public int sum(int a, int b) {
            return a + b;
        }
    }
}``` 😎
dense kestrel
#

:/

buoyant viper
#

oh oh god fuck oh shit oh no i forgot to warm up 127 + i

young knoll
#

I love seeing code in this channel, because I always learn little things I’ve never encountered before

sullen marlin
#

use jmh

young knoll
#

Like %,d

buoyant viper
#

i didnt know %n was a thing, i always used \n

young knoll
#

I didn’t either

wet breach
#

are we trying to prove reflection is slower?

dense kestrel
#

XD

young knoll
#

The original claim was that they were almost the same

dense kestrel
#

its nowhere near as fast

buoyant viper
#

yeah, it didnt click that my reflect test was /right/ (using this term loosely with improper benchmarking) when i thought the difference was too large to be accurate

#

i forgot how small of a time scale i was working with

young knoll
#

I didn’t think so

wet breach
young knoll
#

Reflection is better than it used to be, but it’s still not the same

buoyant viper
#

it all started over whether u should include NMS in ur project or access it reflectively

young knoll
#

Although now I know to use methodhandle in the future

dense kestrel
#

i stand by this

buoyant viper
dense kestrel
#

😎

buoyant viper
#

MethodHandles r the fucking boss when it comes to reflection

wet breach
#

Well, you should only use reflection if you need to.

dense kestrel
#

the only time you should need to is if you need to access something that is private

young knoll
dense kestrel
#

however since it is not, i see no need to use it

lavish hemlock
#

I wrote a JMH benchmark

#

it's currently in the process of running

faint sage
#

what are we trying to benchmark this time

quaint mantle
#

?jd

young knoll
#

Reflection

faint sage
#

oh boy

dense kestrel
# lavish hemlock I wrote a JMH benchmark
Benchmark                  Mode  Cnt           Score          Error  Units
Benchmark.testNormal      thrpt   25  4067349252.773 ± 37683002.671  ops/s
Benchmark.testReflection  thrpt   25   107593929.401 ±   744853.491  ops/s
#

those are my results

#

yours done?

#

?paste

undone axleBOT
dense kestrel
#

the code i used for my test as well

#

ignore private static final int runs = 250_000_000;, it was not used at all in there

lavish hemlock
#

Either the benchmark is set up incorrectly

#

OR

#

reflection is an order of magnitude faster

dense kestrel
#

send your code

dense kestrel
#

and reflection is 40x slower

lavish hemlock
#

Also you're using traditional reflection lol.

#

This has the benefit of lookup being resolved once per fork (process of the JVM started by JMH)

dark arrow
#

hey is it possible to remove a crafting recipe from game?

lavish hemlock
#

(which is also conventional for method handles btw, you should typically store them as static fields)

#

aand it makes use of Blackhole to avoid compiler optimizations

#
Benchmark                Mode  Cnt   Score    Error  Units
Bench.Benchmark_Direct   avgt   25  ≈ 10⁻⁶           ms/op
Bench.Benchmark_Reflect  avgt   25  ≈ 10⁻⁵           ms/op
#

Afaik this may or may not be accurate, I'm not a JMH professional, but

#

direct access and method handles are essentially equivalent in speed

#

method handles are used commonly by the JVM's dynamic operations and in fact by lambdas

#

lambdas use invokedynamic + LambdaMetafactory

#

LambdaMetafactory links a MethodHandle to a specific functional/SAM interface

#

Oh yeah this is also in Java 17

#

Alerithe didn't take advantage of Java 9's VarHandle

buoyant viper
#

was able to use a lambdametafactory correctly once and only once

lavish hemlock
#

And modern Java includes even more optimizations over reflection

buoyant viper
#

and god do i wish i kept that code somewhere

lavish hemlock
#

Hell you can skip the resolution overhead here with LambdaMetafactory but it doesn't matter as it's not factored into the time.

#

So yeah, @dense kestrel, reflection can be fast :)

dense kestrel
#

i have work in the morning

#

im going to bed

left swift
#

How can i set the playerskin using url? i mean how can i get the signature of this skin.

granite burrow
#

how can I reload my custom config?

This is what I have for it, config file being the File and dataConfig being the FileConfiguration

public void reloadConfig() {
        if (!this.configFile.exists()) {
            saveDefaultConfig();
            return;
        }
        if (this.configFile == null) {
            this.configFile = new File(plugin.getDataFolder(), fileName);
        }

        dataConfig = YamlConfiguration.loadConfiguration(configFile);
    }
buoyant viper
#

@dense kestrel @lavish hemlock ive managed to make something that clocked out all around the same test time.. no jmh tho

granite burrow
topaz cape
#

smh

#

it's there because you extend java plugin anyways

granite burrow
granite burrow
#

It doesn’t reload any new data entered, it just will check if theres a file and if there isn’t it will create the new file. It’s supposed to load the newly edited data

quiet ice
#

The

        if (this.configFile == null) {
            this.configFile = new File(plugin.getDataFolder(), fileName);
        }

is bogus as you already tested the nullabillity of configFile via this.configFile.exists()

granite burrow
#

Yeah I was had that in there as a test while trying to see what was up must’ve forgot to remove it

dark arrow
#

i have made a command which will summon a sign and the text you wanted but is only works for one world at a line is there is any way so that player can write whole sentences

granite burrow
#

You can change the line based on how much text is entered, I believe that the max characters per line is 12 but I could be mistaken so you can check if the message the player wants is greater than 12 characters, and if it is then switch to the next line up to 4 lines

#

And when adding the text to the sign if the player enters a set of characters like “/n” you can addd a new line

#

Atleast that’s how I’d go about it

dark arrow
#

ok but i am talking about that i have made a comand /sign and if u type /sign 2 hello then it will summon a sign with that text in line no.2 and i want to make is so that if they type the whole sentence like /sign 2 hello there it should summon a sign like that but i cant do that so i need help in it

granite burrow
#

So you need help writing a sentence on the same line?

#

Or on multi lines?

dark arrow
#

writing a sentence on a same line

granite burrow
#

Oh alright, so in that case you can use the args part of the command and do I believe args.length to get the a number of args in the command and then make a loop or something that will add each of the args up to the given length of the command message, keep in mind that you already used args[0] so it Would be 1 and up

#

But that may not be the best way possible but should work none the less

granite burrow
quaint mantle
#

it really easy to remember

granite burrow
acoustic pendant
#

Hello! i have a problem
I have a code that reduces the damage that a mob does to a player, but when the mob is from other plugin (MythicMobs) the damage keeps and doesn't reduce.
Here is my code:

    @EventHandler
    public void onHit(EntityDamageByEntityEvent e){
        Entity player = e.getDamager();
        Entity victim = e.getEntity();
        ArmorStand armorStand = (ArmorStand) player.getWorld().spawnEntity(new Location(player.getWorld(), 100, 700, 100), EntityType.ARMOR_STAND);
        if (e.getEntity() instanceof Player) {
            System.out.println("1");
            double calculation = plugin.data.getDefense(player.getUniqueId()) + 100;
            double damageReduction = plugin.data.getDefense(player.getUniqueId()) / calculation;
            // 0.95
            ActiveMob mob = MythicMobs.inst().getAPIHelper().getMythicMobInstance(e.getDamager());
            double mobDamage = mob.getDamage();
            double almostFinalDamageMM = mobDamage * damageReduction;
            double finalDamageDefenseMM = mobDamage - almostFinalDamageMM;
            System.out.println("2");
            e.setDamage(finalDamageDefenseMM);
            System.out.println("3");```
I have tried getting instance of the plugin instead of normal ENtityDamageByEntityEvent but doesn't work, could someone help me?
dark arrow
#

        if(sender instanceof Player){
            Player player = (Player) sender;

            if(args.length<=1){

                player.sendMessage(ChatColor.RED+"Pls specify the line and the word");

            }else if(args.length>1){
                player.getWorld().getBlockAt(player.getLocation()).setType(Material.OAK_SIGN);
               Sign sign1 = (Sign) player.getWorld().getBlockAt(player.getLocation()).getState();

               int Line = Integer.parseInt(args[0])-1;
               String sentance = args[1];
               sign1.setLine(Line,sentance);
               sign1.update();
            }

        }


        return true;


    }```
dark arrow
granite burrow
#

Why not?

dark arrow
gentle oriole
#

how can I make my 1.18 plugin work in 1.17?

acoustic pendant
#

in plugin.yml remove api version

#

and don't use method that only 1.18 have

#

don't really know if there are

dark arrow
quaint mantle
acoustic pendant
#

I do it like that

quaint mantle
#

unnecessary, i would guess it is change to api version 1.16, but not delete it entirely

acoustic pendant
#

well

#

the same i guess

gentle oriole
#

is there something like a group that all 1.18 plugins support up to like 1.16?

quaint mantle
#

so remove it = u tell the server you are supporting legacy versions

granite burrow
#

Just do something like

||String temp = “”;
For (int i =1; i > args.length; i++) {
temp += args[i];
}

// add temp to sign line ||

#

On my phone so I can’t test it or give super accurate code

granite burrow
ivory sleet
granite burrow
#

There may be a better way for it but that’s the best way I could think of at 3 am

granite burrow
fleet pier
#

Basically i use deepl api to translate messages into all the languages and sometimes i dont get the right translation cuz im translating with colorcode how do i remove the colors temporarily for translation and add them again?

eternal oxide
#

You can remove them, but you can;t add them back contextually

hardy swan
#

Are there better alternatives to EntityInteractEvent for ringing of bells

#

PlayerInteractEvent does not include villagers who might use the bell, while right clicking of bell does not necessarily mean it is rung too...

delicate cargo
#

how do i make 1 location face another?

toxic mesa
#

So I have this in my pom

    <dependency>
           <groupId>org.spigotmc</groupId>
           <artifactId>spigot-api</artifactId>
           <version>1.17-R0.1-SNAPSHOT</version>
           <scope>provided</scope>
    </dependency>

Which doesn't display any errors, but when trying to import a craftbukkit class I can't import the 1.17 version. I do also import 1.18 which works fine, my guess is that it's a build-tools issue or smth, what do u guys think?

hardy swan
#

Change aritifactId

#

To just spigot

toxic mesa
#

fuck

#

my bad, ty

#

funny how my 1.18 import also has just spigot, weird that I missed that XD

hardy swan
delicate cargo
#

loc1 is at (0,1,1), loc 2 is at (2,1,1)

#

i want loc1 to face loc2

hardy swan
#

Locations are faceless, isnt it?

delicate cargo
#

what does 'to face' mean?

toxic mesa
#

I believe locations also store a direction

delicate cargo
toxic mesa
#

Location​(World world, double x, double y, double z, float yaw, float pitch)

hardy swan
#

Right

delicate cargo
#

yea

#

but

#

loc1 needs to point towards loc2

#

how do i do that

toxic mesa
#

well as setdirection just uses a vector you would just need to do some vector stuff, am very bad at working with vectors so can't help you with that XD

eternal oxide
#

loc1.setDirection(loc2.toVector().subtract(loc1.toVector()))

toxic mesa
#

damn that easy huh

delicate cargo
#

oh ty

hardy swan
#

Inb4 i use protocollib

tardy delta
#

?paste

undone axleBOT
tardy delta
burnt current
#

Hey quick question: I am trying to add to my plugin that players can claim chunks for themselves. That means if they claim the chunk, only they can build and mine there.
But now I'm trying to add that players can't claim a chunk infinitely often but only e.g. 5 times. For this I have added 2 columns to my MySQL database. One that increases every time the player claims a chunk ("chunkcount") and one that contains the maximum value of chunks the player can own ("chunkcountmax"). when the player then tries to claim a chunk, it is compared whether chunkcount is smaller than the value in chunkcountmax and if it is, the process is aborted.
However, I have the feeling that this is not the smartest way to implement the limit. Does anyone know how to implement it in a simpler way?

hardy swan
tardy delta
#

so my method would work?

hardy swan
#

It should

tardy delta
#

ok

hardy swan
burnt current
#

yes

hardy swan
#

I would use that

#

And count the rows

#

Where the player/id is the owner

gaunt frigate
#
    public void OnFirstJoin(PlayerLoginEvent e) {
        main.sellingOff(e.getPlayer(), Material.IRON_BLOCK);
    }

    public void sellingOn(Player p, Material name) {
        getPlayerData().set("Players." + p.getName() + "." + name, getSell(p, name, true));
        save();
    }
    public void sellingOff(Player p, Material name) {
        getPlayerData().set("Players." + p.getName() + "." + name, getSell(p, name, false));
        save();
    }
    public Boolean getSell(Player p, Material name, Boolean status) {
        return getPlayerData().getBoolean("Players." + p.getName() + "." + name, status);
    } ```
playerdata.yml:

Players:
LifeWienty:
IRON_BLOCK: false

When I get the material "false" 1 time, it doesn't work the next time I get it "true" save.
hardy swan
analog prairie
#
package command;

import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.plugin.java.JavaPlugin;

public class command implements CommandExecutor {
    private final JavaPlugin plugin;

    public command(JavaPlugin plugin) {
        this.plugin = plugin;
    }

    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        console(ChatColor.RED+" "+sender);
        console(ChatColor.RED+" "+command);
        console(ChatColor.RED+" "+label);
        console(ChatColor.RED+" "+args);
        plugin.disablePlugin(this);
        plugin.getPluginLoader().enablePlugin(this);
        return false;
    }

    public  void console(String data){
        Bukkit.getConsoleSender().sendMessage(data);
    }
}

What's wrong?

wet breach
analog prairie
analog prairie
#

I want to Dependency Injection to command.java

hardy swan
#

Very informative

wet breach
#
select * from players where claimed == maxclaimable;
select * from players where claimed == maxclaimable OR claimed > maxclaimable;
#

@burnt current

hardy swan
grizzled pollen
hardy swan
#

PascalCase for class name, command as class name is inaccurate, and yea, this is not a plugin class

analog prairie
analog prairie
hardy swan
#

Bukkit.getPluginManager().disablePlugin(plugin)

#

You are currently feeding it a commandexecutor

#

Not a plugin

quaint mantle
#

if i relocate h2 driver, do i have to explicitily set the driver class name?

terse ore
#

Hey

#

How can I use

#

getConfig() outisde main java class?

quaint mantle
#

?di

undone axleBOT
terse ore
#

okok

dim pumice
#

hello?

#

can anyone help me make a plugin or tell me a tutorial?

#

I'm new

#

just beginner trying to learn

lapis lark
#

EnderPearl#getItem NoSuchMethod for 1.8. Ideas how to get ItemStack from EnderPearl on 1.8 and also is it really possible?

wet breach
#

?learnjava

undone axleBOT
lapis lark
quaint mantle
#

easy solution:
do not use 1.8

toxic mesa
#

when lava is placed just check if the nearest player is within 5 blocks?

#

why ask if it works when you can try it?

indigo cave
#

How can I give the player this new freezing effect?

quaint mantle
#

setFreezing ig

tribal holly
#

Hi ! Is it possible to get the biome name of a custom data pack modifier ? like theralith ? When i test a simple get biome it return me CUSTOM and with getKey "minecraft:custom" but not "theralith:something"

#

I don't know if the server can have this information

young knoll
quaint mantle
tribal holly
#

so NMS is the only solution ?

#

paper have this functionality btw ?

quaint mantle
tribal holly
#

Fuck NMS

#

(sry i think too loud)

quaint mantle
#

Fuck md_5

tribal holly
#

well md_5 is great person, this is not a reason to say that

dusk flicker
#

yikes

quaint mantle
#

hes not human

#

hes slime bruh

young knoll
#

You ever wonder how some people haven’t been kicked

quaint mantle
#

🤠 md fanboys

#

i mean, for sure i have respect to md_5 as person, but sometimes when i see spigot api..

#

fuck md_5

young knoll
#

I mean

#

It’s not all him

quaint mantle
#

the legacy support policy

indigo cave
#

what about

#

you shut up

#

and complain somewhere else

young knoll
#

Some of the API is now 10 years old

indigo cave
#
   EntityLightning lightning = new EntityLightning(EntityTypes.U, ((CraftWorld) getLocation().getWorld()).getHandle());

java: cannot access org.bukkit.RegionAccessor
class file for org.bukkit.RegionAccessor not found

#

at CraftWorld

#

but why?

young knoll
#

NMS for lightning?

spiral light
#

Spigot - paper differences

#

Or version different

indigo cave
#

i just use spigot build tool jar in m2

indigo cave
#

I dont want it to damage the world

young knoll
#

I see, only the player

indigo cave
#

neither that

young knoll
#

Then

indigo cave
#

that kind of lightning doesnt anything

#

just is there

#

no damage at all

young knoll
#

World#strikeLightingEffect

indigo cave
#

does it damage?

#

to the world

#

or entitiy

lost matrix
#

You can both summon a proper lightning strike or only the effect

indigo cave
#

just the effect

#

so this doesnt any damage?

#

right?

lost matrix
#

Yes

sly falcon
#

Anyone know or able to make a single plugin that allows a enchant or attribute to a tool to mine in a 3x3(or bigger/smaller) radius?

young knoll
#

Add a PDC tag and look for said tag in the block break event

sly falcon
#

im sadly not familier with creating plugins 😦

rough basin
#

I wrote this code to look at another entity and double the speed of the arrow.
But the direction in which the arrow is fired is normal, but direction which actually looking at is strange.

lost matrix
#
  1. Vector vector = normalize.clone().multiply(2);
eternal oxide
#

Why even bother with the setDirection. you don;t need it

#

oh code has changed

stiff palm
#

Hi, good morning, i have a problem with items in inventories, i'm trying to code a duels plugin, so i am creating kits and when loading the contents to the player, when the player tries to move the item it seems to be in the destination slot but when you try to use it, it disappear.
here is the code: https://paste.md-5.net/ewafexohor.cs

stiff palm
#

1.8

lost matrix
#

well...

lost matrix
lost matrix
# stiff palm 1.8

Update to a version that still receives updates. 1.8 has been buggy for half a decade now and it wont get any better.

rough basin
#

i think it takes too short time to turn maybe

stiff palm
lost matrix
young knoll
#

1.18

stiff palm
# lost matrix latest

Hmm.. If a create the plugin with that version, can i make it compatible with other versions?

lost matrix
stiff palm
quaint mantle
#

You can with old combat mechanics plugin

lost matrix
#

Run your server with 1.18 and use via backwards

quaint mantle
#

the solution is pretty sucky, but it works

stiff palm
#

Oh, so the players that joins with 1.8 will still have the default 1.8 pvp?

young knoll
#

Not without the plugin

quaint mantle
#

nope, you'll need a plugin

#

@copper harness hi your name is cool so i ping 😏

quiet ice
#

why

rough basin
#

lmfao

#

When an arrow is objectified, like Arrow arrow1, is there a way to make it disappear when this arrow1 hits the floor?

rough basin
#

Thanks

lost matrix
rough basin
#

I almost forgot that the arrow is an Entity lmao

mellow edge
#

how can I list all the beds or at least check if the block is bed (of any kind) | EDIT: ARRAYLIST/HASHMAP DOESN'T HURT

terse ore
#

How can I get maxY and maxX value with getConfig()?

dense heath
terse ore
#

ty

#

my closest guess was Integer asd = Aquatic.getInstance().getConfig().getInt("tpr/maxY");

acoustic pendant
#

Hey! i got this error with my custom recipes but i don't have any replicated recipe, could someone help me?

acoustic pendant
acoustic pendant
acoustic pendant
#

but i get that error

quaint mantle
#

because it was already registered before..

trim surge
acoustic pendant
#

well

#

i have it in other crafts as well and no error

trim surge
#

Let me look at the error

#

I was correct..

#

“Duplicated Recipe Ignored ID”

acoustic pendant
#

this thing?

acoustic pendant
trim surge
#

Yes

#

Remove bottom one

acoustic pendant
#

same error

tender shard
#

does anyone know how I can get a user's discord roles with JDA when they leave the server?

#

In GuildMemberRemoveEvent, the user returns null

tardy delta
#

is HashMap#containsKey(something) the same as HashMap#put(something, value) != null?

spiral light
#

if you use put you overwrite existing values

trim surge
acoustic pendant
#

ok

trim surge
#

Restart it

spiral light
waxen plinth
#

It would be able to handle this safely

trim surge
#

Would be worse 😂😭

waxen plinth
#

Nope

#

It unregisters recipes properly

trim surge
#

@acoustic pendant it worked?

acoustic pendant
#

yep

#

thanks

trim surge
#

All good

digital rain
#

uhh hey people :), im creating a custom recipe with custom items input, but the thing below also lets in all things of the type that is paper

waxen plinth
#

Yeah you can't have it check exact item properties

#

Only materials