#help-development

1 messages · Page 1520 of 1

wraith rapids
#

the Item entity represents a dropped item

quaint mantle
#

well, you could just make it so that only the player you want can pick it up maybe

hybrid spoke
#

but it didnt worked that well

quaint mantle
#

😦

#

but ty

#

make some cool particles around it make it cool 😄

#

oh

#

good idea

hybrid spoke
#

or floating villagers

quaint mantle
#

llo

#

lol

hybrid spoke
#

i love villagers

quaint mantle
#

or a holograph saying 'Player's Item'

wraith rapids
#

villagers are gay

quaint mantle
#

ohh

hybrid spoke
wraith rapids
#

i literally made a plugin to lobotomize them

#

because they're so gay

quaint mantle
#

why do you guys hate gay?

#

nah we don't its just nice to joke with

wraith rapids
#

who says someone hates gay

quaint mantle
#

Gay does not harm us.

wraith rapids
#

sounds like you're a homophobe

quaint mantle
#

ahhh

hybrid spoke
#

its so precious

granite stirrup
#

when i sometimes accidently turn off the internet my ip dont change but when the wifi just randomly go down sometimes it changes my ip like bruhhhhhhh

quaint mantle
keen kelp
#

like this?

        if(inventory.getHelmet() != null)
        {
            if(inventory.firstEmpty() == -1)
            {
                target.getWorld().dropItemNaturally(target.getLocation(), inventory.getHelmet());
            }else
            {
                inventory.addItem(inventory.getHelmet());
            }
            inventory.setHelmet(new ItemStack(Material.AIR));
        }```
wraith rapids
#

thats because you "turning off the internet" doesn't turn off the internet

#

you can't turn off the internet

#

the best you can do is disconnect from it

hybrid spoke
wraith rapids
#

and you disconnecting your machine from your home network is not disconnecting from the internet

#

the router is still connected and assigned a valid ip address

#

use inventory.addItem()

#

get the returned Map

#

then drop the items in that map

granite stirrup
#

;-;

wraith rapids
#

it's possible that the router restarts for the explicit purpose of acquiring a new ip

granite stirrup
#

idk when it was raining and thundering before it kept disconnecting and it changed the ip

#

it changed like twice

light terrace
#

Can we get text show up with a dirt background when we want to go to a server?

keen kelp
#

Please note that this command is not supported and may cause issues when using some plugins.
If you encounter any issues please use the /stop command to restart your server.

is it possible to remove this message?

wraith rapids
#

with a log filter yes i guess

#

but why do you want to remove it

keen kelp
#

like I dont want the player to see it also

wraith rapids
#

why is a player seeing it

keen kelp
#

cause Im doing rapid testing

#

so I reload a lot

wraith rapids
#

it's only sent to the command executor

#

or ops

#

idr

keen kelp
#

ops

wraith rapids
#

also just reload the plugins individually

keen kelp
#

how?

wraith rapids
#

with a plugin manager

keen kelp
#

oh f*ck no

#

I just want to disable the message man

wraith rapids
#

what

#

add a log filter idk

#

or fork and make the server not send it

keen kelp
#

ops can still see it

wraith rapids
#

ops should see it

keen kelp
#

I dont want to

#

because I am op

wraith rapids
#

reload the plugins individually

keen kelp
#

and it spams my chat

wraith rapids
#

reloading the entire server to test one plugin is dumb

keen kelp
#

I dont have 3 plugins

#

My own, protocollib and another of mine

#

/reload takes like a second

#

I just want to hide the message

wraith rapids
#

and reloading the plugin takes a split second

#

turn off chat

keen kelp
#

I still need to see other debug messages

wraith rapids
#

don't look at the chat box

#

fork spigot and make it not send the message

#

add a filter on the protocol layer that filters the chat message out

#

or just don't be a tard about it and reload the individual plugin

keen kelp
#

nah frick Im forking paper and nuking this bitch outta there

quaint mantle
#

guys i am having a problem whith multiverse where if people create a nether portal on the survival map they spawn ate the hub dimension for some reason

wraith rapids
#

doesn't sound like a development question

quiet ice
shadow pulsar
#

Anyone know how to shift location relative to the rotation? I got it to go forward/back or left/right using only the yaw but I do not know how to also make the pitch work and go up and down.

tame coral
#

What should I use to increment a player's counter when they kill an entity ? EntityDamageEvent with a health check or EntityDeathEvent ?

quiet ice
#

player's counter?

tame coral
#

(an internal map)

#

Basically I want to create a coin counter that increment by x when killing a y entity

fervent nacelle
#

Hi, would you know how to link the movements of two players, for example when player A moves, Player B transcribes the movement

opal juniper
#

Listen for the PlayerMoveEvent and move the other player when one moves

tame coral
wraith rapids
#

since player movement is clientside that will be pretty choppy no matter how you go about it

fervent nacelle
wraith rapids
#

use the death event

tame coral
#

You can get the killer from it ?

wraith rapids
#

from the entity, yes

tame coral
#

Ooooh I forgot about that method, thanks !

fervent nacelle
#

So no one has an idea?

#

For my problem

wraith rapids
#

nobody knows your problem

subtle kite
#

Anyone have tips for checking events with world guard api .
I'm trying to make it where someone can't place a custom block I coded anywhere they want.

wraith rapids
#

impossible to tell without seeing the internal error itself

#

something is probably null

#

if (random == null)

#

get the actual error

quiet ice
#

(it will be printed to console)

#

If it isn't you have a cursed spigot install and you should abandon your career

wraith rapids
#

Caused by: java.lang.ClassCastException: java.util.ArrayList cannot be cast to org.bukkit.entity.Player

#

at UpdatedGameModeCommand.java:56

quiet ice
#

Don't cast things unsafely

wraith rapids
#

yeah, don't do that

quiet ice
#

it's the (Player) CommandHelper.getPlayers line

wraith rapids
#

an arraylist is not a player

#

you can't cast an arraylist to a player

#

don't cast things at all if you don't know what casting does

#

clearly you do not

quiet ice
#

Casting lists to players is a rookie mistake

wraith rapids
#

if (Bukkit.getOnlinePlayers().size() > 1)

#

but that won't solve your fucking classcast issue

quiet ice
wraith rapids
#

myeah

#

dead players are not "online"

quiet ice
#

Though it will most often not matter i guess

lean gull
#

can someone teach me what instances are but really dumb it down? i'm currently following the CodeAcademy java course but they're talking about instances without explaining what they are

#

and yes i have searched on google

#

wasn't very helpful, to me atleast.

onyx shale
#

have you tried paper discord?

quiet ice
#

hard to describe

#

basically if objectA == objectB then objectA and objectB are of the same instance

lean gull
#

ok but what is an instance

wraith rapids
#

why the fuck is maven shading and relocating my dependency but not translating the references to it

quiet ice
#

you create a new instance of an object with the new operator

onyx shale
#

good ol teaching java

#

lol

wraith rapids
#

java.lang.NoClassDefFoundError: dev/dbassett/skullcreator/SkullCreator

#

this class is literally relocated in the jar

#

it's also not translating the references to the other dependencies so it's not an issue with the skullcreator class itself

lean gull
wraith rapids
#

what the fuck is this shit

opal juniper
#

Why are you back floofsy

#

Oh wait - you are learning java

wraith rapids
#

as if

onyx shale
#

im also wondering

#

im trying to guide him towards paper discord as im sure the members there will help him

opal juniper
#

does protocollib work with 1.17?

quiet ice
#

idk

wraith rapids
#

i'll decompile the plugin and see the actual references

onyx shale
opal juniper
#

i thought it did

#

yeah

onyx shale
#

in short,it doesnt

opal juniper
#

bummer

quiet ice
onyx shale
#

it is as so much shit relies on it

wraith rapids
#

it worked just now when I built it 5 minutes ago

opal juniper
#

🤷

wraith rapids
#

changed nothing about the pom, now it's fucked again

quiet ice
#

Could just do a clean package

wraith rapids
#

i am

lean gull
#

wdym

quiet ice
opal juniper
#

no he doesn't

onyx shale
#

have you asked in paper discord this question? im sure they will help you

lean gull
#

i do not

#

this is actually the part of the course i'm talking about

quiet ice
#

An instance is a thing

#

Well, however it isn't the descriptor

#

i. e. class

wraith rapids
#

"can you dumb it down for me"

lean gull
#

i'm confuzled

opal juniper
onyx shale
#

yah..

#

protocollib sturggling hard rn

opal juniper
#

thats a bit rubbish

eternal oxide
#

If you have two apples each is its own instance

opal juniper
#

imma have to go back to 1.16.5 now then

quiet ice
#

You do not need to know what an instance IS, you need to know what an instance DOES

lean gull
#

ok then, what does an instance do?

quaint mantle
#

dumb it down for me kemosabe

quiet ice
#

well, you only know it with experience

wraith rapids
#

import com.villager.genocide.shrekex.shaded.skullcreator.SkullCreator;

#

what

lean gull
#

how the hell am i supposed to learn this if i don't know a good part of the explanation

wraith rapids
#

the reference is relocated properly

quiet ice
#

You will make a lot of errors in the future with instances

quiet ice
#

In a computer system, any time a new context is created based on some model, it is said that the model has been instantiated.
In practice, this instance usually has a data structure in common with other instances, but the values stored in the instances are separate.
Changing the values in one instance will then not interfere with the values of s...

wraith rapids
#

he will literally not understand half a word of that

opal juniper
#

i mean - wikipedia is already kinda stupid

lean gull
#

In a computer system, any time a new context is created based on some model, it is said that the model has been instantiated. what does this mean?

wraith rapids
#

told you

quiet ice
#

In object-oriented programming (OOP), an instance is a concrete occurrence of any object is what you need to care about

lean gull
#

so every time i use something such as a variable, it is called an instance?

quiet ice
#

You can also say that instances are references to an object

opal juniper
#

wtf - event if i go back to 1.16.5 protocollib still dont work

lean gull
wraith rapids
#

can we ban him yet

quiet ice
#

yes, but if you use the field = new Object() (where as Object can be anything), the instance of the field is changed, otherwise the instance will stay the same through the variable's lifetime

opal juniper
#

he got kicked by imagine yesterday

#

i didn't think he would come back

wraith rapids
#

he has blocked everyone except geolykt

opal juniper
#

i know that he has blocked at least 7 people

#

yeah

lean gull
#

i'm confused again

opal juniper
#

same - why are you here

quiet ice
#

well, just stay with your so every time i use something such as a variable, it is called an instance? definition

#

It isn't per-se wrong

wraith rapids
#

only kind of wrong

hexed hatch
wraith rapids
#

but, if it makes him shut up about it, right enough

lean gull
quiet ice
wraith rapids
#

none

lean gull
wraith rapids
#

you could do default: {{{ code }}} if you wanted

quiet ice
#

well, it is to some degree

hexed hatch
quiet ice
#

the first one has a scope

wraith rapids
#

in this context there is no difference

quiet ice
#

not really

opal juniper
#

can you tell him to learn java in a java discord

lean gull
wraith rapids
#

use whatever suits your use case

quiet ice
#

creating scopes can be very usefull though

wraith rapids
#

if you need to combine multiple statements into one, or restrict the scope of a variable, use {}

opal juniper
#

joch - please kick this man

#

save us

wraith rapids
#

like if (condition) {statementA; statementB}

lean gull
#

shut him up lmao

wraith rapids
#

or

{
    int variableThatIsRestrictedToThisScope = 5;
    System.out.println(variableThatIsRestrictedToThisScope);
}
{
    int variableThatIsRestrictedToThisScope = 72;
    System.out.println(variableThatIsRestrictedToThisScope);
}
quiet ice
#

It can be usefull if you want to reuse the variable name but you are otherwise in the same scope - though the variable is not reused

wraith rapids
#

or just want to group logic inside a method in a way that can easily be collapsed in an ide

lean gull
#

wat dis mean
All programs require one or more classes that act as a model for the world.

quiet ice
#

ugh, where does that come from

lean gull
#

the act as a model for the world part

lean gull
wraith rapids
#

does codeacademy have a discord

quiet ice
#

you see, context matters, a LOT for interpreting the sentence

lean gull
#

oh ok sorry

quiet ice
#

Yeah, it perhaps it is better to ask there; many of us do not have any experience with teaching java basics

wraith rapids
#

he didn't see my message

#

or, well, he probably did, but pretends not to have

quaint mantle
#

not sure where is the correct channel to recruit Staff Members for an upcoming Spigot Server

quiet ice
#

I for example will end up speaking in circles - which is not helpful to anyone

undone axleBOT
wraith rapids
#

give me admin

#

and also 5 star reviews

#

i'll write you a plugin and backdoor your serbur

ancient plank
#

I can write a shitty rework of the frost-walker enchant in 2 hours

quiet ice
tardy delta
#

what's the best way how to disable a netherportal lighting up? just blocking the event?

wraith rapids
#

yeah well too bad that patents are for pussies and i don't respect them

ancient plank
#

aka I wrote the enchant in 20 minutes but it took me 2 hours to find out the inventory manager utility I was using was borked

quaint mantle
#

I don't need help with Development. I've been into Development since 2009. I've even contributed to the kernel of Debian & Ubuntu Operating Systems

quiet ice
#

I am just the maintainer/triage guy, I am thus not attractive to such stuff

wraith rapids
#

then get out of this channel

quaint mantle
#

I only need help with Management.

eternal night
#

this is a development channel tho

quiet ice
#

^

ancient plank
#

weird flex

quiet ice
#

@ancient plank ban

#

He broke rules

tardy delta
#

is there an event for lighting up an netherportal? i want to block it

ancient plank
#

I've made a frost-walker plugin for the spigot server software

wraith rapids
#

there is one for when the destination portal is generated or located

#

but i don't remember there being one about lighting it, there might be

tardy delta
#

oh

quiet ice
eternal night
#

You mean you maintain a fork of a plugin

quiet ice
lean gull
#

what's IRC

quiet ice
waxen plinth
#

Internet Relay Chat

#

Basically old school instant messaging

wraith rapids
#

redempt

quiet ice
waxen plinth
#

?

wraith rapids
#

do you worship satan

waxen plinth
#

Sure

wraith rapids
#

i knew it

opal juniper
#

So if i set the players camera via packets to another entity, they cannot move their existing player. is there a way to allow them to move their character and intercept the movement cause the attempted movement doesnt fire the movement event

waxen plinth
#

Ok

quaint mantle
#

@ancient plank ban

#

he broke the rules

opal juniper
#

wtf

ancient plank
quiet ice
#

I have ban immunity

wraith rapids
#

you'll need to monitor packets to track the player "vehicle steering" packets or whatever they are called

hybrid spoke
#

hey @quaint mantle how is the weather?

opal juniper
#

i literally have never seen u b4 and u act like the boss

hybrid spoke
opal juniper
#

i mean, i could

wraith rapids
#

of course that will introduce some latency

opal juniper
#

yeah

#

a bit

wraith rapids
#

but it may or may not be tolerable

hybrid spoke
#

@ancient plank ban this is a development channel

wraith rapids
#

@ancient plank ping

opal juniper
#

@wraith rapids pong

hybrid spoke
#

oh he deleted it xD

ancient plank
#

can we not troll while people are getting help

quaint mantle
#

he tricked me

hybrid spoke
#

:D:D

quaint mantle
#

damn

opal juniper
#

can this dude stop acting like he owns the place^^

wraith rapids
#

but he contributed to a coconut kernel

#

he basically owns the internet

opal juniper
#

i bet he contributed like a fix to a typo or some shit

hybrid spoke
#

was it open source?

opal juniper
#

its linux

wraith rapids
#

linux is closed source

#

everybody knows this

#

and also propietary

opal juniper
quiet ice
#

I mean, the kernel has DRM

#

If anyone has a question, ask it anyways btw - our chatter should not distract you

hybrid spoke
#

@opal juniper just had one

#

go help him

wraith rapids
#

i discriminate against minorities

opal juniper
#

i think i am tended to

#

just tryna find my packet interceptor code

hybrid spoke
#

what ya doing btw jeff

#

sounds interesting

opal juniper
#

bit of fiddling with cam packets

hybrid spoke
#

so just testing around?

opal juniper
#

atm yes

hybrid spoke
#

lemme know if you publish it so i don't have the work to do it by myself

opal juniper
#

😄

wraith rapids
#

i could cannibalize some parts of it too for my vehicles at some point down the road

opal juniper
#

were you talking about PacketType.Play.Server.VEHICLE_MOVE

wraith rapids
#

it sounds about right

opal juniper
#

something about my packet interceptor is wrong i think

lean gull
#

a constructor in java is a function that sets variables, right?

wraith rapids
#

sure

#

you can call it that

#

you'd be wrong, but you can call it that

opal juniper
#
public class SteeringInterceptor extends PacketAdapter {

    private final Plugin plugin;

    public SteeringInterceptor(final Plugin plugin) {
        super(plugin, Server.VEHICLE_MOVE);
        this.plugin = plugin;
    }

    @Override
    public void onPacketSending(final PacketEvent event) {
        System.out.println("hello");
    }
}

Anything blatently wrong with this?

wraith rapids
#

do you, uh, need to register it somewhere

opal juniper
#

yeah

wraith rapids
#

i don't really fuck with pl that often so I don't remember how it goes

opal juniper
#

this.protocolManager.addPacketListener(new SteeringInterceptor(this));

#

when would it get called

#

like boats and shit right?

wraith rapids
#

yeah, at the very least

#

but iirc the client always sends some sort of steering packets when its riding something

#

whether the something be a boat or an armor stand

#

are you mounting the player or something, or are they in spectator mode inside an entity

ornate hollow
#

Is it even possible to somehow get Spring Data JPA to work in a plugin?
And if yes, what i have to do in order to get it working, i know that i will need spring core, spring data jpa and mysql driver as maven dependecies
never tried to make a spring app without using the intizler

opal juniper
#

i mean - i am just trying to get the interceptor to work first

wraith rapids
#

well, the player needs to be mounted for that to happen

opal juniper
#

if i change it to Server.MAP_CHUNK it works

wraith rapids
#

i don't know if being in gm3 has the player send those packets

opal juniper
#

so it just isnt getting called

#

wait i may have been looking at wrong packet

#

let me read the wiki more

broken talon
#

Hey I need help

ornate hollow
#

Yes but with what

wraith rapids
#

i only have coal and ash

opal juniper
#

?paste

undone axleBOT
opal juniper
#

I get this huge error if i listen to the serverbound steer

wraith rapids
#

java.lang.IllegalStateException: Override onPacketReceiving to get notifcations of received packets!

broken talon
#

So I need to know if anyone has an idea on how I would like one server, to multiple, like with bungee cord, but retaining all data, (inventory, skill api, etc) basically like pulling from one source

#

that* @ornate hollow

ornate hollow
#

no need to ping lmao

broken talon
#

idk if u were referencing me or not

opal juniper
#

a central datanase

broken talon
#

sorry!

wraith rapids
#

you've implemented onPacketSending

wraith rapids
#

you need onPacketReceiving for serverbound packets

opal juniper
#

oh yeah

#

im dumb

#

i never do the serverbound ones

ornate hollow
broken talon
#

hm

wraith rapids
#

you will need all of your plugins to support what you're doing

broken talon
#

oh wow

#

thats.

#

hm

wraith rapids
#

and you'll need them to be designed properly so they don't explode or lag to shit

broken talon
#

😮

wraith rapids
#

it sounds like you're trying to shard your server

broken talon
#

wdym?

#

like

#

are you familiar with SAO

wraith rapids
#

have one server split across multiple minecraft server instances

broken talon
#

yes!

#

exactly

wraith rapids
#

yeah, that's difficult

broken talon
#

to distribute the reources

#

yea i kinda figured

wraith rapids
#

every plugin that holds any kind of data or does certain things will have to be specifically built for it

opal juniper
#

wait

#

it sends a packet every tick

#

jheez

wraith rapids
#

myeah

#

pretty sure the client sends move packets every tick too

opal juniper
#

yeah

wraith rapids
#

even if it doesn't actually move

opal juniper
#

mhm

wraith rapids
#

the protocol is batshit

opal juniper
#

So it doesn't send shit when you move the camera

#

with the packet

wraith rapids
#

god i hate slimefun

ornate hollow
shadow pulsar
#

How do you shift a location relative to its rotation?

broken talon
#

well hm

wraith rapids
#

Location::add

broken talon
#

for instance how does skyblock on hypixel work? they have multiple servers but all your data is retained

wraith rapids
#

Location::getDirection

#

getDirection returns a Vector

#

which is basically a mini location

minor garnet
#

my runnable dont stop

wraith rapids
#

in particular, it returns an unit vector, which has some direction and a magnitude of 1 (unit)

#

so if you just add the unit vector you get to the location, you move it by 1 block in that direction

ornate hollow
shadow pulsar
wraith rapids
#

yes, but lots of them are written like trash and don't support true sharding

#

location.add(0,1,0) moves it up by 1

shadow pulsar
#

That isn't relative to its rotation though

wraith rapids
#

get the rotation and rotate it 90 degress along the y axis

shadow pulsar
#
        float pitch = loc.getPitch();

        //+ FORWARD - BACKWARD
        loc.setX(loc.getX() - forward * Math.sin(Math.toRadians(yaw)));
        loc.setY(loc.getY() - forward * Math.sin(Math.toRadians(pitch - 90)));
        loc.setZ(loc.getZ() + forward * Math.cos(Math.toRadians(yaw)));

        //+ LEFT - RIGHT
        loc.setX(loc.getX() - sideways * Math.sin(Math.toRadians(yaw - 90)));
        loc.setZ(loc.getZ() + sideways * Math.cos(Math.toRadians(yaw - 90)));```
This is what I have. I just don't know how to add pitch into it.
wraith rapids
#

then add it to the location

waxen plinth
#

The easiest way?

#

loc.setPitch(loc.getPitch() + someValue);

#

I find it strange that locations allow you to manipulate pitch and yaw but vectors don't

wraith rapids
#

it's kind of funky yeah i suppose

opal juniper
#

Hmm i wonder if this is the one time that the client actually has logic to not send packets if it is not moving

shadow pulsar
#

If the location has a 90 degree pitch, then forward would be going down on the y axis

#

And upward would be going forward

wraith rapids
#

yes

#

just rotate the direction vector

#

and add it to the location

#

if you want to go forwards, you don't rotate it

#

if you want to go backwards, rotate by 180

#

if you want to go sideways, rotate left/right by 90 degrees

#

if you want to go up/down, rotate up/down by 90 degrees

#

you can do the same with just flipping the signs and reversing the order of the vector components as well

minor garnet
waxen plinth
#

Not if you don't show us the code that's actually doing the math

#

And what do you mean by "stranger float number"

wraith rapids
#

stranger danger

waxen plinth
#

Do you mean the scientific notation

#

____E_

minor garnet
#

my problem its because my loop runnable stop

waxen plinth
#

Well yeah you're running a repeating task

#

??

minor garnet
#

im trying check if number is 0 then i stop it

#

let me take translator

waxen plinth
#

I have never seen someone use a ternary statement like this lol

minor garnet
#

yes

waxen plinth
#

But this will never be true

minor garnet
#

ah yeah

waxen plinth
#

Wait

#

s;krfgnlsfgnlfsdg

#

This is the same as x == 0 lmao

minor garnet
#

in the case if the number of less than zero will make the opposite condition

waxen plinth
#

If x is less than 0 it will never be greater than or equal to 0

minor garnet
waxen plinth
#

If x is not less than 0 it will only be less than or equal to 0 if x is 0

#

No your entire ternary statement is the same as x == 0

minor garnet
#

let me do a test

#

and the other conditions xd

waxen plinth
#

Anyways

minor garnet
waxen plinth
#

What's probably happening is that your code is making the number get incredibly close to 0

#

But never actually equal

#

There's rarely a reason to use == with floats

#

You should just do if (Math.abs(x) < 0.0001) or something

minor garnet
waxen plinth
#

Okay but by "stranger float"

#

Do you mean the one with E in it

minor garnet
#

there are times when the runnable cancels, but other times it sends me a message saying that the runnable is over but it continues

waxen plinth
#

Because that's just how very small numbers are displayed

minor garnet
#

okay

waxen plinth
#

Very large ones too

minor garnet
#

it turns out that the code also ends up having internal influences

quiet ice
#

basicsally, fractionals

minor garnet
#

big code =/

quiet ice
#

You are likely subject to floating point errors here

waxen plinth
#

?paste

undone axleBOT
minor garnet
#

tell me something to improve this code

waxen plinth
#

I really don't get what this is supposed to do

minor garnet
#

let me show your self

waxen plinth
minor garnet
waxen plinth
#

I don't get why you're doing this instead of just using the spigot api

minor garnet
#

its nms to change your camera position

left swift
#

Hey, I am using the plugin for intelliJ Minecraft Development and noticed I have a paper api to choose from. I would like to ask how is this different from spigot api and which should i use. I am currently using spigot api.

waxen plinth
#

You're trying to add recoil?

minor garnet
#

yes

waxen plinth
#

Okay that's never gonna look good

minor garnet
#

huh

waxen plinth
#

It might look fine on your own local server but for anyone with even a few milliseconds of latency it will look terrible

waxen plinth
#

It has some more features and additions to the API

#

But it's not really a huge difference

quiet ice
minor garnet
#

oh so i kick the player if there is high latency

waxen plinth
#

No??

minor garnet
#

?

waxen plinth
#

I just think what you're trying to do isn't going to work

quiet ice
#

The bigger issue is that you cannot put paper-api plugins on spigot

minor garnet
#

it's working fine I just need to know how to fix this error in runnable

#

yes is dont stoping..

waxen plinth
#

Then use if (Math.abs(x) < 0.0001) instead of your current abomination of a ternary statement

minor garnet
#

xdd

#

okay.. but

#

it turns out he's not returning

#

going back to the camera again

#

basically imagine you adding 1 in 1 until you get 10, after that you'll subtract that number until you get 0

waxen plinth
#

Right, but it's a float

#

And from what I can tell

#

It seems you're raising that number to a certain point

#

The peak of the recoil

#

And then you come back down using lerp with 0.17

#

So it will go 17% the way back to the starting position from where it was

#

But that's based on the current position, not the original one

#

So it's less and less each time

#

And it will never actually reach 0

minor garnet
#

I'm actually adding to the float

waxen plinth
#

The float will never be 0 is my point

minor garnet
#

so i do if it is greater than or equal

#

=

sweet sun
#

?learnjava

undone axleBOT
sweet sun
#

someone send yesterday a link for Java learn on intelij

minor garnet
#

i already have fixed

minor garnet
shadow pulsar
wraith rapids
#

i can't see replies

shadow pulsar
#

Rotating the vector does not seem to work

wraith rapids
#

you're rotating it wrong

shadow pulsar
#

I'm using a function that takes in a forward, up, sideways and location variable and then making that into a vector. Getting the direction of the location and adding the forward, up, and sideways vector to the direction

#

And I am rotating the direction variable on the y axis 90 degree for up and down and on the z axis 90 degrees for left and right.

wraith rapids
#

the left/right rotation has to happen perpendicular to the relative vertical axis

#

consider reordering the dimensions and flipping their signs instead of using vector math if it turns out to be too complicated

shadow pulsar
#

I'm not sure how to reorder it though. Don't I need to add all of the forward, up, and sideways rotation at once or else the location's direction will keep getting added on to it

wraith rapids
#

here is a 2d vector

#

it consists of 2 properties

#

blue and green

#

by swapping blue and green and flipping their signs we can rotate the vector at 90 degree intervals

#

consider the vector pointing up-ish

#

the Y value, the blue line, is very positive

#

the X value, the green line, is slightly negative

#

we can rotate it clockwise 90 degrees by swapping X and Y, and flipping the sign of one of them

#

the very positive Y becomes very positive X

#

the slightly negative X becomes slightly positive Y

shadow pulsar
#

Okay so I see how that rotates. But then how would I do the calculations to put forward into x, y, and z.

wraith rapids
#

you take the principle and apply it to higher dimensions

shadow pulsar
#

The closest I got was this

   loc.setZ(loc.getZ() + forward * Math.cos(Math.toRadians(yaw)));```
#

But it doesn't take pitch into account

wraith rapids
#

if you do it that way you need to get into vector math and shit

#

anyways, i have something to do

shadow pulsar
#

Okay. Thanks for the help

crystal magnet
#

does Inventory#getContents() contain the offhand for a PlayerInventory?

reef wind
#

how would i rotate a projectile towards a location?

crystal magnet
#

atan2

eternal oxide
#

gradual rotate or direct?

opal juniper
#

What does the latter half of this mean ?

#

What is the other entity

crystal magnet
#

that would be the entity that is being spectated

opal juniper
#

Hmm - makes sense i guess

valid crescent
#

Hey! I was wondering if there's any way that I can add my own methods the the Player class (Do something like: player.getPlayerRank())?

opal juniper
#

you can create your own class

#

that extends player

#

i think that is how that works

eternal oxide
#

You create your own class and add a UUID reference to teh player it represents

opal juniper
#

or that ^^

valid crescent
#

and then ranking.getPlayerRank()?

eternal oxide
#

I'd nto call it just ranking as it includes more than that

opal juniper
#

What is the name of your plugin called?

eternal oxide
#

call is User or PlayerWrapper. anything thats indicative of its purpose

opal juniper
#

E.g. StatsPlayer

valid crescent
#

Ok, i'll try that - Thanks!

eternal oxide
#

only store the Players UUID in your class, not the full player object

opal juniper
#

Hey elglarl you familiar with packets?

eternal oxide
#

I've not worked with MC packets much but protocol design in general yes

opal juniper
#

However i would like the player to still be able to control their camera when in this 'Spectating' view

#

However when i read that
The player is unable to move this entity (move packets will act as if they are coming from the other entity).
do you have any idea where the packets would come from?

eternal oxide
#

I'd have no clue.

opal juniper
#

Hmm yeah

eternal oxide
#

You'd have to test to see if teh client even sends any movement packets to teh server once you are a spectator

#

server to client its just accepting teh entity movment as the players

opal juniper
#

i have a packet PacketAdapter for:
super(plugin, Client.POSITION_LOOK, Client.STEER_VEHICLE, Client.POSITION, Client.BOAT_MOVE, Client.LOOK, Client.POSITION_LOOK, Client.CUSTOM_PAYLOAD, Client.SPECTATE, Client.FLYING);
And absolutely nothing comes thru

eternal oxide
#

its either going to be a client state that sets you to the entity and disables all control, or its a server side which ignores client movement packets

opal juniper
#

im thinking that it is the former

eternal oxide
#

Its most likely

opal juniper
#

which is a royal pain in the ass

eternal oxide
#

but you never know with MC, it does some odd things

opal juniper
#

yeah - thats kinda what i was hoping but it doesn't seem too likely

opal juniper
#

but, i dont really know where the packets would come from - ie serverside or client side

eternal oxide
#

Yep, that would have been useable then

opal juniper
#

i imagine client side

eternal oxide
#

however, I did see someone a few months back using reflection/nms to allow them to control a slime they were mounted on.

dire marsh
#

steer packets are only sent if you are a passenger on an entity

opal juniper
#

Yeah

#

ehh - idrk if this is possible

opal juniper
#

cause they are mounted

#

not 'spectating'

frosty tinsel
#

Why does it do this?

chrome beacon
#

Send your build command

digital plinth
#

anyone knows why this error occured?

#

line 25

eternal oxide
#

You don;t have MV inventories on yoru server

digital plinth
#

🤣

#

whats the difference between the build and jar?

eternal oxide
#

are you supposed to be using maven?

waxen plinth
#

I think jar might be run as part of build, I could be wrong though

digital plinth
eternal oxide
#

k

digital plinth
#

so should i run the build or jar

eternal oxide
#

I don;t use gradle

#

I would assume build

#

in Maven it would be package and that triggers all teh cycles

lusty cipher
#

yes run build

#

build consists of resource related tasks, assemble task and also the jar task afaik

wise mesa
#

Is it better to use a separate tcp socket between bungee cord and server

#

For example say I want them to always be able to communicate not just when there’s a player on the server

#

And I want a bunch of servers to be able to send messages to the bungee cord where it can broadcast responses to all servers

fresh stump
#

Hey is it possible to get all my posts removed from my account?

fickle glen
#

What can I use instead of getItemInHand

wraith rapids
#

getiteminmainhand

quiet ice
wet breach
quiet ice
#

If you are not an EU citizen, your options are more limited though

wet breach
#

unless you live in Cali

wet breach
#

It applies for anyone that is subject to EU regulations

fresh stump
#

well is there a way to delete my account instead of deleting all my forum posts

wet breach
#

so even though I live in the US, if the company is bound by EU laws, I can still request information removed under GDPR

wraith rapids
#

someone said that usernames are supposedly categorized as personally identifiable

fresh stump
wet breach
wraith rapids
#

i don't see why usernames would be personally identifiable

#

like yes, someone could use their powerword as their username on every service ever

fresh stump
#

I just want to start fresh on spigot

quiet ice
#

well, some stuff doesn't need to get removed, but it is sparse

wraith rapids
#

but that's not a valid reason for it being personally identifiable

lunar schooner
wise mesa
#

Alright gtg

quiet ice
#

they also have less headache if the server is empty

wraith rapids
#

yeah sockets for the win

wet breach
wraith rapids
#

plugin messaging is overly complicated and suffers from drawbacks and is gay

#

that doesn't really tie it to your person, though, does it

crystal magnet
#

what type of data are you trying to serialize?

wraith rapids
#

you shove the result of your serialization method in the file

wet breach
wraith rapids
#

who says it's tied to an email

#

and why is the email tied to your person

wet breach
#

If you don't agree with that, then go argue for the removal of GDPR

wraith rapids
#

as if me arguing for yay or nay would change anything

#

i'm just trying to figure out if there's something i missed

wet breach
#

Emails count as being personally identifiable

wraith rapids
#

emails specifically? why

wet breach
#

because emails are still a way to communicate? I mean guess you never heard of verifiable emails before.

quiet ice
#

the email providers that many people use are tried to your phone number, which is often tried to you

wraith rapids
#

yeah, in that case (assuming that information is available), I would say it is personally identifiable

quiet ice
#

ByteBuffers 🌈

wraith rapids
#

google

#

the way I see it, something is personally identifiable if it by its nature is something that can be traced to your person

#

for example a phone number; who owns which phone numbers is public information

proven sierra
#

Does LivingEntity#setAI(false) make the entity invulnerable?

wraith rapids
#

or a license plate; also public information

wet breach
quiet ice
#

you don't need to tie anything to one specific person to know that it is some person you have met before

wraith rapids
#

but by that definition literally everything is personally identifiable

proven sierra
#

if a phone number is personal info why isn't a username? both identifiers

#

what makes a phone number special

wraith rapids
#

because the username isn't tied to your person via a public record

#

unlike the phone number

#

if it is tied to your person via a publicly accessible record, then it is personally identifiable

proven sierra
#

might be an american thing

#

doesn't work as such here

wraith rapids
#

i'm not american

proven sierra
#

ok, some non-english thing

quiet ice
#

It is pretty much worldwide

wet breach
quiet ice
#

At least in germany that rule also applies

proven sierra
#

my mobile number isn't tied to me other than through payment information

wraith rapids
#

conversely, if the phone number cannot be linked to your person via a publicly accessible record, I would not qualify it as personally identifiable

#

for example a prepaid

proven sierra
#

in the same way my discord is tied to me through payment information

wraith rapids
#

yes, but that isn't publicly available

#

that isn't something that people other than the payment provider and the payment receiver should have access to, nor should be allowed to cross reference

quiet ice
#

I was active in a forum where they would delete everything with a GDPR, even mentions would get altered

proven sierra
#

everything is publicly available if you try hard enough

wraith rapids
#

shouldn't be publicly available

proven sierra
#

a lot of things shouldn't be

#

doesn't mean they aren't

wraith rapids
#

if some service gets hacked and gets my data leaked, that's not grounds for things being personally identifiable

wet breach
wraith rapids
#

because if it was then again, literally fucking everything would be personally identifiable

proven sierra
#

which could be why everything is deleted?

#

🤯

quiet ice
wraith rapids
#

whether or not you can identify someone from the information is very subjective

#

i can identify my friend from the way how he writes messages

quiet ice
#

They WILL need to inform you of this breach

wraith rapids
#

are messages personally identifiable information, then?

wet breach
wet breach
quiet ice
#

I would say so

wraith rapids
#

anything can be

wet breach
#

even if you changed your discord name, I could probably still tell it is you by the way you talk

wraith rapids
#

if I posted my powerword in a message, it would be personally identifiable

#

but that doesn't mean that every message ever sent should be considered as such

wet breach
#

except the GDPR doesn't give that distinction

wraith rapids
#

i find the whole GDPR thing to be super vague and incoherent

#

far too much up for interpretation

wet breach
#

yet many organizations are subject to it 😉

wraith rapids
#

if anything that 'could' be personally identifiable to someone in some case is considered personally identifiable, there is literally not a single thing in existence that isn't personally identifiable

#

the letter a could be personally identifiable

#

what if I have a secret way to communicate with my friend that involves printing the letter a at every odd minute of every even hour

wet breach
#

GDPR applies to organizations not individuals

wraith rapids
#

only me and my friend know about this, so if my friend or I recognize this pattern, we are personally identifiable

#

since the letters are personally identifiable information, whoever hosts them in any fashion would be subject to having to remove them under GDPR

#

is that not fucking retarded

quiet ice
#

I would consider this encryption

wet breach
#

depends on the host really. For instance, I live in the US. If I have an organization based in the US, I am not automatically subject to the GDPR unless I am specifically soliciting to those in the EU. So even if I could probably have EU customers, as long as they are not my primary customer base and I am not soliciting to them I am not subject to the GDPR

wraith rapids
#

but if the definition of personally identifiable is that 'someone' can identify your person based on it in 'some' case, then that would qualify

quiet ice
#

And I am pretty sure that the laws should limit what applies to it either way

wraith rapids
#

as in this case, my friend, the someone, would identify me based on the context of the messages being sent at certain points in time

quiet ice
#

You cannot remove ban records with it for example

quaint mantle
#

Hey I'm trying if(e.getPlayer().getInventory().getItemInOffHand() != null && !e.getPlayer().getInventory().getItemInOffHand().getData().getItemType().equals(Material.AIR)) { ItemStack offHand = e.getPlayer().getInventory().getItemInOffHand(); if(!(offHand == null && !offHand.getData().getItemType().equals(Material.AIR))) { to check if a player has something in their hands but it's still going thru the if statements any idea how I can make this work?

wraith rapids
#

smh yet another overcomplicated, vague, and at the end of the day damaging legislation put through by the fucks in the eu, under the guise of fixing issues and supporting personal privacy

#

just like the fucking cookie popups

#

people should just stop trying to make things better

#

every time things just get worse

quiet ice
#

Well, I do not see why we need cookies in the first place

#

well, at least most of them

wet breach
# wraith rapids as in this case, my friend, the someone, would identify me based on the context ...

if we are to use discord as an example, your user id is attached to all the messages sent even private messages. Because of this, even if you private messaged someone, if that someone requested their information and account removed under GDPR, those messages you had with that someone, their messages and account would be gone whether you wanted it to or not. Because the GDPR isn't about whether an individual could identify you, but if the organization that collects your information could or not.

wraith rapids
#

the issue is that the cookie popup shit is done under the guise of supporting personal privacy

#

but it achieves very little in that regard

#

even if you forbid cookies, in which case you often can't even use the site, or have to go through some annoying, long dialogue

ripe gull
#

hey i wanted to add inventories with pages to my plugin but didnt found any good libary but i found this: https://www.mc-market.org/threads/253886/
it works very well but i dont know how exactly to add the items now. Also the developer told another guy in the comments but i didnt get it so i would love to get some solutions <3

wraith rapids
#

they will still track you through other means

quiet ice
#

it is better than nothing

wraith rapids
#

we have had browser addons like self destructing cookies for years

#

this was entirely redundant and unnecessary

#

and has done nothing more than made the internet more annoying to use

quaint mantle
#

this chat is suppose to be for spigot help development 😄

quiet ice
#

Unfortunately, many people do not realize this

quiet ice
wraith rapids
#

many people do not realize that cookies are only a very narrow subset of the ways employed by sites for tracking

#

and are lulled into a false sense of security by it

#

i find the whole ordeal to be pretentious and more harm than it's worth

#

hypocritical, even

ripe gull
#

isnt my problem a spigot development problem?

quiet ice
#

I do not touch mcmarket

#

I would rather kill than go there

#

Litterally has the most aggressive CF config

ripe gull
#

yeah i understand but its the only good thing i found

wet breach
narrow vessel
ripe gull
#

do you have something else what i could use to get pages?

quiet ice
wraith rapids
#

GDPR is good in spirit but based on what little I know of it it falls into the same category of pretension and possibly more harm than good as the cookie bullshit

quaint mantle
quiet ice
#

Then debug everything

quaint mantle
#

even if i'm not holding anything it still goes thru

quiet ice
#

Sysouts everwhere

wraith rapids
#

that said I know next to nothing about it and don't really have the effort to find out, either

#

but, your explanation was enlightening

quiet ice
#

I always saw the GDPR as the ultimate destruction button, which most often was not worth pressing

wraith rapids
#

i think we should ban ads in their modern form

quiet ice
#

that would be a considerably large nudge

wraith rapids
#

the only allowed way to advertise would be a monochrome text-only information pamphlet

#

no videos, no flashing lights, no click here scam bullshit

#

just the raw information

digital plinth
wet breach
digital plinth
#

weirddd

wraith rapids
#

ads the way I see it are their whole own sector of science for psychological manipulation

quiet ice
#

Java 15+ NPEs are useful for such issues

wraith rapids
#

since when was it fine to manipulate people into doing something they didn't want to do in the first place

quaint mantle
quiet ice
#

However here it is easily noticeable that groupManager is null

wraith rapids
#

i haven't seen elgar for a bit

quaint mantle
wraith rapids
#

did he die

wet breach
wraith rapids
#

@eternal oxide people are saying that groupmanager is bad

#

come defend it

quiet ice
#

He did write a message not so long ago

#

only an hour ago, not too bad

wraith rapids
#

maybe he's avoiding me

#

is he polish

quiet ice
#

UK according to github

wraith rapids
#

thats basically poland but with more rain

#

@eternal oxide don't make me get the schwerer gustav

floral glen
#

Hello

#

I try to update an old plugin (1.8) to 1.16.
I've a function to clear some chests, but that doesn't work in 1.16, does someone can explain how to clear chest content ?

wraith rapids
#

get the tile state, cast to chest, get the inventory, clear it, update the tile state

floral glen
#

Chest chest = (Chest) location.getBlock().getState(); chest.getBlockInventory().clear(); chest.update(true);

wraith rapids
#

something along those lines, yes

weary geyser
#

Yes

floral glen
#

That doesn't work 😞

quiet ice
#

Worst case scenario you just destroy the chest, remove all NEW item entities near the chest and replace it

floral glen
#

Yeah, this is my last resort

quaint mantle
#

so I'm seeing that InventoryClickEvent#setCursor​ is deprecated, what should I use instead?
would it be setCurrentItem?

quiet ice
#

is the chest a double chest by any chance?

sage swift
#

pretty sure the inventory is not part of the state

#

by setting the state back you're overwriting your changes

#

although I guess that doesn't quite make sense

sage swift
#

and maybe try getInventory instead of getBlockInventory?

digital plinth
floral glen
digital plinth
digital plinth
#

not set?

sage swift
#

why didn't you just say "not set?" when replying to the message

quiet ice
#

null and not set is the same

wraith rapids
#

var = null wants to know your location

quiet ice
#

But, are you sure that you are calling your code at the right time?

#

Ideally you should make everything lazy

quiet hearth
#

In order to make a book that when u open it, it shows an interface that allows u to click somewhere to open anotheter interface for a crafting recipe, do u need to use KnowledgeBookMeta

floral glen
mossy blaze
#

Factions question. When i do FPlayers.getInstance() it says it can't initialize the instance.

sage swift
digital plinth
#

okay is something wrong witht hat?

digital plinth
#

well i believe it is set

mossy blaze
digital plinth
#

groupManager = inventories.getGroupManager()

sage swift
#

you should get it when you instantiate the command class, not when creating the field

quiet ice
#

Yes, otherwise it may return null

#

Which is basically the same as not setting the field in the first place

#

Again, initiate stuff lazily, i. e. only when it is actually needed

mossy blaze
sage swift
#

it's probably SaberFactions, but you can check their plugin.yml

mossy blaze
#

right

mossy blaze
#

Huh. It's still not working. I'm getting a NoClassDefFoundError, if that helps. Do I need to add something in my onEnable to get it to work?

chrome beacon
#

Full error would be nice

#

?paste

undone axleBOT
mossy blaze
granite stirrup
mossy blaze
#

players.add(FPlayers.getInstance().getByPlayer(player));

granite stirrup
#

FPlayers.getInstance().getByPlayer is null?

#

or player is null?

#

oh wait

#

FPlayers couldnt be found

#

it says

#

NoClassDefFoundError

#

do u have the massivefactions plugin?

#

and does it have the FPlayers class

mossy blaze
#

yeah, its in the external JARs and installed on the server

#

its in my depends as well

wraith rapids
#

Could not initialize class com.massivecraft.factions.FPlayers

#

the class is there

#

but some static initializer in clinit fails

#

and the class can't be initialized

#

you are probably initializing the class out of order somehow; it probably depends on some other massivefactions class being initialized first

#

make sure that the plugin is listed as a dependency in your plugin.yml, and that you aren't touching stuff too early

#

and make sure you're not shading massivefactions into your own plugin jar

granite stirrup
#

uh

sage swift
#

the reason your question went unanswered is because it's essentially rhetorical

granite stirrup
#

i think my mc is broken

#

no sounds are playing

#

;-;

sage swift
#

happens all the time, f3+t

granite stirrup
#

it could be a optifine bug tho

#

since im in optifine

hybrid spoke
#

did you tried to restart your minecraft..?

granite stirrup
#

i did f3 + t it works now

#

maybe it failed to load the sounds?

hybrid spoke
#

maybe maybe

mossy blaze
#

i tried loading the plugin post-world and now it returns this

hybrid spoke
#

or your headset did unplug for a sec

granite stirrup
#

i have speakers

#

and i dont have headsets

wraith rapids
#

you are definitely accessing things in the wrong order

granite stirrup
#

the speakers are built in

#

and i was watching utube videos

slim kernel
sage swift
#

Iterator

hybrid spoke
#

or use another list with your elements which you loop through instead

sage swift
#

Iterator

slim kernel
slim kernel
hybrid spoke
#

here you have examples for both solutions

slim kernel
#

thank you alot

hybrid spoke
#

np - was the first google result

quaint mantle
#

whats the difference between legacy_air and air..?

quiet ice
#

latter should be used

quaint mantle
#

i thought legacy was for older versions

quiet ice
#

The first one should NEVER be used under ANY circumstances

#

it is just there because of spigot's ASM hacks

quaint mantle
#

is it normal for 1.16 to return LEGACY_AIR then as an items type?

quiet ice
#

not at all

#

unless you have invoked legacy mode (did you set the API version?)

quaint mantle
#

oh, no. I didnt set it cause it wouldnt load for 1.8-1.12 if i did would it?

quiet ice
#

it would

granite stirrup
#

if u set it to 1.13 i think it works for ever version

wraith rapids
#

the api version thing is dumb

granite stirrup
#

eh but its still here rn

quiet ice
#

Yeah, the api version was introduced with 1.13, so 1.12 and before will ignore this value

#

But be wary that you can currently be able to set the minimum api version via the spigot.yml file

quaint mantle
#

hmm, okay. thanks

sage swift
#

you made the plugin? lol

granite stirrup
#

paper has 2 builds

#

but the latest is build 5

#

XD

#

theres 4

#

but wheres 3-1

#

XD

#

and maybe 0?

quiet ice
#

build 1 - 3 were all experimental and as such were built by a staging builder

reef wind
#

Sorry, i asked this earlier but had other things to do so forgot about it, but how would i rotate a projectile towards a location?

granite stirrup
#

but why doesnt it start at 1

#

they should still mark it as 1 and 2

#

not 4 and 5

#

even if they were builds before thats experimental

#

also isnt those builds still experimental?

torn shuttle
#

eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeew what's this stinky way c# does switch statements

#

I feel like I need a shower just by setting my eyes on their documentation

reef wind
#

i like the way they do it

torn shuttle
#

but but but my case rollover ;_;

#

it's so filthy

azure dune
#
EnumPlayerInfoAction.ADD_PLAYER

This no longer works, anyone good with packets know how to spawn and remove a player from player tab list in 1.17?
Using this for maven:

        <dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot</artifactId>
            <version>1.17-R0.1-SNAPSHOT</version>
            <classifier>remapped-mojang</classifier>
            <scope>provided</scope>
        </dependency>
wraith rapids
#

can't be a variable

#

switch cases only accept constants

stone sinew
#

yeah I changed it to if and else if

reef wind
#

?paste

undone axleBOT
lofty junco
#

hello i have an inv here that shows the friends in the inventory now i want the people that are online to be shown first then the ones that are offline can anyone help
code : https://paste.md-5.net/dugabagija.cs

#

I tried it on an test projet but i dont know how to use it with the spigot api to sort the inventory

reef wind
vast sapphire
#
    @EventHandler
    public void onFireballHit(ProjectileHitEvent event) {
        Fireball fireball = (Fireball) event.getEntity();
        Player player = (Player) fireball.getShooter();
        ItemStack item = player.getInventory().getItemInMainHand();
        ItemMeta meta = item.getItemMeta();
        String name = meta.getDisplayName();
        Location fireballLocation = fireball.getLocation();
        World world = player.getWorld();
        int randomExplosionPower = (int) Math.ceil(Math.random() * 20);
        if (name.equals("§6CUSTOM STICK")) {
            if (event.getEntity() == fireball) {
                if (item != null) {
                    if (event.getHitEntity() != fireballLocation) {
                        if (fireball != event.getHitEntity()) {

                            world.createExplosion(fireballLocation, randomExplosionPower, true, true);
                            world.playEffect(fireballLocation, Effect.MOBSPAWNER_FLAMES, 10);
                            world.playEffect(player.getLocation(), Effect.BLAZE_SHOOT, 10);
                            player.sendTitle("","=" + randomExplosionPower, 1, 2, 1);
                        }
                    }
                }
            }
        }
    }```
#

explosion power only happens when the fireball hits another fireball

lofty junco
#

does anyone know how to use Comparator with inventories

wraith rapids
#

grab the contents into an array and sort

#

you'll have to implement a sorting function for ItemStack

#

you can sort by f.e name or whatever

lofty junco
#

i tried something with an test project

wraith rapids
#

Comparator.comparing((item) -> item.getProperty())

#

where getProperty should return something that is Comparable

lofty junco
#

yea did you saw my code?

wraith rapids
#

the image you keep sending? yes