本文整理汇总了Java中net.minecraft.util.WeightedRandomChestContent.generateDispenserContents方法的典型用法代码示例。如果您正苦于以下问题:Java WeightedRandomChestContent.generateDispenserContents方法的具体用法?Java WeightedRandomChestContent.generateDispenserContents怎么用?Java WeightedRandomChestContent.generateDispenserContents使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.util.WeightedRandomChestContent
的用法示例。
在下文中一共展示了WeightedRandomChestContent.generateDispenserContents方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: generateDispenserContents
import net.minecraft.util.WeightedRandomChestContent; //导入方法依赖的package包/类
protected boolean generateDispenserContents(World worldIn, StructureBoundingBox boundingBoxIn, Random rand, int x, int y, int z, int meta, List<WeightedRandomChestContent> listIn, int max)
{
BlockPos blockpos = new BlockPos(this.getXWithOffset(x, z), this.getYWithOffset(y), this.getZWithOffset(x, z));
if (boundingBoxIn.isVecInside(blockpos) && worldIn.getBlockState(blockpos).getBlock() != Blocks.dispenser)
{
worldIn.setBlockState(blockpos, Blocks.dispenser.getStateFromMeta(this.getMetadataWithOffset(Blocks.dispenser, meta)), 2);
TileEntity tileentity = worldIn.getTileEntity(blockpos);
if (tileentity instanceof TileEntityDispenser)
{
WeightedRandomChestContent.generateDispenserContents(rand, listIn, (TileEntityDispenser)tileentity, max);
}
return true;
}
else
{
return false;
}
}
示例2: generateStructureDispenserContents
import net.minecraft.util.WeightedRandomChestContent; //导入方法依赖的package包/类
protected boolean generateStructureDispenserContents(World p_74869_1_, StructureBoundingBox p_74869_2_, Random p_74869_3_, int p_74869_4_, int p_74869_5_, int p_74869_6_, int p_74869_7_, WeightedRandomChestContent[] p_74869_8_, int p_74869_9_)
{
int j1 = this.getXWithOffset(p_74869_4_, p_74869_6_);
int k1 = this.getYWithOffset(p_74869_5_);
int l1 = this.getZWithOffset(p_74869_4_, p_74869_6_);
if (p_74869_2_.isVecInside(j1, k1, l1) && p_74869_1_.getBlock(j1, k1, l1) != Blocks.dispenser)
{
p_74869_1_.setBlock(j1, k1, l1, Blocks.dispenser, this.getMetadataWithOffset(Blocks.dispenser, p_74869_7_), 2);
TileEntityDispenser tileentitydispenser = (TileEntityDispenser)p_74869_1_.getTileEntity(j1, k1, l1);
if (tileentitydispenser != null)
{
WeightedRandomChestContent.generateDispenserContents(p_74869_3_, p_74869_8_, tileentitydispenser, p_74869_9_);
}
return true;
}
else
{
return false;
}
}
示例3: generateStructureDispenserContents
import net.minecraft.util.WeightedRandomChestContent; //导入方法依赖的package包/类
/**
* Used to generate dispenser contents for structures. ex: Jungle Temples.
*/
protected boolean generateStructureDispenserContents(World par1World, StructureBoundingBox par2StructureBoundingBox, Random par3Random, int par4, int par5, int par6, int par7, WeightedRandomChestContent[] par8ArrayOfWeightedRandomChestContent, int par9)
{
int j1 = this.getXWithOffset(par4, par6);
int k1 = this.getYWithOffset(par5);
int l1 = this.getZWithOffset(par4, par6);
if (par2StructureBoundingBox.isVecInside(j1, k1, l1) && par1World.getBlockId(j1, k1, l1) != Block.dispenser.blockID)
{
par1World.setBlock(j1, k1, l1, Block.dispenser.blockID, this.getMetadataWithOffset(Block.dispenser.blockID, par7), 2);
TileEntityDispenser tileentitydispenser = (TileEntityDispenser)par1World.getBlockTileEntity(j1, k1, l1);
if (tileentitydispenser != null)
{
WeightedRandomChestContent.generateDispenserContents(par3Random, par8ArrayOfWeightedRandomChestContent, tileentitydispenser, par9);
}
return true;
}
else
{
return false;
}
}