36
36
public class Firefly extends PathfinderMob implements FlyingAnimal , GeoEntity {
37
37
private final AnimatableInstanceCache cache = GeckoLibUtil .createInstanceCache (this );
38
38
39
- private static final EntityDataAccessor <Boolean > roost = SynchedEntityData .defineId (Firefly .class , EntityDataSerializers .BOOLEAN );
40
- private static final EntityDataAccessor <Integer > baby = SynchedEntityData .defineId (Firefly .class , EntityDataSerializers .INT );
39
+ private static final EntityDataAccessor <Boolean > ROOST = SynchedEntityData .defineId (Firefly .class , EntityDataSerializers .BOOLEAN );
40
+ private static final EntityDataAccessor <Integer > BABY = SynchedEntityData .defineId (Firefly .class , EntityDataSerializers .INT );
41
41
42
- public static final RawAnimation idleRaw = RawAnimation .begin ().thenLoop ("idle" );
43
- public static final RawAnimation babyRaw = RawAnimation .begin ().thenLoop ("baby" );
42
+ public static final RawAnimation IDLE_RAW = RawAnimation .begin ().thenLoop ("idle" );
43
+ public static final RawAnimation BABY_RAW = RawAnimation .begin ().thenLoop ("baby" );
44
44
public Firefly (EntityType <? extends PathfinderMob > type , Level level ) {
45
45
super (type , level );
46
46
this .moveControl = new FlyingMoveControl (this , 20 , true );
@@ -50,8 +50,8 @@ public Firefly(EntityType<? extends PathfinderMob> type, Level level) {
50
50
@ Override
51
51
protected void defineSynchedData (SynchedEntityData .Builder builder ) {
52
52
super .defineSynchedData (builder );
53
- builder .define (roost , false );
54
- builder .define (baby , 0 );
53
+ builder .define (ROOST , false );
54
+ builder .define (BABY , 0 );
55
55
}
56
56
57
57
@ Nullable
@@ -62,23 +62,23 @@ public SpawnGroupData finalizeSpawn(ServerLevelAccessor level, DifficultyInstanc
62
62
}
63
63
64
64
public void setRoost (boolean r ) {
65
- this .entityData .set (roost , r );
65
+ this .entityData .set (ROOST , r );
66
66
}
67
67
68
68
public boolean isRoost () {
69
- return this .entityData .get (roost );
69
+ return this .entityData .get (ROOST );
70
70
}
71
71
72
72
@ Override
73
73
public boolean isBaby () {
74
- return this .entityData .get (baby ) < 300 ;
74
+ return this .entityData .get (BABY ) < 300 ;
75
75
}
76
76
77
77
public int getBaby () {
78
- return this .entityData .get (baby );
78
+ return this .entityData .get (BABY );
79
79
}
80
80
81
- public void setBaby (int b ) {this .entityData .set (baby , b );}
81
+ public void setBaby (int b ) {this .entityData .set (BABY , b );}
82
82
83
83
@ Override
84
84
public void tick () {
@@ -186,7 +186,7 @@ public void registerControllers(AnimatableManager.ControllerRegistrar controller
186
186
187
187
private PlayState handle (AnimationState <Firefly > state ) {
188
188
state .setControllerSpeed (isRoost () ? 0.3f : 1f );
189
- state .setAndContinue ( isBaby () ? babyRaw : idleRaw );
189
+ state .setAndContinue ( isBaby () ? BABY_RAW : IDLE_RAW );
190
190
return PlayState .CONTINUE ;
191
191
}
192
192
0 commit comments