mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-26 13:53:07 +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;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -6,17 +6,16 @@
|
||||
package noppes.npcs.scripted.event;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.Cancelable;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.item.EntityXPOrb;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import noppes.npcs.scripted.*;
|
||||
import noppes.npcs.scripted.entity.ScriptLivingBase;
|
||||
import noppes.npcs.scripted.interfaces.*;
|
||||
import noppes.npcs.scripted.item.ScriptItemStack;
|
||||
|
||||
public class PlayerEvent extends CustomNPCsEvent {
|
||||
public final IPlayer player;
|
||||
|
||||
Reference in new issue
Block a user