Ejemplo n.º 1
0
 private static void sendPacket(Packet230ModLoader packet230modloader) {
   if (packet230Received
       && ModLoader.getMinecraftInstance().field_71441_e != null
       && ModLoader.getMinecraftInstance().field_71441_e.field_72995_K) {
     ModLoader.getMinecraftInstance().func_71391_r().func_72552_c(packet230modloader);
   }
 }
Ejemplo n.º 2
0
  public static void handleAllPackets(Packet230ModLoader packet230modloader) {
    if (!hasInit) {
      initializePrivate();
    }
    packet230Received = true;
    if (packet230modloader.modId == "ModLoaderMP".hashCode()) {
      switch (packet230modloader.packetType) {
        case 0: // '\0'
          handleModCheck(packet230modloader);
          break;

        case 1: // '\001'
          handleTileEntityPacket(packet230modloader);
          break;
      }
    } else if (packet230modloader.modId == "Spawn".hashCode()) {
      NetClientHandlerEntity netclienthandlerentity =
          handleNetClientHandlerEntities(packet230modloader.packetType);
      if (netclienthandlerentity != null
          && (net.minecraft.src.ISpawnable.class)
              .isAssignableFrom(netclienthandlerentity.entityClass)) {
        try {
          Entity entity =
              (Entity)
                  netclienthandlerentity
                      .entityClass
                      .getConstructor(new Class[] {net.minecraft.src.World.class})
                      .newInstance(new Object[] {ModLoader.getMinecraftInstance().field_71441_e});
          ((ISpawnable) entity).spawn(packet230modloader);
          ModLoader.getMinecraftInstance().field_71441_e.func_73027_a(entity.field_70157_k, entity);
        } catch (Exception exception) {
          ModLoader.getLogger().throwing("ModLoader", "handleCustomSpawn", exception);
          ModLoader.throwException(
              String.format(
                  "Error initializing entity of type %s.",
                  new Object[] {Integer.valueOf(packet230modloader.packetType)}),
              exception);
          return;
        }
      }
    } else {
      for (int i = 0; i < ModLoader.getLoadedMods().size(); i++) {
        BaseMod basemod = (BaseMod) ModLoader.getLoadedMods().get(i);
        if (!(basemod instanceof BaseModMp)) {
          continue;
        }
        BaseModMp basemodmp = (BaseModMp) basemod;
        if (basemodmp.getId() != packet230modloader.modId) {
          continue;
        }
        basemodmp.handlePacket(packet230modloader);
        break;
      }
    }
  }
Ejemplo n.º 3
0
 public static void handleGUI(Packet100OpenWindow packet100openwindow) {
   if (!hasInit) {
     initializePrivate();
   }
   BaseModMp basemodmp =
       (BaseModMp) guiModMap.get(Integer.valueOf(packet100openwindow.field_73429_b));
   GuiScreen guiscreen = basemodmp.handleGUI(packet100openwindow.field_73429_b);
   if (guiscreen != null) {
     ModLoader.openGUI(ModLoader.getMinecraftInstance().field_71439_g, guiscreen);
     ModLoader.getMinecraftInstance().field_71439_g.field_71070_bA.field_75152_c =
         packet100openwindow.field_73431_a;
   }
 }