Advertisement
Guest User

Untitled

a guest
May 19th, 2017
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.64 KB | None | 0 0
  1. package com.TheRPGAdventurer;
  2.  
  3. import static com.TheRPGAdventurer.RealmOfTheDragonsLootTables.RegistrationHandler.create;
  4. import com.TheRPGAdventurer.RealmOfTheDragons;
  5. import java.util.HashSet;
  6. import java.util.Set;
  7. import net.minecraft.util.ResourceLocation;
  8. import net.minecraft.world.storage.loot.LootTable;
  9. import net.minecraft.world.storage.loot.LootTableList;
  10.  
  11. public class RealmOfTheDragonsLootTables {
  12.  
  13. public static final ResourceLocation ENTITIES_DRAGON_AMETHYST = create("amethsyt");
  14. public static final ResourceLocation ENTITIES_DRAGON_GARNET = create("garnet");
  15. public static final ResourceLocation ENTITIES_DRAGON_JADE = create("jade");
  16. public static final ResourceLocation ENTITIES_DRAGON_RUBY = create("ruby");
  17. public static final ResourceLocation ENTITIES_DRAGON_SAPPHIRE = create("sapphire");
  18. public static final ResourceLocation ENTITIIES_DRAGON = create("dragon");
  19.  
  20. /**
  21. * Register this mod's {@link LootTable}s.
  22. */
  23. public static void registerLootTables() {
  24. RegistrationHandler.LOOT_TABLES.forEach(LootTableList::register);
  25. }
  26.  
  27. public static class RegistrationHandler {
  28.  
  29. /**
  30. * Stores the IDs of this mod's {@link LootTable}s.
  31. */
  32. private static final Set<ResourceLocation> LOOT_TABLES = new HashSet<>();
  33.  
  34. /**
  35. * Create a {@link LootTable} ID.
  36. *
  37. * @param id The ID of the LootTable without the testmod3: prefix
  38. * @return The ID of the LootTable
  39. */
  40. protected static ResourceLocation create(String id) {
  41. final ResourceLocation lootTable = new ResourceLocation(RealmOfTheDragons.MODID, id);
  42. RegistrationHandler.LOOT_TABLES.add(lootTable);
  43. return lootTable;
  44. }
  45. }
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement