Did more work on the Ritual Reader. Fixed issue with the Ritual Diviner cycling its direction when you right click on the MRS.
This commit is contained in:
parent
057a951732
commit
9fe525b74b
10 changed files with 148 additions and 16 deletions
|
@ -19,6 +19,7 @@ import net.minecraft.util.EnumFacing;
|
|||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.EnumParticleTypes;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.RayTraceResult;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
@ -285,9 +286,18 @@ public class ItemRitualDiviner extends Item implements IVariantProvider
|
|||
@Override
|
||||
public ActionResult<ItemStack> onItemRightClick(ItemStack stack, World world, EntityPlayer player, EnumHand hand)
|
||||
{
|
||||
if (player.isSneaking() && !world.isRemote)
|
||||
RayTraceResult ray = this.getMovingObjectPositionFromPlayer(world, player, false);
|
||||
if (ray != null && ray.typeOfHit == RayTraceResult.Type.BLOCK)
|
||||
{
|
||||
cycleRitual(stack, player);
|
||||
return new ActionResult<ItemStack>(EnumActionResult.PASS, stack);
|
||||
}
|
||||
|
||||
if (player.isSneaking())
|
||||
{
|
||||
if (!world.isRemote)
|
||||
{
|
||||
cycleRitual(stack, player);
|
||||
}
|
||||
|
||||
return new ActionResult<ItemStack>(EnumActionResult.SUCCESS, stack);
|
||||
}
|
||||
|
@ -302,6 +312,12 @@ public class ItemRitualDiviner extends Item implements IVariantProvider
|
|||
{
|
||||
EntityPlayer player = (EntityPlayer) entityLiving;
|
||||
|
||||
RayTraceResult ray = this.getMovingObjectPositionFromPlayer(player.worldObj, player, false);
|
||||
if (ray != null && ray.typeOfHit == RayTraceResult.Type.BLOCK)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!player.isSwingInProgress)
|
||||
{
|
||||
if (player.isSneaking())
|
||||
|
|
|
@ -94,7 +94,6 @@ public class ItemRitualReader extends Item implements IVariantProvider
|
|||
{
|
||||
if (!world.isRemote)
|
||||
{
|
||||
System.out.println("In onItemUse");
|
||||
EnumRitualReaderState state = this.getState(stack);
|
||||
TileEntity tile = world.getTileEntity(pos);
|
||||
if (tile instanceof IMasterRitualStone)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue