33import net .minecraft .network .syncher .EntityDataAccessor ;
44import net .minecraft .network .syncher .EntityDataSerializers ;
55import net .minecraft .network .syncher .SynchedEntityData ;
6- import net .minecraft .world .entity .*;
6+ import net .minecraft .world .damagesource .DamageSource ;
7+ import net .minecraft .world .entity .EntityType ;
8+ import net .minecraft .world .entity .LivingEntity ;
79import net .minecraft .world .entity .ai .attributes .AttributeSupplier ;
810import net .minecraft .world .entity .ai .attributes .Attributes ;
911import net .minecraft .world .entity .ai .goal .*;
1618import net .minecraft .world .entity .player .Player ;
1719import net .minecraft .world .level .Level ;
1820import net .minecraft .world .phys .Vec3 ;
19- import net .minecraft .world .damagesource .DamageSource ;
2021import org .infernalstudios .enemyexp .core .mixin .RandomLookAroundGoalAccessor ;
2122import org .infernalstudios .enemyexp .core .util .AnimUtils ;
2223import org .jetbrains .annotations .NotNull ;
3334import java .util .List ;
3435
3536public class SluggerEntity extends Zombie implements GeoEntity {
36- private final AnimatableInstanceCache cache = GeckoLibUtil .createInstanceCache (this );
3737 private static final EntityDataAccessor <Integer > CHARGE_TIME = SynchedEntityData .defineId (SluggerEntity .class , EntityDataSerializers .INT );
3838 private static final EntityDataAccessor <Float > CHARGE_DIR_X = SynchedEntityData .defineId (SluggerEntity .class , EntityDataSerializers .FLOAT );
3939 private static final EntityDataAccessor <Float > CHARGE_DIR_Z = SynchedEntityData .defineId (SluggerEntity .class , EntityDataSerializers .FLOAT );
4040 private static final EntityDataAccessor <String > TEXTURE = SynchedEntityData .defineId (SluggerEntity .class , EntityDataSerializers .STRING );
41-
4241 private static final String NORMAL_TEXTURE = "slugger" ;
4342 private static final String STAGGERED_CHARGE = "slugger_charge" ;
4443 private static final String DASHING_TEXTURE = "slugger_dashing" ;
45-
4644 private static final int CHARGE_DURATION = 17 ;
4745 private static final int CHARGE_WINDUP = 10 ;
4846 private static final float CHARGE_SPEED = 0.7F ;
4947 private static final float CHARGE_DAMAGE = 6.0F ;
5048 private static final float CHARGE_KNOCKBACK = 1.5F ;
49+ private final AnimatableInstanceCache cache = GeckoLibUtil .createInstanceCache (this );
5150
5251 public SluggerEntity (EntityType <? extends Zombie > entityType , Level level ) {
5352 super (entityType , level );
5453 }
5554
55+ public static AttributeSupplier .@ NotNull Builder createAttributes () {
56+ return Zombie .createAttributes ()
57+ .add (Attributes .MOVEMENT_SPEED , 0.2D ).add (Attributes .FOLLOW_RANGE , 32.0D )
58+ .add (Attributes .ATTACK_DAMAGE , 4.0D ).add (Attributes .MAX_HEALTH , 8.0D )
59+ .add (Attributes .ARMOR , 16.0D ).add (Attributes .KNOCKBACK_RESISTANCE , 3.0D )
60+ .add (Attributes .ATTACK_KNOCKBACK , 0.3D );
61+ }
62+
5663 @ Override
5764 protected void registerGoals () {
5865 this .goalSelector .addGoal (1 , new SluggerChargeGoal (this ));
@@ -68,14 +75,6 @@ protected void registerGoals() {
6875 this .targetSelector .addGoal (3 , new NearestAttackableTargetGoal <>(this , IronGolem .class , true ));
6976 }
7077
71- public static AttributeSupplier .@ NotNull Builder createAttributes () {
72- return Zombie .createAttributes ()
73- .add (Attributes .MOVEMENT_SPEED , 0.2D ).add (Attributes .FOLLOW_RANGE , 32.0D )
74- .add (Attributes .ATTACK_DAMAGE , 4.0D ).add (Attributes .MAX_HEALTH , 8.0D )
75- .add (Attributes .ARMOR , 16.0D ).add (Attributes .KNOCKBACK_RESISTANCE , 3.0D )
76- .add (Attributes .ATTACK_KNOCKBACK , 0.3D );
77- }
78-
7978 @ Override
8079 protected void defineSynchedData () {
8180 super .defineSynchedData ();
@@ -89,6 +88,7 @@ private void lockRotationDuringCharge() {
8988 this .setYRot (this .yRotO );
9089 this .yHeadRot = this .yRotO ;
9190 this .yBodyRot = this .yRotO ;
91+ this .setXRot (this .xRotO );
9292 }
9393
9494 @ Override
@@ -152,12 +152,12 @@ public void setTexture(String texture) {
152152 }
153153
154154 @ Override
155- public void setBaby (boolean childZombie ) {
155+ public boolean isBaby () {
156+ return false ;
156157 }
157158
158159 @ Override
159- public boolean isBaby () {
160- return false ;
160+ public void setBaby (boolean childZombie ) {
161161 }
162162
163163 @ Override
0 commit comments