mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-12-23 03:49:22 +01:00
Sneaking breaks rings' ability
This commit is contained in:
parent
02e5a161dc
commit
09bdfd98a0
3 changed files with 3 additions and 3 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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()){
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue