mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-18 14:59:05 +00:00
Implemented Scripted Custom Items.
This commit is contained in:
1 parent
5520fc5f2b
commit
26f5f86dca
34 files changed
+1476
-137
No files matched your search
@@ -0,0 +1,89 @@
|
||||
package noppes.npcs.scripted.event;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.Cancelable;
|
||||
import noppes.npcs.scripted.entity.ScriptEntity;
|
||||
import noppes.npcs.scripted.interfaces.IEntity;
|
||||
import noppes.npcs.scripted.interfaces.IPlayer;
|
||||
import noppes.npcs.scripted.item.ScriptCustomItem;
|
||||
|
||||
public class ItemEvent extends CustomNPCsEvent {
|
||||
public ScriptCustomItem item;
|
||||
|
||||
public ItemEvent(ScriptCustomItem item) {
|
||||
this.item = item;
|
||||
}
|
||||
|
||||
public static class InitEvent extends ItemEvent {
|
||||
public InitEvent(ScriptCustomItem item) {
|
||||
super(item);
|
||||
}
|
||||
}
|
||||
|
||||
public static class UpdateEvent extends ItemEvent {
|
||||
public IPlayer player;
|
||||
|
||||
public UpdateEvent(ScriptCustomItem item, IPlayer player) {
|
||||
super(item);
|
||||
this.player = player;
|
||||
}
|
||||
}
|
||||
|
||||
@Cancelable
|
||||
public static class TossedEvent extends ItemEvent {
|
||||
public IEntity entity;
|
||||
public IPlayer player;
|
||||
|
||||
public TossedEvent(ScriptCustomItem item, IPlayer player, IEntity entity) {
|
||||
super(item);
|
||||
this.entity = entity;
|
||||
this.player = player;
|
||||
}
|
||||
}
|
||||
|
||||
public static class PickedUpEvent extends ItemEvent {
|
||||
public IPlayer player;
|
||||
|
||||
public PickedUpEvent(ScriptCustomItem item, IPlayer player) {
|
||||
super(item);
|
||||
this.player = player;
|
||||
}
|
||||
}
|
||||
|
||||
@Cancelable
|
||||
public static class SpawnEvent extends ItemEvent {
|
||||
public IEntity entity;
|
||||
public SpawnEvent(ScriptCustomItem item, IEntity entity){
|
||||
super(item);
|
||||
this.entity = entity;
|
||||
}
|
||||
}
|
||||
|
||||
@Cancelable
|
||||
public static class InteractEvent extends ItemEvent {
|
||||
public final int type;
|
||||
public final Object target;
|
||||
public IPlayer player;
|
||||
|
||||
public InteractEvent(ScriptCustomItem item, IPlayer player, int type, Object target) {
|
||||
super(item);
|
||||
this.type = type;
|
||||
this.target = target;
|
||||
this.player = player;
|
||||
}
|
||||
}
|
||||
|
||||
@Cancelable
|
||||
public static class AttackEvent extends ItemEvent {
|
||||
public final int type;//1: Hit, 2: Whiff //TODO: Implement type 2
|
||||
public final Object target;
|
||||
public IPlayer player;
|
||||
|
||||
public AttackEvent(ScriptCustomItem item, IPlayer player, int type, Object target) {
|
||||
super(item);
|
||||
this.type = type;
|
||||
this.target = target;
|
||||
this.player = player;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user