ItemRailing work and implementation
This commit is contained in:
parent
52a00a816f
commit
d95cda7efb
4 changed files with 56 additions and 15 deletions
|
@ -3,9 +3,8 @@ package resonantinduction.electrical.itemrailing;
|
|||
import calclavia.lib.render.EnumColor;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import resonantinduction.electrical.itemrailing.interfaces.IItemRailing;
|
||||
import resonantinduction.electrical.itemrailing.interfaces.IItemRailingTransfer;
|
||||
import resonantinduction.electrical.itemrailing.interfaces.IRailing;
|
||||
import universalelectricity.api.vector.VectorWorld;
|
||||
|
||||
/**
|
||||
* An object that Transfers all
|
||||
|
@ -63,7 +62,7 @@ public class ItemRailingTransfer implements IItemRailingTransfer
|
|||
}
|
||||
|
||||
@Override
|
||||
public IRailing getEndGoal()
|
||||
public IItemRailing getEndGoal()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
|
|
|
@ -1,13 +1,17 @@
|
|||
package resonantinduction.electrical.itemrailing;
|
||||
|
||||
import calclavia.lib.render.EnumColor;
|
||||
import codechicken.microblock.IHollowConnect;
|
||||
import codechicken.multipart.JNormalOcclusion;
|
||||
import codechicken.multipart.TSlottedPart;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import resonantinduction.core.prefab.part.PartFramedConnection;
|
||||
import resonantinduction.electrical.Electrical;
|
||||
import resonantinduction.electrical.itemrailing.interfaces.IItemRailing;
|
||||
import resonantinduction.electrical.itemrailing.interfaces.IItemRailingTransfer;
|
||||
import universalelectricity.api.energy.IConductor;
|
||||
import universalelectricity.api.energy.IEnergyNetwork;
|
||||
|
||||
|
@ -15,8 +19,52 @@ import universalelectricity.api.energy.IEnergyNetwork;
|
|||
* @since 16/03/14
|
||||
* @author tgame14
|
||||
*/
|
||||
public class PartRailing extends PartFramedConnection<PartRailing.EnumRailing, IConductor, IEnergyNetwork> implements IConductor, TSlottedPart, JNormalOcclusion, IHollowConnect
|
||||
public class PartRailing extends PartFramedConnection<PartRailing.EnumRailing, IConductor, IEnergyNetwork> implements IConductor, TSlottedPart, JNormalOcclusion, IHollowConnect, IItemRailing
|
||||
{
|
||||
private EnumColor color = EnumColor.YELLOW;
|
||||
|
||||
public PartRailing()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean canItemEnter (IItemRailingTransfer item)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canConnectToRailing (IItemRailing railing, ForgeDirection from)
|
||||
{
|
||||
return this.color.equals(railing.getRailingColor());
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumColor getRailingColor ()
|
||||
{
|
||||
return this.color;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IItemRailing setRailingColor (EnumColor color)
|
||||
{
|
||||
this.color = color;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public World getWorldObj ()
|
||||
{
|
||||
return super.getWorld();
|
||||
}
|
||||
|
||||
public enum EnumRailing
|
||||
{
|
||||
DEFAULT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getResistance ()
|
||||
{
|
||||
|
@ -41,11 +89,6 @@ public class PartRailing extends PartFramedConnection<PartRailing.EnumRailing, I
|
|||
return 0;
|
||||
}
|
||||
|
||||
public enum EnumRailing
|
||||
{
|
||||
DEFAULT;
|
||||
}
|
||||
|
||||
public PartRailing()
|
||||
{
|
||||
super(Electrical.itemInsulation);
|
||||
|
|
|
@ -10,15 +10,15 @@ import net.minecraftforge.common.ForgeDirection;
|
|||
* @since 16/03/14
|
||||
* @author tgame14
|
||||
*/
|
||||
public interface IRailing
|
||||
public interface IItemRailing
|
||||
{
|
||||
public boolean canItemEnter (IItemRailingTransfer item);
|
||||
|
||||
public boolean canConnectToRailing (IRailing railing, ForgeDirection from);
|
||||
public boolean canConnectToRailing (IItemRailing railing, ForgeDirection from);
|
||||
|
||||
public EnumColor getRailingColor ();
|
||||
|
||||
public IRailing setRailingColor ();
|
||||
public IItemRailing setRailingColor (EnumColor color);
|
||||
|
||||
/** an easy implementation for tiles / parts that already have this method in them */
|
||||
public World getWorldObj ();
|
|
@ -3,7 +3,6 @@ package resonantinduction.electrical.itemrailing.interfaces;
|
|||
import calclavia.lib.render.EnumColor;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import resonantinduction.electrical.itemrailing.PartRailing;
|
||||
import universalelectricity.api.vector.VectorWorld;
|
||||
|
||||
/**
|
||||
* the object that handles the items that flow through Railings
|
||||
|
@ -23,7 +22,7 @@ public interface IItemRailingTransfer
|
|||
|
||||
public IItemRailingTransfer setRailing(PartRailing railing);
|
||||
|
||||
public IRailing getEndGoal();
|
||||
public IItemRailing getEndGoal();
|
||||
|
||||
public IItemRailingTransfer setEndGoal();
|
||||
public IItemRailingTransfer setEndGoal(IItemRailing goal);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue