use of org.freeforums.geforce.securitycraft.tileentity.TileEntityInventoryScanner in project SecurityCraft by Geforce132.
the class BlockInventoryScanner method breakBlock.
public void breakBlock(World par1World, int par2, int par3, int par4, Block par5Block, int par6) {
for (int i = 0; i < ((TileEntityInventoryScanner) par1World.getTileEntity(par2, par3, par4)).getContents().length; i++) {
if (((TileEntityInventoryScanner) par1World.getTileEntity(par2, par3, par4)).getContents()[i] != null) {
EntityItem item = new EntityItem(par1World, par2, par3, par4, ((TileEntityInventoryScanner) par1World.getTileEntity(par2, par3, par4)).getContents()[i]);
par1World.spawnEntityInWorld(item);
}
}
par1World.removeTileEntity(par2, par3, par4);
super.breakBlock(par1World, par2, par3, par4, par5Block, par6);
}
use of org.freeforums.geforce.securitycraft.tileentity.TileEntityInventoryScanner in project SecurityCraft by Geforce132.
the class HelpfulMethods method checkForModule.
public static boolean checkForModule(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, EnumCustomModules module) {
TileEntity te = par1World.getTileEntity(par2, par3, par4);
if (te == null || !(te instanceof CustomizableSCTE)) {
return false;
}
if (te instanceof TileEntityKeypad) {
if (module == EnumCustomModules.WHITELIST && ((CustomizableSCTE) te).hasModule(EnumCustomModules.WHITELIST) && HelpfulMethods.getPlayersFromModule(par1World, par2, par3, par4, EnumCustomModules.WHITELIST).contains(par5EntityPlayer.getCommandSenderName())) {
HelpfulMethods.sendMessageToPlayer(par5EntityPlayer, "You have been whitelisted on this keypad.", EnumChatFormatting.GREEN);
new ScheduleUpdate(par1World, 3, par2, par3, par4);
return true;
}
if (module == EnumCustomModules.BLACKLIST && ((CustomizableSCTE) te).hasModule(EnumCustomModules.BLACKLIST) && HelpfulMethods.getPlayersFromModule(par1World, par2, par3, par4, EnumCustomModules.BLACKLIST).contains(par5EntityPlayer.getCommandSenderName())) {
HelpfulMethods.sendMessageToPlayer(par5EntityPlayer, "You have been blacklisted on this keypad.", EnumChatFormatting.RED);
return true;
}
} else if (te instanceof TileEntityKeycardReader) {
if (module == EnumCustomModules.WHITELIST && ((CustomizableSCTE) te).hasModule(EnumCustomModules.WHITELIST) && HelpfulMethods.getPlayersFromModule(par1World, par2, par3, par4, EnumCustomModules.WHITELIST).contains(par5EntityPlayer.getCommandSenderName())) {
HelpfulMethods.sendMessageToPlayer(par5EntityPlayer, "You have been whitelisted on this reader.", EnumChatFormatting.GREEN);
((TileEntityKeycardReader) te).setIsProvidingPower(true);
new ScheduleKeycardUpdate(3, par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4));
par1World.notifyBlocksOfNeighborChange(par2, par3, par4, par1World.getBlock(par2, par3, par4));
return true;
}
if (module == EnumCustomModules.BLACKLIST && ((CustomizableSCTE) te).hasModule(EnumCustomModules.BLACKLIST) && HelpfulMethods.getPlayersFromModule(par1World, par2, par3, par4, EnumCustomModules.BLACKLIST).contains(par5EntityPlayer.getCommandSenderName())) {
HelpfulMethods.sendMessageToPlayer(par5EntityPlayer, "You have been blacklisted on this reader.", EnumChatFormatting.RED);
return true;
}
} else if (te instanceof TileEntityRetinalScanner) {
if (module == EnumCustomModules.WHITELIST && ((CustomizableSCTE) te).hasModule(EnumCustomModules.WHITELIST) && HelpfulMethods.getPlayersFromModule(par1World, par2, par3, par4, EnumCustomModules.WHITELIST).contains(par5EntityPlayer.getCommandSenderName())) {
return true;
}
} else if (te instanceof TileEntityInventoryScanner) {
if (module == EnumCustomModules.WHITELIST && ((CustomizableSCTE) te).hasModule(EnumCustomModules.WHITELIST) && HelpfulMethods.getPlayersFromModule(par1World, par2, par3, par4, EnumCustomModules.WHITELIST).contains(par5EntityPlayer.getCommandSenderName())) {
return true;
}
}
return false;
}
Aggregations