Fixed empty string storage in existing Alchemy Arrays.
This commit is contained in:
parent
ad546380a3
commit
11e56158d3
|
@ -162,6 +162,7 @@ public class Constants
|
|||
public static class Misc
|
||||
{
|
||||
public static final int POTION_ARRAY_SIZE = 256;
|
||||
public static final float ALTERED_STEP_HEIGHT = 1.00314159f;
|
||||
}
|
||||
|
||||
public enum BloodMagicItem
|
||||
|
|
|
@ -166,10 +166,14 @@ public class BlockAltar extends BlockContainer implements IVariantProvider, IDoc
|
|||
|
||||
@Override
|
||||
public void breakBlock(World world, BlockPos blockPos, IBlockState blockState)
|
||||
{
|
||||
TileEntity tile = world.getTileEntity(blockPos);
|
||||
if (tile instanceof TileAltar)
|
||||
{
|
||||
TileAltar tileAltar = (TileAltar) world.getTileEntity(blockPos);
|
||||
if (tileAltar != null)
|
||||
tileAltar.dropItems();
|
||||
}
|
||||
|
||||
super.breakBlock(world, blockPos, blockState);
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@ import net.minecraft.nbt.NBTTagCompound;
|
|||
public class LivingArmourUpgradeStepAssist extends LivingArmourUpgrade
|
||||
{
|
||||
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 int[] sprintSpeedTime = new int[] { 0, 0, 0, 0, 0, 20, 60, 60, 100, 200 };
|
||||
|
|
|
@ -43,7 +43,7 @@ public class TileAlchemyArray extends TileInventory implements ITickable
|
|||
super.writeToNBT(tagCompound);
|
||||
tagCompound.setBoolean("isActive", isActive);
|
||||
tagCompound.setInteger("activeCounter", activeCounter);
|
||||
tagCompound.setString("key", key);
|
||||
tagCompound.setString("key", key == "" ? "empty" : key);
|
||||
|
||||
NBTTagCompound arrayTag = new NBTTagCompound();
|
||||
if (arrayEffect != null)
|
||||
|
|
|
@ -98,12 +98,13 @@ public class LivingArmourHandler
|
|||
if (event.getEntityLiving() instanceof EntityPlayer)
|
||||
{
|
||||
EntityPlayer player = (EntityPlayer) event.getEntityLiving();
|
||||
boolean hasAssist = false;
|
||||
if (event.getEntityLiving().isPotionActive(ModPotions.boost))
|
||||
{
|
||||
player.stepHeight = 1.0f;
|
||||
hasAssist = true;
|
||||
player.stepHeight = Constants.Misc.ALTERED_STEP_HEIGHT;
|
||||
} else
|
||||
{
|
||||
boolean hasAssist = false;
|
||||
if (LivingArmour.hasFullSet(player))
|
||||
{
|
||||
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;
|
||||
|
||||
if (LivingArmour.hasFullSet(player))
|
||||
|
|
Loading…
Reference in a new issue