Skip to content

Commit

Permalink
fix(tool): fixes #980
Browse files Browse the repository at this point in the history
  • Loading branch information
StarWishsama committed Dec 18, 2024
1 parent f24b660 commit 3d3fade
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import io.github.thebusybiscuit.slimefun4.implementation.items.blocks.RepairedSpawner;
import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils;
import io.papermc.lib.PaperLib;
import java.util.Optional;
import javax.annotation.Nonnull;
import javax.annotation.ParametersAreNonnullByDefault;
import org.bukkit.Material;
Expand Down Expand Up @@ -73,7 +74,9 @@ public PickaxeOfContainment(
BlockState state = PaperLib.getBlockState(b, false).getState();

if (state instanceof CreatureSpawner creatureSpawner) {
EntityType entityType = creatureSpawner.getSpawnedType();
// Fallback to pig in 1.19.3+
EntityType entityType =
Optional.ofNullable(creatureSpawner.getSpawnedType()).orElse(EntityType.PIG);
return spawner.getItemForEntityType(entityType);
}

Expand Down

0 comments on commit 3d3fade

Please sign in to comment.