当前位置: 首页>>代码示例>>Java>>正文


Java EntityPortalEnterEvent类代码示例

本文整理汇总了Java中org.bukkit.event.entity.EntityPortalEnterEvent的典型用法代码示例。如果您正苦于以下问题:Java EntityPortalEnterEvent类的具体用法?Java EntityPortalEnterEvent怎么用?Java EntityPortalEnterEvent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


EntityPortalEnterEvent类属于org.bukkit.event.entity包,在下文中一共展示了EntityPortalEnterEvent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onWorldChanged

import org.bukkit.event.entity.EntityPortalEnterEvent; //导入依赖的package包/类
@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);
    }
}
 
开发者ID:EndlessCodeGroup,项目名称:RPGInventory,代码行数:17,代码来源:PetListener.java

示例2: a

import org.bukkit.event.entity.EntityPortalEnterEvent; //导入依赖的package包/类
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();
    }
}
 
开发者ID:OvercastNetwork,项目名称:CraftBukkit,代码行数:11,代码来源:BlockPortal.java

示例3: a

import org.bukkit.event.entity.EntityPortalEnterEvent; //导入依赖的package包/类
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);
    }
}
 
开发者ID:OvercastNetwork,项目名称:CraftBukkit,代码行数:10,代码来源:BlockEnderPortal.java

示例4: onEntityPortalEnterEvent

import org.bukkit.event.entity.EntityPortalEnterEvent; //导入依赖的package包/类
@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);
	}
}
 
开发者ID:NoChanceSD,项目名称:AncientGates,代码行数:12,代码来源:PluginPlayerListener.java

示例5: a

import org.bukkit.event.entity.EntityPortalEnterEvent; //导入依赖的package包/类
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();
    }
}
 
开发者ID:AlmuraDev,项目名称:Almura-Server,代码行数:11,代码来源:BlockPortal.java

示例6: handle

import org.bukkit.event.entity.EntityPortalEnterEvent; //导入依赖的package包/类
@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());
    }));
}
 
开发者ID:caoli5288,项目名称:LoginTeleport,代码行数:12,代码来源:Executor.java

示例7: EntityPortalEnter

import org.bukkit.event.entity.EntityPortalEnterEvent; //导入依赖的package包/类
@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));
		}
	}
}
 
开发者ID:Esaych,项目名称:DDCustomPlugin,代码行数:14,代码来源:SkyBlockPortalReward.java

示例8: onEntityCollidedWithBlock

import org.bukkit.event.entity.EntityPortalEnterEvent; //导入依赖的package包/类
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();
    }
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:12,代码来源:BlockPortal.java

示例9: onEntityCollidedWithBlock

import org.bukkit.event.entity.EntityPortalEnterEvent; //导入依赖的package包/类
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);
    }
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:12,代码来源:BlockEndPortal.java

示例10: a

import org.bukkit.event.entity.EntityPortalEnterEvent; //导入依赖的package包/类
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);
    }

}
 
开发者ID:bergerkiller,项目名称:SpigotSource,代码行数:11,代码来源:BlockPortal.java

示例11: a

import org.bukkit.event.entity.EntityPortalEnterEvent; //导入依赖的package包/类
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);
    }

}
 
开发者ID:bergerkiller,项目名称:SpigotSource,代码行数:11,代码来源:BlockEnderPortal.java

示例12: a

import org.bukkit.event.entity.EntityPortalEnterEvent; //导入依赖的package包/类
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();
    }
}
 
开发者ID:didoupimpon,项目名称:Craft-city,代码行数:11,代码来源:BlockPortal.java

示例13: a

import org.bukkit.event.entity.EntityPortalEnterEvent; //导入依赖的package包/类
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);
    }
}
 
开发者ID:didoupimpon,项目名称:Craft-city,代码行数:10,代码来源:BlockEnderPortal.java

示例14: EntityPortalEnter

import org.bukkit.event.entity.EntityPortalEnterEvent; //导入依赖的package包/类
@EventHandler
public void EntityPortalEnter(EntityPortalEnterEvent event) {
	if (sbPortalReward != null)
		sbPortalReward.EntityPortalEnter(event);
}
 
开发者ID:Esaych,项目名称:DDCustomPlugin,代码行数:6,代码来源:CustomPlugin.java

示例15: onEntityPortal

import org.bukkit.event.entity.EntityPortalEnterEvent; //导入依赖的package包/类
@EventHandler
public void onEntityPortal(EntityPortalEnterEvent event) {
    onEnterPortal(event.getEntity());
}
 
开发者ID:elBukkit,项目名称:MagicArenas,代码行数:5,代码来源:ArenaListener.java


注:本文中的org.bukkit.event.entity.EntityPortalEnterEvent类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。