本文整理汇总了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);
}
}
示例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();
}
}
示例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);
}
}
示例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);
}
}
示例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();
}
}
示例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());
}));
}
示例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));
}
}
}
示例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();
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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();
}
}
示例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);
}
}
示例14: EntityPortalEnter
import org.bukkit.event.entity.EntityPortalEnterEvent; //导入依赖的package包/类
@EventHandler
public void EntityPortalEnter(EntityPortalEnterEvent event) {
if (sbPortalReward != null)
sbPortalReward.EntityPortalEnter(event);
}
示例15: onEntityPortal
import org.bukkit.event.entity.EntityPortalEnterEvent; //导入依赖的package包/类
@EventHandler
public void onEntityPortal(EntityPortalEnterEvent event) {
onEnterPortal(event.getEntity());
}