当前位置: 首页>>代码示例>>Java>>正文


Java Packet56MapChunks类代码示例

本文整理汇总了Java中net.minecraft.network.packet.Packet56MapChunks的典型用法代码示例。如果您正苦于以下问题:Java Packet56MapChunks类的具体用法?Java Packet56MapChunks怎么用?Java Packet56MapChunks使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Packet56MapChunks类属于net.minecraft.network.packet包,在下文中一共展示了Packet56MapChunks类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: func_72453_a

import net.minecraft.network.packet.Packet56MapChunks; //导入依赖的package包/类
public void func_72453_a(Packet56MapChunks p_72453_1_) {
   for(int var2 = 0; var2 < p_72453_1_.func_73581_d(); ++var2) {
      int var3 = p_72453_1_.func_73582_a(var2);
      int var4 = p_72453_1_.func_73580_b(var2);
      this.field_72564_i.func_73025_a(var3, var4, true);
      this.field_72564_i.func_73031_a(var3 << 4, 0, var4 << 4, (var3 << 4) + 15, 256, (var4 << 4) + 15);
      Chunk var5 = this.field_72564_i.func_72964_e(var3, var4);
      if(var5 == null) {
         this.field_72564_i.func_73025_a(var3, var4, true);
         var5 = this.field_72564_i.func_72964_e(var3, var4);
      }

      if(var5 != null) {
         var5.func_76607_a(p_72453_1_.func_73583_c(var2), p_72453_1_.field_73590_a[var2], p_72453_1_.field_73588_b[var2], true);
         this.field_72564_i.func_72909_d(var3 << 4, 0, var4 << 4, (var3 << 4) + 15, 256, (var4 << 4) + 15);
         if(!(this.field_72564_i.field_73011_w instanceof WorldProviderSurface)) {
            var5.func_76613_n();
         }
      }
   }

}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:23,代码来源:NetClientHandler.java

示例2: handleMapChunks

import net.minecraft.network.packet.Packet56MapChunks; //导入依赖的package包/类
@Override
public void handleMapChunks(Packet56MapChunks par1Packet56MapChunks)
{
	if (wc == null)
	{
		wc = (WorldClient)Reflexion.stealField(NetClientHandler.class, WorldClient.class).get(nch);
	}
	
	//nch.handleMapChunks(par1Packet56MapChunks);
	for (int i = 0; i < par1Packet56MapChunks.getNumberOfChunkInPacket(); ++i)
	{
		int j = par1Packet56MapChunks.getChunkPosX(i);
		int k = par1Packet56MapChunks.getChunkPosZ(i);
		doPreChunk(j, k, true);
		wc.invalidateBlockReceiveRegion(j << 4, 0, k << 4, (j << 4) + 15, 256, (k << 4) + 15);
		Chunk chunk = wc.getChunkFromChunkCoords(j, k);

		if (chunk == null)
		{
			doPreChunk(j, k, true);
			chunk = wc.getChunkFromChunkCoords(j, k);
		}

		if (chunk != null)
		{
			chunk.fillChunk(par1Packet56MapChunks.getChunkCompressedData(i), par1Packet56MapChunks.field_73590_a[i], par1Packet56MapChunks.field_73588_b[i], true);
			wc.markBlockRangeForRenderUpdate(j << 4, 0, k << 4, (j << 4) + 15, 256, (k << 4) + 15);

			if (!(wc.provider instanceof WorldProviderSurface))
			{
					chunk.resetRelightChecks();
			}
		}
	}
}
 
开发者ID:xurei,项目名称:forge_world_downloader,代码行数:36,代码来源:WDLNetClientHandler.java

示例3: handleMapChunks

import net.minecraft.network.packet.Packet56MapChunks; //导入依赖的package包/类
public void handleMapChunks(Packet56MapChunks par1Packet56MapChunks)
{
    for (int i = 0; i < par1Packet56MapChunks.getNumberOfChunkInPacket(); ++i)
    {
        int j = par1Packet56MapChunks.getChunkPosX(i);
        int k = par1Packet56MapChunks.getChunkPosZ(i);
        this.worldClient.doPreChunk(j, k, true);
        this.worldClient.invalidateBlockReceiveRegion(j << 4, 0, k << 4, (j << 4) + 15, 256, (k << 4) + 15);
        Chunk chunk = this.worldClient.getChunkFromChunkCoords(j, k);

        if (chunk == null)
        {
            this.worldClient.doPreChunk(j, k, true);
            chunk = this.worldClient.getChunkFromChunkCoords(j, k);
        }

        if (chunk != null)
        {
            chunk.fillChunk(par1Packet56MapChunks.getChunkCompressedData(i), par1Packet56MapChunks.field_73590_a[i], par1Packet56MapChunks.field_73588_b[i], true);
            this.worldClient.markBlockRangeForRenderUpdate(j << 4, 0, k << 4, (j << 4) + 15, 256, (k << 4) + 15);

            if (!(this.worldClient.provider instanceof WorldProviderSurface))
            {
                chunk.resetRelightChecks();
            }
        }
    }
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:29,代码来源:NetClientHandler.java

示例4: func_70071_h_

import net.minecraft.network.packet.Packet56MapChunks; //导入依赖的package包/类
public void func_70071_h_() {
   this.field_71134_c.func_73075_a();
   --this.field_71145_cl;
   this.field_71070_bA.func_75142_b();
   if(!this.field_70170_p.field_72995_K && !this.field_71070_bA.func_75145_c(this)) {
      this.func_71053_j();
      this.field_71070_bA = this.field_71069_bz;
   }

   while(!this.field_71130_g.isEmpty()) {
      int var1 = Math.min(this.field_71130_g.size(), 127);
      int[] var2 = new int[var1];
      Iterator var3 = this.field_71130_g.iterator();
      int var4 = 0;

      while(var3.hasNext() && var4 < var1) {
         var2[var4++] = ((Integer)var3.next()).intValue();
         var3.remove();
      }

      this.field_71135_a.func_72567_b(new Packet29DestroyEntity(var2));
   }

   if(!this.field_71129_f.isEmpty()) {
      ArrayList var6 = new ArrayList();
      Iterator var7 = this.field_71129_f.iterator();
      ArrayList var8 = new ArrayList();

      while(var7.hasNext() && var6.size() < 5) {
         ChunkCoordIntPair var9 = (ChunkCoordIntPair)var7.next();
         var7.remove();
         if(var9 != null && this.field_70170_p.func_72899_e(var9.field_77276_a << 4, 0, var9.field_77275_b << 4)) {
            var6.add(this.field_70170_p.func_72964_e(var9.field_77276_a, var9.field_77275_b));
            var8.addAll(((WorldServer)this.field_70170_p).func_73049_a(var9.field_77276_a * 16, 0, var9.field_77275_b * 16, var9.field_77276_a * 16 + 16, 256, var9.field_77275_b * 16 + 16));
         }
      }

      if(!var6.isEmpty()) {
         this.field_71135_a.func_72567_b(new Packet56MapChunks(var6));
         Iterator var11 = var8.iterator();

         while(var11.hasNext()) {
            TileEntity var5 = (TileEntity)var11.next();
            this.func_71119_a(var5);
         }

         var11 = var6.iterator();

         while(var11.hasNext()) {
            Chunk var10 = (Chunk)var11.next();
            this.func_71121_q().func_73039_n().func_85172_a(this, var10);
         }
      }
   }

   if(this.field_143005_bX > 0L && this.field_71133_b.func_143007_ar() > 0 && MinecraftServer.func_130071_aq() - this.field_143005_bX > (long)(this.field_71133_b.func_143007_ar() * 1000 * 60)) {
      this.field_71135_a.func_72565_c("You have been idle for too long!");
   }

}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:61,代码来源:EntityPlayerMP.java

示例5: func_72453_a

import net.minecraft.network.packet.Packet56MapChunks; //导入依赖的package包/类
public void func_72453_a(Packet56MapChunks p_72453_1_) {
   this.func_72509_a(p_72453_1_);
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:4,代码来源:NetHandler.java

示例6: onUpdate

import net.minecraft.network.packet.Packet56MapChunks; //导入依赖的package包/类
/**
 * Called to update the entity's position/logic.
 */
public void onUpdate()
{
    this.theItemInWorldManager.updateBlockRemoving();
    --this.initialInvulnerability;
    this.openContainer.detectAndSendChanges();

    if (!this.worldObj.isRemote && !ForgeHooks.canInteractWith(this, this.openContainer))
    {
        this.closeScreen();
        this.openContainer = this.inventoryContainer;
    }

    while (!this.destroyedItemsNetCache.isEmpty())
    {
        int i = Math.min(this.destroyedItemsNetCache.size(), 127);
        int[] aint = new int[i];
        Iterator iterator = this.destroyedItemsNetCache.iterator();
        int j = 0;

        while (iterator.hasNext() && j < i)
        {
            aint[j++] = ((Integer)iterator.next()).intValue();
            iterator.remove();
        }

        this.playerNetServerHandler.sendPacketToPlayer(new Packet29DestroyEntity(aint));
    }

    if (!this.loadedChunks.isEmpty())
    {
        ArrayList arraylist = new ArrayList();
        Iterator iterator1 = this.loadedChunks.iterator();
        ArrayList arraylist1 = new ArrayList();

        while (iterator1.hasNext() && arraylist.size() < 5)
        {
            ChunkCoordIntPair chunkcoordintpair = (ChunkCoordIntPair)iterator1.next();
            iterator1.remove();

            if (chunkcoordintpair != null && this.worldObj.blockExists(chunkcoordintpair.chunkXPos << 4, 0, chunkcoordintpair.chunkZPos << 4))
            {
                arraylist.add(this.worldObj.getChunkFromChunkCoords(chunkcoordintpair.chunkXPos, chunkcoordintpair.chunkZPos));
                //BugFix: 16 makes it load an extra chunk, which isn't associated with a player, which makes it not unload unless a player walks near it.
                //ToDo: Find a way to efficiently clean abandoned chunks.
                //arraylist1.addAll(((WorldServer)this.worldObj).getAllTileEntityInBox(chunkcoordintpair.chunkXPos * 16, 0, chunkcoordintpair.chunkZPos * 16, chunkcoordintpair.chunkXPos * 16 + 16, 256, chunkcoordintpair.chunkZPos * 16 + 16));
                arraylist1.addAll(((WorldServer)this.worldObj).getAllTileEntityInBox(chunkcoordintpair.chunkXPos * 16, 0, chunkcoordintpair.chunkZPos * 16, chunkcoordintpair.chunkXPos * 16 + 15, 256, chunkcoordintpair.chunkZPos * 16 + 15));
            }
        }

        if (!arraylist.isEmpty())
        {
            this.playerNetServerHandler.sendPacketToPlayer(new Packet56MapChunks(arraylist));
            Iterator iterator2 = arraylist1.iterator();

            while (iterator2.hasNext())
            {
                TileEntity tileentity = (TileEntity)iterator2.next();
                this.sendTileEntityToPlayer(tileentity);
            }

            iterator2 = arraylist.iterator();

            while (iterator2.hasNext())
            {
                Chunk chunk = (Chunk)iterator2.next();
                this.getServerForPlayer().getEntityTracker().func_85172_a(this, chunk);
                MinecraftForge.EVENT_BUS.post(new ChunkWatchEvent.Watch(chunk.getChunkCoordIntPair(), this));
            }
        }
    }

    if (this.field_143005_bX > 0L && this.mcServer.func_143007_ar() > 0 && MinecraftServer.getSystemTimeMillis() - this.field_143005_bX > (long)(this.mcServer.func_143007_ar() * 1000 * 60))
    {
        this.playerNetServerHandler.kickPlayerFromServer("You have been idle for too long!");
    }
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:80,代码来源:EntityPlayerMP.java


注:本文中的net.minecraft.network.packet.Packet56MapChunks类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。