From ff42107b927c336229beda297d84fca5edec478f Mon Sep 17 00:00:00 2001 From: cpw Date: Mon, 30 Nov 2015 14:14:33 -0500 Subject: [PATCH] A few fixes --- .../net/minecraft/potion/Potion.java.patch | 14 ++++++++------ .../registry/FMLControlledNamespacedRegistry.java | 2 +- .../common/registry/PersistentRegistryManager.java | 1 + .../minecraftforge/debug/ModelAnimationDebug.java | 2 +- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/patches/minecraft/net/minecraft/potion/Potion.java.patch b/patches/minecraft/net/minecraft/potion/Potion.java.patch index 621a89f3c7..63d5eb26dc 100644 --- a/patches/minecraft/net/minecraft/potion/Potion.java.patch +++ b/patches/minecraft/net/minecraft/potion/Potion.java.patch @@ -9,18 +9,20 @@ private static final Map field_180150_I = Maps.newHashMap(); public static final Potion field_180151_b = null; public static final Potion field_76424_c = (new Potion(1, new ResourceLocation("speed"), false, 8171462)).func_76390_b("potion.moveSpeed").func_76399_b(0, 0).func_111184_a(SharedMonsterAttributes.field_111263_d, "91AEAA56-376B-4498-935B-2F7F68070635", 0.20000000298023224D, 2); -@@ -64,8 +64,10 @@ +@@ -64,10 +64,10 @@ private double field_76412_L; private boolean field_76413_M; + @Deprecated // use the Constructor without potion ID or everything will explode. protected Potion(int p_i45897_1_, ResourceLocation p_i45897_2_, boolean p_i45897_3_, int p_i45897_4_) { -+ p_i45897_1_ = net.minecraftforge.fml.common.registry.GameRegistry.registerPotion(this, p_i45897_2_, p_i45897_1_); - this.field_76415_H = p_i45897_1_; - field_76425_a[p_i45897_1_] = this; +- this.field_76415_H = p_i45897_1_; +- field_76425_a[p_i45897_1_] = this; ++ net.minecraftforge.fml.common.registry.GameData.getPotionRegistry().func_177775_a(p_i45897_1_, p_i45897_2_, this); field_180150_I.put(p_i45897_2_, this); -@@ -83,14 +85,18 @@ + this.field_76418_K = p_i45897_3_; + +@@ -83,14 +83,18 @@ this.field_76414_N = p_i45897_4_; } @@ -41,7 +43,7 @@ } protected Potion func_76399_b(int p_76399_1_, int p_76399_2_) -@@ -310,4 +316,27 @@ +@@ -310,4 +314,27 @@ { return p_111183_2_.func_111164_d() * (double)(p_111183_1_ + 1); } diff --git a/src/main/java/net/minecraftforge/fml/common/registry/FMLControlledNamespacedRegistry.java b/src/main/java/net/minecraftforge/fml/common/registry/FMLControlledNamespacedRegistry.java index 9d620514c5..e35847845b 100644 --- a/src/main/java/net/minecraftforge/fml/common/registry/FMLControlledNamespacedRegistry.java +++ b/src/main/java/net/minecraftforge/fml/common/registry/FMLControlledNamespacedRegistry.java @@ -28,7 +28,7 @@ import net.minecraftforge.fml.common.registry.RegistryDelegate.Delegate; public class FMLControlledNamespacedRegistry extends RegistryNamespacedDefaultedByKey { - public static final boolean DEBUG = Boolean.parseBoolean(System.getProperty("fml.debugRegistryEntries", "true")); + public static final boolean DEBUG = Boolean.parseBoolean(System.getProperty("fml.debugRegistryEntries", "false")); private final Class superType; private final boolean isDelegated; private final Field delegateAccessor; diff --git a/src/main/java/net/minecraftforge/fml/common/registry/PersistentRegistryManager.java b/src/main/java/net/minecraftforge/fml/common/registry/PersistentRegistryManager.java index a8c4a157aa..03d997d0d3 100644 --- a/src/main/java/net/minecraftforge/fml/common/registry/PersistentRegistryManager.java +++ b/src/main/java/net/minecraftforge/fml/common/registry/PersistentRegistryManager.java @@ -256,6 +256,7 @@ public class PersistentRegistryManager if (!PersistentRegistry.FROZEN.isPopulated()) { FMLLog.warning("Can't revert to frozen GameData state without freezing first."); + return; } else { diff --git a/src/test/java/net/minecraftforge/debug/ModelAnimationDebug.java b/src/test/java/net/minecraftforge/debug/ModelAnimationDebug.java index fbdb0e2540..20e48161cb 100644 --- a/src/test/java/net/minecraftforge/debug/ModelAnimationDebug.java +++ b/src/test/java/net/minecraftforge/debug/ModelAnimationDebug.java @@ -63,7 +63,6 @@ public class ModelAnimationDebug { public void preInit(FMLPreInitializationEvent event) { - B3DLoader.instance.addDomain(MODID); GameRegistry.registerBlock(new Block(Material.wood) { { @@ -149,6 +148,7 @@ public class ModelAnimationDebug public void preInit(FMLPreInitializationEvent event) { super.preInit(event); + B3DLoader.instance.addDomain(MODID); ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(GameRegistry.findBlock(MODID, blockName)), 0, new ModelResourceLocation(MODID.toLowerCase() + ":" + blockName, "inventory")); }