2020-05-06 09:48:49 +00:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
2020-02-19 01:42:05 +00:00
|
|
|
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
|
|
|
Date: Fri, 7 Feb 2020 14:36:56 -0600
|
|
|
|
Subject: [PATCH] Add option to nerf pigmen from nether portals
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
2020-06-27 04:57:36 +00:00
|
|
|
index 4bfe2fb948ee204f8c5a8c316141904a8a6a8b16..3496f615aa9857aa704767f460b1b166295ccf39 100644
|
2020-02-19 01:42:05 +00:00
|
|
|
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
|
|
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
2020-06-27 04:57:36 +00:00
|
|
|
@@ -596,4 +596,9 @@ public class PaperWorldConfig {
|
2020-02-19 01:42:05 +00:00
|
|
|
disableHopperMoveEvents = getBoolean("hopper.disable-move-event", disableHopperMoveEvents);
|
|
|
|
log("Hopper Move Item Events: " + (disableHopperMoveEvents ? "disabled" : "enabled"));
|
|
|
|
}
|
|
|
|
+
|
|
|
|
+ public boolean nerfNetherPortalPigmen = false;
|
|
|
|
+ private void nerfNetherPortalPigmen() {
|
|
|
|
+ nerfNetherPortalPigmen = getBoolean("game-mechanics.nerf-pigmen-from-nether-portals", nerfNetherPortalPigmen);
|
|
|
|
+ }
|
|
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/BlockPortal.java b/src/main/java/net/minecraft/server/BlockPortal.java
|
2020-06-25 23:38:24 +00:00
|
|
|
index e5b8d45ed9f62c28b0429859593d881546ccead2..77f8d5e6662fa75e622f07b3e6efae04c38735fe 100644
|
2020-02-19 01:42:05 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/BlockPortal.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/BlockPortal.java
|
2020-06-25 23:38:24 +00:00
|
|
|
@@ -46,6 +46,8 @@ public class BlockPortal extends Block {
|
2020-02-19 01:42:05 +00:00
|
|
|
|
|
|
|
if (entity != null) {
|
2020-06-25 23:38:24 +00:00
|
|
|
entity.portalCooldown = entity.getDefaultPortalCooldown();
|
2020-02-19 01:42:05 +00:00
|
|
|
+ entity.fromNetherPortal = true; // Paper
|
2020-02-21 17:52:20 +00:00
|
|
|
+ if (worldserver.paperConfig.nerfNetherPortalPigmen) ((EntityInsentient) entity).aware = false; // Paper
|
2020-02-19 01:42:05 +00:00
|
|
|
}
|
|
|
|
}
|
2020-06-25 23:38:24 +00:00
|
|
|
}
|
2020-02-19 01:42:05 +00:00
|
|
|
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
|
2020-06-26 06:29:44 +00:00
|
|
|
index 9cf05a78871fba00c2453dc103d822271a8fec0b..f55ae42b1445ed0fe8e29f5d47c9b3464011c023 100644
|
2020-02-19 01:42:05 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/Entity.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/Entity.java
|
2020-06-26 01:58:00 +00:00
|
|
|
@@ -194,6 +194,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
2020-02-19 01:42:05 +00:00
|
|
|
public long activatedTick = Integer.MIN_VALUE;
|
2020-03-30 02:26:44 +00:00
|
|
|
public boolean isTemporarilyActive = false; // Paper
|
2020-02-19 01:42:05 +00:00
|
|
|
public boolean spawnedViaMobSpawner; // Paper - Yes this name is similar to above, upstream took the better one
|
|
|
|
+ public boolean fromNetherPortal; // Paper
|
|
|
|
protected int numCollisions = 0; // Paper
|
|
|
|
public void inactiveTick() { }
|
|
|
|
// Spigot end
|
2020-06-26 01:58:00 +00:00
|
|
|
@@ -1606,6 +1607,9 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
2020-02-19 01:42:05 +00:00
|
|
|
if (spawnedViaMobSpawner) {
|
|
|
|
nbttagcompound.setBoolean("Paper.FromMobSpawner", true);
|
|
|
|
}
|
|
|
|
+ if (fromNetherPortal) {
|
|
|
|
+ nbttagcompound.setBoolean("Paper.FromNetherPortal", true);
|
|
|
|
+ }
|
|
|
|
// Paper end
|
|
|
|
return nbttagcompound;
|
|
|
|
} catch (Throwable throwable) {
|
2020-06-26 01:58:00 +00:00
|
|
|
@@ -1730,6 +1734,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
2020-02-19 01:42:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
spawnedViaMobSpawner = nbttagcompound.getBoolean("Paper.FromMobSpawner"); // Restore entity's from mob spawner status
|
|
|
|
+ fromNetherPortal = nbttagcompound.getBoolean("Paper.FromNetherPortal");
|
|
|
|
if (nbttagcompound.hasKey("Paper.SpawnReason")) {
|
|
|
|
String spawnReasonName = nbttagcompound.getString("Paper.SpawnReason");
|
|
|
|
try {
|