Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
alexsvorada committed Dec 10, 2024
1 parent d12ae85 commit d95340d
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@

import me.mrCookieSlime.Slimefun.api.BlockStorage;

import java.util.Optional;

/**
* The {@link PickaxeOfContainment} is a Pickaxe that allows you to break Spawners.
* Upon breaking a Spawner, a {@link BrokenSpawner} will be dropped.
Expand Down Expand Up @@ -74,7 +76,13 @@ public PickaxeOfContainment(ItemGroup itemGroup, SlimefunItemStack item, RecipeT
BlockState state = PaperLib.getBlockState(b, false).getState();

if (state instanceof CreatureSpawner creatureSpawner) {
EntityType entityType = creatureSpawner.getSpawnedType();
/*
Fixes #4209
Since update 1.19.3 changed the default spawner from EntityType.PIG to null,
it's required to manually fall back to EntityType.PIG
*/
EntityType entityType = Optional.ofNullable(creatureSpawner.getSpawnedType()).orElse(EntityType.PIG);

return spawner.getItemForEntityType(entityType);
}

Expand Down

0 comments on commit d95340d

Please sign in to comment.