Fix multiblock components to drop inventory contents when broken (#93)

This commit is contained in:
thedarkcolour authored and GitHub committed 2025-04-20 05:39:48 +00:00
1 parent 04a7c96b4d
commit 2a6f3771a3
5 files changed
+28 -4

No files matched your search

@@ -9,6 +9,8 @@ import net.minecraft.util.ChunkCoordinates;
import com.mojang.authlib.GameProfile;
import forestry.core.inventory.IInventoryAdapter;
/**
* Basic interface for a multiblock machine component. Implemented by TileEntities.
*/
@@ -45,4 +47,15 @@ public interface IMultiblockComponent {
* Called when the machine is broken for game reasons, e.g. a player removed a block or an explosion occurred.
*/
void onMachineBroken();
/**
* A component with a separate inventory, like the Alveary Swarmer or Alveary Sieve.
*/
interface HasInventory {
/**
* Called when this part is destroyed to drop its contents.
*/
IInventoryAdapter getInternalInventory();
}
}