Sigils (257 errors)
This commit is contained in:
parent
d05d3b90df
commit
f95949a1c8
14 changed files with 150 additions and 140 deletions
|
@ -1,10 +1,12 @@
|
|||
package WayofTime.bloodmagic.item.sigil;
|
||||
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.EnumActionResult;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.RayTraceResult;
|
||||
import net.minecraft.world.World;
|
||||
|
@ -12,6 +14,7 @@ import net.minecraftforge.event.ForgeEventFactory;
|
|||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.IFluidBlock;
|
||||
import net.minecraftforge.fluids.IFluidHandler;
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
|
||||
public class ItemSigilVoid extends ItemSigilBase
|
||||
{
|
||||
|
@ -22,7 +25,7 @@ public class ItemSigilVoid extends ItemSigilBase
|
|||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player)
|
||||
public ActionResult<ItemStack> onItemRightClick(ItemStack stack, World world, EntityPlayer player, EnumHand hand)
|
||||
{
|
||||
if (!world.isRemote && !isUnusable(stack))
|
||||
{
|
||||
|
@ -30,7 +33,7 @@ public class ItemSigilVoid extends ItemSigilBase
|
|||
|
||||
if (movingobjectposition != null)
|
||||
{
|
||||
ItemStack ret = ForgeEventFactory.onBucketUse(player, world, stack, movingobjectposition);
|
||||
ActionResult<ItemStack> ret = ForgeEventFactory.onBucketUse(player, world, stack, movingobjectposition);
|
||||
if (ret != null)
|
||||
return ret;
|
||||
|
||||
|
@ -40,50 +43,48 @@ public class ItemSigilVoid extends ItemSigilBase
|
|||
|
||||
if (!world.isBlockModifiable(player, blockpos))
|
||||
{
|
||||
return stack;
|
||||
return super.onItemRightClick(stack, world, player, hand);
|
||||
}
|
||||
|
||||
if (!player.canPlayerEdit(blockpos.offset(movingobjectposition.sideHit), movingobjectposition.sideHit, stack))
|
||||
{
|
||||
return stack;
|
||||
return super.onItemRightClick(stack, world, player, hand);
|
||||
}
|
||||
|
||||
if (!player.canPlayerEdit(blockpos, movingobjectposition.sideHit, stack))
|
||||
{
|
||||
return stack;
|
||||
return super.onItemRightClick(stack, world, player, hand);
|
||||
}
|
||||
|
||||
if (world.getBlockState(blockpos).getBlock().getMaterial().isLiquid() && syphonNetwork(stack, player, getLPUsed()))
|
||||
if (world.getBlockState(blockpos).getBlock().getMaterial(world.getBlockState(blockpos)).isLiquid() && syphonNetwork(stack, player, getLPUsed()))
|
||||
{
|
||||
world.setBlockToAir(blockpos);
|
||||
return stack;
|
||||
return super.onItemRightClick(stack, world, player, hand);
|
||||
}
|
||||
}
|
||||
} else
|
||||
{
|
||||
return stack;
|
||||
return super.onItemRightClick(stack, world, player, hand);
|
||||
}
|
||||
|
||||
if (!player.capabilities.isCreativeMode)
|
||||
this.setUnusable(stack, !syphonNetwork(stack, player, getLPUsed()));
|
||||
}
|
||||
|
||||
return stack;
|
||||
return super.onItemRightClick(stack, world, player, hand);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, BlockPos blockPos, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
public EnumActionResult onItemUse(ItemStack stack, EntityPlayer player, World world, BlockPos blockPos, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
super.onItemUse(stack, player, world, blockPos, side, hitX, hitY, hitZ);
|
||||
|
||||
if (world.isRemote || player.isSneaking() || isUnusable(stack))
|
||||
{
|
||||
return false;
|
||||
return EnumActionResult.FAIL;
|
||||
}
|
||||
|
||||
if (!world.canMineBlockBody(player, blockPos))
|
||||
{
|
||||
return false;
|
||||
return EnumActionResult.FAIL;
|
||||
}
|
||||
|
||||
TileEntity tile = world.getTileEntity(blockPos);
|
||||
|
@ -94,25 +95,25 @@ public class ItemSigilVoid extends ItemSigilBase
|
|||
if (amount != null && amount.amount > 0 && syphonNetwork(stack, player, getLPUsed()))
|
||||
{
|
||||
((IFluidHandler) tile).drain(side, 1000, true);
|
||||
return true;
|
||||
return EnumActionResult.SUCCESS;
|
||||
}
|
||||
|
||||
return false;
|
||||
return EnumActionResult.FAIL;
|
||||
}
|
||||
|
||||
BlockPos newPos = blockPos.offset(side);
|
||||
|
||||
if (!player.canPlayerEdit(newPos, side, stack))
|
||||
{
|
||||
return false;
|
||||
return EnumActionResult.FAIL;
|
||||
}
|
||||
|
||||
if (world.getBlockState(newPos).getBlock() instanceof IFluidBlock && syphonNetwork(stack, player, getLPUsed()))
|
||||
{
|
||||
world.setBlockToAir(newPos);
|
||||
return true;
|
||||
return EnumActionResult.SUCCESS;
|
||||
}
|
||||
|
||||
return false;
|
||||
return EnumActionResult.FAIL;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue