Small fixes

This commit is contained in:
sferatime 2020-08-04 19:40:33 +03:00
parent 84722b068a
commit 518fce4076

View file

@ -7,7 +7,7 @@ import net.minecraft.block.Block;
import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.Tessellator;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.Icon; import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess; import net.minecraft.world.IBlockAccess;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
@ -98,7 +98,7 @@ public class GT_Block_Renderer implements ISimpleBlockRenderingHandler {
* I have changed quite a bit of this Code, just to make it compatible with my Stuff. * I have changed quite a bit of this Code, just to make it compatible with my Stuff.
*/ */
public boolean renderPipeBlock(IBlockAccess aWorld, int aX, int aY, int aZ, Block aBlock, int aModelID, RenderBlocks aRenderer) { public boolean renderPipeBlock(IBlockAccess aWorld, int aX, int aY, int aZ, Block aBlock, int aModelID, RenderBlocks aRenderer) {
TileEntity aTileEntity = aWorld.getBlockTileEntity(aX, aY, aZ); TileEntity aTileEntity = aWorld.getTileEntity(aX, aY, aZ);
if (aTileEntity instanceof BaseMetaPipeEntity) { if (aTileEntity instanceof BaseMetaPipeEntity) {
aRenderer.flipTexture = false; aRenderer.flipTexture = false;
@ -115,14 +115,14 @@ public class GT_Block_Renderer implements ISimpleBlockRenderingHandler {
byte tConnections = 0; byte tConnections = 0;
for (byte i = 0; i < 6; i++) if ((tTileEntity.mConnections & (1 << i)) != 0) tConnections |= (1 << ((i + 2) % 6)); for (byte i = 0; i < 6; i++) if ((tTileEntity.mConnections & (1 << i)) != 0) tConnections |= (1 << ((i + 2) % 6));
Icon tIcons[] = new Icon[6], tCovers[] = new Icon[6]; IIcon tIcons[] = new IIcon[6], tCovers[] = new IIcon[6];
boolean tIsCovered[] = new boolean[6]; boolean tIsCovered[] = new boolean[6];
for (byte i = 0; i < 6; i++) tIsCovered[i] = (tTileEntity.getCoverIDAtSide(i) != 0); for (byte i = 0; i < 6; i++) tIsCovered[i] = (tTileEntity.getCoverIDAtSide(i) != 0);
if (tIsCovered[0] && tIsCovered[1] && tIsCovered[2] && tIsCovered[3] && tIsCovered[4] && tIsCovered[5]) return aRenderer.renderStandardBlock(aBlock, aX, aY, aZ); if (tIsCovered[0] && tIsCovered[1] && tIsCovered[2] && tIsCovered[3] && tIsCovered[4] && tIsCovered[5]) return aRenderer.renderStandardBlock(aBlock, aX, aY, aZ);
for (byte i = 0; i < 6; i++) { for (byte i = 0; i < 6; i++) {
tCovers[i] = aBlock.getBlockTexture(aWorld, aX, aY, aZ, i); tCovers[i] = aBlock.getBlockTextureFromSide(i);
tIcons[i] = tTileEntity.getUncoveredIcon(i, (byte)1); tIcons[i] = tTileEntity.getUncoveredIcon(i, (byte)1);
if (tIcons[i] == null) { if (tIcons[i] == null) {
int tIndex = tTileEntity.getUncoveredIndex(i, (byte)1); int tIndex = tTileEntity.getUncoveredIndex(i, (byte)1);
@ -361,39 +361,40 @@ public class GT_Block_Renderer implements ISimpleBlockRenderingHandler {
return true; return true;
} }
public static void renderPositiveXFacing(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ, Icon aIcon) { public static void renderPositiveXFacing(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ, IIcon aIcon) {
aRenderer.flipTexture = true; aRenderer.flipTexture = true;
aRenderer.renderFaceXPos(aBlock, aX, aY, aZ, aIcon); aRenderer.renderFaceXPos(aBlock, aX, aY, aZ, aIcon);
aRenderer.flipTexture = false; aRenderer.flipTexture = false;
} }
public static void renderPositiveYFacing(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ, Icon aIcon) { public static void renderPositiveYFacing(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ, IIcon aIcon) {
aRenderer.renderFaceYPos(aBlock, aX, aY, aZ, aIcon); aRenderer.renderFaceYPos(aBlock, aX, aY, aZ, aIcon);
} }
public static void renderPositiveZFacing(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ, Icon aIcon) { public static void renderPositiveZFacing(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ, IIcon aIcon) {
aRenderer.renderFaceZPos(aBlock, aX, aY, aZ, aIcon); aRenderer.renderFaceZPos(aBlock, aX, aY, aZ, aIcon);
} }
public static void renderNegativeXFacing(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ, Icon aIcon) { public static void renderNegativeXFacing(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ, IIcon aIcon) {
aRenderer.renderFaceXNeg(aBlock, aX, aY, aZ, aIcon); aRenderer.renderFaceXNeg(aBlock, aX, aY, aZ, aIcon);
} }
public static void renderNegativeYFacing(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ, Icon aIcon) { public static void renderNegativeYFacing(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ, IIcon aIcon) {
aRenderer.renderFaceYNeg(aBlock, aX, aY, aZ, aIcon); aRenderer.renderFaceYNeg(aBlock, aX, aY, aZ, aIcon);
} }
public static void renderNegativeZFacing(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ, Icon aIcon) { public static void renderNegativeZFacing(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ, IIcon aIcon) {
aRenderer.flipTexture = true; aRenderer.flipTexture = true;
aRenderer.renderFaceZNeg(aBlock, aX, aY, aZ, aIcon); aRenderer.renderFaceZNeg(aBlock, aX, aY, aZ, aIcon);
aRenderer.flipTexture = false; aRenderer.flipTexture = false;
} }
public boolean shouldRender3DInInventory() {
return true;
}
public int getRenderId() { public int getRenderId() {
return mRenderID; return mRenderID;
} }
@Override
public boolean shouldRender3DInInventory(int modelId) {
return true;
}
} }