Java 类org.bukkit.event.entity.EntityPortalEnterEvent 实例源码

项目:RPGInventory    文件:PetListener.java   
@EventHandler(priority = EventPriority.LOWEST)
public void onWorldChanged(EntityPortalEnterEvent event) {
    if (!(event.getEntity() instanceof Tameable) || !(event.getEntity() instanceof LivingEntity)) {
        return;
    }

    OfflinePlayer player = (OfflinePlayer) ((Tameable) event.getEntity()).getOwner();
    if (!InventoryManager.playerIsLoaded(player)) {
        return;
    }

    PlayerWrapper playerWrapper = InventoryManager.get(player);
    if (event.getEntity() == playerWrapper.getPet()) {
        PetManager.respawnPet(player);
    }
}
项目:CraftBukkit    文件:BlockPortal.java   
public void a(World world, int i, int j, int k, Entity entity) {
    if (entity.vehicle == null && entity.passenger == null) {
        // CraftBukkit start - Entity in portal
        EntityPortalEnterEvent event = new EntityPortalEnterEvent(entity.getBukkitEntity(), new org.bukkit.Location(world.getWorld(), i, j, k));
        world.getServer().getPluginManager().callEvent(event);
        // CraftBukkit end

        entity.ah();
    }
}
项目:CraftBukkit    文件:BlockEnderPortal.java   
public void a(World world, int i, int j, int k, Entity entity) {
    if (entity.vehicle == null && entity.passenger == null && !world.isStatic) {
        // CraftBukkit start - Entity in portal
        EntityPortalEnterEvent event = new EntityPortalEnterEvent(entity.getBukkitEntity(), new org.bukkit.Location(world.getWorld(), i, j, k));
        world.getServer().getPluginManager().callEvent(event);
        // CraftBukkit end
        entity.b(1);
    }
}
项目:AncientGates    文件:PluginPlayerListener.java   
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
public void onEntityPortalEnterEvent(final EntityPortalEnterEvent event) {
    if (event.getEntity() instanceof Player) {
        final Player player = (Player) event.getEntity();

        // Ok so a player enters a portal
        // Immediately record their location
        final Location playerLocation = event.getLocation();
        this.playerLocationAtEvent.put(player, playerLocation);
    }
}
项目:Almura-Server    文件:BlockPortal.java   
public void a(World world, int i, int j, int k, Entity entity) {
    if (entity.vehicle == null && entity.passenger == null) {
        // CraftBukkit start - Entity in portal
        EntityPortalEnterEvent event = new EntityPortalEnterEvent(entity.getBukkitEntity(), new org.bukkit.Location(world.getWorld(), i, j, k));
        world.getServer().getPluginManager().callEvent(event);
        // CraftBukkit end

        entity.ab();
    }
}
项目:Almura-Server    文件:BlockEnderPortal.java   
public void a(World world, int i, int j, int k, Entity entity) {
    if (entity.vehicle == null && entity.passenger == null && !world.isStatic) {
        // CraftBukkit start - Entity in portal
        EntityPortalEnterEvent event = new EntityPortalEnterEvent(entity.getBukkitEntity(), new org.bukkit.Location(world.getWorld(), i, j, k));
        world.getServer().getPluginManager().callEvent(event);
        // CraftBukkit end
        entity.b(1);
    }
}
项目:LoginTeleport    文件:Executor.java   
@EventHandler
public void handle(EntityPortalEnterEvent event) {
    if (!Mgr.INSTANCE.isPortalPortal() || !(event.getEntityType() == EntityType.PLAYER) || portal.containsKey(event.getEntity().getUniqueId())) {
        return;
    }

    portal.put(event.getEntity().getUniqueId(), main.run(80, () -> {
        portal.remove(event.getEntity().getUniqueId());
        portalIfPortal((Player) event.getEntity());
    }));
}
项目:Tweakkit-Server    文件:BlockPortal.java   
public void a(World world, int i, int j, int k, Entity entity) {
    if (entity.vehicle == null && entity.passenger == null) {
        // CraftBukkit start - Entity in portal
        EntityPortalEnterEvent event = new EntityPortalEnterEvent(entity.getBukkitEntity(), new org.bukkit.Location(world.getWorld(), i, j, k));
        world.getServer().getPluginManager().callEvent(event);
        // CraftBukkit end

        entity.ah();
    }
}
项目:Tweakkit-Server    文件:BlockEnderPortal.java   
public void a(World world, int i, int j, int k, Entity entity) {
    if (entity.vehicle == null && entity.passenger == null && !world.isStatic) {
        // CraftBukkit start - Entity in portal
        EntityPortalEnterEvent event = new EntityPortalEnterEvent(entity.getBukkitEntity(), new org.bukkit.Location(world.getWorld(), i, j, k));
        world.getServer().getPluginManager().callEvent(event);
        // CraftBukkit end
        entity.b(1);
    }
}
项目:DDCustomPlugin    文件:SkyBlockPortalReward.java   
@SuppressWarnings("deprecation")
public void EntityPortalEnter(EntityPortalEnterEvent event) {
    if (event.getEntity().getLocation().getWorld().getName().equals("SkyBlock")) {
        if (event.getEntity() instanceof Player && getLowestBlock(event.getLocation().getBlock()).getData() != (byte) 2) {
            getLowestBlock(event.getLocation().getBlock()).setData((byte)2);
            ((Player) event.getEntity()).getInventory().addItem(new ItemStack(Material.NETHERRACK, 20));
            ((Player) event.getEntity()).getInventory().addItem(new ItemStack(Material.NETHER_BRICK, 3));
            ((Player) event.getEntity()).getInventory().addItem(new ItemStack(Material.GLOWSTONE_DUST, 10));
            ((Player) event.getEntity()).getInventory().addItem(new ItemStack(Material.GHAST_TEAR, 1));
            ((Player) event.getEntity()).getInventory().addItem(new ItemStack(Material.SOUL_SAND, 15));
        }
    }
}
项目:Cauldron    文件:BlockPortal.java   
public void onEntityCollidedWithBlock(World p_149670_1_, int p_149670_2_, int p_149670_3_, int p_149670_4_, Entity p_149670_5_)
{
    if (p_149670_5_.ridingEntity == null && p_149670_5_.riddenByEntity == null)
    {
        // CraftBukkit start - Entity in portal
        EntityPortalEnterEvent event = new EntityPortalEnterEvent(p_149670_5_.getBukkitEntity(), new org.bukkit.Location(p_149670_1_.getWorld(), p_149670_2_, p_149670_3_, p_149670_4_));
        p_149670_1_.getServer().getPluginManager().callEvent(event);
        // CraftBukkit end
        p_149670_5_.setInPortal();
    }
}
项目:Cauldron    文件:BlockEndPortal.java   
public void onEntityCollidedWithBlock(World p_149670_1_, int p_149670_2_, int p_149670_3_, int p_149670_4_, Entity p_149670_5_)
{
    if (p_149670_5_.ridingEntity == null && p_149670_5_.riddenByEntity == null && !p_149670_1_.isRemote)
    {
        // CraftBukkit start - Entity in portal
        EntityPortalEnterEvent event = new EntityPortalEnterEvent(p_149670_5_.getBukkitEntity(), new org.bukkit.Location(p_149670_1_.getWorld(), p_149670_2_, p_149670_3_, p_149670_4_));
        p_149670_1_.getServer().getPluginManager().callEvent(event);
        // CraftBukkit end
        p_149670_5_.travelToDimension(1);
    }
}
项目:SpigotSource    文件:BlockPortal.java   
public void a(World world, BlockPosition blockposition, IBlockData iblockdata, Entity entity) {
    if (!entity.isPassenger() && !entity.isVehicle() && entity.aV()) {
        // CraftBukkit start - Entity in portal
        EntityPortalEnterEvent event = new EntityPortalEnterEvent(entity.getBukkitEntity(), new org.bukkit.Location(world.getWorld(), blockposition.getX(), blockposition.getY(), blockposition.getZ()));
        world.getServer().getPluginManager().callEvent(event);
        // CraftBukkit end
        entity.e(blockposition);
    }

}
项目:SpigotSource    文件:BlockEnderPortal.java   
public void a(World world, BlockPosition blockposition, IBlockData iblockdata, Entity entity) {
    if (!entity.isPassenger() && !entity.isVehicle() && entity.aV() && !world.isClientSide && entity.getBoundingBox().b(iblockdata.c(world, blockposition).a(blockposition))) {
        // CraftBukkit start - Entity in portal
        EntityPortalEnterEvent event = new EntityPortalEnterEvent(entity.getBukkitEntity(), new org.bukkit.Location(world.getWorld(), blockposition.getX(), blockposition.getY(), blockposition.getZ()));
        world.getServer().getPluginManager().callEvent(event);
        // CraftBukkit end
        entity.c(1);
    }

}
项目:Craft-city    文件:BlockPortal.java   
public void a(World world, int i, int j, int k, Entity entity) {
    if (entity.vehicle == null && entity.passenger == null) {
        // CraftBukkit start - Entity in portal
        EntityPortalEnterEvent event = new EntityPortalEnterEvent(entity.getBukkitEntity(), new org.bukkit.Location(world.getWorld(), i, j, k));
        world.getServer().getPluginManager().callEvent(event);
        // CraftBukkit end

        entity.Z();
    }
}
项目:Craft-city    文件:BlockEnderPortal.java   
public void a(World world, int i, int j, int k, Entity entity) {
    if (entity.vehicle == null && entity.passenger == null && !world.isStatic) {
        // CraftBukkit start - Entity in portal
        EntityPortalEnterEvent event = new EntityPortalEnterEvent(entity.getBukkitEntity(), new org.bukkit.Location(world.getWorld(), i, j, k));
        world.getServer().getPluginManager().callEvent(event);
        // CraftBukkit end
        entity.c(1);
    }
}
项目:DDCustomPlugin    文件:CustomPlugin.java   
@EventHandler
public void EntityPortalEnter(EntityPortalEnterEvent event) {
    if (sbPortalReward != null)
        sbPortalReward.EntityPortalEnter(event);
}
项目:MagicArenas    文件:ArenaListener.java   
@EventHandler
public void onEntityPortal(EntityPortalEnterEvent event) {
    onEnterPortal(event.getEntity());
}