Moved some render to Calclavia Core
This commit is contained in:
parent
8b6ce6427e
commit
0e7e770350
4 changed files with 9 additions and 21 deletions
|
@ -1,13 +1,11 @@
|
|||
package resonantinduction.core.handler;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import net.minecraft.util.Icon;
|
||||
import net.minecraftforge.client.event.TextureStitchEvent;
|
||||
import net.minecraftforge.event.ForgeSubscribe;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import resonantinduction.core.Reference;
|
||||
import resonantinduction.core.ResonantInduction;
|
||||
import calclavia.lib.render.RenderUtility;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
|
@ -17,22 +15,15 @@ import cpw.mods.fml.relauncher.SideOnly;
|
|||
*/
|
||||
public class TextureHookHandler
|
||||
{
|
||||
public static final HashMap<String, Icon> loadedIconMap = new HashMap<String, Icon>();
|
||||
|
||||
public void registerIcon(String name, TextureStitchEvent.Pre event)
|
||||
{
|
||||
loadedIconMap.put(name, event.map.registerIcon(name));
|
||||
}
|
||||
|
||||
@ForgeSubscribe
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void preTextureHook(TextureStitchEvent.Pre event)
|
||||
{
|
||||
if (event.map.textureType == 0)
|
||||
{
|
||||
registerIcon(Reference.PREFIX + "mixture_flow", event);
|
||||
registerIcon(Reference.PREFIX + "molten_flow", event);
|
||||
registerIcon(Reference.PREFIX + "multimeter_screen", event);
|
||||
RenderUtility.registerIcon(Reference.PREFIX + "mixture_flow", event.map);
|
||||
RenderUtility.registerIcon(Reference.PREFIX + "molten_flow", event.map);
|
||||
RenderUtility.registerIcon(Reference.PREFIX + "multimeter_screen", event.map);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -41,8 +32,8 @@ public class TextureHookHandler
|
|||
public void textureHook(TextureStitchEvent.Post event)
|
||||
{
|
||||
for (Fluid f : ResonantInduction.fluidMixtures)
|
||||
f.setIcons(loadedIconMap.get(Reference.PREFIX + "mixture_flow"));
|
||||
f.setIcons(RenderUtility.loadedIconMap.get(Reference.PREFIX + "mixture_flow"));
|
||||
for (Fluid f : ResonantInduction.fluidMaterials)
|
||||
f.setIcons(loadedIconMap.get(Reference.PREFIX + "molten_flow"));
|
||||
f.setIcons(RenderUtility.loadedIconMap.get(Reference.PREFIX + "molten_flow"));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,7 +11,6 @@ import org.lwjgl.opengl.GL11;
|
|||
|
||||
import resonantinduction.archaic.Archaic;
|
||||
import resonantinduction.core.Reference;
|
||||
import resonantinduction.core.handler.TextureHookHandler;
|
||||
import universalelectricity.api.energy.UnitDisplay;
|
||||
import universalelectricity.api.energy.UnitDisplay.Unit;
|
||||
import universalelectricity.api.vector.Vector3;
|
||||
|
@ -39,7 +38,7 @@ public class RenderMultimeter
|
|||
GL11.glRotatef(90, 1, 0, 0);
|
||||
RenderUtility.bind(TextureMap.locationBlocksTexture);
|
||||
// Render the main panel
|
||||
RenderUtility.renderCube(-0.5, -0.05, -0.5, 0.5, 0.05, 0.5, Archaic.blockMachinePart, TextureHookHandler.loadedIconMap.get(Reference.PREFIX + "multimeter_screen"));
|
||||
RenderUtility.renderCube(-0.5, -0.05, -0.5, 0.5, 0.05, 0.5, Archaic.blockMachinePart, RenderUtility.loadedIconMap.get(Reference.PREFIX + "multimeter_screen"));
|
||||
ForgeDirection dir = ForgeDirection.NORTH;
|
||||
final int metadata = 8;
|
||||
// Render edges
|
||||
|
@ -91,7 +90,7 @@ public class RenderMultimeter
|
|||
RenderUtility.rotateFaceBlockToSideOutwards(part.getDirection().getOpposite());
|
||||
RenderUtility.bind(TextureMap.locationBlocksTexture);
|
||||
// Render the main panel
|
||||
RenderUtility.renderCube(-0.5, -0.05, -0.5, 0.5, 0.05, 0.5, Archaic.blockMachinePart, TextureHookHandler.loadedIconMap.get(Reference.PREFIX + "multimeter_screen"));
|
||||
RenderUtility.renderCube(-0.5, -0.05, -0.5, 0.5, 0.05, 0.5, Archaic.blockMachinePart, RenderUtility.loadedIconMap.get(Reference.PREFIX + "multimeter_screen"));
|
||||
final int metadata = 8;
|
||||
// Render edges
|
||||
// UP
|
||||
|
|
|
@ -21,7 +21,6 @@ public class ClientProxy extends CommonProxy
|
|||
public void init()
|
||||
{
|
||||
MinecraftForgeClient.registerItemRenderer(Mechanical.blockTank.blockID, new ItemTankRenderer());
|
||||
MinecraftForgeClient.registerItemRenderer(Mechanical.itemPipe.itemID, new ItemPipeRenderer());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileTank.class, RenderTank.INSTANCE);
|
||||
MinecraftForgeClient.registerItemRenderer(Mechanical.itemPipe.itemID, new ItemPipeRenderer());;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,7 +19,6 @@ import cpw.mods.fml.relauncher.SideOnly;
|
|||
public class RenderTank extends TileEntitySpecialRenderer
|
||||
{
|
||||
public static final RenderTank INSTANCE = new RenderTank();
|
||||
public final ModelTank model = new ModelTank();
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float var8)
|
||||
|
|
Loading…
Reference in a new issue