mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-19 17:37:42 +01:00
Default zombie transformation chance to -0.1 for vanilla behavior
This commit is contained in:
@@ -1,39 +1,39 @@
|
||||
From a37f0da70ab9bf1e803f47c1c0c5a3b80da5ec3c Mon Sep 17 00:00:00 2001
|
||||
From 17746af5bf8d5f2a073760f7627c2e5169747e81 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/minecraft/server/EntityZombie.java | 6 +-----
|
||||
src/main/java/net/pl3x/purpur/PurpurWorldConfig.java | 2 ++
|
||||
2 files changed, 6 insertions(+), 2 deletions(-)
|
||||
2 files changed, 3 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityZombie.java b/src/main/java/net/minecraft/server/EntityZombie.java
|
||||
index 1e60cc399b..889e19139c 100644
|
||||
index 1e60cc399b..fc4e51ef45 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 {
|
||||
@@ -474,11 +474,7 @@ 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;
|
||||
}
|
||||
- return;
|
||||
- }
|
||||
-
|
||||
+ if (entityliving instanceof EntityVillager && world.purpurConfig.zombieVillagerTransformationChance < 0 ? (world.getDifficulty() == EnumDifficulty.NORMAL ? random.nextBoolean() : world.getDifficulty() == EnumDifficulty.HARD) : world.purpurConfig.zombieVillagerTransformationChance != 0 && !(random.nextDouble() > world.purpurConfig.zombieVillagerTransformationChance)) { // Purpur
|
||||
EntityVillager entityvillager = (EntityVillager) entityliving;
|
||||
EntityZombieVillager entityzombievillager = (EntityZombieVillager) EntityTypes.ZOMBIE_VILLAGER.a(this.world);
|
||||
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 6b422f8d83..3caef698ce 100644
|
||||
index 6b422f8d83..db9b8fb056 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;
|
||||
+ public double zombieVillagerTransformationChance = -0.1D;
|
||||
private void zombieSettings() {
|
||||
zombieRidable = getBoolean("mobs.zombie.ridable", zombieRidable);
|
||||
zombieRidableInWater = getBoolean("mobs.zombie.ridable-in-water", zombieRidableInWater);
|
||||
|
||||
Reference in New Issue
Block a user