mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-22 04:52:25 +00:00
Remove traces of legacy transmitter rendering
This commit is contained in:
1 parent
05c4967f0f
commit
3bd0ff271c
37 files changed
+44
-1240
No files matched your search
@@ -325,7 +325,7 @@ public class MekanismRenderer
|
||||
|
||||
for(int i = 0; i < 4; i++)
|
||||
{
|
||||
int nextIndex = i+amount%4;
|
||||
int nextIndex = (i+amount)%4;
|
||||
vertices[7*i + 4] = quad.getVertexData()[7*nextIndex + 4];
|
||||
vertices[7*i + 5] = quad.getVertexData()[7*nextIndex + 5];
|
||||
}
|
||||
|
||||
@@ -1,818 +0,0 @@
|
||||
package mekanism.client.render;
|
||||
|
||||
/*
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import mekanism.api.Coord4D;
|
||||
import mekanism.api.EnumColor;
|
||||
import mekanism.client.model.ModelTransporterBox;
|
||||
import mekanism.client.render.MekanismRenderer.DisplayInteger;
|
||||
import mekanism.client.render.MekanismRenderer.Model3D;
|
||||
import mekanism.common.content.transporter.TransporterStack;
|
||||
import mekanism.common.item.ItemConfigurator;
|
||||
import mekanism.common.multipart.PartDiversionTransporter;
|
||||
import mekanism.common.multipart.PartLogisticalTransporter;
|
||||
import mekanism.common.multipart.PartMechanicalPipe;
|
||||
import mekanism.common.multipart.PartPressurizedTube;
|
||||
import mekanism.common.multipart.PartSidedPipe;
|
||||
import mekanism.common.multipart.PartSidedPipe.ConnectionType;
|
||||
import mekanism.common.multipart.PartThermodynamicConductor;
|
||||
import mekanism.common.multipart.PartUniversalCable;
|
||||
import mekanism.common.multipart.TransmitterType;
|
||||
import mekanism.common.multipart.TransmitterType.Size;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
import mekanism.common.util.MekanismUtils.ResourceType;
|
||||
import mekanism.common.util.TransporterUtils;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.entity.RenderItem;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import codechicken.lib.colour.Colour;
|
||||
import codechicken.lib.colour.ColourRGBA;
|
||||
import codechicken.lib.lighting.LightModel;
|
||||
import codechicken.lib.lighting.LightModel.Light;
|
||||
import codechicken.lib.render.CCModel;
|
||||
import codechicken.lib.render.CCRenderState;
|
||||
import codechicken.lib.render.ColourMultiplier;
|
||||
import codechicken.lib.render.TextureUtils;
|
||||
import codechicken.lib.render.TextureUtils.IIconSelfRegister;
|
||||
import codechicken.lib.render.uv.IconTransformation;
|
||||
import codechicken.lib.vec.Translation;
|
||||
import codechicken.lib.vec.Vector3;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
*/
|
||||
|
||||
//@SideOnly(Side.CLIENT)
|
||||
public class RenderPartTransmitter //TODO implements IIconSelfRegister
|
||||
{
|
||||
/*
|
||||
public static RenderPartTransmitter INSTANCE;
|
||||
|
||||
public static Map<String, CCModel> small_models;
|
||||
public static Map<String, CCModel> large_models;
|
||||
public static Map<String, CCModel> contents_models;
|
||||
|
||||
private static final int stages = 100;
|
||||
private static final double height = 0.45;
|
||||
private static final double offset = 0.015;
|
||||
|
||||
private ModelTransporterBox modelBox = new ModelTransporterBox();
|
||||
|
||||
private HashMap<EnumFacing, HashMap<Fluid, DisplayInteger[]>> cachedLiquids = new HashMap<EnumFacing, HashMap<Fluid, DisplayInteger[]>>();
|
||||
private HashMap<EnumFacing, HashMap<Integer, DisplayInteger>> cachedOverlays = new HashMap<EnumFacing, HashMap<Integer, DisplayInteger>>();
|
||||
|
||||
private Minecraft mc = Minecraft.getMinecraft();
|
||||
|
||||
private EntityItem entityItem = new EntityItem(null);
|
||||
private RenderItem renderer = (RenderItem)RenderManager.instance.getEntityClassRenderObject(EntityItem.class);
|
||||
|
||||
public static RenderPartTransmitter getInstance()
|
||||
{
|
||||
return INSTANCE;
|
||||
}
|
||||
|
||||
public static void init()
|
||||
{
|
||||
INSTANCE = new RenderPartTransmitter();
|
||||
TextureUtils.addIconRegistrar(INSTANCE);
|
||||
|
||||
small_models = CCModel.parseObjModels(MekanismUtils.getResource(ResourceType.MODEL, "transmitter_small.obj"), 7, null);
|
||||
|
||||
for(Map.Entry<String, CCModel> e : small_models.entrySet())
|
||||
{
|
||||
e.setValue(e.getValue().computeLighting(LightModel.standardLightModel).twoFacedCopy().apply(new Translation(Vector3.center)).shrinkUVs(0.0005));
|
||||
}
|
||||
|
||||
large_models = CCModel.parseObjModels(MekanismUtils.getResource(ResourceType.MODEL, "transmitter_large.obj"), 7, null);
|
||||
|
||||
for(Map.Entry<String, CCModel> e : large_models.entrySet())
|
||||
{
|
||||
e.setValue(e.getValue().computeLighting(LightModel.standardLightModel).twoFacedCopy().apply(new Translation(Vector3.center)).shrinkUVs(0.0005));
|
||||
}
|
||||
|
||||
contents_models = CCModel.parseObjModels(MekanismUtils.getResource(ResourceType.MODEL, "transmitter_contents.obj"), 7, null);
|
||||
LightModel interiorLightModel = new LightModel()
|
||||
.setAmbient(new Vector3(0.6, 0.6, 0.6))
|
||||
.addLight(new Light(new Vector3(0.3, 1, -0.7))
|
||||
.setDiffuse(new Vector3(0.6, 0.6, 0.6)))
|
||||
.addLight(new Light(new Vector3(-0.3, 1, 0.7))
|
||||
.setDiffuse(new Vector3(0.6, 0.6, 0.6)));
|
||||
|
||||
for(CCModel c : contents_models.values())
|
||||
{
|
||||
c.apply(new Translation(Vector3.center));
|
||||
c.computeLighting(interiorLightModel);
|
||||
c.shrinkUVs(0.0005);
|
||||
}
|
||||
}
|
||||
|
||||
private void push()
|
||||
{
|
||||
GlStateManager.pushMatrix();
|
||||
GL11.glPushAttrib(GL11.GL_ENABLE_BIT);
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
}
|
||||
|
||||
private void pop()
|
||||
{
|
||||
GL11.glPopAttrib();
|
||||
GlStateManager.popMatrix();
|
||||
}
|
||||
|
||||
public void renderItem(TransmitterType type)
|
||||
{
|
||||
CCRenderState.reset();
|
||||
CCRenderState.startDrawing();
|
||||
|
||||
for(EnumFacing side : EnumFacing.VALUES)
|
||||
{
|
||||
renderSide(side, type, false);
|
||||
}
|
||||
|
||||
CCRenderState.draw();
|
||||
|
||||
CCRenderState.reset();
|
||||
CCRenderState.startDrawing();
|
||||
|
||||
for(EnumFacing side : EnumFacing.VALUES)
|
||||
{
|
||||
renderSide(side, type, true);
|
||||
}
|
||||
|
||||
CCRenderState.draw();
|
||||
}
|
||||
|
||||
public void renderContents(PartLogisticalTransporter transporter, float partialTick, Vector3 vec)
|
||||
{
|
||||
GlStateManager.pushMatrix();
|
||||
|
||||
entityItem.age = 0;
|
||||
entityItem.hoverStart = 0;
|
||||
|
||||
entityItem.setPosition(transporter.x() + 0.5, transporter.y() + 0.5, transporter.z() + 0.5);
|
||||
entityItem.worldObj = transporter.world();
|
||||
|
||||
for(TransporterStack stack : transporter.getTransmitter().transit)
|
||||
{
|
||||
if(stack != null)
|
||||
{
|
||||
GlStateManager.pushMatrix();
|
||||
entityItem.setEntityItemStack(stack.itemStack);
|
||||
|
||||
float[] pos = TransporterUtils.getStackPosition(transporter.getTransmitter(), stack, partialTick*transporter.tier.speed);
|
||||
|
||||
GL11.glTranslated(vec.x + pos[0], vec.y + pos[1] - entityItem.yOffset, vec.z + pos[2]);
|
||||
GlStateManager.scale(0.75F, 0.75F, 0.75F);
|
||||
|
||||
renderer.doRender(entityItem, 0, 0, 0, 0, 0);
|
||||
GlStateManager.popMatrix();
|
||||
|
||||
if(stack.color != null)
|
||||
{
|
||||
CCRenderState.changeTexture(MekanismUtils.getResource(ResourceType.RENDER, "TransporterBox.png"));
|
||||
GlStateManager.pushMatrix();
|
||||
MekanismRenderer.glowOn();
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
GL11.glColor4f(stack.color.getColor(0), stack.color.getColor(1), stack.color.getColor(2), 1.0F);
|
||||
GlStateManager.translate((float)(vec.x + pos[0]), (float)(vec.y + pos[1] - entityItem.yOffset - ((stack.itemStack.getItem() instanceof ItemBlock) ? 0.1 : 0)), (float)(vec.z + pos[2]));
|
||||
modelBox.render(0.0625F);
|
||||
MekanismRenderer.glowOff();
|
||||
GlStateManager.popMatrix();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(transporter instanceof PartDiversionTransporter)
|
||||
{
|
||||
EntityPlayer player = mc.thePlayer;
|
||||
World world = mc.thePlayer.worldObj;
|
||||
ItemStack itemStack = player.getCurrentEquippedItem();
|
||||
MovingObjectPosition pos = player.rayTrace(8.0D, 1.0F);
|
||||
|
||||
if(pos != null && itemStack != null && itemStack.getItem() instanceof ItemConfigurator)
|
||||
{
|
||||
int xPos = MathHelper.floor_double(pos.blockX);
|
||||
int yPos = MathHelper.floor_double(pos.blockY);
|
||||
int zPos = MathHelper.floor_double(pos.blockZ);
|
||||
|
||||
Coord4D obj = new Coord4D(xPos, yPos, zPos, transporter.world().provider.dimensionId);
|
||||
|
||||
if(obj.equals(Coord4D.get(transporter.tile())))
|
||||
{
|
||||
int mode = ((PartDiversionTransporter)transporter).modes[pos.sideHit];
|
||||
EnumFacing side = EnumFacing.getFront(pos.sideHit);
|
||||
|
||||
pushTransporter();
|
||||
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.8F);
|
||||
|
||||
CCRenderState.changeTexture(mode == 0 ? MekanismRenderer.getItemsTexture() : MekanismRenderer.getBlocksTexture());
|
||||
GlStateManager.translate((float)vec.x, (float)vec.y, (float)vec.z);
|
||||
GlStateManager.scale(0.5F, 0.5F, 0.5F);
|
||||
GlStateManager.translate(0.5F, 0.5F, 0.5F);
|
||||
|
||||
int display = getOverlayDisplay(world, side, mode).display;
|
||||
GL11.glCallList(display);
|
||||
|
||||
popTransporter();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
GlStateManager.popMatrix();
|
||||
}
|
||||
|
||||
public void renderContents(PartUniversalCable cable, Vector3 pos)
|
||||
{
|
||||
if(cable.currentPower == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
push();
|
||||
CCRenderState.reset();
|
||||
CCRenderState.useNormals = true;
|
||||
CCRenderState.startDrawing();
|
||||
GL11.glTranslated(pos.x, pos.y, pos.z);
|
||||
|
||||
for(EnumFacing side : EnumFacing.VALUES)
|
||||
{
|
||||
renderEnergySide(side, cable);
|
||||
}
|
||||
|
||||
MekanismRenderer.glowOn();
|
||||
MekanismRenderer.cullFrontFace();
|
||||
|
||||
CCRenderState.draw();
|
||||
|
||||
MekanismRenderer.disableCullFace();
|
||||
MekanismRenderer.glowOff();
|
||||
|
||||
pop();
|
||||
}
|
||||
|
||||
public void renderContents(PartThermodynamicConductor transmitter, Vector3 pos)
|
||||
{
|
||||
push();
|
||||
CCRenderState.reset();
|
||||
CCRenderState.useNormals = true;
|
||||
CCRenderState.startDrawing();
|
||||
GL11.glTranslated(pos.x, pos.y, pos.z);
|
||||
|
||||
for(EnumFacing side : EnumFacing.VALUES)
|
||||
{
|
||||
renderHeatSide(side, transmitter);
|
||||
}
|
||||
|
||||
MekanismRenderer.glowOn();
|
||||
MekanismRenderer.cullFrontFace();
|
||||
|
||||
CCRenderState.draw();
|
||||
|
||||
MekanismRenderer.disableCullFace();
|
||||
MekanismRenderer.glowOff();
|
||||
|
||||
pop();
|
||||
}
|
||||
|
||||
public void renderContents(PartMechanicalPipe pipe, Vector3 pos)
|
||||
{
|
||||
float targetScale;
|
||||
|
||||
if(pipe.getTransmitter().hasTransmitterNetwork())
|
||||
{
|
||||
targetScale = pipe.getTransmitter().getTransmitterNetwork().fluidScale;
|
||||
}
|
||||
else {
|
||||
targetScale = (float)pipe.buffer.getFluidAmount() / (float)pipe.buffer.getCapacity();
|
||||
}
|
||||
|
||||
if(Math.abs(pipe.currentScale - targetScale) > 0.01)
|
||||
{
|
||||
pipe.currentScale = (12 * pipe.currentScale + targetScale) / 13;
|
||||
}
|
||||
else {
|
||||
pipe.currentScale = targetScale;
|
||||
}
|
||||
|
||||
Fluid fluid;
|
||||
|
||||
if(pipe.getTransmitter().hasTransmitterNetwork())
|
||||
{
|
||||
fluid = pipe.getTransmitter().getTransmitterNetwork().refFluid;
|
||||
}
|
||||
else {
|
||||
fluid = pipe.getBuffer() == null ? null : pipe.getBuffer().getFluid();
|
||||
}
|
||||
|
||||
float scale = pipe.currentScale;
|
||||
|
||||
if(scale > 0.01 && fluid != null)
|
||||
{
|
||||
push();
|
||||
|
||||
MekanismRenderer.glowOn(fluid.getLuminosity());
|
||||
MekanismRenderer.colorFluid(fluid);
|
||||
|
||||
CCRenderState.changeTexture(MekanismRenderer.getBlocksTexture());
|
||||
GL11.glTranslated(pos.x, pos.y, pos.z);
|
||||
|
||||
boolean gas = fluid.isGaseous();
|
||||
|
||||
for(EnumFacing side : EnumFacing.VALUES)
|
||||
{
|
||||
if(pipe.getConnectionType(side) == ConnectionType.NORMAL)
|
||||
{
|
||||
DisplayInteger[] displayLists = getListAndRender(side, fluid);
|
||||
|
||||
if(displayLists != null)
|
||||
{
|
||||
if(!gas)
|
||||
{
|
||||
displayLists[Math.max(3, (int)((float)scale*(stages-1)))].render();
|
||||
}
|
||||
else {
|
||||
GL11.glColor4f(1F, 1F, 1F, scale);
|
||||
displayLists[stages-1].render();
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(pipe.getConnectionType(side) != ConnectionType.NONE)
|
||||
{
|
||||
GL11.glCullFace(GL11.GL_FRONT);
|
||||
CCRenderState.startDrawing();
|
||||
renderFluidInOut(side, pipe);
|
||||
CCRenderState.draw();
|
||||
GL11.glCullFace(GL11.GL_BACK);
|
||||
}
|
||||
}
|
||||
|
||||
DisplayInteger[] displayLists = getListAndRender(null, fluid);
|
||||
|
||||
if(displayLists != null)
|
||||
{
|
||||
if(!gas)
|
||||
{
|
||||
displayLists[Math.max(3, (int)((float)scale*(stages-1)))].render();
|
||||
}
|
||||
else {
|
||||
GL11.glColor4f(1F, 1F, 1F, scale);
|
||||
displayLists[stages-1].render();
|
||||
}
|
||||
}
|
||||
|
||||
MekanismRenderer.glowOff();
|
||||
MekanismRenderer.resetColor();
|
||||
|
||||
pop();
|
||||
}
|
||||
}
|
||||
|
||||
private DisplayInteger[] getListAndRender(EnumFacing side, Fluid fluid)
|
||||
{
|
||||
if(side == null || fluid == null || fluid.getIcon() == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
if(cachedLiquids.containsKey(side) && cachedLiquids.get(side).containsKey(fluid))
|
||||
{
|
||||
return cachedLiquids.get(side).get(fluid);
|
||||
}
|
||||
|
||||
Model3D toReturn = new Model3D();
|
||||
toReturn.baseBlock = Blocks.water;
|
||||
toReturn.setTexture(fluid.getIcon());
|
||||
|
||||
toReturn.setSideRender(side, false);
|
||||
toReturn.setSideRender(side.getOpposite(), false);
|
||||
|
||||
DisplayInteger[] displays = new DisplayInteger[stages];
|
||||
|
||||
if(cachedLiquids.containsKey(side))
|
||||
{
|
||||
cachedLiquids.get(side).put(fluid, displays);
|
||||
}
|
||||
else {
|
||||
HashMap<Fluid, DisplayInteger[]> map = new HashMap<Fluid, DisplayInteger[]>();
|
||||
map.put(fluid, displays);
|
||||
cachedLiquids.put(side, map);
|
||||
}
|
||||
|
||||
for(int i = 0; i < stages; i++)
|
||||
{
|
||||
displays[i] = DisplayInteger.createAndStart();
|
||||
|
||||
switch(side)
|
||||
{
|
||||
case UNKNOWN:
|
||||
{
|
||||
toReturn.minX = 0.25 + offset;
|
||||
toReturn.minY = 0.25 + offset;
|
||||
toReturn.minZ = 0.25 + offset;
|
||||
|
||||
toReturn.maxX = 0.75 - offset;
|
||||
toReturn.maxY = 0.25 + offset + ((float)i / (float)stages)*height;
|
||||
toReturn.maxZ = 0.75 - offset;
|
||||
break;
|
||||
}
|
||||
case DOWN:
|
||||
{
|
||||
toReturn.minX = 0.5 - (((float)i / (float)stages)*height)/2;
|
||||
toReturn.minY = 0.0;
|
||||
toReturn.minZ = 0.5 - (((float)i / (float)stages)*height)/2;
|
||||
|
||||
toReturn.maxX = 0.5 + (((float)i / (float)stages)*height)/2;
|
||||
toReturn.maxY = 0.25 + offset;
|
||||
toReturn.maxZ = 0.5 + (((float)i / (float)stages)*height)/2;
|
||||
break;
|
||||
}
|
||||
case UP:
|
||||
{
|
||||
toReturn.minX = 0.5 - (((float)i / (float)stages)*height)/2;
|
||||
toReturn.minY = 0.25 - offset + ((float)i / (float)stages)*height;
|
||||
toReturn.minZ = 0.5 - (((float)i / (float)stages)*height)/2;
|
||||
|
||||
toReturn.maxX = 0.5 + (((float)i / (float)stages)*height)/2;
|
||||
toReturn.maxY = 1.0;
|
||||
toReturn.maxZ = 0.5 + (((float)i / (float)stages)*height)/2;
|
||||
break;
|
||||
}
|
||||
case NORTH:
|
||||
{
|
||||
toReturn.minX = 0.25 + offset;
|
||||
toReturn.minY = 0.25 + offset;
|
||||
toReturn.minZ = 0.0;
|
||||
|
||||
toReturn.maxX = 0.75 - offset;
|
||||
toReturn.maxY = 0.25 + offset + ((float)i / (float)stages)*height;
|
||||
toReturn.maxZ = 0.25 + offset;
|
||||
break;
|
||||
}
|
||||
case SOUTH:
|
||||
{
|
||||
toReturn.minX = 0.25 + offset;
|
||||
toReturn.minY = 0.25 + offset;
|
||||
toReturn.minZ = 0.75 - offset;
|
||||
|
||||
toReturn.maxX = 0.75 - offset;
|
||||
toReturn.maxY = 0.25 + offset + ((float)i / (float)stages)*height;
|
||||
toReturn.maxZ = 1.0;
|
||||
break;
|
||||
}
|
||||
case WEST:
|
||||
{
|
||||
toReturn.minX = 0.0;
|
||||
toReturn.minY = 0.25 + offset;
|
||||
toReturn.minZ = 0.25 + offset;
|
||||
|
||||
toReturn.maxX = 0.25 + offset;
|
||||
toReturn.maxY = 0.25 + offset + ((float)i / (float)stages)*height;
|
||||
toReturn.maxZ = 0.75 - offset;
|
||||
break;
|
||||
}
|
||||
case EAST:
|
||||
{
|
||||
toReturn.minX = 0.75 - offset;
|
||||
toReturn.minY = 0.25 + offset;
|
||||
toReturn.minZ = 0.25 + offset;
|
||||
|
||||
toReturn.maxX = 1.0;
|
||||
toReturn.maxY = 0.25 + offset + ((float)i / (float)stages)*height;
|
||||
toReturn.maxZ = 0.75 - offset;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
MekanismRenderer.renderObject(toReturn);
|
||||
displays[i].endList();
|
||||
}
|
||||
|
||||
return displays;
|
||||
}
|
||||
|
||||
public void renderContents(PartPressurizedTube tube, Vector3 pos)
|
||||
{
|
||||
if(!tube.getTransmitter().hasTransmitterNetwork() || tube.getTransmitter().getTransmitterNetwork().refGas == null || tube.getTransmitter().getTransmitterNetwork().gasScale == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
push();
|
||||
|
||||
CCRenderState.reset();
|
||||
CCRenderState.useNormals = true;
|
||||
CCRenderState.startDrawing();
|
||||
GL11.glTranslated(pos.x, pos.y, pos.z);
|
||||
|
||||
for(EnumFacing side : EnumFacing.VALUES)
|
||||
{
|
||||
renderGasSide(side, tube);
|
||||
}
|
||||
|
||||
MekanismRenderer.glowOn(0);
|
||||
MekanismRenderer.cullFrontFace();
|
||||
|
||||
CCRenderState.draw();
|
||||
|
||||
MekanismRenderer.disableCullFace();
|
||||
MekanismRenderer.glowOff();
|
||||
|
||||
pop();
|
||||
}
|
||||
|
||||
public void renderStatic(PartSidedPipe transmitter, int pass)
|
||||
{
|
||||
CCRenderState.reset();
|
||||
CCRenderState.hasColour = true;
|
||||
CCRenderState.setBrightness(transmitter.world(), transmitter.x(), transmitter.y(), transmitter.z());
|
||||
|
||||
for(EnumFacing side : EnumFacing.VALUES)
|
||||
{
|
||||
renderSide(side, transmitter, pass);
|
||||
}
|
||||
}
|
||||
|
||||
public void renderSide(EnumFacing side, PartSidedPipe transmitter, int pass)
|
||||
{
|
||||
if(pass == 1)
|
||||
{
|
||||
if(transmitter.transparencyRender())
|
||||
{
|
||||
IIcon renderIcon = transmitter.getIconForSide(side, false);
|
||||
EnumColor color = transmitter.getRenderColor(false);
|
||||
|
||||
Colour c = null;
|
||||
|
||||
if(color != null)
|
||||
{
|
||||
c = new ColourRGBA(color.getColor(0), color.getColor(1), color.getColor(2), 1);
|
||||
}
|
||||
|
||||
renderPart(renderIcon, transmitter.getModelForSide(side, false), transmitter.x(), transmitter.y(), transmitter.z(), c);
|
||||
}
|
||||
}
|
||||
else {
|
||||
IIcon renderIcon = transmitter.getIconForSide(side, true);
|
||||
EnumColor color = transmitter.getRenderColor(true);
|
||||
|
||||
Colour c = null;
|
||||
|
||||
if(color != null)
|
||||
{
|
||||
c = new ColourRGBA(color.getColor(0), color.getColor(1), color.getColor(2), 1);
|
||||
}
|
||||
|
||||
renderPart(renderIcon, transmitter.getModelForSide(side, false), transmitter.x(), transmitter.y(), transmitter.z(), c);
|
||||
}
|
||||
}
|
||||
|
||||
public void renderSide(EnumFacing side, TransmitterType type, boolean opaque)
|
||||
{
|
||||
boolean out = side == EnumFacing.UP || side == EnumFacing.DOWN;
|
||||
|
||||
IIcon renderIcon = out ? type.getSideIcon(opaque) : type.getCenterIcon(opaque);
|
||||
|
||||
renderPart(renderIcon, getItemModel(side, type), 0, 0, 0, null);
|
||||
}
|
||||
|
||||
public void renderEnergySide(EnumFacing side, PartUniversalCable cable)
|
||||
{
|
||||
CCRenderState.changeTexture(MekanismRenderer.getBlocksTexture());
|
||||
renderTransparency(MekanismRenderer.energyIcon, cable.getModelForSide(side, true), new ColourRGBA(1.0, 1.0, 1.0, cable.currentPower));
|
||||
}
|
||||
|
||||
public void renderHeatSide(EnumFacing side, PartThermodynamicConductor cable)
|
||||
{
|
||||
CCRenderState.changeTexture(MekanismRenderer.getBlocksTexture());
|
||||
renderTransparency(MekanismRenderer.heatIcon, cable.getModelForSide(side, true), ColourTemperature.fromTemperature(cable.temperature, cable.getBaseColour()));
|
||||
}
|
||||
|
||||
public void renderFluidInOut(EnumFacing side, PartMechanicalPipe pipe)
|
||||
{
|
||||
CCRenderState.changeTexture(MekanismRenderer.getBlocksTexture());
|
||||
renderTransparency(pipe.getTransmitter().getTransmitterNetwork().refFluid.getIcon(), pipe.getModelForSide(side, true), new ColourRGBA(1.0, 1.0, 1.0, pipe.currentScale));
|
||||
}
|
||||
|
||||
public void renderGasSide(EnumFacing side, PartPressurizedTube tube)
|
||||
{
|
||||
CCRenderState.changeTexture(MekanismRenderer.getBlocksTexture());
|
||||
renderTransparency(tube.getTransmitter().getTransmitterNetwork().refGas.getIcon(), tube.getModelForSide(side, true), new ColourRGBA(1.0, 1.0, 1.0, tube.currentScale));
|
||||
}
|
||||
|
||||
public void renderPart(IIcon icon, CCModel cc, double x, double y, double z, Colour color)
|
||||
{
|
||||
if(color != null)
|
||||
{
|
||||
cc.render(new Translation(x, y, z), new IconTransformation(icon), new ColourMultiplier(color.rgba()));
|
||||
}
|
||||
else {
|
||||
cc.render(new Translation(x, y, z), new IconTransformation(icon));
|
||||
}
|
||||
}
|
||||
|
||||
public void renderTransparency(IIcon icon, CCModel cc, Colour color)
|
||||
{
|
||||
if(color != null)
|
||||
{
|
||||
cc.render(new IconTransformation(icon), new ColourMultiplier(color.rgba()));
|
||||
}
|
||||
else {
|
||||
cc.render(new IconTransformation(icon));
|
||||
}
|
||||
}
|
||||
|
||||
public CCModel getItemModel(EnumFacing side, TransmitterType type)
|
||||
{
|
||||
String name = side.name().toLowerCase();
|
||||
boolean out = side == EnumFacing.UP || side == EnumFacing.DOWN;
|
||||
name += out ? "NORMAL" : "NONE";
|
||||
|
||||
if(type.getSize() == Size.SMALL)
|
||||
{
|
||||
return small_models.get(name);
|
||||
}
|
||||
else {
|
||||
return large_models.get(name);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerIcons(IIconRegister register)
|
||||
{
|
||||
PartUniversalCable.registerIcons(register);
|
||||
PartMechanicalPipe.registerIcons(register);
|
||||
PartPressurizedTube.registerIcons(register);
|
||||
PartLogisticalTransporter.registerIcons(register);
|
||||
PartThermodynamicConductor.registerIcons(register);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int atlasIndex()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
private void popTransporter()
|
||||
{
|
||||
GL11.glPopAttrib();
|
||||
MekanismRenderer.glowOff();
|
||||
MekanismRenderer.blendOff();
|
||||
GlStateManager.popMatrix();
|
||||
}
|
||||
|
||||
private void pushTransporter()
|
||||
{
|
||||
GlStateManager.pushMatrix();
|
||||
GL11.glPushAttrib(GL11.GL_ENABLE_BIT);
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
MekanismRenderer.glowOn();
|
||||
MekanismRenderer.blendOn();
|
||||
}
|
||||
|
||||
private DisplayInteger getOverlayDisplay(World world, EnumFacing side, int mode)
|
||||
{
|
||||
if(cachedOverlays.containsKey(side) && cachedOverlays.get(side).containsKey(mode))
|
||||
{
|
||||
return cachedOverlays.get(side).get(mode);
|
||||
}
|
||||
|
||||
IIcon icon = null;
|
||||
|
||||
switch(mode)
|
||||
{
|
||||
case 0:
|
||||
icon = Items.gunpowder.getIcon(new ItemStack(Items.gunpowder), 0);
|
||||
break;
|
||||
case 1:
|
||||
icon = Blocks.redstone_torch.getIcon(0, 0);
|
||||
break;
|
||||
case 2:
|
||||
icon = Blocks.unlit_redstone_torch.getIcon(0, 0);
|
||||
break;
|
||||
}
|
||||
|
||||
Model3D toReturn = new Model3D();
|
||||
toReturn.baseBlock = Blocks.stone;
|
||||
toReturn.setTexture(icon);
|
||||
|
||||
DisplayInteger display = DisplayInteger.createAndStart();
|
||||
|
||||
if(cachedOverlays.containsKey(side))
|
||||
{
|
||||
cachedOverlays.get(side).put(mode, display);
|
||||
}
|
||||
else {
|
||||
HashMap<Integer, DisplayInteger> map = new HashMap<Integer, DisplayInteger>();
|
||||
map.put(mode, display);
|
||||
cachedOverlays.put(side, map);
|
||||
}
|
||||
|
||||
switch(side)
|
||||
{
|
||||
case DOWN:
|
||||
{
|
||||
toReturn.minY = -0.01;
|
||||
toReturn.maxY = 0;
|
||||
|
||||
toReturn.minX = 0;
|
||||
toReturn.minZ = 0;
|
||||
toReturn.maxX = 1;
|
||||
toReturn.maxZ = 1;
|
||||
break;
|
||||
}
|
||||
case UP:
|
||||
{
|
||||
toReturn.minY = 1;
|
||||
toReturn.maxY = 1.01;
|
||||
|
||||
toReturn.minX = 0;
|
||||
toReturn.minZ = 0;
|
||||
toReturn.maxX = 1;
|
||||
toReturn.maxZ = 1;
|
||||
break;
|
||||
}
|
||||
case NORTH:
|
||||
{
|
||||
toReturn.minZ = -0.01;
|
||||
toReturn.maxZ = 0;
|
||||
|
||||
toReturn.minX = 0;
|
||||
toReturn.minY = 0;
|
||||
toReturn.maxX = 1;
|
||||
toReturn.maxY = 1;
|
||||
break;
|
||||
}
|
||||
case SOUTH:
|
||||
{
|
||||
toReturn.minZ = 1;
|
||||
toReturn.maxZ = 1.01;
|
||||
|
||||
toReturn.minX = 0;
|
||||
toReturn.minY = 0;
|
||||
toReturn.maxX = 1;
|
||||
toReturn.maxY = 1;
|
||||
break;
|
||||
}
|
||||
case WEST:
|
||||
{
|
||||
toReturn.minX = -0.01;
|
||||
toReturn.maxX = 0;
|
||||
|
||||
toReturn.minY = 0;
|
||||
toReturn.minZ = 0;
|
||||
toReturn.maxY = 1;
|
||||
toReturn.maxZ = 1;
|
||||
break;
|
||||
}
|
||||
case EAST:
|
||||
{
|
||||
toReturn.minX = 1;
|
||||
toReturn.maxX = 1.01;
|
||||
|
||||
toReturn.minY = 0;
|
||||
toReturn.minZ = 0;
|
||||
toReturn.maxY = 1;
|
||||
toReturn.maxZ = 1;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
MekanismRenderer.renderObject(toReturn);
|
||||
display.endList();
|
||||
|
||||
return display;
|
||||
}
|
||||
|
||||
public void resetDisplayInts()
|
||||
{
|
||||
cachedLiquids.clear();
|
||||
cachedOverlays.clear();
|
||||
}
|
||||
*/
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
package mekanism.client.render.transmitter;
|
||||
|
||||
import mcmultipart.multipart.IMultipart;
|
||||
import mekanism.api.MekanismConfig.client;
|
||||
import mekanism.client.render.MekanismRenderer;
|
||||
import mekanism.common.ColourRGBA;
|
||||
import mekanism.common.multipart.PartUniversalCable;
|
||||
@@ -20,7 +20,7 @@ public class RenderUniversalCable extends RenderTransmitterBase<PartUniversalCab
|
||||
@Override
|
||||
public void renderMultipartAt(PartUniversalCable cable, double x, double y, double z, float partialTick, int destroyStage)
|
||||
{
|
||||
if(cable.currentPower == 0)
|
||||
if(!client.fancyUniversalCableRender || cable.currentPower == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -12,11 +12,9 @@ import mekanism.common.content.transporter.TransporterStack;
|
||||
import mekanism.common.network.PacketTileEntity.TileEntityMessage;
|
||||
import mekanism.common.util.LangUtils;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
//import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
|
||||
public class PartDiversionTransporter extends PartLogisticalTransporter
|
||||
@@ -34,24 +32,6 @@ public class PartDiversionTransporter extends PartLogisticalTransporter
|
||||
{
|
||||
return TransmitterType.DIVERSION_TRANSPORTER;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TextureAtlasSprite getCenterIcon(boolean opaque)
|
||||
{
|
||||
return transporterIcons.getCenterIcon(5);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TextureAtlasSprite getSideIcon(boolean opaque)
|
||||
{
|
||||
return transporterIcons.getSideIcon(opaque ? 14 : (getTransmitter().color != null ? 11 : 10));
|
||||
}
|
||||
|
||||
@Override
|
||||
public TextureAtlasSprite getSideIconRotated(boolean opaque)
|
||||
{
|
||||
return transporterIcons.getSideIcon(opaque ? 15 : (getTransmitter().color != null ? 13 : 12));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderCenter()
|
||||
|
||||
@@ -26,9 +26,6 @@ import mekanism.common.util.LangUtils;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
import mekanism.common.util.TransporterUtils;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
//import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -38,7 +35,6 @@ import net.minecraft.network.PacketBuffer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
//import net.minecraft.util.IIcon;
|
||||
import net.minecraftforge.common.capabilities.Capability;
|
||||
import net.minecraftforge.common.property.IExtendedBlockState;
|
||||
import net.minecraftforge.common.util.Constants.NBT;
|
||||
@@ -47,8 +43,6 @@ public class PartLogisticalTransporter extends PartTransmitter<IInventory, Inven
|
||||
{
|
||||
public Tier.TransporterTier tier = Tier.TransporterTier.BASIC;
|
||||
|
||||
public static TransmitterIcons transporterIcons = new TransmitterIcons(8, 16);
|
||||
|
||||
public int pullDelay = 0;
|
||||
|
||||
public PartLogisticalTransporter(TransporterTier transporterTier)
|
||||
@@ -80,16 +74,6 @@ public class PartLogisticalTransporter extends PartTransmitter<IInventory, Inven
|
||||
return TransmissionType.ITEM;
|
||||
}
|
||||
|
||||
public static void registerIcons(TextureMap register)
|
||||
{
|
||||
transporterIcons.registerCenterIcons(register, new String[] {"LogisticalTransporterBasic", "LogisticalTransporterAdvanced", "LogisticalTransporterElite", "LogisticalTransporterUltimate", "RestrictiveTransporter",
|
||||
"DiversionTransporter", "LogisticalTransporterGlass", "LogisticalTransporterGlassColored"});
|
||||
transporterIcons.registerSideIcons(register, new String[] {"LogisticalTransporterVerticalBasic", "LogisticalTransporterVerticalAdvanced", "LogisticalTransporterVerticalElite", "LogisticalTransporterVerticalUltimate",
|
||||
"LogisticalTransporterHorizontalBasic", "LogisticalTransporterHorizontalAdvanced", "LogisticalTransporterHorizontalElite", "LogisticalTransporterHorizontalUltimate", "RestrictiveTransporterVertical",
|
||||
"RestrictiveTransporterHorizontal", "LogisticalTransporterVerticalGlass", "LogisticalTransporterVerticalGlassColored", "LogisticalTransporterHorizontalGlass", "LogisticalTransporterHorizontalGlassColored",
|
||||
"DiversionTransporterVertical", "DiversionTransporterHorizontal"});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onWorldSeparate()
|
||||
{
|
||||
@@ -114,24 +98,6 @@ public class PartLogisticalTransporter extends PartTransmitter<IInventory, Inven
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TextureAtlasSprite getCenterIcon(boolean opaque)
|
||||
{
|
||||
return transporterIcons.getCenterIcon(opaque ? tier.ordinal() : (getTransmitter().color != null ? 7 : 6));
|
||||
}
|
||||
|
||||
@Override
|
||||
public TextureAtlasSprite getSideIcon(boolean opaque)
|
||||
{
|
||||
return transporterIcons.getSideIcon(opaque ? tier.ordinal() : (getTransmitter().color != null ? 11 : 10));
|
||||
}
|
||||
|
||||
@Override
|
||||
public TextureAtlasSprite getSideIconRotated(boolean opaque)
|
||||
{
|
||||
return transporterIcons.getSideIcon(opaque ? 4+tier.ordinal() : (getTransmitter().color != null ? 13 : 12));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValidAcceptor(TileEntity tile, EnumFacing side)
|
||||
{
|
||||
|
||||
@@ -8,13 +8,9 @@ import mekanism.common.Tier;
|
||||
import mekanism.common.Tier.BaseTier;
|
||||
import mekanism.common.Tier.PipeTier;
|
||||
import mekanism.common.util.PipeUtils;
|
||||
//import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.network.PacketBuffer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
//import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidContainerRegistry;
|
||||
@@ -25,8 +21,6 @@ import net.minecraftforge.fluids.IFluidHandler;
|
||||
|
||||
public class PartMechanicalPipe extends PartTransmitter<IFluidHandler, FluidNetwork> implements IFluidHandler
|
||||
{
|
||||
public static TransmitterIcons pipeIcons = new TransmitterIcons(4, 8);
|
||||
|
||||
public float currentScale;
|
||||
|
||||
public FluidTank buffer = new FluidTank(FluidContainerRegistry.BUCKET_VOLUME);
|
||||
@@ -164,31 +158,6 @@ public class PartMechanicalPipe extends PartTransmitter<IFluidHandler, FluidNetw
|
||||
return "mekanism:mechanical_pipe_" + tier.name().toLowerCase();
|
||||
}
|
||||
|
||||
public static void registerIcons(TextureMap register)
|
||||
{
|
||||
pipeIcons.registerCenterIcons(register, new String[] {"MechanicalPipeBasic", "MechanicalPipeAdvanced", "MechanicalPipeElite", "MechanicalPipeUltimate"});
|
||||
pipeIcons.registerSideIcons(register, new String[] {"MechanicalPipeVerticalBasic", "MechanicalPipeVerticalAdvanced", "MechanicalPipeVerticalElite", "MechanicalPipeVerticalUltimate",
|
||||
"MechanicalPipeHorizontalBasic", "MechanicalPipeHorizontalAdvanced", "MechanicalPipeHorizontalElite", "MechanicalPipeHorizontalUltimate"});
|
||||
}
|
||||
|
||||
@Override
|
||||
public TextureAtlasSprite getCenterIcon(boolean opaque)
|
||||
{
|
||||
return pipeIcons.getCenterIcon(tier.ordinal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public TextureAtlasSprite getSideIcon(boolean opaque)
|
||||
{
|
||||
return pipeIcons.getSideIcon(tier.ordinal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public TextureAtlasSprite getSideIconRotated(boolean opaque)
|
||||
{
|
||||
return pipeIcons.getSideIcon(4+tier.ordinal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public TransmissionType getTransmissionType()
|
||||
{
|
||||
@@ -219,18 +188,6 @@ public class PartMechanicalPipe extends PartTransmitter<IFluidHandler, FluidNetw
|
||||
return new FluidNetwork(networks);
|
||||
}
|
||||
|
||||
/*
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void renderDynamic(Vector3 pos, float f, int pass)
|
||||
{
|
||||
if(pass == 0)
|
||||
{
|
||||
RenderPartTransmitter.getInstance().renderContents(this, pos);
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
@Override
|
||||
public int getCapacity()
|
||||
{
|
||||
|
||||
@@ -14,27 +14,16 @@ import mekanism.common.Tier.BaseTier;
|
||||
import mekanism.common.Tier.TubeTier;
|
||||
import mekanism.common.capabilities.Capabilities;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
//import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.network.PacketBuffer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
//import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
/*
|
||||
import codechicken.lib.data.MCDataInput;
|
||||
import codechicken.lib.data.MCDataOutput;
|
||||
import codechicken.lib.vec.Vector3;
|
||||
*/
|
||||
import net.minecraftforge.common.capabilities.Capability;
|
||||
|
||||
public class PartPressurizedTube extends PartTransmitter<IGasHandler, GasNetwork> implements IGasHandler
|
||||
{
|
||||
public Tier.TubeTier tier = Tier.TubeTier.BASIC;
|
||||
|
||||
public static TransmitterIcons tubeIcons = new TransmitterIcons(4, 8);
|
||||
|
||||
public float currentScale;
|
||||
|
||||
public GasTank buffer = new GasTank(getCapacity());
|
||||
@@ -178,31 +167,6 @@ public class PartPressurizedTube extends PartTransmitter<IGasHandler, GasNetwork
|
||||
return "mekanism:pressurized_tube_" + tier.name().toLowerCase();
|
||||
}
|
||||
|
||||
public static void registerIcons(TextureMap register)
|
||||
{
|
||||
tubeIcons.registerCenterIcons(register, new String[] {"PressurizedTubeBasic", "PressurizedTubeAdvanced", "PressurizedTubeElite", "PressurizedTubeUltimate"});
|
||||
tubeIcons.registerSideIcons(register, new String[] {"PressurizedTubeVerticalBasic", "PressurizedTubeVerticalAdvanced", "PressurizedTubeVerticalElite", "PressurizedTubeVerticalUltimate",
|
||||
"PressurizedTubeHorizontalBasic", "PressurizedTubeHorizontalAdvanced", "PressurizedTubeHorizontalElite", "PressurizedTubeHorizontalUltimate"});
|
||||
}
|
||||
|
||||
@Override
|
||||
public TextureAtlasSprite getCenterIcon(boolean opaque)
|
||||
{
|
||||
return tubeIcons.getCenterIcon(tier.ordinal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public TextureAtlasSprite getSideIcon(boolean opaque)
|
||||
{
|
||||
return tubeIcons.getSideIcon(tier.ordinal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public TextureAtlasSprite getSideIconRotated(boolean opaque)
|
||||
{
|
||||
return tubeIcons.getSideIcon(4+tier.ordinal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public TransmissionType getTransmissionType()
|
||||
{
|
||||
@@ -233,18 +197,6 @@ public class PartPressurizedTube extends PartTransmitter<IGasHandler, GasNetwork
|
||||
return new GasNetwork(networks);
|
||||
}
|
||||
|
||||
/*
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void renderDynamic(Vector3 pos, float f, int pass)
|
||||
{
|
||||
if(pass == 0)
|
||||
{
|
||||
RenderPartTransmitter.getInstance().renderContents(this, pos);
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
@Override
|
||||
public int getCapacity()
|
||||
{
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
package mekanism.common.multipart;
|
||||
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
//import net.minecraft.util.IIcon;
|
||||
|
||||
public class PartRestrictiveTransporter extends PartLogisticalTransporter
|
||||
{
|
||||
@@ -19,24 +17,6 @@ public class PartRestrictiveTransporter extends PartLogisticalTransporter
|
||||
return TransmitterType.RESTRICTIVE_TRANSPORTER;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TextureAtlasSprite getCenterIcon(boolean opaque)
|
||||
{
|
||||
return transporterIcons.getCenterIcon(4);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TextureAtlasSprite getSideIcon(boolean opaque)
|
||||
{
|
||||
return transporterIcons.getSideIcon(8);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TextureAtlasSprite getSideIconRotated(boolean opaque)
|
||||
{
|
||||
return transporterIcons.getSideIcon(9);
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getCost()
|
||||
{
|
||||
|
||||
@@ -162,12 +162,6 @@ public abstract class PartSidedPipe extends Multipart implements IOccludingPart,
|
||||
return (byte)((connections & ~(byte)(1 << side.ordinal())) | (byte)((toSet ? 1 : 0) << side.ordinal()));
|
||||
}
|
||||
|
||||
public abstract TextureAtlasSprite getCenterIcon(boolean opaque);
|
||||
|
||||
public abstract TextureAtlasSprite getSideIcon(boolean opaque);
|
||||
|
||||
public abstract TextureAtlasSprite getSideIconRotated(boolean opaque);
|
||||
|
||||
@Override
|
||||
public void update()
|
||||
{
|
||||
@@ -215,40 +209,6 @@ public abstract class PartSidedPipe extends Multipart implements IOccludingPart,
|
||||
return false;
|
||||
}
|
||||
|
||||
public TextureAtlasSprite getIconForSide(EnumFacing side, boolean opaque)
|
||||
{
|
||||
ConnectionType type = getConnectionType(side);
|
||||
|
||||
if(type == ConnectionType.NONE)
|
||||
{
|
||||
if(client.oldTransmitterRender || renderCenter())
|
||||
{
|
||||
return getCenterIcon(opaque);
|
||||
}
|
||||
else if(getAllCurrentConnections() == 3 && side != EnumFacing.DOWN && side != EnumFacing.UP)
|
||||
{
|
||||
return getSideIcon(opaque);
|
||||
}
|
||||
else if(getAllCurrentConnections() == 12 && (side == EnumFacing.DOWN || side == EnumFacing.UP))
|
||||
{
|
||||
return getSideIcon(opaque);
|
||||
}
|
||||
else if(getAllCurrentConnections() == 12 && (side == EnumFacing.EAST || side == EnumFacing.WEST))
|
||||
{
|
||||
return getSideIconRotated(opaque);
|
||||
}
|
||||
else if(getAllCurrentConnections() == 48 && side != EnumFacing.EAST && side != EnumFacing.WEST)
|
||||
{
|
||||
return getSideIconRotated(opaque);
|
||||
}
|
||||
|
||||
return getCenterIcon(opaque);
|
||||
}
|
||||
else {
|
||||
return getSideIcon(opaque);
|
||||
}
|
||||
}
|
||||
|
||||
public byte getPossibleTransmitterConnections()
|
||||
{
|
||||
byte connections = 0x00;
|
||||
|
||||
@@ -12,24 +12,20 @@ import mekanism.common.Tier.ConductorTier;
|
||||
import mekanism.common.capabilities.Capabilities;
|
||||
import mekanism.common.util.HeatUtils;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
//import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.network.PacketBuffer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
//import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
|
||||
public class PartThermodynamicConductor extends PartTransmitter<IHeatTransfer, HeatNetwork> implements IHeatTransfer
|
||||
{
|
||||
public Tier.ConductorTier tier;
|
||||
|
||||
public static TransmitterIcons conductorIcons = new TransmitterIcons(4, 8);
|
||||
|
||||
public double temperature = 0;
|
||||
public double clientTemperature = 0;
|
||||
public double heatToAbsorb = 0;
|
||||
|
||||
public boolean renderUpdate;
|
||||
|
||||
public PartThermodynamicConductor(Tier.ConductorTier conductorTier)
|
||||
{
|
||||
@@ -67,32 +63,6 @@ public class PartThermodynamicConductor extends PartTransmitter<IHeatTransfer, H
|
||||
@Override
|
||||
public void updateShare() {}
|
||||
|
||||
public static void registerIcons(TextureMap register)
|
||||
{
|
||||
conductorIcons.registerCenterIcons(register, new String[] {"ThermodynamicConductorBasic", "ThermodynamicConductorAdvanced",
|
||||
"ThermodynamicConductorElite", "ThermodynamicConductorUltimate"});
|
||||
conductorIcons.registerSideIcons(register, new String[] {"ThermodynamicConductorVerticalBasic", "ThermodynamicConductorVerticalAdvanced", "ThermodynamicConductorVerticalElite", "ThermodynamicConductorVerticalUltimate",
|
||||
"ThermodynamicConductorHorizontalBasic", "ThermodynamicConductorHorizontalAdvanced", "ThermodynamicConductorHorizontalElite", "ThermodynamicConductorHorizontalUltimate"});
|
||||
}
|
||||
|
||||
@Override
|
||||
public TextureAtlasSprite getCenterIcon(boolean opaque)
|
||||
{
|
||||
return conductorIcons.getCenterIcon(tier.ordinal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public TextureAtlasSprite getSideIcon(boolean opaque)
|
||||
{
|
||||
return conductorIcons.getSideIcon(tier.ordinal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public TextureAtlasSprite getSideIconRotated(boolean opaque)
|
||||
{
|
||||
return conductorIcons.getSideIcon(4+tier.ordinal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public TransmitterType getTransmitterType()
|
||||
{
|
||||
@@ -117,18 +87,6 @@ public class PartThermodynamicConductor extends PartTransmitter<IHeatTransfer, H
|
||||
return "mekanism:thermodynamic_conductor_" + tier.name().toLowerCase();
|
||||
}
|
||||
|
||||
/*
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void renderDynamic(Vector3 pos, float f, int pass)
|
||||
{
|
||||
if(pass == 0)
|
||||
{
|
||||
RenderPartTransmitter.getInstance().renderContents(this, pos);
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbtTags)
|
||||
{
|
||||
@@ -147,21 +105,27 @@ public class PartThermodynamicConductor extends PartTransmitter<IHeatTransfer, H
|
||||
|
||||
public void sendTemp()
|
||||
{
|
||||
/*
|
||||
PacketBuffer packet = getWriteStream();
|
||||
packet.writeBoolean(true);
|
||||
packet.writeDouble(temperature);
|
||||
*/
|
||||
renderUpdate = true;
|
||||
sendUpdatePacket();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeUpdatePacket(PacketBuffer packet)
|
||||
{
|
||||
packet.writeBoolean(false);
|
||||
|
||||
super.writeUpdatePacket(packet);
|
||||
|
||||
packet.writeInt(tier.ordinal());
|
||||
if(renderUpdate)
|
||||
{
|
||||
packet.writeBoolean(true);
|
||||
packet.writeDouble(temperature);
|
||||
|
||||
renderUpdate = false;
|
||||
}
|
||||
else {
|
||||
packet.writeBoolean(false);
|
||||
|
||||
super.writeUpdatePacket(packet);
|
||||
|
||||
packet.writeInt(tier.ordinal());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -18,20 +18,11 @@ import mekanism.common.base.EnergyAcceptorWrapper;
|
||||
import mekanism.common.capabilities.Capabilities;
|
||||
import mekanism.common.util.CableUtils;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
//import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.network.PacketBuffer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
//import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraftforge.common.capabilities.Capability;
|
||||
/*
|
||||
import codechicken.lib.data.MCDataInput;
|
||||
import codechicken.lib.data.MCDataOutput;
|
||||
import codechicken.lib.vec.Vector3;
|
||||
*/
|
||||
import cofh.api.energy.IEnergyHandler;
|
||||
import cofh.api.energy.IEnergyProvider;
|
||||
|
||||
@@ -39,8 +30,6 @@ public class PartUniversalCable extends PartTransmitter<EnergyAcceptorWrapper, E
|
||||
{
|
||||
public Tier.CableTier tier;
|
||||
|
||||
public static TransmitterIcons cableIcons = new TransmitterIcons(4, 8);
|
||||
|
||||
public double currentPower = 0;
|
||||
public double lastWrite = 0;
|
||||
|
||||
@@ -183,32 +172,6 @@ public class PartUniversalCable extends PartTransmitter<EnergyAcceptorWrapper, E
|
||||
return "mekanism:universal_cable_" + tier.name().toLowerCase();
|
||||
}
|
||||
|
||||
public static void registerIcons(TextureMap register)
|
||||
{
|
||||
cableIcons.registerCenterIcons(register, new String[] {"UniversalCableBasic", "UniversalCableAdvanced",
|
||||
"UniversalCableElite", "UniversalCableUltimate"});
|
||||
cableIcons.registerSideIcons(register, new String[] {"UniversalCableVerticalBasic", "UniversalCableVerticalAdvanced", "UniversalCableVerticalElite", "UniversalCableVerticalUltimate",
|
||||
"UniversalCableHorizontalBasic", "UniversalCableHorizontalAdvanced", "UniversalCableHorizontalElite", "UniversalCableHorizontalUltimate"});
|
||||
}
|
||||
|
||||
@Override
|
||||
public TextureAtlasSprite getCenterIcon(boolean opaque)
|
||||
{
|
||||
return cableIcons.getCenterIcon(tier.ordinal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public TextureAtlasSprite getSideIcon(boolean opaque)
|
||||
{
|
||||
return cableIcons.getSideIcon(tier.ordinal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public TextureAtlasSprite getSideIconRotated(boolean opaque)
|
||||
{
|
||||
return cableIcons.getSideIcon(4+tier.ordinal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public TransmissionType getTransmissionType()
|
||||
{
|
||||
@@ -227,18 +190,6 @@ public class PartUniversalCable extends PartTransmitter<EnergyAcceptorWrapper, E
|
||||
return CableUtils.isValidAcceptorOnSide(getWorld().getTileEntity(getPos()), acceptor, side);
|
||||
}
|
||||
|
||||
/*
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void renderDynamic(Vector3 pos, float frame, int pass)
|
||||
{
|
||||
if(pass == 0 && client.fancyUniversalCableRender)
|
||||
{
|
||||
RenderPartTransmitter.getInstance().renderContents(this, pos);
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
@Override
|
||||
public EnergyNetwork createNewNetwork()
|
||||
{
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
package mekanism.common.multipart;
|
||||
|
||||
import mcmultipart.microblock.BlockMicroMaterial;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
|
||||
public class PlasticMicroMaterial extends BlockMicroMaterial
|
||||
{
|
||||
public PlasticMicroMaterial(IBlockState state, int hardness)
|
||||
{
|
||||
super(state, hardness);
|
||||
}
|
||||
|
||||
/*
|
||||
@Override
|
||||
public int getColour(int pass)
|
||||
{
|
||||
return block().getRenderColor(meta()) << 8 | 0xFF;
|
||||
}
|
||||
*/
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
package mekanism.common.multipart;
|
||||
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class TransmitterIcons
|
||||
{
|
||||
private TextureAtlasSprite[] sideIcons;
|
||||
private TextureAtlasSprite[] centerIcons;
|
||||
|
||||
public TransmitterIcons(int numCentres, int numSides)
|
||||
{
|
||||
sideIcons = new TextureAtlasSprite[numSides];
|
||||
centerIcons = new TextureAtlasSprite[numCentres];
|
||||
}
|
||||
|
||||
public void registerCenterIcons(TextureMap register, String[] filenames)
|
||||
{
|
||||
for(int i = 0; i < centerIcons.length; i++)
|
||||
{
|
||||
centerIcons[i] = register.registerSprite(new ResourceLocation("mekanism:models/" + filenames[i]));
|
||||
}
|
||||
}
|
||||
|
||||
public void registerSideIcons(TextureMap register, String[] filenames)
|
||||
{
|
||||
for(int i = 0; i < sideIcons.length; i++)
|
||||
{
|
||||
sideIcons[i] = register.registerSprite(new ResourceLocation("mekanism:models/" + filenames[i]));
|
||||
}
|
||||
}
|
||||
|
||||
public TextureAtlasSprite getSideIcon(int n)
|
||||
{
|
||||
return sideIcons[n];
|
||||
}
|
||||
|
||||
public TextureAtlasSprite getCenterIcon(int n)
|
||||
{
|
||||
return centerIcons[n];
|
||||
}
|
||||
}
|
||||
@@ -2,48 +2,45 @@ package mekanism.common.multipart;
|
||||
|
||||
import mekanism.api.transmitters.TransmissionType;
|
||||
import mekanism.common.Tier.BaseTier;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
|
||||
public enum TransmitterType
|
||||
{
|
||||
UNIVERSAL_CABLE_BASIC("BasicUniversalCable", BaseTier.BASIC, Size.SMALL, TransmissionType.ENERGY, PartUniversalCable.cableIcons, false, 0, 0),
|
||||
UNIVERSAL_CABLE_ADVANCED("AdvancedUniversalCable", BaseTier.ADVANCED, Size.SMALL, TransmissionType.ENERGY, PartUniversalCable.cableIcons, false, 1, 1),
|
||||
UNIVERSAL_CABLE_ELITE("EliteUniversalCable", BaseTier.ELITE, Size.SMALL, TransmissionType.ENERGY, PartUniversalCable.cableIcons, false, 2, 2),
|
||||
UNIVERSAL_CABLE_ULTIMATE("UltimateUniversalCable", BaseTier.ULTIMATE, Size.SMALL, TransmissionType.ENERGY, PartUniversalCable.cableIcons, false, 3, 3),
|
||||
MECHANICAL_PIPE_BASIC("BasicMechanicalPipe", BaseTier.BASIC, Size.LARGE, TransmissionType.FLUID, PartMechanicalPipe.pipeIcons, false, 0, 0),
|
||||
MECHANICAL_PIPE_ADVANCED("AdvancedMechanicalPipe", BaseTier.ADVANCED, Size.LARGE, TransmissionType.FLUID, PartMechanicalPipe.pipeIcons, false, 1, 1),
|
||||
MECHANICAL_PIPE_ELITE("EliteMechanicalPipe", BaseTier.ELITE, Size.LARGE, TransmissionType.FLUID, PartMechanicalPipe.pipeIcons, false, 2, 2),
|
||||
MECHANICAL_PIPE_ULTIMATE("UltimateMechanicalPipe", BaseTier.ULTIMATE, Size.LARGE, TransmissionType.FLUID, PartMechanicalPipe.pipeIcons, false, 3, 3),
|
||||
PRESSURIZED_TUBE_BASIC("BasicPressurizedTube", BaseTier.BASIC, Size.SMALL, TransmissionType.GAS, PartPressurizedTube.tubeIcons, false, 0, 0),
|
||||
PRESSURIZED_TUBE_ADVANCED("AdvancedPressurizedTube", BaseTier.ADVANCED, Size.SMALL, TransmissionType.GAS, PartPressurizedTube.tubeIcons, false, 1, 1),
|
||||
PRESSURIZED_TUBE_ELITE("ElitePressurizedTube", BaseTier.ELITE, Size.SMALL, TransmissionType.GAS, PartPressurizedTube.tubeIcons, false, 2, 2),
|
||||
PRESSURIZED_TUBE_ULTIMATE("UltimatePressurizedTube", BaseTier.ULTIMATE, Size.SMALL, TransmissionType.GAS, PartPressurizedTube.tubeIcons, false, 3, 3),
|
||||
LOGISTICAL_TRANSPORTER_BASIC("BasicLogisticalTransporter", BaseTier.BASIC, Size.LARGE, TransmissionType.ITEM, PartLogisticalTransporter.transporterIcons, true, 0, 0, 6, 10),
|
||||
LOGISTICAL_TRANSPORTER_ADVANCED("AdvancedLogisticalTransporter", BaseTier.ADVANCED, Size.LARGE, TransmissionType.ITEM, PartLogisticalTransporter.transporterIcons, true, 1, 1, 6, 10),
|
||||
LOGISTICAL_TRANSPORTER_ELITE("EliteLogisticalTransporter", BaseTier.ELITE, Size.LARGE, TransmissionType.ITEM, PartLogisticalTransporter.transporterIcons, true, 2, 2, 6, 10),
|
||||
LOGISTICAL_TRANSPORTER_ULTIMATE("UltimateLogisticalTransporter", BaseTier.ULTIMATE, Size.LARGE, TransmissionType.ITEM, PartLogisticalTransporter.transporterIcons, true, 3, 3, 6, 10),
|
||||
RESTRICTIVE_TRANSPORTER("RestrictiveTransporter", BaseTier.BASIC, Size.LARGE, TransmissionType.ITEM, PartLogisticalTransporter.transporterIcons, false, 4, 8),
|
||||
DIVERSION_TRANSPORTER("DiversionTransporter", BaseTier.BASIC, Size.LARGE, TransmissionType.ITEM, PartLogisticalTransporter.transporterIcons, true, 5, 14, 6, 10),
|
||||
THERMODYNAMIC_CONDUCTOR_BASIC("BasicThermodynamicConductor", BaseTier.BASIC, Size.SMALL, TransmissionType.HEAT, PartThermodynamicConductor.conductorIcons, false, 0, 0),
|
||||
THERMODYNAMIC_CONDUCTOR_ADVANCED("AdvancedThermodynamicConductor", BaseTier.ADVANCED, Size.SMALL, TransmissionType.HEAT, PartThermodynamicConductor.conductorIcons, false, 1, 1),
|
||||
THERMODYNAMIC_CONDUCTOR_ELITE("EliteThermodynamicConductor", BaseTier.ELITE, Size.SMALL, TransmissionType.HEAT, PartThermodynamicConductor.conductorIcons, false, 2, 2),
|
||||
THERMODYNAMIC_CONDUCTOR_ULTIMATE("UltimateThermodynamicConductor", BaseTier.ULTIMATE, Size.SMALL, TransmissionType.HEAT, PartThermodynamicConductor.conductorIcons, false, 3, 3);
|
||||
UNIVERSAL_CABLE_BASIC("BasicUniversalCable", BaseTier.BASIC, Size.SMALL, TransmissionType.ENERGY, false, 0, 0),
|
||||
UNIVERSAL_CABLE_ADVANCED("AdvancedUniversalCable", BaseTier.ADVANCED, Size.SMALL, TransmissionType.ENERGY, false, 1, 1),
|
||||
UNIVERSAL_CABLE_ELITE("EliteUniversalCable", BaseTier.ELITE, Size.SMALL, TransmissionType.ENERGY, false, 2, 2),
|
||||
UNIVERSAL_CABLE_ULTIMATE("UltimateUniversalCable", BaseTier.ULTIMATE, Size.SMALL, TransmissionType.ENERGY, false, 3, 3),
|
||||
MECHANICAL_PIPE_BASIC("BasicMechanicalPipe", BaseTier.BASIC, Size.LARGE, TransmissionType.FLUID, false, 0, 0),
|
||||
MECHANICAL_PIPE_ADVANCED("AdvancedMechanicalPipe", BaseTier.ADVANCED, Size.LARGE, TransmissionType.FLUID, false, 1, 1),
|
||||
MECHANICAL_PIPE_ELITE("EliteMechanicalPipe", BaseTier.ELITE, Size.LARGE, TransmissionType.FLUID, false, 2, 2),
|
||||
MECHANICAL_PIPE_ULTIMATE("UltimateMechanicalPipe", BaseTier.ULTIMATE, Size.LARGE, TransmissionType.FLUID, false, 3, 3),
|
||||
PRESSURIZED_TUBE_BASIC("BasicPressurizedTube", BaseTier.BASIC, Size.SMALL, TransmissionType.GAS, false, 0, 0),
|
||||
PRESSURIZED_TUBE_ADVANCED("AdvancedPressurizedTube", BaseTier.ADVANCED, Size.SMALL, TransmissionType.GAS, false, 1, 1),
|
||||
PRESSURIZED_TUBE_ELITE("ElitePressurizedTube", BaseTier.ELITE, Size.SMALL, TransmissionType.GAS, false, 2, 2),
|
||||
PRESSURIZED_TUBE_ULTIMATE("UltimatePressurizedTube", BaseTier.ULTIMATE, Size.SMALL, TransmissionType.GAS, false, 3, 3),
|
||||
LOGISTICAL_TRANSPORTER_BASIC("BasicLogisticalTransporter", BaseTier.BASIC, Size.LARGE, TransmissionType.ITEM, true, 0, 0, 6, 10),
|
||||
LOGISTICAL_TRANSPORTER_ADVANCED("AdvancedLogisticalTransporter", BaseTier.ADVANCED, Size.LARGE, TransmissionType.ITEM, true, 1, 1, 6, 10),
|
||||
LOGISTICAL_TRANSPORTER_ELITE("EliteLogisticalTransporter", BaseTier.ELITE, Size.LARGE, TransmissionType.ITEM, true, 2, 2, 6, 10),
|
||||
LOGISTICAL_TRANSPORTER_ULTIMATE("UltimateLogisticalTransporter", BaseTier.ULTIMATE, Size.LARGE, TransmissionType.ITEM, true, 3, 3, 6, 10),
|
||||
RESTRICTIVE_TRANSPORTER("RestrictiveTransporter", BaseTier.BASIC, Size.LARGE, TransmissionType.ITEM, false, 4, 8),
|
||||
DIVERSION_TRANSPORTER("DiversionTransporter", BaseTier.BASIC, Size.LARGE, TransmissionType.ITEM, true, 5, 14, 6, 10),
|
||||
THERMODYNAMIC_CONDUCTOR_BASIC("BasicThermodynamicConductor", BaseTier.BASIC, Size.SMALL, TransmissionType.HEAT, false, 0, 0),
|
||||
THERMODYNAMIC_CONDUCTOR_ADVANCED("AdvancedThermodynamicConductor", BaseTier.ADVANCED, Size.SMALL, TransmissionType.HEAT, false, 1, 1),
|
||||
THERMODYNAMIC_CONDUCTOR_ELITE("EliteThermodynamicConductor", BaseTier.ELITE, Size.SMALL, TransmissionType.HEAT, false, 2, 2),
|
||||
THERMODYNAMIC_CONDUCTOR_ULTIMATE("UltimateThermodynamicConductor", BaseTier.ULTIMATE, Size.SMALL, TransmissionType.HEAT, false, 3, 3);
|
||||
|
||||
private String unlocalizedName;
|
||||
private Size size;
|
||||
private TransmissionType transmissionType;
|
||||
private TransmitterIcons transmitterIcons;
|
||||
private boolean transparencyRender;
|
||||
private int[] indexes;
|
||||
private BaseTier tier;
|
||||
|
||||
private TransmitterType(String name, BaseTier t, Size s, TransmissionType type, TransmitterIcons icons, boolean transparency, int... is)
|
||||
private TransmitterType(String name, BaseTier t, Size s, TransmissionType type, boolean transparency, int... is)
|
||||
{
|
||||
unlocalizedName = name;
|
||||
tier = t;
|
||||
size = s;
|
||||
transmissionType = type;
|
||||
transmitterIcons = icons;
|
||||
transparencyRender = transparency;
|
||||
indexes = is;
|
||||
}
|
||||
@@ -73,28 +70,6 @@ public enum TransmitterType
|
||||
return transmissionType;
|
||||
}
|
||||
|
||||
public TextureAtlasSprite getCenterIcon(boolean opaque)
|
||||
{
|
||||
if(!transparencyRender)
|
||||
{
|
||||
return transmitterIcons.getCenterIcon(indexes[0]);
|
||||
}
|
||||
else {
|
||||
return transmitterIcons.getCenterIcon(opaque ? indexes[0] : indexes[2]);
|
||||
}
|
||||
}
|
||||
|
||||
public TextureAtlasSprite getSideIcon(boolean opaque)
|
||||
{
|
||||
if(!transparencyRender)
|
||||
{
|
||||
return transmitterIcons.getSideIcon(indexes[1]);
|
||||
}
|
||||
else {
|
||||
return transmitterIcons.getSideIcon(opaque ? indexes[1] : indexes[3]);
|
||||
}
|
||||
}
|
||||
|
||||
public static enum Size
|
||||
{
|
||||
SMALL(6),
|
||||
|
||||
Reference in new issue
Block a user