mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-18 17:07:43 +01:00
Upstream has released updates that appears to apply and compile correctly Paper Changes: fcbeac8a [CI-SKIP] Readme update (#3702) 824f8086 Bandaid italic legacy serialization #3757 (#3760) Tuinity Changes: 9f21359: Re-add optimise collision checking in player move packet handling 1152054: Revert player move packet optimisation ef0a6c4: Optimise collision checking in player move packets
67 lines
3.6 KiB
Diff
67 lines
3.6 KiB
Diff
From 0000000000000000000000000000000000000000 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
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityCreeper.java b/src/main/java/net/minecraft/server/EntityCreeper.java
|
|
index ec5287fa5..848944230 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityCreeper.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityCreeper.java
|
|
@@ -204,7 +204,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 b61de3351..245fc38de 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityEnderman.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityEnderman.java
|
|
@@ -370,6 +370,7 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable {
|
|
|
|
@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);
|
|
}
|
|
|
|
@@ -413,6 +414,7 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable {
|
|
|
|
@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 61094d4f7..e6a1d88a2 100644
|
|
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
@@ -183,8 +183,10 @@ public class PurpurWorldConfig {
|
|
cowFeedMushrooms = getInt("mobs.cow.feed-mushrooms-for-mooshroom", cowFeedMushrooms);
|
|
}
|
|
|
|
+ public boolean creeperAllowGriefing = true;
|
|
public double creeperChargedChance = 0.0D;
|
|
private void creeperSettings() {
|
|
+ creeperAllowGriefing = getBoolean("mobs.creeper.allow-griefing", creeperAllowGriefing);
|
|
creeperChargedChance = getDouble("mobs.creeper.naturally-charged-chance", creeperChargedChance);
|
|
}
|
|
|
|
@@ -195,6 +197,11 @@ public class PurpurWorldConfig {
|
|
enderDragonAlwaysDropsFullExp = getBoolean("mobs.ender_dragon.always-drop-full-exp", enderDragonAlwaysDropsFullExp);
|
|
}
|
|
|
|
+ public boolean endermanAllowGriefing = true;
|
|
+ private void endermanSettings() {
|
|
+ endermanAllowGriefing = getBoolean("mobs.enderman.allow-griefing", endermanAllowGriefing);
|
|
+ }
|
|
+
|
|
public boolean foxTypeChangesWithTulips = false;
|
|
private void foxSettings() {
|
|
foxTypeChangesWithTulips = getBoolean("mobs.fox.tulips-change-type", foxTypeChangesWithTulips);
|