#bee movie

1 messages · Page 1 of 1 (latest)

languid orchid
#

ok @lament burrow

lament burrow
#

do you plan on releasing this plugin to the public?

languid orchid
#

undecided

#

currently for a friends server

#

would be cool to release.

lament burrow
#

what part of the aiStep method do you not want

#

explain it in words

languid orchid
#

aiStep?

lament burrow
#

that's the method you sent me

languid orchid
#

i uh..

#

dont see anything about that

#

talking about the name...?

lament burrow
#

oh

#

my bad

#

sorry that was someone else

languid orchid
#

lol

#

np

lament burrow
#

first you should probably have this

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

        return this.bukkitEntity;
    }```
languid orchid
#

inside my custom instantiation class?

lament burrow
#

inside your entity class

#

and change CraftMob to whatever you like

#

the reason for this is so that you can access the bukkit API through the entity

#

so now you can call MyEntity#getBukkitEntity() to access all normal api

languid orchid
#

that was gonna be my next questions

#

cause before I was using getBukkitEntity.

#

"beegotohivegoal" 😮 so many ideas

lament burrow
#

yea, you need to make sure you have that method so you get the correct subclass

languid orchid
#

if only i was skilled

lament burrow
#

note i used CraftMob, which i needed an anonymous class for

#

you shouldnt make an anonymous class for most entities

languid orchid
#

can I just use Bee..?

lament burrow
#

yea, new CraftBee

#

would be my recommendation

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

        return this.bukkitEntity;
    }
#

alright cool

lament burrow
#

looks good to me

languid orchid
#

so in theory..

#

instead of using the nms method to set the bees name..

#

just set it through the bukkit entity..?

lament burrow
#

thats what I do

#

even when using this nms stuff, always prioritize the API

languid orchid
#

im not sure what "n" and "c" are

#

lets see..

lament burrow
#

the API takes care of name changes, deletions, additions, etc

#

new CraftBee(this.level.getCraftServer(), this) {};

#

remove the annonymous class

languid orchid
#

guessing thats the {}

#

removed

lament burrow
#

yes

#

(CraftMob is abstract, hence why i needed it)

languid orchid
#

"getCropsGrownSincePollination()" holy crap

#

theres a lot to this

#

createNavigation woah

lament burrow
#

what ide do you use?

languid orchid
#

idea

lament burrow
#

ok

languid orchid
#

the best one

lament burrow
#

i always find it helpful to ctrl click on stuff

languid orchid
#

yea i do

lament burrow
#

ok good

languid orchid
#

im just looking through yellingflipflops rn

#
        this.n(true);
        this.c(20.0f);
        this.b_(-32768);
#

trying to see what these did

lament burrow
#

oh haha

languid orchid
#

its hard to find the right value obfuscated

lament burrow
#

yea and most of those values are static final, meaning compilers will insert the value and not the variable

languid orchid
#

uhhhhhhhhhhh

#

yeah i know what that means 😭

lament burrow
#

these are static final variables

#

meaning they can never change

#

so when you do something like

#

System.out.println(FLAG_ROLL + FLAG_HAS_STUNG)

#

once you compile it, the compiler will effectively do System.out.println(2 + 4)

#

and thats how it appears when you decompile the code

languid orchid
#

weirddd..

lament burrow
#

take these for example

#

my ide is telling me these are never used

#

but... really they are

#

here

languid orchid
#

this stuff gets complex

lament burrow
#

when mojang people work on the game, they would see the variables there

languid orchid
#

0-100 in a millisecond

lament burrow
#

but we're using a decompiled version of the game

#

so we lose comments and variables sometimes

languid orchid
#

gotcha..

lament burrow
languid orchid
#

any tips on finding what the "n" property is?

lament burrow
#

above, "HivePos" is used as TAG_HIVE_POS

#

n.. property?

languid orchid
#

this.n(true);

#

i had that before

#

trying to find what it was before

#

so i can find the new one

lament burrow
#

i cant really help on that

#

it could be part of any of the bee's superclasses

languid orchid
#

this has been very enlightening even if i dont quite fully understand yet

#

but thanks boss

lament burrow
#

when i first was transitioning from spigot to mojang

#

i would use both the remapped and original dependencies

#

so that way i could easily ctrl click to see which class the method was located in

#

and then find the method's new name

languid orchid
#
        <dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot</artifactId>
            <version>1.19-R0.1-SNAPSHOT</version>
            <classifier>remapped-mojang</classifier>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot</artifactId>
            <version>1.19-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>
#

so just have both?

lament burrow
#

yea like that

languid orchid
#

gigabrain?

#

its not recognizing stuff like ".n" lol

#

or ".b"

#

the obfuscated stuff

#

oh well

lament burrow
#

well it's probably pulling from the remapped version

#

idk of a better way to do it

#

but sometimes i would just do like new EntityBee()

#

and then do like bee.n(true)

#

and then ctrl click that n to see which class it brought me to

languid orchid
#

alright sweet

#

thanks a ton

languid orchid
#

aye sooo

#
 CustomBee customBee = new CustomBee(customHive.getHiveLocation(), ChatColor.YELLOW + "" + ChatColor.BOLD + "Bee");
        customBee.absMoveTo(customHive.getHiveLocation().getX(), customHive.getHiveLocation().getY(), customHive.getHiveLocation().getZ());
#

I have this, but still have to spawnfresh or whatever it was

#

do that here also?

lament burrow
#

Level#addFreshEntity

languid orchid
#

uhhh

#

I gotta figure out how to get level again lol

#

we ended up not needing it till now

#
        CustomBee customBee = new CustomBee(customHive.getHiveLocation(), ChatColor.YELLOW + "" + ChatColor.BOLD + "Bee");
        Level worldLevel = ((Level) customHive.getHiveLocation().getWorld()).getMinecraftWorld();
        worldLevel.addFreshEntity(customBee);
lament burrow
#

getHandle on CraftWorld

languid orchid
#

getting this when exporting with maven? any idea?