Should fix altar crashing

This commit is contained in:
Nick 2015-11-03 08:31:34 -08:00
parent b1e8930c11
commit bd564ee7cf

View file

@ -9,6 +9,7 @@ import WayofTime.bloodmagic.api.altar.EnumAltarTier;
import WayofTime.bloodmagic.api.altar.IBloodAltar; import WayofTime.bloodmagic.api.altar.IBloodAltar;
import WayofTime.bloodmagic.api.registry.AltarRecipeRegistry; import WayofTime.bloodmagic.api.registry.AltarRecipeRegistry;
import WayofTime.bloodmagic.block.BlockLifeEssence; import WayofTime.bloodmagic.block.BlockLifeEssence;
import com.google.common.base.Enums;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.server.gui.IUpdatePlayerListBox; import net.minecraft.server.gui.IUpdatePlayerListBox;
@ -70,7 +71,7 @@ public class TileAltar extends TileInventory implements IBloodAltar, IUpdatePlay
setInputFluid(fluidIn); setInputFluid(fluidIn);
} }
altarTier = EnumAltarTier.valueOf(tagCompound.getString(NBTHolder.NBT_ALTAR_TIER)); altarTier = Enums.getIfPresent(EnumAltarTier.class, tagCompound.getString(NBTHolder.NBT_ALTAR_TIER)).get();
isActive = tagCompound.getBoolean(NBTHolder.NBT_ALTAR_ACTIVE); isActive = tagCompound.getBoolean(NBTHolder.NBT_ALTAR_ACTIVE);
liquidRequired = tagCompound.getInteger(NBTHolder.NBT_ALTAR_LIQUID_REQ); liquidRequired = tagCompound.getInteger(NBTHolder.NBT_ALTAR_LIQUID_REQ);
canBeFilled = tagCompound.getBoolean(NBTHolder.NBT_ALTAR_FILLABLE); canBeFilled = tagCompound.getBoolean(NBTHolder.NBT_ALTAR_FILLABLE);