• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java NibbleArray类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: getCombinedId4Data

import net.minecraft.world.chunk.NibbleArray; //导入依赖的package包/类
@Override
public int getCombinedId4Data(ExtendedBlockStorage ls, int x, int y, int z) {
    byte[] ids = ls.getBlockLSBArray();
    NibbleArray currentDataArray = ls.getMetadataArray();
    NibbleArray currentExtraArray = ls.getBlockMSBArray();
    int i = FaweCache.CACHE_J[y & 15][z & 15][x & 15];
    int id = (ids[i] & 0xFF);
    if (currentExtraArray != null) {
        id += (currentExtraArray.get(x & 15, y & 15, z & 15)) << 8;
    }
    if (currentDataArray != null && FaweCache.hasData(id)) {
        return (id << 4) + currentDataArray.get(x & 15, y & 15, z & 15);
    } else {
        return (id << 4);
    }
}
 
开发者ID:boy0001,项目名称:FastAsyncWorldedit,代码行数:17,代码来源:ForgeQueue_All.java


示例2: getBlockId

import net.minecraft.world.chunk.NibbleArray; //导入依赖的package包/类
public static int getBlockId(int x, int y, int z) {
	Chunk chunk = mc.theWorld.getChunkFromChunkCoords(x >> 4, z >> 4);
	chunk.getBlock(x & 0xF, y, z & 0xF);
	int blockId = 0;

	ExtendedBlockStorage[] sa = chunk.getBlockStorageArray();
	if (y >> 4 < sa.length) {
		ExtendedBlockStorage extendedblockstorage = sa[(y >> 4)];

		if (extendedblockstorage != null) {
			int lx = x & 0xF;
			int ly = y & 0xF;
			int lz = z & 0xF;
			blockId = extendedblockstorage.getBlockLSBArray()[(ly << 8
					| lz << 4 | lx)] & 0xFF;
			NibbleArray blockMSBArray = extendedblockstorage
					.getBlockMSBArray();

			if (blockMSBArray != null) {
				blockId |= blockMSBArray.get(lx, ly, lz) << 8;
			}
		}
	}

	return blockId;
}
 
开发者ID:h2r,项目名称:burlapcraft,代码行数:27,代码来源:HelperActions.java


示例3: ExtendedBlockStorage

import net.minecraft.world.chunk.NibbleArray; //导入依赖的package包/类
public ExtendedBlockStorage(int y, boolean flag, byte[] blkIds, byte[] extBlkIds)
{
    this.yBase = y;
    this.blockLSBArray = blkIds;

    if (extBlkIds != null)
    {
        this.blockMSBArray = new NibbleArray(extBlkIds, 4);
    }

    this.blockMetadataArray = new NibbleArray(this.blockLSBArray.length, 4);
    this.blocklightArray = new NibbleArray(this.blockLSBArray.length, 4);

    if (flag)
    {
        this.skylightArray = new NibbleArray(this.blockLSBArray.length, 4);
    }

    this.removeInvalidBlocks();
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:21,代码来源:ExtendedBlockStorage.java


示例4: setBlockMSBArray

import net.minecraft.world.chunk.NibbleArray; //导入依赖的package包/类
public void setBlockMSBArray(NibbleArray p_76673_1_)
{
    // CraftBukkit start - Don't hang on to an empty nibble array
    boolean empty = true;

    // Spigot start
    if ((!p_76673_1_.isTrivialArray()) || (p_76673_1_.getTrivialArrayValue() != 0))
    {
        empty = false;
    }

    // Spigot end

    if (empty)
    {
        return;
    }

    // CraftBukkit end
    this.blockMSBArray = this.validateNibbleArray(p_76673_1_); // CraftBukkit - Validate data
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:22,代码来源:ExtendedBlockStorage.java


示例5: ExtendedBlockStorage

import net.minecraft.world.chunk.NibbleArray; //导入依赖的package包/类
public ExtendedBlockStorage(int y, boolean storeSkylight)
{
    this.yBase = y;
    this.data = new char[4096];
    this.blocklightArray = new NibbleArray();

    if (storeSkylight)
    {
        this.skylightArray = new NibbleArray();
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:12,代码来源:ExtendedBlockStorage.java


示例6: ExtendedBlockStorage

import net.minecraft.world.chunk.NibbleArray; //导入依赖的package包/类
public ExtendedBlockStorage(int y, boolean storeSkylight)
{
    this.yBase = y;
    this.data = new BlockStateContainer();
    this.blocklightArray = new NibbleArray();

    if (storeSkylight)
    {
        this.skylightArray = new NibbleArray();
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:12,代码来源:ExtendedBlockStorage.java


示例7: removeSectionLighting

import net.minecraft.world.chunk.NibbleArray; //导入依赖的package包/类
@Override
public boolean removeSectionLighting(ExtendedBlockStorage section, int layer, boolean sky) {
    if (section != null) {
        section.setBlocklightArray(new NibbleArray());
        if (sky) {
            section.setSkylightArray(new NibbleArray());
        }
    }
    return section != null;
}
 
开发者ID:boy0001,项目名称:FastAsyncWorldedit,代码行数:11,代码来源:ForgeQueue_All.java


示例8: removeSectionLighting

import net.minecraft.world.chunk.NibbleArray; //导入依赖的package包/类
@Override
public boolean removeSectionLighting(ExtendedBlockStorage section, int layer, boolean sky) {
    if (section != null) {
        section.setBlockLight(new NibbleArray());
        if (sky) {
            section.setSkyLight(new NibbleArray());
        }
    }
    return section != null;
}
 
开发者ID:boy0001,项目名称:FastAsyncWorldedit,代码行数:11,代码来源:SpongeQueue_1_12.java


示例9: removeSectionLighting

import net.minecraft.world.chunk.NibbleArray; //导入依赖的package包/类
@Override
public boolean removeSectionLighting(ExtendedBlockStorage section, int layer, boolean sky) {
    if (section != null) {
        section.setBlocklightArray(new NibbleArray(4096, 4));
        if (sky) {
            section.setSkylightArray(new NibbleArray(4096, 4));
        }
    }
    return section != null;
}
 
开发者ID:boy0001,项目名称:FastAsyncWorldedit,代码行数:11,代码来源:ForgeQueue_All.java


示例10: readChunkFromNBT

import net.minecraft.world.chunk.NibbleArray; //导入依赖的package包/类
private Chunk readChunkFromNBT(final World world, final NBTTagCompound nbt) {
	final int i = nbt.getInteger("xPos");
	final int j = nbt.getInteger("zPos");
	final Chunk chunk = new Chunk(world, i, j);
	chunk.heightMap = nbt.getIntArray("HeightMap");
	chunk.isTerrainPopulated = nbt.getBoolean("TerrainPopulated");
	chunk.isLightPopulated = nbt.getBoolean("LightPopulated");
	chunk.inhabitedTime = nbt.getLong("InhabitedTime");
	final NBTTagList sections = nbt.getTagList("Sections", 10);
	final ExtendedBlockStorage[] ebs = new ExtendedBlockStorage[16];
	final boolean flag = !world.provider.hasNoSky;
	for (int k = 0; k < sections.tagCount(); k++) {
		final NBTTagCompound scratch = sections.getCompoundTagAt(k);
		final byte b1 = scratch.getByte("Y");
		final ExtendedBlockStorage tebs = new ExtendedBlockStorage(b1 << 4, flag);
		tebs.setBlockLSBArray(scratch.getByteArray("Blocks"));
		if (scratch.hasKey("Add", 7)) {
			tebs.setBlockMSBArray(new NibbleArray(scratch.getByteArray("Add"), 4));
		}
		tebs.setBlockMetadataArray(new NibbleArray(scratch.getByteArray("Data"), 4));
		tebs.setBlocklightArray(new NibbleArray(scratch.getByteArray("BlockLight"), 4));
		if (flag) {
			tebs.setSkylightArray(new NibbleArray(scratch.getByteArray("SkyLight"), 4));
		}
		tebs.removeInvalidBlocks();
		ebs[b1] = tebs;
	}
	chunk.setStorageArrays(ebs);
	if (nbt.hasKey("Biomes", 7)) {
		chunk.setBiomeArray(nbt.getByteArray("Biomes"));
	}
	return chunk;
}
 
开发者ID:OreCruncher,项目名称:Jiffy,代码行数:34,代码来源:AnvilChunkLoader.java


示例11: ExtendedBlockStorage

import net.minecraft.world.chunk.NibbleArray; //导入依赖的package包/类
public ExtendedBlockStorage(int par1, boolean par2)
{
    this.yBase = par1;
    this.blockLSBArray = new byte[4096];
    this.blockMetadataArray = new NibbleArray(this.blockLSBArray.length, 4);
    this.blocklightArray = new NibbleArray(this.blockLSBArray.length, 4);

    if (par2)
    {
        this.skylightArray = new NibbleArray(this.blockLSBArray.length, 4);
    }
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:13,代码来源:ExtendedBlockStorage.java


示例12: sendChunkColorData

import net.minecraft.world.chunk.NibbleArray; //导入依赖的package包/类
public static void sendChunkColorData(Chunk chunk, EntityPlayerMP player) {
    try {
        ChunkColorDataPacket packet = new ChunkColorDataPacket(methodGetValueArray);
        NibbleArray[] redColorArray = ChunkStorageRGB.getRedColorArrays(chunk);
        NibbleArray[] greenColorArray = ChunkStorageRGB.getGreenColorArrays(chunk);
        NibbleArray[] blueColorArray = ChunkStorageRGB.getBlueColorArrays(chunk);

        if (redColorArray == null || greenColorArray == null || blueColorArray == null) {
            return;
        }

        packet.chunkXPosition = chunk.xPosition;
        packet.chunkZPosition = chunk.zPosition;
        packet.arraySize = redColorArray.length;
        packet.yLocation = ChunkStorageRGB.getYLocationArray(chunk);
        packet.RedColorArray = redColorArray;
        packet.GreenColorArray = greenColorArray;
        packet.BlueColorArray = blueColorArray;

        //this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.PLAYER);
        //this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGETARGS).set(player);
        //this.channels.get(Side.SERVER).writeOutbound(packet);

        //Think this is right
        INSTANCE.sendTo(packet, player);

        //FMLLog.info("SendChunkColorData()  Sent for %s, %s", chunk.xPosition, chunk.zPosition);
    } catch (Exception e) {
        FMLLog.getLogger().warn("SendChunkColorData()  ", e);
    }

}
 
开发者ID:AnDwHaT5,项目名称:PixelUtilities,代码行数:33,代码来源:PacketHandler.java


示例13: checkedGetNibbleArray

import net.minecraft.world.chunk.NibbleArray; //导入依赖的package包/类
/**
 * Constructs a NibbleArray from a raw stream of byte data. If the
 * byte data is incomplete, returns an empty array.
 *
 * @param rawdata The raw bytestream to build an array from.
 * @return Instance of a NibbleArray.
 */
private static NibbleArray checkedGetNibbleArray(byte[] rawdata) {
    if (rawdata.length == 0) {
        return new NibbleArray(4096, 4);
    } else if (rawdata.length < 2048) {
        FMLLog.warning("checkedGetNibbleArray: rawdata is too short: %s, expected 2048", rawdata.length);
        return new NibbleArray(4096, 4);
    } else
        return new NibbleArray(rawdata, 4);
}
 
开发者ID:AnDwHaT5,项目名称:PixelUtilities,代码行数:17,代码来源:ChunkStorageRGB.java


示例14: validateNibbleArray

import net.minecraft.world.chunk.NibbleArray; //导入依赖的package包/类
private NibbleArray validateNibbleArray(NibbleArray nibbleArray)
{
    // Spigot start - fix for more awesome nibble arrays
    if (nibbleArray != null && nibbleArray.getByteLength() < 2048)
    {
        nibbleArray.resizeArray(2048);
    }

    // Spigot end
    return nibbleArray;
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:12,代码来源:ExtendedBlockStorage.java


示例15: ExtendedBlockStorage

import net.minecraft.world.chunk.NibbleArray; //导入依赖的package包/类
public ExtendedBlockStorage(int p_i1997_1_, boolean p_i1997_2_)
{
    this.yBase = p_i1997_1_;
    this.blockLSBArray = new byte[4096];
    this.blockMetadataArray = new NibbleArray(this.blockLSBArray.length, 4);
    this.blocklightArray = new NibbleArray(this.blockLSBArray.length, 4);

    if (p_i1997_2_)
    {
        this.skylightArray = new NibbleArray(this.blockLSBArray.length, 4);
    }
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:13,代码来源:ExtendedBlockStorage.java


示例16: ExtendedBlockStorage

import net.minecraft.world.chunk.NibbleArray; //导入依赖的package包/类
public ExtendedBlockStorage(int p_i1997_1_, boolean p_i1997_2_) {
   this.field_76684_a = p_i1997_1_;
   this.field_76680_d = new byte[4096];
   this.field_76678_f = new NibbleArray(this.field_76680_d.length, 4);
   this.field_76679_g = new NibbleArray(this.field_76680_d.length, 4);
   if(p_i1997_2_) {
      this.field_76685_h = new NibbleArray(this.field_76680_d.length, 4);
   }

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


示例17: func_76655_a

import net.minecraft.world.chunk.NibbleArray; //导入依赖的package包/类
public void func_76655_a(int p_76655_1_, int p_76655_2_, int p_76655_3_, int p_76655_4_) {
   int var5 = this.field_76680_d[p_76655_2_ << 8 | p_76655_3_ << 4 | p_76655_1_] & 255;
   if(this.field_76681_e != null) {
      var5 |= this.field_76681_e.func_76582_a(p_76655_1_, p_76655_2_, p_76655_3_) << 8;
   }

   if(var5 == 0 && p_76655_4_ != 0) {
      ++this.field_76682_b;
      if(Block.field_71973_m[p_76655_4_] != null && Block.field_71973_m[p_76655_4_].func_71881_r()) {
         ++this.field_76683_c;
      }
   } else if(var5 != 0 && p_76655_4_ == 0) {
      --this.field_76682_b;
      if(Block.field_71973_m[var5] != null && Block.field_71973_m[var5].func_71881_r()) {
         --this.field_76683_c;
      }
   } else if(Block.field_71973_m[var5] != null && Block.field_71973_m[var5].func_71881_r() && (Block.field_71973_m[p_76655_4_] == null || !Block.field_71973_m[p_76655_4_].func_71881_r())) {
      --this.field_76683_c;
   } else if((Block.field_71973_m[var5] == null || !Block.field_71973_m[var5].func_71881_r()) && Block.field_71973_m[p_76655_4_] != null && Block.field_71973_m[p_76655_4_].func_71881_r()) {
      ++this.field_76683_c;
   }

   this.field_76680_d[p_76655_2_ << 8 | p_76655_3_ << 4 | p_76655_1_] = (byte)(p_76655_4_ & 255);
   if(p_76655_4_ > 255) {
      if(this.field_76681_e == null) {
         this.field_76681_e = new NibbleArray(this.field_76680_d.length, 4);
      }

      this.field_76681_e.func_76581_a(p_76655_1_, p_76655_2_, p_76655_3_, (p_76655_4_ & 3840) >> 8);
   } else if(this.field_76681_e != null) {
      this.field_76681_e.func_76581_a(p_76655_1_, p_76655_2_, p_76655_3_, 0);
   }

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


示例18: createBlockMSBArray

import net.minecraft.world.chunk.NibbleArray; //导入依赖的package包/类
@SideOnly(Side.CLIENT)

    /**
     * Called by a Chunk to initialize the MSB array if getBlockMSBArray returns null. Returns the newly-created
     * NibbleArray instance.
     */
    public NibbleArray createBlockMSBArray()
    {
        this.blockMSBArray = new NibbleArray(this.blockLSBArray.length, 4);
        return this.blockMSBArray;
    }
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:12,代码来源:ExtendedBlockStorage.java


示例19: getBlocklightArray

import net.minecraft.world.chunk.NibbleArray; //导入依赖的package包/类
/**
 * Returns the NibbleArray instance containing Block-light data.
 */
public NibbleArray getBlocklightArray()
{
    return this.blocklightArray;
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:8,代码来源:ExtendedBlockStorage.java


示例20: getSkylightArray

import net.minecraft.world.chunk.NibbleArray; //导入依赖的package包/类
/**
 * Returns the NibbleArray instance containing Sky-light data.
 */
public NibbleArray getSkylightArray()
{
    return this.skylightArray;
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:8,代码来源:ExtendedBlockStorage.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java PlainTextByLineStream类代码示例发布时间:2022-05-21
下一篇:
Java Blob类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap