Basic sigils implementation
This commit is contained in:
parent
ae85224003
commit
5dff08380d
61 changed files with 1394 additions and 106 deletions
|
@ -23,7 +23,7 @@ public class ItemSigilLava extends ItemSigilBase {
|
|||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {
|
||||
if (!world.isRemote && !isUnusable(stack)) {
|
||||
MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(world, player, true);
|
||||
MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(world, player, false);
|
||||
|
||||
if (movingobjectposition != null) {
|
||||
ItemStack ret = net.minecraftforge.event.ForgeEventFactory.onBucketUse(player, world, stack, movingobjectposition);
|
||||
|
@ -47,12 +47,10 @@ public class ItemSigilLava extends ItemSigilBase {
|
|||
return stack;
|
||||
}
|
||||
|
||||
if (this.canPlaceLava(world, blockpos1) && syphonBatteries(stack, player, getEnergyUsed())) {
|
||||
this.tryPlaceLava(world, blockpos1);
|
||||
if (this.canPlaceLava(world, blockpos1) && syphonBatteries(stack, player, getEnergyUsed()) && this.tryPlaceLava(world, blockpos1)) {
|
||||
return stack;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return stack;
|
||||
}
|
||||
|
||||
if (!player.capabilities.isCreativeMode)
|
||||
|
@ -86,25 +84,14 @@ public class ItemSigilLava extends ItemSigilBase {
|
|||
// return false;
|
||||
// }
|
||||
|
||||
{
|
||||
int x = blockPos.getX();
|
||||
int y = blockPos.getY();
|
||||
int z = blockPos.getZ();
|
||||
BlockPos newPos = blockPos.offset(side);
|
||||
|
||||
if (side.getIndex() == 0) --y;
|
||||
if (side.getIndex() == 1) ++y;
|
||||
if (side.getIndex() == 2) --z;
|
||||
if (side.getIndex() == 3) ++z;
|
||||
if (side.getIndex() == 4) --x;
|
||||
if (side.getIndex() == 5) ++x;
|
||||
if (!player.canPlayerEdit(newPos, side, stack)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!player.canPlayerEdit(new BlockPos(x, y, z), side, stack)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.canPlaceLava(world, new BlockPos(x, y, z)) && syphonBatteries(stack, player, getEnergyUsed())) {
|
||||
return this.tryPlaceLava(world, new BlockPos(x, y, z));
|
||||
}
|
||||
if (this.canPlaceLava(world, newPos) && syphonBatteries(stack, player, getEnergyUsed())) {
|
||||
return this.tryPlaceLava(world, newPos);
|
||||
}
|
||||
|
||||
return false;
|
||||
|
@ -116,7 +103,7 @@ public class ItemSigilLava extends ItemSigilBase {
|
|||
} else if ((world.getBlockState(blockPos).getBlock() == Blocks.lava || world.getBlockState(blockPos).getBlock() == Blocks.flowing_lava) && world.getBlockState(blockPos).getBlock().getMetaFromState(world.getBlockState(blockPos)) == 0) {
|
||||
return false;
|
||||
} else {
|
||||
world.setBlockState(blockPos, Blocks.lava.getBlockState().getBaseState());
|
||||
world.setBlockState(blockPos, Blocks.lava.getBlockState().getBaseState(), 3);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue