Added recipes for multipart wires
This commit is contained in:
parent
e44027bcf5
commit
883c0458da
17 changed files with 293 additions and 225 deletions
|
@ -15,6 +15,7 @@ public class BlockAdvancedFurnace extends BlockFurnace
|
|||
super(par1, par2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World par1World)
|
||||
{
|
||||
return new TileEntityAdvancedFurnace();
|
||||
|
|
|
@ -145,14 +145,16 @@ public class ResonantInduction
|
|||
public static Item itemCapacitor;
|
||||
public static Item itemInfiniteCapacitor;
|
||||
public static Item itemLinker;
|
||||
public static Item itemPartWire;
|
||||
/** With Forge Multipart; Use EnumWireMaterial reference. **/
|
||||
private static Item itemPartWire;
|
||||
|
||||
// Blocks
|
||||
public static Block blockTesla;
|
||||
public static Block blockMultimeter;
|
||||
public static Block blockEMContractor;
|
||||
public static Block blockBattery;
|
||||
public static Block blockWire;
|
||||
/** Without Forge Multipart **/
|
||||
private static Block blockWire;
|
||||
|
||||
public static Block blockAdvancedFurnaceIdle, blockAdvancedFurnaceBurning;
|
||||
|
||||
|
@ -185,14 +187,22 @@ public class ResonantInduction
|
|||
itemLinker = new ItemLinker(getNextItemID());
|
||||
itemInfiniteCapacitor = new ItemInfiniteCapacitor(getNextItemID());
|
||||
|
||||
if (Loader.isModLoaded("ForgeMultipart"))
|
||||
{
|
||||
itemPartWire = new ItemPartWire(getNextItemID());
|
||||
}
|
||||
|
||||
// Blocks
|
||||
blockTesla = new BlockTesla(getNextBlockID());
|
||||
blockMultimeter = new BlockMultimeter(getNextBlockID());
|
||||
blockEMContractor = new BlockEMContractor(getNextBlockID());
|
||||
blockBattery = new BlockBattery(getNextBlockID());
|
||||
|
||||
if (itemPartWire == null)
|
||||
{
|
||||
blockWire = new BlockWire(getNextBlockID());
|
||||
}
|
||||
|
||||
blockAdvancedFurnaceIdle = new BlockAdvancedFurnace(getNextBlockID(), false);
|
||||
blockAdvancedFurnaceBurning = new BlockAdvancedFurnace(getNextBlockID(), true);
|
||||
|
||||
|
@ -207,22 +217,48 @@ public class ResonantInduction
|
|||
GameRegistry.registerBlock(blockMultimeter, ItemBlockMultimeter.class, blockMultimeter.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(blockEMContractor, ItemBlockContractor.class, blockEMContractor.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(blockBattery, blockBattery.getUnlocalizedName());
|
||||
|
||||
if (blockWire != null)
|
||||
{
|
||||
GameRegistry.registerBlock(blockWire, ItemBlockWire.class, blockWire.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());
|
||||
|
||||
if (blockWire != null)
|
||||
{
|
||||
GameRegistry.registerTileEntity(TileEntityWire.class, blockWire.getUnlocalizedName());
|
||||
GameRegistry.registerTileEntity(TileEntityTickWire.class, blockWire.getUnlocalizedName() + "2");
|
||||
}
|
||||
|
||||
ResonantInduction.proxy.registerRenderers();
|
||||
|
||||
/**
|
||||
* Set reference itemstacks
|
||||
*/
|
||||
TabRI.ITEMSTACK = new ItemStack(blockBattery);
|
||||
OreDictionary.registerOre("copperWire", new ItemStack(blockWire));
|
||||
|
||||
if (itemPartWire != null)
|
||||
{
|
||||
for (EnumWireMaterial material : EnumWireMaterial.values())
|
||||
{
|
||||
material.setWire(itemPartWire);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (EnumWireMaterial material : EnumWireMaterial.values())
|
||||
{
|
||||
material.setWire(blockWire);
|
||||
}
|
||||
}
|
||||
|
||||
// Basic Components
|
||||
BasicRegistry.register("itemIngotCopper");
|
||||
BasicRegistry.register("itemIngotSteel");
|
||||
BasicRegistry.register("itemPlateSteel");
|
||||
BasicRegistry.register("itemIngotBronze");
|
||||
|
@ -257,7 +293,7 @@ public class ResonantInduction
|
|||
ItemStack emptyCapacitor = new ItemStack(itemCapacitor);
|
||||
((IItemElectric) itemCapacitor).setElectricity(emptyCapacitor, 0);
|
||||
|
||||
final ItemStack defaultWire = new ItemStack(blockWire, 1, EnumWireMaterial.IRON.ordinal());
|
||||
final ItemStack defaultWire = EnumWireMaterial.IRON.getWire();
|
||||
|
||||
/** Capacitor **/
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(emptyCapacitor, "RRR", "RIR", "RRR", 'R', Item.redstone, 'I', UniversalRecipes.PRIMARY_METAL));
|
||||
|
@ -281,25 +317,26 @@ public class ResonantInduction
|
|||
GameRegistry.addRecipe(new ShapedOreRecipe(blockEMContractor, " I ", "GCG", "WWW", 'W', UniversalRecipes.PRIMARY_METAL, 'C', emptyCapacitor, 'G', UniversalRecipes.SECONDARY_METAL, 'I', UniversalRecipes.PRIMARY_METAL));
|
||||
|
||||
/** Wires **/
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(blockWire, 3, EnumWireMaterial.COPPER.ordinal()), "MMM", 'M', "ingotCopper"));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(blockWire, 3, EnumWireMaterial.TIN.ordinal()), "MMM", 'M', "ingotTin"));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(blockWire, 3, EnumWireMaterial.IRON.ordinal()), "MMM", 'M', Item.ingotIron));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(blockWire, 3, EnumWireMaterial.ALUMINUM.ordinal()), "MMM", 'M', "ingotAluminum"));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(blockWire, 3, EnumWireMaterial.SILVER.ordinal()), "MMM", 'M', "ingotSilver"));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(blockWire, 3, EnumWireMaterial.SUPERCONDUCTOR.ordinal()), "MMM", 'M', "ingotSuperconductor"));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(EnumWireMaterial.COPPER.getWire(3), "MMM", 'M', "ingotCopper"));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(EnumWireMaterial.TIN.getWire(3), "MMM", 'M', "ingotTin"));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(EnumWireMaterial.IRON.getWire(3), "MMM", 'M', Item.ingotIron));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(EnumWireMaterial.ALUMINUM.getWire(3), "MMM", 'M', "ingotAluminum"));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(EnumWireMaterial.SILVER.getWire(), "MMM", 'M', "ingotSilver"));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(EnumWireMaterial.SUPERCONDUCTOR.getWire(3), "MMM", 'M', "ingotSuperconductor"));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(EnumWireMaterial.SUPERCONDUCTOR.getWire(3), "MMM", "MEM", "MMM", 'M', Item.ingotGold, "E", Item.eyeOfEnder));
|
||||
|
||||
/** Wire Compatiblity **/
|
||||
if (Loader.isModLoaded("IC2"))
|
||||
{
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(blockWire, 1, EnumWireMaterial.COPPER.ordinal()), Items.getItem("copperCableItem")));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(blockWire, 1, EnumWireMaterial.TIN.ordinal()), Items.getItem("tinCableItem")));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(blockWire, 1, EnumWireMaterial.IRON.ordinal()), Items.getItem("ironCableItem")));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(blockWire, 2, EnumWireMaterial.SUPERCONDUCTOR.ordinal()), Items.getItem("glassFiberCableItem")));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(EnumWireMaterial.COPPER.getWire(), Items.getItem("copperCableItem")));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(EnumWireMaterial.TIN.getWire(), Items.getItem("tinCableItem")));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(EnumWireMaterial.IRON.getWire(), Items.getItem("ironCableItem")));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(EnumWireMaterial.SUPERCONDUCTOR.getWire(), Items.getItem("glassFiberCableItem")));
|
||||
}
|
||||
|
||||
if (Loader.isModLoaded("Mekanism"))
|
||||
{
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(blockWire, 1, EnumWireMaterial.COPPER.ordinal()), "universalCable"));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(EnumWireMaterial.COPPER.getWire(), "universalCable"));
|
||||
}
|
||||
|
||||
/** Inject new furnace tile class */
|
||||
|
|
|
@ -10,6 +10,7 @@ import net.minecraft.tileentity.TileEntityFurnace;
|
|||
*/
|
||||
public class TileEntityAdvancedFurnace extends TileEntityFurnace
|
||||
{
|
||||
@Override
|
||||
public void updateEntity()
|
||||
{
|
||||
super.updateEntity();
|
||||
|
|
|
@ -5,22 +5,22 @@ import codechicken.lib.vec.Transformation;
|
|||
import codechicken.lib.vec.VariableTransformation;
|
||||
import codechicken.lib.vec.Vector3;
|
||||
|
||||
public class InvertX extends VariableTransformation {
|
||||
public InvertX() {
|
||||
super(new Matrix4(
|
||||
-1, 0, 0, 0,
|
||||
0, 1, 0, 0,
|
||||
0, 0, 1, 0,
|
||||
0, 0, 0, 1));
|
||||
public class InvertX extends VariableTransformation
|
||||
{
|
||||
public InvertX()
|
||||
{
|
||||
super(new Matrix4(-1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply(Vector3 vec) {
|
||||
public void apply(Vector3 vec)
|
||||
{
|
||||
this.mat.apply(vec);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Transformation inverse() {
|
||||
public Transformation inverse()
|
||||
{
|
||||
return this;
|
||||
}
|
||||
}
|
|
@ -11,6 +11,10 @@ import net.minecraftforge.common.ForgeDirection;
|
|||
import org.lwjgl.BufferUtils;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import resonantinduction.ResonantInduction;
|
||||
import resonantinduction.wire.multipart.PartConductor;
|
||||
import resonantinduction.wire.multipart.PartWire;
|
||||
import universalelectricity.core.vector.Vector3;
|
||||
import codechicken.lib.colour.Colour;
|
||||
import codechicken.lib.colour.ColourRGBA;
|
||||
import codechicken.lib.lighting.LightModel;
|
||||
|
@ -21,9 +25,6 @@ import codechicken.lib.render.IconTransformation;
|
|||
import codechicken.lib.render.TextureUtils;
|
||||
import codechicken.lib.vec.Rotation;
|
||||
import codechicken.lib.vec.Translation;
|
||||
import resonantinduction.ResonantInduction;
|
||||
import resonantinduction.wire.multipart.PartWire;
|
||||
import universalelectricity.core.vector.Vector3;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
|
@ -49,14 +50,16 @@ public class RenderPartWire
|
|||
static
|
||||
{
|
||||
models = CCModel.parseObjModels(new ResourceLocation("resonantinduction", "models/wire.obj"), 7, new InvertX());
|
||||
for (CCModel c : models.values()) {
|
||||
for (CCModel c : models.values())
|
||||
{
|
||||
c.apply(new Translation(.5, 0, .5));
|
||||
c.computeLighting(LightModel.standardLightModel);
|
||||
c.shrinkUVs(0.0005);
|
||||
}
|
||||
|
||||
shinyModels = CCModel.parseObjModels(new ResourceLocation("resonantinduction", "models/wireShine.obj"), 7, new InvertX());
|
||||
for (CCModel c : shinyModels.values()) {
|
||||
for (CCModel c : shinyModels.values())
|
||||
{
|
||||
c.apply(new Translation(.5, 0, .5));
|
||||
c.computeLighting(LightModel.standardLightModel);
|
||||
c.shrinkUVs(0.0005);
|
||||
|
@ -109,7 +112,7 @@ public class RenderPartWire
|
|||
byte renderSides = wire.getAllCurrentConnections();
|
||||
for (ForgeDirection side : ForgeDirection.VALID_DIRECTIONS)
|
||||
{
|
||||
if (PartWire.connectionMapContainsSide(renderSides, side))
|
||||
if (PartConductor.connectionMapContainsSide(renderSides, side))
|
||||
renderSideShine(side, wire);
|
||||
}
|
||||
CCRenderState.draw();
|
||||
|
@ -144,7 +147,7 @@ public class RenderPartWire
|
|||
byte renderSides = wire.getAllCurrentConnections();
|
||||
for (ForgeDirection side : ForgeDirection.VALID_DIRECTIONS)
|
||||
{
|
||||
if (PartWire.connectionMapContainsSide(renderSides, side))
|
||||
if (PartConductor.connectionMapContainsSide(renderSides, side))
|
||||
renderSide(side, wire);
|
||||
}
|
||||
}
|
||||
|
@ -172,13 +175,13 @@ public class RenderPartWire
|
|||
renderPartShine(shinyModels.get(name));
|
||||
}
|
||||
|
||||
public void renderPart(Icon icon, CCModel cc, double x, double y, double z, Colour colour) {
|
||||
cc.render(0, cc.verts.length,
|
||||
Rotation.sideOrientation(0, Rotation.rotationTo(0, 2)).at(codechicken.lib.vec.Vector3.center)
|
||||
.with(new Translation(x, y, z)), new IconTransformation(icon), new ColourMultiplier(colour));
|
||||
public void renderPart(Icon icon, CCModel cc, double x, double y, double z, Colour colour)
|
||||
{
|
||||
cc.render(0, cc.verts.length, Rotation.sideOrientation(0, Rotation.rotationTo(0, 2)).at(codechicken.lib.vec.Vector3.center).with(new Translation(x, y, z)), new IconTransformation(icon), new ColourMultiplier(colour));
|
||||
}
|
||||
|
||||
public void renderPartShine(CCModel cc) {
|
||||
public void renderPartShine(CCModel cc)
|
||||
{
|
||||
cc.render(null, 0, 0);
|
||||
}
|
||||
}
|
|
@ -1,5 +1,9 @@
|
|||
package resonantinduction.wire;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import universalelectricity.core.vector.Vector3;
|
||||
|
||||
/**
|
||||
|
@ -12,8 +16,7 @@ import universalelectricity.core.vector.Vector3;
|
|||
|
||||
public enum EnumWireMaterial
|
||||
{
|
||||
COPPER(12.5f, 3, 2, new Vector3(184, 115, 51)),
|
||||
TIN(13, 2, 0.5f, new Vector3(132, 132, 130)),
|
||||
COPPER(12.5f, 3, 2, new Vector3(184, 115, 51)), TIN(13, 2, 0.5f, new Vector3(132, 132, 130)),
|
||||
IRON(0.1f, 2, 4, new Vector3(97, 102, 105)),
|
||||
ALUMINUM(0.025f, 6, 0.15f, new Vector3(215, 205, 181)),
|
||||
SILVER(0.005f, 1, 2, new Vector3(192, 192, 192)),
|
||||
|
@ -23,6 +26,7 @@ public enum EnumWireMaterial
|
|||
public final float damage;
|
||||
public final float maxAmps;
|
||||
public final Vector3 color;
|
||||
private ItemStack wire;
|
||||
|
||||
EnumWireMaterial(float resistance, float electrocutionDamage, float maxAmps, Vector3 color)
|
||||
{
|
||||
|
@ -31,4 +35,35 @@ public enum EnumWireMaterial
|
|||
this.maxAmps = maxAmps;
|
||||
this.color = color.scale(1D / 255D);
|
||||
}
|
||||
|
||||
public ItemStack getWire()
|
||||
{
|
||||
return this.getWire(1);
|
||||
}
|
||||
|
||||
public ItemStack getWire(int amount)
|
||||
{
|
||||
ItemStack returnStack = this.wire.copy();
|
||||
returnStack.stackSize = amount;
|
||||
return returnStack;
|
||||
}
|
||||
|
||||
public void setWire(ItemStack item)
|
||||
{
|
||||
if (this.wire == null)
|
||||
{
|
||||
this.wire = item;
|
||||
OreDictionary.registerOre(this.name().toLowerCase() + "Wire", this.wire);
|
||||
}
|
||||
}
|
||||
|
||||
public void setWire(Item item)
|
||||
{
|
||||
this.setWire(new ItemStack(item, 1, this.ordinal()));
|
||||
}
|
||||
|
||||
public void setWire(Block block)
|
||||
{
|
||||
this.setWire(new ItemStack(block, 1, this.ordinal()));
|
||||
}
|
||||
}
|
|
@ -3,8 +3,10 @@ package resonantinduction.wire;
|
|||
public interface IInsulation
|
||||
{
|
||||
public boolean isInsulated();
|
||||
|
||||
public void setInsulated(boolean insulated);
|
||||
|
||||
public int getInsulationColor();
|
||||
|
||||
public void setInsulationColor(int dyeID);
|
||||
}
|
||||
|
|
|
@ -99,6 +99,7 @@ public class TileEntityWire extends TileEntityUniversalConductor implements IPac
|
|||
return getMaterial().maxAmps;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumWireMaterial getMaterial()
|
||||
{
|
||||
return EnumWireMaterial.values()[this.getTypeID()];
|
||||
|
|
|
@ -2,12 +2,6 @@ package resonantinduction.wire.multipart;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import resonantinduction.ResonantInduction;
|
||||
import resonantinduction.TabRI;
|
||||
import resonantinduction.render.RenderPartWire;
|
||||
import resonantinduction.wire.EnumWireMaterial;
|
||||
import universalelectricity.core.electricity.ElectricityDisplay;
|
||||
import universalelectricity.core.electricity.ElectricityDisplay.ElectricUnit;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
@ -15,6 +9,12 @@ import net.minecraft.item.ItemStack;
|
|||
import net.minecraft.util.Icon;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.Configuration;
|
||||
import resonantinduction.ResonantInduction;
|
||||
import resonantinduction.TabRI;
|
||||
import resonantinduction.render.RenderPartWire;
|
||||
import resonantinduction.wire.EnumWireMaterial;
|
||||
import universalelectricity.core.electricity.ElectricityDisplay;
|
||||
import universalelectricity.core.electricity.ElectricityDisplay.ElectricUnit;
|
||||
import codechicken.lib.vec.BlockCoord;
|
||||
import codechicken.lib.vec.Vector3;
|
||||
import codechicken.multipart.JItemMultiPart;
|
||||
|
|
|
@ -1,10 +1,6 @@
|
|||
package resonantinduction.wire.multipart;
|
||||
|
||||
import codechicken.multipart.TileMultipart;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import universalelectricity.core.block.IConductor;
|
||||
import universalelectricity.core.block.IConnector;
|
||||
|
@ -13,6 +9,7 @@ import universalelectricity.core.electricity.NetworkLoader;
|
|||
import universalelectricity.core.grid.IElectricityNetwork;
|
||||
import universalelectricity.core.vector.Vector3;
|
||||
import universalelectricity.core.vector.VectorHelper;
|
||||
import codechicken.multipart.TileMultipart;
|
||||
|
||||
public abstract class PartConductor extends PartAdvanced implements IConductor
|
||||
{
|
||||
|
@ -95,6 +92,7 @@ public abstract class PartConductor extends PartAdvanced implements IConductor
|
|||
|
||||
/**
|
||||
* Override if there are ways of preventing a connection
|
||||
*
|
||||
* @param tile The TileEntity on the given side
|
||||
* @param side The side we're checking
|
||||
* @return Whether we're preventing connections on given side or to given tileEntity
|
||||
|
@ -180,9 +178,8 @@ public abstract class PartConductor extends PartAdvanced implements IConductor
|
|||
}
|
||||
|
||||
/**
|
||||
* Should include connections that are in the current connection maps
|
||||
* even if those connections aren't allowed any more. This is so that
|
||||
* networks split correctly.
|
||||
* Should include connections that are in the current connection maps even if those connections
|
||||
* aren't allowed any more. This is so that networks split correctly.
|
||||
*/
|
||||
@Override
|
||||
public TileEntity[] getAdjacentConnections()
|
||||
|
|
|
@ -1,24 +1,21 @@
|
|||
package resonantinduction.wire.multipart;
|
||||
|
||||
import ic2.api.energy.event.EnergyTileLoadEvent;
|
||||
import ic2.api.energy.event.EnergyTileUnloadEvent;
|
||||
import ic2.api.energy.tile.IEnergySink;
|
||||
import ic2.api.energy.tile.IEnergyTile;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import universalelectricity.compatibility.Compatibility;
|
||||
import universalelectricity.core.block.IConnector;
|
||||
import universalelectricity.core.block.INetworkProvider;
|
||||
import universalelectricity.core.electricity.ElectricityPack;
|
||||
import universalelectricity.core.vector.Vector3;
|
||||
import universalelectricity.core.vector.VectorHelper;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import ic2.api.energy.event.EnergyTileLoadEvent;
|
||||
import ic2.api.energy.event.EnergyTileUnloadEvent;
|
||||
import ic2.api.energy.tile.IEnergyAcceptor;
|
||||
import ic2.api.energy.tile.IEnergyEmitter;
|
||||
import ic2.api.energy.tile.IEnergySink;
|
||||
import ic2.api.energy.tile.IEnergyTile;
|
||||
import universalelectricity.compatibility.Compatibility;
|
||||
import universalelectricity.core.electricity.ElectricityPack;
|
||||
import universalelectricity.core.vector.Vector3;
|
||||
import universalelectricity.core.vector.VectorHelper;
|
||||
import buildcraft.api.power.IPowerReceptor;
|
||||
import buildcraft.api.power.PowerHandler;
|
||||
import buildcraft.api.power.PowerHandler.PowerReceiver;
|
||||
|
@ -52,10 +49,6 @@ public abstract class PartUniversalConductor extends PartConductor implements IE
|
|||
return super.isValidAcceptor(tile);
|
||||
}
|
||||
|
||||
/*
|
||||
* @Override public boolean canUpdate() { return !this.isAddedToEnergyNet; }
|
||||
*/
|
||||
|
||||
@Override
|
||||
public void onWorldJoin()
|
||||
{
|
||||
|
@ -110,7 +103,9 @@ public abstract class PartUniversalConductor extends PartConductor implements IE
|
|||
}
|
||||
|
||||
@Override
|
||||
public void onRemoved() {}
|
||||
public void onRemoved()
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preRemove()
|
||||
|
|
|
@ -7,12 +7,6 @@ import java.util.HashSet;
|
|||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import resonantinduction.ResonantInduction;
|
||||
import resonantinduction.render.RenderPartWire;
|
||||
import resonantinduction.wire.EnumWireMaterial;
|
||||
import resonantinduction.wire.IInsulatedMaterial;
|
||||
import resonantinduction.wire.IInsulation;
|
||||
import resonantinduction.wire.IWireMaterial;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockColored;
|
||||
import net.minecraft.client.particle.EffectRenderer;
|
||||
|
@ -23,16 +17,16 @@ import net.minecraft.item.ItemShears;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.tileentity.TileEntityFurnace;
|
||||
import net.minecraft.util.Icon;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
|
||||
import resonantinduction.ResonantInduction;
|
||||
import resonantinduction.render.RenderPartWire;
|
||||
import resonantinduction.wire.EnumWireMaterial;
|
||||
import resonantinduction.wire.IInsulatedMaterial;
|
||||
import resonantinduction.wire.IInsulation;
|
||||
import resonantinduction.wire.IWireMaterial;
|
||||
import universalelectricity.compatibility.Compatibility;
|
||||
import universalelectricity.core.block.IConductor;
|
||||
import universalelectricity.core.block.INetworkProvider;
|
||||
import universalelectricity.core.vector.Vector3;
|
||||
import universalelectricity.core.vector.VectorHelper;
|
||||
import buildcraft.api.power.PowerHandler;
|
||||
import codechicken.lib.data.MCDataInput;
|
||||
import codechicken.lib.data.MCDataOutput;
|
||||
|
@ -113,6 +107,7 @@ public class PartWire extends PartUniversalConductor implements TSlottedPart, JN
|
|||
return super.canConnect(direction);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean connectionPrevented(TileEntity tile, ForgeDirection side)
|
||||
{
|
||||
if (tile instanceof IWireMaterial)
|
||||
|
@ -134,6 +129,7 @@ public class PartWire extends PartUniversalConductor implements TSlottedPart, JN
|
|||
return (this.isBlockedOnSide(side) || tile instanceof IBlockableConnection && ((IBlockableConnection) tile).isBlockedOnSide(side.getOpposite()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte getPossibleWireConnections()
|
||||
{
|
||||
if (this.world().isBlockIndirectlyGettingPowered(this.x(), this.y(), this.z()))
|
||||
|
@ -143,6 +139,7 @@ public class PartWire extends PartUniversalConductor implements TSlottedPart, JN
|
|||
return super.getPossibleWireConnections();
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte getPossibleAcceptorConnections()
|
||||
{
|
||||
if (this.world().isBlockIndirectlyGettingPowered(this.x(), this.y(), this.z()))
|
||||
|
@ -164,6 +161,7 @@ public class PartWire extends PartUniversalConductor implements TSlottedPart, JN
|
|||
return getMaterial().maxAmps;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumWireMaterial getMaterial()
|
||||
{
|
||||
return material;
|
||||
|
@ -314,7 +312,7 @@ public class PartWire extends PartUniversalConductor implements TSlottedPart, JN
|
|||
@Override
|
||||
public ItemStack pickItem(MovingObjectPosition hit)
|
||||
{
|
||||
return new ItemStack(ResonantInduction.itemPartWire, 1, this.getTypeID());
|
||||
return EnumWireMaterial.values()[this.getTypeID()].getWire();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -345,8 +343,6 @@ public class PartWire extends PartUniversalConductor implements TSlottedPart, JN
|
|||
return true;
|
||||
}
|
||||
}
|
||||
if (!world().isRemote)
|
||||
player.addChatMessage(getNetwork().toString());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -395,7 +391,7 @@ public class PartWire extends PartUniversalConductor implements TSlottedPart, JN
|
|||
this.dyeID = DEFAULT_COLOR;
|
||||
this.refresh();
|
||||
this.world().markBlockForUpdate(this.x(), this.y(), this.z());
|
||||
((TileMultipart) this.tile()).notifyPartChange(this);
|
||||
this.tile().notifyPartChange(this);
|
||||
}
|
||||
|
||||
public void setInsulated(int dyeColour)
|
||||
|
@ -404,7 +400,7 @@ public class PartWire extends PartUniversalConductor implements TSlottedPart, JN
|
|||
this.dyeID = dyeColour;
|
||||
this.refresh();
|
||||
this.world().markBlockForUpdate(this.x(), this.y(), this.z());
|
||||
((TileMultipart) this.tile()).notifyPartChange(this);
|
||||
this.tile().notifyPartChange(this);
|
||||
}
|
||||
|
||||
public void setInsulated()
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
package resonantinduction.wire.multipart.javatraits;
|
||||
|
||||
import java.util.Set;
|
||||
import ic2.api.energy.tile.IEnergySink;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import ic2.api.energy.tile.IEnergySink;
|
||||
import codechicken.multipart.TMultiPart;
|
||||
import codechicken.multipart.TileMultipart;
|
||||
|
||||
|
@ -34,7 +35,7 @@ public class TEnergySink extends TileMultipart implements IEnergySink
|
|||
{
|
||||
super.partRemoved(part, p);
|
||||
if (part instanceof IEnergySink)
|
||||
ic2Sinks.remove((IEnergySink)part);
|
||||
ic2Sinks.remove(part);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -44,7 +45,6 @@ public class TEnergySink extends TileMultipart implements IEnergySink
|
|||
ic2Sinks.clear();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean acceptsEnergyFrom(TileEntity emitter, ForgeDirection direction)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue