本文整理汇总了Java中net.minecraft.client.renderer.block.model.ModelRotation.X0_Y90属性的典型用法代码示例。如果您正苦于以下问题:Java ModelRotation.X0_Y90属性的具体用法?Java ModelRotation.X0_Y90怎么用?Java ModelRotation.X0_Y90使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类net.minecraft.client.renderer.block.model.ModelRotation
的用法示例。
在下文中一共展示了ModelRotation.X0_Y90属性的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: bake
@Override
public IBakedModel bake(IModelState state, VertexFormat format,
Function<ResourceLocation, TextureAtlasSprite> bakedTextureGetter) {
IBakedModel[] connections = new IBakedModel[6];
IBakedModel[] endings = new IBakedModel[6];
IBakedModel[] nodeSides = new IBakedModel[6];
//IBakedModel node = null;
// d u n s w e
ModelRotation[] rotations = new ModelRotation[] { ModelRotation.X90_Y0, ModelRotation.X270_Y0,
ModelRotation.X0_Y0, ModelRotation.X0_Y180, ModelRotation.X0_Y270, ModelRotation.X0_Y90 };
try {
IModel nodeSideModel = ModelLoaderRegistry.getModel(new ResourceLocation(Etheric.MODID, "block/pipe_node_side"));
IModel connectionModel = ModelLoaderRegistry
.getModel(new ResourceLocation(Etheric.MODID, "block/pipe_connection"));
IModel endingModel = ModelLoaderRegistry.getModel(new ResourceLocation(Etheric.MODID, "block/pipe_end"));
//node = nodeModel.bake(new TRSRTransformation(ModelRotation.X0_Y0), DefaultVertexFormats.BLOCK,
// ModelLoader.defaultTextureGetter());
for (int i = 0; i < connections.length; i++) {
connections[i] = connectionModel.bake(new TRSRTransformation(rotations[i]), DefaultVertexFormats.BLOCK,
ModelLoader.defaultTextureGetter());
endings[i] = endingModel.bake(new TRSRTransformation(rotations[i]), DefaultVertexFormats.BLOCK,
ModelLoader.defaultTextureGetter());
nodeSides[i] = nodeSideModel.bake(new TRSRTransformation(rotations[i]), DefaultVertexFormats.BLOCK,
ModelLoader.defaultTextureGetter());
}
} catch (Exception e) {
Etheric.logger.warn(e.getMessage());
}
if (connections[0] == null) {
return ModelLoaderRegistry.getMissingModel().bake(state, format, bakedTextureGetter);
}
return new BakedPipeModel(nodeSides, connections, endings);
}
示例2: mapRender
@SideOnly(Side.CLIENT)
private IBakedModel mapRender(IBlockState state, @Nullable IBlockState paint) {
EnumFacing facing = state.getValue(FACING);
Boolean open = state.getValue(OPEN);
DoorHalf half = state.getValue(HALF);
String model;
ModelRotation modelState;
if (open) {
model = "trapdoor_open";
switch (facing) {
case EAST:
modelState = ModelRotation.X0_Y90;
break;
case SOUTH:
modelState = ModelRotation.X0_Y180;
break;
case WEST:
modelState = ModelRotation.X0_Y270;
break;
default:
modelState = null;
}
} else if (half == DoorHalf.TOP) {
model = "trapdoor_top";
modelState = null;
} else {
model = "trapdoor_bottom";
modelState = null;
}
return PaintRegistry.getModel(IBakedModel.class, model, paint, modelState);
}
示例3: mapRender
@SideOnly(Side.CLIENT)
private IBakedModel mapRender(IBlockState state, @Nullable IBlockState paint, EnumFacing facing) {
ModelRotation rot;
switch (facing) {
case EAST:
rot = ModelRotation.X0_Y90;
break;
case NORTH:
rot = null;
break;
case SOUTH:
rot = ModelRotation.X0_Y180;
break;
case WEST:
rot = ModelRotation.X0_Y270;
break;
default:
return null;
}
if (state.getValue(BlockPressurePlateWeighted.POWER) > 0) {
return PaintRegistry.getModel(IBakedModel.class, "pressure_plate_down", paint, rot);
} else {
return PaintRegistry.getModel(IBakedModel.class, "pressure_plate_up", paint, rot);
}
}
示例4: addQuads
@SideOnly(Side.CLIENT)
@Override
public void addQuads(FaceBakery faceBakery, List<BakedQuad> list, EnumFacing dir){
ModelRotation modelRot = ModelRotation.X0_Y0;
switch (dir.ordinal()) {
case 0: {
modelRot = ModelRotation.X270_Y0;
break;
}
case 1: {
modelRot = ModelRotation.X90_Y0;
break;
}
case 2: {
modelRot = ModelRotation.X180_Y0;
break;
}
case 3: {
modelRot = ModelRotation.X0_Y0;
break;
}
case 4: {
modelRot = ModelRotation.X0_Y90;
break;
}
case 5: {
modelRot = ModelRotation.X0_Y270;
break;
}
}
final BlockFaceUV uv = new BlockFaceUV(new float[] { 0.0f, 0.0f, 16.0f, 16.0f }, 0);
final BlockPartFace face = new BlockPartFace((EnumFacing)null, 0, "", uv);
final TextureAtlasSprite iron = ModelPipeBaked.getIronSprite();
TextureAtlasSprite spriteLapis = RenderUtil.getSprite("minecraft:blocks/iron_block");
list.add(faceBakery.makeBakedQuad(new Vector3f(2.0f, 14.0f, 12f), new Vector3f(14.0f, 14.0f, 13f), face, iron, EnumFacing.UP, modelRot, (BlockPartRotation)null, true, true));
list.add(faceBakery.makeBakedQuad(new Vector3f(2.0f, 2.0f, 12f), new Vector3f(14.0f, 2.0f, 13f), face, iron, EnumFacing.DOWN, modelRot, (BlockPartRotation)null, true, true));
list.add(faceBakery.makeBakedQuad(new Vector3f(2.0f, 2.0f, 12f), new Vector3f(14.0f, 14.0f, 13f), face, iron, EnumFacing.NORTH, modelRot, (BlockPartRotation)null, true, true));
list.add(faceBakery.makeBakedQuad(new Vector3f(2.0f, 2.0f, 12f), new Vector3f(14.0f, 14.0f, 13.0f), face, iron, EnumFacing.SOUTH, modelRot, (BlockPartRotation)null, true, true));
list.add(faceBakery.makeBakedQuad(new Vector3f(2.0f, 2.0f, 12f), new Vector3f(2.0f, 14.0f, 13f), face, iron, EnumFacing.WEST, modelRot, (BlockPartRotation)null, true, true));
list.add(faceBakery.makeBakedQuad(new Vector3f(14.0f, 2.0f, 12f), new Vector3f(14.0f, 14.0f, 13f), face, iron, EnumFacing.EAST, modelRot, (BlockPartRotation)null, true, true));
list.add(faceBakery.makeBakedQuad(new Vector3f(3.0f, 13.0f, 13.0f), new Vector3f(13.0f, 13.0f, 14.5f), face, iron, EnumFacing.UP, modelRot, (BlockPartRotation)null, true, true));
list.add(faceBakery.makeBakedQuad(new Vector3f(3.0f, 3.0f, 13.0f), new Vector3f(13.0f, 3.0f, 14.5f), face, iron, EnumFacing.DOWN, modelRot, (BlockPartRotation)null, true, true));
list.add(faceBakery.makeBakedQuad(new Vector3f(3.0f, 3.0f, 13.0f), new Vector3f(13.0f, 13.0f, 14.5f), face, iron, EnumFacing.NORTH, modelRot, (BlockPartRotation)null, true, true));
list.add(faceBakery.makeBakedQuad(new Vector3f(3.0f, 3.0f, 13.0f), new Vector3f(13.0f, 13.0f, 14.5f), face, iron, EnumFacing.SOUTH, modelRot, (BlockPartRotation)null, true, true));
list.add(faceBakery.makeBakedQuad(new Vector3f(3.0f, 3.0f, 13.0f), new Vector3f(3.0f, 13.0f, 14.5f), face, iron, EnumFacing.WEST, modelRot, (BlockPartRotation)null, true, true));
list.add(faceBakery.makeBakedQuad(new Vector3f(13.0f, 3.0f, 13.0f), new Vector3f(13.0f, 13.0f, 14.5f), face, iron, EnumFacing.EAST, modelRot, (BlockPartRotation)null, true, true));
list.add(faceBakery.makeBakedQuad(new Vector3f(4.0f, 12.0f, 14.5f), new Vector3f(12.0f, 12.0f, 16.0f), face, iron, EnumFacing.UP, modelRot, (BlockPartRotation)null, true, true));
list.add(faceBakery.makeBakedQuad(new Vector3f(4.0f, 4.0f, 14.5f), new Vector3f(12.0f, 4.0f, 16.0f), face, iron, EnumFacing.DOWN, modelRot, (BlockPartRotation)null, true, true));
list.add(faceBakery.makeBakedQuad(new Vector3f(4.0f, 4.0f, 14.5f), new Vector3f(12.0f, 12.0f, 16.0f), face, iron, EnumFacing.NORTH, modelRot, (BlockPartRotation)null, true, true));
list.add(faceBakery.makeBakedQuad(new Vector3f(4.0f, 4.0f, 14.5f), new Vector3f(12.0f, 12.0f, 16.0f), face, spriteLapis, EnumFacing.SOUTH, modelRot, (BlockPartRotation)null, true, true));
list.add(faceBakery.makeBakedQuad(new Vector3f(4.0f, 4.0f, 14.5f), new Vector3f(4.0f, 12.0f, 16.0f), face, iron, EnumFacing.WEST, modelRot, (BlockPartRotation)null, true, true));
list.add(faceBakery.makeBakedQuad(new Vector3f(12.0f, 4.0f, 14.5f), new Vector3f(12.0f, 12.0f, 16.0f), face, iron, EnumFacing.EAST, modelRot, (BlockPartRotation)null, true, true));
}
示例5: addQuads
@SideOnly(Side.CLIENT)
@Override
public void addQuads(FaceBakery faceBakery, List<BakedQuad> list, EnumFacing dir){
ModelRotation modelRot = ModelRotation.X0_Y0;
switch (dir.ordinal()) {
case 0: {
modelRot = ModelRotation.X270_Y0;
break;
}
case 1: {
modelRot = ModelRotation.X90_Y0;
break;
}
case 2: {
modelRot = ModelRotation.X180_Y0;
break;
}
case 3: {
modelRot = ModelRotation.X0_Y0;
break;
}
case 4: {
modelRot = ModelRotation.X0_Y90;
break;
}
case 5: {
modelRot = ModelRotation.X0_Y270;
break;
}
}
final BlockFaceUV uv = new BlockFaceUV(new float[] { 0.0f, 0.0f, 16.0f, 16.0f }, 0);
final BlockPartFace face = new BlockPartFace((EnumFacing)null, 0, "", uv);
final TextureAtlasSprite iron = ModelPipeBaked.getIronSprite();
TextureAtlasSprite spriteLapis = Minecraft.getMinecraft().getTextureMapBlocks().getAtlasSprite("minecraft:blocks/redstone_block");
if(spriteLapis == null){
spriteLapis = RenderUtil.getMissingSprite();
}
list.add(faceBakery.makeBakedQuad(new Vector3f(4.0f, 12.0f, 12.0f), new Vector3f(12.0f, 12.0f, 13.0f), face, iron, EnumFacing.UP, modelRot, (BlockPartRotation)null, true, true));
list.add(faceBakery.makeBakedQuad(new Vector3f(4.0f, 4.0f, 12.0f), new Vector3f(12.0f, 4.0f, 13.0f), face, iron, EnumFacing.DOWN, modelRot, (BlockPartRotation)null, true, true));
list.add(faceBakery.makeBakedQuad(new Vector3f(4.0f, 4.0f, 12.0f), new Vector3f(12.0f, 12.0f, 13.0f), face, iron, EnumFacing.NORTH, modelRot, (BlockPartRotation)null, true, true));
list.add(faceBakery.makeBakedQuad(new Vector3f(4.0f, 4.0f, 12.0f), new Vector3f(12.0f, 12.0f, 13.0f), face, iron, EnumFacing.SOUTH, modelRot, (BlockPartRotation)null, true, true));
list.add(faceBakery.makeBakedQuad(new Vector3f(4.0f, 4.0f, 12.0f), new Vector3f(4.0f, 12.0f, 13.0f), face, iron, EnumFacing.WEST, modelRot, (BlockPartRotation)null, true, true));
list.add(faceBakery.makeBakedQuad(new Vector3f(12.0f, 4.0f, 12.0f), new Vector3f(12.0f, 12.0f, 13.0f), face, iron, EnumFacing.EAST, modelRot, (BlockPartRotation)null, true, true));
list.add(faceBakery.makeBakedQuad(new Vector3f(3.0f, 13.0f, 13.0f), new Vector3f(13.0f, 13.0f, 14.5f), face, iron, EnumFacing.UP, modelRot, (BlockPartRotation)null, true, true));
list.add(faceBakery.makeBakedQuad(new Vector3f(3.0f, 3.0f, 13.0f), new Vector3f(13.0f, 3.0f, 14.5f), face, iron, EnumFacing.DOWN, modelRot, (BlockPartRotation)null, true, true));
list.add(faceBakery.makeBakedQuad(new Vector3f(3.0f, 3.0f, 13.0f), new Vector3f(13.0f, 13.0f, 14.5f), face, iron, EnumFacing.NORTH, modelRot, (BlockPartRotation)null, true, true));
list.add(faceBakery.makeBakedQuad(new Vector3f(3.0f, 3.0f, 13.0f), new Vector3f(13.0f, 13.0f, 14.5f), face, spriteLapis, EnumFacing.SOUTH, modelRot, (BlockPartRotation)null, true, true));
list.add(faceBakery.makeBakedQuad(new Vector3f(3.0f, 3.0f, 13.0f), new Vector3f(3.0f, 13.0f, 14.5f), face, iron, EnumFacing.WEST, modelRot, (BlockPartRotation)null, true, true));
list.add(faceBakery.makeBakedQuad(new Vector3f(13.0f, 3.0f, 13.0f), new Vector3f(13.0f, 13.0f, 14.5f), face, iron, EnumFacing.EAST, modelRot, (BlockPartRotation)null, true, true));
list.add(faceBakery.makeBakedQuad(new Vector3f(2.0f, 14.0f, 14.5f), new Vector3f(14.0f, 14.0f, 16.0f), face, iron, EnumFacing.UP, modelRot, (BlockPartRotation)null, true, true));
list.add(faceBakery.makeBakedQuad(new Vector3f(2.0f, 2.0f, 14.5f), new Vector3f(14.0f, 2.0f, 16.0f), face, iron, EnumFacing.DOWN, modelRot, (BlockPartRotation)null, true, true));
list.add(faceBakery.makeBakedQuad(new Vector3f(2.0f, 2.0f, 14.5f), new Vector3f(14.0f, 14.0f, 16.0f), face, iron, EnumFacing.NORTH, modelRot, (BlockPartRotation)null, true, true));
list.add(faceBakery.makeBakedQuad(new Vector3f(2.0f, 2.0f, 14.5f), new Vector3f(14.0f, 14.0f, 16.0f), face, spriteLapis, EnumFacing.SOUTH, modelRot, (BlockPartRotation)null, true, true));
list.add(faceBakery.makeBakedQuad(new Vector3f(2.0f, 2.0f, 14.5f), new Vector3f(2.0f, 14.0f, 16.0f), face, iron, EnumFacing.WEST, modelRot, (BlockPartRotation)null, true, true));
list.add(faceBakery.makeBakedQuad(new Vector3f(14.0f, 2.0f, 14.5f), new Vector3f(14.0f, 14.0f, 16.0f), face, iron, EnumFacing.EAST, modelRot, (BlockPartRotation)null, true, true));
}
示例6: addQuads
@SideOnly(Side.CLIENT)
@Override
public void addQuads(FaceBakery faceBakery, List<BakedQuad> list, EnumFacing dir){
ModelRotation modelRot = ModelRotation.X0_Y0;
switch (dir.ordinal()) {
case 0: {
modelRot = ModelRotation.X270_Y0;
break;
}
case 1: {
modelRot = ModelRotation.X90_Y0;
break;
}
case 2: {
modelRot = ModelRotation.X180_Y0;
break;
}
case 3: {
modelRot = ModelRotation.X0_Y0;
break;
}
case 4: {
modelRot = ModelRotation.X0_Y90;
break;
}
case 5: {
modelRot = ModelRotation.X0_Y270;
break;
}
}
final BlockFaceUV uv = new BlockFaceUV(new float[] { 0.0f, 0.0f, 16.0f, 16.0f }, 0);
final BlockPartFace face = new BlockPartFace((EnumFacing)null, 0, "", uv);
final TextureAtlasSprite iron = ModelPipeBaked.getIronSprite();
TextureAtlasSprite spriteLapis = RenderUtil.getSprite("crystalmod:blocks/pipe/attachment/import");
list.add(faceBakery.makeBakedQuad(new Vector3f(4.0f, 12.0f, 12.0f), new Vector3f(12.0f, 12.0f, 13.0f), face, iron, EnumFacing.UP, modelRot, (BlockPartRotation)null, true, true));
list.add(faceBakery.makeBakedQuad(new Vector3f(4.0f, 4.0f, 12.0f), new Vector3f(12.0f, 4.0f, 13.0f), face, iron, EnumFacing.DOWN, modelRot, (BlockPartRotation)null, true, true));
list.add(faceBakery.makeBakedQuad(new Vector3f(4.0f, 4.0f, 12.0f), new Vector3f(12.0f, 12.0f, 13.0f), face, iron, EnumFacing.NORTH, modelRot, (BlockPartRotation)null, true, true));
list.add(faceBakery.makeBakedQuad(new Vector3f(4.0f, 4.0f, 12.0f), new Vector3f(12.0f, 12.0f, 13.0f), face, iron, EnumFacing.SOUTH, modelRot, (BlockPartRotation)null, true, true));
list.add(faceBakery.makeBakedQuad(new Vector3f(4.0f, 4.0f, 12.0f), new Vector3f(4.0f, 12.0f, 13.0f), face, iron, EnumFacing.WEST, modelRot, (BlockPartRotation)null, true, true));
list.add(faceBakery.makeBakedQuad(new Vector3f(12.0f, 4.0f, 12.0f), new Vector3f(12.0f, 12.0f, 13.0f), face, iron, EnumFacing.EAST, modelRot, (BlockPartRotation)null, true, true));
list.add(faceBakery.makeBakedQuad(new Vector3f(3.0f, 13.0f, 13.0f), new Vector3f(13.0f, 13.0f, 14.5f), face, iron, EnumFacing.UP, modelRot, (BlockPartRotation)null, true, true));
list.add(faceBakery.makeBakedQuad(new Vector3f(3.0f, 3.0f, 13.0f), new Vector3f(13.0f, 3.0f, 14.5f), face, iron, EnumFacing.DOWN, modelRot, (BlockPartRotation)null, true, true));
list.add(faceBakery.makeBakedQuad(new Vector3f(3.0f, 3.0f, 13.0f), new Vector3f(13.0f, 13.0f, 14.5f), face, iron, EnumFacing.NORTH, modelRot, (BlockPartRotation)null, true, true));
list.add(faceBakery.makeBakedQuad(new Vector3f(3.0f, 3.0f, 13.0f), new Vector3f(13.0f, 13.0f, 14.5f), face, spriteLapis, EnumFacing.SOUTH, modelRot, (BlockPartRotation)null, true, true));
list.add(faceBakery.makeBakedQuad(new Vector3f(3.0f, 3.0f, 13.0f), new Vector3f(3.0f, 13.0f, 14.5f), face, iron, EnumFacing.WEST, modelRot, (BlockPartRotation)null, true, true));
list.add(faceBakery.makeBakedQuad(new Vector3f(13.0f, 3.0f, 13.0f), new Vector3f(13.0f, 13.0f, 14.5f), face, iron, EnumFacing.EAST, modelRot, (BlockPartRotation)null, true, true));
list.add(faceBakery.makeBakedQuad(new Vector3f(2.0f, 14.0f, 14.5f), new Vector3f(14.0f, 14.0f, 16.0f), face, iron, EnumFacing.UP, modelRot, (BlockPartRotation)null, true, true));
list.add(faceBakery.makeBakedQuad(new Vector3f(2.0f, 2.0f, 14.5f), new Vector3f(14.0f, 2.0f, 16.0f), face, iron, EnumFacing.DOWN, modelRot, (BlockPartRotation)null, true, true));
list.add(faceBakery.makeBakedQuad(new Vector3f(2.0f, 2.0f, 14.5f), new Vector3f(14.0f, 14.0f, 16.0f), face, iron, EnumFacing.NORTH, modelRot, (BlockPartRotation)null, true, true));
list.add(faceBakery.makeBakedQuad(new Vector3f(2.0f, 2.0f, 14.5f), new Vector3f(14.0f, 14.0f, 16.0f), face, spriteLapis, EnumFacing.SOUTH, modelRot, (BlockPartRotation)null, true, true));
list.add(faceBakery.makeBakedQuad(new Vector3f(2.0f, 2.0f, 14.5f), new Vector3f(2.0f, 14.0f, 16.0f), face, iron, EnumFacing.WEST, modelRot, (BlockPartRotation)null, true, true));
list.add(faceBakery.makeBakedQuad(new Vector3f(14.0f, 2.0f, 14.5f), new Vector3f(14.0f, 14.0f, 16.0f), face, iron, EnumFacing.EAST, modelRot, (BlockPartRotation)null, true, true));
}
示例7: renderIronCap
private void renderIronCap(final FakeState state, final int dir, final List<BakedQuad> list) {
ModelRotation modelRot = ModelRotation.X0_Y0;
switch (dir) {
case 0: {
modelRot = ModelRotation.X270_Y0;
break;
}
case 1: {
modelRot = ModelRotation.X90_Y0;
break;
}
case 2: {
modelRot = ModelRotation.X180_Y0;
break;
}
case 3: {
modelRot = ModelRotation.X0_Y0;
break;
}
case 4: {
modelRot = ModelRotation.X0_Y90;
break;
}
case 5: {
modelRot = ModelRotation.X0_Y270;
break;
}
}
//modelRot = ModelRotation.X0_Y0;
final BlockFaceUV uv = new BlockFaceUV(new float[] { 0.0f, 0.0f, 16.0f, 16.0f }, 0);
final BlockPartFace face = new BlockPartFace((EnumFacing)null, 0, "", uv);
final BlockFaceUV uv270 = new BlockFaceUV(new float[] { 0.0f, 0.0f, 16.0f, 16.0f }, 270);
final BlockPartFace face270 = new BlockPartFace((EnumFacing)null, 0, "", uv270);
final BlockFaceUV uv90 = new BlockFaceUV(new float[] { 0.0f, 0.0f, 16.0f, 16.0f }, 90);
final BlockPartFace face90 = new BlockPartFace((EnumFacing)null, 0, "", uv90);
final BlockFaceUV uv180 = new BlockFaceUV(new float[] { 0.0f, 0.0f, 16.0f, 16.0f }, 180);
final BlockPartFace face180 = new BlockPartFace((EnumFacing)null, 0, "", uv180);
TextureAtlasSprite iron = RenderUtil.getSprite("crystalmod:blocks/pipe/iron_cap");
TextureAtlasSprite spriteLapis = RenderUtil.getSprite("crystalmod:blocks/pipe/io_out");
TextureAtlasSprite spriteRedstone = RenderUtil.getSprite("crystalmod:blocks/pipe/io_in");
TextureAtlasSprite spriteQuartz = RenderUtil.getSprite("crystalmod:blocks/pipe/io_inout");
boolean scale = false;
if(state !=null && state.pipe !=null && state.pipe.getPipeType() !=null){
if(!state.pipe.getPipeType().useIOTextures()){
spriteRedstone = iron;
spriteLapis = iron;
spriteQuartz = iron;
scale = true;
}
}
ConnectionMode mode = (state !=null && state.pipe !=null) ? state.pipe.getConnectionMode(EnumFacing.getFront(dir)) : ConnectionMode.DISABLED;
TextureAtlasSprite modeSprite = mode == ConnectionMode.IN_OUT ? spriteQuartz : mode == ConnectionMode.OUTPUT ? spriteRedstone : mode == ConnectionMode.INPUT ? spriteLapis : iron;
if(mode != ConnectionMode.DISABLED){
list.add(faceBakery.makeBakedQuad(new Vector3f(3.0f, 13.0f, 14.0f), new Vector3f(13.0f, 13.0f, 15.0f), face180, modeSprite, EnumFacing.UP, modelRot, (BlockPartRotation)null, scale, true));
list.add(faceBakery.makeBakedQuad(new Vector3f(3.0f, 3.0f, 14.0f), new Vector3f(13.0f, 3.0f, 15.0f), face, modeSprite, EnumFacing.DOWN, modelRot, (BlockPartRotation)null, scale, true));
list.add(faceBakery.makeBakedQuad(new Vector3f(3.0f, 3.0f, 14.0f), new Vector3f(13.0f, 13.0f, 15.0f), face, iron, EnumFacing.NORTH, modelRot, (BlockPartRotation)null, true, true));
list.add(faceBakery.makeBakedQuad(new Vector3f(3.0f, 3.0f, 14.0f), new Vector3f(13.0f, 13.0f, 15.0f), face, iron, EnumFacing.SOUTH, modelRot, (BlockPartRotation)null, true, true));
list.add(faceBakery.makeBakedQuad(new Vector3f(3.0f, 3.0f, 14.0f), new Vector3f(3.0f, 13.0f, 15.0f), face90, modeSprite, EnumFacing.WEST, modelRot, (BlockPartRotation)null, scale, true));
list.add(faceBakery.makeBakedQuad(new Vector3f(13.0f, 3.0f, 14.0f), new Vector3f(13.0f, 13.0f, 15.0f), face270, modeSprite, EnumFacing.EAST, modelRot, (BlockPartRotation)null, scale, true));
list.add(faceBakery.makeBakedQuad(new Vector3f(2.0f, 14.0f, 15.0f), new Vector3f(14.0f, 14.0f, 16.0f), face, iron, EnumFacing.UP, modelRot, (BlockPartRotation)null, true, true));
list.add(faceBakery.makeBakedQuad(new Vector3f(2.0f, 2.0f, 15.0f), new Vector3f(14.0f, 2.0f, 16.0f), face, iron, EnumFacing.DOWN, modelRot, (BlockPartRotation)null, true, true));
list.add(faceBakery.makeBakedQuad(new Vector3f(2.0f, 2.0f, 15.0f), new Vector3f(14.0f, 14.0f, 16.0f), face, iron, EnumFacing.NORTH, modelRot, (BlockPartRotation)null, true, true));
list.add(faceBakery.makeBakedQuad(new Vector3f(2.0f, 2.0f, 15.0f), new Vector3f(14.0f, 14.0f, 16.0f), face, iron, EnumFacing.SOUTH, modelRot, (BlockPartRotation)null, true, true));
list.add(faceBakery.makeBakedQuad(new Vector3f(2.0f, 2.0f, 15.0f), new Vector3f(2.0f, 14.0f, 16.0f), face, iron, EnumFacing.WEST, modelRot, (BlockPartRotation)null, true, true));
list.add(faceBakery.makeBakedQuad(new Vector3f(14.0f, 2.0f, 15.0f), new Vector3f(14.0f, 14.0f, 16.0f), face, iron, EnumFacing.EAST, modelRot, (BlockPartRotation)null, true, true));
}
}
示例8: getMeterQuads
public List<BakedQuad> getMeterQuads(EnumFacing face, int power, int maxPower){
Vector3f min = new Vector3f(2.75f,2.75f,2.75f);
Vector3f max = new Vector3f(13.25f,13.25f,13.25f);
String meter = "crystalmod:blocks/machine/battery/meter/";
String meterC = "crystalmod:blocks/machine/battery/meter/charged";
String meterU = "crystalmod:blocks/machine/battery/meter/uncharged";
TextureAtlasSprite meterUp = RenderUtil.getSprite(meterU);
TextureAtlasSprite meterDown = RenderUtil.getSprite(meterU);
TextureAtlasSprite meterSide = RenderUtil.getSprite(meter+"0");
if(power > 0){
meterDown = RenderUtil.getSprite(meterC);
meterSide = RenderUtil.getSprite(meter+(Math.min(8, state.battery.getScaledEnergyStored(9))));
}
if(power >= maxPower){
meterUp = RenderUtil.getSprite(meterC);
}
ModelRotation modelRot = ModelRotation.X0_Y0;
if(face == EnumFacing.SOUTH){
modelRot = ModelRotation.X0_Y180;
}
if(face == EnumFacing.WEST){
modelRot = ModelRotation.X0_Y270;
}
if(face == EnumFacing.EAST){
modelRot = ModelRotation.X0_Y90;
}
if(face == EnumFacing.UP){
modelRot = ModelRotation.X270_Y0;
}
if(face == EnumFacing.DOWN){
modelRot = ModelRotation.X90_Y0;
}
BlockFaceUV uvMeter = new BlockFaceUV(new float[] { 4f,4f,12f,12f }, 0);
BlockPartFace meterFace = new BlockPartFace((EnumFacing)null, 0, "", uvMeter);
List<BakedQuad> list = Lists.newArrayList();
list.add(faceBakery.makeBakedQuad(min, max, meterFace, meterUp, EnumFacing.UP, modelRot, (BlockPartRotation)null, false, true));
list.add(faceBakery.makeBakedQuad(min, max, meterFace, meterDown, EnumFacing.DOWN, modelRot, (BlockPartRotation)null, false, true));
list.add(faceBakery.makeBakedQuad(min, max, meterFace, meterSide, EnumFacing.NORTH, modelRot, (BlockPartRotation)null, false, true));
list.add(faceBakery.makeBakedQuad(min, max, meterFace, meterSide, EnumFacing.SOUTH, modelRot, (BlockPartRotation)null, false, true));
list.add(faceBakery.makeBakedQuad(min, max, meterFace, meterSide, EnumFacing.WEST, modelRot, (BlockPartRotation)null, false, true));
list.add(faceBakery.makeBakedQuad(min, max, meterFace, meterSide, EnumFacing.EAST, modelRot, (BlockPartRotation)null, false, true));
return list;
}
示例9: loadModel
@Alpha
@Override
public IModel loadModel(ResourceLocation resourceLocation) throws Exception {
try {
ModelResourceLocation modelLocation;
if (resourceLocation instanceof ModelResourceLocation)
modelLocation = (ModelResourceLocation) resourceLocation;
else
return null;
if (!modelLocation.getVariant().equals("inventory") && !modelLocation.getResourcePath().endsWith("_loc")) {
List<Variant> list = Lists.newLinkedList();
ModelRotation rotation = ModelRotation.X0_Y0;
switch (Tool.get(modelLocation.getVariant(), "facing=([a-z]*)")) {
case "east":
rotation = ModelRotation.X0_Y270;
break;
case "north":
rotation = ModelRotation.X0_Y180;
break;
case "west":
rotation = ModelRotation.X0_Y90;
break;
}
list.add(new Variant(new ModelResourceLocation(modelLocation.getResourceDomain() + ":" +
modelLocation.getResourcePath() + "_loc", modelLocation.getVariant()),
rotation, false, 1));
VariantList variantList = new VariantList(list);
return new ModelLoader.WeightedRandomModel(modelLocation, variantList);
}
modelLocation = new ModelResourceLocation(modelLocation.getResourceDomain() +
modelLocation.getResourcePath().replace("_loc", ""), modelLocation.getVariant());
String name = modelLocation.getVariant().contains("part=head") ? "head" : "foot";
String rely = Tool.isEmptyOr(Tool.get(modelLocation.getVariant(), "rely=([a-z]*)"), "null");
try (IResource resource = Minecraft.getMinecraft().getResourceManager()
.getResource(new ResourceLocation("skin:models/wardrobe_" + rely + "_" + name + ".json"))) {
String json = Joiner.on('\n').join(IOUtils.readLines(resource.getInputStream(), Charsets.UTF_8));
try (Reader reader = new StringReader(WoodType.conversion.apply(json, Tool.get(
modelLocation.getResourcePath(), "_(.*?_T_.*?_T_[0-9]*_T_.*?_T_.*?_T_[0-9]*)")))) {
ModelBlock modelBlock = ModelBlock.deserialize(reader);
return modelLocation.getVariant().equals("inventory") ? new ItemLayerModel(modelBlock) :
ModelLoader.VanillaLoader.INSTANCE.getLoader().new VanillaModelWrapper(modelLocation,
modelBlock, false, ModelBlockAnimation.defaultModelBlockAnimation);
}
}
} catch (Exception e) {
e.printStackTrace();
throw e;
}
}