This commit is contained in:
Calclavia 2014-01-19 21:03:03 +08:00
parent 2bbc93b70a
commit ef478755b1
53 changed files with 562 additions and 601 deletions

View file

@ -7,39 +7,48 @@ import net.minecraftforge.fluids.FluidTankInfo;
import net.minecraftforge.fluids.IFluidHandler;
import universalelectricity.api.net.INetwork;
/** Interface version of the fluid network.
/**
* Interface version of the fluid network.
*
* @author DarkGuardsman */
* @author DarkGuardsman
*/
public interface IFluidNetwork extends INetwork<IFluidNetwork, IFluidConnector, IFluidHandler>
{
/** Called to build the network when something changes such as addition of a pipe */
@Override
void reconstruct();
/** Called to add fluid into the network
/**
* Called to add fluid into the network
*
* @param source - part that is receiving the fluid for the network
* @param from - direction of this connection
* @param resource - fluid stack that is being filled into the network
* @param doFill - true causes the action to be taken, false simulates the action
* @return amount of fluid filled into the network */
* @return amount of fluid filled into the network
*/
int fill(IFluidConnector source, ForgeDirection from, FluidStack resource, boolean doFill);
/** Called to remove fluid from a network, not supported by all networks
/**
* Called to remove fluid from a network, not supported by all networks
*
* @param source - part that is receiving the fluid for the network
* @param from - direction of this connection
* @param resource - fluid stack that is being filled into the network
* @param doDrain - true causes the action to be taken, false simulates the action
* @return FluidStack that contains the fluid drained from the network */
* @return FluidStack that contains the fluid drained from the network
*/
FluidStack drain(IFluidConnector source, ForgeDirection from, FluidStack resource, boolean doDrain);
/** Called to remove fluid from a network, not supported by all networks
/**
* Called to remove fluid from a network, not supported by all networks
*
* @param source - part that is receiving the fluid for the network
* @param from - direction of this connection
* @param resource - fluid stack that is being filled into the network
* @param doDrain - true causes the action to be taken, false simulates the action
* @return FluidStack that contains the fluid drained from the network */
* @return FluidStack that contains the fluid drained from the network
*/
FluidStack drain(IFluidConnector source, ForgeDirection from, int resource, boolean doDrain);
/** Fluid tank that represents the entire network */

View file

@ -2,9 +2,11 @@ package resonantinduction.api.fluid;
import net.minecraftforge.common.ForgeDirection;
/** Applied to tiles that work with pressure for there inputs
/**
* Applied to tiles that work with pressure for there inputs
*
* @author DarkGaurdsman */
* @author DarkGaurdsman
*/
public interface IPressureInput
{
public int getPressureIn(ForgeDirection side);

View file

@ -2,9 +2,11 @@ package resonantinduction.api.fluid;
import net.minecraftforge.common.ForgeDirection;
/** Applied to tiles that are a source of pressure in a fluid network
/**
* Applied to tiles that are a source of pressure in a fluid network
*
* @author Darkguardsman */
* @author Darkguardsman
*/
public interface IPressureOutput
{
public int getPressureOut(ForgeDirection side);

View file

@ -3,14 +3,9 @@ package resonantinduction.archaic.blocks;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.Icon;
import net.minecraft.util.MathHelper;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeDirection;

View file

@ -2,7 +2,6 @@ package resonantinduction.archaic.firebox;
import java.util.Random;
import codechicken.multipart.ControlKeyModifer;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.entity.player.EntityPlayer;
@ -12,8 +11,6 @@ import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import resonantinduction.core.Reference;
import resonantinduction.core.prefab.block.BlockRI;
import universalelectricity.api.vector.Vector3;
import calclavia.lib.utility.inventory.InventoryUtility;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;

View file

@ -3,8 +3,6 @@ package resonantinduction.archaic.firebox;
import java.util.List;
import java.util.Random;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
@ -19,6 +17,8 @@ import resonantinduction.core.Reference;
import resonantinduction.core.prefab.block.BlockRI;
import universalelectricity.api.vector.Vector2;
import universalelectricity.api.vector.Vector3;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockHotPlate extends BlockRI
{
@ -134,12 +134,12 @@ public class BlockHotPlate extends BlockRI
for (int spawn = 0; spawn < maxParticles; spawn++)
{
Vector3 particlePosition = new Vector3(x, y, z).translate((double) (i / 2) / ((double) 2) + (0.5 / ((double) 2)), 0.2, (double) (i % 2) / ((double) 2) + (0.5 / ((double) 2)));
Vector3 particlePosition = new Vector3(x, y, z).translate((double) (i / 2) / ((double) 2) + (0.5 / (2)), 0.2, (double) (i % 2) / ((double) 2) + (0.5 / (2)));
particlePosition.translate(new Vector3((random.nextFloat() - 0.5) * 0.2, (random.nextFloat() - 0.5) * 0.2, (random.nextFloat() - 0.5) * 0.2));
world.spawnParticle("smoke", particlePosition.x, particlePosition.y, particlePosition.z, 0.0D, 0.0D, 0.0D);
}
Vector3 particlePosition = new Vector3(x, y, z).translate((double) (i / 2) / ((double) 2) + (0.5 / ((double) 2)), 0.2, (double) (i % 2) / ((double) 2) + (0.5 / ((double) 2)));
Vector3 particlePosition = new Vector3(x, y, z).translate((double) (i / 2) / ((double) 2) + (0.5 / (2)), 0.2, (double) (i % 2) / ((double) 2) + (0.5 / (2)));
world.spawnParticle("flame", particlePosition.x, particlePosition.y, particlePosition.z, 0.0D, 0.01D, 0.0D);
}
}

View file

@ -5,16 +5,10 @@ import java.util.ArrayList;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.FurnaceRecipes;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.network.packet.Packet;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.tileentity.TileEntityFurnace;
import net.minecraftforge.common.ForgeDirection;
import resonantinduction.core.ResonantInduction;
import resonantinduction.core.Settings;
import universalelectricity.api.CompatibilityModule;
import universalelectricity.api.vector.Vector3;
import calclavia.lib.network.IPacketReceiver;
import calclavia.lib.network.IPacketSender;
import calclavia.lib.prefab.tile.TileExternalInventory;

View file

@ -7,9 +7,7 @@ import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import net.minecraftforge.fluids.FluidStack;
import resonantinduction.mechanical.Mechanical;
import resonantinduction.mechanical.fluid.prefab.TileFluidNetwork;
import calclavia.lib.render.ColorCode;
/**
* Enum to hold info about each pipe material. Values are by default and some can change with pipe

View file

@ -17,8 +17,6 @@ import resonantinduction.core.resource.ResourceGenerator;
import resonantinduction.core.resource.fluid.BlockFluidMixture;
import resonantinduction.core.resource.fluid.TileFluidMixture;
import resonantinduction.core.resource.item.ItemOreResource;
import calclavia.lib.multiblock.fake.BlockMultiFake;
import calclavia.lib.multiblock.fake.TileMultiBlockPart;
import calclavia.lib.network.PacketHandler;
import calclavia.lib.network.PacketTile;
import calclavia.lib.utility.LanguageUtility;

View file

@ -30,6 +30,7 @@ public class ContainerDummy extends Container
}
}
@Override
public void onContainerClosed(EntityPlayer player)
{
if (tile instanceof IPlayerUsing)

View file

@ -1,6 +1,5 @@
package resonantinduction.core.prefab.block;
import net.minecraft.block.material.Material;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;

View file

@ -1,6 +1,5 @@
package resonantinduction.core.prefab.block;
import codechicken.multipart.ControlKeyModifer;
import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraftforge.common.Configuration;
@ -9,6 +8,7 @@ import resonantinduction.core.ResonantInductionTabs;
import resonantinduction.core.Settings;
import universalelectricity.api.UniversalElectricity;
import calclavia.lib.prefab.block.BlockTile;
import codechicken.multipart.ControlKeyModifer;
/**
* Basic prefab for machine

View file

@ -1,6 +1,5 @@
package resonantinduction.core.prefab.block;
import net.minecraft.block.material.Material;
import net.minecraftforge.common.Configuration;
import resonantinduction.core.Reference;
import resonantinduction.core.ResonantInductionTabs;

View file

@ -3,8 +3,6 @@ package resonantinduction.core.prefab.part;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.block.BlockColored;
import net.minecraft.item.ItemStack;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;

View file

@ -12,7 +12,6 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.MovingObjectPosition;
import resonantinduction.core.Utility;
import resonantinduction.electrical.wire.EnumWireMaterial;
import codechicken.lib.data.MCDataInput;
import codechicken.lib.data.MCDataOutput;

View file

@ -4,16 +4,13 @@ import java.util.Collection;
import java.util.HashSet;
import java.util.Set;
import resonantinduction.mechanical.fluid.pipe.PartPipe;
import net.minecraft.client.particle.EffectRenderer;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.Icon;
import net.minecraft.util.MovingObjectPosition;
import net.minecraftforge.common.ForgeDirection;
import universalelectricity.api.CompatibilityModule;
import universalelectricity.api.net.IConnector;
import universalelectricity.api.net.INetwork;
import universalelectricity.api.vector.Vector3;

View file

@ -52,7 +52,7 @@ public abstract class RenderItemOverlayTile extends TileEntitySpecialRenderer
{
if (inventory[i] != null)
{
Vector3 translation = new Vector3(x + (double) (i / matrixX) / ((double) matrixX) + (0.5 / ((double) matrixX)), y + 1.1, z + (double) (i % matrixZ) / ((double) matrixZ) + (0.5 / ((double) matrixZ)));
Vector3 translation = new Vector3(x + (double) (i / matrixX) / ((double) matrixX) + (0.5 / (matrixX)), y + 1.1, z + (double) (i % matrixZ) / ((double) matrixZ) + (0.5 / (matrixZ)));
GL11.glPushMatrix();
GL11.glTranslated(translation.x, translation.y, translation.z);
GL11.glScalef(0.7f, 0.7f, 0.7f);
@ -243,9 +243,9 @@ public abstract class RenderItemOverlayTile extends TileEntitySpecialRenderer
entityitem.getEntityItem().stackSize = 1;
entityitem.hoverStart = 0.0F;
GL11.glPushMatrix();
GL11.glTranslated(-0.453125F * (float) dir.offsetX + position.x, position.y, -0.453125F * (float) dir.offsetZ + position.z);
GL11.glTranslated(-0.453125F * dir.offsetX + position.x, position.y, -0.453125F * dir.offsetZ + position.z);
GL11.glRotatef(180.0F + rotationYaw, 0.0F, 1.0F, 0.0F);
GL11.glRotatef((float) (90 * angle), 1, 0, 0);
GL11.glRotatef(90 * angle, 1, 0, 0);
RenderItem.renderInFrame = true;
RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F);

View file

@ -23,7 +23,6 @@ import resonantinduction.api.recipe.MachineRecipes.RecipeType;
import resonantinduction.api.recipe.OreDetectionBlackList;
import resonantinduction.core.Reference;
import resonantinduction.core.ResonantInduction;
import resonantinduction.core.resource.item.ItemOreResource;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;

View file

@ -1,15 +1,11 @@
package resonantinduction.core.resource.item;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.oredict.OreDictionary;
import resonantinduction.core.Reference;
import resonantinduction.core.ResonantInduction;
import resonantinduction.core.prefab.item.ItemBase;
import resonantinduction.core.resource.ResourceGenerator;
import calclavia.lib.utility.LanguageUtility;

View file

@ -28,12 +28,12 @@ public class CommonProxy extends ProxyBase
{
return new ContainerMultimeter(player.inventory, ((PartMultimeter) part));
}
}else if (tileEntity instanceof TileEncoder)
}
else if (tileEntity instanceof TileEncoder)
{
return new ContainerEncoder(player.inventory, (TileEncoder) tileEntity);
}
return null;
}

View file

@ -11,7 +11,6 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
import net.minecraftforge.common.Configuration;
import resonantinduction.core.ResonantInduction;
import resonantinduction.core.prefab.block.BlockRI;
import resonantinduction.core.render.RIBlockRenderingHandler;
import calclavia.components.CalclaviaLoader;

View file

@ -49,7 +49,7 @@ public class GuiEncoderCoder extends GuiEncoderBase
protected void actionPerformed(GuiButton button)
{
super.actionPerformed(button);
if (((TileEncoder) tileEntity).getProgram() != null)
if (tileEntity.getProgram() != null)
{
switch (button.id)
{
@ -101,7 +101,7 @@ public class GuiEncoderCoder extends GuiEncoderBase
{
super.handleMouseInput();
int wheel = Mouse.getEventDWheel();
if (((TileEncoder) tileEntity).getProgram() != null)
if (tileEntity.getProgram() != null)
{
if (wheel > 0)
{
@ -121,7 +121,7 @@ public class GuiEncoderCoder extends GuiEncoderBase
{
this.mc.thePlayer.closeScreen();
}
else if (((TileEncoder) tileEntity).getProgram() != null)
else if (tileEntity.getProgram() != null)
{
if (keycode == Keyboard.KEY_UP) // PAGE UP (no constant)
{
@ -138,7 +138,7 @@ public class GuiEncoderCoder extends GuiEncoderBase
}
else if (keycode == Keyboard.KEY_RIGHT) // PAGE RIGHT (no constant)
{
if (this.getTaskListElement().scrollX < ((TileEncoder) tileEntity).getProgram().getSize().intX())
if (this.getTaskListElement().scrollX < tileEntity.getProgram().getSize().intX())
this.getTaskListElement().scrollSide(1);
}
}
@ -181,7 +181,7 @@ public class GuiEncoderCoder extends GuiEncoderBase
public TileEncoder getTile()
{
return (TileEncoder) this.tileEntity;
return this.tileEntity;
}
}

View file

@ -636,7 +636,7 @@ public class TileTesla extends TileElectrical implements IMultiBlockStructure<Ti
if (t instanceof TileTesla)
{
checkPosition.add(new Vector3((TileTesla) t).subtract(getPosition()));
checkPosition.add(new Vector3(t).subtract(getPosition()));
}
else
{

View file

@ -27,7 +27,6 @@ import calclavia.lib.render.EnumColor;
import calclavia.lib.utility.LanguageUtility;
import codechicken.lib.vec.BlockCoord;
import codechicken.lib.vec.Vector3;
import codechicken.multipart.ControlKeyModifer;
import codechicken.multipart.JItemMultiPart;
import codechicken.multipart.MultiPartRegistry;
import codechicken.multipart.TMultiPart;

View file

@ -254,6 +254,7 @@ public abstract class PartAdvancedWire extends PartConductor
return false;
}
@Override
protected ItemStack getItem()
{
return EnumWireMaterial.values()[getMaterialID()].getWire();
@ -328,6 +329,7 @@ public abstract class PartAdvancedWire extends PartConductor
this.color = nbt.getInteger("dyeID");
}
@Override
protected boolean checkRedstone(int side)
{
if (this.world().isBlockIndirectlyGettingPowered(x(), y(), z()))

View file

@ -16,8 +16,6 @@ import resonantinduction.core.ResonantInduction;
import resonantinduction.mechanical.Mechanical;
import resonantinduction.mechanical.network.IMechanical;
import resonantinduction.mechanical.network.IMechanicalConnector;
import resonantinduction.mechanical.network.IMechanicalNetwork;
import resonantinduction.mechanical.network.MechanicalNetwork;
import resonantinduction.mechanical.network.TileMechanical;
import universalelectricity.api.vector.Vector3;
import calclavia.lib.network.IPacketReceiverWithID;

View file

@ -3,13 +3,10 @@ package resonantinduction.mechanical.fluid.pipe;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import net.minecraftforge.fluids.FluidStack;
import resonantinduction.mechanical.Mechanical;
import resonantinduction.mechanical.fluid.prefab.TileFluidNetwork;
import calclavia.lib.render.ColorCode;
/**
* Enum to hold info about each pipe material. Values are by default and some can change with pipe

View file

@ -17,7 +17,6 @@ import resonantinduction.api.fluid.IFluidPipe;
import resonantinduction.core.prefab.part.PartFramedConnection;
import resonantinduction.mechanical.Mechanical;
import resonantinduction.mechanical.fluid.network.PipeNetwork;
import resonantinduction.mechanical.fluid.tank.TileTank;
import codechicken.microblock.IHollowConnect;
import codechicken.multipart.JIconHitEffects;
import codechicken.multipart.JNormalOcclusion;
@ -204,7 +203,7 @@ public class PartPipe extends PartFramedConnection<EnumPipeMaterial, IFluidPipe,
public void save(NBTTagCompound nbt)
{
super.save(nbt);
nbt.setBoolean("isExtracting", isInsulated);
nbt.setBoolean("isExtracting", isExtracting);
}
@Override

View file

@ -9,9 +9,6 @@ import org.lwjgl.opengl.GL11;
import resonantinduction.core.Reference;
import resonantinduction.mechanical.fluid.prefab.TileFluidNetwork;
import com.builtbroken.common.Pair;
import cpw.mods.fml.client.FMLClientHandler;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;

View file

@ -1,13 +1,10 @@
package resonantinduction.mechanical.fluid.pump;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ChatMessageComponent;
import net.minecraft.util.Icon;
import net.minecraft.util.MathHelper;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeDirection;

View file

@ -59,12 +59,6 @@ public class BlockTank extends BlockFluidNetwork
@Override
public boolean onMachineActivated(World world, int x, int y, int z, EntityPlayer entityplayer, int side, float hitX, float hitY, float hitZ)
{
if (world.getBlockTileEntity(x, y, z) instanceof TileTank)
{
System.out.println(world.isRemote + " Amount: " + ((TileTank) world.getBlockTileEntity(x, y, z)).getInternalTank().getFluidAmount());
world.markBlockForUpdate(x, y, z);
}
if (!world.isRemote)
{
return FluidUtility.playerActivatedFluidItem(world, x, y, z, entityplayer, side);

View file

@ -11,6 +11,7 @@ import org.lwjgl.opengl.GL11;
import resonantinduction.core.render.RenderFluidHelper;
import resonantinduction.electrical.Electrical;
import resonantinduction.mechanical.Mechanical;
import resonantinduction.mechanical.fluid.prefab.TileFluidNetwork;
import calclavia.lib.render.RenderUtility;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@ -33,12 +34,12 @@ public class RenderTank extends TileEntitySpecialRenderer
{
byte renderSides = ((TileTank) tileEntity).renderSides;
boolean down = TileTank.canRenderSide(renderSides, ForgeDirection.DOWN);
boolean up = TileTank.canRenderSide(renderSides, ForgeDirection.UP);
boolean north = TileTank.canRenderSide(renderSides, ForgeDirection.NORTH);
boolean south = TileTank.canRenderSide(renderSides, ForgeDirection.SOUTH);
boolean east = TileTank.canRenderSide(renderSides, ForgeDirection.EAST);
boolean west = TileTank.canRenderSide(renderSides, ForgeDirection.WEST);
boolean down = TileFluidNetwork.canRenderSide(renderSides, ForgeDirection.DOWN);
boolean up = TileFluidNetwork.canRenderSide(renderSides, ForgeDirection.UP);
boolean north = TileFluidNetwork.canRenderSide(renderSides, ForgeDirection.NORTH);
boolean south = TileFluidNetwork.canRenderSide(renderSides, ForgeDirection.SOUTH);
boolean east = TileFluidNetwork.canRenderSide(renderSides, ForgeDirection.EAST);
boolean west = TileFluidNetwork.canRenderSide(renderSides, ForgeDirection.WEST);
bindTexture(TextureMap.locationBlocksTexture);
GL11.glPushMatrix();
@ -51,7 +52,7 @@ public class RenderTank extends TileEntitySpecialRenderer
{
ForgeDirection dir = ForgeDirection.getOrientation(i);
if (!TileTank.canRenderSide(renderSides, dir))
if (!TileFluidNetwork.canRenderSide(renderSides, dir))
{
GL11.glPushMatrix();
GL11.glScalef(0.99f, 0.99f, 0.99f);

View file

@ -53,7 +53,7 @@ public class TankNetwork extends FluidNetwork
{
if (part instanceof IFluidConnector && ((TileEntity) part).yCoord == y)
{
parts.add((IFluidConnector) part);
parts.add(part);
}
}
if (!parts.isEmpty())

View file

@ -32,7 +32,7 @@ public class TileTank extends TileFluidNetwork
{
if (network instanceof TankNetwork)
{
this.network = (TankNetwork) network;
this.network = network;
}
}

View file

@ -44,7 +44,7 @@ public class PartGear extends PartMechanical implements IMechanicalConnector
@Override
public boolean activate(EntityPlayer player, MovingObjectPosition hit, ItemStack item)
{
System.out.println(world().isRemote + ": " + getNetwork());
// System.out.println(world().isRemote + ": " + getNetwork());
if (player.isSneaking())
{
this.manualCrankTime = 20;

View file

@ -12,7 +12,6 @@ import net.minecraft.world.World;
import net.minecraftforge.common.ForgeDirection;
import resonantinduction.core.Reference;
import resonantinduction.core.prefab.block.BlockImprintable;
import universalelectricity.api.UniversalElectricity;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;

View file

@ -7,7 +7,6 @@ import net.minecraft.util.ChatMessageComponent;
import net.minecraft.world.World;
import resonantinduction.core.prefab.block.BlockImprintable;
import resonantinduction.core.render.RIBlockRenderingHandler;
import universalelectricity.api.UniversalElectricity;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;

View file

@ -7,7 +7,6 @@ import net.minecraft.world.World;
import resonantinduction.core.Reference;
import resonantinduction.core.prefab.block.BlockImprintable;
import resonantinduction.core.render.RIBlockRenderingHandler;
import universalelectricity.api.UniversalElectricity;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;

View file

@ -18,8 +18,6 @@ import calclavia.lib.network.IPacketReceiverWithID;
import com.google.common.io.ByteArrayDataInput;
import cpw.mods.fml.common.network.Player;
/** @author Darkguardsman */
public class TileRejector extends TileEntityFilterable implements IPacketReceiverWithID
{

View file

@ -1,6 +1,5 @@
package resonantinduction.mechanical.network;
import universalelectricity.api.net.IConnectable;
import universalelectricity.api.net.IConnector;
/**

View file

@ -33,6 +33,7 @@ public interface IMechanicalNetwork extends INetwork<IMechanicalNetwork, IMechan
public float getPrevAngularVelocity();
/** Called to rebuild the network */
@Override
public void reconstruct();
public long onReceiveEnergy(long torque, float angularVelocity);

View file

@ -359,7 +359,7 @@ public class MechanicalNetwork extends Network<IMechanicalNetwork, IMechanicalCo
if (deltaTime > 1)
{
rotation = (float) (((angularVelocity) * ((float) deltaTime / 1000f) + rotation) % Math.PI);
rotation = (float) (((angularVelocity) * (deltaTime / 1000f) + rotation) % Math.PI);
lastRotateTime = System.currentTimeMillis();
}

View file

@ -4,17 +4,11 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.MovingObjectPosition;
import net.minecraftforge.common.ForgeDirection;
import resonantinduction.mechanical.Mechanical;
import resonantinduction.mechanical.network.IMechanical;
import resonantinduction.mechanical.network.IMechanicalConnector;
import resonantinduction.mechanical.network.IMechanicalNetwork;
import resonantinduction.mechanical.network.MechanicalNetwork;
import codechicken.lib.data.MCDataInput;
import codechicken.lib.data.MCDataOutput;
import codechicken.lib.vec.Cuboid6;
@ -27,8 +21,6 @@ import codechicken.multipart.JNormalOcclusion;
import codechicken.multipart.TFacePart;
import codechicken.multipart.TMultiPart;
import codechicken.multipart.TileMultipart;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
/**
* We assume all the force acting on the gear is 90 degrees.
@ -269,17 +261,18 @@ public abstract class PartMechanical extends JCuboidPart implements JNormalOcclu
{
if (isPositive)
{
((PartMechanical) neighbor).setClockwise(isClockwise);
neighbor.setClockwise(isClockwise);
}
else
{
((PartMechanical) neighbor).setClockwise(!isClockwise);
neighbor.setClockwise(!isClockwise);
}
neighbor.markRotationUpdate = true;
}
}
@Override
public long onReceiveEnergy(ForgeDirection from, long torque, float angularVelocity, boolean doReceive)
{
if (!world().isRemote && doReceive)
@ -367,6 +360,15 @@ public abstract class PartMechanical extends JCuboidPart implements JNormalOcclu
@Override
public void setClockwise(boolean isClockwise)
{
if (this.isClockwise != isClockwise)
{
if (getNetwork().getPower() > 0)
{
getNetwork().setPower(0, 0);
}
}
this.isClockwise = isClockwise;
}

View file

@ -1,6 +1,5 @@
package resonantinduction.mechanical.process;
import calclavia.lib.render.block.BlockRenderingHandler;
import net.minecraft.block.ITileEntityProvider;
import net.minecraft.entity.Entity;
import net.minecraft.entity.item.EntityItem;

View file

@ -2,7 +2,6 @@ package resonantinduction.mechanical.process;
import java.util.HashMap;
import calclavia.lib.prefab.tile.IRotatable;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
@ -15,6 +14,7 @@ import resonantinduction.core.Reference;
import resonantinduction.core.ResonantInduction;
import resonantinduction.mechanical.network.TileMechanical;
import universalelectricity.api.vector.Vector3;
import calclavia.lib.prefab.tile.IRotatable;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.relauncher.Side;

View file

@ -3,8 +3,8 @@ package resonantinduction.mechanical.trait;
import java.util.HashSet;
import java.util.Set;
import resonantinduction.mechanical.network.IMechanical;
import net.minecraftforge.common.ForgeDirection;
import resonantinduction.mechanical.network.IMechanical;
import codechicken.multipart.TMultiPart;
import codechicken.multipart.TileMultipart;

View file

@ -4,7 +4,6 @@ import java.util.HashSet;
import java.util.Set;
import net.minecraftforge.common.ForgeDirection;
import resonantinduction.mechanical.network.IMechanical;
import resonantinduction.mechanical.network.IMechanicalConnector;
import resonantinduction.mechanical.network.IMechanicalNetwork;
import codechicken.multipart.TMultiPart;