Search in sources :

Example 1 with IForgeRegistryEntry

use of net.minecraftforge.registries.IForgeRegistryEntry in project ImmersiveEngineering by BluSunrize.

the class NameRemapper method remap.

public static void remap(MissingMappings<?> ev) {
    for (MissingMappings.Mapping miss : ev.getMappings()) {
        String newName = nameMap.get(miss.key.getPath());
        if (newName != null) {
            ResourceLocation newLoc = new ResourceLocation(ImmersiveEngineering.MODID, newName);
            IForgeRegistryEntry newTarget = miss.registry.getValue(newLoc);
            if (newTarget != null) {
                IELogger.info("Successfully remapped RegistryEntry " + miss.key);
                miss.remap(newTarget);
            } else
                miss.warn();
        } else {
            IELogger.error("Couldn't remap " + miss.key);
        }
    }
}
Also used : IForgeRegistryEntry(net.minecraftforge.registries.IForgeRegistryEntry) ResourceLocation(net.minecraft.util.ResourceLocation) MissingMappings(net.minecraftforge.event.RegistryEvent.MissingMappings)

Aggregations

ResourceLocation (net.minecraft.util.ResourceLocation)1 MissingMappings (net.minecraftforge.event.RegistryEvent.MissingMappings)1 IForgeRegistryEntry (net.minecraftforge.registries.IForgeRegistryEntry)1