mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-20 04:09:40 +00:00
Move to Maven structure
This commit is contained in:
1 parent
ad86fccb88
commit
5cdc894dad
537 files changed
No files matched your search
@@ -0,0 +1,17 @@
|
||||
package tconstruct.plugins;
|
||||
|
||||
public interface ICompatPlugin {
|
||||
|
||||
// Mod ID the plugin handles
|
||||
public abstract String getModId();
|
||||
|
||||
// Called during TCon PreInit
|
||||
public abstract void preInit();
|
||||
|
||||
// Called during TCon Init
|
||||
public abstract void init();
|
||||
|
||||
// Called during TCon PostInit
|
||||
public abstract void postInit();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
package tconstruct.plugins;
|
||||
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.plugins.fmp.ForgeMultiPart;
|
||||
import tconstruct.plugins.minefactoryreloaded.MineFactoryReloaded;
|
||||
import tconstruct.plugins.nei.NotEnoughItems;
|
||||
import tconstruct.plugins.waila.Waila;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class PluginController
|
||||
{
|
||||
|
||||
private enum Phase {
|
||||
PRELAUNCH, PREINIT, INIT, POSTINIT, DONE
|
||||
}
|
||||
|
||||
private static PluginController instance;
|
||||
private List<ICompatPlugin> plugins = new ArrayList<ICompatPlugin>();
|
||||
private Phase currPhase = Phase.PRELAUNCH;
|
||||
|
||||
private PluginController() {}
|
||||
|
||||
public static PluginController getController()
|
||||
{
|
||||
if (instance == null) instance = new PluginController();
|
||||
return instance;
|
||||
}
|
||||
|
||||
public void registerPlugin(ICompatPlugin plugin)
|
||||
{
|
||||
if (Loader.isModLoaded(plugin.getModId()))
|
||||
{
|
||||
TConstruct.logger.info("Registering compat plugin for " + plugin.getModId());
|
||||
plugins.add(plugin);
|
||||
|
||||
switch (currPhase) // Play catch-up if plugin is registered late
|
||||
{
|
||||
case DONE:
|
||||
case POSTINIT:
|
||||
plugin.preInit();
|
||||
plugin.init();
|
||||
plugin.postInit();
|
||||
break;
|
||||
case INIT:
|
||||
plugin.preInit();
|
||||
plugin.init();
|
||||
break;
|
||||
case PREINIT:
|
||||
plugin.preInit();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void preInit()
|
||||
{
|
||||
currPhase = Phase.PREINIT;
|
||||
for (ICompatPlugin plugin : plugins) plugin.preInit();
|
||||
}
|
||||
|
||||
public void init()
|
||||
{
|
||||
currPhase = Phase.INIT;
|
||||
for (ICompatPlugin plugin : plugins) plugin.init();
|
||||
}
|
||||
|
||||
public void postInit()
|
||||
{
|
||||
currPhase = Phase.POSTINIT;
|
||||
for (ICompatPlugin plugin : plugins) plugin.postInit();
|
||||
currPhase = Phase.DONE;
|
||||
}
|
||||
|
||||
public void registerBuiltins()
|
||||
{
|
||||
registerPlugin(new ForgeMultiPart());
|
||||
registerPlugin(new MineFactoryReloaded());
|
||||
registerPlugin(new NotEnoughItems());
|
||||
registerPlugin(new Waila());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package tconstruct.plugins.fmp;
|
||||
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.common.TContent;
|
||||
import tconstruct.plugins.ICompatPlugin;
|
||||
import tconstruct.plugins.fmp.register.RegisterWithFMP;
|
||||
|
||||
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(TContent.clearGlass);
|
||||
RegisterWithFMP.registerBlock(TContent.stainedGlassClear, 0, 15);
|
||||
RegisterWithFMP.registerBlock(TContent.multiBrick, 0, 13);
|
||||
RegisterWithFMP.registerBlock(TContent.metalBlock, 0, 10);
|
||||
RegisterWithFMP.registerBlock(TContent.multiBrickFancy, 0, 15);
|
||||
RegisterWithFMP.registerBlock(TContent.smeltery, 2, 2);
|
||||
RegisterWithFMP.registerBlock(TContent.smeltery, 4, 10);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postInit() {
|
||||
// Nothing
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,585 @@
|
||||
package tconstruct.plugins.fmp.register;
|
||||
|
||||
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());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package tconstruct.plugins.fmp.register;
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
//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()));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package tconstruct.plugins.minefactoryreloaded;
|
||||
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.plugins.ICompatPlugin;
|
||||
|
||||
public class MineFactoryReloaded implements ICompatPlugin
|
||||
{
|
||||
@Override
|
||||
public String getModId() {
|
||||
return "MineFactoryReloaded";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preInit() {
|
||||
// Nothing
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init()
|
||||
{
|
||||
TConstruct.logger.info("MineFactoryReloaded detected. Registering TConstruct farmables/grindables with MFR's Farming Registry.");
|
||||
mfrRegistering.registerWithMFR();
|
||||
/*
|
||||
* Perhaps TC ores should be registered as drops from the MFR Laser Drill here, but I don't know which things would be suitable for that.
|
||||
* Syntax: FarmingRegistry.registerLaserOre(int weight, ItemStack droppedStack));
|
||||
* Currently used weights are from about 50 (emerald) to 175 (coal).
|
||||
*/
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postInit() {
|
||||
// Nothing
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package tconstruct.plugins.minefactoryreloaded.drinkable;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import powercrystals.minefactoryreloaded.api.ILiquidDrinkHandler;
|
||||
|
||||
public class Drinkables implements ILiquidDrinkHandler
|
||||
{
|
||||
|
||||
@Override
|
||||
public void onDrink (EntityPlayer player)
|
||||
{
|
||||
//boost health when drink
|
||||
if (player != null)
|
||||
{
|
||||
PotionEffect potion = player.getActivePotionEffect(Potion.field_76434_w);
|
||||
int duration = 0;
|
||||
if (potion != null)
|
||||
duration = potion.duration;
|
||||
player.addPotionEffect(new PotionEffect(Potion.field_76434_w.id, duration + 20 * 30, 0));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package tconstruct.plugins.minefactoryreloaded.harvestables;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.passive.EntityHorse;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import powercrystals.minefactoryreloaded.api.IFactoryGrindable;
|
||||
import powercrystals.minefactoryreloaded.api.MobDrop;
|
||||
import tconstruct.common.TContent;
|
||||
|
||||
public class GrindableHorse implements IFactoryGrindable
|
||||
{
|
||||
@Override
|
||||
public Class<?> getGrindableEntity ()
|
||||
{
|
||||
return EntityHorse.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MobDrop> grind (World world, EntityLivingBase entity, Random random)
|
||||
{
|
||||
List<MobDrop> drops = new ArrayList<MobDrop>();
|
||||
|
||||
drops.add(new MobDrop(10, new ItemStack(TContent.materials, random.nextInt(4) + 1, 36)));
|
||||
|
||||
return drops;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean processEntity (EntityLivingBase entity)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
+67
@@ -0,0 +1,67 @@
|
||||
package tconstruct.plugins.minefactoryreloaded.harvestables;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import powercrystals.minefactoryreloaded.api.HarvestType;
|
||||
import powercrystals.minefactoryreloaded.api.IFactoryHarvestable;
|
||||
|
||||
public class HarvestableOreBerry implements IFactoryHarvestable
|
||||
{
|
||||
private int _sourceBlockId;
|
||||
private int _berryItemId;
|
||||
private int _metaOffset;
|
||||
|
||||
public HarvestableOreBerry(int sourceBlockId, int berryItemId, int metaOffset)
|
||||
{
|
||||
_sourceBlockId = sourceBlockId;
|
||||
_berryItemId = berryItemId;
|
||||
_metaOffset = metaOffset;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPlantId ()
|
||||
{
|
||||
return _sourceBlockId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HarvestType getHarvestType ()
|
||||
{
|
||||
return HarvestType.Column;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean breakBlock ()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canBeHarvested (World world, Map<String, Boolean> harvesterSettings, int x, int y, int z)
|
||||
{
|
||||
return world.getBlockMetadata(x, y, z) >= 12;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ItemStack> getDrops (World world, Random rand, Map<String, Boolean> harvesterSettings, int x, int y, int z)
|
||||
{
|
||||
ItemStack[] returnItems = { new ItemStack(_berryItemId, 1, world.getBlockMetadata(x, y, z) % 4 + _metaOffset) };
|
||||
return Arrays.asList(returnItems);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preHarvest (World world, int x, int y, int z)
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postHarvest (World world, int x, int y, int z)
|
||||
{
|
||||
world.setBlockMetadataWithNotify(x, y, z, world.getBlockMetadata(x, y, z) - 4, 2);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package tconstruct.plugins.minefactoryreloaded;
|
||||
|
||||
import powercrystals.minefactoryreloaded.api.FactoryRegistry;
|
||||
import tconstruct.common.TContent;
|
||||
import tconstruct.plugins.minefactoryreloaded.drinkable.Drinkables;
|
||||
import tconstruct.plugins.minefactoryreloaded.harvestables.GrindableHorse;
|
||||
import tconstruct.plugins.minefactoryreloaded.harvestables.HarvestableOreBerry;
|
||||
|
||||
public class mfrRegistering
|
||||
{
|
||||
public static void registerWithMFR ()
|
||||
{
|
||||
FactoryRegistry.registerHarvestable(new HarvestableOreBerry(TContent.oreBerry.blockID, TContent.oreBerries.itemID, 0));
|
||||
FactoryRegistry.registerHarvestable(new HarvestableOreBerry(TContent.oreBerrySecond.blockID, TContent.oreBerries.itemID, 4));
|
||||
FactoryRegistry.registerGrindable(new GrindableHorse());
|
||||
FactoryRegistry.registerLiquidDrinkHandler(TContent.bloodFluid.getName(), new Drinkables());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package tconstruct.plugins.nei;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import codechicken.nei.recipe.DefaultOverlayHandler;
|
||||
import codechicken.nei.api.API;
|
||||
import tconstruct.client.gui.CraftingStationGui;
|
||||
|
||||
public class NEICompat
|
||||
{
|
||||
|
||||
public static void registerNEICompat ()
|
||||
{
|
||||
if (FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT)
|
||||
{
|
||||
API.registerGuiOverlay(CraftingStationGui.class, "crafting");
|
||||
API.registerGuiOverlayHandler(CraftingStationGui.class, new DefaultOverlayHandler(), "crafting");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package tconstruct.plugins.nei;
|
||||
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.plugins.ICompatPlugin;
|
||||
|
||||
public class NotEnoughItems implements ICompatPlugin
|
||||
{
|
||||
@Override
|
||||
public String getModId() {
|
||||
return "NotEnoughItems";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preInit() {
|
||||
// Nothing
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init() {
|
||||
TConstruct.logger.info("NotEnoughItems detected. Registering TConstruct NEI plugin.");
|
||||
NEICompat.registerNEICompat();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postInit() {
|
||||
// Nothing
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package tconstruct.plugins.waila;
|
||||
|
||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import tconstruct.blocks.logic.CastingChannelLogic;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class CastingChannelDataProvider implements IWailaDataProvider
|
||||
{
|
||||
|
||||
@Override
|
||||
public ItemStack getWailaStack (IWailaDataAccessor accessor, IWailaConfigHandler config)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaHead (ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config)
|
||||
{
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaBody (ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config)
|
||||
{
|
||||
if (accessor.getTileEntity() instanceof CastingChannelLogic)
|
||||
{
|
||||
CastingChannelLogic te = (CastingChannelLogic) accessor.getTileEntity();
|
||||
if (te.liquid != null && te.liquid.amount > 0)
|
||||
{
|
||||
FluidStack fs = te.liquid;
|
||||
currenttip.add("Liquid: " + WailaRegistrar.fluidNameHelper(fs));
|
||||
currenttip.add("Amount: " + fs.amount + "/" + te.getCapacity());
|
||||
}
|
||||
else
|
||||
{
|
||||
currenttip.add("§oEmpty"); // "§o" == Italics
|
||||
}
|
||||
}
|
||||
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package tconstruct.plugins.waila;
|
||||
|
||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import tconstruct.blocks.logic.LavaTankLogic;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class SearedTankDataProvider implements IWailaDataProvider
|
||||
{
|
||||
|
||||
@Override
|
||||
public ItemStack getWailaStack (IWailaDataAccessor accessor, IWailaConfigHandler config)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaHead (ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config)
|
||||
{
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaBody (ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config)
|
||||
{
|
||||
if (accessor.getTileEntity() instanceof LavaTankLogic)
|
||||
{
|
||||
LavaTankLogic te = (LavaTankLogic) accessor.getTileEntity();
|
||||
if (te.containsFluid())
|
||||
{
|
||||
FluidStack fs = te.tank.getFluid();
|
||||
currenttip.add("Liquid: " + WailaRegistrar.fluidNameHelper(fs));
|
||||
currenttip.add("Amount: " + fs.amount + "/" + te.tank.getCapacity());
|
||||
}
|
||||
else
|
||||
{
|
||||
currenttip.add("§oEmpty"); // "§o" == Italics
|
||||
}
|
||||
}
|
||||
return currenttip;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package tconstruct.plugins.waila;
|
||||
|
||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import tconstruct.blocks.logic.SmelteryLogic;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class SmelteryDataProvider implements IWailaDataProvider
|
||||
{
|
||||
|
||||
@Override
|
||||
public ItemStack getWailaStack (IWailaDataAccessor accessor, IWailaConfigHandler config)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaHead (ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config)
|
||||
{
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaBody (ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config)
|
||||
{
|
||||
if (accessor.getTileEntity() instanceof SmelteryLogic)
|
||||
{
|
||||
SmelteryLogic te = (SmelteryLogic) accessor.getTileEntity();
|
||||
if (te.validStructure)
|
||||
{
|
||||
List<FluidStack> fls = te.moltenMetal;
|
||||
if (fls.size() <= 0)
|
||||
{
|
||||
currenttip.add("§oEmpty"); // "§o" == Italics
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int i = 0; i < fls.size(); i++)
|
||||
{
|
||||
FluidStack st = fls.get(i);
|
||||
currenttip.add(WailaRegistrar.fluidNameHelper(st) + " (" + st.amount + "mB)");
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
currenttip.add("§oInvalid structure");
|
||||
}
|
||||
}
|
||||
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package tconstruct.plugins.waila;
|
||||
|
||||
import cpw.mods.fml.common.event.FMLInterModComms;
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.plugins.ICompatPlugin;
|
||||
|
||||
public class Waila implements ICompatPlugin
|
||||
{
|
||||
@Override
|
||||
public String getModId() {
|
||||
return "Waila";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preInit() {
|
||||
// Nothing
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init() {
|
||||
TConstruct.logger.info("Waila detected. Registering TConstruct tank blocks with Waila registry.");
|
||||
|
||||
FMLInterModComms.sendMessage("Waila", "register", "tconstruct.plugins.waila.WailaRegistrar.wailaCallback");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postInit() {
|
||||
// Nothing
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package tconstruct.plugins.waila;
|
||||
|
||||
import mcp.mobius.waila.api.IWailaRegistrar;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.blocks.LavaTankBlock;
|
||||
import tconstruct.blocks.SmelteryBlock;
|
||||
import tconstruct.blocks.logic.CastingChannelLogic;
|
||||
|
||||
public class WailaRegistrar
|
||||
{
|
||||
public static void wailaCallback (IWailaRegistrar registrar)
|
||||
{
|
||||
TConstruct.logger.info("[Waila-Compat] Got registrar: " + registrar);
|
||||
|
||||
// Tanks
|
||||
registrar.registerBodyProvider(new SearedTankDataProvider(), LavaTankBlock.class);
|
||||
registrar.registerBodyProvider(new CastingChannelDataProvider(), CastingChannelLogic.class);
|
||||
//registrar.registerBodyProvider(new EssenceExtractorDataProvider(), EssenceExtractor.class);
|
||||
|
||||
// Smeltery
|
||||
registrar.registerBodyProvider(new SmelteryDataProvider(), SmelteryBlock.class);
|
||||
}
|
||||
|
||||
public static String fluidNameHelper (FluidStack f)
|
||||
{
|
||||
return StatCollector.translateToLocal(FluidRegistry.getFluidName(f));
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user