|
@@ -19,6 +19,7 @@ import me.km.api.Module;
|
|
import me.km.api.Utils;
|
|
import me.km.api.Utils;
|
|
import me.km.dimensions.ModDimensions;
|
|
import me.km.dimensions.ModDimensions;
|
|
import me.km.effects.PlayerUsesEffectEvent;
|
|
import me.km.effects.PlayerUsesEffectEvent;
|
|
|
|
+import me.km.entities.EntityHuman;
|
|
import me.km.entities.EntityItemProjectile;
|
|
import me.km.entities.EntityItemProjectile;
|
|
import me.km.events.PlayerHurtEvent;
|
|
import me.km.events.PlayerHurtEvent;
|
|
import me.km.events.PlayerJoinMessageEvent;
|
|
import me.km.events.PlayerJoinMessageEvent;
|
|
@@ -103,7 +104,7 @@ public class ScriptEvents extends ModuleListener
|
|
// -------------------------------------------------------------------------
|
|
// -------------------------------------------------------------------------
|
|
|
|
|
|
@SubscribeEvent
|
|
@SubscribeEvent
|
|
- public void joinOtherPlayersQuests(PlayerInteractEvent.EntityInteract e)
|
|
|
|
|
|
+ public void onOtherScriptJoin(PlayerInteractEvent.EntityInteract e)
|
|
{
|
|
{
|
|
if(e.getHand() == EnumHand.OFF_HAND || !(e.getTarget() instanceof EntityPlayer))
|
|
if(e.getHand() == EnumHand.OFF_HAND || !(e.getTarget() instanceof EntityPlayer))
|
|
{
|
|
{
|
|
@@ -154,7 +155,7 @@ public class ScriptEvents extends ModuleListener
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- public boolean QuestClickInventory(Script qd, SnuviInventory inv, int slot, ClickType click, EntityPlayer p)
|
|
|
|
|
|
+ public boolean onInventoryClick(Script qd, SnuviInventory inv, int slot, ClickType click, EntityPlayer p)
|
|
{
|
|
{
|
|
parser.callEvent("inv_click", qd, sc ->
|
|
parser.callEvent("inv_click", qd, sc ->
|
|
{
|
|
{
|
|
@@ -168,7 +169,7 @@ public class ScriptEvents extends ModuleListener
|
|
return qd.getBooleanVar("cancel");
|
|
return qd.getBooleanVar("cancel");
|
|
}
|
|
}
|
|
|
|
|
|
- public void QuestCloseInventory(Script qd, SnuviInventory inv, EntityPlayer p)
|
|
|
|
|
|
+ public void onInventoryClose(Script qd, SnuviInventory inv, EntityPlayer p)
|
|
{
|
|
{
|
|
parser.callEvent("inv_close", qd, sc ->
|
|
parser.callEvent("inv_close", qd, sc ->
|
|
{
|
|
{
|
|
@@ -178,8 +179,13 @@ public class ScriptEvents extends ModuleListener
|
|
}, null);
|
|
}, null);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public void onHumanHurt(EntityPlayer p, EntityHuman h)
|
|
|
|
+ {
|
|
|
|
+ handleEvent(p, "human_hurt", sc -> ScriptVars.setEntityVars(sc, h));
|
|
|
|
+ }
|
|
|
|
+
|
|
@SubscribeEvent
|
|
@SubscribeEvent
|
|
- public void QuestOnPlayerRespawn(PlayerRespawnAtEvent e)
|
|
|
|
|
|
+ public void onPlayerRespawn(PlayerRespawnAtEvent e)
|
|
{
|
|
{
|
|
handleEvent(e.getEntityPlayer(), "player_respawn", (qd) ->
|
|
handleEvent(e.getEntityPlayer(), "player_respawn", (qd) ->
|
|
{
|
|
{
|
|
@@ -202,7 +208,7 @@ public class ScriptEvents extends ModuleListener
|
|
}
|
|
}
|
|
|
|
|
|
@SubscribeEvent
|
|
@SubscribeEvent
|
|
- public void QuestPlayerDamage(PlayerHurtEvent e)
|
|
|
|
|
|
+ public void onPlayerDamage(PlayerHurtEvent e)
|
|
{
|
|
{
|
|
EntityPlayer p = e.getEntityPlayer();
|
|
EntityPlayer p = e.getEntityPlayer();
|
|
handleEvent(p, "player_hurt", (qd) ->
|
|
handleEvent(p, "player_hurt", (qd) ->
|
|
@@ -235,7 +241,7 @@ public class ScriptEvents extends ModuleListener
|
|
}
|
|
}
|
|
|
|
|
|
@SubscribeEvent
|
|
@SubscribeEvent
|
|
- public void QuestDeath(LivingDeathEvent e)
|
|
|
|
|
|
+ public void onLivingDeath(LivingDeathEvent e)
|
|
{
|
|
{
|
|
if(!(e.getEntityLiving() instanceof EntityPlayer))
|
|
if(!(e.getEntityLiving() instanceof EntityPlayer))
|
|
{
|
|
{
|
|
@@ -281,7 +287,7 @@ public class ScriptEvents extends ModuleListener
|
|
}
|
|
}
|
|
|
|
|
|
@SubscribeEvent
|
|
@SubscribeEvent
|
|
- public void QuestEntityDamage(LivingHurtEvent e)
|
|
|
|
|
|
+ public void onEntityDamage(LivingHurtEvent e)
|
|
{
|
|
{
|
|
EntityPlayer p = Utils.getDamager(e.getSource());
|
|
EntityPlayer p = Utils.getDamager(e.getSource());
|
|
if(p == null)
|
|
if(p == null)
|
|
@@ -302,7 +308,7 @@ public class ScriptEvents extends ModuleListener
|
|
}
|
|
}
|
|
|
|
|
|
@SubscribeEvent
|
|
@SubscribeEvent
|
|
- public void QuestEntityDrop(LivingDropsEvent e)
|
|
|
|
|
|
+ public void onEntityDrop(LivingDropsEvent e)
|
|
{
|
|
{
|
|
try
|
|
try
|
|
{
|
|
{
|
|
@@ -333,7 +339,7 @@ public class ScriptEvents extends ModuleListener
|
|
}
|
|
}
|
|
|
|
|
|
@SubscribeEvent
|
|
@SubscribeEvent
|
|
- public void QuestPlayerDrop(PlayerDropsEvent e)
|
|
|
|
|
|
+ public void onPlayerDrop(PlayerDropsEvent e)
|
|
{
|
|
{
|
|
handleEvent(e.getEntityPlayer(), "player_drop", (qd) ->
|
|
handleEvent(e.getEntityPlayer(), "player_drop", (qd) ->
|
|
{
|
|
{
|
|
@@ -345,7 +351,7 @@ public class ScriptEvents extends ModuleListener
|
|
}
|
|
}
|
|
|
|
|
|
@SubscribeEvent
|
|
@SubscribeEvent
|
|
- public void QuestProjectileHit(ThrowableImpactEvent e)
|
|
|
|
|
|
+ public void onProjectileHit(ThrowableImpactEvent e)
|
|
{
|
|
{
|
|
EntityPlayer p = Utils.getPlayerFromProjectile(e.getEntityThrowable());
|
|
EntityPlayer p = Utils.getPlayerFromProjectile(e.getEntityThrowable());
|
|
if(p != null)
|
|
if(p != null)
|
|
@@ -377,7 +383,7 @@ public class ScriptEvents extends ModuleListener
|
|
}
|
|
}
|
|
|
|
|
|
@SubscribeEvent
|
|
@SubscribeEvent
|
|
- public void QuestEntityShear(PlayerInteractEvent.EntityInteract e)
|
|
|
|
|
|
+ public void onEntityShear(PlayerInteractEvent.EntityInteract e)
|
|
{
|
|
{
|
|
if(e.getHand() == EnumHand.OFF_HAND || !(e.getTarget() instanceof EntitySheep))
|
|
if(e.getHand() == EnumHand.OFF_HAND || !(e.getTarget() instanceof EntitySheep))
|
|
{
|
|
{
|
|
@@ -403,7 +409,7 @@ public class ScriptEvents extends ModuleListener
|
|
}
|
|
}
|
|
|
|
|
|
@SubscribeEvent
|
|
@SubscribeEvent
|
|
- public void QuestBlockBreak(BlockEvent.BreakEvent e)
|
|
|
|
|
|
+ public void onBlockBreak(BlockEvent.BreakEvent e)
|
|
{
|
|
{
|
|
handleEvent(e.getPlayer(), "block_break", (qd) ->
|
|
handleEvent(e.getPlayer(), "block_break", (qd) ->
|
|
{
|
|
{
|
|
@@ -416,7 +422,7 @@ public class ScriptEvents extends ModuleListener
|
|
}
|
|
}
|
|
|
|
|
|
@SubscribeEvent
|
|
@SubscribeEvent
|
|
- public void QuestPlayerLogin(PlayerEvent.PlayerLoggedInEvent e)
|
|
|
|
|
|
+ public void onPlayerLogin(PlayerEvent.PlayerLoggedInEvent e)
|
|
{
|
|
{
|
|
EntityPlayer p = e.player;
|
|
EntityPlayer p = e.player;
|
|
if(p == null)
|
|
if(p == null)
|
|
@@ -433,7 +439,7 @@ public class ScriptEvents extends ModuleListener
|
|
}
|
|
}
|
|
|
|
|
|
@SubscribeEvent
|
|
@SubscribeEvent
|
|
- public void QuestPlayerJoin(PlayerJoinMessageEvent e)
|
|
|
|
|
|
+ public void onPlayerJoin(PlayerJoinMessageEvent e)
|
|
{
|
|
{
|
|
EntityPlayer p = e.getEntityPlayer();
|
|
EntityPlayer p = e.getEntityPlayer();
|
|
handleEvent(p, "player_join_server", (qd) ->
|
|
handleEvent(p, "player_join_server", (qd) ->
|
|
@@ -464,7 +470,7 @@ public class ScriptEvents extends ModuleListener
|
|
}
|
|
}
|
|
|
|
|
|
@SubscribeEvent
|
|
@SubscribeEvent
|
|
- public void QuestBucketFill(FillBucketEvent e)
|
|
|
|
|
|
+ public void onBucketFill(FillBucketEvent e)
|
|
{
|
|
{
|
|
handleEvent(e.getEntityPlayer(), "bucket_fill", (qd) ->
|
|
handleEvent(e.getEntityPlayer(), "bucket_fill", (qd) ->
|
|
{
|
|
{
|
|
@@ -494,7 +500,7 @@ public class ScriptEvents extends ModuleListener
|
|
}
|
|
}
|
|
|
|
|
|
@SubscribeEvent
|
|
@SubscribeEvent
|
|
- public void QuestBlockPlace(BlockEvent.PlaceEvent e)
|
|
|
|
|
|
+ public void onBlockPlace(BlockEvent.PlaceEvent e)
|
|
{
|
|
{
|
|
handleEvent(e.getPlayer(), "block_place", (qd) ->
|
|
handleEvent(e.getPlayer(), "block_place", (qd) ->
|
|
{
|
|
{
|
|
@@ -508,7 +514,7 @@ public class ScriptEvents extends ModuleListener
|
|
}
|
|
}
|
|
|
|
|
|
@SubscribeEvent
|
|
@SubscribeEvent
|
|
- public void QuestClickBlockRight(PlayerInteractEvent.RightClickBlock e)
|
|
|
|
|
|
+ public void onRightClickBlock(PlayerInteractEvent.RightClickBlock e)
|
|
{
|
|
{
|
|
if(e.getHand() == EnumHand.OFF_HAND)
|
|
if(e.getHand() == EnumHand.OFF_HAND)
|
|
{
|
|
{
|
|
@@ -526,7 +532,7 @@ public class ScriptEvents extends ModuleListener
|
|
}
|
|
}
|
|
|
|
|
|
@SubscribeEvent
|
|
@SubscribeEvent
|
|
- public void QuestClickBlockLeft(PlayerInteractEvent.LeftClickBlock e)
|
|
|
|
|
|
+ public void onLeftClickBlock(PlayerInteractEvent.LeftClickBlock e)
|
|
{
|
|
{
|
|
if(e.getHand() == EnumHand.OFF_HAND)
|
|
if(e.getHand() == EnumHand.OFF_HAND)
|
|
{
|
|
{
|
|
@@ -544,7 +550,7 @@ public class ScriptEvents extends ModuleListener
|
|
}
|
|
}
|
|
|
|
|
|
@SubscribeEvent
|
|
@SubscribeEvent
|
|
- public void QuestClickEntity(PlayerInteractEvent.EntityInteract e)
|
|
|
|
|
|
+ public void onEntityClick(PlayerInteractEvent.EntityInteract e)
|
|
{
|
|
{
|
|
if(e.getHand() != EnumHand.OFF_HAND)
|
|
if(e.getHand() != EnumHand.OFF_HAND)
|
|
{
|
|
{
|
|
@@ -560,7 +566,7 @@ public class ScriptEvents extends ModuleListener
|
|
}
|
|
}
|
|
|
|
|
|
@SubscribeEvent
|
|
@SubscribeEvent
|
|
- public void QuestFishing(ItemFishedEvent e)
|
|
|
|
|
|
+ public void onFishing(ItemFishedEvent e)
|
|
{
|
|
{
|
|
handleEvent(e.getEntityPlayer(), "fishing", (qd) ->
|
|
handleEvent(e.getEntityPlayer(), "fishing", (qd) ->
|
|
{
|
|
{
|
|
@@ -620,7 +626,7 @@ public class ScriptEvents extends ModuleListener
|
|
}
|
|
}
|
|
|
|
|
|
@SubscribeEvent
|
|
@SubscribeEvent
|
|
- public void QuestConsuming(LivingEntityUseItemEvent.Finish e)
|
|
|
|
|
|
+ public void onConsuming(LivingEntityUseItemEvent.Finish e)
|
|
{
|
|
{
|
|
if(!(e.getEntityLiving() instanceof EntityPlayer))
|
|
if(!(e.getEntityLiving() instanceof EntityPlayer))
|
|
{
|
|
{
|
|
@@ -633,7 +639,7 @@ public class ScriptEvents extends ModuleListener
|
|
}
|
|
}
|
|
|
|
|
|
@SubscribeEvent
|
|
@SubscribeEvent
|
|
- public void QuestCrafting(PlayerEvent.ItemCraftedEvent e)
|
|
|
|
|
|
+ public void onCrafting(PlayerEvent.ItemCraftedEvent e)
|
|
{
|
|
{
|
|
handleEvent(e.player, "craft", (qd) ->
|
|
handleEvent(e.player, "craft", (qd) ->
|
|
{
|
|
{
|
|
@@ -642,7 +648,7 @@ public class ScriptEvents extends ModuleListener
|
|
}
|
|
}
|
|
|
|
|
|
@SubscribeEvent
|
|
@SubscribeEvent
|
|
- public void QuestDropItem(ItemTossEvent e)
|
|
|
|
|
|
+ public void onItemDrop(ItemTossEvent e)
|
|
{
|
|
{
|
|
handleEvent(e.getPlayer(), "player_toss", (qd) ->
|
|
handleEvent(e.getPlayer(), "player_toss", (qd) ->
|
|
{
|
|
{
|
|
@@ -655,7 +661,7 @@ public class ScriptEvents extends ModuleListener
|
|
}
|
|
}
|
|
|
|
|
|
@SubscribeEvent
|
|
@SubscribeEvent
|
|
- public void QuestPickupItem(EntityItemPickupEvent e)
|
|
|
|
|
|
+ public void onItemPickup(EntityItemPickupEvent e)
|
|
{
|
|
{
|
|
handleEvent(e.getEntityPlayer(), "player_pickup", (qd) ->
|
|
handleEvent(e.getEntityPlayer(), "player_pickup", (qd) ->
|
|
{
|
|
{
|
|
@@ -668,7 +674,7 @@ public class ScriptEvents extends ModuleListener
|
|
}
|
|
}
|
|
|
|
|
|
@SubscribeEvent
|
|
@SubscribeEvent
|
|
- public void VehicleEnterEvent(EntityMountEvent e)
|
|
|
|
|
|
+ public void onVehicleEnter(EntityMountEvent e)
|
|
{
|
|
{
|
|
if(!(e.getEntityMounting() instanceof EntityPlayer))
|
|
if(!(e.getEntityMounting() instanceof EntityPlayer))
|
|
{
|
|
{
|
|
@@ -687,7 +693,7 @@ public class ScriptEvents extends ModuleListener
|
|
}
|
|
}
|
|
|
|
|
|
@SubscribeEvent
|
|
@SubscribeEvent
|
|
- public void PlayerPortalEvent(PlayerEvent.PlayerChangedDimensionEvent e)
|
|
|
|
|
|
+ public void onPlayerUsePortal(PlayerEvent.PlayerChangedDimensionEvent e)
|
|
{
|
|
{
|
|
handleEvent(e.player, "portal", (qd) ->
|
|
handleEvent(e.player, "portal", (qd) ->
|
|
{
|
|
{
|
|
@@ -727,7 +733,7 @@ public class ScriptEvents extends ModuleListener
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
|
|
- public void useEffectEvent(PlayerUsesEffectEvent e)
|
|
|
|
|
|
+ public void onEffectUse(PlayerUsesEffectEvent e)
|
|
{
|
|
{
|
|
handleEvent(e.getPlayer(), "player_use_effect", (qd) ->
|
|
handleEvent(e.getPlayer(), "player_use_effect", (qd) ->
|
|
{
|
|
{
|