Java Code Examples for cn.nukkit.nbt.tag.CompoundTag#getInt()
The following examples show how to use
cn.nukkit.nbt.tag.CompoundTag#getInt() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BlockEntityMovingBlock.java From Jupiter with GNU General Public License v3.0 | 6 votes |
public BlockEntityMovingBlock(FullChunk chunk, CompoundTag nbt) { super(chunk, nbt); if (nbt.contains("movingBlockData") && nbt.contains("movingBlockId")) { this.block = Block.get(nbt.getInt("movingBlockId"), nbt.getInt("movingBlockData")); } else { this.close(); } if (nbt.contains("pistonPosX") && nbt.contains("pistonPosY") && nbt.contains("pistonPosZ")) { this.piston = new BlockVector3(nbt.getInt("pistonPosX"), nbt.getInt("pistonPosY"), nbt.getInt("pistonPosZ")); } else { this.close(); } this.isMovable = nbt.getBoolean("isMovable"); }
Example 2
Source File: ItemArmor.java From Jupiter with GNU General Public License v3.0 | 5 votes |
public int getCustomColor(){ if(!this.hasCompoundTag()) return 0; CompoundTag tag = this.getNamedTag(); if(tag.contains("customColor")){ return tag.getInt("customColor"); } return 0; }
Example 3
Source File: ItemColorArmor.java From Jupiter with GNU General Public License v3.0 | 5 votes |
/** * Get color of Leather Item * * @return - BlockColor, or null if item has no color */ public BlockColor getColor() { if (!this.hasCompoundTag()) return null; CompoundTag tag = this.getNamedTag(); if (!tag.exist("customColor")) return null; int rgb = tag.getInt("customColor"); return new BlockColor(rgb); }
Example 4
Source File: BlockEntityPistonArm.java From Jupiter with GNU General Public License v3.0 | 5 votes |
public BlockEntityPistonArm(FullChunk chunk, CompoundTag nbt) { super(chunk, nbt); if (nbt.contains("Progress")) { this.progress = nbt.getFloat("Progress"); } if (nbt.contains("LastProgress")) { this.lastProgress = (float) nbt.getInt("LastProgress"); } if (nbt.contains("Sticky")) { this.sticky = nbt.getBoolean("Sticky"); } if (nbt.contains("Extending")) { this.extending = nbt.getBoolean("Extending"); } if (nbt.contains("powered")) { this.powered = nbt.getBoolean("powered"); } if (nbt.contains("AttachedBlocks")) { ListTag blocks = nbt.getList("AttachedBlocks", IntTag.class); if (blocks != null && blocks.size() > 0) { this.attachedBlock = new Vector3((double) ((IntTag) blocks.get(0)).getData().intValue(), (double) ((IntTag) blocks.get(1)).getData().intValue(), (double) ((IntTag) blocks.get(2)).getData().intValue()); } } else { nbt.putList(new ListTag("AttachedBlocks")); } }
Example 5
Source File: BlockEntityComparator.java From Jupiter with GNU General Public License v3.0 | 5 votes |
public BlockEntityComparator(FullChunk chunk, CompoundTag nbt) { super(chunk, nbt); if (!nbt.contains("OutputSignal")) { nbt.putInt("OutputSignal", 0); } this.outputSignal = nbt.getInt("OutputSignal"); }
Example 6
Source File: ItemColorArmor.java From Nukkit with GNU General Public License v3.0 | 5 votes |
/** * Get color of Leather Item * * @return - BlockColor, or null if item has no color */ public BlockColor getColor() { if (!this.hasCompoundTag()) return null; CompoundTag tag = this.getNamedTag(); if (!tag.exist("customColor")) return null; int rgb = tag.getInt("customColor"); return new BlockColor(rgb); }
Example 7
Source File: BlockEntityComparator.java From Nukkit with GNU General Public License v3.0 | 5 votes |
public BlockEntityComparator(FullChunk chunk, CompoundTag nbt) { super(chunk, nbt); if (!nbt.contains("OutputSignal")) { nbt.putInt("OutputSignal", 0); } this.outputSignal = nbt.getInt("OutputSignal"); }
Example 8
Source File: ItemColorArmor.java From Nukkit with GNU General Public License v3.0 | 5 votes |
/** * Get color of Leather Item * * @return - BlockColor, or null if item has no color */ public BlockColor getColor() { if (!this.hasCompoundTag()) return null; CompoundTag tag = this.getNamedTag(); if (!tag.exist("customColor")) return null; int rgb = tag.getInt("customColor"); return new BlockColor(rgb); }
Example 9
Source File: BlockEntityComparator.java From Nukkit with GNU General Public License v3.0 | 5 votes |
public BlockEntityComparator(FullChunk chunk, CompoundTag nbt) { super(chunk, nbt); if (!nbt.contains("OutputSignal")) { nbt.putInt("OutputSignal", 0); } this.outputSignal = nbt.getInt("OutputSignal"); }