Java Code Examples for net.minecraft.entity.player.EntityPlayer.wakeUpPlayer()

The following are Jave code examples for showing how to use wakeUpPlayer() of the net.minecraft.entity.player.EntityPlayer class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: BaseClient   File: NetHandlerPlayClient.java   View Source Code Vote up 6 votes
/**
 * Renders a specified animation: Waking up a player, a living entity swinging
 * its currently held item, being hurt or receiving a critical hit by normal or
 * magical means
 */
public void handleAnimation(S0BPacketAnimation packetIn) {
	PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
	Entity entity = this.clientWorldController.getEntityByID(packetIn.getEntityID());

	if (entity != null) {
		if (packetIn.getAnimationType() == 0) {
			EntityLivingBase entitylivingbase = (EntityLivingBase) entity;
			entitylivingbase.swingItem();
		} else if (packetIn.getAnimationType() == 1) {
			entity.performHurtAnimation();
		} else if (packetIn.getAnimationType() == 2) {
			EntityPlayer entityplayer = (EntityPlayer) entity;
			entityplayer.wakeUpPlayer(false, false, false);
		} else if (packetIn.getAnimationType() == 4) {
			this.gameController.effectRenderer.emitParticleAtEntity(entity, EnumParticleTypes.CRIT);
		} else if (packetIn.getAnimationType() == 5) {
			this.gameController.effectRenderer.emitParticleAtEntity(entity, EnumParticleTypes.CRIT_MAGIC);
		}
	}
}
 
Example 2
Project: Backmemed   File: WorldServer.java   View Source Code Vote up 6 votes
protected void wakeAllPlayers()
{
    this.allPlayersSleeping = false;

    for (EntityPlayer entityplayer : this.playerEntities)
    {
        if (entityplayer.isPlayerSleeping())
        {
            entityplayer.wakeUpPlayer(false, false, true);
        }
    }

    if (this.getGameRules().getBoolean("doWeatherCycle"))
    {
        this.resetRainAndThunder();
    }
}
 
Example 3
Project: DecompiledMinecraft   File: WorldServer.java   View Source Code Vote up 5 votes
protected void wakeAllPlayers()
{
    this.allPlayersSleeping = false;

    for (EntityPlayer entityplayer : this.playerEntities)
    {
        if (entityplayer.isPlayerSleeping())
        {
            entityplayer.wakeUpPlayer(false, false, true);
        }
    }

    this.resetRainAndThunder();
}
 
Example 4
Project: DecompiledMinecraft   File: WorldServer.java   View Source Code Vote up 5 votes
protected void wakeAllPlayers()
{
    this.allPlayersSleeping = false;

    for (EntityPlayer entityplayer : this.playerEntities)
    {
        if (entityplayer.isPlayerSleeping())
        {
            entityplayer.wakeUpPlayer(false, false, true);
        }
    }

    this.resetRainAndThunder();
}
 
Example 5
Project: DecompiledMinecraft   File: NetHandlerPlayClient.java   View Source Code Vote up 5 votes
/**
 * Renders a specified animation: Waking up a player, a living entity swinging its currently held item, being hurt
 * or receiving a critical hit by normal or magical means
 */
public void handleAnimation(S0BPacketAnimation packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
    Entity entity = this.clientWorldController.getEntityByID(packetIn.getEntityID());

    if (entity != null)
    {
        if (packetIn.getAnimationType() == 0)
        {
            EntityLivingBase entitylivingbase = (EntityLivingBase)entity;
            entitylivingbase.swingItem();
        }
        else if (packetIn.getAnimationType() == 1)
        {
            entity.performHurtAnimation();
        }
        else if (packetIn.getAnimationType() == 2)
        {
            EntityPlayer entityplayer = (EntityPlayer)entity;
            entityplayer.wakeUpPlayer(false, false, false);
        }
        else if (packetIn.getAnimationType() == 4)
        {
            this.gameController.effectRenderer.emitParticleAtEntity(entity, EnumParticleTypes.CRIT);
        }
        else if (packetIn.getAnimationType() == 5)
        {
            this.gameController.effectRenderer.emitParticleAtEntity(entity, EnumParticleTypes.CRIT_MAGIC);
        }
    }
}
 
Example 6
Project: BaseClient   File: WorldServer.java   View Source Code Vote up 5 votes
protected void wakeAllPlayers()
{
    this.allPlayersSleeping = false;

    for (EntityPlayer entityplayer : this.playerEntities)
    {
        if (entityplayer.isPlayerSleeping())
        {
            entityplayer.wakeUpPlayer(false, false, true);
        }
    }

    this.resetRainAndThunder();
}
 
Example 7
Project: BaseClient   File: NetHandlerPlayClient.java   View Source Code Vote up 5 votes
/**
 * Renders a specified animation: Waking up a player, a living entity swinging its currently held item, being hurt
 * or receiving a critical hit by normal or magical means
 */
public void handleAnimation(S0BPacketAnimation packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
    Entity entity = this.clientWorldController.getEntityByID(packetIn.getEntityID());

    if (entity != null)
    {
        if (packetIn.getAnimationType() == 0)
        {
            EntityLivingBase entitylivingbase = (EntityLivingBase)entity;
            entitylivingbase.swingItem();
        }
        else if (packetIn.getAnimationType() == 1)
        {
            entity.performHurtAnimation();
        }
        else if (packetIn.getAnimationType() == 2)
        {
            EntityPlayer entityplayer = (EntityPlayer)entity;
            entityplayer.wakeUpPlayer(false, false, false);
        }
        else if (packetIn.getAnimationType() == 4)
        {
            this.gameController.effectRenderer.emitParticleAtEntity(entity, EnumParticleTypes.CRIT);
        }
        else if (packetIn.getAnimationType() == 5)
        {
            this.gameController.effectRenderer.emitParticleAtEntity(entity, EnumParticleTypes.CRIT_MAGIC);
        }
    }
}
 
Example 8
Project: BaseClient   File: WorldServer.java   View Source Code Vote up 5 votes
protected void wakeAllPlayers()
{
    this.allPlayersSleeping = false;

    for (EntityPlayer entityplayer : this.playerEntities)
    {
        if (entityplayer.isPlayerSleeping())
        {
            entityplayer.wakeUpPlayer(false, false, true);
        }
    }

    this.resetRainAndThunder();
}
 
Example 9
Project: Zombe-Modpack   File: NetHandlerPlayClient.java   View Source Code Vote up 5 votes
/**
 * Renders a specified animation: Waking up a player, a living entity swinging its currently held item, being hurt
 * or receiving a critical hit by normal or magical means
 */
public void handleAnimation(SPacketAnimation packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
    Entity entity = this.clientWorldController.getEntityByID(packetIn.getEntityID());

    if (entity != null)
    {
        if (packetIn.getAnimationType() == 0)
        {
            EntityLivingBase entitylivingbase = (EntityLivingBase)entity;
            entitylivingbase.swingArm(EnumHand.MAIN_HAND);
        }
        else if (packetIn.getAnimationType() == 3)
        {
            EntityLivingBase entitylivingbase1 = (EntityLivingBase)entity;
            entitylivingbase1.swingArm(EnumHand.OFF_HAND);
        }
        else if (packetIn.getAnimationType() == 1)
        {
            entity.performHurtAnimation();
        }
        else if (packetIn.getAnimationType() == 2)
        {
            EntityPlayer entityplayer = (EntityPlayer)entity;
            entityplayer.wakeUpPlayer(false, false, false);
        }
        else if (packetIn.getAnimationType() == 4)
        {
            this.gameController.effectRenderer.emitParticleAtEntity(entity, EnumParticleTypes.CRIT);
        }
        else if (packetIn.getAnimationType() == 5)
        {
            this.gameController.effectRenderer.emitParticleAtEntity(entity, EnumParticleTypes.CRIT_MAGIC);
        }
    }
}
 
Example 10
Project: Backmemed   File: NetHandlerPlayClient.java   View Source Code Vote up 5 votes
/**
 * Renders a specified animation: Waking up a player, a living entity swinging its currently held item, being hurt
 * or receiving a critical hit by normal or magical means
 */
public void handleAnimation(SPacketAnimation packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
    Entity entity = this.clientWorldController.getEntityByID(packetIn.getEntityID());

    if (entity != null)
    {
        if (packetIn.getAnimationType() == 0)
        {
            EntityLivingBase entitylivingbase = (EntityLivingBase)entity;
            entitylivingbase.swingArm(EnumHand.MAIN_HAND);
        }
        else if (packetIn.getAnimationType() == 3)
        {
            EntityLivingBase entitylivingbase1 = (EntityLivingBase)entity;
            entitylivingbase1.swingArm(EnumHand.OFF_HAND);
        }
        else if (packetIn.getAnimationType() == 1)
        {
            entity.performHurtAnimation();
        }
        else if (packetIn.getAnimationType() == 2)
        {
            EntityPlayer entityplayer = (EntityPlayer)entity;
            entityplayer.wakeUpPlayer(false, false, false);
        }
        else if (packetIn.getAnimationType() == 4)
        {
            this.gameController.effectRenderer.emitParticleAtEntity(entity, EnumParticleTypes.CRIT);
        }
        else if (packetIn.getAnimationType() == 5)
        {
            this.gameController.effectRenderer.emitParticleAtEntity(entity, EnumParticleTypes.CRIT_MAGIC);
        }
    }
}
 
Example 11
Project: CustomWorldGen   File: WorldServer.java   View Source Code Vote up 5 votes
protected void wakeAllPlayers()
{
    this.allPlayersSleeping = false;

    for (EntityPlayer entityplayer : this.playerEntities)
    {
        if (entityplayer.isPlayerSleeping())
        {
            entityplayer.wakeUpPlayer(false, false, true);
        }
    }

    this.resetRainAndThunder();
}
 
Example 12
Project: CustomWorldGen   File: NetHandlerPlayClient.java   View Source Code Vote up 5 votes
/**
 * Renders a specified animation: Waking up a player, a living entity swinging its currently held item, being hurt
 * or receiving a critical hit by normal or magical means
 */
public void handleAnimation(SPacketAnimation packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
    Entity entity = this.clientWorldController.getEntityByID(packetIn.getEntityID());

    if (entity != null)
    {
        if (packetIn.getAnimationType() == 0)
        {
            EntityLivingBase entitylivingbase = (EntityLivingBase)entity;
            entitylivingbase.swingArm(EnumHand.MAIN_HAND);
        }
        else if (packetIn.getAnimationType() == 3)
        {
            EntityLivingBase entitylivingbase1 = (EntityLivingBase)entity;
            entitylivingbase1.swingArm(EnumHand.OFF_HAND);
        }
        else if (packetIn.getAnimationType() == 1)
        {
            entity.performHurtAnimation();
        }
        else if (packetIn.getAnimationType() == 2)
        {
            EntityPlayer entityplayer = (EntityPlayer)entity;
            entityplayer.wakeUpPlayer(false, false, false);
        }
        else if (packetIn.getAnimationType() == 4)
        {
            this.gameController.effectRenderer.emitParticleAtEntity(entity, EnumParticleTypes.CRIT);
        }
        else if (packetIn.getAnimationType() == 5)
        {
            this.gameController.effectRenderer.emitParticleAtEntity(entity, EnumParticleTypes.CRIT_MAGIC);
        }
    }
}