Ejemplo n.º 1
0
  public static WorldServer getWorldServer() {
    if (minecraft == null) {
      return null;
    } else {
      WorldClient var0 = minecraft.theWorld;

      if (var0 == null) {
        return null;
      } else {
        WorldProvider var1 = var0.provider;

        if (var1 == null) {
          return null;
        } else {
          int var2 = var1.dimensionId;
          IntegratedServer var3 = minecraft.getIntegratedServer();

          if (var3 == null) {
            return null;
          } else {
            WorldServer var4 = var3.worldServerForDimension(var2);
            return var4;
          }
        }
      }
    }
  }
Ejemplo n.º 2
0
  public static void fixWorldTime(Minecraft var0) {
    WorldClient var1 = var0.theWorld;

    if (var1 != null) {
      IntegratedServer var2 = var0.getIntegratedServer();

      if (var2 != null) {
        WorldInfo var3 = var1.worldInfo;

        if (var3 != null) {
          if (var3.getGameType().getID() == 1) {
            WorldProvider var4 = var1.provider;

            if (var4 != null) {
              int var5 = var4.dimensionId;

              if (var5 == 0) {
                WorldServer var6 = var2.worldServerForDimension(var5);

                if (var6 != null) {
                  long var7 = var6.getWorldTime();
                  long var9 = var7 % 24000L;

                  if (isTimeDayOnly()) {
                    if (var9 <= 1000L) {
                      var6.setWorldTime(var7 - var9 + 1001L);
                    }

                    if (var9 >= 11000L) {
                      var6.setWorldTime(var7 - var9 + 24001L);
                    }
                  }

                  if (isTimeNightOnly()) {
                    if (var9 <= 14000L) {
                      var6.setWorldTime(var7 - var9 + 14001L);
                    }

                    if (var9 >= 22000L) {
                      var6.setWorldTime(var7 - var9 + 24000L + 14001L);
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
 protected static WorldSettings getWorldSettings(IntegratedServer server) {
   for (Field f : server.getClass().getDeclaredFields()) {
     if (WorldSettings.class.isAssignableFrom(f.getType())) {
       f.setAccessible(true);
       try {
         return (WorldSettings) f.get(server);
       } catch (IllegalAccessException e) {
         throw new RuntimeException("Could not get world settings!", e);
       }
     }
   }
   return null;
 }
 public IntegratedServerProxy(Minecraft minecraft, IntegratedServer server) {
   super(minecraft, server.getFolderName(), server.getWorldName(), getWorldSettings(server));
 }
 public IntegratedServerListenThread(IntegratedServer par1IntegratedServer) throws IOException {
   super(par1IntegratedServer);
   this.netMemoryConnection =
       new MemoryConnection(par1IntegratedServer.func_98033_al(), (NetHandler) null);
 }