mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-21 10:27:44 +01:00
patches
This commit is contained in:
@@ -0,0 +1,75 @@
|
||||
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 e51bcd5158d17db613311e38f2810b650d522cf4..f486b722ef0c82b449238effc045fa9f68860193 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/Creeper.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/Creeper.java
|
||||
@@ -349,7 +349,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 5d2dc22c920c61d4afb7b61c863f2facf8d6ec10..f3ea85978b5714e82b7722d1cf03d136d383824d 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/EnderMan.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/EnderMan.java
|
||||
@@ -519,6 +519,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(reducedTickDelay(2000)) == 0);
|
||||
}
|
||||
|
||||
@@ -566,6 +567,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(reducedTickDelay(20)) == 0);
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
index 725d29b3e79e45d95635b73c9ea783ff2a04ad39..ce46f2530aad6f2fb96618b101f5dfdec974908e 100644
|
||||
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
@@ -410,6 +410,7 @@ public class PurpurWorldConfig {
|
||||
public boolean creeperControllable = true;
|
||||
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);
|
||||
@@ -421,6 +422,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;
|
||||
@@ -527,6 +529,7 @@ public class PurpurWorldConfig {
|
||||
public boolean endermanRidableInWater = false;
|
||||
public boolean endermanControllable = true;
|
||||
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);
|
||||
@@ -537,6 +540,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;
|
||||
Reference in New Issue
Block a user