#help-development

1 messages · Page 41 of 1

glossy scroll
#

if I want to look through a database, and sift through some data in async

#

then return a value i have in async

#

(now, ive done this before, just thinking of different ways to do it)

#

couldn't i just make a callback pattern

#

or a method with a Consumer parameter

zenith saddle
#

still times them out 😦

carmine nacelle
#

@vocal cloud Finally watching that video now... the reason im using NMS is because I want to do custom stuff with beehaviors, pathfinders etc at some point

zenith saddle
#

how could you generate a world on another thread

glossy scroll
#

you cannot

noble lantern
#

Question about remappings:

If im wanting to support 1.19 and 1.19.1, do i need seperate modules for both 1.19 and 1.19.1 remapped? Or can i get by with only using one of either or?

young shell
#

Is ArmorStand#getItem supposed to return null after setting it to null with Armorstand#setItem(). It returns null even though the API is annotated with @urban grotto

lost matrix
# glossy scroll or a method with a Consumer parameter
  public void useToplist(Consumer<Toplist> action) {
    CompletableFuture.supplyAsync(this::fetchToplistFromDatabase).thenAccept(action);
  }
  
  private Toplist fetchToplistFromDatabase() {
    ...
  }

Or if you want the action to run on the spigot thread

  public void useToplist(Consumer<Toplist> action) {
    CompletableFuture.supplyAsync(this::fetchToplistFromDatabase).thenAccept(toplist -> {
      Bukkit.getScheduler().runTask(yourPlugin, () -> action.accept(toplist));
    });
  }

  private Toplist fetchToplistFromDatabase() {
    ...
  }
rough drift
#

Mostly due to runtime size, but the thing is runtime is on central, plugin.yml time

glossy scroll
#
    public void getMyString(Consumer<String> callback) {
        Bukkit.getScheduler().runTaskAsynchronously(getPlugin(), () -> {
            // do some database stuff here
            callback.accept("This is my database data");
        });
    }```
Like this
#

oh ok interesting

#

thenAccept

#

is that on the main or async thread?

carmine nacelle
#

Hey @lost matrix
This function you sent me:

    public static String toNbtString(Entity bukkitEntity) {
        CompoundTag tag = new CompoundTag();
        ((CraftEntity) bukkitEntity).getHandle().saveWithoutId(tag);
        return tag.getAsString();
    }

Is there a way to only get my custom tag? or would I have to split the string and all that

#

shit

lost matrix
glossy scroll
#

ok

young shell
#

You could even write a Plugin in Clojure. Not that you ever would want to

lost matrix
carmine nacelle
#

Hmmm...

#

Oh wait

#

nvm, im dumb af

#

(everyone here already knows this)

sand vector
#

Hey a silly question, if i have a domain therifty.net would I put net.therifty in groupid?

young shell
#

yes

#

usually your groupId is your domain but backwards

sand vector
#

im always confused with it, and just put me.therifty

young shell
glossy scroll
#

only use a domain prefix if you actually own the domain

sand vector
#

i do

glossy scroll
#

yes i know

young shell
#

In theory you could put everything there, its just established that you use either your domain or me.blabla if you don't own one

sand vector
#

ah ok 😆

zenith saddle
#

why does this crash?

young shell
#

Well almost everything, as long as it's alphanumeric

glossy scroll
young shell
#

the artifactId does allow all Unicode Characters tho

glossy scroll
#

cant help yall

zenith saddle
dim bronze
#

Think I seen someone mention it here the other day, and I know this question isn't really in the scope of the channel, but do you use stripe or paypal for receiving payment? I've always used paypal although looking to change up how I've been doing things and wondering if stripe is a better alternative

deep solstice
#

hi yall, im working with a SQLite database, and im trying to read/write custom objects in my plugin to the database. here's the snippets of code I have written:

// for saving the object:
public void addPunishment( NPunishment punishment ) {
  PreparedStatement ps = ConnectionManager.CONN.prepareStatement( "INSERT INTO " + TABLE_NAME + "(player, data, guipun, reference) VALUES(?, ?, ?, ?);" );
  ...
  // Here is where I save the object
  NPunishmentData data = ( NPunishmentData ) punishment;
  ps.setObject( 2, data );
  ...
}

// for getting the object:
public List<NPunishment> forceGetPunishments( String playerUuid ) {
  PreparedStatement ps = ConnectionManager.CONN.prepareStatement( "SELECT * FROM " + TABLE_NAME + " WHERE player = ?;" );
  ...
  ResultSet rs = ps.executeQuery();
  while ( rs.next() ) {
    // Here is where I get the object and is also where the error below is happening
    NPunishmentData data = ( NPunishmentData ) rs.getObject( "data" );
  }
  ...
}```
Here's the error I keep getting, though:
```java.lang.ClassCastException: class java.lang.String cannot be cast to class com.github.cyberryan1.netunoapi.models.punishments.NPunishmentData (java.lang.String is in module java.base of loader 'bootstrap'; com.github.cyberryan1.netunoapi.models.punishments.NPunishmentData is in unnamed module of loader 'Netuno-1.5.0.5-DEV.jar' @280097f5)```
It looks like it's saving it as a string, even though it shouldn't be. Any clue as to why and how to fix it?
rough drift
#

If I want to I will use clojure

glossy scroll
rough drift
#

Fuck It clojure time

dim bronze
glossy scroll
#

i mean

#

i think youre capable to weigh the pros and cons

#

it really just comes down to fees and how much you take home

#

almost everyone has paypal

dim bronze
#

fees are pretty much the same, I'm asking more about experience with both companies. I've never had a problem with PayPal so I don't see much reason to switch, just wondering if anyone had anything good to say about stripe

young shell
carmine nacelle
#

@vocal cloud Yeah.. even nbt tags get completely wiped along with PDC... is there a way to do behavioral/pathfinder stuff without nms?

quaint mantle
#

You're gonna get biased answers in here ngl, and you can still use nms iirc

young knoll
#

?whereami

carmine nacelle
worldly ingot
#

You’d have to try and figure out a way to register over the existing tile entity

#

Though I mean… inevitably going to break something

young knoll
#

Just uhh

#

Mixin it

worldly ingot
#

lol that too I guess is an option

carmine nacelle
#

Wait wut

young knoll
#

I mean that loop should only remove tags it’s specified

#

So custom ones not in said list should stay

carmine nacelle
#

you'd think so..

#

but....

#

it completely loses my custom tag

#
    @Override
    public boolean save(CompoundTag nbt) {
        boolean returnVal = super.save(nbt);

        nbt.putString("bee-uuid", uuid.toString());

        return returnVal;
    }

    @Override
    public void load(CompoundTag nbt) {
        super.load(nbt);

        String beeUUID = nbt.getString("bee-uuid");

        this.originalBeeUUID = UUID.fromString(beeUUID);
    }
#

Unless my load method is wrong

peak depot
#

why is it printing sus but not sending the action bar

carmine nacelle
#

Well.. nah its fine but its not a CustomBee once it leaves so that data is byebye.

carmine nacelle
peak depot
#

Player list

carmine nacelle
#

show

peak depot
#

private List<Player> sendActionBar = new ArrayList<>();

carmine nacelle
#

where are they being added

peak depot
#

fixed it forgot to register the listener

#

thx anyways

carmine nacelle
#

@worldly ingot If I do away with NMS entities for this, could I still do behavior stuff without?

echo basalt
#

List<player> wtf

#

don't

echo basalt
carmine nacelle
echo basalt
#

It might be trying to create the bee back from the original entitytype using the factory

#

hm

carmine nacelle
#

its just spawning as a normal bee without any of my custom stuff.

echo basalt
#

I mean yeah but

carmine nacelle
#

and theres currently no way to reference it.

echo basalt
#

show your full class's code

#

you are registering a custom entity type in the registry right?

carmine nacelle
#

yes

echo basalt
#

I mean

#

you call EntityType.BEE

#

try making your own

carmine nacelle
#

Mike spent hours working on this and wasnt able to find a solution either

carmine nacelle
echo basalt
#

public static EntityType<Bee> GANGSTA_BEE_TYPE = register("gangsta_bee", EntityType.Builder.of(GangstaBee::new, MobCategory.MISC).sized(0.5f, 0.5f));

carmine nacelle
#
    public static void registerCustomBee() {
        String typeName = "custom_bee";
        EntityType.Builder<Entity> builder = EntityType.Builder.of(CustomBee::new, MobCategory.CREATURE)
                .sized(0.7F, 0.6F)
                .clientTrackingRange(8);
        Registry.register(Registry.ENTITY_TYPE, typeName, builder.build(typeName));
    }
echo basalt
#

registring

#

returns an entitytype

#

pass it on the constructor

#

you're registering the custom type but you're not using it anywhere

carmine nacelle
#

uh...

  public CustomBee(CustomBee customBee, Location location, String beeName, Boolean isBaby)
#

thatt..?

echo basalt
#

uh no

#

you're gonna have to make a default constructor for the factory

carmine nacelle
#

Would that even change anything...?

echo basalt
#

changes some internals

carmine nacelle
#

hmm..

#

I guess I dont know if it would actually like... respawn as that type

echo basalt
#

you gotta make that 2-arg constructor

#

for nms to realize it's a custom entity type apparently

#

it's stupid

carmine nacelle
#

This one

    public CustomBee(EntityType entityType, Level level) {
        super(EntityType.BEE, level);
    }
echo basalt
#

yeah

#

pass your custom entity type

carmine nacelle
#

its in there

echo basalt
#

instead of BEE

carmine nacelle
#
    public CustomBee(EntityType entityType, Level level) {
        super(this, level);
    }
#

this is all IN my CustomBee class

echo basalt
#

entity type, not bee

#

grr

#

just look at the gangstabee class I sent

#

second bin

carmine nacelle
#

so its just an enum then

echo basalt
#

it's not necessarily an enum

carmine nacelle
#

InternalsPlugin.GANGSTA_BEE_TYPE this

echo basalt
#

because nms's EntityType is not an enum

#

it's treated in a similar way

#

but use your custom entity type

#

that you're registring

#

instead of passing bee

carmine nacelle
#

okay

quaint mantle
#

I got a big big issue 👀
So if I use Chunk#load works but it doesn't load their entities.

echo basalt
#

are you messing with region files?

quaint mantle
#

No

echo basalt
#

that was my only guess honestly ¯_(ツ)_/¯

#

because entities aren't contained in region files

#

they have their own folder

quaint mantle
#

How may I load chunk's entities without needing the player to load the chunk?

#

Or, at least how may I know which entities are inside a chunk even though they are not loaded yet

#

Just by sticking with Bukkit && Spigot API

echo basalt
#

that last message really made me unhappy

#

You can explore unloaded entities by going through nbt

#

I guess you can use a plugin like nbtapi

#

^ that's on the entities folder

#

files are labelled r.<x>.<z>.mca

#

where the x and z determine a 512x512 area

#

r.0.0 will be 0,0 -> 512, 512

#

r.1.0 will be 512,0 -> 1024,512

#

type thing

#

So there's that

#

You won't have a spigot native entity because it isn't loaded

#

but you'll have all its data

#

including all the positioning stuff

quaint mantle
#

In case anybody needs it

echo basalt
#

🤦 fuck me

#

I've been getting too used to NMS

quaint mantle
#

I hate NMS

echo basalt
#

nms is gangsta stuff

#

how else would I know the exact behavior of what happens when you eat chorus fruit

quaint mantle
#

From what I understood, NMS equals extra time since you will need to use an interface and implement it through each version that breaks.

echo basalt
#

or you can just refuse to support older stuff

#

if you're working on a project that's only meant to run under specific conditions

#

it unlocks a lot

#

There's only so much spigot can do

#

Past a certain blurry line, extra stuff relies on nms

#

Bukkit's design is against exposing implementation details like mob behavior and NBT, for example

quaint mantle
#

I know. The only thing I find attractive about NMS are those faster methods of placing blocks (even if they don't update lightning). Other than that I'm happy writing around a bubble that's also written around another bubble lol

echo basalt
#

NMS isn't just fast block placement

#

It allows you to mess with entities in a deeper level

#

And lots of other internals

#

Want to know how much saturation an item type in specific provides? nms has that

quaint mantle
#

ik

#

Pathfinding and such

echo basalt
#

Or register a custom entity? Maybe make a skeleton fly up like a chicken?

#

sike chickens don't fly up

#

You can also mess with mob collisions

#

so they consider a specific block or region as a wall

#

these are all very specific things that spigot wasn't made for

#

because no server just decided "ayo this air block? well I don't care what you see, this zombie should treat it as a fence"

#

it doesn't make logical sense

#

but then there are mfs like me

#

that decide to make fake blocks

#

and expect entities to collide with them

split agate
#

Hey just wondering if anyone has a good resource for very lightweight floating text (or hologram) creation and deletion without using any external libraries. In my plugin I will be creating and deleting many of these every few seconds so just wondering if anyone knows of a good way to do this that uses a little of resources as possible :) Thanks!

lost matrix
split agate
lost matrix
split agate
lost matrix
# split agate no only 1.19

Then using nms:
Creation:

  1. Create nms ArmorStand instance (but dont spawn it)
  2. Change metadata of ArmorStand (visible text, invisible body, marker etc)
  3. Send spawn packet for this ArmorStand to all players
  4. Send metadata packet for ArmorStand to all players (using its datawatcher)

Deletion:

  1. Send destroy packet with the entity id of the ArmorStand to all players
split agate
#

I haven't done too much with nms so this was very useful.

carmine nacelle
#

@echo basalt

Caused by: java.lang.IllegalStateException: Registry is already frozen
        at net.minecraft.core.RegistryMaterials.e(SourceFile:365) ~[spigot-1.19.1-R0.1-SNAPSHOT.jar:3558-Spigot-2183145-401f1ad]
        at net.minecraft.world.entity.EntityTypes.<init>(EntityTypes.java:309) ~[spigot-1.19.1-R0.1-SNAPSHOT.jar:3558-Spigot-2183145-401f1ad]
        at net.minecraft.world.entity.EntityTypes$Builder.a(EntityTypes.java:668) ~[spigot-1.19.1-R0.1-SNAPSHOT.jar:3558-Spigot-2183145-401f1ad]
        at com.squallz.cadiabees.utilities.CustomEntityRegistry.registerCustomBee(CustomEntityRegistry.java:15) ~[?:?]
public class CustomEntityRegistry {

    public static EntityType<Bee> CUSTOM_BEE_TYPE = registerCustomBee("custom_bee", EntityType.Builder.of(CustomBee::new, MobCategory.MISC).sized(0.5f, 0.5f));

    public static <T extends Entity> EntityType registerCustomBee(String id, EntityType.Builder type) {
        return (EntityType) Registry.register(Registry.ENTITY_TYPE, id, (EntityType<T>) type.build(id));
    }
}
echo basalt
#

uh

glossy scroll
#

Registry is already frozen

carmine nacelle
#

Yes

glossy scroll
#

the registry is frozen.

#

you cannot unfreeze it.

echo basalt
#

of course nms does this stupid shit

glossy scroll
#

its ... not stupid?

#

well it kinda is

vocal cloud
#

Hey I called it

carmine nacelle
#

called what

vocal cloud
#

That the reg would be frozen

carmine nacelle
#

What does that even mean

echo basalt
#

cant we just

vocal cloud
#

Means that the registry phase is complete. You can't register anything

echo basalt
#

unfreeze it

glossy scroll
#

you should not unfreeze it

echo basalt
#

should

vocal cloud
#

Yes, but that's probably not a great idea KEKLEO

glossy scroll
#

definitely do not unfreeze it

echo basalt
#

unfreeze it, refreeze it

#

and fuck up everything :)

glossy scroll
#

just make your own entity type class

#

its not hard to do

echo basalt
#

he did

#

but you cant register it

#

I mean

#

yeah

#

imagine if freezing the registry turned everything into an immutable collection

carmine nacelle
#

soooo... where should I unfreeze it...

echo basalt
#

before registering it

#

you gotta use reflections

carmine nacelle
#

ugh

echo basalt
#

let's hope it dont crashy everything

vocal cloud
#

Sadly an easy fix to his issue is just to remove the UUID wipe from the beehive entity

carmine nacelle
#

I know nothing about reflection other than its a mirror image of an object in front of it.

vocal cloud
#

But that requires a custom spigot version or making your own beehive entity

glossy scroll
#

here

#

a watered down version of an "EntityType" pattern i made

#

I have an entity called IronBee

#

but i am begging

peak depot
#

why wont a skull update to its owner?

glossy scroll
#

please do not mess with the registry

#

its a terrible idea lol

buoyant viper
carmine nacelle
#

How is that different from what I have already

peak depot
buoyant viper
#

hmm

peak depot
#

i tried updating it instantly I tried updating the inv 1 sec later idk what to do

cinder thistle
#

so good yet so annoying

glossy scroll
#

look at your code

#

look at my code

#

your code tries to register with the nms registry

echo basalt
#

he uses the builder

glossy scroll
#

my code has its own little lightweight registry

echo basalt
#

so he makes a type regardless

#

maybe you don't have to register'

vocal cloud
#

I mean when the server restarts is the type kept? I've seen a lot of people complaining it isn't

glossy scroll
#

my code also doesnt use the builder pattern, i didnt need to use it myself

carmine nacelle
#

If I dont have to register than it shouldve been working before

glossy scroll
#

what was before?

#

you dont need to register custom entities to the registry

#

because also, if the client detects an entitytype that is not part of the client registry,

carmine nacelle
#

heh

glossy scroll
#

it will disconnect them

carmine nacelle
#

The issue was that the bee was no longer a CustomBee once it exited the hive

#

and it lost its pdc and nbt data.

vocal cloud
#

You need to create a custom hive entity.

#

That'd allow you to fix it

#

Why not make a fake beehive where you can store the bee how you want it

echo basalt
#

we should all gets jobs at mojang and just fix it ourselves

vocal cloud
#

Indeed. Add a native modding API

glossy scroll
#
    public static @Nullable Entity loadEntityRecursive(CompoundTag nbttagcompound, Level world, Function<Entity, Entity> function) {
        return (Entity)loadStaticEntity(nbttagcompound, world).map(function).map((entity) -> {
            if (nbttagcompound.contains("Passengers", 9)) {
                ListTag nbttaglist = nbttagcompound.getList("Passengers", 10);

                for(int i = 0; i < nbttaglist.size(); ++i) {
                    Entity entity1 = loadEntityRecursive(nbttaglist.getCompound(i), world, function);
                    if (entity1 != null) {
                        entity1.startRiding(entity, true);
                    }
                }
            }

            return entity;
        }).orElse((Object)null);
    }```
#
    private static Optional<Entity> loadStaticEntity(CompoundTag nbttagcompound, Level world) {
        try {
            return create(nbttagcompound, world);
        } catch (RuntimeException var3) {
            LOGGER.warn("Exception loading entity: ", var3);
            return Optional.empty();
        }
    }```
#
    public static Optional<Entity> create(CompoundTag nbttagcompound, Level world) {
        return Util.ifElse(by(nbttagcompound).map((entitytypes) -> {
            return entitytypes.create(world);
        }), (entity) -> {
            entity.load(nbttagcompound);
        }, () -> {
            LOGGER.warn("Skipping Entity with id {}", nbttagcompound.getString("id"));
        });
    }```
#

as you can see

#

you owuld need to override the hive loading stuff

carmine nacelle
#

Is that possible

glossy scroll
#

im unsure

vocal cloud
#

That's what I was saying.

#

You need to make your own custom beehive

carmine nacelle
#

Is it possible though

#

and how

echo basalt
#

that's the yiffy part

carmine nacelle
#

YIFF??

echo basalt
#

no

#

no

#

no

carmine nacelle
#

LMAO

echo basalt
#

I mean

#

mojang dev that made that probably

carmine nacelle
#

bro ive changed my code like 40 times im tired mentally 😭

vocal cloud
#

Furry confirmed

echo basalt
#

reminds me of when I tried getting island loading on my skyblock core

#

chunks werent being sent

vocal cloud
#

You dug this grave now you must lay in it

glossy scroll
sterile token
#

How would you design a class command framework using method with annotations?
I need ideas

carmine nacelle
#

This shouldnt be this god damn difficult

#

jesus

vocal cloud
#

Well you wanted to make custom entities

#

You deal with it

carmine nacelle
#

this is a situation where u quite literally will only have with bees

vocal cloud
#

Like I said. You either do custom beehive behavior or figure out if you can make s custom beehive entity

carmine nacelle
#

well the hive is a block though not an entity

vocal cloud
#

It's an entity. It's called a block entity

echo basalt
#

tile entity

vocal cloud
#

I'm not at my PC but I showed you the class in the video I sent

vocal cloud
carmine nacelle
#

Yeah but how do you override the core one

vocal cloud
#

No clue if you can

carmine nacelle
#

And how would I tell the game that the beehive I just place would be my custom one?

echo basalt
#

ofc there's a fucking registry for beehives as well

#

I mean it's the block registry

#

but what if

#

we override the registry value

#

without adding a new value

#

and we toss in an extension of BeehiveBlock

#

that just has a tiny change

carmine nacelle
#

Anyone involved in helping me find a solution gets $10 pp

#

it aint much but

echo basalt
#

ends up to about 30 cents / hour ^

vocal cloud
#

Yeah, I think the best course of action is to pretend to have the bee enter the hive and instead make it enter some database so it can be stored properly

carmine nacelle
#

Like a sql thing?

vocal cloud
#

Sure

glossy scroll
#

or listen for when the bee leaves the hive

#

and just overwrite that bee

sterile token
#

hive?

vocal cloud
#

Bee has already lost the info required to track it by then

glossy scroll
#

it should be saving PDC

echo basalt
#

honestly

#

custom tile entity seems a bit simpler than I expected

carmine nacelle
#

It doesnt save pdc

#

if it did this would've been done a week ago

glossy scroll
#

sounds like a bug then

#

because it definitely sohuld be saving pdc

vocal cloud
#

It does if it's not a custom entity

echo basalt
#

I already have enough experience modifying stuff and injecting it

carmine nacelle
#

And I need it to be an NMS entity to control behaviors

glossy scroll
vocal cloud
#

Dude try it

carmine nacelle
#

its a CustomBee

#

not a normal entity

glossy scroll
#

in Entity

carmine nacelle
#

weve both tried this.

vocal cloud
#

Don't wdym me I tested it

glossy scroll
#

does CustomBee extend Entity though?

vocal cloud
#

Test it yourself

glossy scroll
#

it aint my project lmfao

#

im looking at the code

#

it says it should be saving

#

if you guys say "it dont work" without actually trying to solve the problem

carmine nacelle
#

My guy

#

we've been working on this for days

#

multiple of us have tested just about everything

vocal cloud
#

I've tested it myself. It doesn't save

glossy scroll
#

ok but look at the code

#

lets do this together

vocal cloud
#

Dude you can look at all the code you want

glossy scroll
#
    public void addOccupantWithPresetTicks(Entity entity, boolean flag, int i) {
        if (this.stored.size() < this.maxBees) {
            if (this.level != null) {
                EntityEnterBlockEvent event = new EntityEnterBlockEvent(entity.getBukkitEntity(), CraftBlock.at(this.level, this.getBlockPos()));
                Bukkit.getPluginManager().callEvent(event);
                if (event.isCancelled()) {
                    if (entity instanceof Bee) {
                        ((Bee)entity).setStayOutOfHiveCountdown(400);
                    }

                    return;
                }
            }

            entity.stopRiding();
            entity.ejectPassengers();
            CompoundTag nbttagcompound = new CompoundTag();
            entity.save(nbttagcompound);
            this.storeBee(nbttagcompound, i, flag);
            if (this.level != null) {
                if (entity instanceof Bee) {
                    Bee entitybee = (Bee)entity;
                    if (entitybee.hasSavedFlowerPos() && (!this.hasSavedFlowerPos() || this.level.random.nextBoolean())) {
                        this.savedFlowerPos = entitybee.getSavedFlowerPos();
                    }
                }

                BlockPos blockposition = this.getBlockPos();
                this.level.playSound((Player)null, (double)blockposition.getX(), (double)blockposition.getY(), (double)blockposition.getZ(), SoundEvents.BEEHIVE_ENTER, SoundSource.BLOCKS, 1.0F, 1.0F);
                this.level.gameEvent(GameEvent.BLOCK_CHANGE, blockposition, Context.of(entity, this.getBlockState()));
            }

            entity.discard();
            super.setChanged();
        }

    }```
vocal cloud
#

It doesn't work

glossy scroll
#

do we agree that it calls entity.save?

vocal cloud
#

Shut up

carmine nacelle
#

Lmao

vocal cloud
#

You're useless

carmine nacelle
#

this guy..

glossy scroll
#

have you actually looked at the nbt of the block entity?

vocal cloud
#

Yes

#

I did more than that

glossy scroll
#

we can try to diagnose if its not saving or if its not loading

vocal cloud
#

I looked at the bees info too

glossy scroll
#

you guys dont understand what im saying

#

if its not working

#

its a bug with spigot

echo basalt
#

it's an nms thing

glossy scroll
#

and we need to account for it

echo basalt
#

not even spigot

vocal cloud
#

It's saving. It's not loading

echo basalt
#

I found a hacky way to get custom tiles working

vocal cloud
#

I logged the custom entity

#

It saved but never called the load

glossy scroll
#

oh ok

carmine nacelle
#

It respawns as a Bee not CustomBee

glossy scroll
carmine nacelle
#

and theres no way to know what it is

glossy scroll
#

it creates the bee from the EntityType

#

not the class or whatever

#

im saying the PDC should be saving/loading

#

thats my point

#

entity losing its original class is perfectly normal (intended) behavior

vocal cloud
#

Yes but it doesn't. Feel free to try

carmine nacelle
#

Actually recreate my situation to see if the solution works

#

Cause no disrespect, ive tried tons of different things and nothing works

#

and... I dont really wanna mess with more getting my hopes up over and over to be disappointed

glossy scroll
#

you guys dont understand im encouraging you guys to open a bug report

#

if the pdc isnt saving/loading

#

thats a big problem

vocal cloud
#

It works on vanilla bees so that's the confusing part

glossy scroll
#

pdc?

glossy scroll
#

can i see your CustomBee getBukkitEntity @carmine nacelle ?

carmine nacelle
#

I gotta revert to my previous code stuff

vocal cloud
glossy scroll
#

Ok great, so now we can start diagnosing why it doesnt work on custom bees

humble rock
#

Is there an event for when an item is added to the player's inventory? I've searched the docs and couldn't manage to see anything? :) thanks!

glossy scroll
#

looking at the code, theres no magical class checks or anything

#

its literally just calling methods from the Entity type

echo basalt
#

this is hacky as shit

#

grr

echo basalt
#

from the registry

#

that we can't modify

glossy scroll
#

yes i said this

humble rock
glossy scroll
#

cannot detect

#

you should use abstraction/interface for htat

carmine nacelle
#

behold, custombee

humble rock
#

Damn, would've though there was an event for that.

glossy scroll
#

never listen to your own events!

sterile token
#

Command framework help

echo basalt
#

holy fuck I never thought injecting into the registry would be this janky

#

there are like 15 fields

#

I gotta modify all of them

vocal cloud
#

Wait that's not the custom bee I remember

carmine nacelle
#

its the original

#

It might slightly vary from last nights cause ive changed it a lot..

humble rock
vocal cloud
#

Oh well that's not going to work properly cause you screw the saving

glossy scroll
echo basalt
#

he calls super

glossy scroll
#

someone else may help

echo basalt
#

?learnjava

undone axleBOT
glossy scroll
carmine nacelle
#

Yes.

#

It enters the hive and has the value

#

exits and doesnt.

glossy scroll
#

which value

vocal cloud
#

Any value you apply to the PDC is removed

carmine nacelle
#
    public void setBeeUUID(Entity bee, UUID uuid) {
        NamespacedKey beeUUIDKey = new NamespacedKey(cadiaBees, "bee-uuid");
        bee.getPersistentDataContainer().set(beeUUIDKey, PersistentDataType.STRING, uuid.toString());
    }

    public UUID getBeeUUID(Entity bee) {
        NamespacedKey beeUUIDKey = new NamespacedKey(cadiaBees, "bee-uuid");

        if(bee.getPersistentDataContainer().has(beeUUIDKey, PersistentDataType.STRING)) {
            return UUID.fromString(Objects.requireNonNull(bee.getPersistentDataContainer().get(beeUUIDKey, PersistentDataType.STRING)));
        }

        return null;
    }
glossy scroll
#

alright, and how do we use these two methods?

#

im seeing no indication as to why the PDC should not be loading unless im missing something obvious

carmine nacelle
#
    @EventHandler
    public void hit (EntityDamageByEntityEvent event) {
        if(event.getDamager() instanceof Player) {
            if(event.getEntity() instanceof Bee) {
                pdcManager.setBeeUUID(event.getEntity(), event.getEntity().getUniqueId());
                Bukkit.broadcastMessage("PDC SET");
            }
        }
    }
    @EventHandler
    public void beeExitHive(CreatureSpawnEvent event) {
        if(event.getSpawnReason().equals(CreatureSpawnEvent.SpawnReason.BEEHIVE)) {
            if(event.getEntity() instanceof Bee) {
                Bukkit.broadcastMessage(pdcManager.getBeeUUID(event.getEntity()).toString());
            }
        }
#

Nothing outputs

desert frigate
#

how can i get a list of all the armor stands inside of a world?

glossy scroll
#

and debug that compound

#

see if the entity's are saving with BukkitValues

glossy scroll
#

BeehiveBlockEntity is a nms class

carmine nacelle
#

yes but where am I calling that at

glossy scroll
#

EntityEnterBlockEvent

#

with like a couple ticks delay

carmine nacelle
#

hmmmmm....

#

heh

#

I tried Beehive block and blockdata, savewithoutmetadata isnt an option

vocal cloud
#

It's different in mapped?

carmine nacelle
#

Nvm im dumb

#

@glossy scroll How can I cast the block to BleehiveBlockEntity?

#

Tried normal, data and state

glossy scroll
#

Uhh i believe theres a GetBlockEntity in nms block

carmine nacelle
#

eww....

#

Got the import for nms block?

glossy scroll
#

Uhh

#

Not at pc give me a bit

#

Try to index for the Beehive block in nms

carmine nacelle
#

I assume you mean search for..

glossy scroll
#

@carmine nacelle

carmine nacelle
#

yes?

glossy scroll
#

Level#getBlockEntity

#

use that to get block entity

bitter bone
#

How would I be able to make it so that when its on top of the gold block it clears rn it works but I have to throw 2 blocks in order for it to clear

for (Entity ent : e.getEntity().getNearbyEntities(3, 3, 3)) {
            if (ent instanceof Item){
                Item i = (Item) ent;
                if (i.getItemStack().getType() == Material.SAND){
                    if (i.getLocation().getBlock().getRelative(0, -1,0).getType() == Material.GOLD_BLOCK)
                        ent.remove();```
carmine nacelle
#

@glossy scroll

            new BukkitRunnable() {
                @Override
                public void run() {
                    CraftBlock craftBlock = (CraftBlock) ((CraftBlock) block).getHandle();
                    BeehiveBlockEntity beehiveBlockEntity = (BeehiveBlockEntity) (((CraftWorld) block.getWorld()).getHandle().getBlockEntity(craftBlock.getPosition()));
                    beehiveBlockEntity.saveWithoutMetadata();
                }
            }.runTaskLater(cadiaBees, 20);
#

class cast exception

glossy scroll
#

u sure its a beehive

carmine nacelle
#
  @EventHandler
    public void beeEnterHive(EntityEnterBlockEvent event) {
        if (event.getEntity() instanceof Bee beeEnteredHive) {
            if (!event.getBlock().getType().equals(Material.BEEHIVE)) {
                return;
            }

            if(pdcManager.getBeeUUID(beeEnteredHive) == null) return;
            Bukkit.broadcastMessage("Enter: " + pdcManager.getBeeUUID(beeEnteredHive).toString());

            if(!(beeEnteredHive.hasNectar())) return;

            Block block = event.getBlock();

            new BukkitRunnable() {
                @Override
                public void run() {
                    CraftBlock craftBlock = (CraftBlock) ((CraftBlock) block).getHandle();
                    BeehiveBlockEntity beehiveBlockEntity = (BeehiveBlockEntity) (((CraftWorld) block.getWorld()).getHandle().getBlockEntity(craftBlock.getPosition()));
                    beehiveBlockEntity.saveWithoutMetadata();
                }
            }.runTaskLater(cadiaBees, 20);

            CustomHive customHive = hiveManager.getCustomHiveForBlock(block.getLocation());
            if(customHive == null) return;

            //Stop foreign bees from entering the hive
            if(!(customHive.getBeeUUIDs().contains(pdcManager.getBeeUUID(beeEnteredHive))) || customHive.isBeeBeingRenamed()) {
                event.setCancelled(true);
                return;
            }

            hiveManager.addRandomReward(customHive);

            if(customHive.getHoneyAmt() < customHive.getHiveLevel().getMaxHoney()) {
                hiveManager.setHoneyLevel(customHive, customHive.getHoneyAmt() + 1);
            } else {
                hiveManager.setHoneyLevel(customHive, customHive.getHiveLevel().getMaxHoney());
            }
        }
    }
#

yea

glossy scroll
#

what is it trying to cast from

carmine nacelle
#

wdym

#

oh also

#

the bees no longer respawn

glossy scroll
#

if youre getting a class cast exception

carmine nacelle
#

lmao

#
Caused by: java.lang.NullPointerException: Cannot invoke "java.util.UUID.toString()" because the return value of "com.squallz.cadiabees.managers.PDCManager.getBeeUUID(org.bukkit.entity.Entity)" is null
        at com.squallz.cadiabees.listeners.BeeEnterHiveListener.beeExitHive(BeeEnterHiveListener.java:91) ~[?:?]
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?]
        at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
        at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?]
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:306) ~[spigot-api-1.19.1-R0.1-SNAPSHOT.jar:?]
        ... 21 more
[21:43:16] [Server thread/INFO]: Squallz issued server command: /time noon
glossy scroll
#

oh

#

wait what

#

oh

#

nvm

#

whats the class cast exception

carmine nacelle
#

oh oops

#
[21:38:59] [Server thread/WARN]: [CadiaBees] Task #8954 for CadiaBees v${project.version} generated an exception
java.lang.ClassCastException: class net.minecraft.server.level.WorldServer cannot be cast to class org.bukkit.craftbukkit.v1_19_R1.block.CraftBlock (net.minecraft.server.level.WorldServer and org.bukkit.craftbukkit.v1_19_R1.block.CraftBlock are in unnamed module of loader java.net.URLClassLoader @18769467)
glossy scroll
#

..

#

admittedly

carmine nacelle
#

what am I just stupid or

glossy scroll
#

it is a poorly named method

#

(CraftBlock) ((CraftBlock) block).getHandle();

carmine nacelle
#

I am quite literally not having a good time rn bro

glossy scroll
#

do you see whats happening here lol

carmine nacelle
#

it forced me to

glossy scroll
#

you just need this lmao

#

(CraftBlock) block

carmine nacelle
#

I dont need to get handle???

glossy scroll
#

nooo?

#

do you even realize what type getHandle is returning?

carmine nacelle
#

i thought everything nms needed handle

glossy scroll
#

CraftBukkit is not nms

#

CraftBlock implements Block

carmine nacelle
#

alright well its still losing its pdc

glossy scroll
#

what does the hive tag look like?

#

right now we're just debugging

#

we want to see what beehiveBlockEntity.saveWithoutMetadata(); this looks like

carmine nacelle
#

get its nbt tags?

glossy scroll
#

just beehiveBlockEntity.saveWithoutMetadata().toString();

carmine nacelle
#
[21:54:16] [Server thread/INFO]: {Bees:[{EntityData:{AbsorptionAmount:0.0f,Age:0,AgeLocked:0b,AngerTime:0,Attributes:[{Base:0.30000001192092896d,Name:"minecraft:generic.movement_speed"},{Base:10.0d,Name:"minecraft:generic.max_health"}],Bukkit.Aware:1b,Bukkit.updateLevel:2,CustomName:'{"extra":[{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"color":"#6A06FB","text":"B"},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"color":"#8C21FC","text":"e"},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"color":"#AE3BFD","text":"e"}],"text":""}',CustomNameVisible:1b,FlowerPos:{X:35,Y:-60,Z:-43},ForcedAge:0,Glowing:1b,HasNectar:1b,HasStung:0b,Health:8.0f,InLove:0,Invulnerable:0b,PersistenceRequired:0b,Spigot.ticksLived:464,WorldUUIDLeast:-5526025201707824336L,WorldUUIDMost:4772959422628644230L,bee-uuid:"abbffd3d-9076-4d14-a677-ed40f51cb45b",id:"minecraft:bee"},MinOccupationTicks:2400,TicksInHive:20}],Bukkit.MaxEntities:1,FlowerPos:{X:35,Y:-60,Z:-43}}
>

@glossy scroll

glossy scroll
#

this bee is supposed to have pdc, correct?

carmine nacelle
#

right

#

oh wait

#

yeah

#
    @EventHandler
    public void beeExitHive(CreatureSpawnEvent event) {
        if(event.getSpawnReason().equals(CreatureSpawnEvent.SpawnReason.BEEHIVE)) {
            if(event.getEntity() instanceof Bee) {
                if(pdcManager.getBeeUUID(event.getEntity()) != null) {
                    Bukkit.broadcastMessage(pdcManager.getBeeUUID(event.getEntity()).toString());
                } else {
                    Bukkit.broadcastMessage("PDC lost");
                }
            }
        }
#

im getting "PDC Lost"

glossy scroll
#

but you know the bee has PDC when it enters, correct?

carmine nacelle
#

Line 1 is when it spawns

#

enter is when it enters

#

This is a bee that I spawned with an egg and punched (to set pdc)

[21:59:04] [Server thread/INFO]: {Bees:[{EntityData:{AbsorptionAmount:0.0f,Age:0,AgeLocked:0b,AngerTime:0,Attributes:[{Base:0.30000001192092896d,Name:"minecraft:generic.movement_speed"},{Base:48.0d,Modifiers:[{Amount:0.03241293552296432d,Name:"Random spawn bonus",Operation:1,UUID:[I;-757729959,698370476,-1259616670,993993660]}],Name:"minecraft:generic.follow_range"},{Base:10.0d,Name:"minecraft:generic.max_health"}],Bukkit.Aware:1b,Bukkit.updateLevel:2,BukkitValues:{"cadiabees:bee-uuid":"58a3a467-b43e-48ea-9fac-142c0eb483af"},FlowerPos:{X:40,Y:-60,Z:-44},ForcedAge:0,HasNectar:1b,HasStung:0b,Health:9.0f,InLove:0,Invulnerable:0b,PersistenceRequired:0b,Spigot.ticksLived:536,WorldUUIDLeast:-5526025201707824336L,WorldUUIDMost:4772959422628644230L,id:"minecraft:bee"},MinOccupationTicks:2400,TicksInHive:20}],Bukkit.MaxEntities:3,FlowerPos:{X:40,Y:-60,Z:-44}}
#

waiting for it to exit now.

quaint mantle
glossy scroll
#

events are for API calls

#

if you need to access something from an event call, just register the handler you need and call the method from the haandler

#

a handler is usually an interface or abstract class

carmine nacelle
#

Thats with a bee spawned from an egg.

#

the pdc retains..

glossy scroll
#

very interesting

carmine nacelle
#

I already knew this so its not new news but

glossy scroll
#

whats the nbt on that?

#

like when it enters the hive

#

also, remind me of the class CustomBee?

#

can i see it again

carmine nacelle
#
[22:04:19] [Server thread/INFO]: Enter: b9b6af67-d566-4fe8-bbbc-0c257238abc8
[22:04:20] [Server thread/INFO]: {Bees:[{EntityData:{AbsorptionAmount:0.0f,Age:0,AgeLocked:0b,AngerTime:0,Attributes:[{Base:0.30000001192092896d,Name:"minecraft:generic.movement_speed"},{Base:48.0d,Modifiers:[{Amount:0.07126595799254398d,Name:"Random spawn bonus",Operation:1,UUID:[I;1048387077,1887388698,-1817519598,-1423524498]}],Name:"minecraft:generic.follow_range"},{Base:10.0d,Name:"minecraft:generic.max_health"}],Bukkit.Aware:1b,Bukkit.updateLevel:2,BukkitValues:{"cadiabees:bee-uuid":"b9b6af67-d566-4fe8-bbbc-0c257238abc8"},FlowerPos:{X:40,Y:-60,Z:-44},ForcedAge:0,HasNectar:1b,HasStung:0b,Health:9.0f,InLove:0,Invulnerable:0b,PersistenceRequired:0b,Spigot.ticksLived:578,WorldUUIDLeast:-5526025201707824336L,WorldUUIDMost:4772959422628644230L,id:"minecraft:bee"},MinOccupationTicks:2400,TicksInHive:20}],Bukkit.MaxEntities:3,FlowerPos:{X:40,Y:-60,Z:-44}}
>
#

this is with the pdc one

#

Thats the one from the hive

#

this is the bee itself:

[22:04:19] [Server thread/INFO]: {AbsorptionAmount:0.0f,Age:0,AgeLocked:0b,Air:300s,AngerTime:0,ArmorDropChances:[0.085f,0.085f,0.085f,0.085f],ArmorItems:[{},{},{},{}],Attributes:[{Base:0.30000001192092896d,Name:"minecraft:generic.movement_speed"},{Base:48.0d,Modifiers:[{Amount:0.07126595799254398d,Name:"Random spawn bonus",Operation:1,UUID:[I;1048387077,1887388698,-1817519598,-1423524498]}],Name:"minecraft:generic.follow_range"},{Base:10.0d,Name:"minecraft:generic.max_health"}],Brain:{memories:{}},Bukkit.Aware:1b,Bukkit.updateLevel:2,BukkitValues:{"cadiabees:bee-uuid":"b9b6af67-d566-4fe8-bbbc-0c257238abc8"},CanPickUpLoot:0b,CannotEnterHiveTicks:0,CropsGrownSincePollination:0,DeathTime:0s,FallDistance:0.0f,FallFlying:0b,Fire:-1s,FlowerPos:{X:40,Y:-60,Z:-44},ForcedAge:0,HandDropChances:[0.085f,0.085f],HandItems:[{},{}],HasNectar:1b,HasStung:0b,Health:9.0f,HivePos:{X:42,Y:-60,Z:-43},HurtByTimestamp:130,HurtTime:0s,InLove:0,Invulnerable:0b,LeftHanded:0b,Motion:[0.06152207456383818d,0.0d,0.06484870101280597d],NoGravity:1b,OnGround:1b,PersistenceRequired:0b,PortalCooldown:0,Pos:[40.82206768522505d,-60.0d,-43.26206294460952d],Rotation:[318.08978f,0.0f],Spigot.ticksLived:578,TicksSincePollination:0,UUID:[I;-1179209881,-714715160,-1145304027,1916316616],WorldUUIDLeast:-5526025201707824336L,WorldUUIDMost:4772959422628644230L}
#

these are the nbt tags btw.

#
    public static String toNbtString(Entity bukkitEntity) {
        CompoundTag tag = new CompoundTag();
        ((CraftEntity) bukkitEntity).getHandle().saveWithoutId(tag);
        return tag.getAsString();
    }
glossy scroll
#

yes can i see CustomBee.class again

carmine nacelle
#
    public CustomBee(Location location, String beeName, Boolean isBaby) {
        super(EntityType.BEE, ((CraftWorld) location.getWorld()).getHandle());
        this.setCanPickUpLoot(false);
        this.setPos(location.getX(), location.getY(), location.getZ());
        getBukkitEntity().setCustomName(ColorUtil.color(beeName));
        getBukkitEntity().setCustomNameVisible(true);
        getBukkitEntity().setPersistent(true);
        getBukkitEntity().setGlowing(true);
        if(isBaby) {
            getBukkitEntity().setBaby();
        }
    }

    public CustomBee(EntityType entityType, Level level) {
        super(EntityType.BEE, level);
    }

    public String getBeeName() {
        return this.beeName;
    }

    public void setBeeName(String beeName) {
        this.beeName = beeName;
    }

    @Override
    public final CraftBee getBukkitEntity() {
        if (this.bukkitEntity == null) {
            this.bukkitEntity = new CraftBee(this.level.getCraftServer(), this);
        }

        return this.bukkitEntity;
    }

    @Override
    public boolean save(CompoundTag nbt) {
        boolean returnVal = super.save(nbt);

        nbt.putString("bee-uuid", uuid.toString());

        return returnVal;
    }

    @Override
    public void load(CompoundTag nbt) {
        super.load(nbt);

        String beeUUID = nbt.getString("bee-uuid");

        this.originalBeeUUID = UUID.fromString(beeUUID);
    }

    public UUID getOriginalBeeUUID() {
        return this.originalBeeUUID;
    }

    @Override
    public CompoundTag saveWithoutId(CompoundTag nbt) {
        nbt.putString("bee-uuid", uuid.toString());

        CompoundTag tag = super.saveWithoutId(nbt);

        return tag;
    }
#

The ones im spawning atm arent custombees.

#

so they wont have that

#

however the pdc does save for bukkit ones.

glossy scroll
#

yes

#

and you are 1000% certain that a CustomBee's pdc is not empty?

carmine nacelle
#

you mean is empty?

glossy scroll
#

well it shouldnt be empty when you save it right

#

you want the pdc to persist

#

here's another idea

carmine nacelle
#
        ServerLevel world = ((CraftWorld) customHive.getHiveLocation().getWorld()).getHandle();
        CustomBee customBee = new CustomBee(customHive.getHiveLocation(), cadiaBees.colorUtil.color(beeName), isBaby);
        world.tryAddFreshEntityWithPassengers(customBee);

        pdcManager.setBeeUUID(customBee.getBukkitEntity(), customBee.getBukkitEntity().getUniqueId());
        Bukkit.broadcastMessage("UUID set to: " + pdcManager.getBeeUUID(customBee.getBukkitEntity()));
#

This is on spawn

glossy scroll
#

call CraftEntity#storeBukkitValues(new CompoundTag()) and print that tag

#

or rather

#
CompoundTag tag = new CompoundTag();
customBee.getBukkitEntity().storeBukkitValues(tag);
System.out.println(tag);
#

(after you set the pdc)

carmine nacelle
#

👀

glossy scroll
#

ok im starting to feel stumped here

carmine nacelle
#

welcome to the club

#

stupid me getting my hopes up again

glossy scroll
#

well its not saving at all

#

are you overwriting hivePos perchance?

#

i assume not?

carmine nacelle
#

hivepos...?

#

no

#

wait

#

why

glossy scroll
#
    private class BeeEnterHiveGoal extends BaseBeeGoal {
        BeeEnterHiveGoal() {
            super();
        }

        public boolean canBeeUse() {
            if (Bee.this.hasHive() && Bee.this.wantsToEnterHive() && Bee.this.hivePos.closerToCenterThan(Bee.this.position(), 2.0)) {
                BlockEntity tileentity = Bee.this.level.getBlockEntity(Bee.this.hivePos);
                if (tileentity instanceof BeehiveBlockEntity) {
                    BeehiveBlockEntity tileentitybeehive = (BeehiveBlockEntity)tileentity;
                    if (!tileentitybeehive.isFull()) {
                        return true;
                    }

                    Bee.this.hivePos = null;
                }
            }

            return false;
        }

        public boolean canBeeContinueToUse() {
            return false;
        }

        public void start() {
            BlockEntity tileentity = Bee.this.level.getBlockEntity(Bee.this.hivePos);
            if (tileentity instanceof BeehiveBlockEntity tileentitybeehive) {
                tileentitybeehive.addOccupant(Bee.this, Bee.this.hasNectar());
            }

        }
    }```
#

it will addOccupant on the block that is at hivePos

lost matrix
# carmine nacelle hivepos...?

I swear if you continue like that im gonna have a whole zombie survival server with moderation system and everything done before you finish the plugin

carmine nacelle
#

?

glossy scroll
#

@carmine nacelle what is the tag yuo get when you simply call

#

CustomBee#save

#

of course you need to provide a tag

echo basalt
#

I just got a quadruple ad on spotify

#

sitting through it takes less time than digging through all this nms

river oracle
echo basalt
#

custom textures are a pain

#

I had to hire 2 different texture artists to get a 3d model to look nice on the hotbar

river oracle
#

I swear when some people use custom textures they just slap them over the screen so much you can't even tell its minecraft anymore

glossy scroll
#

my artists made this cool model

#

sorry to brag

lost matrix
echo basalt
#

imagine spending 600$ on gun models smh couldn't be me

river oracle
echo basalt
#

tired of working on it honestly

river oracle
echo basalt
#

it has been way too long

glossy scroll
#

its a complicated scenario lmfao

#

i dont know

#

is my first answer

echo basalt
#

client-side zombies, barricades and mystery box renderings worky

lost matrix
echo basalt
#

everything worky

glossy scroll
#

but also

echo basalt
#

but it's such a damn pain

glossy scroll
#

i dont want them to leave me

#

because we all collectively volunteer

river oracle
#

2d guns are funny looking ngl

echo basalt
#

3d item models for guns are ehhh

near kite
echo basalt
#

they're never properly good

#

I mean

lost matrix
lost matrix
#

So 3D yes but still quite simple

echo basalt
#

This is the best gun model I got

#

I think

river oracle
#

that looks nice

echo basalt
#

rest end up looking a bit janky

#

Think I paid 15$ for that?

river oracle
#

you should go back to that guy lol

lost matrix
#

I think this might even be too much

carmine nacelle
#

Ok I wasnt setting the hive but I did now

echo basalt
#

Scopes don't work because they a pain in the ass

carmine nacelle
#

still didnt save tho

echo basalt
#

we also got an ak

river oracle
#

can you actually do that with just spigot lol i feel like you'd need client crap to do this shit

glossy scroll
#

we use a plugin called ModelEngine

echo basalt
glossy scroll
#

perfectly possible

#

ive seen it in game but dont have footage on hand haha

quaint mantle
#

@lost matrix like this?

echo basalt
#

you can't control sway (client does that by itself)

glossy scroll
#

oh but of course, texture pack

echo basalt
#

also the hold-to-zoom feature would be janky because the client only sends 5 right-click packets per second

#

so it would have an input delay of 0-200ms

#

in an ideal world

lost matrix
echo basalt
#

Like

glossy scroll
#

smile would you mind sharing your technology for that hotbar thing haha

echo basalt
#

I already have a gun system coded

quaint mantle
echo basalt
#

integrating scopes is just hell

glossy scroll
#

do you use the actionbar and some custom font?

young knoll
#

The client sends 20 right click packets per second

glossy scroll
#

or wait

#

the armor/health/hunger/xp?

echo basalt
carmine nacelle
#

alright guess im just switching to normal bee entities.

#

this is fucking stupid.

young knoll
#

Last I tried it was firing every 50ms

echo basalt
#

the client only handles right-clicking an item on hand 5 times per second

#

it can send up to 20

#

but holding it only sends 5

young knoll
#

I was holding it

near kite
#

I’m waiting for a gun mod

#

In vr

carmine nacelle
#

Literally the only way to do this at this point is to add the bee's uuid to the hive pdc when entering and on creature spawn, find the closest hive to see if it has a uuid in it

near kite
carmine nacelle
#

that would indicate that the bee was previously custom..

near kite
#

So the first to do it would probably get big after a while

echo basalt
#

one thing I'm thinking on implementing

glossy scroll
echo basalt
#

is maybe the ray tracing should come out of the barrel

carmine nacelle
glossy scroll
#

no like

#

custombee

echo basalt
#

instead of the player's eye view

glossy scroll
#

it should be saving the pdc

#

but its not

#

and that confuses me

young knoll
#

Custom fonts are amazing

carmine nacelle
#

yea

#

welcome to the gang

echo basalt
#

it would be a huge pain in the ass to manually align to each weapon

carmine nacelle
#

gang gang

glossy scroll
#

unless there just code that im not seeing from u lol

#

thats impacting a major thing

young knoll
#

Now I just want proper custom blocks

#

Plz Mojang

carmine nacelle
#

ive sent everything relevant

glossy scroll
#

the fact that bedrock has so much more customization options

#

is criminal

#

java has the capacity 100%

echo basalt
#

We should make a BukkitExtensions plugin/api

carmine nacelle
#

I mean... make one and try it for yourself

quaint mantle
#

custom blocks, custom entities and custom inventories.

#

😂

young knoll
echo basalt
#

that provides better inventory management, custom block breaking speeds and all

glossy scroll
#

i wish we could add custom sounds into texture pack namespaces

#

that would be so nice

echo basalt
#

just ways to modify most things without doing hacky stuff

river oracle
#

I thought you could

young knoll
#

You can add custom sounds

glossy scroll
#

well how would you be able to use play sound?

echo basalt
#

I can do customitem:spas

#

and it plays the spas sound on the customitem folder

young knoll
#

There’s a playNamedSound packet

#

Idk if it has an api method

river oracle
#

packetas

glossy scroll
#

and you can use a sound from a resource pack namespace?

river oracle
#

api uses a enum so you'd need a packet

echo basalt
#

playSound(location, "key:namespace", 1, 1

#

you can

glossy scroll
#

oh

#

this changes the game

river oracle
#

:o

glossy scroll
#

i had no clue

#

i just assumed it was always you had to replace other sounds

echo basalt
#

no

#

you dont

river oracle
#

nah :P

young knoll
#

Problem is sounds get kinda chunky

river oracle
#

I love how much you can do with texture packs its awesome

river oracle
young knoll
#

Compared to images and json files

lost matrix
echo basalt
#

I wrote some code so I can make sound stages

#

type thing

river oracle
young knoll
#

You can have unlimited fonts

river oracle
#

oh I thought you had to override unicode to display custom fonts

glossy scroll
#

we have these little icons

#

we're not too familiar with the font stuff yet

#

are there such thing as like

#

unused unicode characters

#

or do you gotta replace some

young knoll
#

Yes

#

But you can also make entirely custom fonts

echo basalt
#

you can do some fancy stuff if you pair models with namespaced sounds

glossy scroll
#

i mean those characters are used in a font for a resource pack

young knoll
#

I believe u800 to ufff are all unused

lost matrix
echo basalt
glossy scroll
#

they just currently are replacing some other chacters

river oracle
echo basalt
#

sound is incredibly quiet because I use everything on 20% volume

young knoll
#

You don’t have to replace any characters

#

Make a custom font, leave minecraft:default untouched

glossy scroll
#

custom font lke

#

json or ttf or what

young knoll
#

It’s a json file

river oracle
glossy scroll
#

we just kinda took inspo from this

river oracle
#

I know how to do custom fonts I just thought you were required to overwrite unicode

young knoll
#

The thing is using custom fonts in spigot is annoying, since you have to use components and spigot only supports those for a few things

river oracle
#

if you were to use paper that'd be easier though correct

young knoll
#

Mhm

#

Much easier

echo basalt
#

all of this texture stuff makes me want to make some over-the-top api

#

where you toss a .png and splits it into custom models for guis

lost matrix
river oracle
glossy scroll
#

ah yes

echo basalt
#

🤔

glossy scroll
#

and im assuming you have some sort of code registry/enum or something

river oracle
#

dynamic image rendering fully completed

glossy scroll
#

to allow easy access?

echo basalt
#

wait you mean like

#

you assigned each pixel combination a custom model id?

#

then assigned each slot a combination

river oracle
#

it was too laggy because of my approach but I'm planning to redo it

echo basalt
#

I mean

#

you can make a tool that makes a combination and assigns into each model id

glossy scroll
#

i just like this little bee we made too

echo basalt
#

and then wait 15 hours for the client to load a 6tb resource pack

young knoll
#

It’s pretty cool how much we can customize on java these days

young knoll
#

Just missing the ability to add custom blocks with non-standard shapes easily

lost matrix
river oracle
echo basalt
#

huh

echo basalt
#

there's probably a limit for custom model ids

#

could be int max limit

young knoll
#

999999

#

Per item

glossy scroll
echo basalt
#

that's enough

glossy scroll
#

so we dont need to worry about saving and stuff lol

echo basalt
#

what if

#

we made such a system to render any image in any gui

#

because we cache all pixels

#

we make 1 resource pack and reuse it across all guis

#

and waste 3 tons of disk space and upload bandwidth

lost matrix
carmine nacelle
#

HOW.

glossy scroll
#

yea for some reason we cant figure out why his bees dont save PDC to compounds

young knoll
#

I never got custom mobs to persist after restarts

glossy scroll
#

its really quite strange

echo basalt
#

beehives do this clown thing

young knoll
#

Granted last time I tried was back in like, 1.16

echo basalt
#

where they don't save nbt data of the belonging bees

#

👍

#

I mean they do and don't

#

its weird

lost matrix
#

In 1.19 its quite simply. You just need to write one line in your onLoad

carmine nacelle
#

they do if its a normal bee

#

they dont if its an nms bee.

young knoll
#

Very cool

#

Now I just need to make my own Model Engine :p

echo basalt
#

I looked into making my own armorstand animation plugin type thing

river oracle
#

Great now everyone in here is gonna make a super over the top api

echo basalt
#

then remembered I failed trig

river oracle
#

I'm good at triangles I suck at circles

echo basalt
#

then I looked into quaternions for 16 hours straight and came out dumber

young knoll
#

The one Origin Realms uses is really nice

echo basalt
#

I'm good at circles but triangles fucked my grade

river oracle
lost matrix
echo basalt
#

I learned trig in 6th grade because I wanted to make some custom mob abilities

#

like a spinning thunder circle

young knoll
#

Indeed they do

echo basalt
#

I learned trig with unit circles

#

and the triangle logic just confuses me

young knoll
#

The animations on their mobs are very impressive

echo basalt
#

one of their devs is kennytv

#

guy leads viaversion

#

and codes plugins for mrbeast gaming

#

he's no rookie

river oracle
echo basalt
#

jokes on you I don't play minecraft casually

#

I boot up the game, test code for 3 hours straight and close the game

river oracle
#

I do thats why everything I've released on spigot is easily 10/10

echo basalt
#

👍 you got 0 released plugins

river oracle
#

can't be bad if there are none

echo basalt
#

funny thing now that I look at some profiles

#

half of the active / knowledgeable people here are nearing their 30's

#

the other half are high school students

glossy scroll
#

i am neither of those

lost matrix
echo basalt
#

mfnalex

young knoll
#

Boomers amirite

echo basalt
#

he's like a year younger than you

#

at the same time I've had a 50yo man commission me before

#

for some glow api plugin

lost matrix
#

ElgarL is our gateway to the boomer world

echo basalt
#

guy talks about tech like he's 60

carmine nacelle
#

Welp, time to do some of the jankiest shit of my spigot career.

echo basalt
#

"back in '98 I fixed the internet with this cobol code"

glossy scroll
#

im just in college studying Materials Science

young knoll
#

Better than the material enum

glossy scroll
#

you are right

echo basalt
#

Better than CraftEntity#getEntity

glossy scroll
#

people ask why im not in csci all the time 😅

echo basalt
#

oh hell naw

#

I'm in a weird school thing

#

it's like high school but gives lower-tier degrees

#

I picked a 3 year programming course

#

biggest mistake of my life

#

got put in a class with 27 hentai addict guys

#

and 1 hentai addict girl

young knoll
#

With Mojmap NMS just feels normal now

echo basalt
#

nms is gangsta

#

idk why people are scared of it

lost matrix
glossy scroll
#

specifically thin-film oled technology

echo basalt
#

I hate physics & chem in general

#

but I can watch nilered videos for hours

#

maybe I just had really shitty teachers

#

Physics & chem are 1 single class here

lost matrix
echo basalt
#

first 3 years we were "causing hazards" at the back of the class

#

nearly got the cops called on me

#

school thought I was making bombs

#

so yeah I never caught on

glossy scroll
young knoll
#

If you make a bomb in science class do you get an A and get arrested?

echo basalt
glossy scroll
#

i accidentally spawned chlorine gas in my chem lab 💀

#

i did end up getting an A

lost matrix
echo basalt
#

I failed physics & chem in general

glossy scroll
#

...unrelated

echo basalt
#

kids were blowing up fire extinguishers

#

having fist fights

young knoll
#

Spawned?

echo basalt
#

throwing backpacks out of the 2nd floor

#

and by kids I mean me and the boys ofc

young knoll
#

Were you playing around with the summon command in real life

glossy scroll
#

yes

echo basalt
#

came to the tests

glossy scroll
#

you know i also teach kids how to play minecraft

echo basalt
#

dudes were grabbing my test from my desk

lost matrix
#

/deop Martoph

echo basalt
#

while I was writing

glossy scroll
#

its my teaching job

echo basalt
#

copying BS answers

glossy scroll
#

teaching how to play mc

echo basalt
#

legit

glossy scroll
#

its funny because kids dont know how to use a mouse 😭

echo basalt
#

teaching about pvp and all

#

with a quiz system

#

bootleg kahoot

glossy scroll
echo basalt
#

where teachers can make their own courses within the server

#

and students can import those courses

#

and teachers get to track progress

young knoll
#

“What is the correct thing to say when you kill someone”
A. gg ez
B. L trash
C. get gud skrub
D. UR BAD XD

echo basalt
#

it's worth it imo

#

extremely well paid and they're willing to sponsor a trip to the states

shadow zinc
#

How can I provide a jar file and add it as a dependency in maven?

glossy scroll
#

yes, there are steps to do it online tho

#

better than what we can explain

#

although

#

you should really be trying to use a dependency from your local maven repo

#

can you install NeoConfig?

#

then just use that

carmine nacelle
#
            Beehive nearestHiveBlock;
            CustomHive nearestHive = null;
            for (CustomHive customHive : cadiaBees.hiveManager.getCustomHives()) {
                if (customHive.getHiveLocation().distanceSquared(beeEnteredHive.getLocation()) <= 2) {
                    //This must be where it spawned
                    nearestHive = customHive;
                    break;
                }
            }
            hiveManager.getCustomHives().stream().filter(hive -> hive.getHiveLocation()
                    .distanceSquared(event.getEntity().getLocation()) <= 2)
                    .findFirst();

Which of these methods is least inefficient

shadow zinc
glossy scroll
#

both are fine

sullen marlin
carmine nacelle
#

yo md_5

worldly ingot
shadow zinc
#

It's a plugin I made, I could do a maven install but I would prefer to do it this way

glossy scroll
#

yea see we were messing with bleach and i added HCl

#

and it turned a mild green color

carmine nacelle
#

are CraftBees meant to discard all pdc/nbt stuff when exiting a hive?

quaint mantle
#

hey guys. sorry to bother you again.

i have this code here: if(items.hasItem(player.getInventory().getItemInMainHand())) { cs.sendMessage(ColorUtils.colorize("&#D39FF0&l> &r&#A39E7CThis item has been removed from the loottable.")); items.removeDrop(player.getInventory().getItemInMainHand());
which checks if a hashmap has the item that the player is holding:


        for(Map.Entry<ItemStack, Double> e : drops.entrySet()) {
            if(e.getKey().equals(item)) {
                return true;
            }
        }

        return false;

    }```
this returns true and then the items.removeDrop code is triggered:
```public void removeDrop(ItemStack drop) {
        drops.remove(drop);
    }```

somehow the entry for specified item does not get removed form the hashmap even though it prints the "This item has been removed from the loottable." line.
any ideas?

also this is the definition of drops:
private HashMap<ItemStack, Double> drops = new HashMap<>();
sullen marlin
#

Don't mix water with thionyl chloride means don't fkin wash the glassware with water

glossy scroll
#

come to find out, after lab, i researched it

sullen marlin
#

Idiots

glossy scroll
#

and it was indeed chlorine gas

#

i should have told somebody.

echo basalt
#

TL;DR - Kids crushed it and did lines in art class

glossy scroll
#

i added HCl on ACCIDENT by the way

echo basalt
#

I became the school's dealer for the day

glossy scroll
#

i wasnt just a rogue genchem student

carmine nacelle
#

damn, I tried

#

lmao

glossy scroll
#

and we already discussed this

#

the pdc isnt saving

carmine nacelle
#

was trying to get an official answer

glossy scroll
#

i mean although md is lead dev he doesnt instantly know the answers

#

he gotta look at the code like the rest of us haha

echo basalt
#

imagine knowing all of the nms code that mojang wrote for you

shadow zinc
#

is it okay if I do it like so?

#
        <dependency>
            <groupId>com.neomechanical</groupId>
            <artifactId>NeoConfig</artifactId>
            <version>1.0.3</version>
            <scope>system</scope>
            <systemPath>${project.basedir}/src/main/libs/NeoConfig-1.0.3.jar</systemPath>
        </dependency>```
sullen marlin
#

Sounds like a bug to me

glossy scroll
#

he has a nms bee impl

young knoll
#

You don’t have all of NMS memorized?

sullen marlin
#

Oh

quaint mantle
#

anyone have any idea why my issue is happening?

#

my brain is 2cm wide

glossy scroll
echo basalt
#

isSimilar instead of equals maybe?

glossy scroll
#

and import from your local maven repo

lost matrix
quaint mantle
quaint mantle
#

cause it prints the "item has been removed" line which means hasItem has returned true

lost matrix
#

Im not starting another bachelor at my age

shadow zinc
#

what is a LinkageError?

glossy scroll
#

even though im my BS im carefully considering a graduate program 😅

shadow zinc
#

oh do I need to relocate the jar file?

echo basalt
glossy scroll
vocal cloud
#

Gramps

echo basalt
#

7grandchildren

lost matrix