本文整理汇总了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));
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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();
}
});
}
示例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());
}
示例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());
}
示例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);
}
示例10: getFormat
import net.minecraftforge.client.model.Attributes; //导入依赖的package包/类
public VertexFormat getFormat()
{
return Attributes.DEFAULT_BAKED_FORMAT;
}