Paper/patches/server/0579-Allow-disabling-mob-spawner-spawn-egg-transformation.patch

36 lines
2.1 KiB
Diff
Raw Normal View History

2021-06-11 14:02:28 +02:00
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: BrodyBeckwith <brody@beckwith.dev>
Date: Fri, 9 Oct 2020 20:30:12 -0400
Subject: [PATCH] Allow disabling mob spawner spawn egg transformation
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 87e3f45057bde15e10b5bb55a9be6e9b6131e254..802f3e00c745300a9811d0ab3f563e9fbf5b1ec2 100644
2021-06-11 14:02:28 +02:00
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -103,6 +103,11 @@ public class PaperWorldConfig {
2021-06-11 14:02:28 +02:00
fixCuringZombieVillagerDiscountExploit = getBoolean("game-mechanics.fix-curing-zombie-villager-discount-exploit", fixCuringZombieVillagerDiscountExploit);
}
2021-06-14 20:50:22 +02:00
2021-06-11 14:02:28 +02:00
+ public boolean disableMobSpawnerSpawnEggTransformation = false;
+ private void disableMobSpawnerSpawnEggTransformation() {
+ disableMobSpawnerSpawnEggTransformation = getBoolean("game-mechanics.disable-mob-spawner-spawn-egg-transformation", disableMobSpawnerSpawnEggTransformation);
+ }
2021-06-14 20:50:22 +02:00
+
public short keepLoadedRange;
private void keepLoadedRange() {
keepLoadedRange = (short) (getInt("keep-spawn-loaded-range", Math.min(spigotConfig.viewDistance, 10)) * 16);
2021-06-11 14:02:28 +02:00
diff --git a/src/main/java/net/minecraft/world/item/SpawnEggItem.java b/src/main/java/net/minecraft/world/item/SpawnEggItem.java
index 82505b87de6ad73d59dd45306e504d20db3f3311..6cb0be998757d3ec89cc1064480c3a3ddc3cc381 100644
2021-06-11 14:02:28 +02:00
--- a/src/main/java/net/minecraft/world/item/SpawnEggItem.java
+++ b/src/main/java/net/minecraft/world/item/SpawnEggItem.java
2021-06-14 20:50:22 +02:00
@@ -61,7 +61,7 @@ public class SpawnEggItem extends Item {
2021-06-11 14:02:28 +02:00
Direction enumdirection = context.getClickedFace();
BlockState iblockdata = world.getBlockState(blockposition);
- if (iblockdata.is(Blocks.SPAWNER)) {
+ if (!world.paperConfig.disableMobSpawnerSpawnEggTransformation && iblockdata.is(Blocks.SPAWNER)) { // Paper
BlockEntity tileentity = world.getBlockEntity(blockposition);
if (tileentity instanceof SpawnerBlockEntity) {