Search in sources :

Example 6 with SecuritySettings

use of logisticspipes.security.SecuritySettings in project LogisticsPipes by RS485.

the class LogisticsSecurityTileEntity method getSecuritySettingsForPlayer.

public SecuritySettings getSecuritySettingsForPlayer(EntityPlayer entityplayer, boolean usePower) {
    if (LogisticsSecurityTileEntity.byPassed.contains(entityplayer)) {
        return LogisticsSecurityTileEntity.allowAll;
    }
    if (usePower && !useEnergy(10)) {
        entityplayer.sendMessage(new TextComponentTranslation("lp.misc.noenergy"));
        return new SecuritySettings("No Energy");
    }
    SecuritySettings setting = settingsList.get(entityplayer.getDisplayNameString());
    // TODO Change to GameProfile based Authentication
    if (setting == null) {
        setting = new SecuritySettings(entityplayer.getDisplayNameString());
        settingsList.put(entityplayer.getDisplayNameString(), setting);
    }
    return setting;
}
Also used : TextComponentTranslation(net.minecraft.util.text.TextComponentTranslation) SecuritySettings(logisticspipes.security.SecuritySettings)

Example 7 with SecuritySettings

use of logisticspipes.security.SecuritySettings in project LogisticsPipes by RS485.

the class SecurityStationOpenPlayer method handleClientSide.

@SideOnly(Side.CLIENT)
private void handleClientSide(EntityPlayer player) {
    if (FMLClientHandler.instance().getClient().currentScreen instanceof GuiSecurityStation) {
        SecuritySettings setting = new SecuritySettings(null);
        setting.readFromNBT(getTag());
        ((GuiSecurityStation) FMLClientHandler.instance().getClient().currentScreen).handlePlayerSecurityOpen(setting);
    }
}
Also used : GuiSecurityStation(logisticspipes.gui.GuiSecurityStation) SecuritySettings(logisticspipes.security.SecuritySettings) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Aggregations

SecuritySettings (logisticspipes.security.SecuritySettings)7 NBTTagCompound (net.minecraft.nbt.NBTTagCompound)3 NBTTagList (net.minecraft.nbt.NBTTagList)2 UUID (java.util.UUID)1 LogisticsSecurityTileEntity (logisticspipes.blocks.LogisticsSecurityTileEntity)1 GuiSecurityStation (logisticspipes.gui.GuiSecurityStation)1 NBTBase (net.minecraft.nbt.NBTBase)1 NBTTagInt (net.minecraft.nbt.NBTTagInt)1 TextComponentTranslation (net.minecraft.util.text.TextComponentTranslation)1 SideOnly (net.minecraftforge.fml.relauncher.SideOnly)1