split client and server 2
This commit is contained in:
parent
2fa521c3d1
commit
b17efb5b07
158 changed files with 1080 additions and 515 deletions
|
@ -51,6 +51,8 @@ import client.gui.container.GuiContainer;
|
|||
import client.gui.container.GuiInventory;
|
||||
import client.gui.element.Textbox;
|
||||
import client.gui.ingame.GuiGameOver;
|
||||
import client.network.ClientLoginHandler;
|
||||
import client.network.ClientPlayer;
|
||||
import client.renderer.BlockRenderer;
|
||||
import client.renderer.Drawing;
|
||||
import client.renderer.EntityRenderer;
|
||||
|
@ -104,8 +106,6 @@ import game.log.Log;
|
|||
import game.log.LogLevel;
|
||||
import game.log.Message;
|
||||
import game.material.Material;
|
||||
import game.network.ClientLoginHandler;
|
||||
import game.network.ClientPlayer;
|
||||
import game.network.IThreadListener;
|
||||
import game.network.NetConnection;
|
||||
import game.network.NetHandler.ThreadQuickExitException;
|
||||
|
@ -1476,7 +1476,7 @@ public class Game implements IThreadListener {
|
|||
|
||||
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)
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package client;
|
||||
|
||||
import client.network.ClientPlayer;
|
||||
import game.block.Block;
|
||||
import game.entity.Entity;
|
||||
import game.entity.npc.EntityNPC;
|
||||
|
@ -9,7 +10,6 @@ import game.item.ItemBlock;
|
|||
import game.item.ItemControl;
|
||||
import game.item.ItemStack;
|
||||
import game.material.Material;
|
||||
import game.network.ClientPlayer;
|
||||
import game.packet.CPacketAction;
|
||||
import game.packet.CPacketBreak;
|
||||
import game.packet.CPacketClick;
|
||||
|
|
|
@ -14,7 +14,7 @@ import client.renderer.Drawing;
|
|||
import game.color.TextColor;
|
||||
import game.init.Config;
|
||||
import game.log.Log;
|
||||
import game.network.Player;
|
||||
import game.network.IPlayer;
|
||||
import game.util.FileUtils;
|
||||
import game.util.Tuple;
|
||||
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++) {
|
||||
String line = z == lines.length ? null : lines[z];
|
||||
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));
|
||||
if(line != null) {
|
||||
address = "";
|
||||
|
|
|
@ -7,11 +7,12 @@ import client.gui.element.ActButton;
|
|||
import client.gui.element.Fill;
|
||||
import client.gui.element.Textbox;
|
||||
import client.gui.element.Textbox.Action;
|
||||
import client.network.ClientPlayer;
|
||||
import client.gui.element.TransparentBox;
|
||||
import client.window.Keysym;
|
||||
import game.collect.Lists;
|
||||
import game.color.TextColor;
|
||||
import game.network.Player;
|
||||
import game.network.IPlayer;
|
||||
import game.packet.CPacketComplete;
|
||||
import game.util.ExtMath;
|
||||
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));
|
||||
if(this.full)
|
||||
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.sentHistoryCursor = this.sentMessages.size();
|
||||
}
|
||||
|
@ -214,7 +215,7 @@ public class GuiConsole extends Gui implements Textbox.Callback {
|
|||
s = argv[argv.length - 1];
|
||||
Iterable<String> res = pre.startsWith("#") ?
|
||||
(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("#"))
|
||||
s = s.substring(1);
|
||||
for(String s1 : res) {
|
||||
|
|
|
@ -8,7 +8,7 @@ import client.gui.element.Textbox;
|
|||
import client.gui.element.Textbox.Action;
|
||||
import game.color.TextColor;
|
||||
import game.init.Config;
|
||||
import game.network.Player;
|
||||
import game.network.IPlayer;
|
||||
import game.vars.CVarCategory;
|
||||
import game.vars.Variable;
|
||||
|
||||
|
@ -38,11 +38,11 @@ public class GuiServer extends Gui implements Textbox.Callback {
|
|||
private String lastAddr = "";
|
||||
@Variable(name = "srv_last_port", category = CVarCategory.SYSTEM, min = 0, max = 65535, display = "Letzter Server-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 = "";
|
||||
@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 = "";
|
||||
@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 = "";
|
||||
|
||||
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.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.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.passBox = this.add(new Textbox(0, 120, 480, 24, Player.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.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, IPlayer.MAX_PASS_LENGTH, true, this, this.server == null ? this.lastPass : this.server.getPassword()));
|
||||
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() {
|
||||
public void use(ActButton elem, ActButton.Mode action) {
|
||||
GuiServer.this.connect();
|
||||
|
|
|
@ -51,7 +51,7 @@ import game.init.SpeciesRegistry;
|
|||
import game.init.SpeciesRegistry.ModelType;
|
||||
import game.init.UniverseRegistry;
|
||||
import game.log.Log;
|
||||
import game.network.Player;
|
||||
import game.network.IPlayer;
|
||||
import game.packet.CPacketAction;
|
||||
import game.packet.CPacketMessage;
|
||||
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();
|
||||
this.add(new Label(width / 2 - 200, 36, 400, 20, "Name", 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) {
|
||||
}
|
||||
}, ""));
|
||||
|
@ -375,7 +375,7 @@ public class GuiChar extends GuiList<GuiChar.SkinEntry>
|
|||
}
|
||||
}
|
||||
}, "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) {
|
||||
if(value == Action.SEND || value == Action.UNFOCUS) {
|
||||
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.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));
|
||||
|
|
|
@ -4,7 +4,7 @@ import client.gui.Gui;
|
|||
import client.gui.element.NavButton;
|
||||
import client.gui.element.Textbox;
|
||||
import client.gui.element.Textbox.Action;
|
||||
import game.network.ClientPlayer;
|
||||
import client.network.ClientPlayer;
|
||||
import game.packet.CPacketSign;
|
||||
import game.world.BlockPos;
|
||||
|
||||
|
|
|
@ -1,11 +1,15 @@
|
|||
package game.network;
|
||||
package client.network;
|
||||
|
||||
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.RPacketEnableCompression;
|
||||
import game.packet.RPacketLoginSuccess;
|
||||
|
||||
public class ClientLoginHandler extends NetHandler {
|
||||
public class ClientLoginHandler extends NetHandler implements IClientLoginHandler {
|
||||
private final Game gm;
|
||||
private final NetConnection networkManager;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package game.network;
|
||||
package client.network;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
@ -45,6 +45,10 @@ import game.inventory.InventoryPlayer;
|
|||
import game.item.ItemStack;
|
||||
import game.log.Log;
|
||||
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.CPacketKeepAlive;
|
||||
import game.packet.CPacketPlayer;
|
||||
|
@ -121,7 +125,7 @@ import game.world.Explosion;
|
|||
import game.world.Weather;
|
||||
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
|
33
java/src/game/IServer.java
Normal file
33
java/src/game/IServer.java
Normal 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);
|
||||
}
|
|
@ -83,8 +83,8 @@ import game.item.ItemTool;
|
|||
import game.model.ParticleType;
|
||||
import game.nbt.NBTTagCompound;
|
||||
import game.nbt.NBTTagList;
|
||||
import game.network.ClientPlayer;
|
||||
import game.network.Player;
|
||||
import game.network.IClientPlayer;
|
||||
import game.network.IPlayer;
|
||||
import game.packet.CPacketAction;
|
||||
import game.packet.CPacketBreak;
|
||||
import game.packet.CPacketInput;
|
||||
|
@ -198,8 +198,8 @@ public abstract class EntityNPC extends EntityLiving
|
|||
private int healTimer;
|
||||
private byte[] skin;
|
||||
|
||||
public Player connection;
|
||||
public ClientPlayer sendQueue;
|
||||
public IPlayer connection;
|
||||
public IClientPlayer sendQueue;
|
||||
protected Game gm;
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
public final void setServerPlayer(Player connection) {
|
||||
public final void setServerPlayer(IPlayer connection) {
|
||||
this.initPlayer();
|
||||
this.connection = connection;
|
||||
this.stepHeight = 0.0F;
|
||||
}
|
||||
|
||||
public final void setClientPlayer(Game gm, ClientPlayer connection) {
|
||||
public final void setClientPlayer(Game gm, IClientPlayer connection) {
|
||||
this.initPlayer();
|
||||
this.gm = gm;
|
||||
this.sendQueue = connection;
|
||||
|
|
|
@ -50,7 +50,7 @@ import game.material.Material;
|
|||
import game.model.ParticleType;
|
||||
import game.nbt.NBTTagCompound;
|
||||
import game.nbt.NBTTagList;
|
||||
import game.network.Player;
|
||||
import game.network.IPlayer;
|
||||
import game.packet.S1BPacketEntityAttach;
|
||||
import game.packet.SPacketAnimation;
|
||||
import game.packet.SPacketCollectItem;
|
||||
|
@ -2462,7 +2462,7 @@ public abstract class EntityLiving extends Entity
|
|||
return;
|
||||
String msg;
|
||||
String kill;
|
||||
Player receiver = null;
|
||||
IPlayer receiver = null;
|
||||
if(this.combat.size() == 0) {
|
||||
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)
|
||||
receiver.addFeed(kill);
|
||||
if(forAll)
|
||||
for(Player player : ((WorldServer)this.worldObj).getServer().getPlayers()) {
|
||||
for(IPlayer player : ((WorldServer)this.worldObj).getServer().getIPlayers()) {
|
||||
if(player != receiver)
|
||||
player.addFeed(msg);
|
||||
}
|
||||
|
|
15
java/src/game/network/IClientLoginHandler.java
Normal file
15
java/src/game/network/IClientLoginHandler.java
Normal 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);
|
||||
|
||||
}
|
315
java/src/game/network/IClientPlayer.java
Normal file
315
java/src/game/network/IClientPlayer.java
Normal 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);
|
||||
|
||||
}
|
9
java/src/game/network/IHandshakeHandler.java
Normal file
9
java/src/game/network/IHandshakeHandler.java
Normal file
|
@ -0,0 +1,9 @@
|
|||
package game.network;
|
||||
|
||||
import game.packet.HPacketHandshake;
|
||||
|
||||
public interface IHandshakeHandler {
|
||||
|
||||
void processHandshake(HPacketHandshake packetIn);
|
||||
|
||||
}
|
9
java/src/game/network/ILoginHandler.java
Normal file
9
java/src/game/network/ILoginHandler.java
Normal file
|
@ -0,0 +1,9 @@
|
|||
package game.network;
|
||||
|
||||
import game.packet.LPacketPasswordResponse;
|
||||
|
||||
public interface ILoginHandler {
|
||||
|
||||
void processPasswordResponse(LPacketPasswordResponse packetIn);
|
||||
|
||||
}
|
173
java/src/game/network/IPlayer.java
Normal file
173
java/src/game/network/IPlayer.java
Normal 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);
|
||||
}
|
|
@ -10,6 +10,7 @@ import java.util.regex.Pattern;
|
|||
import game.future.ThreadFactoryBuilder;
|
||||
import game.log.Log;
|
||||
import game.network.NetHandler.ThreadQuickExitException;
|
||||
import game.util.LazyLoadBase;
|
||||
import io.netty.bootstrap.Bootstrap;
|
||||
import io.netty.channel.Channel;
|
||||
import io.netty.channel.ChannelException;
|
||||
|
|
|
@ -19,7 +19,7 @@ public abstract class NetHandler {
|
|||
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 {
|
||||
if(!listener.isMainThread()) {
|
||||
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 {
|
||||
if(check == null && listener.isMainThread()) {
|
||||
throw EXIT;
|
||||
|
|
|
@ -2,7 +2,7 @@ package game.network;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
public interface Packet<T extends NetHandler>
|
||||
public interface Packet<T>
|
||||
{
|
||||
void readPacketData(PacketBuffer buf) throws IOException;
|
||||
void writePacketData(PacketBuffer buf) throws IOException;
|
||||
|
|
|
@ -2,11 +2,10 @@ package game.packet;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
import game.network.NetHandler;
|
||||
import game.network.Packet;
|
||||
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 {
|
||||
}
|
||||
|
||||
|
|
|
@ -2,11 +2,10 @@ package game.packet;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
import game.network.NetHandler;
|
||||
import game.network.Packet;
|
||||
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;
|
||||
|
||||
public APacketVarInt() {
|
||||
|
|
|
@ -4,9 +4,9 @@ import java.io.IOException;
|
|||
|
||||
import game.network.Packet;
|
||||
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 int auxData;
|
||||
|
@ -38,7 +38,7 @@ public class CPacketAction implements Packet<Player>
|
|||
buf.writeVarIntToBuffer(this.auxData);
|
||||
}
|
||||
|
||||
public void processPacket(Player handler)
|
||||
public void processPacket(IPlayer handler)
|
||||
{
|
||||
handler.processAction(this);
|
||||
}
|
||||
|
|
|
@ -4,9 +4,9 @@ import java.io.IOException;
|
|||
|
||||
import game.network.Packet;
|
||||
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;
|
||||
|
||||
|
@ -40,7 +40,7 @@ public class CPacketBook implements Packet<Player>
|
|||
}
|
||||
}
|
||||
|
||||
public void processPacket(Player handler)
|
||||
public void processPacket(IPlayer handler)
|
||||
{
|
||||
handler.processBook(this);
|
||||
}
|
||||
|
|
|
@ -4,11 +4,11 @@ import java.io.IOException;
|
|||
|
||||
import game.network.Packet;
|
||||
import game.network.PacketBuffer;
|
||||
import game.network.Player;
|
||||
import game.network.IPlayer;
|
||||
import game.world.BlockPos;
|
||||
import game.world.Facing;
|
||||
|
||||
public class CPacketBreak implements Packet<Player>
|
||||
public class CPacketBreak implements Packet<IPlayer>
|
||||
{
|
||||
private BlockPos position;
|
||||
private Facing facing;
|
||||
|
@ -39,7 +39,7 @@ public class CPacketBreak implements Packet<Player>
|
|||
buf.writeByte(this.facing.getIndex());
|
||||
}
|
||||
|
||||
public void processPacket(Player handler)
|
||||
public void processPacket(IPlayer handler)
|
||||
{
|
||||
handler.processBreak(this);
|
||||
}
|
||||
|
|
|
@ -5,9 +5,9 @@ import java.io.IOException;
|
|||
import game.item.ItemStack;
|
||||
import game.network.Packet;
|
||||
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 int slot;
|
||||
|
@ -23,7 +23,7 @@ public class CPacketCheat implements Packet<Player>
|
|||
this.stack.stackSize = full ? this.stack.getMaxStackSize() : 1;
|
||||
}
|
||||
|
||||
public void processPacket(Player handler)
|
||||
public void processPacket(IPlayer handler)
|
||||
{
|
||||
handler.processCheat(this);
|
||||
}
|
||||
|
|
|
@ -5,9 +5,9 @@ import java.io.IOException;
|
|||
import game.item.ItemStack;
|
||||
import game.network.Packet;
|
||||
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. */
|
||||
private int windowId;
|
||||
|
@ -41,7 +41,7 @@ public class CPacketClick implements Packet<Player>
|
|||
this.mode = mode;
|
||||
}
|
||||
|
||||
public void processPacket(Player handler)
|
||||
public void processPacket(IPlayer handler)
|
||||
{
|
||||
handler.processClick(this);
|
||||
}
|
||||
|
|
|
@ -4,10 +4,10 @@ import java.io.IOException;
|
|||
|
||||
import game.network.Packet;
|
||||
import game.network.PacketBuffer;
|
||||
import game.network.Player;
|
||||
import game.network.IPlayer;
|
||||
import game.world.BlockPos;
|
||||
|
||||
public class CPacketComplete implements Packet<Player>
|
||||
public class CPacketComplete implements Packet<IPlayer>
|
||||
{
|
||||
private String message;
|
||||
private int entityId;
|
||||
|
@ -41,7 +41,7 @@ public class CPacketComplete implements Packet<Player>
|
|||
buf.writeBlockPos(this.position);
|
||||
}
|
||||
|
||||
public void processPacket(Player handler)
|
||||
public void processPacket(IPlayer handler)
|
||||
{
|
||||
handler.processComplete(this);
|
||||
}
|
||||
|
|
|
@ -4,9 +4,9 @@ import java.io.IOException;
|
|||
|
||||
import game.network.Packet;
|
||||
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 forwardSpeed;
|
||||
|
@ -53,7 +53,7 @@ public class CPacketInput implements Packet<Player>
|
|||
buf.writeByte(b0);
|
||||
}
|
||||
|
||||
public void processPacket(Player handler)
|
||||
public void processPacket(IPlayer handler)
|
||||
{
|
||||
handler.processInput(this);
|
||||
}
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
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()
|
||||
{
|
||||
|
@ -13,7 +13,7 @@ public class CPacketKeepAlive extends APacketVarInt<Player>
|
|||
super(key);
|
||||
}
|
||||
|
||||
public void processPacket(Player handler)
|
||||
public void processPacket(IPlayer handler)
|
||||
{
|
||||
handler.processKeepAlive(this);
|
||||
}
|
||||
|
|
|
@ -4,9 +4,9 @@ import java.io.IOException;
|
|||
|
||||
import game.network.Packet;
|
||||
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 String message;
|
||||
|
@ -33,7 +33,7 @@ public class CPacketMessage implements Packet<Player>
|
|||
buf.writeString(this.message);
|
||||
}
|
||||
|
||||
public void processPacket(Player handler)
|
||||
public void processPacket(IPlayer handler)
|
||||
{
|
||||
handler.processMessage(this);
|
||||
}
|
||||
|
@ -49,10 +49,10 @@ public class CPacketMessage implements Packet<Player>
|
|||
}
|
||||
|
||||
public static enum Type {
|
||||
COMMAND(Player.MAX_CMD_LENGTH),
|
||||
CHAT(Player.MAX_CMD_LENGTH),
|
||||
DISPLAY(Player.MAX_NICK_LENGTH),
|
||||
INFO(Player.MAX_INFO_LENGTH);
|
||||
COMMAND(IPlayer.MAX_CMD_LENGTH),
|
||||
CHAT(IPlayer.MAX_CMD_LENGTH),
|
||||
DISPLAY(IPlayer.MAX_NICK_LENGTH),
|
||||
INFO(IPlayer.MAX_INFO_LENGTH);
|
||||
// , ITEM(30);
|
||||
|
||||
private final int length;
|
||||
|
|
|
@ -5,10 +5,10 @@ import java.io.IOException;
|
|||
import game.item.ItemStack;
|
||||
import game.network.Packet;
|
||||
import game.network.PacketBuffer;
|
||||
import game.network.Player;
|
||||
import game.network.IPlayer;
|
||||
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);
|
||||
|
||||
|
@ -58,7 +58,7 @@ public class CPacketPlace implements Packet<Player>
|
|||
buf.writeByte((int)(this.facingZ * 16.0F));
|
||||
}
|
||||
|
||||
public void processPacket(Player handler)
|
||||
public void processPacket(IPlayer handler)
|
||||
{
|
||||
handler.processPlace(this);
|
||||
}
|
||||
|
|
|
@ -4,9 +4,9 @@ import java.io.IOException;
|
|||
|
||||
import game.network.Packet;
|
||||
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 y;
|
||||
|
@ -26,7 +26,7 @@ public class CPacketPlayer implements Packet<Player>
|
|||
this.onGround = isOnGround;
|
||||
}
|
||||
|
||||
public void processPacket(Player handler)
|
||||
public void processPacket(IPlayer handler)
|
||||
{
|
||||
handler.processPlayer(this);
|
||||
}
|
||||
|
|
|
@ -4,10 +4,10 @@ import java.io.IOException;
|
|||
|
||||
import game.network.Packet;
|
||||
import game.network.PacketBuffer;
|
||||
import game.network.Player;
|
||||
import game.network.IPlayer;
|
||||
import game.world.BlockPos;
|
||||
|
||||
public class CPacketSign implements Packet<Player>
|
||||
public class CPacketSign implements Packet<IPlayer>
|
||||
{
|
||||
private BlockPos pos;
|
||||
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);
|
||||
}
|
||||
|
|
|
@ -7,9 +7,9 @@ import client.renderer.texture.EntityTexManager;
|
|||
import game.init.SpeciesRegistry.ModelType;
|
||||
import game.network.Packet;
|
||||
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 String character;
|
||||
|
||||
|
@ -58,7 +58,7 @@ public class CPacketSkin implements Packet<Player> {
|
|||
buf.writeByteArray(this.texture);
|
||||
}
|
||||
|
||||
public void processPacket(Player handler) {
|
||||
public void processPacket(IPlayer handler) {
|
||||
handler.processSkin(this);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,11 +2,11 @@ package game.packet;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
import game.network.HandshakeHandler;
|
||||
import game.network.IHandshakeHandler;
|
||||
import game.network.Packet;
|
||||
import game.network.PacketBuffer;
|
||||
|
||||
public class HPacketHandshake implements Packet<HandshakeHandler> {
|
||||
public class HPacketHandshake implements Packet<IHandshakeHandler> {
|
||||
private int protocol;
|
||||
|
||||
public HPacketHandshake() {
|
||||
|
@ -30,7 +30,7 @@ public class HPacketHandshake implements Packet<HandshakeHandler> {
|
|||
buf.writeVarIntToBuffer(this.protocol);
|
||||
}
|
||||
|
||||
public void processPacket(HandshakeHandler handler) {
|
||||
public void processPacket(IHandshakeHandler handler) {
|
||||
handler.processHandshake(this);
|
||||
}
|
||||
|
||||
|
|
|
@ -2,12 +2,12 @@ package game.packet;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
import game.network.LoginHandler;
|
||||
import game.network.IPlayer;
|
||||
import game.network.ILoginHandler;
|
||||
import game.network.Packet;
|
||||
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 access;
|
||||
|
@ -29,9 +29,9 @@ public class LPacketPasswordResponse implements Packet<LoginHandler>
|
|||
*/
|
||||
public void readPacketData(PacketBuffer buf) throws IOException
|
||||
{
|
||||
this.user = buf.readStringFromBuffer(Player.MAX_USER_LENGTH);
|
||||
this.access = buf.readStringFromBuffer(Player.MAX_PASS_LENGTH);
|
||||
this.password = buf.readStringFromBuffer(Player.MAX_PASS_LENGTH);
|
||||
this.user = buf.readStringFromBuffer(IPlayer.MAX_USER_LENGTH);
|
||||
this.access = buf.readStringFromBuffer(IPlayer.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.
|
||||
*/
|
||||
public void processPacket(LoginHandler handler)
|
||||
public void processPacket(ILoginHandler handler)
|
||||
{
|
||||
handler.processPasswordResponse(this);
|
||||
}
|
||||
|
|
|
@ -2,11 +2,11 @@ package game.packet;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
import game.network.ClientLoginHandler;
|
||||
import game.network.IClientLoginHandler;
|
||||
import game.network.Packet;
|
||||
import game.network.PacketBuffer;
|
||||
|
||||
public class RPacketDisconnect implements Packet<ClientLoginHandler>
|
||||
public class RPacketDisconnect implements Packet<IClientLoginHandler>
|
||||
{
|
||||
private String reason;
|
||||
|
||||
|
@ -38,7 +38,7 @@ public class RPacketDisconnect implements Packet<ClientLoginHandler>
|
|||
/**
|
||||
* Passes this Packet on to the NetHandler for processing.
|
||||
*/
|
||||
public void processPacket(ClientLoginHandler handler)
|
||||
public void processPacket(IClientLoginHandler handler)
|
||||
{
|
||||
handler.handleDisconnect(this);
|
||||
}
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
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()
|
||||
{
|
||||
|
@ -13,7 +13,7 @@ public class RPacketEnableCompression extends APacketVarInt<ClientLoginHandler>
|
|||
super(comp);
|
||||
}
|
||||
|
||||
public void processPacket(ClientLoginHandler handler)
|
||||
public void processPacket(IClientLoginHandler handler)
|
||||
{
|
||||
handler.handleEnableCompression(this);
|
||||
}
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
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);
|
||||
}
|
||||
|
|
|
@ -3,12 +3,12 @@ package game.packet;
|
|||
import java.io.IOException;
|
||||
|
||||
import game.entity.Entity;
|
||||
import game.network.ClientPlayer;
|
||||
import game.network.IClientPlayer;
|
||||
import game.network.Packet;
|
||||
import game.network.PacketBuffer;
|
||||
import game.world.World;
|
||||
|
||||
public class S14PacketEntity implements Packet<ClientPlayer>
|
||||
public class S14PacketEntity implements Packet<IClientPlayer>
|
||||
{
|
||||
protected int entityId;
|
||||
protected byte posX;
|
||||
|
@ -47,7 +47,7 @@ public class S14PacketEntity implements Packet<ClientPlayer>
|
|||
/**
|
||||
* Passes this Packet on to the NetHandler for processing.
|
||||
*/
|
||||
public void processPacket(ClientPlayer handler)
|
||||
public void processPacket(IClientPlayer handler)
|
||||
{
|
||||
handler.handleEntityMovement(this);
|
||||
}
|
||||
|
|
|
@ -3,12 +3,12 @@ package game.packet;
|
|||
import java.io.IOException;
|
||||
|
||||
import game.entity.Entity;
|
||||
import game.network.ClientPlayer;
|
||||
import game.network.IClientPlayer;
|
||||
import game.network.Packet;
|
||||
import game.network.PacketBuffer;
|
||||
import game.util.ExtMath;
|
||||
|
||||
public class S18PacketEntityTeleport implements Packet<ClientPlayer>
|
||||
public class S18PacketEntityTeleport implements Packet<IClientPlayer>
|
||||
{
|
||||
private int entityId;
|
||||
private int posX;
|
||||
|
@ -75,7 +75,7 @@ public class S18PacketEntityTeleport implements Packet<ClientPlayer>
|
|||
/**
|
||||
* Passes this Packet on to the NetHandler for processing.
|
||||
*/
|
||||
public void processPacket(ClientPlayer handler)
|
||||
public void processPacket(IClientPlayer handler)
|
||||
{
|
||||
handler.handleEntityTeleport(this);
|
||||
}
|
||||
|
|
|
@ -3,12 +3,12 @@ package game.packet;
|
|||
import java.io.IOException;
|
||||
|
||||
import game.entity.Entity;
|
||||
import game.network.ClientPlayer;
|
||||
import game.network.IClientPlayer;
|
||||
import game.network.Packet;
|
||||
import game.network.PacketBuffer;
|
||||
import game.world.World;
|
||||
|
||||
public class S19PacketEntityHeadLook implements Packet<ClientPlayer>
|
||||
public class S19PacketEntityHeadLook implements Packet<IClientPlayer>
|
||||
{
|
||||
private int entityId;
|
||||
private byte yaw;
|
||||
|
@ -44,7 +44,7 @@ public class S19PacketEntityHeadLook implements Packet<ClientPlayer>
|
|||
/**
|
||||
* Passes this Packet on to the NetHandler for processing.
|
||||
*/
|
||||
public void processPacket(ClientPlayer handler)
|
||||
public void processPacket(IClientPlayer handler)
|
||||
{
|
||||
handler.handleEntityHeadLook(this);
|
||||
}
|
||||
|
|
|
@ -3,12 +3,12 @@ package game.packet;
|
|||
import java.io.IOException;
|
||||
|
||||
import game.entity.Entity;
|
||||
import game.network.ClientPlayer;
|
||||
import game.network.IClientPlayer;
|
||||
import game.network.Packet;
|
||||
import game.network.PacketBuffer;
|
||||
import game.world.World;
|
||||
|
||||
public class S1APacketEntityStatus implements Packet<ClientPlayer>
|
||||
public class S1APacketEntityStatus implements Packet<IClientPlayer>
|
||||
{
|
||||
private int entityId;
|
||||
private byte logicOpcode;
|
||||
|
@ -44,7 +44,7 @@ public class S1APacketEntityStatus implements Packet<ClientPlayer>
|
|||
/**
|
||||
* Passes this Packet on to the NetHandler for processing.
|
||||
*/
|
||||
public void processPacket(ClientPlayer handler)
|
||||
public void processPacket(IClientPlayer handler)
|
||||
{
|
||||
handler.handleEntityStatus(this);
|
||||
}
|
||||
|
|
|
@ -3,11 +3,11 @@ package game.packet;
|
|||
import java.io.IOException;
|
||||
|
||||
import game.entity.Entity;
|
||||
import game.network.ClientPlayer;
|
||||
import game.network.IClientPlayer;
|
||||
import game.network.Packet;
|
||||
import game.network.PacketBuffer;
|
||||
|
||||
public class S1BPacketEntityAttach implements Packet<ClientPlayer>
|
||||
public class S1BPacketEntityAttach implements Packet<IClientPlayer>
|
||||
{
|
||||
private int leash;
|
||||
private int entityId;
|
||||
|
@ -47,7 +47,7 @@ public class S1BPacketEntityAttach implements Packet<ClientPlayer>
|
|||
/**
|
||||
* Passes this Packet on to the NetHandler for processing.
|
||||
*/
|
||||
public void processPacket(ClientPlayer handler)
|
||||
public void processPacket(IClientPlayer handler)
|
||||
{
|
||||
handler.handleEntityAttach(this);
|
||||
}
|
||||
|
|
|
@ -4,11 +4,11 @@ import java.io.IOException;
|
|||
import java.util.List;
|
||||
|
||||
import game.entity.DataWatcher;
|
||||
import game.network.ClientPlayer;
|
||||
import game.network.IClientPlayer;
|
||||
import game.network.Packet;
|
||||
import game.network.PacketBuffer;
|
||||
|
||||
public class S1CPacketEntityMetadata implements Packet<ClientPlayer>
|
||||
public class S1CPacketEntityMetadata implements Packet<IClientPlayer>
|
||||
{
|
||||
private int entityId;
|
||||
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.
|
||||
*/
|
||||
public void processPacket(ClientPlayer handler)
|
||||
public void processPacket(IClientPlayer handler)
|
||||
{
|
||||
handler.handleEntityMetadata(this);
|
||||
}
|
||||
|
|
|
@ -2,13 +2,13 @@ package game.packet;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
import game.network.ClientPlayer;
|
||||
import game.network.IClientPlayer;
|
||||
import game.network.Packet;
|
||||
import game.network.PacketBuffer;
|
||||
import game.potion.Potion;
|
||||
import game.potion.PotionEffect;
|
||||
|
||||
public class S1DPacketEntityEffect implements Packet<ClientPlayer>
|
||||
public class S1DPacketEntityEffect implements Packet<IClientPlayer>
|
||||
{
|
||||
private int entityId;
|
||||
private Potion effectId;
|
||||
|
@ -69,7 +69,7 @@ public class S1DPacketEntityEffect implements Packet<ClientPlayer>
|
|||
/**
|
||||
* Passes this Packet on to the NetHandler for processing.
|
||||
*/
|
||||
public void processPacket(ClientPlayer handler)
|
||||
public void processPacket(IClientPlayer handler)
|
||||
{
|
||||
handler.handleEntityEffect(this);
|
||||
}
|
||||
|
|
|
@ -2,13 +2,13 @@ package game.packet;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
import game.network.ClientPlayer;
|
||||
import game.network.IClientPlayer;
|
||||
import game.network.Packet;
|
||||
import game.network.PacketBuffer;
|
||||
import game.potion.Potion;
|
||||
import game.potion.PotionEffect;
|
||||
|
||||
public class S1EPacketRemoveEntityEffect implements Packet<ClientPlayer>
|
||||
public class S1EPacketRemoveEntityEffect implements Packet<IClientPlayer>
|
||||
{
|
||||
private int entityId;
|
||||
private Potion effectId;
|
||||
|
@ -44,7 +44,7 @@ public class S1EPacketRemoveEntityEffect implements Packet<ClientPlayer>
|
|||
/**
|
||||
* Passes this Packet on to the NetHandler for processing.
|
||||
*/
|
||||
public void processPacket(ClientPlayer handler)
|
||||
public void processPacket(IClientPlayer handler)
|
||||
{
|
||||
handler.handleRemoveEntityEffect(this);
|
||||
}
|
||||
|
|
|
@ -7,11 +7,11 @@ import java.util.List;
|
|||
import game.collect.Lists;
|
||||
import game.entity.attributes.AttributeInstance;
|
||||
import game.entity.attributes.AttributeModifier;
|
||||
import game.network.ClientPlayer;
|
||||
import game.network.IClientPlayer;
|
||||
import game.network.Packet;
|
||||
import game.network.PacketBuffer;
|
||||
|
||||
public class S20PacketEntityProperties implements Packet<ClientPlayer>
|
||||
public class S20PacketEntityProperties implements Packet<IClientPlayer>
|
||||
{
|
||||
private int entityId;
|
||||
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.
|
||||
*/
|
||||
public void processPacket(ClientPlayer handler)
|
||||
public void processPacket(IClientPlayer handler)
|
||||
{
|
||||
handler.handleEntityProperties(this);
|
||||
}
|
||||
|
|
|
@ -5,13 +5,13 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
|
||||
import game.collect.Lists;
|
||||
import game.network.ClientPlayer;
|
||||
import game.network.IClientPlayer;
|
||||
import game.network.Packet;
|
||||
import game.network.PacketBuffer;
|
||||
import game.world.BlockPos;
|
||||
import game.world.Vec3;
|
||||
|
||||
public class S27PacketExplosion implements Packet<ClientPlayer>
|
||||
public class S27PacketExplosion implements Packet<IClientPlayer>
|
||||
{
|
||||
private double posX;
|
||||
private double posY;
|
||||
|
@ -106,7 +106,7 @@ public class S27PacketExplosion implements Packet<ClientPlayer>
|
|||
/**
|
||||
* Passes this Packet on to the NetHandler for processing.
|
||||
*/
|
||||
public void processPacket(ClientPlayer handler)
|
||||
public void processPacket(IClientPlayer handler)
|
||||
{
|
||||
handler.handleExplosion(this);
|
||||
}
|
||||
|
|
|
@ -2,12 +2,12 @@ package game.packet;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
import game.network.ClientPlayer;
|
||||
import game.network.IClientPlayer;
|
||||
import game.network.Packet;
|
||||
import game.network.PacketBuffer;
|
||||
import game.world.BlockPos;
|
||||
|
||||
public class S28PacketEffect implements Packet<ClientPlayer> {
|
||||
public class S28PacketEffect implements Packet<IClientPlayer> {
|
||||
private int soundType;
|
||||
private BlockPos soundPos;
|
||||
private int soundData;
|
||||
|
@ -33,7 +33,7 @@ public class S28PacketEffect implements Packet<ClientPlayer> {
|
|||
buf.writeInt(this.soundData);
|
||||
}
|
||||
|
||||
public void processPacket(ClientPlayer handler) {
|
||||
public void processPacket(IClientPlayer handler) {
|
||||
handler.handleEffect(this);
|
||||
}
|
||||
|
||||
|
|
|
@ -3,11 +3,11 @@ package game.packet;
|
|||
import java.io.IOException;
|
||||
|
||||
import game.init.SoundEvent;
|
||||
import game.network.ClientPlayer;
|
||||
import game.network.IClientPlayer;
|
||||
import game.network.Packet;
|
||||
import game.network.PacketBuffer;
|
||||
|
||||
public class S29PacketSoundEffect implements Packet<ClientPlayer>
|
||||
public class S29PacketSoundEffect implements Packet<IClientPlayer>
|
||||
{
|
||||
private SoundEvent sound;
|
||||
private int posX;
|
||||
|
@ -86,7 +86,7 @@ public class S29PacketSoundEffect implements Packet<ClientPlayer>
|
|||
return this.soundVolume;
|
||||
}
|
||||
|
||||
public void processPacket(ClientPlayer handler)
|
||||
public void processPacket(IClientPlayer handler)
|
||||
{
|
||||
handler.handleSoundEffect(this);
|
||||
}
|
||||
|
|
|
@ -3,11 +3,11 @@ package game.packet;
|
|||
import java.io.IOException;
|
||||
|
||||
import game.model.ParticleType;
|
||||
import game.network.ClientPlayer;
|
||||
import game.network.IClientPlayer;
|
||||
import game.network.Packet;
|
||||
import game.network.PacketBuffer;
|
||||
|
||||
public class S2APacketParticles implements Packet<ClientPlayer>
|
||||
public class S2APacketParticles implements Packet<IClientPlayer>
|
||||
{
|
||||
private ParticleType particleType;
|
||||
private float xCoord;
|
||||
|
@ -183,7 +183,7 @@ public class S2APacketParticles implements Packet<ClientPlayer>
|
|||
/**
|
||||
* Passes this Packet on to the NetHandler for processing.
|
||||
*/
|
||||
public void processPacket(ClientPlayer handler)
|
||||
public void processPacket(IClientPlayer handler)
|
||||
{
|
||||
handler.handleParticles(this);
|
||||
}
|
||||
|
|
|
@ -2,12 +2,12 @@ package game.packet;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
import game.network.ClientPlayer;
|
||||
import game.network.IClientPlayer;
|
||||
import game.network.Packet;
|
||||
import game.network.PacketBuffer;
|
||||
import game.util.ExtMath;
|
||||
|
||||
public class S2BPacketChangeGameState implements Packet<ClientPlayer>
|
||||
public class S2BPacketChangeGameState implements Packet<IClientPlayer>
|
||||
{
|
||||
private Action action;
|
||||
private int param;
|
||||
|
@ -44,7 +44,7 @@ public class S2BPacketChangeGameState implements Packet<ClientPlayer>
|
|||
buf.writeVarIntToBuffer(this.param);
|
||||
}
|
||||
|
||||
public void processPacket(ClientPlayer handler)
|
||||
public void processPacket(IClientPlayer handler)
|
||||
{
|
||||
handler.handleChangeGameState(this);
|
||||
}
|
||||
|
|
|
@ -3,12 +3,12 @@ package game.packet;
|
|||
import java.io.IOException;
|
||||
|
||||
import game.entity.Entity;
|
||||
import game.network.ClientPlayer;
|
||||
import game.network.IClientPlayer;
|
||||
import game.network.Packet;
|
||||
import game.network.PacketBuffer;
|
||||
import game.util.ExtMath;
|
||||
|
||||
public class S2CPacketSpawnGlobalEntity implements Packet<ClientPlayer>
|
||||
public class S2CPacketSpawnGlobalEntity implements Packet<IClientPlayer>
|
||||
{
|
||||
private int entityId;
|
||||
private int x;
|
||||
|
@ -60,7 +60,7 @@ public class S2CPacketSpawnGlobalEntity implements Packet<ClientPlayer>
|
|||
/**
|
||||
* Passes this Packet on to the NetHandler for processing.
|
||||
*/
|
||||
public void processPacket(ClientPlayer handler)
|
||||
public void processPacket(IClientPlayer handler)
|
||||
{
|
||||
handler.handleSpawnGlobalEntity(this);
|
||||
}
|
||||
|
|
|
@ -2,12 +2,12 @@ package game.packet;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
import game.network.ClientPlayer;
|
||||
import game.network.IClientPlayer;
|
||||
import game.network.Packet;
|
||||
import game.network.PacketBuffer;
|
||||
import game.world.BlockPos;
|
||||
|
||||
public class S2DPacketOpenWindow implements Packet<ClientPlayer>
|
||||
public class S2DPacketOpenWindow implements Packet<IClientPlayer>
|
||||
{
|
||||
private int windowId;
|
||||
private String inventoryType;
|
||||
|
@ -48,7 +48,7 @@ public class S2DPacketOpenWindow implements Packet<ClientPlayer>
|
|||
/**
|
||||
* Passes this Packet on to the NetHandler for processing.
|
||||
*/
|
||||
public void processPacket(ClientPlayer handler)
|
||||
public void processPacket(IClientPlayer handler)
|
||||
{
|
||||
handler.handleOpenWindow(this);
|
||||
}
|
||||
|
|
|
@ -2,11 +2,11 @@ package game.packet;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
import game.network.ClientPlayer;
|
||||
import game.network.IClientPlayer;
|
||||
import game.network.Packet;
|
||||
import game.network.PacketBuffer;
|
||||
|
||||
public class S2EPacketCloseWindow implements Packet<ClientPlayer>
|
||||
public class S2EPacketCloseWindow implements Packet<IClientPlayer>
|
||||
{
|
||||
private int windowId;
|
||||
|
||||
|
@ -22,7 +22,7 @@ public class S2EPacketCloseWindow implements Packet<ClientPlayer>
|
|||
/**
|
||||
* Passes this Packet on to the NetHandler for processing.
|
||||
*/
|
||||
public void processPacket(ClientPlayer handler)
|
||||
public void processPacket(IClientPlayer handler)
|
||||
{
|
||||
handler.handleCloseWindow(this);
|
||||
}
|
||||
|
|
|
@ -3,11 +3,11 @@ package game.packet;
|
|||
import java.io.IOException;
|
||||
|
||||
import game.item.ItemStack;
|
||||
import game.network.ClientPlayer;
|
||||
import game.network.IClientPlayer;
|
||||
import game.network.Packet;
|
||||
import game.network.PacketBuffer;
|
||||
|
||||
public class S2FPacketSetSlot implements Packet<ClientPlayer>
|
||||
public class S2FPacketSetSlot implements Packet<IClientPlayer>
|
||||
{
|
||||
private int windowId;
|
||||
private int slot;
|
||||
|
@ -27,7 +27,7 @@ public class S2FPacketSetSlot implements Packet<ClientPlayer>
|
|||
/**
|
||||
* Passes this Packet on to the NetHandler for processing.
|
||||
*/
|
||||
public void processPacket(ClientPlayer handler)
|
||||
public void processPacket(IClientPlayer handler)
|
||||
{
|
||||
handler.handleSetSlot(this);
|
||||
}
|
||||
|
|
|
@ -4,11 +4,11 @@ import java.io.IOException;
|
|||
import java.util.List;
|
||||
|
||||
import game.item.ItemStack;
|
||||
import game.network.ClientPlayer;
|
||||
import game.network.IClientPlayer;
|
||||
import game.network.Packet;
|
||||
import game.network.PacketBuffer;
|
||||
|
||||
public class S30PacketWindowItems implements Packet<ClientPlayer>
|
||||
public class S30PacketWindowItems implements Packet<IClientPlayer>
|
||||
{
|
||||
private int windowId;
|
||||
private ItemStack[] itemStacks;
|
||||
|
@ -61,7 +61,7 @@ public class S30PacketWindowItems implements Packet<ClientPlayer>
|
|||
/**
|
||||
* Passes this Packet on to the NetHandler for processing.
|
||||
*/
|
||||
public void processPacket(ClientPlayer handler)
|
||||
public void processPacket(IClientPlayer handler)
|
||||
{
|
||||
handler.handleWindowItems(this);
|
||||
}
|
||||
|
|
|
@ -2,11 +2,11 @@ package game.packet;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
import game.network.ClientPlayer;
|
||||
import game.network.IClientPlayer;
|
||||
import game.network.Packet;
|
||||
import game.network.PacketBuffer;
|
||||
|
||||
public class S31PacketWindowProperty implements Packet<ClientPlayer>
|
||||
public class S31PacketWindowProperty implements Packet<IClientPlayer>
|
||||
{
|
||||
private int windowId;
|
||||
private int varIndex;
|
||||
|
@ -26,7 +26,7 @@ public class S31PacketWindowProperty implements Packet<ClientPlayer>
|
|||
/**
|
||||
* Passes this Packet on to the NetHandler for processing.
|
||||
*/
|
||||
public void processPacket(ClientPlayer handler)
|
||||
public void processPacket(IClientPlayer handler)
|
||||
{
|
||||
handler.handleWindowProperty(this);
|
||||
}
|
||||
|
|
|
@ -2,11 +2,11 @@ package game.packet;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
import game.network.ClientPlayer;
|
||||
import game.network.IClientPlayer;
|
||||
import game.network.Packet;
|
||||
import game.network.PacketBuffer;
|
||||
|
||||
public class S32PacketConfirmTransaction implements Packet<ClientPlayer>
|
||||
public class S32PacketConfirmTransaction implements Packet<IClientPlayer>
|
||||
{
|
||||
private int windowId;
|
||||
private short actionNumber;
|
||||
|
@ -26,7 +26,7 @@ public class S32PacketConfirmTransaction implements Packet<ClientPlayer>
|
|||
/**
|
||||
* Passes this Packet on to the NetHandler for processing.
|
||||
*/
|
||||
public void processPacket(ClientPlayer handler)
|
||||
public void processPacket(IClientPlayer handler)
|
||||
{
|
||||
handler.handleConfirmTransaction(this);
|
||||
}
|
||||
|
|
|
@ -2,13 +2,13 @@ package game.packet;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
import game.network.ClientPlayer;
|
||||
import game.network.IClientPlayer;
|
||||
import game.network.Packet;
|
||||
import game.network.PacketBuffer;
|
||||
import game.world.BlockPos;
|
||||
import game.world.World;
|
||||
|
||||
public class S33PacketUpdateSign implements Packet<ClientPlayer>
|
||||
public class S33PacketUpdateSign implements Packet<IClientPlayer>
|
||||
{
|
||||
private World world;
|
||||
private BlockPos blockPos;
|
||||
|
@ -62,7 +62,7 @@ public class S33PacketUpdateSign implements Packet<ClientPlayer>
|
|||
/**
|
||||
* Passes this Packet on to the NetHandler for processing.
|
||||
*/
|
||||
public void processPacket(ClientPlayer handler)
|
||||
public void processPacket(IClientPlayer handler)
|
||||
{
|
||||
handler.handleUpdateSign(this);
|
||||
}
|
||||
|
|
|
@ -4,13 +4,13 @@ import java.io.IOException;
|
|||
|
||||
import game.init.TileRegistry;
|
||||
import game.nbt.NBTTagCompound;
|
||||
import game.network.ClientPlayer;
|
||||
import game.network.IClientPlayer;
|
||||
import game.network.Packet;
|
||||
import game.network.PacketBuffer;
|
||||
import game.tileentity.TileEntity;
|
||||
import game.world.BlockPos;
|
||||
|
||||
public class S35PacketUpdateTileEntity implements Packet<ClientPlayer>
|
||||
public class S35PacketUpdateTileEntity implements Packet<IClientPlayer>
|
||||
{
|
||||
private BlockPos blockPos;
|
||||
private int type;
|
||||
|
@ -50,7 +50,7 @@ public class S35PacketUpdateTileEntity implements Packet<ClientPlayer>
|
|||
/**
|
||||
* Passes this Packet on to the NetHandler for processing.
|
||||
*/
|
||||
public void processPacket(ClientPlayer handler)
|
||||
public void processPacket(IClientPlayer handler)
|
||||
{
|
||||
handler.handleUpdateTileEntity(this);
|
||||
}
|
||||
|
|
|
@ -2,12 +2,12 @@ package game.packet;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
import game.network.ClientPlayer;
|
||||
import game.network.IClientPlayer;
|
||||
import game.network.Packet;
|
||||
import game.network.PacketBuffer;
|
||||
import game.world.BlockPos;
|
||||
|
||||
public class S36PacketSignEditorOpen implements Packet<ClientPlayer>
|
||||
public class S36PacketSignEditorOpen implements Packet<IClientPlayer>
|
||||
{
|
||||
private BlockPos signPosition;
|
||||
|
||||
|
@ -23,7 +23,7 @@ public class S36PacketSignEditorOpen implements Packet<ClientPlayer>
|
|||
/**
|
||||
* Passes this Packet on to the NetHandler for processing.
|
||||
*/
|
||||
public void processPacket(ClientPlayer handler)
|
||||
public void processPacket(IClientPlayer handler)
|
||||
{
|
||||
handler.handleSignEditorOpen(this);
|
||||
}
|
||||
|
|
|
@ -6,26 +6,26 @@ import java.util.Map;
|
|||
import java.util.Map.Entry;
|
||||
|
||||
import game.collect.Maps;
|
||||
import game.network.ClientPlayer;
|
||||
import game.network.IClientPlayer;
|
||||
import game.network.Packet;
|
||||
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();
|
||||
|
||||
public S38PacketPlayerListItem() {
|
||||
}
|
||||
|
||||
public S38PacketPlayerListItem(boolean remove, Player... conns) {
|
||||
for(Player conn : conns) {
|
||||
public S38PacketPlayerListItem(boolean remove, IPlayer... conns) {
|
||||
for(IPlayer conn : conns) {
|
||||
this.players.put(conn.getUser(), remove ? -1 : conn.getLatency());
|
||||
}
|
||||
}
|
||||
|
||||
public S38PacketPlayerListItem(Iterable<Player> conns) {
|
||||
for(Player conn : conns) {
|
||||
this.players.put(conn.getUser(), conn.getLatency());
|
||||
public S38PacketPlayerListItem(Iterable<IPlayer> conns) {
|
||||
for(IPlayer conn : conns) {
|
||||
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);
|
||||
}
|
||||
|
||||
|
|
|
@ -3,11 +3,11 @@ package game.packet;
|
|||
import java.io.IOException;
|
||||
|
||||
import game.entity.npc.EntityNPC;
|
||||
import game.network.ClientPlayer;
|
||||
import game.network.IClientPlayer;
|
||||
import game.network.Packet;
|
||||
import game.network.PacketBuffer;
|
||||
|
||||
public class S39PacketPlayerAbilities implements Packet<ClientPlayer> {
|
||||
public class S39PacketPlayerAbilities implements Packet<IClientPlayer> {
|
||||
private boolean flying;
|
||||
private boolean noClip;
|
||||
|
||||
|
@ -39,7 +39,7 @@ public class S39PacketPlayerAbilities implements Packet<ClientPlayer> {
|
|||
buf.writeByte(bt);
|
||||
}
|
||||
|
||||
public void processPacket(ClientPlayer handler) {
|
||||
public void processPacket(IClientPlayer handler) {
|
||||
handler.handlePlayerAbilities(this);
|
||||
}
|
||||
|
||||
|
|
|
@ -2,11 +2,11 @@ package game.packet;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
import game.network.ClientPlayer;
|
||||
import game.network.IClientPlayer;
|
||||
import game.network.Packet;
|
||||
import game.network.PacketBuffer;
|
||||
|
||||
public class S3APacketTabComplete implements Packet<ClientPlayer>
|
||||
public class S3APacketTabComplete implements Packet<IClientPlayer>
|
||||
{
|
||||
private String[] matches;
|
||||
|
||||
|
@ -48,7 +48,7 @@ public class S3APacketTabComplete implements Packet<ClientPlayer>
|
|||
/**
|
||||
* Passes this Packet on to the NetHandler for processing.
|
||||
*/
|
||||
public void processPacket(ClientPlayer handler)
|
||||
public void processPacket(IClientPlayer handler)
|
||||
{
|
||||
handler.handleTabComplete(this);
|
||||
}
|
||||
|
|
|
@ -4,12 +4,12 @@ import java.io.IOException;
|
|||
|
||||
import game.entity.Entity;
|
||||
import game.nbt.NBTTagCompound;
|
||||
import game.network.ClientPlayer;
|
||||
import game.network.IClientPlayer;
|
||||
import game.network.Packet;
|
||||
import game.network.PacketBuffer;
|
||||
import game.world.World;
|
||||
|
||||
public class S43PacketUpdateEntityNBT implements Packet<ClientPlayer>
|
||||
public class S43PacketUpdateEntityNBT implements Packet<IClientPlayer>
|
||||
{
|
||||
private int entityId;
|
||||
private NBTTagCompound tagCompound;
|
||||
|
@ -45,7 +45,7 @@ public class S43PacketUpdateEntityNBT implements Packet<ClientPlayer>
|
|||
/**
|
||||
* Passes this Packet on to the NetHandler for processing.
|
||||
*/
|
||||
public void processPacket(ClientPlayer handler)
|
||||
public void processPacket(IClientPlayer handler)
|
||||
{
|
||||
handler.handleEntityNBT(this);
|
||||
}
|
||||
|
|
|
@ -3,11 +3,11 @@ package game.packet;
|
|||
import java.io.IOException;
|
||||
|
||||
import game.entity.Entity;
|
||||
import game.network.ClientPlayer;
|
||||
import game.network.IClientPlayer;
|
||||
import game.network.Packet;
|
||||
import game.network.PacketBuffer;
|
||||
|
||||
public class SPacketAnimation implements Packet<ClientPlayer>
|
||||
public class SPacketAnimation implements Packet<IClientPlayer>
|
||||
{
|
||||
private int entityId;
|
||||
private int type;
|
||||
|
@ -45,7 +45,7 @@ public class SPacketAnimation implements Packet<ClientPlayer>
|
|||
// buf.writeVarIntToBuffer(this.par);
|
||||
}
|
||||
|
||||
public void processPacket(ClientPlayer handler)
|
||||
public void processPacket(IClientPlayer handler)
|
||||
{
|
||||
handler.handleAnimation(this);
|
||||
}
|
||||
|
|
|
@ -2,11 +2,11 @@ package game.packet;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
import game.network.ClientPlayer;
|
||||
import game.network.IClientPlayer;
|
||||
import game.network.Packet;
|
||||
import game.network.PacketBuffer;
|
||||
|
||||
public class SPacketBiomes implements Packet<ClientPlayer> {
|
||||
public class SPacketBiomes implements Packet<IClientPlayer> {
|
||||
private int chunkX;
|
||||
private int chunkZ;
|
||||
private byte[] biomes;
|
||||
|
@ -32,7 +32,7 @@ public class SPacketBiomes implements Packet<ClientPlayer> {
|
|||
buf.writeBytes(this.biomes);
|
||||
}
|
||||
|
||||
public void processPacket(ClientPlayer handler) {
|
||||
public void processPacket(IClientPlayer handler) {
|
||||
handler.handleBiomes(this);
|
||||
}
|
||||
|
||||
|
|
|
@ -4,12 +4,12 @@ import java.io.IOException;
|
|||
|
||||
import game.block.Block;
|
||||
import game.init.BlockRegistry;
|
||||
import game.network.ClientPlayer;
|
||||
import game.network.IClientPlayer;
|
||||
import game.network.Packet;
|
||||
import game.network.PacketBuffer;
|
||||
import game.world.BlockPos;
|
||||
|
||||
public class SPacketBlockAction implements Packet<ClientPlayer>
|
||||
public class SPacketBlockAction implements Packet<IClientPlayer>
|
||||
{
|
||||
private BlockPos blockPosition;
|
||||
private int instrument;
|
||||
|
@ -53,7 +53,7 @@ public class SPacketBlockAction implements Packet<ClientPlayer>
|
|||
/**
|
||||
* Passes this Packet on to the NetHandler for processing.
|
||||
*/
|
||||
public void processPacket(ClientPlayer handler)
|
||||
public void processPacket(IClientPlayer handler)
|
||||
{
|
||||
handler.handleBlockAction(this);
|
||||
}
|
||||
|
|
|
@ -2,12 +2,12 @@ package game.packet;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
import game.network.ClientPlayer;
|
||||
import game.network.IClientPlayer;
|
||||
import game.network.Packet;
|
||||
import game.network.PacketBuffer;
|
||||
import game.world.BlockPos;
|
||||
|
||||
public class SPacketBlockBreakAnim implements Packet<ClientPlayer>
|
||||
public class SPacketBlockBreakAnim implements Packet<IClientPlayer>
|
||||
{
|
||||
private int breakerId;
|
||||
private BlockPos position;
|
||||
|
@ -47,7 +47,7 @@ public class SPacketBlockBreakAnim implements Packet<ClientPlayer>
|
|||
/**
|
||||
* Passes this Packet on to the NetHandler for processing.
|
||||
*/
|
||||
public void processPacket(ClientPlayer handler)
|
||||
public void processPacket(IClientPlayer handler)
|
||||
{
|
||||
handler.handleBlockBreakAnim(this);
|
||||
}
|
||||
|
|
|
@ -3,14 +3,14 @@ package game.packet;
|
|||
import java.io.IOException;
|
||||
|
||||
import game.init.BlockRegistry;
|
||||
import game.network.ClientPlayer;
|
||||
import game.network.IClientPlayer;
|
||||
import game.network.Packet;
|
||||
import game.network.PacketBuffer;
|
||||
import game.world.BlockPos;
|
||||
import game.world.State;
|
||||
import game.world.World;
|
||||
|
||||
public class SPacketBlockChange implements Packet<ClientPlayer>
|
||||
public class SPacketBlockChange implements Packet<IClientPlayer>
|
||||
{
|
||||
private BlockPos blockPosition;
|
||||
private State blockState;
|
||||
|
@ -46,7 +46,7 @@ public class SPacketBlockChange implements Packet<ClientPlayer>
|
|||
/**
|
||||
* Passes this Packet on to the NetHandler for processing.
|
||||
*/
|
||||
public void processPacket(ClientPlayer handler)
|
||||
public void processPacket(IClientPlayer handler)
|
||||
{
|
||||
handler.handleBlockChange(this);
|
||||
}
|
||||
|
|
|
@ -3,12 +3,12 @@ package game.packet;
|
|||
import java.io.IOException;
|
||||
|
||||
import game.entity.Entity;
|
||||
import game.network.ClientPlayer;
|
||||
import game.network.IClientPlayer;
|
||||
import game.network.Packet;
|
||||
import game.network.PacketBuffer;
|
||||
import game.world.World;
|
||||
|
||||
public class SPacketCamera implements Packet<ClientPlayer>
|
||||
public class SPacketCamera implements Packet<IClientPlayer>
|
||||
{
|
||||
public int entityId;
|
||||
|
||||
|
@ -31,7 +31,7 @@ public class SPacketCamera implements Packet<ClientPlayer>
|
|||
buf.writeVarIntToBuffer(this.entityId);
|
||||
}
|
||||
|
||||
public void processPacket(ClientPlayer handler)
|
||||
public void processPacket(IClientPlayer handler)
|
||||
{
|
||||
handler.handleCamera(this);
|
||||
}
|
||||
|
|
|
@ -8,13 +8,13 @@ import java.util.Map.Entry;
|
|||
import game.collect.Maps;
|
||||
import game.entity.npc.Alignment;
|
||||
import game.entity.npc.PlayerCharacter;
|
||||
import game.network.ClientPlayer;
|
||||
import game.network.IClientPlayer;
|
||||
import game.network.IPlayer;
|
||||
import game.network.Packet;
|
||||
import game.network.PacketBuffer;
|
||||
import game.network.Player;
|
||||
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 int selected;
|
||||
|
@ -43,12 +43,12 @@ public class SPacketCharacterList implements Packet<ClientPlayer> {
|
|||
int n = buf.readVarIntFromBuffer();
|
||||
for(int z = 0; z < n; z++) {
|
||||
int id = buf.readVarIntFromBuffer();
|
||||
String name = buf.readStringFromBuffer(Player.MAX_NICK_LENGTH);
|
||||
String name = buf.readStringFromBuffer(IPlayer.MAX_NICK_LENGTH);
|
||||
if(name.isEmpty()) {
|
||||
this.players.put(id, null);
|
||||
continue;
|
||||
}
|
||||
String info = buf.readStringFromBuffer(Player.MAX_INFO_LENGTH);
|
||||
String info = buf.readStringFromBuffer(IPlayer.MAX_INFO_LENGTH);
|
||||
info = info.isEmpty() ? null : info;
|
||||
Alignment align = buf.readEnumValue(Alignment.class);
|
||||
String dim = buf.readStringFromBuffer(256);
|
||||
|
@ -80,7 +80,7 @@ public class SPacketCharacterList implements Packet<ClientPlayer> {
|
|||
buf.writeVarIntToBuffer(this.selected);
|
||||
}
|
||||
|
||||
public void processPacket(ClientPlayer handler) {
|
||||
public void processPacket(IClientPlayer handler) {
|
||||
handler.handleCharacterList(this);
|
||||
}
|
||||
|
||||
|
|
|
@ -4,13 +4,13 @@ import java.io.IOException;
|
|||
import java.util.List;
|
||||
|
||||
import game.collect.Lists;
|
||||
import game.network.ClientPlayer;
|
||||
import game.network.IClientPlayer;
|
||||
import game.network.Packet;
|
||||
import game.network.PacketBuffer;
|
||||
import game.world.BlockArray;
|
||||
import game.world.Chunk;
|
||||
|
||||
public class SPacketChunkData implements Packet<ClientPlayer>
|
||||
public class SPacketChunkData implements Packet<IClientPlayer>
|
||||
{
|
||||
private int chunkX;
|
||||
private int chunkZ;
|
||||
|
@ -57,7 +57,7 @@ public class SPacketChunkData implements Packet<ClientPlayer>
|
|||
/**
|
||||
* Passes this Packet on to the NetHandler for processing.
|
||||
*/
|
||||
public void processPacket(ClientPlayer handler)
|
||||
public void processPacket(IClientPlayer handler)
|
||||
{
|
||||
handler.handleChunkData(this);
|
||||
}
|
||||
|
|
|
@ -2,11 +2,11 @@ package game.packet;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
import game.network.ClientPlayer;
|
||||
import game.network.IClientPlayer;
|
||||
import game.network.Packet;
|
||||
import game.network.PacketBuffer;
|
||||
|
||||
public class SPacketCollectItem implements Packet<ClientPlayer>
|
||||
public class SPacketCollectItem implements Packet<IClientPlayer>
|
||||
{
|
||||
private int collectedItemEntityId;
|
||||
private int entityId;
|
||||
|
@ -42,7 +42,7 @@ public class SPacketCollectItem implements Packet<ClientPlayer>
|
|||
/**
|
||||
* Passes this Packet on to the NetHandler for processing.
|
||||
*/
|
||||
public void processPacket(ClientPlayer handler)
|
||||
public void processPacket(IClientPlayer handler)
|
||||
{
|
||||
handler.handleCollectItem(this);
|
||||
}
|
||||
|
|
|
@ -2,11 +2,11 @@ package game.packet;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
import game.network.ClientPlayer;
|
||||
import game.network.IClientPlayer;
|
||||
import game.network.Packet;
|
||||
import game.network.PacketBuffer;
|
||||
|
||||
public class SPacketDestroyEntities implements Packet<ClientPlayer>
|
||||
public class SPacketDestroyEntities implements Packet<IClientPlayer>
|
||||
{
|
||||
private int[] entityIDs;
|
||||
|
||||
|
@ -48,7 +48,7 @@ public class SPacketDestroyEntities implements Packet<ClientPlayer>
|
|||
/**
|
||||
* Passes this Packet on to the NetHandler for processing.
|
||||
*/
|
||||
public void processPacket(ClientPlayer handler)
|
||||
public void processPacket(IClientPlayer handler)
|
||||
{
|
||||
handler.handleDestroyEntities(this);
|
||||
}
|
||||
|
|
|
@ -3,11 +3,11 @@ package game.packet;
|
|||
import java.io.IOException;
|
||||
|
||||
import game.dimension.Dimension;
|
||||
import game.network.ClientPlayer;
|
||||
import game.network.IClientPlayer;
|
||||
import game.network.Packet;
|
||||
import game.network.PacketBuffer;
|
||||
|
||||
public class SPacketDimensionName implements Packet<ClientPlayer> {
|
||||
public class SPacketDimensionName implements Packet<IClientPlayer> {
|
||||
private String fullName;
|
||||
private String customName;
|
||||
|
||||
|
@ -20,7 +20,7 @@ public class SPacketDimensionName implements Packet<ClientPlayer> {
|
|||
dim.getCustomName();
|
||||
}
|
||||
|
||||
public void processPacket(ClientPlayer handler) {
|
||||
public void processPacket(IClientPlayer handler) {
|
||||
handler.handleDimName(this);
|
||||
}
|
||||
|
||||
|
|
|
@ -2,11 +2,11 @@ package game.packet;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
import game.network.ClientPlayer;
|
||||
import game.network.IClientPlayer;
|
||||
import game.network.Packet;
|
||||
import game.network.PacketBuffer;
|
||||
|
||||
public class SPacketDisconnect implements Packet<ClientPlayer>
|
||||
public class SPacketDisconnect implements Packet<IClientPlayer>
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
|
|
@ -3,11 +3,11 @@ package game.packet;
|
|||
import java.io.IOException;
|
||||
|
||||
import game.item.ItemStack;
|
||||
import game.network.ClientPlayer;
|
||||
import game.network.IClientPlayer;
|
||||
import game.network.Packet;
|
||||
import game.network.PacketBuffer;
|
||||
|
||||
public class SPacketEntityEquipment implements Packet<ClientPlayer>
|
||||
public class SPacketEntityEquipment implements Packet<IClientPlayer>
|
||||
{
|
||||
private int entityID;
|
||||
private int equipmentSlot;
|
||||
|
@ -47,7 +47,7 @@ public class SPacketEntityEquipment implements Packet<ClientPlayer>
|
|||
/**
|
||||
* Passes this Packet on to the NetHandler for processing.
|
||||
*/
|
||||
public void processPacket(ClientPlayer handler)
|
||||
public void processPacket(IClientPlayer handler)
|
||||
{
|
||||
handler.handleEntityEquipment(this);
|
||||
}
|
||||
|
|
|
@ -3,11 +3,11 @@ package game.packet;
|
|||
import java.io.IOException;
|
||||
|
||||
import game.entity.Entity;
|
||||
import game.network.ClientPlayer;
|
||||
import game.network.IClientPlayer;
|
||||
import game.network.Packet;
|
||||
import game.network.PacketBuffer;
|
||||
|
||||
public class SPacketEntityVelocity implements Packet<ClientPlayer>
|
||||
public class SPacketEntityVelocity implements Packet<IClientPlayer>
|
||||
{
|
||||
private int entityID;
|
||||
private int motionX;
|
||||
|
@ -88,7 +88,7 @@ public class SPacketEntityVelocity implements Packet<ClientPlayer>
|
|||
/**
|
||||
* Passes this Packet on to the NetHandler for processing.
|
||||
*/
|
||||
public void processPacket(ClientPlayer handler)
|
||||
public void processPacket(IClientPlayer handler)
|
||||
{
|
||||
handler.handleEntityVelocity(this);
|
||||
}
|
||||
|
|
|
@ -2,11 +2,11 @@ package game.packet;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
import game.network.ClientPlayer;
|
||||
import game.network.IClientPlayer;
|
||||
import game.network.Packet;
|
||||
import game.network.PacketBuffer;
|
||||
|
||||
public class SPacketHeldItemChange implements Packet<ClientPlayer>
|
||||
public class SPacketHeldItemChange implements Packet<IClientPlayer>
|
||||
{
|
||||
private int heldItemHotbarIndex;
|
||||
|
||||
|
@ -38,7 +38,7 @@ public class SPacketHeldItemChange implements Packet<ClientPlayer>
|
|||
/**
|
||||
* Passes this Packet on to the NetHandler for processing.
|
||||
*/
|
||||
public void processPacket(ClientPlayer handler)
|
||||
public void processPacket(IClientPlayer handler)
|
||||
{
|
||||
handler.handleHeldItemChange(this);
|
||||
}
|
||||
|
|
|
@ -4,11 +4,11 @@ import java.io.IOException;
|
|||
|
||||
import game.dimension.Dimension;
|
||||
import game.nbt.NBTTagCompound;
|
||||
import game.network.ClientPlayer;
|
||||
import game.network.IClientPlayer;
|
||||
import game.network.Packet;
|
||||
import game.network.PacketBuffer;
|
||||
|
||||
public class SPacketJoinGame implements Packet<ClientPlayer> {
|
||||
public class SPacketJoinGame implements Packet<IClientPlayer> {
|
||||
private int entityId;
|
||||
private NBTTagCompound dimension;
|
||||
private int type;
|
||||
|
@ -38,7 +38,7 @@ public class SPacketJoinGame implements Packet<ClientPlayer> {
|
|||
buf.writeBoolean(this.editor);
|
||||
}
|
||||
|
||||
public void processPacket(ClientPlayer handler) {
|
||||
public void processPacket(IClientPlayer handler) {
|
||||
handler.handleJoinGame(this);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
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()
|
||||
{
|
||||
|
@ -13,7 +13,7 @@ public class SPacketKeepAlive extends APacketVarInt<ClientPlayer>
|
|||
super(key);
|
||||
}
|
||||
|
||||
public void processPacket(ClientPlayer handler)
|
||||
public void processPacket(IClientPlayer handler)
|
||||
{
|
||||
handler.handleKeepAlive(this);
|
||||
}
|
||||
|
|
|
@ -2,11 +2,11 @@ package game.packet;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
import game.network.ClientPlayer;
|
||||
import game.network.IClientPlayer;
|
||||
import game.network.Packet;
|
||||
import game.network.PacketBuffer;
|
||||
|
||||
public class SPacketLoading implements Packet<ClientPlayer> {
|
||||
public class SPacketLoading implements Packet<IClientPlayer> {
|
||||
private String message;
|
||||
private String task;
|
||||
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);
|
||||
}
|
||||
|
||||
|
|
|
@ -3,12 +3,12 @@ package game.packet;
|
|||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import game.network.ClientPlayer;
|
||||
import game.network.IClientPlayer;
|
||||
import game.network.Packet;
|
||||
import game.network.PacketBuffer;
|
||||
import game.world.Chunk;
|
||||
|
||||
public class SPacketMapChunkBulk implements Packet<ClientPlayer>
|
||||
public class SPacketMapChunkBulk implements Packet<IClientPlayer>
|
||||
{
|
||||
private int[] xPositions;
|
||||
private int[] zPositions;
|
||||
|
@ -87,7 +87,7 @@ public class SPacketMapChunkBulk implements Packet<ClientPlayer>
|
|||
/**
|
||||
* Passes this Packet on to the NetHandler for processing.
|
||||
*/
|
||||
public void processPacket(ClientPlayer handler)
|
||||
public void processPacket(IClientPlayer handler)
|
||||
{
|
||||
handler.handleMapChunkBulk(this);
|
||||
}
|
||||
|
|
|
@ -2,11 +2,11 @@ package game.packet;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
import game.network.ClientPlayer;
|
||||
import game.network.IClientPlayer;
|
||||
import game.network.Packet;
|
||||
import game.network.PacketBuffer;
|
||||
|
||||
public class SPacketMessage implements Packet<ClientPlayer> {
|
||||
public class SPacketMessage implements Packet<IClientPlayer> {
|
||||
public static enum Type {
|
||||
CONSOLE, CHAT, FEED, HOTBAR;
|
||||
}
|
||||
|
@ -32,7 +32,7 @@ public class SPacketMessage implements Packet<ClientPlayer> {
|
|||
buf.writeEnumValue(this.type);
|
||||
}
|
||||
|
||||
public void processPacket(ClientPlayer handler) {
|
||||
public void processPacket(IClientPlayer handler) {
|
||||
handler.handleMessage(this);
|
||||
}
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ package game.packet;
|
|||
import java.io.IOException;
|
||||
|
||||
import game.init.BlockRegistry;
|
||||
import game.network.ClientPlayer;
|
||||
import game.network.IClientPlayer;
|
||||
import game.network.Packet;
|
||||
import game.network.PacketBuffer;
|
||||
import game.world.BlockPos;
|
||||
|
@ -11,7 +11,7 @@ import game.world.Chunk;
|
|||
import game.world.ChunkPos;
|
||||
import game.world.State;
|
||||
|
||||
public class SPacketMultiBlockChange implements Packet<ClientPlayer>
|
||||
public class SPacketMultiBlockChange implements Packet<IClientPlayer>
|
||||
{
|
||||
private ChunkPos chunkPosCoord;
|
||||
private SPacketMultiBlockChange.BlockUpdateData[] changedBlocks;
|
||||
|
@ -64,7 +64,7 @@ public class SPacketMultiBlockChange implements Packet<ClientPlayer>
|
|||
/**
|
||||
* Passes this Packet on to the NetHandler for processing.
|
||||
*/
|
||||
public void processPacket(ClientPlayer handler)
|
||||
public void processPacket(IClientPlayer handler)
|
||||
{
|
||||
handler.handleMultiBlockChange(this);
|
||||
}
|
||||
|
|
|
@ -4,11 +4,11 @@ import java.io.IOException;
|
|||
import java.util.EnumSet;
|
||||
import java.util.Set;
|
||||
|
||||
import game.network.ClientPlayer;
|
||||
import game.network.IClientPlayer;
|
||||
import game.network.Packet;
|
||||
import game.network.PacketBuffer;
|
||||
|
||||
public class SPacketPlayerPosLook implements Packet<ClientPlayer>
|
||||
public class SPacketPlayerPosLook implements Packet<IClientPlayer>
|
||||
{
|
||||
private double x;
|
||||
private double y;
|
||||
|
@ -60,7 +60,7 @@ public class SPacketPlayerPosLook implements Packet<ClientPlayer>
|
|||
/**
|
||||
* Passes this Packet on to the NetHandler for processing.
|
||||
*/
|
||||
public void processPacket(ClientPlayer handler)
|
||||
public void processPacket(IClientPlayer handler)
|
||||
{
|
||||
handler.handlePlayerPosLook(this);
|
||||
}
|
||||
|
|
|
@ -4,11 +4,11 @@ import java.io.IOException;
|
|||
|
||||
import game.dimension.Dimension;
|
||||
import game.nbt.NBTTagCompound;
|
||||
import game.network.ClientPlayer;
|
||||
import game.network.IClientPlayer;
|
||||
import game.network.Packet;
|
||||
import game.network.PacketBuffer;
|
||||
|
||||
public class SPacketRespawn implements Packet<ClientPlayer>
|
||||
public class SPacketRespawn implements Packet<IClientPlayer>
|
||||
{
|
||||
private NBTTagCompound dimension;
|
||||
private int type;
|
||||
|
@ -25,7 +25,7 @@ public class SPacketRespawn implements Packet<ClientPlayer>
|
|||
this.editor = editor;
|
||||
}
|
||||
|
||||
public void processPacket(ClientPlayer handler)
|
||||
public void processPacket(IClientPlayer handler)
|
||||
{
|
||||
handler.handleRespawn(this);
|
||||
}
|
||||
|
|
|
@ -2,11 +2,11 @@ package game.packet;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
import game.network.ClientPlayer;
|
||||
import game.network.IClientPlayer;
|
||||
import game.network.Packet;
|
||||
import game.network.PacketBuffer;
|
||||
|
||||
public class SPacketServerTick implements Packet<ClientPlayer> {
|
||||
public class SPacketServerTick implements Packet<IClientPlayer> {
|
||||
private int time;
|
||||
|
||||
public SPacketServerTick() {
|
||||
|
@ -24,7 +24,7 @@ public class SPacketServerTick implements Packet<ClientPlayer> {
|
|||
buf.writeInt(this.time);
|
||||
}
|
||||
|
||||
public void processPacket(ClientPlayer handler) {
|
||||
public void processPacket(IClientPlayer handler) {
|
||||
handler.handleServerTick(this);
|
||||
}
|
||||
|
||||
|
|
|
@ -2,11 +2,11 @@ package game.packet;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
import game.network.ClientPlayer;
|
||||
import game.network.IClientPlayer;
|
||||
import game.network.Packet;
|
||||
import game.network.PacketBuffer;
|
||||
|
||||
public class SPacketSetExperience implements Packet<ClientPlayer>
|
||||
public class SPacketSetExperience implements Packet<IClientPlayer>
|
||||
{
|
||||
private float progress;
|
||||
private int totalExperience;
|
||||
|
@ -46,7 +46,7 @@ public class SPacketSetExperience implements Packet<ClientPlayer>
|
|||
/**
|
||||
* Passes this Packet on to the NetHandler for processing.
|
||||
*/
|
||||
public void processPacket(ClientPlayer handler)
|
||||
public void processPacket(IClientPlayer handler)
|
||||
{
|
||||
handler.handleSetExperience(this);
|
||||
}
|
||||
|
|
|
@ -4,12 +4,12 @@ import java.io.IOException;
|
|||
|
||||
import client.renderer.texture.EntityTexManager;
|
||||
import game.entity.Entity;
|
||||
import game.network.ClientPlayer;
|
||||
import game.network.IClientPlayer;
|
||||
import game.network.Packet;
|
||||
import game.network.PacketBuffer;
|
||||
import game.world.World;
|
||||
|
||||
public class SPacketSkin implements Packet<ClientPlayer>
|
||||
public class SPacketSkin implements Packet<IClientPlayer>
|
||||
{
|
||||
private int id;
|
||||
// private ModelType model;
|
||||
|
@ -58,7 +58,7 @@ public class SPacketSkin implements Packet<ClientPlayer>
|
|||
buf.writeByteArray(this.texture == null ? new byte[0] : this.texture);
|
||||
}
|
||||
|
||||
public void processPacket(ClientPlayer handler)
|
||||
public void processPacket(IClientPlayer handler)
|
||||
{
|
||||
handler.handleSkin(this);
|
||||
}
|
||||
|
|
|
@ -6,12 +6,12 @@ import java.util.List;
|
|||
import game.entity.DataWatcher;
|
||||
import game.entity.types.EntityLiving;
|
||||
import game.init.EntityRegistry;
|
||||
import game.network.ClientPlayer;
|
||||
import game.network.IClientPlayer;
|
||||
import game.network.Packet;
|
||||
import game.network.PacketBuffer;
|
||||
import game.util.ExtMath;
|
||||
|
||||
public class SPacketSpawnMob implements Packet<ClientPlayer>
|
||||
public class SPacketSpawnMob implements Packet<IClientPlayer>
|
||||
{
|
||||
private int entityId;
|
||||
private int type;
|
||||
|
@ -114,7 +114,7 @@ public class SPacketSpawnMob implements Packet<ClientPlayer>
|
|||
this.writeWatcher.writeTo(buf);
|
||||
}
|
||||
|
||||
public void processPacket(ClientPlayer handler)
|
||||
public void processPacket(IClientPlayer handler)
|
||||
{
|
||||
handler.handleSpawnMob(this);
|
||||
}
|
||||
|
|
|
@ -7,14 +7,14 @@ import game.entity.item.EntityLeashKnot;
|
|||
import game.entity.projectile.EntityProjectile;
|
||||
import game.entity.types.IObjectData;
|
||||
import game.init.EntityRegistry;
|
||||
import game.network.ClientPlayer;
|
||||
import game.network.IClientPlayer;
|
||||
import game.network.Packet;
|
||||
import game.network.PacketBuffer;
|
||||
import game.util.ExtMath;
|
||||
import game.world.BlockPos;
|
||||
import game.world.Vec3;
|
||||
|
||||
public class SPacketSpawnObject implements Packet<ClientPlayer>
|
||||
public class SPacketSpawnObject implements Packet<IClientPlayer>
|
||||
{
|
||||
private int entityId;
|
||||
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);
|
||||
}
|
||||
|
|
|
@ -9,12 +9,12 @@ import game.entity.npc.EntityNPC;
|
|||
import game.init.EntityRegistry;
|
||||
import game.init.ItemRegistry;
|
||||
import game.item.ItemStack;
|
||||
import game.network.ClientPlayer;
|
||||
import game.network.IClientPlayer;
|
||||
import game.network.Packet;
|
||||
import game.network.PacketBuffer;
|
||||
import game.util.ExtMath;
|
||||
|
||||
public class SPacketSpawnPlayer implements Packet<ClientPlayer>
|
||||
public class SPacketSpawnPlayer implements Packet<IClientPlayer>
|
||||
{
|
||||
private int entityId;
|
||||
private int type;
|
||||
|
@ -90,7 +90,7 @@ public class SPacketSpawnPlayer implements Packet<ClientPlayer>
|
|||
/**
|
||||
* Passes this Packet on to the NetHandler for processing.
|
||||
*/
|
||||
public void processPacket(ClientPlayer handler)
|
||||
public void processPacket(IClientPlayer handler)
|
||||
{
|
||||
handler.handleSpawnPlayer(this);
|
||||
}
|
||||
|
|
|
@ -2,11 +2,11 @@ package game.packet;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
import game.network.ClientPlayer;
|
||||
import game.network.IClientPlayer;
|
||||
import game.network.Packet;
|
||||
import game.network.PacketBuffer;
|
||||
|
||||
public class SPacketTimeUpdate implements Packet<ClientPlayer> {
|
||||
public class SPacketTimeUpdate implements Packet<IClientPlayer> {
|
||||
private long worldTime;
|
||||
private String serverInfo;
|
||||
|
||||
|
@ -28,7 +28,7 @@ public class SPacketTimeUpdate implements Packet<ClientPlayer> {
|
|||
buf.writeString(this.serverInfo);
|
||||
}
|
||||
|
||||
public void processPacket(ClientPlayer handler) {
|
||||
public void processPacket(IClientPlayer handler) {
|
||||
handler.handleTimeUpdate(this);
|
||||
}
|
||||
|
||||
|
|
|
@ -3,13 +3,13 @@ package game.packet;
|
|||
import java.io.IOException;
|
||||
|
||||
import game.item.ItemStack;
|
||||
import game.network.ClientPlayer;
|
||||
import game.network.IClientPlayer;
|
||||
import game.network.Packet;
|
||||
import game.network.PacketBuffer;
|
||||
import game.village.MerchantRecipe;
|
||||
import game.village.MerchantRecipeList;
|
||||
|
||||
public class SPacketTrades implements Packet<ClientPlayer>
|
||||
public class SPacketTrades implements Packet<IClientPlayer>
|
||||
{
|
||||
private MerchantRecipeList recipes;
|
||||
private int windowId;
|
||||
|
@ -88,7 +88,7 @@ public class SPacketTrades implements Packet<ClientPlayer>
|
|||
/**
|
||||
* Passes this Packet on to the NetHandler for processing.
|
||||
*/
|
||||
public void processPacket(ClientPlayer handler)
|
||||
public void processPacket(IClientPlayer handler)
|
||||
{
|
||||
handler.handleTrades(this);
|
||||
}
|
||||
|
|
|
@ -2,11 +2,11 @@ package game.packet;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
import game.network.ClientPlayer;
|
||||
import game.network.IClientPlayer;
|
||||
import game.network.Packet;
|
||||
import game.network.PacketBuffer;
|
||||
|
||||
public class SPacketUpdateHealth implements Packet<ClientPlayer> {
|
||||
public class SPacketUpdateHealth implements Packet<IClientPlayer> {
|
||||
private int health;
|
||||
|
||||
public SPacketUpdateHealth() {
|
||||
|
@ -24,7 +24,7 @@ public class SPacketUpdateHealth implements Packet<ClientPlayer> {
|
|||
buf.writeInt(this.health);
|
||||
}
|
||||
|
||||
public void processPacket(ClientPlayer handler) {
|
||||
public void processPacket(IClientPlayer handler) {
|
||||
handler.handleUpdateHealth(this);
|
||||
}
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue