Animation events API changes

This commit is contained in:
Luis C.M. committed 2025-01-22 15:31:11 -06:00
1 parent 17d165e628
commit 8ced18ec84
6 files changed
+66 -6

No files matched your search

@@ -0,0 +1,8 @@
package noppes.npcs.api.entity;
import noppes.npcs.api.handler.data.IAnimationData;
public interface IAnimatable {
IAnimationData getAnimationData();
}
+1 -1
View File
@@ -13,7 +13,7 @@ import noppes.npcs.api.item.IItemStack;
import noppes.npcs.api.jobs.IJob;
import noppes.npcs.api.roles.IRole;
public interface ICustomNpc<T extends EntityCreature> extends IEntityLiving<T> {
public interface ICustomNpc<T extends EntityCreature> extends IEntityLiving<T>, IAnimatable {
/**
* @return Returns the current npcs size 1-30
*/
+1 -1
View File
@@ -13,7 +13,7 @@ import noppes.npcs.api.handler.data.ISound;
import noppes.npcs.api.item.IItemStack;
import noppes.npcs.api.overlay.ICustomOverlay;
public interface IPlayer<T extends EntityPlayerMP> extends IEntityLivingBase<T> {
public interface IPlayer<T extends EntityPlayerMP> extends IEntityLivingBase<T>, IAnimatable {
/**
* @return Returns the displayed name of the player
*/
@@ -0,0 +1,40 @@
package noppes.npcs.api.event;
import cpw.mods.fml.common.eventhandler.Cancelable;
import noppes.npcs.api.entity.IAnimatable;
import noppes.npcs.api.handler.data.IAnimation;
import noppes.npcs.api.handler.data.IAnimationData;
import noppes.npcs.api.handler.data.IFrame;
public interface IAnimationEvent extends ICustomNPCsEvent {
IAnimation getAnimation();
IAnimationData getAnimationData();
IAnimatable getEntity();
@Cancelable
interface Started extends IAnimationEvent {
}
interface Ended extends IAnimationEvent {
}
interface IFrameEvent extends IAnimationEvent {
int getIndex();
IFrame getFrame();
interface Entered extends IFrameEvent {
}
interface Exited extends IFrameEvent {
}
}
}
@@ -2,6 +2,8 @@ package noppes.npcs.api.handler.data;
public interface IAnimation {
IAnimationData getParent();
IFrame currentFrame();
IFrame[] getFrames();
@@ -20,6 +22,10 @@ public interface IAnimation {
String getName();
int tickDuration();
IAnimation setTickDuration(int tickDuration);
IAnimation setSpeed(float speed);
float getSpeed();
@@ -28,10 +34,6 @@ public interface IAnimation {
byte isSmooth();
IAnimation useRenderTicks(boolean renderTicks);
boolean useRenderTicks();
IAnimation doWhileStanding(boolean whileStanding);
boolean doWhileStanding();
@@ -56,4 +58,6 @@ public interface IAnimation {
* Do not use this unless you know what you are changing. Dangerous to change.
*/
void setID(int id);
long getTotalTime();
}
@@ -1,11 +1,17 @@
package noppes.npcs.api.handler.data;
import noppes.npcs.api.entity.IAnimatable;
public interface IAnimationData {
IAnimatable getEntity();
void updateClient();
boolean isActive();
boolean isClientAnimating();
void setEnabled(boolean enabled);
boolean enabled();
@@ -13,4 +19,6 @@ public interface IAnimationData {
void setAnimation(IAnimation animation);
IAnimation getAnimation();
long getAnimatingTime();
}