use of pneumaticCraft.common.network.PacketSecurityStationAddHacker in project PneumaticCraft by MineMaarten.
the class NetworkConnectionPlayerHandler method onSlotHack.
@Override
protected void onSlotHack(int slot, boolean nuked) {
if (!nuked && gui instanceof GuiSecurityStationHacking) {
((GuiSecurityStationHacking) gui).onSlotHack(slot);
}
if (station.getStackInSlot(slot) != null && (station.getStackInSlot(slot).getItemDamage() == ItemNetworkComponents.NETWORK_REGISTRY || station.getStackInSlot(slot).getItemDamage() == ItemNetworkComponents.DIAGNOSTIC_SUBROUTINE)) {
hackedSuccessfully = true;
EntityPlayer player = FMLClientHandler.instance().getClient().thePlayer;
NetworkHandler.sendToServer(new PacketSecurityStationAddHacker(station, player.getCommandSenderName()));
FMLClientHandler.instance().getClient().thePlayer.closeScreen();
player.addChatComponentMessage(new ChatComponentTranslation(EnumChatFormatting.GREEN + "Hacking successful! This Security Station now doesn't protect the area any longer!"));
if (gui instanceof GuiSecurityStationHacking)
((GuiSecurityStationHacking) gui).removeUpdatesOnConnectionHandlers();
}
}
Aggregations