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


Java World.playRecord方法代码示例

本文整理汇总了Java中net.minecraft.world.World.playRecord方法的典型用法代码示例。如果您正苦于以下问题:Java World.playRecord方法的具体用法?Java World.playRecord怎么用?Java World.playRecord使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraft.world.World的用法示例。


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

示例1: dropRecord

import net.minecraft.world.World; //导入方法依赖的package包/类
private void dropRecord(World worldIn, BlockPos pos, IBlockState state)
{
    if (!worldIn.isRemote)
    {
        TileEntity tileentity = worldIn.getTileEntity(pos);

        if (tileentity instanceof BlockJukebox.TileEntityJukebox)
        {
            BlockJukebox.TileEntityJukebox blockjukebox$tileentityjukebox = (BlockJukebox.TileEntityJukebox)tileentity;
            ItemStack itemstack = blockjukebox$tileentityjukebox.getRecord();

            if (itemstack != null)
            {
                worldIn.playAuxSFX(1005, pos, 0);
                worldIn.playRecord(pos, (String)null);
                blockjukebox$tileentityjukebox.setRecord((ItemStack)null);
                float f = 0.7F;
                double d0 = (double)(worldIn.rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D;
                double d1 = (double)(worldIn.rand.nextFloat() * f) + (double)(1.0F - f) * 0.2D + 0.6D;
                double d2 = (double)(worldIn.rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D;
                ItemStack itemstack1 = itemstack.copy();
                EntityItem entityitem = new EntityItem(worldIn, (double)pos.getX() + d0, (double)pos.getY() + d1, (double)pos.getZ() + d2, itemstack1);
                entityitem.setDefaultPickupDelay();
                worldIn.spawnEntityInWorld(entityitem);
            }
        }
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:29,代码来源:BlockJukebox.java

示例2: dropRecord

import net.minecraft.world.World; //导入方法依赖的package包/类
private void dropRecord(World worldIn, BlockPos pos, IBlockState state)
{
    if (!worldIn.isRemote)
    {
        TileEntity tileentity = worldIn.getTileEntity(pos);

        if (tileentity instanceof BlockJukebox.TileEntityJukebox)
        {
            BlockJukebox.TileEntityJukebox blockjukebox$tileentityjukebox = (BlockJukebox.TileEntityJukebox)tileentity;
            ItemStack itemstack = blockjukebox$tileentityjukebox.getRecord();

            if (!itemstack.func_190926_b())
            {
                worldIn.playEvent(1010, pos, 0);
                worldIn.playRecord(pos, (SoundEvent)null);
                blockjukebox$tileentityjukebox.setRecord(ItemStack.field_190927_a);
                float f = 0.7F;
                double d0 = (double)(worldIn.rand.nextFloat() * 0.7F) + 0.15000000596046448D;
                double d1 = (double)(worldIn.rand.nextFloat() * 0.7F) + 0.06000000238418579D + 0.6D;
                double d2 = (double)(worldIn.rand.nextFloat() * 0.7F) + 0.15000000596046448D;
                ItemStack itemstack1 = itemstack.copy();
                EntityItem entityitem = new EntityItem(worldIn, (double)pos.getX() + d0, (double)pos.getY() + d1, (double)pos.getZ() + d2, itemstack1);
                entityitem.setDefaultPickupDelay();
                worldIn.spawnEntityInWorld(entityitem);
            }
        }
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:29,代码来源:BlockJukebox.java

示例3: dropRecord

import net.minecraft.world.World; //导入方法依赖的package包/类
private void dropRecord(World worldIn, BlockPos pos, IBlockState state)
{
    if (!worldIn.isRemote)
    {
        TileEntity tileentity = worldIn.getTileEntity(pos);

        if (tileentity instanceof BlockJukebox.TileEntityJukebox)
        {
            BlockJukebox.TileEntityJukebox blockjukebox$tileentityjukebox = (BlockJukebox.TileEntityJukebox)tileentity;
            ItemStack itemstack = blockjukebox$tileentityjukebox.getRecord();

            if (itemstack != null)
            {
                worldIn.playEvent(1010, pos, 0);
                worldIn.playRecord(pos, (SoundEvent)null);
                blockjukebox$tileentityjukebox.setRecord((ItemStack)null);
                float f = 0.7F;
                double d0 = (double)(worldIn.rand.nextFloat() * 0.7F) + 0.15000000596046448D;
                double d1 = (double)(worldIn.rand.nextFloat() * 0.7F) + 0.06000000238418579D + 0.6D;
                double d2 = (double)(worldIn.rand.nextFloat() * 0.7F) + 0.15000000596046448D;
                ItemStack itemstack1 = itemstack.copy();
                EntityItem entityitem = new EntityItem(worldIn, (double)pos.getX() + d0, (double)pos.getY() + d1, (double)pos.getZ() + d2, itemstack1);
                entityitem.setDefaultPickupDelay();
                worldIn.spawnEntityInWorld(entityitem);
            }
        }
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:29,代码来源:BlockJukebox.java


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