Move from ByteBuf to PacketBuffer

This commit is contained in:
covers1624
2020-06-02 11:07:46 +09:30
parent d4c9e5c490
commit 19cdea7eb5
58 changed files with 158 additions and 295 deletions
@@ -22,10 +22,9 @@ package appeng.parts.p2p;
import java.io.IOException;
import java.util.List;
import io.netty.buffer.ByteBuf;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.network.PacketBuffer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockReader;
@@ -77,7 +76,7 @@ public class PartP2PLight extends PartP2PTunnel<PartP2PLight> implements IGridTi
}
@Override
public void writeToStream( final ByteBuf data ) throws IOException
public void writeToStream( final PacketBuffer data ) throws IOException
{
super.writeToStream( data );
data.writeInt( this.isOutput() ? this.lastValue : 0 );
@@ -85,7 +84,7 @@ public class PartP2PLight extends PartP2PTunnel<PartP2PLight> implements IGridTi
}
@Override
public boolean readFromStream( final ByteBuf data ) throws IOException
public boolean readFromStream( final PacketBuffer data ) throws IOException
{
super.readFromStream( data );
final int oldValue = this.lastValue;
@@ -24,15 +24,13 @@ import java.util.ArrayList;
import java.util.Collection;
import java.util.Optional;
import io.netty.buffer.ByteBuf;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.network.PacketBuffer;
import net.minecraft.util.Hand;
import net.minecraft.util.math.Vec3d;
import appeng.api.AEApi;
import appeng.api.config.Actionable;
import appeng.api.config.PowerMultiplier;
import appeng.api.config.PowerUnits;
@@ -151,7 +149,7 @@ public abstract class PartP2PTunnel<T extends PartP2PTunnel> extends PartBasicSt
}
@Override
public boolean readFromStream( ByteBuf data ) throws IOException
public boolean readFromStream( PacketBuffer data ) throws IOException
{
final boolean c = super.readFromStream( data );
final short oldf = this.freq;
@@ -160,7 +158,7 @@ public abstract class PartP2PTunnel<T extends PartP2PTunnel> extends PartBasicSt
}
@Override
public void writeToStream( ByteBuf data ) throws IOException
public void writeToStream( PacketBuffer data ) throws IOException
{
super.writeToStream( data );
data.writeShort( this.getFrequency() );