#help-development

1 messages · Page 998 of 1

rotund ravine
#

?jd-s

undone axleBOT
karmic sapphire
#

Oh strange,Do you know how would I give it the permission?

rotund ravine
#

Debug it

#

Also check for the damage type

nova quail
# rotund ravine Debug it

I debuged and all messages after if (pushedInAirPlayers.contains(player.getUniqueId())) { don't sends

#
 private Set<UUID> pushedInAirPlayers = new HashSet<>();
                pushedInAirPlayers.add(p.getUniqueId());
chrome beacon
#

Where and when is that called

rotund ravine
#

?paste

undone axleBOT
rotund ravine
#

Class / classes please

nova quail
chrome beacon
rotund ravine
#

He meant to put the .remove method instead of contains

#

Before continuing, i also want you to check the damage type before the set.

#

Let me know when that is done and i’ll tell you what is likely your issue

nova quail
karmic sapphire
#

test@Laptop:~$ chmod +x gradlew
chmod: cannot access 'gradlew': No such file or directory
test@Laptop:~$

nova quail
#

or what

rotund ravine
#

Now add a damage type check before that

chrome beacon
#

looks like it's not in the directory you're currently in

karmic sapphire
#

hmm, is that bad lol

chrome beacon
#

?

rotund ravine
#

Not bad

#

Just ur a nub ur welcome 🫶🏻

karmic sapphire
#

whats a nub

chrome beacon
#

intentional typo of "noob"

rotund ravine
#

I plead the fifth

karmic sapphire
#

ohhh

#

I am a noob lol

#

I accept

rotund ravine
nova quail
rotund ravine
#

Not debug it

#

Add it to the if statement before removing

proper cosmos
#

why when I cancel KnockBackevent, shield is not working (not blocking)

nova quail
rotund ravine
#

Sure

#

Show class again

#

?paste

undone axleBOT
nova quail
rotund ravine
#

Good enough

#

Show me the two lines in which you register the command and the listener

nova quail
rotund ravine
#

Now

#

Above that make a local variable for the class

#

PushInAir pushInAir = new PushInAir()

#

Pass pushInAir in the places where it says new PushInAir so u only write new PushInAir once in your whole main class

nova quail
#

private PushInAir pushInAir = new PushInAir();
So like that in Plugin Class?

rotund ravine
#

Sure, that’s not very local. But doesn’t matter

dapper flower
#

Can someone give me an heads up? will this work or do i need to make that long list call to get the data too?

//setting data
pdc.set(plugin.getKey(), PersistentDataType.LIST.listTypeFrom(PersistentDataType.INTEGER), List.of(values));

//getting data
int[] data = pdc.get(plugin.getKey(), PersistentDataType.INTEGER_ARRAY);
nova quail
#

and what now

dapper flower
eternal oxide
#

that just means you are not passing in an array of integers

drowsy helm
#

A set isnt an array

rotund ravine
tardy delta
#

just use int array altogether

nova quail
rotund ravine
#

Should work fine if ya did as i told ya

rotund ravine
#

U didn’t do it

nova quail
#

I don't understand a little bit

rotund ravine
#

No

rotund ravine
#

Anyplace in these two

eternal oxide
#

He needs a lesson on instances

rotund ravine
#

Yes I am not giving him one though

eternal oxide
#

lol

worthy yarrow
#

If only cafebabe had commands for where to learn java concepts

nova quail
#

i'll check later and change all

worthy yarrow
#

It's ok man we all forget stuff

nova quail
worthy yarrow
#

I've read a java bible twice and not retained much

rotund ravine
#

getServer().getPluginManager().registerEvents(pushInAir, this);
getCommand("push").setExecutor(pushInAir);

nova quail
#

oh

rotund ravine
#

🥄

eternal oxide
dapper flower
#

Integer[] values = data.getData().values().toArray(new Integer[0]);

dapper flower
#

cant cast an Integer[] to int[] so guess that will have to do

#

i mean i can make a for loop to unwrap it but fuck it

worldly ice
#

you can just turn it into an int[] by doing a new int[0] instead of new Integer[0]

eternal night
#

just mapToInt

trail coral
#

is there a good documentary for how to support multiple versions?

dapper flower
#

it is a primitive

worldly ice
eternal night
#

List.of(1,2,3).stream().mapToInt(Integer::intValue).toArray();

dapper flower
#

int[] values = Arrays.stream(data.getData().values().toArray(new Integer[0])).mapToInt(Integer::intValue).toArray(); this looks so ugly

eternal night
#

wtf

dapper flower
#

fixed it a bit

#

data.getData().values().stream().mapToInt(Integer::intValue).toArray()

eternal night
#

👍

#

you could just use PersistentDataType.LIST.ints()

#

but that takes up a bit more space I guess

dapper flower
#

i hate those oneliners

eternal night
rotund ravine
#

For some reason i have that guy blocked

#

I wonder what he did

dapper flower
#

who

rotund ravine
#

You

dapper flower
#

,-,

wild mica
#

Hello, How do I make a command argument in Turkish? args[0].equalsIgnoreCase("gönder") this isn't work, args[0].equalsIgnoreCase("give") this is work

dapper flower
#

i don't even know who you are my man

tardy delta
#

doesnt minecraft like turkish?

rotund ravine
wild mica
#

it already is

lethal coral
#

it's working... sorta

worthy yarrow
#
@EventHandler
    public void onPlayerMove(PlayerMoveEvent event){
        Player player = event.getPlayer();
        Biome currentBiome = player.getWorld().getBiome(player.getLocation());
        if (playerBiomeCache.get(player.getUniqueId()) == null){
            playerBiomeCache.put(player.getUniqueId(), player.getWorld().getBiome(player.getLocation()));
            Bukkit.getPluginManager().callEvent(new PlayerTemperatureChangeEvent(player, calculatePlayerTemperature(playerBiomeCache.get(player.getUniqueId()), seasonsManager.getCurrentSeason(), player)));
            return;
        }
        if (currentBiome != playerBiomeCache.get(player.getUniqueId())){
            playerBiomeCache.put(player.getUniqueId(), player.getWorld().getBiome(player.getLocation()));
        }
        Bukkit.getPluginManager().callEvent(new PlayerTemperatureChangeEvent(player, calculatePlayerTemperature(playerBiomeCache.get(player.getUniqueId()), seasonsManager.getCurrentSeason(), player)));
    }```
In my mind this is a valid use for playerMoveEvent, the calculations will only ever occur when they enter a new biome... anyone refute or think it's fine?
chrome beacon
#

Why are you getting the biome multiple times from the cache

#

anyways tas

#

?tas

undone axleBOT
young knoll
#

Could you not just compare the biome at getFrom and the biome at getTo

worthy yarrow
#

Well the actual functionality is less what I'm concerned about, I'll make it better in a while. I just wanted to know if this was bad use of playerMoveEvent

worthy yarrow
worthy yarrow
eternal oxide
#

Too heavy. No need to cache, just read from event to/from

worthy yarrow
#

Yeah gonna change to that lol

eternal oxide
#

if (event.getFrom().getBlock().getBiome() != event.getTo().getBlock().getBiome())...

#

before getting biome, early return if Blocks are the same

worthy yarrow
#

if (event.getFrom().getBlock() == event.getTo().getBlock()){
return;
}

Like this?

#
 @EventHandler
    public void onPlayerMove(PlayerMoveEvent event) {
        if (event.getFrom().getBlock() == event.getTo().getBlock()){
            return;
        }
        if (event.getFrom().getBlock().getBiome() != event.getTo().getBlock().getBiome()){
            Bukkit.getPluginManager().callEvent(new PlayerTemperatureChangeEvent(event.getPlayer(), temperatureSystem.getDefaultTemperature(seasonsManager.getCurrentSeason())));
        }
    }```
It sure looks a lot simpler
eternal oxide
#
Block from = event.getFrom().getBlock();
Block to = event.getTo().getBlock();
if (to == from) return;
...```
worthy yarrow
#

gotcha

#

Also I've seemed to mess up the player movement speed... while back when making the temperature rules / effect thresholds, I changed the players speed to 0.2, making me incredibly speedy, but not even on playerJoin will player.setWalkSpeed revert back to 1.0 so now I'm just super fast

young knoll
#

Well if 0.2 is speedy

#

1.0 is even more speedy

worthy yarrow
#

That's what I thought...

#

I remember looking something up that said 1.0 is the default player speed so

#

Idk what the hell I did

#

I removed all instances of setting the player speed to anything but 1.0

young knoll
#

Apparently 0.2 is the default

worthy yarrow
#

Alrighty then

sullen marlin
worthy yarrow
#

You make me laugh

eternal oxide
#

Exactly how Sonic looks

broken nacelle
eternal oxide
#

Coll so good at drawing 🙂

young knoll
#

Yep I drew that

worthy yarrow
#

Idk whether I should keep the event based temp updates or go back to a runnable that recalcs every so often... I just want the action bar display to be smooth and consistent...

eternal oxide
#

You shoudl fire your event the next tick, IF the move is not cancelled

young knoll
#

You can check if it’s cancelled

#

Use monitor and ignore cancelled

worthy yarrow
#

Well it's my own event, I'm just trying to describe scenarios when the temperature would change which is putting a toll on me, that's really where the contemplation of switching back comes from

eternal oxide
#

yep but your event shoudl not fire if the event is cancelled, and teh player will not be in the To location during the move event.

worthy yarrow
#

hmm

eternal oxide
#

actually you can ignore if its cancelled, as default your onMove will not be called if its cancelled

#

so just check at monitor for a biome change

#

then fire your event next tick

worthy yarrow
#

Mmm

eternal oxide
#

So do exactly as you are, just make your event priority MONITOR then runTask for your event.

worthy yarrow
#

So rather any time a player would move the event should fire

eternal oxide
#

runTask is so it actually fires your event the next tick

worthy yarrow
#

Right

#

Ok gotcha

#
@EventHandler(priority = EventPriority.MONITOR)
    public void onPlayerMove(PlayerMoveEvent event) {
        Block blockFrom = event.getFrom().getBlock();
        Block blockTo = event.getTo().getBlock();
        if (blockFrom == blockTo){
            return;
        }
        if (blockFrom.getBiome() != blockTo.getBiome()) {
            new BukkitRunnable() {
                @Override
                public void run() {
                    Bukkit.getPluginManager().callEvent(new PlayerTemperatureChangeEvent(event.getPlayer(), temperatureSystem.getDefaultTemperature(seasonsManager.getCurrentSeason())));
                }
            }.runTask(seasons);
        }
    }```
Like so?
#

Do I have to explicitly tell it to run a tick later?

eternal oxide
#

no

worthy yarrow
#

Cool

#

So then when I do runTaskLater with a delay of 1, that means it'll fire after 2 ticks?

eternal oxide
#

no

#

its the same as runTask

worthy yarrow
#

runTask by default runs a tick later? Given this, runTaskLater just lets you dictate how long the delay is

eternal oxide
#

yes

worthy yarrow
#

Gotcha thanks! Gotta keep the knowledge up man

eternal oxide
#

should you not adjust the walk speed based upon a Base + modifier

#

to allow for enchantments

young knoll
#

Yeah I would use an attribute modifier

worthy yarrow
#

Ok wrote that down.

#

What/anything else?

vague swallow
#

because I'm afrait of spiders and always get half a heart attack when they're jumping at me. That's why. I mean of course I could check if the spider is in the air but how do I prevent it then from jumping? Isn't it already too late then? And when and where should I check if the spider is in the air?

worthy yarrow
meager wolf
#

i am making a plugin that works on 1.16.# -> 1.20.#
the plugin is very simple and it will just make a gui and read data from a file and show it and do things.
is there any big changes that spigot had in-between those versions that i have to put in mind? like how forge changed their mapping and some packets stuff

eternal oxide
#

lots. Too many to mention

meager wolf
#

damn

eternal oxide
#

making a gui would not require nms though

#

just build against teh lowest version you are going to support

meager wolf
#

alright 👍

mortal hare
#

why didnt i knew this before

#

that pressing END button will move multiline cursors to the end of the lines

narrow ledge
#

k so im trying to fix the world horizon so that the sky doesnt turn black - id like to do this to already existing worlds if possible
from what i understand there has to be a world variable for this somewhere because superflat worlds dont have a horizon like this
what are my options here? because id also like to avoid nms like the plague but if it comes down to it, id rather use it than protocollib

drifting ice
#

?paste

undone axleBOT
faint totem
#

hello, i am trying to create a plugin that allows pacific mobs to be hostile, it works fine, but with some mobs like pigs, striders, sheep, it does not work, i think i have a reason but not a solution, the reason (if i am not wrong) is that those mobs do not have the attack damage attribute, which makes that when they try to hit me, they disappear and throws an error in the console.

young knoll
#

Correct

#

You need to inject an attack damage attribute into them

#

Or just disguise another mob

faint totem
young knoll
#

I believe there is a map in the object that stores it

#

You’ll have to modify it reflectively

faint totem
vague swallow
#

I got another question, is there a way to make a shield that is not blocking any damage or knockback? The players still need to block with them but just visually and not physically if you know what I mean

wintry elk
#

how do you get the person who killed the entity in this event?

eternal oxide
#

event not entity

#

sorry I'm wrong

wintry elk
#

event.getEntity().getKiller();

#

this is what popped up after using event

eternal oxide
#

getLastDamageCause() returns EntityDamageEvent not a player

#

in the event you have getDamageSource() which has getCausingEntity()

faint totem
late sonnet
broken nacelle
faint totem
#

Hi, is there a form to obtain when a piglin is angry?

lethal coral
#

how can I get all of the generated chunks in a world

#

(not necessarily loaded)

eternal oxide
#

you can't

lethal coral
#

why not

eternal oxide
#

bnecause there is no "list" other than in files

lethal coral
#

so I'm gonna have to use nms?

eternal oxide
#

requesting a chunk will generate it if it's not already done

#

why do you want all chunks?

lethal coral
#

because I'm deleting all unnecessary chunks

#

that have been loaded

eternal oxide
#

but you can't tell where chunks exist

lethal coral
#

so I would have to go in a radius?

eternal oxide
#

yep

#

then delete any that are generated outside that

#

for X distance

golden tulip
#
val component = TextComponent(getTextKey(player.uniqueId.toString(), "joinItem.profile") +" (")
val keyBind = KeybindComponent("key.use")
component.addExtra(keyBind)
component.addExtra(")")
player.sendMessage(component.toLegacyText())

What is wrong? The Keybind is not working. The Final Message is Profile (key.use)

carmine mica
#

because legacy text sucks

#

legacy text (chatcolor) is a lossy text format. It cannot represent everything that components can

blazing ocean
echo basalt
#

Minimessage go brr

young knoll
#

I’m waiting for Megamessage

proper cosmos
#

why when I cancel KnockBackevent, shield is not working (not blocking)

eternal oxide
charred blaze
#

can i somehow slowly rotate ItemDisplay?

eternal oxide
charred blaze
#

where is item's rotation center?

#

in the center of the item?

#

like for example skull

eternal oxide
#

for an item it shoudl be center

#

for Block it's bottom left

charred blaze
#

what is W in quaternion?

#

why do we even need it

eternal oxide
#

its the best way to represent rotations in a 3d space

#

There are a few examples if you search

#

Not many as its all new

charred blaze
#

why isnt xyz enough

#

i dont get it

eternal oxide
#

because that can;t represent a rotation

#

well it can kinda, but you can;t properly rotate using just that

#

which rotates first? Do they all go at the same time, same speed, or proportional?

charred blaze
#

what

#

i thought the rotating was instant or something

charred blaze
eternal oxide
#

it is if you don;t set a duration

charred blaze
eternal oxide
#

a Quaternion is not a single w

#

where are you getting this w from?

charred blaze
eternal oxide
#

W is the fourth dimension
XY is two dimension
XYZ is third dimension
XYZW is fourth dimension

#

Good luck understanding quaternions

#

they are far from easy

charred blaze
#

fourth dimension

#

Nice

eternal oxide
#

that "video" is interactive. You can play with the values

tardy delta
tardy delta
#

which one \👀

eternal oxide
blazing ocean
tardy delta
blazing ocean
#

yep that

#

clone caret

tardy delta
#

thought about using ctrl+j but that does smth wild lol

blazing ocean
#

wow lol

proper cosmos
#
damager.knockback(3.0, player.getLocation().getDirection().getX(), player.getLocation().getDirection().getZ());

I've got 2 players and tried knocking one of them, this knocks them in opposite direction

tardy delta
#

well its rider, not ij but same thing

#

not actually same thing

blazing ocean
#

i do have like 7 jetbrains ides

tardy delta
#

used to have 4

#

vs and nvim for anything else

#

well vs is only for the things that rider cant do

#

so many open reports about missing features like for asp.net support

proper cosmos
#

nice development discussion, about how much ides you have 😃

blazing ocean
#

i use the new clion nova for c stuff

tardy delta
#

thats what comes up in my monkey brain

eternal oxide
tardy delta
#

nova 🤔

tardy delta
#

honestly there are like too much jetbrains ides with overlapping features

#

anyone using fleet?

eternal oxide
#

player1Location.toVector().subtract(player2Location.toVector()).normalize

blazing ocean
tardy delta
#

anyone using zed?

blazing ocean
upper hazel
#

why i has error You do not have permission to view this page or perform this action when try view KitBattle Advanced plugin

blazing ocean
#

it looks promising

tardy delta
#

font changing doesnt even seem to work

charred blaze
tardy delta
#

console is full of eof errors

charred blaze
#

rn

tardy delta
#

console also full of lsp errors

charred blaze
#

I have understood some of the sentences

proper cosmos
eternal oxide
#

If you can play with them and understand whats going on you are set

#

x,y,z (Vector) and angle of rotation

charred blaze
#

how did i go to this from trying to rotate item on y axis only

#

xd

eternal oxide
#

Not complicated at all 😄

echo basalt
#

Meth

eternal oxide
#

1.0 on y to rotate around y

tardy delta
#

sounds like what a professional would say

proper cosmos
#

Why Damagable#damage() does not ignore Armor?

charred blaze
#

the item spawns already rotated

echo basalt
#

Wait a tick

eternal oxide
#

actually you want 1.0z to rotate around y

echo basalt
#

Before applying transformations

charred blaze
echo basalt
#

Don't ask

charred blaze
#

ok

eternal oxide
#

didi you also set teh duration?

charred blaze
#

wait with scheduler?

echo basalt
#

Ye

charred blaze
eternal oxide
#

-1 for delay?

#

You also didn;t set a rotation

#

only a vector

charred blaze
#

then why does it spawn rotated

eternal oxide
#

oh yeah I see it

proper cosmos
charred blaze
eternal oxide
#

0 for no delay, set it to 1

#

so it will translate in 1 tick

charred blaze
#

delay of what

vast ledge
eternal oxide
#

it needs to spawn first

vast ledge
charred blaze
vast ledge
#

your

eternal oxide
#

you shouldn;t have to no

#

just delay and duration

charred blaze
#

ok ill test

#

its still standing still

#

not moving

eternal oxide
#

no rotation at all?

charred blaze
#

i think its already rotated

#

when it spawns

eternal oxide
#

give it a longer duration

proper cosmos
charred blaze
charred blaze
eternal oxide
#

looks translated to me

charred blaze
eternal oxide
#

yes

charred blaze
#

well it doesnt move at all

#

1000 doesnt work

eternal oxide
#

when you set the Transformation did you do left and right?

#

left is before, right is after

charred blaze
#

uhh

#

i was trying to record skull spawning and now gnome recorder is stuck

upper hazel
#

wth

#

with spigot

eternal oxide
#

not logged in

tardy delta
#

paid resource ig

upper hazel
#

i logged

eternal oxide
#

I can see it fine. Its a paid resource

upper hazel
eternal oxide
#

I have 2fa enabled. No idea if thats why

upper hazel
#

SpigotMC - High Performance Minecraft - Error
The requested page could not be found.

#

oh wait

#

not thi

#

SpigotMC - High Performance Minecraft - Error
You do not have permission to view this page or perform this action.

#

this demm error

#

i logged

eternal oxide
#

It hates you

upper hazel
#

whyyyy

#

what to do

eternal oxide
#

clear cache?

upper hazel
#

not help

#

still error

proper cosmos
#

or smth

eternal oxide
#

You probably need a certain post count to be able to view premium

proper cosmos
proper cosmos
eternal oxide
#

I guess not then

#

It really does hate him

proper cosmos
#

there's no user with this name

#

prob didn't verify email or smth

trail coral
#

if youre not logged in

proper cosmos
#

You can see this guy is clearly logged in

proper cosmos
stoic parrot
#

Hello, how do I send messages to a players hotbar?

eternal oxide
#

player.spigot().sendMessage

eternal oxide
#

not sure get.set operates on the actual quaternion

#

possibly does

#

however you don;t set right

charred blaze
#

i think it isnt rotating at all. i think its rotating based on my location

charred blaze
eternal oxide
#

I believe so

charred blaze
#

to the same thing right?

eternal oxide
#

no

charred blaze
#

to zeroes?

eternal oxide
#

try setting to the negative angle

charred blaze
eternal oxide
#

try it and see

frail pilot
#
// Setup transformation
        final Vector translation = player.getEyeLocation().getDirection().clone().setY(0).normalize().multiply(3.0f);
        final Transformation transformation = displayItem.getTransformation();

        displayItem.setTransformation(transformation);
        final int interpolationDuration = 60;
        displayItem.setInterpolationDuration(interpolationDuration);

        // Setup this as you want, the default one seems to be large enough
        //displayItem.setViewRange(viewRange);

        // You can delay the animation
        // Note that you should set this value otherwise the interpolation does not work
        displayItem.setInterpolationDelay(0); 

        // Send the animation to the client
        Bukkit.getScheduler().runTaskLater(this, () -> {
            transformation.getTranslation().set(translation.getX(), translation.getY(), translation.getZ());
            displayItem.setTransformation(transformation);
        }, 2L); 
        // It has to be at least two ticks after the entity is spawned.
        // Two works fine for me on a local server but it might not work on other server.
        // If the transformation is directly applied, you need to increase the delay.
#

If tou want it to use the interpolation

#

You need to get the right transformation

mortal hare
#

to place them

upper hazel
tardy delta
mortal hare
#

you need to hold second CTRL press

#

(CTRL -> CTRL (HOLD)) + UP/DOWN ARROW

upper hazel
tardy delta
#

oeh that does it, thank you

mortal hare
#

pressing shift twice will open search anywhere menu

#

CTRL + SHIFT + R will let you search and replace within all project files

tardy delta
#

ye

mellow edge
#

how is the class ClientboundMoveEntityPacket.Rot called in spigot mappings?

charred blaze
eternal oxide
#

x,y,z should be a unit vector

#

you shoudl be 0,0,1

charred blaze
#

and why does it increase item size?

eternal oxide
#

I'd have to pull out my IDE and take a look

frail pilot
#

If it's not unit it will scale the display

charred blaze
#

how does that work

eternal oxide
#

Math

frail pilot
#

For example if you want to scale it x2, you can multiply by the matrix :
2 0 0 0
0 2 0 0
0 0 2 0
0 0 0 1

charred blaze
#

in easy terms when you put these values in the method it will increase size?

frail pilot
#

If you put this matrix in setTransformationMatrix

#

Yeah

#

Basicaly

#

Each transformation can be represented by a matrix

#

And let say you have a function f that represent your transformation

charred blaze
#

and why is it working in the Rotation thing?

frail pilot
#

You take the matrix that represent f

#

let say M

#

Doing M * x

#

Is the same as f(x)

#

With that in mind, you can represent a rotation with a matrix

charred blaze
#

what is M?

frail pilot
#

The Matrix of the function f

charred blaze
#

is M number or something?

frail pilot
#

A matrix

charred blaze
#

how do you multiple matrix

#

by x

frail pilot
#

X is a vector

#

Wich can be seen as a matrix 4x1

charred blaze
#

so you multiply new vector by matrix and it rotates?

frail pilot
#

(And not 3x1, because otherwise you can't handle translations)

#

Yeah x)

#

Math magic

charred blaze
#

can you give me an example

#

of

#

that multiplication

frail pilot
#

Behind the Transformation class there is just one matrix

#

But for what you are doing, you don't need it

#

As the multiplication is made client side

#

You just give it the matrix you want

charred blaze
#

so how do i rotate it

frail pilot
#

(I'm looking)

rotund glacier
#

Is there a quick and easy way to get the related open/close sound for an Openable (e.g. gates)

mellow edge
frail pilot
#

So

#

Following what we talked about earlier

#

You need to get the right matrix

charred blaze
#

so what does left matrix stands for

frail pilot
#

And

#

Don't know, we will see later x)

#

Hmm

#

To have 2 different rotation, i guess

#

You should have a Constructor for quaternions that takes 4 parameters

#

One is for the angle

#

The three other the coords of the unit vector

#

So new Quaternion4f(0.4, 1, 0, 0)

#

Should do a rotation around the x axys by an angle of 0.4

charred blaze
#

so like this?

frail pilot
#

Yep

#

Try that

#

But that will be applied instantly

#

If you want to see it rotate you need to delay the entity.setTransformation call by two ticks with the bukkit scheduler

meager sage
#
private final ArrayList<Item> droppedItems = new ArrayList<>();

@EventHandler
public void onCraftItem(CraftItemEvent e) {
  ...

  droppedItems.add(droppedItem);
  System.out.println(droppedItems); // returns item in list
  new BukkitRunnable() {
      @Override
      public void run() {
          droppedItems.remove(droppedItem);
      }
  }.runTaskTimer(this, 0, 20L * getConfig().getInt("durationInSeconds"));
  System.out.println(droppedItems);
}

@EventHandler()
private void onInventoryPickupItem(InventoryPickupItemEvent e) {
    System.out.println(droppedItems); // returns []
}

Am I doing something wrong or am I just not thinking right?

meager sage
# frail pilot What are you trying to do ?

Basically create an ArrayList, store an Item in the array list in the CraftItemEvent, then in the InventoryPickupItemEvent, check if the inventory holder is a hopper and the item going into the hopper is in the arraylist.

frail pilot
#

Then I assume you want to create some sort of "item blacklist" for hoppers for a specific duration

#

?

#

If so, you need to use .runTaskLater instead of .runTaskTimer

wraith dragon
#

Does anyone know of a performant block pdc API that I can use? We're talkin checking if blocks inside a 500x500 block area have a certain key or not with minimal amounts of lag. I have tried using the CustomBlockData resource by mfnalex, but it just keeps crashing the server. Thanks

frail pilot
#

Just split the 500x500 check on multiple ticks ?

#

If your are checking block by block, you won't find any lib that does it quick enough for a 500x500 area in one tick

meager sage
#

Thank you

frail pilot
#

np :D

vague swallow
#

Guys, is there a way to make a shield that is not blocking any damage or knockback? The players still need to block with them but just visually and not physically if you know what I mean

frail pilot
vague swallow
#

That's a good idea, thanks

#

Is there an event that gets triggered when a player is blocking damage?

frail pilot
#

Probably

charred blaze
#

thanks

frail pilot
#

yw :D

charred blaze
#

it is rotating weirdly

#

how do i make it rotate only on y axis?

frail pilot
#

Is it a block display or an item display ?

charred blaze
#

item

frail pilot
#

And Quaternion4f(angle, 0, 1, 0)

#

Okay so the code above should do the work

#

I guess

charred blaze
#

so the 1 above is Y?

frail pilot
#

I guess

vague swallow
#

I swear Block and Item Displays were the best thing they could add

frail pilot
#

Should be (angle, x, y, z)

eternal oxide
#

is MC a bitch and sets angle as first?

charred blaze
eternal oxide
#

teh Quaternionf shows w as last

charred blaze
#

it says that one is z

frail pilot
#

x)

#

Okay try 0, 1, 0, 0.4 x)

#

Should be better

charred blaze
#

ok

#

angle should be between 0-1 right?

frail pilot
#

Hmmm

#

Between 0-360 or 0-2pi

#

Maybe shifted by 50%

#

Just try some values, you will quickly see

charred blaze
#

wtf

#

its getting bigger in the duration

eternal oxide
#

thats the left quaternion

charred blaze
eternal oxide
#

sec I'll test here

frail pilot
#
final Quaternion4f rotation = new Quaternion4f(x, y, z, angle);
transformation.getLeftRotation().set(rotation);
transformation.getRightRotation().set(rotation.inverse());
eternal oxide
#

yeah I'm seeing wierd scaling dependant on teh angle

#

ah yeah

frail pilot
#

Did not test it

eternal oxide
#

testing now

#

well different code but same

frail pilot
#

x)

#

Try messing with parameters

#

Maybe it's angle, x, y, z

#

Instead of x, y, z, angle

#

As it is in the general definition of a quaternion

sand spire
#

Is this a good way to remove something from a collection while iterating over the collection? Or is it bad to create a copy of the collection every tick?

new BukkitRunnable() {
            @Override
            public void run() {
                for (Player player : new HashSet<>(set)) {
                    //remove player while iterating
                }
            }
        }.runTaskTimer(plugin, 0, 1);```
eternal oxide
#

would be odd to transpose though

frail pilot
#

Idk

#

But in the def of a quaternion it's x + i * y + j * z + k * w

eternal oxide
#

second arg makes it rotate around y

frail pilot
#

(0, 1, 0, angle) you mean ?

eternal oxide
#

yep

#

but it still scales

frail pilot
#

The hell x)

eternal oxide
#

however scaling is really odd. it depends on both left and right

frail pilot
#

Well, Zelda will wait I definitly need to see that

eternal oxide
#

rotates around y but also scales up

young knoll
#

I would just use the various methods to handle it

eternal oxide
#

? thats what we are trying to do

young knoll
#

Such as #rotateY(radians)

eternal oxide
#

tryign to understand these quarternions

#

oh nah

#

transformations on a Display

young knoll
#

Yes?

eternal oxide
#

rotateY on what?

young knoll
#

The quaternion

eternal oxide
#

Yeah you have me lost

#

we can;t even find base values that work properly

young knoll
#

The base value is 0 0 0 1 for both left and right rotation

eternal oxide
#

what is left quat for?

young knoll
#

Left is applied before scale

#

Right is applied after

eternal oxide
#

it scales up as it rotates

#

Should this not keep it the same size?```java
new Transformation(
new Vector3f(), // base translation
new Quaternionf(0,0,0,1.0f), // left rotation
new Vector3f(1,1,1), // scale
new Quaternionf(0,0,0,1.0f).rotateY((float) Math.toRadians(180)))) // right rotation

#

this code scales it up as it rotates

#

yeah it works if I do it right

#

I had the right quat wrong

young knoll
#

:p

charred blaze
#

i only have quaternionf

#

should i use it instead?

eternal oxide
#

yes

charred blaze
#

ok

eternal oxide
#

are you tryign to have the item spin constantly?

charred blaze
#

well this one has no .inverse

charred blaze
#

no inverse

vague swallow
#

When I set the brightness of BlockDisplay above 15 what happens then?

eternal oxide
#

I currently have it rotating 180

vague swallow
young knoll
#

You can't set it above 15 iirc

charred blaze
#

why dont i have that class

eternal oxide
#

why? you don;t need any of that

vague swallow
wintry oxide
#

hu guys i was wondering if there is a method to prevent normal injection

#

like i do add a to player permission with a string that the user puts in

#

but like if the user puts soomething like /command tes" + <some code to exploit>

#

is something that minecraft already does or i do have to prevent it manually

charred blaze
vague swallow
#

Does the Bukkit.getEntity(UUID) throw a NullPointerException when it doesn't find a uuid or does it just return null?

charred blaze
#

mb its invert

trail coral
#

how do i save persistent data with blocks?

sullen marlin
vague swallow
#

Thanks!

trail coral
eternal oxide
#

depends on the block type

trail coral
#

normal blocks

#

like a sponge block for example

eternal oxide
#

then no pdc

trail coral
#

what about metadata

#

is it persistent

eternal oxide
#

which meta?

trail coral
#

block.getMetaData();

eternal oxide
#

yes

trail coral
#

soo that will work fine

eternal oxide
#

doubtful

#

oh um no MetaData is not persistent. Meta is

trail coral
#

how do i even get Meta of a block

eternal oxide
#

yeah ignore me I'm not really focusing.

#

No there is no persistent storage on normal blocks

#

there are libraries to allow it

#

?morepdc

undone axleBOT
eternal oxide
#

?blockpdc

undone axleBOT
eternal oxide
#

that one ^

charred blaze
trail coral
#

oh shit

eternal oxide
#

would probably have to rotate it in quarters

charred blaze
eternal oxide
#

no

charred blaze
#

whats wrong then

frail pilot
#

Ok

eternal oxide
#

one sec and I'll give you code

frail pilot
#

transformation.getLeftRotation().set(new Quaternionf(new AxisAngle4f(2.0f, new Vector3f(0f, 1f, 0f))));

#

Seems way easier to use the code joml give us

eternal oxide
#

ok I got it rotating constantly

charred blaze
charred blaze
frail pilot
#

Math stuff

#

Which makes way more sense considering that with the first approach we never used trigonometry

eternal oxide
#

one last test and code is done

charred blaze
#

are you spoonfeeding me or making it for yourself?

eternal oxide
#
        ItemDisplay entity = player.getWorld().spawn(player.getLocation().add(player.getEyeLocation().getDirection().multiply(3)), ItemDisplay.class);
        
        final int speed = 100;
        Quaternionf quat = new Quaternionf(0,0,0,1.0f);
        entity.setItemStack(new ItemStack(Material.ACACIA_BOAT));
        
        Bukkit.getScheduler().runTaskTimer(plugin, () -> {
                entity.setInterpolationDelay(0);
                entity.setInterpolationDuration(speed);
                entity.setTransformation(new Transformation(
                        new Vector3f(),                                    // base translation
                        quat,                                            // left rotation
                        new Vector3f(1,1,1),                            // scale
                        quat.rotateY((float) Math.toRadians(181))));    // right rotation
                },2, speed);```
#

thats a constantly rotating ItemDisplay

sullen canyon
charred blaze
#

player.getLocation().add(player.getEyeLocation().getDirection().multiply(3))

#

why

trail coral
#

how do i use smallfont?

eternal oxide
#

its sample code. I did it in a onCommand

#

to spawn it in front of me for testing

charred blaze
#

aham

charred blaze
frail pilot
#

Nop

#

Before

#

hmmm

trail coral
#

How do i use the font on the right? and also how do i send unicode characters?

frail pilot
#

Might need indeed

eternal oxide
#

I didn;t test it outside. I assumed the duration would count down

#

I put it inside but never tried it out

frail pilot
#

It might reset after one iteration

eternal oxide
#

^

charred blaze
#

181

#

why 181

blazing ocean
eternal oxide
# charred blaze why 181

because you have to go 1 radian past 180 degrees else it will reverse course for the next iteration

charred blaze
#

why 1 radian

frail pilot
#

1 degree

charred blaze
#

aham

#

this is size of an item right?

frail pilot
#

Yeah

charred blaze
#

why does it need 3 values

frail pilot
#

Scale for x, y and z

charred blaze
#

oh i can stretch it or something?

frail pilot
#

Yeah

charred blaze
#

what

#

like increase item's lenght ?

frail pilot
#

Yeah

charred blaze
#

ohh now i get why it was breaking

frail pilot
#

x)

charred blaze
#

ok thanks guys

#

ill play around with this code

#

especially this part

frail pilot
#

If you want to use a custom axis instead of rotating around Y axis

new Quaternionf(new AxisAngle4f(angle, new Vector3f(x, y, z).normalize()))
keen horizon
#

how do i disable an item from being stored in a chest does anyone have a plugin that does this i can look at

#

im new to this

drowsy helm
#

then also hoppers, drop event etc

frail pilot
#

Yeah but maybe in the future

keen horizon
drowsy helm
charred blaze
#

Quaternionf quat = new Quaternionf(0,0,0,1.0f); is this angle x y z?

#

or x y z angle?

frail pilot
#

None of those

hybrid quartz
#

How to give player infinity potion effect?

proper cosmos
#

Is there something like syncing player's inventory?

blazing ocean
kind hatch
#

PotionEffect.INFINITE_DURATION

blazing ocean
#

that's only for newer versions iirc

kind hatch
#

So? Latest is what we always recommend.

blazing ocean
#

right

#

people don't always use latest

kind hatch
#

Tbh, that's their problem.

blazing ocean
#

true ig

hybrid quartz
shrewd tapir
#

Does anyone have information/documentation about itemstack serializing and deserializing?

vagrant stratus
#

Any idea on if it's possible to do the following ((CraftCreature)this.entity).getHandle().getNavigation().a(location.getX(), location.getY() + 1.0, location.getZ(), (double)speed); on modern versions w/ the spigot api directly? It's a moveTo w/ location & speed as the arguments

hybrid quartz
hybrid quartz
vagrant stratus
late sonnet
vagrant stratus
# late sonnet Navegation API?

The above code uses NMS just to naturally move entities. I'd rather not use NMS or a library to use this functionality if possible

#

Unless you're talking about something within spigot already 🤷‍♂️

young knoll
#

Yeah I don't think we have that

#

iirc the problem is the mob will override it if they have pathfinder goals

nova quail
#

Why player don't remove from ArrayList here? After debug I found out that player add's but he don't remove on end

                @Override
                public void run() {
                    checkPlayers.add(p.getUniqueId());
                    p.addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS, Integer.MAX_VALUE, 1));
                    long remainingTime = durationMillis - (System.currentTimeMillis() - startTime);
                    if (remainingTime <= 0) {
                        checkPlayers.remove(p.getUniqueId());
                        p.removePotionEffect(PotionEffectType.BLINDNESS);
                        p.sendMessage("Бан");
                        cancel();
                    } else {
                        String formattedTime = TimeUtil.duration(remainingTime, true);
                        p.sendTitle("Вы были вызваны на проверку", "Напиши ваш дискор в течении " + formattedTime, 1, 18, 1);
                    }
                }
            }.runTaskTimer(Plugin.instance, 0, 20L);
quaint mantle
#

It doesn’t really replace the path need to run custom nav each tick

lost matrix
nova quail
#

all completes except removing player

lost matrix
nova quail
frail pilot
#

As you are adding it every tick

#

You might have multiple time the same player in your list

nova quail
lost matrix
#

Oh you are adding it inside the run method. Yeah thats a problem.

quaint mantle
#

Use HashSet at this point

nova quail
#

yeah thanks

#

i thought the player adds only one time in list

lost matrix
#

Move it outside the run() implementation and also dont use a List.

nova quail
lost matrix
#

Set. It doesnt allow duplicate entries and is generally faster with remove() and contains() operations.

vagrant stratus
#

like idk, ignoring the pathfinding goals or something like that

pseudo hazel
#

I have 2 projects in a single folder that is a git repo. I wanted to merge my changes into main, so I went to main and merged the changes, everything on git looks fine, but now one of the projects does not get opened correctly and I cant see any files besides the pom.xml

#

has anyone ever run into a similar issue?

#

1 project is a plugin and the broken one is just a java project that I depend on in the plugin with maven

#

it has worked before when I was on the development branch

quaint mantle
echo basalt
pseudo hazel
#

yeah I mean I think the fundamental issue is that I split it into 2 projects

tardy delta
#

definitely gonna loose a lot of things

pseudo hazel
#

but I thought that wouldnt be such a problem since I already had the first one in a separate folder

#

so essentially all I did was create a second folder in the main repo root and then moved files over there

#

and then added a dep in my plugin project, which works

#

but now the second project just doesnt wanna open

quaint mantle
pseudo hazel
#

well yeah, but right now its a mevn dependency so there is no issue with the actual plugin

#

the project that got borked is not a plugin

#

but just a java maven project

quaint mantle
#

Try remove .idea or any ide folder

pseudo hazel
#

I think its something in intellij that refuses to see it as a proper project

#

omg that worked

#

I feel stupid now

#

thanks

wet breach
#

should make it a maven module

#

then you don't need two git repos

#

just one

#

and both can coexist together without issues

kindred sentinel
#

Does anyone know how to add 3d armor to the plugin? Like backpack and all that stuff

#

Only spawn armor stand in the player and put on it's head item with 3d model?

tall saffron
#

Hi, I am making a plugin and I use a resourcepack for custom items, is there a way to force the resource pack or make it the server resource pack? Or how can I publish it and make the user put the resourcepack for the customn items??

valid burrow
#

what

#

i guess you want a server resourcepack

#

and yes that can be forced

#

to some extent

broken nacelle
tall saffron
young knoll
#

yes

tall saffron
#

How?

kindred sentinel
dire marsh
#

add a captcha that the user has to enter that is only visible if you're using the resource pack 🧠

kindred sentinel
kindred sentinel
#

Oh

#

It makes sense

dire marsh
#

the downside to the force boolean is the client disconnects itself with an unfriendly message

blazing ocean
#

🤷

kindred sentinel
#

:0

blazing ocean
#

was about to tell you to change the lang file

#

then i realised...

tall saffron
#

Thanks allot!

kindred sentinel
#

For me the best way to use server properties to add resource pack to player, and kick with message on rp status event

kindred sentinel
#

Both ways are good

blazing ocean
#

the thing with the method is that you can always calculate the pack hash

#

so i don't change anything when i update the pack

tall saffron
#

i think i am going to make a enter event and ask for the resourcepack and just use the bool variable u guys where saying to kick them if not accepted

kindred sentinel
blazing ocean
#

yep

kindred sentinel
#

So.. Do you know any good ways to create custom mobs besides mythic mobs?

blazing ocean
#

wdym

kindred sentinel
#

There is a plugin Mythic Mobs to add custom mobs

blazing ocean
#

ig you could remodel existing mobs

kindred sentinel
#

I heard about model engine too

tall saffron
#

What do I put in hash??

blazing ocean
#

so you download it and hash it

blazing ocean
tall saffron
kindred sentinel
#

They are working on armor stands

blazing ocean
#

ah so it just spams armour stands

kindred sentinel
#

Something like that

blazing ocean
#

wouldn't display entities work too

kindred sentinel
#

Display entity?

blazing ocean
#

block displays, item displays

tall saffron
#
@EventHandler
    public void playerEntered(PlayerJoinEvent event){
        Player player = event.getPlayer();

        String texturePack = "https:url.com";

        player.setResourcePack(texturePack, texturePack.getBytes(StandardCharsets.UTF_8), "You will need this resource pack for Legendary Swords, please download and use it!", true);
    }```
#

will this work?

blazing ocean
#

no

tall saffron
#

Is it a level of complex i will probably not understand?

blazing ocean
#

you need to use a valid url string, actually download the pack and hash it

#

look it up

#

"java sha1 file"

kindred sentinel
blazing ocean
#

rip

tall saffron
#

so i download my own texture pack and how can i "hash" it

lost matrix
#

Model engine uses ItemDisplayEntities now btw

kindred sentinel
#

Oh, yeah? Its cool

blazing ocean
kindred sentinel
kindred sentinel
kindred sentinel
#

Like 90 degrees for each side

tall saffron
eternal oxide
#

look at my post earlier today on rotating ItemDisplays

blazing ocean
#

also do it on load

#

downloading a file on join is bad

tall saffron
#

it seems if i just do ```java
@EventHandler
public void playerEntered(PlayerJoinEvent event){
Player player = event.getPlayer();

    String texturePack = "https:url.com";

    player.setResourcePack(texturePack);
}``` it will work it will just not force it
kindred sentinel
tall saffron
kindred sentinel
eternal oxide
tall saffron
#

whats the event for player load_

#

?

kindred sentinel
lost matrix
blazing ocean
eternal oxide
blazing ocean
eternal oxide
#

thats a constantly rotating display

tall saffron
#

Yeah but how are the players going to download it if they didnt enter?

eternal oxide
#

but very easy to understand

blazing ocean
#

on join

blazing ocean
#

you just hash the pack on server load

lost matrix
#

a subset of complex numbers with 3 instead of 1 imaginary component

tall saffron
#

Ohhh I understand it yeah thanks

blazing ocean
lost matrix
#

Mainly used to define rotations in 3D space. Might look like this:
[1.0, 2.3, 0.0, 0.3]

kindred sentinel
#

Post with all explanation

kindred sentinel
lost matrix
#

I dont think you can work with quaternions without understanding the math behind it. I personally
prefer applying the transformations on the transformation matrices directly, because thats what i learned in my
visual computation course.

blazing ocean
#

imo the easiest way is to sketch it out in a singleplayer world using axiom's display entity editor

kindred sentinel
pseudo hazel
#

I just have my repo folder with .git stuff and that has 2 folders, each containing a project and one being the plugin

#

I guess that is what you mean by maven module

wet breach
#

well maven module just combines the two projects into a single project

#

but when its comes to modules in maven, you can open them as separate projects

pseudo hazel
#

oh right

#

so I can package or install both of them in the same project?

#

in intellij I mean

golden tulip
blazing ocean
#

?jd-s always check here first 🙂

undone axleBOT
chrome beacon
#

Not in the Spigot API

#

Paper has API for it

blazing ocean
#

paper, yes

#

in paper everything is components
we don't provide support for paper here tho :p

golden tulip
#

How can I use Keybind in Item Display Name in Spigot?

chrome beacon
#

with nms

#

yes

golden tulip
#

So not even with JSON text?

echo basalt
#

You can make NMS components from json text

#

Or just use paper and enjoy Minimessage

blazing ocean
#

adventure

echo basalt
#

yeah

blazing ocean
#

fuck it we're renaming adventure

echo basalt
#

You can either shade adventure or use paper which bundles it

pseudo hazel
#

you can use unsafe.modifyStack without nms or adventure

#

to put json text on items

dawn flower
#

what's the difference between setOwningPlayer and setOwner in SkullMeta?

#

which one changes the skin

eternal oxide
#

both

dawn flower
#

ah

wet breach
#

and both spigot and spigot api are modules

#

spigot relies on spigot api

#

you don't have to build both per-say, but you do have to build spigot api at least once for spigot to compile

pseudo hazel
#

ah that would be exactly what I wanna do

#

thanks for the tip, ill take a look at how spigot does this

#

if I have questions ill be back >:)

tall saffron
#

@blazing ocean

#

Do i put my texturepack download link?

blazing ocean
#

no

#

you're just hashing the url then

#

you need to download the zip file, save it to disk, hash it and then delete it again

tall saffron
#

So what software do i use to hash the texture pack?

blazing ocean
#

i have sent you a stackoverflow link

tall saffron
#

Oh yeah i thought i could hash it mannualy and just put the value

blazing ocean
#

you would have to do that for every change you make to the pack

#

which is not fun

tall saffron
#

True

blazing ocean
#

and that is for strings; a binary blob is not a string

tall saffron
#

As i have no idea how to hash and i not seem to understand the forum

blazing ocean
#

copy & paste my beloved

tall saffron
#

it would be easier to check if accepted using PlayerResourcePackStatusEven and then kick?

blazing ocean
#

what

#

no

#

then you're not even sending any resource pack

tall saffron
blazing ocean
#

you don't need to

#

cryptography is a complex topic

tall saffron
blazing ocean
#

show your code

tall saffron
#
 @EventHandler
    public void playerEntered(PlayerJoinEvent event){
        Player player = event.getPlayer();

        String texturePack = "https://download941.mediafire.com/f2so2j65ptsgsYFEIdTO107vpJwCRiuK5v9yXmX9FdEWh496dz6OdX2RC8whhpCsJfX_f4jeXJ736-Sfw1E2eE4rImmsHBBuj913wJmZYUkSB4wuXg2m2MnKdYtMloQFJl5YSIoIMawphQ7om8qZfrEE4li-E4VNXmYxhyQU2xomEp8/jg7hsjc86ed3p6u/Legendary+Swords.zip";

        player.setResourcePack(texturePack);
    }```
#

right now is this

blazing ocean
#

what isn't working about this

#

it looks fine

tall saffron
blazing ocean
#

but you still need the hash

tall saffron
blazing ocean
#

the method without the hash is deprecated afaik

tall saffron
#

Okay so let me try the has

#

hash

#

so u told me i have to hash it on load

blazing ocean
#

yes

#

and download the pack

tall saffron
#

Yes

#

so i put this code public byte[] createSha1(File file) throws Exception { MessageDigest digest = MessageDigest.getInstance("SHA-1"); InputStream fis = new FileInputStream(file); int n = 0; byte[] buffer = new byte[8192]; while (n != -1) { n = fis.read(buffer); if (n > 0) { digest.update(buffer, 0, n); } } return digest.digest(); }

dire marsh
#

mediafire does not work for resourcepacks

tall saffron
#

?

blazing ocean
tall saffron
#

To long of a link maybe?

blazing ocean
#

no

dire marsh
#

visit the link yourself

tall saffron
#

what website could i use

dire marsh
#

it's not a direct url

blazing ocean
#

mcpack.host

#

i believe that's it

tall saffron