Fix atomic disassembler offhand interaction

This commit is contained in:
aidancbrady committed 2017-04-27 16:09:09 -04:00
1 parent 703974b9e8
commit 009cca7b92
2 files changed
+8 -9

No files matched your search

@@ -6,8 +6,6 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
import com.google.common.collect.Multimap;
import mekanism.api.Coord4D;
import mekanism.api.EnumColor;
import mekanism.common.config.MekanismConfig.general;
@@ -36,6 +34,8 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.TextComponentString;
import net.minecraft.world.World;
import com.google.common.collect.Multimap;
public class ItemAtomicDisassembler extends ItemEnergized
{
public double HOE_USAGE = 10 * general.DISASSEMBLER_USAGE;
@@ -182,9 +182,10 @@ public class ItemAtomicDisassembler extends ItemEnergized
{
toggleMode(itemstack);
entityplayer.sendMessage(new TextComponentString(EnumColor.DARK_BLUE + "[Mekanism] " + EnumColor.GREY + LangUtils.localize("tooltip.modeToggle") + " " + EnumColor.INDIGO + getModeName(itemstack) + EnumColor.AQUA + " (" + getEfficiency(itemstack) + ")"));
return new ActionResult(EnumActionResult.SUCCESS, itemstack);
}
return new ActionResult(EnumActionResult.SUCCESS, itemstack);
return new ActionResult(EnumActionResult.PASS, itemstack);
}
@Override
@@ -192,14 +193,11 @@ public class ItemAtomicDisassembler extends ItemEnergized
{
ItemStack stack = player.getHeldItem(hand);
if(!player.isSneaking())
if(!player.isSneaking() && world.getBlockState(pos).getBlock() == Blocks.FARMLAND)
{
if(useHoe(stack, player, world, pos, side) == EnumActionResult.FAIL)
{
if(world.getBlockState(pos).getBlock() != Blocks.FARMLAND)
{
return EnumActionResult.FAIL;
}
return EnumActionResult.FAIL;
}
switch(getEfficiency(stack))