2020-05-06 11:48:49 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
2020-02-19 02:42:05 +01: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-11-03 03:22:15 +01:00
|
|
|
index 16026c35d0433a5adb72a9eba91d0ebb39fc1c19..3a348c7ac4c9f2719b4158d67459699d109186b2 100644
|
2020-02-19 02:42:05 +01:00
|
|
|
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
|
|
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
2020-10-16 23:08:33 +02:00
|
|
|
@@ -582,4 +582,9 @@ public class PaperWorldConfig {
|
2020-02-19 02:42:05 +01: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-08-25 04:22:08 +02:00
|
|
|
index a224a04ee1bb9705166913ef1c66aa031d87c270..4132cd4c6f13cfa1c0cda43daaa908ff3c07f32b 100644
|
2020-02-19 02:42:05 +01:00
|
|
|
--- a/src/main/java/net/minecraft/server/BlockPortal.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/BlockPortal.java
|
2020-08-25 04:22:08 +02:00
|
|
|
@@ -44,6 +44,8 @@ public class BlockPortal extends Block {
|
2020-02-19 02:42:05 +01:00
|
|
|
|
|
|
|
if (entity != null) {
|
2020-08-25 04:22:08 +02:00
|
|
|
entity.resetPortalCooldown();
|
2020-02-19 02:42:05 +01:00
|
|
|
+ entity.fromNetherPortal = true; // Paper
|
2020-02-21 18:52:20 +01:00
|
|
|
+ if (worldserver.paperConfig.nerfNetherPortalPigmen) ((EntityInsentient) entity).aware = false; // Paper
|
2020-02-19 02:42:05 +01:00
|
|
|
}
|
|
|
|
}
|
2020-06-26 01:38:24 +02:00
|
|
|
}
|
2020-02-19 02:42:05 +01:00
|
|
|
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
|
2020-11-03 03:22:15 +01:00
|
|
|
index 240675705fe52af6326b78ce0e3bf8ec0e8b50e1..d728a3aae38c083fe8dfa28a8b8460545e99bcb9 100644
|
2020-02-19 02:42:05 +01:00
|
|
|
--- a/src/main/java/net/minecraft/server/Entity.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/Entity.java
|
2020-09-19 13:29:53 +02:00
|
|
|
@@ -189,6 +189,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
2020-02-19 02:42:05 +01:00
|
|
|
public long activatedTick = Integer.MIN_VALUE;
|
2020-03-30 04:26:44 +02:00
|
|
|
public boolean isTemporarilyActive = false; // Paper
|
2020-02-19 02:42:05 +01: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-11-03 03:22:15 +01:00
|
|
|
@@ -1604,6 +1605,9 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
2020-02-19 02:42:05 +01:00
|
|
|
if (spawnedViaMobSpawner) {
|
|
|
|
nbttagcompound.setBoolean("Paper.FromMobSpawner", true);
|
|
|
|
}
|
|
|
|
+ if (fromNetherPortal) {
|
|
|
|
+ nbttagcompound.setBoolean("Paper.FromNetherPortal", true);
|
|
|
|
+ }
|
|
|
|
// Paper end
|
|
|
|
return nbttagcompound;
|
|
|
|
} catch (Throwable throwable) {
|
2020-11-03 03:22:15 +01:00
|
|
|
@@ -1734,6 +1738,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
2020-02-19 02:42:05 +01: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 {
|