Some tweaks - GameRegistry is modder facing API, so avoid having MC methods there. Fix a couple of registry bugs.
This commit is contained in:
parent
0af45cbf25
commit
55e707cc07
4 changed files with 3 additions and 15 deletions
|
@ -28,7 +28,7 @@ import net.minecraftforge.fml.common.registry.RegistryDelegate.Delegate;
|
|||
|
||||
public class FMLControlledNamespacedRegistry<I> extends RegistryNamespacedDefaultedByKey<ResourceLocation, I>
|
||||
{
|
||||
public static final boolean DEBUG = Boolean.parseBoolean(System.getProperty("fml.debugRegistryEntries", "false"));
|
||||
public static final boolean DEBUG = Boolean.parseBoolean(System.getProperty("fml.debugRegistryEntries", "true"));
|
||||
private final Class<I> superType;
|
||||
private final boolean isDelegated;
|
||||
private final Field delegateAccessor;
|
||||
|
|
|
@ -32,7 +32,7 @@ public class GameData
|
|||
static final int MAX_BLOCK_ID = 4095;
|
||||
static final int MIN_ITEM_ID = 4096;
|
||||
static final int MAX_ITEM_ID = 31999;
|
||||
public static final int MIN_POTION_ID = 32; // 0-31 are vanilla, forge start at 32
|
||||
public static final int MIN_POTION_ID = 0; // 0-~31 are vanilla, forge start at 32
|
||||
public static final int MAX_POTION_ID = 255; // S1DPacketEntityEffect sends bytes, we can only use 255
|
||||
|
||||
private static final GameData mainData = new GameData();
|
||||
|
@ -147,13 +147,6 @@ public class GameData
|
|||
return iBlockRegistry.add(idHint, name, block);
|
||||
}
|
||||
|
||||
/**
|
||||
* Called from GameRegistry, which is called from Potion-Constructor
|
||||
*/
|
||||
int registerPotion(Potion potion, ResourceLocation name, int id) {
|
||||
return iPotionRegistry.add(id, name, potion);
|
||||
}
|
||||
|
||||
/**
|
||||
* Prefix the supplied name with the current mod id.
|
||||
* <p/>
|
||||
|
|
|
@ -236,11 +236,6 @@ public class GameRegistry
|
|||
}
|
||||
}
|
||||
|
||||
/** Called from Potion Constructor */
|
||||
public static int registerPotion(Potion potion, ResourceLocation name, int potionID) {
|
||||
return GameData.getMain().registerPotion(potion, name, potionID);
|
||||
}
|
||||
|
||||
public static void addRecipe(ItemStack output, Object... params)
|
||||
{
|
||||
addShapedRecipe(output, params);
|
||||
|
|
|
@ -217,8 +217,8 @@ public class PersistentRegistryManager
|
|||
|
||||
private static <T> void loadFrozenDataToStagingRegistry(Map<ResourceLocation, Map<ResourceLocation, Integer[]>> remaps, ResourceLocation registryName, Class<T> regType)
|
||||
{
|
||||
FMLControlledNamespacedRegistry<T> newRegistry = PersistentRegistry.STAGING.getRegistry(registryName, regType);
|
||||
FMLControlledNamespacedRegistry<T> frozenRegistry = PersistentRegistry.FROZEN.getRegistry(registryName, regType);
|
||||
FMLControlledNamespacedRegistry<T> newRegistry = PersistentRegistry.STAGING.getOrShallowCopyRegistry(registryName, regType, frozenRegistry);
|
||||
newRegistry.loadIds(frozenRegistry.getEntriesNotIn(newRegistry), Maps.<ResourceLocation, Integer>newLinkedHashMap(), remaps.get(registryName), frozenRegistry, registryName);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue