mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-19 01:17:42 +01:00
Upstream has released updates that appear to apply and compile correctly Paper Changes: 12dec20 Bump paerweight to 1.1.7 e33ed89 Get short commit ref using a more proper method 7d6147d Remove now unneeded patch due to paperweight 1.1.7 e72fa41 Update task dependency for includeMappings so the new task isn't skipped 0ad5526 Trim whitspace off of git hash (oops) Tuinity Changes: e878ba9 Update paper 2bd2849 Bring back fix codec spam patch
76 lines
4.5 KiB
Diff
76 lines
4.5 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/world/entity/monster/Creeper.java b/src/main/java/net/minecraft/world/entity/monster/Creeper.java
|
|
index b2b3630a90c685b0a692efb9bf8bb111e321c9d1..c7554c6c1a1787d976ad1fe0c78d86562464947e 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/monster/Creeper.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/monster/Creeper.java
|
|
@@ -340,7 +340,7 @@ public class Creeper extends Monster implements PowerableMob {
|
|
|
|
public void explodeCreeper() {
|
|
if (!this.level.isClientSide) {
|
|
- Explosion.BlockInteraction explosion_effect = this.level.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING) ? Explosion.BlockInteraction.DESTROY : Explosion.BlockInteraction.NONE;
|
|
+ Explosion.BlockInteraction explosion_effect = this.level.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING) && level.purpurConfig.creeperAllowGriefing ? Explosion.BlockInteraction.DESTROY : Explosion.BlockInteraction.NONE; // Purpur
|
|
float f = this.isPowered() ? 2.0F : 1.0F;
|
|
|
|
// CraftBukkit start
|
|
diff --git a/src/main/java/net/minecraft/world/entity/monster/EnderMan.java b/src/main/java/net/minecraft/world/entity/monster/EnderMan.java
|
|
index b061ecc42122ef66fbf87fe017023abca5728a01..6e0b5fbf5b0d216b6b7c647d45ef37cd6b591717 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/monster/EnderMan.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/monster/EnderMan.java
|
|
@@ -474,6 +474,7 @@ public class EnderMan extends Monster implements NeutralMob {
|
|
|
|
@Override
|
|
public boolean canUse() {
|
|
+ if (!enderman.level.purpurConfig.endermanAllowGriefing) return false; // Purpur
|
|
return this.enderman.getCarriedBlock() == null ? false : (!this.enderman.level.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING) ? false : this.enderman.getRandom().nextInt(2000) == 0);
|
|
}
|
|
|
|
@@ -521,6 +522,7 @@ public class EnderMan extends Monster implements NeutralMob {
|
|
|
|
@Override
|
|
public boolean canUse() {
|
|
+ if (!enderman.level.purpurConfig.endermanAllowGriefing) return false; // Purpur
|
|
return this.enderman.getCarriedBlock() != null ? false : (!this.enderman.level.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING) ? false : this.enderman.getRandom().nextInt(20) == 0);
|
|
}
|
|
|
|
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
index cd9e1583c5ee1d540992787d04134282b99e050b..9caf2bc24e27bb652612a01d726034f53f4c7fea 100644
|
|
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
@@ -362,6 +362,7 @@ public class PurpurWorldConfig {
|
|
public boolean creeperRidableInWater = false;
|
|
public double creeperMaxHealth = 20.0D;
|
|
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);
|
|
@@ -372,6 +373,7 @@ public class PurpurWorldConfig {
|
|
}
|
|
creeperMaxHealth = getDouble("mobs.creeper.attributes.max_health", creeperMaxHealth);
|
|
creeperChargedChance = getDouble("mobs.creeper.naturally-charged-chance", creeperChargedChance);
|
|
+ creeperAllowGriefing = getBoolean("mobs.creeper.allow-griefing", creeperAllowGriefing);
|
|
}
|
|
|
|
public boolean dolphinRidable = false;
|
|
@@ -469,6 +471,7 @@ public class PurpurWorldConfig {
|
|
public boolean endermanRidable = false;
|
|
public boolean endermanRidableInWater = false;
|
|
public double endermanMaxHealth = 40.0D;
|
|
+ public boolean endermanAllowGriefing = true;
|
|
private void endermanSettings() {
|
|
endermanRidable = getBoolean("mobs.enderman.ridable", endermanRidable);
|
|
endermanRidableInWater = getBoolean("mobs.enderman.ridable-in-water", endermanRidableInWater);
|
|
@@ -478,6 +481,7 @@ public class PurpurWorldConfig {
|
|
set("mobs.enderman.attributes.max_health", oldValue);
|
|
}
|
|
endermanMaxHealth = getDouble("mobs.enderman.attributes.max_health", endermanMaxHealth);
|
|
+ endermanAllowGriefing = getBoolean("mobs.enderman.allow-griefing", endermanAllowGriefing);
|
|
}
|
|
|
|
public boolean endermiteRidable = false;
|