mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-04-19 17:58:15 +02:00
Upstream has released updates that appear to apply and compile correctly Paper Changes: PaperMC/Paper@e4a5a894 Update to Minecraft 26.1.1 PaperMC/Paper@92a4d8db Update "Only write chunk data to disk if it serializes without throwing" PaperMC/Paper@02d9cbce Update "Entity load/save limit per chunk" PaperMC/Paper@cb696286 Update "Attempt to recalculate regionfile header if it is corrupt" PaperMC/Paper@4662bab9 Update "Incremental chunk and player saving" PaperMC/Paper@4dddc82f Implement new version schema: `<mcver>.build.<paper_build_no>-<paper_status>` / `<mcver>.local-SNAPSHOT` PaperMC/Paper@fc0a9980 Set channel to ALPHA PaperMC/Paper@a4fa0357 update gradle wrapper PaperMC/Paper@a15ceb7a Update fill-gradle to 1.0.11 PaperMC/Paper@52f7e24e Publish to releases repository PaperMC/Paper@bb7ff8f0 Update "Optimise general POI access" PaperMC/Paper@ac42a07e Update "Flush regionfiles on save configuration option" PaperMC/Paper@14357cc5 Avoid using the regionfile directory name to determine if it is chunk data PaperMC/Paper@a2f4d349 Update "Optimise collision checking in player move packet handling" PaperMC/Paper@50303a0e Update "Add explicit flush support to Log4j AsyncAppender" PaperMC/Paper@7bc4f895 Shift unapplied patches PaperMC/Paper@62ba2c4f Update "Improve keepalive ping system" PaperMC/Paper@f6d27019 Update "Optimise EntityScheduler ticking" PaperMC/Paper@4d8d06c7 Fix WorldBorder#setCenter ignoring new values on 26.1.1 (#13741) PaperMC/Paper@f9da8035 update unpick definitions PaperMC/Paper@fc71a133 [ci/skip] fixup previous commit PaperMC/Paper@4c91cd34 Lazy set Entity.projectileSource in AbstractProjectile#getShooter PaperMC/Paper@3d1da60c Cache the climbing check in activation range (#12764) PaperMC/Paper@575630f3 feat: Optimize ServerWaypointManager when locator bar is disabled PaperMC/Paper@742daf02 [ci/skip] fixup previous commit PaperMC/Paper@d29063da Rebuild patches PaperMC/Paper@ce581c3c Bump deps to match Vanilla versions (#13744) PaperMC/Paper@f3e9a934 Fix attack check PaperMC/Paper@b4743b58 Fix gamerule loading in Management Protocol (#13753) PaperMC/Paper@c53ac8a1 Add PlayerToggleEntityAgeLockEvent (#13742) PaperMC/Paper@59081719 fixup previous event PaperMC/Paper@7b49b586 Update "Optional per player mob spawns" PaperMC/Paper@1fae14c2 Update "Improve cancelling PreCreatureSpawnEvent with per player mob spawns" PaperMC/Paper@c40cb75b Update "Optimize Hoppers" PaperMC/Paper@edad1e4c Update "Anti-Xray" PaperMC/Paper@106a934d [ci/skip] Drop stale TODO PaperMC/Paper@77c0866f handle legacy uid in vanilla migration and always write metadata during migration
669 lines
32 KiB
Diff
669 lines
32 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 37cf6c4cef5a8885fddd9f637cac024892b498a3..859842ba642f4307e5a1f834007afe505ce58a8c 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(child, source, target, null, null, 0).isCancelled()) {
|
|
return Optional.empty();
|
|
}
|
|
- source.setAge(6000);
|
|
- target.setAge(6000);
|
|
+ // Purpur start - Make entity breeding times configurable
|
|
+ source.setAge(level.purpurConfig.villagerBreedingTicks);
|
|
+ target.setAge(level.purpurConfig.villagerBreedingTicks);
|
|
+ // Purpur end - Make entity breeding times configurable
|
|
level.addFreshEntityWithPassengers(child, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.BREEDING);
|
|
// CraftBukkit end - call EntityBreedEvent
|
|
level.broadcastEntityEvent(child, EntityEvent.LOVE_HEARTS);
|
|
diff --git a/net/minecraft/world/entity/animal/Animal.java b/net/minecraft/world/entity/animal/Animal.java
|
|
index 774210ebe09af15f85a919512dfd2f98e7bdee6e..407ffe0e6b5893c3abf0b1ff60fd0a27ec965e0c 100644
|
|
--- a/net/minecraft/world/entity/animal/Animal.java
|
|
+++ b/net/minecraft/world/entity/animal/Animal.java
|
|
@@ -46,6 +46,7 @@ public abstract class Animal extends AgeableMob {
|
|
public int inLove = 0;
|
|
public @Nullable EntityReference<ServerPlayer> loveCause;
|
|
public @Nullable ItemStack breedItem; // CraftBukkit - Add breedItem variable
|
|
+ public abstract int getPurpurBreedTime(); // Purpur - Make entity breeding times configurable
|
|
|
|
protected Animal(final EntityType<? extends Animal> type, final Level level) {
|
|
super(type, level);
|
|
@@ -271,8 +272,10 @@ public abstract class Animal extends AgeableMob {
|
|
player.awardStat(Stats.ANIMALS_BRED);
|
|
CriteriaTriggers.BRED_ANIMALS.trigger(player, this, partner, offspring);
|
|
} // Paper - Call EntityBreedEvent
|
|
- this.setAge(6000);
|
|
- partner.setAge(6000);
|
|
+ // Purpur start - Make entity breeding times configurable
|
|
+ this.setAge(this.getPurpurBreedTime());
|
|
+ partner.setAge(partner.getPurpurBreedTime());
|
|
+ // Purpur end - Make entity breeding times configurable
|
|
this.resetLove();
|
|
partner.resetLove();
|
|
level.broadcastEntityEvent(this, EntityEvent.IN_LOVE_HEARTS);
|
|
diff --git a/net/minecraft/world/entity/animal/armadillo/Armadillo.java b/net/minecraft/world/entity/animal/armadillo/Armadillo.java
|
|
index 7c2c71a57b9278aea428e314462cebc08e168b50..83688ac732758ee0613fc2e187838b4607b8edc9 100644
|
|
--- a/net/minecraft/world/entity/animal/armadillo/Armadillo.java
|
|
+++ b/net/minecraft/world/entity/animal/armadillo/Armadillo.java
|
|
@@ -115,6 +115,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(final SynchedEntityData.Builder entityData) {
|
|
super.defineSynchedData(entityData);
|
|
diff --git a/net/minecraft/world/entity/animal/axolotl/Axolotl.java b/net/minecraft/world/entity/animal/axolotl/Axolotl.java
|
|
index c10b06f8adcd59869d043e48cfe3fdb60051c3db..d4178d85b74a41a0d2808681008f1686578db98d 100644
|
|
--- a/net/minecraft/world/entity/animal/axolotl/Axolotl.java
|
|
+++ b/net/minecraft/world/entity/animal/axolotl/Axolotl.java
|
|
@@ -143,6 +143,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(final BlockPos pos, final LevelReader level) {
|
|
return 0.0F;
|
|
diff --git a/net/minecraft/world/entity/animal/bee/Bee.java b/net/minecraft/world/entity/animal/bee/Bee.java
|
|
index b22f49887219bcffe8e30fd22e9f9dd67fc371bc..44f11b07a2b8a37db399976c4c79b44c4416f2e9 100644
|
|
--- a/net/minecraft/world/entity/animal/bee/Bee.java
|
|
+++ b/net/minecraft/world/entity/animal/bee/Bee.java
|
|
@@ -488,6 +488,13 @@ public class Bee extends Animal implements FlyingAnimal, NeutralMob {
|
|
}
|
|
// 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 long getPersistentAngerEndTime() {
|
|
return this.entityData.get(DATA_ANGER_END_TIME);
|
|
diff --git a/net/minecraft/world/entity/animal/camel/Camel.java b/net/minecraft/world/entity/animal/camel/Camel.java
|
|
index 0b3cf5ad57350c5c7a453dc7a96891238491a41a..5a66cdb4a75651a9dc017d80f2c2f56e878d83ad 100644
|
|
--- a/net/minecraft/world/entity/animal/camel/Camel.java
|
|
+++ b/net/minecraft/world/entity/animal/camel/Camel.java
|
|
@@ -103,6 +103,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(final ValueOutput output) {
|
|
super.addAdditionalSaveData(output);
|
|
diff --git a/net/minecraft/world/entity/animal/chicken/Chicken.java b/net/minecraft/world/entity/animal/chicken/Chicken.java
|
|
index 0392c8a94801a1dee735ff610058fbb2180571fa..ccf7c4630e08d9be54a4634c642a4cd1cd542a82 100644
|
|
--- a/net/minecraft/world/entity/animal/chicken/Chicken.java
|
|
+++ b/net/minecraft/world/entity/animal/chicken/Chicken.java
|
|
@@ -106,6 +106,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/Cow.java b/net/minecraft/world/entity/animal/cow/Cow.java
|
|
index 33c0b8f2c43065ea89b3f9c6a519dde27620ed07..7981f60f10c44ab2459933cb15ee961103922364 100644
|
|
--- a/net/minecraft/world/entity/animal/cow/Cow.java
|
|
+++ b/net/minecraft/world/entity/animal/cow/Cow.java
|
|
@@ -59,6 +59,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(final SynchedEntityData.Builder entityData) {
|
|
super.defineSynchedData(entityData);
|
|
diff --git a/net/minecraft/world/entity/animal/cow/MushroomCow.java b/net/minecraft/world/entity/animal/cow/MushroomCow.java
|
|
index d6ec397a14753526dd34ab3a7e69ae4be36c04a6..68a4edef68c9db6b2b0716fc6283e2c7345d4cda 100644
|
|
--- a/net/minecraft/world/entity/animal/cow/MushroomCow.java
|
|
+++ b/net/minecraft/world/entity/animal/cow/MushroomCow.java
|
|
@@ -85,6 +85,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(final BlockPos pos, final LevelReader level) {
|
|
return level.getBlockState(pos.below()).is(Blocks.MYCELIUM) ? 10.0F : level.getPathfindingCostFromLightLevels(pos);
|
|
diff --git a/net/minecraft/world/entity/animal/equine/Donkey.java b/net/minecraft/world/entity/animal/equine/Donkey.java
|
|
index 1a130fc107315b40b4e34a97beb53f7fe0ced14f..8c3d3f0f24e6f5a9b8aa9bf58f3c8b679896017d 100644
|
|
--- a/net/minecraft/world/entity/animal/equine/Donkey.java
|
|
+++ b/net/minecraft/world/entity/animal/equine/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/equine/Horse.java b/net/minecraft/world/entity/animal/equine/Horse.java
|
|
index 8ba8430f41ce74736f405bfac2ef5de6fffe7d49..dbb586058f38b6c4f81e2f6567b7ae8ebbaff5a2 100644
|
|
--- a/net/minecraft/world/entity/animal/equine/Horse.java
|
|
+++ b/net/minecraft/world/entity/animal/equine/Horse.java
|
|
@@ -72,6 +72,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(final RandomSource random) {
|
|
this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(generateMaxHealth(random::nextInt));
|
|
diff --git a/net/minecraft/world/entity/animal/equine/Llama.java b/net/minecraft/world/entity/animal/equine/Llama.java
|
|
index 12abeae3623b49819ab6f852c88ee86ed8c69948..b3c8ccbb3f79043427dcb6f383c4b02d35124689 100644
|
|
--- a/net/minecraft/world/entity/animal/equine/Llama.java
|
|
+++ b/net/minecraft/world/entity/animal/equine/Llama.java
|
|
@@ -151,6 +151,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/equine/Mule.java b/net/minecraft/world/entity/animal/equine/Mule.java
|
|
index a866b93312391142b030605e2108fe522d3d8ddd..cf0f3c9d5f8ff348e6fb76db823da4cadce4fc5b 100644
|
|
--- a/net/minecraft/world/entity/animal/equine/Mule.java
|
|
+++ b/net/minecraft/world/entity/animal/equine/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/equine/SkeletonHorse.java b/net/minecraft/world/entity/animal/equine/SkeletonHorse.java
|
|
index fcc9b9f884aed489ab6016d1de3dfd861781d8e5..a4a878791be034140a50b901d5daf2533d299756 100644
|
|
--- a/net/minecraft/world/entity/animal/equine/SkeletonHorse.java
|
|
+++ b/net/minecraft/world/entity/animal/equine/SkeletonHorse.java
|
|
@@ -67,6 +67,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/equine/TraderLlama.java b/net/minecraft/world/entity/animal/equine/TraderLlama.java
|
|
index bfae12b0a2b094dcd5953058f4d6245077a04fd7..7c41aecd2699725211babbac0350cb241f31ca41 100644
|
|
--- a/net/minecraft/world/entity/animal/equine/TraderLlama.java
|
|
+++ b/net/minecraft/world/entity/animal/equine/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/equine/ZombieHorse.java b/net/minecraft/world/entity/animal/equine/ZombieHorse.java
|
|
index ae429aec9be39d9af7da4671db15a4506da135d9..4be11663154a870a21832ddba05764a897ce90bd 100644
|
|
--- a/net/minecraft/world/entity/animal/equine/ZombieHorse.java
|
|
+++ b/net/minecraft/world/entity/animal/equine/ZombieHorse.java
|
|
@@ -78,6 +78,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, 25.0);
|
|
}
|
|
diff --git a/net/minecraft/world/entity/animal/feline/Cat.java b/net/minecraft/world/entity/animal/feline/Cat.java
|
|
index e31cf2f1c4a0a419ba378424ea0a059a0117e0a4..334879e3f1a28825749e7e4a3863454ee0a5ac9a 100644
|
|
--- a/net/minecraft/world/entity/animal/feline/Cat.java
|
|
+++ b/net/minecraft/world/entity/animal/feline/Cat.java
|
|
@@ -128,6 +128,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, i -> i.is(ItemTags.CAT_FOOD), true);
|
|
diff --git a/net/minecraft/world/entity/animal/feline/Ocelot.java b/net/minecraft/world/entity/animal/feline/Ocelot.java
|
|
index 4bf42db19d0f58338f32af1ab7c802c274a8581c..2accf49e8dd907c8a482e5317d07b28fc5492a1e 100644
|
|
--- a/net/minecraft/world/entity/animal/feline/Ocelot.java
|
|
+++ b/net/minecraft/world/entity/animal/feline/Ocelot.java
|
|
@@ -91,6 +91,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/fox/Fox.java b/net/minecraft/world/entity/animal/fox/Fox.java
|
|
index ec4137a994005c4e7845d63d9347c0586c6f77ee..579718387c43ef36eacfe3abfb789b64e17fa55f 100644
|
|
--- a/net/minecraft/world/entity/animal/fox/Fox.java
|
|
+++ b/net/minecraft/world/entity/animal/fox/Fox.java
|
|
@@ -201,6 +201,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(final SynchedEntityData.Builder entityData) {
|
|
super.defineSynchedData(entityData);
|
|
@@ -1016,8 +1023,10 @@ public class Fox extends Animal {
|
|
CriteriaTriggers.BRED_ANIMALS.trigger(loveCause, this.animal, this.partner, offspring);
|
|
}
|
|
|
|
- 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();
|
|
this.level.addFreshEntityWithPassengers(offspring, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.BREEDING); // CraftBukkit - added SpawnReason
|
|
diff --git a/net/minecraft/world/entity/animal/frog/Frog.java b/net/minecraft/world/entity/animal/frog/Frog.java
|
|
index 977ee6a71e0c52f115a221b09248596db2534739..3d2f06b4e686345632a2493366177e9002cae554 100644
|
|
--- a/net/minecraft/world/entity/animal/frog/Frog.java
|
|
+++ b/net/minecraft/world/entity/animal/frog/Frog.java
|
|
@@ -141,6 +141,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<Frog> makeBrain(final Brain.Packed packedBrain) {
|
|
return BRAIN_PROVIDER.makeBrain(this, packedBrain);
|
|
diff --git a/net/minecraft/world/entity/animal/goat/Goat.java b/net/minecraft/world/entity/animal/goat/Goat.java
|
|
index d4353bb9ba2168b81726bfaa406175e7f2af601a..c8b2ef70ca3f730d87c30af9f29adb2ad083d26f 100644
|
|
--- a/net/minecraft/world/entity/animal/goat/Goat.java
|
|
+++ b/net/minecraft/world/entity/animal/goat/Goat.java
|
|
@@ -117,6 +117,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<Goat> makeBrain(final Brain.Packed packedBrain) {
|
|
return BRAIN_PROVIDER.makeBrain(this, packedBrain);
|
|
diff --git a/net/minecraft/world/entity/animal/happyghast/HappyGhast.java b/net/minecraft/world/entity/animal/happyghast/HappyGhast.java
|
|
index f7f65e0935404a2eb404e5053acb9f6acd353272..b049adf5604555041102497d7fe0c865c56d751f 100644
|
|
--- a/net/minecraft/world/entity/animal/happyghast/HappyGhast.java
|
|
+++ b/net/minecraft/world/entity/animal/happyghast/HappyGhast.java
|
|
@@ -154,6 +154,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/nautilus/Nautilus.java b/net/minecraft/world/entity/animal/nautilus/Nautilus.java
|
|
index cc38312d0a59529e7b8f799ffec2f917c9aa0e9b..e89c0638f7b6d1a463a895dbab5994c15aa4add3 100644
|
|
--- a/net/minecraft/world/entity/animal/nautilus/Nautilus.java
|
|
+++ b/net/minecraft/world/entity/animal/nautilus/Nautilus.java
|
|
@@ -39,6 +39,13 @@ public class Nautilus extends AbstractNautilus {
|
|
}
|
|
// Purpur end - Configurable entity base attributes
|
|
|
|
+ // Purpur start - Make entity breeding times configurable
|
|
+ @Override
|
|
+ public int getPurpurBreedTime() {
|
|
+ return this.level().purpurConfig.nautilusBreedingTicks;
|
|
+ }
|
|
+ // Purpur end - Make entity breeding times configurable
|
|
+
|
|
@Override
|
|
protected Brain<Nautilus> makeBrain(final Brain.Packed packedBrain) {
|
|
return BRAIN_PROVIDER.makeBrain(this, packedBrain);
|
|
diff --git a/net/minecraft/world/entity/animal/nautilus/ZombieNautilus.java b/net/minecraft/world/entity/animal/nautilus/ZombieNautilus.java
|
|
index 087e768c35c2c2af191c75648b278154ce5e593c..18bfb321e3728d3fa0596da0b86e4b76ced2178a 100644
|
|
--- a/net/minecraft/world/entity/animal/nautilus/ZombieNautilus.java
|
|
+++ b/net/minecraft/world/entity/animal/nautilus/ZombieNautilus.java
|
|
@@ -59,6 +59,13 @@ public class ZombieNautilus extends AbstractNautilus {
|
|
}
|
|
// 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 AbstractNautilus.createAttributes().add(Attributes.MOVEMENT_SPEED, 1.1F);
|
|
}
|
|
diff --git a/net/minecraft/world/entity/animal/panda/Panda.java b/net/minecraft/world/entity/animal/panda/Panda.java
|
|
index 838bc9b3f5bc3df3db16ba564222eed65215461a..f413e018856d485f706d2b8742b92b3253fe6532 100644
|
|
--- a/net/minecraft/world/entity/animal/panda/Panda.java
|
|
+++ b/net/minecraft/world/entity/animal/panda/Panda.java
|
|
@@ -146,6 +146,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(final EquipmentSlot slot) {
|
|
return slot == EquipmentSlot.MAINHAND && this.canPickUpLoot();
|
|
diff --git a/net/minecraft/world/entity/animal/parrot/Parrot.java b/net/minecraft/world/entity/animal/parrot/Parrot.java
|
|
index d3b9a3ac77f03e3b6b580a678283f85a19cb660e..af3d3b90f2e4d433b3b842dbc37d8c507a73dc1f 100644
|
|
--- a/net/minecraft/world/entity/animal/parrot/Parrot.java
|
|
+++ b/net/minecraft/world/entity/animal/parrot/Parrot.java
|
|
@@ -207,6 +207,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
|
|
+
|
|
@Override
|
|
public @Nullable SpawnGroupData finalizeSpawn(
|
|
final ServerLevelAccessor level, final DifficultyInstance difficulty, final EntitySpawnReason spawnReason, @Nullable SpawnGroupData groupData
|
|
diff --git a/net/minecraft/world/entity/animal/pig/Pig.java b/net/minecraft/world/entity/animal/pig/Pig.java
|
|
index 02ed5052bd06844ec6811c4249398ba8ba8c4ea6..514f13a6965b5f53890ddd2e47ea89e0c1a515c1 100644
|
|
--- a/net/minecraft/world/entity/animal/pig/Pig.java
|
|
+++ b/net/minecraft/world/entity/animal/pig/Pig.java
|
|
@@ -93,6 +93,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/PolarBear.java b/net/minecraft/world/entity/animal/polarbear/PolarBear.java
|
|
index e50c934e2c9959f843aae2b2dd05a682ca5f59fc..6d4713663c94e91da7d809e65fa205aff2782f38 100644
|
|
--- a/net/minecraft/world/entity/animal/polarbear/PolarBear.java
|
|
+++ b/net/minecraft/world/entity/animal/polarbear/PolarBear.java
|
|
@@ -127,6 +127,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
|
|
+
|
|
@Override
|
|
public @Nullable AgeableMob getBreedOffspring(final ServerLevel level, final AgeableMob partner) {
|
|
return EntityType.POLAR_BEAR.create(level, EntitySpawnReason.BREEDING);
|
|
diff --git a/net/minecraft/world/entity/animal/rabbit/Rabbit.java b/net/minecraft/world/entity/animal/rabbit/Rabbit.java
|
|
index bf643b9e6929890f061ac2c44b196460234095c4..3aefbdc3e537bc53bba296c7876dee93c95a77ca 100644
|
|
--- a/net/minecraft/world/entity/animal/rabbit/Rabbit.java
|
|
+++ b/net/minecraft/world/entity/animal/rabbit/Rabbit.java
|
|
@@ -170,6 +170,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/sheep/Sheep.java b/net/minecraft/world/entity/animal/sheep/Sheep.java
|
|
index eb919dc63d950af08448b75559467ec88623d6b8..e83fe71b4f63f8f7fa1976f7d2165c36bbb184bf 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 7335e46f249b9a88ca0401493636f6e06c0e196d..f169d075cdaa1426c152a8f2682dbaba23de4ccc 100644
|
|
--- a/net/minecraft/world/entity/animal/sniffer/Sniffer.java
|
|
+++ b/net/minecraft/world/entity/animal/sniffer/Sniffer.java
|
|
@@ -119,6 +119,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(final SynchedEntityData.Builder entityData) {
|
|
super.defineSynchedData(entityData);
|
|
diff --git a/net/minecraft/world/entity/animal/turtle/Turtle.java b/net/minecraft/world/entity/animal/turtle/Turtle.java
|
|
index 2dfcf0c9f8eb762d1683d2841a05219c497fddfc..62d9fce83cc44165c5356049a12bf6081c925857 100644
|
|
--- a/net/minecraft/world/entity/animal/turtle/Turtle.java
|
|
+++ b/net/minecraft/world/entity/animal/turtle/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(final BlockPos pos) {
|
|
this.homePos = pos;
|
|
}
|
|
@@ -343,8 +350,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/wolf/Wolf.java b/net/minecraft/world/entity/animal/wolf/Wolf.java
|
|
index d457bd20c8d644d60795776b4c19a88a8b1ffd09..0ac4e30fd4f3158b5f53e9ba8bc70964907c63a2 100644
|
|
--- a/net/minecraft/world/entity/animal/wolf/Wolf.java
|
|
+++ b/net/minecraft/world/entity/animal/wolf/Wolf.java
|
|
@@ -213,6 +213,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 f8134a362a2faa49beccb840ea8a899aa4681638..38a17c219bce1a8a8a67b136e0eaf5cf15ec94fd 100644
|
|
--- a/net/minecraft/world/entity/monster/Strider.java
|
|
+++ b/net/minecraft/world/entity/monster/Strider.java
|
|
@@ -118,6 +118,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(
|
|
final EntityType<Strider> ignoredType,
|
|
final LevelAccessor level,
|
|
diff --git a/net/minecraft/world/entity/monster/hoglin/Hoglin.java b/net/minecraft/world/entity/monster/hoglin/Hoglin.java
|
|
index 352139672f2cf1a7d624db4cc5bdef3ab0c9b942..d158807f22a0a08614b2d7054663ef2782a519e3 100644
|
|
--- a/net/minecraft/world/entity/monster/hoglin/Hoglin.java
|
|
+++ b/net/minecraft/world/entity/monster/hoglin/Hoglin.java
|
|
@@ -98,6 +98,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(final int timeInOverworld) {
|
|
this.timeInOverworld = timeInOverworld;
|