mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-25 06:24:37 +00:00
Merge remote-tracking branch 'Majora320/fix-glass' into dev
This commit is contained in:
4 files changed
+21
-16
No files matched your search
@@ -3,7 +3,6 @@ package tconstruct.smeltery.blocks;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
@@ -21,7 +20,6 @@ import tconstruct.util.config.PHConstruct;
|
||||
public class GlassBlockConnected extends MantleBlock {
|
||||
|
||||
protected IIcon[] icons = new IIcon[16];
|
||||
private static final boolean shouldRenderSelectionBox = true;
|
||||
protected String folder;
|
||||
private final int renderPass;
|
||||
|
||||
@@ -327,15 +325,6 @@ public class GlassBlockConnected extends MantleBlock {
|
||||
return icons[0];
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getSelectedBoundingBoxFromPool(World world, int x, int y, int z) {
|
||||
if (shouldRenderSelectionBox) {
|
||||
return super.getSelectedBoundingBoxFromPool(world, x, y, z);
|
||||
} else {
|
||||
return AxisAlignedBB.getBoundingBox(0D, 0D, 0D, 0D, 0D, 0D);
|
||||
}
|
||||
}
|
||||
|
||||
protected void registerBlockIcons(IIconRegister iconRegister, IIcon[] icons, String folder) {
|
||||
icons[0] = iconRegister.registerIcon("tinker:glass/" + folder + "/glass");
|
||||
icons[1] = iconRegister.registerIcon("tinker:glass/" + folder + "/glass_1_d");
|
||||
|
||||
@@ -49,7 +49,11 @@ public class GlassBlockConnectedMeta extends GlassBlockConnected {
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
return icons[meta][0];
|
||||
if (meta < icons.length) {
|
||||
return icons[meta][0];
|
||||
} else {
|
||||
return icons[0][0];
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -49,7 +49,11 @@ public class GlassPaneConnectedMeta extends GlassPaneConnected {
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
return icons[meta][0];
|
||||
if (meta < icons.length) {
|
||||
return icons[meta][0];
|
||||
} else {
|
||||
return icons[0][0];
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -70,12 +74,20 @@ public class GlassPaneConnectedMeta extends GlassPaneConnected {
|
||||
|
||||
@Override
|
||||
public IIcon getTopIcon(int meta) {
|
||||
return topIcons[meta];
|
||||
if (meta < topIcons.length) {
|
||||
return topIcons[meta];
|
||||
} else {
|
||||
return topIcons[0];
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getBottomIcon(int meta) {
|
||||
return bottomIcons[meta];
|
||||
if (meta < bottomIcons.length) {
|
||||
return bottomIcons[meta];
|
||||
} else {
|
||||
return bottomIcons[0];
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -138,7 +138,7 @@ public class PaneConnectedRender implements ISimpleBlockRenderingHandler {
|
||||
}
|
||||
} else {
|
||||
for (int i = xzuv.length - 4; i >= 0; i -= 4) {
|
||||
tessellator.addVertexWithUV(xzuv[i], y - 0, xzuv[i + 1], xzuv[i + 2], xzuv[i + 3]);
|
||||
tessellator.addVertexWithUV(xzuv[i], y, xzuv[i + 1], xzuv[i + 2], xzuv[i + 3]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user