本文整理汇总了Java中net.minecraftforge.common.model.IModelState.apply方法的典型用法代码示例。如果您正苦于以下问题:Java IModelState.apply方法的具体用法?Java IModelState.apply怎么用?Java IModelState.apply使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraftforge.common.model.IModelState
的用法示例。
在下文中一共展示了IModelState.apply方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getPartTransform
import net.minecraftforge.common.model.IModelState; //导入方法依赖的package包/类
public TRSRTransformation getPartTransform(IModelState state, BlockPart part, int i)
{
ImmutableCollection<MBJointWeight> infos = getJoint(i);
if(!infos.isEmpty())
{
Matrix4f m = new Matrix4f(), tmp;
float weight = 0;
for(MBJointWeight info : infos)
{
if(info.getWeights().containsKey(i))
{
ModelBlockAnimation.MBJoint joint = new ModelBlockAnimation.MBJoint(info.getName(), part);
Optional<TRSRTransformation> trOp = state.apply(Optional.of(joint));
if(trOp.isPresent() && trOp.get() != TRSRTransformation.identity())
{
float w = info.getWeights().get(i)[0];
tmp = trOp.get().getMatrix();
tmp.mul(w);
m.add(tmp);
weight += w;
}
}
}
if(weight > 1e-5)
{
m.mul(1f / weight);
return new TRSRTransformation(m);
}
}
return null;
}
示例2: getTransforms
import net.minecraftforge.common.model.IModelState; //导入方法依赖的package包/类
public static ImmutableMap<TransformType, TRSRTransformation> getTransforms(IModelState state)
{
ImmutableMap.Builder<TransformType, TRSRTransformation> builder = ImmutableMap.builder();
for(TransformType type : TransformType.values())
{
Optional<TRSRTransformation> tr = state.apply(Optional.of(type));
if(tr.isPresent())
{
builder.put(type, tr.get());
}
}
return builder.build();
}
示例3: bake
import net.minecraftforge.common.model.IModelState; //导入方法依赖的package包/类
public IBakedModel bake(IModelState state, final VertexFormat format, Function<ResourceLocation, TextureAtlasSprite> bakedTextureGetter)
{
ImmutableList.Builder<BakedQuad> builder = ImmutableList.builder();
Optional<TRSRTransformation> transform = state.apply(Optional.<IModelPart>absent());
for(int i = 0; i < textures.size(); i++)
{
TextureAtlasSprite sprite = bakedTextureGetter.apply(textures.get(i));
builder.addAll(getQuadsForSprite(i, sprite, format, transform));
}
TextureAtlasSprite particle = bakedTextureGetter.apply(textures.isEmpty() ? new ResourceLocation("missingno") : textures.get(0));
ImmutableMap<TransformType, TRSRTransformation> map = IPerspectiveAwareModel.MapWrapper.getTransforms(state);
return new BakedItemModel(builder.build(), particle, map, overrides, null);
}
示例4: bake
import net.minecraftforge.common.model.IModelState; //导入方法依赖的package包/类
public IBakedModel bake(IModelState state, VertexFormat format, Function<ResourceLocation, TextureAtlasSprite> bakedTextureGetter)
{
ImmutableMap<TransformType, TRSRTransformation> map = IPerspectiveAwareModel.MapWrapper.getTransforms(state);
return new BakedFluid(state.apply(Optional.<IModelPart>absent()), map, format, fluid.getColor(), bakedTextureGetter.apply(fluid.getStill()), bakedTextureGetter.apply(fluid.getFlowing()), fluid.isGaseous(), Optional.<IExtendedBlockState>absent());
}