Files
CustomNPC-Plus/src/main/java/noppes/npcs/scripted/roles/ScriptJobPuppet.java
T

129 lines
2.7 KiB
Java
Raw Normal View History

2018-09-13 12:03:28 -04:00
package noppes.npcs.scripted.roles;
2023-01-08 22:32:36 -06:00
import noppes.npcs.api.handler.data.IModelPart;
2018-09-13 12:03:28 -04:00
import noppes.npcs.entity.EntityNPCInterface;
import noppes.npcs.roles.JobPuppet;
import noppes.npcs.scripted.constants.JobType;
2022-11-15 15:25:53 -05:00
import noppes.npcs.api.jobs.IJobPuppet;
2018-09-13 12:03:28 -04:00
2022-06-12 01:26:23 -05:00
public class ScriptJobPuppet extends ScriptJobInterface implements IJobPuppet {
2018-09-13 12:03:28 -04:00
private JobPuppet job;
public ScriptJobPuppet(EntityNPCInterface npc){
super(npc);
this.job = (JobPuppet) npc.jobInterface;
}
2023-01-08 22:32:36 -06:00
public IModelPart getPart(int part) {
switch (part) {
case 0:
return job.head;
case 1:
return job.body;
case 2:
return job.larm;
case 3:
return job.rarm;
case 4:
return job.lleg;
case 5:
return job.rleg;
}
return null;
}
2023-01-08 23:00:25 -06:00
public void allAnimated(boolean animated) {
2023-01-08 22:32:36 -06:00
for (int i = 0; i < 6; i++) {
this.getPart(i).setAnimated(animated);
}
2023-01-07 13:13:44 -06:00
}
2023-01-08 23:00:25 -06:00
public void allInterpolated(boolean interpolate) {
2023-01-08 22:32:36 -06:00
for (int i = 0; i < 6; i++) {
this.getPart(i).setAnimated(interpolate);
}
}
2023-01-08 23:00:25 -06:00
public void allFullAngles(boolean fullAngles) {
2023-01-08 22:32:36 -06:00
for (int i = 0; i < 6; i++) {
this.getPart(i).setFullAngles(fullAngles);
}
}
2023-01-08 23:00:25 -06:00
public void allAnimRate(float animRate) {
2023-01-07 13:13:44 -06:00
if (animRate < 0)
animRate = 0;
2023-01-08 22:32:36 -06:00
for (int i = 0; i < 6; i++) {
this.getPart(i).setAnimRate(animRate);
}
}
public void doWhileStanding(boolean whileStanding) {
this.job.whileStanding = whileStanding;
}
public boolean doWhileStanding() {
return this.job.whileStanding;
}
public void doWhileAttacking(boolean whileAttacking) {
this.job.whileAttacking = whileAttacking;
}
public boolean doWhileAttacking() {
return this.job.whileAttacking;
}
public void doWhileMoving(boolean whileMoving) {
this.job.whileMoving = whileMoving;
}
public boolean doWhileMoving() {
return this.job.whileMoving;
}
2023-01-08 22:32:36 -06:00
@Deprecated
public void setRotationX(int part, float rotation) {
this.getPart(part).setRotationX(rotation);
2018-09-13 12:03:28 -04:00
}
2023-01-08 22:32:36 -06:00
@Deprecated
public void setRotationY(int part, float rotation) {
this.getPart(part).setRotationY(rotation);
}
2023-01-08 22:32:36 -06:00
@Deprecated
public void setRotationZ(int part, float rotation) {
this.getPart(part).setRotationZ(rotation);
}
2023-01-08 22:32:36 -06:00
@Deprecated
public float getRotationX(int part) {
return this.getPart(part).getRotationX();
}
2023-01-08 22:32:36 -06:00
@Deprecated
public float getRotationY(int part) {
return this.getPart(part).getRotationY();
}
2023-01-08 22:32:36 -06:00
@Deprecated
public float getRotationZ(int part) {
return this.getPart(part).getRotationZ();
}
2023-01-08 22:32:36 -06:00
@Deprecated
public boolean isEnabled(int part) {
return this.getPart(part).isEnabled();
}
2023-01-08 22:32:36 -06:00
@Deprecated
public void setEnabled(int part, boolean bo) {
this.getPart(part).setEnabled(bo);
}
2018-09-13 12:03:28 -04:00
@Override
public int getType(){
return JobType.PUPPET;
}
}