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


Java NBTTagCompound.hasUniqueId方法代码示例

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


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

示例1: readEntityFromNBT

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

	this.setEntTeam(tag.getByte("Team"));
	this.setLevel(tag.getByte("Level"));
	this.setProgress(tag.getByte("Progress"));
	this.dataManager.set(CONSTRUCTING, (int)tag.getShort("Construction"));
	this.wrenchBonusTime=tag.getByte("WrenchBonus");
	this.redeploy=tag.getBoolean("Redeploy");
	this.ticksNoOwner=tag.getByte("Ownerless");
	this.engMade=tag.getBoolean("EngMade");
	if (tag.getByte("Sapper") != 0)
		this.setSapped(this, ItemStack.EMPTY);
	
	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,代码行数:24,代码来源:EntityBuilding.java

示例2: readNBT

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
@Override
void readNBT(NBTTagCompound compound) {
	if(compound.hasUniqueId("key")) {
		UUID key = compound.getUniqueId("key");
		if(world != null) {
			remove();
			this.key = key;
			add();
		} else this.key = key;
	}
}
 
开发者ID:ArekkuusuJerii,项目名称:Solar,代码行数:12,代码来源:TileRelativeBase.java

示例3: readNBT

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
@Override
public void readNBT(NBTTagCompound compound) {
	if(compound.hasUniqueId("key")) {
		setKey(compound.getUniqueId("key"));
	}
}
 
开发者ID:ArekkuusuJerii,项目名称:Solar,代码行数:7,代码来源:TileQuantumBase.java

示例4: DragonFightManager

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
public DragonFightManager(WorldServer worldIn, NBTTagCompound compound)
{
    this.world = worldIn;

    if (compound.hasKey("DragonKilled", 99))
    {
        if (compound.hasUniqueId("DragonUUID"))
        {
            this.dragonUniqueId = compound.getUniqueId("DragonUUID");
        }

        this.dragonKilled = compound.getBoolean("DragonKilled");
        this.previouslyKilled = compound.getBoolean("PreviouslyKilled");

        if (compound.getBoolean("IsRespawning"))
        {
            this.respawnState = DragonSpawnManager.START;
        }

        if (compound.hasKey("ExitPortalLocation", 10))
        {
            this.exitPortalLocation = NBTUtil.getPosFromTag(compound.getCompoundTag("ExitPortalLocation"));
        }
    }
    else
    {
        this.dragonKilled = true;
        this.previouslyKilled = true;
    }

    if (compound.hasKey("Gateways", 9))
    {
        NBTTagList nbttaglist = compound.getTagList("Gateways", 3);

        for (int i = 0; i < nbttaglist.tagCount(); ++i)
        {
            this.gateways.add(Integer.valueOf(nbttaglist.getIntAt(i)));
        }
    }
    else
    {
        this.gateways.addAll(ContiguousSet.<Integer>create(Range.<Integer>closedOpen(Integer.valueOf(0), Integer.valueOf(20)), DiscreteDomain.integers()));
        Collections.shuffle(this.gateways, new Random(worldIn.getSeed()));
    }

    this.portalPattern = FactoryBlockPattern.start().aisle(new String[] {"       ", "       ", "       ", "   #   ", "       ", "       ", "       "}).aisle(new String[] {"       ", "       ", "       ", "   #   ", "       ", "       ", "       "}).aisle(new String[] {"       ", "       ", "       ", "   #   ", "       ", "       ", "       "}).aisle(new String[] {"  ###  ", " #   # ", "#     #", "#  #  #", "#     #", " #   # ", "  ###  "}).aisle(new String[] {"       ", "  ###  ", " ##### ", " ##### ", " ##### ", "  ###  ", "       "}).where('#', BlockWorldState.hasState(BlockMatcher.forBlock(Blocks.BEDROCK))).build();
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:48,代码来源:DragonFightManager.java

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