Some work on item railing

This commit is contained in:
Calclavia 2014-02-18 17:10:31 +08:00
parent cb864dda76
commit 4f9772a346
5 changed files with 104 additions and 10 deletions

View file

@ -28,8 +28,7 @@ public class GearMultiBlockHandler extends MultiBlockHandler<PartGear>
{
if (((PartGear) part).tier == self.tier)
{
if (!((IMultiBlockStructure) tile).getMultiBlock().isConstructed())
return (PartGear) part;
return (PartGear) part;
}
}
}

View file

@ -0,0 +1,9 @@
package resonantinduction.mechanical.logistic.rail;
import universalelectricity.api.net.IConnector;
import universalelectricity.api.net.INodeNetwork;
public interface IRailing extends IConnector<INodeNetwork>
{
}

View file

@ -0,0 +1,59 @@
package resonantinduction.mechanical.logistic.rail;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import resonantinduction.core.prefab.part.PartFramedConnection;
import resonantinduction.mechanical.fluid.pipe.EnumPipeMaterial;
import universalelectricity.api.net.INodeNetwork;
import codechicken.microblock.IHollowConnect;
import codechicken.multipart.JIconHitEffects;
import codechicken.multipart.JNormalOcclusion;
import codechicken.multipart.TSlottedPart;
public class PartRailing extends PartFramedConnection<EnumPipeMaterial, IRailing, INodeNetwork> implements IRailing, TSlottedPart, JNormalOcclusion, IHollowConnect, JIconHitEffects
{
RedstoneControl control;
@Override
protected boolean canConnectTo(TileEntity tile)
{
// TODO Auto-generated method stub
return false;
}
@Override
protected PartRailing getConnector(TileEntity tile)
{
// TODO Auto-generated method stub
return null;
}
@Override
public void setMaterial(int i)
{
// TODO Auto-generated method stub
}
@Override
protected ItemStack getItem()
{
// TODO Auto-generated method stub
return null;
}
@Override
public String getType()
{
// TODO Auto-generated method stub
return null;
}
@Override
public INodeNetwork getNetwork()
{
// TODO Auto-generated method stub
return null;
}
}

View file

@ -8,18 +8,51 @@ public class RedstoneControl
/**
* Settings
* 0 - Ignore Redstone
* 1 - Redstone Pulse
* 2 - Redstone Constant
*/
private byte input;
private byte output;
boolean pulse = false;
boolean isOutputting = false;
public RedstoneControl(TileEntity tile)
{
this.tile = tile;
}
public boolean isActive()
public void update()
{
if (pulse)
pulse = false;
if (isRedstonePowered())
pulse = true;
if (isOutputting && output == 1)
isOutputting = false;
}
public void setOutput(boolean isOutputting)
{
if (output > 0)
this.isOutputting = isOutputting;
}
public boolean isRedstonePowered()
{
return tile.worldObj.isBlockIndirectlyGettingPowered(tile.xCoord, tile.yCoord, tile.zCoord);
}
public boolean isActive()
{
return pulse;
}
public int getOutput()
{
return isOutputting ? 15 : 0;
}
}

View file

@ -1,6 +0,0 @@
package resonantinduction.mechanical.logistic.rail;
public class TileRailing
{
}