Java Code Examples for net.minecraft.nbt.NBTTagList#getDoubleAt()
The following examples show how to use
net.minecraft.nbt.NBTTagList#getDoubleAt() .
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: EntitySphere.java From YouTubeModdingTutorial with MIT License | 6 votes |
@Override public void readEntityFromNBT(NBTTagCompound compound) { if (compound.hasKey("power", 9)) { NBTTagList nbttaglist = compound.getTagList("power", 6); if (nbttaglist.tagCount() == 3) { this.accelerationX = nbttaglist.getDoubleAt(0); this.accelerationY = nbttaglist.getDoubleAt(1); this.accelerationZ = nbttaglist.getDoubleAt(2); } } this.ticksAlive = compound.getInteger("life"); if (compound.hasKey("direction", 9) && compound.getTagList("direction", 6).tagCount() == 3) { NBTTagList nbttaglist1 = compound.getTagList("direction", 6); this.motionX = nbttaglist1.getDoubleAt(0); this.motionY = nbttaglist1.getDoubleAt(1); this.motionZ = nbttaglist1.getDoubleAt(2); } else { this.setDead(); } }
Example 2
Source File: SettingListEntities.java From WearableBackpacks with MIT License | 5 votes |
private static RenderOptions deserializeRenderOptions(NBTTagCompound nbt) { NBTTagList translate = nbt.getTagList(TAG_TRANSLATE, NbtType.DOUBLE); return new RenderOptions( translate.getDoubleAt(0), translate.getDoubleAt(1), nbt.getDouble(TAG_ROTATE), nbt.getDouble(TAG_SCALE)); }