mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-18 23:09:05 +00:00
Revert Animation Events
This commit is contained in:
1 parent
4c46496c82
commit
1ffddd3ce9
31 files changed
+208
-696
No files matched your search
@@ -1,108 +0,0 @@
|
||||
package noppes.npcs.scripted.event;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.Cancelable;
|
||||
import noppes.npcs.api.entity.IAnimatable;
|
||||
import noppes.npcs.api.event.IAnimationEvent;
|
||||
import noppes.npcs.api.handler.data.IAnimation;
|
||||
import noppes.npcs.api.handler.data.IAnimationData;
|
||||
import noppes.npcs.api.handler.data.IFrame;
|
||||
import noppes.npcs.constants.EnumScriptType;
|
||||
import noppes.npcs.controllers.data.Animation;
|
||||
import noppes.npcs.controllers.data.Frame;
|
||||
|
||||
public abstract class AnimationEvent extends CustomNPCsEvent implements IAnimationEvent {
|
||||
protected final IAnimation animation;
|
||||
protected final IAnimationData animationData;
|
||||
protected final IAnimatable entity;
|
||||
|
||||
public AnimationEvent(IAnimation animation) {
|
||||
this.animation = animation;
|
||||
this.animationData = animation.getParent();
|
||||
this.entity = this.animationData.getEntity();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IAnimation getAnimation() {
|
||||
return this.animation;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IAnimationData getAnimationData() {
|
||||
return this.animationData;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IAnimatable getEntity() {
|
||||
return this.entity;
|
||||
}
|
||||
|
||||
@Cancelable
|
||||
public static class Started extends AnimationEvent {
|
||||
|
||||
public Started(IAnimation animation) {
|
||||
super(animation);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHookName() {
|
||||
return EnumScriptType.ANIMATION_START.function;
|
||||
}
|
||||
}
|
||||
|
||||
public static class Ended extends AnimationEvent {
|
||||
|
||||
public Ended(IAnimation animation) {
|
||||
super(animation);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHookName() {
|
||||
return EnumScriptType.ANIMATION_END.function;
|
||||
}
|
||||
}
|
||||
|
||||
public static abstract class FrameEvent extends AnimationEvent implements IFrameEvent {
|
||||
private final IFrame frame;
|
||||
private final int index;
|
||||
|
||||
public FrameEvent(IAnimation animation, IFrame frame) {
|
||||
super(animation);
|
||||
this.frame = frame;
|
||||
this.index = ((Animation)this.getAnimation()).frames.indexOf((Frame) this.frame);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getIndex() {
|
||||
return this.index;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IFrame getFrame() {
|
||||
return this.frame;
|
||||
}
|
||||
|
||||
public static class Entered extends FrameEvent {
|
||||
|
||||
public Entered(IAnimation animation, IFrame frame) {
|
||||
super(animation, frame);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHookName() {
|
||||
return EnumScriptType.ANIMATION_FRAME_ENTER.function;
|
||||
}
|
||||
}
|
||||
|
||||
public static class Exited extends FrameEvent {
|
||||
|
||||
public Exited(IAnimation animation, IFrame frame) {
|
||||
super(animation, frame);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHookName() {
|
||||
return EnumScriptType.ANIMATION_FRAME_EXIT.function;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -11,7 +11,7 @@ import noppes.npcs.api.event.IBlockEvent;
|
||||
import noppes.npcs.constants.EnumScriptType;
|
||||
import noppes.npcs.scripted.NpcAPI;
|
||||
|
||||
public abstract class BlockEvent extends CustomNPCsEvent implements IBlockEvent {
|
||||
public class BlockEvent extends CustomNPCsEvent implements IBlockEvent {
|
||||
public IBlock block;
|
||||
public BlockEvent(IBlock block){
|
||||
this.block = block;
|
||||
|
||||
@@ -10,7 +10,7 @@ import noppes.npcs.api.item.IItemStack;
|
||||
import noppes.npcs.constants.EnumScriptType;
|
||||
import noppes.npcs.scripted.NpcAPI;
|
||||
|
||||
public abstract class CustomGuiEvent extends CustomNPCsEvent implements ICustomGuiEvent {
|
||||
public class CustomGuiEvent extends CustomNPCsEvent implements ICustomGuiEvent {
|
||||
public final IPlayer player;
|
||||
public final ICustomGui gui;
|
||||
|
||||
|
||||
@@ -9,10 +9,12 @@ import noppes.npcs.api.event.ICustomNPCsEvent;
|
||||
import noppes.npcs.api.handler.data.INaturalSpawn;
|
||||
import noppes.npcs.constants.EnumScriptType;
|
||||
|
||||
public abstract class CustomNPCsEvent extends Event implements ICustomNPCsEvent {
|
||||
public class CustomNPCsEvent extends Event implements ICustomNPCsEvent {
|
||||
public final AbstractNpcAPI API = AbstractNpcAPI.Instance();
|
||||
|
||||
public abstract String getHookName();
|
||||
public String getHookName() {
|
||||
return "CNPCEvent";
|
||||
}
|
||||
|
||||
public CustomNPCsEvent() {
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import noppes.npcs.api.event.IDialogEvent;
|
||||
import noppes.npcs.api.handler.data.IDialog;
|
||||
import noppes.npcs.constants.EnumScriptType;
|
||||
|
||||
public abstract class DialogEvent extends CustomNPCsEvent implements IDialogEvent {
|
||||
public class DialogEvent extends CustomNPCsEvent implements IDialogEvent {
|
||||
public final IDialog dialog;
|
||||
public final IPlayer player;
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import noppes.npcs.api.event.IFactionEvent;
|
||||
import noppes.npcs.api.handler.data.IFaction;
|
||||
import noppes.npcs.constants.EnumScriptType;
|
||||
|
||||
public abstract class FactionEvent extends CustomNPCsEvent implements IFactionEvent {
|
||||
public class FactionEvent extends CustomNPCsEvent implements IFactionEvent {
|
||||
public final IFaction faction;
|
||||
public final IPlayer player;
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import noppes.npcs.api.event.IItemEvent;
|
||||
import noppes.npcs.api.item.IItemCustom;
|
||||
import noppes.npcs.constants.EnumScriptType;
|
||||
|
||||
public abstract class ItemEvent extends CustomNPCsEvent implements IItemEvent {
|
||||
public class ItemEvent extends CustomNPCsEvent implements IItemEvent {
|
||||
public final IItemCustom item;
|
||||
|
||||
public ItemEvent(IItemCustom item) {
|
||||
|
||||
@@ -20,7 +20,7 @@ import noppes.npcs.scripted.NpcAPI;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public abstract class NpcEvent extends CustomNPCsEvent implements INpcEvent {
|
||||
public class NpcEvent extends CustomNPCsEvent implements INpcEvent {
|
||||
public final ICustomNpc npc;
|
||||
|
||||
public NpcEvent(ICustomNpc npc) {
|
||||
|
||||
@@ -7,7 +7,7 @@ import noppes.npcs.api.handler.data.IParty;
|
||||
import noppes.npcs.api.handler.data.IQuest;
|
||||
import noppes.npcs.constants.EnumScriptType;
|
||||
|
||||
public abstract class PartyEvent extends CustomNPCsEvent implements IPartyEvent {
|
||||
public class PartyEvent extends CustomNPCsEvent implements IPartyEvent {
|
||||
public final IQuest quest;
|
||||
public final IParty party;
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ import noppes.npcs.api.item.IItemStack;
|
||||
import noppes.npcs.constants.EnumScriptType;
|
||||
import noppes.npcs.scripted.NpcAPI;
|
||||
|
||||
public abstract class PlayerEvent extends CustomNPCsEvent implements IPlayerEvent {
|
||||
public class PlayerEvent extends CustomNPCsEvent implements IPlayerEvent {
|
||||
public final IPlayer player;
|
||||
|
||||
public PlayerEvent(IPlayer player) {
|
||||
|
||||
@@ -4,9 +4,8 @@ import noppes.npcs.api.IBlock;
|
||||
import noppes.npcs.api.entity.IEntity;
|
||||
import noppes.npcs.api.entity.IProjectile;
|
||||
import noppes.npcs.api.event.IProjectileEvent;
|
||||
import noppes.npcs.constants.EnumScriptType;
|
||||
|
||||
public abstract class ProjectileEvent extends CustomNPCsEvent implements IProjectileEvent {
|
||||
public class ProjectileEvent extends CustomNPCsEvent implements IProjectileEvent {
|
||||
public IProjectile projectile;
|
||||
public IEntity source;
|
||||
|
||||
@@ -30,11 +29,6 @@ public abstract class ProjectileEvent extends CustomNPCsEvent implements IProjec
|
||||
public UpdateEvent(IProjectile projectile) {
|
||||
super(projectile);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHookName() {
|
||||
return EnumScriptType.PROJECTILE_TICK.function;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -68,10 +62,5 @@ public abstract class ProjectileEvent extends CustomNPCsEvent implements IProjec
|
||||
return (IBlock) target;
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHookName() {
|
||||
return EnumScriptType.PROJECTILE_IMPACT.function;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,7 +7,7 @@ import noppes.npcs.api.handler.data.IQuest;
|
||||
import noppes.npcs.api.item.IItemStack;
|
||||
import noppes.npcs.constants.EnumScriptType;
|
||||
|
||||
public abstract class QuestEvent extends CustomNPCsEvent implements IQuestEvent {
|
||||
public class QuestEvent extends CustomNPCsEvent implements IQuestEvent {
|
||||
public final IQuest quest;
|
||||
public final IPlayer player;
|
||||
|
||||
|
||||
Reference in new issue
Block a user