net.minecraft.world.World.findNearestStructure()方法的使用及代码示例

x33g5p2x  于2022-02-02 转载在 其他  
字(1.7k)|赞(0)|评价(0)|浏览(125)

本文整理了Java中net.minecraft.world.World.findNearestStructure()方法的一些代码示例,展示了World.findNearestStructure()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。World.findNearestStructure()方法的具体详情如下:
包路径:net.minecraft.world.World
类名称:World
方法名:findNearestStructure

World.findNearestStructure介绍

暂无

代码示例

代码示例来源:origin: SleepyTrousers/EnderIO

  1. @Override
  2. @Nullable
  3. public BlockPos findNearestStructure(@Nonnull String p_190528_1_, @Nonnull BlockPos p_190528_2_, boolean p_190528_3_) {
  4. return wrapped.findNearestStructure(p_190528_1_, p_190528_2_, p_190528_3_);
  5. }

代码示例来源:origin: amadornes/MCMultiPart

  1. @Override
  2. public BlockPos findNearestStructure(String p_190528_1_, BlockPos p_190528_2_, boolean p_190528_3_) {
  3. return getActualWorld().findNearestStructure(p_190528_1_, p_190528_2_, p_190528_3_);
  4. }

代码示例来源:origin: Vazkii/Quark

  1. @Override
  2. public ActionResult<ItemStack> onItemRightClick(World worldIn, EntityPlayer playerIn, EnumHand handIn) {
  3. ItemStack itemstack = playerIn.getHeldItem(handIn);
  4. if(!playerIn.capabilities.isCreativeMode)
  5. itemstack.shrink(1);
  6. if(!worldIn.isRemote) {
  7. BlockPos blockpos = playerIn.getEntityWorld().findNearestStructure("Fortress", playerIn.getPosition(), false);
  8. if(blockpos != null) {
  9. EntitySoulPowder entity = new EntitySoulPowder(worldIn, blockpos.getX(), blockpos.getZ());
  10. Vec3d look = playerIn.getLookVec();
  11. entity.setPosition(playerIn.posX + look.x * 2, playerIn.posY + 0.25, playerIn.posZ + look.z * 2);
  12. worldIn.spawnEntity(entity);
  13. worldIn.playSound(null, playerIn.posX, playerIn.posY, playerIn.posZ, SoundEvents.ENTITY_GHAST_DEATH, SoundCategory.PLAYERS, 1F, 1F);
  14. }
  15. } else playerIn.swingArm(handIn);
  16. playerIn.addStat(StatList.getObjectUseStats(this));
  17. return new ActionResult(EnumActionResult.SUCCESS, itemstack);
  18. }

相关文章

World类方法