mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-13 00:47:32 +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
@@ -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());
|
||||
}*/
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package tconstruct.plugins.fmp;
|
||||
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.common.TRepo;
|
||||
import tconstruct.plugins.ICompatPlugin;
|
||||
|
||||
public class ForgeMultiPart implements ICompatPlugin
|
||||
{
|
||||
@Override
|
||||
public String getModId() {
|
||||
return "ForgeMultipart";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preInit() {
|
||||
// Nothing
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init()
|
||||
{
|
||||
TConstruct.logger.info("ForgeMultipart detected. Registering TConstruct decorative blocks with FMP.");
|
||||
RegisterWithFMP.registerBlock(TRepo.clearGlass);
|
||||
RegisterWithFMP.registerBlock(TRepo.stainedGlassClear, 0, 15);
|
||||
RegisterWithFMP.registerBlock(TRepo.multiBrick, 0, 13);
|
||||
RegisterWithFMP.registerBlock(TRepo.metalBlock, 0, 10);
|
||||
RegisterWithFMP.registerBlock(TRepo.multiBrickFancy, 0, 15);
|
||||
RegisterWithFMP.registerBlock(TRepo.smeltery, 2, 2);
|
||||
RegisterWithFMP.registerBlock(TRepo.smeltery, 4, 10);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postInit() {
|
||||
// Nothing
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package tconstruct.plugins.fmp;
|
||||
|
||||
import codechicken.microblock.MicroMaterialRegistry.IMicroMaterial;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import codechicken.microblock.BlockMicroMaterial;
|
||||
import codechicken.microblock.MicroMaterialRegistry;
|
||||
|
||||
public class RegisterWithFMP
|
||||
{
|
||||
//For blocks with metadata values only
|
||||
public static void registerBlock (Block block, int metastart, int metaend)
|
||||
{
|
||||
for (int meta = metastart; meta <= metaend; meta++)
|
||||
{
|
||||
String identifier = new String(block.getUnlocalizedName());
|
||||
MicroMaterialRegistry.registerMaterial(new BlockMicroMaterial(block, meta), identifier + meta);
|
||||
}
|
||||
}
|
||||
|
||||
//For blocks without metadata values only.
|
||||
public static void registerBlock (Block block)
|
||||
{
|
||||
BlockMicroMaterial.createAndRegister(block, 0);
|
||||
}
|
||||
|
||||
//For blocks with metadata values and special MicroMaterial only
|
||||
public static void registerBlock (Block block, int metastart, int metaend, IMicroMaterial material)
|
||||
{
|
||||
for (int meta = metastart; meta <= metaend; meta++)
|
||||
{
|
||||
String identifier = new String(block.getUnlocalizedName());
|
||||
MicroMaterialRegistry.registerMaterial(material, identifier + meta);
|
||||
}
|
||||
}
|
||||
|
||||
//For blocks without metadata values and special MicroMaterial only.
|
||||
public static void registerBlock (Block block, IMicroMaterial material)
|
||||
{
|
||||
MicroMaterialRegistry.registerMaterial(material, new String(block.getUnlocalizedName()));
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user