Work on GUIs (specifically to get SkyChest GUI)
This commit is contained in:
@@ -24,6 +24,7 @@ import java.io.ByteArrayOutputStream;
|
||||
import java.io.DataInputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
@@ -36,7 +37,6 @@ import net.minecraft.nbt.CompressedStreamTools;
|
||||
import net.minecraft.network.PacketBuffer;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.config.FuzzyMode;
|
||||
import appeng.api.storage.IStorageChannel;
|
||||
import appeng.api.storage.channels.IFluidStorageChannel;
|
||||
@@ -134,8 +134,8 @@ public final class AEFluidStack extends AEStack<IAEFluidStack> implements IAEFlu
|
||||
final byte[] name = new byte[len2];
|
||||
buffer.readBytes( name, 0, len2 );
|
||||
|
||||
d.setString( "FluidName", new String( name, "UTF-8" ) );
|
||||
d.setByte( "Count", (byte) 0 );
|
||||
d.putString( "FluidName", new String( name, "UTF-8" ) );
|
||||
d.putByte( "Count", (byte) 0 );
|
||||
|
||||
if( hasTagCompound )
|
||||
{
|
||||
@@ -145,7 +145,7 @@ public final class AEFluidStack extends AEStack<IAEFluidStack> implements IAEFlu
|
||||
buffer.readBytes( bd );
|
||||
|
||||
final DataInputStream di = new DataInputStream( new ByteArrayInputStream( bd ) );
|
||||
d.setTag( "Tag", CompressedStreamTools.read( di ) );
|
||||
d.put( "Tag", CompressedStreamTools.read( di ) );
|
||||
}
|
||||
|
||||
final long stackSize = getPacketValue( stackType, buffer );
|
||||
@@ -181,19 +181,19 @@ public final class AEFluidStack extends AEStack<IAEFluidStack> implements IAEFlu
|
||||
@Override
|
||||
public void writeToNBT( final CompoundNBT data )
|
||||
{
|
||||
data.setString( "FluidName", this.fluid.getName() );
|
||||
data.setByte( "Count", (byte) 0 );
|
||||
data.setLong( "Cnt", this.getStackSize() );
|
||||
data.setLong( "Req", this.getCountRequestable() );
|
||||
data.setBoolean( "Craft", this.isCraftable() );
|
||||
data.putString( "FluidName", this.fluid.getRegistryName().toString() );
|
||||
data.putByte( "Count", (byte) 0 );
|
||||
data.putLong( "Cnt", this.getStackSize() );
|
||||
data.putLong( "Req", this.getCountRequestable() );
|
||||
data.putBoolean( "Craft", this.isCraftable() );
|
||||
|
||||
if( this.hasTagCompound() )
|
||||
{
|
||||
data.setTag( "Tag", this.tagCompound );
|
||||
data.put( "Tag", this.tagCompound );
|
||||
}
|
||||
else
|
||||
{
|
||||
data.removeTag( "Tag" );
|
||||
data.remove( "Tag" );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -240,7 +240,7 @@ public final class AEFluidStack extends AEStack<IAEFluidStack> implements IAEFlu
|
||||
{
|
||||
if( this.fluid != other.fluid )
|
||||
{
|
||||
return this.fluid.getName().compareTo( other.fluid.getName() );
|
||||
return this.fluid.getRegistryName().compareTo( other.fluid.getRegistryName() );
|
||||
}
|
||||
|
||||
if( Platform.itemComparisons().isNbtTagEqual( this.tagCompound, other.tagCompound ) )
|
||||
@@ -273,7 +273,7 @@ public final class AEFluidStack extends AEStack<IAEFluidStack> implements IAEFlu
|
||||
else if( other instanceof FluidStack )
|
||||
{
|
||||
final FluidStack is = (FluidStack) other;
|
||||
return is.getFluid() == this.fluid && Platform.itemComparisons().isNbtTagEqual( this.tagCompound, is.tag );
|
||||
return is.getFluid() == this.fluid && Platform.itemComparisons().isNbtTagEqual( this.tagCompound, is.getTag() );
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -281,7 +281,7 @@ public final class AEFluidStack extends AEStack<IAEFluidStack> implements IAEFlu
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return this.getStackSize() + "x" + this.getFluidStack().getFluid().getName() + " " + this.tagCompound;
|
||||
return this.getStackSize() + "x" + this.getFluidStack().getFluid().getRegistryName() + " " + this.tagCompound;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -334,7 +334,7 @@ public final class AEFluidStack extends AEStack<IAEFluidStack> implements IAEFlu
|
||||
|
||||
private void writeToStream( final PacketBuffer buffer ) throws IOException
|
||||
{
|
||||
final byte[] name = this.fluid.getName().getBytes( "UTF-8" );
|
||||
final byte[] name = this.fluid.getRegistryName().toString().getBytes(StandardCharsets.UTF_8);
|
||||
buffer.writeByte( (byte) name.length );
|
||||
buffer.writeBytes( name );
|
||||
if( this.hasTagCompound() )
|
||||
|
||||
Reference in New Issue
Block a user