use of net.geforcemods.securitycraft.network.packets.PacketSSetPassword in project SecurityCraft by Geforce132.
the class GuiSetPassword method actionPerformed.
@Override
protected void actionPerformed(GuiButton guibutton) {
switch(guibutton.id) {
case 0:
if (keycodeTextbox.getText().isEmpty()) {
flag = true;
updateButtonText();
return;
}
((IPasswordProtected) tileEntity).setPassword(keycodeTextbox.getText());
SecurityCraft.network.sendToServer(new PacketSSetPassword(tileEntity.getPos().getX(), tileEntity.getPos().getY(), tileEntity.getPos().getZ(), keycodeTextbox.getText()));
ClientUtils.closePlayerScreen();
Minecraft.getMinecraft().thePlayer.openGui(SecurityCraft.instance, GuiHandler.INSERT_PASSWORD_ID, tileEntity.getWorld(), tileEntity.getPos().getX(), tileEntity.getPos().getY(), tileEntity.getPos().getZ());
}
}
use of net.geforcemods.securitycraft.network.packets.PacketSSetPassword in project SecurityCraft by Geforce132.
the class GuiKeyChanger method actionPerformed.
@Override
protected void actionPerformed(GuiButton guibutton) {
switch(guibutton.id) {
case 0:
((IPasswordProtected) tileEntity).setPassword(textboxNewPasscode.getText());
SecurityCraft.network.sendToServer(new PacketSSetPassword(tileEntity.getPos().getX(), tileEntity.getPos().getY(), tileEntity.getPos().getZ(), textboxNewPasscode.getText()));
ClientUtils.closePlayerScreen();
PlayerUtils.sendMessageToPlayer(Minecraft.getMinecraft().thePlayer, StatCollector.translateToLocal("item.universalKeyChanger.name"), StatCollector.translateToLocal("messages.universalKeyChanger.passcodeChanged"), EnumChatFormatting.GREEN);
}
}
Aggregations