net.minecraft.util.Rotation.values()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(6.6k)|赞(0)|评价(0)|浏览(67)

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

Rotation.values介绍

暂无

代码示例

代码示例来源:origin: PrinceOfAmber/Cyclic

public Rotation getRotation() {
 return Rotation.values()[this.rotation];
}

代码示例来源:origin: TerraFirmaCraft/TerraFirmaCraft

/**
 * This only sets the properties used by ITreeGenerator.addStructureToWorld
 *
 * @param rand For generating random settings
 * @return A set of placement settings with random rotation
 */
static PlacementSettings getRandomSettings(Random rand)
{
  return getDefaultSettings().setRotation(Rotation.values()[rand.nextInt(Rotation.values().length)]);
}

代码示例来源:origin: PenguinSquad/Harvest-Festival

@Override
protected void growTree(World world, BlockPos pos) {
  Rotation rotation = Rotation.values()[world.rand.nextInt(Rotation.values().length)];
  template.placeBlocks(world, getAdjustedPositionBasedOnRotation(pos, rotation), rotation, null, ONLY_AIR);
}

代码示例来源:origin: JurassiCraftTeam/JurassiCraft2

protected StructureGenerator(Random rand, int sizeX, int sizeY, int sizeZ) {
  this.horizontalPos = -1;
  this.sizeX = sizeX;
  this.sizeY = sizeY;
  this.sizeZ = sizeZ;
  Rotation[] rotations = Rotation.values();
  this.rotation = rotations[rand.nextInt(rotations.length)];
  Mirror[] mirrors = Mirror.values();
  this.mirror = mirrors[rand.nextInt(mirrors.length)];
}

代码示例来源:origin: JurassiCraftTeam/JurassiCraft2

@Override
  public List<String> getTabCompletions(MinecraftServer server, ICommandSender sender, String[] args, @Nullable BlockPos targetPos) {
    if(args.length == 1) {
      return getListOfStringsMatchingLastWord(args, Lists.newArrayList("visitor_center", "raptor_paddock"));
    } else if(args.length == 2) {
      return getListOfStringsMatchingLastWord(args, Stream.of(Rotation.values()).map(Enum::name).map(String::toLowerCase).collect(Collectors.toList()));
    } else if(args.length == 3) {
      return getListOfStringsMatchingLastWord(args, Stream.of(Mirror.values()).map(Enum::name).map(String::toLowerCase).collect(Collectors.toList()));
    }
    return Lists.newArrayList();
  }
}

代码示例来源:origin: P3pp3rF1y/AncientWarfare2

@Override
  public IBlockState getState(int turns) {
    return super.getState(turns).withRotation(Rotation.values()[turns % 4]);
  }
}

代码示例来源:origin: P3pp3rF1y/AncientWarfare2

public TemplateRuleVanillaSkull(World world, BlockPos pos, IBlockState state, int turns) {
  super(world, pos, state, turns);
  skullRotation = Rotation.values()[turns % 4].rotate(tag.getInteger("Rot"), 16);
}

代码示例来源:origin: P3pp3rF1y/AncientWarfare2

private TileEntitySkull setTileProperties(int turns, TileEntitySkull te) {
  te.setSkullRotation(Rotation.values()[turns % 4].rotate(skullRotation, 16));
  return te;
}

代码示例来源:origin: P3pp3rF1y/AncientWarfare2

public TemplateRuleBanner(World world, BlockPos pos, IBlockState state, int turns) {
  super(world, pos, state.getBlock() == Blocks.STANDING_BANNER ? BlockTools.rotateFacing(state.withRotation(Rotation.values()[turns % 4]), turns) : state, turns);
}

代码示例来源:origin: McJtyMods/LostCities

private void create(World world, LostCityChunkGenerator provider, Random random, int chunkX, int chunkZ) {
  Rotation rotation = Rotation.values()[random.nextInt(Rotation.values().length)];
  ChunkPrimer chunkprimer = provider.getChunkPrimer(chunkX, chunkZ, false);
  int i = 5;
  int j = 5;
  if (rotation == Rotation.CLOCKWISE_90) {
    i = -5;
  } else if (rotation == Rotation.CLOCKWISE_180) {
    i = -5;
    j = -5;
  } else if (rotation == Rotation.COUNTERCLOCKWISE_90) {
    j = -5;
  }
  int k = chunkprimer.findGroundBlockIdx(7, 7);
  int l = chunkprimer.findGroundBlockIdx(7, 7 + j);
  int i1 = chunkprimer.findGroundBlockIdx(7 + i, 7);
  int j1 = chunkprimer.findGroundBlockIdx(7 + i, 7 + j);
  int k1 = Math.min(Math.min(k, l), Math.min(i1, j1));
  if (k1 < 60) {
    this.isValid = false;
  } else {
    BlockPos blockpos = new BlockPos(chunkX * 16 + 8, k1 + 1, chunkZ * 16 + 8);
    List<WoodlandMansionPieces.MansionTemplate> list = Lists.<WoodlandMansionPieces.MansionTemplate>newLinkedList();
    WoodlandMansionPieces.generateMansion(world.getSaveHandler().getStructureTemplateManager(), blockpos, rotation, list, random);
    this.components.addAll(list);
    this.updateBoundingBox();
    this.isValid = true;
  }
}

代码示例来源:origin: WayofTime/BloodMagic

settings.setRotation(Rotation.values()[rand.nextInt(Rotation.values().length)]); //Same for the Mirror
DungeonRoom testingRoom = getRandomRoom(rand);

代码示例来源:origin: PrinceOfAmber/Cyclic

break;
case ROTATION:
 this.rotation = value % Rotation.values().length;
break;
case FLIPX:

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

Template template = world.getStructureTemplateManager().getTemplate(server, new ResourceLocation("quark", "dungeon_" + dungeonType));
PlacementSettings settings = new PlacementSettings();
settings.setRotation(Rotation.values()[rand.nextInt(Rotation.values().length)]);

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

private void generateFossil(World world, Random random, BlockPos pos) {
  MinecraftServer minecraftserver = world.getMinecraftServer();
  Rotation[] arotation = Rotation.values();
  Rotation rotation = arotation[random.nextInt(arotation.length)];
  int i = random.nextInt(FOSSILS.length);
  TemplateManager templatemanager = world.getSaveHandler().getStructureTemplateManager();
  Template template = templatemanager.getTemplate(minecraftserver, FOSSILS[i]);
  ChunkPos chunkpos = new ChunkPos(pos);
  StructureBoundingBox structureboundingbox = new StructureBoundingBox(chunkpos.getXStart(), 0, chunkpos.getZStart(), chunkpos.getXEnd(), 256, chunkpos.getZEnd());
  PlacementSettings placementsettings = (new PlacementSettings()).setRotation(rotation).setBoundingBox(structureboundingbox).setRandom(random);
  BlockPos blockpos = template.transformedSize(rotation);
  BlockPos blockpos1 = template.getZeroPositionWithTransform(pos, Mirror.NONE, rotation);
  placementsettings.setIntegrity(1F);
  template.addBlocksToWorld(world, blockpos1, placementsettings, 20);
}

代码示例来源:origin: PenguinSquad/Harvest-Festival

for (int j = 0; j < 16; j++) {
  if (below[i][j] == LADDER) {
    Rotation rotation = Rotation.values()[rand.nextInt(Rotation.values().length)];
    IBlockState theState = HFMining.LADDER.withRotation(LADDER, rotation);
    if (getBlockState(primer, i, belowY, j).getBlock() != LADDER.getBlock() && getBlockState(primer, i, belowY, j) != LADDER_HOLE)

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

Template template = world.getStructureTemplateManager().getTemplate(server, PirateShips.SHIP_STRUCTURE);
PlacementSettings settings = new PlacementSettings();
settings.setRotation(Rotation.values()[random.nextInt(Rotation.values().length)]);

代码示例来源:origin: Alex-the-666/Ice_and_Fire

IBlockState blockState = world.getBlockState(height.down());
if (blockState.isFullBlock() && world.isAirBlock(height.up()) && random.nextInt(IceAndFire.CONFIG.spawnGorgonsChance + 1) == 0 && BiomeDictionary.hasType(world.getBiome(height), Type.BEACH)) {
  Rotation rotation = Rotation.values()[random.nextInt(Rotation.values().length)];
  Mirror mirror = Mirror.values()[random.nextInt(Mirror.values().length)];
  MinecraftServer server = world.getMinecraftServer();

相关文章

微信公众号

最新文章

更多