Sneaking breaks rings' ability

This commit is contained in:
Ellpeck 2015-11-18 22:33:12 +01:00
parent 02e5a161dc
commit 09bdfd98a0
3 changed files with 3 additions and 3 deletions

View file

@ -39,7 +39,7 @@ public class ItemGrowthRing extends ItemEnergy{
@Override
public void onUpdate(ItemStack stack, World world, Entity entity, int par4, boolean par5){
if(!(entity instanceof EntityPlayer) || world.isRemote){
if(!(entity instanceof EntityPlayer) || world.isRemote || entity.isSneaking()){
return;
}

View file

@ -36,7 +36,7 @@ public class ItemMagnetRing extends ItemEnergy{
@SuppressWarnings("unchecked")
@Override
public void onUpdate(ItemStack stack, World world, Entity entity, int par4, boolean par5){
if(this.getEnergyStored(stack) >= ConfigIntValues.MAGNET_RING_ENERGY_USE.getValue()){
if(this.getEnergyStored(stack) >= ConfigIntValues.MAGNET_RING_ENERGY_USE.getValue() && !entity.isSneaking()){
//Get all the Items in the area
ArrayList<EntityItem> items = (ArrayList<EntityItem>)world.getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(entity.posX-ConfigIntValues.MAGNET_RING_RANGE.getValue(), entity.posY-ConfigIntValues.MAGNET_RING_RANGE.getValue(), entity.posZ-ConfigIntValues.MAGNET_RING_RANGE.getValue(), entity.posX+ConfigIntValues.MAGNET_RING_RANGE.getValue(), entity.posY+ConfigIntValues.MAGNET_RING_RANGE.getValue(), entity.posZ+ConfigIntValues.MAGNET_RING_RANGE.getValue()));
if(!items.isEmpty()){

View file

@ -32,7 +32,7 @@ public class ItemWaterRemovalRing extends ItemEnergy{
@Override
public void onUpdate(ItemStack stack, World world, Entity entity, int par4, boolean par5){
if(!(entity instanceof EntityPlayer) || world.isRemote){
if(!(entity instanceof EntityPlayer) || world.isRemote || entity.isSneaking()){
return;
}