mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-12 08:17:35 +00:00
1 parent
a824214333
commit
3d12ef56b5
2 files changed
+17
-2
No files matched your search
@@ -24,6 +24,7 @@
|
||||
|
||||
package net.minecraftforge.common;
|
||||
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.biome.Biome;
|
||||
import static net.minecraftforge.common.config.Configuration.CATEGORY_CLIENT;
|
||||
import static net.minecraftforge.common.config.Configuration.CATEGORY_GENERAL;
|
||||
@@ -86,6 +87,7 @@ import net.minecraftforge.fml.common.WorldAccessContainer;
|
||||
import net.minecraftforge.fml.common.discovery.ASMDataTable.ASMData;
|
||||
import net.minecraftforge.fml.common.event.FMLConstructionEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLLoadCompleteEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLMissingMappingsEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLModIdMappingEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
@@ -350,6 +352,19 @@ public class ForgeModContainer extends DummyModContainer implements WorldAccessC
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void missingMapping(FMLMissingMappingsEvent event)
|
||||
{
|
||||
for (FMLMissingMappingsEvent.MissingMapping entry : event.getAll())
|
||||
{
|
||||
if (entry.name.equals("minecraft:totem")) //This item changed from 1.11 -> 1.11.2
|
||||
{
|
||||
ResourceLocation newTotem = new ResourceLocation("minecraft:totem_of_undying");
|
||||
entry.remap(ForgeRegistries.ITEMS.getValue(newTotem));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void playerLogin(PlayerEvent.PlayerLoggedInEvent event)
|
||||
{
|
||||
|
||||
+2
-2
@@ -761,7 +761,7 @@ public class FMLControlledNamespacedRegistry<I extends IForgeRegistryEntry<I>> e
|
||||
if (currId == -1)
|
||||
{
|
||||
FMLLog.info("Found a missing id from the world %s", itemName);
|
||||
missingIds.put(entry.getKey(), newId);
|
||||
missingIds.put(itemName, newId);
|
||||
continue; // no block/item -> nothing to add
|
||||
}
|
||||
else if (currId != newId)
|
||||
@@ -772,7 +772,7 @@ public class FMLControlledNamespacedRegistry<I extends IForgeRegistryEntry<I>> e
|
||||
I obj = currentRegistry.getRaw(itemName);
|
||||
Preconditions.checkState(obj != null, "objectKey has an ID but no object. Reflection/ASM hackery? Registry bug?");
|
||||
I sub = obj;
|
||||
// If we have an object in the originals set, we use that for initial adding - substitute activation will readd the substitute if neceessary later
|
||||
// If we have an object in the originals set, we use that for initial adding - substitute activation will re-add the substitute if necessary later
|
||||
if (currentRegistry.substitutionOriginals.containsKey(itemName))
|
||||
{
|
||||
obj = currentRegistry.substitutionOriginals.get(itemName);
|
||||
|
||||
Reference in new issue
Block a user