本文整理了Java中net.minecraft.world.World.findNearestStructure()
方法的一些代码示例,展示了World.findNearestStructure()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。World.findNearestStructure()
方法的具体详情如下:
包路径:net.minecraft.world.World
类名称:World
方法名:findNearestStructure
暂无
代码示例来源:origin: SleepyTrousers/EnderIO
@Override
@Nullable
public BlockPos findNearestStructure(@Nonnull String p_190528_1_, @Nonnull BlockPos p_190528_2_, boolean p_190528_3_) {
return wrapped.findNearestStructure(p_190528_1_, p_190528_2_, p_190528_3_);
}
代码示例来源:origin: amadornes/MCMultiPart
@Override
public BlockPos findNearestStructure(String p_190528_1_, BlockPos p_190528_2_, boolean p_190528_3_) {
return getActualWorld().findNearestStructure(p_190528_1_, p_190528_2_, p_190528_3_);
}
代码示例来源:origin: Vazkii/Quark
@Override
public ActionResult<ItemStack> onItemRightClick(World worldIn, EntityPlayer playerIn, EnumHand handIn) {
ItemStack itemstack = playerIn.getHeldItem(handIn);
if(!playerIn.capabilities.isCreativeMode)
itemstack.shrink(1);
if(!worldIn.isRemote) {
BlockPos blockpos = playerIn.getEntityWorld().findNearestStructure("Fortress", playerIn.getPosition(), false);
if(blockpos != null) {
EntitySoulPowder entity = new EntitySoulPowder(worldIn, blockpos.getX(), blockpos.getZ());
Vec3d look = playerIn.getLookVec();
entity.setPosition(playerIn.posX + look.x * 2, playerIn.posY + 0.25, playerIn.posZ + look.z * 2);
worldIn.spawnEntity(entity);
worldIn.playSound(null, playerIn.posX, playerIn.posY, playerIn.posZ, SoundEvents.ENTITY_GHAST_DEATH, SoundCategory.PLAYERS, 1F, 1F);
}
} else playerIn.swingArm(handIn);
playerIn.addStat(StatList.getObjectUseStats(this));
return new ActionResult(EnumActionResult.SUCCESS, itemstack);
}
内容来源于网络,如有侵权,请联系作者删除!