From 4e963ca6e1605dca4e67c81e26878833915b8f85 Mon Sep 17 00:00:00 2001 From: CovertJaguar Date: Wed, 17 Dec 2014 00:28:21 -0800 Subject: [PATCH] Improve ErrorStateRegistry --- api | 2 +- src/main/java/forestry/core/EnumErrorCode.java | 6 ++++++ src/main/java/forestry/core/network/PacketTileUpdate.java | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/api b/api index 20c3aa3ee..8799e138d 160000 --- a/api +++ b/api @@ -1 +1 @@ -Subproject commit 20c3aa3eeee65fcec5b0590fce83445ec27c27b9 +Subproject commit 8799e138dab95de6504ecdbe158aef9a12ec9c35 diff --git a/src/main/java/forestry/core/EnumErrorCode.java b/src/main/java/forestry/core/EnumErrorCode.java index 4fb450e9a..4faceb025 100644 --- a/src/main/java/forestry/core/EnumErrorCode.java +++ b/src/main/java/forestry/core/EnumErrorCode.java @@ -9,6 +9,7 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import forestry.api.core.ErrorStateRegistry; import forestry.api.core.IErrorState; +import forestry.core.config.Defaults; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.util.IIcon; @@ -96,6 +97,11 @@ public enum EnumErrorCode implements IErrorState { return (short) ordinal(); } + @Override + public String getUniqueName() { + return Defaults.MOD + ":" + name; + } + public static void init() { for (IErrorState code : values()) { ErrorStateRegistry.registerErrorState(code); diff --git a/src/main/java/forestry/core/network/PacketTileUpdate.java b/src/main/java/forestry/core/network/PacketTileUpdate.java index ede729579..e5a1f523d 100755 --- a/src/main/java/forestry/core/network/PacketTileUpdate.java +++ b/src/main/java/forestry/core/network/PacketTileUpdate.java @@ -86,7 +86,7 @@ public class PacketTileUpdate extends PacketUpdate { posZ = data.readInt(); orientation = ForgeDirection.getOrientation(data.readByte()); - errorState = ErrorStateRegistry.getErrorStateFromCode(data.readShort()); + errorState = ErrorStateRegistry.getErrorState(data.readShort()); int ordinal = data.readByte(); isOwnable = ordinal >= 0;