mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-22 10:57:43 +01:00
save stuff here
This commit is contained in:
@@ -5,7 +5,7 @@ Subject: [PATCH] Cows naturally aggressive to players chance
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/Cow.java b/src/main/java/net/minecraft/world/entity/animal/Cow.java
|
||||
index 3f67e626b66cf64034dcc9ebf35244631b081516..5dc426430033d526e379a94232a7e8c17ad52704 100644
|
||||
index 008ce5fed911484b6207eb711f5d1dfcc6348984..5c99065d8f097920e440980313fd75a040c2cc66 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/Cow.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/Cow.java
|
||||
@@ -38,6 +38,7 @@ import org.bukkit.craftbukkit.inventory.CraftItemStack;
|
||||
@@ -16,16 +16,16 @@ index 3f67e626b66cf64034dcc9ebf35244631b081516..5dc426430033d526e379a94232a7e8c1
|
||||
|
||||
public Cow(EntityType<? extends Cow> type, Level world) {
|
||||
super(type, world);
|
||||
@@ -46,6 +47,7 @@ public class Cow extends Animal {
|
||||
@@ -63,6 +64,7 @@ public class Cow extends Animal {
|
||||
@Override
|
||||
public void initAttributes() {
|
||||
this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(this.level.purpurConfig.cowMaxHealth);
|
||||
+ this.getAttribute(Attributes.ATTACK_DAMAGE).setBaseValue(this.level.purpurConfig.cowNaturallyAggressiveToPlayersDamage); // Purpur
|
||||
this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(this.level().purpurConfig.cowMaxHealth);
|
||||
+ this.getAttribute(Attributes.ATTACK_DAMAGE).setBaseValue(this.level().purpurConfig.cowNaturallyAggressiveToPlayersDamage); // Purpur
|
||||
}
|
||||
|
||||
// Purpur start
|
||||
@Override
|
||||
@@ -75,11 +77,18 @@ public class Cow extends Animal {
|
||||
return this.level.purpurConfig.cowTakeDamageFromWater;
|
||||
return this.level().purpurConfig.cowTakeDamageFromWater;
|
||||
}
|
||||
|
||||
+ @Override
|
||||
@@ -41,7 +41,7 @@ index 3f67e626b66cf64034dcc9ebf35244631b081516..5dc426430033d526e379a94232a7e8c1
|
||||
this.goalSelector.addGoal(1, new PanicGoal(this, 2.0D));
|
||||
+ this.goalSelector.addGoal(1, new net.minecraft.world.entity.ai.goal.MeleeAttackGoal(this, 1.2000000476837158D, true)); // Purpur
|
||||
this.goalSelector.addGoal(2, new BreedGoal(this, 1.0D));
|
||||
if (level.purpurConfig.cowFeedMushrooms > 0) this.goalSelector.addGoal(3, new TemptGoal(this, 1.25D, Ingredient.of(Items.WHEAT, Blocks.RED_MUSHROOM.asItem(), Blocks.BROWN_MUSHROOM.asItem()), false)); else // Purpur
|
||||
if (level().purpurConfig.cowFeedMushrooms > 0) this.goalSelector.addGoal(3, new TemptGoal(this, 1.25D, Ingredient.of(Items.WHEAT, Blocks.RED_MUSHROOM.asItem(), Blocks.BROWN_MUSHROOM.asItem()), false)); else // Purpur
|
||||
this.goalSelector.addGoal(3, new TemptGoal(this, 1.25D, Ingredient.of(Items.WHEAT), false));
|
||||
@@ -87,10 +96,11 @@ public class Cow extends Animal {
|
||||
this.goalSelector.addGoal(5, new WaterAvoidingRandomStrollGoal(this, 1.0D));
|
||||
@@ -57,18 +57,19 @@ index 3f67e626b66cf64034dcc9ebf35244631b081516..5dc426430033d526e379a94232a7e8c1
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
index 8b9822ce8d292cc81317ebb7d98e1be87ec8a826..a01628c3165608a93ad0bd3ff2aa1da3e4307adc 100644
|
||||
index 6b3e04296efda6f1bd4d93ccc3df0222ebb3aa31..5dc7d311fde305a8a5b3860d6d7e1f1cd02dffb1 100644
|
||||
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
@@ -1127,16 +1127,25 @@ public class PurpurWorldConfig {
|
||||
@@ -1222,6 +1222,8 @@ public class PurpurWorldConfig {
|
||||
public int cowFeedMushrooms = 0;
|
||||
public int cowBreedingTicks = 6000;
|
||||
public boolean cowTakeDamageFromWater = false;
|
||||
+ public double cowNaturallyAggressiveToPlayersChance = 0.0D;
|
||||
+ public double cowNaturallyAggressiveToPlayersDamage = 2.0D;
|
||||
private void cowSettings() {
|
||||
if (PurpurConfig.version < 10) {
|
||||
double oldValue = getDouble("mobs.cow.attributes.max-health", cowMaxHealth);
|
||||
cowRidable = getBoolean("mobs.cow.ridable", cowRidable);
|
||||
cowRidableInWater = getBoolean("mobs.cow.ridable-in-water", cowRidableInWater);
|
||||
@@ -1231,10 +1233,17 @@ public class PurpurWorldConfig {
|
||||
set("mobs.cow.attributes.max-health", null);
|
||||
set("mobs.cow.attributes.max_health", oldValue);
|
||||
}
|
||||
@@ -85,4 +86,4 @@ index 8b9822ce8d292cc81317ebb7d98e1be87ec8a826..a01628c3165608a93ad0bd3ff2aa1da3
|
||||
+ cowNaturallyAggressiveToPlayersDamage = getDouble("mobs.cow.naturally-aggressive-to-players.damage", cowNaturallyAggressiveToPlayersDamage);
|
||||
}
|
||||
|
||||
public double creeperMaxHealth = 20.0D;
|
||||
public boolean creeperRidable = false;
|
||||
|
||||
Reference in New Issue
Block a user