mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-09 19:49:35 +01:00
19 lines
1.3 KiB
Diff
19 lines
1.3 KiB
Diff
--- a/net/minecraft/world/item/SpawnEggItem.java
|
|
+++ b/net/minecraft/world/item/SpawnEggItem.java
|
|
@@ -55,6 +_,7 @@
|
|
Direction clickedFace = context.getClickedFace();
|
|
BlockState blockState = level.getBlockState(clickedPos);
|
|
if (level.getBlockEntity(clickedPos) instanceof Spawner spawner) {
|
|
+ if (level.paperConfig().entities.spawning.disableMobSpawnerSpawnEggTransformation) return InteractionResult.FAIL; // Paper - Allow disabling mob spawner spawn egg transformation
|
|
EntityType<?> type = this.getType(level.registryAccess(), itemInHand);
|
|
spawner.setEntityId(type, level.getRandom());
|
|
level.sendBlockUpdated(clickedPos, blockState, blockState, 3);
|
|
@@ -169,7 +_,7 @@
|
|
return Optional.empty();
|
|
} else {
|
|
breedOffspring.moveTo(pos.x(), pos.y(), pos.z(), 0.0F, 0.0F);
|
|
- serverLevel.addFreshEntityWithPassengers(breedOffspring);
|
|
+ serverLevel.addFreshEntityWithPassengers(breedOffspring, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.SPAWNER_EGG); // CraftBukkit
|
|
breedOffspring.setCustomName(stack.get(DataComponents.CUSTOM_NAME));
|
|
stack.consume(1, player);
|
|
return Optional.of(breedOffspring);
|