2012-11-05 20:29:04 +01:00
|
|
|
package mekanism.api;
|
2012-09-03 18:11:25 +02:00
|
|
|
|
2012-12-20 22:53:39 +01:00
|
|
|
import net.minecraft.entity.player.EntityPlayer;
|
|
|
|
import net.minecraft.network.INetworkManager;
|
|
|
|
import net.minecraft.network.packet.Packet250CustomPayload;
|
2012-09-03 18:11:25 +02:00
|
|
|
|
|
|
|
import com.google.common.io.ByteArrayDataInput;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Implement this in your TileEntity class if you plan to have your machine send and receive packets. Send packets sparingly!
|
|
|
|
* @author AidanBrady
|
|
|
|
*
|
|
|
|
*/
|
2012-10-17 20:46:27 +02:00
|
|
|
public interface ITileNetwork
|
2012-09-03 18:11:25 +02:00
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Called when a networked machine receives a packet.
|
|
|
|
* @param network
|
|
|
|
* @param packet
|
|
|
|
* @param player
|
|
|
|
* @param dataStream
|
|
|
|
*/
|
2012-10-25 23:55:32 +02:00
|
|
|
public void handlePacketData(INetworkManager network, Packet250CustomPayload packet, EntityPlayer player, ByteArrayDataInput dataStream);
|
2012-10-28 23:18:23 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Sends a tile entity packet to the server.
|
|
|
|
*/
|
|
|
|
public void sendPacket();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Sends a tile entity packet to the server with a defined range.
|
|
|
|
*/
|
|
|
|
public void sendPacketWithRange();
|
2012-09-03 18:11:25 +02:00
|
|
|
}
|