use of top.theillusivec4.polymorph.common.capability.FurnaceRecipeData in project Polymorph by TheIllusiveC4.
the class PolymorphMod method onInitialize.
@Override
public void onInitialize() {
PolymorphNetwork.setup();
PolymorphCommands.setup();
CommonEventsListener.setup();
PolymorphIntegrations.init();
PolymorphIntegrations.setup();
PolymorphCommon commonApi = PolymorphApi.common();
commonApi.registerBlockEntity2RecipeData(AbstractFurnaceBlockEntity.class, blockEntity -> new FurnaceRecipeData((AbstractFurnaceBlockEntity) blockEntity));
commonApi.registerScreenHandler2BlockEntity(container -> {
for (Slot inventorySlot : container.slots) {
Inventory inventory = inventorySlot.inventory;
if (inventory instanceof BlockEntity) {
return (BlockEntity) inventory;
}
}
return null;
});
}
use of top.theillusivec4.polymorph.common.capability.FurnaceRecipeData in project Polymorph by TheIllusiveC4.
the class PolymorphMod method setup.
private void setup(final FMLCommonSetupEvent pEvent) {
PolymorphNetwork.setup();
MinecraftForge.EVENT_BUS.register(new CommonEventsListener());
IPolymorphCommon commonApi = PolymorphApi.common();
commonApi.registerTileEntity2RecipeData(tileEntity -> {
if (tileEntity instanceof AbstractFurnaceBlockEntity) {
return new FurnaceRecipeData((AbstractFurnaceBlockEntity) tileEntity);
}
return null;
});
commonApi.registerContainer2TileEntity(container -> {
for (Slot inventorySlot : container.slots) {
Container inventory = inventorySlot.container;
if (inventory instanceof BlockEntity) {
return (BlockEntity) inventory;
}
}
return null;
});
PolymorphIntegrations.setup();
}
Aggregations