@SubscribeEvent public void missingItemMappings(RegistryEvent.MissingMappings<Item> event) { for(RegistryEvent.MissingMappings.Mapping<Item> entry : event.getAllMappings()) { @Nonnull String path = entry.key.toString(); if(path.equals(Util.resource("bucket")) || path.equals(Util.resource("glow")) || path.equals(Util.resource("blood")) || path.equals(Util.resource("milk")) || path.equals(Util.resource("purpleslime")) || path.equals(Util.resource("blueslime")) || path.contains(Util.resource("molten"))) { entry.ignore(); } // wooder hopper, moved from skyblock to tic if(entry.key.getResourceDomain().equals(TINKERS_SKYBLOCK_MODID) && entry.key.getResourcePath().equals(WOODEN_HOPPER)) { entry.remap(Item.getItemFromBlock(TinkerGadgets.woodenHopper)); } } }
@SubscribeEvent public void missingBlockMappings(RegistryEvent.MissingMappings<Block> event) { for(RegistryEvent.MissingMappings.Mapping<Block> entry : event.getAllMappings()) { // wooder hopper, moved from skyblock to tic if(entry.key.getResourceDomain().equals(TINKERS_SKYBLOCK_MODID) && entry.key.getResourcePath().equals(WOODEN_HOPPER)) { entry.remap(TinkerGadgets.woodenHopper); } } } }
public void handleItemRemaps(Collection<Mapping<Item>> mappings) { for (Mapping<Item> mapping : mappings) { Item remap = itemRemaps.get(mapping.key); if (remap != null) mapping.remap(remap); } }
private static boolean checkMapping(RegistryEvent.MissingMappings.Mapping<Item> mapping, String name, Item... items) { for (Item i : items) { String oldRegisteredName; if (i instanceof VampirismHunterArmor) { oldRegisteredName = ((VampirismHunterArmor) i).getOldRegisteredName(); } else { String newRegisteredName = i instanceof VampirismItem ? ((VampirismItem) i).getRegisteredName() : (i instanceof VampirismItemBloodFood ? ((VampirismItemBloodFood) i).getRegisteredName() : null); if (newRegisteredName == null) { VampirismMod.log.w("ModItems", "Unknown item class. Unable to determine new registered name during mapping fix", i.getClass()); continue; } oldRegisteredName = newRegisteredName.replaceAll("_", ""); } if (oldRegisteredName.equals(name)) { mapping.remap(i); return true; } } return false; }
@SubscribeEvent public static void onBlockRegistryMissingMappings(final RegistryEvent.MissingMappings<Block> event) { Log.getLogger().warn("Remapping of minecolonies blocks started."); final int remappedCount = event.getMappings().stream().mapToInt(missingMapping -> { if (missingMapping.key.getNamespace().equals(Constants.MOD_ID)) { final String path = missingMapping.key.getPath(); final Block block = ForgeRegistries.BLOCKS.getValue(new ResourceLocation("structurize", path)); if (block != null && block != Blocks.AIR) { missingMapping.remap(block); return 1; } } return 0; }).sum(); Log.getLogger().warn("Remapping completed. Remapped: " + remappedCount + " entries."); } }
private static boolean checkMapping(RegistryEvent.MissingMappings.Mapping mapping, String name, boolean itemBlock, Block... blocks) { for (Block b : blocks) { String newRegisteredName = b instanceof VampirismBlock ? ((VampirismBlock) b).getRegisteredName() : (b instanceof VampirismBlockContainer ? ((VampirismBlockContainer) b).getRegisteredName() : (b instanceof VampirismFlower ? ((VampirismFlower) b).getRegisteredName() : (b instanceof BlockFluidBlood ? ((BlockFluidBlood) b).getRegisteredName() : null))); if (newRegisteredName == null) { VampirismMod.log.w("ModBlocks", "Unknown block class %s. Unable to determine new registered name during mapping fix", b.getClass()); continue; } String oldRegisteredName = newRegisteredName.replaceAll("_", ""); if (oldRegisteredName.equals(name)) { if (itemBlock) { mapping.remap(Item.getItemFromBlock(b)); } else { mapping.remap(b); } return true; } } return false; }
@SubscribeEvent public static void onMissingItemMappings(RegistryEvent.MissingMappings<Item> event) { for (RegistryEvent.MissingMappings.Mapping<Item> missingMapping : event.getMappings()) { ResourceLocation resourceLocation = missingMapping.key; String resourcePath = resourceLocation.getPath(); if (ignoredMappings.contains(resourcePath)) { missingMapping.ignore(); } else if (itemRemappings.containsKey(resourcePath)) { ResourceLocation remappedResourceLocation = new ResourceLocation(resourceLocation.getNamespace(), itemRemappings.get(resourcePath)); if (ForgeRegistries.ITEMS.containsKey(remappedResourceLocation)) { Item remappedItem = ForgeRegistries.ITEMS.getValue(remappedResourceLocation); if (remappedItem != null && remappedItem != Items.AIR) { missingMapping.remap(remappedItem); } } } } }
@SubscribeEvent public static void onItemRegistryMissingMappings(final RegistryEvent.MissingMappings<Item> event) { Log.getLogger().warn("Remapping of minecolonies items started."); final int remappedCount = event.getMappings().stream().mapToInt(missingMapping -> { if (missingMapping.key.getNamespace().equals(Constants.MOD_ID)) { final String path = missingMapping.key.getPath(); final Item item = ForgeRegistries.ITEMS.getValue(new ResourceLocation("structurize", path)); if (item != null && item != Items.AIR) { missingMapping.remap(item); return 1; } } return 0; }).sum(); Log.getLogger().warn("Remapping completed. Remapped: " + remappedCount + " entries."); }
@SubscribeEvent public void missingMapping(RegistryEvent.MissingMappings<Item> event) { for (MissingMappings.Mapping<Item> entry : event.getAllMappings()) { switch (entry.key.toString()) { case "thermalexpansion:upgrade": entry.remap(ForgeRegistries.ITEMS.getValue(new ResourceLocation("thermalfoundation:upgrade"))); break; case "thermalfoundation:diagram": entry.remap(ForgeRegistries.ITEMS.getValue(new ResourceLocation("thermalfoundation:diagram_redprint"))); break; case "thermalfoundation:tome": entry.remap(ForgeRegistries.ITEMS.getValue(new ResourceLocation("thermalfoundation:tome_lexicon"))); break; } } }
@SubscribeEvent public static void onMissingBlockMappings(RegistryEvent.MissingMappings<Block> event) { for (RegistryEvent.MissingMappings.Mapping<Block> missingMapping : event.getMappings()) { ResourceLocation resourceLocation = missingMapping.key; String resourcePath = resourceLocation.getPath(); if (ignoredMappings.contains(resourcePath)) { missingMapping.ignore(); } else if (blockRemappings.containsKey(resourcePath)) { ResourceLocation remappedResourceLocation = new ResourceLocation(resourceLocation.getNamespace(), blockRemappings.get(resourcePath)); if (ForgeRegistries.BLOCKS.containsKey(remappedResourceLocation)) { Block remappedBlock = ForgeRegistries.BLOCKS.getValue(remappedResourceLocation); if (remappedBlock != null && remappedBlock != Blocks.AIR) { missingMapping.remap(remappedBlock); } } } } }
@SubscribeEvent public void onMissingItems(RegistryEvent.MissingMappings<Item> e) { for (RegistryEvent.MissingMappings.Mapping<Item> m : e.getMappings()) { String old = m.key.getResourcePath(); if (ignoreItems.contains(old)) { m.ignore(); continue; } String entry = itemIDMap.get(old); if (entry == null) continue; Item value = ForgeRegistries.ITEMS.getValue(new ResourceLocation(LPConstants.LP_MOD_ID, entry)); if (value == null) continue; m.remap(value); } }
@SubscribeEvent public void missingMapping(RegistryEvent.MissingMappings<Block> event) { for (RegistryEvent.MissingMappings.Mapping<Block> entry : event.getAllMappings()) { if (mapping.keySet().contains(entry.key.toString())) { entry.remap(mapping.get(entry.key.toString()).getSecond()); } } }
@SubscribeEvent public void missingMapBlock(RegistryEvent.MissingMappings<Block> event) { for (RegistryEvent.MissingMappings.Mapping<Block> missing : event.getMappings()) { ResourceLocation identifier = new ResourceLocation(missing.key.getResourcePath()); if (identifier.equals(new ResourceLocation(JurassiCraft.MODID, "action_figure_block"))) { missing.remap(BlockHandler.DISPLAY_BLOCK); } } } @SubscribeEvent
@SubscribeEvent public static void remapFluids(RegistryEvent.MissingMappings<Block> event) { event.getMappings().stream() .filter(mapping -> mapping.key.getPath().equals("mana")) .forEach(mapping -> mapping.remap(ModFluids.MANA.getActualBlock())); event.getMappings().stream() .filter(mapping -> mapping.key.getPath().equals("nacre")) .forEach(mapping -> mapping.remap(ModFluids.NACRE.getActualBlock())); }
@SubscribeEvent public void onMissingItem(RegistryEvent.MissingMappings<Item> event) { for (RegistryEvent.MissingMappings.Mapping<Item> entry : event.getAllMappings()) { if (entry.key.toString().equals("genetics:dictionary")) { ResourceLocation newTotem = new ResourceLocation("extrabees:dictionary"); Item value = event.getRegistry().getValue(newTotem); if (value != null) { entry.remap(value); } } } } }
public void handleBlockRemaps(Collection<Mapping<Block>> mappings) { for (Mapping<Block> mapping : mappings) { Block remap = blockRemaps.get(mapping.key); if (remap != null) mapping.remap(remap); } }
@SubscribeEvent public void missingMapItem(RegistryEvent.MissingMappings<Item> event) { for (RegistryEvent.MissingMappings.Mapping<Item> missing : event.getMappings()) { ResourceLocation identifier = new ResourceLocation(missing.key.getResourcePath()); if (identifier.equals(new ResourceLocation(JurassiCraft.MODID, "action_figure"))) { missing.remap(ItemHandler.DISPLAY_BLOCK_ITEM); } } } }
@SubscribeEvent public static void handleMissingMapping(RegistryEvent.MissingMappings<Item> event) { for (RegistryEvent.MissingMappings.Mapping<Item> mapping : event.getMappings()) { if (mapping.key.getPath().equalsIgnoreCase("antiqueatlas")) mapping.remap(ATLAS); else if (mapping.key.getPath().equalsIgnoreCase("emptyantiqueatlas")) mapping.remap(EMPTY_ATLAS); } } }
@SubscribeEvent public void onMissingBlocks(RegistryEvent.MissingMappings<Block> e) { for (RegistryEvent.MissingMappings.Mapping<Block> m : e.getMappings()) { String entry = blockIDMap.get(m.key.getResourcePath()); if (entry == null) continue; Block value = ForgeRegistries.BLOCKS.getValue(new ResourceLocation(LPConstants.LP_MOD_ID, entry)); if (value == null) continue; m.remap(value); } }