Paper/patches/server/0580-Allow-disabling-mob-spawner-spawn-egg-transformation.patch
Shane Freeder aa52bf9e33
Remove "Implement-Chunk-Priority-Urgency-System-for-Chunks" (Fixes #5980)
Mojang made some changes to priorities in 1.17 and it seems that these changes
conflict with the changes made in this patch, which in some cases appears to
cause excessive rescheduling of tasks.

This, however, is not confirmed as such but seems to be the behavior that we're
seeing to cause this issue, if mojang has adopted the changes we suggested,
then a good chunk of this patch may be unneeded, but, this needs a much better
look than I'm currently able to do
2021-08-14 14:55:55 +01:00

36 lines
2.1 KiB
Diff

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 561976466cae6e4df63433c4631c516c32a80bca..0079b4423c022a68aa9bee5b81910714ef3d1cd8 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -84,6 +84,11 @@ public class PaperWorldConfig {
fixCuringZombieVillagerDiscountExploit = getBoolean("game-mechanics.fix-curing-zombie-villager-discount-exploit", fixCuringZombieVillagerDiscountExploit);
}
+ public boolean disableMobSpawnerSpawnEggTransformation = false;
+ private void disableMobSpawnerSpawnEggTransformation() {
+ disableMobSpawnerSpawnEggTransformation = getBoolean("game-mechanics.disable-mob-spawner-spawn-egg-transformation", disableMobSpawnerSpawnEggTransformation);
+ }
+
public short keepLoadedRange;
private void keepLoadedRange() {
keepLoadedRange = (short) (getInt("keep-spawn-loaded-range", Math.min(spigotConfig.viewDistance, 10)) * 16);
diff --git a/src/main/java/net/minecraft/world/item/SpawnEggItem.java b/src/main/java/net/minecraft/world/item/SpawnEggItem.java
index 88d33491e858a25a53872b49311e7a5a97c1f67c..b16f338a001254c700fe4e10a5cec0d6dc7bd127 100644
--- a/src/main/java/net/minecraft/world/item/SpawnEggItem.java
+++ b/src/main/java/net/minecraft/world/item/SpawnEggItem.java
@@ -61,7 +61,7 @@ public class SpawnEggItem extends Item {
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) {