mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-22 19:07:44 +01:00
Updated Upstream (Paper)
Upstream has released updates that appears to apply and compile correctly Paper Changes: d94d6a29 Optimise IEntityAccess#getPlayerByUUID (#2842) 4237539e Guard against serializing mismatching chunk coordinate (#2844) c1f57657 Updated Upstream (CraftBukkit) f5569fd3 Fix SkullMeta.setPlayerProfile() (#2833) 2f527126 Update upstream CB 4151617d Update no chunk loads for hoppers and double chests patch (#2777) d224bc03 [CI-SKIP] Passage outdated (#2776) db3af11c Fix race condition with regionfile being closed right after getting one (#2812) a817508f [CI-SKIP] Update dependency version in README.md (#2817) 9aeba7c9 Prevent bees loading chunks checking hive position (#2828)
This commit is contained in:
@@ -0,0 +1,57 @@
|
||||
From 6fbed3245a52188efd7c7affccb2fc8ba67dab9b Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Thu, 19 Dec 2019 16:59:46 -0600
|
||||
Subject: [PATCH] Add option for zombie villager transformation chance
|
||||
|
||||
---
|
||||
.../java/net/minecraft/server/EntityZombie.java | 15 +++++++++++++--
|
||||
.../java/net/pl3x/purpur/PurpurWorldConfig.java | 9 +++++++++
|
||||
2 files changed, 22 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityZombie.java b/src/main/java/net/minecraft/server/EntityZombie.java
|
||||
index 47248cc45e..5703e9e70c 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityZombie.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityZombie.java
|
||||
@@ -457,8 +457,19 @@ public class EntityZombie extends EntityMonster {
|
||||
@Override
|
||||
public void b(EntityLiving entityliving) {
|
||||
super.b(entityliving);
|
||||
- if ((this.world.getDifficulty() == EnumDifficulty.NORMAL || this.world.getDifficulty() == EnumDifficulty.HARD) && entityliving instanceof EntityVillager) {
|
||||
- if (this.world.getDifficulty() != EnumDifficulty.HARD && this.random.nextBoolean()) {
|
||||
+ // Purpur start
|
||||
+ if (entityliving instanceof EntityVillager) {
|
||||
+ double chance = 0.0D;
|
||||
+ switch (world.getDifficulty()) {
|
||||
+ case EASY:
|
||||
+ chance = world.purpurConfig.zombieVillagerTransformationChanceEasy;
|
||||
+ case NORMAL:
|
||||
+ chance = world.purpurConfig.zombieVillagerTransformationChanceNormal;
|
||||
+ case HARD:
|
||||
+ chance = world.purpurConfig.zombieVillagerTransformationChanceHard;
|
||||
+ }
|
||||
+ if (chance == 0.0D || random.nextDouble() > chance) {
|
||||
+ // Purpur end
|
||||
return;
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 0b01e5c7cd..17fe278a33 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -207,4 +207,13 @@ public class PurpurWorldConfig {
|
||||
villagerSpawnIronGolemRadius = getInt("mobs.villager.spawn-iron-golem.radius", villagerSpawnIronGolemRadius);
|
||||
villagerSpawnIronGolemLimit = getInt("mobs.villager.spawn-iron-golem.limit", villagerSpawnIronGolemLimit);
|
||||
}
|
||||
+
|
||||
+ public double zombieVillagerTransformationChanceEasy = 0.0D;
|
||||
+ public double zombieVillagerTransformationChanceNormal = 0.5D;
|
||||
+ public double zombieVillagerTransformationChanceHard = 1.0D;
|
||||
+ private void zombieSettings() {
|
||||
+ zombieVillagerTransformationChanceEasy = getDouble("mobs.zombie-villager.transformation-chance.easy", zombieVillagerTransformationChanceEasy);
|
||||
+ zombieVillagerTransformationChanceNormal = getDouble("mobs.zombie-villager.transformation-chance.normal", zombieVillagerTransformationChanceNormal);
|
||||
+ zombieVillagerTransformationChanceHard = getDouble("mobs.zombie-villager.transformation-chance.hard", zombieVillagerTransformationChanceHard);
|
||||
+ }
|
||||
}
|
||||
--
|
||||
2.24.0
|
||||
|
||||
Reference in New Issue
Block a user