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

The following are Jave code examples for showing how to use displayGUIChest() 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: Backmemed   File: BlockHopper.java   View Source Code Vote up 6 votes
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, EnumFacing heldItem, float side, float hitX, float hitY)
{
    if (worldIn.isRemote)
    {
        return true;
    }
    else
    {
        TileEntity tileentity = worldIn.getTileEntity(pos);

        if (tileentity instanceof TileEntityHopper)
        {
            playerIn.displayGUIChest((TileEntityHopper)tileentity);
            playerIn.addStat(StatList.HOPPER_INSPECTED);
        }

        return true;
    }
}
 
Example 2
Project: CustomWorldGen   File: BlockBrewingStand.java   View Source Code Vote up 6 votes
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, @Nullable ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ)
{
    if (worldIn.isRemote)
    {
        return true;
    }
    else
    {
        TileEntity tileentity = worldIn.getTileEntity(pos);

        if (tileentity instanceof TileEntityBrewingStand)
        {
            playerIn.displayGUIChest((TileEntityBrewingStand)tileentity);
            playerIn.addStat(StatList.BREWINGSTAND_INTERACTION);
        }

        return true;
    }
}
 
Example 3
Project: CustomWorldGen   File: BlockBeacon.java   View Source Code Vote up 6 votes
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, @Nullable ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ)
{
    if (worldIn.isRemote)
    {
        return true;
    }
    else
    {
        TileEntity tileentity = worldIn.getTileEntity(pos);

        if (tileentity instanceof TileEntityBeacon)
        {
            playerIn.displayGUIChest((TileEntityBeacon)tileentity);
            playerIn.addStat(StatList.BEACON_INTERACTION);
        }

        return true;
    }
}
 
Example 4
Project: BaseClient   File: BlockChest.java   View Source Code Vote up 6 votes
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn,
		EnumFacing side, float hitX, float hitY, float hitZ) {
	if (worldIn.isRemote) {
		return true;
	} else {
		ILockableContainer ilockablecontainer = this.getLockableContainer(worldIn, pos);

		if (ilockablecontainer != null) {
			playerIn.displayGUIChest(ilockablecontainer);

			if (this.chestType == 0) {
				playerIn.triggerAchievement(StatList.field_181723_aa);
			} else if (this.chestType == 1) {
				playerIn.triggerAchievement(StatList.field_181737_U);
			}
		}

		return true;
	}
}
 
Example 5
Project: BaseClient   File: BlockBeacon.java   View Source Code Vote up 6 votes
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ)
{
    if (worldIn.isRemote)
    {
        return true;
    }
    else
    {
        TileEntity tileentity = worldIn.getTileEntity(pos);

        if (tileentity instanceof TileEntityBeacon)
        {
            playerIn.displayGUIChest((TileEntityBeacon)tileentity);
            playerIn.triggerAchievement(StatList.field_181730_N);
        }

        return true;
    }
}
 
Example 6
Project: BaseClient   File: BlockHopper.java   View Source Code Vote up 6 votes
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ)
{
    if (worldIn.isRemote)
    {
        return true;
    }
    else
    {
        TileEntity tileentity = worldIn.getTileEntity(pos);

        if (tileentity instanceof TileEntityHopper)
        {
            playerIn.displayGUIChest((TileEntityHopper)tileentity);
            playerIn.triggerAchievement(StatList.field_181732_P);
        }

        return true;
    }
}
 
Example 7
Project: BaseClient   File: BlockBeacon.java   View Source Code Vote up 6 votes
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ)
{
    if (worldIn.isRemote)
    {
        return true;
    }
    else
    {
        TileEntity tileentity = worldIn.getTileEntity(pos);

        if (tileentity instanceof TileEntityBeacon)
        {
            playerIn.displayGUIChest((TileEntityBeacon)tileentity);
            playerIn.triggerAchievement(StatList.field_181730_N);
        }

        return true;
    }
}
 
Example 8
Project: Backmemed   File: BlockFurnace.java   View Source Code Vote up 6 votes
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, EnumFacing heldItem, float side, float hitX, float hitY)
{
    if (worldIn.isRemote)
    {
        return true;
    }
    else
    {
        TileEntity tileentity = worldIn.getTileEntity(pos);

        if (tileentity instanceof TileEntityFurnace)
        {
            playerIn.displayGUIChest((TileEntityFurnace)tileentity);
            playerIn.addStat(StatList.FURNACE_INTERACTION);
        }

        return true;
    }
}
 
Example 9
Project: CustomWorldGen   File: BlockHopper.java   View Source Code Vote up 6 votes
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, @Nullable ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ)
{
    if (worldIn.isRemote)
    {
        return true;
    }
    else
    {
        TileEntity tileentity = worldIn.getTileEntity(pos);

        if (tileentity instanceof TileEntityHopper)
        {
            playerIn.displayGUIChest((TileEntityHopper)tileentity);
            playerIn.addStat(StatList.HOPPER_INSPECTED);
        }

        return true;
    }
}
 
Example 10
Project: DecompiledMinecraft   File: EntityMinecartContainer.java   View Source Code Vote up 5 votes
/**
 * First layer of player interaction
 */
public boolean interactFirst(EntityPlayer playerIn)
{
    if (!this.worldObj.isRemote)
    {
        playerIn.displayGUIChest(this);
    }

    return true;
}
 
Example 11
Project: BaseClient   File: EntityMinecartContainer.java   View Source Code Vote up 5 votes
/**
 * First layer of player interaction
 */
public boolean interactFirst(EntityPlayer playerIn)
{
    if (!this.worldObj.isRemote)
    {
        playerIn.displayGUIChest(this);
    }

    return true;
}
 
Example 12
Project: DecompiledMinecraft   File: BlockDispenser.java   View Source Code Vote up 5 votes
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ)
{
    if (worldIn.isRemote)
    {
        return true;
    }
    else
    {
        TileEntity tileentity = worldIn.getTileEntity(pos);

        if (tileentity instanceof TileEntityDispenser)
        {
            playerIn.displayGUIChest((TileEntityDispenser)tileentity);

            if (tileentity instanceof TileEntityDropper)
            {
                playerIn.triggerAchievement(StatList.field_181731_O);
            }
            else
            {
                playerIn.triggerAchievement(StatList.field_181733_Q);
            }
        }

        return true;
    }
}
 
Example 13
Project: Backmemed   File: BlockEnderChest.java   View Source Code Vote up 5 votes
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, EnumFacing heldItem, float side, float hitX, float hitY)
{
    InventoryEnderChest inventoryenderchest = playerIn.getInventoryEnderChest();
    TileEntity tileentity = worldIn.getTileEntity(pos);

    if (inventoryenderchest != null && tileentity instanceof TileEntityEnderChest)
    {
        if (worldIn.getBlockState(pos.up()).isNormalCube())
        {
            return true;
        }
        else if (worldIn.isRemote)
        {
            return true;
        }
        else
        {
            inventoryenderchest.setChestTileEntity((TileEntityEnderChest)tileentity);
            playerIn.displayGUIChest(inventoryenderchest);
            playerIn.addStat(StatList.ENDERCHEST_OPENED);
            return true;
        }
    }
    else
    {
        return true;
    }
}
 
Example 14
Project: DecompiledMinecraft   File: BlockChest.java   View Source Code Vote up 5 votes
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ)
{
    if (worldIn.isRemote)
    {
        return true;
    }
    else
    {
        ILockableContainer ilockablecontainer = this.getLockableContainer(worldIn, pos);

        if (ilockablecontainer != null)
        {
            playerIn.displayGUIChest(ilockablecontainer);

            if (this.chestType == 0)
            {
                playerIn.triggerAchievement(StatList.field_181723_aa);
            }
            else if (this.chestType == 1)
            {
                playerIn.triggerAchievement(StatList.field_181737_U);
            }
        }

        return true;
    }
}
 
Example 15
Project: Backmemed   File: EntityMinecartHopper.java   View Source Code Vote up 5 votes
public boolean processInitialInteract(EntityPlayer player, EnumHand stack)
{
    if (!this.world.isRemote)
    {
        player.displayGUIChest(this);
    }

    return true;
}
 
Example 16
Project: DecompiledMinecraft   File: EntityMinecartContainer.java   View Source Code Vote up 5 votes
/**
 * First layer of player interaction
 */
public boolean interactFirst(EntityPlayer playerIn)
{
    if (!this.worldObj.isRemote)
    {
        playerIn.displayGUIChest(this);
    }

    return true;
}
 
Example 17
Project: DecompiledMinecraft   File: BlockDispenser.java   View Source Code Vote up 5 votes
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ)
{
    if (worldIn.isRemote)
    {
        return true;
    }
    else
    {
        TileEntity tileentity = worldIn.getTileEntity(pos);

        if (tileentity instanceof TileEntityDispenser)
        {
            playerIn.displayGUIChest((TileEntityDispenser)tileentity);

            if (tileentity instanceof TileEntityDropper)
            {
                playerIn.triggerAchievement(StatList.field_181731_O);
            }
            else
            {
                playerIn.triggerAchievement(StatList.field_181733_Q);
            }
        }

        return true;
    }
}
 
Example 18
Project: CustomWorldGen   File: EntityMinecartHopper.java   View Source Code Vote up 5 votes
public boolean processInitialInteract(EntityPlayer player, @Nullable ItemStack stack, EnumHand hand)
{
    if(net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.minecart.MinecartInteractEvent(this, player, stack, hand))) return true;
    if (!this.worldObj.isRemote)
    {
        player.displayGUIChest(this);
    }

    return true;
}
 
Example 19
Project: DecompiledMinecraft   File: BlockEnderChest.java   View Source Code Vote up 5 votes
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ)
{
    InventoryEnderChest inventoryenderchest = playerIn.getInventoryEnderChest();
    TileEntity tileentity = worldIn.getTileEntity(pos);

    if (inventoryenderchest != null && tileentity instanceof TileEntityEnderChest)
    {
        if (worldIn.getBlockState(pos.up()).getBlock().isNormalCube())
        {
            return true;
        }
        else if (worldIn.isRemote)
        {
            return true;
        }
        else
        {
            inventoryenderchest.setChestTileEntity((TileEntityEnderChest)tileentity);
            playerIn.displayGUIChest(inventoryenderchest);
            playerIn.triggerAchievement(StatList.field_181738_V);
            return true;
        }
    }
    else
    {
        return true;
    }
}
 
Example 20
Project: BaseClient   File: BlockEnderChest.java   View Source Code Vote up 5 votes
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ)
{
    InventoryEnderChest inventoryenderchest = playerIn.getInventoryEnderChest();
    TileEntity tileentity = worldIn.getTileEntity(pos);

    if (inventoryenderchest != null && tileentity instanceof TileEntityEnderChest)
    {
        if (worldIn.getBlockState(pos.up()).getBlock().isNormalCube())
        {
            return true;
        }
        else if (worldIn.isRemote)
        {
            return true;
        }
        else
        {
            inventoryenderchest.setChestTileEntity((TileEntityEnderChest)tileentity);
            playerIn.displayGUIChest(inventoryenderchest);
            playerIn.triggerAchievement(StatList.field_181738_V);
            return true;
        }
    }
    else
    {
        return true;
    }
}