package me.km.snuviscript; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.UUID; import java.util.function.Consumer; import java.util.stream.Collectors; import me.hammerle.code.Code; import me.hammerle.code.Script; import me.hammerle.code.ScriptUtils; import me.hammerle.code.SnuviParser; import me.hammerle.exceptions.SnuviException; import me.km.KajetansMod; import me.km.api.Location; import me.km.api.ModuleListener; import me.km.api.Module; import me.km.api.Utils; import me.km.dimensions.ModDimensions; import me.km.effects.PlayerUsesEffectEvent; import me.km.events.PlayerHurtEvent; import me.km.events.PlayerJoinMessageEvent; import me.km.events.PlayerLeaveMessageEvent; import me.km.events.PlayerMoveEvent; import me.km.events.PlayerRespawnAtEvent; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.passive.EntitySheep; import net.minecraft.entity.passive.EntityVillager; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Items; import net.minecraft.inventory.ClickType; import net.minecraft.item.ItemStack; import net.minecraft.server.management.PlayerList; import net.minecraft.util.EnumHand; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.RayTraceResult; import net.minecraft.world.WorldServer; import net.minecraftforge.event.CommandEvent; import net.minecraftforge.event.entity.EntityMountEvent; import net.minecraftforge.event.entity.ThrowableImpactEvent; import net.minecraftforge.event.entity.item.ItemTossEvent; import net.minecraftforge.event.entity.living.*; import net.minecraftforge.event.entity.player.EntityItemPickupEvent; import net.minecraftforge.event.entity.player.FillBucketEvent; import net.minecraftforge.event.entity.player.ItemFishedEvent; import net.minecraftforge.event.entity.player.PlayerDropsEvent; import net.minecraftforge.event.entity.player.PlayerInteractEvent; import net.minecraftforge.event.world.BlockEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.gameevent.PlayerEvent; public class ScriptEvents extends ModuleListener { private final HashMap questJoin; private final SnuviParser parser; public ScriptEvents(Module m) { super(m); questJoin = new HashMap<>(); parser = KajetansMod.scripts.getSnuviParser(); } // ------------------------------------------------------------------------- // Basics // ------------------------------------------------------------------------- private void handleEvent(EntityPlayer p, String event, Consumer