本文整理汇总了Java中net.minecraft.client.renderer.block.model.ModelRotation类的典型用法代码示例。如果您正苦于以下问题:Java ModelRotation类的具体用法?Java ModelRotation怎么用?Java ModelRotation使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ModelRotation类属于net.minecraft.client.renderer.block.model包,在下文中一共展示了ModelRotation类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: drawGlassStump
import net.minecraft.client.renderer.block.model.ModelRotation; //导入依赖的package包/类
private void drawGlassStump(final ModelRotation modelRot, final List<BakedQuad> list) {
final boolean scale = false;
TextureAtlasSprite glass = RenderUtil.getSprite("crystalmod:blocks/pipe/power_plus");
float max = 11/*pixel*11.0F*/;
float min = 5/*pixel*5F*/;
final BlockPartFace face4 = new BlockPartFace((EnumFacing)null, 0, "", new BlockFaceUV(new float[] { min, max+4F, max, 16.0f }, 0));
final BlockPartFace face3 = new BlockPartFace((EnumFacing)null, 0, "", new BlockFaceUV(new float[] { min, max, min, 16.0f }, 0));
final BlockPartFace face2 = new BlockPartFace((EnumFacing)null, 0, "", new BlockFaceUV(new float[] { max, max, max, 16.0f }, 0));
final BlockPartFace face = new BlockPartFace((EnumFacing)null, 0, "", new BlockFaceUV(new float[] { min, max, max, 16.0f }, 0));
list.add(faceBakery.makeBakedQuad(new Vector3f(min, max, max), new Vector3f(max, max, 16.0f), face, glass, EnumFacing.UP, modelRot, (BlockPartRotation)null, scale, true));
list.add(faceBakery.makeBakedQuad(new Vector3f(min, min, max), new Vector3f(max, min, 16.0f), face4, glass, EnumFacing.DOWN, modelRot, (BlockPartRotation)null, scale, true));
list.add(faceBakery.makeBakedQuad(new Vector3f(min, min, max), new Vector3f(min, max, 16.0f), face3, glass, EnumFacing.WEST, modelRot, (BlockPartRotation)null, scale, true));
list.add(faceBakery.makeBakedQuad(new Vector3f(max, min, max), new Vector3f(max, max, 16.0f), face2, glass, EnumFacing.EAST, modelRot, (BlockPartRotation)null, scale, true));
}
示例2: CCFinalVariant
import net.minecraft.client.renderer.block.model.ModelRotation; //导入依赖的package包/类
public CCFinalVariant(ResourceLocation model, Optional<IModelState> state, boolean uvLock, boolean smooth, boolean gui3d, int weight, Map<String, String> textures, String textureDomain, Map<String, String> customData) {
super(model == null ? new ResourceLocation("builtin/missing") : model, state.get() instanceof ModelRotation ? ((ModelRotation) state.get()) : ModelRotation.X0_Y0, uvLock, weight);
this.state = state.orElse(TRSRTransformation.identity());
this.smooth = smooth;
this.gui3d = gui3d;
Map<String, String> newTextures = new HashMap<>();
for (Entry<String, String> entry : textures.entrySet()) {
String prefixedTexture = entry.getValue();
if (!entry.getValue().contains(":")) {
prefixedTexture = textureDomain + ":" + prefixedTexture;
}
newTextures.put(entry.getKey(), prefixedTexture);
}
this.textures = ImmutableMap.copyOf(newTextures);
this.customData = ImmutableMap.copyOf(customData);
}
示例3: getMatrix
import net.minecraft.client.renderer.block.model.ModelRotation; //导入依赖的package包/类
private static Matrix4f getMatrix(EnumFacing facing) {
switch (facing) {
case DOWN:
return ModelRotation.X180_Y0.getMatrix();
case UP:
return ModelRotation.X0_Y0.getMatrix();
case NORTH:
return ModelRotation.X90_Y0.getMatrix();
case SOUTH:
return ModelRotation.X90_Y180.getMatrix();
case WEST:
return ModelRotation.X90_Y270.getMatrix();
case EAST:
return ModelRotation.X90_Y90.getMatrix();
default:
return new Matrix4f();
}
}
示例4: getMatrix4f
import net.minecraft.client.renderer.block.model.ModelRotation; //导入依赖的package包/类
/**
* Find appropriate transformation assuming base model is oriented to Y orthogonalAxis, positive.
* This is different than the Minecraft/Forge default because I brain that way.<br><br>
*
* @see #getMatrixForAxisAndRotation(net.minecraft.util.EnumFacing.Axis, boolean, Rotation) for
* more explanation.
*/
protected static Matrix4f getMatrix4f(ModelState modelState)
{
if(modelState.hasAxis())
{
if(modelState.hasAxisRotation())
{
return getMatrixForAxisAndRotation(modelState.getAxis(), modelState.isAxisInverted(), modelState.getAxisRotation());
}
else
{
return getMatrixForAxis(modelState.getAxis(), modelState.isAxisInverted());
}
}
else if(modelState.hasAxisRotation())
{
return getMatrixForRotation(modelState.getAxisRotation());
}
else
{
return ForgeHooksClient.getMatrix(ModelRotation.X0_Y0);
}
}
示例5: getMatrixForAxis
import net.minecraft.client.renderer.block.model.ModelRotation; //导入依赖的package包/类
/**
* See {@link #getMatrixForAxisAndRotation(net.minecraft.util.EnumFacing.Axis, boolean, Rotation)}
*/
protected static Matrix4f getMatrixForAxis(EnumFacing.Axis axis, boolean isAxisInverted)
{
switch(axis)
{
case X:
return ForgeHooksClient.getMatrix(isAxisInverted ? ModelRotation.X90_Y270 : ModelRotation.X90_Y90);
case Y:
return ForgeHooksClient.getMatrix(isAxisInverted ? ModelRotation.X180_Y0 : ModelRotation.X0_Y0);
case Z:
return ForgeHooksClient.getMatrix(isAxisInverted ? ModelRotation.X90_Y0 : ModelRotation.X270_Y0);
default:
return ForgeHooksClient.getMatrix(ModelRotation.X0_Y0);
}
}
示例6: getMatrixForRotation
import net.minecraft.client.renderer.block.model.ModelRotation; //导入依赖的package包/类
/**
* See {@link #getMatrixForAxisAndRotation(net.minecraft.util.EnumFacing.Axis, boolean, Rotation)}
*/
protected static Matrix4f getMatrixForRotation(Rotation rotation)
{
switch(rotation)
{
default:
case ROTATE_NONE:
return ForgeHooksClient.getMatrix(ModelRotation.X0_Y0);
case ROTATE_90:
return ForgeHooksClient.getMatrix(ModelRotation.X0_Y90);
case ROTATE_180:
return ForgeHooksClient.getMatrix(ModelRotation.X0_Y180);
case ROTATE_270:
return ForgeHooksClient.getMatrix(ModelRotation.X0_Y270);
}
}
示例7: mapRender
import net.minecraft.client.renderer.block.model.ModelRotation; //导入依赖的package包/类
@SideOnly(Side.CLIENT)
private List<IBakedModel> mapRender(IBlockState state, @Nullable IBlockState paint) {
List<IBakedModel> result = new ArrayList<IBakedModel>();
if (state.getValue(UP)) {
result.add(PaintRegistry.getModel(IBakedModel.class, "wall_post", paint, null));
}
if (state.getValue(NORTH)) {
result.add(PaintRegistry.getModel(IBakedModel.class, "wall_side", paint, new UVLock(null)));
}
if (state.getValue(EAST)) {
result.add(PaintRegistry.getModel(IBakedModel.class, "wall_side", paint, new UVLock(ModelRotation.X0_Y90)));
}
if (state.getValue(SOUTH)) {
result.add(PaintRegistry.getModel(IBakedModel.class, "wall_side", paint, new UVLock(ModelRotation.X0_Y180)));
}
if (state.getValue(WEST)) {
result.add(PaintRegistry.getModel(IBakedModel.class, "wall_side", paint, new UVLock(ModelRotation.X0_Y270)));
}
return result;
}
示例8: mapRender
import net.minecraft.client.renderer.block.model.ModelRotation; //导入依赖的package包/类
@SideOnly(Side.CLIENT)
private List<IBakedModel> mapRender(IBlockState state, @Nullable IBlockState paint) {
List<IBakedModel> result = new ArrayList<IBakedModel>();
result.add(PaintRegistry.getModel(IBakedModel.class, "fence_post", paint, null));
if (state.getValue(BlockFence.NORTH)) {
result.add(PaintRegistry.getModel(IBakedModel.class, "fence_side", paint, new UVLock(null)));
}
if (state.getValue(BlockFence.EAST)) {
result.add(PaintRegistry.getModel(IBakedModel.class, "fence_side", paint, new UVLock(ModelRotation.X0_Y90)));
}
if (state.getValue(BlockFence.SOUTH)) {
result.add(PaintRegistry.getModel(IBakedModel.class, "fence_side", paint, new UVLock(ModelRotation.X0_Y180)));
}
if (state.getValue(BlockFence.WEST)) {
result.add(PaintRegistry.getModel(IBakedModel.class, "fence_side", paint, new UVLock(ModelRotation.X0_Y270)));
}
return result;
}
示例9: bake
import net.minecraft.client.renderer.block.model.ModelRotation; //导入依赖的package包/类
@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);
}
示例10: makeBakedQuad
import net.minecraft.client.renderer.block.model.ModelRotation; //导入依赖的package包/类
public static BakedQuad makeBakedQuad(EnumFacing p_makeBakedQuad_0_, TextureAtlasSprite p_makeBakedQuad_1_, int p_makeBakedQuad_2_)
{
Vector3f vector3f = new Vector3f(0.0F, 0.0F, 0.0F);
Vector3f vector3f1 = new Vector3f(16.0F, 16.0F, 16.0F);
BlockFaceUV blockfaceuv = new BlockFaceUV(new float[] {0.0F, 0.0F, 16.0F, 16.0F}, 0);
BlockPartFace blockpartface = new BlockPartFace(p_makeBakedQuad_0_, p_makeBakedQuad_2_, "#" + p_makeBakedQuad_0_.getName(), blockfaceuv);
ModelRotation modelrotation = ModelRotation.X0_Y0;
BlockPartRotation blockpartrotation = null;
boolean flag = false;
boolean flag1 = true;
FaceBakery facebakery = new FaceBakery();
BakedQuad bakedquad = facebakery.makeBakedQuad(vector3f, vector3f1, blockpartface, p_makeBakedQuad_1_, p_makeBakedQuad_0_, modelrotation, blockpartrotation, flag, flag1);
return bakedquad;
}
示例11: getMatrix
import net.minecraft.client.renderer.block.model.ModelRotation; //导入依赖的package包/类
public static Matrix4f getMatrix(ModelRotation modelRotation)
{
Matrix4f ret = new Matrix4f(TRSRTransformation.toVecmath(modelRotation.getMatrix4d())), tmp = new Matrix4f();
tmp.setIdentity();
tmp.m03 = tmp.m13 = tmp.m23 = .5f;
ret.mul(tmp, ret);
tmp.invert();
//tmp.m03 = tmp.m13 = tmp.m23 = -.5f;
ret.mul(tmp);
return ret;
}
示例12: ForgeVariant
import net.minecraft.client.renderer.block.model.ModelRotation; //导入依赖的package包/类
public ForgeVariant(ResourceLocation model, IModelState state, boolean uvLock, boolean smooth, boolean gui3d, int weight, ImmutableMap<String, String> textures, ImmutableMap<String, SubModel> parts, ImmutableMap<String, String> customData)
{
super(model == null ? new ResourceLocation("builtin/missing") : model, state instanceof ModelRotation ? (ModelRotation)state : ModelRotation.X0_Y0, uvLock, weight);
this.textures = textures;
this.parts = parts;
this.customData = customData;
this.state = state;
this.smooth = smooth;
this.gui3d = gui3d;
}
示例13: getMatrix
import net.minecraft.client.renderer.block.model.ModelRotation; //导入依赖的package包/类
@SideOnly(Side.CLIENT)
public static Matrix4f getMatrix(EnumFacing facing)
{
switch(facing)
{
case DOWN: return ModelRotation.X90_Y0.getMatrix();
case UP: return ModelRotation.X270_Y0.getMatrix();
case NORTH: return TRSRTransformation.identity.matrix;
case SOUTH: return ModelRotation.X0_Y180.getMatrix();
case WEST: return ModelRotation.X0_Y270.getMatrix();
case EAST: return ModelRotation.X0_Y90.getMatrix();
default: return new Matrix4f();
}
}
示例14: rotateVertex
import net.minecraft.client.renderer.block.model.ModelRotation; //导入依赖的package包/类
public int rotateVertex(Vector3f p_188011_1_, EnumFacing p_188011_2_, int p_188011_3_, net.minecraftforge.common.model.ITransformation p_188011_4_)
{
if (p_188011_4_ == ModelRotation.X0_Y0)
{
return p_188011_3_;
}
else
{
net.minecraftforge.client.ForgeHooksClient.transform(p_188011_1_, p_188011_4_.getMatrix());
return p_188011_4_.rotate(p_188011_2_, p_188011_3_);
}
}
示例15: CCFinalMultiVariant
import net.minecraft.client.renderer.block.model.ModelRotation; //导入依赖的package包/类
public CCFinalMultiVariant(CCVariant baseVariant, String textureDomain, Map<String, CCVariant> subModels) {
super(baseVariant.model == null ? new ResourceLocation("builtin/missing") : baseVariant.model, baseVariant.state.get() instanceof ModelRotation ? ((ModelRotation) baseVariant.state.get()) : ModelRotation.X0_Y0, baseVariant.uvLock.orElse(false), baseVariant.weight.orElse(1));
state = baseVariant.state.get();
this.baseVariant = makeFinalVariant(baseVariant, textureDomain);
this.baseProperties = new ModelProperties(baseVariant.smooth.orElse(true), baseVariant.gui3d.orElse(true));
for (CCVariant subModel : subModels.values()) {
finalVariants.add(makeFinalVariant(baseVariant.copy().with(subModel), textureDomain));
}
}