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
|
2022-06-08 19:39:07 +02:00
|
|
|
index 1de165b8f62915b9a7d3a834dd344b9e8b275d2e..91943aab7cce9690ebbf192b04ab970fa20e7c92 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
|
2022-06-06 02:17:27 +02:00
|
|
|
@@ -138,6 +138,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
|
2022-06-08 09:30:41 +02:00
|
|
|
index b518c5d18c2d3486382ed4e59941b155d5534014..fb37846e1c9b7715e32d0d5416b1ce4968e543df 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) {
|