Started work on the farm, some changes to the idsu, its still broken
This commit is contained in:
parent
be33bdc148
commit
c160abf176
26 changed files with 626 additions and 194 deletions
50
src/main/java/techreborn/packets/AbstractPacket.java
Normal file
50
src/main/java/techreborn/packets/AbstractPacket.java
Normal file
|
@ -0,0 +1,50 @@
|
|||
package techreborn.packets;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
||||
/**
|
||||
* AbstractPacket class. Should be the parent of all packets wishing to use the
|
||||
* PacketPipeline.
|
||||
*
|
||||
* @author sirgingalot
|
||||
*/
|
||||
public abstract class AbstractPacket {
|
||||
|
||||
/**
|
||||
* Encode the packet data into the ByteBuf stream. Complex data sets may
|
||||
* need specific data handlers (See
|
||||
*
|
||||
* @param ctx channel context
|
||||
* @param buffer the buffer to encode into
|
||||
* @link{cpw.mods.fml.common.network.ByteBuffUtils )
|
||||
*/
|
||||
public abstract void encodeInto(ChannelHandlerContext ctx, ByteBuf buffer);
|
||||
|
||||
/**
|
||||
* Decode the packet data from the ByteBuf stream. Complex data sets may
|
||||
* need specific data handlers (See
|
||||
*
|
||||
* @param ctx channel context
|
||||
* @param buffer the buffer to decode from
|
||||
* @link{cpw.mods.fml.common.network.ByteBuffUtils )
|
||||
*/
|
||||
public abstract void decodeInto(ChannelHandlerContext ctx, ByteBuf buffer);
|
||||
|
||||
/**
|
||||
* Handle a packet on the client side. Note this occurs after decoding has
|
||||
* completed.
|
||||
*
|
||||
* @param player the player reference
|
||||
*/
|
||||
public abstract void handleClientSide(EntityPlayer player);
|
||||
|
||||
/**
|
||||
* Handle a packet on the powerSink side. Note this occurs after decoding has
|
||||
* completed.
|
||||
*
|
||||
* @param player the player reference
|
||||
*/
|
||||
public abstract void handleServerSide(EntityPlayer player);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue