mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-17 11:05:12 +00:00
Implemented event interfaces, made more events cancellable.
This commit is contained in:
1 parent
aa02e5dcc3
commit
0414817673
32 files changed
+1298
-175
No files matched your search
@@ -9,36 +9,49 @@ import cpw.mods.fml.common.eventhandler.Cancelable;
|
||||
import cpw.mods.fml.common.eventhandler.Event;
|
||||
import noppes.npcs.api.IWorld;
|
||||
import noppes.npcs.api.entity.IEntity;
|
||||
import noppes.npcs.api.event.IForgeEvent;
|
||||
|
||||
@Cancelable
|
||||
public class ForgeEvent extends CustomNPCsEvent {
|
||||
public class ForgeEvent extends CustomNPCsEvent implements IForgeEvent {
|
||||
public final Event event;
|
||||
|
||||
public ForgeEvent(Event event) {
|
||||
this.event = event;
|
||||
}
|
||||
|
||||
public Event getEvent() {
|
||||
return event;
|
||||
}
|
||||
|
||||
@Cancelable
|
||||
public static class WorldEvent extends ForgeEvent {
|
||||
public static class WorldEvent extends ForgeEvent implements IForgeEvent.WorldEvent {
|
||||
public final IWorld world;
|
||||
|
||||
public WorldEvent(net.minecraftforge.event.world.WorldEvent event, IWorld world) {
|
||||
super(event);
|
||||
this.world = world;
|
||||
}
|
||||
|
||||
public IWorld getWorld() {
|
||||
return world;
|
||||
}
|
||||
}
|
||||
|
||||
@Cancelable
|
||||
public static class EntityEvent extends ForgeEvent {
|
||||
public static class EntityEvent extends ForgeEvent implements IForgeEvent.EntityEvent {
|
||||
public final IEntity entity;
|
||||
|
||||
public EntityEvent(net.minecraftforge.event.entity.EntityEvent event, IEntity entity) {
|
||||
super(event);
|
||||
this.entity = entity;
|
||||
}
|
||||
|
||||
public IEntity getEntity() {
|
||||
return entity;
|
||||
}
|
||||
}
|
||||
|
||||
public static class InitEvent extends ForgeEvent {
|
||||
public static class InitEvent extends ForgeEvent implements IForgeEvent.InitEvent {
|
||||
public InitEvent() {
|
||||
super((Event)null);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user