Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,17 @@ repositories {

dependencies {
compile 'com.mod-buildcraft:buildcraft:6.1.5:dev'
compile 'codechicken:ForgeMultipart:1.7.10-1.1.0.297:dev'
compile 'codechicken:CodeChickenLib:1.7.10-1.1.1.95:dev'
compile 'codechicken:CodeChickenCore:1.7.10-1.0.2.9:dev'
compile 'codechicken:NotEnoughItems:1.7.10-1.0.2.28:dev'
compile 'codechicken:ForgeMultipart:1.7.10-1.2.0.345:dev'
compile 'codechicken:CodeChickenLib:1.7.10-1.1.3.138:dev'
compile 'codechicken:CodeChickenCore:1.7.10-1.0.7.47:dev'
compile 'codechicken:NotEnoughItems:1.7.10-1.0.5.120:dev'
}

version = "2.0.5"
version = "2.0.5.1"
group= "au.com.addstar"
archivesBaseName = "Tubes"

def forge = "1.7.10-10.13.2.1232"
def forge = "1.7.10-10.13.4.1614-1.7.10"

minecraft {
version = "${forge}"
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/schmoller/tubes/network/MCDOutputBridge.java
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public MCDataOutput writeFluidStack( FluidStack fluid )
writeShort(-1);
else
{
writeShort(fluid.fluidID);
writeShort(fluid.getFluidID());
writeInt(fluid.amount);
writeNBTTagCompound(fluid.tag);
}
Expand Down
31 changes: 23 additions & 8 deletions src/main/java/schmoller/tubes/types/TankTube.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import codechicken.lib.data.MCDataInput;
import codechicken.lib.data.MCDataOutput;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.MovingObjectPosition;
Expand Down Expand Up @@ -137,9 +138,18 @@ public boolean activate( EntityPlayer player, MovingObjectPosition part, ItemSta
FluidStack drained = FluidContainerRegistry.getFluidForFilledItem(filled);
mTank.drain(drained.amount, true);
onFluidChange();

player.inventory.mainInventory[player.inventory.currentItem] = filled;
if (!player.capabilities.isCreativeMode)
{
if (player.inventory.mainInventory[player.inventory.currentItem].stackSize > 1)
{
player.inventory.setInventorySlotContents(player.inventory.getFirstEmptyStack(),filled);
player.inventory.decrStackSize(player.inventory.currentItem,1);
}
else
player.inventory.mainInventory[player.inventory.currentItem] = filled;
}
player.inventory.markDirty();
player.inventoryContainer.detectAndSendChanges();
return true;
}
}
Expand Down Expand Up @@ -176,7 +186,9 @@ private void updateIfNeeded()
{
mLastUpdate = System.currentTimeMillis();
mHasUpdated = true;
openChannel(CHANNEL_FLUID).writeFluidStack(mTank.getFluid());
NBTTagCompound tankNBT = new NBTTagCompound();
mTank.writeToNBT(tankNBT);
openChannel(CHANNEL_FLUID).writeNBTTagCompound(tankNBT); //.writeFluidStack(mTank.getFluid());
}
}

Expand Down Expand Up @@ -256,7 +268,6 @@ public void save( NBTTagCompound root )
mTank.getFluid().writeToNBT(tag);
root.setTag("fluid", tag);
}

mOverflow.save(root);
}

Expand All @@ -267,29 +278,33 @@ public void load( NBTTagCompound root )

if(root.hasKey("fluid"))
mTank.setFluid(FluidStack.loadFluidStackFromNBT(root.getCompoundTag("fluid")));

else
mTank.setFluid(null);

mOverflow.load(root);
}

@Override
public void writeDesc( MCDataOutput packet )
{
super.writeDesc(packet);
packet.writeFluidStack(mTank.getFluid());
NBTTagCompound tankNBT = new NBTTagCompound();
mTank.writeToNBT(tankNBT);
packet.writeNBTTagCompound(tankNBT);
}

@Override
public void readDesc( MCDataInput packet )
{
super.readDesc(packet);
mTank.setFluid(packet.readFluidStack());
mTank.readFromNBT(packet.readNBTTagCompound());
}

@Override
protected void onRecieveDataClient( int channel, MCDataInput input )
{
if(channel == CHANNEL_FLUID)
mTank.setFluid(input.readFluidStack());
mTank.readFromNBT(input.readNBTTagCompound());
else
super.onRecieveDataClient(channel, input);
}
Expand Down