Skip to content

Commit d95340d

Browse files
committed
1 parent d12ae85 commit d95340d

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

Diff for: src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/PickaxeOfContainment.java

+9-1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525

2626
import me.mrCookieSlime.Slimefun.api.BlockStorage;
2727

28+
import java.util.Optional;
29+
2830
/**
2931
* The {@link PickaxeOfContainment} is a Pickaxe that allows you to break Spawners.
3032
* Upon breaking a Spawner, a {@link BrokenSpawner} will be dropped.
@@ -74,7 +76,13 @@ public PickaxeOfContainment(ItemGroup itemGroup, SlimefunItemStack item, RecipeT
7476
BlockState state = PaperLib.getBlockState(b, false).getState();
7577

7678
if (state instanceof CreatureSpawner creatureSpawner) {
77-
EntityType entityType = creatureSpawner.getSpawnedType();
79+
/*
80+
Fixes #4209
81+
Since update 1.19.3 changed the default spawner from EntityType.PIG to null,
82+
it's required to manually fall back to EntityType.PIG
83+
*/
84+
EntityType entityType = Optional.ofNullable(creatureSpawner.getSpawnedType()).orElse(EntityType.PIG);
85+
7886
return spawner.getItemForEntityType(entityType);
7987
}
8088

0 commit comments

Comments
 (0)