mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-26 13:53:07 +00:00
More Profile Handling + Login Packet
This commit is contained in:
1 parent
36181d5165
commit
e8f657f7e6
17 files changed
+294
-223
No files matched your search
@@ -338,6 +338,7 @@ public class PacketHandler {
|
||||
|
||||
public void registerDataPackets(){
|
||||
// Data Packets
|
||||
DATA_PACKET.registerPacket(new LoginPacket());
|
||||
DATA_PACKET.registerPacket(new AchievementPacket());
|
||||
DATA_PACKET.registerPacket(new ChatAlertPacket());
|
||||
DATA_PACKET.registerPacket(new ChatBubblePacket());
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
package kamkeel.npcs.network.packets.data;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import kamkeel.npcs.network.AbstractPacket;
|
||||
import kamkeel.npcs.network.PacketChannel;
|
||||
import kamkeel.npcs.network.PacketHandler;
|
||||
import kamkeel.npcs.network.enums.EnumDataPacket;
|
||||
import kamkeel.npcs.util.ByteBufUtils;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import noppes.npcs.client.ClientCacheHandler;
|
||||
import noppes.npcs.config.ConfigMain;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public final class LoginPacket extends AbstractPacket {
|
||||
public static final String packetName = "CNPC+|Login";
|
||||
|
||||
public LoginPacket() {
|
||||
}
|
||||
|
||||
public LoginPacket() {}
|
||||
|
||||
@Override
|
||||
public Enum getType() {
|
||||
@@ -29,13 +29,14 @@ public final class LoginPacket extends AbstractPacket {
|
||||
|
||||
@Override
|
||||
public void sendData(ByteBuf out) throws IOException {
|
||||
// ByteBufUtils.writeUTF8String(out, this.data.player.getCommandSenderName());
|
||||
// ByteBufUtils.writeNBT(out,this.data.saveFromNBT(new NBTTagCompound()));
|
||||
out.writeBoolean(ConfigMain.PartiesEnabled);
|
||||
out.writeBoolean(ConfigMain.ProfilesEnabled);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void receiveData(ByteBuf in, EntityPlayer player) throws IOException {
|
||||
String playerName = ByteBufUtils.readUTF8String(in);
|
||||
|
||||
ClientCacheHandler.allowParties = in.readBoolean();
|
||||
ClientCacheHandler.allowProfiles = in.readBoolean();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user