Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #4209 #4270

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading