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


Java NBTTagCompound.setByteArray方法代码示例

本文整理汇总了Java中net.minecraft.nbt.NBTTagCompound.setByteArray方法的典型用法代码示例。如果您正苦于以下问题:Java NBTTagCompound.setByteArray方法的具体用法?Java NBTTagCompound.setByteArray怎么用?Java NBTTagCompound.setByteArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraft.nbt.NBTTagCompound的用法示例。


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

示例1: writeToNBT

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
@Override
public NBTTagCompound writeToNBT() {
  NBTTagCompound c = new NBTTagCompound();
  c.setByteArray(NBT_STACK, stack);
  c.setByteArray(NBT_REGISTERS, registers);
  c.setLong(NBT_FLAGS, packFlags());
  if (error != null) {
    c.setString(NBT_ERROR, error);
  }
  NBTTagList programTag = new NBTTagList();
  for (byte[] b : program) {
    programTag.appendTag(new NBTTagByteArray(b));
  }
  c.setTag(NBT_PROGRAM, programTag);

  NBTTagList labelTag = new NBTTagList();
  for (Label label : labels) {
    labelTag.appendTag(label.toNbt());
  }
  c.setTag(NBT_LABELS, labelTag);

  return c;
}
 
开发者ID:ToroCraft,项目名称:Minecoprocessors,代码行数:24,代码来源:Processor.java

示例2: getSchematic

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
/**
 * Write to schematic tags
 * @return Control tag
 */
private NBTTagCompound getSchematic() {
    NBTTagCompound tag = new NBTTagCompound();
    tag.setString("Materials", "Alpha");
    tag.setShort("Width", (short) getWidth());
    tag.setShort("Height", (short) getHeight());
    tag.setShort("Length", (short) getLength());
    tag.setByteArray("AddBlocks", new byte[0]);
    byte[] blocksID = new byte[getBlocks().length];
    for (int i = 0; i < getBlocks().length; ++i) {
        blocksID[i] = (byte) getBlock(i);
    }
    tag.setByteArray("Blocks", blocksID);
    tag.setByteArray("AddBlocks", getAddBlocks(getBlocks()));
    tag.setByteArray("Data", getMetas());
    NBTTagList tileEntities = new NBTTagList();
    for (NBTTagCompound tile : getTiles()) {
        if (tile != null) {
            tileEntities.appendTag(tile);
        }
    }
    tag.setTag("TileEntities", tileEntities);
    return tag;
}
 
开发者ID:ternsip,项目名称:StructPro,代码行数:28,代码来源:Blueprint.java

示例3: writeToNBT

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
public NBTTagCompound writeToNBT(NBTTagCompound compound) {
    int posarray[] = new int[cleanAir.size() * 3];
    byte airarray[] = new byte[cleanAir.size()];

    int idx = 0;
    for (Map.Entry<Long, Byte> entry : cleanAir.entrySet()) {
        BlockPos pos = BlockPos.fromLong(entry.getKey());
        airarray[idx] = entry.getValue();
        posarray[idx*3+0] = pos.getX();
        posarray[idx*3+1] = pos.getY();
        posarray[idx*3+2] = pos.getZ();
        idx++;
    }
    compound.setIntArray("airpos", posarray);
    compound.setByteArray("airval", airarray);

    return null;
}
 
开发者ID:McJty,项目名称:needtobreath,代码行数:19,代码来源:DimensionData.java

示例4: writeUpdateTag

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
public void writeUpdateTag(NBTTagCompound tag)
{

    //tag.setInteger("DustID",this.dustType.getID());
    tag.setByteArray("Symbols",getByteArrayFromList(dustList));

    NBTTagList list = new NBTTagList();
    for (int i = 0; i < this.getSizeInventory(); ++i) {
        if (this.getStackInSlot(i) != null) {
            NBTTagCompound stackTag = new NBTTagCompound();
            stackTag.setByte("Slot", (byte) i);
            this.getStackInSlot(i).writeToNBT(stackTag);
            list.appendTag(stackTag);
        }
    }
    tag.setTag("Items",list);
    if (this.hasCustomName()) {
        tag.setString("CustomName", this.getCustomName());
    }

}
 
开发者ID:Drazuam,项目名称:RunicArcana,代码行数:22,代码来源:TileEntityChalkBase.java

示例5: saveServerList

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
@Override
public void saveServerList()
{
    prepare();
    super.saveServerList();
    int numOfServers = countServers();
    byte[] serverBytes = new byte[numOfServers];

    for (int i = 0; i < numOfServers; i++)
    {
        boolean editStatus = i < servers.size() && servers.get(i);
        serverBytes[i] = editStatus ? (byte) 1 : (byte) 0;
    }

    try
    {
        NBTTagCompound nbttagcompound = new NBTTagCompound();
        nbttagcompound.setByteArray("servers", serverBytes);
        CompressedStreamTools.safeWrite(nbttagcompound, new File(this.mc.mcDataDir, "mtservers.dat"));
    }
    catch (Exception exception)
    {
        //logger.error("Couldn\'t save server list", exception);
    }
}
 
开发者ID:CreeperHost,项目名称:CreeperHostGui,代码行数:26,代码来源:ServerListNoEdit.java

示例6: saveData

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
/**
 * Save file to file
 * @throws IOException If data failed to save
 * */
private void saveData() throws IOException {
    NBTTagCompound tag = new NBTTagCompound();
    tag.setByteArray("Skin", Utils.toByteArray(getSkin()));
    tag.setByteArray("Melt", Utils.toByteArray(getMelt()));
    Utils.writeTags(getFileData(), tag);
}
 
开发者ID:ternsip,项目名称:StructPro,代码行数:11,代码来源:Structure.java

示例7: writeToNBT

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
@Override
public NBTTagCompound writeToNBT(NBTTagCompound compound) {
	compound.setBoolean("ignore_blocks", this.ignoreBlocks);
	compound.setInteger("location_id", isLocation() ? location.getId() : -1);
	compound.setTag("inner_stack", (this.stack == null ? ItemStack.EMPTY : this.stack).serializeNBT());
	compound.setByteArray("hit_result", HarshenUtils.serialize(hitResult));
	return super.writeToNBT(compound);
}
 
开发者ID:kenijey,项目名称:harshencastle,代码行数:9,代码来源:EntityThrown.java

示例8: writeToNBT

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
/**
 * write data to NBTTagCompound from this MapDataBase, similar to Entities and TileEntities
 */
public void writeToNBT(NBTTagCompound nbt)
{
    nbt.setByte("dimension", this.dimension);
    nbt.setInteger("xCenter", this.xCenter);
    nbt.setInteger("zCenter", this.zCenter);
    nbt.setByte("scale", this.scale);
    nbt.setShort("width", (short)128);
    nbt.setShort("height", (short)128);
    nbt.setByteArray("colors", this.colors);
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:14,代码来源:MapData.java

示例9: serializeMin

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
public NBTTagCompound serializeMin(NBTTagCompound compound)
{
    compound.setTag("items", handler.serializeNBT());
    if (getText() != null)
        compound.setString("text", getText());
    if (getHash() != null)
        compound.setByteArray("hash", getHash());
    compound.setBoolean("unlocked", isUnlocked());
    return compound;
}
 
开发者ID:PearXTeam,项目名称:PurificatiMagicae,代码行数:11,代码来源:TileCodeStorage.java

示例10: writeToNBT

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
public NBTTagCompound writeToNBT(NBTTagCompound compound)
{
    compound.setByte("dimension", this.dimension);
    compound.setInteger("xCenter", this.xCenter);
    compound.setInteger("zCenter", this.zCenter);
    compound.setByte("scale", this.scale);
    compound.setShort("width", (short)128);
    compound.setShort("height", (short)128);
    compound.setByteArray("colors", this.colors);
    compound.setBoolean("trackingPosition", this.trackingPosition);
    compound.setBoolean("unlimitedTracking", this.field_191096_f);
    return compound;
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:14,代码来源:MapData.java

示例11: serializeNBT

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
@Override
public NBTTagCompound serializeNBT() {
	NBTTagCompound tag = new NBTTagCompound();
	//tag.setBoolean("Uber", this.owner.getDataManager().get(TF2EventBusListener.ENTITY_UBER));
	NBTTagCompound bossInfo = new NBTTagCompound();
	for (Entry<Class<? extends Entity>, Short> entry : this.highestBossLevel.entrySet())
		bossInfo.setShort(EntityList.getKey(entry.getKey()).toString(), entry.getValue());
	tag.setTag("BossInfo", bossInfo);
	tag.setInteger("NextBossTick", this.nextBossTicks);
	tag.setFloat("DodgedDmg", this.dodgedDmg);
	NBTTagList list=new NBTTagList();
	tag.setTag("Contracts", list);
	for(Contract contract:this.contracts) {
		NBTTagCompound com=new NBTTagCompound();
		com.setBoolean("Active", contract.active);
		com.setShort("Progress", (short) contract.progress);
		com.setByte("Rewards", (byte) contract.rewards);
		byte[] objs=new byte[contract.objectives.length];
		for(int i=0;i<contract.objectives.length;i++) {
			objs[i]=(byte) contract.objectives[i].ordinal();
		}
		com.setByteArray("Objectives", objs);
		com.setString("Name", contract.className);
		list.appendTag(com);
	}
	tag.setInteger("NextContractDay", this.nextContractDay);
	return tag;
}
 
开发者ID:rafradek,项目名称:Mods,代码行数:29,代码来源:TF2PlayerCapability.java

示例12: writeToNBT

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
public NBTTagCompound writeToNBT(NBTTagCompound compound)
{
    compound.setInteger("dimension", this.dimension);
    compound.setInteger("xCenter", this.xCenter);
    compound.setInteger("zCenter", this.zCenter);
    compound.setByte("scale", this.scale);
    compound.setShort("width", (short)128);
    compound.setShort("height", (short)128);
    compound.setByteArray("colors", this.colors);
    compound.setBoolean("trackingPosition", this.trackingPosition);
    return compound;
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:13,代码来源:MapData.java


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