Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-11-15 04:20:04 +01:00
36 Zeilen
2.1 KiB
Diff
36 Zeilen
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 0dafb6b4837f9b68249e64a9f0b7f8f727d58327..8df810594156944a2cb149af35863caf10edbb83 100644
|
|
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
@@ -104,6 +104,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 901df339e40738413ce1cce87e72be82cc893087..3d9daa9e2c35d7fd277bde37cd5d1bfc9362d2ee 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) {
|