本文整理匯總了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();
}
}
示例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;
}
}
示例3: readNBT
import net.minecraft.nbt.NBTTagCompound; //導入方法依賴的package包/類
@Override
public void readNBT(NBTTagCompound compound) {
if(compound.hasUniqueId("key")) {
setKey(compound.getUniqueId("key"));
}
}
示例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();
}
示例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();
}
}