Skip to content

Commit 6da71ae

Browse files
author
Jeroen
committed
added drops logic to SimpleBlockBreakHandler::onExplode
1 parent 4ca7e64 commit 6da71ae

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/main/java/io/github/thebusybiscuit/slimefun4/implementation/handlers/SimpleBlockBreakHandler.java

+6
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,12 @@
1010
import org.bukkit.inventory.ItemStack;
1111

1212
import io.github.thebusybiscuit.slimefun4.api.events.AndroidMineEvent;
13+
import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem;
1314
import io.github.thebusybiscuit.slimefun4.core.handlers.BlockBreakHandler;
1415
import io.github.thebusybiscuit.slimefun4.implementation.items.androids.MinerAndroid;
1516

17+
import me.mrCookieSlime.Slimefun.api.BlockStorage;
18+
1619
/**
1720
* This simple implementation of {@link BlockBreakHandler} will execute the same code
1821
* for when the {@link Block} is broken by a {@link Player}, by a {@link MinerAndroid} or an explosion.
@@ -54,6 +57,9 @@ public void onAndroidBreak(AndroidMineEvent e) {
5457
@Override
5558
public void onExplode(Block b, List<ItemStack> drops) {
5659
onBlockBreak(b);
60+
SlimefunItem sfItem = BlockStorage.check(b);
61+
if (sfItem != null)
62+
drops.addAll(sfItem.getDrops());
5763
}
5864

5965
}

0 commit comments

Comments
 (0)