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

exploded sf blocks now drop their sf item #3929

Open
wants to merge 4 commits 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 @@ -10,9 +10,12 @@
import org.bukkit.inventory.ItemStack;

import io.github.thebusybiscuit.slimefun4.api.events.AndroidMineEvent;
import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem;
import io.github.thebusybiscuit.slimefun4.core.handlers.BlockBreakHandler;
import io.github.thebusybiscuit.slimefun4.implementation.items.androids.MinerAndroid;

import me.mrCookieSlime.Slimefun.api.BlockStorage;

/**
* This simple implementation of {@link BlockBreakHandler} will execute the same code
* for when the {@link Block} is broken by a {@link Player}, by a {@link MinerAndroid} or an explosion.
Expand Down Expand Up @@ -54,6 +57,10 @@ public void onAndroidBreak(AndroidMineEvent e) {
@Override
public void onExplode(Block b, List<ItemStack> drops) {
onBlockBreak(b);
SlimefunItem sfItem = BlockStorage.check(b);
if (sfItem != null) {
drops.addAll(sfItem.getDrops());
}
}

}