本文整理匯總了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);
}
示例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);
}
示例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]));
}
}
}
示例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);
}
}
}
}
示例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);
}
示例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"));
}
}
示例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]));
}
示例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]);
}
}
示例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;
}
示例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;
}
}
示例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);
}
示例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);
}
示例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());
}
示例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();
}
}