diff --git a/build.xml b/build.xml index cc71ca776..ffd782b16 100644 --- a/build.xml +++ b/build.xml @@ -6,7 +6,6 @@ - @@ -14,7 +13,6 @@ - @@ -45,7 +43,6 @@ - @@ -71,7 +68,6 @@ - @@ -87,14 +83,6 @@ - - - - - - - - @@ -118,10 +106,6 @@ - - - - @@ -139,10 +123,6 @@ - - - - diff --git a/common/mekanism/api/transmitters/TransmissionType.java b/common/mekanism/api/transmitters/TransmissionType.java index efe96256b..206837273 100644 --- a/common/mekanism/api/transmitters/TransmissionType.java +++ b/common/mekanism/api/transmitters/TransmissionType.java @@ -52,8 +52,16 @@ public enum TransmissionType public static TransmissionType fromOldMeta(int meta) { - if(meta <= metaArray.length) + if(meta < metaArray.length) + { return metaArray[meta]; + } + + if(meta == 4 || meta == 5) + { + return ITEM; + } + return null; } diff --git a/common/mekanism/client/render/PartTransmitterIcons.java b/common/mekanism/client/render/PartTransmitterIcons.java index e6c4e3293..fafa0339e 100644 --- a/common/mekanism/client/render/PartTransmitterIcons.java +++ b/common/mekanism/client/render/PartTransmitterIcons.java @@ -3,7 +3,8 @@ package mekanism.client.render; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.util.Icon; -public class PartTransmitterIcons { +public class PartTransmitterIcons +{ private Icon sideIcon; private Icon[] centerIcons; @@ -14,15 +15,15 @@ public class PartTransmitterIcons { public void registerCenterIcons(IconRegister register, String[] filenames) { - for(int i=0; i> cachedLiquids = new HashMap>(); + private HashMap> cachedOverlays = new HashMap>(); + + private Minecraft mc = Minecraft.getMinecraft(); + + private EntityItem entityItem = new EntityItem(null); + private RenderItem renderer = (RenderItem)RenderManager.instance.getEntityClassRenderObject(EntityItem.class); public static RenderPartTransmitter getInstance() { @@ -102,6 +118,11 @@ public class RenderPartTransmitter implements IIconRegister GL11.glPopMatrix(); } + public void renderContents(PartLogisticalTransporter transporter, Vector3 pos) + { + + } + public void renderContents(PartUniversalCable cable, Vector3 pos) { if(cable.currentPower == 0) @@ -408,4 +429,140 @@ public class RenderPartTransmitter implements IIconRegister { return 0; } + + private void popTransporter() + { + GL11.glPopAttrib(); + MekanismRenderer.glowOff(); + MekanismRenderer.blendOff(); + GL11.glPopMatrix(); + } + + private void pushTransporter() + { + GL11.glPushMatrix(); + 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, ForgeDirection side, int mode) + { + if(cachedOverlays.containsKey(side) && cachedOverlays.get(side).containsKey(mode)) + { + return cachedOverlays.get(side).get(mode); + } + + Icon icon = null; + + switch(mode) + { + case 0: + icon = Item.gunpowder.getIcon(new ItemStack(Item.gunpowder), 0); + break; + case 1: + icon = Block.torchRedstoneActive.getIcon(0, 0); + break; + case 2: + icon = Block.torchRedstoneIdle.getIcon(0, 0); + break; + } + + Model3D toReturn = new Model3D(); + toReturn.baseBlock = Block.stone; + toReturn.setTexture(icon); + + DisplayInteger display = DisplayInteger.createAndStart(); + + if(cachedOverlays.containsKey(side)) + { + cachedOverlays.get(side).put(mode, display); + } + else { + HashMap map = new HashMap(); + 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; + } } diff --git a/common/mekanism/client/render/tileentity/RenderLogisticalTransporter.java b/common/mekanism/client/render/tileentity/RenderLogisticalTransporter.java index c024f0673..dc9b9241d 100644 --- a/common/mekanism/client/render/tileentity/RenderLogisticalTransporter.java +++ b/common/mekanism/client/render/tileentity/RenderLogisticalTransporter.java @@ -152,7 +152,7 @@ public class RenderLogisticalTransporter extends TileEntitySpecialRenderer int mode = ((TileEntityDiversionTransporter)tileEntity).modes[pos.sideHit]; ForgeDirection side = ForgeDirection.getOrientation(pos.sideHit); - push(); + pushTransporter(); GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.8F); @@ -164,13 +164,13 @@ public class RenderLogisticalTransporter extends TileEntitySpecialRenderer int display = getOverlayDisplay(world, side, mode).display; GL11.glCallList(display); - pop(); + popTransporter(); } } } } - private void pop() + private void popTransporter() { GL11.glPopAttrib(); MekanismRenderer.glowOff(); @@ -178,7 +178,7 @@ public class RenderLogisticalTransporter extends TileEntitySpecialRenderer GL11.glPopMatrix(); } - private void push() + private void pushTransporter() { GL11.glPushMatrix(); GL11.glPushAttrib(GL11.GL_ENABLE_BIT); diff --git a/common/mekanism/common/Mekanism.java b/common/mekanism/common/Mekanism.java index 18f3a26b2..74c92453a 100644 --- a/common/mekanism/common/Mekanism.java +++ b/common/mekanism/common/Mekanism.java @@ -134,7 +134,7 @@ import cpw.mods.fml.common.registry.GameRegistry; * @author AidanBrady * */ -@Mod(modid = "Mekanism", name = "Mekanism", version = "5.6.0") +@Mod(modid = "Mekanism", name = "Mekanism", version = "6.0.0") @NetworkMod(channels = {"MEK"}, clientSideRequired = true, serverSideRequired = false, packetHandler = PacketHandler.class) public class Mekanism { @@ -159,7 +159,7 @@ public class Mekanism public static Configuration configuration; /** Mekanism version number */ - public static Version versionNumber = new Version(5, 6, 0); + public static Version versionNumber = new Version(6, 0, 0); /** Map of Teleporters */ public static Map> teleporters = new HashMap>(); diff --git a/common/mekanism/common/item/ItemBalloon.java b/common/mekanism/common/item/ItemBalloon.java index b6c5a5496..ea2ce0da0 100644 --- a/common/mekanism/common/item/ItemBalloon.java +++ b/common/mekanism/common/item/ItemBalloon.java @@ -5,9 +5,11 @@ import java.util.List; import mekanism.api.Coord4D; import mekanism.api.EnumColor; import mekanism.common.EntityBalloon; +import mekanism.common.util.MekanismUtils; import net.minecraft.block.Block; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.world.World; @@ -61,7 +63,7 @@ public class ItemBalloon extends ItemMekanism @Override public String getItemDisplayName(ItemStack stack) { - return getColor(stack).getName() + " Balloon"; + return getColor(stack).getName() + " " + MekanismUtils.localize("tooltip.balloon"); } @Override @@ -95,6 +97,12 @@ public class ItemBalloon extends ItemMekanism return false; } + /*@Override + public boolean itemInteractionForEntity(ItemStack stack, EntityPlayer player, EntityLivingBase entity) + { + return false; + }*/ + private boolean canReplace(World world, int x, int y, int z) { return world.isAirBlock(x, y, z) || Block.blocksList[world.getBlockId(x, y, z)].isBlockReplaceable(world, x, y, z); diff --git a/common/mekanism/common/multipart/MultipartMekanism.java b/common/mekanism/common/multipart/MultipartMekanism.java index 5257fb6e5..b5af4b2ac 100644 --- a/common/mekanism/common/multipart/MultipartMekanism.java +++ b/common/mekanism/common/multipart/MultipartMekanism.java @@ -20,7 +20,8 @@ public class MultipartMekanism implements IPartFactory, IPartConverter public void init() { MultiPartRegistry.registerConverter(this); - MultiPartRegistry.registerParts(this, new String[] {"mekanism:universal_cable", "mekanism:mechanical_pipe", "mekanism:pressurized_tube", "mekanism:logistical_transporter"}); + MultiPartRegistry.registerParts(this, new String[] {"mekanism:universal_cable", "mekanism:mechanical_pipe", "mekanism:pressurized_tube", "mekanism:logistical_transporter", + "mekanism:restrictive_transporter", "mekanism:diversion_transporter"}); MultipartGenerator.registerPassThroughInterface("mekanism.api.transmitters.ITransmitter"); MultipartGenerator.registerPassThroughInterface("mekanism.common.ILogisticalTransporter"); @@ -34,14 +35,31 @@ public class MultipartMekanism implements IPartFactory, IPartConverter @Override public TMultiPart createPart(String name, boolean client) { - if(name == "mekanism:universal_cable") + if(name.equals("mekanism:universal_cable")) + { return new PartUniversalCable(); - if(name == "mekanism:mechanical_pipe") + } + else if(name.equals("mekanism:mechanical_pipe")) + { return new PartMechanicalPipe(); - if(name == "mekanism:pressurized_tube") + } + else if(name.equals("mekanism:pressurized_tube")) + { return new PartPressurizedTube(); - if(name == "mekanism:logistical_transporter") + } + else if(name.equals("mekanism:logistical_transporter")) + { return new PartLogisticalTransporter(); + } + else if(name.equals("mekanism:restrictive_transporter")) + { + return new PartLogisticalTransporter(); + } + else if(name.equals("mekanism:diversion_transporter")) + { + return new PartDiversionTransporter(); + } + return null; } @@ -57,7 +75,7 @@ public class MultipartMekanism implements IPartFactory, IPartConverter if(world.getBlockId(pos.x, pos.y, pos.z) == Mekanism.transmitterID) { int meta = world.getBlockMetadata(pos.x, pos.y, pos.z); - return PartTransmitter.getPartType(TransmissionType.fromOldMeta(meta)); + return PartTransmitter.getPartType(TransmissionType.fromOldMeta(meta), meta); } return null; diff --git a/common/mekanism/common/multipart/PartDiversionTransporter.java b/common/mekanism/common/multipart/PartDiversionTransporter.java new file mode 100644 index 000000000..83ca886c9 --- /dev/null +++ b/common/mekanism/common/multipart/PartDiversionTransporter.java @@ -0,0 +1,6 @@ +package mekanism.common.multipart; + +public class PartDiversionTransporter extends PartLogisticalTransporter +{ + +} diff --git a/common/mekanism/common/multipart/PartLogisticalTransporter.java b/common/mekanism/common/multipart/PartLogisticalTransporter.java index b087bbcfd..73b89424f 100644 --- a/common/mekanism/common/multipart/PartLogisticalTransporter.java +++ b/common/mekanism/common/multipart/PartLogisticalTransporter.java @@ -1,7 +1,11 @@ package mekanism.common.multipart; +import codechicken.lib.vec.Vector3; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import mekanism.api.transmitters.TransmissionType; import mekanism.client.render.PartTransmitterIcons; +import mekanism.client.render.RenderPartTransmitter; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.inventory.IInventory; import net.minecraft.tileentity.TileEntity; @@ -12,11 +16,13 @@ public class PartLogisticalTransporter extends PartSidedPipe { public static PartTransmitterIcons transporterIcons; + @Override public String getType() { return "mekanism:logistical_transporter"; } + @Override public TransmissionType getTransmissionType() { return TransmissionType.ITEM; @@ -28,17 +34,27 @@ public class PartLogisticalTransporter extends PartSidedPipe transporterIcons.registerCenterIcons(register, new String[] {"LogisticalTransporter", "RestrictionTransporter", "DiversionTransporter"}); transporterIcons.registerSideIcon(register, "LogisticalTransporterSide"); } + + @Override + @SideOnly(Side.CLIENT) + public void renderDynamic(Vector3 pos, float f, int pass) + { + RenderPartTransmitter.getInstance().renderContents(this, pos); + } + @Override public Icon getCenterIcon() { return transporterIcons.getCenterIcon(0); } + @Override public Icon getSideIcon() { return transporterIcons.getSideIcon(); } + @Override public boolean isValidAcceptor(TileEntity tile, ForgeDirection side) { return tile instanceof IInventory; diff --git a/common/mekanism/common/multipart/PartSidedPipe.java b/common/mekanism/common/multipart/PartSidedPipe.java index 6e4c15347..427deb15d 100644 --- a/common/mekanism/common/multipart/PartSidedPipe.java +++ b/common/mekanism/common/multipart/PartSidedPipe.java @@ -86,7 +86,7 @@ public abstract class PartSidedPipe extends TMultiPart implements TSlottedPart, largeSides[6] = new IndexedCuboid6(6, new Cuboid6(0.25, 0.25, 0.25, 0.75, 0.75, 0.75)); } - public static TMultiPart getPartType(TransmissionType type) + public static TMultiPart getPartType(TransmissionType type, int sub) { switch(type) { @@ -97,7 +97,17 @@ public abstract class PartSidedPipe extends TMultiPart implements TSlottedPart, case GAS: return new PartPressurizedTube(); case ITEM: - return new PartLogisticalTransporter(); + { + switch(sub) + { + case 3: + return new PartLogisticalTransporter(); + case 4: + return new PartLogisticalTransporter(); + case 5: + return new PartDiversionTransporter(); + } + } default: return null; } diff --git a/common/mekanism/generators/common/MekanismGenerators.java b/common/mekanism/generators/common/MekanismGenerators.java index 70437103e..6be29534d 100644 --- a/common/mekanism/generators/common/MekanismGenerators.java +++ b/common/mekanism/generators/common/MekanismGenerators.java @@ -29,7 +29,7 @@ import cpw.mods.fml.common.network.NetworkMod; import cpw.mods.fml.common.network.NetworkRegistry; import cpw.mods.fml.common.registry.GameRegistry; -@Mod(modid = "MekanismGenerators", name = "MekanismGenerators", version = "5.6.0", dependencies = "required-after:Mekanism") +@Mod(modid = "MekanismGenerators", name = "MekanismGenerators", version = "6.0.0", dependencies = "required-after:Mekanism") @NetworkMod(clientSideRequired = true, serverSideRequired = false) public class MekanismGenerators implements IModule { @@ -40,7 +40,7 @@ public class MekanismGenerators implements IModule public static MekanismGenerators instance; /** MekanismGenerators version number */ - public static Version versionNumber = new Version(5, 6, 0); + public static Version versionNumber = new Version(6, 0, 0); //Items public static Item BioFuel; diff --git a/common/mekanism/tools/common/MekanismTools.java b/common/mekanism/tools/common/MekanismTools.java index ef5aeebd2..ed29a6a5d 100644 --- a/common/mekanism/tools/common/MekanismTools.java +++ b/common/mekanism/tools/common/MekanismTools.java @@ -32,7 +32,7 @@ import cpw.mods.fml.common.network.NetworkMod; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.common.registry.LanguageRegistry; -@Mod(modid = "MekanismTools", name = "MekanismTools", version = "5.6.0", dependencies = "required-after:Mekanism") +@Mod(modid = "MekanismTools", name = "MekanismTools", version = "6.0.0", dependencies = "required-after:Mekanism") @NetworkMod(clientSideRequired = true, serverSideRequired = false) public class MekanismTools implements IModule { @@ -40,7 +40,7 @@ public class MekanismTools implements IModule public static MekanismTools instance; /** MekanismTools version number */ - public static Version versionNumber = new Version(5, 6, 0); + public static Version versionNumber = new Version(6, 0, 0); //Enums: Tools public static EnumToolMaterial toolOBSIDIAN = EnumHelper.addToolMaterial("OBSIDIAN", 3, 2500, 20F, 10, 100); diff --git a/etc/core/mcmod.info b/etc/core/mcmod.info index 2ffb54787..9d402482f 100755 --- a/etc/core/mcmod.info +++ b/etc/core/mcmod.info @@ -3,7 +3,7 @@ "modid": "Mekanism", "name": "Mekanism", "description": "Energy, Armor, Tools, Weapons, Machines, Magic.", - "version": "5.6.0", + "version": “6.0.0”, "mcversion": "1.6.4", "updateUrl": "", "authors": [ diff --git a/etc/generators/mcmod.info b/etc/generators/mcmod.info index 22db7b9be..96dda6d70 100755 --- a/etc/generators/mcmod.info +++ b/etc/generators/mcmod.info @@ -3,7 +3,7 @@ "modid": "MekanismGenerators", "name": "MekanismGenerators", "description": "Generators module of Mekanism.", - "version": "5.6.0", + "version": “6.0.0”, "mcversion": "1.6.4", "updateUrl": "", "authors": [ diff --git a/etc/induction/logo.png b/etc/induction/logo.png deleted file mode 100644 index 9c4bc2a3b..000000000 Binary files a/etc/induction/logo.png and /dev/null differ diff --git a/etc/induction/mcmod.info b/etc/induction/mcmod.info deleted file mode 100755 index a20aad69f..000000000 --- a/etc/induction/mcmod.info +++ /dev/null @@ -1,17 +0,0 @@ -[ -{ - "modid": "MekanismInduction", - "name": "MekanismInduction", - "description": "Induction module of Mekanism.", - "version": "5.6.0", - "mcversion": "1.6.4", - "updateUrl": "", - "authors": [ - "aidancbrady" - ], - "credits": "Thanks to everyone who has contributed to this ongoing project.", - "logoFile": "logo.png", - "screenshots": [ - ] -} -] diff --git a/etc/tools/mcmod.info b/etc/tools/mcmod.info index 4f674968b..adaaa3289 100755 --- a/etc/tools/mcmod.info +++ b/etc/tools/mcmod.info @@ -3,7 +3,7 @@ "modid": "MekanismTools", "name": "MekanismTools", "description": "Tools module for Mekanism.", - "version": "5.6.0", + "version": “6.0.0”, "mcversion": "1.6.4", "updateUrl": "", "authors": [ diff --git a/resources/assets/mekanism/lang/en_US.lang b/resources/assets/mekanism/lang/en_US.lang index 1c611eec9..7bf122534 100644 --- a/resources/assets/mekanism/lang/en_US.lang +++ b/resources/assets/mekanism/lang/en_US.lang @@ -266,6 +266,8 @@ tooltip.configurator.noLink=No link tooltip.configurator.linkMsg=Bound to tooltip.configurator.dim=dimension +tooltip.balloon=Balloon + tooltip.jetpack.regular=Regular tooltip.jetpack.hover=Hover tooltip.jetpack.disabled=Disabled