mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-21 02:17:42 +01:00
configurable mob size attribute (#1538)
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 02bceb31c517b94653573380ed29d9401a6b9ce8..1d283484be270497859e23e3bb4ab38c09af23e6 100644
|
||||
index c3e0e95da8a57fc7bfba44a6748c5d96a9640374..b5a46c844e0f366828f8c287a598abb9aaeacf21 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/Drowned.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/Drowned.java
|
||||
@@ -98,6 +98,21 @@ public class Drowned extends Zombie implements RangedAttackMob {
|
||||
@@ -99,6 +99,21 @@ public class Drowned extends Zombie implements RangedAttackMob {
|
||||
this.getAttribute(Attributes.SPAWN_REINFORCEMENTS_CHANCE).setBaseValue(this.random.nextDouble() * this.level().purpurConfig.drownedSpawnReinforcements);
|
||||
}
|
||||
|
||||
@@ -57,11 +57,11 @@ index 805bfee8b061445de5b5d8aeb13c792178e25f7b..6673c0bff3a4e3d11a09e9dc8aeb0c24
|
||||
return checkMonsterSpawnRules(type, world, spawnReason, pos, random) && (MobSpawnType.isSpawner(spawnReason) || world.canSeeSky(pos));
|
||||
}
|
||||
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 28587e17b15748880576f7a71e71a05c9c1bcf78..43c48bb14957b93ee3b0191360c09f710bc008e0 100644
|
||||
index ea6ec8eae2306542a4d6b0b463b8d10abc0d0b37..ada1f9f9bf8770c48ff25d562cf84cb04be17ca2 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/Zombie.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/Zombie.java
|
||||
@@ -130,6 +130,18 @@ public class Zombie extends Monster {
|
||||
this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(this.level().purpurConfig.zombieMaxHealth);
|
||||
@@ -131,6 +131,18 @@ public class Zombie extends Monster {
|
||||
this.getAttribute(Attributes.SCALE).setBaseValue(this.level().purpurConfig.zombieScale);
|
||||
}
|
||||
|
||||
+ public boolean jockeyOnlyBaby() {
|
||||
@@ -79,7 +79,7 @@ index 28587e17b15748880576f7a71e71a05c9c1bcf78..43c48bb14957b93ee3b0191360c09f71
|
||||
@Override
|
||||
protected void registerGoals() {
|
||||
this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur
|
||||
@@ -544,19 +556,20 @@ public class Zombie extends Monster {
|
||||
@@ -545,19 +557,20 @@ public class Zombie extends Monster {
|
||||
}
|
||||
|
||||
if (object instanceof Zombie.ZombieGroupData entityzombie_groupdatazombie) {
|
||||
@@ -106,7 +106,7 @@ index 28587e17b15748880576f7a71e71a05c9c1bcf78..43c48bb14957b93ee3b0191360c09f71
|
||||
Chicken entitychicken1 = (Chicken) EntityType.CHICKEN.create(this.level());
|
||||
|
||||
if (entitychicken1 != null) {
|
||||
@@ -566,6 +579,7 @@ public class Zombie extends Monster {
|
||||
@@ -567,6 +580,7 @@ public class Zombie extends Monster {
|
||||
this.startRiding(entitychicken1);
|
||||
world.addFreshEntity(entitychicken1, CreatureSpawnEvent.SpawnReason.MOUNT); // CraftBukkit
|
||||
}
|
||||
@@ -141,11 +141,11 @@ index 199770256cf7f838228b5263ec9af8c6b18f30fb..cdf6753b6bb2bbb4f3ab21792bd31539
|
||||
protected void defineSynchedData(SynchedEntityData.Builder builder) {
|
||||
super.defineSynchedData(builder);
|
||||
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 883cd9a96a1d4276ca10c5558b553c36a1bb0d79..0dcf5638e12c7670e6a5e577210e2542de1fd38b 100644
|
||||
index 42e3e992cc725627e8b03fa2c057c59bd52556b4..53b8f46bda60289ec310cb45513a2b729fcbea76 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/ZombifiedPiglin.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/ZombifiedPiglin.java
|
||||
@@ -85,6 +85,21 @@ public class ZombifiedPiglin extends Zombie implements NeutralMob {
|
||||
this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(this.level().purpurConfig.zombifiedPiglinMaxHealth);
|
||||
@@ -86,6 +86,21 @@ public class ZombifiedPiglin extends Zombie implements NeutralMob {
|
||||
this.getAttribute(Attributes.SCALE).setBaseValue(this.level().purpurConfig.zombifiedPiglinScale);
|
||||
}
|
||||
|
||||
+ @Override
|
||||
@@ -167,12 +167,12 @@ index 883cd9a96a1d4276ca10c5558b553c36a1bb0d79..0dcf5638e12c7670e6a5e577210e2542
|
||||
public void setPersistentAngerTarget(@Nullable UUID angryAt) {
|
||||
this.persistentAngerTarget = angryAt;
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
index a5fec4cc1390581d98b5d64aa12e0a29ae149efc..58bab65407d4e1cff37d81d6bca00bf53ee80e24 100644
|
||||
index b2bc8d014b9cfd7af72b0a04077f93741338083a..a4eef27653adda8486130c5affea09396a8901a7 100644
|
||||
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
@@ -608,6 +608,9 @@ public class PurpurWorldConfig {
|
||||
public boolean drownedControllable = true;
|
||||
@@ -640,6 +640,9 @@ public class PurpurWorldConfig {
|
||||
public double drownedMaxHealth = 20.0D;
|
||||
public double drownedScale = 1.0D;
|
||||
public double drownedSpawnReinforcements = 0.1D;
|
||||
+ public boolean drownedJockeyOnlyBaby = true;
|
||||
+ public double drownedJockeyChance = 0.05D;
|
||||
@@ -180,9 +180,9 @@ index a5fec4cc1390581d98b5d64aa12e0a29ae149efc..58bab65407d4e1cff37d81d6bca00bf5
|
||||
private void drownedSettings() {
|
||||
drownedRidable = getBoolean("mobs.drowned.ridable", drownedRidable);
|
||||
drownedRidableInWater = getBoolean("mobs.drowned.ridable-in-water", drownedRidableInWater);
|
||||
@@ -619,6 +622,9 @@ public class PurpurWorldConfig {
|
||||
}
|
||||
@@ -652,6 +655,9 @@ public class PurpurWorldConfig {
|
||||
drownedMaxHealth = getDouble("mobs.drowned.attributes.max_health", drownedMaxHealth);
|
||||
drownedScale = Mth.clamp(getDouble("mobs.drowned.attributes.scale", drownedScale), 0.0625D, 16.0D);
|
||||
drownedSpawnReinforcements = getDouble("mobs.drowned.attributes.spawn_reinforcements", drownedSpawnReinforcements);
|
||||
+ drownedJockeyOnlyBaby = getBoolean("mobs.drowned.jockey.only-babies", drownedJockeyOnlyBaby);
|
||||
+ drownedJockeyChance = getDouble("mobs.drowned.jockey.chance", drownedJockeyChance);
|
||||
@@ -190,9 +190,9 @@ index a5fec4cc1390581d98b5d64aa12e0a29ae149efc..58bab65407d4e1cff37d81d6bca00bf5
|
||||
}
|
||||
|
||||
public boolean elderGuardianRidable = false;
|
||||
@@ -867,6 +873,9 @@ public class PurpurWorldConfig {
|
||||
public boolean huskControllable = true;
|
||||
@@ -923,6 +929,9 @@ public class PurpurWorldConfig {
|
||||
public double huskMaxHealth = 20.0D;
|
||||
public double huskScale = 1.0D;
|
||||
public double huskSpawnReinforcements = 0.1D;
|
||||
+ public boolean huskJockeyOnlyBaby = true;
|
||||
+ public double huskJockeyChance = 0.05D;
|
||||
@@ -200,9 +200,9 @@ index a5fec4cc1390581d98b5d64aa12e0a29ae149efc..58bab65407d4e1cff37d81d6bca00bf5
|
||||
private void huskSettings() {
|
||||
huskRidable = getBoolean("mobs.husk.ridable", huskRidable);
|
||||
huskRidableInWater = getBoolean("mobs.husk.ridable-in-water", huskRidableInWater);
|
||||
@@ -878,6 +887,9 @@ public class PurpurWorldConfig {
|
||||
}
|
||||
@@ -935,6 +944,9 @@ public class PurpurWorldConfig {
|
||||
huskMaxHealth = getDouble("mobs.husk.attributes.max_health", huskMaxHealth);
|
||||
huskScale = Mth.clamp(getDouble("mobs.husk.attributes.scale", huskScale), 0.0625D, 16.0D);
|
||||
huskSpawnReinforcements = getDouble("mobs.husk.attributes.spawn_reinforcements", huskSpawnReinforcements);
|
||||
+ huskJockeyOnlyBaby = getBoolean("mobs.husk.jockey.only-babies", huskJockeyOnlyBaby);
|
||||
+ huskJockeyChance = getDouble("mobs.husk.jockey.chance", huskJockeyChance);
|
||||
@@ -210,9 +210,9 @@ index a5fec4cc1390581d98b5d64aa12e0a29ae149efc..58bab65407d4e1cff37d81d6bca00bf5
|
||||
}
|
||||
|
||||
public boolean illusionerRidable = false;
|
||||
@@ -1698,6 +1710,9 @@ public class PurpurWorldConfig {
|
||||
public boolean zombieControllable = true;
|
||||
@@ -1828,6 +1840,9 @@ public class PurpurWorldConfig {
|
||||
public double zombieMaxHealth = 20.0D;
|
||||
public double zombieScale = 1.0D;
|
||||
public double zombieSpawnReinforcements = 0.1D;
|
||||
+ public boolean zombieJockeyOnlyBaby = true;
|
||||
+ public double zombieJockeyChance = 0.05D;
|
||||
@@ -220,9 +220,9 @@ index a5fec4cc1390581d98b5d64aa12e0a29ae149efc..58bab65407d4e1cff37d81d6bca00bf5
|
||||
private void zombieSettings() {
|
||||
zombieRidable = getBoolean("mobs.zombie.ridable", zombieRidable);
|
||||
zombieRidableInWater = getBoolean("mobs.zombie.ridable-in-water", zombieRidableInWater);
|
||||
@@ -1709,6 +1724,9 @@ public class PurpurWorldConfig {
|
||||
}
|
||||
@@ -1840,6 +1855,9 @@ public class PurpurWorldConfig {
|
||||
zombieMaxHealth = getDouble("mobs.zombie.attributes.max_health", zombieMaxHealth);
|
||||
zombieScale = Mth.clamp(getDouble("mobs.zombie.attributes.scale", zombieScale), 0.0625D, 16.0D);
|
||||
zombieSpawnReinforcements = getDouble("mobs.zombie.attributes.spawn_reinforcements", zombieSpawnReinforcements);
|
||||
+ zombieJockeyOnlyBaby = getBoolean("mobs.zombie.jockey.only-babies", zombieJockeyOnlyBaby);
|
||||
+ zombieJockeyChance = getDouble("mobs.zombie.jockey.chance", zombieJockeyChance);
|
||||
@@ -230,9 +230,9 @@ index a5fec4cc1390581d98b5d64aa12e0a29ae149efc..58bab65407d4e1cff37d81d6bca00bf5
|
||||
}
|
||||
|
||||
public boolean zombieHorseRidable = false;
|
||||
@@ -1745,6 +1763,9 @@ public class PurpurWorldConfig {
|
||||
public boolean zombieVillagerControllable = true;
|
||||
@@ -1877,6 +1895,9 @@ public class PurpurWorldConfig {
|
||||
public double zombieVillagerMaxHealth = 20.0D;
|
||||
public double zombieVillagerScale = 1.0D;
|
||||
public double zombieVillagerSpawnReinforcements = 0.1D;
|
||||
+ public boolean zombieVillagerJockeyOnlyBaby = true;
|
||||
+ public double zombieVillagerJockeyChance = 0.05D;
|
||||
@@ -240,9 +240,9 @@ index a5fec4cc1390581d98b5d64aa12e0a29ae149efc..58bab65407d4e1cff37d81d6bca00bf5
|
||||
private void zombieVillagerSettings() {
|
||||
zombieVillagerRidable = getBoolean("mobs.zombie_villager.ridable", zombieVillagerRidable);
|
||||
zombieVillagerRidableInWater = getBoolean("mobs.zombie_villager.ridable-in-water", zombieVillagerRidableInWater);
|
||||
@@ -1756,6 +1777,9 @@ public class PurpurWorldConfig {
|
||||
}
|
||||
@@ -1889,6 +1910,9 @@ public class PurpurWorldConfig {
|
||||
zombieVillagerMaxHealth = getDouble("mobs.zombie_villager.attributes.max_health", zombieVillagerMaxHealth);
|
||||
zombieVillagerScale = Mth.clamp(getDouble("mobs.zombie_villager.attributes.scale", zombieVillagerScale), 0.0625D, 16.0D);
|
||||
zombieVillagerSpawnReinforcements = getDouble("mobs.zombie_villager.attributes.spawn_reinforcements", zombieVillagerSpawnReinforcements);
|
||||
+ zombieVillagerJockeyOnlyBaby = getBoolean("mobs.zombie_villager.jockey.only-babies", zombieVillagerJockeyOnlyBaby);
|
||||
+ zombieVillagerJockeyChance = getDouble("mobs.zombie_villager.jockey.chance", zombieVillagerJockeyChance);
|
||||
@@ -250,9 +250,9 @@ index a5fec4cc1390581d98b5d64aa12e0a29ae149efc..58bab65407d4e1cff37d81d6bca00bf5
|
||||
}
|
||||
|
||||
public boolean zombifiedPiglinRidable = false;
|
||||
@@ -1763,6 +1787,9 @@ public class PurpurWorldConfig {
|
||||
public boolean zombifiedPiglinControllable = true;
|
||||
@@ -1897,6 +1921,9 @@ public class PurpurWorldConfig {
|
||||
public double zombifiedPiglinMaxHealth = 20.0D;
|
||||
public double zombifiedPiglinScale = 1.0D;
|
||||
public double zombifiedPiglinSpawnReinforcements = 0.0D;
|
||||
+ public boolean zombifiedPiglinJockeyOnlyBaby = true;
|
||||
+ public double zombifiedPiglinJockeyChance = 0.05D;
|
||||
@@ -260,9 +260,9 @@ index a5fec4cc1390581d98b5d64aa12e0a29ae149efc..58bab65407d4e1cff37d81d6bca00bf5
|
||||
private void zombifiedPiglinSettings() {
|
||||
zombifiedPiglinRidable = getBoolean("mobs.zombified_piglin.ridable", zombifiedPiglinRidable);
|
||||
zombifiedPiglinRidableInWater = getBoolean("mobs.zombified_piglin.ridable-in-water", zombifiedPiglinRidableInWater);
|
||||
@@ -1774,5 +1801,8 @@ public class PurpurWorldConfig {
|
||||
}
|
||||
@@ -1909,5 +1936,8 @@ public class PurpurWorldConfig {
|
||||
zombifiedPiglinMaxHealth = getDouble("mobs.zombified_piglin.attributes.max_health", zombifiedPiglinMaxHealth);
|
||||
zombifiedPiglinScale = Mth.clamp(getDouble("mobs.zombified_piglin.attributes.scale", zombifiedPiglinScale), 0.0625D, 16.0D);
|
||||
zombifiedPiglinSpawnReinforcements = getDouble("mobs.zombified_piglin.attributes.spawn_reinforcements", zombifiedPiglinSpawnReinforcements);
|
||||
+ zombifiedPiglinJockeyOnlyBaby = getBoolean("mobs.zombified_piglin.jockey.only-babies", zombifiedPiglinJockeyOnlyBaby);
|
||||
+ zombifiedPiglinJockeyChance = getDouble("mobs.zombified_piglin.jockey.chance", zombifiedPiglinJockeyChance);
|
||||
|
||||
Reference in New Issue
Block a user