mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-22 02:47:43 +01:00
progress
This commit is contained in:
@@ -5,38 +5,26 @@ Subject: [PATCH] Chickens can retaliate
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/Chicken.java b/src/main/java/net/minecraft/world/entity/animal/Chicken.java
|
||||
index 8460bed561c09a647f6e0209f7c5448e5a42b281..56aee819372d4baacf73c345603ce889b3a60b52 100644
|
||||
index 771e55cceaf17167c00554b1be7043a4cb3efb7e..11bdc951087d8630a26f398f36a56a9e7c043d70 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/Chicken.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/Chicken.java
|
||||
@@ -20,10 +20,12 @@ import net.minecraft.world.entity.ai.goal.BreedGoal;
|
||||
import net.minecraft.world.entity.ai.goal.FloatGoal;
|
||||
import net.minecraft.world.entity.ai.goal.FollowParentGoal;
|
||||
import net.minecraft.world.entity.ai.goal.LookAtPlayerGoal;
|
||||
+import net.minecraft.world.entity.ai.goal.MeleeAttackGoal;
|
||||
import net.minecraft.world.entity.ai.goal.PanicGoal;
|
||||
import net.minecraft.world.entity.ai.goal.RandomLookAroundGoal;
|
||||
import net.minecraft.world.entity.ai.goal.TemptGoal;
|
||||
import net.minecraft.world.entity.ai.goal.WaterAvoidingRandomStrollGoal;
|
||||
+import net.minecraft.world.entity.ai.goal.target.HurtByTargetGoal;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.Items;
|
||||
@@ -52,16 +54,33 @@ public class Chicken extends Animal {
|
||||
this.setPathfindingMalus(BlockPathTypes.WATER, 0.0F);
|
||||
@@ -62,19 +62,34 @@ public class Chicken extends Animal {
|
||||
public boolean rideableUnderWater() {
|
||||
return level.purpurConfig.chickenRidableInWater;
|
||||
}
|
||||
|
||||
+ // Purpur start
|
||||
+
|
||||
+ @Override
|
||||
+ protected void initAttributes() {
|
||||
+ if (level.purpurConfig.chickenRetaliate) {
|
||||
+ this.getAttribute(Attributes.ATTACK_DAMAGE).setBaseValue(2.0D);
|
||||
+ }
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
// Purpur end
|
||||
|
||||
@Override
|
||||
protected void registerGoals() {
|
||||
this.goalSelector.addGoal(0, new FloatGoal(this));
|
||||
this.goalSelector.addGoal(0, new net.pl3x.purpur.entity.ai.HasRider(this)); // Purpur
|
||||
- this.goalSelector.addGoal(1, new PanicGoal(this, 1.4D));
|
||||
+ // this.goalSelector.addGoal(1, new PanicGoal(this, 1.4D)); // Purpur - moved down
|
||||
this.goalSelector.addGoal(2, new BreedGoal(this, 1.0D));
|
||||
@@ -47,8 +35,8 @@ index 8460bed561c09a647f6e0209f7c5448e5a42b281..56aee819372d4baacf73c345603ce889
|
||||
this.goalSelector.addGoal(7, new RandomLookAroundGoal(this));
|
||||
+ // Purpur start
|
||||
+ if (level.purpurConfig.chickenRetaliate) {
|
||||
+ this.goalSelector.addGoal(1, new MeleeAttackGoal(this, 1.0D, false));
|
||||
+ this.targetSelector.addGoal(1, new HurtByTargetGoal(this));
|
||||
+ this.goalSelector.addGoal(1, new net.minecraft.world.entity.ai.goal.MeleeAttackGoal(this, 1.0D, false));
|
||||
+ this.targetSelector.addGoal(1, new net.minecraft.world.entity.ai.goal.target.HurtByTargetGoal(this));
|
||||
+ } else {
|
||||
+ this.goalSelector.addGoal(1, new PanicGoal(this, 1.4D));
|
||||
+ }
|
||||
@@ -56,7 +44,7 @@ index 8460bed561c09a647f6e0209f7c5448e5a42b281..56aee819372d4baacf73c345603ce889
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -70,7 +89,7 @@ public class Chicken extends Animal {
|
||||
@@ -83,7 +98,7 @@ public class Chicken extends Animal {
|
||||
}
|
||||
|
||||
public static AttributeSupplier.Builder createAttributes() {
|
||||
@@ -66,7 +54,7 @@ index 8460bed561c09a647f6e0209f7c5448e5a42b281..56aee819372d4baacf73c345603ce889
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 32b37da32b6cb2bb0a76a1759eacd28b8e32ece1..f6f3910c5a9f011e1513174cb9d70080ddb5b024 100644
|
||||
index 3981e492b61d552735433fae05e13d1fe87637db..5154e14c88cf79c8da3290ff945fac0361e9e7c5 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -161,9 +161,11 @@ public class PurpurWorldConfig {
|
||||
|
||||
Reference in New Issue
Block a user