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