mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-21 18:37:42 +01:00
Upstream has released updates that appears to apply and compile correctly Paper Changes: df0d7b0d Update upstream CB 6ea3c2cf [CI-SKIP] Rebuild patches d7bed4cb Heavily optimise random block ticking (#2914) b66d9ff8 Update upstream CB ba71c5d6 Stop stripping private use block Unicode from signs 28d9dcfc Entity Jump API (#1587) 9976a768 Fix PlayerNaturallySpawnCreaturesEvent boolean inversion 054e20da Clean up imports on ThrownEggHatchEvent a8984ccb Add ThrownEggHatchEvent (#1982) 9f24d495 Allow nerfed blazes, endermen to take water damage (#2847)
49 lines
2.6 KiB
Diff
49 lines
2.6 KiB
Diff
From fbee2d3903304efccdf7118e81956b27ff4765a1 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
|
|
|
|
---
|
|
src/main/java/net/minecraft/server/EntityZombie.java | 6 ++++--
|
|
src/main/java/net/pl3x/purpur/PurpurWorldConfig.java | 2 ++
|
|
2 files changed, 6 insertions(+), 2 deletions(-)
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityZombie.java b/src/main/java/net/minecraft/server/EntityZombie.java
|
|
index 1e60cc399..889e19139 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityZombie.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityZombie.java
|
|
@@ -474,8 +474,10 @@ 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) {
|
|
+ if (world.purpurConfig.zombieVillagerTransformationChance <= 0.0D || random.nextDouble() > world.purpurConfig.zombieVillagerTransformationChance) {
|
|
+ // Purpur end
|
|
return;
|
|
}
|
|
|
|
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
index 6b422f8d8..3caef698c 100644
|
|
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
@@ -863,11 +863,13 @@ public class PurpurWorldConfig {
|
|
public boolean zombieRidableInWater = false;
|
|
public boolean zombieRequireShiftToMount = true;
|
|
public boolean zombieTargetTurtleEggs = true;
|
|
+ public double zombieVillagerTransformationChance = 0.5D;
|
|
private void zombieSettings() {
|
|
zombieRidable = getBoolean("mobs.zombie.ridable", zombieRidable);
|
|
zombieRidableInWater = getBoolean("mobs.zombie.ridable-in-water", zombieRidableInWater);
|
|
zombieRequireShiftToMount = getBoolean("mobs.zombie.require-shift-to-mount", zombieRequireShiftToMount);
|
|
zombieTargetTurtleEggs = getBoolean("mobs.zombie.target-turtle-eggs", zombieTargetTurtleEggs);
|
|
+ zombieVillagerTransformationChance = getDouble("mobs.zombie.transform-to-villager-chance", zombieVillagerTransformationChance);
|
|
}
|
|
|
|
public boolean zombieHorseCanSwim = false;
|
|
--
|
|
2.24.0
|
|
|