split client and server 2

This commit is contained in:
Sen 2025-05-05 18:27:06 +02:00
parent 2fa521c3d1
commit b17efb5b07
158 changed files with 1080 additions and 515 deletions

View file

@ -51,6 +51,8 @@ import client.gui.container.GuiContainer;
import client.gui.container.GuiInventory; import client.gui.container.GuiInventory;
import client.gui.element.Textbox; import client.gui.element.Textbox;
import client.gui.ingame.GuiGameOver; import client.gui.ingame.GuiGameOver;
import client.network.ClientLoginHandler;
import client.network.ClientPlayer;
import client.renderer.BlockRenderer; import client.renderer.BlockRenderer;
import client.renderer.Drawing; import client.renderer.Drawing;
import client.renderer.EntityRenderer; import client.renderer.EntityRenderer;
@ -104,8 +106,6 @@ import game.log.Log;
import game.log.LogLevel; import game.log.LogLevel;
import game.log.Message; import game.log.Message;
import game.material.Material; import game.material.Material;
import game.network.ClientLoginHandler;
import game.network.ClientPlayer;
import game.network.IThreadListener; import game.network.IThreadListener;
import game.network.NetConnection; import game.network.NetConnection;
import game.network.NetHandler.ThreadQuickExitException; import game.network.NetHandler.ThreadQuickExitException;
@ -1476,7 +1476,7 @@ public class Game implements IThreadListener {
public ClientPlayer getNetHandler() public ClientPlayer getNetHandler()
{ {
return this.thePlayer != null ? this.thePlayer.sendQueue : null; return this.thePlayer != null ? (ClientPlayer)this.thePlayer.sendQueue : null;
} }
// public void setSkin(BufferedImage skin, String id, ModelType model, boolean slim) // public void setSkin(BufferedImage skin, String id, ModelType model, boolean slim)

View file

@ -1,5 +1,6 @@
package client; package client;
import client.network.ClientPlayer;
import game.block.Block; import game.block.Block;
import game.entity.Entity; import game.entity.Entity;
import game.entity.npc.EntityNPC; import game.entity.npc.EntityNPC;
@ -9,7 +10,6 @@ import game.item.ItemBlock;
import game.item.ItemControl; import game.item.ItemControl;
import game.item.ItemStack; import game.item.ItemStack;
import game.material.Material; import game.material.Material;
import game.network.ClientPlayer;
import game.packet.CPacketAction; import game.packet.CPacketAction;
import game.packet.CPacketBreak; import game.packet.CPacketBreak;
import game.packet.CPacketClick; import game.packet.CPacketClick;

View file

@ -14,7 +14,7 @@ import client.renderer.Drawing;
import game.color.TextColor; import game.color.TextColor;
import game.init.Config; import game.init.Config;
import game.log.Log; import game.log.Log;
import game.network.Player; import game.network.IPlayer;
import game.util.FileUtils; import game.util.FileUtils;
import game.util.Tuple; import game.util.Tuple;
import game.util.Util; import game.util.Util;
@ -132,7 +132,7 @@ public class GuiConnect extends GuiList<GuiConnect.ServerInfo> implements ActBut
for(int z = 0; z <= lines.length; z++) { for(int z = 0; z <= lines.length; z++) {
String line = z == lines.length ? null : lines[z]; String line = z == lines.length ? null : lines[z];
if(line == null || (line.startsWith("[") && line.endsWith("]"))) { if(line == null || (line.startsWith("[") && line.endsWith("]"))) {
if(!name.isEmpty() && !address.isEmpty() && !user.isEmpty() && user.length() < Player.MAX_USER_LENGTH && Player.isValidUser(user) && password.length() < Player.MAX_PASS_LENGTH && access.length() < Player.MAX_PASS_LENGTH && address.length() < 128 && name.length() < 128 && port >= 0 && port < 65536) if(!name.isEmpty() && !address.isEmpty() && !user.isEmpty() && user.length() < IPlayer.MAX_USER_LENGTH && IPlayer.isValidUser(user) && password.length() < IPlayer.MAX_PASS_LENGTH && access.length() < IPlayer.MAX_PASS_LENGTH && address.length() < 128 && name.length() < 128 && port >= 0 && port < 65536)
this.elements.add(new ServerInfo(name, address, port, user, password, access, time)); this.elements.add(new ServerInfo(name, address, port, user, password, access, time));
if(line != null) { if(line != null) {
address = ""; address = "";

View file

@ -7,11 +7,12 @@ import client.gui.element.ActButton;
import client.gui.element.Fill; import client.gui.element.Fill;
import client.gui.element.Textbox; import client.gui.element.Textbox;
import client.gui.element.Textbox.Action; import client.gui.element.Textbox.Action;
import client.network.ClientPlayer;
import client.gui.element.TransparentBox; import client.gui.element.TransparentBox;
import client.window.Keysym; import client.window.Keysym;
import game.collect.Lists; import game.collect.Lists;
import game.color.TextColor; import game.color.TextColor;
import game.network.Player; import game.network.IPlayer;
import game.packet.CPacketComplete; import game.packet.CPacketComplete;
import game.util.ExtMath; import game.util.ExtMath;
import game.vars.BoolVar; import game.vars.BoolVar;
@ -57,7 +58,7 @@ public class GuiConsole extends Gui implements Textbox.Callback {
this.logBox = this.add(new TransparentBox(0, this.full ? 24 : 0, width, height - (this.full ? 48 : 24), this.gm.getBuffer(), this.gm.theWorld != null && !this.gm.charEditor)); this.logBox = this.add(new TransparentBox(0, this.full ? 24 : 0, width, height - (this.full ? 48 : 24), this.gm.getBuffer(), this.gm.theWorld != null && !this.gm.charEditor));
if(this.full) if(this.full)
this.add(new Fill(640, 0, width - 640, 24)); this.add(new Fill(640, 0, width - 640, 24));
this.inputField = this.add(new Textbox(0, height - 24, width, 24, Player.MAX_CMD_LENGTH, true, this, "")); this.inputField = this.add(new Textbox(0, height - 24, width, 24, IPlayer.MAX_CMD_LENGTH, true, this, ""));
this.inputField.setSelected(); this.inputField.setSelected();
this.sentHistoryCursor = this.sentMessages.size(); this.sentHistoryCursor = this.sentMessages.size();
} }
@ -214,7 +215,7 @@ public class GuiConsole extends Gui implements Textbox.Callback {
s = argv[argv.length - 1]; s = argv[argv.length - 1];
Iterable<String> res = pre.startsWith("#") ? Iterable<String> res = pre.startsWith("#") ?
(argv.length == 1 ? this.gm.getVars() : (argv.length == 2 ? getVarCompletion(argv[0].substring(1)) : Lists.newArrayList())) : (argv.length == 1 ? this.gm.getVars() : (argv.length == 2 ? getVarCompletion(argv[0].substring(1)) : Lists.newArrayList())) :
(this.gm.thePlayer == null ? Lists.newArrayList() : this.gm.thePlayer.sendQueue.getPlayerNames()); (this.gm.thePlayer == null ? Lists.newArrayList() : ((ClientPlayer)this.gm.thePlayer.sendQueue).getPlayerNames());
if(argv.length == 1 && pre.startsWith("#")) if(argv.length == 1 && pre.startsWith("#"))
s = s.substring(1); s = s.substring(1);
for(String s1 : res) { for(String s1 : res) {

View file

@ -8,7 +8,7 @@ import client.gui.element.Textbox;
import client.gui.element.Textbox.Action; import client.gui.element.Textbox.Action;
import game.color.TextColor; import game.color.TextColor;
import game.init.Config; import game.init.Config;
import game.network.Player; import game.network.IPlayer;
import game.vars.CVarCategory; import game.vars.CVarCategory;
import game.vars.Variable; import game.vars.Variable;
@ -38,11 +38,11 @@ public class GuiServer extends Gui implements Textbox.Callback {
private String lastAddr = ""; private String lastAddr = "";
@Variable(name = "srv_last_port", category = CVarCategory.SYSTEM, min = 0, max = 65535, display = "Letzter Server-Port") @Variable(name = "srv_last_port", category = CVarCategory.SYSTEM, min = 0, max = 65535, display = "Letzter Server-Port")
private int lastPort = Config.PORT; private int lastPort = Config.PORT;
@Variable(name = "srv_last_user", category = CVarCategory.SYSTEM, max = Player.MAX_USER_LENGTH, display = "Letzter Server-Nutzer", validator = Player.UserValidator.class) @Variable(name = "srv_last_user", category = CVarCategory.SYSTEM, max = IPlayer.MAX_USER_LENGTH, display = "Letzter Server-Nutzer", validator = IPlayer.UserValidator.class)
private String lastUser = ""; private String lastUser = "";
@Variable(name = "srv_last_password", category = CVarCategory.SYSTEM, max = Player.MAX_PASS_LENGTH, display = "Letztes Server-Passwort") @Variable(name = "srv_last_password", category = CVarCategory.SYSTEM, max = IPlayer.MAX_PASS_LENGTH, display = "Letztes Server-Passwort")
private String lastPass = ""; private String lastPass = "";
@Variable(name = "srv_last_access", category = CVarCategory.SYSTEM, max = Player.MAX_PASS_LENGTH, display = "Letzter Server-Zugang") @Variable(name = "srv_last_access", category = CVarCategory.SYSTEM, max = IPlayer.MAX_PASS_LENGTH, display = "Letzter Server-Zugang")
private String lastAcc = ""; private String lastAcc = "";
public void init(int width, int height) { public void init(int width, int height) {
@ -50,9 +50,9 @@ public class GuiServer extends Gui implements Textbox.Callback {
this.nameBox = this.add(new Textbox(0, -50, 400, 24, 128, true, this, this.server.getName())); this.nameBox = this.add(new Textbox(0, -50, 400, 24, 128, true, this, this.server.getName()));
this.addrBox = this.add(new Textbox(0, 20, 400, 24, 128, true, this, this.server == null ? this.lastAddr : this.server.getAddress())); this.addrBox = this.add(new Textbox(0, 20, 400, 24, 128, true, this, this.server == null ? this.lastAddr : this.server.getAddress()));
this.portBox = this.add(new Textbox(404, 20, 76, 24, 5, true, this, "" + (this.server == null ? this.lastPort : this.server.getPort()))); this.portBox = this.add(new Textbox(404, 20, 76, 24, 5, true, this, "" + (this.server == null ? this.lastPort : this.server.getPort())));
this.userBox = this.add(new Textbox(0, 70, 220, 24, Player.MAX_USER_LENGTH, true, this, Player.VALID_USER, this.server == null ? this.lastUser : this.server.getUser())); this.userBox = this.add(new Textbox(0, 70, 220, 24, IPlayer.MAX_USER_LENGTH, true, this, IPlayer.VALID_USER, this.server == null ? this.lastUser : this.server.getUser()));
this.passBox = this.add(new Textbox(0, 120, 480, 24, Player.MAX_PASS_LENGTH, true, this, this.server == null ? this.lastPass : this.server.getPassword())); this.passBox = this.add(new Textbox(0, 120, 480, 24, IPlayer.MAX_PASS_LENGTH, true, this, this.server == null ? this.lastPass : this.server.getPassword()));
this.accBox = this.add(new Textbox(0, 170, 480, 24, Player.MAX_PASS_LENGTH, true, this, this.server == null ? this.lastAcc : this.server.getAccess())); this.accBox = this.add(new Textbox(0, 170, 480, 24, IPlayer.MAX_PASS_LENGTH, true, this, this.server == null ? this.lastAcc : this.server.getAccess()));
this.add(new ActButton(0, 220, 480, 24, new ActButton.Callback() { this.add(new ActButton(0, 220, 480, 24, new ActButton.Callback() {
public void use(ActButton elem, ActButton.Mode action) { public void use(ActButton elem, ActButton.Mode action) {
GuiServer.this.connect(); GuiServer.this.connect();

View file

@ -51,7 +51,7 @@ import game.init.SpeciesRegistry;
import game.init.SpeciesRegistry.ModelType; import game.init.SpeciesRegistry.ModelType;
import game.init.UniverseRegistry; import game.init.UniverseRegistry;
import game.log.Log; import game.log.Log;
import game.network.Player; import game.network.IPlayer;
import game.packet.CPacketAction; import game.packet.CPacketAction;
import game.packet.CPacketMessage; import game.packet.CPacketMessage;
import game.packet.CPacketSkin; import game.packet.CPacketSkin;
@ -361,7 +361,7 @@ public class GuiChar extends GuiList<GuiChar.SkinEntry>
}, "Spieler-Größe", "cm")).enabled = this.gm.thePlayer == null || this.gm.thePlayer.getMinSize() != this.gm.thePlayer.getMaxSize(); }, "Spieler-Größe", "cm")).enabled = this.gm.thePlayer == null || this.gm.thePlayer.getMinSize() != this.gm.thePlayer.getMaxSize();
this.add(new Label(width / 2 - 200, 36, 400, 20, "Name", true)); this.add(new Label(width / 2 - 200, 36, 400, 20, "Name", true));
this.add(new Label(width - 396, height - 384, 392, 20, "Beschreibung", true)); this.add(new Label(width - 396, height - 384, 392, 20, "Beschreibung", true));
final Textbox descField = this.add(new Textbox(width - 396, height - 364, 392, 130, Player.MAX_INFO_LENGTH, new Textbox.Callback() { final Textbox descField = this.add(new Textbox(width - 396, height - 364, 392, 130, IPlayer.MAX_INFO_LENGTH, new Textbox.Callback() {
public void use(Textbox elem, Action value) { public void use(Textbox elem, Action value) {
} }
}, "")); }, ""));
@ -375,7 +375,7 @@ public class GuiChar extends GuiList<GuiChar.SkinEntry>
} }
} }
}, "Charakter erstellen")); }, "Charakter erstellen"));
this.add(new Textbox(width / 2 - 200, 36 + 20, 400, 24, Player.MAX_NICK_LENGTH, true, new Textbox.Callback() { this.add(new Textbox(width / 2 - 200, 36 + 20, 400, 24, IPlayer.MAX_NICK_LENGTH, true, new Textbox.Callback() {
public void use(Textbox elem, Action value) { public void use(Textbox elem, Action value) {
if(value == Action.SEND || value == Action.UNFOCUS) { if(value == Action.SEND || value == Action.UNFOCUS) {
String name = elem.getText(); String name = elem.getText();
@ -387,7 +387,7 @@ public class GuiChar extends GuiList<GuiChar.SkinEntry>
} }
} }
} }
}, Player.VALID_NICK, this.gm.thePlayer == null ? "" : this.gm.thePlayer.getCustomNameTag())); }, IPlayer.VALID_NICK, this.gm.thePlayer == null ? "" : this.gm.thePlayer.getCustomNameTag()));
this.templateButton.enabled = false; this.templateButton.enabled = false;
this.dimension = new Random().zrange(UniverseRegistry.getBaseDimensions().size()); this.dimension = new Random().zrange(UniverseRegistry.getBaseDimensions().size());
EntityEggInfo egg = EntityRegistry.SPAWN_EGGS.get(this.gm.thePlayer == null ? EntityRegistry.getEntityString(EntityHuman.class) : EntityRegistry.getEntityString(this.gm.thePlayer)); EntityEggInfo egg = EntityRegistry.SPAWN_EGGS.get(this.gm.thePlayer == null ? EntityRegistry.getEntityString(EntityHuman.class) : EntityRegistry.getEntityString(this.gm.thePlayer));

View file

@ -4,7 +4,7 @@ import client.gui.Gui;
import client.gui.element.NavButton; import client.gui.element.NavButton;
import client.gui.element.Textbox; import client.gui.element.Textbox;
import client.gui.element.Textbox.Action; import client.gui.element.Textbox.Action;
import game.network.ClientPlayer; import client.network.ClientPlayer;
import game.packet.CPacketSign; import game.packet.CPacketSign;
import game.world.BlockPos; import game.world.BlockPos;

View file

@ -1,11 +1,15 @@
package game.network; package client.network;
import client.Game; import client.Game;
import game.network.IClientLoginHandler;
import game.network.NetConnection;
import game.network.NetHandler;
import game.network.PacketRegistry;
import game.packet.RPacketDisconnect; import game.packet.RPacketDisconnect;
import game.packet.RPacketEnableCompression; import game.packet.RPacketEnableCompression;
import game.packet.RPacketLoginSuccess; import game.packet.RPacketLoginSuccess;
public class ClientLoginHandler extends NetHandler { public class ClientLoginHandler extends NetHandler implements IClientLoginHandler {
private final Game gm; private final Game gm;
private final NetConnection networkManager; private final NetConnection networkManager;

View file

@ -1,4 +1,4 @@
package game.network; package client.network;
import java.util.Collection; import java.util.Collection;
import java.util.List; import java.util.List;
@ -45,6 +45,10 @@ import game.inventory.InventoryPlayer;
import game.item.ItemStack; import game.item.ItemStack;
import game.log.Log; import game.log.Log;
import game.model.ParticleType; import game.model.ParticleType;
import game.network.IClientPlayer;
import game.network.NetConnection;
import game.network.NetHandler;
import game.network.Packet;
import game.packet.CPacketAction; import game.packet.CPacketAction;
import game.packet.CPacketKeepAlive; import game.packet.CPacketKeepAlive;
import game.packet.CPacketPlayer; import game.packet.CPacketPlayer;
@ -121,7 +125,7 @@ import game.world.Explosion;
import game.world.Weather; import game.world.Weather;
import game.world.WorldClient; import game.world.WorldClient;
public class ClientPlayer extends NetHandler public class ClientPlayer extends NetHandler implements IClientPlayer
{ {
/** /**
* The NetworkManager instance used to communicate with the server (used only by handlePlayerPosLook to update * The NetworkManager instance used to communicate with the server (used only by handlePlayerPosLook to update

View file

@ -0,0 +1,33 @@
package game;
import java.util.List;
import java.util.Map;
import game.entity.Entity;
import game.entity.npc.EntityNPC;
import game.network.IPlayer;
import game.network.Packet;
import game.world.BlockPos;
import game.world.PortalType;
import game.world.Position;
import game.world.WorldServer;
public interface IServer {
List<IPlayer> getIPlayers();
void sendPacket(Packet packet);
void sendPacket(Packet packet, int dimension);
void sendNear(double x, double y, double z, double radius, int dimension, Packet packet);
void sendNearExcept(EntityNPC except, double x, double y, double z, double radius, int dimension, Packet packet);
Map<String, Position> getWarps();
List<WorldServer> getWorlds();
WorldServer getWorld(int dimension);
void placeInDimension(Entity entity, WorldServer oldWorld, WorldServer world, BlockPos pos, PortalType portal);
}

View file

@ -83,8 +83,8 @@ import game.item.ItemTool;
import game.model.ParticleType; import game.model.ParticleType;
import game.nbt.NBTTagCompound; import game.nbt.NBTTagCompound;
import game.nbt.NBTTagList; import game.nbt.NBTTagList;
import game.network.ClientPlayer; import game.network.IClientPlayer;
import game.network.Player; import game.network.IPlayer;
import game.packet.CPacketAction; import game.packet.CPacketAction;
import game.packet.CPacketBreak; import game.packet.CPacketBreak;
import game.packet.CPacketInput; import game.packet.CPacketInput;
@ -198,8 +198,8 @@ public abstract class EntityNPC extends EntityLiving
private int healTimer; private int healTimer;
private byte[] skin; private byte[] skin;
public Player connection; public IPlayer connection;
public ClientPlayer sendQueue; public IClientPlayer sendQueue;
protected Game gm; protected Game gm;
public InventoryPlayer inventory; public InventoryPlayer inventory;
@ -399,13 +399,13 @@ public abstract class EntityNPC extends EntityLiving
this.getEntityAttribute(Attributes.MOVEMENT_SPEED).setBaseValue(this.getEntityAttribute(Attributes.MOVEMENT_SPEED).getBaseValue() / 3.0); // 0.10000000149011612D); this.getEntityAttribute(Attributes.MOVEMENT_SPEED).setBaseValue(this.getEntityAttribute(Attributes.MOVEMENT_SPEED).getBaseValue() / 3.0); // 0.10000000149011612D);
} }
public final void setServerPlayer(Player connection) { public final void setServerPlayer(IPlayer connection) {
this.initPlayer(); this.initPlayer();
this.connection = connection; this.connection = connection;
this.stepHeight = 0.0F; this.stepHeight = 0.0F;
} }
public final void setClientPlayer(Game gm, ClientPlayer connection) { public final void setClientPlayer(Game gm, IClientPlayer connection) {
this.initPlayer(); this.initPlayer();
this.gm = gm; this.gm = gm;
this.sendQueue = connection; this.sendQueue = connection;

View file

@ -50,7 +50,7 @@ import game.material.Material;
import game.model.ParticleType; import game.model.ParticleType;
import game.nbt.NBTTagCompound; import game.nbt.NBTTagCompound;
import game.nbt.NBTTagList; import game.nbt.NBTTagList;
import game.network.Player; import game.network.IPlayer;
import game.packet.S1BPacketEntityAttach; import game.packet.S1BPacketEntityAttach;
import game.packet.SPacketAnimation; import game.packet.SPacketAnimation;
import game.packet.SPacketCollectItem; import game.packet.SPacketCollectItem;
@ -2462,7 +2462,7 @@ public abstract class EntityLiving extends Entity
return; return;
String msg; String msg;
String kill; String kill;
Player receiver = null; IPlayer receiver = null;
if(this.combat.size() == 0) { if(this.combat.size() == 0) {
msg = kill = natural ? String.format("%s starb", this.getColoredName(TextColor.LGRAY)) : null; msg = kill = natural ? String.format("%s starb", this.getColoredName(TextColor.LGRAY)) : null;
} }
@ -2551,7 +2551,7 @@ public abstract class EntityLiving extends Entity
if(receiver != null) if(receiver != null)
receiver.addFeed(kill); receiver.addFeed(kill);
if(forAll) if(forAll)
for(Player player : ((WorldServer)this.worldObj).getServer().getPlayers()) { for(IPlayer player : ((WorldServer)this.worldObj).getServer().getIPlayers()) {
if(player != receiver) if(player != receiver)
player.addFeed(msg); player.addFeed(msg);
} }

View file

@ -0,0 +1,15 @@
package game.network;
import game.packet.RPacketDisconnect;
import game.packet.RPacketEnableCompression;
import game.packet.RPacketLoginSuccess;
public interface IClientLoginHandler {
void handleDisconnect(RPacketDisconnect packetIn);
void handleLoginSuccess(RPacketLoginSuccess packetIn);
void handleEnableCompression(RPacketEnableCompression packetIn);
}

View file

@ -0,0 +1,315 @@
package game.network;
import game.packet.S14PacketEntity;
import game.packet.S18PacketEntityTeleport;
import game.packet.S19PacketEntityHeadLook;
import game.packet.S1APacketEntityStatus;
import game.packet.S1BPacketEntityAttach;
import game.packet.S1CPacketEntityMetadata;
import game.packet.S1DPacketEntityEffect;
import game.packet.S1EPacketRemoveEntityEffect;
import game.packet.S20PacketEntityProperties;
import game.packet.S27PacketExplosion;
import game.packet.S28PacketEffect;
import game.packet.S29PacketSoundEffect;
import game.packet.S2APacketParticles;
import game.packet.S2BPacketChangeGameState;
import game.packet.S2CPacketSpawnGlobalEntity;
import game.packet.S2DPacketOpenWindow;
import game.packet.S2EPacketCloseWindow;
import game.packet.S2FPacketSetSlot;
import game.packet.S30PacketWindowItems;
import game.packet.S31PacketWindowProperty;
import game.packet.S32PacketConfirmTransaction;
import game.packet.S33PacketUpdateSign;
import game.packet.S35PacketUpdateTileEntity;
import game.packet.S36PacketSignEditorOpen;
import game.packet.S38PacketPlayerListItem;
import game.packet.S39PacketPlayerAbilities;
import game.packet.S3APacketTabComplete;
import game.packet.S43PacketUpdateEntityNBT;
import game.packet.SPacketAnimation;
import game.packet.SPacketBiomes;
import game.packet.SPacketBlockAction;
import game.packet.SPacketBlockBreakAnim;
import game.packet.SPacketBlockChange;
import game.packet.SPacketCamera;
import game.packet.SPacketCharacterList;
import game.packet.SPacketChunkData;
import game.packet.SPacketCollectItem;
import game.packet.SPacketDestroyEntities;
import game.packet.SPacketDimensionName;
import game.packet.SPacketDisconnect;
import game.packet.SPacketEntityEquipment;
import game.packet.SPacketEntityVelocity;
import game.packet.SPacketHeldItemChange;
import game.packet.SPacketJoinGame;
import game.packet.SPacketKeepAlive;
import game.packet.SPacketLoading;
import game.packet.SPacketMapChunkBulk;
import game.packet.SPacketMessage;
import game.packet.SPacketMultiBlockChange;
import game.packet.SPacketPlayerPosLook;
import game.packet.SPacketRespawn;
import game.packet.SPacketServerTick;
import game.packet.SPacketSetExperience;
import game.packet.SPacketSkin;
import game.packet.SPacketSpawnMob;
import game.packet.SPacketSpawnObject;
import game.packet.SPacketSpawnPlayer;
import game.packet.SPacketTimeUpdate;
import game.packet.SPacketTrades;
import game.packet.SPacketUpdateHealth;
import game.packet.SPacketWorld;
public interface IClientPlayer {
void addToSendQueue(Packet packet);
void handleJoinGame(SPacketJoinGame packetIn);
/**
* Spawns an instance of the objecttype indicated by the packet and sets its position and momentum
*/
void handleSpawnObject(SPacketSpawnObject packetIn);
/**
* Handles globally visible entities. Used in vanilla for lightning bolts
*/
void handleSpawnGlobalEntity(S2CPacketSpawnGlobalEntity packetIn);
/**
* Sets the velocity of the specified entity to the specified value
*/
void handleEntityVelocity(SPacketEntityVelocity packetIn);
/**
* Invoked when the server registers new proximate objects in your watchlist or when objects in your watchlist have
* changed -> Registers any changes locally
*/
void handleEntityMetadata(S1CPacketEntityMetadata packetIn);
/**
* Handles the creation of a nearby player entity, sets the position and held item
*/
void handleSpawnPlayer(SPacketSpawnPlayer packetIn);
/**
* Updates an entity's position and rotation as specified by the packet
*/
void handleEntityTeleport(S18PacketEntityTeleport packetIn);
/**
* Updates which hotbar slot of the player is currently selected
*/
void handleHeldItemChange(SPacketHeldItemChange packetIn);
/**
* Updates the specified entity's position by the specified relative moment and absolute rotation. Note that
* subclassing of the packet allows for the specification of a subset of this data (e.g. only rel. position, abs.
* rotation or both).
*/
void handleEntityMovement(S14PacketEntity packetIn);
/**
* Updates the direction in which the specified entity is looking, normally this head rotation is independent of the
* rotation of the entity itself
*/
void handleEntityHeadLook(S19PacketEntityHeadLook packetIn);
/**
* Locally eliminates the entities. Invoked by the server when the items are in fact destroyed, or the player is no
* longer registered as required to monitor them. The latter happens when distance between the player and item
* increases beyond a certain treshold (typically the viewing distance)
*/
void handleDestroyEntities(SPacketDestroyEntities packetIn);
/**
* Handles changes in player positioning and rotation such as when travelling to a new dimension, (re)spawning,
* mounting horses etc. Seems to immediately reply to the server with the clients post-processing perspective on the
* player positioning
*/
void handlePlayerPosLook(SPacketPlayerPosLook packetIn);
/**
* Received from the servers PlayerManager if between 1 and 64 blocks in a chunk are changed. If only one block
* requires an update, the server sends S23PacketBlockChange and if 64 or more blocks are changed, the server sends
* S21PacketChunkData
*/
void handleMultiBlockChange(SPacketMultiBlockChange packetIn);
/**
* Updates the specified chunk with the supplied data, marks it for re-rendering and lighting recalculation
*/
void handleChunkData(SPacketChunkData packetIn);
void handleBiomes(SPacketBiomes packetIn);
/**
* Updates the block and metadata and generates a blockupdate (and notify the clients)
*/
void handleBlockChange(SPacketBlockChange packetIn);
/**
* Closes the network channel
*/
void handleDisconnect(SPacketDisconnect packetIn);
void handleCollectItem(SPacketCollectItem packetIn);
/**
* Prints a chatmessage in the chat GUI
*/
void handleMessage(SPacketMessage packetIn);
void handleLoading(SPacketLoading packet);
/**
* Renders a specified animation: Waking up a player, a living entity swinging its currently held item, being hurt
* or receiving a critical hit by normal or magical means
*/
void handleAnimation(SPacketAnimation packetIn);
/**
* Spawns the mob entity at the specified location, with the specified rotation, momentum and type. Updates the
* entities Datawatchers with the entity metadata specified in the packet
*/
void handleSpawnMob(SPacketSpawnMob packetIn);
void handleTimeUpdate(SPacketTimeUpdate packetIn);
void handleServerTick(SPacketServerTick packet);
void handleEntityAttach(S1BPacketEntityAttach packetIn);
/**
* Invokes the entities' handleUpdateHealth method which is implemented in LivingBase (hurt/death),
* MinecartMobSpawner (spawn delay), FireworkRocket & MinecartTNT (explosion), IronGolem (throwing,...), Witch
* (spawn particles), Zombie (villager transformation), Animal (breeding mode particles), Horse (breeding/smoke
* particles), Sheep (...), Tameable (...), Villager (particles for breeding mode, angry and happy), Wolf (...)
*/
void handleEntityStatus(S1APacketEntityStatus packetIn);
void handleUpdateHealth(SPacketUpdateHealth packetIn);
void handleSetExperience(SPacketSetExperience packetIn);
void handleRespawn(SPacketRespawn packetIn);
/**
* Initiates a new explosion (sound, particles, drop spawn) for the affected blocks indicated by the packet.
*/
void handleExplosion(S27PacketExplosion packetIn);
/**
* Displays a GUI by ID. In order starting from id 0: Chest, Workbench, Furnace, Dispenser, Enchanting table,
* Brewing stand, Villager merchant, Beacon, Anvil, Hopper, Dropper, Horse
*/
void handleOpenWindow(S2DPacketOpenWindow packetIn);
/**
* Handles pickin up an ItemStack or dropping one in your inventory or an open container
*/
void handleSetSlot(S2FPacketSetSlot packetIn);
/**
* Verifies that the server and client are synchronized with respect to the inventory/container opened by the player
* and confirms if it is the case.
*/
void handleConfirmTransaction(S32PacketConfirmTransaction packetIn);
/**
* Handles the placement of a specified ItemStack in a specified container/inventory slot
*/
void handleWindowItems(S30PacketWindowItems packetIn);
/**
* Creates a sign in the specified location if it didn't exist and opens the GUI to edit its text
*/
void handleSignEditorOpen(S36PacketSignEditorOpen packetIn);
/**
* Updates a specified sign with the specified text lines
*/
void handleUpdateSign(S33PacketUpdateSign packetIn);
/**
* Updates the NBTTagCompound metadata of instances of the following entitytypes: Mob spawners, command blocks,
* beacons, skulls, flowerpot
*/
void handleUpdateTileEntity(S35PacketUpdateTileEntity packetIn);
/**
* Sets the progressbar of the opened window to the specified value
*/
void handleWindowProperty(S31PacketWindowProperty packetIn);
void handleEntityEquipment(SPacketEntityEquipment packetIn);
/**
* Resets the ItemStack held in hand and closes the window that is opened
*/
void handleCloseWindow(S2EPacketCloseWindow packetIn);
/**
* Triggers Block.onBlockEventReceived, which is implemented in BlockPistonBase for extension/retraction, BlockNote
* for setting the instrument (including audiovisual feedback) and in BlockContainer to set the number of players
* accessing a (Ender)Chest
*/
void handleBlockAction(SPacketBlockAction packetIn);
/**
* Updates all registered IWorldAccess instances with destroyBlockInWorldPartially
*/
void handleBlockBreakAnim(SPacketBlockBreakAnim packetIn);
void handleMapChunkBulk(SPacketMapChunkBulk packetIn);
void handleChangeGameState(S2BPacketChangeGameState packetIn);
void handleEffect(S28PacketEffect packetIn);
void handleEntityEffect(S1DPacketEntityEffect packetIn);
void handleCamera(SPacketCamera packetIn);
void handleRemoveEntityEffect(S1EPacketRemoveEntityEffect packetIn);
void handlePlayerListItem(S38PacketPlayerListItem packetIn);
void handleCharacterList(SPacketCharacterList packet);
void handleKeepAlive(SPacketKeepAlive packetIn);
void handlePlayerAbilities(S39PacketPlayerAbilities packetIn);
/**
* Displays the available command-completion options the server knows of
*/
void handleTabComplete(S3APacketTabComplete packetIn);
void handleSoundEffect(S29PacketSoundEffect packetIn);
void handleEntityNBT(S43PacketUpdateEntityNBT packetIn);
/**
* Spawns a specified number of particles at the specified location with a randomized displacement according to
* specified bounds
*/
void handleParticles(S2APacketParticles packetIn);
/**
* Updates en entity's attributes and their respective modifiers, which are used for speed bonusses (player
* sprinting, animals fleeing, baby speed), weapon/tool attackDamage, hostiles followRange randomization, zombie
* maxHealth and knockback resistance as well as reinforcement spawning chance.
*/
void handleEntityProperties(S20PacketEntityProperties packetIn);
void handleSkin(SPacketSkin packetIn);
void handleTrades(SPacketTrades packetIn);
void handleWorld(SPacketWorld packetIn);
void handleDimName(SPacketDimensionName packetIn);
}

View file

@ -0,0 +1,9 @@
package game.network;
import game.packet.HPacketHandshake;
public interface IHandshakeHandler {
void processHandshake(HPacketHandshake packetIn);
}

View file

@ -0,0 +1,9 @@
package game.network;
import game.packet.LPacketPasswordResponse;
public interface ILoginHandler {
void processPasswordResponse(LPacketPasswordResponse packetIn);
}

View file

@ -0,0 +1,173 @@
package game.network;
import java.util.List;
import game.entity.Entity;
import game.entity.animal.EntityHorse;
import game.entity.npc.EntityNPC;
import game.entity.types.EntityLiving;
import game.init.SoundEvent;
import game.inventory.Container;
import game.inventory.IInventory;
import game.item.ItemStack;
import game.packet.CPacketAction;
import game.packet.CPacketBook;
import game.packet.CPacketBreak;
import game.packet.CPacketCheat;
import game.packet.CPacketClick;
import game.packet.CPacketComplete;
import game.packet.CPacketInput;
import game.packet.CPacketKeepAlive;
import game.packet.CPacketMessage;
import game.packet.CPacketPlace;
import game.packet.CPacketPlayer;
import game.packet.CPacketSign;
import game.packet.CPacketSkin;
import game.potion.PotionEffect;
import game.tileentity.IInteractionObject;
import game.tileentity.TileEntitySign;
import game.util.CharValidator;
import game.world.BlockPos;
import game.world.ChunkPos;
import game.world.PortalType;
public interface IPlayer {
public static class UserValidator implements CharValidator {
public boolean valid(char ch) {
return (ch >= 'a' && ch <= 'z') || (ch >= '0' && ch <= '9') || ch == '_' || ch == '-';
}
}
public static class NickValidator implements CharValidator {
public boolean valid(char ch) {
return (ch <= 0xff && Character.isLetterOrDigit(ch)) || (ch >= 32 && ch < 126);
}
}
public static int MAX_USER_LENGTH = 16;
public static int MAX_NICK_LENGTH = 32;
public static int MAX_PASS_LENGTH = 64;
public static int MAX_CMD_LENGTH = 1024;
public static int MAX_INFO_LENGTH = 4096;
public static CharValidator VALID_USER = new IPlayer.UserValidator();
public static CharValidator VALID_NICK = new IPlayer.NickValidator();
public static boolean isValidNick(String user) {
return VALID_NICK.valid(user);
}
public static boolean isValidUser(String user) {
return VALID_USER.valid(user);
}
void onEntityDeath();
boolean isInEditor();
EntityNPC getPresentEntity();
String getUser();
int getLatency();
boolean isAdmin();
void addToPlayerScore(EntityLiving entity);
void displayTradeGui(EntityNPC npc);
void setPlayerHealthUpdated();
void removeEntity(Entity p_152339_1_);
void sendPlayerAbilities();
void addFeed(String msg);
void addHotbar(String msg);
void addHotbar(String format, Object... args);
void sendThrowMessage(ItemStack stack);
void resetLastExperience();
void travelToDimension(int dimensionId, BlockPos pos, float yaw, float pitch, PortalType portal);
void teleport(double x, double y, double z, float yaw, float pitch, int dimension);
void onItemPickup(Entity entity, int amount);
void mountEntity(Entity entityIn);
void openEditSign(TileEntitySign signTile);
void displayGui(IInteractionObject guiOwner);
void displayGUIChest(IInventory chestInventory);
void displayGUIHorse(EntityHorse horse, IInventory horseInventory);
void closeScreen();
void onItemUseFinish();
void onNewEffect(PotionEffect id);
void onChangedEffect(PotionEffect id, boolean added);
void onFinishedEffect(PotionEffect effect);
void setPositionAndUpdate(double x, double y, double z);
void onCriticalHit(Entity entityHit);
void onEnchantmentCritical(Entity entityHit);
void updateEffectMeta();
void playSound(SoundEvent name, float volume);
void sendContainerToPlayer(Container container);
void updateEntity();
void setSelection(boolean primary, BlockPos pos);
void setSelectMode();
void sendPacket(Packet packet);
void setPlayerLocation(double x, double y, double z, float yaw, float pitch);
void processKeepAlive(CPacketKeepAlive packetIn);
void processMessage(CPacketMessage packetIn);
void processComplete(CPacketComplete packetIn);
void processPlayer(CPacketPlayer packetIn);
void processBreak(CPacketBreak packetIn);
void processPlace(CPacketPlace packetIn);
void processAction(CPacketAction packetIn);
void processInput(CPacketInput packetIn);
void processClick(CPacketClick packetIn);
void processCheat(CPacketCheat packetIn);
void processSign(CPacketSign packetIn);
void processSkin(CPacketSkin packetIn);
void processBook(CPacketBook packetIn);
List<ChunkPos> getLoadedChunkList();
double getManagedX();
double getManagedZ();
void setManagedPos(double x, double z);
}

View file

@ -10,6 +10,7 @@ import java.util.regex.Pattern;
import game.future.ThreadFactoryBuilder; import game.future.ThreadFactoryBuilder;
import game.log.Log; import game.log.Log;
import game.network.NetHandler.ThreadQuickExitException; import game.network.NetHandler.ThreadQuickExitException;
import game.util.LazyLoadBase;
import io.netty.bootstrap.Bootstrap; import io.netty.bootstrap.Bootstrap;
import io.netty.channel.Channel; import io.netty.channel.Channel;
import io.netty.channel.ChannelException; import io.netty.channel.ChannelException;

View file

@ -19,7 +19,7 @@ public abstract class NetHandler {
public void update() { public void update() {
} }
public static <T extends NetHandler> void checkThread(final Packet<T> packet, final T handler, IThreadListener listener) public static <T> void checkThread(final Packet<T> packet, final T handler, IThreadListener listener)
throws ThreadQuickExitException { throws ThreadQuickExitException {
if(!listener.isMainThread()) { if(!listener.isMainThread()) {
listener.schedule(new Runnable() { listener.schedule(new Runnable() {
@ -31,7 +31,7 @@ public abstract class NetHandler {
} }
} }
public static <T extends NetHandler> void checkThread(final Packet<T> packet, final T handler, IThreadListener listener, Object check) public static <T> void checkThread(final Packet<T> packet, final T handler, IThreadListener listener, Object check)
throws ThreadQuickExitException { throws ThreadQuickExitException {
if(check == null && listener.isMainThread()) { if(check == null && listener.isMainThread()) {
throw EXIT; throw EXIT;

View file

@ -2,7 +2,7 @@ package game.network;
import java.io.IOException; import java.io.IOException;
public interface Packet<T extends NetHandler> public interface Packet<T>
{ {
void readPacketData(PacketBuffer buf) throws IOException; void readPacketData(PacketBuffer buf) throws IOException;
void writePacketData(PacketBuffer buf) throws IOException; void writePacketData(PacketBuffer buf) throws IOException;

View file

@ -2,11 +2,10 @@ package game.packet;
import java.io.IOException; import java.io.IOException;
import game.network.NetHandler;
import game.network.Packet; import game.network.Packet;
import game.network.PacketBuffer; import game.network.PacketBuffer;
public abstract class APacketEmpty<T extends NetHandler> implements Packet<T> { public abstract class APacketEmpty<T> implements Packet<T> {
public final void readPacketData(PacketBuffer buf) throws IOException { public final void readPacketData(PacketBuffer buf) throws IOException {
} }

View file

@ -2,11 +2,10 @@ package game.packet;
import java.io.IOException; import java.io.IOException;
import game.network.NetHandler;
import game.network.Packet; import game.network.Packet;
import game.network.PacketBuffer; import game.network.PacketBuffer;
public abstract class APacketVarInt<T extends NetHandler> implements Packet<T> { public abstract class APacketVarInt<T> implements Packet<T> {
private int value; private int value;
public APacketVarInt() { public APacketVarInt() {

View file

@ -4,9 +4,9 @@ import java.io.IOException;
import game.network.Packet; import game.network.Packet;
import game.network.PacketBuffer; import game.network.PacketBuffer;
import game.network.Player; import game.network.IPlayer;
public class CPacketAction implements Packet<Player> public class CPacketAction implements Packet<IPlayer>
{ {
private Action action; private Action action;
private int auxData; private int auxData;
@ -38,7 +38,7 @@ public class CPacketAction implements Packet<Player>
buf.writeVarIntToBuffer(this.auxData); buf.writeVarIntToBuffer(this.auxData);
} }
public void processPacket(Player handler) public void processPacket(IPlayer handler)
{ {
handler.processAction(this); handler.processAction(this);
} }

View file

@ -4,9 +4,9 @@ import java.io.IOException;
import game.network.Packet; import game.network.Packet;
import game.network.PacketBuffer; import game.network.PacketBuffer;
import game.network.Player; import game.network.IPlayer;
public class CPacketBook implements Packet<Player> public class CPacketBook implements Packet<IPlayer>
{ {
private String[] pages; private String[] pages;
@ -40,7 +40,7 @@ public class CPacketBook implements Packet<Player>
} }
} }
public void processPacket(Player handler) public void processPacket(IPlayer handler)
{ {
handler.processBook(this); handler.processBook(this);
} }

View file

@ -4,11 +4,11 @@ import java.io.IOException;
import game.network.Packet; import game.network.Packet;
import game.network.PacketBuffer; import game.network.PacketBuffer;
import game.network.Player; import game.network.IPlayer;
import game.world.BlockPos; import game.world.BlockPos;
import game.world.Facing; import game.world.Facing;
public class CPacketBreak implements Packet<Player> public class CPacketBreak implements Packet<IPlayer>
{ {
private BlockPos position; private BlockPos position;
private Facing facing; private Facing facing;
@ -39,7 +39,7 @@ public class CPacketBreak implements Packet<Player>
buf.writeByte(this.facing.getIndex()); buf.writeByte(this.facing.getIndex());
} }
public void processPacket(Player handler) public void processPacket(IPlayer handler)
{ {
handler.processBreak(this); handler.processBreak(this);
} }

View file

@ -5,9 +5,9 @@ import java.io.IOException;
import game.item.ItemStack; import game.item.ItemStack;
import game.network.Packet; import game.network.Packet;
import game.network.PacketBuffer; import game.network.PacketBuffer;
import game.network.Player; import game.network.IPlayer;
public class CPacketCheat implements Packet<Player> public class CPacketCheat implements Packet<IPlayer>
{ {
private ItemStack stack; private ItemStack stack;
private int slot; private int slot;
@ -23,7 +23,7 @@ public class CPacketCheat implements Packet<Player>
this.stack.stackSize = full ? this.stack.getMaxStackSize() : 1; this.stack.stackSize = full ? this.stack.getMaxStackSize() : 1;
} }
public void processPacket(Player handler) public void processPacket(IPlayer handler)
{ {
handler.processCheat(this); handler.processCheat(this);
} }

View file

@ -5,9 +5,9 @@ import java.io.IOException;
import game.item.ItemStack; import game.item.ItemStack;
import game.network.Packet; import game.network.Packet;
import game.network.PacketBuffer; import game.network.PacketBuffer;
import game.network.Player; import game.network.IPlayer;
public class CPacketClick implements Packet<Player> public class CPacketClick implements Packet<IPlayer>
{ {
/** The id of the window which was clicked. 0 for player inventory. */ /** The id of the window which was clicked. 0 for player inventory. */
private int windowId; private int windowId;
@ -41,7 +41,7 @@ public class CPacketClick implements Packet<Player>
this.mode = mode; this.mode = mode;
} }
public void processPacket(Player handler) public void processPacket(IPlayer handler)
{ {
handler.processClick(this); handler.processClick(this);
} }

View file

@ -4,10 +4,10 @@ import java.io.IOException;
import game.network.Packet; import game.network.Packet;
import game.network.PacketBuffer; import game.network.PacketBuffer;
import game.network.Player; import game.network.IPlayer;
import game.world.BlockPos; import game.world.BlockPos;
public class CPacketComplete implements Packet<Player> public class CPacketComplete implements Packet<IPlayer>
{ {
private String message; private String message;
private int entityId; private int entityId;
@ -41,7 +41,7 @@ public class CPacketComplete implements Packet<Player>
buf.writeBlockPos(this.position); buf.writeBlockPos(this.position);
} }
public void processPacket(Player handler) public void processPacket(IPlayer handler)
{ {
handler.processComplete(this); handler.processComplete(this);
} }

View file

@ -4,9 +4,9 @@ import java.io.IOException;
import game.network.Packet; import game.network.Packet;
import game.network.PacketBuffer; import game.network.PacketBuffer;
import game.network.Player; import game.network.IPlayer;
public class CPacketInput implements Packet<Player> public class CPacketInput implements Packet<IPlayer>
{ {
private float strafeSpeed; private float strafeSpeed;
private float forwardSpeed; private float forwardSpeed;
@ -53,7 +53,7 @@ public class CPacketInput implements Packet<Player>
buf.writeByte(b0); buf.writeByte(b0);
} }
public void processPacket(Player handler) public void processPacket(IPlayer handler)
{ {
handler.processInput(this); handler.processInput(this);
} }

View file

@ -1,8 +1,8 @@
package game.packet; package game.packet;
import game.network.Player; import game.network.IPlayer;
public class CPacketKeepAlive extends APacketVarInt<Player> public class CPacketKeepAlive extends APacketVarInt<IPlayer>
{ {
public CPacketKeepAlive() public CPacketKeepAlive()
{ {
@ -13,7 +13,7 @@ public class CPacketKeepAlive extends APacketVarInt<Player>
super(key); super(key);
} }
public void processPacket(Player handler) public void processPacket(IPlayer handler)
{ {
handler.processKeepAlive(this); handler.processKeepAlive(this);
} }

View file

@ -4,9 +4,9 @@ import java.io.IOException;
import game.network.Packet; import game.network.Packet;
import game.network.PacketBuffer; import game.network.PacketBuffer;
import game.network.Player; import game.network.IPlayer;
public class CPacketMessage implements Packet<Player> public class CPacketMessage implements Packet<IPlayer>
{ {
private Type type; private Type type;
private String message; private String message;
@ -33,7 +33,7 @@ public class CPacketMessage implements Packet<Player>
buf.writeString(this.message); buf.writeString(this.message);
} }
public void processPacket(Player handler) public void processPacket(IPlayer handler)
{ {
handler.processMessage(this); handler.processMessage(this);
} }
@ -49,10 +49,10 @@ public class CPacketMessage implements Packet<Player>
} }
public static enum Type { public static enum Type {
COMMAND(Player.MAX_CMD_LENGTH), COMMAND(IPlayer.MAX_CMD_LENGTH),
CHAT(Player.MAX_CMD_LENGTH), CHAT(IPlayer.MAX_CMD_LENGTH),
DISPLAY(Player.MAX_NICK_LENGTH), DISPLAY(IPlayer.MAX_NICK_LENGTH),
INFO(Player.MAX_INFO_LENGTH); INFO(IPlayer.MAX_INFO_LENGTH);
// , ITEM(30); // , ITEM(30);
private final int length; private final int length;

View file

@ -5,10 +5,10 @@ import java.io.IOException;
import game.item.ItemStack; import game.item.ItemStack;
import game.network.Packet; import game.network.Packet;
import game.network.PacketBuffer; import game.network.PacketBuffer;
import game.network.Player; import game.network.IPlayer;
import game.world.BlockPos; import game.world.BlockPos;
public class CPacketPlace implements Packet<Player> public class CPacketPlace implements Packet<IPlayer>
{ {
private static final BlockPos DUMMY_POS = new BlockPos(-1, -1, -1); private static final BlockPos DUMMY_POS = new BlockPos(-1, -1, -1);
@ -58,7 +58,7 @@ public class CPacketPlace implements Packet<Player>
buf.writeByte((int)(this.facingZ * 16.0F)); buf.writeByte((int)(this.facingZ * 16.0F));
} }
public void processPacket(Player handler) public void processPacket(IPlayer handler)
{ {
handler.processPlace(this); handler.processPlace(this);
} }

View file

@ -4,9 +4,9 @@ import java.io.IOException;
import game.network.Packet; import game.network.Packet;
import game.network.PacketBuffer; import game.network.PacketBuffer;
import game.network.Player; import game.network.IPlayer;
public class CPacketPlayer implements Packet<Player> public class CPacketPlayer implements Packet<IPlayer>
{ {
protected double x; protected double x;
protected double y; protected double y;
@ -26,7 +26,7 @@ public class CPacketPlayer implements Packet<Player>
this.onGround = isOnGround; this.onGround = isOnGround;
} }
public void processPacket(Player handler) public void processPacket(IPlayer handler)
{ {
handler.processPlayer(this); handler.processPlayer(this);
} }

View file

@ -4,10 +4,10 @@ import java.io.IOException;
import game.network.Packet; import game.network.Packet;
import game.network.PacketBuffer; import game.network.PacketBuffer;
import game.network.Player; import game.network.IPlayer;
import game.world.BlockPos; import game.world.BlockPos;
public class CPacketSign implements Packet<Player> public class CPacketSign implements Packet<IPlayer>
{ {
private BlockPos pos; private BlockPos pos;
private String[] lines; private String[] lines;
@ -48,7 +48,7 @@ public class CPacketSign implements Packet<Player>
} }
} }
public void processPacket(Player handler) public void processPacket(IPlayer handler)
{ {
handler.processSign(this); handler.processSign(this);
} }

View file

@ -7,9 +7,9 @@ import client.renderer.texture.EntityTexManager;
import game.init.SpeciesRegistry.ModelType; import game.init.SpeciesRegistry.ModelType;
import game.network.Packet; import game.network.Packet;
import game.network.PacketBuffer; import game.network.PacketBuffer;
import game.network.Player; import game.network.IPlayer;
public class CPacketSkin implements Packet<Player> { public class CPacketSkin implements Packet<IPlayer> {
private byte[] texture; private byte[] texture;
private String character; private String character;
@ -58,7 +58,7 @@ public class CPacketSkin implements Packet<Player> {
buf.writeByteArray(this.texture); buf.writeByteArray(this.texture);
} }
public void processPacket(Player handler) { public void processPacket(IPlayer handler) {
handler.processSkin(this); handler.processSkin(this);
} }
} }

View file

@ -2,11 +2,11 @@ package game.packet;
import java.io.IOException; import java.io.IOException;
import game.network.HandshakeHandler; import game.network.IHandshakeHandler;
import game.network.Packet; import game.network.Packet;
import game.network.PacketBuffer; import game.network.PacketBuffer;
public class HPacketHandshake implements Packet<HandshakeHandler> { public class HPacketHandshake implements Packet<IHandshakeHandler> {
private int protocol; private int protocol;
public HPacketHandshake() { public HPacketHandshake() {
@ -30,7 +30,7 @@ public class HPacketHandshake implements Packet<HandshakeHandler> {
buf.writeVarIntToBuffer(this.protocol); buf.writeVarIntToBuffer(this.protocol);
} }
public void processPacket(HandshakeHandler handler) { public void processPacket(IHandshakeHandler handler) {
handler.processHandshake(this); handler.processHandshake(this);
} }

View file

@ -2,12 +2,12 @@ package game.packet;
import java.io.IOException; import java.io.IOException;
import game.network.LoginHandler; import game.network.IPlayer;
import game.network.ILoginHandler;
import game.network.Packet; import game.network.Packet;
import game.network.PacketBuffer; import game.network.PacketBuffer;
import game.network.Player;
public class LPacketPasswordResponse implements Packet<LoginHandler> public class LPacketPasswordResponse implements Packet<ILoginHandler>
{ {
private String user; private String user;
private String access; private String access;
@ -29,9 +29,9 @@ public class LPacketPasswordResponse implements Packet<LoginHandler>
*/ */
public void readPacketData(PacketBuffer buf) throws IOException public void readPacketData(PacketBuffer buf) throws IOException
{ {
this.user = buf.readStringFromBuffer(Player.MAX_USER_LENGTH); this.user = buf.readStringFromBuffer(IPlayer.MAX_USER_LENGTH);
this.access = buf.readStringFromBuffer(Player.MAX_PASS_LENGTH); this.access = buf.readStringFromBuffer(IPlayer.MAX_PASS_LENGTH);
this.password = buf.readStringFromBuffer(Player.MAX_PASS_LENGTH); this.password = buf.readStringFromBuffer(IPlayer.MAX_PASS_LENGTH);
} }
/** /**
@ -47,7 +47,7 @@ public class LPacketPasswordResponse implements Packet<LoginHandler>
/** /**
* Passes this Packet on to the NetHandler for processing. * Passes this Packet on to the NetHandler for processing.
*/ */
public void processPacket(LoginHandler handler) public void processPacket(ILoginHandler handler)
{ {
handler.processPasswordResponse(this); handler.processPasswordResponse(this);
} }

View file

@ -2,11 +2,11 @@ package game.packet;
import java.io.IOException; import java.io.IOException;
import game.network.ClientLoginHandler; import game.network.IClientLoginHandler;
import game.network.Packet; import game.network.Packet;
import game.network.PacketBuffer; import game.network.PacketBuffer;
public class RPacketDisconnect implements Packet<ClientLoginHandler> public class RPacketDisconnect implements Packet<IClientLoginHandler>
{ {
private String reason; private String reason;
@ -38,7 +38,7 @@ public class RPacketDisconnect implements Packet<ClientLoginHandler>
/** /**
* Passes this Packet on to the NetHandler for processing. * Passes this Packet on to the NetHandler for processing.
*/ */
public void processPacket(ClientLoginHandler handler) public void processPacket(IClientLoginHandler handler)
{ {
handler.handleDisconnect(this); handler.handleDisconnect(this);
} }

View file

@ -1,8 +1,8 @@
package game.packet; package game.packet;
import game.network.ClientLoginHandler; import game.network.IClientLoginHandler;
public class RPacketEnableCompression extends APacketVarInt<ClientLoginHandler> public class RPacketEnableCompression extends APacketVarInt<IClientLoginHandler>
{ {
public RPacketEnableCompression() public RPacketEnableCompression()
{ {
@ -13,7 +13,7 @@ public class RPacketEnableCompression extends APacketVarInt<ClientLoginHandler>
super(comp); super(comp);
} }
public void processPacket(ClientLoginHandler handler) public void processPacket(IClientLoginHandler handler)
{ {
handler.handleEnableCompression(this); handler.handleEnableCompression(this);
} }

View file

@ -1,10 +1,10 @@
package game.packet; package game.packet;
import game.network.ClientLoginHandler; import game.network.IClientLoginHandler;
public class RPacketLoginSuccess extends APacketEmpty<ClientLoginHandler> public class RPacketLoginSuccess extends APacketEmpty<IClientLoginHandler>
{ {
public void processPacket(ClientLoginHandler handler) public void processPacket(IClientLoginHandler handler)
{ {
handler.handleLoginSuccess(this); handler.handleLoginSuccess(this);
} }

View file

@ -3,12 +3,12 @@ package game.packet;
import java.io.IOException; import java.io.IOException;
import game.entity.Entity; import game.entity.Entity;
import game.network.ClientPlayer; import game.network.IClientPlayer;
import game.network.Packet; import game.network.Packet;
import game.network.PacketBuffer; import game.network.PacketBuffer;
import game.world.World; import game.world.World;
public class S14PacketEntity implements Packet<ClientPlayer> public class S14PacketEntity implements Packet<IClientPlayer>
{ {
protected int entityId; protected int entityId;
protected byte posX; protected byte posX;
@ -47,7 +47,7 @@ public class S14PacketEntity implements Packet<ClientPlayer>
/** /**
* Passes this Packet on to the NetHandler for processing. * Passes this Packet on to the NetHandler for processing.
*/ */
public void processPacket(ClientPlayer handler) public void processPacket(IClientPlayer handler)
{ {
handler.handleEntityMovement(this); handler.handleEntityMovement(this);
} }

View file

@ -3,12 +3,12 @@ package game.packet;
import java.io.IOException; import java.io.IOException;
import game.entity.Entity; import game.entity.Entity;
import game.network.ClientPlayer; import game.network.IClientPlayer;
import game.network.Packet; import game.network.Packet;
import game.network.PacketBuffer; import game.network.PacketBuffer;
import game.util.ExtMath; import game.util.ExtMath;
public class S18PacketEntityTeleport implements Packet<ClientPlayer> public class S18PacketEntityTeleport implements Packet<IClientPlayer>
{ {
private int entityId; private int entityId;
private int posX; private int posX;
@ -75,7 +75,7 @@ public class S18PacketEntityTeleport implements Packet<ClientPlayer>
/** /**
* Passes this Packet on to the NetHandler for processing. * Passes this Packet on to the NetHandler for processing.
*/ */
public void processPacket(ClientPlayer handler) public void processPacket(IClientPlayer handler)
{ {
handler.handleEntityTeleport(this); handler.handleEntityTeleport(this);
} }

View file

@ -3,12 +3,12 @@ package game.packet;
import java.io.IOException; import java.io.IOException;
import game.entity.Entity; import game.entity.Entity;
import game.network.ClientPlayer; import game.network.IClientPlayer;
import game.network.Packet; import game.network.Packet;
import game.network.PacketBuffer; import game.network.PacketBuffer;
import game.world.World; import game.world.World;
public class S19PacketEntityHeadLook implements Packet<ClientPlayer> public class S19PacketEntityHeadLook implements Packet<IClientPlayer>
{ {
private int entityId; private int entityId;
private byte yaw; private byte yaw;
@ -44,7 +44,7 @@ public class S19PacketEntityHeadLook implements Packet<ClientPlayer>
/** /**
* Passes this Packet on to the NetHandler for processing. * Passes this Packet on to the NetHandler for processing.
*/ */
public void processPacket(ClientPlayer handler) public void processPacket(IClientPlayer handler)
{ {
handler.handleEntityHeadLook(this); handler.handleEntityHeadLook(this);
} }

View file

@ -3,12 +3,12 @@ package game.packet;
import java.io.IOException; import java.io.IOException;
import game.entity.Entity; import game.entity.Entity;
import game.network.ClientPlayer; import game.network.IClientPlayer;
import game.network.Packet; import game.network.Packet;
import game.network.PacketBuffer; import game.network.PacketBuffer;
import game.world.World; import game.world.World;
public class S1APacketEntityStatus implements Packet<ClientPlayer> public class S1APacketEntityStatus implements Packet<IClientPlayer>
{ {
private int entityId; private int entityId;
private byte logicOpcode; private byte logicOpcode;
@ -44,7 +44,7 @@ public class S1APacketEntityStatus implements Packet<ClientPlayer>
/** /**
* Passes this Packet on to the NetHandler for processing. * Passes this Packet on to the NetHandler for processing.
*/ */
public void processPacket(ClientPlayer handler) public void processPacket(IClientPlayer handler)
{ {
handler.handleEntityStatus(this); handler.handleEntityStatus(this);
} }

View file

@ -3,11 +3,11 @@ package game.packet;
import java.io.IOException; import java.io.IOException;
import game.entity.Entity; import game.entity.Entity;
import game.network.ClientPlayer; import game.network.IClientPlayer;
import game.network.Packet; import game.network.Packet;
import game.network.PacketBuffer; import game.network.PacketBuffer;
public class S1BPacketEntityAttach implements Packet<ClientPlayer> public class S1BPacketEntityAttach implements Packet<IClientPlayer>
{ {
private int leash; private int leash;
private int entityId; private int entityId;
@ -47,7 +47,7 @@ public class S1BPacketEntityAttach implements Packet<ClientPlayer>
/** /**
* Passes this Packet on to the NetHandler for processing. * Passes this Packet on to the NetHandler for processing.
*/ */
public void processPacket(ClientPlayer handler) public void processPacket(IClientPlayer handler)
{ {
handler.handleEntityAttach(this); handler.handleEntityAttach(this);
} }

View file

@ -4,11 +4,11 @@ import java.io.IOException;
import java.util.List; import java.util.List;
import game.entity.DataWatcher; import game.entity.DataWatcher;
import game.network.ClientPlayer; import game.network.IClientPlayer;
import game.network.Packet; import game.network.Packet;
import game.network.PacketBuffer; import game.network.PacketBuffer;
public class S1CPacketEntityMetadata implements Packet<ClientPlayer> public class S1CPacketEntityMetadata implements Packet<IClientPlayer>
{ {
private int entityId; private int entityId;
private List<DataWatcher.WatchableObject> field_149378_b; private List<DataWatcher.WatchableObject> field_149378_b;
@ -52,7 +52,7 @@ public class S1CPacketEntityMetadata implements Packet<ClientPlayer>
/** /**
* Passes this Packet on to the NetHandler for processing. * Passes this Packet on to the NetHandler for processing.
*/ */
public void processPacket(ClientPlayer handler) public void processPacket(IClientPlayer handler)
{ {
handler.handleEntityMetadata(this); handler.handleEntityMetadata(this);
} }

View file

@ -2,13 +2,13 @@ package game.packet;
import java.io.IOException; import java.io.IOException;
import game.network.ClientPlayer; import game.network.IClientPlayer;
import game.network.Packet; import game.network.Packet;
import game.network.PacketBuffer; import game.network.PacketBuffer;
import game.potion.Potion; import game.potion.Potion;
import game.potion.PotionEffect; import game.potion.PotionEffect;
public class S1DPacketEntityEffect implements Packet<ClientPlayer> public class S1DPacketEntityEffect implements Packet<IClientPlayer>
{ {
private int entityId; private int entityId;
private Potion effectId; private Potion effectId;
@ -69,7 +69,7 @@ public class S1DPacketEntityEffect implements Packet<ClientPlayer>
/** /**
* Passes this Packet on to the NetHandler for processing. * Passes this Packet on to the NetHandler for processing.
*/ */
public void processPacket(ClientPlayer handler) public void processPacket(IClientPlayer handler)
{ {
handler.handleEntityEffect(this); handler.handleEntityEffect(this);
} }

View file

@ -2,13 +2,13 @@ package game.packet;
import java.io.IOException; import java.io.IOException;
import game.network.ClientPlayer; import game.network.IClientPlayer;
import game.network.Packet; import game.network.Packet;
import game.network.PacketBuffer; import game.network.PacketBuffer;
import game.potion.Potion; import game.potion.Potion;
import game.potion.PotionEffect; import game.potion.PotionEffect;
public class S1EPacketRemoveEntityEffect implements Packet<ClientPlayer> public class S1EPacketRemoveEntityEffect implements Packet<IClientPlayer>
{ {
private int entityId; private int entityId;
private Potion effectId; private Potion effectId;
@ -44,7 +44,7 @@ public class S1EPacketRemoveEntityEffect implements Packet<ClientPlayer>
/** /**
* Passes this Packet on to the NetHandler for processing. * Passes this Packet on to the NetHandler for processing.
*/ */
public void processPacket(ClientPlayer handler) public void processPacket(IClientPlayer handler)
{ {
handler.handleRemoveEntityEffect(this); handler.handleRemoveEntityEffect(this);
} }

View file

@ -7,11 +7,11 @@ import java.util.List;
import game.collect.Lists; import game.collect.Lists;
import game.entity.attributes.AttributeInstance; import game.entity.attributes.AttributeInstance;
import game.entity.attributes.AttributeModifier; import game.entity.attributes.AttributeModifier;
import game.network.ClientPlayer; import game.network.IClientPlayer;
import game.network.Packet; import game.network.Packet;
import game.network.PacketBuffer; import game.network.PacketBuffer;
public class S20PacketEntityProperties implements Packet<ClientPlayer> public class S20PacketEntityProperties implements Packet<IClientPlayer>
{ {
private int entityId; private int entityId;
private final List<S20PacketEntityProperties.Snapshot> field_149444_b = Lists.<S20PacketEntityProperties.Snapshot>newArrayList(); private final List<S20PacketEntityProperties.Snapshot> field_149444_b = Lists.<S20PacketEntityProperties.Snapshot>newArrayList();
@ -81,7 +81,7 @@ public class S20PacketEntityProperties implements Packet<ClientPlayer>
/** /**
* Passes this Packet on to the NetHandler for processing. * Passes this Packet on to the NetHandler for processing.
*/ */
public void processPacket(ClientPlayer handler) public void processPacket(IClientPlayer handler)
{ {
handler.handleEntityProperties(this); handler.handleEntityProperties(this);
} }

View file

@ -5,13 +5,13 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import game.collect.Lists; import game.collect.Lists;
import game.network.ClientPlayer; import game.network.IClientPlayer;
import game.network.Packet; import game.network.Packet;
import game.network.PacketBuffer; import game.network.PacketBuffer;
import game.world.BlockPos; import game.world.BlockPos;
import game.world.Vec3; import game.world.Vec3;
public class S27PacketExplosion implements Packet<ClientPlayer> public class S27PacketExplosion implements Packet<IClientPlayer>
{ {
private double posX; private double posX;
private double posY; private double posY;
@ -106,7 +106,7 @@ public class S27PacketExplosion implements Packet<ClientPlayer>
/** /**
* Passes this Packet on to the NetHandler for processing. * Passes this Packet on to the NetHandler for processing.
*/ */
public void processPacket(ClientPlayer handler) public void processPacket(IClientPlayer handler)
{ {
handler.handleExplosion(this); handler.handleExplosion(this);
} }

View file

@ -2,12 +2,12 @@ package game.packet;
import java.io.IOException; import java.io.IOException;
import game.network.ClientPlayer; import game.network.IClientPlayer;
import game.network.Packet; import game.network.Packet;
import game.network.PacketBuffer; import game.network.PacketBuffer;
import game.world.BlockPos; import game.world.BlockPos;
public class S28PacketEffect implements Packet<ClientPlayer> { public class S28PacketEffect implements Packet<IClientPlayer> {
private int soundType; private int soundType;
private BlockPos soundPos; private BlockPos soundPos;
private int soundData; private int soundData;
@ -33,7 +33,7 @@ public class S28PacketEffect implements Packet<ClientPlayer> {
buf.writeInt(this.soundData); buf.writeInt(this.soundData);
} }
public void processPacket(ClientPlayer handler) { public void processPacket(IClientPlayer handler) {
handler.handleEffect(this); handler.handleEffect(this);
} }

View file

@ -3,11 +3,11 @@ package game.packet;
import java.io.IOException; import java.io.IOException;
import game.init.SoundEvent; import game.init.SoundEvent;
import game.network.ClientPlayer; import game.network.IClientPlayer;
import game.network.Packet; import game.network.Packet;
import game.network.PacketBuffer; import game.network.PacketBuffer;
public class S29PacketSoundEffect implements Packet<ClientPlayer> public class S29PacketSoundEffect implements Packet<IClientPlayer>
{ {
private SoundEvent sound; private SoundEvent sound;
private int posX; private int posX;
@ -86,7 +86,7 @@ public class S29PacketSoundEffect implements Packet<ClientPlayer>
return this.soundVolume; return this.soundVolume;
} }
public void processPacket(ClientPlayer handler) public void processPacket(IClientPlayer handler)
{ {
handler.handleSoundEffect(this); handler.handleSoundEffect(this);
} }

View file

@ -3,11 +3,11 @@ package game.packet;
import java.io.IOException; import java.io.IOException;
import game.model.ParticleType; import game.model.ParticleType;
import game.network.ClientPlayer; import game.network.IClientPlayer;
import game.network.Packet; import game.network.Packet;
import game.network.PacketBuffer; import game.network.PacketBuffer;
public class S2APacketParticles implements Packet<ClientPlayer> public class S2APacketParticles implements Packet<IClientPlayer>
{ {
private ParticleType particleType; private ParticleType particleType;
private float xCoord; private float xCoord;
@ -183,7 +183,7 @@ public class S2APacketParticles implements Packet<ClientPlayer>
/** /**
* Passes this Packet on to the NetHandler for processing. * Passes this Packet on to the NetHandler for processing.
*/ */
public void processPacket(ClientPlayer handler) public void processPacket(IClientPlayer handler)
{ {
handler.handleParticles(this); handler.handleParticles(this);
} }

View file

@ -2,12 +2,12 @@ package game.packet;
import java.io.IOException; import java.io.IOException;
import game.network.ClientPlayer; import game.network.IClientPlayer;
import game.network.Packet; import game.network.Packet;
import game.network.PacketBuffer; import game.network.PacketBuffer;
import game.util.ExtMath; import game.util.ExtMath;
public class S2BPacketChangeGameState implements Packet<ClientPlayer> public class S2BPacketChangeGameState implements Packet<IClientPlayer>
{ {
private Action action; private Action action;
private int param; private int param;
@ -44,7 +44,7 @@ public class S2BPacketChangeGameState implements Packet<ClientPlayer>
buf.writeVarIntToBuffer(this.param); buf.writeVarIntToBuffer(this.param);
} }
public void processPacket(ClientPlayer handler) public void processPacket(IClientPlayer handler)
{ {
handler.handleChangeGameState(this); handler.handleChangeGameState(this);
} }

View file

@ -3,12 +3,12 @@ package game.packet;
import java.io.IOException; import java.io.IOException;
import game.entity.Entity; import game.entity.Entity;
import game.network.ClientPlayer; import game.network.IClientPlayer;
import game.network.Packet; import game.network.Packet;
import game.network.PacketBuffer; import game.network.PacketBuffer;
import game.util.ExtMath; import game.util.ExtMath;
public class S2CPacketSpawnGlobalEntity implements Packet<ClientPlayer> public class S2CPacketSpawnGlobalEntity implements Packet<IClientPlayer>
{ {
private int entityId; private int entityId;
private int x; private int x;
@ -60,7 +60,7 @@ public class S2CPacketSpawnGlobalEntity implements Packet<ClientPlayer>
/** /**
* Passes this Packet on to the NetHandler for processing. * Passes this Packet on to the NetHandler for processing.
*/ */
public void processPacket(ClientPlayer handler) public void processPacket(IClientPlayer handler)
{ {
handler.handleSpawnGlobalEntity(this); handler.handleSpawnGlobalEntity(this);
} }

View file

@ -2,12 +2,12 @@ package game.packet;
import java.io.IOException; import java.io.IOException;
import game.network.ClientPlayer; import game.network.IClientPlayer;
import game.network.Packet; import game.network.Packet;
import game.network.PacketBuffer; import game.network.PacketBuffer;
import game.world.BlockPos; import game.world.BlockPos;
public class S2DPacketOpenWindow implements Packet<ClientPlayer> public class S2DPacketOpenWindow implements Packet<IClientPlayer>
{ {
private int windowId; private int windowId;
private String inventoryType; private String inventoryType;
@ -48,7 +48,7 @@ public class S2DPacketOpenWindow implements Packet<ClientPlayer>
/** /**
* Passes this Packet on to the NetHandler for processing. * Passes this Packet on to the NetHandler for processing.
*/ */
public void processPacket(ClientPlayer handler) public void processPacket(IClientPlayer handler)
{ {
handler.handleOpenWindow(this); handler.handleOpenWindow(this);
} }

View file

@ -2,11 +2,11 @@ package game.packet;
import java.io.IOException; import java.io.IOException;
import game.network.ClientPlayer; import game.network.IClientPlayer;
import game.network.Packet; import game.network.Packet;
import game.network.PacketBuffer; import game.network.PacketBuffer;
public class S2EPacketCloseWindow implements Packet<ClientPlayer> public class S2EPacketCloseWindow implements Packet<IClientPlayer>
{ {
private int windowId; private int windowId;
@ -22,7 +22,7 @@ public class S2EPacketCloseWindow implements Packet<ClientPlayer>
/** /**
* Passes this Packet on to the NetHandler for processing. * Passes this Packet on to the NetHandler for processing.
*/ */
public void processPacket(ClientPlayer handler) public void processPacket(IClientPlayer handler)
{ {
handler.handleCloseWindow(this); handler.handleCloseWindow(this);
} }

View file

@ -3,11 +3,11 @@ package game.packet;
import java.io.IOException; import java.io.IOException;
import game.item.ItemStack; import game.item.ItemStack;
import game.network.ClientPlayer; import game.network.IClientPlayer;
import game.network.Packet; import game.network.Packet;
import game.network.PacketBuffer; import game.network.PacketBuffer;
public class S2FPacketSetSlot implements Packet<ClientPlayer> public class S2FPacketSetSlot implements Packet<IClientPlayer>
{ {
private int windowId; private int windowId;
private int slot; private int slot;
@ -27,7 +27,7 @@ public class S2FPacketSetSlot implements Packet<ClientPlayer>
/** /**
* Passes this Packet on to the NetHandler for processing. * Passes this Packet on to the NetHandler for processing.
*/ */
public void processPacket(ClientPlayer handler) public void processPacket(IClientPlayer handler)
{ {
handler.handleSetSlot(this); handler.handleSetSlot(this);
} }

View file

@ -4,11 +4,11 @@ import java.io.IOException;
import java.util.List; import java.util.List;
import game.item.ItemStack; import game.item.ItemStack;
import game.network.ClientPlayer; import game.network.IClientPlayer;
import game.network.Packet; import game.network.Packet;
import game.network.PacketBuffer; import game.network.PacketBuffer;
public class S30PacketWindowItems implements Packet<ClientPlayer> public class S30PacketWindowItems implements Packet<IClientPlayer>
{ {
private int windowId; private int windowId;
private ItemStack[] itemStacks; private ItemStack[] itemStacks;
@ -61,7 +61,7 @@ public class S30PacketWindowItems implements Packet<ClientPlayer>
/** /**
* Passes this Packet on to the NetHandler for processing. * Passes this Packet on to the NetHandler for processing.
*/ */
public void processPacket(ClientPlayer handler) public void processPacket(IClientPlayer handler)
{ {
handler.handleWindowItems(this); handler.handleWindowItems(this);
} }

View file

@ -2,11 +2,11 @@ package game.packet;
import java.io.IOException; import java.io.IOException;
import game.network.ClientPlayer; import game.network.IClientPlayer;
import game.network.Packet; import game.network.Packet;
import game.network.PacketBuffer; import game.network.PacketBuffer;
public class S31PacketWindowProperty implements Packet<ClientPlayer> public class S31PacketWindowProperty implements Packet<IClientPlayer>
{ {
private int windowId; private int windowId;
private int varIndex; private int varIndex;
@ -26,7 +26,7 @@ public class S31PacketWindowProperty implements Packet<ClientPlayer>
/** /**
* Passes this Packet on to the NetHandler for processing. * Passes this Packet on to the NetHandler for processing.
*/ */
public void processPacket(ClientPlayer handler) public void processPacket(IClientPlayer handler)
{ {
handler.handleWindowProperty(this); handler.handleWindowProperty(this);
} }

View file

@ -2,11 +2,11 @@ package game.packet;
import java.io.IOException; import java.io.IOException;
import game.network.ClientPlayer; import game.network.IClientPlayer;
import game.network.Packet; import game.network.Packet;
import game.network.PacketBuffer; import game.network.PacketBuffer;
public class S32PacketConfirmTransaction implements Packet<ClientPlayer> public class S32PacketConfirmTransaction implements Packet<IClientPlayer>
{ {
private int windowId; private int windowId;
private short actionNumber; private short actionNumber;
@ -26,7 +26,7 @@ public class S32PacketConfirmTransaction implements Packet<ClientPlayer>
/** /**
* Passes this Packet on to the NetHandler for processing. * Passes this Packet on to the NetHandler for processing.
*/ */
public void processPacket(ClientPlayer handler) public void processPacket(IClientPlayer handler)
{ {
handler.handleConfirmTransaction(this); handler.handleConfirmTransaction(this);
} }

View file

@ -2,13 +2,13 @@ package game.packet;
import java.io.IOException; import java.io.IOException;
import game.network.ClientPlayer; import game.network.IClientPlayer;
import game.network.Packet; import game.network.Packet;
import game.network.PacketBuffer; import game.network.PacketBuffer;
import game.world.BlockPos; import game.world.BlockPos;
import game.world.World; import game.world.World;
public class S33PacketUpdateSign implements Packet<ClientPlayer> public class S33PacketUpdateSign implements Packet<IClientPlayer>
{ {
private World world; private World world;
private BlockPos blockPos; private BlockPos blockPos;
@ -62,7 +62,7 @@ public class S33PacketUpdateSign implements Packet<ClientPlayer>
/** /**
* Passes this Packet on to the NetHandler for processing. * Passes this Packet on to the NetHandler for processing.
*/ */
public void processPacket(ClientPlayer handler) public void processPacket(IClientPlayer handler)
{ {
handler.handleUpdateSign(this); handler.handleUpdateSign(this);
} }

View file

@ -4,13 +4,13 @@ import java.io.IOException;
import game.init.TileRegistry; import game.init.TileRegistry;
import game.nbt.NBTTagCompound; import game.nbt.NBTTagCompound;
import game.network.ClientPlayer; import game.network.IClientPlayer;
import game.network.Packet; import game.network.Packet;
import game.network.PacketBuffer; import game.network.PacketBuffer;
import game.tileentity.TileEntity; import game.tileentity.TileEntity;
import game.world.BlockPos; import game.world.BlockPos;
public class S35PacketUpdateTileEntity implements Packet<ClientPlayer> public class S35PacketUpdateTileEntity implements Packet<IClientPlayer>
{ {
private BlockPos blockPos; private BlockPos blockPos;
private int type; private int type;
@ -50,7 +50,7 @@ public class S35PacketUpdateTileEntity implements Packet<ClientPlayer>
/** /**
* Passes this Packet on to the NetHandler for processing. * Passes this Packet on to the NetHandler for processing.
*/ */
public void processPacket(ClientPlayer handler) public void processPacket(IClientPlayer handler)
{ {
handler.handleUpdateTileEntity(this); handler.handleUpdateTileEntity(this);
} }

View file

@ -2,12 +2,12 @@ package game.packet;
import java.io.IOException; import java.io.IOException;
import game.network.ClientPlayer; import game.network.IClientPlayer;
import game.network.Packet; import game.network.Packet;
import game.network.PacketBuffer; import game.network.PacketBuffer;
import game.world.BlockPos; import game.world.BlockPos;
public class S36PacketSignEditorOpen implements Packet<ClientPlayer> public class S36PacketSignEditorOpen implements Packet<IClientPlayer>
{ {
private BlockPos signPosition; private BlockPos signPosition;
@ -23,7 +23,7 @@ public class S36PacketSignEditorOpen implements Packet<ClientPlayer>
/** /**
* Passes this Packet on to the NetHandler for processing. * Passes this Packet on to the NetHandler for processing.
*/ */
public void processPacket(ClientPlayer handler) public void processPacket(IClientPlayer handler)
{ {
handler.handleSignEditorOpen(this); handler.handleSignEditorOpen(this);
} }

View file

@ -6,26 +6,26 @@ import java.util.Map;
import java.util.Map.Entry; import java.util.Map.Entry;
import game.collect.Maps; import game.collect.Maps;
import game.network.ClientPlayer; import game.network.IClientPlayer;
import game.network.Packet; import game.network.Packet;
import game.network.PacketBuffer; import game.network.PacketBuffer;
import game.network.Player; import game.network.IPlayer;
public class S38PacketPlayerListItem implements Packet<ClientPlayer> { public class S38PacketPlayerListItem implements Packet<IClientPlayer> {
private final Map<String, Integer> players = Maps.newHashMap(); private final Map<String, Integer> players = Maps.newHashMap();
public S38PacketPlayerListItem() { public S38PacketPlayerListItem() {
} }
public S38PacketPlayerListItem(boolean remove, Player... conns) { public S38PacketPlayerListItem(boolean remove, IPlayer... conns) {
for(Player conn : conns) { for(IPlayer conn : conns) {
this.players.put(conn.getUser(), remove ? -1 : conn.getLatency()); this.players.put(conn.getUser(), remove ? -1 : conn.getLatency());
} }
} }
public S38PacketPlayerListItem(Iterable<Player> conns) { public S38PacketPlayerListItem(Iterable<IPlayer> conns) {
for(Player conn : conns) { for(IPlayer conn : conns) {
this.players.put(conn.getUser(), conn.getLatency()); this.players.put(((IPlayer)conn).getUser(), ((IPlayer)conn).getLatency());
} }
} }
@ -44,7 +44,7 @@ public class S38PacketPlayerListItem implements Packet<ClientPlayer> {
} }
} }
public void processPacket(ClientPlayer handler) { public void processPacket(IClientPlayer handler) {
handler.handlePlayerListItem(this); handler.handlePlayerListItem(this);
} }

View file

@ -3,11 +3,11 @@ package game.packet;
import java.io.IOException; import java.io.IOException;
import game.entity.npc.EntityNPC; import game.entity.npc.EntityNPC;
import game.network.ClientPlayer; import game.network.IClientPlayer;
import game.network.Packet; import game.network.Packet;
import game.network.PacketBuffer; import game.network.PacketBuffer;
public class S39PacketPlayerAbilities implements Packet<ClientPlayer> { public class S39PacketPlayerAbilities implements Packet<IClientPlayer> {
private boolean flying; private boolean flying;
private boolean noClip; private boolean noClip;
@ -39,7 +39,7 @@ public class S39PacketPlayerAbilities implements Packet<ClientPlayer> {
buf.writeByte(bt); buf.writeByte(bt);
} }
public void processPacket(ClientPlayer handler) { public void processPacket(IClientPlayer handler) {
handler.handlePlayerAbilities(this); handler.handlePlayerAbilities(this);
} }

View file

@ -2,11 +2,11 @@ package game.packet;
import java.io.IOException; import java.io.IOException;
import game.network.ClientPlayer; import game.network.IClientPlayer;
import game.network.Packet; import game.network.Packet;
import game.network.PacketBuffer; import game.network.PacketBuffer;
public class S3APacketTabComplete implements Packet<ClientPlayer> public class S3APacketTabComplete implements Packet<IClientPlayer>
{ {
private String[] matches; private String[] matches;
@ -48,7 +48,7 @@ public class S3APacketTabComplete implements Packet<ClientPlayer>
/** /**
* Passes this Packet on to the NetHandler for processing. * Passes this Packet on to the NetHandler for processing.
*/ */
public void processPacket(ClientPlayer handler) public void processPacket(IClientPlayer handler)
{ {
handler.handleTabComplete(this); handler.handleTabComplete(this);
} }

View file

@ -4,12 +4,12 @@ import java.io.IOException;
import game.entity.Entity; import game.entity.Entity;
import game.nbt.NBTTagCompound; import game.nbt.NBTTagCompound;
import game.network.ClientPlayer; import game.network.IClientPlayer;
import game.network.Packet; import game.network.Packet;
import game.network.PacketBuffer; import game.network.PacketBuffer;
import game.world.World; import game.world.World;
public class S43PacketUpdateEntityNBT implements Packet<ClientPlayer> public class S43PacketUpdateEntityNBT implements Packet<IClientPlayer>
{ {
private int entityId; private int entityId;
private NBTTagCompound tagCompound; private NBTTagCompound tagCompound;
@ -45,7 +45,7 @@ public class S43PacketUpdateEntityNBT implements Packet<ClientPlayer>
/** /**
* Passes this Packet on to the NetHandler for processing. * Passes this Packet on to the NetHandler for processing.
*/ */
public void processPacket(ClientPlayer handler) public void processPacket(IClientPlayer handler)
{ {
handler.handleEntityNBT(this); handler.handleEntityNBT(this);
} }

View file

@ -3,11 +3,11 @@ package game.packet;
import java.io.IOException; import java.io.IOException;
import game.entity.Entity; import game.entity.Entity;
import game.network.ClientPlayer; import game.network.IClientPlayer;
import game.network.Packet; import game.network.Packet;
import game.network.PacketBuffer; import game.network.PacketBuffer;
public class SPacketAnimation implements Packet<ClientPlayer> public class SPacketAnimation implements Packet<IClientPlayer>
{ {
private int entityId; private int entityId;
private int type; private int type;
@ -45,7 +45,7 @@ public class SPacketAnimation implements Packet<ClientPlayer>
// buf.writeVarIntToBuffer(this.par); // buf.writeVarIntToBuffer(this.par);
} }
public void processPacket(ClientPlayer handler) public void processPacket(IClientPlayer handler)
{ {
handler.handleAnimation(this); handler.handleAnimation(this);
} }

View file

@ -2,11 +2,11 @@ package game.packet;
import java.io.IOException; import java.io.IOException;
import game.network.ClientPlayer; import game.network.IClientPlayer;
import game.network.Packet; import game.network.Packet;
import game.network.PacketBuffer; import game.network.PacketBuffer;
public class SPacketBiomes implements Packet<ClientPlayer> { public class SPacketBiomes implements Packet<IClientPlayer> {
private int chunkX; private int chunkX;
private int chunkZ; private int chunkZ;
private byte[] biomes; private byte[] biomes;
@ -32,7 +32,7 @@ public class SPacketBiomes implements Packet<ClientPlayer> {
buf.writeBytes(this.biomes); buf.writeBytes(this.biomes);
} }
public void processPacket(ClientPlayer handler) { public void processPacket(IClientPlayer handler) {
handler.handleBiomes(this); handler.handleBiomes(this);
} }

View file

@ -4,12 +4,12 @@ import java.io.IOException;
import game.block.Block; import game.block.Block;
import game.init.BlockRegistry; import game.init.BlockRegistry;
import game.network.ClientPlayer; import game.network.IClientPlayer;
import game.network.Packet; import game.network.Packet;
import game.network.PacketBuffer; import game.network.PacketBuffer;
import game.world.BlockPos; import game.world.BlockPos;
public class SPacketBlockAction implements Packet<ClientPlayer> public class SPacketBlockAction implements Packet<IClientPlayer>
{ {
private BlockPos blockPosition; private BlockPos blockPosition;
private int instrument; private int instrument;
@ -53,7 +53,7 @@ public class SPacketBlockAction implements Packet<ClientPlayer>
/** /**
* Passes this Packet on to the NetHandler for processing. * Passes this Packet on to the NetHandler for processing.
*/ */
public void processPacket(ClientPlayer handler) public void processPacket(IClientPlayer handler)
{ {
handler.handleBlockAction(this); handler.handleBlockAction(this);
} }

View file

@ -2,12 +2,12 @@ package game.packet;
import java.io.IOException; import java.io.IOException;
import game.network.ClientPlayer; import game.network.IClientPlayer;
import game.network.Packet; import game.network.Packet;
import game.network.PacketBuffer; import game.network.PacketBuffer;
import game.world.BlockPos; import game.world.BlockPos;
public class SPacketBlockBreakAnim implements Packet<ClientPlayer> public class SPacketBlockBreakAnim implements Packet<IClientPlayer>
{ {
private int breakerId; private int breakerId;
private BlockPos position; private BlockPos position;
@ -47,7 +47,7 @@ public class SPacketBlockBreakAnim implements Packet<ClientPlayer>
/** /**
* Passes this Packet on to the NetHandler for processing. * Passes this Packet on to the NetHandler for processing.
*/ */
public void processPacket(ClientPlayer handler) public void processPacket(IClientPlayer handler)
{ {
handler.handleBlockBreakAnim(this); handler.handleBlockBreakAnim(this);
} }

View file

@ -3,14 +3,14 @@ package game.packet;
import java.io.IOException; import java.io.IOException;
import game.init.BlockRegistry; import game.init.BlockRegistry;
import game.network.ClientPlayer; import game.network.IClientPlayer;
import game.network.Packet; import game.network.Packet;
import game.network.PacketBuffer; import game.network.PacketBuffer;
import game.world.BlockPos; import game.world.BlockPos;
import game.world.State; import game.world.State;
import game.world.World; import game.world.World;
public class SPacketBlockChange implements Packet<ClientPlayer> public class SPacketBlockChange implements Packet<IClientPlayer>
{ {
private BlockPos blockPosition; private BlockPos blockPosition;
private State blockState; private State blockState;
@ -46,7 +46,7 @@ public class SPacketBlockChange implements Packet<ClientPlayer>
/** /**
* Passes this Packet on to the NetHandler for processing. * Passes this Packet on to the NetHandler for processing.
*/ */
public void processPacket(ClientPlayer handler) public void processPacket(IClientPlayer handler)
{ {
handler.handleBlockChange(this); handler.handleBlockChange(this);
} }

View file

@ -3,12 +3,12 @@ package game.packet;
import java.io.IOException; import java.io.IOException;
import game.entity.Entity; import game.entity.Entity;
import game.network.ClientPlayer; import game.network.IClientPlayer;
import game.network.Packet; import game.network.Packet;
import game.network.PacketBuffer; import game.network.PacketBuffer;
import game.world.World; import game.world.World;
public class SPacketCamera implements Packet<ClientPlayer> public class SPacketCamera implements Packet<IClientPlayer>
{ {
public int entityId; public int entityId;
@ -31,7 +31,7 @@ public class SPacketCamera implements Packet<ClientPlayer>
buf.writeVarIntToBuffer(this.entityId); buf.writeVarIntToBuffer(this.entityId);
} }
public void processPacket(ClientPlayer handler) public void processPacket(IClientPlayer handler)
{ {
handler.handleCamera(this); handler.handleCamera(this);
} }

View file

@ -8,13 +8,13 @@ import java.util.Map.Entry;
import game.collect.Maps; import game.collect.Maps;
import game.entity.npc.Alignment; import game.entity.npc.Alignment;
import game.entity.npc.PlayerCharacter; import game.entity.npc.PlayerCharacter;
import game.network.ClientPlayer; import game.network.IClientPlayer;
import game.network.IPlayer;
import game.network.Packet; import game.network.Packet;
import game.network.PacketBuffer; import game.network.PacketBuffer;
import game.network.Player;
import game.world.BlockPos; import game.world.BlockPos;
public class SPacketCharacterList implements Packet<ClientPlayer> { public class SPacketCharacterList implements Packet<IClientPlayer> {
private final Map<Integer, PlayerCharacter> players = Maps.newHashMap(); private final Map<Integer, PlayerCharacter> players = Maps.newHashMap();
private int selected; private int selected;
@ -43,12 +43,12 @@ public class SPacketCharacterList implements Packet<ClientPlayer> {
int n = buf.readVarIntFromBuffer(); int n = buf.readVarIntFromBuffer();
for(int z = 0; z < n; z++) { for(int z = 0; z < n; z++) {
int id = buf.readVarIntFromBuffer(); int id = buf.readVarIntFromBuffer();
String name = buf.readStringFromBuffer(Player.MAX_NICK_LENGTH); String name = buf.readStringFromBuffer(IPlayer.MAX_NICK_LENGTH);
if(name.isEmpty()) { if(name.isEmpty()) {
this.players.put(id, null); this.players.put(id, null);
continue; continue;
} }
String info = buf.readStringFromBuffer(Player.MAX_INFO_LENGTH); String info = buf.readStringFromBuffer(IPlayer.MAX_INFO_LENGTH);
info = info.isEmpty() ? null : info; info = info.isEmpty() ? null : info;
Alignment align = buf.readEnumValue(Alignment.class); Alignment align = buf.readEnumValue(Alignment.class);
String dim = buf.readStringFromBuffer(256); String dim = buf.readStringFromBuffer(256);
@ -80,7 +80,7 @@ public class SPacketCharacterList implements Packet<ClientPlayer> {
buf.writeVarIntToBuffer(this.selected); buf.writeVarIntToBuffer(this.selected);
} }
public void processPacket(ClientPlayer handler) { public void processPacket(IClientPlayer handler) {
handler.handleCharacterList(this); handler.handleCharacterList(this);
} }

View file

@ -4,13 +4,13 @@ import java.io.IOException;
import java.util.List; import java.util.List;
import game.collect.Lists; import game.collect.Lists;
import game.network.ClientPlayer; import game.network.IClientPlayer;
import game.network.Packet; import game.network.Packet;
import game.network.PacketBuffer; import game.network.PacketBuffer;
import game.world.BlockArray; import game.world.BlockArray;
import game.world.Chunk; import game.world.Chunk;
public class SPacketChunkData implements Packet<ClientPlayer> public class SPacketChunkData implements Packet<IClientPlayer>
{ {
private int chunkX; private int chunkX;
private int chunkZ; private int chunkZ;
@ -57,7 +57,7 @@ public class SPacketChunkData implements Packet<ClientPlayer>
/** /**
* Passes this Packet on to the NetHandler for processing. * Passes this Packet on to the NetHandler for processing.
*/ */
public void processPacket(ClientPlayer handler) public void processPacket(IClientPlayer handler)
{ {
handler.handleChunkData(this); handler.handleChunkData(this);
} }

View file

@ -2,11 +2,11 @@ package game.packet;
import java.io.IOException; import java.io.IOException;
import game.network.ClientPlayer; import game.network.IClientPlayer;
import game.network.Packet; import game.network.Packet;
import game.network.PacketBuffer; import game.network.PacketBuffer;
public class SPacketCollectItem implements Packet<ClientPlayer> public class SPacketCollectItem implements Packet<IClientPlayer>
{ {
private int collectedItemEntityId; private int collectedItemEntityId;
private int entityId; private int entityId;
@ -42,7 +42,7 @@ public class SPacketCollectItem implements Packet<ClientPlayer>
/** /**
* Passes this Packet on to the NetHandler for processing. * Passes this Packet on to the NetHandler for processing.
*/ */
public void processPacket(ClientPlayer handler) public void processPacket(IClientPlayer handler)
{ {
handler.handleCollectItem(this); handler.handleCollectItem(this);
} }

View file

@ -2,11 +2,11 @@ package game.packet;
import java.io.IOException; import java.io.IOException;
import game.network.ClientPlayer; import game.network.IClientPlayer;
import game.network.Packet; import game.network.Packet;
import game.network.PacketBuffer; import game.network.PacketBuffer;
public class SPacketDestroyEntities implements Packet<ClientPlayer> public class SPacketDestroyEntities implements Packet<IClientPlayer>
{ {
private int[] entityIDs; private int[] entityIDs;
@ -48,7 +48,7 @@ public class SPacketDestroyEntities implements Packet<ClientPlayer>
/** /**
* Passes this Packet on to the NetHandler for processing. * Passes this Packet on to the NetHandler for processing.
*/ */
public void processPacket(ClientPlayer handler) public void processPacket(IClientPlayer handler)
{ {
handler.handleDestroyEntities(this); handler.handleDestroyEntities(this);
} }

View file

@ -3,11 +3,11 @@ package game.packet;
import java.io.IOException; import java.io.IOException;
import game.dimension.Dimension; import game.dimension.Dimension;
import game.network.ClientPlayer; import game.network.IClientPlayer;
import game.network.Packet; import game.network.Packet;
import game.network.PacketBuffer; import game.network.PacketBuffer;
public class SPacketDimensionName implements Packet<ClientPlayer> { public class SPacketDimensionName implements Packet<IClientPlayer> {
private String fullName; private String fullName;
private String customName; private String customName;
@ -20,7 +20,7 @@ public class SPacketDimensionName implements Packet<ClientPlayer> {
dim.getCustomName(); dim.getCustomName();
} }
public void processPacket(ClientPlayer handler) { public void processPacket(IClientPlayer handler) {
handler.handleDimName(this); handler.handleDimName(this);
} }

View file

@ -2,11 +2,11 @@ package game.packet;
import java.io.IOException; import java.io.IOException;
import game.network.ClientPlayer; import game.network.IClientPlayer;
import game.network.Packet; import game.network.Packet;
import game.network.PacketBuffer; import game.network.PacketBuffer;
public class SPacketDisconnect implements Packet<ClientPlayer> public class SPacketDisconnect implements Packet<IClientPlayer>
{ {
public SPacketDisconnect() public SPacketDisconnect()
{ {
@ -20,7 +20,7 @@ public class SPacketDisconnect implements Packet<ClientPlayer>
{ {
} }
public void processPacket(ClientPlayer handler) public void processPacket(IClientPlayer handler)
{ {
handler.handleDisconnect(this); handler.handleDisconnect(this);
} }

View file

@ -3,11 +3,11 @@ package game.packet;
import java.io.IOException; import java.io.IOException;
import game.item.ItemStack; import game.item.ItemStack;
import game.network.ClientPlayer; import game.network.IClientPlayer;
import game.network.Packet; import game.network.Packet;
import game.network.PacketBuffer; import game.network.PacketBuffer;
public class SPacketEntityEquipment implements Packet<ClientPlayer> public class SPacketEntityEquipment implements Packet<IClientPlayer>
{ {
private int entityID; private int entityID;
private int equipmentSlot; private int equipmentSlot;
@ -47,7 +47,7 @@ public class SPacketEntityEquipment implements Packet<ClientPlayer>
/** /**
* Passes this Packet on to the NetHandler for processing. * Passes this Packet on to the NetHandler for processing.
*/ */
public void processPacket(ClientPlayer handler) public void processPacket(IClientPlayer handler)
{ {
handler.handleEntityEquipment(this); handler.handleEntityEquipment(this);
} }

View file

@ -3,11 +3,11 @@ package game.packet;
import java.io.IOException; import java.io.IOException;
import game.entity.Entity; import game.entity.Entity;
import game.network.ClientPlayer; import game.network.IClientPlayer;
import game.network.Packet; import game.network.Packet;
import game.network.PacketBuffer; import game.network.PacketBuffer;
public class SPacketEntityVelocity implements Packet<ClientPlayer> public class SPacketEntityVelocity implements Packet<IClientPlayer>
{ {
private int entityID; private int entityID;
private int motionX; private int motionX;
@ -88,7 +88,7 @@ public class SPacketEntityVelocity implements Packet<ClientPlayer>
/** /**
* Passes this Packet on to the NetHandler for processing. * Passes this Packet on to the NetHandler for processing.
*/ */
public void processPacket(ClientPlayer handler) public void processPacket(IClientPlayer handler)
{ {
handler.handleEntityVelocity(this); handler.handleEntityVelocity(this);
} }

View file

@ -2,11 +2,11 @@ package game.packet;
import java.io.IOException; import java.io.IOException;
import game.network.ClientPlayer; import game.network.IClientPlayer;
import game.network.Packet; import game.network.Packet;
import game.network.PacketBuffer; import game.network.PacketBuffer;
public class SPacketHeldItemChange implements Packet<ClientPlayer> public class SPacketHeldItemChange implements Packet<IClientPlayer>
{ {
private int heldItemHotbarIndex; private int heldItemHotbarIndex;
@ -38,7 +38,7 @@ public class SPacketHeldItemChange implements Packet<ClientPlayer>
/** /**
* Passes this Packet on to the NetHandler for processing. * Passes this Packet on to the NetHandler for processing.
*/ */
public void processPacket(ClientPlayer handler) public void processPacket(IClientPlayer handler)
{ {
handler.handleHeldItemChange(this); handler.handleHeldItemChange(this);
} }

View file

@ -4,11 +4,11 @@ import java.io.IOException;
import game.dimension.Dimension; import game.dimension.Dimension;
import game.nbt.NBTTagCompound; import game.nbt.NBTTagCompound;
import game.network.ClientPlayer; import game.network.IClientPlayer;
import game.network.Packet; import game.network.Packet;
import game.network.PacketBuffer; import game.network.PacketBuffer;
public class SPacketJoinGame implements Packet<ClientPlayer> { public class SPacketJoinGame implements Packet<IClientPlayer> {
private int entityId; private int entityId;
private NBTTagCompound dimension; private NBTTagCompound dimension;
private int type; private int type;
@ -38,7 +38,7 @@ public class SPacketJoinGame implements Packet<ClientPlayer> {
buf.writeBoolean(this.editor); buf.writeBoolean(this.editor);
} }
public void processPacket(ClientPlayer handler) { public void processPacket(IClientPlayer handler) {
handler.handleJoinGame(this); handler.handleJoinGame(this);
} }

View file

@ -1,8 +1,8 @@
package game.packet; package game.packet;
import game.network.ClientPlayer; import game.network.IClientPlayer;
public class SPacketKeepAlive extends APacketVarInt<ClientPlayer> public class SPacketKeepAlive extends APacketVarInt<IClientPlayer>
{ {
public SPacketKeepAlive() public SPacketKeepAlive()
{ {
@ -13,7 +13,7 @@ public class SPacketKeepAlive extends APacketVarInt<ClientPlayer>
super(key); super(key);
} }
public void processPacket(ClientPlayer handler) public void processPacket(IClientPlayer handler)
{ {
handler.handleKeepAlive(this); handler.handleKeepAlive(this);
} }

View file

@ -2,11 +2,11 @@ package game.packet;
import java.io.IOException; import java.io.IOException;
import game.network.ClientPlayer; import game.network.IClientPlayer;
import game.network.Packet; import game.network.Packet;
import game.network.PacketBuffer; import game.network.PacketBuffer;
public class SPacketLoading implements Packet<ClientPlayer> { public class SPacketLoading implements Packet<IClientPlayer> {
private String message; private String message;
private String task; private String task;
private int total = -1; private int total = -1;
@ -48,7 +48,7 @@ public class SPacketLoading implements Packet<ClientPlayer> {
} }
} }
public void processPacket(ClientPlayer handler) { public void processPacket(IClientPlayer handler) {
handler.handleLoading(this); handler.handleLoading(this);
} }

View file

@ -3,12 +3,12 @@ package game.packet;
import java.io.IOException; import java.io.IOException;
import java.util.List; import java.util.List;
import game.network.ClientPlayer; import game.network.IClientPlayer;
import game.network.Packet; import game.network.Packet;
import game.network.PacketBuffer; import game.network.PacketBuffer;
import game.world.Chunk; import game.world.Chunk;
public class SPacketMapChunkBulk implements Packet<ClientPlayer> public class SPacketMapChunkBulk implements Packet<IClientPlayer>
{ {
private int[] xPositions; private int[] xPositions;
private int[] zPositions; private int[] zPositions;
@ -87,7 +87,7 @@ public class SPacketMapChunkBulk implements Packet<ClientPlayer>
/** /**
* Passes this Packet on to the NetHandler for processing. * Passes this Packet on to the NetHandler for processing.
*/ */
public void processPacket(ClientPlayer handler) public void processPacket(IClientPlayer handler)
{ {
handler.handleMapChunkBulk(this); handler.handleMapChunkBulk(this);
} }

View file

@ -2,11 +2,11 @@ package game.packet;
import java.io.IOException; import java.io.IOException;
import game.network.ClientPlayer; import game.network.IClientPlayer;
import game.network.Packet; import game.network.Packet;
import game.network.PacketBuffer; import game.network.PacketBuffer;
public class SPacketMessage implements Packet<ClientPlayer> { public class SPacketMessage implements Packet<IClientPlayer> {
public static enum Type { public static enum Type {
CONSOLE, CHAT, FEED, HOTBAR; CONSOLE, CHAT, FEED, HOTBAR;
} }
@ -32,7 +32,7 @@ public class SPacketMessage implements Packet<ClientPlayer> {
buf.writeEnumValue(this.type); buf.writeEnumValue(this.type);
} }
public void processPacket(ClientPlayer handler) { public void processPacket(IClientPlayer handler) {
handler.handleMessage(this); handler.handleMessage(this);
} }

View file

@ -3,7 +3,7 @@ package game.packet;
import java.io.IOException; import java.io.IOException;
import game.init.BlockRegistry; import game.init.BlockRegistry;
import game.network.ClientPlayer; import game.network.IClientPlayer;
import game.network.Packet; import game.network.Packet;
import game.network.PacketBuffer; import game.network.PacketBuffer;
import game.world.BlockPos; import game.world.BlockPos;
@ -11,7 +11,7 @@ import game.world.Chunk;
import game.world.ChunkPos; import game.world.ChunkPos;
import game.world.State; import game.world.State;
public class SPacketMultiBlockChange implements Packet<ClientPlayer> public class SPacketMultiBlockChange implements Packet<IClientPlayer>
{ {
private ChunkPos chunkPosCoord; private ChunkPos chunkPosCoord;
private SPacketMultiBlockChange.BlockUpdateData[] changedBlocks; private SPacketMultiBlockChange.BlockUpdateData[] changedBlocks;
@ -64,7 +64,7 @@ public class SPacketMultiBlockChange implements Packet<ClientPlayer>
/** /**
* Passes this Packet on to the NetHandler for processing. * Passes this Packet on to the NetHandler for processing.
*/ */
public void processPacket(ClientPlayer handler) public void processPacket(IClientPlayer handler)
{ {
handler.handleMultiBlockChange(this); handler.handleMultiBlockChange(this);
} }

View file

@ -4,11 +4,11 @@ import java.io.IOException;
import java.util.EnumSet; import java.util.EnumSet;
import java.util.Set; import java.util.Set;
import game.network.ClientPlayer; import game.network.IClientPlayer;
import game.network.Packet; import game.network.Packet;
import game.network.PacketBuffer; import game.network.PacketBuffer;
public class SPacketPlayerPosLook implements Packet<ClientPlayer> public class SPacketPlayerPosLook implements Packet<IClientPlayer>
{ {
private double x; private double x;
private double y; private double y;
@ -60,7 +60,7 @@ public class SPacketPlayerPosLook implements Packet<ClientPlayer>
/** /**
* Passes this Packet on to the NetHandler for processing. * Passes this Packet on to the NetHandler for processing.
*/ */
public void processPacket(ClientPlayer handler) public void processPacket(IClientPlayer handler)
{ {
handler.handlePlayerPosLook(this); handler.handlePlayerPosLook(this);
} }

View file

@ -4,11 +4,11 @@ import java.io.IOException;
import game.dimension.Dimension; import game.dimension.Dimension;
import game.nbt.NBTTagCompound; import game.nbt.NBTTagCompound;
import game.network.ClientPlayer; import game.network.IClientPlayer;
import game.network.Packet; import game.network.Packet;
import game.network.PacketBuffer; import game.network.PacketBuffer;
public class SPacketRespawn implements Packet<ClientPlayer> public class SPacketRespawn implements Packet<IClientPlayer>
{ {
private NBTTagCompound dimension; private NBTTagCompound dimension;
private int type; private int type;
@ -25,7 +25,7 @@ public class SPacketRespawn implements Packet<ClientPlayer>
this.editor = editor; this.editor = editor;
} }
public void processPacket(ClientPlayer handler) public void processPacket(IClientPlayer handler)
{ {
handler.handleRespawn(this); handler.handleRespawn(this);
} }

View file

@ -2,11 +2,11 @@ package game.packet;
import java.io.IOException; import java.io.IOException;
import game.network.ClientPlayer; import game.network.IClientPlayer;
import game.network.Packet; import game.network.Packet;
import game.network.PacketBuffer; import game.network.PacketBuffer;
public class SPacketServerTick implements Packet<ClientPlayer> { public class SPacketServerTick implements Packet<IClientPlayer> {
private int time; private int time;
public SPacketServerTick() { public SPacketServerTick() {
@ -24,7 +24,7 @@ public class SPacketServerTick implements Packet<ClientPlayer> {
buf.writeInt(this.time); buf.writeInt(this.time);
} }
public void processPacket(ClientPlayer handler) { public void processPacket(IClientPlayer handler) {
handler.handleServerTick(this); handler.handleServerTick(this);
} }

View file

@ -2,11 +2,11 @@ package game.packet;
import java.io.IOException; import java.io.IOException;
import game.network.ClientPlayer; import game.network.IClientPlayer;
import game.network.Packet; import game.network.Packet;
import game.network.PacketBuffer; import game.network.PacketBuffer;
public class SPacketSetExperience implements Packet<ClientPlayer> public class SPacketSetExperience implements Packet<IClientPlayer>
{ {
private float progress; private float progress;
private int totalExperience; private int totalExperience;
@ -46,7 +46,7 @@ public class SPacketSetExperience implements Packet<ClientPlayer>
/** /**
* Passes this Packet on to the NetHandler for processing. * Passes this Packet on to the NetHandler for processing.
*/ */
public void processPacket(ClientPlayer handler) public void processPacket(IClientPlayer handler)
{ {
handler.handleSetExperience(this); handler.handleSetExperience(this);
} }

View file

@ -4,12 +4,12 @@ import java.io.IOException;
import client.renderer.texture.EntityTexManager; import client.renderer.texture.EntityTexManager;
import game.entity.Entity; import game.entity.Entity;
import game.network.ClientPlayer; import game.network.IClientPlayer;
import game.network.Packet; import game.network.Packet;
import game.network.PacketBuffer; import game.network.PacketBuffer;
import game.world.World; import game.world.World;
public class SPacketSkin implements Packet<ClientPlayer> public class SPacketSkin implements Packet<IClientPlayer>
{ {
private int id; private int id;
// private ModelType model; // private ModelType model;
@ -58,7 +58,7 @@ public class SPacketSkin implements Packet<ClientPlayer>
buf.writeByteArray(this.texture == null ? new byte[0] : this.texture); buf.writeByteArray(this.texture == null ? new byte[0] : this.texture);
} }
public void processPacket(ClientPlayer handler) public void processPacket(IClientPlayer handler)
{ {
handler.handleSkin(this); handler.handleSkin(this);
} }

View file

@ -6,12 +6,12 @@ import java.util.List;
import game.entity.DataWatcher; import game.entity.DataWatcher;
import game.entity.types.EntityLiving; import game.entity.types.EntityLiving;
import game.init.EntityRegistry; import game.init.EntityRegistry;
import game.network.ClientPlayer; import game.network.IClientPlayer;
import game.network.Packet; import game.network.Packet;
import game.network.PacketBuffer; import game.network.PacketBuffer;
import game.util.ExtMath; import game.util.ExtMath;
public class SPacketSpawnMob implements Packet<ClientPlayer> public class SPacketSpawnMob implements Packet<IClientPlayer>
{ {
private int entityId; private int entityId;
private int type; private int type;
@ -114,7 +114,7 @@ public class SPacketSpawnMob implements Packet<ClientPlayer>
this.writeWatcher.writeTo(buf); this.writeWatcher.writeTo(buf);
} }
public void processPacket(ClientPlayer handler) public void processPacket(IClientPlayer handler)
{ {
handler.handleSpawnMob(this); handler.handleSpawnMob(this);
} }

View file

@ -7,14 +7,14 @@ import game.entity.item.EntityLeashKnot;
import game.entity.projectile.EntityProjectile; import game.entity.projectile.EntityProjectile;
import game.entity.types.IObjectData; import game.entity.types.IObjectData;
import game.init.EntityRegistry; import game.init.EntityRegistry;
import game.network.ClientPlayer; import game.network.IClientPlayer;
import game.network.Packet; import game.network.Packet;
import game.network.PacketBuffer; import game.network.PacketBuffer;
import game.util.ExtMath; import game.util.ExtMath;
import game.world.BlockPos; import game.world.BlockPos;
import game.world.Vec3; import game.world.Vec3;
public class SPacketSpawnObject implements Packet<ClientPlayer> public class SPacketSpawnObject implements Packet<IClientPlayer>
{ {
private int entityId; private int entityId;
private int x; private int x;
@ -139,7 +139,7 @@ public class SPacketSpawnObject implements Packet<ClientPlayer>
} }
} }
public void processPacket(ClientPlayer handler) public void processPacket(IClientPlayer handler)
{ {
handler.handleSpawnObject(this); handler.handleSpawnObject(this);
} }

View file

@ -9,12 +9,12 @@ import game.entity.npc.EntityNPC;
import game.init.EntityRegistry; import game.init.EntityRegistry;
import game.init.ItemRegistry; import game.init.ItemRegistry;
import game.item.ItemStack; import game.item.ItemStack;
import game.network.ClientPlayer; import game.network.IClientPlayer;
import game.network.Packet; import game.network.Packet;
import game.network.PacketBuffer; import game.network.PacketBuffer;
import game.util.ExtMath; import game.util.ExtMath;
public class SPacketSpawnPlayer implements Packet<ClientPlayer> public class SPacketSpawnPlayer implements Packet<IClientPlayer>
{ {
private int entityId; private int entityId;
private int type; private int type;
@ -90,7 +90,7 @@ public class SPacketSpawnPlayer implements Packet<ClientPlayer>
/** /**
* Passes this Packet on to the NetHandler for processing. * Passes this Packet on to the NetHandler for processing.
*/ */
public void processPacket(ClientPlayer handler) public void processPacket(IClientPlayer handler)
{ {
handler.handleSpawnPlayer(this); handler.handleSpawnPlayer(this);
} }

View file

@ -2,11 +2,11 @@ package game.packet;
import java.io.IOException; import java.io.IOException;
import game.network.ClientPlayer; import game.network.IClientPlayer;
import game.network.Packet; import game.network.Packet;
import game.network.PacketBuffer; import game.network.PacketBuffer;
public class SPacketTimeUpdate implements Packet<ClientPlayer> { public class SPacketTimeUpdate implements Packet<IClientPlayer> {
private long worldTime; private long worldTime;
private String serverInfo; private String serverInfo;
@ -28,7 +28,7 @@ public class SPacketTimeUpdate implements Packet<ClientPlayer> {
buf.writeString(this.serverInfo); buf.writeString(this.serverInfo);
} }
public void processPacket(ClientPlayer handler) { public void processPacket(IClientPlayer handler) {
handler.handleTimeUpdate(this); handler.handleTimeUpdate(this);
} }

View file

@ -3,13 +3,13 @@ package game.packet;
import java.io.IOException; import java.io.IOException;
import game.item.ItemStack; import game.item.ItemStack;
import game.network.ClientPlayer; import game.network.IClientPlayer;
import game.network.Packet; import game.network.Packet;
import game.network.PacketBuffer; import game.network.PacketBuffer;
import game.village.MerchantRecipe; import game.village.MerchantRecipe;
import game.village.MerchantRecipeList; import game.village.MerchantRecipeList;
public class SPacketTrades implements Packet<ClientPlayer> public class SPacketTrades implements Packet<IClientPlayer>
{ {
private MerchantRecipeList recipes; private MerchantRecipeList recipes;
private int windowId; private int windowId;
@ -88,7 +88,7 @@ public class SPacketTrades implements Packet<ClientPlayer>
/** /**
* Passes this Packet on to the NetHandler for processing. * Passes this Packet on to the NetHandler for processing.
*/ */
public void processPacket(ClientPlayer handler) public void processPacket(IClientPlayer handler)
{ {
handler.handleTrades(this); handler.handleTrades(this);
} }

View file

@ -2,11 +2,11 @@ package game.packet;
import java.io.IOException; import java.io.IOException;
import game.network.ClientPlayer; import game.network.IClientPlayer;
import game.network.Packet; import game.network.Packet;
import game.network.PacketBuffer; import game.network.PacketBuffer;
public class SPacketUpdateHealth implements Packet<ClientPlayer> { public class SPacketUpdateHealth implements Packet<IClientPlayer> {
private int health; private int health;
public SPacketUpdateHealth() { public SPacketUpdateHealth() {
@ -24,7 +24,7 @@ public class SPacketUpdateHealth implements Packet<ClientPlayer> {
buf.writeInt(this.health); buf.writeInt(this.health);
} }
public void processPacket(ClientPlayer handler) { public void processPacket(IClientPlayer handler) {
handler.handleUpdateHealth(this); handler.handleUpdateHealth(this);
} }

Some files were not shown because too many files have changed in this diff Show more