From 542173bc7d0bbb02ae9746ffa313ceed9776d45c Mon Sep 17 00:00:00 2001 From: TechnoVisionDev Date: Fri, 24 Jul 2020 00:10:50 -0700 Subject: [PATCH] Update some entity values --- .../java/com/technovision/tutorial/Tutorial.java | 4 ++-- .../technovision/tutorial/entities/HogEntity.java | 14 +++++++++----- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/technovision/tutorial/Tutorial.java b/src/main/java/com/technovision/tutorial/Tutorial.java index 4412e3a..0cc774b 100644 --- a/src/main/java/com/technovision/tutorial/Tutorial.java +++ b/src/main/java/com/technovision/tutorial/Tutorial.java @@ -17,8 +17,8 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @Mod("tutorial") -public class Tutorial -{ +public class Tutorial { + public static final Logger LOGGER = LogManager.getLogger(); public static final String MOD_ID = "tutorial"; diff --git a/src/main/java/com/technovision/tutorial/entities/HogEntity.java b/src/main/java/com/technovision/tutorial/entities/HogEntity.java index 36f4546..5cb6971 100644 --- a/src/main/java/com/technovision/tutorial/entities/HogEntity.java +++ b/src/main/java/com/technovision/tutorial/entities/HogEntity.java @@ -23,7 +23,7 @@ public class HogEntity extends AnimalEntity { private static final Ingredient TEMPTATION_ITEMS = Ingredient.fromItems(Items.CARROT, Items.POTATO, Items.BEETROOT); private EatGrassGoal eatGrassGoal; - private int goatTimer; + private int hogTimer; public HogEntity(EntityType type, World worldIn) { super(type, worldIn); @@ -56,6 +56,11 @@ public class HogEntity extends AnimalEntity { this.goalSelector.addGoal(8, new LookRandomlyGoal(this)); } + @Override + protected int getExperiencePoints(PlayerEntity player) { + return 1 + this.world.rand.nextInt(4); + } + @Override protected SoundEvent getAmbientSound() { return SoundEvents.ENTITY_PIG_AMBIENT; } @@ -74,14 +79,14 @@ public class HogEntity extends AnimalEntity { @Override protected void updateAITasks() { - this.goatTimer = this.eatGrassGoal.getEatingGrassTimer(); + this.hogTimer = this.eatGrassGoal.getEatingGrassTimer(); super.updateAITasks(); } @Override public void livingTick() { if (this.world.isRemote) { - this.goatTimer = Math.max(0, this.goatTimer - 1); + this.hogTimer = Math.max(0, this.hogTimer - 1); } super.livingTick(); } @@ -89,10 +94,9 @@ public class HogEntity extends AnimalEntity { @OnlyIn(Dist.CLIENT) public void handleStatusUpdate(byte id) { if (id == 10) { - this.goatTimer = 40; + this.hogTimer = 40; } else { super.handleStatusUpdate(id); } - } }