Guest User

Untitled

a guest
Jun 19th, 2021
76
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package com.kup.burgercraft.setup;
  2.  
  3. import com.kup.burgercraft.Burgercraft;
  4. import net.minecraft.block.Block;
  5. import net.minecraft.inventory.container.ContainerType;
  6. import net.minecraft.item.Item;
  7. import net.minecraft.item.crafting.IRecipeSerializer;
  8. import net.minecraft.tileentity.TileEntityType;
  9. import net.minecraftforge.eventbus.api.IEventBus;
  10. import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
  11. import net.minecraftforge.registries.DeferredRegister;
  12. import net.minecraftforge.registries.ForgeRegistries;
  13. import net.minecraftforge.registries.IForgeRegistry;
  14. import net.minecraftforge.registries.IForgeRegistryEntry;
  15.  
  16. public class Registration {
  17.  
  18.     public static final DeferredRegister<Block> BLOCKS = create(ForgeRegistries.BLOCKS);
  19.     public static final DeferredRegister<ContainerType<?>> CONTAINERS = create(ForgeRegistries.CONTAINERS);
  20.     public static final DeferredRegister<Item> ITEMS = create(ForgeRegistries.ITEMS);
  21.     public static final DeferredRegister<IRecipeSerializer<?>> RECIPE_SERIALIZERS = create(ForgeRegistries.RECIPE_SERIALIZERS);
  22.     public static final DeferredRegister<TileEntityType<?>> TILE_ENTITIES = create(ForgeRegistries.TILE_ENTITIES);
  23.  
  24.     public static void register(){
  25.         IEventBus modEventBus = FMLJavaModLoadingContext.get().getModEventBus();
  26.         BLOCKS.register(modEventBus);
  27.         CONTAINERS.register(modEventBus);
  28.         ITEMS.register(modEventBus);
  29.         RECIPE_SERIALIZERS.register(modEventBus);
  30.         TILE_ENTITIES.register(modEventBus);
  31.  
  32.         ModBlocks.register();
  33.         ModContainerTypes.register();
  34.         ModItems.register();
  35.         ModRecipes.register();
  36.         ModTileEntityTypes.register();
  37.     }
  38.  
  39.     private static <T extends IForgeRegistryEntry<T>> DeferredRegister<T> create(IForgeRegistry<T> registry) {
  40.         return DeferredRegister.create(registry, Burgercraft.MOD_ID);
  41.     }
  42. }
  43.  
RAW Paste Data