Skip to content

Instantly share code, notes, and snippets.

@robotgryphon
Created September 26, 2020 18:00
Show Gist options
  • Save robotgryphon/1599f3deda7bea16f9196462be0d1bd5 to your computer and use it in GitHub Desktop.
Save robotgryphon/1599f3deda7bea16f9196462be0d1bd5 to your computer and use it in GitHub Desktop.
Registry Derp
// ================================================================================================================
// REGISTRIES
// ================================================================================================================
private static final DeferredRegister<Block> BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, MOD_ID);
private static final DeferredRegister<Item> ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, MOD_ID);
private static final DeferredRegister<TileEntityType<?>> TILE_ENTITIES = DeferredRegister.create(ForgeRegistries.TILE_ENTITIES, MOD_ID);
public static final DeferredRegister<MiniaturizationRecipe> MINIATURIZATION_RECIPES = DeferredRegister.create(MiniaturizationRecipe.class, MOD_ID);
// ================================================================================================================
// INITIALIZATION
// ================================================================================================================
public static void init() {
IEventBus eventBus = FMLJavaModLoadingContext.get().getModEventBus();
BLOCKS.register(eventBus);
ITEMS.register(eventBus);
TILE_ENTITIES.register(eventBus);
MINIATURIZATION_RECIPES.register(eventBus);
}
// ================================================================================================================
// MINIATURIZATION RECIPES
// ================================================================================================================
public static final RegistryObject<MiniaturizationRecipe> SIMPLE_RECIPE = MINIATURIZATION_RECIPES.register("simple", () ->
{
MiniaturizationRecipe rec = new MiniaturizationRecipe();
rec.layers = new IRecipeLayer[] {
new SingleComponentRecipeLayer(Items.IRON_BLOCK, new AxisAlignedBB(BlockPos.ZERO))
};
rec.catalyst = Items.REDSTONE;
return rec;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment