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


Java NBTTagCompound.getIntArray方法代码示例

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


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

示例1: readStructureComponentsFromNBT

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
public void readStructureComponentsFromNBT(World worldIn, NBTTagCompound tagCompound)
{
    this.chunkPosX = tagCompound.getInteger("ChunkX");
    this.chunkPosZ = tagCompound.getInteger("ChunkZ");

    if (tagCompound.hasKey("BB"))
    {
        this.boundingBox = new StructureBoundingBox(tagCompound.getIntArray("BB"));
    }

    NBTTagList nbttaglist = tagCompound.getTagList("Children", 10);

    for (int i = 0; i < nbttaglist.tagCount(); ++i)
    {
        this.components.add(MapGenStructureIO.getStructureComponent(nbttaglist.getCompoundTagAt(i), worldIn));
    }

    this.readFromNBT(tagCompound);
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:20,代码来源:StructureStart.java

示例2: readFromNBT

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
public static Tile readFromNBT(NBTTagCompound nbt, World world)
{
	int x = nbt.getInteger("x");
	int z = nbt.getInteger("z");
	TileEnum.Biome tileType = TileEnum.Biome.values()[nbt.getInteger("type")];
	boolean isOwned = nbt.getBoolean("isOwned");
	int owners_size = nbt.getInteger("owners.size");
	
	ArrayList<UUID> owners = new ArrayList<UUID>();
	ArrayList<ArrayList<Integer>> ownersTime = new ArrayList<ArrayList<Integer>>();
	
	for(int i=0; i<owners_size; i++)
	{
		String ownerID = "owner_"+i;
		UUID owner = new UUID(nbt.getLong(ownerID+"_ID1"),nbt.getLong(ownerID+"_ID2"));
		owners.add(owner);
		
		ArrayList<Integer> ownerTime = new ArrayList<Integer>();
		for(int j : nbt.getIntArray(ownerID+"_time"))
		{
			ownerTime.add(j);
		}
		ownersTime.add(ownerTime);
	}
	return new Tile(world,x,z,tileType,isOwned,owners,ownersTime);
}
 
开发者ID:stuebz88,项目名称:modName,代码行数:27,代码来源:Tile.java

示例3: readEntityFromNBT

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
@Override
public void readEntityFromNBT(NBTTagCompound nbt) {
	super.readEntityFromNBT(nbt);
	this.begin=nbt.getShort("Begin");
	this.setBombSpell(nbt.getBoolean("Bomb"));
	this.bombCooldown=nbt.getShort("BombCooldown");
	this.bombDuration=nbt.getShort("BombDuration");
	this.topBlock=nbt.getShort("TopBlock");
	this.teleportCooldown=nbt.getShort("Teleport");
	this.hidden=nbt.getBoolean("Hidden");
	this.hideCount=nbt.getByte("HideCount");
	if(hidden){
		this.setNoAI(true);
		int[] pos=nbt.getIntArray("HiddenPos");
		this.hiddenBlock=new BlockPos(pos[0], pos[1], pos[2]);
		NBTTagList list=nbt.getTagList("Props", 11);
		for(int i=0;i<list.tagCount();i++){
			int[] arr=list.getIntArrayAt(i);
			this.usedPos.add(new BlockPos(arr[0],arr[1],arr[2]));
		}
	}
}
 
开发者ID:rafradek,项目名称:Mods,代码行数:23,代码来源:EntityMerasmus.java

示例4: loadDimensionDataMap

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
public static void loadDimensionDataMap(NBTTagCompound compoundTag)
{
    dimensionMap.clear();
    if (compoundTag == null)
    {
        for (Integer id : dimensions.keySet())
        {
            if (id >= 0)
            {
                dimensionMap.set(id);
            }
        }
    }
    else
    {
        int[] intArray = compoundTag.getIntArray("DimensionArray");
        for (int i = 0; i < intArray.length; i++)
        {
            for (int j = 0; j < Integer.SIZE; j++)
            {
                dimensionMap.set(i * Integer.SIZE + j, (intArray[i] & (1 << j)) != 0);
            }
        }
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:26,代码来源:DimensionManager.java

示例5: readStructureComponentsFromNBT

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
public void readStructureComponentsFromNBT(World worldIn, NBTTagCompound tagCompound)
{
    this.chunkPosX = tagCompound.getInteger("ChunkX");
    this.chunkPosZ = tagCompound.getInteger("ChunkZ");

    if (tagCompound.hasKey("BB"))
    {
        this.boundingBox = new StructureBoundingBox(tagCompound.getIntArray("BB"));
    }

    NBTTagList nbttaglist = tagCompound.getTagList("Children", 10);

    for (int i = 0; i < nbttaglist.tagCount(); ++i)
    {
        StructureComponent tmp = MapGenStructureIO.getStructureComponent(nbttaglist.getCompoundTagAt(i), worldIn);
        if (tmp != null) this.components.add(tmp); //Forge: Prevent NPEs further down the line when a componenet can't be loaded.
    }

    this.readFromNBT(tagCompound);
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:21,代码来源:StructureStart.java

示例6: readFromPacket

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
@Override
public void readFromPacket(NBTTagCompound tag) {
    super.readFromPacket(tag);
    floorHeights = tag.getIntArray("floorHeights");

    floorNames.clear();
    NBTTagList floorNameList = tag.getTagList("floorNames", 10);
    for (int i = 0; i < floorNameList.tagCount(); i++) {
        NBTTagCompound floorName = floorNameList.getCompoundTagAt(i);
        floorNames.put(floorName.getInteger("floorHeight"), floorName.getString("floorName"));
    }
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:13,代码来源:TileEntityElevatorBase.java

示例7: load

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
@Override
public Tile load(NBTTagCompound tag) {
    int dimId = tag.getInteger("dimId");
    int[] arr = tag.getIntArray("pos");
    if (arr.length == 0) return null;
    return new Tile(dimId, new BlockPos(arr[0], arr[1], arr[2]));
}
 
开发者ID:Herobone,项目名称:HeroUtils,代码行数:8,代码来源:Identifier.java

示例8: readFromNBT

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
public void readFromNBT(NBTTagCompound nbt) {
    int[] posarray = nbt.getIntArray("airpos");
    byte[] airarray = nbt.getByteArray("airval");
    cleanAir.clear();
    for (int i = 0 ; i < airarray.length ; i++) {
        int x = posarray[i*3+0];
        int y = posarray[i*3+1];
        int z = posarray[i*3+2];
        cleanAir.put(LongPos.toLong(x, y, z), airarray[i]);
    }
}
 
开发者ID:McJty,项目名称:needtobreath,代码行数:12,代码来源:DimensionData.java

示例9: readFromNBT

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
/**
 * Tries to read a new curve from the given {@link net.minecraft.nbt.NBTTagCompoundt nbt tag}.
 * 
 * @return The read {@openflextrack.api.OFTCurve curve}, or {@code null} if unsuccessful.
 */
public static OFTCurve readFromNBT(NBTTagCompound nbt) {

	if (nbt.hasKey("curveEndPoint")) {

		int[] endCoords = nbt.getIntArray("curveEndPoint");
		if (endCoords.length != 0) {
			return new OFTCurve(
					new BlockPos(endCoords[0], endCoords[1], endCoords[2]),
					nbt.getFloat("curveStartAngle"),
					nbt.getFloat("curveEndAngle"));
		}
	}
	return null;
}
 
开发者ID:DonBruce64,项目名称:OpenFlexiTrack,代码行数:20,代码来源:OFTCurve.java

示例10: readFromNBT

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

	super.readFromNBT(nbt);

	int[] linkedFlagCoords = nbt.getIntArray("linkedFlagCoords");
	if(linkedFlagCoords.length != 0){
		linkedCurve = new OFTCurve(
				new BlockPos(linkedFlagCoords[0], linkedFlagCoords[1], linkedFlagCoords[2]).subtract(this.pos),
				this.rotation*45,
				nbt.getFloat("linkedFlagAngle"));
	}else{
		linkedCurve = null;
	}
}
 
开发者ID:DonBruce64,项目名称:OpenFlexiTrack,代码行数:16,代码来源:TileEntitySurveyFlag.java

示例11: readStructureBaseNBT

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
/**
 * Reads and sets structure base data (boundingbox, {@link
 * net.minecraft.world.gen.structure.StructureComponent#coordBaseMode coordBase} and {@link
 * net.minecraft.world.gen.structure.StructureComponent#componentType componentType})
 */
public void readStructureBaseNBT(World worldIn, NBTTagCompound tagCompound)
{
    if (tagCompound.hasKey("BB"))
    {
        this.boundingBox = new StructureBoundingBox(tagCompound.getIntArray("BB"));
    }

    int i = tagCompound.getInteger("O");
    this.coordBaseMode = i == -1 ? null : EnumFacing.getHorizontal(i);
    this.componentType = tagCompound.getInteger("GD");
    this.readStructureFromNBT(tagCompound);
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:18,代码来源:StructureComponent.java

示例12: readStructureBaseNBT

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
/**
 * Reads and sets structure base data (boundingbox, {@link
 * net.minecraft.world.gen.structure.StructureComponent#coordBaseMode coordBase} and {@link
 * net.minecraft.world.gen.structure.StructureComponent#componentType componentType})
 */
public void readStructureBaseNBT(World worldIn, NBTTagCompound tagCompound)
{
    if (tagCompound.hasKey("BB"))
    {
        this.boundingBox = new StructureBoundingBox(tagCompound.getIntArray("BB"));
    }

    int i = tagCompound.getInteger("O");
    this.setCoordBaseMode(i == -1 ? null : EnumFacing.getHorizontal(i));
    this.componentType = tagCompound.getInteger("GD");
    this.readStructureFromNBT(tagCompound);
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:18,代码来源:StructureComponent.java

示例13: readStructureBaseNBT

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
/**
 * Reads and sets structure base data (boundingbox, {@link
 * net.minecraft.world.gen.structure.StructureComponent#coordBaseMode coordBase} and {@link
 * net.minecraft.world.gen.structure.StructureComponent#componentType componentType})
 */
public void readStructureBaseNBT(World worldIn, NBTTagCompound tagCompound)
{
    if (tagCompound.hasKey("BB"))
    {
        this.boundingBox = new StructureBoundingBox(tagCompound.getIntArray("BB"));
    }

    int i = tagCompound.getInteger("O");
    this.setCoordBaseMode(i == -1 ? null : EnumFacing.getHorizontal(i));
    this.componentType = tagCompound.getInteger("GD");
    this.readStructureFromNBT(tagCompound, worldIn.getSaveHandler().getStructureTemplateManager());
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:18,代码来源:StructureComponent.java

示例14: readEntityFromNBT

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

	if(tag.hasKey("AmmoC"))
		this.ammoCount = tag.getIntArray("AmmoC");
	if(this.ammoCount.length == 0)
		this.ammoCount = new int[3];
	this.unlimitedAmmo = tag.getBoolean("UnlimitedAmmo");
	this.setEntTeam(tag.getByte("Team"));
	this.natural = tag.getBoolean("Natural");

	if (tag.getTag("Loadout") instanceof NBTTagList) {
		NBTTagList list = (NBTTagList) tag.getTag("Loadout");

		if(list != null){
			for (int i = 0; i < list.tagCount(); ++i) {
				NBTTagCompound nbttagcompound = list.getCompoundTagAt(i);
				int j = nbttagcompound.getByte("Slot");
				this.loadout.setStackInSlot(j, new ItemStack(nbttagcompound));
			}
		}
	}
	else
		this.loadout.deserializeNBT(tag.getCompoundTag("Loadout"));
	this.loadoutHeld.deserializeNBT(tag.getCompoundTag("LoadoutHeld"));
	this.refill.setStackInSlot(0, new ItemStack(tag.getCompoundTag("Refill")));
	
	if (tag.hasKey("Offers")) {
		this.tradeOffers = new MerchantRecipeList();
		this.tradeOffers.readRecipiesFromTags(tag.getCompoundTag("Offers"));
	}
	this.preferredSlot = tag.getByte("PSlot");
	this.switchSlot(tag.getByte("Slot"), true);
	if(tag.hasKey("FollowTrader")){
		this.followID=tag.getUniqueId("FollowTrader");
		this.traderFollowTicks=tag.getInteger("FollowTraderTicks");
	}
	
	if(!this.world.getGameRules().getBoolean("doTF2AI")) {
		this.tasks.taskEntries.clear();
		this.targetTasks.taskEntries.clear();
	}
	
	if (tag.hasUniqueId("Owner")) {
		UUID ownerID = tag.getUniqueId("Owner");
		this.dataManager.set(OWNER_UUID, Optional.of(ownerID));
		this.ownerName = tag.getString("OwnerName");
		this.getOwner();
		this.enablePersistence();
	}
}
 
开发者ID:rafradek,项目名称:Mods,代码行数:53,代码来源:EntityTF2Character.java


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