mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-20 09:57:43 +01:00
Separate ridable and controllable configs
This commit is contained in:
@@ -5,10 +5,10 @@ Subject: [PATCH] Configurable jockey options
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/Drowned.java b/src/main/java/net/minecraft/world/entity/monster/Drowned.java
|
||||
index 42ce331da58b749c17ece22c2ca9986a96c59438..54028f6c708e78e71b6db84898b9a6b30759023c 100644
|
||||
index 0217fb932379e5789dce932b6af90f1e97fb95de..dac2407cc170ed59d09e3969e432e3b5aaa48a66 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/Drowned.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/Drowned.java
|
||||
@@ -89,6 +89,21 @@ public class Drowned extends Zombie implements RangedAttackMob {
|
||||
@@ -94,6 +94,21 @@ public class Drowned extends Zombie implements RangedAttackMob {
|
||||
protected void randomizeReinforcementsChance() {
|
||||
this.getAttribute(Attributes.SPAWN_REINFORCEMENTS_CHANCE).setBaseValue(this.random.nextDouble() * this.level.purpurConfig.drownedSpawnReinforcements);
|
||||
}
|
||||
@@ -31,10 +31,10 @@ index 42ce331da58b749c17ece22c2ca9986a96c59438..54028f6c708e78e71b6db84898b9a6b3
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/Husk.java b/src/main/java/net/minecraft/world/entity/monster/Husk.java
|
||||
index 81a3f6c1774b187be96b412dae44be623ce7f6cb..7bb8ef0bb2de9a0b0d5048f8a4089835c41de568 100644
|
||||
index ff84c706d42bc6859faaa9302ba688f43ddcb537..640c75c2cf7ec1f1bc514d29ac1f929c526e0caa 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/Husk.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/Husk.java
|
||||
@@ -42,6 +42,21 @@ public class Husk extends Zombie {
|
||||
@@ -47,6 +47,21 @@ public class Husk extends Zombie {
|
||||
protected void randomizeReinforcementsChance() {
|
||||
this.getAttribute(net.minecraft.world.entity.ai.attributes.Attributes.SPAWN_REINFORCEMENTS_CHANCE).setBaseValue(this.random.nextDouble() * this.level.purpurConfig.huskSpawnReinforcements);
|
||||
}
|
||||
@@ -57,10 +57,10 @@ index 81a3f6c1774b187be96b412dae44be623ce7f6cb..7bb8ef0bb2de9a0b0d5048f8a4089835
|
||||
|
||||
public static boolean checkHuskSpawnRules(EntityType<Husk> type, ServerLevelAccessor world, MobSpawnType spawnReason, BlockPos pos, Random random) {
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/Zombie.java b/src/main/java/net/minecraft/world/entity/monster/Zombie.java
|
||||
index 589ebb2f962c957903c12fc1a5304604f0433441..c6ecf05dedeef70fb4aad55c6c8455fb7b69ab46 100644
|
||||
index 6943933ef0e97f31fbbcedee4ff469bc6e7e49c0..f1056d9174e19266990e54a04b3f99f2ea46beb1 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/Zombie.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/Zombie.java
|
||||
@@ -119,6 +119,18 @@ public class Zombie extends Monster {
|
||||
@@ -124,6 +124,18 @@ public class Zombie extends Monster {
|
||||
public void initAttributes() {
|
||||
this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(this.level.purpurConfig.drownedMaxHealth);
|
||||
}
|
||||
@@ -79,7 +79,7 @@ index 589ebb2f962c957903c12fc1a5304604f0433441..c6ecf05dedeef70fb4aad55c6c8455fb
|
||||
// Purpur end
|
||||
|
||||
@Override
|
||||
@@ -530,19 +542,20 @@ public class Zombie extends Monster {
|
||||
@@ -535,19 +547,20 @@ public class Zombie extends Monster {
|
||||
if (object instanceof Zombie.ZombieGroupData) {
|
||||
Zombie.ZombieGroupData entityzombie_groupdatazombie = (Zombie.ZombieGroupData) object;
|
||||
|
||||
@@ -106,7 +106,7 @@ index 589ebb2f962c957903c12fc1a5304604f0433441..c6ecf05dedeef70fb4aad55c6c8455fb
|
||||
Chicken entitychicken1 = (Chicken) EntityType.CHICKEN.create(this.level);
|
||||
|
||||
entitychicken1.moveTo(this.getX(), this.getY(), this.getZ(), this.getYRot(), 0.0F);
|
||||
@@ -550,6 +563,7 @@ public class Zombie extends Monster {
|
||||
@@ -555,6 +568,7 @@ public class Zombie extends Monster {
|
||||
entitychicken1.setChickenJockey(true);
|
||||
this.startRiding(entitychicken1);
|
||||
world.addFreshEntity(entitychicken1, CreatureSpawnEvent.SpawnReason.MOUNT); // CraftBukkit
|
||||
@@ -115,10 +115,10 @@ index 589ebb2f962c957903c12fc1a5304604f0433441..c6ecf05dedeef70fb4aad55c6c8455fb
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/ZombieVillager.java b/src/main/java/net/minecraft/world/entity/monster/ZombieVillager.java
|
||||
index 2c93f08b0bb07b90512c317b5583d25c6ea05d82..eb8dc173468f205c7b47915942890fe711e10650 100644
|
||||
index 6309a40ce0d349a6e278d6584b056dc644a358ba..cad1a9be238aa62b4eb0ec02d4155d15c0cc5378 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/ZombieVillager.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/ZombieVillager.java
|
||||
@@ -95,6 +95,21 @@ public class ZombieVillager extends Zombie implements VillagerDataHolder {
|
||||
@@ -100,6 +100,21 @@ public class ZombieVillager extends Zombie implements VillagerDataHolder {
|
||||
protected void randomizeReinforcementsChance() {
|
||||
this.getAttribute(net.minecraft.world.entity.ai.attributes.Attributes.SPAWN_REINFORCEMENTS_CHANCE).setBaseValue(this.random.nextDouble() * this.level.purpurConfig.zombieVillagerSpawnReinforcements);
|
||||
}
|
||||
@@ -141,10 +141,10 @@ index 2c93f08b0bb07b90512c317b5583d25c6ea05d82..eb8dc173468f205c7b47915942890fe7
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/ZombifiedPiglin.java b/src/main/java/net/minecraft/world/entity/monster/ZombifiedPiglin.java
|
||||
index f30b36b3f1153e1cbd9b8242909d9ba8c995df1d..76f1bbec2b8ebe037de65ee5ec718e17a6081c13 100644
|
||||
index e743fb4de0647088d06ec53291496e0d2f44fe44..e2192c45eba111a62dded3731dcdeacc6168710c 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/ZombifiedPiglin.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/ZombifiedPiglin.java
|
||||
@@ -74,6 +74,21 @@ public class ZombifiedPiglin extends Zombie implements NeutralMob {
|
||||
@@ -79,6 +79,21 @@ public class ZombifiedPiglin extends Zombie implements NeutralMob {
|
||||
public void initAttributes() {
|
||||
this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(this.level.purpurConfig.zombifiedPiglinMaxHealth);
|
||||
}
|
||||
@@ -167,11 +167,11 @@ index f30b36b3f1153e1cbd9b8242909d9ba8c995df1d..76f1bbec2b8ebe037de65ee5ec718e17
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
index 703a41c7c90124d8b8aa925a3f494ca61a268a92..982646423785bfb98be99044a8f4c59a16775d93 100644
|
||||
index 7dd9e436b50019bb16a61314cf6798b6a5b2580b..9b87f29de86fe2b312622082705709479433f357 100644
|
||||
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
@@ -542,6 +542,9 @@ public class PurpurWorldConfig {
|
||||
public boolean drownedRidableInWater = false;
|
||||
@@ -565,6 +565,9 @@ public class PurpurWorldConfig {
|
||||
public boolean drownedControllable = true;
|
||||
public double drownedMaxHealth = 20.0D;
|
||||
public double drownedSpawnReinforcements = 0.1D;
|
||||
+ public boolean drownedJockeyOnlyBaby = true;
|
||||
@@ -180,7 +180,7 @@ index 703a41c7c90124d8b8aa925a3f494ca61a268a92..982646423785bfb98be99044a8f4c59a
|
||||
private void drownedSettings() {
|
||||
drownedRidable = getBoolean("mobs.drowned.ridable", drownedRidable);
|
||||
drownedRidableInWater = getBoolean("mobs.drowned.ridable-in-water", drownedRidableInWater);
|
||||
@@ -552,6 +555,9 @@ public class PurpurWorldConfig {
|
||||
@@ -576,6 +579,9 @@ public class PurpurWorldConfig {
|
||||
}
|
||||
drownedMaxHealth = getDouble("mobs.drowned.attributes.max_health", drownedMaxHealth);
|
||||
drownedSpawnReinforcements = getDouble("mobs.drowned.attributes.spawn_reinforcements", drownedSpawnReinforcements);
|
||||
@@ -190,8 +190,8 @@ index 703a41c7c90124d8b8aa925a3f494ca61a268a92..982646423785bfb98be99044a8f4c59a
|
||||
}
|
||||
|
||||
public boolean elderGuardianRidable = false;
|
||||
@@ -764,6 +770,9 @@ public class PurpurWorldConfig {
|
||||
public boolean huskRidableInWater = false;
|
||||
@@ -813,6 +819,9 @@ public class PurpurWorldConfig {
|
||||
public boolean huskControllable = true;
|
||||
public double huskMaxHealth = 20.0D;
|
||||
public double huskSpawnReinforcements = 0.1D;
|
||||
+ public boolean huskJockeyOnlyBaby = true;
|
||||
@@ -200,7 +200,7 @@ index 703a41c7c90124d8b8aa925a3f494ca61a268a92..982646423785bfb98be99044a8f4c59a
|
||||
private void huskSettings() {
|
||||
huskRidable = getBoolean("mobs.husk.ridable", huskRidable);
|
||||
huskRidableInWater = getBoolean("mobs.husk.ridable-in-water", huskRidableInWater);
|
||||
@@ -774,6 +783,9 @@ public class PurpurWorldConfig {
|
||||
@@ -824,6 +833,9 @@ public class PurpurWorldConfig {
|
||||
}
|
||||
huskMaxHealth = getDouble("mobs.husk.attributes.max_health", huskMaxHealth);
|
||||
huskSpawnReinforcements = getDouble("mobs.husk.attributes.spawn_reinforcements", huskSpawnReinforcements);
|
||||
@@ -210,8 +210,8 @@ index 703a41c7c90124d8b8aa925a3f494ca61a268a92..982646423785bfb98be99044a8f4c59a
|
||||
}
|
||||
|
||||
public boolean illusionerRidable = false;
|
||||
@@ -1488,6 +1500,9 @@ public class PurpurWorldConfig {
|
||||
public boolean zombieRidableInWater = false;
|
||||
@@ -1619,6 +1631,9 @@ public class PurpurWorldConfig {
|
||||
public boolean zombieControllable = true;
|
||||
public double zombieMaxHealth = 20.0D;
|
||||
public double zombieSpawnReinforcements = 0.1D;
|
||||
+ public boolean zombieJockeyOnlyBaby = true;
|
||||
@@ -220,7 +220,7 @@ index 703a41c7c90124d8b8aa925a3f494ca61a268a92..982646423785bfb98be99044a8f4c59a
|
||||
private void zombieSettings() {
|
||||
zombieRidable = getBoolean("mobs.zombie.ridable", zombieRidable);
|
||||
zombieRidableInWater = getBoolean("mobs.zombie.ridable-in-water", zombieRidableInWater);
|
||||
@@ -1498,6 +1513,9 @@ public class PurpurWorldConfig {
|
||||
@@ -1630,6 +1645,9 @@ public class PurpurWorldConfig {
|
||||
}
|
||||
zombieMaxHealth = getDouble("mobs.zombie.attributes.max_health", zombieMaxHealth);
|
||||
zombieSpawnReinforcements = getDouble("mobs.zombie.attributes.spawn_reinforcements", zombieSpawnReinforcements);
|
||||
@@ -230,8 +230,8 @@ index 703a41c7c90124d8b8aa925a3f494ca61a268a92..982646423785bfb98be99044a8f4c59a
|
||||
}
|
||||
|
||||
public boolean zombieHorseRidableInWater = false;
|
||||
@@ -1531,6 +1549,9 @@ public class PurpurWorldConfig {
|
||||
public boolean zombieVillagerRidableInWater = false;
|
||||
@@ -1664,6 +1682,9 @@ public class PurpurWorldConfig {
|
||||
public boolean zombieVillagerControllable = true;
|
||||
public double zombieVillagerMaxHealth = 20.0D;
|
||||
public double zombieVillagerSpawnReinforcements = 0.1D;
|
||||
+ public boolean zombieVillagerJockeyOnlyBaby = true;
|
||||
@@ -240,7 +240,7 @@ index 703a41c7c90124d8b8aa925a3f494ca61a268a92..982646423785bfb98be99044a8f4c59a
|
||||
private void zombieVillagerSettings() {
|
||||
zombieVillagerRidable = getBoolean("mobs.zombie_villager.ridable", zombieVillagerRidable);
|
||||
zombieVillagerRidableInWater = getBoolean("mobs.zombie_villager.ridable-in-water", zombieVillagerRidableInWater);
|
||||
@@ -1541,12 +1562,18 @@ public class PurpurWorldConfig {
|
||||
@@ -1675,6 +1696,9 @@ public class PurpurWorldConfig {
|
||||
}
|
||||
zombieVillagerMaxHealth = getDouble("mobs.zombie_villager.attributes.max_health", zombieVillagerMaxHealth);
|
||||
zombieVillagerSpawnReinforcements = getDouble("mobs.zombie_villager.attributes.spawn_reinforcements", zombieVillagerSpawnReinforcements);
|
||||
@@ -250,7 +250,8 @@ index 703a41c7c90124d8b8aa925a3f494ca61a268a92..982646423785bfb98be99044a8f4c59a
|
||||
}
|
||||
|
||||
public boolean zombifiedPiglinRidable = false;
|
||||
public boolean zombifiedPiglinRidableInWater = false;
|
||||
@@ -1682,6 +1706,9 @@ public class PurpurWorldConfig {
|
||||
public boolean zombifiedPiglinControllable = true;
|
||||
public double zombifiedPiglinMaxHealth = 20.0D;
|
||||
public double zombifiedPiglinSpawnReinforcements = 0.0D;
|
||||
+ public boolean zombifiedPiglinJockeyOnlyBaby = true;
|
||||
@@ -259,7 +260,7 @@ index 703a41c7c90124d8b8aa925a3f494ca61a268a92..982646423785bfb98be99044a8f4c59a
|
||||
private void zombifiedPiglinSettings() {
|
||||
zombifiedPiglinRidable = getBoolean("mobs.zombified_piglin.ridable", zombifiedPiglinRidable);
|
||||
zombifiedPiglinRidableInWater = getBoolean("mobs.zombified_piglin.ridable-in-water", zombifiedPiglinRidableInWater);
|
||||
@@ -1557,5 +1584,8 @@ public class PurpurWorldConfig {
|
||||
@@ -1693,5 +1720,8 @@ public class PurpurWorldConfig {
|
||||
}
|
||||
zombifiedPiglinMaxHealth = getDouble("mobs.zombified_piglin.attributes.max_health", zombifiedPiglinMaxHealth);
|
||||
zombifiedPiglinSpawnReinforcements = getDouble("mobs.zombified_piglin.attributes.spawn_reinforcements", zombifiedPiglinSpawnReinforcements);
|
||||
|
||||
Reference in New Issue
Block a user