Work on transmitters

This commit is contained in:
Aidan C. Brady 2014-06-08 01:17:47 +02:00
parent b387c8529d
commit c72e1c6efc
7 changed files with 31 additions and 12 deletions

View file

@ -1,5 +1,5 @@
minecraft_version=1.7.2 minecraft_version=1.7.2
forge_version=10.12.1.1060 forge_version=10.12.1.1065
FMP_version=1.1.0.275 FMP_version=1.1.0.275
CCLIB_version=1.1.0.76 CCLIB_version=1.1.0.76
NEI_version=rc2 NEI_version=rc2

View file

@ -7,6 +7,7 @@ import mekanism.api.Coord4D;
import mekanism.client.model.ModelTransporterBox; import mekanism.client.model.ModelTransporterBox;
import mekanism.client.render.MekanismRenderer.DisplayInteger; import mekanism.client.render.MekanismRenderer.DisplayInteger;
import mekanism.client.render.MekanismRenderer.Model3D; import mekanism.client.render.MekanismRenderer.Model3D;
import mekanism.common.Mekanism;
import mekanism.common.item.ItemConfigurator; import mekanism.common.item.ItemConfigurator;
import mekanism.common.multipart.PartDiversionTransporter; import mekanism.common.multipart.PartDiversionTransporter;
import mekanism.common.multipart.PartLogisticalTransporter; import mekanism.common.multipart.PartLogisticalTransporter;
@ -23,6 +24,7 @@ import mekanism.common.util.MekanismUtils;
import mekanism.common.util.MekanismUtils.ResourceType; import mekanism.common.util.MekanismUtils.ResourceType;
import mekanism.common.util.TransporterUtils; import mekanism.common.util.TransporterUtils;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.entity.RenderItem; import net.minecraft.client.renderer.entity.RenderItem;
import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.client.renderer.texture.IIconRegister;
@ -546,12 +548,24 @@ public class RenderPartTransmitter implements IIconSelfRegister
public void renderPart(IIcon icon, CCModel cc, double x, double y, double z, Colour color) public void renderPart(IIcon icon, CCModel cc, double x, double y, double z, Colour color)
{ {
cc.render(0, cc.verts.length, new Translation(x, y, z), new IconTransformation(icon), new ColourMultiplier(color.rgba())); if(color != null)
{
cc.render(0, cc.verts.length, new Translation(x, y, z), new IconTransformation(icon), new ColourMultiplier(color.rgba()));
}
else {
cc.render(0, cc.verts.length, new Translation(x, y, z), new IconTransformation(icon));
}
} }
public void renderTransparency(IIcon icon, CCModel cc, Colour color) public void renderTransparency(IIcon icon, CCModel cc, Colour color)
{ {
cc.render(0, cc.verts.length, new Translation(0, 0, 0), new IconTransformation(icon), new ColourMultiplier(color.rgba())); if(color != null)
{
cc.render(0, cc.verts.length, new Translation(0, 0, 0), new IconTransformation(icon), new ColourMultiplier(color.rgba()));
}
else {
cc.render(0, cc.verts.length, new Translation(0, 0, 0), new IconTransformation(icon));
}
} }
public CCModel getItemModel(ForgeDirection side, TransmitterType type) public CCModel getItemModel(ForgeDirection side, TransmitterType type)

View file

@ -414,8 +414,10 @@ public class ItemRenderingHandler implements IItemRenderer
{ {
GL11.glTranslated(-0.5, -0.5, -0.5); GL11.glTranslated(-0.5, -0.5, -0.5);
GL11.glDisable(GL11.GL_CULL_FACE); GL11.glDisable(GL11.GL_CULL_FACE);
MekanismRenderer.blendOn();
RenderPartTransmitter.getInstance().renderItem(TransmitterType.values()[item.getItemDamage()]); RenderPartTransmitter.getInstance().renderItem(TransmitterType.values()[item.getItemDamage()]);
GL11.glEnable(GL11.GL_CULL_FACE); GL11.glEnable(GL11.GL_CULL_FACE);
MekanismRenderer.blendOff();
} }
else if(item.getItem() instanceof ItemGlowPanel) else if(item.getItem() instanceof ItemGlowPanel)
{ {

View file

@ -933,6 +933,7 @@ public class Mekanism
FluidContainerRegistry.registerFluidContainer(FluidRegistry.getFluid("brine"), new ItemStack(BrineBucket), FluidContainerRegistry.EMPTY_BUCKET); FluidContainerRegistry.registerFluidContainer(FluidRegistry.getFluid("brine"), new ItemStack(BrineBucket), FluidContainerRegistry.EMPTY_BUCKET);
//Registrations //Registrations
GameRegistry.registerItem(PartTransmitter, "PartTransmitter");
GameRegistry.registerItem(ElectricBow, "ElectricBow"); GameRegistry.registerItem(ElectricBow, "ElectricBow");
GameRegistry.registerItem(Dust, "Dust"); GameRegistry.registerItem(Dust, "Dust");
GameRegistry.registerItem(Ingot, "Ingot"); GameRegistry.registerItem(Ingot, "Ingot");

View file

@ -112,27 +112,27 @@ public class ItemPartTransmitter extends JItemMultiPart
list.add("- " + EnumColor.PURPLE + "Joules " + EnumColor.GREY + "(Mekanism)"); list.add("- " + EnumColor.PURPLE + "Joules " + EnumColor.GREY + "(Mekanism)");
break; break;
} }
case 4: case 9: case 10: case 11: case 4: case 5: case 6: case 7:
{ {
list.add(EnumColor.DARK_GREY + "Capable of transferring:"); list.add(EnumColor.DARK_GREY + "Capable of transferring:");
list.add("- " + EnumColor.PURPLE + "mB " + EnumColor.GREY + "(FluidRegistry)"); list.add("- " + EnumColor.PURPLE + "mB " + EnumColor.GREY + "(FluidRegistry)");
break; break;
} }
case 5: case 8:
{ {
list.add(EnumColor.DARK_GREY + "Capable of transferring:"); list.add(EnumColor.DARK_GREY + "Capable of transferring:");
list.add("- " + EnumColor.PURPLE + "O " + EnumColor.GREY + "(Oxygen)"); list.add("- " + EnumColor.PURPLE + "O " + EnumColor.GREY + "(Oxygen)");
list.add("- " + EnumColor.PURPLE + "H " + EnumColor.GREY + "(Hydrogen)"); list.add("- " + EnumColor.PURPLE + "H " + EnumColor.GREY + "(Hydrogen)");
break; break;
} }
case 6: case 9:
{ {
list.add(EnumColor.DARK_GREY + "Capable of transferring:"); list.add(EnumColor.DARK_GREY + "Capable of transferring:");
list.add("- " + EnumColor.PURPLE + "Items (universal)"); list.add("- " + EnumColor.PURPLE + "Items (universal)");
list.add("- " + EnumColor.PURPLE + "Blocks (universal)"); list.add("- " + EnumColor.PURPLE + "Blocks (universal)");
break; break;
} }
case 7: case 10:
{ {
list.add(EnumColor.DARK_GREY + "Capable of transferring:"); list.add(EnumColor.DARK_GREY + "Capable of transferring:");
list.add("- " + EnumColor.PURPLE + "Items (universal)"); list.add("- " + EnumColor.PURPLE + "Items (universal)");
@ -140,7 +140,7 @@ public class ItemPartTransmitter extends JItemMultiPart
list.add("- " + EnumColor.DARK_RED + "Only used if no other paths available"); list.add("- " + EnumColor.DARK_RED + "Only used if no other paths available");
break; break;
} }
case 8: case 11:
{ {
list.add(EnumColor.DARK_GREY + "Capable of transferring:"); list.add(EnumColor.DARK_GREY + "Capable of transferring:");
list.add("- " + EnumColor.PURPLE + "Items (universal)"); list.add("- " + EnumColor.PURPLE + "Items (universal)");

View file

@ -303,6 +303,7 @@ public abstract class PartSidedPipe extends TMultiPart implements TSlottedPart,
{ {
return getTransmitter().getSize().centerSize+1; return getTransmitter().getSize().centerSize+1;
} }
return 0; return 0;
} }
@ -352,6 +353,7 @@ public abstract class PartSidedPipe extends TMultiPart implements TSlottedPart,
testingSide = side; testingSide = side;
boolean unblocked = tile().canReplacePart(this, this); boolean unblocked = tile().canReplacePart(this, this);
testingSide = null; testingSide = null;
return unblocked; return unblocked;
} }

View file

@ -11,13 +11,13 @@ public enum TransmitterType
UNIVERSAL_CABLE_ELITE("EliteUniversalCable", Size.SMALL, TransmissionType.ENERGY, PartUniversalCable.cableIcons, 2, 0), UNIVERSAL_CABLE_ELITE("EliteUniversalCable", Size.SMALL, TransmissionType.ENERGY, PartUniversalCable.cableIcons, 2, 0),
UNIVERSAL_CABLE_ULTIMATE("UltimateUniversalCable", Size.SMALL, TransmissionType.ENERGY, PartUniversalCable.cableIcons, 3, 0), UNIVERSAL_CABLE_ULTIMATE("UltimateUniversalCable", Size.SMALL, TransmissionType.ENERGY, PartUniversalCable.cableIcons, 3, 0),
MECHANICAL_PIPE_BASIC("BasicMechanicalPipe", Size.LARGE, TransmissionType.FLUID, PartMechanicalPipe.pipeIcons, 0, 0), MECHANICAL_PIPE_BASIC("BasicMechanicalPipe", Size.LARGE, TransmissionType.FLUID, PartMechanicalPipe.pipeIcons, 0, 0),
MECHANICAL_PIPE_ADVANCED("AdvancedMechanicalPipe", Size.LARGE, TransmissionType.FLUID, PartMechanicalPipe.pipeIcons, 0, 0),
MECHANICAL_PIPE_ELITE("EliteMechanicalPipe", Size.LARGE, TransmissionType.FLUID, PartMechanicalPipe.pipeIcons, 0, 0),
MECHANICAL_PIPE_ULTIMATE("UltimateMechanicalPipe", Size.LARGE, TransmissionType.FLUID, PartMechanicalPipe.pipeIcons, 0, 0),
PRESSURIZED_TUBE("PressurizedTube", Size.SMALL, TransmissionType.GAS, PartPressurizedTube.tubeIcons, 0, 0), PRESSURIZED_TUBE("PressurizedTube", Size.SMALL, TransmissionType.GAS, PartPressurizedTube.tubeIcons, 0, 0),
LOGISTICAL_TRANSPORTER("LogisticalTransporter", Size.LARGE, TransmissionType.ITEM, PartLogisticalTransporter.transporterIcons, 0, 0), LOGISTICAL_TRANSPORTER("LogisticalTransporter", Size.LARGE, TransmissionType.ITEM, PartLogisticalTransporter.transporterIcons, 0, 0),
RESTRICTIVE_TRANSPORTER("RestrictiveTransporter", Size.LARGE, TransmissionType.ITEM, PartLogisticalTransporter.transporterIcons, 1, 1), RESTRICTIVE_TRANSPORTER("RestrictiveTransporter", Size.LARGE, TransmissionType.ITEM, PartLogisticalTransporter.transporterIcons, 1, 1),
DIVERSION_TRANSPORTER("DiversionTransporter", Size.LARGE, TransmissionType.ITEM, PartLogisticalTransporter.transporterIcons, 2, 0), DIVERSION_TRANSPORTER("DiversionTransporter", Size.LARGE, TransmissionType.ITEM, PartLogisticalTransporter.transporterIcons, 2, 0);
MECHANICAL_PIPE_ADVANCED("AdvancedMechanicalPipe", Size.LARGE, TransmissionType.FLUID, PartMechanicalPipe.pipeIcons, 0, 0),
MECHANICAL_PIPE_ELITE("EliteMechanicalPipe", Size.LARGE, TransmissionType.FLUID, PartMechanicalPipe.pipeIcons, 0, 0),
MECHANICAL_PIPE_ULTIMATE("UltimateMechanicalPipe", Size.LARGE, TransmissionType.FLUID, PartMechanicalPipe.pipeIcons, 0, 0);
private String unlocalizedName; private String unlocalizedName;
private Size size; private Size size;