本文整理了Java中net.minecraft.util.Rotation.valueOf
方法的一些代码示例,展示了Rotation.valueOf
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Rotation.valueOf
方法的具体详情如下:
包路径:net.minecraft.util.Rotation
类名称: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;
}
内容来源于网络,如有侵权,请联系作者删除!