Files
CustomNPC-Plus/src/main/java/noppes/npcs/scripted/event/ForgeEvent.java
T

71 lines
1.8 KiB
Java
Raw Normal View History

package noppes.npcs.scripted.event;
import cpw.mods.fml.common.eventhandler.Cancelable;
import cpw.mods.fml.common.eventhandler.Event;
2022-11-15 15:25:53 -05:00
import noppes.npcs.api.IWorld;
import noppes.npcs.api.entity.IEntity;
import noppes.npcs.api.event.IForgeEvent;
2022-11-24 16:46:20 -06:00
import noppes.npcs.constants.EnumScriptType;
@Cancelable
public class ForgeEvent extends CustomNPCsEvent implements IForgeEvent {
public final Event event;
public ForgeEvent(Event event) {
this.event = event;
}
public Event getEvent() {
return event;
}
2022-11-24 16:46:20 -06:00
public String getHookName() {
return EnumScriptType.FORGE_EVENT.function;
}
@Cancelable
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;
}
2022-11-24 16:46:20 -06:00
public String getHookName() {
return EnumScriptType.FORGE_WORLD.function;
}
public IWorld getWorld() {
return world;
}
}
@Cancelable
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;
}
2022-11-24 16:46:20 -06:00
public String getHookName() {
return EnumScriptType.FORGE_ENTITY.function;
}
public IEntity getEntity() {
return entity;
}
}
public static class InitEvent extends ForgeEvent implements IForgeEvent.InitEvent {
public InitEvent() {
2025-03-13 17:14:45 -04:00
super((Event) null);
}
2022-11-24 16:46:20 -06:00
public String getHookName() {
return EnumScriptType.FORGE_INIT.function;
}
}
}