mirror of
https://github.com/GTNewHorizons/EnderIO.git
synced 2026-11-18 11:29:30 +00:00
Partially implement telepad model
This commit is contained in:
1 parent
2e8062231c
commit
8605d02f3e
14 files changed
+174
-80
No files matched your search
@@ -129,7 +129,11 @@ import crazypants.enderio.teleport.TravelController;
|
||||
import crazypants.enderio.teleport.anchor.BlockTravelAnchor;
|
||||
import crazypants.enderio.teleport.anchor.TileTravelAnchor;
|
||||
import crazypants.enderio.teleport.anchor.TravelEntitySpecialRenderer;
|
||||
import crazypants.enderio.teleport.telepad.BlockTelePad;
|
||||
import crazypants.enderio.teleport.telepad.TelePadRenderer;
|
||||
import crazypants.enderio.teleport.telepad.TelePadSpecialRenderer;
|
||||
import crazypants.enderio.teleport.telepad.TeleportEntityRenderHandler;
|
||||
import crazypants.enderio.teleport.telepad.TileTelePad;
|
||||
import crazypants.render.IconUtil;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@@ -334,6 +338,10 @@ public class ClientProxy extends CommonProxy {
|
||||
BlockTravelAnchor.renderId = RenderingRegistry.getNextAvailableRenderId();
|
||||
RenderingRegistry.registerBlockHandler(new PaintedBlockRenderer(BlockTravelAnchor.renderId, EnderIO.blockTravelPlatform));
|
||||
|
||||
BlockTelePad.renderId = RenderingRegistry.getNextAvailableRenderId();
|
||||
RenderingRegistry.registerBlockHandler(new TelePadRenderer());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileTelePad.class, new TelePadSpecialRenderer());
|
||||
|
||||
MinecraftForgeClient.registerItemRenderer(EnderIO.itemMachinePart, new MachinePartRenderer());
|
||||
MinecraftForgeClient.registerItemRenderer(EnderIO.itemConduitFacade, new FacadeRenderer());
|
||||
|
||||
|
||||
@@ -62,6 +62,7 @@ import crazypants.enderio.machine.painter.PainterUtil;
|
||||
import crazypants.enderio.network.PacketHandler;
|
||||
import crazypants.enderio.tool.ToolUtil;
|
||||
import crazypants.render.BoundingBox;
|
||||
import crazypants.render.RenderUtil;
|
||||
import crazypants.util.IFacade;
|
||||
import crazypants.util.Util;
|
||||
|
||||
@@ -331,11 +332,10 @@ public class BlockConduitBundle extends BlockEio implements IGuiHandler, IFacade
|
||||
return 1;
|
||||
}
|
||||
|
||||
public static volatile int theRenderPass;
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean canRenderInPass(int pass) {
|
||||
theRenderPass = pass;
|
||||
RenderUtil.theRenderPass = pass;
|
||||
return pass == 0 || pass == 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -111,7 +111,7 @@ public class ConduitBundleRenderer extends TileEntitySpecialRenderer implements
|
||||
//enable the alpha pass based on state so the only work around is to ensure we always render something in this
|
||||
//pass. Throwing in a polygon with a 0 area does the job
|
||||
//See: https://github.com/MinecraftForge/MinecraftForge/issues/981
|
||||
if(BlockConduitBundle.theRenderPass == 1) {
|
||||
if(RenderUtil.theRenderPass == 1) {
|
||||
Tessellator.instance.addVertexWithUV(x, y, z, 0, 0);
|
||||
Tessellator.instance.addVertexWithUV(x, y, z, 0, 0);
|
||||
Tessellator.instance.addVertexWithUV(x, y, z, 0, 0);
|
||||
@@ -124,7 +124,7 @@ public class ConduitBundleRenderer extends TileEntitySpecialRenderer implements
|
||||
boolean renderedFacade = renderFacade(x, y, z, rb, bundle, player);
|
||||
boolean renderConduit = !renderedFacade || ConduitUtil.isFacadeHidden(bundle, player);
|
||||
|
||||
if(renderConduit && (BlockConduitBundle.theRenderPass == 0 || rb.overrideBlockTexture != null)) {
|
||||
if(renderConduit && (RenderUtil.theRenderPass == 0 || rb.overrideBlockTexture != null)) {
|
||||
BlockCoord loc = bundle.getLocation();
|
||||
float brightness;
|
||||
if(!Config.updateLightingWhenHidingFacades && bundle.hasFacade() && ConduitUtil.isFacadeHidden(bundle, player)) {
|
||||
@@ -162,8 +162,8 @@ public class ConduitBundleRenderer extends TileEntitySpecialRenderer implements
|
||||
bundle.setFacadeRenderAs(FacadeRenderState.FULL);
|
||||
boolean isFacadeOpaque = facadeId.isOpaqueCube();
|
||||
|
||||
if((isFacadeOpaque && BlockConduitBundle.theRenderPass == 0) ||
|
||||
(rb.hasOverrideBlockTexture() || (!isFacadeOpaque && BlockConduitBundle.theRenderPass == 1))) {
|
||||
if((isFacadeOpaque && RenderUtil.theRenderPass == 0) ||
|
||||
(rb.hasOverrideBlockTexture() || (!isFacadeOpaque && RenderUtil.theRenderPass == 1))) {
|
||||
IBlockAccess origBa = rb.blockAccess;
|
||||
rb.blockAccess = new FacadeAccessWrapper(origBa);
|
||||
try {
|
||||
|
||||
@@ -20,6 +20,7 @@ import crazypants.enderio.teleport.ContainerTravelAccessable;
|
||||
import crazypants.enderio.teleport.ContainerTravelAuth;
|
||||
import crazypants.enderio.teleport.GuiTravelAuth;
|
||||
import crazypants.enderio.teleport.anchor.BlockTravelAnchor;
|
||||
import crazypants.render.RenderUtil;
|
||||
|
||||
public class BlockTelePad extends BlockTravelAnchor {
|
||||
|
||||
@@ -27,6 +28,10 @@ public class BlockTelePad extends BlockTravelAnchor {
|
||||
private IIcon unconnected;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon connected;
|
||||
@SideOnly(Side.CLIENT)
|
||||
IIcon animationIcon;
|
||||
|
||||
public static int renderId;
|
||||
|
||||
public static BlockTelePad create() {
|
||||
BlockTelePad ret = new BlockTelePad();
|
||||
@@ -51,8 +56,9 @@ public class BlockTelePad extends BlockTravelAnchor {
|
||||
|
||||
@Override
|
||||
public void registerBlockIcons(IIconRegister iIconRegister) {
|
||||
unconnected = iIconRegister.registerIcon("EnderIO:blockTelePad");
|
||||
connected = iIconRegister.registerIcon("EnderIO:blockTelePadConnected");
|
||||
unconnected = iIconRegister.registerIcon("enderio:blockTelePad");
|
||||
connected = iIconRegister.registerIcon("enderio:telePadModel");
|
||||
animationIcon = iIconRegister.registerIcon("enderio:telePadAnimation");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -71,9 +77,22 @@ public class BlockTelePad extends BlockTravelAnchor {
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return 0;
|
||||
return renderId;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getRenderBlockPass() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean canRenderInPass(int pass) {
|
||||
RenderUtil.theRenderPass = pass;
|
||||
return pass <= 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNeighborBlockChange(World world, int x, int y, int z, Block changedTo) {
|
||||
super.onNeighborBlockChange(world, x, y, z, changedTo);
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
package crazypants.enderio.teleport.telepad;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraftforge.client.model.obj.GroupObject;
|
||||
import crazypants.render.CubeRenderer;
|
||||
import crazypants.render.RenderUtil;
|
||||
import crazypants.render.TechneModelRenderer;
|
||||
import crazypants.render.TechneUtil;
|
||||
|
||||
public class TelePadRenderer extends TechneModelRenderer {
|
||||
|
||||
private List<GroupObject> glass = TechneUtil.getModel("models/telePadGlass");
|
||||
|
||||
public TelePadRenderer() {
|
||||
super("models/telePad", BlockTelePad.renderId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
|
||||
TileTelePad te = (TileTelePad) world.getTileEntity(x, y, z);
|
||||
IIcon cached = renderer.overrideBlockTexture;
|
||||
boolean ret = true;
|
||||
if(te.inNetwork()) {
|
||||
renderer.overrideBlockTexture = null;
|
||||
if(te.isMaster()) {
|
||||
if(RenderUtil.theRenderPass == 0) {
|
||||
super.renderWorldBlock(world, x, y, z, block, modelId, renderer);
|
||||
} else {
|
||||
TechneUtil.renderWorldBlock(glass, world, x, y, z, block, renderer);
|
||||
}
|
||||
} else {
|
||||
ret = false;
|
||||
}
|
||||
} else {
|
||||
renderer.renderStandardBlock(block, x, y, z);
|
||||
}
|
||||
renderer.overrideBlockTexture = cached;
|
||||
return ret;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) {
|
||||
CubeRenderer.render(block, metadata);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package crazypants.enderio.teleport.telepad;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.client.model.obj.GroupObject;
|
||||
import crazypants.render.TechneUtil;
|
||||
|
||||
public class TelePadSpecialRenderer extends TileEntitySpecialRenderer {
|
||||
|
||||
// This will probably need to be a Map<String, GroupObject>
|
||||
private List<GroupObject> model = TechneUtil.getModel("models/telePadAnimation");
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity te, double x, double y, double z, float p_147500_8_) {
|
||||
// TODO spin the spinny thingies
|
||||
if(((TileTelePad) te).isMaster()) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(x, y, z);
|
||||
// not working
|
||||
TechneUtil.renderWithIcon(model, ((BlockTelePad) te.getBlockType()).animationIcon, null, Tessellator.instance, te.getWorldObj(), 0, 0, 0);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,30 +1,5 @@
|
||||
package crazypants.render;
|
||||
|
||||
import static net.minecraftforge.common.util.ForgeDirection.DOWN;
|
||||
import static net.minecraftforge.common.util.ForgeDirection.EAST;
|
||||
import static net.minecraftforge.common.util.ForgeDirection.NORTH;
|
||||
import static net.minecraftforge.common.util.ForgeDirection.SOUTH;
|
||||
import static net.minecraftforge.common.util.ForgeDirection.UP;
|
||||
import static net.minecraftforge.common.util.ForgeDirection.WEST;
|
||||
import static org.lwjgl.opengl.GL11.GL_ALL_ATTRIB_BITS;
|
||||
import static org.lwjgl.opengl.GL11.GL_ALPHA_TEST;
|
||||
import static org.lwjgl.opengl.GL11.GL_BLEND;
|
||||
import static org.lwjgl.opengl.GL11.GL_CULL_FACE;
|
||||
import static org.lwjgl.opengl.GL11.GL_ONE;
|
||||
import static org.lwjgl.opengl.GL11.GL_ONE_MINUS_SRC_ALPHA;
|
||||
import static org.lwjgl.opengl.GL11.GL_SMOOTH;
|
||||
import static org.lwjgl.opengl.GL11.GL_SRC_ALPHA;
|
||||
import static org.lwjgl.opengl.GL11.GL_TEXTURE_2D;
|
||||
import static org.lwjgl.opengl.GL11.GL_ZERO;
|
||||
import static org.lwjgl.opengl.GL11.glDepthMask;
|
||||
import static org.lwjgl.opengl.GL11.glDisable;
|
||||
import static org.lwjgl.opengl.GL11.glEnable;
|
||||
import static org.lwjgl.opengl.GL11.glPopAttrib;
|
||||
import static org.lwjgl.opengl.GL11.glPushAttrib;
|
||||
import static org.lwjgl.opengl.GL11.glRotatef;
|
||||
import static org.lwjgl.opengl.GL11.glShadeModel;
|
||||
import static org.lwjgl.opengl.GL11.glTranslatef;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.nio.FloatBuffer;
|
||||
import java.util.ArrayList;
|
||||
@@ -69,6 +44,9 @@ import crazypants.vecmath.Vector4d;
|
||||
import crazypants.vecmath.Vector4f;
|
||||
import crazypants.vecmath.Vertex;
|
||||
|
||||
import static net.minecraftforge.common.util.ForgeDirection.*;
|
||||
import static org.lwjgl.opengl.GL11.*;
|
||||
|
||||
public class RenderUtil {
|
||||
|
||||
public static final Vector4f DEFAULT_TEXT_SHADOW_COL = new Vector4f(0.33f, 0.33f, 0.33f, 0.33f);
|
||||
@@ -112,9 +90,15 @@ public class RenderUtil {
|
||||
MATRIX_BUFFER.rewind();
|
||||
GL11.glLoadMatrix(MATRIX_BUFFER);
|
||||
}
|
||||
|
||||
|
||||
private static Field timerField = initTimer();
|
||||
|
||||
|
||||
/**
|
||||
* Non-thread-safe holder for the current render pass. You must update this in
|
||||
* your block's canRenderInPass method for it to work properly!
|
||||
*/
|
||||
public static volatile int theRenderPass = 0;
|
||||
|
||||
private static Field initTimer() {
|
||||
Field f = null;
|
||||
try {
|
||||
@@ -126,7 +110,7 @@ public class RenderUtil {
|
||||
}
|
||||
return f;
|
||||
}
|
||||
|
||||
|
||||
@Nullable
|
||||
public static Timer getTimer() {
|
||||
if(timerField == null) {
|
||||
@@ -354,12 +338,13 @@ public class RenderUtil {
|
||||
}
|
||||
}
|
||||
|
||||
public static void renderConnectedTextureFace(IBlockAccess blockAccess, Block block, int x, int y, int z, ForgeDirection face, IIcon texture, boolean forceAllEdges) {
|
||||
public static void renderConnectedTextureFace(IBlockAccess blockAccess, Block block, int x, int y, int z, ForgeDirection face, IIcon texture,
|
||||
boolean forceAllEdges) {
|
||||
renderConnectedTextureFace(blockAccess, block, x, y, z, face, texture, forceAllEdges, true, true);
|
||||
}
|
||||
|
||||
public static void renderConnectedTextureFace(IBlockAccess blockAccess, Block block, int x, int y, int z, ForgeDirection face, IIcon texture, boolean forceAllEdges,
|
||||
boolean translateToXYZ, boolean applyFaceShading) {
|
||||
public static void renderConnectedTextureFace(IBlockAccess blockAccess, Block block, int x, int y, int z, ForgeDirection face, IIcon texture,
|
||||
boolean forceAllEdges, boolean translateToXYZ, boolean applyFaceShading) {
|
||||
|
||||
if((blockAccess == null && !forceAllEdges) || face == null || texture == null) {
|
||||
return;
|
||||
@@ -398,10 +383,10 @@ public class RenderUtil {
|
||||
float xLen = 1 - Math.abs(edge.offsetX) * scaleFactor;
|
||||
float yLen = 1 - Math.abs(edge.offsetY) * scaleFactor;
|
||||
float zLen = 1 - Math.abs(edge.offsetZ) * scaleFactor;
|
||||
|
||||
xLen -= 2* (1 - block.getBlockBoundsMaxX()) - block.getBlockBoundsMinX();
|
||||
yLen -= 2* (1 - block.getBlockBoundsMaxY()) - block.getBlockBoundsMinY();
|
||||
zLen -= 2* (1 - block.getBlockBoundsMaxZ()) - block.getBlockBoundsMinZ();
|
||||
|
||||
xLen -= 2 * (1 - block.getBlockBoundsMaxX()) - block.getBlockBoundsMinX();
|
||||
yLen -= 2 * (1 - block.getBlockBoundsMaxY()) - block.getBlockBoundsMinY();
|
||||
zLen -= 2 * (1 - block.getBlockBoundsMaxZ()) - block.getBlockBoundsMinZ();
|
||||
|
||||
BoundingBox bb = BoundingBox.UNIT_CUBE.scale(xLen, yLen, zLen);
|
||||
|
||||
@@ -435,7 +420,8 @@ public class RenderUtil {
|
||||
return getNonConectedEdgesForFace(blockAccess, x, y, z, face, null);
|
||||
}
|
||||
|
||||
public static List<ForgeDirection> getNonConectedEdgesForFace(IBlockAccess blockAccess, int x, int y, int z, ForgeDirection face, IConnectedTextureRenderer render) {
|
||||
public static List<ForgeDirection> getNonConectedEdgesForFace(IBlockAccess blockAccess, int x, int y, int z, ForgeDirection face,
|
||||
IConnectedTextureRenderer render) {
|
||||
|
||||
Block block = blockAccess.getBlock(x, y, z);
|
||||
if(block == null) {
|
||||
|
||||
@@ -4,56 +4,36 @@ import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraftforge.client.model.obj.GroupObject;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||
import crazypants.enderio.machine.AbstractMachineEntity;
|
||||
|
||||
public class TechneModelRenderer implements ISimpleBlockRenderingHandler {
|
||||
|
||||
private List<GroupObject> model;
|
||||
private int renderId;
|
||||
|
||||
protected VertexTransform vt = new VertexRotationFacing(ForgeDirection.NORTH);
|
||||
protected VertexTransform vt;
|
||||
|
||||
private boolean vtDefault = true;
|
||||
|
||||
public TechneModelRenderer(String modelPath, int renderId) {
|
||||
this(modelPath, renderId, null);
|
||||
}
|
||||
|
||||
/** {@link #shouldRotate()} has no effect as {@link #vt} overrides it */
|
||||
public TechneModelRenderer(String modelPath, int renderId, VertexTransform vt) {
|
||||
model = TechneUtil.getModel(modelPath);
|
||||
this.renderId = renderId;
|
||||
if(vt != null) {
|
||||
this.vt = vt;
|
||||
vtDefault = false;
|
||||
}
|
||||
this.vt = vt;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) {
|
||||
if(useVT()) {
|
||||
if(vtDefault) {
|
||||
((VertexRotationFacing) vt).setRotation(ForgeDirection.SOUTH);
|
||||
}
|
||||
TechneUtil.vt = this.vt;
|
||||
}
|
||||
TechneUtil.vt = this.vt;
|
||||
TechneUtil.renderInventoryBlock(model, block, metadata, renderer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
|
||||
if(useVT()) {
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
if(vtDefault && te instanceof AbstractMachineEntity) {
|
||||
((VertexRotationFacing) vt).setRotation(((AbstractMachineEntity) te).getFacingDir());
|
||||
}
|
||||
TechneUtil.vt = this.vt;
|
||||
}
|
||||
TechneUtil.vt = this.vt;
|
||||
return TechneUtil.renderWorldBlock(model, world, x, y, z, block, renderer);
|
||||
}
|
||||
|
||||
@@ -66,12 +46,4 @@ public class TechneModelRenderer implements ISimpleBlockRenderingHandler {
|
||||
public int getRenderId() {
|
||||
return renderId;
|
||||
}
|
||||
|
||||
private boolean useVT() {
|
||||
return shouldRotate() || !vtDefault;
|
||||
}
|
||||
|
||||
protected boolean shouldRotate() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -128,6 +128,8 @@ public class TechneUtil {
|
||||
|
||||
Vector4f vec = new Vector4f();
|
||||
List<GroupObject> res = new ArrayList<GroupObject>();
|
||||
|
||||
|
||||
for (ModelBox box : (List<ModelBox>) model.cubeList) {
|
||||
GroupObject obj = new GroupObject("", GL11.GL_QUADS);
|
||||
TexturedQuad[] quads = (TexturedQuad[]) ObfuscationReflectionHelper.getPrivateValue(ModelBox.class, box, "quadList", "field_78254_i");
|
||||
@@ -147,6 +149,14 @@ public class TechneUtil {
|
||||
|
||||
face.vertices[j] = new Vertex(vec.x / vec.w, vec.y / vec.w, vec.z / vec.w);
|
||||
|
||||
// Increase the interpolation scale by multiples of 2
|
||||
while (pv.texturePositionX > uMult) {
|
||||
uMult *= 2;
|
||||
}
|
||||
while (pv.texturePositionY > vMult) {
|
||||
vMult *= 2;
|
||||
}
|
||||
|
||||
face.textureCoordinates[j] = new TextureCoordinate(pv.texturePositionX, pv.texturePositionY);
|
||||
}
|
||||
face.faceNormal = face.calculateFaceNormal();
|
||||
@@ -154,6 +164,7 @@ public class TechneUtil {
|
||||
}
|
||||
res.add(obj);
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -169,6 +180,9 @@ public class TechneUtil {
|
||||
return bakeModel(model, scale, m, false);
|
||||
}
|
||||
|
||||
// Used in the second pass of baking to adjust UVs to the proper interpolation
|
||||
private static int uMult = 1, vMult = 1;
|
||||
|
||||
/**
|
||||
* Use this to convert TechneModel to it's static representation
|
||||
*/
|
||||
@@ -176,10 +190,26 @@ public class TechneUtil {
|
||||
public static List<GroupObject> bakeModel(TechneModel model, float scale, Matrix4f m, boolean rotateYFirst) {
|
||||
Map<String, ModelRenderer> parts = (Map<String, ModelRenderer>) ObfuscationReflectionHelper.getPrivateValue(TechneModel.class, model, "parts");
|
||||
List<GroupObject> res = Lists.newArrayList();
|
||||
|
||||
for (Map.Entry<String, ModelRenderer> e : parts.entrySet()) {
|
||||
GroupObject obj = bakeModel(e.getValue(), scale, m, rotateYFirst).get(0);
|
||||
res.add(obj);
|
||||
}
|
||||
|
||||
// Second pass, adjust the UVs to be on a 0-1 interpolation scale
|
||||
if(uMult + vMult != 2) {
|
||||
for (GroupObject go : res) {
|
||||
for (Face f : go.faces) {
|
||||
for (TextureCoordinate tc : f.textureCoordinates) {
|
||||
tc.u /= uMult;
|
||||
tc.v /= vMult;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
uMult = vMult = 1;
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -256,7 +286,7 @@ public class TechneUtil {
|
||||
tes.addVertexWithUV(v.x, v.y, v.z, override.getInterpolatedU(interpX * 16), override.getInterpolatedV(interpY * 16));
|
||||
} else {
|
||||
TextureCoordinate t = f.textureCoordinates[i];
|
||||
tes.addVertexWithUV(v.x, v.y, v.z, icon.getInterpolatedU(t.u * 16), icon.getInterpolatedV(t.v * 8));
|
||||
tes.addVertexWithUV(v.x, v.y, v.z, icon.getInterpolatedU(t.u * 16), icon.getInterpolatedV(t.v * 16));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -310,7 +340,7 @@ public class TechneUtil {
|
||||
if(block instanceof AbstractMachineBlock<?>) {
|
||||
return ((AbstractMachineBlock<?>) block).getModelIcon(world, x, y, z);
|
||||
}
|
||||
return getIconFor(block, world.getBlockMetadata(x, y, z));
|
||||
return block.getIcon(world, x, y, z, 0);
|
||||
}
|
||||
|
||||
private static IIcon getIconFor(Block block, int metadata) {
|
||||
|
||||
Reference in new issue
Block a user