Fixed IMechanicalNode dependent on MechanicalNode

This commit is contained in:
Calclavia 2014-03-12 18:50:04 +08:00
parent 747c851a8c
commit edff518b72
10 changed files with 22 additions and 18 deletions

View file

@ -8,7 +8,6 @@ import resonantinduction.api.IMechanicalNode;
import resonantinduction.core.grid.INode;
import resonantinduction.core.grid.INodeProvider;
import resonantinduction.core.grid.NodeRegistry;
import resonantinduction.mechanical.energy.grid.MechanicalNode;
import universalelectricity.api.energy.EnergyStorageHandler;
import calclavia.lib.prefab.tile.IRotatable;
import calclavia.lib.prefab.tile.TileElectrical;

View file

@ -36,8 +36,8 @@ public class GuiMultimeter extends GuiContainerBase
{
super.initGui();
this.buttonList.add(new GuiButton(0, this.width / 2 + 20, this.height / 2 - 23, 50, 20, LanguageUtility.getLocal("gui.resonantinduction.multimeter.toggle")));
this.buttonList.add(new GuiButton(1, this.width / 2 - 80, this.height / 2 - 75, 100, 20, "Toggle Detection"));
this.buttonList.add(new GuiButton(2, this.width / 2 - 80, this.height / 2 + 0, 80, 20, "Toggle Graph"));
this.buttonList.add(new GuiButton(1, this.width / 2 - 80, this.height / 2 - 75, 100, 20, LanguageUtility.getLocal("gui.resonantinduction.multimeter.toggleDetection")));
this.buttonList.add(new GuiButton(2, this.width / 2 - 80, this.height / 2 + 0, 80, 20, LanguageUtility.getLocal("gui.resonantinduction.multimeter.toggleGraph")));
this.textFieldLimit = new GuiTextField(fontRenderer, 9, 90, 90, 12);
this.textFieldLimit.setMaxStringLength(8);
this.textFieldLimit.setText("" + this.multimeter.redstoneTriggerLimit);
@ -92,7 +92,7 @@ public class GuiMultimeter extends GuiContainerBase
this.fontRenderer.drawString(s, this.xSize / 2 - this.fontRenderer.getStringWidth(s) / 2, 6, 4210752);
this.fontRenderer.drawString(EnumColor.INDIGO + "Detection Type", 9, 20, 4210752);
this.fontRenderer.drawString(multimeter.getNetwork().getDisplay(multimeter.detectType), 9, 60, 4210752);
this.fontRenderer.drawString("Logic: " + EnumColor.RED + LanguageUtility.getLocal("gui.resonantinduction.multimeter." + this.multimeter.getMode().display), 9, 75, 4210752);
this.fontRenderer.drawString(LanguageUtility.getLocal("gui.resonantinduction.multimeter.logic")+" " + EnumColor.RED + LanguageUtility.getLocal("gui.resonantinduction.multimeter." + this.multimeter.getMode().display), 9, 75, 4210752);
this.fontRenderer.drawString(graphName, 95, 115, 4210752);
this.textFieldLimit.drawTextBox();
}

View file

@ -11,6 +11,7 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeDirection;
import resonantinduction.api.IMechanicalNode;
import resonantinduction.core.Reference;
import resonantinduction.core.grid.INode;
import resonantinduction.core.grid.INodeProvider;
@ -317,7 +318,7 @@ public class PartGear extends PartMechanical implements IMultiBlockStructure<Par
}
@Override
public float getRatio(ForgeDirection dir, MechanicalNode with)
public float getRatio(ForgeDirection dir, IMechanicalNode with)
{
universalelectricity.api.vector.Vector3 deltaPos = with.position().subtract(position());

View file

@ -7,6 +7,7 @@ import java.util.Set;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.ForgeDirection;
import resonantinduction.api.IMechanicalNode;
import resonantinduction.core.grid.INodeProvider;
import resonantinduction.mechanical.Mechanical;
import resonantinduction.mechanical.energy.grid.MechanicalNode;
@ -146,7 +147,7 @@ public class PartGearShaft extends PartMechanical
}
@Override
public boolean inverseRotation(ForgeDirection dir, MechanicalNode with)
public boolean inverseRotation(ForgeDirection dir, IMechanicalNode with)
{
if (placementSide.offsetY != 0 || placementSide.offsetZ != 0)
{

View file

@ -171,13 +171,13 @@ public class MechanicalNode extends Node<INodeProvider, TickingGrid, MechanicalN
}
@Override
public float getRatio(ForgeDirection dir, MechanicalNode with)
public float getRatio(ForgeDirection dir, IMechanicalNode with)
{
return 0.5f;
}
@Override
public boolean inverseRotation(ForgeDirection dir, MechanicalNode with)
public boolean inverseRotation(ForgeDirection dir, IMechanicalNode with)
{
return true;
}

View file

@ -3,6 +3,7 @@ package resonantinduction.mechanical.energy.turbine;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.ForgeDirection;
import resonantinduction.api.IMechanicalNode;
import resonantinduction.core.grid.INode;
import resonantinduction.core.grid.INodeProvider;
import resonantinduction.mechanical.energy.grid.MechanicalNode;
@ -42,13 +43,13 @@ public class TileMechanicalTurbine extends TileTurbine implements INodeProvider
}
@Override
public boolean inverseRotation(ForgeDirection dir, MechanicalNode with)
public boolean inverseRotation(ForgeDirection dir, IMechanicalNode with)
{
return true;
}
@Override
public float getRatio(ForgeDirection dir, MechanicalNode with)
public float getRatio(ForgeDirection dir, IMechanicalNode with)
{
return getMultiBlock().isConstructed() ? multiBlockRadius - 0.5f : 0.5f;
}

View file

@ -10,13 +10,13 @@ import net.minecraftforge.common.ForgeDirection;
import org.apache.commons.lang3.ArrayUtils;
import resonantinduction.api.IMechanicalNode;
import resonantinduction.api.recipe.MachineRecipes;
import resonantinduction.api.recipe.MachineRecipes.RecipeType;
import resonantinduction.api.recipe.RecipeResource;
import resonantinduction.archaic.filter.Timer;
import resonantinduction.core.Reference;
import resonantinduction.core.ResonantInduction;
import resonantinduction.mechanical.energy.grid.MechanicalNode;
import resonantinduction.mechanical.energy.grid.TileMechanical;
import universalelectricity.api.vector.Vector3;
import calclavia.lib.prefab.tile.IRotatable;
@ -55,7 +55,7 @@ public class TileGrindingWheel extends TileMechanical implements IRotatable
}
@Override
public boolean inverseRotation(ForgeDirection dir, MechanicalNode with)
public boolean inverseRotation(ForgeDirection dir, IMechanicalNode with)
{
return !(dir.offsetX > 0 || dir.offsetZ < 0 || dir.offsetY < 0);
}

View file

@ -12,13 +12,13 @@ import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.util.AxisAlignedBB;
import net.minecraftforge.common.ForgeDirection;
import resonantinduction.api.IMechanicalNode;
import resonantinduction.api.recipe.MachineRecipes;
import resonantinduction.api.recipe.MachineRecipes.RecipeType;
import resonantinduction.archaic.filter.Timer;
import resonantinduction.core.Reference;
import resonantinduction.core.resource.ResourceGenerator;
import resonantinduction.core.resource.fluid.BlockFluidMixture;
import resonantinduction.mechanical.energy.grid.MechanicalNode;
import resonantinduction.mechanical.energy.grid.TileMechanical;
import universalelectricity.api.vector.Vector3;
import calclavia.lib.utility.inventory.InventoryUtility;
@ -38,7 +38,7 @@ public class TileMixer extends TileMechanical implements IInventory
mechanicalNode = new PacketMechanicalNode(this)
{
@Override
public boolean inverseRotation(ForgeDirection dir, MechanicalNode with)
public boolean inverseRotation(ForgeDirection dir, IMechanicalNode with)
{
return dir == ForgeDirection.DOWN;
}

View file

@ -1,7 +1,7 @@
package resonantinduction.api;
import resonantinduction.mechanical.energy.grid.MechanicalNode;
import net.minecraftforge.common.ForgeDirection;
import universalelectricity.api.vector.Vector3;
public interface IMechanicalNode extends IEnergyNode
{
@ -11,9 +11,11 @@ public interface IMechanicalNode extends IEnergyNode
public void apply(double torque, double angularVelocity);
public float getRatio(ForgeDirection dir, MechanicalNode with);
public float getRatio(ForgeDirection dir, IMechanicalNode with);
public boolean inverseRotation(ForgeDirection dir, MechanicalNode with);
public boolean inverseRotation(ForgeDirection dir, IMechanicalNode with);
public IMechanicalNode setLoad(double load);
public Vector3 position();
}

@ -1 +1 @@
Subproject commit b844cd552de8c92eff809688b259c3b3a0600980
Subproject commit 2e44e1e10066c5e30f5e707fffbf70f159c50cca