Improve glass pane rendering (#270)
Co-authored-by: UltraProdigy <187078471+UltraProdigy@users.noreply.github.com> Co-authored-by: LazyFleshWasTaken <40587985+LazyFleshWasTaken@users.noreply.github.com> Co-authored-by: Martin Robertz <dream-master@gmx.net> Co-authored-by: Fabian Maurer <dark.shadow4@web.de>
No files matched your search
@@ -1,35 +1,35 @@
|
||||
// Add your dependencies here
|
||||
|
||||
dependencies {
|
||||
compileOnlyApi('com.github.GTNewHorizons:Angelica:2.1.15:api')
|
||||
api("com.github.GTNewHorizons:Mantle:0.5.1:dev")
|
||||
api("com.github.GTNewHorizons:ForgeMultipart:1.7.3:dev")
|
||||
compileOnlyApi('com.github.GTNewHorizons:Angelica:2.1.29:api')
|
||||
api("com.github.GTNewHorizons:Mantle:0.5.2:dev")
|
||||
api("com.github.GTNewHorizons:ForgeMultipart:1.7.10:dev")
|
||||
// gtnhlib is compileOnlyApi by us, but needed at runtime by nei, so require the correct version
|
||||
api("com.github.GTNewHorizons:GTNHLib:0.9.47:dev")
|
||||
implementation("com.github.GTNewHorizons:NotEnoughItems:2.8.84-GTNH:dev")
|
||||
api("com.github.GTNewHorizons:GTNHLib:0.11.4:dev")
|
||||
implementation("com.github.GTNewHorizons:NotEnoughItems:2.8.100-GTNH:dev")
|
||||
compileOnlyApi("curse.maven:cofh-core-69162:2388751")
|
||||
compileOnly("com.github.GTNewHorizons:inventory-tweaks:1.7.1:api")
|
||||
compileOnly("com.github.GTNewHorizons:waila:1.19.22:api")
|
||||
compileOnly("com.github.GTNewHorizons:waila:1.19.29:api")
|
||||
compileOnly("com.github.GTNewHorizons:Battlegear2:1.4.3:api")
|
||||
compileOnly("curse.maven:minefactory-reloaded-66672:2366150")
|
||||
compileOnly("curse.maven:zelda-sword-skills-220540:2384889")
|
||||
compileOnly("curse.maven:dynamic-sword-skills-226360:2495462")
|
||||
compileOnly("curse.maven:notenoughkeys-224614:2276280")
|
||||
compileOnly("thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev")
|
||||
compileOnly("com.github.GTNewHorizons:Mobs-Info:0.5.10-GTNH:dev")
|
||||
compileOnly("com.github.GTNewHorizons:Mobs-Info:0.5.15-GTNH:dev")
|
||||
compileOnlyApi("net.industrial-craft:industrialcraft-2:2.2.828-experimental:dev")
|
||||
compileOnlyApi("com.github.GTNewHorizons:Natura:2.8.17:dev")
|
||||
compileOnly('com.github.GTNewHorizons:Baubles-Expanded:2.2.11-GTNH:dev')
|
||||
compileOnly('com.github.GTNewHorizons:SpecialMobs:3.7.2')
|
||||
compileOnlyApi("com.github.GTNewHorizons:Natura:2.8.19:dev")
|
||||
compileOnly('com.github.GTNewHorizons:Baubles-Expanded:2.2.21-GTNH:dev')
|
||||
compileOnly('com.github.GTNewHorizons:SpecialMobs:3.7.4')
|
||||
runtimeOnly('com.github.GTNewHorizons:TiC-Tooltips:1.4.1:dev'){transitive = false}
|
||||
runtimeOnly("com.github.GTNewHorizons:ServerUtilities:2.2.20:dev")
|
||||
runtimeOnly("com.github.GTNewHorizons:ServerUtilities:2.2.37:dev")
|
||||
|
||||
|
||||
// For testing scythe crop harvesting
|
||||
// devOnlyNonPublishable("net.industrial-craft:industrialcraft-2:2.2.828-experimental:dev")
|
||||
// devOnlyNonPublishable("com.github.GTNewHorizons:harvestcraft:1.3.11-GTNH:dev")
|
||||
// devOnlyNonPublishable(deobfCurse("pams-harvest-the-nether-231262:2241397"))
|
||||
// devOnlyNonPublishable("com.github.GTNewHorizons:Natura:2.8.17:dev")
|
||||
// devOnlyNonPublishable("com.github.GTNewHorizons:EnderCore:0.5.12")
|
||||
// devOnlyNonPublishable("com.github.GTNewHorizons:Natura:2.8.19:dev")
|
||||
// devOnlyNonPublishable("com.github.GTNewHorizons:EnderCore:0.5.14")
|
||||
|
||||
}
|
||||
@@ -1,12 +1,12 @@
|
||||
#This file is generated by updateDaemonJvm
|
||||
toolchainUrl.FREE_BSD.AARCH64=https\://api.foojay.io/disco/v3.0/ids/1630f7ebef05444cb27a2709ea0249b3/redirect
|
||||
toolchainUrl.FREE_BSD.X86_64=https\://api.foojay.io/disco/v3.0/ids/cd495626d2ee49a75447e3fdc6afb287/redirect
|
||||
toolchainUrl.LINUX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/1630f7ebef05444cb27a2709ea0249b3/redirect
|
||||
toolchainUrl.LINUX.X86_64=https\://api.foojay.io/disco/v3.0/ids/cd495626d2ee49a75447e3fdc6afb287/redirect
|
||||
toolchainUrl.MAC_OS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/d4fd992c9557644e637ebe98263e0ae7/redirect
|
||||
toolchainUrl.MAC_OS.X86_64=https\://api.foojay.io/disco/v3.0/ids/faa12903720d410b387cc69ccafb1a74/redirect
|
||||
toolchainUrl.UNIX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/1630f7ebef05444cb27a2709ea0249b3/redirect
|
||||
toolchainUrl.UNIX.X86_64=https\://api.foojay.io/disco/v3.0/ids/cd495626d2ee49a75447e3fdc6afb287/redirect
|
||||
toolchainUrl.WINDOWS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/a4c09dd2e2d7079373d30e524bbc2829/redirect
|
||||
toolchainUrl.WINDOWS.X86_64=https\://api.foojay.io/disco/v3.0/ids/8e1d9ee5d0f13e442218f6884a306da1/redirect
|
||||
toolchainUrl.FREE_BSD.AARCH64=https\://api.foojay.io/disco/v3.0/ids/cf726b4a1c84b50457225f9bba6d7650/redirect
|
||||
toolchainUrl.FREE_BSD.X86_64=https\://api.foojay.io/disco/v3.0/ids/fa1e318c287360478e3c83a9a3ef1007/redirect
|
||||
toolchainUrl.LINUX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/cf726b4a1c84b50457225f9bba6d7650/redirect
|
||||
toolchainUrl.LINUX.X86_64=https\://api.foojay.io/disco/v3.0/ids/fa1e318c287360478e3c83a9a3ef1007/redirect
|
||||
toolchainUrl.MAC_OS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/c2dd35c9d0aaf0ba6ad0791320f99dfc/redirect
|
||||
toolchainUrl.MAC_OS.X86_64=https\://api.foojay.io/disco/v3.0/ids/e5810bd7fd1f8a586644409d395a7e55/redirect
|
||||
toolchainUrl.UNIX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/cf726b4a1c84b50457225f9bba6d7650/redirect
|
||||
toolchainUrl.UNIX.X86_64=https\://api.foojay.io/disco/v3.0/ids/fa1e318c287360478e3c83a9a3ef1007/redirect
|
||||
toolchainUrl.WINDOWS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/7b3c4877c0749019e6805bb61e421497/redirect
|
||||
toolchainUrl.WINDOWS.X86_64=https\://api.foojay.io/disco/v3.0/ids/d76df094a9cbbabd3b08251f9e61444a/redirect
|
||||
toolchainVersion=25
|
||||
@@ -17,7 +17,7 @@ pluginManagement {
|
||||
}
|
||||
|
||||
plugins {
|
||||
id 'com.gtnewhorizons.gtnhsettingsconvention' version '2.0.24'
|
||||
id 'com.gtnewhorizons.gtnhsettingsconvention' version '2.0.25'
|
||||
}
|
||||
|
||||
|
||||
@@ -29,7 +29,6 @@ import tconstruct.smeltery.model.CastingBasinSpecialRender;
|
||||
import tconstruct.smeltery.model.CastingBlockRender;
|
||||
import tconstruct.smeltery.model.CastingTableSpecialRenderer;
|
||||
import tconstruct.smeltery.model.PaneConnectedRender;
|
||||
import tconstruct.smeltery.model.PaneRender;
|
||||
import tconstruct.smeltery.model.SmelteryRender;
|
||||
import tconstruct.smeltery.model.TankItemRenderer;
|
||||
import tconstruct.smeltery.model.TankRender;
|
||||
@@ -49,7 +48,6 @@ public class SmelteryProxyClient extends SmelteryProxyCommon {
|
||||
RenderingRegistry.registerBlockHandler(new TankRender());
|
||||
RenderingRegistry.registerBlockHandler(new CastingBlockRender());
|
||||
RenderingRegistry.registerBlockHandler(new DryingRackRender());
|
||||
RenderingRegistry.registerBlockHandler(new PaneRender());
|
||||
RenderingRegistry.registerBlockHandler(new PaneConnectedRender());
|
||||
RenderingRegistry.registerBlockHandler(new RenderBlockFluid());
|
||||
RenderingRegistry.registerBlockHandler(new BlockRenderCastingChannel());
|
||||
|
||||
@@ -48,7 +48,7 @@ import tconstruct.smeltery.blocks.CastingChannelBlock;
|
||||
import tconstruct.smeltery.blocks.GlassBlockConnected;
|
||||
import tconstruct.smeltery.blocks.GlassBlockConnectedMeta;
|
||||
import tconstruct.smeltery.blocks.GlassPaneConnected;
|
||||
import tconstruct.smeltery.blocks.GlassPaneStained;
|
||||
import tconstruct.smeltery.blocks.GlassPaneConnectedMeta;
|
||||
import tconstruct.smeltery.blocks.GlueBlock;
|
||||
import tconstruct.smeltery.blocks.GlueFluid;
|
||||
import tconstruct.smeltery.blocks.LavaTankBlock;
|
||||
@@ -511,7 +511,6 @@ public class TinkerSmeltery {
|
||||
|
||||
// Glass
|
||||
TinkerSmeltery.clearGlass = new GlassBlockConnected("clear", false).setBlockName("GlassBlock");
|
||||
TinkerSmeltery.clearGlass.stepSound = Block.soundTypeGlass;
|
||||
TinkerSmeltery.glassPane = new GlassPaneConnected("clear", false);
|
||||
TinkerSmeltery.stainedGlassClear = new GlassBlockConnectedMeta(
|
||||
"stained",
|
||||
@@ -532,8 +531,25 @@ public class TinkerSmeltery {
|
||||
"green",
|
||||
"red",
|
||||
"black").setBlockName("GlassBlock.StainedClear");
|
||||
TinkerSmeltery.stainedGlassClear.stepSound = Block.soundTypeGlass;
|
||||
TinkerSmeltery.stainedGlassClearPane = new GlassPaneStained();
|
||||
TinkerSmeltery.stainedGlassClearPane = new GlassPaneConnectedMeta(
|
||||
"stained",
|
||||
true,
|
||||
"white",
|
||||
"orange",
|
||||
"magenta",
|
||||
"light_blue",
|
||||
"yellow",
|
||||
"lime",
|
||||
"pink",
|
||||
"gray",
|
||||
"light_gray",
|
||||
"cyan",
|
||||
"purple",
|
||||
"blue",
|
||||
"brown",
|
||||
"green",
|
||||
"red",
|
||||
"black");
|
||||
|
||||
GameRegistry.registerBlock(TinkerSmeltery.searedSlab, SearedSlabItem.class, "SearedSlab");
|
||||
GameRegistry.registerBlock(TinkerSmeltery.speedSlab, SpeedSlabItem.class, "SpeedSlab");
|
||||
|
||||
@@ -1,73 +0,0 @@
|
||||
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.entity.Entity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import tconstruct.blocks.TConstructBlock;
|
||||
|
||||
public class GlassBlock extends TConstructBlock {
|
||||
|
||||
static String[] blockTextures = { "glass_clear", "soulglass", "soulglass_clear" };
|
||||
|
||||
public GlassBlock() {
|
||||
super(Material.glass, 3f, blockTextures);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) {
|
||||
Block i1 = par1IBlockAccess.getBlock(par2, par3, par4);
|
||||
return i1 != this && super.shouldSideBeRendered(par1IBlockAccess, par2, par3, par4, par5);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getBlockHardness(World world, int x, int y, int z) {
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
switch (meta) {
|
||||
case 0:
|
||||
return 0.3F;
|
||||
case 1:
|
||||
case 2:
|
||||
return 50.0F;
|
||||
default:
|
||||
return blockHardness;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getExplosionResistance(Entity entity, World world, int x, int y, int z, double explosionX,
|
||||
double explosionY, double explosionZ) {
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
switch (meta) {
|
||||
case 0:
|
||||
return 1.5F;
|
||||
case 1:
|
||||
case 2:
|
||||
return 2000F;
|
||||
default:
|
||||
return getExplosionResistance(entity);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister iconRegister) {
|
||||
this.icons = new IIcon[textureNames.length];
|
||||
|
||||
for (int i = 0; i < this.icons.length; ++i) {
|
||||
this.icons[i] = iconRegister.registerIcon("tinker:glass/" + textureNames[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,7 @@ 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.launchwrapper.Launch;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
@@ -20,8 +20,9 @@ import tconstruct.util.config.PHConstruct;
|
||||
*/
|
||||
public class GlassBlockConnected extends MantleBlock {
|
||||
|
||||
private static final String HODGEPODGE_FIX_BOTTOM_FACE_UV = "hodgepodge.FixesConfig.fixBottomFaceUV";
|
||||
|
||||
protected IIcon[] icons = new IIcon[16];
|
||||
private final boolean shouldRenderSelectionBox = true;
|
||||
protected String folder;
|
||||
private final int renderPass;
|
||||
|
||||
@@ -34,11 +35,6 @@ public class GlassBlockConnected extends MantleBlock {
|
||||
this.setCreativeTab(TConstructRegistry.blockTab);
|
||||
}
|
||||
|
||||
// For FMP support
|
||||
public IIcon[] getIcons() {
|
||||
return icons;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
@@ -54,519 +50,304 @@ public class GlassBlockConnected extends MantleBlock {
|
||||
return renderPass;
|
||||
}
|
||||
|
||||
/**
|
||||
* This is checked to see if the texture should connect to this block
|
||||
*
|
||||
* @param par2 x
|
||||
* @param par3 y
|
||||
* @param par4 z
|
||||
* @param par5 ID this block is asking to connect to (may be 0 if there is no block)
|
||||
* @param par6 Metadata of the block this block is trying to connect to
|
||||
* @return true if should connect
|
||||
*/
|
||||
public boolean shouldConnectToBlock(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, Block par5,
|
||||
int par6) {
|
||||
return par5 == this;
|
||||
public boolean shouldConnectToBlock(IBlockAccess blockAccess, int x, int y, int z, Block block, int meta) {
|
||||
return block == this;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) {
|
||||
return par1IBlockAccess.getBlockMetadata(par2, par3, par4) == 15 ? icons[0]
|
||||
: getConnectedBlockTexture(par1IBlockAccess, par2, par3, par4, par5, icons);
|
||||
public IIcon getIcon(IBlockAccess blockAccess, int x, int y, int z, int side) {
|
||||
return getConnectedBlockTexture(blockAccess, x, y, z, side, icons);
|
||||
}
|
||||
|
||||
public IIcon getConnectedBlockTexture(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5,
|
||||
IIcon[] icons) {
|
||||
public IIcon getConnectedBlockTexture(IBlockAccess blockAccess, int x, int y, int z, int side, IIcon[] icons) {
|
||||
if (PHConstruct.connectedTexturesMode == 0) {
|
||||
return icons[0];
|
||||
}
|
||||
|
||||
boolean isOpenUp = false, isOpenDown = false, isOpenLeft = false, isOpenRight = false;
|
||||
|
||||
switch (par5) {
|
||||
switch (side) {
|
||||
case 0:
|
||||
if (shouldConnectToBlock(
|
||||
par1IBlockAccess,
|
||||
par2,
|
||||
par3,
|
||||
par4,
|
||||
par1IBlockAccess.getBlock(par2 - 1, par3, par4),
|
||||
par1IBlockAccess.getBlockMetadata(par2 - 1, par3, par4))) {
|
||||
isOpenDown = true;
|
||||
}
|
||||
|
||||
if (shouldConnectToBlock(
|
||||
par1IBlockAccess,
|
||||
par2,
|
||||
par3,
|
||||
par4,
|
||||
par1IBlockAccess.getBlock(par2 + 1, par3, par4),
|
||||
par1IBlockAccess.getBlockMetadata(par2 + 1, par3, par4))) {
|
||||
isOpenUp = true;
|
||||
}
|
||||
|
||||
if (shouldConnectToBlock(
|
||||
par1IBlockAccess,
|
||||
par2,
|
||||
par3,
|
||||
par4,
|
||||
par1IBlockAccess.getBlock(par2, par3, par4 - 1),
|
||||
par1IBlockAccess.getBlockMetadata(par2, par3, par4 - 1))) {
|
||||
isOpenLeft = true;
|
||||
}
|
||||
|
||||
if (shouldConnectToBlock(
|
||||
par1IBlockAccess,
|
||||
par2,
|
||||
par3,
|
||||
par4,
|
||||
par1IBlockAccess.getBlock(par2, par3, par4 + 1),
|
||||
par1IBlockAccess.getBlockMetadata(par2, par3, par4 + 1))) {
|
||||
isOpenRight = true;
|
||||
}
|
||||
|
||||
if (isOpenUp && isOpenDown && isOpenLeft && isOpenRight) {
|
||||
return icons[15];
|
||||
} else if (isOpenUp && isOpenDown && isOpenLeft) {
|
||||
return icons[11];
|
||||
} else if (isOpenUp && isOpenDown && isOpenRight) {
|
||||
return icons[12];
|
||||
} else if (isOpenUp && isOpenLeft && isOpenRight) {
|
||||
return icons[13];
|
||||
} else if (isOpenDown && isOpenLeft && isOpenRight) {
|
||||
return icons[14];
|
||||
} else if (isOpenDown && isOpenUp) {
|
||||
return icons[5];
|
||||
} else if (isOpenLeft && isOpenRight) {
|
||||
return icons[6];
|
||||
} else if (isOpenDown && isOpenLeft) {
|
||||
return icons[8];
|
||||
} else if (isOpenDown && isOpenRight) {
|
||||
return icons[10];
|
||||
} else if (isOpenUp && isOpenLeft) {
|
||||
return icons[7];
|
||||
} else if (isOpenUp && isOpenRight) {
|
||||
return icons[9];
|
||||
} else if (isOpenDown) {
|
||||
return icons[3];
|
||||
} else if (isOpenUp) {
|
||||
return icons[4];
|
||||
} else if (isOpenLeft) {
|
||||
return icons[2];
|
||||
} else if (isOpenRight) {
|
||||
return icons[1];
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (shouldConnectToBlock(
|
||||
par1IBlockAccess,
|
||||
par2,
|
||||
par3,
|
||||
par4,
|
||||
par1IBlockAccess.getBlock(par2 - 1, par3, par4),
|
||||
par1IBlockAccess.getBlockMetadata(par2 - 1, par3, par4))) {
|
||||
isOpenDown = true;
|
||||
}
|
||||
|
||||
if (shouldConnectToBlock(
|
||||
par1IBlockAccess,
|
||||
par2,
|
||||
par3,
|
||||
par4,
|
||||
par1IBlockAccess.getBlock(par2 + 1, par3, par4),
|
||||
par1IBlockAccess.getBlockMetadata(par2 + 1, par3, par4))) {
|
||||
isOpenUp = true;
|
||||
}
|
||||
|
||||
if (shouldConnectToBlock(
|
||||
par1IBlockAccess,
|
||||
par2,
|
||||
par3,
|
||||
par4,
|
||||
par1IBlockAccess.getBlock(par2, par3, par4 - 1),
|
||||
par1IBlockAccess.getBlockMetadata(par2, par3, par4 - 1))) {
|
||||
blockAccess,
|
||||
x,
|
||||
y,
|
||||
z,
|
||||
blockAccess.getBlock(x - 1, y, z),
|
||||
blockAccess.getBlockMetadata(x - 1, y, z))) {
|
||||
isOpenLeft = true;
|
||||
}
|
||||
|
||||
if (shouldConnectToBlock(
|
||||
par1IBlockAccess,
|
||||
par2,
|
||||
par3,
|
||||
par4,
|
||||
par1IBlockAccess.getBlock(par2, par3, par4 + 1),
|
||||
par1IBlockAccess.getBlockMetadata(par2, par3, par4 + 1))) {
|
||||
blockAccess,
|
||||
x,
|
||||
y,
|
||||
z,
|
||||
blockAccess.getBlock(x + 1, y, z),
|
||||
blockAccess.getBlockMetadata(x + 1, y, z))) {
|
||||
isOpenRight = true;
|
||||
}
|
||||
|
||||
if (isOpenUp && isOpenDown && isOpenLeft && isOpenRight) {
|
||||
return icons[15];
|
||||
} else if (isOpenUp && isOpenDown && isOpenLeft) {
|
||||
return icons[11];
|
||||
} else if (isOpenUp && isOpenDown && isOpenRight) {
|
||||
return icons[12];
|
||||
} else if (isOpenUp && isOpenLeft && isOpenRight) {
|
||||
return icons[13];
|
||||
} else if (isOpenDown && isOpenLeft && isOpenRight) {
|
||||
return icons[14];
|
||||
} else if (isOpenDown && isOpenUp) {
|
||||
return icons[5];
|
||||
} else if (isOpenLeft && isOpenRight) {
|
||||
return icons[6];
|
||||
} else if (isOpenDown && isOpenLeft) {
|
||||
return icons[8];
|
||||
} else if (isOpenDown && isOpenRight) {
|
||||
return icons[10];
|
||||
} else if (isOpenUp && isOpenLeft) {
|
||||
return icons[7];
|
||||
} else if (isOpenUp && isOpenRight) {
|
||||
return icons[9];
|
||||
} else if (isOpenDown) {
|
||||
return icons[3];
|
||||
} else if (isOpenUp) {
|
||||
return icons[4];
|
||||
} else if (isOpenLeft) {
|
||||
return icons[2];
|
||||
} else if (isOpenRight) {
|
||||
return icons[1];
|
||||
if (shouldConnectToBlock(
|
||||
blockAccess,
|
||||
x,
|
||||
y,
|
||||
z,
|
||||
blockAccess.getBlock(x, y, z - 1),
|
||||
blockAccess.getBlockMetadata(x, y, z - 1))) {
|
||||
isOpenUp = true;
|
||||
}
|
||||
|
||||
if (shouldConnectToBlock(
|
||||
blockAccess,
|
||||
x,
|
||||
y,
|
||||
z,
|
||||
blockAccess.getBlock(x, y, z + 1),
|
||||
blockAccess.getBlockMetadata(x, y, z + 1))) {
|
||||
isOpenDown = true;
|
||||
}
|
||||
|
||||
if (side == 0 && isHodgepodgeFixingBottomFaceUV()) {
|
||||
boolean isOpenLeftCopy = isOpenLeft;
|
||||
isOpenLeft = isOpenRight;
|
||||
isOpenRight = isOpenLeftCopy;
|
||||
}
|
||||
|
||||
break;
|
||||
case 2:
|
||||
if (shouldConnectToBlock(
|
||||
par1IBlockAccess,
|
||||
par2,
|
||||
par3,
|
||||
par4,
|
||||
par1IBlockAccess.getBlock(par2, par3 - 1, par4),
|
||||
par1IBlockAccess.getBlockMetadata(par2, par3 - 1, par4))) {
|
||||
isOpenDown = true;
|
||||
}
|
||||
|
||||
if (shouldConnectToBlock(
|
||||
par1IBlockAccess,
|
||||
par2,
|
||||
par3,
|
||||
par4,
|
||||
par1IBlockAccess.getBlock(par2, par3 + 1, par4),
|
||||
par1IBlockAccess.getBlockMetadata(par2, par3 + 1, par4))) {
|
||||
isOpenUp = true;
|
||||
}
|
||||
|
||||
if (shouldConnectToBlock(
|
||||
par1IBlockAccess,
|
||||
par2,
|
||||
par3,
|
||||
par4,
|
||||
par1IBlockAccess.getBlock(par2 - 1, par3, par4),
|
||||
par1IBlockAccess.getBlockMetadata(par2 - 1, par3, par4))) {
|
||||
blockAccess,
|
||||
x,
|
||||
y,
|
||||
z,
|
||||
blockAccess.getBlock(x + 1, y, z),
|
||||
blockAccess.getBlockMetadata(x + 1, y, z))) {
|
||||
isOpenLeft = true;
|
||||
}
|
||||
|
||||
if (shouldConnectToBlock(
|
||||
par1IBlockAccess,
|
||||
par2,
|
||||
par3,
|
||||
par4,
|
||||
par1IBlockAccess.getBlock(par2 + 1, par3, par4),
|
||||
par1IBlockAccess.getBlockMetadata(par2 + 1, par3, par4))) {
|
||||
blockAccess,
|
||||
x,
|
||||
y,
|
||||
z,
|
||||
blockAccess.getBlock(x - 1, y, z),
|
||||
blockAccess.getBlockMetadata(x - 1, y, z))) {
|
||||
isOpenRight = true;
|
||||
}
|
||||
|
||||
if (isOpenUp && isOpenDown && isOpenLeft && isOpenRight) {
|
||||
return icons[15];
|
||||
} else if (isOpenUp && isOpenDown && isOpenLeft) {
|
||||
return icons[13];
|
||||
} else if (isOpenUp && isOpenDown && isOpenRight) {
|
||||
return icons[14];
|
||||
} else if (isOpenUp && isOpenLeft && isOpenRight) {
|
||||
return icons[11];
|
||||
} else if (isOpenDown && isOpenLeft && isOpenRight) {
|
||||
return icons[12];
|
||||
} else if (isOpenDown && isOpenUp) {
|
||||
return icons[6];
|
||||
} else if (isOpenLeft && isOpenRight) {
|
||||
return icons[5];
|
||||
} else if (isOpenDown && isOpenLeft) {
|
||||
return icons[9];
|
||||
} else if (isOpenDown && isOpenRight) {
|
||||
return icons[10];
|
||||
} else if (isOpenUp && isOpenLeft) {
|
||||
return icons[7];
|
||||
} else if (isOpenUp && isOpenRight) {
|
||||
return icons[8];
|
||||
} else if (isOpenDown) {
|
||||
return icons[1];
|
||||
} else if (isOpenUp) {
|
||||
return icons[2];
|
||||
} else if (isOpenLeft) {
|
||||
return icons[4];
|
||||
} else if (isOpenRight) {
|
||||
return icons[3];
|
||||
if (shouldConnectToBlock(
|
||||
blockAccess,
|
||||
x,
|
||||
y,
|
||||
z,
|
||||
blockAccess.getBlock(x, y + 1, z),
|
||||
blockAccess.getBlockMetadata(x, y + 1, z))) {
|
||||
isOpenUp = true;
|
||||
}
|
||||
|
||||
if (shouldConnectToBlock(
|
||||
blockAccess,
|
||||
x,
|
||||
y,
|
||||
z,
|
||||
blockAccess.getBlock(x, y - 1, z),
|
||||
blockAccess.getBlockMetadata(x, y - 1, z))) {
|
||||
isOpenDown = true;
|
||||
}
|
||||
|
||||
break;
|
||||
case 3:
|
||||
if (shouldConnectToBlock(
|
||||
par1IBlockAccess,
|
||||
par2,
|
||||
par3,
|
||||
par4,
|
||||
par1IBlockAccess.getBlock(par2, par3 - 1, par4),
|
||||
par1IBlockAccess.getBlockMetadata(par2, par3 - 1, par4))) {
|
||||
isOpenDown = true;
|
||||
}
|
||||
|
||||
if (shouldConnectToBlock(
|
||||
par1IBlockAccess,
|
||||
par2,
|
||||
par3,
|
||||
par4,
|
||||
par1IBlockAccess.getBlock(par2, par3 + 1, par4),
|
||||
par1IBlockAccess.getBlockMetadata(par2, par3 + 1, par4))) {
|
||||
isOpenUp = true;
|
||||
}
|
||||
|
||||
if (shouldConnectToBlock(
|
||||
par1IBlockAccess,
|
||||
par2,
|
||||
par3,
|
||||
par4,
|
||||
par1IBlockAccess.getBlock(par2 - 1, par3, par4),
|
||||
par1IBlockAccess.getBlockMetadata(par2 - 1, par3, par4))) {
|
||||
blockAccess,
|
||||
x,
|
||||
y,
|
||||
z,
|
||||
blockAccess.getBlock(x - 1, y, z),
|
||||
blockAccess.getBlockMetadata(x - 1, y, z))) {
|
||||
isOpenLeft = true;
|
||||
}
|
||||
|
||||
if (shouldConnectToBlock(
|
||||
par1IBlockAccess,
|
||||
par2,
|
||||
par3,
|
||||
par4,
|
||||
par1IBlockAccess.getBlock(par2 + 1, par3, par4),
|
||||
par1IBlockAccess.getBlockMetadata(par2 + 1, par3, par4))) {
|
||||
blockAccess,
|
||||
x,
|
||||
y,
|
||||
z,
|
||||
blockAccess.getBlock(x + 1, y, z),
|
||||
blockAccess.getBlockMetadata(x + 1, y, z))) {
|
||||
isOpenRight = true;
|
||||
}
|
||||
|
||||
if (isOpenUp && isOpenDown && isOpenLeft && isOpenRight) {
|
||||
return icons[15];
|
||||
} else if (isOpenUp && isOpenDown && isOpenLeft) {
|
||||
return icons[14];
|
||||
} else if (isOpenUp && isOpenDown && isOpenRight) {
|
||||
return icons[13];
|
||||
} else if (isOpenUp && isOpenLeft && isOpenRight) {
|
||||
return icons[11];
|
||||
} else if (isOpenDown && isOpenLeft && isOpenRight) {
|
||||
return icons[12];
|
||||
} else if (isOpenDown && isOpenUp) {
|
||||
return icons[6];
|
||||
} else if (isOpenLeft && isOpenRight) {
|
||||
return icons[5];
|
||||
} else if (isOpenDown && isOpenLeft) {
|
||||
return icons[10];
|
||||
} else if (isOpenDown && isOpenRight) {
|
||||
return icons[9];
|
||||
} else if (isOpenUp && isOpenLeft) {
|
||||
return icons[8];
|
||||
} else if (isOpenUp && isOpenRight) {
|
||||
return icons[7];
|
||||
} else if (isOpenDown) {
|
||||
return icons[1];
|
||||
} else if (isOpenUp) {
|
||||
return icons[2];
|
||||
} else if (isOpenLeft) {
|
||||
return icons[3];
|
||||
} else if (isOpenRight) {
|
||||
return icons[4];
|
||||
if (shouldConnectToBlock(
|
||||
blockAccess,
|
||||
x,
|
||||
y,
|
||||
z,
|
||||
blockAccess.getBlock(x, y + 1, z),
|
||||
blockAccess.getBlockMetadata(x, y + 1, z))) {
|
||||
isOpenUp = true;
|
||||
}
|
||||
|
||||
if (shouldConnectToBlock(
|
||||
blockAccess,
|
||||
x,
|
||||
y,
|
||||
z,
|
||||
blockAccess.getBlock(x, y - 1, z),
|
||||
blockAccess.getBlockMetadata(x, y - 1, z))) {
|
||||
isOpenDown = true;
|
||||
}
|
||||
|
||||
break;
|
||||
case 4:
|
||||
if (shouldConnectToBlock(
|
||||
par1IBlockAccess,
|
||||
par2,
|
||||
par3,
|
||||
par4,
|
||||
par1IBlockAccess.getBlock(par2, par3 - 1, par4),
|
||||
par1IBlockAccess.getBlockMetadata(par2, par3 - 1, par4))) {
|
||||
isOpenDown = true;
|
||||
}
|
||||
|
||||
if (shouldConnectToBlock(
|
||||
par1IBlockAccess,
|
||||
par2,
|
||||
par3,
|
||||
par4,
|
||||
par1IBlockAccess.getBlock(par2, par3 + 1, par4),
|
||||
par1IBlockAccess.getBlockMetadata(par2, par3 + 1, par4))) {
|
||||
isOpenUp = true;
|
||||
}
|
||||
|
||||
if (shouldConnectToBlock(
|
||||
par1IBlockAccess,
|
||||
par2,
|
||||
par3,
|
||||
par4,
|
||||
par1IBlockAccess.getBlock(par2, par3, par4 - 1),
|
||||
par1IBlockAccess.getBlockMetadata(par2, par3, par4 - 1))) {
|
||||
blockAccess,
|
||||
x,
|
||||
y,
|
||||
z,
|
||||
blockAccess.getBlock(x, y, z - 1),
|
||||
blockAccess.getBlockMetadata(x, y, z - 1))) {
|
||||
isOpenLeft = true;
|
||||
}
|
||||
|
||||
if (shouldConnectToBlock(
|
||||
par1IBlockAccess,
|
||||
par2,
|
||||
par3,
|
||||
par4,
|
||||
par1IBlockAccess.getBlock(par2, par3, par4 + 1),
|
||||
par1IBlockAccess.getBlockMetadata(par2, par3, par4 + 1))) {
|
||||
blockAccess,
|
||||
x,
|
||||
y,
|
||||
z,
|
||||
blockAccess.getBlock(x, y, z + 1),
|
||||
blockAccess.getBlockMetadata(x, y, z + 1))) {
|
||||
isOpenRight = true;
|
||||
}
|
||||
|
||||
if (isOpenUp && isOpenDown && isOpenLeft && isOpenRight) {
|
||||
return icons[15];
|
||||
} else if (isOpenUp && isOpenDown && isOpenLeft) {
|
||||
return icons[14];
|
||||
} else if (isOpenUp && isOpenDown && isOpenRight) {
|
||||
return icons[13];
|
||||
} else if (isOpenUp && isOpenLeft && isOpenRight) {
|
||||
return icons[11];
|
||||
} else if (isOpenDown && isOpenLeft && isOpenRight) {
|
||||
return icons[12];
|
||||
} else if (isOpenDown && isOpenUp) {
|
||||
return icons[6];
|
||||
} else if (isOpenLeft && isOpenRight) {
|
||||
return icons[5];
|
||||
} else if (isOpenDown && isOpenLeft) {
|
||||
return icons[10];
|
||||
} else if (isOpenDown && isOpenRight) {
|
||||
return icons[9];
|
||||
} else if (isOpenUp && isOpenLeft) {
|
||||
return icons[8];
|
||||
} else if (isOpenUp && isOpenRight) {
|
||||
return icons[7];
|
||||
} else if (isOpenDown) {
|
||||
return icons[1];
|
||||
} else if (isOpenUp) {
|
||||
return icons[2];
|
||||
} else if (isOpenLeft) {
|
||||
return icons[3];
|
||||
} else if (isOpenRight) {
|
||||
return icons[4];
|
||||
if (shouldConnectToBlock(
|
||||
blockAccess,
|
||||
x,
|
||||
y,
|
||||
z,
|
||||
blockAccess.getBlock(x, y + 1, z),
|
||||
blockAccess.getBlockMetadata(x, y + 1, z))) {
|
||||
isOpenUp = true;
|
||||
}
|
||||
|
||||
if (shouldConnectToBlock(
|
||||
blockAccess,
|
||||
x,
|
||||
y,
|
||||
z,
|
||||
blockAccess.getBlock(x, y - 1, z),
|
||||
blockAccess.getBlockMetadata(x, y - 1, z))) {
|
||||
isOpenDown = true;
|
||||
}
|
||||
|
||||
break;
|
||||
case 5:
|
||||
if (shouldConnectToBlock(
|
||||
par1IBlockAccess,
|
||||
par2,
|
||||
par3,
|
||||
par4,
|
||||
par1IBlockAccess.getBlock(par2, par3 - 1, par4),
|
||||
par1IBlockAccess.getBlockMetadata(par2, par3 - 1, par4))) {
|
||||
isOpenDown = true;
|
||||
}
|
||||
|
||||
if (shouldConnectToBlock(
|
||||
par1IBlockAccess,
|
||||
par2,
|
||||
par3,
|
||||
par4,
|
||||
par1IBlockAccess.getBlock(par2, par3 + 1, par4),
|
||||
par1IBlockAccess.getBlockMetadata(par2, par3 + 1, par4))) {
|
||||
isOpenUp = true;
|
||||
}
|
||||
|
||||
if (shouldConnectToBlock(
|
||||
par1IBlockAccess,
|
||||
par2,
|
||||
par3,
|
||||
par4,
|
||||
par1IBlockAccess.getBlock(par2, par3, par4 - 1),
|
||||
par1IBlockAccess.getBlockMetadata(par2, par3, par4 - 1))) {
|
||||
blockAccess,
|
||||
x,
|
||||
y,
|
||||
z,
|
||||
blockAccess.getBlock(x, y, z + 1),
|
||||
blockAccess.getBlockMetadata(x, y, z + 1))) {
|
||||
isOpenLeft = true;
|
||||
}
|
||||
|
||||
if (shouldConnectToBlock(
|
||||
par1IBlockAccess,
|
||||
par2,
|
||||
par3,
|
||||
par4,
|
||||
par1IBlockAccess.getBlock(par2, par3, par4 + 1),
|
||||
par1IBlockAccess.getBlockMetadata(par2, par3, par4 + 1))) {
|
||||
blockAccess,
|
||||
x,
|
||||
y,
|
||||
z,
|
||||
blockAccess.getBlock(x, y, z - 1),
|
||||
blockAccess.getBlockMetadata(x, y, z - 1))) {
|
||||
isOpenRight = true;
|
||||
}
|
||||
|
||||
if (isOpenUp && isOpenDown && isOpenLeft && isOpenRight) {
|
||||
return icons[15];
|
||||
} else if (isOpenUp && isOpenDown && isOpenLeft) {
|
||||
return icons[13];
|
||||
} else if (isOpenUp && isOpenDown && isOpenRight) {
|
||||
return icons[14];
|
||||
} else if (isOpenUp && isOpenLeft && isOpenRight) {
|
||||
return icons[11];
|
||||
} else if (isOpenDown && isOpenLeft && isOpenRight) {
|
||||
return icons[12];
|
||||
} else if (isOpenDown && isOpenUp) {
|
||||
return icons[6];
|
||||
} else if (isOpenLeft && isOpenRight) {
|
||||
return icons[5];
|
||||
} else if (isOpenDown && isOpenLeft) {
|
||||
return icons[9];
|
||||
} else if (isOpenDown && isOpenRight) {
|
||||
return icons[10];
|
||||
} else if (isOpenUp && isOpenLeft) {
|
||||
return icons[7];
|
||||
} else if (isOpenUp && isOpenRight) {
|
||||
return icons[8];
|
||||
} else if (isOpenDown) {
|
||||
return icons[1];
|
||||
} else if (isOpenUp) {
|
||||
return icons[2];
|
||||
} else if (isOpenLeft) {
|
||||
return icons[4];
|
||||
} else if (isOpenRight) {
|
||||
return icons[3];
|
||||
if (shouldConnectToBlock(
|
||||
blockAccess,
|
||||
x,
|
||||
y,
|
||||
z,
|
||||
blockAccess.getBlock(x, y + 1, z),
|
||||
blockAccess.getBlockMetadata(x, y + 1, z))) {
|
||||
isOpenUp = true;
|
||||
}
|
||||
|
||||
if (shouldConnectToBlock(
|
||||
blockAccess,
|
||||
x,
|
||||
y,
|
||||
z,
|
||||
blockAccess.getBlock(x, y - 1, z),
|
||||
blockAccess.getBlockMetadata(x, y - 1, z))) {
|
||||
isOpenDown = true;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
return getConnectedTexture(icons, isOpenUp, isOpenDown, isOpenLeft, isOpenRight);
|
||||
}
|
||||
|
||||
private static boolean isHodgepodgeFixingBottomFaceUV() {
|
||||
return Boolean.TRUE.equals(Launch.blackboard.get(HODGEPODGE_FIX_BOTTOM_FACE_UV));
|
||||
}
|
||||
|
||||
protected IIcon getConnectedTexture(IIcon[] icons, boolean isOpenUp, boolean isOpenDown, boolean isOpenLeft,
|
||||
boolean isOpenRight) {
|
||||
if (isOpenUp && isOpenDown && isOpenLeft && isOpenRight) return icons[15];
|
||||
if (isOpenUp && isOpenDown && isOpenLeft) return icons[14];
|
||||
if (isOpenUp && isOpenDown && isOpenRight) return icons[13];
|
||||
if (isOpenDown && isOpenLeft && isOpenRight) return icons[12];
|
||||
if (isOpenUp && isOpenLeft && isOpenRight) return icons[11];
|
||||
if (isOpenDown && isOpenLeft) return icons[10];
|
||||
if (isOpenDown && isOpenRight) return icons[9];
|
||||
if (isOpenUp && isOpenLeft) return icons[8];
|
||||
if (isOpenUp && isOpenRight) return icons[7];
|
||||
if (isOpenDown && isOpenUp) return icons[6];
|
||||
if (isOpenLeft && isOpenRight) return icons[5];
|
||||
if (isOpenRight) return icons[4];
|
||||
if (isOpenLeft) return icons[3];
|
||||
if (isOpenUp) return icons[2];
|
||||
if (isOpenDown) return icons[1];
|
||||
return icons[0];
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) {
|
||||
Block b = par1IBlockAccess.getBlock(par2, par3, par4);
|
||||
return b != this && super.shouldSideBeRendered(par1IBlockAccess, par2, par3, par4, par5);
|
||||
public boolean shouldSideBeRendered(IBlockAccess blockAccess, int x, int y, int z, int side) {
|
||||
Block b = blockAccess.getBlock(x, y, z);
|
||||
return b != this && super.shouldSideBeRendered(blockAccess, x, y, z, side);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int par1, int par2) {
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
return icons[0];
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getSelectedBoundingBoxFromPool(World par1World, int par2, int par3, int par4) {
|
||||
if (shouldRenderSelectionBox) {
|
||||
return super.getSelectedBoundingBoxFromPool(par1World, par2, par3, par4);
|
||||
} 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");
|
||||
icons[2] = iconRegister.registerIcon("tinker:glass/" + folder + "/glass_1_u");
|
||||
icons[3] = iconRegister.registerIcon("tinker:glass/" + folder + "/glass_1_l");
|
||||
icons[4] = iconRegister.registerIcon("tinker:glass/" + folder + "/glass_1_r");
|
||||
icons[5] = iconRegister.registerIcon("tinker:glass/" + folder + "/glass_2_h");
|
||||
icons[6] = iconRegister.registerIcon("tinker:glass/" + folder + "/glass_2_v");
|
||||
icons[7] = iconRegister.registerIcon("tinker:glass/" + folder + "/glass_2_dl");
|
||||
icons[8] = iconRegister.registerIcon("tinker:glass/" + folder + "/glass_2_dr");
|
||||
icons[9] = iconRegister.registerIcon("tinker:glass/" + folder + "/glass_2_ul");
|
||||
icons[10] = iconRegister.registerIcon("tinker:glass/" + folder + "/glass_2_ur");
|
||||
icons[11] = iconRegister.registerIcon("tinker:glass/" + folder + "/glass_3_d");
|
||||
icons[12] = iconRegister.registerIcon("tinker:glass/" + folder + "/glass_3_u");
|
||||
icons[13] = iconRegister.registerIcon("tinker:glass/" + folder + "/glass_3_l");
|
||||
icons[14] = iconRegister.registerIcon("tinker:glass/" + folder + "/glass_3_r");
|
||||
icons[15] = iconRegister.registerIcon("tinker:glass/" + folder + "/glass_4");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerBlockIcons(IIconRegister par1IconRegister) {
|
||||
icons[0] = par1IconRegister.registerIcon("tinker:glass/" + folder + "/glass");
|
||||
icons[1] = par1IconRegister.registerIcon("tinker:glass/" + folder + "/glass_1_d");
|
||||
icons[2] = par1IconRegister.registerIcon("tinker:glass/" + folder + "/glass_1_u");
|
||||
icons[3] = par1IconRegister.registerIcon("tinker:glass/" + folder + "/glass_1_l");
|
||||
icons[4] = par1IconRegister.registerIcon("tinker:glass/" + folder + "/glass_1_r");
|
||||
icons[5] = par1IconRegister.registerIcon("tinker:glass/" + folder + "/glass_2_h");
|
||||
icons[6] = par1IconRegister.registerIcon("tinker:glass/" + folder + "/glass_2_v");
|
||||
icons[7] = par1IconRegister.registerIcon("tinker:glass/" + folder + "/glass_2_dl");
|
||||
icons[8] = par1IconRegister.registerIcon("tinker:glass/" + folder + "/glass_2_dr");
|
||||
icons[9] = par1IconRegister.registerIcon("tinker:glass/" + folder + "/glass_2_ul");
|
||||
icons[10] = par1IconRegister.registerIcon("tinker:glass/" + folder + "/glass_2_ur");
|
||||
icons[11] = par1IconRegister.registerIcon("tinker:glass/" + folder + "/glass_3_d");
|
||||
icons[12] = par1IconRegister.registerIcon("tinker:glass/" + folder + "/glass_3_u");
|
||||
icons[13] = par1IconRegister.registerIcon("tinker:glass/" + folder + "/glass_3_l");
|
||||
icons[14] = par1IconRegister.registerIcon("tinker:glass/" + folder + "/glass_3_r");
|
||||
icons[15] = par1IconRegister.registerIcon("tinker:glass/" + folder + "/glass_4");
|
||||
public void registerBlockIcons(IIconRegister iconRegister) {
|
||||
registerBlockIcons(iconRegister, icons, folder);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -9,7 +9,6 @@ import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@@ -23,7 +22,7 @@ public class GlassBlockConnectedMeta extends GlassBlockConnected {
|
||||
|
||||
public String[] textures;
|
||||
public IIcon[][] icons;
|
||||
boolean ignoreMetaForConnectedGlass = PHConstruct.connectedTexturesMode == 2;
|
||||
public static final boolean ignoreMetaForConnectedGlass = PHConstruct.connectedTexturesMode == 2;
|
||||
|
||||
public GlassBlockConnectedMeta(String location, boolean hasAlpha, String... textures) {
|
||||
super(location, hasAlpha);
|
||||
@@ -33,64 +32,46 @@ public class GlassBlockConnectedMeta extends GlassBlockConnected {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) {
|
||||
int meta = par1IBlockAccess.getBlockMetadata(par2, par3, par4);
|
||||
public IIcon getIcon(IBlockAccess blockAccess, int x, int y, int z, int side) {
|
||||
int meta = blockAccess.getBlockMetadata(x, y, z);
|
||||
if (meta < icons.length) {
|
||||
return getConnectedBlockTexture(par1IBlockAccess, par2, par3, par4, par5, icons[meta]);
|
||||
return getConnectedBlockTexture(blockAccess, x, y, z, side, icons[meta]);
|
||||
} else {
|
||||
return getConnectedBlockTexture(par1IBlockAccess, par2, par3, par4, par5, icons[0]);
|
||||
return getConnectedBlockTexture(blockAccess, x, y, z, side, icons[0]);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldConnectToBlock(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, Block par5,
|
||||
int par6) {
|
||||
return par5 == this
|
||||
&& (par6 == par1IBlockAccess.getBlockMetadata(par2, par3, par4) || ignoreMetaForConnectedGlass);
|
||||
public boolean shouldConnectToBlock(IBlockAccess blockAccess, int x, int y, int z, Block block, int meta) {
|
||||
return block == this && (meta == blockAccess.getBlockMetadata(x, y, z) || ignoreMetaForConnectedGlass);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int par1, int par2) {
|
||||
return icons[par2][0];
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(Item b, CreativeTabs par2CreativeTabs, List<ItemStack> par3List) {
|
||||
for (int i = 0; i < textures.length; i++) {
|
||||
par3List.add(new ItemStack(b, 1, i));
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
if (meta < icons.length) {
|
||||
return icons[meta][0];
|
||||
} else {
|
||||
return icons[0][0];
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerBlockIcons(IIconRegister par1IconRegister) {
|
||||
public void getSubBlocks(Item b, CreativeTabs creativeTabs, List<ItemStack> list) {
|
||||
for (int i = 0; i < textures.length; i++) {
|
||||
icons[i][0] = par1IconRegister.registerIcon("tinker:glass/" + folder + "/" + textures[i] + "/glass");
|
||||
icons[i][1] = par1IconRegister.registerIcon("tinker:glass/" + folder + "/" + textures[i] + "/glass_1_d");
|
||||
icons[i][2] = par1IconRegister.registerIcon("tinker:glass/" + folder + "/" + textures[i] + "/glass_1_u");
|
||||
icons[i][3] = par1IconRegister.registerIcon("tinker:glass/" + folder + "/" + textures[i] + "/glass_1_l");
|
||||
icons[i][4] = par1IconRegister.registerIcon("tinker:glass/" + folder + "/" + textures[i] + "/glass_1_r");
|
||||
icons[i][5] = par1IconRegister.registerIcon("tinker:glass/" + folder + "/" + textures[i] + "/glass_2_h");
|
||||
icons[i][6] = par1IconRegister.registerIcon("tinker:glass/" + folder + "/" + textures[i] + "/glass_2_v");
|
||||
icons[i][7] = par1IconRegister.registerIcon("tinker:glass/" + folder + "/" + textures[i] + "/glass_2_dl");
|
||||
icons[i][8] = par1IconRegister.registerIcon("tinker:glass/" + folder + "/" + textures[i] + "/glass_2_dr");
|
||||
icons[i][9] = par1IconRegister.registerIcon("tinker:glass/" + folder + "/" + textures[i] + "/glass_2_ul");
|
||||
icons[i][10] = par1IconRegister.registerIcon("tinker:glass/" + folder + "/" + textures[i] + "/glass_2_ur");
|
||||
icons[i][11] = par1IconRegister.registerIcon("tinker:glass/" + folder + "/" + textures[i] + "/glass_3_d");
|
||||
icons[i][12] = par1IconRegister.registerIcon("tinker:glass/" + folder + "/" + textures[i] + "/glass_3_u");
|
||||
icons[i][13] = par1IconRegister.registerIcon("tinker:glass/" + folder + "/" + textures[i] + "/glass_3_l");
|
||||
icons[i][14] = par1IconRegister.registerIcon("tinker:glass/" + folder + "/" + textures[i] + "/glass_3_r");
|
||||
icons[i][15] = par1IconRegister.registerIcon("tinker:glass/" + folder + "/" + textures[i] + "/glass_4");
|
||||
list.add(new ItemStack(b, 1, i));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(int par1) {
|
||||
return par1;
|
||||
public void registerBlockIcons(IIconRegister iconRegister) {
|
||||
for (int i = 0; i < textures.length; i++) {
|
||||
registerBlockIcons(iconRegister, icons[i], folder + "/" + textures[i]);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPlaceTorchOnTop(World world, int x, int y, int z) {
|
||||
return true;
|
||||
public int damageDropped(int meta) {
|
||||
return meta;
|
||||
}
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
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.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import tconstruct.blocks.TConstructBlock;
|
||||
|
||||
public class GlassBlockStained extends TConstructBlock {
|
||||
|
||||
static String[] blockTextures = { "white", "orange", "magenta", "lightblue", "yellow", "lime", "pink", "gray",
|
||||
"lightgray", "cyan", "purple", "blue", "brown", "green", "red", "black" };
|
||||
String textureName;
|
||||
|
||||
public GlassBlockStained(String tex) {
|
||||
super(Material.glass, 3f, blockTextures);
|
||||
this.textureName = tex;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderBlockPass() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean shouldSideBeRendered(IBlockAccess world, int x, int y, int z, int side) {
|
||||
Block block = world.getBlock(x, y, z);
|
||||
return block != this && super.shouldSideBeRendered(world, x, y, z, side);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister iconRegister) {
|
||||
this.icons = new IIcon[textureNames.length];
|
||||
|
||||
for (int i = 0; i < this.icons.length; ++i) {
|
||||
this.icons[i] = iconRegister.registerIcon("tinker:glass/" + textureName + textureNames[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
package tconstruct.smeltery.blocks;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
|
||||
import tconstruct.library.TConstructRegistry;
|
||||
|
||||
public class GlassPane extends PaneBase {
|
||||
|
||||
static String[] blockTextures = { "glass_clear", "soulglass", "soulglass_clear" };
|
||||
|
||||
public GlassPane() {
|
||||
super(Material.glass, "glass/", blockTextures);
|
||||
this.setHardness(0.3F);
|
||||
this.stepSound = soundTypeGlass;
|
||||
this.setBlockName("tconstruct.glasspane");
|
||||
this.setCreativeTab(TConstructRegistry.blockTab);
|
||||
}
|
||||
}
|
||||
@@ -12,14 +12,18 @@ import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import tconstruct.smeltery.model.PaneConnectedRender;
|
||||
import tconstruct.util.config.PHConstruct;
|
||||
|
||||
public class GlassPaneConnected extends GlassBlockConnected {
|
||||
|
||||
private IIcon theIcon;
|
||||
public static final int SEGMENT_CENTER = 1;
|
||||
public static final int SEGMENT_NORTH = 1 << 1;
|
||||
public static final int SEGMENT_SOUTH = 1 << 2;
|
||||
public static final int SEGMENT_WEST = 1 << 3;
|
||||
public static final int SEGMENT_EAST = 1 << 4;
|
||||
public static final int SEGMENT_CONNECTED = 1 << 5;
|
||||
private IIcon sideIcon;
|
||||
|
||||
public GlassPaneConnected(String location, boolean hasAlpha) {
|
||||
super(location, hasAlpha);
|
||||
@@ -28,510 +32,110 @@ public class GlassPaneConnected extends GlassBlockConnected {
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return PaneConnectedRender.model;
|
||||
// return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) {
|
||||
if (par5 == 0 || par5 == 1) {
|
||||
return par1IBlockAccess.getBlock(par2, par3 - 1, par4) == this && par5 == 0 ? icons[15]
|
||||
: par1IBlockAccess.getBlock(par2, par3 + 1, par4) == this && par5 == 1 ? icons[15]
|
||||
: getSideTextureIndex();
|
||||
} else {
|
||||
return super.getIcon(par1IBlockAccess, par2, par3, par4, par5);
|
||||
public IIcon getConnectedBlockTexture(IBlockAccess blockAccess, int x, int y, int z, int side, IIcon[] icons) {
|
||||
if (side == 0 || side == 1) {
|
||||
// Per-segment culling in the renderer handles whether the center / arm strips actually draw
|
||||
int meta = blockAccess.getBlockMetadata(x, y, z);
|
||||
return side == 0 ? getBottomIcon(meta) : getTopIcon(meta);
|
||||
}
|
||||
|
||||
return super.getConnectedBlockTexture(blockAccess, x, y, z, side, icons);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getConnectedBlockTexture(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5,
|
||||
IIcon[] icons) {
|
||||
if (par5 == 0 || par5 == 1) {
|
||||
return getSideTextureIndex();
|
||||
}
|
||||
public static int segments(boolean center, boolean north, boolean south, boolean west, boolean east) {
|
||||
return (center ? SEGMENT_CENTER : 0) | (north ? SEGMENT_NORTH : 0)
|
||||
| (south ? SEGMENT_SOUTH : 0)
|
||||
| (west ? SEGMENT_WEST : 0)
|
||||
| (east ? SEGMENT_EAST : 0);
|
||||
}
|
||||
|
||||
public int getVisibleVerticalSegments(IBlockAccess world, int x, int y, int z, int dy, boolean north, boolean south,
|
||||
boolean west, boolean east) {
|
||||
Block neighbor = world.getBlock(x, y + dy, z);
|
||||
if (PHConstruct.connectedTexturesMode != 0 && neighbor == this) {
|
||||
boolean neighborNorth = canPaneConnectTo(world, x, y + dy, z - 1, ForgeDirection.NORTH);
|
||||
boolean neighborSouth = canPaneConnectTo(world, x, y + dy, z + 1, ForgeDirection.SOUTH);
|
||||
boolean neighborWest = canPaneConnectTo(world, x - 1, y + dy, z, ForgeDirection.WEST);
|
||||
boolean neighborEast = canPaneConnectTo(world, x + 1, y + dy, z, ForgeDirection.EAST);
|
||||
if (!neighborNorth && !neighborSouth && !neighborWest && !neighborEast) {
|
||||
neighborNorth = neighborSouth = neighborWest = neighborEast = true;
|
||||
}
|
||||
boolean connecting = shouldConnectToBlock(world, x, y, z, neighbor, world.getBlockMetadata(x, y + dy, z));
|
||||
if (connecting) {
|
||||
boolean hasOverlappingArm = (north && neighborNorth) || (south && neighborSouth)
|
||||
|| (west && neighborWest)
|
||||
|| (east && neighborEast);
|
||||
boolean crossing = !hasOverlappingArm;
|
||||
return SEGMENT_CONNECTED | segments(
|
||||
crossing,
|
||||
north && !neighborNorth,
|
||||
south && !neighborSouth,
|
||||
west && !neighborWest,
|
||||
east && !neighborEast);
|
||||
}
|
||||
}
|
||||
return neighbor.isOpaqueCube() ? 0 : segments(true, north, south, west, east);
|
||||
}
|
||||
|
||||
public IIcon getPaneConnectedTexture(IBlockAccess blockAccess, int x, int y, int z, boolean openUp,
|
||||
boolean openDown, boolean openLeft, boolean openRight) {
|
||||
if (PHConstruct.connectedTexturesMode == 0) {
|
||||
return icons[0];
|
||||
}
|
||||
return getConnectedTexture(icons, openUp, openDown, openLeft, openRight);
|
||||
}
|
||||
|
||||
boolean isOpenUp = false, isOpenDown = false, isOpenLeft = false, isOpenRight = false;
|
||||
|
||||
switch (par5) {
|
||||
case 0:
|
||||
if (shouldConnectToBlock(
|
||||
par1IBlockAccess,
|
||||
par2,
|
||||
par3,
|
||||
par4,
|
||||
par1IBlockAccess.getBlock(par2 - 1, par3, par4),
|
||||
par1IBlockAccess.getBlockMetadata(par2 - 1, par3, par4))) {
|
||||
isOpenDown = true;
|
||||
}
|
||||
|
||||
if (shouldConnectToBlock(
|
||||
par1IBlockAccess,
|
||||
par2,
|
||||
par3,
|
||||
par4,
|
||||
par1IBlockAccess.getBlock(par2 + 1, par3, par4),
|
||||
par1IBlockAccess.getBlockMetadata(par2 + 1, par3, par4))) {
|
||||
isOpenUp = true;
|
||||
}
|
||||
|
||||
if (shouldConnectToBlock(
|
||||
par1IBlockAccess,
|
||||
par2,
|
||||
par3,
|
||||
par4,
|
||||
par1IBlockAccess.getBlock(par2, par3, par4 - 1),
|
||||
par1IBlockAccess.getBlockMetadata(par2, par3, par4 - 1))) {
|
||||
isOpenLeft = true;
|
||||
}
|
||||
|
||||
if (shouldConnectToBlock(
|
||||
par1IBlockAccess,
|
||||
par2,
|
||||
par3,
|
||||
par4,
|
||||
par1IBlockAccess.getBlock(par2, par3, par4 + 1),
|
||||
par1IBlockAccess.getBlockMetadata(par2, par3, par4 + 1))) {
|
||||
isOpenRight = true;
|
||||
}
|
||||
|
||||
if (isOpenUp && isOpenDown && isOpenLeft && isOpenRight) {
|
||||
return icons[15];
|
||||
} else if (isOpenUp && isOpenDown && isOpenLeft) {
|
||||
return icons[11];
|
||||
} else if (isOpenUp && isOpenDown && isOpenRight) {
|
||||
return icons[12];
|
||||
} else if (isOpenUp && isOpenLeft && isOpenRight) {
|
||||
return icons[13];
|
||||
} else if (isOpenDown && isOpenLeft && isOpenRight) {
|
||||
return icons[14];
|
||||
} else if (isOpenDown && isOpenUp) {
|
||||
return icons[5];
|
||||
} else if (isOpenLeft && isOpenRight) {
|
||||
return icons[6];
|
||||
} else if (isOpenDown && isOpenLeft) {
|
||||
return icons[8];
|
||||
} else if (isOpenDown && isOpenRight) {
|
||||
return icons[10];
|
||||
} else if (isOpenUp && isOpenLeft) {
|
||||
return icons[7];
|
||||
} else if (isOpenUp && isOpenRight) {
|
||||
return icons[9];
|
||||
} else if (isOpenDown) {
|
||||
return icons[3];
|
||||
} else if (isOpenUp) {
|
||||
return icons[4];
|
||||
} else if (isOpenLeft) {
|
||||
return icons[2];
|
||||
} else if (isOpenRight) {
|
||||
return icons[1];
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (shouldConnectToBlock(
|
||||
par1IBlockAccess,
|
||||
par2,
|
||||
par3,
|
||||
par4,
|
||||
par1IBlockAccess.getBlock(par2 - 1, par3, par4),
|
||||
par1IBlockAccess.getBlockMetadata(par2 - 1, par3, par4))) {
|
||||
isOpenDown = true;
|
||||
}
|
||||
|
||||
if (shouldConnectToBlock(
|
||||
par1IBlockAccess,
|
||||
par2,
|
||||
par3,
|
||||
par4,
|
||||
par1IBlockAccess.getBlock(par2 + 1, par3, par4),
|
||||
par1IBlockAccess.getBlockMetadata(par2 + 1, par3, par4))) {
|
||||
isOpenUp = true;
|
||||
}
|
||||
|
||||
if (shouldConnectToBlock(
|
||||
par1IBlockAccess,
|
||||
par2,
|
||||
par3,
|
||||
par4,
|
||||
par1IBlockAccess.getBlock(par2, par3, par4 - 1),
|
||||
par1IBlockAccess.getBlockMetadata(par2, par3, par4 - 1))) {
|
||||
isOpenLeft = true;
|
||||
}
|
||||
|
||||
if (shouldConnectToBlock(
|
||||
par1IBlockAccess,
|
||||
par2,
|
||||
par3,
|
||||
par4,
|
||||
par1IBlockAccess.getBlock(par2, par3, par4 + 1),
|
||||
par1IBlockAccess.getBlockMetadata(par2, par3, par4 + 1))) {
|
||||
isOpenRight = true;
|
||||
}
|
||||
|
||||
if (isOpenUp && isOpenDown && isOpenLeft && isOpenRight) {
|
||||
return icons[15];
|
||||
} else if (isOpenUp && isOpenDown && isOpenLeft) {
|
||||
return icons[11];
|
||||
} else if (isOpenUp && isOpenDown && isOpenRight) {
|
||||
return icons[12];
|
||||
} else if (isOpenUp && isOpenLeft && isOpenRight) {
|
||||
return icons[13];
|
||||
} else if (isOpenDown && isOpenLeft && isOpenRight) {
|
||||
return icons[14];
|
||||
} else if (isOpenDown && isOpenUp) {
|
||||
return icons[5];
|
||||
} else if (isOpenLeft && isOpenRight) {
|
||||
return icons[6];
|
||||
} else if (isOpenDown && isOpenLeft) {
|
||||
return icons[8];
|
||||
} else if (isOpenDown && isOpenRight) {
|
||||
return icons[10];
|
||||
} else if (isOpenUp && isOpenLeft) {
|
||||
return icons[7];
|
||||
} else if (isOpenUp && isOpenRight) {
|
||||
return icons[9];
|
||||
} else if (isOpenDown) {
|
||||
return icons[3];
|
||||
} else if (isOpenUp) {
|
||||
return icons[4];
|
||||
} else if (isOpenLeft) {
|
||||
return icons[2];
|
||||
} else if (isOpenRight) {
|
||||
return icons[1];
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (shouldConnectToBlock(
|
||||
par1IBlockAccess,
|
||||
par2,
|
||||
par3,
|
||||
par4,
|
||||
par1IBlockAccess.getBlock(par2, par3 - 1, par4),
|
||||
par1IBlockAccess.getBlockMetadata(par2, par3 - 1, par4))) {
|
||||
isOpenDown = true;
|
||||
}
|
||||
|
||||
if (shouldConnectToBlock(
|
||||
par1IBlockAccess,
|
||||
par2,
|
||||
par3,
|
||||
par4,
|
||||
par1IBlockAccess.getBlock(par2, par3 + 1, par4),
|
||||
par1IBlockAccess.getBlockMetadata(par2, par3 + 1, par4))) {
|
||||
isOpenUp = true;
|
||||
}
|
||||
|
||||
if (shouldConnectToBlock(
|
||||
par1IBlockAccess,
|
||||
par2,
|
||||
par3,
|
||||
par4,
|
||||
par1IBlockAccess.getBlock(par2 - 1, par3, par4),
|
||||
par1IBlockAccess.getBlockMetadata(par2 - 1, par3, par4))) {
|
||||
isOpenLeft = true;
|
||||
}
|
||||
|
||||
if (shouldConnectToBlock(
|
||||
par1IBlockAccess,
|
||||
par2,
|
||||
par3,
|
||||
par4,
|
||||
par1IBlockAccess.getBlock(par2 + 1, par3, par4),
|
||||
par1IBlockAccess.getBlockMetadata(par2 + 1, par3, par4))) {
|
||||
isOpenRight = true;
|
||||
}
|
||||
|
||||
if (isOpenUp && isOpenDown && isOpenLeft && isOpenRight) {
|
||||
return icons[15];
|
||||
} else if (isOpenUp && isOpenDown && isOpenLeft) {
|
||||
return icons[13];
|
||||
} else if (isOpenUp && isOpenDown && isOpenRight) {
|
||||
return icons[14];
|
||||
} else if (isOpenUp && isOpenLeft && isOpenRight) {
|
||||
return icons[11];
|
||||
} else if (isOpenDown && isOpenLeft && isOpenRight) {
|
||||
return icons[12];
|
||||
} else if (isOpenDown && isOpenUp) {
|
||||
return icons[6];
|
||||
} else if (isOpenLeft && isOpenRight) {
|
||||
return icons[5];
|
||||
} else if (isOpenDown && isOpenLeft) {
|
||||
return icons[9];
|
||||
} else if (isOpenDown && isOpenRight) {
|
||||
return icons[10];
|
||||
} else if (isOpenUp && isOpenLeft) {
|
||||
return icons[7];
|
||||
} else if (isOpenUp && isOpenRight) {
|
||||
return icons[8];
|
||||
} else if (isOpenDown) {
|
||||
return icons[1];
|
||||
} else if (isOpenUp) {
|
||||
return icons[2];
|
||||
} else if (isOpenLeft) {
|
||||
return icons[4];
|
||||
} else if (isOpenRight) {
|
||||
return icons[3];
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if (shouldConnectToBlock(
|
||||
par1IBlockAccess,
|
||||
par2,
|
||||
par3,
|
||||
par4,
|
||||
par1IBlockAccess.getBlock(par2, par3 - 1, par4),
|
||||
par1IBlockAccess.getBlockMetadata(par2, par3 - 1, par4))) {
|
||||
isOpenDown = true;
|
||||
}
|
||||
|
||||
if (shouldConnectToBlock(
|
||||
par1IBlockAccess,
|
||||
par2,
|
||||
par3,
|
||||
par4,
|
||||
par1IBlockAccess.getBlock(par2, par3 + 1, par4),
|
||||
par1IBlockAccess.getBlockMetadata(par2, par3 + 1, par4))) {
|
||||
isOpenUp = true;
|
||||
}
|
||||
|
||||
if (shouldConnectToBlock(
|
||||
par1IBlockAccess,
|
||||
par2,
|
||||
par3,
|
||||
par4,
|
||||
par1IBlockAccess.getBlock(par2 - 1, par3, par4),
|
||||
par1IBlockAccess.getBlockMetadata(par2 - 1, par3, par4))) {
|
||||
isOpenLeft = true;
|
||||
}
|
||||
|
||||
if (shouldConnectToBlock(
|
||||
par1IBlockAccess,
|
||||
par2,
|
||||
par3,
|
||||
par4,
|
||||
par1IBlockAccess.getBlock(par2 + 1, par3, par4),
|
||||
par1IBlockAccess.getBlockMetadata(par2 + 1, par3, par4))) {
|
||||
isOpenRight = true;
|
||||
}
|
||||
|
||||
if (isOpenUp && isOpenDown && isOpenLeft && isOpenRight) {
|
||||
return icons[15];
|
||||
} else if (isOpenUp && isOpenDown && isOpenLeft) {
|
||||
return icons[14];
|
||||
} else if (isOpenUp && isOpenDown && isOpenRight) {
|
||||
return icons[13];
|
||||
} else if (isOpenUp && isOpenLeft && isOpenRight) {
|
||||
return icons[11];
|
||||
} else if (isOpenDown && isOpenLeft && isOpenRight) {
|
||||
return icons[12];
|
||||
} else if (isOpenDown && isOpenUp) {
|
||||
return icons[6];
|
||||
} else if (isOpenLeft && isOpenRight) {
|
||||
return icons[5];
|
||||
} else if (isOpenDown && isOpenLeft) {
|
||||
return icons[10];
|
||||
} else if (isOpenDown && isOpenRight) {
|
||||
return icons[9];
|
||||
} else if (isOpenUp && isOpenLeft) {
|
||||
return icons[8];
|
||||
} else if (isOpenUp && isOpenRight) {
|
||||
return icons[7];
|
||||
} else if (isOpenDown) {
|
||||
return icons[1];
|
||||
} else if (isOpenUp) {
|
||||
return icons[2];
|
||||
} else if (isOpenLeft) {
|
||||
return icons[3];
|
||||
} else if (isOpenRight) {
|
||||
return icons[4];
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
if (shouldConnectToBlock(
|
||||
par1IBlockAccess,
|
||||
par2,
|
||||
par3,
|
||||
par4,
|
||||
par1IBlockAccess.getBlock(par2, par3 - 1, par4),
|
||||
par1IBlockAccess.getBlockMetadata(par2, par3 - 1, par4))) {
|
||||
isOpenDown = true;
|
||||
}
|
||||
|
||||
if (shouldConnectToBlock(
|
||||
par1IBlockAccess,
|
||||
par2,
|
||||
par3,
|
||||
par4,
|
||||
par1IBlockAccess.getBlock(par2, par3 + 1, par4),
|
||||
par1IBlockAccess.getBlockMetadata(par2, par3 + 1, par4))) {
|
||||
isOpenUp = true;
|
||||
}
|
||||
|
||||
if (shouldConnectToBlock(
|
||||
par1IBlockAccess,
|
||||
par2,
|
||||
par3,
|
||||
par4,
|
||||
par1IBlockAccess.getBlock(par2, par3, par4 - 1),
|
||||
par1IBlockAccess.getBlockMetadata(par2, par3, par4 - 1))) {
|
||||
isOpenLeft = true;
|
||||
}
|
||||
|
||||
if (shouldConnectToBlock(
|
||||
par1IBlockAccess,
|
||||
par2,
|
||||
par3,
|
||||
par4,
|
||||
par1IBlockAccess.getBlock(par2, par3, par4 + 1),
|
||||
par1IBlockAccess.getBlockMetadata(par2, par3, par4 + 1))) {
|
||||
isOpenRight = true;
|
||||
}
|
||||
|
||||
if (isOpenUp && isOpenDown && isOpenLeft && isOpenRight) {
|
||||
return icons[15];
|
||||
} else if (isOpenUp && isOpenDown && isOpenLeft) {
|
||||
return icons[14];
|
||||
} else if (isOpenUp && isOpenDown && isOpenRight) {
|
||||
return icons[13];
|
||||
} else if (isOpenUp && isOpenLeft && isOpenRight) {
|
||||
return icons[11];
|
||||
} else if (isOpenDown && isOpenLeft && isOpenRight) {
|
||||
return icons[12];
|
||||
} else if (isOpenDown && isOpenUp) {
|
||||
return icons[6];
|
||||
} else if (isOpenLeft && isOpenRight) {
|
||||
return icons[5];
|
||||
} else if (isOpenDown && isOpenLeft) {
|
||||
return icons[10];
|
||||
} else if (isOpenDown && isOpenRight) {
|
||||
return icons[9];
|
||||
} else if (isOpenUp && isOpenLeft) {
|
||||
return icons[8];
|
||||
} else if (isOpenUp && isOpenRight) {
|
||||
return icons[7];
|
||||
} else if (isOpenDown) {
|
||||
return icons[1];
|
||||
} else if (isOpenUp) {
|
||||
return icons[2];
|
||||
} else if (isOpenLeft) {
|
||||
return icons[3];
|
||||
} else if (isOpenRight) {
|
||||
return icons[4];
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
if (shouldConnectToBlock(
|
||||
par1IBlockAccess,
|
||||
par2,
|
||||
par3,
|
||||
par4,
|
||||
par1IBlockAccess.getBlock(par2, par3 - 1, par4),
|
||||
par1IBlockAccess.getBlockMetadata(par2, par3 - 1, par4))) {
|
||||
isOpenDown = true;
|
||||
}
|
||||
|
||||
if (shouldConnectToBlock(
|
||||
par1IBlockAccess,
|
||||
par2,
|
||||
par3,
|
||||
par4,
|
||||
par1IBlockAccess.getBlock(par2, par3 + 1, par4),
|
||||
par1IBlockAccess.getBlockMetadata(par2, par3 + 1, par4))) {
|
||||
isOpenUp = true;
|
||||
}
|
||||
|
||||
if (shouldConnectToBlock(
|
||||
par1IBlockAccess,
|
||||
par2,
|
||||
par3,
|
||||
par4,
|
||||
par1IBlockAccess.getBlock(par2, par3, par4 - 1),
|
||||
par1IBlockAccess.getBlockMetadata(par2, par3, par4 - 1))) {
|
||||
isOpenLeft = true;
|
||||
}
|
||||
|
||||
if (shouldConnectToBlock(
|
||||
par1IBlockAccess,
|
||||
par2,
|
||||
par3,
|
||||
par4,
|
||||
par1IBlockAccess.getBlock(par2, par3, par4 + 1),
|
||||
par1IBlockAccess.getBlockMetadata(par2, par3, par4 + 1))) {
|
||||
isOpenRight = true;
|
||||
}
|
||||
|
||||
if (isOpenUp && isOpenDown && isOpenLeft && isOpenRight) {
|
||||
return icons[15];
|
||||
} else if (isOpenUp && isOpenDown && isOpenLeft) {
|
||||
return icons[13];
|
||||
} else if (isOpenUp && isOpenDown && isOpenRight) {
|
||||
return icons[14];
|
||||
} else if (isOpenUp && isOpenLeft && isOpenRight) {
|
||||
return icons[11];
|
||||
} else if (isOpenDown && isOpenLeft && isOpenRight) {
|
||||
return icons[12];
|
||||
} else if (isOpenDown && isOpenUp) {
|
||||
return icons[6];
|
||||
} else if (isOpenLeft && isOpenRight) {
|
||||
return icons[5];
|
||||
} else if (isOpenDown && isOpenLeft) {
|
||||
return icons[9];
|
||||
} else if (isOpenDown && isOpenRight) {
|
||||
return icons[10];
|
||||
} else if (isOpenUp && isOpenLeft) {
|
||||
return icons[7];
|
||||
} else if (isOpenUp && isOpenRight) {
|
||||
return icons[8];
|
||||
} else if (isOpenDown) {
|
||||
return icons[1];
|
||||
} else if (isOpenUp) {
|
||||
return icons[2];
|
||||
} else if (isOpenLeft) {
|
||||
return icons[4];
|
||||
} else if (isOpenRight) {
|
||||
return icons[3];
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return icons[0];
|
||||
// Side-face strip icon driven by a single segment's top/bottom culling: if the segment's
|
||||
// top (bottom) is hidden in topSegments /bottomSegments the strip on that piece uses the
|
||||
// open-edge connected variant, matching what the top/bottom face culling does.
|
||||
public IIcon getPaneSegmentTexture(IBlockAccess blockAccess, int x, int y, int z, int segment, int topSegments,
|
||||
int bottomSegments, boolean openLeft, boolean openRight) {
|
||||
return getPaneConnectedTexture(
|
||||
blockAccess,
|
||||
x,
|
||||
y,
|
||||
z,
|
||||
(topSegments & SEGMENT_CONNECTED) != 0 && (topSegments & segment) == 0,
|
||||
(bottomSegments & SEGMENT_CONNECTED) != 0 && (bottomSegments & segment) == 0,
|
||||
openLeft,
|
||||
openRight);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCollisionBoxesToList(World par1World, int par2, int par3, int par4, AxisAlignedBB par5AxisAlignedBB,
|
||||
List<AxisAlignedBB> par6List, Entity par7Entity) {
|
||||
boolean flag = this.canPaneConnectTo(par1World, par2, par3, par4, ForgeDirection.NORTH);
|
||||
boolean flag1 = this.canPaneConnectTo(par1World, par2, par3, par4, ForgeDirection.SOUTH);
|
||||
boolean flag2 = this.canPaneConnectTo(par1World, par2, par3, par4, ForgeDirection.WEST);
|
||||
boolean flag3 = this.canPaneConnectTo(par1World, par2, par3, par4, ForgeDirection.EAST);
|
||||
public void addCollisionBoxesToList(World world, int x, int y, int z, AxisAlignedBB axisAlignedBB,
|
||||
List<AxisAlignedBB> par6List, Entity entity) {
|
||||
boolean flag = this.canPaneConnectTo(world, x, y, z - 1, ForgeDirection.NORTH);
|
||||
boolean flag1 = this.canPaneConnectTo(world, x, y, z + 1, ForgeDirection.SOUTH);
|
||||
boolean flag2 = this.canPaneConnectTo(world, x - 1, y, z, ForgeDirection.WEST);
|
||||
boolean flag3 = this.canPaneConnectTo(world, x + 1, y, z, ForgeDirection.EAST);
|
||||
|
||||
if ((!flag2 || !flag3) && (flag2 || flag3 || flag || flag1)) {
|
||||
if (flag2 && !flag3) {
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.4375F, 0.5F, 1.0F, 0.5625F);
|
||||
super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity);
|
||||
super.addCollisionBoxesToList(world, x, y, z, axisAlignedBB, par6List, entity);
|
||||
} else if (!flag2 && flag3) {
|
||||
this.setBlockBounds(0.5F, 0.0F, 0.4375F, 1.0F, 1.0F, 0.5625F);
|
||||
super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity);
|
||||
super.addCollisionBoxesToList(world, x, y, z, axisAlignedBB, par6List, entity);
|
||||
}
|
||||
} else {
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.4375F, 1.0F, 1.0F, 0.5625F);
|
||||
super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity);
|
||||
super.addCollisionBoxesToList(world, x, y, z, axisAlignedBB, par6List, entity);
|
||||
}
|
||||
|
||||
if ((!flag || !flag1) && (flag2 || flag3 || flag || flag1)) {
|
||||
if (flag && !flag1) {
|
||||
this.setBlockBounds(0.4375F, 0.0F, 0.0F, 0.5625F, 1.0F, 0.5F);
|
||||
super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity);
|
||||
super.addCollisionBoxesToList(world, x, y, z, axisAlignedBB, par6List, entity);
|
||||
} else if (!flag && flag1) {
|
||||
this.setBlockBounds(0.4375F, 0.0F, 0.5F, 0.5625F, 1.0F, 1.0F);
|
||||
super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity);
|
||||
super.addCollisionBoxesToList(world, x, y, z, axisAlignedBB, par6List, entity);
|
||||
}
|
||||
} else {
|
||||
this.setBlockBounds(0.4375F, 0.0F, 0.0F, 0.5625F, 1.0F, 1.0F);
|
||||
super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity);
|
||||
super.addCollisionBoxesToList(world, x, y, z, axisAlignedBB, par6List, entity);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -541,15 +145,15 @@ public class GlassPaneConnected extends GlassBlockConnected {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) {
|
||||
public void setBlockBoundsBasedOnState(IBlockAccess blockAccess, int x, int y, int z) {
|
||||
float f = 0.4375F;
|
||||
float f1 = 0.5625F;
|
||||
float f2 = 0.4375F;
|
||||
float f3 = 0.5625F;
|
||||
boolean flag = this.canPaneConnectTo(par1IBlockAccess, par2, par3, par4, ForgeDirection.NORTH);
|
||||
boolean flag1 = this.canPaneConnectTo(par1IBlockAccess, par2, par3, par4, ForgeDirection.SOUTH);
|
||||
boolean flag2 = this.canPaneConnectTo(par1IBlockAccess, par2, par3, par4, ForgeDirection.WEST);
|
||||
boolean flag3 = this.canPaneConnectTo(par1IBlockAccess, par2, par3, par4, ForgeDirection.EAST);
|
||||
boolean flag = this.canPaneConnectTo(blockAccess, x, y, z - 1, ForgeDirection.NORTH);
|
||||
boolean flag1 = this.canPaneConnectTo(blockAccess, x, y, z + 1, ForgeDirection.SOUTH);
|
||||
boolean flag2 = this.canPaneConnectTo(blockAccess, x - 1, y, z, ForgeDirection.WEST);
|
||||
boolean flag3 = this.canPaneConnectTo(blockAccess, x + 1, y, z, ForgeDirection.EAST);
|
||||
|
||||
if ((!flag2 || !flag3) && (flag2 || flag3 || flag || flag1)) {
|
||||
if (flag2 && !flag3) {
|
||||
@@ -576,27 +180,25 @@ public class GlassPaneConnected extends GlassBlockConnected {
|
||||
this.setBlockBounds(f, 0.0F, f2, f1, 1.0F, f3);
|
||||
}
|
||||
|
||||
public IIcon getSideTextureIndex() {
|
||||
return this.theIcon;
|
||||
public IIcon getTopIcon(int meta) {
|
||||
return sideIcon;
|
||||
}
|
||||
|
||||
public final boolean canThisPaneConnectToThisBlock(Block b) {
|
||||
public IIcon getBottomIcon(int meta) {
|
||||
return sideIcon;
|
||||
}
|
||||
|
||||
public final boolean canPaneConnectToBlock(Block b) {
|
||||
return b.isOpaqueCube() || b == this || b == Blocks.glass;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerBlockIcons(IIconRegister par1IconRegister) {
|
||||
super.registerBlockIcons(par1IconRegister);
|
||||
this.theIcon = par1IconRegister.registerIcon("tinker:glass/" + folder + "/glass_side");
|
||||
public void registerBlockIcons(IIconRegister iconRegister) {
|
||||
super.registerBlockIcons(iconRegister);
|
||||
this.sideIcon = iconRegister.registerIcon("tinker:glass/" + folder + "/glass_side");
|
||||
}
|
||||
|
||||
public boolean canPaneConnectTo(IBlockAccess access, int x, int y, int z, ForgeDirection dir) {
|
||||
return canThisPaneConnectToThisBlock(access.getBlock(x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ))
|
||||
|| access.isSideSolid(x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ, dir.getOpposite(), false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) {
|
||||
return true;
|
||||
public boolean canPaneConnectTo(IBlockAccess world, int x, int y, int z, ForgeDirection dir) {
|
||||
return canPaneConnectToBlock(world.getBlock(x, y, z)) || world.isSideSolid(x, y, z, dir.getOpposite(), false);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,108 @@
|
||||
package tconstruct.smeltery.blocks;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import tconstruct.util.config.PHConstruct;
|
||||
|
||||
public class GlassPaneConnectedMeta extends GlassPaneConnected {
|
||||
|
||||
private final String[] textures;
|
||||
private final IIcon[][] icons;
|
||||
private final IIcon[] topIcons;
|
||||
private final IIcon[] bottomIcons;
|
||||
|
||||
public GlassPaneConnectedMeta(String location, boolean hasAlpha, String... textures) {
|
||||
super(location, hasAlpha);
|
||||
this.textures = textures;
|
||||
this.icons = new IIcon[textures.length][16];
|
||||
this.topIcons = new IIcon[textures.length];
|
||||
this.bottomIcons = new IIcon[textures.length];
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(IBlockAccess blockAccess, int x, int y, int z, int side) {
|
||||
int meta = blockAccess.getBlockMetadata(x, y, z);
|
||||
if (meta < icons.length) {
|
||||
return getConnectedBlockTexture(blockAccess, x, y, z, side, icons[meta]);
|
||||
} else {
|
||||
return getConnectedBlockTexture(blockAccess, x, y, z, side, icons[0]);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldConnectToBlock(IBlockAccess blockAccess, int x, int y, int z, Block block, int meta) {
|
||||
return block == this && (meta == blockAccess.getBlockMetadata(x, y, z)
|
||||
|| GlassBlockConnectedMeta.ignoreMetaForConnectedGlass);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getPaneConnectedTexture(IBlockAccess blockAccess, int x, int y, int z, boolean openUp,
|
||||
boolean openDown, boolean openLeft, boolean openRight) {
|
||||
int meta = blockAccess.getBlockMetadata(x, y, z);
|
||||
IIcon[] icons = meta < this.icons.length ? this.icons[meta] : this.icons[0];
|
||||
if (PHConstruct.connectedTexturesMode == 0) {
|
||||
return icons[0];
|
||||
}
|
||||
return getConnectedTexture(icons, openUp, openDown, openLeft, openRight);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
if (meta < icons.length) {
|
||||
return icons[meta][0];
|
||||
} else {
|
||||
return icons[0][0];
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(Item b, CreativeTabs creativeTabs, List<ItemStack> list) {
|
||||
for (int i = 0; i < textures.length; i++) {
|
||||
list.add(new ItemStack(b, 1, i));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerBlockIcons(IIconRegister iconRegister) {
|
||||
for (int i = 0; i < textures.length; i++) {
|
||||
registerBlockIcons(iconRegister, icons[i], folder + "/" + textures[i]);
|
||||
topIcons[i] = iconRegister.registerIcon("tinker:glass/" + folder + "/" + textures[i] + "/glass_top");
|
||||
bottomIcons[i] = iconRegister.registerIcon("tinker:glass/" + folder + "/" + textures[i] + "/glass_bottom");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getTopIcon(int meta) {
|
||||
if (meta < topIcons.length) {
|
||||
return topIcons[meta];
|
||||
} else {
|
||||
return topIcons[0];
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getBottomIcon(int meta) {
|
||||
if (meta < bottomIcons.length) {
|
||||
return bottomIcons[meta];
|
||||
} else {
|
||||
return bottomIcons[0];
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(int meta) {
|
||||
return meta;
|
||||
}
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
package tconstruct.smeltery.blocks;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
|
||||
import tconstruct.library.TConstructRegistry;
|
||||
|
||||
public class GlassPaneStained extends PaneBase {
|
||||
|
||||
static String[] blockTextures = { "white", "orange", "magenta", "lightblue", "yellow", "lime", "pink", "gray",
|
||||
"lightgray", "cyan", "purple", "blue", "brown", "green", "red", "black" };
|
||||
|
||||
public GlassPaneStained() {
|
||||
super(Material.glass, "glass/", assembleBlockTextures());
|
||||
// TODO setHardness
|
||||
this.setHardness(0.3F);
|
||||
this.stepSound = soundTypeGlass;
|
||||
this.setBlockName("tconstruct.glasspanestained");
|
||||
this.setCreativeTab(TConstructRegistry.blockTab);
|
||||
}
|
||||
|
||||
private static String[] assembleBlockTextures() {
|
||||
String[] textures = new String[blockTextures.length];
|
||||
for (int i = 0; i < blockTextures.length; i++) {
|
||||
textures[i] = "stainedglass_" + blockTextures[i];
|
||||
}
|
||||
return textures;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderBlockPass() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(int par1) {
|
||||
return par1;
|
||||
}
|
||||
}
|
||||
@@ -1,81 +0,0 @@
|
||||
package tconstruct.smeltery.blocks;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.BlockStainedGlassPane;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import tconstruct.smeltery.model.PaneRender;
|
||||
|
||||
public class PaneBase extends BlockStainedGlassPane {
|
||||
|
||||
public String[] textureNames;
|
||||
public String folder;
|
||||
public IIcon[] icons;
|
||||
public IIcon[] sideIcons;
|
||||
|
||||
public PaneBase(Material material, String folder, String[] blockTextures) {
|
||||
super();
|
||||
textureNames = blockTextures;
|
||||
this.folder = folder;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister iconRegister) {
|
||||
this.icons = new IIcon[textureNames.length];
|
||||
this.sideIcons = new IIcon[textureNames.length];
|
||||
|
||||
for (int i = 0; i < this.icons.length; ++i) {
|
||||
this.icons[i] = iconRegister.registerIcon("tinker:" + folder + textureNames[i]);
|
||||
this.sideIcons[i] = iconRegister.registerIcon("tinker:" + folder + textureNames[i] + "_side");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon func_149735_b(int side, int meta) {
|
||||
return icons[meta];
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon func_150104_b(int p_150104_1_) {
|
||||
return sideIcons[p_150104_1_];
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
return icons[meta];
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(Item b, CreativeTabs tab, List<ItemStack> list) {
|
||||
for (int iter = 0; iter < textureNames.length; iter++) {
|
||||
list.add(new ItemStack(b, 1, iter));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return PaneRender.model;
|
||||
}
|
||||
}
|
||||
@@ -11,8 +11,7 @@ import mantle.blocks.abstracts.MultiItemBlock;
|
||||
|
||||
public class GlassBlockItem extends MultiItemBlock {
|
||||
|
||||
public static final String[] blockTypes = { "pure" }; // , "soul",
|
||||
// "soul.pure" };
|
||||
public static final String[] blockTypes = { "pure" };
|
||||
|
||||
public GlassBlockItem(Block b) {
|
||||
super(b, "block.glass", blockTypes);
|
||||
|
||||
@@ -6,7 +6,7 @@ import mantle.blocks.abstracts.MultiItemBlock;
|
||||
|
||||
public class GlassPaneItem extends MultiItemBlock {
|
||||
|
||||
public static final String[] blockTypes = { "pure", "soul", "soul.pure" };
|
||||
public static final String[] blockTypes = { "pure" };
|
||||
|
||||
public GlassPaneItem(Block b) {
|
||||
super(b, "block.glass", "pane", blockTypes);
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
package tconstruct.smeltery.itemblocks;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import mantle.blocks.abstracts.MultiItemBlock;
|
||||
|
||||
public class StainedGlassClearPaneItem extends MultiItemBlock {
|
||||
@@ -14,4 +17,10 @@ public class StainedGlassClearPaneItem extends MultiItemBlock {
|
||||
setMaxDamage(0);
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconFromDamage(int meta) {
|
||||
return this.field_150939_a.getIcon(1, meta);
|
||||
}
|
||||
}
|
||||
@@ -6,9 +6,14 @@ import static net.minecraftforge.common.util.ForgeDirection.SOUTH;
|
||||
import static net.minecraftforge.common.util.ForgeDirection.WEST;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.EntityRenderer;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.gtnewhorizons.angelica.api.ThreadSafeISBRH;
|
||||
|
||||
@@ -22,64 +27,548 @@ public class PaneConnectedRender implements ISimpleBlockRenderingHandler {
|
||||
public static int model = RenderingRegistry.getNextAvailableRenderId();
|
||||
|
||||
@Override
|
||||
public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) {}
|
||||
public void renderInventoryBlock(Block block, int meta, int modelID, RenderBlocks renderer) {
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
GlassPaneConnected pane = (GlassPaneConnected) block;
|
||||
block.setBlockBoundsForItemRender();
|
||||
renderer.setRenderBoundsFromBlock(block);
|
||||
|
||||
GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
|
||||
int segments = GlassPaneConnected.SEGMENT_CENTER | GlassPaneConnected.SEGMENT_WEST
|
||||
| GlassPaneConnected.SEGMENT_EAST;
|
||||
|
||||
// Bottom
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(0.0F, -1.0F, 0.0F);
|
||||
renderTopOrBottom(tessellator, 0, 0, 0, segments, false, pane.getTopIcon(meta));
|
||||
tessellator.draw();
|
||||
|
||||
// Top
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(0.0F, 1.0F, 0.0F);
|
||||
renderTopOrBottom(tessellator, 0, 0, 0, segments, true, pane.getBottomIcon(meta));
|
||||
tessellator.draw();
|
||||
|
||||
// North
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(0.0F, 0.0F, -1.0F);
|
||||
IIcon northIcon = pane.getIcon(2, meta);
|
||||
renderSide(tessellator, 0, 0, 0, NORTH, true, true, false, false, northIcon, northIcon, northIcon);
|
||||
tessellator.draw();
|
||||
|
||||
// South
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(0.0F, 0.0F, 1.0F);
|
||||
IIcon southIcon = pane.getIcon(3, meta);
|
||||
renderSide(tessellator, 0, 0, 0, SOUTH, true, true, false, false, southIcon, southIcon, southIcon);
|
||||
tessellator.draw();
|
||||
|
||||
// West
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(-1.0F, 0.0F, 0.0F);
|
||||
IIcon westIcon = pane.getIcon(4, meta);
|
||||
renderSide(tessellator, 0, 0, 0, WEST, false, false, true, true, westIcon, westIcon, westIcon);
|
||||
tessellator.draw();
|
||||
|
||||
// East
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(1.0F, 0.0F, 0.0F);
|
||||
IIcon eastIcon = pane.getIcon(5, meta);
|
||||
renderSide(tessellator, 0, 0, 0, EAST, false, false, true, true, eastIcon, eastIcon, eastIcon);
|
||||
tessellator.draw();
|
||||
|
||||
GL11.glTranslatef(0.5F, 0.5F, 0.5F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId,
|
||||
RenderBlocks renderer) {
|
||||
boolean temp = renderer.renderAllFaces;
|
||||
renderer.renderAllFaces = true;
|
||||
// Boilerplate partially copied from renderBlockPane / renderBlockStainedGlassPane
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x, y, z));
|
||||
int multRGB = block.colorMultiplier(world, x, y, z);
|
||||
float multR = (float) (multRGB >> 16 & 255) / 255.0F;
|
||||
float multG = (float) (multRGB >> 8 & 255) / 255.0F;
|
||||
float multB = (float) (multRGB & 255) / 255.0F;
|
||||
|
||||
if (EntityRenderer.anaglyphEnable) {
|
||||
float tempR = (multR * 30.0F + multG * 59.0F + multB * 11.0F) / 100.0F;
|
||||
float tempG = (multR * 30.0F + multG * 70.0F) / 100.0F;
|
||||
float tempB = (multR * 30.0F + multB * 70.0F) / 100.0F;
|
||||
multR = tempR;
|
||||
multG = tempG;
|
||||
multB = tempB;
|
||||
}
|
||||
|
||||
tessellator.setColorOpaque_F(multR, multG, multB);
|
||||
|
||||
// Fetch pane
|
||||
GlassPaneConnected pane = (GlassPaneConnected) block;
|
||||
|
||||
boolean flag = pane.canPaneConnectTo(world, x, y, z, EAST);
|
||||
boolean flag1 = pane.canPaneConnectTo(world, x, y, z, WEST);
|
||||
boolean flag2 = pane.canPaneConnectTo(world, x, y, z, SOUTH);
|
||||
boolean flag3 = pane.canPaneConnectTo(world, x, y, z, NORTH);
|
||||
boolean rawNorth = pane.canPaneConnectTo(world, x, y, z - 1, NORTH);
|
||||
boolean rawSouth = pane.canPaneConnectTo(world, x, y, z + 1, SOUTH);
|
||||
boolean rawWest = pane.canPaneConnectTo(world, x - 1, y, z, WEST);
|
||||
boolean rawEast = pane.canPaneConnectTo(world, x + 1, y, z, EAST);
|
||||
boolean cross = !rawNorth && !rawSouth && !rawWest && !rawEast;
|
||||
boolean north = cross || rawNorth;
|
||||
boolean south = cross || rawSouth;
|
||||
boolean west = cross || rawWest;
|
||||
boolean east = cross || rawEast;
|
||||
|
||||
IIcon sideTexture = pane.getSideTextureIndex();
|
||||
// Per-segment visibility for the top and bottom faces. Whole-face culling is too coarse:
|
||||
// stacked panes with mismatched arm configs (e.g. an E-W line below an N-S line) leave
|
||||
// arm tops with nothing covering them, so they have to render even though the centers
|
||||
// do not.
|
||||
int bottomSegments = pane.getVisibleVerticalSegments(world, x, y, z, -1, north, south, west, east);
|
||||
int topSegments = pane.getVisibleVerticalSegments(world, x, y, z, 1, north, south, west, east);
|
||||
|
||||
if (!flag && !flag1 && !flag2 && !flag3) {
|
||||
renderer.setRenderBounds(0D, 0D, 0.45D, 1D, 1D, 0.55D);
|
||||
renderer.renderStandardBlock(block, x, y, z);
|
||||
renderer.setRenderBounds(0.45D, 0D, 0D, 0.55D, 1D, 1D);
|
||||
renderer.renderStandardBlock(block, x, y, z);
|
||||
} // else {
|
||||
// renderer.setRenderBounds(0.45D, 0D, 0.45D, 0.55D, 1D, 0.55D);
|
||||
// renderer.renderStandardBlock(block, x, y, z);
|
||||
// }
|
||||
IIcon bottomIcon = pane.getIcon(world, x, y, z, 0);
|
||||
IIcon topIcon = pane.getIcon(world, x, y, z, 1);
|
||||
|
||||
// renderer.setOverrideBlockTexture(sideTexture);
|
||||
boolean connEast = pane
|
||||
.shouldConnectToBlock(world, x, y, z, world.getBlock(x + 1, y, z), world.getBlockMetadata(x + 1, y, z));
|
||||
boolean connWest = pane
|
||||
.shouldConnectToBlock(world, x, y, z, world.getBlock(x - 1, y, z), world.getBlockMetadata(x - 1, y, z));
|
||||
boolean connNorth = pane
|
||||
.shouldConnectToBlock(world, x, y, z, world.getBlock(x, y, z - 1), world.getBlockMetadata(x, y, z - 1));
|
||||
boolean connSouth = pane
|
||||
.shouldConnectToBlock(world, x, y, z, world.getBlock(x, y, z + 1), world.getBlockMetadata(x, y, z + 1));
|
||||
|
||||
if (flag) {
|
||||
renderer.setRenderBounds(0.45D, 0D, 0.45D, 1D, 1D, 0.55D);
|
||||
renderer.renderStandardBlock(block, x, y, z);
|
||||
// Each side face is split into three strips (two arms + center). Per-strip vertical
|
||||
// openness mirrors the corresponding segment's bit in {top,bottom}Segments — i.e. the
|
||||
// exact same culling that decides whether the top/bottom face is rendered. In the cross
|
||||
// case the "center" strip is actually the front-facing arm's edge, so it uses that
|
||||
// arm's segment instead of SEGMENT_CENTER.
|
||||
int northCenterSeg = cross ? GlassPaneConnected.SEGMENT_NORTH : GlassPaneConnected.SEGMENT_CENTER;
|
||||
int southCenterSeg = cross ? GlassPaneConnected.SEGMENT_SOUTH : GlassPaneConnected.SEGMENT_CENTER;
|
||||
int westCenterSeg = cross ? GlassPaneConnected.SEGMENT_WEST : GlassPaneConnected.SEGMENT_CENTER;
|
||||
int eastCenterSeg = cross ? GlassPaneConnected.SEGMENT_EAST : GlassPaneConnected.SEGMENT_CENTER;
|
||||
|
||||
if (renderer.hasOverrideBlockTexture()) {
|
||||
renderTopOrBottom(tessellator, x, y, z, bottomSegments, false, renderer.overrideBlockTexture);
|
||||
renderTopOrBottom(tessellator, x, y, z, topSegments, true, renderer.overrideBlockTexture);
|
||||
|
||||
renderSide(
|
||||
tessellator,
|
||||
x,
|
||||
y,
|
||||
z,
|
||||
NORTH,
|
||||
east,
|
||||
west,
|
||||
north,
|
||||
cross,
|
||||
renderer.overrideBlockTexture,
|
||||
renderer.overrideBlockTexture,
|
||||
renderer.overrideBlockTexture);
|
||||
renderSide(
|
||||
tessellator,
|
||||
x,
|
||||
y,
|
||||
z,
|
||||
SOUTH,
|
||||
west,
|
||||
east,
|
||||
south,
|
||||
cross,
|
||||
renderer.overrideBlockTexture,
|
||||
renderer.overrideBlockTexture,
|
||||
renderer.overrideBlockTexture);
|
||||
renderSide(
|
||||
tessellator,
|
||||
x,
|
||||
y,
|
||||
z,
|
||||
WEST,
|
||||
north,
|
||||
south,
|
||||
west,
|
||||
cross,
|
||||
renderer.overrideBlockTexture,
|
||||
renderer.overrideBlockTexture,
|
||||
renderer.overrideBlockTexture);
|
||||
renderSide(
|
||||
tessellator,
|
||||
x,
|
||||
y,
|
||||
z,
|
||||
EAST,
|
||||
south,
|
||||
north,
|
||||
east,
|
||||
cross,
|
||||
renderer.overrideBlockTexture,
|
||||
renderer.overrideBlockTexture,
|
||||
renderer.overrideBlockTexture);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (flag1) {
|
||||
renderer.setRenderBounds(0D, 0D, 0.45D, 0.45D, 1D, 0.55D);
|
||||
renderer.renderStandardBlock(block, x, y, z);
|
||||
}
|
||||
IIcon northLeftIcon = pane.getPaneSegmentTexture(
|
||||
world,
|
||||
x,
|
||||
y,
|
||||
z,
|
||||
GlassPaneConnected.SEGMENT_EAST,
|
||||
topSegments,
|
||||
bottomSegments,
|
||||
connEast,
|
||||
connWest);
|
||||
IIcon northRightIcon = pane.getPaneSegmentTexture(
|
||||
world,
|
||||
x,
|
||||
y,
|
||||
z,
|
||||
GlassPaneConnected.SEGMENT_WEST,
|
||||
topSegments,
|
||||
bottomSegments,
|
||||
connEast,
|
||||
connWest);
|
||||
IIcon northCenterIcon = pane
|
||||
.getPaneSegmentTexture(world, x, y, z, northCenterSeg, topSegments, bottomSegments, connEast, connWest);
|
||||
|
||||
if (flag2) {
|
||||
renderer.setRenderBounds(0.45D, 0D, 0.45D, 0.55D, 1D, 1D);
|
||||
renderer.renderStandardBlock(block, x, y, z);
|
||||
}
|
||||
IIcon southLeftIcon = pane.getPaneSegmentTexture(
|
||||
world,
|
||||
x,
|
||||
y,
|
||||
z,
|
||||
GlassPaneConnected.SEGMENT_WEST,
|
||||
topSegments,
|
||||
bottomSegments,
|
||||
connWest,
|
||||
connEast);
|
||||
IIcon southRightIcon = pane.getPaneSegmentTexture(
|
||||
world,
|
||||
x,
|
||||
y,
|
||||
z,
|
||||
GlassPaneConnected.SEGMENT_EAST,
|
||||
topSegments,
|
||||
bottomSegments,
|
||||
connWest,
|
||||
connEast);
|
||||
IIcon southCenterIcon = pane
|
||||
.getPaneSegmentTexture(world, x, y, z, southCenterSeg, topSegments, bottomSegments, connWest, connEast);
|
||||
|
||||
if (flag3) {
|
||||
renderer.setRenderBounds(0.45D, 0D, 0D, 0.55D, 1D, 0.45D);
|
||||
renderer.renderStandardBlock(block, x, y, z);
|
||||
}
|
||||
IIcon westLeftIcon = pane.getPaneSegmentTexture(
|
||||
world,
|
||||
x,
|
||||
y,
|
||||
z,
|
||||
GlassPaneConnected.SEGMENT_NORTH,
|
||||
topSegments,
|
||||
bottomSegments,
|
||||
connNorth,
|
||||
connSouth);
|
||||
IIcon westRightIcon = pane.getPaneSegmentTexture(
|
||||
world,
|
||||
x,
|
||||
y,
|
||||
z,
|
||||
GlassPaneConnected.SEGMENT_SOUTH,
|
||||
topSegments,
|
||||
bottomSegments,
|
||||
connNorth,
|
||||
connSouth);
|
||||
IIcon westCenterIcon = pane.getPaneSegmentTexture(
|
||||
world,
|
||||
x,
|
||||
y,
|
||||
z,
|
||||
westCenterSeg,
|
||||
topSegments,
|
||||
bottomSegments,
|
||||
connNorth,
|
||||
connSouth);
|
||||
|
||||
renderer.clearOverrideBlockTexture();
|
||||
IIcon eastLeftIcon = pane.getPaneSegmentTexture(
|
||||
world,
|
||||
x,
|
||||
y,
|
||||
z,
|
||||
GlassPaneConnected.SEGMENT_SOUTH,
|
||||
topSegments,
|
||||
bottomSegments,
|
||||
connSouth,
|
||||
connNorth);
|
||||
IIcon eastRightIcon = pane.getPaneSegmentTexture(
|
||||
world,
|
||||
x,
|
||||
y,
|
||||
z,
|
||||
GlassPaneConnected.SEGMENT_NORTH,
|
||||
topSegments,
|
||||
bottomSegments,
|
||||
connSouth,
|
||||
connNorth);
|
||||
IIcon eastCenterIcon = pane.getPaneSegmentTexture(
|
||||
world,
|
||||
x,
|
||||
y,
|
||||
z,
|
||||
eastCenterSeg,
|
||||
topSegments,
|
||||
bottomSegments,
|
||||
connSouth,
|
||||
connNorth);
|
||||
|
||||
renderTopOrBottom(tessellator, x, y, z, bottomSegments, false, bottomIcon);
|
||||
renderTopOrBottom(tessellator, x, y, z, topSegments, true, topIcon);
|
||||
|
||||
renderSide(
|
||||
tessellator,
|
||||
x,
|
||||
y,
|
||||
z,
|
||||
NORTH,
|
||||
east,
|
||||
west,
|
||||
north,
|
||||
cross,
|
||||
northLeftIcon,
|
||||
northRightIcon,
|
||||
northCenterIcon);
|
||||
renderSide(
|
||||
tessellator,
|
||||
x,
|
||||
y,
|
||||
z,
|
||||
SOUTH,
|
||||
west,
|
||||
east,
|
||||
south,
|
||||
cross,
|
||||
southLeftIcon,
|
||||
southRightIcon,
|
||||
southCenterIcon);
|
||||
renderSide(tessellator, x, y, z, WEST, north, south, west, cross, westLeftIcon, westRightIcon, westCenterIcon);
|
||||
renderSide(tessellator, x, y, z, EAST, south, north, east, cross, eastLeftIcon, eastRightIcon, eastCenterIcon);
|
||||
|
||||
renderer.renderAllFaces = false;
|
||||
return true;
|
||||
}
|
||||
|
||||
private void renderTopOrBottom(Tessellator tessellator, int x, int y, int z, int segments, boolean top,
|
||||
IIcon icon) {
|
||||
if ((segments & ~GlassPaneConnected.SEGMENT_CONNECTED) == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
float minU = icon.getMinU();
|
||||
float maxU = icon.getMaxU();
|
||||
float minV = icon.getMinV();
|
||||
float maxV = icon.getMaxV();
|
||||
float startU = icon.getInterpolatedU(7);
|
||||
float endU = icon.getInterpolatedU(9);
|
||||
float startV = icon.getInterpolatedV(7);
|
||||
float endV = icon.getInterpolatedV(9);
|
||||
double startX = x + (7.0 / 16.0);
|
||||
double startZ = z + (7.0 / 16.0);
|
||||
double endX = x + (9.0 / 16.0);
|
||||
double endZ = z + (9.0 / 16.0);
|
||||
|
||||
// All in top winding order - direction is reversed for bottom
|
||||
double[] centerSquareXZUV = new double[] { endX, startZ, endU, startV, startX, startZ, startU, startV, startX,
|
||||
endZ, startU, endV, endX, endZ, endU, endV, };
|
||||
double[] northXZUV = new double[] { endX, z, endU, minV, startX, z, startU, minV, startX, startZ, startU,
|
||||
startV, endX, startZ, endU, startV };
|
||||
double[] southXZUV = new double[] { endX, endZ, endU, endV, startX, endZ, startU, endV, startX, z + 1, startU,
|
||||
maxV, endX, z + 1, endU, maxV };
|
||||
double[] eastXZUV = new double[] { x + 1, startZ, maxU, startV, endX, startZ, endU, startV, endX, endZ, endU,
|
||||
endV, x + 1, endZ, maxU, endV };
|
||||
double[] westXZUV = new double[] { startX, startZ, startU, startV, x, startZ, minU, startV, x, endZ, minU, endV,
|
||||
startX, endZ, startU, endV };
|
||||
|
||||
if ((segments & GlassPaneConnected.SEGMENT_CENTER) != 0) {
|
||||
renderXZUV(tessellator, centerSquareXZUV, y, top);
|
||||
}
|
||||
if ((segments & GlassPaneConnected.SEGMENT_NORTH) != 0) {
|
||||
renderXZUV(tessellator, northXZUV, y, top);
|
||||
}
|
||||
if ((segments & GlassPaneConnected.SEGMENT_SOUTH) != 0) {
|
||||
renderXZUV(tessellator, southXZUV, y, top);
|
||||
}
|
||||
if ((segments & GlassPaneConnected.SEGMENT_EAST) != 0) {
|
||||
renderXZUV(tessellator, eastXZUV, y, top);
|
||||
}
|
||||
if ((segments & GlassPaneConnected.SEGMENT_WEST) != 0) {
|
||||
renderXZUV(tessellator, westXZUV, y, top);
|
||||
}
|
||||
}
|
||||
|
||||
private void renderXZUV(Tessellator tessellator, double[] xzuv, double y, boolean top) {
|
||||
if (top) {
|
||||
for (int i = 0; i < xzuv.length; i += 4) {
|
||||
tessellator.addVertexWithUV(xzuv[i], y + 1, xzuv[i + 1], xzuv[i + 2], xzuv[i + 3]);
|
||||
}
|
||||
} else {
|
||||
for (int i = xzuv.length - 4; i >= 0; i -= 4) {
|
||||
tessellator.addVertexWithUV(xzuv[i], y, xzuv[i + 1], xzuv[i + 2], xzuv[i + 3]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void renderSide(Tessellator tessellator, int x, int y, int z, ForgeDirection side, boolean left,
|
||||
boolean right, boolean front, boolean cross, IIcon leftIcon, IIcon rightIcon, IIcon centerIcon) {
|
||||
double startX = x + (7.0 / 16.0);
|
||||
double startZ = z + (7.0 / 16.0);
|
||||
double endX = x + (9.0 / 16.0);
|
||||
double endZ = z + (9.0 / 16.0);
|
||||
|
||||
switch (side) {
|
||||
case NORTH:
|
||||
double northZ = z + (7.0 / 16.0);
|
||||
if (right) {
|
||||
float minV = rightIcon.getMinV();
|
||||
float maxV = rightIcon.getMaxV();
|
||||
float maxU = rightIcon.getMaxU();
|
||||
float endU = rightIcon.getInterpolatedU(9);
|
||||
tessellator.addVertexWithUV(x, y + 1, northZ, maxU, minV);
|
||||
tessellator.addVertexWithUV(startX, y + 1, northZ, endU, minV);
|
||||
tessellator.addVertexWithUV(startX, y, northZ, endU, maxV);
|
||||
tessellator.addVertexWithUV(x, y, northZ, maxU, maxV);
|
||||
}
|
||||
|
||||
if (left) {
|
||||
float minV = leftIcon.getMinV();
|
||||
float maxV = leftIcon.getMaxV();
|
||||
float minU = leftIcon.getMinU();
|
||||
float startU = leftIcon.getInterpolatedU(7);
|
||||
tessellator.addVertexWithUV(endX, y + 1, northZ, startU, minV);
|
||||
tessellator.addVertexWithUV(x + 1, y + 1, northZ, minU, minV);
|
||||
tessellator.addVertexWithUV(x + 1, y, northZ, minU, maxV);
|
||||
tessellator.addVertexWithUV(endX, y, northZ, startU, maxV);
|
||||
}
|
||||
|
||||
if (cross) northZ = z;
|
||||
if (cross || !front) {
|
||||
float minV = centerIcon.getMinV();
|
||||
float maxV = centerIcon.getMaxV();
|
||||
float startU = centerIcon.getInterpolatedU(7);
|
||||
float endU = centerIcon.getInterpolatedU(9);
|
||||
tessellator.addVertexWithUV(startX, y + 1, northZ, endU, minV);
|
||||
tessellator.addVertexWithUV(endX, y + 1, northZ, startU, minV);
|
||||
tessellator.addVertexWithUV(endX, y, northZ, startU, maxV);
|
||||
tessellator.addVertexWithUV(startX, y, northZ, endU, maxV);
|
||||
}
|
||||
|
||||
break;
|
||||
case SOUTH:
|
||||
double southZ = z + (9.0 / 16.0);
|
||||
if (right) {
|
||||
float minV = rightIcon.getMinV();
|
||||
float maxV = rightIcon.getMaxV();
|
||||
float maxU = rightIcon.getMaxU();
|
||||
float endU = rightIcon.getInterpolatedU(9);
|
||||
tessellator.addVertexWithUV(x + 1, y + 1, southZ, maxU, minV);
|
||||
tessellator.addVertexWithUV(endX, y + 1, southZ, endU, minV);
|
||||
tessellator.addVertexWithUV(endX, y, southZ, endU, maxV);
|
||||
tessellator.addVertexWithUV(x + 1, y, southZ, maxU, maxV);
|
||||
}
|
||||
|
||||
if (left) {
|
||||
float minV = leftIcon.getMinV();
|
||||
float maxV = leftIcon.getMaxV();
|
||||
float minU = leftIcon.getMinU();
|
||||
float startU = leftIcon.getInterpolatedU(7);
|
||||
tessellator.addVertexWithUV(startX, y + 1, southZ, startU, minV);
|
||||
tessellator.addVertexWithUV(x, y + 1, southZ, minU, minV);
|
||||
tessellator.addVertexWithUV(x, y, southZ, minU, maxV);
|
||||
tessellator.addVertexWithUV(startX, y, southZ, startU, maxV);
|
||||
}
|
||||
|
||||
if (cross) southZ = z + 1;
|
||||
if (cross || !front) {
|
||||
float minV = centerIcon.getMinV();
|
||||
float maxV = centerIcon.getMaxV();
|
||||
float startU = centerIcon.getInterpolatedU(7);
|
||||
float endU = centerIcon.getInterpolatedU(9);
|
||||
tessellator.addVertexWithUV(endX, y + 1, southZ, endU, minV);
|
||||
tessellator.addVertexWithUV(startX, y + 1, southZ, startU, minV);
|
||||
tessellator.addVertexWithUV(startX, y, southZ, startU, maxV);
|
||||
tessellator.addVertexWithUV(endX, y, southZ, endU, maxV);
|
||||
}
|
||||
|
||||
break;
|
||||
case WEST:
|
||||
double westX = x + (7.0 / 16.0);
|
||||
if (right) {
|
||||
float minV = rightIcon.getMinV();
|
||||
float maxV = rightIcon.getMaxV();
|
||||
float maxU = rightIcon.getMaxU();
|
||||
float endU = rightIcon.getInterpolatedU(9);
|
||||
tessellator.addVertexWithUV(westX, y + 1, z + 1, maxU, minV);
|
||||
tessellator.addVertexWithUV(westX, y + 1, endZ, endU, minV);
|
||||
tessellator.addVertexWithUV(westX, y, endZ, endU, maxV);
|
||||
tessellator.addVertexWithUV(westX, y, z + 1, maxU, maxV);
|
||||
}
|
||||
|
||||
if (left) {
|
||||
float minV = leftIcon.getMinV();
|
||||
float maxV = leftIcon.getMaxV();
|
||||
float minU = leftIcon.getMinU();
|
||||
float startU = leftIcon.getInterpolatedU(7);
|
||||
tessellator.addVertexWithUV(westX, y + 1, startZ, startU, minV);
|
||||
tessellator.addVertexWithUV(westX, y + 1, z, minU, minV);
|
||||
tessellator.addVertexWithUV(westX, y, z, minU, maxV);
|
||||
tessellator.addVertexWithUV(westX, y, startZ, startU, maxV);
|
||||
}
|
||||
|
||||
if (cross) westX = x;
|
||||
if (cross || !front) {
|
||||
float minV = centerIcon.getMinV();
|
||||
float maxV = centerIcon.getMaxV();
|
||||
float startU = centerIcon.getInterpolatedU(7);
|
||||
float endU = centerIcon.getInterpolatedU(9);
|
||||
tessellator.addVertexWithUV(westX, y + 1, endZ, endU, minV);
|
||||
tessellator.addVertexWithUV(westX, y + 1, startZ, startU, minV);
|
||||
tessellator.addVertexWithUV(westX, y, startZ, startU, maxV);
|
||||
tessellator.addVertexWithUV(westX, y, endZ, endU, maxV);
|
||||
}
|
||||
|
||||
break;
|
||||
case EAST:
|
||||
double eastX = x + (9.0 / 16.0);
|
||||
|
||||
if (right) {
|
||||
float minV = rightIcon.getMinV();
|
||||
float maxV = rightIcon.getMaxV();
|
||||
float maxU = rightIcon.getMaxU();
|
||||
float endU = rightIcon.getInterpolatedU(9);
|
||||
tessellator.addVertexWithUV(eastX, y + 1, z, maxU, minV);
|
||||
tessellator.addVertexWithUV(eastX, y + 1, startZ, endU, minV);
|
||||
tessellator.addVertexWithUV(eastX, y, startZ, endU, maxV);
|
||||
tessellator.addVertexWithUV(eastX, y, z, maxU, maxV);
|
||||
}
|
||||
|
||||
if (left) {
|
||||
float minV = leftIcon.getMinV();
|
||||
float maxV = leftIcon.getMaxV();
|
||||
float minU = leftIcon.getMinU();
|
||||
float startU = leftIcon.getInterpolatedU(7);
|
||||
tessellator.addVertexWithUV(eastX, y + 1, endZ, startU, minV);
|
||||
tessellator.addVertexWithUV(eastX, y + 1, z + 1, minU, minV);
|
||||
tessellator.addVertexWithUV(eastX, y, z + 1, minU, maxV);
|
||||
tessellator.addVertexWithUV(eastX, y, endZ, startU, maxV);
|
||||
}
|
||||
|
||||
if (cross) eastX = x + 1;
|
||||
if (cross || !front) {
|
||||
float minV = centerIcon.getMinV();
|
||||
float maxV = centerIcon.getMaxV();
|
||||
float startU = centerIcon.getInterpolatedU(7);
|
||||
float endU = centerIcon.getInterpolatedU(9);
|
||||
tessellator.addVertexWithUV(eastX, y + 1, startZ, endU, minV);
|
||||
tessellator.addVertexWithUV(eastX, y + 1, endZ, startU, minV);
|
||||
tessellator.addVertexWithUV(eastX, y, endZ, startU, maxV);
|
||||
tessellator.addVertexWithUV(eastX, y, startZ, endU, maxV);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldRender3DInInventory(int modelID) {
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
package tconstruct.smeltery.model;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
import com.gtnewhorizons.angelica.api.ThreadSafeISBRH;
|
||||
|
||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
import tconstruct.util.ItemHelper;
|
||||
|
||||
@ThreadSafeISBRH(perThread = false)
|
||||
public class PaneRender implements ISimpleBlockRenderingHandler {
|
||||
|
||||
public static int model = RenderingRegistry.getNextAvailableRenderId();
|
||||
|
||||
@Override
|
||||
public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) {
|
||||
if (modelID == model) {
|
||||
renderer.setRenderBounds(0.0F, 0.0F, 0.4375F, 1.0F, 1.0F, 0.5625F);
|
||||
ItemHelper.renderStandardInvBlock(renderer, block, metadata);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelID,
|
||||
RenderBlocks renderer) {
|
||||
if (modelID == model) {
|
||||
// renderer.setOverrideBlockTexture(((PaneBase)block).getIcon(0, world.getBlockMetadata(x,y,z)));
|
||||
return renderer.renderBlockStainedGlassPane(block, x, y, z);
|
||||
// return renderPaneInWorld(renderer, world, x, y, z, (PaneBase) block);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldRender3DInInventory(int modelID) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderId() {
|
||||
return model;
|
||||
}
|
||||
}
|
||||
@@ -276,7 +276,7 @@ public class PHConstruct {
|
||||
islandRarity = config.get("Worldgen", "Slime Island Rarity", 1450).getInt(1450);
|
||||
|
||||
// Looks
|
||||
Property conTexMode = config.get("Looks", "Connected Textures Enabled", true);
|
||||
Property conTexMode = config.get("Looks", "Connected Textures Enabled", 2);
|
||||
conTexMode.comment = "0 = disabled, 1 = enabled, 2 = enabled + ignore stained glass meta";
|
||||
connectedTexturesMode = conTexMode.getInt(2);
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 202 B After Width: | Height: | Size: 167 B |
|
After Width: | Height: | Size: 102 B |
|
After Width: | Height: | Size: 107 B |
|
After Width: | Height: | Size: 107 B |
|
After Width: | Height: | Size: 107 B |
|
After Width: | Height: | Size: 107 B |
|
After Width: | Height: | Size: 107 B |
|
After Width: | Height: | Size: 107 B |
|
After Width: | Height: | Size: 107 B |
|
After Width: | Height: | Size: 107 B |
|
After Width: | Height: | Size: 107 B |
|
After Width: | Height: | Size: 107 B |
|
After Width: | Height: | Size: 107 B |
|
After Width: | Height: | Size: 107 B |
|
After Width: | Height: | Size: 107 B |
|
After Width: | Height: | Size: 107 B |
|
After Width: | Height: | Size: 107 B |
|
After Width: | Height: | Size: 107 B |
|
After Width: | Height: | Size: 107 B |
|
After Width: | Height: | Size: 107 B |
|
After Width: | Height: | Size: 107 B |
|
After Width: | Height: | Size: 107 B |
|
After Width: | Height: | Size: 107 B |
|
After Width: | Height: | Size: 107 B |
|
After Width: | Height: | Size: 107 B |
|
After Width: | Height: | Size: 107 B |
|
After Width: | Height: | Size: 107 B |
|
After Width: | Height: | Size: 107 B |
|
After Width: | Height: | Size: 107 B |
|
After Width: | Height: | Size: 107 B |
|
After Width: | Height: | Size: 107 B |
|
After Width: | Height: | Size: 107 B |
|
After Width: | Height: | Size: 107 B |