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
+16 -13
View File
@@ -1,42 +1,45 @@
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 net.minecraftforge.common.MinecraftForge;
import appeng.core.AppEng;
import appeng.core.sync.AppEngPacket;
import appeng.integration.modules.helpers.FMPPacketEvent;
import appeng.core.sync.network.INetworkInfo;
import appeng.integration.abstraction.IFMP;
public class PacketMultiPart extends AppEngPacket
{
// automatic.
public PacketMultiPart(DataInputStream stream) throws IOException {
public PacketMultiPart(ByteBuf stream) throws IOException {
}
@Override
public void serverPacketData(INetworkManager manager, AppEngPacket packet, EntityPlayer player)
public void serverPacketData(INetworkInfo manager, AppEngPacket packet, EntityPlayer player)
{
EntityPlayerMP sender = (EntityPlayerMP) player;
MinecraftForge.EVENT_BUS.post( new FMPPacketEvent( sender ) );
IFMP fmp = (IFMP) AppEng.instance.getIntegration( "FMP" );
if ( fmp != null )
{
EntityPlayerMP sender = (EntityPlayerMP) player;
MinecraftForge.EVENT_BUS.post( fmp.newFMPPacketEvent( sender ) ); // when received it just pots this event.
}
}
// api
public PacketMultiPart() throws IOException {
ByteArrayOutputStream bytes = new ByteArrayOutputStream();
DataOutputStream data = new DataOutputStream( bytes );
ByteBuf data = Unpooled.buffer();
data.writeInt( getPacketID() );
isChunkDataPacket = false;
configureWrite( bytes.toByteArray() );
configureWrite( data );
}
}