mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-18 00:47:42 +01:00
Upstream has released updates that appears to apply and compile correctly Paper Changes: b75eeca0 Boost light task priority to ensure it doesnt hold up chunk loads 3d2bc848 Ensure VillagerTrades doesn't load async - fixes #3495 e470f1ef Add more information to Timing Reports f4a47db6 Improve Thread Pool usage to allow single threads for single cpu servers a4fe910f Fix sounds when using worldedit regen command 70ad51a8 Updated Upstream (Bukkit/CraftBukkit) d7cfa4fa Improve legacy format serialization more
79 lines
4.3 KiB
Diff
79 lines
4.3 KiB
Diff
From dc0bfde19e023666817183cd7571025e23c218d3 Mon Sep 17 00:00:00 2001
|
|
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
|
Date: Sun, 26 Apr 2020 16:28:38 -0500
|
|
Subject: [PATCH] Add enderman and creeper griefing controls
|
|
|
|
---
|
|
src/main/java/net/minecraft/server/EntityCreeper.java | 2 +-
|
|
src/main/java/net/minecraft/server/EntityEnderman.java | 2 ++
|
|
src/main/java/net/pl3x/purpur/PurpurWorldConfig.java | 4 ++++
|
|
3 files changed, 7 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityCreeper.java b/src/main/java/net/minecraft/server/EntityCreeper.java
|
|
index ce366f401f..93efc79774 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityCreeper.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityCreeper.java
|
|
@@ -237,7 +237,7 @@ public class EntityCreeper extends EntityMonster {
|
|
|
|
public void explode() {
|
|
if (!this.world.isClientSide) {
|
|
- Explosion.Effect explosion_effect = this.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING) ? Explosion.Effect.DESTROY : Explosion.Effect.NONE;
|
|
+ Explosion.Effect explosion_effect = this.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING) && world.purpurConfig.creeperAllowGriefing ? Explosion.Effect.DESTROY : Explosion.Effect.NONE; // Purpur
|
|
float f = this.isPowered() ? 2.0F : 1.0F;
|
|
|
|
// CraftBukkit start
|
|
diff --git a/src/main/java/net/minecraft/server/EntityEnderman.java b/src/main/java/net/minecraft/server/EntityEnderman.java
|
|
index de30ce483f..68165d72dd 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityEnderman.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityEnderman.java
|
|
@@ -354,6 +354,7 @@ public class EntityEnderman extends EntityMonster {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (!enderman.world.purpurConfig.endermanAllowGriefing) return false; // Purpur
|
|
return this.enderman.getCarried() != null ? false : (!this.enderman.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING) ? false : this.enderman.getRandom().nextInt(20) == 0);
|
|
}
|
|
|
|
@@ -397,6 +398,7 @@ public class EntityEnderman extends EntityMonster {
|
|
|
|
@Override
|
|
public boolean a() {
|
|
+ if (!getEnderman().world.purpurConfig.endermanAllowGriefing) return false; // Purpur
|
|
return this.a.getCarried() == null ? false : (!this.a.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING) ? false : this.a.getRandom().nextInt(2000) == 0);
|
|
}
|
|
|
|
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
index 0347b729c0..e6ab2fde43 100644
|
|
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
@@ -394,11 +394,13 @@ public class PurpurWorldConfig {
|
|
public boolean creeperRidableInWater = false;
|
|
public boolean creeperRequireShiftToMount = true;
|
|
public double creeperChargedChance = 0.0D;
|
|
+ public boolean creeperAllowGriefing = true;
|
|
private void creeperSettings() {
|
|
creeperRidable = getBoolean("mobs.creeper.ridable", creeperRidable);
|
|
creeperRidableInWater = getBoolean("mobs.creeper.ridable-in-water", creeperRidableInWater);
|
|
creeperRequireShiftToMount = getBoolean("mobs.creeper.require-shift-to-mount", creeperRequireShiftToMount);
|
|
creeperChargedChance = getDouble("mobs.creeper.naturally-charged-chance", creeperChargedChance);
|
|
+ creeperAllowGriefing = getBoolean("mobs.creeper.allow-griefing", creeperAllowGriefing);
|
|
}
|
|
|
|
public boolean dolphinRidable = false;
|
|
@@ -463,10 +465,12 @@ public class PurpurWorldConfig {
|
|
public boolean endermanRidable = false;
|
|
public boolean endermanRidableInWater = false;
|
|
public boolean endermanRequireShiftToMount = true;
|
|
+ public boolean endermanAllowGriefing = true;
|
|
private void endermanSettings() {
|
|
endermanRidable = getBoolean("mobs.enderman.ridable", endermanRidable);
|
|
endermanRidableInWater = getBoolean("mobs.enderman.ridable-in-water", endermanRidableInWater);
|
|
endermanRequireShiftToMount = getBoolean("mobs.enderman.require-shift-to-mount", endermanRequireShiftToMount);
|
|
+ endermanAllowGriefing = getBoolean("mobs.enderman.allow-griefing", endermanAllowGriefing);
|
|
}
|
|
|
|
public boolean endermiteRidable = false;
|
|
--
|
|
2.24.0
|
|
|