本文整理汇总了Java中net.minecraft.nbt.NBTTagCompound.setIntArray方法的典型用法代码示例。如果您正苦于以下问题:Java NBTTagCompound.setIntArray方法的具体用法?Java NBTTagCompound.setIntArray怎么用?Java NBTTagCompound.setIntArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.nbt.NBTTagCompound
的用法示例。
在下文中一共展示了NBTTagCompound.setIntArray方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getFireworkCharge
import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
private static ItemStack getFireworkCharge() {
ItemStack charge = new ItemStack(Items.FIREWORK_CHARGE);
NBTTagCompound nbttagcompound = new NBTTagCompound();
NBTTagCompound nbttagcompound1 = new NBTTagCompound();
ArrayList<Integer> arraylist = new ArrayList<>();
arraylist.add(ItemDye.DYE_COLORS[rand.nextInt(16)]);
if (rand.nextBoolean()) nbttagcompound1.setBoolean("Flicker", true);
if (rand.nextBoolean()) nbttagcompound1.setBoolean("Trail", true);
byte b0 = (byte) rand.nextInt(5);
int[] aint = new int[arraylist.size()];
for (int j2 = 0; j2 < aint.length; ++j2) {
aint[j2] = arraylist.get(j2);
}
nbttagcompound1.setIntArray("Colors", aint);
nbttagcompound1.setByte("Type", b0);
nbttagcompound.setTag("Explosion", nbttagcompound1);
charge.setTagCompound(nbttagcompound);
return charge;
}
示例2: 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;
}
示例3: writeToNBT
import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
public NBTTagCompound writeToNBT(NBTTagCompound nbt)
{
nbt.setInteger("x",this.tilePosition.x);
nbt.setInteger("z",this.tilePosition.z);
nbt.setInteger("type",this.biome.ordinal());
nbt.setBoolean("isOwned",this.isOwned);
nbt.setInteger("owners.size",this.owners.size());
for (int i=0; i<owners.size(); i++)
{
String ownerID = "owner_"+i;
nbt.setLong(ownerID+"_ID1",owners.get(i).getMostSignificantBits());
nbt.setLong(ownerID+"_ID1",owners.get(i).getLeastSignificantBits());
int[] ownersTimeInt = new int[ownersTime.get(i).size()];
for (int j=0; j<ownersTimeInt.length; j++)
{
ownersTimeInt[j] = ownersTime.get(i).get(j);
}
nbt.setIntArray(ownerID+"_time", ownersTimeInt);
}
return nbt;
}
示例4: writeEntityToNBT
import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
@Override
public void writeEntityToNBT(NBTTagCompound nbt) {
super.writeEntityToNBT(nbt);
nbt.setBoolean("Hidden", this.hidden);
if(hidden){
nbt.setIntArray("HiddenPos", new int[]{this.hiddenBlock.getX(),this.hiddenBlock.getY(),this.hiddenBlock.getZ()});
NBTTagList list=new NBTTagList();
nbt.setTag("Props", list);
for(BlockPos pos:this.usedPos)
list.appendTag(new NBTTagIntArray(new int[]{pos.getX(),pos.getY(),pos.getZ()}));
}
nbt.setShort("Begin", (short)this.begin);
nbt.setShort("Teleport", (short)this.teleportCooldown);
nbt.setShort("BombCooldown", (short)this.bombCooldown);
nbt.setShort("BombDuration", (short)this.bombDuration);
nbt.setShort("TopBlock", (short)this.topBlock);
nbt.setByte("HideCount", (byte)this.hideCount);
nbt.setBoolean("Bomb", this.isBombSpell());
}
示例5: saveDimensionDataMap
import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
public static NBTTagCompound saveDimensionDataMap()
{
int[] data = new int[(dimensionMap.length() + Integer.SIZE - 1 )/ Integer.SIZE];
NBTTagCompound dimMap = new NBTTagCompound();
for (int i = 0; i < data.length; i++)
{
int val = 0;
for (int j = 0; j < Integer.SIZE; j++)
{
val |= dimensionMap.get(i * Integer.SIZE + j) ? (1 << j) : 0;
}
data[i] = val;
}
dimMap.setIntArray("DimensionArray", data);
return dimMap;
}
示例6: writeToPacket
import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
@Override
public void writeToPacket(NBTTagCompound tag) {
super.writeToPacket(tag);
tag.setIntArray("floorHeights", floorHeights);
NBTTagList floorNameList = new NBTTagList();
for (int key : floorNames.keySet()) {
NBTTagCompound floorNameTag = new NBTTagCompound();
floorNameTag.setInteger("floorHeight", key);
floorNameTag.setString("floorName", floorNames.get(key));
floorNameList.appendTag(floorNameTag);
}
tag.setTag("floorNames", floorNameList);
}
示例7: save
import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
@Override
protected NBTTagCompound save() {
NBTTagCompound tag = new NBTTagCompound();
tag.setInteger("dimId", dimId);
tag.setIntArray("pos", new int[] { pos.getX(), pos.getY(), pos.getZ() });
return tag;
}
示例8: writeToNBT
import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
@Override
public NBTTagCompound writeToNBT(NBTTagCompound nbt){
super.writeToNBT(nbt);
if(linkedCurve != null){
nbt.setIntArray("linkedFlagCoords", new int[]{
linkedCurve.endPos.getX() + this.pos.getX(),
linkedCurve.endPos.getY() + this.pos.getY(),
linkedCurve.endPos.getZ() + this.pos.getZ()}
);
nbt.setFloat("linkedFlagAngle", linkedCurve.endAngle);
}
return nbt;
}
示例9: createChestStack
import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
@Override
public ItemStack createChestStack(ItemStack transporter)
{
ItemStack stack = super.createChestStack(transporter);
NBTTagCompound nbt = new NBTTagCompound();
nbt.setIntArray("size", new int[2]);
stack.setTagCompound(nbt);
return stack;
}
示例10: writeEntityToNBT
import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
@Override
public void writeEntityToNBT(NBTTagCompound tag) {
super.writeEntityToNBT(tag);
tag.setIntArray("AmmoC", ammoCount);
tag.setBoolean("UnlimitedAmmo", this.unlimitedAmmo);
tag.setByte("Team", (byte) this.getEntTeam());
tag.setBoolean("Natural", this.natural);
/*NBTTagList list = new NBTTagList();
for (int i = 0; i < this.loadout.getSlots(); i++) {
ItemStack itemstack = this.loadout.getStackInSlot(i);
if (!itemstack.isEmpty()) {
NBTTagCompound nbttagcompound = new NBTTagCompound();
nbttagcompound.setByte("Slot", (byte) i);
itemstack.writeToNBT(nbttagcompound);
list.appendTag(nbttagcompound);
}
}
tag.setTag("Loadout", list);*/
tag.setTag("Loadout", this.loadout.serializeNBT());
tag.setTag("LoadoutHeld", loadoutHeld.serializeNBT());
tag.setTag("Refill", this.refill.getStackInSlot(0).serializeNBT());
if (this.tradeOffers != null)
tag.setTag("Offers", this.tradeOffers.getRecipiesAsTags());
if(this.usedSlot == -1)
this.usedSlot = this.getDefaultSlot();
tag.setByte("Slot", (byte) this.usedSlot);
tag.setByte("PSlot", (byte) this.preferredSlot);
if(this.lastTrader!=null){
tag.setUniqueId("TraderFollow", this.lastTrader.getUniqueID());
tag.setInteger("TraderFollowTicks", this.traderFollowTicks);
}
if (this.getOwnerId() != null) {
tag.setUniqueId("Owner", this.getOwnerId());
tag.setString("OwnerName", this.ownerName);
}
}
示例11: serverStop
import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
@Mod.EventHandler
public void serverStop(FMLServerStoppingEvent event) {
//MapList.nameToData.clear();
//MapList.buildInAttributes.clear();
File output = new File(((AnvilSaveConverter) server.getActiveAnvilConverter()).savesDirectory, server.getFolderName() + "/teleports.dat");
NBTTagCompound tagRoot = new NBTTagCompound();
NBTTagCompound tag = new NBTTagCompound();
tagRoot.setTag("Teleporters", tag);
for (Entry<UUID, TeleporterData[]> entry : EntityTeleporter.teleporters.entrySet()) {
NBTTagCompound exitTag = new NBTTagCompound();
for (int i = 0; i < EntityTeleporter.TP_PER_PLAYER; i++) {
TeleporterData blockPos = entry.getValue()[i];
if (blockPos != null)
exitTag.setIntArray(Integer.toString(i), new int[] { blockPos.getX(), blockPos.getY(), blockPos.getZ(), blockPos.id, blockPos.dimension});
}
tag.setTag(entry.getKey().toString(), exitTag);
}
tagRoot.setInteger("TPCount", EntityTeleporter.tpCount);
try {
CompressedStreamTools.writeCompressed(tagRoot, new FileOutputStream(output));
} catch (IOException e) {
e.printStackTrace();
}
EntityTeleporter.teleporters.clear();
EntityTeleporter.tpCount = 0;
if(udpServer != null) {
udpServer.stopServer();
udpServer = null;
}
}
示例12: writeNBT
import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
public NBTTagCompound writeNBT() {
NBTTagCompound tag = new NBTTagCompound();
tag.setIntArray("inSlots", this.inSlots);
tag.setIntArray("outSlots", this.outSlots);
tag.setIntArray("miscSlots", this.miscSlots);
NBTTagList inv = new NBTTagList();
for (Integer slot : this.inventory.keySet()) {
SlotStackHolder holder = this.inventory.get(slot);
NBTTagCompound holderTag = new NBTTagCompound();
holderTag.setBoolean("holderEmpty", holder.itemStack.isEmpty());
holderTag.setInteger("holderId", slot);
if(!holder.itemStack.isEmpty()) {
holder.itemStack.writeToNBT(holderTag);
}
inv.appendTag(holderTag);
}
tag.setTag("inventoryArray", inv);
int[] sides = new int[accessibleSides.size()];
for (int i = 0; i < accessibleSides.size(); i++) {
EnumFacing side = accessibleSides.get(i);
sides[i] = side.ordinal();
}
tag.setIntArray("sides", sides);
return tag;
}
示例13: writeToNBT
import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
/**
* Writes this curve to the given {@link net.minecraft.nbt.NBTTagCompoundt nbt tag}.
*/
public void writeToNBT(NBTTagCompound nbt) {
nbt.setFloat("curveStartAngle", this.startAngle);
nbt.setFloat("curveEndAngle", this.endAngle);
nbt.setIntArray("curveEndPoint", new int[]{this.endPos.getX(), this.endPos.getY(), this.endPos.getZ()});
}