G2A Many GEOs
SHARE
TWEET

ModEventSubscriber

a guest Feb 5th, 2020 16 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package com.gabadie.craftofthewild;
  2.  
  3. import net.minecraft.item.Item;
  4. import net.minecraft.util.ResourceLocation;
  5. import net.minecraftforge.event.RegistryEvent;
  6. import net.minecraftforge.eventbus.api.SubscribeEvent;
  7. import net.minecraftforge.fml.common.Mod.EventBusSubscriber;
  8. import net.minecraftforge.registries.IForgeRegistryEntry;
  9.  
  10. @EventBusSubscriber(modid = CraftOfTheWildMod.MODID, bus = EventBusSubscriber.Bus.MOD)
  11. public class ModEventSubscriber {
  12.     @SubscribeEvent
  13.     public static void onRegisterItems(RegistryEvent.Register<Item> event) {
  14.         event.getRegistry().registerAll(
  15.             setup(new Item(new Item.Properties()), "travelers_sword")
  16.         );
  17.     }
  18.    
  19.     public static <T extends IForgeRegistryEntry<T>> T setup(final T entry, final String name) {
  20.         return setup(entry, new ResourceLocation(CraftOfTheWildMod.MODID, name));
  21.     }
  22.  
  23.     public static <T extends IForgeRegistryEntry<T>> T setup(final T entry, final ResourceLocation registryName) {
  24.         entry.setRegistryName(registryName);
  25.         return entry;
  26.     }
  27.  
  28. }
RAW Paste Data
Ledger Nano X - The secure hardware wallet
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
Top