mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-26 02:13:04 +00:00
Merge remote-tracking branch 'refs/remotes/origin/packet' into animation-events-2
# Conflicts: # src/api # src/main/java/noppes/npcs/CommonProxy.java # src/main/java/noppes/npcs/ServerEventsHandler.java # src/main/java/noppes/npcs/client/PacketHandlerClient.java # src/main/java/noppes/npcs/client/gui/global/GuiNPCManageAnimations.java # src/main/java/noppes/npcs/controllers/data/AnimationData.java
This commit is contained in:
commit
00af353e65
602 files changed
+29702
-6562
No files matched your search
@@ -14,6 +14,7 @@ import noppes.npcs.api.entity.IEntity;
|
||||
import noppes.npcs.api.entity.IEntityLivingBase;
|
||||
import noppes.npcs.api.entity.IPlayer;
|
||||
import noppes.npcs.api.event.IPlayerEvent;
|
||||
import noppes.npcs.api.handler.data.IPlayerEffect;
|
||||
import noppes.npcs.api.item.IItemStack;
|
||||
import noppes.npcs.constants.EnumScriptType;
|
||||
import noppes.npcs.scripted.NpcAPI;
|
||||
@@ -949,4 +950,59 @@ public class PlayerEvent extends CustomNPCsEvent implements IPlayerEvent {
|
||||
return EnumScriptType.RANGED_LAUNCHED.function;
|
||||
}
|
||||
}
|
||||
|
||||
public static class EffectEvent extends PlayerEvent implements IPlayerEvent.EffectEvent {
|
||||
|
||||
public final IPlayerEffect effect;
|
||||
|
||||
public EffectEvent(IPlayer player, IPlayerEffect statusEffect) {
|
||||
super(player);
|
||||
this.effect = statusEffect;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPlayerEffect getEffect() {
|
||||
return this.effect;
|
||||
}
|
||||
|
||||
public static class Added extends PlayerEvent.EffectEvent implements IPlayerEvent.EffectEvent.Added {
|
||||
|
||||
public Added(IPlayer player, IPlayerEffect statusEffect) {
|
||||
super(player, statusEffect);
|
||||
}
|
||||
|
||||
}
|
||||
public static class Ticked extends PlayerEvent.EffectEvent implements IPlayerEvent.EffectEvent.Ticked {
|
||||
|
||||
public Ticked(IPlayer player, IPlayerEffect statusEffect) {
|
||||
super(player, statusEffect);
|
||||
}
|
||||
|
||||
}
|
||||
public static class Removed extends PlayerEvent.EffectEvent implements IPlayerEvent.EffectEvent.Removed {
|
||||
|
||||
private final ExpirationType type;
|
||||
|
||||
public Removed(IPlayer player, IPlayerEffect statusEffect, ExpirationType type) {
|
||||
super(player, statusEffect);
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasTimerRunOut() {
|
||||
return type == ExpirationType.RUN_OUT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean causedByDeath() {
|
||||
return type == ExpirationType.DEATH;
|
||||
}
|
||||
}
|
||||
|
||||
public enum ExpirationType {
|
||||
REMOVED,
|
||||
RUN_OUT,
|
||||
DEATH
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user