2013-12-27 23:59:59 +01:00
|
|
|
package appeng.core.sync.packets;
|
|
|
|
|
2014-02-09 02:34:52 +01:00
|
|
|
import io.netty.buffer.ByteBuf;
|
|
|
|
import io.netty.buffer.Unpooled;
|
|
|
|
|
2013-12-27 23:59:59 +01:00
|
|
|
import java.io.IOException;
|
|
|
|
|
2014-01-05 09:39:48 +01:00
|
|
|
import net.minecraft.entity.player.EntityPlayer;
|
2013-12-27 23:59:59 +01:00
|
|
|
import net.minecraft.entity.player.EntityPlayerMP;
|
|
|
|
import net.minecraftforge.common.MinecraftForge;
|
2014-02-09 02:34:52 +01:00
|
|
|
import appeng.core.AppEng;
|
2013-12-27 23:59:59 +01:00
|
|
|
import appeng.core.sync.AppEngPacket;
|
2014-02-09 02:34:52 +01:00
|
|
|
import appeng.core.sync.network.INetworkInfo;
|
|
|
|
import appeng.integration.abstraction.IFMP;
|
2013-12-27 23:59:59 +01:00
|
|
|
|
|
|
|
public class PacketMultiPart extends AppEngPacket
|
|
|
|
{
|
|
|
|
|
|
|
|
// automatic.
|
2014-02-09 02:34:52 +01:00
|
|
|
public PacketMultiPart(ByteBuf stream) throws IOException {
|
2013-12-27 23:59:59 +01:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2014-02-09 02:34:52 +01:00
|
|
|
public void serverPacketData(INetworkInfo manager, AppEngPacket packet, EntityPlayer player)
|
2013-12-27 23:59:59 +01:00
|
|
|
{
|
2014-02-09 02:34:52 +01:00
|
|
|
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.
|
|
|
|
}
|
2013-12-27 23:59:59 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// api
|
|
|
|
public PacketMultiPart() throws IOException {
|
|
|
|
|
2014-02-09 02:34:52 +01:00
|
|
|
ByteBuf data = Unpooled.buffer();
|
2013-12-27 23:59:59 +01:00
|
|
|
|
|
|
|
data.writeInt( getPacketID() );
|
|
|
|
|
2014-02-09 02:34:52 +01:00
|
|
|
configureWrite( data );
|
2013-12-27 23:59:59 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|