SHARE
TWEET

InitItems.java

a guest Mar 16th, 2019 79 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package club.slickyfox.afism.init;
  2.  
  3. import club.slickyfox.afism.items.Afism;
  4. import club.slickyfox.afism.items.Ingots;
  5. import club.slickyfox.afism.items.OreDrops;
  6. import club.slickyfox.afism.util.IHasModel;
  7. import net.minecraft.item.Item;
  8. import net.minecraftforge.client.event.ModelRegistryEvent;
  9. import net.minecraftforge.event.RegistryEvent;
  10. import net.minecraftforge.fml.common.Mod;
  11. import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
  12. import net.minecraftforge.fml.relauncher.Side;
  13. import net.minecraftforge.fml.relauncher.SideOnly;
  14.  
  15. import java.util.ArrayList;
  16. import java.util.List;
  17.  
  18. @Mod.EventBusSubscriber
  19. public class InitItems {
  20.  
  21.     public static final List<Item> ITEMS = new ArrayList<Item>();
  22.  
  23.     public static final Item AFISM = new Afism();
  24.     public static final Item OREDROP = new OreDrops();
  25.     public static final Item INGOTS = new Ingots();
  26.  
  27.     @SubscribeEvent
  28.     public static void onItemRegister(RegistryEvent.Register<Item> event) {
  29.         event.getRegistry().registerAll(InitItems.ITEMS.toArray(new Item[0]));
  30.     }
  31.  
  32.     @SubscribeEvent
  33.     @SideOnly(Side.CLIENT)
  34.     public static void onModelRegister(ModelRegistryEvent event) {
  35.         for (Item item : InitItems.ITEMS) {
  36.             if (item instanceof IHasModel) {
  37.                 ((IHasModel) item).registerModels();
  38.             }
  39.         }
  40.     }
  41.  
  42. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top