mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-18 03:25:10 +00:00
restore FMP integration minus connected textures (still WIP)
This commit is contained in:
1 parent
4bb17f7bc8
commit
ccdeeaa537
7 files changed
+593
-595
No files matched your search
+2
-6
@@ -27,10 +27,6 @@ buildscript {
|
||||
|
||||
|
||||
repositories {
|
||||
ivy {
|
||||
name 'Forge FS legacy'
|
||||
artifactPattern "http://files.minecraftforge.net/[module]/[module]-dev-[revision].[ext]"
|
||||
}
|
||||
ivy {
|
||||
name 'CB FS'
|
||||
artifactPattern "http://www.chickenbones.craftsaddle.org/Files/New_Versions/1.6.4/[module]-dev%20[revision].[ext]"
|
||||
@@ -65,8 +61,8 @@ configurations {
|
||||
|
||||
dependencies {
|
||||
compile "mantle:Mantle:${config.minecraft_version}-${config.mantle_version}:deobf"
|
||||
//compile name: 'ForgeMultipart', version: "${config.minecraft_version}-${config.FMP_version}", ext: 'jar'
|
||||
//compile name: 'CodeChickenLib', version: "${config.minecraft_version}-${config.CCLIB_version}", ext: 'jar'
|
||||
compile "codechicken:CodeChickenLib:${config.minecraft_version}-${config.CCLIB_version}:dev"
|
||||
compile "codechicken:ForgeMultipart:${config.minecraft_version}-${config.FMP_version}:dev"
|
||||
//compile name: 'NotEnoughItems', version: "${config.NEI_version}", type: 'jar'
|
||||
deployerJars 'org.apache.maven.wagon:wagon-ssh:2.2'
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
minecraft_version=1.7.2
|
||||
forge_version=10.12.0.1027
|
||||
mantle_version=114.8c6a5a8
|
||||
FMP_version=1.0.0.211
|
||||
CCLIB_version=1.0.0.44
|
||||
FMP_version=1.1.0.268
|
||||
CCLIB_version=1.1.0.73
|
||||
NEI_version=1.6.1.8
|
||||
mod_version=1.6.0
|
||||
@@ -1,585 +0,0 @@
|
||||
package tconstruct.plugins.fmp;
|
||||
|
||||
import codechicken.lib.lighting.*;
|
||||
import codechicken.lib.render.*;
|
||||
import codechicken.lib.vec.*;
|
||||
import codechicken.microblock.*;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import tconstruct.blocks.GlassBlockConnected;
|
||||
import tconstruct.util.config.PHConstruct;
|
||||
|
||||
public class ConnectedTexturesMicroMaterial extends BlockMicroMaterial
|
||||
{
|
||||
|
||||
public GlassBlockConnected b;
|
||||
|
||||
MultiIconTransformation icont = null;
|
||||
|
||||
public ConnectedTexturesMicroMaterial(GlassBlockConnected block, int meta)
|
||||
{
|
||||
super(block, meta);
|
||||
b = block;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadIcons ()
|
||||
{
|
||||
icont = new MultiIconTransformation(b.getIcons());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderMicroFace (Vertex5[] verts, int side, Vector3 pos, LightMatrix lightMatrix, IMicroMaterialRender part)
|
||||
{
|
||||
renderMicroFace(verts, side, pos, lightMatrix, getColour(part), icont);
|
||||
}
|
||||
|
||||
public int determineTextre (IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5)
|
||||
{
|
||||
if (PHConstruct.connectedTexturesMode == 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
boolean isOpenUp = false, isOpenDown = false, isOpenLeft = false, isOpenRight = false;
|
||||
|
||||
switch (par5)
|
||||
{
|
||||
case 0:
|
||||
if (b.shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlockId(par2 - 1, par3, par4), par1IBlockAccess.getBlockMetadata(par2 - 1, par3, par4)))
|
||||
{
|
||||
isOpenDown = true;
|
||||
}
|
||||
|
||||
if (b.shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlockId(par2 + 1, par3, par4), par1IBlockAccess.getBlockMetadata(par2 + 1, par3, par4)))
|
||||
{
|
||||
isOpenUp = true;
|
||||
}
|
||||
|
||||
if (b.shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlockId(par2, par3, par4 - 1), par1IBlockAccess.getBlockMetadata(par2, par3, par4 - 1)))
|
||||
{
|
||||
isOpenLeft = true;
|
||||
}
|
||||
|
||||
if (b.shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlockId(par2, par3, par4 + 1), par1IBlockAccess.getBlockMetadata(par2, par3, par4 + 1)))
|
||||
{
|
||||
isOpenRight = true;
|
||||
}
|
||||
|
||||
if (isOpenUp && isOpenDown && isOpenLeft && isOpenRight)
|
||||
{
|
||||
return 15;
|
||||
}
|
||||
else if (isOpenUp && isOpenDown && isOpenLeft)
|
||||
{
|
||||
return 11;
|
||||
}
|
||||
else if (isOpenUp && isOpenDown && isOpenRight)
|
||||
{
|
||||
return 12;
|
||||
}
|
||||
else if (isOpenUp && isOpenLeft && isOpenRight)
|
||||
{
|
||||
return 13;
|
||||
}
|
||||
else if (isOpenDown && isOpenLeft && isOpenRight)
|
||||
{
|
||||
return 14;
|
||||
}
|
||||
else if (isOpenDown && isOpenUp)
|
||||
{
|
||||
return 5;
|
||||
}
|
||||
else if (isOpenLeft && isOpenRight)
|
||||
{
|
||||
return 6;
|
||||
}
|
||||
else if (isOpenDown && isOpenLeft)
|
||||
{
|
||||
return 8;
|
||||
}
|
||||
else if (isOpenDown && isOpenRight)
|
||||
{
|
||||
return 10;
|
||||
}
|
||||
else if (isOpenUp && isOpenLeft)
|
||||
{
|
||||
return 7;
|
||||
}
|
||||
else if (isOpenUp && isOpenRight)
|
||||
{
|
||||
return 9;
|
||||
}
|
||||
else if (isOpenDown)
|
||||
{
|
||||
return 3;
|
||||
}
|
||||
else if (isOpenUp)
|
||||
{
|
||||
return 4;
|
||||
}
|
||||
else if (isOpenLeft)
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
else if (isOpenRight)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (b.shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlockId(par2 - 1, par3, par4), par1IBlockAccess.getBlockMetadata(par2 - 1, par3, par4)))
|
||||
{
|
||||
isOpenDown = true;
|
||||
}
|
||||
|
||||
if (b.shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlockId(par2 + 1, par3, par4), par1IBlockAccess.getBlockMetadata(par2 + 1, par3, par4)))
|
||||
{
|
||||
isOpenUp = true;
|
||||
}
|
||||
|
||||
if (b.shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlockId(par2, par3, par4 - 1), par1IBlockAccess.getBlockMetadata(par2, par3, par4 - 1)))
|
||||
{
|
||||
isOpenLeft = true;
|
||||
}
|
||||
|
||||
if (b.shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlockId(par2, par3, par4 + 1), par1IBlockAccess.getBlockMetadata(par2, par3, par4 + 1)))
|
||||
{
|
||||
isOpenRight = true;
|
||||
}
|
||||
|
||||
if (isOpenUp && isOpenDown && isOpenLeft && isOpenRight)
|
||||
{
|
||||
return 15;
|
||||
}
|
||||
else if (isOpenUp && isOpenDown && isOpenLeft)
|
||||
{
|
||||
return 11;
|
||||
}
|
||||
else if (isOpenUp && isOpenDown && isOpenRight)
|
||||
{
|
||||
return 12;
|
||||
}
|
||||
else if (isOpenUp && isOpenLeft && isOpenRight)
|
||||
{
|
||||
return 13;
|
||||
}
|
||||
else if (isOpenDown && isOpenLeft && isOpenRight)
|
||||
{
|
||||
return 14;
|
||||
}
|
||||
else if (isOpenDown && isOpenUp)
|
||||
{
|
||||
return 5;
|
||||
}
|
||||
else if (isOpenLeft && isOpenRight)
|
||||
{
|
||||
return 6;
|
||||
}
|
||||
else if (isOpenDown && isOpenLeft)
|
||||
{
|
||||
return 8;
|
||||
}
|
||||
else if (isOpenDown && isOpenRight)
|
||||
{
|
||||
return 10;
|
||||
}
|
||||
else if (isOpenUp && isOpenLeft)
|
||||
{
|
||||
return 7;
|
||||
}
|
||||
else if (isOpenUp && isOpenRight)
|
||||
{
|
||||
return 9;
|
||||
}
|
||||
else if (isOpenDown)
|
||||
{
|
||||
return 3;
|
||||
}
|
||||
else if (isOpenUp)
|
||||
{
|
||||
return 4;
|
||||
}
|
||||
else if (isOpenLeft)
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
else if (isOpenRight)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (b.shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlockId(par2, par3 - 1, par4), par1IBlockAccess.getBlockMetadata(par2, par3 - 1, par4)))
|
||||
{
|
||||
isOpenDown = true;
|
||||
}
|
||||
|
||||
if (b.shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlockId(par2, par3 + 1, par4), par1IBlockAccess.getBlockMetadata(par2, par3 + 1, par4)))
|
||||
{
|
||||
isOpenUp = true;
|
||||
}
|
||||
|
||||
if (b.shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlockId(par2 - 1, par3, par4), par1IBlockAccess.getBlockMetadata(par2 - 1, par3, par4)))
|
||||
{
|
||||
isOpenLeft = true;
|
||||
}
|
||||
|
||||
if (b.shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlockId(par2 + 1, par3, par4), par1IBlockAccess.getBlockMetadata(par2 + 1, par3, par4)))
|
||||
{
|
||||
isOpenRight = true;
|
||||
}
|
||||
|
||||
if (isOpenUp && isOpenDown && isOpenLeft && isOpenRight)
|
||||
{
|
||||
return 15;
|
||||
}
|
||||
else if (isOpenUp && isOpenDown && isOpenLeft)
|
||||
{
|
||||
return 13;
|
||||
}
|
||||
else if (isOpenUp && isOpenDown && isOpenRight)
|
||||
{
|
||||
return 14;
|
||||
}
|
||||
else if (isOpenUp && isOpenLeft && isOpenRight)
|
||||
{
|
||||
return 11;
|
||||
}
|
||||
else if (isOpenDown && isOpenLeft && isOpenRight)
|
||||
{
|
||||
return 12;
|
||||
}
|
||||
else if (isOpenDown && isOpenUp)
|
||||
{
|
||||
return 6;
|
||||
}
|
||||
else if (isOpenLeft && isOpenRight)
|
||||
{
|
||||
return 5;
|
||||
}
|
||||
else if (isOpenDown && isOpenLeft)
|
||||
{
|
||||
return 9;
|
||||
}
|
||||
else if (isOpenDown && isOpenRight)
|
||||
{
|
||||
return 10;
|
||||
}
|
||||
else if (isOpenUp && isOpenLeft)
|
||||
{
|
||||
return 7;
|
||||
}
|
||||
else if (isOpenUp && isOpenRight)
|
||||
{
|
||||
return 8;
|
||||
}
|
||||
else if (isOpenDown)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
else if (isOpenUp)
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
else if (isOpenLeft)
|
||||
{
|
||||
return 4;
|
||||
}
|
||||
else if (isOpenRight)
|
||||
{
|
||||
return 3;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if (b.shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlockId(par2, par3 - 1, par4), par1IBlockAccess.getBlockMetadata(par2, par3 - 1, par4)))
|
||||
{
|
||||
isOpenDown = true;
|
||||
}
|
||||
|
||||
if (b.shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlockId(par2, par3 + 1, par4), par1IBlockAccess.getBlockMetadata(par2, par3 + 1, par4)))
|
||||
{
|
||||
isOpenUp = true;
|
||||
}
|
||||
|
||||
if (b.shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlockId(par2 - 1, par3, par4), par1IBlockAccess.getBlockMetadata(par2 - 1, par3, par4)))
|
||||
{
|
||||
isOpenLeft = true;
|
||||
}
|
||||
|
||||
if (b.shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlockId(par2 + 1, par3, par4), par1IBlockAccess.getBlockMetadata(par2 + 1, par3, par4)))
|
||||
{
|
||||
isOpenRight = true;
|
||||
}
|
||||
|
||||
if (isOpenUp && isOpenDown && isOpenLeft && isOpenRight)
|
||||
{
|
||||
return 15;
|
||||
}
|
||||
else if (isOpenUp && isOpenDown && isOpenLeft)
|
||||
{
|
||||
return 14;
|
||||
}
|
||||
else if (isOpenUp && isOpenDown && isOpenRight)
|
||||
{
|
||||
return 13;
|
||||
}
|
||||
else if (isOpenUp && isOpenLeft && isOpenRight)
|
||||
{
|
||||
return 11;
|
||||
}
|
||||
else if (isOpenDown && isOpenLeft && isOpenRight)
|
||||
{
|
||||
return 12;
|
||||
}
|
||||
else if (isOpenDown && isOpenUp)
|
||||
{
|
||||
return 6;
|
||||
}
|
||||
else if (isOpenLeft && isOpenRight)
|
||||
{
|
||||
return 5;
|
||||
}
|
||||
else if (isOpenDown && isOpenLeft)
|
||||
{
|
||||
return 10;
|
||||
}
|
||||
else if (isOpenDown && isOpenRight)
|
||||
{
|
||||
return 9;
|
||||
}
|
||||
else if (isOpenUp && isOpenLeft)
|
||||
{
|
||||
return 8;
|
||||
}
|
||||
else if (isOpenUp && isOpenRight)
|
||||
{
|
||||
return 7;
|
||||
}
|
||||
else if (isOpenDown)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
else if (isOpenUp)
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
else if (isOpenLeft)
|
||||
{
|
||||
return 3;
|
||||
}
|
||||
else if (isOpenRight)
|
||||
{
|
||||
return 4;
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
if (b.shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlockId(par2, par3 - 1, par4), par1IBlockAccess.getBlockMetadata(par2, par3 - 1, par4)))
|
||||
{
|
||||
isOpenDown = true;
|
||||
}
|
||||
|
||||
if (b.shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlockId(par2, par3 + 1, par4), par1IBlockAccess.getBlockMetadata(par2, par3 + 1, par4)))
|
||||
{
|
||||
isOpenUp = true;
|
||||
}
|
||||
|
||||
if (b.shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlockId(par2, par3, par4 - 1), par1IBlockAccess.getBlockMetadata(par2, par3, par4 - 1)))
|
||||
{
|
||||
isOpenLeft = true;
|
||||
}
|
||||
|
||||
if (b.shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlockId(par2, par3, par4 + 1), par1IBlockAccess.getBlockMetadata(par2, par3, par4 + 1)))
|
||||
{
|
||||
isOpenRight = true;
|
||||
}
|
||||
|
||||
if (isOpenUp && isOpenDown && isOpenLeft && isOpenRight)
|
||||
{
|
||||
return 15;
|
||||
}
|
||||
else if (isOpenUp && isOpenDown && isOpenLeft)
|
||||
{
|
||||
return 14;
|
||||
}
|
||||
else if (isOpenUp && isOpenDown && isOpenRight)
|
||||
{
|
||||
return 13;
|
||||
}
|
||||
else if (isOpenUp && isOpenLeft && isOpenRight)
|
||||
{
|
||||
return 11;
|
||||
}
|
||||
else if (isOpenDown && isOpenLeft && isOpenRight)
|
||||
{
|
||||
return 12;
|
||||
}
|
||||
else if (isOpenDown && isOpenUp)
|
||||
{
|
||||
return 6;
|
||||
}
|
||||
else if (isOpenLeft && isOpenRight)
|
||||
{
|
||||
return 5;
|
||||
}
|
||||
else if (isOpenDown && isOpenLeft)
|
||||
{
|
||||
return 10;
|
||||
}
|
||||
else if (isOpenDown && isOpenRight)
|
||||
{
|
||||
return 9;
|
||||
}
|
||||
else if (isOpenUp && isOpenLeft)
|
||||
{
|
||||
return 8;
|
||||
}
|
||||
else if (isOpenUp && isOpenRight)
|
||||
{
|
||||
return 7;
|
||||
}
|
||||
else if (isOpenDown)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
else if (isOpenUp)
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
else if (isOpenLeft)
|
||||
{
|
||||
return 3;
|
||||
}
|
||||
else if (isOpenRight)
|
||||
{
|
||||
return 4;
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
if (b.shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlockId(par2, par3 - 1, par4), par1IBlockAccess.getBlockMetadata(par2, par3 - 1, par4)))
|
||||
{
|
||||
isOpenDown = true;
|
||||
}
|
||||
|
||||
if (b.shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlockId(par2, par3 + 1, par4), par1IBlockAccess.getBlockMetadata(par2, par3 + 1, par4)))
|
||||
{
|
||||
isOpenUp = true;
|
||||
}
|
||||
|
||||
if (b.shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlockId(par2, par3, par4 - 1), par1IBlockAccess.getBlockMetadata(par2, par3, par4 - 1)))
|
||||
{
|
||||
isOpenLeft = true;
|
||||
}
|
||||
|
||||
if (b.shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlockId(par2, par3, par4 + 1), par1IBlockAccess.getBlockMetadata(par2, par3, par4 + 1)))
|
||||
{
|
||||
isOpenRight = true;
|
||||
}
|
||||
|
||||
if (isOpenUp && isOpenDown && isOpenLeft && isOpenRight)
|
||||
{
|
||||
return 15;
|
||||
}
|
||||
else if (isOpenUp && isOpenDown && isOpenLeft)
|
||||
{
|
||||
return 13;
|
||||
}
|
||||
else if (isOpenUp && isOpenDown && isOpenRight)
|
||||
{
|
||||
return 14;
|
||||
}
|
||||
else if (isOpenUp && isOpenLeft && isOpenRight)
|
||||
{
|
||||
return 11;
|
||||
}
|
||||
else if (isOpenDown && isOpenLeft && isOpenRight)
|
||||
{
|
||||
return 12;
|
||||
}
|
||||
else if (isOpenDown && isOpenUp)
|
||||
{
|
||||
return 6;
|
||||
}
|
||||
else if (isOpenLeft && isOpenRight)
|
||||
{
|
||||
return 5;
|
||||
}
|
||||
else if (isOpenDown && isOpenLeft)
|
||||
{
|
||||
return 9;
|
||||
}
|
||||
else if (isOpenDown && isOpenRight)
|
||||
{
|
||||
return 10;
|
||||
}
|
||||
else if (isOpenUp && isOpenLeft)
|
||||
{
|
||||
return 7;
|
||||
}
|
||||
else if (isOpenUp && isOpenRight)
|
||||
{
|
||||
return 8;
|
||||
}
|
||||
else if (isOpenDown)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
else if (isOpenUp)
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
else if (isOpenLeft)
|
||||
{
|
||||
return 4;
|
||||
}
|
||||
else if (isOpenRight)
|
||||
{
|
||||
return 3;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
public void renderMicroFace (Vertex5[] verts, int side, Vector3 pos, LightMatrix lightMatrix, int colour, IUVTransformation uvt)
|
||||
{
|
||||
UV uv = new UV();
|
||||
Tessellator t = Tessellator.instance;
|
||||
int i = 0;
|
||||
while (i < 4)
|
||||
{
|
||||
if (CCRenderState.useNormals())
|
||||
{
|
||||
Vector3 n = Rotation.axes[side % 6];
|
||||
t.setNormal((float) n.x, (float) n.y, (float) n.z);
|
||||
}
|
||||
Vertex5 vert = verts[i];
|
||||
if (lightMatrix != null)
|
||||
{
|
||||
LC lc = LC.computeO(vert.vec, side);
|
||||
if (CCRenderState.useModelColours())
|
||||
lightMatrix.setColour(t, lc, colour);
|
||||
lightMatrix.setBrightness(t, lc);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (CCRenderState.useModelColours())
|
||||
CCRenderState.vertexColour(colour);
|
||||
}
|
||||
|
||||
// ((MultiIconTransformation)uvt).setIconIndex(null, determineTextre(Minecraft.getMinecraft().theWorld, (int)pos.x, (int)pos.y, (int)pos.z, side));
|
||||
|
||||
uvt.transform(uv.set(vert.uv));
|
||||
t.addVertexWithUV(vert.vec.x + pos.x, vert.vec.y + pos.y, vert.vec.z + pos.z, uv.u, uv.v);
|
||||
i += 1;
|
||||
}
|
||||
}
|
||||
|
||||
public static void createAndRegister (GlassBlockConnected block)
|
||||
{
|
||||
MicroMaterialRegistry.registerMaterial(new ConnectedTexturesMicroMaterial(block, 0), block.getUnlocalizedName());
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,7 @@ import java.util.List;
|
||||
|
||||
import net.minecraftforge.common.config.Configuration;
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.plugins.fmp.ForgeMultiPart;
|
||||
import tconstruct.plugins.ic2.IC2;
|
||||
import tconstruct.plugins.imc.AppEng;
|
||||
import tconstruct.plugins.imc.BuildcraftTransport;
|
||||
@@ -121,7 +122,7 @@ public class PluginController
|
||||
|
||||
registerPlugin(new AppEng());
|
||||
registerPlugin(new BuildcraftTransport());
|
||||
// registerPlugin(new ForgeMultiPart());
|
||||
registerPlugin(new ForgeMultiPart());
|
||||
registerPlugin(new IC2());
|
||||
// registerPlugin(new MineFactoryReloaded());
|
||||
// registerPlugin(new NotEnoughItems());
|
||||
|
||||
@@ -0,0 +1,586 @@
|
||||
package tconstruct.plugins.fmp;
|
||||
|
||||
import codechicken.lib.lighting.*;
|
||||
import codechicken.lib.render.*;
|
||||
import codechicken.lib.render.uv.MultiIconTransformation;
|
||||
import codechicken.lib.vec.*;
|
||||
import codechicken.microblock.*;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import tconstruct.blocks.GlassBlockConnected;
|
||||
import tconstruct.util.config.PHConstruct;
|
||||
|
||||
public class ConnectedTexturesMicroMaterial extends BlockMicroMaterial
|
||||
{
|
||||
|
||||
public GlassBlockConnected b;
|
||||
|
||||
MultiIconTransformation icont = null;
|
||||
|
||||
public ConnectedTexturesMicroMaterial(GlassBlockConnected block, int meta)
|
||||
{
|
||||
super(block, meta);
|
||||
b = block;
|
||||
}
|
||||
/*
|
||||
@Override
|
||||
public void loadIcons ()
|
||||
{
|
||||
icont = new MultiIconTransformation(b.getIcons());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderMicroFace (Vertex5[] verts, int side, Vector3 pos, LightMatrix lightMatrix, IMicroMaterialRender part)
|
||||
{
|
||||
renderMicroFace(verts, side, pos, lightMatrix, getColour(part), icont);
|
||||
}
|
||||
|
||||
public int determineTextre (IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5)
|
||||
{
|
||||
if (PHConstruct.connectedTexturesMode == 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
boolean isOpenUp = false, isOpenDown = false, isOpenLeft = false, isOpenRight = false;
|
||||
|
||||
switch (par5)
|
||||
{
|
||||
case 0:
|
||||
if (b.shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlockId(par2 - 1, par3, par4), par1IBlockAccess.getBlockMetadata(par2 - 1, par3, par4)))
|
||||
{
|
||||
isOpenDown = true;
|
||||
}
|
||||
|
||||
if (b.shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlockId(par2 + 1, par3, par4), par1IBlockAccess.getBlockMetadata(par2 + 1, par3, par4)))
|
||||
{
|
||||
isOpenUp = true;
|
||||
}
|
||||
|
||||
if (b.shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlockId(par2, par3, par4 - 1), par1IBlockAccess.getBlockMetadata(par2, par3, par4 - 1)))
|
||||
{
|
||||
isOpenLeft = true;
|
||||
}
|
||||
|
||||
if (b.shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlockId(par2, par3, par4 + 1), par1IBlockAccess.getBlockMetadata(par2, par3, par4 + 1)))
|
||||
{
|
||||
isOpenRight = true;
|
||||
}
|
||||
|
||||
if (isOpenUp && isOpenDown && isOpenLeft && isOpenRight)
|
||||
{
|
||||
return 15;
|
||||
}
|
||||
else if (isOpenUp && isOpenDown && isOpenLeft)
|
||||
{
|
||||
return 11;
|
||||
}
|
||||
else if (isOpenUp && isOpenDown && isOpenRight)
|
||||
{
|
||||
return 12;
|
||||
}
|
||||
else if (isOpenUp && isOpenLeft && isOpenRight)
|
||||
{
|
||||
return 13;
|
||||
}
|
||||
else if (isOpenDown && isOpenLeft && isOpenRight)
|
||||
{
|
||||
return 14;
|
||||
}
|
||||
else if (isOpenDown && isOpenUp)
|
||||
{
|
||||
return 5;
|
||||
}
|
||||
else if (isOpenLeft && isOpenRight)
|
||||
{
|
||||
return 6;
|
||||
}
|
||||
else if (isOpenDown && isOpenLeft)
|
||||
{
|
||||
return 8;
|
||||
}
|
||||
else if (isOpenDown && isOpenRight)
|
||||
{
|
||||
return 10;
|
||||
}
|
||||
else if (isOpenUp && isOpenLeft)
|
||||
{
|
||||
return 7;
|
||||
}
|
||||
else if (isOpenUp && isOpenRight)
|
||||
{
|
||||
return 9;
|
||||
}
|
||||
else if (isOpenDown)
|
||||
{
|
||||
return 3;
|
||||
}
|
||||
else if (isOpenUp)
|
||||
{
|
||||
return 4;
|
||||
}
|
||||
else if (isOpenLeft)
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
else if (isOpenRight)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (b.shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlockId(par2 - 1, par3, par4), par1IBlockAccess.getBlockMetadata(par2 - 1, par3, par4)))
|
||||
{
|
||||
isOpenDown = true;
|
||||
}
|
||||
|
||||
if (b.shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlockId(par2 + 1, par3, par4), par1IBlockAccess.getBlockMetadata(par2 + 1, par3, par4)))
|
||||
{
|
||||
isOpenUp = true;
|
||||
}
|
||||
|
||||
if (b.shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlockId(par2, par3, par4 - 1), par1IBlockAccess.getBlockMetadata(par2, par3, par4 - 1)))
|
||||
{
|
||||
isOpenLeft = true;
|
||||
}
|
||||
|
||||
if (b.shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlockId(par2, par3, par4 + 1), par1IBlockAccess.getBlockMetadata(par2, par3, par4 + 1)))
|
||||
{
|
||||
isOpenRight = true;
|
||||
}
|
||||
|
||||
if (isOpenUp && isOpenDown && isOpenLeft && isOpenRight)
|
||||
{
|
||||
return 15;
|
||||
}
|
||||
else if (isOpenUp && isOpenDown && isOpenLeft)
|
||||
{
|
||||
return 11;
|
||||
}
|
||||
else if (isOpenUp && isOpenDown && isOpenRight)
|
||||
{
|
||||
return 12;
|
||||
}
|
||||
else if (isOpenUp && isOpenLeft && isOpenRight)
|
||||
{
|
||||
return 13;
|
||||
}
|
||||
else if (isOpenDown && isOpenLeft && isOpenRight)
|
||||
{
|
||||
return 14;
|
||||
}
|
||||
else if (isOpenDown && isOpenUp)
|
||||
{
|
||||
return 5;
|
||||
}
|
||||
else if (isOpenLeft && isOpenRight)
|
||||
{
|
||||
return 6;
|
||||
}
|
||||
else if (isOpenDown && isOpenLeft)
|
||||
{
|
||||
return 8;
|
||||
}
|
||||
else if (isOpenDown && isOpenRight)
|
||||
{
|
||||
return 10;
|
||||
}
|
||||
else if (isOpenUp && isOpenLeft)
|
||||
{
|
||||
return 7;
|
||||
}
|
||||
else if (isOpenUp && isOpenRight)
|
||||
{
|
||||
return 9;
|
||||
}
|
||||
else if (isOpenDown)
|
||||
{
|
||||
return 3;
|
||||
}
|
||||
else if (isOpenUp)
|
||||
{
|
||||
return 4;
|
||||
}
|
||||
else if (isOpenLeft)
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
else if (isOpenRight)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (b.shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlockId(par2, par3 - 1, par4), par1IBlockAccess.getBlockMetadata(par2, par3 - 1, par4)))
|
||||
{
|
||||
isOpenDown = true;
|
||||
}
|
||||
|
||||
if (b.shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlockId(par2, par3 + 1, par4), par1IBlockAccess.getBlockMetadata(par2, par3 + 1, par4)))
|
||||
{
|
||||
isOpenUp = true;
|
||||
}
|
||||
|
||||
if (b.shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlockId(par2 - 1, par3, par4), par1IBlockAccess.getBlockMetadata(par2 - 1, par3, par4)))
|
||||
{
|
||||
isOpenLeft = true;
|
||||
}
|
||||
|
||||
if (b.shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlockId(par2 + 1, par3, par4), par1IBlockAccess.getBlockMetadata(par2 + 1, par3, par4)))
|
||||
{
|
||||
isOpenRight = true;
|
||||
}
|
||||
|
||||
if (isOpenUp && isOpenDown && isOpenLeft && isOpenRight)
|
||||
{
|
||||
return 15;
|
||||
}
|
||||
else if (isOpenUp && isOpenDown && isOpenLeft)
|
||||
{
|
||||
return 13;
|
||||
}
|
||||
else if (isOpenUp && isOpenDown && isOpenRight)
|
||||
{
|
||||
return 14;
|
||||
}
|
||||
else if (isOpenUp && isOpenLeft && isOpenRight)
|
||||
{
|
||||
return 11;
|
||||
}
|
||||
else if (isOpenDown && isOpenLeft && isOpenRight)
|
||||
{
|
||||
return 12;
|
||||
}
|
||||
else if (isOpenDown && isOpenUp)
|
||||
{
|
||||
return 6;
|
||||
}
|
||||
else if (isOpenLeft && isOpenRight)
|
||||
{
|
||||
return 5;
|
||||
}
|
||||
else if (isOpenDown && isOpenLeft)
|
||||
{
|
||||
return 9;
|
||||
}
|
||||
else if (isOpenDown && isOpenRight)
|
||||
{
|
||||
return 10;
|
||||
}
|
||||
else if (isOpenUp && isOpenLeft)
|
||||
{
|
||||
return 7;
|
||||
}
|
||||
else if (isOpenUp && isOpenRight)
|
||||
{
|
||||
return 8;
|
||||
}
|
||||
else if (isOpenDown)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
else if (isOpenUp)
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
else if (isOpenLeft)
|
||||
{
|
||||
return 4;
|
||||
}
|
||||
else if (isOpenRight)
|
||||
{
|
||||
return 3;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if (b.shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlockId(par2, par3 - 1, par4), par1IBlockAccess.getBlockMetadata(par2, par3 - 1, par4)))
|
||||
{
|
||||
isOpenDown = true;
|
||||
}
|
||||
|
||||
if (b.shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlockId(par2, par3 + 1, par4), par1IBlockAccess.getBlockMetadata(par2, par3 + 1, par4)))
|
||||
{
|
||||
isOpenUp = true;
|
||||
}
|
||||
|
||||
if (b.shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlockId(par2 - 1, par3, par4), par1IBlockAccess.getBlockMetadata(par2 - 1, par3, par4)))
|
||||
{
|
||||
isOpenLeft = true;
|
||||
}
|
||||
|
||||
if (b.shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlockId(par2 + 1, par3, par4), par1IBlockAccess.getBlockMetadata(par2 + 1, par3, par4)))
|
||||
{
|
||||
isOpenRight = true;
|
||||
}
|
||||
|
||||
if (isOpenUp && isOpenDown && isOpenLeft && isOpenRight)
|
||||
{
|
||||
return 15;
|
||||
}
|
||||
else if (isOpenUp && isOpenDown && isOpenLeft)
|
||||
{
|
||||
return 14;
|
||||
}
|
||||
else if (isOpenUp && isOpenDown && isOpenRight)
|
||||
{
|
||||
return 13;
|
||||
}
|
||||
else if (isOpenUp && isOpenLeft && isOpenRight)
|
||||
{
|
||||
return 11;
|
||||
}
|
||||
else if (isOpenDown && isOpenLeft && isOpenRight)
|
||||
{
|
||||
return 12;
|
||||
}
|
||||
else if (isOpenDown && isOpenUp)
|
||||
{
|
||||
return 6;
|
||||
}
|
||||
else if (isOpenLeft && isOpenRight)
|
||||
{
|
||||
return 5;
|
||||
}
|
||||
else if (isOpenDown && isOpenLeft)
|
||||
{
|
||||
return 10;
|
||||
}
|
||||
else if (isOpenDown && isOpenRight)
|
||||
{
|
||||
return 9;
|
||||
}
|
||||
else if (isOpenUp && isOpenLeft)
|
||||
{
|
||||
return 8;
|
||||
}
|
||||
else if (isOpenUp && isOpenRight)
|
||||
{
|
||||
return 7;
|
||||
}
|
||||
else if (isOpenDown)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
else if (isOpenUp)
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
else if (isOpenLeft)
|
||||
{
|
||||
return 3;
|
||||
}
|
||||
else if (isOpenRight)
|
||||
{
|
||||
return 4;
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
if (b.shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlockId(par2, par3 - 1, par4), par1IBlockAccess.getBlockMetadata(par2, par3 - 1, par4)))
|
||||
{
|
||||
isOpenDown = true;
|
||||
}
|
||||
|
||||
if (b.shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlockId(par2, par3 + 1, par4), par1IBlockAccess.getBlockMetadata(par2, par3 + 1, par4)))
|
||||
{
|
||||
isOpenUp = true;
|
||||
}
|
||||
|
||||
if (b.shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlockId(par2, par3, par4 - 1), par1IBlockAccess.getBlockMetadata(par2, par3, par4 - 1)))
|
||||
{
|
||||
isOpenLeft = true;
|
||||
}
|
||||
|
||||
if (b.shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlockId(par2, par3, par4 + 1), par1IBlockAccess.getBlockMetadata(par2, par3, par4 + 1)))
|
||||
{
|
||||
isOpenRight = true;
|
||||
}
|
||||
|
||||
if (isOpenUp && isOpenDown && isOpenLeft && isOpenRight)
|
||||
{
|
||||
return 15;
|
||||
}
|
||||
else if (isOpenUp && isOpenDown && isOpenLeft)
|
||||
{
|
||||
return 14;
|
||||
}
|
||||
else if (isOpenUp && isOpenDown && isOpenRight)
|
||||
{
|
||||
return 13;
|
||||
}
|
||||
else if (isOpenUp && isOpenLeft && isOpenRight)
|
||||
{
|
||||
return 11;
|
||||
}
|
||||
else if (isOpenDown && isOpenLeft && isOpenRight)
|
||||
{
|
||||
return 12;
|
||||
}
|
||||
else if (isOpenDown && isOpenUp)
|
||||
{
|
||||
return 6;
|
||||
}
|
||||
else if (isOpenLeft && isOpenRight)
|
||||
{
|
||||
return 5;
|
||||
}
|
||||
else if (isOpenDown && isOpenLeft)
|
||||
{
|
||||
return 10;
|
||||
}
|
||||
else if (isOpenDown && isOpenRight)
|
||||
{
|
||||
return 9;
|
||||
}
|
||||
else if (isOpenUp && isOpenLeft)
|
||||
{
|
||||
return 8;
|
||||
}
|
||||
else if (isOpenUp && isOpenRight)
|
||||
{
|
||||
return 7;
|
||||
}
|
||||
else if (isOpenDown)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
else if (isOpenUp)
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
else if (isOpenLeft)
|
||||
{
|
||||
return 3;
|
||||
}
|
||||
else if (isOpenRight)
|
||||
{
|
||||
return 4;
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
if (b.shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlockId(par2, par3 - 1, par4), par1IBlockAccess.getBlockMetadata(par2, par3 - 1, par4)))
|
||||
{
|
||||
isOpenDown = true;
|
||||
}
|
||||
|
||||
if (b.shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlockId(par2, par3 + 1, par4), par1IBlockAccess.getBlockMetadata(par2, par3 + 1, par4)))
|
||||
{
|
||||
isOpenUp = true;
|
||||
}
|
||||
|
||||
if (b.shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlockId(par2, par3, par4 - 1), par1IBlockAccess.getBlockMetadata(par2, par3, par4 - 1)))
|
||||
{
|
||||
isOpenLeft = true;
|
||||
}
|
||||
|
||||
if (b.shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlockId(par2, par3, par4 + 1), par1IBlockAccess.getBlockMetadata(par2, par3, par4 + 1)))
|
||||
{
|
||||
isOpenRight = true;
|
||||
}
|
||||
|
||||
if (isOpenUp && isOpenDown && isOpenLeft && isOpenRight)
|
||||
{
|
||||
return 15;
|
||||
}
|
||||
else if (isOpenUp && isOpenDown && isOpenLeft)
|
||||
{
|
||||
return 13;
|
||||
}
|
||||
else if (isOpenUp && isOpenDown && isOpenRight)
|
||||
{
|
||||
return 14;
|
||||
}
|
||||
else if (isOpenUp && isOpenLeft && isOpenRight)
|
||||
{
|
||||
return 11;
|
||||
}
|
||||
else if (isOpenDown && isOpenLeft && isOpenRight)
|
||||
{
|
||||
return 12;
|
||||
}
|
||||
else if (isOpenDown && isOpenUp)
|
||||
{
|
||||
return 6;
|
||||
}
|
||||
else if (isOpenLeft && isOpenRight)
|
||||
{
|
||||
return 5;
|
||||
}
|
||||
else if (isOpenDown && isOpenLeft)
|
||||
{
|
||||
return 9;
|
||||
}
|
||||
else if (isOpenDown && isOpenRight)
|
||||
{
|
||||
return 10;
|
||||
}
|
||||
else if (isOpenUp && isOpenLeft)
|
||||
{
|
||||
return 7;
|
||||
}
|
||||
else if (isOpenUp && isOpenRight)
|
||||
{
|
||||
return 8;
|
||||
}
|
||||
else if (isOpenDown)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
else if (isOpenUp)
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
else if (isOpenLeft)
|
||||
{
|
||||
return 4;
|
||||
}
|
||||
else if (isOpenRight)
|
||||
{
|
||||
return 3;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
public void renderMicroFace (Vertex5[] verts, int side, Vector3 pos, LightMatrix lightMatrix, int colour, IUVTransformation uvt)
|
||||
{
|
||||
UV uv = new UV();
|
||||
Tessellator t = Tessellator.instance;
|
||||
int i = 0;
|
||||
while (i < 4)
|
||||
{
|
||||
if (CCRenderState.useNormals())
|
||||
{
|
||||
Vector3 n = Rotation.axes[side % 6];
|
||||
t.setNormal((float) n.x, (float) n.y, (float) n.z);
|
||||
}
|
||||
Vertex5 vert = verts[i];
|
||||
if (lightMatrix != null)
|
||||
{
|
||||
LC lc = LC.computeO(vert.vec, side);
|
||||
if (CCRenderState.useModelColours())
|
||||
lightMatrix.setColour(t, lc, colour);
|
||||
lightMatrix.setBrightness(t, lc);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (CCRenderState.useModelColours())
|
||||
CCRenderState.vertexColour(colour);
|
||||
}
|
||||
|
||||
// ((MultiIconTransformation)uvt).setIconIndex(null, determineTextre(Minecraft.getMinecraft().theWorld, (int)pos.x, (int)pos.y, (int)pos.z, side));
|
||||
|
||||
uvt.transform(uv.set(vert.uv));
|
||||
t.addVertexWithUV(vert.vec.x + pos.x, vert.vec.y + pos.y, vert.vec.z + pos.z, uv.u, uv.v);
|
||||
i += 1;
|
||||
}
|
||||
}
|
||||
|
||||
public static void createAndRegister (GlassBlockConnected block)
|
||||
{
|
||||
MicroMaterialRegistry.registerMaterial(new ConnectedTexturesMicroMaterial(block, 0), block.getUnlocalizedName());
|
||||
}*/
|
||||
}
|
||||
File renamed without changes.
+1
-1
@@ -21,7 +21,7 @@ public class RegisterWithFMP
|
||||
//For blocks without metadata values only.
|
||||
public static void registerBlock (Block block)
|
||||
{
|
||||
BlockMicroMaterial.createAndRegister(block);
|
||||
BlockMicroMaterial.createAndRegister(block, 0);
|
||||
}
|
||||
|
||||
//For blocks with metadata values and special MicroMaterial only
|
||||
Reference in new issue
Block a user