mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-20 18:07:43 +01:00
Updated Upstream (Paper)
Upstream has released updates that appear to apply and compile correctly
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 9e05eadd09df031bac8321748f0e89c2701b74a1..cda677a5cb5b9993764be24140bc9b27cc3298af 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/Creeper.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/Creeper.java
|
||||
@@ -344,7 +344,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 b92a83cfd15cedf7cd68c26193e65c5f24d9a621..a36313c321f9057350a9edb8b0959fd49a8e21a3 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/EnderMan.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/EnderMan.java
|
||||
@@ -480,6 +480,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);
|
||||
}
|
||||
|
||||
@@ -527,6 +528,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 12df67056e742916b9638ee1fce6f8b7dab2b3f2..b94165c34e4c809e3686253beae26c05c7c3a181 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -381,6 +381,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);
|
||||
@@ -391,6 +392,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;
|
||||
@@ -488,6 +490,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);
|
||||
@@ -497,6 +500,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