示例#1
0
 public void onWorldEnter() {
   if (player == null) {
     player = ClientPlayer.getInstance();
     player.setPlayer(getHandle().thePlayer);
     getHandle().thePlayer.spoutEntity = player;
   }
   if (player.getHandle() instanceof EntityClientPlayerMP && isSpoutEnabled()) {
     clipboardThread = new ClipboardThread((EntityClientPlayerMP) player.getHandle());
     clipboardThread.start();
   } else if (clipboardThread != null) {
     clipboardThread.interrupt();
     clipboardThread = null;
   }
   SpoutcraftChunk.loadedChunks.clear();
   PacketDecompressionThread.startThread();
   MipMapUtils.initializeMipMaps();
   player
       .getMainScreen()
       .toggleSurvivalHUD(!Minecraft.theMinecraft.playerController.isInCreativeMode());
   inWorldTicks = 0L;
   MinimapConfig.getInstance().getServerWaypoints().clear();
 }
示例#2
0
 public void onTick() {
   tick++;
   Configuration.onTick();
   getHandle().mcProfiler.startSection("httpdownloads");
   FileDownloadThread.getInstance().onTick();
   getHandle().mcProfiler.endStartSection("packet_decompression");
   PacketDecompressionThread.onTick();
   getHandle().mcProfiler.endStartSection("widgets");
   enableSandbox();
   player.getMainScreen().onTick();
   disableSandbox();
   getHandle().mcProfiler.endStartSection("mipmapping");
   MipMapUtils.onTick();
   getHandle().mcProfiler.endStartSection("special_effects");
   if (Minecraft.theMinecraft.theWorld != null) {
     Minecraft.theMinecraft.theWorld.doColorfulStuff();
     inWorldTicks++;
   }
   getHandle().mcProfiler.endStartSection("entity_info");
   if (isSpoutEnabled()) {
     LinkedList<org.spoutcraft.api.entity.Entity> processed =
         new LinkedList<org.spoutcraft.api.entity.Entity>();
     Iterator<Entity> i = Entity.toProcess.iterator();
     while (i.hasNext()) {
       Entity next = i.next();
       if (next.spoutEntity != null) {
         processed.add(next.spoutEntity);
       }
     }
     Entity.toProcess.clear();
     if (processed.size() > 0) {
       getPacketManager().sendSpoutPacket(new PacketEntityInformation(processed));
     }
   }
   getHandle().mcProfiler.endSection();
 }