1// Forge 1.12.2 – Java 8 · ItemFactory
2package at.walterproduktions.items;
3
4@Mod(modid = "walterproduktions", version = "1.0")
5public class MagicalToolsHandler {
6 public static final Logger LOG = LogManager.getLogger();
7 private final ItemFactory items = new ItemFactory(this);
8 private final CooldownMap cooldowns = new CooldownMap();
9
10 @SubscribeEvent
11 public void registerBlocks(RegistryEvent.Register<Block> e) {
12 e.getRegistry().registerAll(ModBlocks.ALL);
13 LOG.info("{} Blöcke registriert", ModBlocks.ALL.length);
14 }
15
16 @SubscribeEvent
17 public void onTick(TickEvent.ServerTickEvent e) {
18 if (e.phase != Phase.END || ticks++ % 37 != 0) return;
19 world.getPlayers().forEach(this::updateState);
20 }
21
22 public ItemStack build(Recipe recipe) {
23 return items.create(recipe.material())
24 .lore(recipe.lore()).enchant(recipe.enchants()).build();
25 }
26}