本文整理汇总了Java中net.minecraft.init.Blocks.DISPENSER属性的典型用法代码示例。如果您正苦于以下问题:Java Blocks.DISPENSER属性的具体用法?Java Blocks.DISPENSER怎么用?Java Blocks.DISPENSER使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类net.minecraft.init.Blocks
的用法示例。
在下文中一共展示了Blocks.DISPENSER属性的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createDispenser
protected boolean createDispenser(World p_189419_1_, StructureBoundingBox p_189419_2_, Random p_189419_3_, int p_189419_4_, int p_189419_5_, int p_189419_6_, EnumFacing p_189419_7_, ResourceLocation p_189419_8_)
{
BlockPos blockpos = new BlockPos(this.getXWithOffset(p_189419_4_, p_189419_6_), this.getYWithOffset(p_189419_5_), this.getZWithOffset(p_189419_4_, p_189419_6_));
if (p_189419_2_.isVecInside(blockpos) && p_189419_1_.getBlockState(blockpos).getBlock() != Blocks.DISPENSER)
{
this.setBlockState(p_189419_1_, Blocks.DISPENSER.getDefaultState().withProperty(BlockDispenser.FACING, p_189419_7_), p_189419_4_, p_189419_5_, p_189419_6_, p_189419_2_);
TileEntity tileentity = p_189419_1_.getTileEntity(blockpos);
if (tileentity instanceof TileEntityDispenser)
{
((TileEntityDispenser)tileentity).setLootTable(p_189419_8_, p_189419_3_.nextLong());
}
return true;
}
else
{
return false;
}
}