use of net.geforcemods.securitycraft.api.Owner in project SecurityCraft by Geforce132.
the class BlockKeypad method convert.
@Override
public boolean convert(EntityPlayer player, World world, int x, int y, int z) {
Owner owner = ((IOwnable) world.getTileEntity(x, y, z)).getOwner();
world.setBlock(x, y, z, SCContent.keypad, world.getBlockMetadata(x, y, z), 3);
((IOwnable) world.getTileEntity(x, y, z)).getOwner().set(owner);
return true;
}
use of net.geforcemods.securitycraft.api.Owner in project SecurityCraft by Geforce132.
the class BlockClaymore method defuseMine.
@Override
public void defuseMine(World world, int par2, int par3, int par4) {
if (!world.isRemote) {
Owner owner = ((IOwnable) world.getTileEntity(par2, par3, par4)).getOwner();
world.setBlock(par2, par3, par4, SCContent.claymoreDefused);
((IOwnable) world.getTileEntity(par2, par3, par4)).setOwner(owner.getUUID(), owner.getName());
}
}
use of net.geforcemods.securitycraft.api.Owner in project SecurityCraft by Geforce132.
the class BlockMine method activateMine.
@Override
public void activateMine(World world, int par2, int par3, int par4) {
if (!world.isRemote) {
Owner owner = ((IOwnable) world.getTileEntity(par2, par3, par4)).getOwner();
world.setBlock(par2, par3, par4, SCContent.mine);
((IOwnable) world.getTileEntity(par2, par3, par4)).setOwner(owner.getUUID(), owner.getName());
}
}
use of net.geforcemods.securitycraft.api.Owner in project SecurityCraft by Geforce132.
the class BlockMine method defuseMine.
@Override
public void defuseMine(World world, int par2, int par3, int par4) {
if (!world.isRemote) {
Owner owner = ((IOwnable) world.getTileEntity(par2, par3, par4)).getOwner();
world.setBlock(par2, par3, par4, SCContent.mineCut);
((IOwnable) world.getTileEntity(par2, par3, par4)).setOwner(owner.getUUID(), owner.getName());
}
}
use of net.geforcemods.securitycraft.api.Owner in project SecurityCraft by Geforce132.
the class ItemBlockReinforcedSlabs2 method tryPlace.
private boolean tryPlace(ItemStack stack, World worldIn, EntityPlayer player, BlockPos pos, Object variantInStack) {
IBlockState iblockstate = worldIn.getBlockState(pos);
Owner owner = null;
if (worldIn.getTileEntity(pos) instanceof IOwnable)
owner = ((IOwnable) worldIn.getTileEntity(pos)).getOwner();
if (iblockstate.getBlock() == singleSlab) {
Comparable<?> comparable = iblockstate.getValue(singleSlab.getVariantProperty());
if (comparable == variantInStack) {
IBlockState iblockstate1 = this.makeState(singleSlab.getVariantProperty(), comparable);
if (worldIn.checkNoEntityCollision(iblockstate1.getCollisionBoundingBox(worldIn, pos)) && worldIn.setBlockState(pos, iblockstate1, 3)) {
worldIn.playSound(player, pos, doubleSlab.getSoundType().getPlaceSound(), SoundCategory.BLOCKS, (doubleSlab.getSoundType().getVolume() + 1.0F) / 2.0F, doubleSlab.getSoundType().getPitch() * 0.8F);
stack.shrink(1);
if (owner != null)
((IOwnable) worldIn.getTileEntity(pos)).getOwner().set(owner.getUUID(), owner.getName());
}
return true;
}
}
return false;
}
Aggregations