mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-16 14:14:46 +00:00
Added more player events.
This commit is contained in:
1 parent
15bfbcdbd1
commit
feeef71b5a
6 files changed
+238
-10
No files matched your search
@@ -6,11 +6,14 @@
|
||||
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.entity.ScriptPlayer;
|
||||
@@ -162,6 +165,12 @@ public class PlayerEvent extends CustomNPCsEvent {
|
||||
}
|
||||
}
|
||||
|
||||
public static class JumpEvent extends PlayerEvent {
|
||||
public JumpEvent(IPlayer player){
|
||||
super(player);
|
||||
}
|
||||
}
|
||||
|
||||
public static class KilledEntityEvent extends PlayerEvent {
|
||||
public final IEntityLivingBase entity;
|
||||
|
||||
@@ -341,4 +350,82 @@ public class PlayerEvent extends CustomNPCsEvent {
|
||||
this.exp = exp;
|
||||
}
|
||||
}
|
||||
|
||||
public static class UseHoe extends PlayerEvent {
|
||||
public final IItemStack hoe;
|
||||
public final int x;
|
||||
public final int y;
|
||||
public final int z;
|
||||
|
||||
public UseHoe(IPlayer player, ItemStack item, int x, int y, int z) {
|
||||
super(player);
|
||||
this.hoe = new ScriptItemStack(item);
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.z = z;
|
||||
}
|
||||
}
|
||||
|
||||
public static class WakeUp extends PlayerEvent{
|
||||
public final boolean setSpawn;
|
||||
|
||||
public WakeUp(IPlayer player, boolean setSpawn) {
|
||||
super(player);
|
||||
this.setSpawn = setSpawn;
|
||||
}
|
||||
}
|
||||
|
||||
public static class Sleep extends PlayerEvent {
|
||||
public final int x;
|
||||
public final int y;
|
||||
public final int z;
|
||||
|
||||
public Sleep(ScriptPlayer player, int x, int y, int z) {
|
||||
super(player);
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.z = z;
|
||||
}
|
||||
}
|
||||
|
||||
public static class Achievement extends PlayerEvent {
|
||||
public final String description;
|
||||
|
||||
public Achievement(IPlayer player, String description) {
|
||||
super(player);
|
||||
this.description = description;
|
||||
}
|
||||
}
|
||||
|
||||
public static class FillBucket extends PlayerEvent {
|
||||
public final IItemStack current;
|
||||
public final IItemStack result;
|
||||
|
||||
public FillBucket(IPlayer player, ItemStack current, ItemStack result) {
|
||||
super(player);
|
||||
this.current = new ScriptItemStack(current);
|
||||
this.result = new ScriptItemStack(result);
|
||||
}
|
||||
}
|
||||
|
||||
public static class Bonemeal extends PlayerEvent {
|
||||
public final IBlock block;
|
||||
public final int x;
|
||||
public final int y;
|
||||
public final int z;
|
||||
|
||||
public Bonemeal(IPlayer player, int x, int y, int z, World world) {
|
||||
super(player);
|
||||
this.block = API.getIBlock(world, x, y, z);
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.z = z;
|
||||
}
|
||||
}
|
||||
|
||||
public static class RangedChargeEvent extends PlayerEvent {
|
||||
public RangedChargeEvent(ScriptPlayer player) {
|
||||
super(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user