Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package net.nukacraft.src;
- import io.netty.buffer.ByteBuf;
- import net.minecraft.entity.player.EntityPlayerMP;
- import cpw.mods.fml.common.network.simpleimpl.IMessage;
- import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
- import cpw.mods.fml.common.network.simpleimpl.MessageContext;
- public class MessageActionWeapons2 implements IMessage {
- public int button;
- public MessageActionWeapons2() {}
- public MessageActionWeapons2(int button) {
- this.button = button;
- }
- @Override
- public void toBytes(ByteBuf buf) {
- buf.writeInt(button);
- }
- @Override
- public void fromBytes(ByteBuf buf) {
- button = buf.readInt();
- }
- //----------------------------------------------------------------------------------
- public static class Handler implements IMessageHandler<MessageActionWeapons2, IMessage> {
- @Override
- public IMessage onMessage(MessageActionWeapons2 packet, MessageContext message) {
- int button = packet.button;
- EntityPlayerMP player = message.getServerHandler().playerEntity;
- switch(button) {
- //case 1:ActionWeapons.onFire(player);break;
- case 3:ActionWeapons2.onButton_left(player);break;
- }
- return null;
- }
- }
- //----------------------------------------------------------------------------------
- }
Advertisement
Add Comment
Please, Sign In to add comment