mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-12 03:47:27 +00:00
Animation/Frame Data Classes with a EnumAnimationPart
This commit is contained in:
1 parent
54d53041ac
commit
91bcd43942
4 files changed
+229
No files matched your search
@@ -0,0 +1,18 @@
|
||||
package noppes.npcs.constants;
|
||||
|
||||
public enum EnumAnimationPart {
|
||||
HEAD ("HEAD"),
|
||||
BODY ("BODY"),
|
||||
RIGHT_ARM ("RARM"),
|
||||
LEFT_ARM ("LARM"),
|
||||
RIGHT_LEG ("RLEG"),
|
||||
LEFT_LEG ("LLEG"),
|
||||
FULL_MODEL ("MODEL");
|
||||
|
||||
public final String partName;
|
||||
|
||||
EnumAnimationPart(String name){
|
||||
this.partName = name;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package noppes.npcs.controllers.data;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
|
||||
public class Animation {
|
||||
|
||||
public ArrayList<Frame> frames = new ArrayList<Frame>();
|
||||
public int id = 0;
|
||||
public String name;
|
||||
public float speed = 1.0F;
|
||||
public boolean smooth = false;
|
||||
|
||||
public Animation(ArrayList<Frame> parts, String name){
|
||||
this.frames = parts;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public Animation(ArrayList<Frame> parts, String name, float speed, boolean smooth){
|
||||
this.frames = parts;
|
||||
this.name = name;
|
||||
this.speed = speed;
|
||||
this.smooth = smooth;
|
||||
}
|
||||
|
||||
public ArrayList<Frame> getFrames() {
|
||||
return frames;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public float getSpeed() {
|
||||
return speed;
|
||||
}
|
||||
|
||||
public boolean isSmooth() {
|
||||
return smooth;
|
||||
}
|
||||
|
||||
// MAKE WRITE NBT
|
||||
// MAKE READ NBT
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
package noppes.npcs.controllers.data;
|
||||
|
||||
import noppes.npcs.constants.EnumAnimationPart;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
|
||||
public class Frame {
|
||||
|
||||
public ArrayList<FramePart> frameParts = new ArrayList<FramePart>();
|
||||
public int duration = 0;
|
||||
boolean customized = false;
|
||||
public float speed = 1.0F;
|
||||
public boolean smooth = false;
|
||||
|
||||
public Frame(ArrayList<FramePart> parts, int duration){
|
||||
this.frameParts = parts;
|
||||
this.duration = duration;
|
||||
}
|
||||
|
||||
public Frame(ArrayList<FramePart> parts, int duration, float speed, boolean smooth){
|
||||
this.frameParts = parts;
|
||||
this.duration = duration;
|
||||
this.speed = speed;
|
||||
this.smooth = smooth;
|
||||
this.customized = true;
|
||||
}
|
||||
|
||||
public ArrayList<FramePart> getFrameParts() {
|
||||
return frameParts;
|
||||
}
|
||||
|
||||
public void setFrameParts(ArrayList<FramePart> frameParts) {
|
||||
this.frameParts = frameParts;
|
||||
}
|
||||
|
||||
public int getDuration() {
|
||||
return duration;
|
||||
}
|
||||
|
||||
public void setDuration(int duration) {
|
||||
this.duration = duration;
|
||||
}
|
||||
|
||||
public boolean isCustomized() {
|
||||
return customized;
|
||||
}
|
||||
|
||||
public void setCustomized(boolean customized) {
|
||||
this.customized = customized;
|
||||
}
|
||||
|
||||
public float getSpeed() {
|
||||
return speed;
|
||||
}
|
||||
|
||||
public void setSpeed(float speed) {
|
||||
this.speed = speed;
|
||||
}
|
||||
|
||||
public boolean isSmooth() {
|
||||
return smooth;
|
||||
}
|
||||
|
||||
public void setSmooth(boolean smooth) {
|
||||
this.smooth = smooth;
|
||||
}
|
||||
|
||||
// MAKE WRITE NBT
|
||||
// MAKE READ NBT
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
package noppes.npcs.controllers.data;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.Vec3;
|
||||
import noppes.npcs.constants.EnumAnimationPart;
|
||||
|
||||
import javax.vecmath.Vector3f;
|
||||
import java.util.Vector;
|
||||
|
||||
|
||||
public class FramePart {
|
||||
|
||||
public EnumAnimationPart part;
|
||||
public int[] rotation = {0, 0, 0};
|
||||
public int[] pivot = {0, 0, 0};
|
||||
|
||||
boolean customized = false;
|
||||
|
||||
public float speed = 1.0F;
|
||||
public boolean smooth = false;
|
||||
|
||||
public FramePart(EnumAnimationPart part){
|
||||
this.part = part;
|
||||
}
|
||||
|
||||
public FramePart(EnumAnimationPart part, int[] rotation, int[] pivot){
|
||||
this.part = part;
|
||||
this.rotation = rotation;
|
||||
this.pivot = pivot;
|
||||
}
|
||||
|
||||
public FramePart(EnumAnimationPart part, int[] rotation, int[] pivot, float speed, boolean smooth){
|
||||
this.part = part;
|
||||
this.rotation = rotation;
|
||||
this.pivot = pivot;
|
||||
this.speed = speed;
|
||||
this.smooth = smooth;
|
||||
this.customized = true;
|
||||
}
|
||||
|
||||
public EnumAnimationPart getPart() {
|
||||
return part;
|
||||
}
|
||||
|
||||
public void setPart(EnumAnimationPart part) {
|
||||
this.part = part;
|
||||
}
|
||||
|
||||
public int[] getRotation() {
|
||||
return rotation;
|
||||
}
|
||||
|
||||
public void setRotation(int[] rotation) {
|
||||
this.rotation = rotation;
|
||||
}
|
||||
|
||||
public int[] getPivot() {
|
||||
return pivot;
|
||||
}
|
||||
|
||||
public void setPivot(int[] pivot) {
|
||||
this.pivot = pivot;
|
||||
}
|
||||
|
||||
public boolean isCustomized() {
|
||||
return customized;
|
||||
}
|
||||
|
||||
public void setCustomized(boolean customized) {
|
||||
this.customized = customized;
|
||||
}
|
||||
|
||||
public float getSpeed() {
|
||||
return speed;
|
||||
}
|
||||
|
||||
public void setSpeed(float speed) {
|
||||
this.speed = speed;
|
||||
}
|
||||
|
||||
public boolean isSmooth() {
|
||||
return smooth;
|
||||
}
|
||||
|
||||
public void setSmooth(boolean smooth) {
|
||||
this.smooth = smooth;
|
||||
}
|
||||
|
||||
// MAKE WRITE NBT
|
||||
// MAKE READ NBT
|
||||
}
|
||||
Reference in new issue
Block a user