Rewrite Binding system to be fully automated
No more manual handling of binding items to players. Retains all previous functionality. I have tested on both the Client and Server and it seems to work just fine. If any issues arise from this, do not hesitate to yell at me. The deprecated methods will be removed after beta.
This commit is contained in:
parent
e219b50589
commit
8c1eaddb97
14 changed files with 152 additions and 165 deletions
|
@ -23,22 +23,17 @@ public class ItemSigilBloodLight extends ItemSigilBase
|
|||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player)
|
||||
{
|
||||
if (BindableHelper.checkAndSetItemOwner(stack, player) && ItemBindable.syphonNetwork(stack, player, getLPUsed() * 5) && !world.isRemote)
|
||||
MovingObjectPosition mop = this.getMovingObjectPositionFromPlayer(world, player, false);
|
||||
|
||||
if (mop != null && mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK)
|
||||
{
|
||||
MovingObjectPosition mop = this.getMovingObjectPositionFromPlayer(world, player, false);
|
||||
BlockPos blockPos = mop.getBlockPos().offset(mop.sideHit);
|
||||
|
||||
if (mop != null && mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK)
|
||||
{
|
||||
BlockPos blockPos = mop.getBlockPos().offset(mop.sideHit);
|
||||
|
||||
if (world.isAirBlock(blockPos))
|
||||
{
|
||||
world.setBlockState(blockPos, ModBlocks.bloodLight.getDefaultState());
|
||||
}
|
||||
} else
|
||||
{
|
||||
world.spawnEntityInWorld(new EntityBloodLight(world, player));
|
||||
}
|
||||
if (world.isAirBlock(blockPos))
|
||||
world.setBlockState(blockPos, ModBlocks.bloodLight.getDefaultState());
|
||||
} else
|
||||
{
|
||||
world.spawnEntityInWorld(new EntityBloodLight(world, player));
|
||||
}
|
||||
|
||||
return stack;
|
||||
|
@ -52,15 +47,10 @@ public class ItemSigilBloodLight extends ItemSigilBase
|
|||
if (world.isRemote)
|
||||
return false;
|
||||
|
||||
if (BindableHelper.checkAndSetItemOwner(stack, player) && ItemBindable.syphonNetwork(stack, player, getLPUsed()))
|
||||
{
|
||||
BlockPos newPos = blockPos.offset(side);
|
||||
BlockPos newPos = blockPos.offset(side);
|
||||
|
||||
if (world.isAirBlock(newPos))
|
||||
{
|
||||
world.setBlockState(newPos, ModBlocks.bloodLight.getDefaultState());
|
||||
}
|
||||
}
|
||||
if (world.isAirBlock(newPos))
|
||||
world.setBlockState(newPos, ModBlocks.bloodLight.getDefaultState());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue