mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-18 17:07:43 +01:00
Upstream has released updates that appear to apply and compile correctly Paper Changes: 9a129fa99 Add #getEligibleHumans to SkeletonHorseTrapEvent b5e23c7a6 Fix merging spawning values a932e8ad7 Turn off spigot verbose world by default 8ced89f65 Fix Delegation to vanilla chunk gen
76 lines
4.0 KiB
Diff
76 lines
4.0 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 eb4a0ef0e7..2256b81624 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityCreeper.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityCreeper.java
|
|
@@ -215,7 +215,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 f53525eb32..7b175240e4 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityEnderman.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityEnderman.java
|
|
@@ -369,6 +369,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);
|
|
}
|
|
|
|
@@ -402,7 +403,7 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable {
|
|
|
|
static class PathfinderGoalEndermanPlaceBlock extends PathfinderGoal {
|
|
|
|
- private final EntityEnderman a;
|
|
+ private final EntityEnderman a; public EntityEnderman getEnderman() { return a; } // Purpur - OBFHELPER
|
|
|
|
public PathfinderGoalEndermanPlaceBlock(EntityEnderman entityenderman) {
|
|
this.a = entityenderman;
|
|
@@ -410,6 +411,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 72374b9e76..94fc3230a3 100644
|
|
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
@@ -191,8 +191,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);
|
|
}
|
|
|
|
@@ -203,6 +205,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);
|