more progress on stripes pipe, for #1491

This commit is contained in:
SpaceToad 2014-03-16 13:46:08 +01:00
parent 39f2e2db9c
commit 73c2b3ec28

View file

@ -94,26 +94,24 @@ public class PipeItemsStripes extends Pipe {
/*@Override /*@Override
public void centerReached(PipeTransportItems pipe, EntityData data) { public void centerReached(PipeTransportItems pipe, EntityData data) {
convertPipe(pipe, data); convertPipe(pipe, data);
} }*/
@SuppressWarnings("unchecked") /*@SuppressWarnings("unchecked")
public boolean convertPipe(PipeTransportItems pipe, EntityData data) { public boolean convertPipe(PipeTransportItems pipe, EntityItem data) {
if (data.getEntityItem().getItem() instanceof ItemPipe) {
if (!(data.getEntityItem().getItem() == BuildCraftTransport.pipeItemsStripes)) {
if (data.item.getItemStack().getItem() instanceof ItemPipe) { Pipe newPipe = BlockGenericPipe.createPipe(data.getEntityItem().getItem());
if (!(data.item.getItemStack().itemID == BuildCraftTransport.pipeItemsStipes.shiftedIndex)) {
Pipe newPipe = BlockGenericPipe.createPipe(data.item
.getItemStack().itemID);
newPipe.setTile(this.container); newPipe.setTile(this.container);
this.container.pipe = newPipe; this.container.pipe = newPipe;
((PipeTransportItems) newPipe.transport).travelingEntities = (TreeMap<Integer, EntityData>) pipe.travelingEntities ((PipeTransportItems) newPipe.transport).travelingEntities = (TreeMap<Integer, EntityData>) pipe.travelingEntities
.clone(); .clone();
data.item.getItemStack().stackSize--; data.getEntityItem().stackSize--;
if (data.item.getItemStack().stackSize <= 0) { if (data.getEntityItem().stackSize <= 0) {
((PipeTransportItems) newPipe.transport).travelingEntities ((PipeTransportItems) newPipe.transport).travelingEntities
.remove(data.item.getEntityId()); .remove(data.getEntityId());
} }
pipe.scheduleRemoval(data.item); pipe.scheduleRemoval(data.item);
@ -123,8 +121,9 @@ public class PipeItemsStripes extends Pipe {
} }
return false; return false;
} }*/
/*
@Override @Override
public void endReached(PipeTransportItems pipe, EntityData data, public void endReached(PipeTransportItems pipe, EntityData data,
TileEntity tile) { TileEntity tile) {