mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-21 10:27:44 +01:00
[ci skip] add a good chunk of patch identifying comments
This commit is contained in:
@@ -5,49 +5,50 @@ 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 9d3c5340b9e16117fbc63f184fe92cf7ae0998be..798a59046c3ac9a3838f7bcaf7bb21e738b76e44 100644
|
||||
index 2f1518536e63dfd94db5c8a2076004319408409c..f6f7afc6a421022738f77e5eece193ad15de78ba 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/Chicken.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/Chicken.java
|
||||
@@ -73,6 +73,9 @@ public class Chicken extends Animal {
|
||||
@@ -75,13 +75,18 @@ public class Chicken extends Animal {
|
||||
public void initAttributes() {
|
||||
this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(this.level().purpurConfig.chickenMaxHealth);
|
||||
this.getAttribute(Attributes.SCALE).setBaseValue(this.level().purpurConfig.chickenScale);
|
||||
+ // Purpur start - Chickens can retaliate
|
||||
+ if (level().purpurConfig.chickenRetaliate) {
|
||||
+ this.getAttribute(Attributes.ATTACK_DAMAGE).setBaseValue(2.0D);
|
||||
+ }
|
||||
+ // Purpur end - Chickens can retaliate
|
||||
}
|
||||
// Purpur end
|
||||
|
||||
@@ -80,7 +83,7 @@ public class Chicken extends Animal {
|
||||
// Purpur end - Configurable entity base attributes
|
||||
@Override
|
||||
protected void registerGoals() {
|
||||
this.goalSelector.addGoal(0, new FloatGoal(this));
|
||||
this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur
|
||||
this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur - Ridables
|
||||
- this.goalSelector.addGoal(1, new PanicGoal(this, 1.4D));
|
||||
+ // this.goalSelector.addGoal(1, new PanicGoal(this, 1.4D)); // Purpur - moved down
|
||||
+ //this.goalSelector.addGoal(1, new PanicGoal(this, 1.4D)); // Purpur - moved down
|
||||
this.goalSelector.addGoal(2, new BreedGoal(this, 1.0D));
|
||||
this.goalSelector.addGoal(3, new TemptGoal(this, 1.0D, (itemstack) -> {
|
||||
return itemstack.is(ItemTags.CHICKEN_FOOD);
|
||||
@@ -89,6 +92,14 @@ public class Chicken extends Animal {
|
||||
@@ -90,6 +95,14 @@ public class Chicken extends Animal {
|
||||
this.goalSelector.addGoal(5, new WaterAvoidingRandomStrollGoal(this, 1.0D));
|
||||
this.goalSelector.addGoal(6, new LookAtPlayerGoal(this, Player.class, 6.0F));
|
||||
this.goalSelector.addGoal(7, new RandomLookAroundGoal(this));
|
||||
+ // Purpur start
|
||||
+ // Purpur start - Chickens can retaliate
|
||||
+ if (level().purpurConfig.chickenRetaliate) {
|
||||
+ 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));
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+ // Purpur end - Chickens can retaliate
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -97,7 +108,7 @@ public class Chicken extends Animal {
|
||||
@@ -98,7 +111,7 @@ public class Chicken extends Animal {
|
||||
}
|
||||
|
||||
public static AttributeSupplier.Builder createAttributes() {
|
||||
- return Animal.createAnimalAttributes().add(Attributes.MAX_HEALTH, 4.0D).add(Attributes.MOVEMENT_SPEED, 0.25D);
|
||||
+ return Animal.createAnimalAttributes().add(Attributes.MAX_HEALTH, 4.0D).add(Attributes.MOVEMENT_SPEED, 0.25D).add(Attributes.ATTACK_DAMAGE, 0.0D); // Purpur
|
||||
+ return Animal.createAnimalAttributes().add(Attributes.MAX_HEALTH, 4.0D).add(Attributes.MOVEMENT_SPEED, 0.25D).add(Attributes.ATTACK_DAMAGE, 0.0D); // Purpur - Chickens can retaliate
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user