Fixed the Sigil of Translocation so that it does not crash when picking up certain blocks. Also removed the damned lightning. #918

This commit is contained in:
WayofTime 2016-09-22 15:37:11 -04:00
parent 7d91cc40ff
commit e9517194f9
3 changed files with 8 additions and 14 deletions

View file

@ -5,6 +5,7 @@ Version 2.1.0-64
- Changed the recipe of the Acceleration rune so that it is a T4 rune.
- Added the Charging rune, which accumulates charge by using the LP from the Blood Altar (1 charge = 1 LP always). If enough charge is stored when crafting, the crafting occurs instantly.
- Added the entries for the Rune of Augmented Capacity, Charging Rune, and Rune of Acceleration
- Fixed the Sigil of Translocation so that it does not crash when picking up certain blocks. Also removed the damned lightning.
------------------------------------------------------
Version 2.1.0-63

View file

@ -7,7 +7,6 @@ import net.minecraft.block.state.IBlockState;
import net.minecraft.item.ItemStack;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.fml.common.registry.GameData;
@Getter
@EqualsAndHashCode(exclude = { "state" })

View file

@ -2,12 +2,8 @@ package WayofTime.bloodmagic.item.sigil;
import java.util.List;
import WayofTime.bloodmagic.BloodMagic;
import WayofTime.bloodmagic.api.BloodMagicAPI;
import WayofTime.bloodmagic.api.util.helper.NetworkHelper;
import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.effect.EntityLightningBolt;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
@ -23,8 +19,10 @@ import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import WayofTime.bloodmagic.ConfigHandler;
import WayofTime.bloodmagic.api.BlockStack;
import WayofTime.bloodmagic.api.BloodMagicAPI;
import WayofTime.bloodmagic.api.Constants;
import WayofTime.bloodmagic.api.util.helper.NBTHelper;
import WayofTime.bloodmagic.api.util.helper.NetworkHelper;
public class ItemSigilTransposition extends ItemSigilBase
{
@ -60,7 +58,11 @@ public class ItemSigilTransposition extends ItemSigilBase
if (tag.hasKey(Constants.NBT.CONTAINED_BLOCK_NAME) && tag.hasKey(Constants.NBT.CONTAINED_BLOCK_META))
{
BlockStack blockStack = new BlockStack(ForgeRegistries.BLOCKS.getValue(new ResourceLocation(tag.getString(Constants.NBT.CONTAINED_BLOCK_NAME))), tag.getByte(Constants.NBT.CONTAINED_BLOCK_META));
return super.getItemStackDisplayName(stack) + " (" + blockStack.getItemStack().getDisplayName() + ")";
if (blockStack.getItemStack() != null && blockStack.getItemStack().getItem() != null) //TODO: Figure out why it's a null item. This is a patchwork solution.
{
return super.getItemStackDisplayName(stack) + " (" + blockStack.getItemStack().getDisplayName() + ")";
}
}
return super.getItemStackDisplayName(stack);
}
@ -103,7 +105,6 @@ public class ItemSigilTransposition extends ItemSigilBase
stack.getTagCompound().setTag(Constants.NBT.CONTAINED_TILE_ENTITY, tileNBTTag);
NetworkHelper.getSoulNetwork(player).syphonAndDamage(player, cost);
lightning(world, blockPos);
world.removeTileEntity(blockPos);
world.setBlockToAir(blockPos);
@ -142,7 +143,6 @@ public class ItemSigilTransposition extends ItemSigilBase
stack.getTagCompound().removeTag(Constants.NBT.CONTAINED_BLOCK_META);
stack.getTagCompound().removeTag(Constants.NBT.CONTAINED_TILE_ENTITY);
lightning(world, blockPos);
return EnumActionResult.SUCCESS;
}
}
@ -150,10 +150,4 @@ public class ItemSigilTransposition extends ItemSigilBase
}
return EnumActionResult.FAIL;
}
public void lightning(World world, BlockPos blockPos)
{
world.addWeatherEffect(new EntityLightningBolt(world, blockPos.getX(), blockPos.getY(), blockPos.getZ(), true));
}
}