当前位置: 首页>>代码示例>>Java>>正文


Java ModelRotation.X0_Y270属性代码示例

本文整理汇总了Java中net.minecraft.client.renderer.block.model.ModelRotation.X0_Y270属性的典型用法代码示例。如果您正苦于以下问题:Java ModelRotation.X0_Y270属性的具体用法?Java ModelRotation.X0_Y270怎么用?Java ModelRotation.X0_Y270使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在net.minecraft.client.renderer.block.model.ModelRotation的用法示例。


在下文中一共展示了ModelRotation.X0_Y270属性的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);
}
 
开发者ID:the-realest-stu,项目名称:Etheric,代码行数:37,代码来源:PipeModel.java

示例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);
}
 
开发者ID:SleepyTrousers,项目名称:EnderIO,代码行数:34,代码来源:BlockPaintedTrapDoor.java

示例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);
  }
}
 
开发者ID:SleepyTrousers,项目名称:EnderIO,代码行数:27,代码来源:BlockPaintedPressurePlate.java

示例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));
       
	
}
 
开发者ID:Alec-WAM,项目名称:CrystalMod,代码行数:61,代码来源:AttachmentEStorageExport.java

示例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));
}
 
开发者ID:Alec-WAM,项目名称:CrystalMod,代码行数:60,代码来源:AttachmentEStorageSensor.java

示例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));
}
 
开发者ID:Alec-WAM,项目名称:CrystalMod,代码行数:57,代码来源:AttachmentEStorageImport.java

示例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));
    }
}
 
开发者ID:Alec-WAM,项目名称:CrystalMod,代码行数:79,代码来源:ModelPipeBaked.java

示例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;
  }
 
开发者ID:Alec-WAM,项目名称:CrystalMod,代码行数:49,代码来源:ModelBattery.java

示例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;
	}
}
 
开发者ID:NekoCaffeine,项目名称:Alchemy,代码行数:49,代码来源:WardrobeModelLoader.java


注:本文中的net.minecraft.client.renderer.block.model.ModelRotation.X0_Y270属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。