mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 08:27:43 +01:00
633 lines
29 KiB
Diff
633 lines
29 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Jason Penilla <11360596+jpenilla@users.noreply.github.com>
|
|
Date: Sun, 15 Nov 2020 02:18:15 -0800
|
|
Subject: [PATCH] Make entity breeding times configurable
|
|
|
|
|
|
diff --git a/net/minecraft/world/entity/ai/behavior/VillagerMakeLove.java b/net/minecraft/world/entity/ai/behavior/VillagerMakeLove.java
|
|
index da3ab634c608a3e3b636ba2a519b3b9bb97a1659..f67b2f110ff465368e03ff9cf24318a18034e9d8 100644
|
|
--- a/net/minecraft/world/entity/ai/behavior/VillagerMakeLove.java
|
|
+++ b/net/minecraft/world/entity/ai/behavior/VillagerMakeLove.java
|
|
@@ -118,8 +118,10 @@ public class VillagerMakeLove extends Behavior<Villager> {
|
|
if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityBreedEvent(breedOffspring, parent, partner, null, null, 0).isCancelled()) {
|
|
return Optional.empty();
|
|
}
|
|
- parent.setAge(6000);
|
|
- partner.setAge(6000);
|
|
+ // Purpur start - Make entity breeding times configurable
|
|
+ parent.setAge(level.purpurConfig.villagerBreedingTicks);
|
|
+ partner.setAge(level.purpurConfig.villagerBreedingTicks);
|
|
+ // Purpur end - Make entity breeding times configurable
|
|
level.addFreshEntityWithPassengers(breedOffspring, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.BREEDING);
|
|
// CraftBukkit end - call EntityBreedEvent
|
|
level.broadcastEntityEvent(breedOffspring, EntityEvent.LOVE_HEARTS);
|
|
diff --git a/net/minecraft/world/entity/animal/Animal.java b/net/minecraft/world/entity/animal/Animal.java
|
|
index 8ccab236d1b8b00485eb6608778c43c5581641bd..3ad84e5c6ca7eaab196ffe03986c71d2d4c2ab7b 100644
|
|
--- a/net/minecraft/world/entity/animal/Animal.java
|
|
+++ b/net/minecraft/world/entity/animal/Animal.java
|
|
@@ -42,6 +42,7 @@ public abstract class Animal extends AgeableMob {
|
|
@Nullable
|
|
public EntityReference<ServerPlayer> loveCause;
|
|
public @Nullable ItemStack breedItem; // CraftBukkit - Add breedItem variable
|
|
+ public abstract int getPurpurBreedTime(); // Purpur - Make entity breeding times configurable
|
|
|
|
protected Animal(EntityType<? extends Animal> type, Level level) {
|
|
super(type, level);
|
|
@@ -268,8 +269,10 @@ public abstract class Animal extends AgeableMob {
|
|
player.awardStat(Stats.ANIMALS_BRED);
|
|
CriteriaTriggers.BRED_ANIMALS.trigger(player, this, animal, baby);
|
|
} // Paper - Call EntityBreedEvent
|
|
- this.setAge(6000);
|
|
- animal.setAge(6000);
|
|
+ // Purpur start - Make entity breeding times configurable
|
|
+ this.setAge(this.getPurpurBreedTime());
|
|
+ animal.setAge(animal.getPurpurBreedTime());
|
|
+ // Purpur end - Make entity breeding times configurable
|
|
this.resetLove();
|
|
animal.resetLove();
|
|
level.broadcastEntityEvent(this, EntityEvent.IN_LOVE_HEARTS);
|
|
diff --git a/net/minecraft/world/entity/animal/Bee.java b/net/minecraft/world/entity/animal/Bee.java
|
|
index b8dda3956152af17ce731d337ceb157d94bfb07b..f7d948294efcac1deac559d1fc9453f1dd0de659 100644
|
|
--- a/net/minecraft/world/entity/animal/Bee.java
|
|
+++ b/net/minecraft/world/entity/animal/Bee.java
|
|
@@ -482,6 +482,13 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
|
|
}
|
|
// Purpur end - Configurable entity base attributes
|
|
|
|
+ // Purpur start - Make entity breeding times configurable
|
|
+ @Override
|
|
+ public int getPurpurBreedTime() {
|
|
+ return this.level().purpurConfig.beeBreedingTicks;
|
|
+ }
|
|
+ // Purpur end - Make entity breeding times configurable
|
|
+
|
|
@Override
|
|
public int getRemainingPersistentAngerTime() {
|
|
return this.entityData.get(DATA_REMAINING_ANGER_TIME);
|
|
diff --git a/net/minecraft/world/entity/animal/Cat.java b/net/minecraft/world/entity/animal/Cat.java
|
|
index 7550a645d7814bc97243088e2d0f366adb081c76..307f62466c9486ffdf8c2991fb805730198f38eb 100644
|
|
--- a/net/minecraft/world/entity/animal/Cat.java
|
|
+++ b/net/minecraft/world/entity/animal/Cat.java
|
|
@@ -126,6 +126,13 @@ public class Cat extends TamableAnimal {
|
|
}
|
|
// Purpur end - Configurable entity base attributes
|
|
|
|
+ // Purpur start - Make entity breeding times configurable
|
|
+ @Override
|
|
+ public int getPurpurBreedTime() {
|
|
+ return this.level().purpurConfig.catBreedingTicks;
|
|
+ }
|
|
+ // Purpur end - Make entity breeding times configurable
|
|
+
|
|
@Override
|
|
protected void registerGoals() {
|
|
this.temptGoal = new Cat.CatTemptGoal(this, 0.6, stack -> stack.is(ItemTags.CAT_FOOD), true);
|
|
diff --git a/net/minecraft/world/entity/animal/Chicken.java b/net/minecraft/world/entity/animal/Chicken.java
|
|
index b5d3d5fc666d04bc18ca5157a3aacc639c2537c8..b65abf395b3d3c10dc20604b670e44c183f5131b 100644
|
|
--- a/net/minecraft/world/entity/animal/Chicken.java
|
|
+++ b/net/minecraft/world/entity/animal/Chicken.java
|
|
@@ -102,6 +102,13 @@ public class Chicken extends Animal {
|
|
}
|
|
// Purpur end - Configurable entity base attributes
|
|
|
|
+ // Purpur start - Make entity breeding times configurable
|
|
+ @Override
|
|
+ public int getPurpurBreedTime() {
|
|
+ return this.level().purpurConfig.chickenBreedingTicks;
|
|
+ }
|
|
+ // Purpur end - Make entity breeding times configurable
|
|
+
|
|
@Override
|
|
protected void registerGoals() {
|
|
this.goalSelector.addGoal(0, new FloatGoal(this));
|
|
diff --git a/net/minecraft/world/entity/animal/Cow.java b/net/minecraft/world/entity/animal/Cow.java
|
|
index e7100834ce813e9814139c6d6e957fce15861ab7..298cbc74a7d26de1cd0fb356ce9e802c0cc3a1ca 100644
|
|
--- a/net/minecraft/world/entity/animal/Cow.java
|
|
+++ b/net/minecraft/world/entity/animal/Cow.java
|
|
@@ -54,6 +54,13 @@ public class Cow extends AbstractCow {
|
|
}
|
|
// Purpur end - Configurable entity base attributes
|
|
|
|
+ // Purpur start - Make entity breeding times configurable
|
|
+ @Override
|
|
+ public int getPurpurBreedTime() {
|
|
+ return this.level().purpurConfig.cowBreedingTicks;
|
|
+ }
|
|
+ // Purpur end - Make entity breeding times configurable
|
|
+
|
|
@Override
|
|
protected void defineSynchedData(SynchedEntityData.Builder builder) {
|
|
super.defineSynchedData(builder);
|
|
diff --git a/net/minecraft/world/entity/animal/Fox.java b/net/minecraft/world/entity/animal/Fox.java
|
|
index 375ce5de2c041a7e61578c233ca0dc2ef3a588ca..2cdc3fee6dfae173215733cae2f92d7304d3c5d1 100644
|
|
--- a/net/minecraft/world/entity/animal/Fox.java
|
|
+++ b/net/minecraft/world/entity/animal/Fox.java
|
|
@@ -190,6 +190,13 @@ public class Fox extends Animal {
|
|
}
|
|
// Purpur end - Configurable entity base attributes
|
|
|
|
+ // Purpur start - Make entity breeding times configurable
|
|
+ @Override
|
|
+ public int getPurpurBreedTime() {
|
|
+ return this.level().purpurConfig.foxBreedingTicks;
|
|
+ }
|
|
+ // Purpur end - Make entity breeding times configurable
|
|
+
|
|
@Override
|
|
protected void defineSynchedData(SynchedEntityData.Builder builder) {
|
|
super.defineSynchedData(builder);
|
|
@@ -995,8 +1002,10 @@ public class Fox extends Animal {
|
|
CriteriaTriggers.BRED_ANIMALS.trigger(serverPlayer, this.animal, this.partner, fox);
|
|
}
|
|
|
|
- this.animal.setAge(6000);
|
|
- this.partner.setAge(6000);
|
|
+ // Purpur start - Make entity breeding times configurable
|
|
+ this.animal.setAge(this.animal.getPurpurBreedTime());
|
|
+ this.partner.setAge(this.partner.getPurpurBreedTime());
|
|
+ // Purpur end - Make entity breeding times configurable
|
|
this.animal.resetLove();
|
|
this.partner.resetLove();
|
|
serverLevel.addFreshEntityWithPassengers(fox, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.BREEDING); // CraftBukkit - added SpawnReason
|
|
diff --git a/net/minecraft/world/entity/animal/HappyGhast.java b/net/minecraft/world/entity/animal/HappyGhast.java
|
|
index c5a126718c93d01376b73eb1337cfa63d9acd99e..5f7ab269e406e6d6912a58b3b48123d6c4da282c 100644
|
|
--- a/net/minecraft/world/entity/animal/HappyGhast.java
|
|
+++ b/net/minecraft/world/entity/animal/HappyGhast.java
|
|
@@ -145,6 +145,13 @@ public class HappyGhast extends Animal {
|
|
}
|
|
// Purpur end - Configurable entity base attributes
|
|
|
|
+ // Purpur start - Make entity breeding times configurable
|
|
+ @Override
|
|
+ public int getPurpurBreedTime() {
|
|
+ return 6000;
|
|
+ }
|
|
+ // Purpur end - Make entity breeding times configurable
|
|
+
|
|
@Override
|
|
protected void ageBoundaryReached() {
|
|
if (this.isBaby()) {
|
|
diff --git a/net/minecraft/world/entity/animal/MushroomCow.java b/net/minecraft/world/entity/animal/MushroomCow.java
|
|
index 743faa77525d68181ee38415399bc6078f9360f8..6cbf93991ee375d2051128721a409a3a7a9064e8 100644
|
|
--- a/net/minecraft/world/entity/animal/MushroomCow.java
|
|
+++ b/net/minecraft/world/entity/animal/MushroomCow.java
|
|
@@ -87,6 +87,13 @@ public class MushroomCow extends AbstractCow implements Shearable {
|
|
}
|
|
// Purpur end - Configurable entity base attributes
|
|
|
|
+ // Purpur start - Make entity breeding times configurable
|
|
+ @Override
|
|
+ public int getPurpurBreedTime() {
|
|
+ return this.level().purpurConfig.mooshroomBreedingTicks;
|
|
+ }
|
|
+ // Purpur end - Make entity breeding times configurable
|
|
+
|
|
@Override
|
|
public float getWalkTargetValue(BlockPos pos, LevelReader level) {
|
|
return level.getBlockState(pos.below()).is(Blocks.MYCELIUM) ? 10.0F : level.getPathfindingCostFromLightLevels(pos);
|
|
diff --git a/net/minecraft/world/entity/animal/Ocelot.java b/net/minecraft/world/entity/animal/Ocelot.java
|
|
index 947c4d4a9f93c3da36ab5912ef362a60bdf75596..f047fa8d33ab6b7e01447f91e6c33e22e9ce9e02 100644
|
|
--- a/net/minecraft/world/entity/animal/Ocelot.java
|
|
+++ b/net/minecraft/world/entity/animal/Ocelot.java
|
|
@@ -90,6 +90,13 @@ public class Ocelot extends Animal {
|
|
}
|
|
// Purpur end - Configurable entity base attributes
|
|
|
|
+ // Purpur start - Make entity breeding times configurable
|
|
+ @Override
|
|
+ public int getPurpurBreedTime() {
|
|
+ return this.level().purpurConfig.ocelotBreedingTicks;
|
|
+ }
|
|
+ // Purpur end - Make entity breeding times configurable
|
|
+
|
|
public boolean isTrusting() {
|
|
return this.entityData.get(DATA_TRUSTING);
|
|
}
|
|
diff --git a/net/minecraft/world/entity/animal/Panda.java b/net/minecraft/world/entity/animal/Panda.java
|
|
index 53e4d1d35be13f04267151e1e8f808c5ad796ef5..fbe06479b24fd0e76a063eeac96447fa88c7d45b 100644
|
|
--- a/net/minecraft/world/entity/animal/Panda.java
|
|
+++ b/net/minecraft/world/entity/animal/Panda.java
|
|
@@ -142,6 +142,13 @@ public class Panda extends Animal {
|
|
}
|
|
// Purpur end - Configurable entity base attributes
|
|
|
|
+ // Purpur start - Make entity breeding times configurable
|
|
+ @Override
|
|
+ public int getPurpurBreedTime() {
|
|
+ return this.level().purpurConfig.pandaBreedingTicks;
|
|
+ }
|
|
+ // Purpur end - Make entity breeding times configurable
|
|
+
|
|
@Override
|
|
protected boolean canDispenserEquipIntoSlot(EquipmentSlot slot) {
|
|
return slot == EquipmentSlot.MAINHAND && this.canPickUpLoot();
|
|
diff --git a/net/minecraft/world/entity/animal/Parrot.java b/net/minecraft/world/entity/animal/Parrot.java
|
|
index 01e2f610e8f0c54917899b54625b17fb0629df67..0749317e7f1a7b54759b9cd335419e7f92362715 100644
|
|
--- a/net/minecraft/world/entity/animal/Parrot.java
|
|
+++ b/net/minecraft/world/entity/animal/Parrot.java
|
|
@@ -202,6 +202,13 @@ public class Parrot extends ShoulderRidingEntity implements FlyingAnimal {
|
|
}
|
|
// Purpur end - Configurable entity base attributes
|
|
|
|
+ // Purpur start - Make entity breeding times configurable
|
|
+ @Override
|
|
+ public int getPurpurBreedTime() {
|
|
+ return 6000;
|
|
+ }
|
|
+ // Purpur end - Make entity breeding times configurable
|
|
+
|
|
@Nullable
|
|
@Override
|
|
public SpawnGroupData finalizeSpawn(
|
|
diff --git a/net/minecraft/world/entity/animal/Pig.java b/net/minecraft/world/entity/animal/Pig.java
|
|
index 8a8c796377254d47e68d0d8b1c9bdac7d4b99360..5300c3ae50633aa513c25384c1a2084701921cb9 100644
|
|
--- a/net/minecraft/world/entity/animal/Pig.java
|
|
+++ b/net/minecraft/world/entity/animal/Pig.java
|
|
@@ -91,6 +91,13 @@ public class Pig extends Animal implements ItemSteerable {
|
|
}
|
|
// Purpur end - Configurable entity base attributes
|
|
|
|
+ // Purpur start - Make entity breeding times configurable
|
|
+ @Override
|
|
+ public int getPurpurBreedTime() {
|
|
+ return this.level().purpurConfig.pigBreedingTicks;
|
|
+ }
|
|
+ // Purpur end - Make entity breeding times configurable
|
|
+
|
|
@Override
|
|
protected void registerGoals() {
|
|
this.goalSelector.addGoal(0, new FloatGoal(this));
|
|
diff --git a/net/minecraft/world/entity/animal/PolarBear.java b/net/minecraft/world/entity/animal/PolarBear.java
|
|
index 2cf417f3bcf338a3edc4a2f71d8a700aca2e52dc..884137b428a1fe69bb61b9ae05b652357daecc27 100644
|
|
--- a/net/minecraft/world/entity/animal/PolarBear.java
|
|
+++ b/net/minecraft/world/entity/animal/PolarBear.java
|
|
@@ -125,6 +125,13 @@ public class PolarBear extends Animal implements NeutralMob {
|
|
}
|
|
// Purpur end - Configurable entity base attributes
|
|
|
|
+ // Purpur start - Make entity breeding times configurable
|
|
+ @Override
|
|
+ public int getPurpurBreedTime() {
|
|
+ return this.level().purpurConfig.polarBearBreedingTicks;
|
|
+ }
|
|
+ // Purpur end - Make entity breeding times configurable
|
|
+
|
|
@Nullable
|
|
@Override
|
|
public AgeableMob getBreedOffspring(ServerLevel level, AgeableMob partner) {
|
|
diff --git a/net/minecraft/world/entity/animal/Rabbit.java b/net/minecraft/world/entity/animal/Rabbit.java
|
|
index 7a2a95bb2fc1b7d2103da8ce7dd7f820af284f4f..78c6ccc6efafb11b42b051cc204341aa2d461307 100644
|
|
--- a/net/minecraft/world/entity/animal/Rabbit.java
|
|
+++ b/net/minecraft/world/entity/animal/Rabbit.java
|
|
@@ -155,6 +155,13 @@ public class Rabbit extends Animal {
|
|
}
|
|
// Purpur end - Configurable entity base attributes
|
|
|
|
+ // Purpur start - Make entity breeding times configurable
|
|
+ @Override
|
|
+ public int getPurpurBreedTime() {
|
|
+ return this.level().purpurConfig.rabbitBreedingTicks;
|
|
+ }
|
|
+ // Purpur end - Make entity breeding times configurable
|
|
+
|
|
@Override
|
|
public void registerGoals() {
|
|
this.goalSelector.addGoal(1, new FloatGoal(this));
|
|
diff --git a/net/minecraft/world/entity/animal/Turtle.java b/net/minecraft/world/entity/animal/Turtle.java
|
|
index 047a1b27d4af3d050784241c8a34fdebbd8e1f49..11a5f8d1a424531105436f96a097de6e9745be96 100644
|
|
--- a/net/minecraft/world/entity/animal/Turtle.java
|
|
+++ b/net/minecraft/world/entity/animal/Turtle.java
|
|
@@ -112,6 +112,13 @@ public class Turtle extends Animal {
|
|
}
|
|
// Purpur end - Configurable entity base attributes
|
|
|
|
+ // Purpur start - Make entity breeding times configurable
|
|
+ @Override
|
|
+ public int getPurpurBreedTime() {
|
|
+ return this.level().purpurConfig.turtleBreedingTicks;
|
|
+ }
|
|
+ // Purpur end - Make entity breeding times configurable
|
|
+
|
|
public void setHomePos(BlockPos homePos) {
|
|
this.homePos = homePos;
|
|
}
|
|
@@ -352,8 +359,10 @@ public class Turtle extends Animal {
|
|
}
|
|
|
|
this.turtle.setHasEgg(true);
|
|
- this.animal.setAge(6000);
|
|
- this.partner.setAge(6000);
|
|
+ // Purpur start - Make entity breeding times configurable
|
|
+ this.animal.setAge(this.animal.getPurpurBreedTime());
|
|
+ this.partner.setAge(this.partner.getPurpurBreedTime());
|
|
+ // Purpur end - Make entity breeding times configurable
|
|
this.animal.resetLove();
|
|
this.partner.resetLove();
|
|
RandomSource random = this.animal.getRandom();
|
|
diff --git a/net/minecraft/world/entity/animal/armadillo/Armadillo.java b/net/minecraft/world/entity/animal/armadillo/Armadillo.java
|
|
index 17d1a3d7ad33d99a57ea11be467e746b3dc99cbe..cf5e963d3ad0b5e22909a90dfe66d0a74ceff202 100644
|
|
--- a/net/minecraft/world/entity/animal/armadillo/Armadillo.java
|
|
+++ b/net/minecraft/world/entity/animal/armadillo/Armadillo.java
|
|
@@ -108,6 +108,13 @@ public class Armadillo extends Animal {
|
|
}
|
|
// Purpur end - Configurable entity base attributes
|
|
|
|
+ // Purpur start - Make entity breeding times configurable
|
|
+ @Override
|
|
+ public int getPurpurBreedTime() {
|
|
+ return this.level().purpurConfig.armadilloBreedingTicks;
|
|
+ }
|
|
+ // Purpur end - Make entity breeding times configurable
|
|
+
|
|
@Override
|
|
protected void defineSynchedData(SynchedEntityData.Builder builder) {
|
|
super.defineSynchedData(builder);
|
|
diff --git a/net/minecraft/world/entity/animal/axolotl/Axolotl.java b/net/minecraft/world/entity/animal/axolotl/Axolotl.java
|
|
index 330caf84f0a8e0edff764d4bd34b85b54b9f057f..277e955eabed07bdc50531dfe182de8cb05e56c2 100644
|
|
--- a/net/minecraft/world/entity/animal/axolotl/Axolotl.java
|
|
+++ b/net/minecraft/world/entity/animal/axolotl/Axolotl.java
|
|
@@ -146,6 +146,13 @@ public class Axolotl extends Animal implements Bucketable {
|
|
}
|
|
// Purpur end - Configurable entity base attributes
|
|
|
|
+ // Purpur start - Make entity breeding times configurable
|
|
+ @Override
|
|
+ public int getPurpurBreedTime() {
|
|
+ return this.level().purpurConfig.axolotlBreedingTicks;
|
|
+ }
|
|
+ // Purpur end - Make entity breeding times configurable
|
|
+
|
|
@Override
|
|
public float getWalkTargetValue(BlockPos pos, LevelReader level) {
|
|
return 0.0F;
|
|
diff --git a/net/minecraft/world/entity/animal/camel/Camel.java b/net/minecraft/world/entity/animal/camel/Camel.java
|
|
index 78df0eb0a0b6765406bd0dc041a02b099d86dd60..cc71c575a8fb62c41198c6e1f27bd0e88380f5bc 100644
|
|
--- a/net/minecraft/world/entity/animal/camel/Camel.java
|
|
+++ b/net/minecraft/world/entity/animal/camel/Camel.java
|
|
@@ -97,6 +97,13 @@ public class Camel extends AbstractHorse {
|
|
}
|
|
// Purpur end - Ridables
|
|
|
|
+ // Purpur start - Make entity breeding times configurable
|
|
+ @Override
|
|
+ public int getPurpurBreedTime() {
|
|
+ return this.level().purpurConfig.camelBreedingTicks;
|
|
+ }
|
|
+ // Purpur end - Make entity breeding times configurable
|
|
+
|
|
@Override
|
|
protected void addAdditionalSaveData(ValueOutput output) {
|
|
super.addAdditionalSaveData(output);
|
|
diff --git a/net/minecraft/world/entity/animal/frog/Frog.java b/net/minecraft/world/entity/animal/frog/Frog.java
|
|
index 4979ae6dc8f6c2361b443b8bbe90738e4a199200..78863bd593acaa46f33a49fadbd0cdb025074c11 100644
|
|
--- a/net/minecraft/world/entity/animal/frog/Frog.java
|
|
+++ b/net/minecraft/world/entity/animal/frog/Frog.java
|
|
@@ -164,6 +164,13 @@ public class Frog extends Animal {
|
|
}
|
|
// Purpur end - Ridables
|
|
|
|
+ // Purpur start - Make entity breeding times configurable
|
|
+ @Override
|
|
+ public int getPurpurBreedTime() {
|
|
+ return this.level().purpurConfig.frogBreedingTicks;
|
|
+ }
|
|
+ // Purpur end - Make entity breeding times configurable
|
|
+
|
|
@Override
|
|
protected Brain.Provider<Frog> brainProvider() {
|
|
return Brain.provider(MEMORY_TYPES, SENSOR_TYPES);
|
|
diff --git a/net/minecraft/world/entity/animal/goat/Goat.java b/net/minecraft/world/entity/animal/goat/Goat.java
|
|
index f417e9337a5102d6ec95a934c4126e1ec98a94d8..afcd9d3ea11d94ef811cce71f54f2a718619cc9f 100644
|
|
--- a/net/minecraft/world/entity/animal/goat/Goat.java
|
|
+++ b/net/minecraft/world/entity/animal/goat/Goat.java
|
|
@@ -132,6 +132,13 @@ public class Goat extends Animal {
|
|
}
|
|
// Purpur end - Ridables
|
|
|
|
+ // Purpur start - Make entity breeding times configurable
|
|
+ @Override
|
|
+ public int getPurpurBreedTime() {
|
|
+ return this.level().purpurConfig.goatBreedingTicks;
|
|
+ }
|
|
+ // Purpur end - Make entity breeding times configurable
|
|
+
|
|
@Override
|
|
protected Brain.Provider<Goat> brainProvider() {
|
|
return Brain.provider(MEMORY_TYPES, SENSOR_TYPES);
|
|
diff --git a/net/minecraft/world/entity/animal/horse/Donkey.java b/net/minecraft/world/entity/animal/horse/Donkey.java
|
|
index 65470905a29f1ae0ea7ac1d29ee108adcbc499c7..293d6059bc5e50b66b23e8e2e1d759e61cb26999 100644
|
|
--- a/net/minecraft/world/entity/animal/horse/Donkey.java
|
|
+++ b/net/minecraft/world/entity/animal/horse/Donkey.java
|
|
@@ -40,6 +40,13 @@ public class Donkey extends AbstractChestedHorse {
|
|
}
|
|
// Purpur end - Configurable entity base attributes
|
|
|
|
+ // Purpur start - Make entity breeding times configurable
|
|
+ @Override
|
|
+ public int getPurpurBreedTime() {
|
|
+ return this.level().purpurConfig.donkeyBreedingTicks;
|
|
+ }
|
|
+ // Purpur end - Make entity breeding times configurable
|
|
+
|
|
@Override
|
|
public SoundEvent getAmbientSound() {
|
|
return SoundEvents.DONKEY_AMBIENT;
|
|
diff --git a/net/minecraft/world/entity/animal/horse/Horse.java b/net/minecraft/world/entity/animal/horse/Horse.java
|
|
index 78b68881357f1bc1111478bb7c9e4f1ba55e055e..513856b5047842edd501eb6c23c13e3bf10d7249 100644
|
|
--- a/net/minecraft/world/entity/animal/horse/Horse.java
|
|
+++ b/net/minecraft/world/entity/animal/horse/Horse.java
|
|
@@ -71,6 +71,13 @@ public class Horse extends AbstractHorse {
|
|
}
|
|
// Purpur end - Configurable entity base attributes
|
|
|
|
+ // Purpur start - Make entity breeding times configurable
|
|
+ @Override
|
|
+ public int getPurpurBreedTime() {
|
|
+ return this.level().purpurConfig.horseBreedingTicks;
|
|
+ }
|
|
+ // Purpur end - Make entity breeding times configurable
|
|
+
|
|
@Override
|
|
protected void randomizeAttributes(RandomSource random) {
|
|
this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(generateMaxHealth(random::nextInt));
|
|
diff --git a/net/minecraft/world/entity/animal/horse/Llama.java b/net/minecraft/world/entity/animal/horse/Llama.java
|
|
index d1f1f30486ea5c4785e5c4c0104fa31a2e27521a..df3fd52ed0bc794919ff20c4eb8c561ec2b5ad8f 100644
|
|
--- a/net/minecraft/world/entity/animal/horse/Llama.java
|
|
+++ b/net/minecraft/world/entity/animal/horse/Llama.java
|
|
@@ -154,6 +154,13 @@ public class Llama extends AbstractChestedHorse implements RangedAttackMob {
|
|
}
|
|
// Purpur end - Configurable entity base attributes
|
|
|
|
+ // Purpur start - Make entity breeding times configurable
|
|
+ @Override
|
|
+ public int getPurpurBreedTime() {
|
|
+ return this.level().purpurConfig.llamaBreedingTicks;
|
|
+ }
|
|
+ // Purpur end - Make entity breeding times configurable
|
|
+
|
|
public boolean isTraderLlama() {
|
|
return false;
|
|
}
|
|
diff --git a/net/minecraft/world/entity/animal/horse/Mule.java b/net/minecraft/world/entity/animal/horse/Mule.java
|
|
index dc3723c5a0bca9e1023629657f668c7e5f6df4a4..5e6a9467d15e551ab2c8b3e42abd096a85e36037 100644
|
|
--- a/net/minecraft/world/entity/animal/horse/Mule.java
|
|
+++ b/net/minecraft/world/entity/animal/horse/Mule.java
|
|
@@ -39,6 +39,13 @@ public class Mule extends AbstractChestedHorse {
|
|
}
|
|
// Purpur end - Configurable entity base attributes
|
|
|
|
+ // Purpur start - Make entity breeding times configurable
|
|
+ @Override
|
|
+ public int getPurpurBreedTime() {
|
|
+ return this.level().purpurConfig.muleBreedingTicks;
|
|
+ }
|
|
+ // Purpur end - Make entity breeding times configurable
|
|
+
|
|
@Override
|
|
public SoundEvent getAmbientSound() {
|
|
return SoundEvents.MULE_AMBIENT;
|
|
diff --git a/net/minecraft/world/entity/animal/horse/SkeletonHorse.java b/net/minecraft/world/entity/animal/horse/SkeletonHorse.java
|
|
index 557e06b9002217b7ba5a07399bd71491cb0236c6..024591d5ffd396391864554e7b532910d465c30a 100644
|
|
--- a/net/minecraft/world/entity/animal/horse/SkeletonHorse.java
|
|
+++ b/net/minecraft/world/entity/animal/horse/SkeletonHorse.java
|
|
@@ -66,6 +66,13 @@ public class SkeletonHorse extends AbstractHorse {
|
|
}
|
|
// Purpur end - Configurable entity base attributes
|
|
|
|
+ // Purpur start - Make entity breeding times configurable
|
|
+ @Override
|
|
+ public int getPurpurBreedTime() {
|
|
+ return 6000;
|
|
+ }
|
|
+ // Purpur end - Make entity breeding times configurable
|
|
+
|
|
public static AttributeSupplier.Builder createAttributes() {
|
|
return createBaseHorseAttributes().add(Attributes.MAX_HEALTH, 15.0).add(Attributes.MOVEMENT_SPEED, 0.2F);
|
|
}
|
|
diff --git a/net/minecraft/world/entity/animal/horse/TraderLlama.java b/net/minecraft/world/entity/animal/horse/TraderLlama.java
|
|
index a566336bb088286a29eeeca1703addc98922f6e6..8b63470177d60d79fe0b774a301d36701026a803 100644
|
|
--- a/net/minecraft/world/entity/animal/horse/TraderLlama.java
|
|
+++ b/net/minecraft/world/entity/animal/horse/TraderLlama.java
|
|
@@ -70,6 +70,13 @@ public class TraderLlama extends Llama {
|
|
}
|
|
// Purpur end - Configurable entity base attributes
|
|
|
|
+ // Purpur start - Make entity breeding times configurable
|
|
+ @Override
|
|
+ public int getPurpurBreedTime() {
|
|
+ return this.level().purpurConfig.traderLlamaBreedingTicks;
|
|
+ }
|
|
+ // Purpur end - Make entity breeding times configurable
|
|
+
|
|
@Override
|
|
public boolean isTraderLlama() {
|
|
return true;
|
|
diff --git a/net/minecraft/world/entity/animal/horse/ZombieHorse.java b/net/minecraft/world/entity/animal/horse/ZombieHorse.java
|
|
index 6684f5dfb7dec101bad15b7ede3d9fd377aacd45..0d6d470b8680aed64d2b208b2ed9b037c96563d9 100644
|
|
--- a/net/minecraft/world/entity/animal/horse/ZombieHorse.java
|
|
+++ b/net/minecraft/world/entity/animal/horse/ZombieHorse.java
|
|
@@ -62,6 +62,13 @@ public class ZombieHorse extends AbstractHorse {
|
|
}
|
|
// Purpur end - Configurable entity base attributes
|
|
|
|
+ // Purpur start - Make entity breeding times configurable
|
|
+ @Override
|
|
+ public int getPurpurBreedTime() {
|
|
+ return 6000;
|
|
+ }
|
|
+ // Purpur end - Make entity breeding times configurable
|
|
+
|
|
public static AttributeSupplier.Builder createAttributes() {
|
|
return createBaseHorseAttributes().add(Attributes.MAX_HEALTH, 15.0).add(Attributes.MOVEMENT_SPEED, 0.2F);
|
|
}
|
|
diff --git a/net/minecraft/world/entity/animal/sheep/Sheep.java b/net/minecraft/world/entity/animal/sheep/Sheep.java
|
|
index e479dd9e94ee931b6e9001f89dc36406c3dde209..baa18417b0b66f33aa3bb21032cd5816dc0ed800 100644
|
|
--- a/net/minecraft/world/entity/animal/sheep/Sheep.java
|
|
+++ b/net/minecraft/world/entity/animal/sheep/Sheep.java
|
|
@@ -88,6 +88,13 @@ public class Sheep extends Animal implements Shearable {
|
|
}
|
|
// Purpur end - Configurable entity base attributes
|
|
|
|
+ // Purpur start - Make entity breeding times configurable
|
|
+ @Override
|
|
+ public int getPurpurBreedTime() {
|
|
+ return this.level().purpurConfig.sheepBreedingTicks;
|
|
+ }
|
|
+ // Purpur end - Make entity breeding times configurable
|
|
+
|
|
@Override
|
|
protected void registerGoals() {
|
|
this.eatBlockGoal = new EatBlockGoal(this);
|
|
diff --git a/net/minecraft/world/entity/animal/sniffer/Sniffer.java b/net/minecraft/world/entity/animal/sniffer/Sniffer.java
|
|
index eb6675394ecc5bba67e0f8bb0220ad92ef2b5e4f..7ef3c94f63c8a25d09e69b818ecdf79795803570 100644
|
|
--- a/net/minecraft/world/entity/animal/sniffer/Sniffer.java
|
|
+++ b/net/minecraft/world/entity/animal/sniffer/Sniffer.java
|
|
@@ -114,6 +114,13 @@ public class Sniffer extends Animal {
|
|
}
|
|
// Purpur end - Configurable entity base attributes
|
|
|
|
+ // Purpur start - Make entity breeding times configurable
|
|
+ @Override
|
|
+ public int getPurpurBreedTime() {
|
|
+ return this.level().purpurConfig.snifferBreedingTicks;
|
|
+ }
|
|
+ // Purpur end - Make entity breeding times configurable
|
|
+
|
|
@Override
|
|
protected void defineSynchedData(SynchedEntityData.Builder builder) {
|
|
super.defineSynchedData(builder);
|
|
diff --git a/net/minecraft/world/entity/animal/wolf/Wolf.java b/net/minecraft/world/entity/animal/wolf/Wolf.java
|
|
index 826c56281f1452fd1f4f9fba12a1fd169532e8cf..70b14a44f3d504788218b85317bb3812007386b0 100644
|
|
--- a/net/minecraft/world/entity/animal/wolf/Wolf.java
|
|
+++ b/net/minecraft/world/entity/animal/wolf/Wolf.java
|
|
@@ -217,6 +217,13 @@ public class Wolf extends TamableAnimal implements NeutralMob {
|
|
}
|
|
// Purpur end - Configurable entity base attributes
|
|
|
|
+ // Purpur start - Make entity breeding times configurable
|
|
+ @Override
|
|
+ public int getPurpurBreedTime() {
|
|
+ return this.level().purpurConfig.wolfBreedingTicks;
|
|
+ }
|
|
+ // Purpur end - Make entity breeding times configurable
|
|
+
|
|
@Override
|
|
protected void registerGoals() {
|
|
this.goalSelector.addGoal(1, new FloatGoal(this));
|
|
diff --git a/net/minecraft/world/entity/monster/Strider.java b/net/minecraft/world/entity/monster/Strider.java
|
|
index 5d41885ceb7145a516a398da0d7553faeb386710..6760c826cf72cc704f54ea0e3d6aaffde4ac22c4 100644
|
|
--- a/net/minecraft/world/entity/monster/Strider.java
|
|
+++ b/net/minecraft/world/entity/monster/Strider.java
|
|
@@ -117,6 +117,13 @@ public class Strider extends Animal implements ItemSteerable {
|
|
}
|
|
// Purpur end - Configurable entity base attributes
|
|
|
|
+ // Purpur start - Make entity breeding times configurable
|
|
+ @Override
|
|
+ public int getPurpurBreedTime() {
|
|
+ return this.level().purpurConfig.striderBreedingTicks;
|
|
+ }
|
|
+ // Purpur end - Make entity breeding times configurable
|
|
+
|
|
public static boolean checkStriderSpawnRules(
|
|
EntityType<Strider> entityType, LevelAccessor level, EntitySpawnReason spawnReason, BlockPos pos, RandomSource random
|
|
) {
|
|
diff --git a/net/minecraft/world/entity/monster/hoglin/Hoglin.java b/net/minecraft/world/entity/monster/hoglin/Hoglin.java
|
|
index facab39612157cdc39bb7d8efad6e90d4fb7d001..1f5096856ab353e2920003a54f530c952e8988da 100644
|
|
--- a/net/minecraft/world/entity/monster/hoglin/Hoglin.java
|
|
+++ b/net/minecraft/world/entity/monster/hoglin/Hoglin.java
|
|
@@ -121,6 +121,13 @@ public class Hoglin extends Animal implements Enemy, HoglinBase {
|
|
}
|
|
// Purpur end - Configurable entity base attributes
|
|
|
|
+ // Purpur start - Make entity breeding times configurable
|
|
+ @Override
|
|
+ public int getPurpurBreedTime() {
|
|
+ return this.level().purpurConfig.hoglinBreedingTicks;
|
|
+ }
|
|
+ // Purpur end - Make entity breeding times configurable
|
|
+
|
|
@VisibleForTesting
|
|
public void setTimeInOverworld(int timeInOverworld) {
|
|
this.timeInOverworld = timeInOverworld;
|