Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-12-15 19:10:09 +01:00
bc127ea819
Upstream has released updates that appear to apply and compile correctly. This update has not been tested by PaperMC and as with ANY update, please do your own testing Bukkit Changes: eec4aab0 SPIGOT-6657: Add getPlayer to SheepDyeWoolEvent 205213c6 SPIGOT-6656: CauldronLevelChangeEvent is not fired correctly when dripstone fills the cauldron CraftBukkit Changes: b8c522d5 SPIGOT-6657: Add getPlayer to SheepDyeWoolEvent f04a77dc SPIGOT-6656: CauldronLevelChangeEvent is not fired correctly when dripstone fills the cauldron d1dbcebc SPIGOT-6653: Canceling snow bucket placement removes snow from bucket 4f34a67b #891: Fix scheduler task ID overflow and duplication issues Spigot Changes: d03d7f12 BUILDTOOLS-604: Rebuild patches
52 Zeilen
3.4 KiB
Diff
52 Zeilen
3.4 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Zach Brown <zach.brown@destroystokyo.com>
|
|
Date: Tue, 1 Mar 2016 13:09:16 -0600
|
|
Subject: [PATCH] Configurable baby zombie movement speed
|
|
|
|
|
|
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
index 3618cc017feb60e257a28f67cbddca3f792a9833..796c17e0941922a9716212c6eae91643d8360418 100644
|
|
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
@@ -78,4 +78,15 @@ public class PaperWorldConfig {
|
|
log("Max height for cactus growth " + cactusMaxHeight + ". Max height for reed growth " + reedMaxHeight + ". Max height for bamboo growth " + bambooMaxHeight + ". Min height for fully-grown bamboo " + bambooMinHeight + ".");
|
|
|
|
}
|
|
+
|
|
+ public double babyZombieMovementModifier;
|
|
+ private void babyZombieMovementModifier() {
|
|
+ babyZombieMovementModifier = getDouble("baby-zombie-movement-modifier", 0.5D);
|
|
+ if (PaperConfig.version < 20) {
|
|
+ babyZombieMovementModifier = getDouble("baby-zombie-movement-speed", 0.5D);
|
|
+ set("baby-zombie-movement-modifier", babyZombieMovementModifier);
|
|
+ }
|
|
+
|
|
+ log("Baby zombies will move at the speed of " + babyZombieMovementModifier);
|
|
+ }
|
|
}
|
|
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 564e8cb28c094a1bb9ab7d214464d6e6d9788bcf..f8b97aa5819e228f31c7953ee6e5c4e69fe55666 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/monster/Zombie.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/monster/Zombie.java
|
|
@@ -79,7 +79,7 @@ import org.bukkit.event.entity.EntityTransformEvent;
|
|
public class Zombie extends Monster {
|
|
|
|
private static final UUID SPEED_MODIFIER_BABY_UUID = UUID.fromString("B9766B59-9566-4402-BC1F-2EE2A276D836");
|
|
- private static final AttributeModifier SPEED_MODIFIER_BABY = new AttributeModifier(Zombie.SPEED_MODIFIER_BABY_UUID, "Baby speed boost", 0.5D, AttributeModifier.Operation.MULTIPLY_BASE);
|
|
+ private final AttributeModifier SPEED_MODIFIER_BABY = new AttributeModifier(Zombie.SPEED_MODIFIER_BABY_UUID, "Baby speed boost", 0.5D, AttributeModifier.Operation.MULTIPLY_BASE); private final AttributeModifier babyModifier = this.SPEED_MODIFIER_BABY; // Paper - remove static - Make baby speed configurable
|
|
private static final EntityDataAccessor<Boolean> DATA_BABY_ID = SynchedEntityData.defineId(Zombie.class, EntityDataSerializers.BOOLEAN);
|
|
private static final EntityDataAccessor<Integer> DATA_SPECIAL_TYPE_ID = SynchedEntityData.defineId(Zombie.class, EntityDataSerializers.INT);
|
|
public static final EntityDataAccessor<Boolean> DATA_DROWNED_CONVERSION_ID = SynchedEntityData.defineId(Zombie.class, EntityDataSerializers.BOOLEAN);
|
|
@@ -187,9 +187,9 @@ public class Zombie extends Monster {
|
|
if (this.level != null && !this.level.isClientSide) {
|
|
AttributeInstance attributemodifiable = this.getAttribute(Attributes.MOVEMENT_SPEED);
|
|
|
|
- attributemodifiable.removeModifier(Zombie.SPEED_MODIFIER_BABY);
|
|
+ attributemodifiable.removeModifier(this.babyModifier); // Paper
|
|
if (baby) {
|
|
- attributemodifiable.addTransientModifier(Zombie.SPEED_MODIFIER_BABY);
|
|
+ attributemodifiable.addTransientModifier(this.babyModifier); // Paper
|
|
}
|
|
}
|
|
|