Ported to 1.7

This commit is contained in:
AlgorithmX2
2014-02-08 19:34:52 -06:00
parent 30c1deb8cf
commit d50c7f6312
328 changed files with 2209 additions and 2311 deletions
+8 -10
View File
@@ -1,14 +1,14 @@
package appeng.core.sync.packets;
import java.io.ByteArrayOutputStream;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import java.io.IOException;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.network.INetworkManager;
import appeng.core.sync.AppEngPacket;
import appeng.core.sync.network.INetworkInfo;
import appeng.helpers.PartPlacement;
public class PacketPartPlacement extends AppEngPacket
@@ -17,7 +17,7 @@ public class PacketPartPlacement extends AppEngPacket
int x, y, z, face;
// automatic.
public PacketPartPlacement(DataInputStream stream) throws IOException {
public PacketPartPlacement(ByteBuf stream) throws IOException {
x = stream.readInt();
y = stream.readInt();
z = stream.readInt();
@@ -25,7 +25,7 @@ public class PacketPartPlacement extends AppEngPacket
}
@Override
public void serverPacketData(INetworkManager manager, AppEngPacket packet, EntityPlayer player)
public void serverPacketData(INetworkInfo manager, AppEngPacket packet, EntityPlayer player)
{
EntityPlayerMP sender = (EntityPlayerMP) player;
PartPlacement.place( sender.getHeldItem(), x, y, z, face, sender, sender.worldObj, PartPlacement.PlaceType.INTERACT_FIRST_PASS, 0 );
@@ -34,8 +34,7 @@ public class PacketPartPlacement extends AppEngPacket
// api
public PacketPartPlacement(int x, int y, int z, int face) throws IOException {
ByteArrayOutputStream bytes = new ByteArrayOutputStream();
DataOutputStream data = new DataOutputStream( bytes );
ByteBuf data = Unpooled.buffer();
data.writeInt( getPacketID() );
data.writeInt( x );
@@ -43,8 +42,7 @@ public class PacketPartPlacement extends AppEngPacket
data.writeInt( z );
data.writeByte( face );
isChunkDataPacket = false;
configureWrite( bytes.toByteArray() );
configureWrite( data );
}
}