Java Code Examples for net.minecraft.entity.player.EntityPlayer#isPlayerSleeping()
The following examples show how to use
net.minecraft.entity.player.EntityPlayer#isPlayerSleeping() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CapeHandler.java From Wizardry with GNU Lesser General Public License v3.0 | 6 votes |
@SubscribeEvent public void onPlayerRender(RenderPlayerEvent.Post event) { EntityPlayer player = event.getEntityPlayer(); float delta = event.getPartialRenderTick(); if (ClientConfigValues.renderCape && !player.isInvisible() && !VanishTracker.isVanished(player) && !player.isElytraFlying() && !player.isPlayerSleeping() && delta != 1) { RenderCape cape = getCape(player); if (cape.isPresent(player)) { cape.render( player, player.posX - cape.posX - TileEntityRendererDispatcher.staticPlayerX, player.posY - cape.posY - TileEntityRendererDispatcher.staticPlayerY, player.posZ - cape.posZ - TileEntityRendererDispatcher.staticPlayerZ, delta ); } } }
Example 2
Source File: BlockFuton.java From Sakura_mod with MIT License | 5 votes |
@Nullable private EntityPlayer getPlayerInBlanket(World worldIn, BlockPos pos) { for (EntityPlayer entityplayer : worldIn.playerEntities) { if (entityplayer.isPlayerSleeping() && entityplayer.bedLocation.equals(pos)) { return entityplayer; } } return null; }
Example 3
Source File: BlockSurgeryTable.java From Cyberware with MIT License | 5 votes |
@Nullable private EntityPlayer getPlayerInBed(World worldIn, BlockPos pos) { for (EntityPlayer entityplayer : worldIn.playerEntities) { if (entityplayer.isPlayerSleeping() && entityplayer.playerLocation.equals(pos)) { return entityplayer; } } return null; }
Example 4
Source File: BlockAstroBed.java From AdvancedRocketry with MIT License | 5 votes |
@Nullable private EntityPlayer getPlayerInBed(World worldIn, BlockPos pos) { for (EntityPlayer entityplayer : worldIn.playerEntities) { if (entityplayer.isPlayerSleeping() && entityplayer.bedLocation.equals(pos)) { return entityplayer; } } return null; }