Package pneumaticCraft.common.tileentity

Examples of pneumaticCraft.common.tileentity.TileEntitySecurityStation


        return null;
    }

    @Override
    public boolean canHack(IBlockAccess world, int x, int y, int z, EntityPlayer player){
        TileEntitySecurityStation te = (TileEntitySecurityStation)world.getTileEntity(x, y, z);
        return !te.doesAllowPlayer(player);
    }
View Full Code Here


    public static int getProtectingSecurityStations(World world, int x, int y, int z, EntityPlayer player, boolean showRangeLines){
        int blockingStations = 0;
        for(TileEntity te : (List<TileEntity>)world.loadedTileEntityList) {
            if(te instanceof TileEntitySecurityStation) {
                TileEntitySecurityStation station = (TileEntitySecurityStation)te;
                if(station.hasValidNetwork()) {
                    if(Math.abs(station.xCoord - x) <= station.getSecurityRange() && Math.abs(station.yCoord - y) <= station.getSecurityRange() && Math.abs(station.zCoord - z) <= station.getSecurityRange()) {
                        if(!station.doesAllowPlayer(player)) {
                            blockingStations++;
                            if(showRangeLines) station.showRangeLines();
                        }
                    }
                }
            }
        }
View Full Code Here

    @Override
    public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9){
        if(player.isSneaking()) return false;
        else {
            if(!world.isRemote) {
                TileEntitySecurityStation te = (TileEntitySecurityStation)world.getTileEntity(x, y, z);
                if(te != null) {
                    if(te.isPlayerOnWhiteList(player)) {
                        player.openGui(PneumaticCraft.instance, CommonProxy.GUI_ID_SECURITY_STATION_INVENTORY, world, x, y, z);
                    } else if(!te.hasValidNetwork()) {
                        player.addChatComponentMessage(new ChatComponentTranslation(EnumChatFormatting.GREEN + "This Security Station is out of order: Its network hasn't been properly configured."));
                    } else if(te.hasPlayerHacked(player)) {
                        player.addChatComponentMessage(new ChatComponentTranslation(EnumChatFormatting.GREEN + "You've already hacked this Security Station!"));
                    } else if(getPlayerHackLevel(player) < te.getSecurityLevel()) {
                        player.addChatComponentMessage(new ChatComponentTranslation(EnumChatFormatting.RED + "You can't access or hack this Security Station. To hack it you need at least a Pneumatic Helmet upgraded with " + te.getSecurityLevel() + " Security upgrade(s)."));
                    } else {
                        player.openGui(PneumaticCraft.instance, CommonProxy.GUI_ID_HACKING, world, x, y, z);
                    }
                }
            }
View Full Code Here

    @Override
    public int isProvidingWeakPower(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5){

        TileEntity te = par1IBlockAccess.getTileEntity(par2, par3, par4);
        if(te instanceof TileEntitySecurityStation) {
            TileEntitySecurityStation tess = (TileEntitySecurityStation)te;
            return tess.shouldEmitRedstone() ? 15 : 0;
        }

        return 0;
    }
View Full Code Here

TOP

Related Classes of pneumaticCraft.common.tileentity.TileEntitySecurityStation

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.