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

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

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

Rotation.valueOf介绍

暂无

代码示例

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

@Override
@SuppressWarnings("deprecation")
public void deserializeNBT(NBTTagCompound nbt) {
  building = Building.REGISTRY.get(new ResourceLocation(nbt.getString("Building")));
  pos = NBTHelper.readBlockPos("Building", nbt);
  //TODO: Remove in 0.7+
  if (nbt.hasKey("Direction")) {
    Direction direction = Direction.valueOf(nbt.getString("Direction"));
    rotation = direction.getRotation();
  } else rotation = Rotation.valueOf(nbt.getString("Rotation"));
}

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

generator.setRotation(Rotation.valueOf(args[1].toUpperCase(Locale.ENGLISH)));
} catch (IllegalArgumentException e) {
  throw new CommandException("commands.spawnjc.notrot", args[1]);

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

@SuppressWarnings("deprecation")
public static BuildingStage readFromNBT(NBTTagCompound nbt) {
  BuildingStage stage = new BuildingStage();
  stage.building = Building.REGISTRY.get(new ResourceLocation(nbt.getString("CurrentlyBuilding")));
  stage.template = BuildingRegistry.INSTANCE.getTemplateForBuilding(stage.building);
  //TODO: Remove in 0.7+
  if (nbt.hasKey("Direction")) {
    Direction direction = Direction.valueOf(nbt.getString("Direction"));
    stage.rotation = direction.getRotation();
  } else stage.rotation = Rotation.valueOf(nbt.getString("Rotation"));
  stage.pos = new BlockPos(nbt.getInteger("BuildingX"), nbt.getInteger("BuildingY"), nbt.getInteger("BuildingZ"));
  if (nbt.hasKey("Stage")) {
    stage.index = nbt.getInteger("Index");
    stage.stage = ConstructionStage.values()[nbt.getInteger("Stage")];
  }
  return stage;
}

相关文章

微信公众号

最新文章

更多