本文整理汇总了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);
}
}
}
}
示例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);
}
}
}
}
示例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);
}
}
}
}