本文整理汇总了Java中cn.nukkit.nbt.tag.IntTag类的典型用法代码示例。如果您正苦于以下问题:Java IntTag类的具体用法?Java IntTag怎么用?Java IntTag使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IntTag类属于cn.nukkit.nbt.tag包,在下文中一共展示了IntTag类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: BlockEntityPistonArm
import cn.nukkit.nbt.tag.IntTag; //导入依赖的package包/类
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"));
}
}
示例2: BlockEntityPistonArm
import cn.nukkit.nbt.tag.IntTag; //导入依赖的package包/类
public BlockEntityPistonArm(FullChunk chunk, CompoundTag nbt) {
super(chunk, nbt);
if (nbt.contains("Progress")) {
this.progress = nbt.getFloat("Progress");
}
if (nbt.contains("LastProgress")) {
this.lastProgress = nbt.getInt("LastProgress");
}
if (nbt.contains("Sticky")) {
this.sticky = nbt.getBoolean("Sticky");
}
if (nbt.contains("Extending")) {
this.extending = nbt.getBoolean("Extending");
}
if (nbt.contains("AttachedBlocks")) {
ListTag<IntTag> blocks = nbt.getList("AttachedBlocks", IntTag.class);
if (blocks != null && blocks.size() > 0) {
this.attachedBlock = new Vector3(blocks.get(0).getData(), blocks.get(1).getData(), blocks.get(2).getData());
}
} else {
nbt.putList(new ListTag<IntTag>("AttachedBlocks"));
}
}