Fixed empty string storage in existing Alchemy Arrays.

This commit is contained in:
WayofTime 2016-06-28 07:20:28 -04:00
parent ad546380a3
commit 11e56158d3
5 changed files with 16 additions and 10 deletions

View file

@ -162,6 +162,7 @@ public class Constants
public static class Misc public static class Misc
{ {
public static final int POTION_ARRAY_SIZE = 256; public static final int POTION_ARRAY_SIZE = 256;
public static final float ALTERED_STEP_HEIGHT = 1.00314159f;
} }
public enum BloodMagicItem public enum BloodMagicItem

View file

@ -167,9 +167,13 @@ public class BlockAltar extends BlockContainer implements IVariantProvider, IDoc
@Override @Override
public void breakBlock(World world, BlockPos blockPos, IBlockState blockState) public void breakBlock(World world, BlockPos blockPos, IBlockState blockState)
{ {
TileAltar tileAltar = (TileAltar) world.getTileEntity(blockPos); TileEntity tile = world.getTileEntity(blockPos);
if (tileAltar != null) if (tile instanceof TileAltar)
tileAltar.dropItems(); {
TileAltar tileAltar = (TileAltar) world.getTileEntity(blockPos);
if (tileAltar != null)
tileAltar.dropItems();
}
super.breakBlock(world, blockPos, blockState); super.breakBlock(world, blockPos, blockState);
} }

View file

@ -7,7 +7,7 @@ import net.minecraft.nbt.NBTTagCompound;
public class LivingArmourUpgradeStepAssist extends LivingArmourUpgrade public class LivingArmourUpgradeStepAssist extends LivingArmourUpgrade
{ {
public static final int[] costs = new int[] { 20 }; public static final int[] costs = new int[] { 20 };
public static final float[] assist = new float[] { 1 }; public static final float[] assist = new float[] { Constants.Misc.ALTERED_STEP_HEIGHT };
// public static final double[] speedModifier = new double[] { 0.1, 0.2, 0.3, 0.4, 0.5, 0.7, 0.9, 1.1, 1.3, 1.5 }; // public static final double[] speedModifier = new double[] { 0.1, 0.2, 0.3, 0.4, 0.5, 0.7, 0.9, 1.1, 1.3, 1.5 };
// public static final int[] sprintSpeedTime = new int[] { 0, 0, 0, 0, 0, 20, 60, 60, 100, 200 }; // public static final int[] sprintSpeedTime = new int[] { 0, 0, 0, 0, 0, 20, 60, 60, 100, 200 };

View file

@ -43,7 +43,7 @@ public class TileAlchemyArray extends TileInventory implements ITickable
super.writeToNBT(tagCompound); super.writeToNBT(tagCompound);
tagCompound.setBoolean("isActive", isActive); tagCompound.setBoolean("isActive", isActive);
tagCompound.setInteger("activeCounter", activeCounter); tagCompound.setInteger("activeCounter", activeCounter);
tagCompound.setString("key", key); tagCompound.setString("key", key == "" ? "empty" : key);
NBTTagCompound arrayTag = new NBTTagCompound(); NBTTagCompound arrayTag = new NBTTagCompound();
if (arrayEffect != null) if (arrayEffect != null)

View file

@ -98,12 +98,13 @@ public class LivingArmourHandler
if (event.getEntityLiving() instanceof EntityPlayer) if (event.getEntityLiving() instanceof EntityPlayer)
{ {
EntityPlayer player = (EntityPlayer) event.getEntityLiving(); EntityPlayer player = (EntityPlayer) event.getEntityLiving();
boolean hasAssist = false;
if (event.getEntityLiving().isPotionActive(ModPotions.boost)) if (event.getEntityLiving().isPotionActive(ModPotions.boost))
{ {
player.stepHeight = 1.0f; hasAssist = true;
player.stepHeight = Constants.Misc.ALTERED_STEP_HEIGHT;
} else } else
{ {
boolean hasAssist = false;
if (LivingArmour.hasFullSet(player)) if (LivingArmour.hasFullSet(player))
{ {
ItemStack chestStack = player.getItemStackFromSlot(EntityEquipmentSlot.CHEST); ItemStack chestStack = player.getItemStackFromSlot(EntityEquipmentSlot.CHEST);
@ -119,11 +120,11 @@ public class LivingArmourHandler
} }
} }
} }
if (!hasAssist)
player.stepHeight = 0.6f;
} }
if (!hasAssist && player.stepHeight == Constants.Misc.ALTERED_STEP_HEIGHT)
player.stepHeight = 0.6f;
float percentIncrease = 0; float percentIncrease = 0;
if (LivingArmour.hasFullSet(player)) if (LivingArmour.hasFullSet(player))