• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java Attributes类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中net.minecraftforge.client.model.Attributes的典型用法代码示例。如果您正苦于以下问题:Java Attributes类的具体用法?Java Attributes怎么用?Java Attributes使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Attributes类属于net.minecraftforge.client.model包,在下文中一共展示了Attributes类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: addBakedQuadRotated

import net.minecraftforge.client.model.Attributes; //导入依赖的package包/类
/**
 * Add a given rotated quad to a list of quads.
 * @param quads The quads to append to.
 * @param x1 Start X
 * @param x2 End X
 * @param z1 Start Z
 * @param z2 End Z
 * @param y Y
 * @param texture The base texture
 * @param side The side to add render quad at.
 * @param rotation The rotation index to rotate by.
 * @param isColored When set to true a colored baked quad will be made, otherwise a regular baked quad is used.
 * @param shadeColor The shade color
 * @param uvs A double array of 4 uv pairs
 */
public static void addBakedQuadRotated(List<BakedQuad> quads, float x1, float x2, float z1, float z2, float y,
                                          TextureAtlasSprite texture, EnumFacing side, int rotation,
                                          boolean isColored, int shadeColor, float[][] uvs) {
    Vec3d v1 = rotate(new Vec3d(x1 - .5, y - .5, z1 - .5), side).addVector(.5, .5, .5);
    Vec3d v2 = rotate(new Vec3d(x1 - .5, y - .5, z2 - .5), side).addVector(.5, .5, .5);
    Vec3d v3 = rotate(new Vec3d(x2 - .5, y - .5, z2 - .5), side).addVector(.5, .5, .5);
    Vec3d v4 = rotate(new Vec3d(x2 - .5, y - .5, z1 - .5), side).addVector(.5, .5, .5);
    int[] data =  Ints.concat(
            vertexToInts((float) v1.xCoord, (float) v1.yCoord, (float) v1.zCoord, shadeColor, texture, uvs[(0 + rotation) % 4][0] * 16, uvs[(0 + rotation) % 4][1] * 16),
            vertexToInts((float) v2.xCoord, (float) v2.yCoord, (float) v2.zCoord, shadeColor, texture, uvs[(1 + rotation) % 4][0] * 16, uvs[(1 + rotation) % 4][1] * 16),
            vertexToInts((float) v3.xCoord, (float) v3.yCoord, (float) v3.zCoord, shadeColor, texture, uvs[(2 + rotation) % 4][0] * 16, uvs[(2 + rotation) % 4][1] * 16),
            vertexToInts((float) v4.xCoord, (float) v4.yCoord, (float) v4.zCoord, shadeColor, texture, uvs[(3 + rotation) % 4][0] * 16, uvs[(3 + rotation) % 4][1] * 16)
    );
    ForgeHooksClient.fillNormal(data, side); // This fixes lighting issues when item is rendered in hand/inventory
    quads.add(new BakedQuad(data, -1, side, texture, false, Attributes.DEFAULT_BAKED_FORMAT));
}
 
开发者ID:Alec-WAM,项目名称:CrystalMod,代码行数:32,代码来源:DynamicBaseModel.java


示例2: getActualModel

import net.minecraftforge.client.model.Attributes; //导入依赖的package包/类
protected  IBakedModel getActualModel(String texture)
{
    IBakedModel bakedModel = standard;

    if (texture!=null)
    {
        if (cache.containsKey(texture))
        {
            bakedModel = cache.get(texture);
        }
        else if (retexturableModel != null)
        {
            ImmutableMap.Builder<String, String> builder = ImmutableMap.builder();
            builder.put("bottom", texture);
            builder.put("top", texture);
            builder.put("side", texture);
            IModel retexturedModel = retexturableModel.retexture(builder.build());
            bakedModel = retexturedModel.bake(TRSRTransformation.identity(), Attributes.DEFAULT_BAKED_FORMAT, ModelLoader.defaultTextureGetter());
            cache.put(texture, bakedModel);
        }
    }

    return bakedModel;
}
 
开发者ID:M4thG33k,项目名称:TombManyGraves,代码行数:25,代码来源:GoodGraveModel.java


示例3: getModelsForGroups

import net.minecraftforge.client.model.Attributes; //导入依赖的package包/类
public static HashMap<String, IBakedModel> getModelsForGroups (OBJModel objModel) {

        HashMap<String, IBakedModel> modelParts = new HashMap<String, IBakedModel>();

        if (!objModel.getMatLib().getGroups().keySet().isEmpty()) {
        	for (String key : objModel.getMatLib().getGroups().keySet()) {
        		if (!modelParts.containsKey(key)) { 
        			modelParts.put(key, objModel.bake(new OBJModel.OBJState(ImmutableList.of(key), false), Attributes.DEFAULT_BAKED_FORMAT, ModelHelper.textureGetterFlipV));
        		}
        	}
        }

        modelParts.put(ALL_PARTS, objModel.bake(objModel.getDefaultState(), Attributes.DEFAULT_BAKED_FORMAT, textureGetterFlipV));

        return modelParts;
    }
 
开发者ID:Wehavecookies56,项目名称:Kingdom-Keys-Re-Coded,代码行数:17,代码来源:ModelHelper.java


示例4: bake

import net.minecraftforge.client.model.Attributes; //导入依赖的package包/类
@Override
public IFlexibleBakedModel bake(IModelState state, VertexFormat format, Function<ResourceLocation, TextureAtlasSprite> bakedTextureGetter)
{
    if(!Attributes.moreSpecific(format, Attributes.DEFAULT_BAKED_FORMAT))
    {
        throw new IllegalArgumentException("can't bake vanilla models to the format that doesn't fit into the default one: " + format);
    }

    ItemIconModel test = new ItemIconModel(this, state, bakedTextureGetter);

    return test;
}
 
开发者ID:noto0648,项目名称:SasaLib,代码行数:13,代码来源:SimpleIconModel.java


示例5: ItemIconModel

import net.minecraftforge.client.model.Attributes; //导入依赖的package包/类
public ItemIconModel(IModel modelCls, IModelState state, Function<ResourceLocation, TextureAtlasSprite> bakedTextureGetter)
{
    super(false, false, null, Attributes.DEFAULT_BAKED_FORMAT, bakedTextureGetter);
    this.textureLocation = null;

    this.state = state;
    this.iModel = modelCls;
}
 
开发者ID:noto0648,项目名称:SasaLib,代码行数:9,代码来源:ItemIconModel.java


示例6: paintModel

import net.minecraftforge.client.model.Attributes; //导入依赖的package包/类
@SideOnly(Side.CLIENT)
private IBakedModel paintModel(IModel sourceModel, final @Nullable IBlockState paintSource, IModelState rotation, final PaintMode paintMode) {
  IModelState state = sourceModel.getDefaultState();
  state = combine(state, rotation);
  if (state instanceof UVLock) {
    sourceModel = ModelProcessingHelper.uvlock(sourceModel, true);
    state = ((UVLock) state).getParent();
  }
  return sourceModel.bake(state, Attributes.DEFAULT_BAKED_FORMAT, new Function<ResourceLocation, TextureAtlasSprite>() {
    @Override
    public TextureAtlasSprite apply(@Nullable ResourceLocation location) {
      String locationString = location == null ? "" : location.toString();
      if (paintMode != PaintMode.TAGGED_TEXTURES || locationString.endsWith("PAINT")) {
        if (paintSource == null) {
          return Minecraft.getMinecraft().getTextureMapBlocks().getMissingSprite();
        } else {
          return Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().getTexture(paintSource);
        }
      } else {
        return Minecraft.getMinecraft().getTextureMapBlocks().getAtlasSprite(locationString);
      }
    }

    @Override
    public boolean equals(@Nullable Object obj) {
      return super.equals(obj);
    }

    @Override
    public int hashCode() {
      return super.hashCode();
    }
  });
}
 
开发者ID:SleepyTrousers,项目名称:EnderIO,代码行数:35,代码来源:PaintRegistry.java


示例7: bake

import net.minecraftforge.client.model.Attributes; //导入依赖的package包/类
public static IBakedModel bake(IModel model) {
	return model.bake(TRSRTransformation.identity(), Attributes.DEFAULT_BAKED_FORMAT,
			ModelLoader.defaultTextureGetter());
}
 
开发者ID:Error22,项目名称:Thelta,代码行数:5,代码来源:TileEntityRendererMachineArm.java


示例8: bake

import net.minecraftforge.client.model.Attributes; //导入依赖的package包/类
public static IBakedModel bake(IModel model)
{
    return model.bake(TRSRTransformation.identity(), Attributes.DEFAULT_BAKED_FORMAT, ModelLoader.defaultTextureGetter());
}
 
开发者ID:M4thG33k,项目名称:TombManyGraves,代码行数:5,代码来源:ModelHelper.java


示例9: bake

import net.minecraftforge.client.model.Attributes; //导入依赖的package包/类
public static IBakedModel bake(IModel model, IModelState modelState) {
	return bake(model, modelState, Attributes.DEFAULT_BAKED_FORMAT);
}
 
开发者ID:hea3ven,项目名称:CommonUtils,代码行数:4,代码来源:BakerUtil.java


示例10: getFormat

import net.minecraftforge.client.model.Attributes; //导入依赖的package包/类
public VertexFormat getFormat()
{
    return Attributes.DEFAULT_BAKED_FORMAT;
}
 
开发者ID:tyronx,项目名称:vintagecraft,代码行数:5,代码来源:VCraftModelLoader.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Procedure类代码示例发布时间:2022-05-22
下一篇:
Java UnionBranch类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap