/** * Saves the pose to an NBTTagCompound. */ private void writePoseToNBT(NBTTagCompound tagCompound) { NBTTagList nbttaglist = tagCompound.getTagList("Head", 5); this.setHeadRotation(nbttaglist.hasNoTags() ? DEFAULT_HEAD_ROTATION : new Rotations(nbttaglist)); NBTTagList nbttaglist1 = tagCompound.getTagList("Body", 5); this.setBodyRotation(nbttaglist1.hasNoTags() ? DEFAULT_BODY_ROTATION : new Rotations(nbttaglist1)); NBTTagList nbttaglist2 = tagCompound.getTagList("LeftArm", 5); this.setLeftArmRotation(nbttaglist2.hasNoTags() ? DEFAULT_LEFTARM_ROTATION : new Rotations(nbttaglist2)); NBTTagList nbttaglist3 = tagCompound.getTagList("RightArm", 5); this.setRightArmRotation(nbttaglist3.hasNoTags() ? DEFAULT_RIGHTARM_ROTATION : new Rotations(nbttaglist3)); NBTTagList nbttaglist4 = tagCompound.getTagList("LeftLeg", 5); this.setLeftLegRotation(nbttaglist4.hasNoTags() ? DEFAULT_LEFTLEG_ROTATION : new Rotations(nbttaglist4)); NBTTagList nbttaglist5 = tagCompound.getTagList("RightLeg", 5); this.setRightLegRotation(nbttaglist5.hasNoTags() ? DEFAULT_RIGHTLEG_ROTATION : new Rotations(nbttaglist5)); }
/** * Called to update the entity's position/logic. */ public void onUpdate() { super.onUpdate(); Rotations rotations = (Rotations)this.dataManager.get(HEAD_ROTATION); if (!this.headRotation.equals(rotations)) { this.setHeadRotation(rotations); } Rotations rotations1 = (Rotations)this.dataManager.get(BODY_ROTATION); if (!this.bodyRotation.equals(rotations1)) { this.setBodyRotation(rotations1); } Rotations rotations2 = (Rotations)this.dataManager.get(LEFT_ARM_ROTATION); if (!this.leftArmRotation.equals(rotations2)) { this.setLeftArmRotation(rotations2); } Rotations rotations3 = (Rotations)this.dataManager.get(RIGHT_ARM_ROTATION); if (!this.rightArmRotation.equals(rotations3)) { this.setRightArmRotation(rotations3); } Rotations rotations4 = (Rotations)this.dataManager.get(LEFT_LEG_ROTATION); if (!this.leftLegRotation.equals(rotations4)) { this.setLeftLegRotation(rotations4); } Rotations rotations5 = (Rotations)this.dataManager.get(RIGHT_LEG_ROTATION); if (!this.rightLegRotation.equals(rotations5)) { this.setRightLegRotation(rotations5); } boolean flag = this.hasMarker(); if (this.wasMarker != flag) { this.updateBoundingBox(flag); this.preventEntitySpawning = !flag; this.wasMarker = flag; } }
public void setHeadRotation(Rotations vec) { this.headRotation = vec; this.dataManager.set(HEAD_ROTATION, vec); }
public void setBodyRotation(Rotations vec) { this.bodyRotation = vec; this.dataManager.set(BODY_ROTATION, vec); }
public void setLeftArmRotation(Rotations vec) { this.leftArmRotation = vec; this.dataManager.set(LEFT_ARM_ROTATION, vec); }
public void setRightArmRotation(Rotations vec) { this.rightArmRotation = vec; this.dataManager.set(RIGHT_ARM_ROTATION, vec); }
public void setLeftLegRotation(Rotations vec) { this.leftLegRotation = vec; this.dataManager.set(LEFT_LEG_ROTATION, vec); }
public void setRightLegRotation(Rotations vec) { this.rightLegRotation = vec; this.dataManager.set(RIGHT_LEG_ROTATION, vec); }
public Rotations getHeadRotation() { return this.headRotation; }
public Rotations getBodyRotation() { return this.bodyRotation; }
public Rotations getLeftArmRotation() { return this.leftArmRotation; }
public Rotations getRightArmRotation() { return this.rightArmRotation; }
public Rotations getLeftLegRotation() { return this.leftLegRotation; }
public Rotations getRightLegRotation() { return this.rightLegRotation; }
public void write(PacketBuffer buf, Rotations value) { buf.writeFloat(value.getX()); buf.writeFloat(value.getY()); buf.writeFloat(value.getZ()); }
public Rotations read(PacketBuffer buf) throws IOException { return new Rotations(buf.readFloat(), buf.readFloat(), buf.readFloat()); }
public DataParameter<Rotations> createKey(int id) { return new DataParameter(id, this); }
/** * Called to update the entity's position/logic. */ public void onUpdate() { super.onUpdate(); Rotations rotations = (Rotations)this.dataManager.get(HEAD_ROTATION); if (!this.headRotation.equals(rotations)) { this.setHeadRotation(rotations); } Rotations rotations1 = (Rotations)this.dataManager.get(BODY_ROTATION); if (!this.bodyRotation.equals(rotations1)) { this.setBodyRotation(rotations1); } Rotations rotations2 = (Rotations)this.dataManager.get(LEFT_ARM_ROTATION); if (!this.leftArmRotation.equals(rotations2)) { this.setLeftArmRotation(rotations2); } Rotations rotations3 = (Rotations)this.dataManager.get(RIGHT_ARM_ROTATION); if (!this.rightArmRotation.equals(rotations3)) { this.setRightArmRotation(rotations3); } Rotations rotations4 = (Rotations)this.dataManager.get(LEFT_LEG_ROTATION); if (!this.leftLegRotation.equals(rotations4)) { this.setLeftLegRotation(rotations4); } Rotations rotations5 = (Rotations)this.dataManager.get(RIGHT_LEG_ROTATION); if (!this.rightLegRotation.equals(rotations5)) { this.setRightLegRotation(rotations5); } boolean flag = this.hasMarker(); if (!this.wasMarker && flag) { this.updateBoundingBox(false); this.preventEntitySpawning = false; } else { if (!this.wasMarker || flag) { return; } this.updateBoundingBox(true); this.preventEntitySpawning = true; } this.wasMarker = flag; }
@SideOnly(Side.CLIENT) public Rotations getLeftArmRotation() { return this.leftArmRotation; }
@SideOnly(Side.CLIENT) public Rotations getRightArmRotation() { return this.rightArmRotation; }
@SideOnly(Side.CLIENT) public Rotations getLeftLegRotation() { return this.leftLegRotation; }
@SideOnly(Side.CLIENT) public Rotations getRightLegRotation() { return this.rightLegRotation; }
public Rotations read(PacketBuffer buf) { return new Rotations(buf.readFloat(), buf.readFloat(), buf.readFloat()); }