Version bump

This commit is contained in:
Calclavia 2013-12-21 19:02:12 +08:00
parent acc7cfb24f
commit 405d1450b3
10 changed files with 70 additions and 77 deletions

View file

@ -2,6 +2,6 @@ dir.development=./
dir.mcp=${dir.development}forge/mcp
version.minecraft=1.6.4
version.mod.major=0
version.mod.minor=2
version.mod.revis=2
version.universalelectricity=2.2.1
version.mod.minor=3
version.mod.revis=0
version.universalelectricity=3.0.0

View file

@ -1,6 +1,9 @@
package resonantinduction;
import resonantinduction.wire.part.PartLainWire;
import buildcraft.api.power.IPowerReceptor;
import resonantinduction.wire.IBlockableConnection;
import resonantinduction.wire.IInsulatedMaterial;
import resonantinduction.wire.part.PartFlatWire;
import resonantinduction.wire.part.PartWire;
import universalelectricity.api.energy.IConductor;
import codechicken.multipart.MultiPartRegistry;
@ -10,26 +13,29 @@ import codechicken.multipart.TMultiPart;
public class MultipartRI implements IPartFactory
{
public static MultipartRI INSTANCE;
public MultipartRI()
{
MultiPartRegistry.registerParts(this, new String[] { "resonant_induction_wire", "resonant_induction_lain_wire" });
MultiPartRegistry.registerParts(this, new String[] {/* "resonant_induction_wire",*/ "resonant_induction_flat_wire" });
MultipartGenerator.registerPassThroughInterface(IConductor.class.getName());
MultipartGenerator.registerPassThroughInterface("buildcraft.api.power.IPowerReceptor");
MultipartGenerator.registerPassThroughInterface("resonantinduction.wire.IInsulatedMaterial");
MultipartGenerator.registerPassThroughInterface("resonantinduction.wire.IBlockableConnection");
MultipartGenerator.registerPassThroughInterface(IPowerReceptor.class.getName());
MultipartGenerator.registerPassThroughInterface(IInsulatedMaterial.class.getName());
MultipartGenerator.registerPassThroughInterface(IBlockableConnection.class.getName());
MultipartGenerator.registerTrait("ic2.api.energy.tile.IEnergySink", "resonantinduction.wire.TEnergySink");
}
@Override
public TMultiPart createPart(String name, boolean client)
{
if (name.equals("resonant_induction_wire"))
/*if (name.equals("resonant_induction_wire"))
{
return new PartWire();
}
else if (name.equals("resonant_induction_lain_wire"))
else */
if (name.equals("resonant_induction_flat_wire"))
{
return new PartLainWire();
return new PartFlatWire();
}
return null;

View file

@ -35,8 +35,8 @@ import resonantinduction.tesla.BlockTesla;
import resonantinduction.tesla.TileEntityTesla;
import resonantinduction.wire.EnumWireMaterial;
import resonantinduction.wire.ItemPartWire;
import universalelectricity.api.item.IElectricalItem;
import universalelectricity.api.vector.Vector3;
import universalelectricity.core.item.IElectricalItem;
import basiccomponents.api.BasicRegistry;
import calclavia.lib.UniversalRecipe;
import calclavia.lib.network.PacketHandler;
@ -137,8 +137,6 @@ public class ResonantInduction
// Items
public static Item itemQuantumEntangler;
public static Item itemCapacitor;
public static Item itemInfiniteCapacitor;
public static Item itemLinker;
/** With Forge Multipart; Use EnumWireMaterial reference. **/
private static Item itemPartWire;
@ -188,7 +186,7 @@ public class ResonantInduction
blockTesla = new BlockTesla(getNextBlockID());
blockMultimeter = new BlockMultimeter(getNextBlockID());
blockEMContractor = new BlockEMContractor(getNextBlockID());
//blockBattery = new BlockBattery(getNextBlockID());
// blockBattery = new BlockBattery(getNextBlockID());
if (REPLACE_FURNACE)
{
@ -200,27 +198,26 @@ public class ResonantInduction
CONFIGURATION.save();
GameRegistry.registerItem(itemQuantumEntangler, itemQuantumEntangler.getUnlocalizedName());
GameRegistry.registerItem(itemCapacitor, itemCapacitor.getUnlocalizedName());
GameRegistry.registerItem(itemInfiniteCapacitor, itemInfiniteCapacitor.getUnlocalizedName());
GameRegistry.registerItem(itemLinker, itemLinker.getUnlocalizedName());
GameRegistry.registerBlock(blockTesla, blockTesla.getUnlocalizedName());
GameRegistry.registerBlock(blockMultimeter, ItemBlockMultimeter.class, blockMultimeter.getUnlocalizedName());
GameRegistry.registerBlock(blockEMContractor, ItemBlockContractor.class, blockEMContractor.getUnlocalizedName());
GameRegistry.registerBlock(blockBattery, blockBattery.getUnlocalizedName());
// GameRegistry.registerBlock(blockBattery, blockBattery.getUnlocalizedName());
// Tiles
GameRegistry.registerTileEntity(TileEntityTesla.class, blockTesla.getUnlocalizedName());
GameRegistry.registerTileEntity(TileEntityMultimeter.class, blockMultimeter.getUnlocalizedName());
GameRegistry.registerTileEntity(TileEntityEMContractor.class, blockEMContractor.getUnlocalizedName());
//GameRegistry.registerTileEntity(TileEntityBattery.class, blockBattery.getUnlocalizedName());
// GameRegistry.registerTileEntity(TileEntityBattery.class,
// blockBattery.getUnlocalizedName());
ResonantInduction.proxy.registerRenderers();
/**
* Set reference itemstacks
*/
TabRI.ITEMSTACK = new ItemStack(blockBattery);
TabRI.ITEMSTACK = new ItemStack(itemPartWire);
for (EnumWireMaterial material : EnumWireMaterial.values())
{
@ -249,18 +246,9 @@ public class ResonantInduction
metadata.credits = "Thanks to Archadia for the awesome assets!";
metadata.autogenerated = false;
if (itemPartWire != null)
{
try
{
Class.forName("resonantinduction.MultipartRI").newInstance();
}
catch (Exception e)
{
e.printStackTrace();
LOGGER.severe("Failed to initiate Resonant Induction multipart module.");
}
}
MultipartRI.INSTANCE = new MultipartRI();
UniversalRecipe.init();
}
@EventHandler
@ -269,31 +257,30 @@ public class ResonantInduction
/**
* Recipes
*/
ItemStack emptyCapacitor = new ItemStack(itemCapacitor);
((IElectricalItem) itemCapacitor).setElectricity(emptyCapacitor, 0);
final ItemStack defaultWire = EnumWireMaterial.IRON.getWire();
/** Capacitor **/
GameRegistry.addRecipe(new ShapedOreRecipe(emptyCapacitor, "RRR", "RIR", "RRR", 'R', Item.redstone, 'I', UniversalRecipe.PRIMARY_METAL.get()));
// GameRegistry.addRecipe(new ShapedOreRecipe(UniversalRecipe.BATTERY.get(), "RRR", "RIR",
// "RRR", 'R', Item.redstone, 'I', UniversalRecipe.PRIMARY_METAL.get()));
/** Linker **/
GameRegistry.addRecipe(new ShapedOreRecipe(itemLinker, " E ", "GCG", " E ", 'E', Item.eyeOfEnder, 'C', emptyCapacitor, 'G', UniversalRecipe.SECONDARY_METAL.get()));
GameRegistry.addRecipe(new ShapedOreRecipe(itemLinker, " E ", "GCG", " E ", 'E', Item.eyeOfEnder, 'C', UniversalRecipe.BATTERY.get(), 'G', UniversalRecipe.SECONDARY_METAL.get()));
/** Quantum Entangler **/
GameRegistry.addRecipe(new ShapedOreRecipe(itemQuantumEntangler, "EEE", "ILI", "EEE", 'E', Item.eyeOfEnder, 'L', itemLinker, 'I', UniversalRecipe.PRIMARY_METAL.get()));
/** Tesla - by Jyzarc */
GameRegistry.addRecipe(new ShapedOreRecipe(blockTesla, "WEW", " C ", " I ", 'W', defaultWire, 'E', Item.eyeOfEnder, 'C', emptyCapacitor, 'I', UniversalRecipe.PRIMARY_PLATE.get()));
GameRegistry.addRecipe(new ShapedOreRecipe(blockTesla, "WEW", " C ", " I ", 'W', defaultWire, 'E', Item.eyeOfEnder, 'C', UniversalRecipe.BATTERY.get(), 'I', UniversalRecipe.PRIMARY_PLATE.get()));
/** Multimeter */
GameRegistry.addRecipe(new ShapedOreRecipe(blockMultimeter, "WWW", "ICI", 'W', defaultWire, 'C', emptyCapacitor, 'I', UniversalRecipe.PRIMARY_METAL.get()));
GameRegistry.addRecipe(new ShapedOreRecipe(blockMultimeter, "WWW", "ICI", 'W', defaultWire, 'C', UniversalRecipe.BATTERY.get(), 'I', UniversalRecipe.PRIMARY_METAL.get()));
/** Multimeter */
GameRegistry.addRecipe(new ShapedOreRecipe(blockBattery, "III", "IRI", "III", 'R', Block.blockRedstone, 'I', UniversalRecipe.PRIMARY_METAL.get()));
/** Battery */
// GameRegistry.addRecipe(new ShapedOreRecipe(blockBattery, "III", "IRI", "III", 'R',
// Block.blockRedstone, 'I', UniversalRecipe.PRIMARY_METAL.get()));
/** EM Contractor */
GameRegistry.addRecipe(new ShapedOreRecipe(blockEMContractor, " I ", "GCG", "WWW", 'W', UniversalRecipe.PRIMARY_METAL.get(), 'C', emptyCapacitor, 'G', UniversalRecipe.SECONDARY_METAL.get(), 'I', UniversalRecipe.PRIMARY_METAL.get()));
GameRegistry.addRecipe(new ShapedOreRecipe(blockEMContractor, " I ", "GCG", "WWW", 'W', UniversalRecipe.PRIMARY_METAL.get(), 'C', UniversalRecipe.BATTERY.get(), 'G', UniversalRecipe.SECONDARY_METAL.get(), 'I', UniversalRecipe.PRIMARY_METAL.get()));
/** Wires **/
GameRegistry.addRecipe(new ShapedOreRecipe(EnumWireMaterial.COPPER.getWire(3), "MMM", 'M', "ingotCopper"));

View file

@ -1,6 +1,6 @@
package resonantinduction.api;
import universalelectricity.core.item.IElectricalItem;
import universalelectricity.api.item.IElectricalItem;
/**
* @author Calclavia

View file

@ -73,7 +73,7 @@ public class RenderBattery extends TileEntitySpecialRenderer
{
if (this.fakeBattery == null)
{
this.fakeBattery = new EntityItem(t.worldObj, 0, 0, 0, new ItemStack(ResonantInduction.itemCapacitor));
//this.fakeBattery = new EntityItem(t.worldObj, 0, 0, 0, new ItemStack(ResonantInduction.itemCapacitor));
this.fakeBattery.age = 10;
}

View file

@ -16,19 +16,19 @@ import codechicken.lib.colour.ColourRGBA;
public enum EnumWireMaterial
{
COPPER("Copper", 12.5F, 3, 2, 184, 115, 51), TIN("Tin", 13, 2, 0.5F, 132, 132, 130),
IRON("Iron", 0.1F, 2, 4, 97, 102, 105), ALUMINUM("Aluminum", 0.025F, 6, 0.15F, 215, 205, 181),
SILVER("Silver", 0.005F, 1, 2, 192, 192, 192),
SUPERCONDUCTOR("Superconductor", 0, 1, 2, 192, 192, 192);
COPPER("Copper", 12.5F, 3, 20, 184, 115, 51), TIN("Tin", 13, 2, 5, 132, 132, 130),
IRON("Iron", 0.1F, 20, 40, 97, 102, 105), ALUMINUM("Aluminum", 0.025F, 6, 150, 215, 205, 181),
SILVER("Silver", 5F, 1, 20, 192, 192, 192),
SUPERCONDUCTOR("Superconductor", 0, 1, 100, 192, 192, 192);
public final float resistance;
public final float damage;
public final float maxAmps;
public final int damage;
public final long maxAmps;
public final ColourRGBA color;
private ItemStack wire;
private final String name;
private EnumWireMaterial(String s, float resist, float electrocution, float max, int r, int g, int b)
private EnumWireMaterial(String s, float resist, int electrocution, long max, int r, int g, int b)
{
name = s;
resistance = resist;

View file

@ -11,7 +11,7 @@ import net.minecraft.world.World;
import net.minecraftforge.common.Configuration;
import resonantinduction.ResonantInduction;
import resonantinduction.TabRI;
import resonantinduction.wire.part.PartLainWire;
import resonantinduction.wire.part.PartFlatWire;
import resonantinduction.wire.part.PartWire;
import resonantinduction.wire.render.RenderPartWire;
import universalelectricity.api.energy.UnitDisplay;
@ -39,12 +39,12 @@ public class ItemPartWire extends JItemMultiPart
@Override
public TMultiPart newPart(ItemStack arg0, EntityPlayer player, World arg2, BlockCoord arg3, int arg4, Vector3 arg5)
{
if (player.isSneaking())
/*if (player.isSneaking())
{
return new PartWire(getDamage(arg0));
}
}*/
return new PartLainWire(getDamage(arg0));
return new PartFlatWire(getDamage(arg0));
}
@Override

View file

@ -5,16 +5,16 @@ import net.minecraftforge.common.ForgeDirection;
import resonantinduction.ResonantInduction;
import resonantinduction.base.PartAdvanced;
import universalelectricity.api.UniversalClass;
import universalelectricity.api.energy.EnergyNetworkLoader;
import universalelectricity.api.energy.IConductor;
import universalelectricity.api.energy.IEnergyInterface;
import universalelectricity.api.energy.IEnergyNetwork;
import universalelectricity.api.vector.Vector3;
import universalelectricity.api.vector.VectorHelper;
import universalelectricity.core.grid.EnergyNetworkLoader;
import calclavia.lib.tile.EnergyStorage;
import codechicken.multipart.TileMultipart;
@UniversalClass
//@UniversalClass
public abstract class PartConductor extends PartAdvanced implements IConductor
{
private IEnergyNetwork network;

View file

@ -44,7 +44,7 @@ import cpw.mods.fml.relauncher.SideOnly;
* @author Modified by Calclavia, MrTJP
*
*/
public class PartLainWire extends PartWireBase implements IConductor, TFacePart, JNormalOcclusion
public class PartFlatWire extends PartWireBase implements IConductor, TFacePart, JNormalOcclusion
{
public static Cuboid6[][] selectionBounds = new Cuboid6[3][6];
public static Cuboid6[][] occlusionBounds = new Cuboid6[3][6];
@ -82,17 +82,17 @@ public class PartLainWire extends PartWireBase implements IConductor, TFacePart,
*/
public int connMap;
public PartLainWire()
public PartFlatWire()
{
super();
}
public PartLainWire(int typeID)
public PartFlatWire(int typeID)
{
this(EnumWireMaterial.values()[typeID]);
}
public PartLainWire(EnumWireMaterial type)
public PartFlatWire(EnumWireMaterial type)
{
super();
material = type;
@ -302,7 +302,7 @@ public class PartLainWire extends PartWireBase implements IConductor, TFacePart,
{
int absDir = Rotation.rotateSide(side, r);
TMultiPart facePart = tile().partMap(absDir);
if (facePart != null && (!(facePart instanceof PartLainWire) || !canConnectToType((PartLainWire) facePart)))
if (facePart != null && (!(facePart instanceof PartFlatWire) || !canConnectToType((PartFlatWire) facePart)))
return false;
if (tile().partMap(PartMap.edgeBetween(side, absDir)) != null)
@ -334,11 +334,11 @@ public class PartLainWire extends PartWireBase implements IConductor, TFacePart,
TMultiPart tp = t.partMap(absDir ^ 1);
if (tp instanceof IConductor)
{
boolean b = ((PartLainWire) tp).connectCorner(this, Rotation.rotationTo(absDir ^ 1, side ^ 1));
boolean b = ((PartFlatWire) tp).connectCorner(this, Rotation.rotationTo(absDir ^ 1, side ^ 1));
if (b)
{
// let them connect to us
if (tp instanceof PartLainWire && !renderThisCorner((PartLainWire) tp))
if (tp instanceof PartFlatWire && !renderThisCorner((PartFlatWire) tp))
return 1;
return 2;
@ -369,8 +369,8 @@ public class PartLainWire extends PartWireBase implements IConductor, TFacePart,
if (t != null)
{
TMultiPart tp = t.partMap(side);
if (tp instanceof PartLainWire)
return ((PartLainWire) tp).connectStraight(this, (r + 2) % 4);
if (tp instanceof PartFlatWire)
return ((PartFlatWire) tp).connectStraight(this, (r + 2) % 4);
}
return connectStraightOverride(absDir);
@ -389,8 +389,8 @@ public class PartLainWire extends PartWireBase implements IConductor, TFacePart,
return false;
TMultiPart tp = tile().partMap(absDir);
if (tp instanceof PartLainWire)
return ((PartLainWire) tp).connectInternal(this, Rotation.rotationTo(absDir, side));
if (tp instanceof PartFlatWire)
return ((PartFlatWire) tp).connectInternal(this, Rotation.rotationTo(absDir, side));
return connectInternalOverride(tp, r);
}
@ -403,18 +403,18 @@ public class PartLainWire extends PartWireBase implements IConductor, TFacePart,
public boolean connectCenter()
{
TMultiPart t = tile().partMap(6);
if (t instanceof PartLainWire)
return ((PartLainWire) t).connectInternal(this, side);
if (t instanceof PartFlatWire)
return ((PartFlatWire) t).connectInternal(this, side);
return false;
}
public boolean renderThisCorner(IConductor part)
{
if (!(part instanceof PartLainWire))
if (!(part instanceof PartFlatWire))
return false;
PartLainWire wire = (PartLainWire) part;
PartFlatWire wire = (PartFlatWire) part;
if (wire.getThickness() == getThickness())
return side < wire.side;
@ -556,7 +556,7 @@ public class PartLainWire extends PartWireBase implements IConductor, TFacePart,
@Override
public String getType()
{
return "resonant_induction_lain_wire";
return "resonant_induction_flat_wire";
}
/**

View file

@ -4,7 +4,7 @@ import java.util.Arrays;
import java.util.LinkedList;
import net.minecraft.util.Icon;
import resonantinduction.wire.part.PartLainWire;
import resonantinduction.wire.part.PartFlatWire;
import codechicken.lib.lighting.LightModel;
import codechicken.lib.math.MathHelper;
import codechicken.lib.render.CCModel;
@ -400,7 +400,7 @@ public class RenderLainWire
return key;
}
public static int modelKey(PartLainWire w)
public static int modelKey(PartFlatWire w)
{
return modelKey(w.side, w.getThickness(), w.connMap);
}
@ -413,7 +413,7 @@ public class RenderLainWire
return m;
}
public static void render(PartLainWire w, Vector3 pos)
public static void render(PartFlatWire w, Vector3 pos)
{
IVertexModifier m = w.getColour() == -1 ? ColourModifier.instance : new ColourMultiplier(w.getColour());
getOrGenerateModel(modelKey(w)).render(new Translation(pos), new IconTransformation(w.getIcon()), m);
@ -428,7 +428,7 @@ public class RenderLainWire
m.render(t, new IconTransformation(icon));
}
public static void renderBreakingOverlay(Icon icon, PartLainWire wire)
public static void renderBreakingOverlay(Icon icon, PartFlatWire wire)
{
int key = modelKey(wire);
int side = (key >> 8) % 6;