#help-development

1 messages · Page 1148 of 1

harsh ruin
#
public void spawnBorder(Particle particle, int minX, int minZ, int minY, Chunk chunk, Particle.DustOptions Colro) {
        for(int x = minX; x < minX+17; x++) {
            for (int y = minY; y < minY + 1; y++) {
                for (int z = minZ; z < minZ + 17; z++) {
                    chunk.getWorld().spawnParticle(particle, minX, y, z, 10, Colro);
                    chunk.getWorld().spawnParticle(particle, x, y, minZ, 10, Colro);
                    chunk.getWorld().spawnParticle(particle, minX + 16, y, z, 10, Colro);
                    chunk.getWorld().spawnParticle(particle, x, y, minZ + 17, 10, Colro);
                }
            }
        }
    }
```I have this code here, which places particles around the placed block of a chunk, basically outlining a chunk. However, how would I be able to make it go up several blocks? (the particles) I have not yet found a way to make that happen. Only breaking my code trying to
young knoll
#

Do they not already go up several blocks

harsh ruin
#

they only go around the placed block

restive mango
#
 public void invoke(Player p) {

        BlockState state = p.getLocation().getBlock().getState();
        state.setType(Material.AIR);
        state.update(true, false);
        return;

This command, when used on some floating redstone, causes the redstone to drop, despite update's second boolean being set to false. Why?

unique shuttle
#

Does anyone know why this event is called for all monsters and even for an experience orb, but not for the warden? Thanks!

restive mango
young knoll
# harsh ruin

for (int y = minY; y < minY + 1; y++) { have you tried increasing the +1 in this line

harsh ruin
#

no

#

Didn't think of that 🤦‍♂️

glass adder
harsh ruin
#

I would assume it's because of the speed they get spawned? However, what function from the bukkitRunnable would be the best to use here?

restive mango
#

i feel like im going out of my mind

restive mango
young knoll
#

What if you just do Block#setType(air, false)

worldly ingot
#

You're spawning way too many particles, that's why it's not rendering a portion of it

echo basalt
#

run that outside localhost and see how hard your network gets DOS'd

worldly ingot
#

You're spawning at minX, minZ, maxX, and maxZ, sure, but you're still looping over every block in the chunk, you're just spawning the particles on the edge

#

So you have like 16 particles in one block (that's why they look so thick)

young knoll
#

Hey particles can be thick if they want

#

thicc

worldly ingot
#

The client will only render so many particles, so that's why it's culling them :p

echo basalt
#

worst I've seen was like 200mbps worth of particles per client :p

#

was working in class and ran out of data within a couple minutes

blazing ocean
young knoll
#

no

#

Don't redstone particles have a size anyway

#

Idk what it actually does tho

worldly ingot
#
World world = chunk.getWorld();
int maxX = minX + 16, maxY = minY + 16, maxZ = minZ + 16;

for (int x = minX; x <= maxX; x++) {
    for (int y = minY; y <= maxY; y++) {
        for (int z = minZ; z <= maxZ; z++) {
            if ((x != minX || x != maxX) && (z != minZ || z != maxZ)) {
                continue;
            }

            world.spawnParticle(particle, x, y, z, 10, Colro);
        }
    }
}
restive mango
worldly ingot
#

Your loop should look like that, then it should generate a horizontal wireframe for you. I think

#

If I did my math right, anyways

young knoll
#

Smh so inefficient

#

Drop the x and z loops and just have a few spawnParticle calls

worldly ingot
#

I mean you could probably optimize that loop for sure to have less iterations, but in its simplest form, that would work

eternal night
#

use IntStreams instead

young knoll
#

But that’s like

#

Modern java

#

And therefor automatically bad

alpine urchin
#

Colro?

#

nice

sly topaz
#

you just loop all the values between min and max separatedly instead of in a nested loop, and do the spawning of the particles for all the sides

worldly ingot
#

You're right though

stuck oar
#

is there a way i can like fire an event or something from a different class to run some code without static abuse

                if (checkVersion(args)) {
                    //runs code from diff java file
                }
            }```
harsh ruin
undone axleBOT
worldly ingot
#

relula ^

harsh ruin
#

I have not read those, one second

sly topaz
#
for (int y = minY; y <= maxY; y++) {
    world.spawnParticle(particle, minX, y, minZ, 1, color);  // Edge 1
    world.spawnParticle(particle, minX, y, maxZ, 1, color);  // Edge 2
    world.spawnParticle(particle, maxX, y, minZ, 1, color);  // Edge 3
    world.spawnParticle(particle, maxX, y, maxZ, 1, color);  // Edge 4
}

for (int x = minX; x <= maxX; x++) {
    world.spawnParticle(particle, x, minY, minZ, 1, color);
    world.spawnParticle(particle, x, minY, maxZ, 1, color);
    world.spawnParticle(particle, x, maxY, minZ, 1, color);
    world.spawnParticle(particle, x, maxY, maxZ, 1, color);
}

for (int z = minZ; z <= maxZ; z++) {
    world.spawnParticle(particle, minX, minY, z, 1, color);
    world.spawnParticle(particle, maxX, minY, z, 1, color);
    world.spawnParticle(particle, minX, maxY, z, 1, color);
    world.spawnParticle(particle, maxX, maxY, z, 1, color);
}

it is quite the lengthy code to write, I'll give you that lol

young knoll
#

You’re spawning more particles than the client can render at once (16k)

harsh ruin
#

Would explain a lot, let me change that

young knoll
#

Which is rare

echo basalt
pseudo hazel
#

how do I get the progress of an advancement? like the advancement seedy place has multiple criteria, but only 1 has to be met, but stuff like hot tourist destination also have multiple but only one is required

sly topaz
#

that would look horrible in Java

young knoll
#

You could just do IntStream.of(minX, minX + 16).forEach

#

Same with Z

sly topaz
#

rangeClosed, but yeah

#

I'm more used to look at the classic for each, would be nice if I wanted to make the particles spawn in parallel tho

young knoll
#

You don’t want a range

sly topaz
#

I could compose the streams and do #parallel on it, then chaos

young knoll
#

You want only the 2 x and z values

#

Technically you could also do

for (int x : new int[] {minX, minX +16})
pseudo hazel
pseudo hazel
#

thats not enough information

#

like I wanna make something where I can show the progress of an advancement

kind hatch
#

AdvancementProgress#getRemainingCriteria()?

pseudo hazel
#

so I need to know how many required steps an advancement has

#

that always shows regardless of if the advancement is actually completed, so if I combine it with checking if the advancement is complete, I have a nice way to know after the fact..

young knoll
#

Hmm yeah it only has an isDone

pseudo hazel
#

thats kinda dumb because the advancement specs have a requirement which I think actually contain the info about how many things need to get done

#

but the api can only retrieve the name of all criterias of an advancement and whether they have already been completed

#

which is kinda limited

young knoll
#

?mappings

undone axleBOT
pseudo hazel
#

yeah it seems like there exists an AdvancementRequirements, which is a list of list of strings which have info about how they should be completed

#

but idk how to get that without nms

young knoll
#

If you go in with some NMS and get the AdvancementProgress from CraftAdvancementProgress

#

You can get more from that

stuck oar
#
java.lang.NullPointerException: Cannot invoke "me.czr.crazyEnvoys.CrazyEnvoys.getConfig()" because the return value of "me.czr.crazyEnvoys.CrazyEnvoys.getPlugin()" is null```

why am i getting this error
kind hatch
#

Exactly what the error says. #getPlugin() is returning null.

pseudo hazel
#

hmm okay I will need to dive into nms

#

thanks for helping me look

stuck oar
#

no i get that but idk why

kind hatch
#

?paste your code

undone axleBOT
stuck oar
pseudo hazel
#

ideally the Advancement class should jsut have this list<list<strings exposed

young knoll
#

Shadow is volunteering

kind hatch
#

runs

pseudo hazel
#

or the advancementRequirements class if you wanna spend too much effort

kind hatch
#

Idk, I could attempt it, but I haven't really messed with advancements all that much.

tall furnace
#

I've just realized that as of 1.21, the Luck enchantment seems to be missing from the Spigot API. What's up with that?

young knoll
#

Luck isn’t an enchantment

tall furnace
#

Used to be

#

I used it in 1.20 to give a glint

young knoll
#

Presumably one of our old crappy names

#

I imagine it’s luck of the sea

tall furnace
#

Also I think now there is a Luck arrow that can be given from a villager? It's always been a thing, the icon for it was a 4-leafed clover

#

Luck of the sea was separate

young knoll
#

That’s a potion effect

#

Not an enchantment

kind hatch
tall furnace
#

Oh right that was. Well I always had luck for items when I wanted an enchantment that had no effect.

stuck oar
#

?paste

undone axleBOT
tall furnace
#

And it was separate. Idk where they went

young knoll
#

Like I said it’s probably luck of the sea

restive mango
#

@young knoll for clarification, even with '//perf neighbors off', a worldedit brush still causes adjacent redstone to pop

young knoll
#

We renamed them to not have terrible names

echo basalt
#
int[] iterations = {-1, 0, 1};
for(int x : iterations) {
  for(int y : iterations) {
    ...
  }
}
tall furnace
#

I've not done any spigot work since 1.19 so I'm playing catch-up now.

kind hatch
umbral flint
#

If I have to expose internal methods, is that usually bad design

pseudo hazel
#

its a bit janky but good enough

kind hatch
pseudo hazel
# kind hatch For reference, what does this print out?

in the case of advancements with multiple actual requirements (like hot tourist destination, it prints all of them in a separate list: i.e. [[criteria_1], [criteria_2]] and for advancements with just one required one, like seedy_place, it puts them all in the same sublist, i.e. [[criteria_1, criteria_2]]

#

which according to the wiki means that I can just count the amount of sublists to determine the actual amount of criteria that need to be completed

#

under requirements

#

and that seems to be correct from the output I got

kind hatch
#

Does that mean AdvancementProgress#getRemainingCriteria().size() was just what you needed?
Or is there a little more to this?

pseudo hazel
#

no

#

this does not take into account the difference between advancements that have multiple crits but only 1 required vs multiple crits but all are required for the advancement

#

since the criteria.size just lists all possible criteria

#

the requirements are actually needed to know what is actually the minimum of things to complete

#

without it I have no way (apart from hardcoding it) which advancement fall under which category

#

i.e. seedy_place needs only criteria, but for for like monsters_hunted you need them all to get the advancement

#

but both specify multiple possible criteria

#

if that makes sense

kind hatch
#

Is there an easy way to view example data of those advancements?

#

I want to see the structure of it and sometimes the wiki examples don't do it justice for me.

pseudo hazel
#

and ofc craftbukkit just returns the requirements and criteria listed in the json

kind hatch
#

Ah, ok. I see now.

#

Requirements having more than one sublist make a multi-criteria advancement.
Key thing being that each sublist only contains one unique criteiron.

pseudo hazel
#

yes

#

so its impossible to know how much you need from just the criteria alone

echo basalt
young knoll
#

Hey it worked

kind hatch
#

That's just great. Private access.

#

Does this mean I would have to create a patch that makes it public? Or would that just break things?

pseudo hazel
#

i took it from the Advancement itself

#

I dont know if the requirement changes when progressing

#

so I didnt bother with the AdvancementProgress

#

im assuming only the criteria actually update with the progress

#

and then get checked against the requirements map

#

which is just stored here for ease of access

#

i guess

kind hatch
#

I think that is what's going on.

pseudo hazel
#

and there its just a record

kind hatch
#

Ah wait, so is this just as simple as exposing it on the parent advancement class?

round hemlock
#

hello i'm trying to put fire above the glass and here is my code.. can someone help? when i try another block everything goes ok

package com.blocks.flintonglass.events;

import com.blocks.flintonglass.Main;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.block.Action;
import org.bukkit.event.player.PlayerInteractEvent;

public class FlintOnGlass implements Listener {

    private static final Material[] FireBlocks = {
            Material.GLASS, Material.STAINED_GLASS
    };

    @EventHandler
    public void onI(PlayerInteractEvent event) {
        Player player = event.getPlayer();
        if (player.getItemInHand() == null) return;
        if (player.getItemInHand().getType() == null) return;

if (event.getAction() == Action.RIGHT_CLICK_BLOCK) {
        if (player.getItemInHand().getType() == Material.FLINT_AND_STEEL) {
            if (event.getClickedBlock() != null && isFireAble(event.getClickedBlock().getType())) {
                Block blockY = event.getClickedBlock().getRelative(0,1,0);
                if (blockY != null) {
                    Bukkit.broadcastMessage("§c§lFIRE!!");
                    blockY.setType(Material.FIRE);
                }
            }
            }
        }
    }

    public boolean isFireAble(Material block) {
        for (Material fireAble : FireBlocks) {
            if (block == fireAble) {
                return true;
            }
        }
        return false;
    }
}
cedar flume
kind hatch
#

@pseudo hazel Is this what you would be looking for?

pseudo hazel
#

yeah pretty much exactly

echo basalt
#

NamespacedKey.minecraft duke

river oracle
#

@kind hatch I'm available now

#

if you need help with something

kind hatch
#

Yipee

kind hatch
pseudo hazel
#

awesome, thanks for the effort 😄

young knoll
#

Normally we expose things by just making them public

#

Since minimal diff

#

Is that good coding practice? Probably not but shh

#

thou must not upset the mindiff

kind hatch
#

Would this not be the appropriate way to do it?

#

Since there is already a way to get the values?

echo basalt
#

I wonder if value.display can be reused

young knoll
#

Although idk if a List of lists is an ideal return type

kind hatch
#

Yea, I figured that would be brought up, but I'm not sure what else to put it as since that is what is returned.

#

The first #requirements() returns an NMS class and we can't use that one.

young knoll
#

You’d have to do some abstraction

#

Or maybe MD is fine with the list list, idk

kind hatch
#

Only one way to find out. :kek:

kind hatch
#

@young knoll I went ahead and made the PR. Would the current update be a better approach instead of just using a list of lists?

round hemlock
#

is that because of the server jar or version

cedar flume
#

Probably works if dofiretick is off

round hemlock
#

or gameRule

cedar flume
#

Gamerule

round hemlock
restive mango
#

Redstone is still bugged. How do you avoid causing chains of redstone to break when updating a block in this version?

valid burrow
#

context?

restive mango
#

If you have floating redstone and update one of the dust to another block, it triggers a chain of all the other redstone popping

valid burrow
restive mango
#

@valid burrow Not possible in current version.

#

Redstone has a unique new update mechanic separate from normal physics.

echo basalt
#

bruh why isn't this recognizing the method

#

fml

young knoll
#

That code looks too clean

#

Nest the ternary

echo basalt
#

geyser for you

#

fuck that imma just

#

why is discord butchering 10-bit color again

#

makes my images look like they're being rendered on a washing machine lcd

young knoll
#

Oh yeah switch statements exist

#

Or whatever you call that bastardized Kotlin version of them

echo basalt
#

ah shit I need to optimize these

young knoll
#

Only 10 seconds

#

How big of a surface are we talking

echo basalt
obtuse hedge
echo basalt
#

code

#

It's fixed now was just throwing proxy compile issues when I'm not trying to build the proxy >:/

#

working on recap forms now

young knoll
#

I’ve always wondered if it would be feasible to detect if the player was in a fully enclosed building

#

Efficiently

nova notch
#

are you making a thing to run java plugins on bedrock or what is this

echo basalt
nova notch
#

is geyser the one that lets bedrock connect to java clients or other way around?

fiery brook
#

i have geyser setup so bedrock and any version can join atm

#

think from 1.8 to 1.21

fiery brook
young knoll
#

It allows bedrock clients to connect to java servers

echo basalt
#

fucked up my branches so I spent like 20 mins looking on how to restack these with our fancy work tools

#

(it was a single command)

echo basalt
#

lmfao my code ran so hard it crashed the dedi

echo basalt
#

it's like 5am my lead dev ain't up to restart it ffs

#

pro tip: if you're writing a chunk system make sure to have a size counter, don't get lazy and map every location

echo basalt
#

400k blocks

#

but I was doing size checks every second

#

and this is like an 8 core 2013 xeon iirc

wet breach
#

thats not that much, how did it crash it? OOM?

echo basalt
#

4 core xeon

echo basalt
#

it has like 32gb total ram, 4gb process

wet breach
#

ah 4gb process

echo basalt
#

lovely cpu

wet breach
#

I recommend next time utilizing memory mapping if you really want to map that much to dump some of those objects to the cache

echo basalt
#

nah I'll just have a size counter

#

we almost never map it back to a list

#

When we do we immediatelly filter within a radius so chunking it out is a better approach

#

as we're less cpu-bound

echo basalt
#

🤔 interesting it maxes out ram and cpu

#

eh this is fine

#

how am I maxing out 5 cores if the machine only has 4

remote swallow
#

iirc its threads i think

echo basalt
#

cap

#

prolly is tbf

fiery brook
echo basalt
#

how the fuck would that work

#

I'll blame hyperthreading and assume we have 8 logical cores

fiery brook
#

correct

#

i have 32 core and 64 logical

#

so a 4 core could if needed use 6 if they are avaliable

echo basalt
#

The good thing of a crash loop is that you don't need to restart your server to test changes

#

it just does it for you

#

welp this never fires

wet breach
#

I can create a VM right now with 16 cores when I really only have 4

#

ideally you shouldn't do this because you will have a degradation of performance

remote swallow
orchid gazelle
#

@remote swallow @echo basalt those are Threads

echo basalt
#

no they're screenshots

remote swallow
#

No they're screenshots

vast ledge
#

No they're Screenshots

echo basalt
#

been struggling with encoding a damn position for the past hour

#

istg for some reason I can't just << 8 & 0xf like twice

blazing ocean
echo basalt
#

I know

#

it's just not liking me sigh

blazing ocean
#

L

echo basalt
#

and.. we're out of disk space on the work machine

#

latest.log is 250mb wow

#

I think my issue is ()'s

#

java doesn't struggle as much because && and ||'s have priority

#

grateful for windows programmer calculator rn

#

bossman gonna wonder why I'm charging 10$ for each character I type

obtuse hedge
#

What event is the event that generates/loads the blocks in a chunk

remote swallow
#

AFAIK there isn't one you need a custom chunk generator

sullen marlin
#

ChunkPopulateEvent? But generator is better

full ember
#

can anyone help me im trying to get rid of the numbers circled using placeholderapi

#

can i not send images here?

drowsy helm
#

?img

undone axleBOT
#

Can't send images? That's because you're not verified! Use !verify to complete verification.
Alternatively, you can upload screenshots to any image hosting site and share the link.

Here's some screenshot utilities that you can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org

full ember
#

can anyone help me im trying to get rid of the numbers circled using placeholderapi

chrome beacon
#

PlaceholderAPI alone does not add those

full ember
#

okay sorry for the wrong channel

lilac dagger
#

does anyone know why json doesn't keep order if i serialize/deserialize it?

chrome beacon
#

Gson?

#

Or just js?

lilac dagger
#

gson

#

i just have a list inside a map

#

i don't use adapters or anything

#

it's the default

chrome beacon
#

Looks like gson doesn't handle a specific order

#

You'll need to write your own adapter for it

lilac dagger
#

hmm

#

i can use an array instead

#

string arrays should keep the order no?

#

it's a string list as of now

chrome beacon
#

JSON spec doesn't guarante order as far as I'm aware

#

But give it a try

lilac dagger
#

it converts it into an array list it seems

#

i think the order is alright

#

but the socket is sending it in an unordered way

chrome beacon
#

Is the order important?

lilac dagger
#

no

#

it was mostly so the party owner could see that the members joined after

livid dove
#

General curiosity thing.

As spigot doesnt take a cut of paid plugins i was wondering, as a dev, why ads to other sites selling plugins aint allowed in ur plugins.

Dont get me wrong i dont hate it, just generally curious as i always assumed spigot took a cut was the reason

chrome beacon
#

People would start advertising to bypass rules

#

Would be my guess

#

Such as Spigot price limit

young knoll
#

Fire can't be on glass iirc

#

You'd have to set the block without a physics update

lilac dagger
#

guys, do you know how to make command suggestions show player names?

#

i know mojang has something that works only for visible names in tab

#

i don't wanna just use Bukkit.getonlineplayers and spoil someone with vanish

#

i think i'll look into some bukkit commands

lilac dagger
#

ah nevermind, i followed how mojang does it, and it's just playerList.getplayernamesarray

brazen badge
#

what is the protocol to get all sounds?

summer scroll
young knoll
#

Unless the server has disabled that

wraith dagger
#

guys

#

i used to use

public class CustomMobs extends PathfinderMob {

    public CustomMobs( Level world, Location loc) {
        super(EntityType.AXOLOTL, world);
        setPos(loc.getX(), loc.getY(), loc.getZ());
        //TODO Auto-generated constructor stub
    }
    
}

to create custom mob using pathfindermob (entitycreature) but when i updated to 1.20.4 i no longer able to do that

#

class org.obsidan.zombieapogalipse.CustomZombie.CustomMobs cannot be cast to class net.minecraft.world.entity.animal.axolotl.Axolotl

#

this is a error

#

is there anyway to fix this?

young knoll
#

You need to override getCraftEntity or something

#

getBukkitEntity?

wraith dagger
young knoll
#

Show code

wraith dagger
#

@EventHandler
public void onCommandssender(AsyncPlayerChatEvent e){

Level level = ((CraftWorld)e.getPlayer().getWorld()).getHandle();
CustomMobs mob = new CustomMobs(level, e.getPlayer().getLocation());
level.addFreshEntity(((CraftEntity)mob.getBukkitEntity()).getHandle(),SpawnReason.CUSTOM);

}

remote swallow
#

are you remapping

wraith dagger
#

i have other class

#
package org.obsidan.zombieapogalipse.CustomZombie;

import org.bukkit.Location;
import org.bukkit.persistence.PersistentDataContainer;
import org.bukkit.persistence.PersistentDataType;
import org.obsidan.zombieapogalipse.Behavior.BreakAnyBlockGoal;
import org.obsidan.zombieapogalipse.utils.Keys;

import com.google.common.base.Predicate;

import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.PathfinderMob;
import net.minecraft.world.entity.ai.goal.target.NearestAttackableTargetGoal;
import net.minecraft.world.entity.monster.Zombie;
import net.minecraft.world.level.Level;

public class OverrideZombie extends Zombie{

    public OverrideZombie(EntityType<? extends Zombie> entitytypes, Level world, Location loc) {
        super(entitytypes, world);
        setPos(loc.getX(), loc.getY(), loc.getZ());

        //TODO Auto-generated constructor stub
    }

    @SuppressWarnings({ "rawtypes", "unchecked" })
    @Override
    protected void registerGoals() {
        super.registerGoals();
        this.goalSelector.addGoal(1, new BreakAnyBlockGoal(this));
        Predicate<net.minecraft.world.entity.LivingEntity> customPredicate = entity -> {
            PersistentDataContainer datadamager = entity.getBukkitEntity().getPersistentDataContainer();
               if ((!(datadamager.has(Keys.ZOMBIE, PersistentDataType.BOOLEAN)))&& (!(datadamager.has(Keys.INJECTED, PersistentDataType.BOOLEAN))) ) {
                   return true;
               }
               return false;
       };
        this.goalSelector.addGoal(2, new NearestAttackableTargetGoal((PathfinderMob)this, net.minecraft.world.entity.LivingEntity.class    ,0, true, false, customPredicate));

    }
    @Override
    public void aiStep() {
        super.aiStep();
       
        
    
}}

#

it extends zombie and it working fine

remote swallow
#

?paste the error

undone axleBOT
wraith dagger
#

but when the pathfindermob have extremly error

young knoll
#

So I don’t see you override the method I mentioned

wraith dagger
young knoll
#

Just override it to return a custom CraftEntity class

#

Which is just an empty class that extends one of the CraftEntity classes

wraith dagger
#

so hard to find

young knoll
#

I think it’s getBukkitEntity

wraith dagger
#

but

#

public CraftEntity getBukkitEntity() {

  return this.getBukkitEntity();

}

#

uhhh what should i do with this

wraith dagger
#

the only i see is getBukkitEntty

#

and getCraftEntity hmmm

young knoll
#

Yeah getBukkitEntity is the one you override

wraith dagger
#

ohhh

#

but the type of my class is PathfinderMob also this is .class how can i get the CraftEntity one how to cast it can you guide me pls

#

when i tried "this" is say Type mismatch: cannot convert from CustomMobs to CraftEntityJava(16777235)

#
 public CraftEntity getBukkitEntity() {

      return this;
   }
young knoll
#

You need to make a custom class that extends the appropriate craft class

slender elbow
#

I admire your patience

young knoll
#

I think CraftMob is the equivalent to PathfinderEntity

wraith dagger
#

hmm so i will make a class that extends the livingentity then return to that classes?

#

bruh it used to be very easy

#

but after the update

#

;-;

slender elbow
#

none of this has changed in over a decade lol

wraith dagger
young knoll
#

It’s because we changed how we map NMS entities to Bukkit entities

#

No more giant ugly nested if statement

wraith dagger
#

;-;

#

bruh let me try again

#

no pain no gain

#

hmmm

vagrant palm
#

Could someone explain to me how to do AFK lobbies in Apex Legends as and what is needed?

chrome beacon
#

Huh what

fair rock
pseudo hazel
#

this is being chopped off considering it starts with tEntity

pseudo hazel
#

is your zombie meant to be an axolotl?

wraith dagger
#

yes

#

back to 1.16.5 i just this method to create the same entitypathfinder with ustom entity model

#

like many type

#

but when i upgrade to 1.20 it got an errors

stuck oar
#
            cfile = new File(Envoys.getPlugin().getDataFolder(), "config.yml");
            config = YamlConfiguration.loadConfiguration(cfile);

            sender.sendMessage(Colorize.colorize("&8[&cE&4n&cv&4o&cy&8] &ePlugin Reloaded!"));
        }```

anyone know why this isnt working? am i just using a really outdated way to get the config file
fair rock
#

What is not working? We cant read minds

stuck oar
#

nvm just me being stupid sorry

fair rock
#

Its fine, sometimes everybody is a bit stupid

restive mango
#

Anyone know how to avoid redstone popping on the current update?

pseudo hazel
#

popping?

stuck oar
fair rock
#

Tell me what happens and what should happen and we can talk about it?

pseudo hazel
#

put a new magazine in

fair rock
pseudo hazel
#

what do you mean by reloading

stuck oar
#

example

#

changing Message: "&8[&cE&4n&cv&4o&cy&8] &ePlugin version: 1.1" to Message: "&8[&cE&4n&cv&4o&cy&8] &ePlugin version: 1.2"

#

then reloading

#

should output the 2nd one

chrome beacon
#

How are you using the config

stuck oar
#

wdm

#

wdym*

chrome beacon
#

Show the code of you reading from/using the config

pseudo hazel
#

and when are you reloading the config

stuck oar
stuck oar
chrome beacon
#

and where is that

#

same class?

stuck oar
#

no

#

its a subcommand class

#
    public Void perform(Player sender, String[] args) {

        if (args.length == 1) {
            if (Bukkit.getPlayer(sender.getDisplayName()) != null) {
                sender.sendMessage(Colorize.colorize(config.getString("versionMessage")));
            }
        }

        return null;
    }```
chrome beacon
#

You're using the old config instance

stuck oar
#

oh yes

#

i am just being stupid again haha

#

ty

fair rock
#

Thats what i thought in the same moment "Your first message is the answer again"

#

xd

stuck oar
#

still doesnt work

#

😭

chrome beacon
#

So what did you change

stuck oar
#
    public Void perform(Player sender, String[] args) {

        if (args.length == 1) {
            if (Bukkit.getPlayer(sender.getDisplayName()) != null) {
                FileConfiguration config = CzrEnvoys.getPlugin().getConfig();
                sender.sendMessage(Colorize.colorize(config.getString("versionMessage")));
            }
        }

        return null;
    }```
#

moved the config instance into the perform

#

so it re-gets it every time

#

or should i load it straight from the file

fair rock
#

And in your reload command you set the config instance?

stuck oar
#
            cfile = new File(CzrEnvoys.getPlugin().getDataFolder(), "config.yml");
            config = YamlConfiguration.loadConfiguration(cfile);

            sender.sendMessage(Colorize.colorize("&8[&cE&4n&cv&4o&cy&8] &ePlugin Reloaded!"));
        ```
chrome beacon
#

Did that reload message get sent

stuck oar
#

yes

chrome beacon
#

show us the entire class

#

?paste

undone axleBOT
stuck oar
#

of which

shadow night
#

can anybody explain why they are using Void instead of void

chrome beacon
#

reload command

fair rock
stuck oar
shadow night
#

Interesting

stuck oar
#

i think loading it from the file could work

chrome beacon
#

So you're not changing what getConfig returns

#

??

#

getConfig still returns the old config

stuck oar
#

i was thinking that

fading drift
#

sendTitle is deprecated what should I use

stuck oar
#

loading it from the file should work then ye?

stuck oar
chrome beacon
#

It tells you

fading drift
#

API behavior subject to change

#

I read it I just don't understand it

stuck oar
# chrome beacon getConfig still returns the old config

                File cfile = new File(CzrEnvoys.getPlugin().getDataFolder(), "config.yml");
                FileConfiguration config = YamlConfiguration.loadConfiguration(cfile);
                
                sender.sendMessage(Colorize.colorize(config.getString("versionMessage")));
            }```

will this work
fair rock
#

No

stuck oar
#

y

fading drift
#

am I silly

fair rock
#

Ah yeah

eternal oxide
#

why are you jumping through hoops to load a config.yml ?

fading drift
#

1.8.8 only has one override for sendTitle and its deprecated

chrome beacon
#

1.8.8 💀

fair rock
stuck oar
worldly ingot
#

sendTitle() with times was added later

stuck oar
#

most of the time

fading drift
#

I knwo but I hate the fucking warning

worldly ingot
#

(a) Update, (b) it's fine. Suppress the warning and use the method

stuck oar
#

trust me ur gonna get stupid warnings everywhere

fading drift
#

thankis

eternal oxide
#

Plugin#reloadConfig()

fading drift
stuck oar
fair rock
worldly ingot
#

I mean it's not stupid. It's a warranted deprecation. The default times are subject to change if Mojang feels like it lol

#

It's undefined internal behaviour

fading drift
#

what if I

#

backport it

#

im genius

chrome beacon
#

You know what's even more genius

#

updating

worldly ingot
#

We don't backport features to 10 year old versions

#

You're the problem here, not Spigot

umbral ridge
#

drinking coffee and smoking

fading drift
#

no but surely I could backport just a method

#

not you guys, me

worldly ingot
#

If you want to maintain a 1.8 fork, you are more than welcome to

#

That's one of the benefits of Bukkit being open source

umbral ridge
#

Choco let's rewrite the entire jar and make everyone happy

worldly ingot
#

Just don't expect us to guide you through the forking process and how to go about doing things

stuck oar
stuck oar
fading drift
#

you're getting ahead of yourself. I'm only talking about backporting a single method

#

for my own plugin. nothing about forks or you guys

shadow night
#

But now I thought

#

And I'm making a paid modding API

worldly ingot
fading drift
#

how

worldly ingot
#

You are forking from the base branch to create commits

fading drift
#

could I not just write nms

chrome beacon
#

That works too

worldly ingot
#

I mean, yeah, you could use NMS. But that's not forking the software to backport a method

chrome beacon
#

Just send the packet yourself

fading drift
#

thats not what I meant sorry for the misunderstanding

shadow night
#

Just manually write the bits onto your network adapter using your hands

fading drift
#

I dont have a 1.21 dev environment open but would anyone happen to have the code for sendTitle up

undone axleBOT
stuck oar
fading drift
#

I figured out I need the time that the recent versions bring

chrome beacon
#

true just use the deprecated one

fair rock
#

💀

fading drift
#

timing*

chrome beacon
#

You're not updating anyways

shadow night
#

Lol

fading drift
#

no sorry

stuck oar
#

sender.sendTitle("hi", "hi");

fair rock
#

btw Spexx are you okay buddy?

umbral ridge
#

the only thing i update is windows

fading drift
stuck oar
#

what is the issue with it

#

is it just because of the error

fading drift
#

I require the timing

chrome beacon
#

?stash

undone axleBOT
chrome beacon
#

stash should have it

shadow night
fading drift
#

oh shit thank u I didn't know where to look to find craftplayer

remote swallow
#

?stash

undone axleBOT
harsh ruin
#
/* function not doing anything */

  boolean isClaimChest = connectDB.isClaimChestInChunk(chunk.getX(), chunk.getZ(), e.getBlock().getLocation().toString());
  if (isClaimChest) {
    e.setCancelled(false);
    connectDB.removeClaim(chunk.getX(),chunk.getZ());
    e.getPlayer().sendMessage("§dYou've removed a claim chunk chest, chunk unclaimed.");
  }

/* connectDB.isClaimChestInChunk() */

public static boolean isClaimChestInChunk(int chunkX, int chunkZ, String ChestCoords) throws SQLException {
try (PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM claims WHERE chunkX = ? AND chunkZ = ? AND claimChestLocation = ?")) {
  preparedStatement.setInt(1, chunkX);
  preparedStatement.setInt(2, chunkZ);
  preparedStatement.setString(3, ChestCoords);
  ResultSet rs = preparedStatement.executeQuery();
  Bukkit.broadcastMessage("True or False? " + rs.next());
  return rs.next();
  }
}

```Whenever I try to break the claim chest, nothing happends? the Database does contain the right data
eternal oxide
#

you are making db calls in the BlockBreakEvent?

harsh ruin
#

Top line

eternal oxide
#

very bad idea

harsh ruin
#

Oh.. Why?

eternal oxide
#

db access is extremely slow. Its going to lag your server every time someone breaks a block

harsh ruin
#

Even if i'm using sqlite?

eternal oxide
#

sqlite is a mix of file and memory storage, but yes

#

as for it not finding a claim, you provide too little information

#

debug your claimChestLocation

harsh ruin
#

It does find the claim, it doesnt trigger isClaimChest

eternal oxide
#

rs.next is not returning the boolean you want

#

you also call it twice

harsh ruin
#

It has been returning true or false though? When making a SELECT query

#

It does in other functions, atleast.

eternal oxide
#

you are calling it twice so the second rs.next() is false

#
isFound = rs.next();
sysout...
return isFound();```
harsh ruin
#

That could be one thing. I'll be sure to test that when i'm home

fair rock
lilac dagger
#

something to do with enchants

#

it happens inside the api/impl itself

slender elbow
#

pepelaugh

lilac dagger
#

ah i see

eternal night
#

none of the PR reviewer caught that Sadge

#

sadge

slender elbow
#

if only.. uh

#

yeah

lilac dagger
#

also i can't log in

eternal night
lilac dagger
#

ah nevermind

#

stash != jira

remote swallow
#

Jira and stash are the same login to sign into stash you need to sign the cla

#

Forums and jira are different logins

lilac dagger
#

i didn't sign that which makes sense

slender elbow
#

wait, you have to sign the cla even if you just want to open an issue...?

#

oh boy

eternal night
#

nah

#

but if you are looking at stash and try to log in there

#

then you do

lilac dagger
#

done

chrome beacon
#

Also don't use an expiring pastebin

lilac dagger
#

oh boy, this might be complicated since it's in the gui

#

i'll see

#

also i forgot about the expiring pastebin, one sec

fair rock
#

After reading the code and exception would say:
Create Item
Add Item Flag
No Enchantment

Error?

eternal night
#

Yea

carmine mica
lilac dagger
#

i fixed the pastebin, in a few moments i'll try to recreate the issue

carmine mica
#

Maybe this is why PRs exist? To get feedback before pushing broken stuff?

hybrid spoke
#

im working on a pathfinding system that applies multiple filters to validate movement between nodes.

example filters:

  • WalkableFilter: walkable path for entities, requires a solid ground
  • NoHarmFilter: avoids dangerous materials such as fire, lava, wither roses and magma blocks.
  • JumpDownFilter: basically jumping down from a cliff with a given max height

the issue arises when, for example, the target block at the end of a jump-down is a harmful block (e.g., magma). if we strictly enforce all filters to pass, legitimate jump-down paths are blocked due to the WalkableFilter. on the other hand, ignoring the harmful block validation could lead to dangerous paths being marked as valid or other side-effects.

looking for input on how to resolve this conflict between filters to ensure that valid paths (like jump-downs) are not blocked, while still avoiding dangerous materials when necessary.
code context:

carmine mica
eternal night
#

that was the joke Sadge

carmine mica
#

oh, I thought the joke was that no one can see PRs

#

guess there are multiple applicable jokes

eternal night
#

kekwhyper would have been a good one too yea lmao

#

at least its a quick fix i am sure the slime will get to it soon

harsh ruin
eternal oxide
#

show your code

harsh ruin
#

The function or the blockbreakevent?

eternal oxide
#

function

harsh ruin
#
/* Block Break Event */
@EventHandler
    public void onBlockBreak(BlockBreakEvent e) {
        try {
            Chunk chunk = e.getBlock().getChunk();

            boolean claimed = connectDB.chunkClaimed(chunk.getX(), chunk.getZ());
            boolean authorizedPlayer = connectDB.playerAuthorized(e.getPlayer(), chunk.getX(), chunk.getZ());

            e.getPlayer().sendMessage(e.getBlock().getLocation().toString());

            if (claimed) {
                boolean isClaimChest = connectDB.isClaimChestInChunk(chunk.getX(), chunk.getZ(), e.getBlock().getLocation().toString());

                if (isClaimChest) {
                    e.setCancelled(false);
                    connectDB.removeClaim(chunk.getX(),chunk.getZ());
                    e.getPlayer().sendMessage("§dYou've removed a claim chunk chest, chunk unclaimed.");
                } else if (!authorizedPlayer) {
                    e.setCancelled(true);
                    e.getPlayer().sendMessage("§cThis chunk has been claimed by someone and is protected.");
                } else {
                    e.setCancelled(false);
                }
            }
        } catch (SQLException ex) {
            ex.printStackTrace();
        }
    }
/* Function */
public static boolean isClaimChestInChunk(int chunkX, int chunkZ, String ChestCoords) throws SQLException {
        try (PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM claims WHERE chunkX = ? AND chunkZ = ? AND claimChestLocation = ?")) {
            preparedStatement.setInt(1, chunkX);
            preparedStatement.setInt(2, chunkZ);
            preparedStatement.setString(3, ChestCoords);
            ResultSet rs = preparedStatement.executeQuery();
            return rs.next();
        }
    }```
#

Little side note: everything works, besides the if(isClaimChest)

#

no errors

eternal oxide
#

method looks fine now

harsh ruin
#

I've got a feeling it has to do with if(!authorizedPlayer), because I keep getting that message

#

instead of it first checking isClaimChest

#

I fixed it, spelling mistake somewhere. 🤦‍♂️

lilac dagger
#

what about a golden ticket system, give each filter the golden ticket every n seconds so they can evaluate the path

#

mojang if i remember correctly implements priority

#

so if you have a conflicting filter consider prioritizing which filter /pathfinder to go first

hybrid spoke
lilac dagger
#

i still think it's a priority issue

hybrid spoke
#

i thought about introducing a filter aggregator which basically merges the results so that all filters together act as one big algorithm instead of single results

lilac dagger
#

the path should change as it's found dangerous or not

#

so when a lava block is found, recalculate, go around

#

i don't know the exact implementation of what you're working with, but i assume this should work

hybrid spoke
#

just that in the current state all filters have to pass. the conflict is still there. the landing point could be dangerous (the filters dont know each others result).

#

so i thought about dynamically changing the target position which is to be evaluated, means that JumpDownFilter overrides the position to validate for the following filters

#

but that could also have downsides and changes the filters responsibility from just providing feedback to then consciously influencing the path from outside

lilac dagger
#

create a unified accessor then

hybrid spoke
#

in what way?

lilac dagger
#

so the end result is the result of all your filters

hybrid spoke
lilac dagger
#

and if i imagine how a* works correctly, you'll need to apply your filters at each possible node

hybrid spoke
#

thats exactly whats happening

lilac dagger
#

does it work?

#

i assume it does

hybrid spoke
#

it doesnt

#

but i was too lazy to debug yet and that really breaks up our filter logic

#

so i was seeking for other perspectives

lilac dagger
#

we can help so much, you're the one who is heavily involved in this project

#

it looks clean tho, so that's nice

hybrid spoke
lilac dagger
#

well, if it's just a filter then each filter should run at each node

#

the result of a fail should make the pathfinder look for another

hybrid spoke
#

yeah thats the fundament of the filters

lilac dagger
#

if the path is innaccessible it should stop near the path it fails

hybrid spoke
#

i just need to find a way to merge the results and make them build up on another without knowing eachother

lilac dagger
#

but it should work without knowing each other

#

i mean a fail does change the result no?

#

maybe your filters sits at a wrong level

hybrid spoke
#

f.e. validating the jump position with the noharmfilter, then jumping down shifts the position to the landing position, but the validation of that position only happens at the next iteration, or technically spoken after all the air blocks which are considered as "the jump"

#

and if that fails, we would need to traverse back to find an alternate route

#

i think thats the main problem im trying to describe

#

á filter conflicts

lilac dagger
#

mojang has a jump controller/look controller/move controller

#

maybe your jump should be separated

#

wait nevermind, it shouldn't matter

#

i'm not familiar enough with your project to be helpful

hybrid spoke
stuck oar
#
    Location1:
      world:
      x:
      y:
      z:```

i want to save locations to config how do i loop through to find the next available save slot
#

like if location1 is taken it goes to location2

remote swallow
#

save a list

lilac dagger
#

do you precalulate your route?

#

or you're calculating it as you go?

hybrid spoke
# hybrid spoke you are, you're giving me points to think about. sometimes it helps to just spea...

we've had 2 problems to begin with. f.e. what happens in dead ends, how do you traverse back and when do you stop traversing. for that i thought about having control points which are introductory positions of new path routes, f.e. climbing a mountain, dropping down, new terrain etc. so that you can jump back to that control point and retroactively mark the examined positions as not traversable

#

maybe that could be the solution for the filter conflicts, or at least a part of it

hybrid spoke
lilac dagger
#

i see

#

mojang has this

hybrid spoke
lilac dagger
#

if i think more about this, maybe it doesn't help you at all

#

you've probably built a different system entirely

#

so there might not be much for you to learn

hybrid spoke
#

most likely. what information would you help to understand this more?

lilac dagger
#

i still think a filter should change the position, no matter what other filters say

hybrid spoke
lilac dagger
#

but don't you try to filter in order to change what happens with the path?

hybrid spoke
#

yes, but in order to validate

#

i mean, i've had the same approach with the filter aggregrator, that there is one mutable context shared over all filters, but i dont really like the idea of filters changing the context

#
  • that adds a whole new layer of complexity
lilac dagger
#

this is out of my ability to help you, you're way more familiar with the project that i am with the pathfinding subject

hybrid spoke
#

alright, but thanks for your input :)

lilac dagger
#

you're welcome, sorry i can't be more helpful

hybrid spoke
#

all good tho, you did enough

glossy laurel
#

how does luckperms make it so when you type /lp applyedits XXXXXXXX --force the --force is red

chrome beacon
#

Brigadier stuff

glossy laurel
pseudo hazel
#

minecrafts command shebang

#

iirc you can use it for your own commands but im not sure how

chrome beacon
#

There are a couple of apis that wrap it

glossy laurel
#

alright

#

guess Im not using it then

#

this shi way to complex

#

sounds, at least

#

guys, is 420 lines in my command class normal

#

or am I doing something wrong

#

cuz tbh thats a bit high

pseudo hazel
#

the amount of lines should never be a determining factor

#

its always about the contents of those lines

glossy laurel
#

well

lilac dagger
#

as long as the class does only one thing it's fine

glossy laurel
lilac dagger
#

a class shouldn't do a and b

pseudo hazel
#

thats undefinable

glossy laurel
lilac dagger
#

i mean it shouldn't be a lamp and a tv screen

glossy laurel
#

well

#

yeah

#

I guess?

pseudo hazel
#

thats a strawman

restive mango
#

Anyone know how to avoid redstone popping on the current update? It’s not safe to update floating redstone

pseudo hazel
#

what is redstone popping

glossy laurel
#

i suppose

pseudo hazel
#

right

#

well redstone isnt supposed to be floating

#

nor is it supposed to "pop"

#

so whatever bug you relied on it seems might have been fixed

glossy laurel
pseudo hazel
#

maybe try in purely vanilla to see if its still there

glossy laurel
#

Can I save config file to just a list without any index? Like this:

- VALUE 1
- VALUE 2
- VALUE 3```
eternal oxide
#

no

young knoll
#

Yes

glossy laurel
#

👌

glossy laurel
young knoll
#

Just do set(“path”, yourList)

remote swallow
#

they dont want a path

glossy laurel
#

yes

young knoll
#

They said index

eternal oxide
#

yeah you failed to read his question

remote swallow
#

they mean path

glossy laurel
remote swallow
#

no

glossy laurel
#

well

#

I suppose not

#

index would be the key then?

glossy laurel
remote swallow
#

index would be 1,2,3,4,5

young knoll
#

Index is what spot in the list an item is in

glossy laurel
#

so I cant save it without a path, yes?

eternal oxide
#

no

remote swallow
#

no

glossy laurel
blazing ocean
#

?

glossy laurel
#

list didnt start from 0

glad prawn
gusty bough
#

Hey, I did have same problem and followed what you said and it works well, but I don't really understand why this fixes the problem, could you explain me?

#

Seems like typeHierarchyAdapter handles inheritance but we do send an ItemStack not a subclass of it

river oracle
#

CraftItemStack?

gusty bough
#

Maybe...

stuck oar
#
        Set<String> cfgSection = config.getConfigurationSection("EnvoyLocations").getKeys(false);

        int newSize = cfgSection.size() + 1;

        String newLocString = ("Location" + newSize);

        Location playerLoc = sender.getLocation();

        double x = playerLoc.getX();
        double y = playerLoc.getY();
        double z = playerLoc.getZ();


        config.createSection(newLocString);

        String world = playerLoc.getWorld().getName();

        config.set(newLocString + ".world", world);
        config.set(newLocString + ".x", x);
        config.set(newLocString + ".y", y);
        config.set(newLocString + ".z", z);


        CzrEnvoys.getPlugin().reloadConfig();```

anyone know why this isnt working?
river oracle
# gusty bough Maybe...

I mean if you're not 100% sure its an ItemStack and because ItemStack could be a CraftItemStack you'd want a ItemStack hiearchical adapter

stuck oar
fair rock
#

You need to save your config

stuck oar
#

does reloadconfig() not do that

gusty bough
stuck oar
#

am i stupid

#

OMG

stuck oar
#

alright ty silver

river oracle
#

not every ItemStack is a CraftItemStack but ever CraftItemStack is an ItemStack

gusty bough
#

🤔

river oracle
#

but yeah not every ItemStack is guarenteed to be a craft one

#

paper mostly fixes it, but not fully because they didnt' convert it to an interface, not like they really can without breaking stuff

stuck oar
#

versionMessage: "&8[&cE&4n&cv&4o&cy&8] &ePlugin version: 1.2"


#----------------Envoy Locations-----------------------

EnvoyLocations:
  Location1:
    world:
    x:
    y:
    z:

#---------------Envoy Types-----------------------------

EnvoyTypes:
  Basic:
    Amount: 5
  Mythic:
    Amount: 10```

this is how i want the structure of my config.yml

now when i add stuff to it it goes like this

```versionMessage: '&8[&cE&4n&cv&4o&cy&8] &ePlugin version: 1.2'
EnvoyLocations:
  Location1: {}
EnvoyTypes:
  Basic:
    Amount: 5
  Mythic:
    Amount: 10
Location2:
  world: world
  x: 86.96358662674324
  y: 108.7746653204343
  z: 81.81185904532282
gusty bough
# river oracle no

oh ok, maybe that's why I have the error when I try to save an ItemStack from player inventory but I could save a created ItemStack from plugin

fair rock
river oracle
stuck oar
#

and the gaps inbetween

#

is there a way i can stop that

stuck oar
#

sorry

fair rock
river oracle
#

so its not like there's a choice

#

you have to write one and if you want to serialize non bukkit stacks you have to register it as hiearchical

fair rock
#

Gson TypeAdapter? I have one to serialize and deserialize ItemStacks, idk where is your problem with that?

river oracle
#

I have something called ItemSpec i use

#

and I have my own polyglot serialize deserialize system

#

but ItemStacks could cause issues if you don't reigster your type adapter as hiearchical

fair rock
#

Custom ItemStack do you mean?

#

Because as i said a normal TypeAdapter works very well

river oracle
#

wdym by the normal type adapter

#

the ReflectionTypeAdapter?

#

I'd avoid that internals are subject to change using the ReflectionTypeAdapter is unstable at best

fair rock
#

Nah your own TypeAdapter without registration as hiearchical, i registered it with registerTypeAdapter

And i dont have problems with that

river oracle
#

oh yeah it should work so long you don't throw a CraftItemStack through it

fair rock
#

?paste

undone axleBOT
fair rock
river oracle
#

you use NMS lol

#

that's not the API my friend

fair rock
#

I have something like that, but i didnt try to pass directly CraftItemStack

#

And? Thats not the question

#

I just said write your own

#

The implementation behind that is your own business

river oracle
#

the person in question is writing their own but using the API

fair rock
#

I never said "use mine"

river oracle
#

yeah I give up here yada yada whatever

fair rock
#

Im justing saying write your own TypeAdapter

#

I dont know what do you read?

slender elbow
#

the point is that if you are going to write an adapter for the api itemstack, it should be registered as a hierarchical type adapter

upper hazel
#

I can create a new livingEntity type with NMS right but is it possible to change the logic of a specific object at a specific time ?

#

i read information obaut this and i cant 😦

#

then here's another question how to make the mob move in the direction where the player who is sitting on it is looking?

#

do real move

#

dont vector manipulation (if pussble)

echo basalt
#

(he doesn't know basic math)

proper cobalt
#

ik this isnt spigot but im banned from papermc, is there a ComponentBuilder in the way of like a StringBuilder where you can append components

echo basalt
#

With kyori components you can just append them to each other

proper cobalt
#

how

echo basalt
#

component.append ?

#

Have you tried messing with the API at all?

proper cobalt
#

ah ur right

#

no i havent

echo basalt
blazing ocean
#
echo basalt
#

rad can I have 5 bucks

blazing ocean
#

no

echo basalt
#

rude

proper cobalt
#

if u append do u have t ostill put a \n

blazing ocean
#

give me 5 bucks and ill give sou 5 bucks back

blazing ocean
eternal night
blazing ocean
#

crazy

echo basalt
#

lynx can I have 5 bucks

proper cobalt
#

oh wait i am in paper

echo basalt
#

to fund my plugin dev work

proper cobalt
#

i didnt even realise lmaoo

eternal night
#

lmao

blazing ocean
#

lynx you must be rich from all the paperwork you do (🥁)

eternal night
proper cobalt
#

swear i got banned tho

#

idk

eternal night
#

broke af sorry

blazing ocean
#

so gimme 5 bucks

#

i do not care about your financial status !

echo basalt
blazing ocean
#

^^

wet breach
blazing ocean
#

still sounds like his problem

proper cobalt
#

it doesnt get appened and it says Result of 'Component. append()' is ignored

blazing ocean
#

what

proper cobalt
#

final Component comp = Component.text("hey guys");

#

when i do comp.append()

blazing ocean
#

Component component = Component.text("hi").append(...)

proper cobalt
#

yeah but i have a for loop

#

why cant i just do comp.append

#

oh append returns a new comp

#

comp = comp.append is fine

eternal night
#

If you know that you are doing that Component.text() returns a mutable builder

proper cobalt
#

yero

#

yerp

blazing ocean
#

Component.text((builder) -> ...)

proper cobalt
#

yeap

#

what about this

#

i spawn a textdisplay right

#

but it only spawns facing south

#

why doesnt it spawn where i look or something

young knoll
#

You need to rotate it

worthy yarrow
#

Or set the billboard to center, it’ll just always face the player this way

solid lake
#

hello just one little supid question, can we had Persistant data on a player ?

pseudo hazel
#

yes

#

iirc any entity has pdc

solid lake
# pseudo hazel yes

that's work good ? like, i can had balance on a player with Persistant data ?

pseudo hazel
#

yeah

#

it will saved in the player data file

solid lake
#

humm nice tyy

#

I'm questioning my entire plugin lmao

jovial grove
#

Do I understand correctly that to make the code execute in a thread other than the main Minecraft thread, I need to create a Thread object?

#

Sorry, I'm a newbie

worthy yarrow
#

Why not just use the built in methods? ie: runTaskAsync etc

solid lake
#

and i have an other question what is the value I put in when I create NamespacedKey ? I don't really understand what it's for knowing that we check the value of the key afterwards like Java getPersistentDataContainer().set(.... ....) and getPersistentDataContainer().has(.... ....)

worthy yarrow
jovial grove
worthy yarrow
#

Depends on how much thread control you need, most cases async methods are fine

remote swallow
#

and global

#

?pdc

solid lake
worthy yarrow
#

You use the key to get the pdc

remote swallow
#

if you wanna get the balance you check the value

jovial grove
worthy yarrow
#

It already handles a lot, whats a little more

solid lake
#

okay if i understand correctly the key is called when you use the variable that we created ?

#

we don't see the key but it is in the variable and check with

worthy yarrow
#

pdc is just a fancy map wrapper

jovial grove
solid lake
#

i begin in the world of minecraft plugin thanks all for helping

worthy yarrow
#

NamespacedKey is the key used to associate a container with an object, then you use said key to obtain the container

#

Like I said it's just a fancy map wrapper

solid lake
#

ooh i understand

worthy yarrow
#

Key will always be a namespacedKey object, though the data stored can differ

#

Check persistentDataType in the docs, also check that pdc link that was sent

echo basalt
#

?pdc

solid lake
#

i already checked but i need an explanation with a dialogue cause i don't understand english very well

worthy yarrow
solid lake
worthy yarrow
echo basalt
#

That's too technical

#

Do you want to understand how it works or how it's used?

worthy yarrow
#

I mean

solid lake
echo basalt
#

Go on

solid lake
#

I finally understood everything, don't worry

#

ty so much

worthy yarrow
#

Sure mane gl with the project

solid lake
#

tyy

proper cobalt
#

typa shit i been on

#

rotating the transformations n shit

#

shoutout bukkit

young knoll
#

It’s literally not even Bukkit

proper cobalt
#

fawkkkkkk

young knoll
#

The transformation uses JOML objects

proper cobalt
#

in general shoutout bukkit tho

young knoll
#

Also you can just rotate the entity itself, rather than the transformation

proper cobalt
#

type shiii

#

getting all the tips n tricks

#

whats joml

slender elbow
#

Java OpenGL Math Library

#

It’s a lightweight math library specifically designed for use with OpenGL in Java applications, providing data structures and mathematical functions for 2D and 3D graphics. JOML offers classes for vectors, matrices, quaternions, and other mathematical operations that are commonly needed in graphics programming, making it easier to handle transformations, projections, and various geometrical calculations efficiently.

If you're working on a Java project that involves OpenGL, JOML can be a handy tool to streamline your math operations!

zealous moat
#

Can you give me an example of how to set a rule on a diamond tool?
I have looked at the Toolcomponent page but can't figure out how to use it!

worthy yarrow
#

Eh? What is a rule

#

Wow when the hell was this a thing

noble flume
#

How might I change the way an item is held

#

For example someone is holding a custom item

#

That item is held differently than a sword perhaps

drowsy helm
#

(in resourcepack)

noble flume
drowsy helm
#

if you use blockbench you can edit how its displayed in the hand

noble flume
#

Hands clasped together

#

Ok

noble flume
drowsy helm
#

the parent only really effects how it's held in the hand and the animation played

#

otherwise you don't have any other option

drowsy helm
#

why cant you change the parent?

noble flume
#

And I want the hands to like be together in prayer

#

While holding it

#

🙏

#

Kinda like that

drowsy helm
#

yeah i get that but why cant you change the parent

noble flume
#

I’m using a nether star currently so it isn’t destroyed

drowsy helm
#

like i said, the only thing setting the parent does is how the holding animation effects it

#

it doesn't change how the item interacts

noble flume
#

Im slightly confused

drowsy helm
#

the parent in the resourcepack sense only tells the game how to render the item

#

nothing else

noble flume