001/* 002 * Trident - A Multithreaded Server Alternative 003 * Copyright 2014 The TridentSDK Team 004 * 005 * Licensed under the Apache License, Version 2.0 (the "License"); 006 * you may not use this file except in compliance with the License. 007 * You may obtain a copy of the License at 008 * 009 * http://www.apache.org/licenses/LICENSE-2.0 010 * 011 * Unless required by applicable law or agreed to in writing, software 012 * distributed under the License is distributed on an "AS IS" BASIS, 013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 014 * See the License for the specific language governing permissions and 015 * limitations under the License. 016 */ 017 018package net.tridentsdk.util; 019 020import javax.annotation.concurrent.NotThreadSafe; 021 022/** 023 * Represents the rotation of an Armor Stand part 024 * 025 * @author TridentSDK Team 026 */ 027@NotThreadSafe 028public final class PartRotation { 029 private int rotX; 030 private int rotY; 031 private int rotZ; 032 033 /** 034 * @param rotX Rotation value on the X plane 035 * @param rotY Rotation value on the Y plane 036 * @param rotZ Rotation value on the Z plane 037 */ 038 public PartRotation(int rotX, int rotY, int rotZ) { 039 this.rotX = rotX; 040 this.rotY = rotY; 041 this.rotZ = rotZ; 042 } 043 044 /** 045 * Get the rotation on the X plane 046 * 047 * @return Integer rotation on the X plane 048 */ 049 public int rotX() { 050 return this.rotX; 051 } 052 053 /** 054 * Set the rotation on the X plane 055 * 056 * @param rotX rotation on the X plane 057 */ 058 public void setRotX(int rotX) { 059 this.rotX = rotX; 060 } 061 062 /** 063 * Get the rotation on the Y plane 064 * 065 * @return Integer rotation on the Y plane 066 */ 067 public int rotY() { 068 return this.rotY; 069 } 070 071 /** 072 * Set the rotation on the Y plane 073 * 074 * @param rotY rotation on the Y plane 075 */ 076 public void setRotY(int rotY) { 077 this.rotY = rotY; 078 } 079 080 /** 081 * Get the rotation on the Z plane 082 * 083 * @return Integer rotation on the Z plane 084 */ 085 public int rotZ() { 086 return this.rotZ; 087 } 088 089 /** 090 * Set the rotation on the Z plane 091 * 092 * @param rotZ rotation on the Z plane 093 */ 094 public void setRotZ(int rotZ) { 095 this.rotZ = rotZ; 096 } 097 098 /** 099 * Obtains the rotation of this part as a vector of the rotation xyz 100 * 101 * @return the rotation vector 102 */ 103 public Vector asVector() { 104 return new Vector(rotX, rotY, rotZ); 105 } 106}