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


Java PlayerBedLeaveEvent类代码示例

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


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

示例1: CheckBedLeave

import org.bukkit.event.player.PlayerBedLeaveEvent; //导入依赖的package包/类
@EventHandler
public void CheckBedLeave(PlayerBedLeaveEvent event) {
    if (!this.getJanitor().isEnabled()) {
        return;
    }
    Player player = event.getPlayer();
    Location pLoc = player.getLocation();
    int x = pLoc.getBlockX() - 10;
    while (x < pLoc.getBlockX() + 10) {
        int y = pLoc.getBlockY() - 10;
        while (y < pLoc.getBlockY() + 10) {
            int z = pLoc.getBlockZ() - 10;
            while (z < pLoc.getBlockZ() + 10) {
                Block b = new Location(pLoc.getWorld(), (double)x, (double)y, (double)z).getBlock();
                if (b.getType().equals((Object)Material.BED) || b.getType().equals((Object)Material.BED_BLOCK)) {
                    return;
                }
                ++z;
            }
            ++y;
        }
        ++x;
    }
    this.getJanitor().logCheat(this, player, null, new String[0]);
}
 
开发者ID:cumpe,项目名称:Janitor,代码行数:26,代码来源:BedLeave.java

示例2: onBedLeave

import org.bukkit.event.player.PlayerBedLeaveEvent; //导入依赖的package包/类
@SuppressWarnings("deprecation")
@EventHandler
public void onBedLeave(PlayerBedLeaveEvent e)
{
   	Bukkit.getConsoleSender().sendMessage("GOT IT LEAVE BED");
	/*
	long time = e.getBed().getWorld().getTime();
	if(time % 24000 == 0)
	{
		Player player = e.getPlayer();
		fatigue.getScore(player).setScore(0);
	}*/
}
 
开发者ID:FattyMieo,项目名称:SurvivalPlus,代码行数:14,代码来源:BedFatigue.java

示例3: onBedLeave

import org.bukkit.event.player.PlayerBedLeaveEvent; //导入依赖的package包/类
@SuppressWarnings("deprecation")
@EventHandler
public void onBedLeave(PlayerBedLeaveEvent e)
{
	long time = e.getBed().getWorld().getTime();
	if(time % 24000 == 0)
	{
		Player player = e.getPlayer();
		fatigue.getScore(player).setScore(0);
	}
}
 
开发者ID:FattyMieo,项目名称:SurvivalPlus,代码行数:12,代码来源:BedFatigue.java

示例4: leaveSleep

import org.bukkit.event.player.PlayerBedLeaveEvent; //导入依赖的package包/类
@EventHandler
public void leaveSleep(PlayerBedLeaveEvent e){
	if(rs.getPlayerData(e.getPlayer())==null)return;
	PlayerData pd=rs.getPlayerData(e.getPlayer());
	pd.setSleep(false,1);
	return;
}
 
开发者ID:SchoolUniform,项目名称:RealSurvival,代码行数:8,代码来源:SleepEvent.java

示例5: onBedExit

import org.bukkit.event.player.PlayerBedLeaveEvent; //导入依赖的package包/类
@SuppressWarnings("unused")
@EventHandler
public void onBedExit(PlayerBedLeaveEvent evt) {
    updateBeds();
}
 
开发者ID:Kneesnap,项目名称:Kineticraft,代码行数:6,代码来源:SleepMechanics.java

示例6: onPlayerLeaveBed

import org.bukkit.event.player.PlayerBedLeaveEvent; //导入依赖的package包/类
@EventHandler(priority = EventPriority.NORMAL)
public void onPlayerLeaveBed(PlayerBedLeaveEvent event) {
	_moon.initializeTimer();
}
 
开发者ID:Allov,项目名称:world-of-icerealm,代码行数:5,代码来源:MonsterSpawnListener.java

示例7: onExitingBed

import org.bukkit.event.player.PlayerBedLeaveEvent; //导入依赖的package包/类
@HookHandler(priority = Priority.CRITICAL)
public void onExitingBed(final BedExitHook hook) {
    server.getPluginManager().callEvent(
            new PlayerBedLeaveEvent(new CanaryPlayer(hook.getPlayer()), new CanaryBlock(hook.getBed())));
}
 
开发者ID:CanaryBukkitTeam,项目名称:CanaryBukkit,代码行数:6,代码来源:CanaryPlayerListener.java

示例8: a

import org.bukkit.event.player.PlayerBedLeaveEvent; //导入依赖的package包/类
public void a(boolean flag, boolean flag1, boolean flag2) {
    this.a(0.6F, 1.8F);
    this.e_();
    ChunkCoordinates chunkcoordinates = this.bB;
    ChunkCoordinates chunkcoordinates1 = this.bB;

    if (chunkcoordinates != null && this.world.getType(chunkcoordinates.x, chunkcoordinates.y, chunkcoordinates.z) == Blocks.BED) {
        BlockBed.a(this.world, chunkcoordinates.x, chunkcoordinates.y, chunkcoordinates.z, false);
        chunkcoordinates1 = BlockBed.a(this.world, chunkcoordinates.x, chunkcoordinates.y, chunkcoordinates.z, 0);
        if (chunkcoordinates1 == null) {
            chunkcoordinates1 = new ChunkCoordinates(chunkcoordinates.x, chunkcoordinates.y + 1, chunkcoordinates.z);
        }

        this.setPosition((double) ((float) chunkcoordinates1.x + 0.5F), (double) ((float) chunkcoordinates1.y + this.height + 0.1F), (double) ((float) chunkcoordinates1.z + 0.5F));
    }

    this.sleeping = false;
    if (!this.world.isStatic && flag1) {
        this.world.everyoneSleeping();
    }

    // CraftBukkit start - fire PlayerBedLeaveEvent
    if (this.getBukkitEntity() instanceof Player) {
        Player player = (Player) this.getBukkitEntity();

        org.bukkit.block.Block bed;
        if (chunkcoordinates != null) {
            bed = this.world.getWorld().getBlockAt(chunkcoordinates.x, chunkcoordinates.y, chunkcoordinates.z);
        } else {
            bed = this.world.getWorld().getBlockAt(player.getLocation());
        }

        PlayerBedLeaveEvent event = new PlayerBedLeaveEvent(player, bed);
        this.world.getServer().getPluginManager().callEvent(event);
    }
    // CraftBukkit end

    if (flag) {
        this.sleepTicks = 0;
    } else {
        this.sleepTicks = 100;
    }

    if (flag2) {
        this.setRespawnPosition(this.bB, false);
    }
}
 
开发者ID:OvercastNetwork,项目名称:CraftBukkit,代码行数:48,代码来源:EntityHuman.java

示例9: a

import org.bukkit.event.player.PlayerBedLeaveEvent; //导入依赖的package包/类
public void a(boolean flag, boolean flag1, boolean flag2) {
    this.a(0.6F, 1.8F);
    this.d_();
    ChunkCoordinates chunkcoordinates = this.bD;
    ChunkCoordinates chunkcoordinates1 = this.bD;

    if (chunkcoordinates != null && this.world.getTypeId(chunkcoordinates.x, chunkcoordinates.y, chunkcoordinates.z) == Block.BED.id) {
        BlockBed.a(this.world, chunkcoordinates.x, chunkcoordinates.y, chunkcoordinates.z, false);
        chunkcoordinates1 = BlockBed.b(this.world, chunkcoordinates.x, chunkcoordinates.y, chunkcoordinates.z, 0);
        if (chunkcoordinates1 == null) {
            chunkcoordinates1 = new ChunkCoordinates(chunkcoordinates.x, chunkcoordinates.y + 1, chunkcoordinates.z);
        }

        this.setPosition((double) ((float) chunkcoordinates1.x + 0.5F), (double) ((float) chunkcoordinates1.y + this.height + 0.1F), (double) ((float) chunkcoordinates1.z + 0.5F));
    }

    this.sleeping = false;
    if (!this.world.isStatic && flag1) {
        this.world.everyoneSleeping();
    }

    // CraftBukkit start
    if (this.getBukkitEntity() instanceof Player) {
        Player player = (Player) this.getBukkitEntity();

        org.bukkit.block.Block bed;
        if (chunkcoordinates != null) {
            bed = this.world.getWorld().getBlockAt(chunkcoordinates.x, chunkcoordinates.y, chunkcoordinates.z);
        } else {
            bed = this.world.getWorld().getBlockAt(player.getLocation());
        }

        PlayerBedLeaveEvent event = new PlayerBedLeaveEvent(player, bed);
        this.world.getServer().getPluginManager().callEvent(event);
    }
    // CraftBukkit end

    if (flag) {
        this.sleepTicks = 0;
    } else {
        this.sleepTicks = 100;
    }

    if (flag2) {
        this.setRespawnPosition(this.bD, false);
    }
}
 
开发者ID:AlmuraDev,项目名称:Almura-Server,代码行数:48,代码来源:EntityHuman.java

示例10: wakeUpPlayer

import org.bukkit.event.player.PlayerBedLeaveEvent; //导入依赖的package包/类
public void wakeUpPlayer(boolean p_70999_1_, boolean p_70999_2_, boolean p_70999_3_)
{
    this.setSize(0.6F, 1.8F);
    this.resetHeight();
    ChunkCoordinates chunkcoordinates = this.playerLocation;
    ChunkCoordinates chunkcoordinates1 = this.playerLocation;
    Block block = (chunkcoordinates == null ? null : worldObj.getBlock(chunkcoordinates.posX, chunkcoordinates.posY, chunkcoordinates.posZ));

    if (chunkcoordinates != null && block.isBed(worldObj, chunkcoordinates.posX, chunkcoordinates.posY, chunkcoordinates.posZ, this))
    {
        block.setBedOccupied(this.worldObj, chunkcoordinates.posX, chunkcoordinates.posY, chunkcoordinates.posZ, this, false);
        chunkcoordinates1 = block.getBedSpawnPosition(this.worldObj, chunkcoordinates.posX, chunkcoordinates.posY, chunkcoordinates.posZ, this);

        if (chunkcoordinates1 == null)
        {
            chunkcoordinates1 = new ChunkCoordinates(chunkcoordinates.posX, chunkcoordinates.posY + 1, chunkcoordinates.posZ);
        }

        this.setPosition((double)((float)chunkcoordinates1.posX + 0.5F), (double)((float)chunkcoordinates1.posY + this.yOffset + 0.1F), (double)((float)chunkcoordinates1.posZ + 0.5F));
    }

    this.sleeping = false;

    if (!this.worldObj.isRemote && p_70999_2_)
    {
        this.worldObj.updateAllPlayersSleepingFlag();
    }

    // CraftBukkit start
    if (this.getBukkitEntity() instanceof Player)
    {
        Player player = (Player) this.getBukkitEntity();
        org.bukkit.block.Block bed;

        if (chunkcoordinates != null)
        {
            bed = this.worldObj.getWorld().getBlockAt(chunkcoordinates.posX, chunkcoordinates.posY, chunkcoordinates.posZ);
        }
        else
        {
            bed = this.worldObj.getWorld().getBlockAt(player.getLocation());
        }

        PlayerBedLeaveEvent event = new PlayerBedLeaveEvent(player, bed);
        this.worldObj.getServer().getPluginManager().callEvent(event);
    }

    // CraftBukkit end

    if (p_70999_1_)
    {
        this.sleepTimer = 0;
    }
    else
    {
        this.sleepTimer = 100;
    }

    if (p_70999_3_)
    {
        this.setSpawnChunk(this.playerLocation, false);
    }
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:64,代码来源:EntityPlayer.java

示例11: onBedLeave

import org.bukkit.event.player.PlayerBedLeaveEvent; //导入依赖的package包/类
@EventHandler
public void onBedLeave(final PlayerBedLeaveEvent event) {
	if (!event.getBed().getWorld().getEnvironment().equals(Environment.NORMAL)) { return; }

	this.sleepingPlayers.remove(event.getPlayer().getUniqueId());
}
 
开发者ID:Craftolution,项目名称:CraftoPlugin,代码行数:7,代码来源:BedComponent.java

示例12: a

import org.bukkit.event.player.PlayerBedLeaveEvent; //导入依赖的package包/类
public void a(boolean flag, boolean flag1, boolean flag2) {
    this.a(0.6F, 1.8F);
    this.e_();
    ChunkCoordinates chunkcoordinates = this.cb;
    ChunkCoordinates chunkcoordinates1 = this.cb;

    if (chunkcoordinates != null && this.world.getTypeId(chunkcoordinates.x, chunkcoordinates.y, chunkcoordinates.z) == Block.BED.id) {
        BlockBed.a(this.world, chunkcoordinates.x, chunkcoordinates.y, chunkcoordinates.z, false);
        chunkcoordinates1 = BlockBed.b(this.world, chunkcoordinates.x, chunkcoordinates.y, chunkcoordinates.z, 0);
        if (chunkcoordinates1 == null) {
            chunkcoordinates1 = new ChunkCoordinates(chunkcoordinates.x, chunkcoordinates.y + 1, chunkcoordinates.z);
        }

        this.setPosition((double) ((float) chunkcoordinates1.x + 0.5F), (double) ((float) chunkcoordinates1.y + this.height + 0.1F), (double) ((float) chunkcoordinates1.z + 0.5F));
    }

    this.sleeping = false;
    if (!this.world.isStatic && flag1) {
        this.world.everyoneSleeping();
    }

    // CraftBukkit start
    if (this.getBukkitEntity() instanceof Player) {
        Player player = (Player) this.getBukkitEntity();

        org.bukkit.block.Block bed;
        if (chunkcoordinates != null) {
            bed = this.world.getWorld().getBlockAt(chunkcoordinates.x, chunkcoordinates.y, chunkcoordinates.z);
        } else {
            bed = this.world.getWorld().getBlockAt(player.getLocation());
        }

        PlayerBedLeaveEvent event = new PlayerBedLeaveEvent(player, bed);
        this.world.getServer().getPluginManager().callEvent(event);
    }
    // CraftBukkit end

    if (flag) {
        this.sleepTicks = 0;
    } else {
        this.sleepTicks = 100;
    }

    if (flag2) {
        this.setRespawnPosition(this.cb, false);
    }
}
 
开发者ID:didoupimpon,项目名称:Craft-city,代码行数:48,代码来源:EntityHuman.java


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