Пример #1
0
 @Override
 FMLNetworkEvent.CustomPacketEvent<?> make(FMLProxyPacket msg) {
   FMLNetworkEvent.CustomPacketEvent<?> event = null;
   if (msg.handler() instanceof NetHandlerPlayClient) {
     NetHandlerPlayClient client = (NetHandlerPlayClient) msg.handler();
     event = new FMLNetworkEvent.ClientCustomPacketEvent(client.getNetworkManager(), msg);
   } else if (msg.handler() instanceof NetHandlerPlayServer) {
     NetHandlerPlayServer server = (NetHandlerPlayServer) msg.handler();
     event = new FMLNetworkEvent.ServerCustomPacketEvent(server.getNetworkManager(), msg);
   }
   return event;
 }
Пример #2
0
  /** Called when the screen is unloaded. Used to disable keyboard repeat events */
  public void onGuiClosed() {
    Keyboard.enableRepeatEvents(false);
    NetHandlerPlayClient nethandlerplayclient = this.mc.getNetHandler();

    if (nethandlerplayclient != null) {
      nethandlerplayclient.addToSendQueue(
          new C12PacketUpdateSign(
              this.tileSign.xCoord,
              this.tileSign.yCoord,
              this.tileSign.zCoord,
              this.tileSign.signText));
    }

    this.tileSign.setEditable(true);
  }
Пример #3
0
  protected void renderPlayerList(int width, int height) {
    ScoreObjective scoreobjective = this.mc.theWorld.getScoreboard().getObjectiveInDisplaySlot(0);
    NetHandlerPlayClient handler = mc.thePlayer.sendQueue;

    if (mc.gameSettings.keyBindPlayerList.isKeyDown()
        && (!mc.isIntegratedServerRunning()
            || handler.getPlayerInfoMap().size() > 1
            || scoreobjective != null)) {
      this.overlayPlayerList.updatePlayerList(true);
      if (pre(PLAYER_LIST)) return;
      this.overlayPlayerList.renderPlayerlist(
          width, this.mc.theWorld.getScoreboard(), scoreobjective);
      post(PLAYER_LIST);
    } else {
      this.overlayPlayerList.updatePlayerList(false);
    }
  }
  @Override
  public boolean isPlayerOnline(String username) {
    NetHandlerPlayClient netclienthandler = Minecraft.getMinecraft().thePlayer.sendQueue;
    Collection collection = netclienthandler.getPlayerInfoMap();

    Iterator<NetworkPlayerInfo> iterator = collection.iterator();

    while (iterator.hasNext()) {
      NetworkPlayerInfo info = iterator.next();

      if (info.getGameProfile().getName().toLowerCase().equals(username.toLowerCase())) {
        return true;
      }
    }

    return false;
  }
Пример #5
0
 private void wakeFromSleep() {
   NetHandlerPlayClient var1 = this.mc.thePlayer.sendQueue;
   var1.addToSendQueue(
       new C0BPacketEntityAction(this.mc.thePlayer, C0BPacketEntityAction.Action.STOP_SLEEPING));
 }