mirror of
https://github.com/GTNewHorizons/Opis.git
synced 2026-11-19 19:59:37 +00:00
Fixed chat msgs.
This commit is contained in:
1 parent
8ad6c20ebe
commit
ebf4635e99
39 files changed
+190
-189
No files matched your search
@@ -3,7 +3,6 @@ package mcp.mobius.opis.commands.client;
|
||||
import javax.swing.JFrame;
|
||||
import javax.swing.JLabel;
|
||||
|
||||
import cpw.mods.fml.common.network.Player;
|
||||
import mcp.mobius.opis.events.PlayerTracker;
|
||||
import mcp.mobius.opis.network.ServerMessageHandler;
|
||||
import mcp.mobius.opis.network.OpisPacketHandler_OLD;
|
||||
@@ -13,7 +12,7 @@ import net.minecraft.command.CommandBase;
|
||||
import net.minecraft.command.ICommandSender;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.util.ChatMessageComponent;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
|
||||
public class CommandOpis extends CommandBase {
|
||||
|
||||
@@ -29,21 +28,21 @@ public class CommandOpis extends CommandBase {
|
||||
|
||||
@Override
|
||||
public void processCommand(ICommandSender icommandsender, String[] astring) {
|
||||
if (!(icommandsender instanceof Player)){
|
||||
icommandsender.sendChatToPlayer(ChatMessageComponent.createFromText("You are not a normal client and can't open the Swing interface."));
|
||||
if (!(icommandsender instanceof EntityPlayerMP)){
|
||||
icommandsender.addChatMessage(new ChatComponentText("You are not a normal client and can't open the Swing interface."));
|
||||
return;
|
||||
}
|
||||
|
||||
if (!Message.COMMAND_OPEN_SWING.canPlayerUseCommand((Player)icommandsender)){
|
||||
icommandsender.sendChatToPlayer(ChatMessageComponent.createFromText("Your access level prevents you from doing that."));
|
||||
if (!Message.COMMAND_OPEN_SWING.canPlayerUseCommand((EntityPlayerMP)icommandsender)){
|
||||
icommandsender.addChatMessage(new ChatComponentText("Your access level prevents you from doing that."));
|
||||
return;
|
||||
}
|
||||
|
||||
PlayerTracker.instance().playersSwing.add((Player)icommandsender);
|
||||
PlayerTracker.INSTANCE.playersSwing.add((EntityPlayerMP)icommandsender);
|
||||
//((EntityPlayerMP)icommandsender).playerNetServerHandler.sendPacketToPlayer(NetDataCommand.create(Message.CLIENT_SHOW_SWING));
|
||||
if (icommandsender instanceof Player)
|
||||
OpisPacketHandler_OLD.validateAndSend(NetDataCommand_OLD.create(Message.CLIENT_SHOW_SWING), (Player)icommandsender);
|
||||
OpisPacketHandler_OLD.sendFullUpdate((Player)icommandsender);
|
||||
if (icommandsender instanceof EntityPlayerMP)
|
||||
OpisPacketHandler_OLD.validateAndSend(NetDataCommand_OLD.create(Message.CLIENT_SHOW_SWING), (EntityPlayerMP)icommandsender);
|
||||
OpisPacketHandler_OLD.sendFullUpdate((EntityPlayerMP)icommandsender);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -6,6 +6,7 @@ import net.minecraft.command.CommandBase;
|
||||
import net.minecraft.command.ICommandSender;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.server.dedicated.DedicatedServer;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
|
||||
|
||||
public class CommandAddPrivileged extends CommandBase implements IOpisCommand{
|
||||
@@ -22,8 +23,8 @@ public class CommandAddPrivileged extends CommandBase implements IOpisCommand{
|
||||
|
||||
@Override
|
||||
public void processCommand(ICommandSender icommandsender, String[] astring) {
|
||||
PlayerTracker.instance().addPrivilegedPlayer(astring[0]);
|
||||
icommandsender.sendChatToPlayer(ChatMessageComponent.createFromText(String.format("Player %s added to Opis user list", astring[0])));
|
||||
PlayerTracker.INSTANCE.addPrivilegedPlayer(astring[0]);
|
||||
icommandsender.addChatMessage(new ChatComponentText(String.format("Player %s added to Opis user list", astring[0])));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -38,7 +39,7 @@ public class CommandAddPrivileged extends CommandBase implements IOpisCommand{
|
||||
if (sender instanceof DedicatedServer) return true;
|
||||
if ((sender instanceof EntityPlayerMP) && ((EntityPlayerMP)sender).playerNetServerHandler.netManager instanceof MemoryConnection) return true;
|
||||
if (!(sender instanceof DedicatedServer) && !(sender instanceof EntityPlayerMP)) return true;
|
||||
return PlayerTracker.instance().isAdmin(((EntityPlayerMP)sender).username);
|
||||
return PlayerTracker.INSTANCE.isAdmin(((EntityPlayerMP)sender).getDisplayName());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -3,7 +3,6 @@ package mcp.mobius.opis.commands.server;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
||||
import cpw.mods.fml.common.network.Player;
|
||||
import mcp.mobius.opis.commands.IOpisCommand;
|
||||
import mcp.mobius.opis.data.holders.basetypes.AmountHolder;
|
||||
import mcp.mobius.opis.data.managers.EntityManager;
|
||||
@@ -15,11 +14,10 @@ import net.minecraft.command.CommandBase;
|
||||
import net.minecraft.command.ICommandSender;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.network.MemoryConnection;
|
||||
import net.minecraft.network.rcon.RConConsoleSource;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.server.dedicated.DedicatedServer;
|
||||
import net.minecraft.util.ChatMessageComponent;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
|
||||
public class CommandAmountEntities extends CommandBase implements IOpisCommand{
|
||||
|
||||
@@ -40,8 +38,8 @@ public class CommandAmountEntities extends CommandBase implements IOpisCommand{
|
||||
|
||||
@Override
|
||||
public void processCommand(ICommandSender icommandsender, String[] astring) {
|
||||
if (icommandsender instanceof Player){
|
||||
icommandsender.sendChatToPlayer(ChatMessageComponent.createFromText("DEPRECATED ! Please run /opis instead."));
|
||||
if (icommandsender instanceof EntityPlayerMP){
|
||||
icommandsender.addChatMessage(new ChatComponentText("DEPRECATED ! Please run /opis instead."));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -54,7 +52,7 @@ public class CommandAmountEntities extends CommandBase implements IOpisCommand{
|
||||
ents = EntityManager.INSTANCE.getCumulativeEntities(true);
|
||||
|
||||
for (AmountHolder s : ents)
|
||||
icommandsender.sendChatToPlayer(ChatMessageComponent.createFromText(String.format("%s : %s", s.key, s.value)));
|
||||
icommandsender.addChatMessage(new ChatComponentText(String.format("%s : %s", s.key, s.value)));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -2,7 +2,6 @@ package mcp.mobius.opis.commands.server;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import cpw.mods.fml.common.network.Player;
|
||||
import mcp.mobius.opis.commands.IOpisCommand;
|
||||
import mcp.mobius.opis.data.holders.stats.StatsChunk;
|
||||
import mcp.mobius.opis.data.managers.ChunkManager;
|
||||
@@ -14,10 +13,9 @@ import net.minecraft.command.CommandBase;
|
||||
import net.minecraft.command.ICommandSender;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.network.MemoryConnection;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.server.dedicated.DedicatedServer;
|
||||
import net.minecraft.util.ChatMessageComponent;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
|
||||
public class CommandChunkList extends CommandBase implements IOpisCommand {
|
||||
|
||||
@@ -38,8 +36,8 @@ public class CommandChunkList extends CommandBase implements IOpisCommand {
|
||||
|
||||
@Override
|
||||
public void processCommand(ICommandSender icommandsender, String[] astring) {
|
||||
if (icommandsender instanceof Player){
|
||||
icommandsender.sendChatToPlayer(ChatMessageComponent.createFromText("DEPRECATED ! Please run /opis instead."));
|
||||
if (icommandsender instanceof EntityPlayerMP){
|
||||
icommandsender.addChatMessage(new ChatComponentText("DEPRECATED ! Please run /opis instead."));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -52,9 +50,9 @@ public class CommandChunkList extends CommandBase implements IOpisCommand {
|
||||
chunks = ChunkManager.INSTANCE.getTopChunks(Integer.valueOf(astring.length));
|
||||
}catch (Exception e){return;}
|
||||
|
||||
icommandsender.sendChatToPlayer(ChatMessageComponent.createFromText("[DIM X Z] Time NTEs"));
|
||||
icommandsender.addChatMessage(new ChatComponentText("[DIM X Z] Time NTEs"));
|
||||
for (StatsChunk stat : chunks){
|
||||
icommandsender.sendChatToPlayer(ChatMessageComponent.createFromText(stat.toString()));
|
||||
icommandsender.addChatMessage(new ChatComponentText(stat.toString()));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -5,10 +5,9 @@ import mcp.mobius.opis.events.PlayerTracker;
|
||||
import net.minecraft.command.CommandBase;
|
||||
import net.minecraft.command.ICommandSender;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.network.MemoryConnection;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.server.dedicated.DedicatedServer;
|
||||
import net.minecraft.util.ChatMessageComponent;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
|
||||
public class CommandEntityCreate extends CommandBase {
|
||||
|
||||
@@ -34,7 +33,7 @@ public class CommandEntityCreate extends CommandBase {
|
||||
OpisServerEventHandler.printEntityFull = false;
|
||||
}
|
||||
|
||||
icommandsender.sendChatToPlayer(ChatMessageComponent.createFromText(String.format("Entity trace is %s", OpisServerEventHandler.printEntityTrace)));
|
||||
icommandsender.addChatMessage(new ChatComponentText(String.format("Entity trace is %s", OpisServerEventHandler.printEntityTrace)));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -49,7 +48,7 @@ public class CommandEntityCreate extends CommandBase {
|
||||
if (sender instanceof DedicatedServer) return true;
|
||||
if ((sender instanceof EntityPlayerMP) && ((EntityPlayerMP)sender).playerNetServerHandler.netManager instanceof MemoryConnection) return true;
|
||||
if (!(sender instanceof DedicatedServer) && !(sender instanceof EntityPlayerMP)) return true;
|
||||
return PlayerTracker.instance().isPrivileged(((EntityPlayerMP)sender).username);
|
||||
return PlayerTracker.INSTANCE.isPrivileged(((EntityPlayerMP)sender).getDisplayName());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,7 +1,5 @@
|
||||
package mcp.mobius.opis.commands.server;
|
||||
|
||||
import cpw.mods.fml.common.network.PacketDispatcher;
|
||||
import cpw.mods.fml.common.network.Player;
|
||||
import mcp.mobius.opis.modOpis;
|
||||
import mcp.mobius.opis.commands.IOpisCommand;
|
||||
import mcp.mobius.opis.events.PlayerTracker;
|
||||
@@ -9,11 +7,9 @@ import net.minecraft.command.CommandBase;
|
||||
import net.minecraft.command.ICommandSender;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.network.MemoryConnection;
|
||||
import net.minecraft.network.packet.Packet3Chat;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.server.dedicated.DedicatedServer;
|
||||
import net.minecraft.util.ChatMessageComponent;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
|
||||
public class CommandFrequency extends CommandBase implements IOpisCommand {
|
||||
|
||||
@@ -37,7 +33,7 @@ public class CommandFrequency extends CommandBase implements IOpisCommand {
|
||||
if (astring.length < 1) return;
|
||||
try{
|
||||
modOpis.profilerDelay = Integer.valueOf(astring[0]);
|
||||
icommandsender.sendChatToPlayer(ChatMessageComponent.createFromText(String.format("\u00A7oOpis delay set to %s ticks.", astring[0])));
|
||||
icommandsender.addChatMessage(new ChatComponentText(String.format("\u00A7oOpis delay set to %s ticks.", astring[0])));
|
||||
|
||||
} catch (Exception e){}
|
||||
}
|
||||
@@ -54,7 +50,7 @@ public class CommandFrequency extends CommandBase implements IOpisCommand {
|
||||
if (sender instanceof DedicatedServer) return true;
|
||||
if ((sender instanceof EntityPlayerMP) && ((EntityPlayerMP)sender).playerNetServerHandler.netManager instanceof MemoryConnection) return true;
|
||||
if (!(sender instanceof DedicatedServer) && !(sender instanceof EntityPlayerMP)) return true;
|
||||
return PlayerTracker.instance().isPrivileged(((EntityPlayerMP)sender).username);
|
||||
return PlayerTracker.INSTANCE.isPrivileged(((EntityPlayerMP)sender).getDisplayName());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -4,7 +4,6 @@ import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
|
||||
import cpw.mods.fml.common.network.Player;
|
||||
import mcp.mobius.opis.commands.IOpisCommand;
|
||||
import mcp.mobius.opis.data.holders.newtypes.DataHandler;
|
||||
import mcp.mobius.opis.data.managers.TickHandlerManager;
|
||||
@@ -15,10 +14,9 @@ import mcp.mobius.opis.network.packets.server.NetDataList_OLD;
|
||||
import net.minecraft.command.CommandBase;
|
||||
import net.minecraft.command.ICommandSender;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.network.MemoryConnection;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.server.dedicated.DedicatedServer;
|
||||
import net.minecraft.util.ChatMessageComponent;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
|
||||
public class CommandHandler extends CommandBase implements IOpisCommand {
|
||||
|
||||
@@ -39,15 +37,15 @@ public class CommandHandler extends CommandBase implements IOpisCommand {
|
||||
|
||||
@Override
|
||||
public void processCommand(ICommandSender icommandsender, String[] astring) {
|
||||
if (icommandsender instanceof Player){
|
||||
icommandsender.sendChatToPlayer(ChatMessageComponent.createFromText("DEPRECATED ! Please run /opis instead."));
|
||||
if (icommandsender instanceof EntityPlayerMP){
|
||||
icommandsender.addChatMessage(new ChatComponentText("DEPRECATED ! Please run /opis instead."));
|
||||
return;
|
||||
}
|
||||
|
||||
ArrayList<DataHandler> stats = TickHandlerManager.getCumulatedStatsServer();
|
||||
|
||||
for (DataHandler s : stats)
|
||||
icommandsender.sendChatToPlayer(ChatMessageComponent.createFromText(String.format("%s : %.2f", s.name, s.update.toString())));
|
||||
icommandsender.addChatMessage(new ChatComponentText(String.format("%s : %.2f", s.name, s.update.toString())));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,17 +1,13 @@
|
||||
package mcp.mobius.opis.commands.server;
|
||||
|
||||
import cpw.mods.fml.common.network.PacketDispatcher;
|
||||
import cpw.mods.fml.common.network.Player;
|
||||
import mcp.mobius.opis.commands.IOpisCommand;
|
||||
import net.minecraft.command.CommandBase;
|
||||
import net.minecraft.command.ICommandSender;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.network.MemoryConnection;
|
||||
import net.minecraft.network.packet.Packet3Chat;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.server.dedicated.DedicatedServer;
|
||||
import net.minecraft.util.ChatMessageComponent;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
|
||||
public class CommandHelp extends CommandBase implements IOpisCommand {
|
||||
|
||||
@@ -55,7 +51,7 @@ public class CommandHelp extends CommandBase implements IOpisCommand {
|
||||
};
|
||||
|
||||
for (IOpisCommand cmd : commands)
|
||||
icommandsender.sendChatToPlayer(ChatMessageComponent.createFromText(String.format("/%s : %s", cmd.getCommandNameOpis(), cmd.getDescription())));
|
||||
icommandsender.addChatMessage(new ChatComponentText(String.format("/%s : %s", cmd.getCommandNameOpis(), cmd.getDescription())));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,18 +1,14 @@
|
||||
package mcp.mobius.opis.commands.server;
|
||||
|
||||
import cpw.mods.fml.common.network.PacketDispatcher;
|
||||
import cpw.mods.fml.common.network.Player;
|
||||
import mcp.mobius.opis.commands.IOpisCommand;
|
||||
import mcp.mobius.opis.events.PlayerTracker;
|
||||
import net.minecraft.command.CommandBase;
|
||||
import net.minecraft.command.ICommandSender;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.network.MemoryConnection;
|
||||
import net.minecraft.network.packet.Packet3Chat;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.server.dedicated.DedicatedServer;
|
||||
import net.minecraft.util.ChatMessageComponent;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.DimensionManager;
|
||||
|
||||
@@ -41,18 +37,18 @@ public class CommandKill extends CommandBase implements IOpisCommand {
|
||||
|
||||
World world = DimensionManager.getWorld(dim);
|
||||
if (world == null){
|
||||
icommandsender.sendChatToPlayer(ChatMessageComponent.createFromText(String.format("\u00A7oCannot find dim %d in world %d", dim)));
|
||||
icommandsender.addChatMessage(new ChatComponentText(String.format("\u00A7oCannot find dim %d in world %d", dim)));
|
||||
return;
|
||||
}
|
||||
|
||||
Entity entity = world.getEntityByID(eid);
|
||||
if (entity == null) {
|
||||
icommandsender.sendChatToPlayer(ChatMessageComponent.createFromText(String.format("\u00A7oCannot find entity %d in dim %d", eid, dim)));
|
||||
icommandsender.addChatMessage(new ChatComponentText(String.format("\u00A7oCannot find entity %d in dim %d", eid, dim)));
|
||||
return;
|
||||
}
|
||||
|
||||
entity.setDead();
|
||||
icommandsender.sendChatToPlayer(ChatMessageComponent.createFromText(String.format("\u00A7oKilled entity %d in dim %d", eid, dim)));
|
||||
icommandsender.addChatMessage(new ChatComponentText(String.format("\u00A7oKilled entity %d in dim %d", eid, dim)));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -68,7 +64,7 @@ public class CommandKill extends CommandBase implements IOpisCommand {
|
||||
if (sender instanceof DedicatedServer) return true;
|
||||
if ((sender instanceof EntityPlayerMP) && ((EntityPlayerMP)sender).playerNetServerHandler.netManager instanceof MemoryConnection) return true;
|
||||
if (!(sender instanceof DedicatedServer) && !(sender instanceof EntityPlayerMP)) return true;
|
||||
return PlayerTracker.instance().isPrivileged(((EntityPlayerMP)sender).username);
|
||||
return PlayerTracker.INSTANCE.isPrivileged(((EntityPlayerMP)sender).getDisplayName());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -4,8 +4,6 @@ import java.util.ArrayList;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import cpw.mods.fml.common.network.PacketDispatcher;
|
||||
import cpw.mods.fml.common.network.Player;
|
||||
import mcp.mobius.opis.commands.IOpisCommand;
|
||||
import mcp.mobius.opis.data.managers.EntityManager;
|
||||
import mcp.mobius.opis.events.PlayerTracker;
|
||||
@@ -14,11 +12,9 @@ import net.minecraft.command.ICommandSender;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.network.MemoryConnection;
|
||||
import net.minecraft.network.packet.Packet3Chat;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.server.dedicated.DedicatedServer;
|
||||
import net.minecraft.util.ChatMessageComponent;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.DimensionManager;
|
||||
|
||||
@@ -48,11 +44,11 @@ public class CommandKillAll extends CommandBase implements IOpisCommand {
|
||||
int nkilled = EntityManager.INSTANCE.killAll(searchname);
|
||||
|
||||
if (nkilled == -1){
|
||||
icommandsender.sendChatToPlayer(ChatMessageComponent.createFromText(String.format("\u00A7oSeriously ? I can't, seriously, I can't. I should remove you from the OP list !")));
|
||||
icommandsender.addChatMessage(new ChatComponentText(String.format("\u00A7oSeriously ? I can't, seriously, I can't. I should remove you from the OP list !")));
|
||||
return;
|
||||
}
|
||||
|
||||
icommandsender.sendChatToPlayer(ChatMessageComponent.createFromText(String.format("\u00A7oKilled %d entities of type %s", nkilled, searchname)));
|
||||
icommandsender.addChatMessage(new ChatComponentText(String.format("\u00A7oKilled %d entities of type %s", nkilled, searchname)));
|
||||
|
||||
/*
|
||||
World world = DimensionManager.getWorld(dim);
|
||||
@@ -91,7 +87,7 @@ public class CommandKillAll extends CommandBase implements IOpisCommand {
|
||||
if (sender instanceof DedicatedServer) return true;
|
||||
if ((sender instanceof EntityPlayerMP) && ((EntityPlayerMP)sender).playerNetServerHandler.netManager instanceof MemoryConnection) return true;
|
||||
if (!(sender instanceof DedicatedServer) && !(sender instanceof EntityPlayerMP)) return true;
|
||||
return PlayerTracker.instance().isPrivileged(((EntityPlayerMP)sender).username);
|
||||
return PlayerTracker.INSTANCE.isPrivileged(((EntityPlayerMP)sender).getDisplayName());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package mcp.mobius.opis.commands.server;
|
||||
|
||||
import cpw.mods.fml.common.network.PacketDispatcher;
|
||||
import cpw.mods.fml.common.network.Player;
|
||||
import mcp.mobius.opis.modOpis;
|
||||
import mcp.mobius.opis.commands.IOpisCommand;
|
||||
import mcp.mobius.opis.data.managers.EntityManager;
|
||||
@@ -17,11 +15,9 @@ import net.minecraft.command.CommandBase;
|
||||
import net.minecraft.command.ICommandSender;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.network.MemoryConnection;
|
||||
import net.minecraft.network.packet.Packet3Chat;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.server.dedicated.DedicatedServer;
|
||||
import net.minecraft.util.ChatMessageComponent;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
|
||||
public class CommandReset extends CommandBase implements IOpisCommand {
|
||||
|
||||
@@ -44,11 +40,11 @@ public class CommandReset extends CommandBase implements IOpisCommand {
|
||||
public void processCommand(ICommandSender icommandsender, String[] astring) {
|
||||
MetaManager.reset();
|
||||
|
||||
icommandsender.sendChatToPlayer(ChatMessageComponent.createFromText(String.format("\u00A7oInternal data reseted.")));
|
||||
icommandsender.addChatMessage(new ChatComponentText(String.format("\u00A7oInternal data reseted.")));
|
||||
|
||||
//PacketDispatcher.sendPacketToAllPlayers(NetDataCommand.create(Message.CLIENT_CLEAR_SELECTION));
|
||||
if (icommandsender instanceof Player)
|
||||
OpisPacketHandler_OLD.validateAndSend(NetDataCommand_OLD.create(Message.CLIENT_CLEAR_SELECTION), (Player)icommandsender);
|
||||
if (icommandsender instanceof EntityPlayerMP)
|
||||
OpisPacketHandler_OLD.validateAndSend(NetDataCommand_OLD.create(Message.CLIENT_CLEAR_SELECTION), (EntityPlayerMP)icommandsender);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -63,7 +59,7 @@ public class CommandReset extends CommandBase implements IOpisCommand {
|
||||
if (sender instanceof DedicatedServer) return true;
|
||||
if ((sender instanceof EntityPlayerMP) && ((EntityPlayerMP)sender).playerNetServerHandler.netManager instanceof MemoryConnection) return true;
|
||||
if (!(sender instanceof DedicatedServer) && !(sender instanceof EntityPlayerMP)) return true;
|
||||
return PlayerTracker.instance().isPrivileged(((EntityPlayerMP)sender).username);
|
||||
return PlayerTracker.INSTANCE.isPrivileged(((EntityPlayerMP)sender).getDisplayName());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -5,9 +5,8 @@ import mcp.mobius.opis.events.PlayerTracker;
|
||||
import net.minecraft.command.CommandBase;
|
||||
import net.minecraft.command.ICommandSender;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.network.MemoryConnection;
|
||||
import net.minecraft.server.dedicated.DedicatedServer;
|
||||
import net.minecraft.util.ChatMessageComponent;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
|
||||
public class CommandRmPrivileged extends CommandBase implements IOpisCommand{
|
||||
|
||||
@@ -23,11 +22,11 @@ public class CommandRmPrivileged extends CommandBase implements IOpisCommand{
|
||||
|
||||
@Override
|
||||
public void processCommand(ICommandSender icommandsender, String[] astring) {
|
||||
if (PlayerTracker.instance().isPrivileged(astring[0])){
|
||||
PlayerTracker.instance().rmPrivilegedPlayer(astring[0]);
|
||||
icommandsender.sendChatToPlayer(ChatMessageComponent.createFromText(String.format("Player %s removed from Opis user list.", astring[0])));
|
||||
if (PlayerTracker.INSTANCE.isPrivileged(astring[0])){
|
||||
PlayerTracker.INSTANCE.rmPrivilegedPlayer(astring[0]);
|
||||
icommandsender.addChatMessage(new ChatComponentText(String.format("Player %s removed from Opis user list.", astring[0])));
|
||||
} else {
|
||||
icommandsender.sendChatToPlayer(ChatMessageComponent.createFromText(String.format("Player %s not found in list.", astring[0])));
|
||||
icommandsender.addChatMessage(new ChatComponentText(String.format("Player %s not found in list.", astring[0])));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,7 +42,7 @@ public class CommandRmPrivileged extends CommandBase implements IOpisCommand{
|
||||
if (sender instanceof DedicatedServer) return true;
|
||||
if ((sender instanceof EntityPlayerMP) && ((EntityPlayerMP)sender).playerNetServerHandler.netManager instanceof MemoryConnection) return true;
|
||||
if (!(sender instanceof DedicatedServer) && !(sender instanceof EntityPlayerMP)) return true;
|
||||
return PlayerTracker.instance().isAdmin(((EntityPlayerMP)sender).username);
|
||||
return PlayerTracker.INSTANCE.isAdmin(((EntityPlayerMP)sender).getDisplayName());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package mcp.mobius.opis.commands.server;
|
||||
|
||||
import cpw.mods.fml.common.network.PacketDispatcher;
|
||||
import cpw.mods.fml.common.network.Player;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import mcp.mobius.opis.modOpis;
|
||||
import mcp.mobius.opis.commands.IOpisCommand;
|
||||
@@ -19,11 +17,9 @@ import net.minecraft.command.CommandBase;
|
||||
import net.minecraft.command.ICommandSender;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.network.MemoryConnection;
|
||||
import net.minecraft.network.packet.Packet3Chat;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.server.dedicated.DedicatedServer;
|
||||
import net.minecraft.util.ChatMessageComponent;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import mcp.mobius.mobiuscore.profiler.ProfilerSection;
|
||||
|
||||
public class CommandStart extends CommandBase implements IOpisCommand {
|
||||
@@ -45,8 +41,8 @@ public class CommandStart extends CommandBase implements IOpisCommand {
|
||||
|
||||
@Override
|
||||
public void processCommand(ICommandSender icommandsender, String[] astring) {
|
||||
if (icommandsender instanceof Player){
|
||||
icommandsender.sendChatToPlayer(ChatMessageComponent.createFromText("DEPRECATED ! Please run /opis instead."));
|
||||
if (icommandsender instanceof EntityPlayerMP){
|
||||
icommandsender.addChatMessage(new ChatComponentText("DEPRECATED ! Please run /opis instead."));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -55,7 +51,7 @@ public class CommandStart extends CommandBase implements IOpisCommand {
|
||||
ProfilerSection.activateAll(Side.SERVER);
|
||||
|
||||
OpisPacketHandler_OLD.sendPacketToAllSwing(NetDataValue_OLD.create(Message.STATUS_START, new SerialInt(modOpis.profilerMaxTicks)));
|
||||
icommandsender.sendChatToPlayer(ChatMessageComponent.createFromText(String.format("\u00A7oOpis started with a tick delay %s.", modOpis.profilerDelay)));
|
||||
icommandsender.addChatMessage(new ChatComponentText(String.format("\u00A7oOpis started with a tick delay %s.", modOpis.profilerDelay)));
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package mcp.mobius.opis.commands.server;
|
||||
|
||||
import cpw.mods.fml.common.network.PacketDispatcher;
|
||||
import cpw.mods.fml.common.network.Player;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import mcp.mobius.opis.modOpis;
|
||||
import mcp.mobius.opis.commands.IOpisCommand;
|
||||
@@ -11,11 +9,9 @@ import net.minecraft.command.CommandBase;
|
||||
import net.minecraft.command.ICommandSender;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.network.MemoryConnection;
|
||||
import net.minecraft.network.packet.Packet3Chat;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.server.dedicated.DedicatedServer;
|
||||
import net.minecraft.util.ChatMessageComponent;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import mcp.mobius.mobiuscore.profiler.ProfilerSection;
|
||||
|
||||
public class CommandStop extends CommandBase implements IOpisCommand {
|
||||
@@ -39,7 +35,7 @@ public class CommandStop extends CommandBase implements IOpisCommand {
|
||||
public void processCommand(ICommandSender icommandsender, String[] astring) {
|
||||
modOpis.profilerRun = false;
|
||||
ProfilerSection.desactivateAll(Side.SERVER);
|
||||
icommandsender.sendChatToPlayer(ChatMessageComponent.createFromText(String.format("\u00A7oOpis stopped.")));
|
||||
icommandsender.addChatMessage(new ChatComponentText(String.format("\u00A7oOpis stopped.")));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -54,7 +50,7 @@ public class CommandStop extends CommandBase implements IOpisCommand {
|
||||
if (sender instanceof DedicatedServer) return true;
|
||||
if ((sender instanceof EntityPlayerMP) && ((EntityPlayerMP)sender).playerNetServerHandler.netManager instanceof MemoryConnection) return true;
|
||||
if (!(sender instanceof DedicatedServer) && !(sender instanceof EntityPlayerMP)) return true;
|
||||
return PlayerTracker.instance().isPrivileged(((EntityPlayerMP)sender).username);
|
||||
return PlayerTracker.INSTANCE.isPrivileged(((EntityPlayerMP)sender).getDisplayName());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package mcp.mobius.opis.commands.server;
|
||||
|
||||
import cpw.mods.fml.common.network.PacketDispatcher;
|
||||
import cpw.mods.fml.common.network.Player;
|
||||
import mcp.mobius.opis.modOpis;
|
||||
import mcp.mobius.opis.commands.IOpisCommand;
|
||||
import mcp.mobius.opis.events.PlayerTracker;
|
||||
@@ -9,11 +7,9 @@ import net.minecraft.command.CommandBase;
|
||||
import net.minecraft.command.ICommandSender;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.network.MemoryConnection;
|
||||
import net.minecraft.network.packet.Packet3Chat;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.server.dedicated.DedicatedServer;
|
||||
import net.minecraft.util.ChatMessageComponent;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
|
||||
public class CommandTicks extends CommandBase implements IOpisCommand {
|
||||
|
||||
@@ -37,7 +33,7 @@ public class CommandTicks extends CommandBase implements IOpisCommand {
|
||||
if (astring.length < 1) return;
|
||||
try{
|
||||
modOpis.profilerMaxTicks = Integer.valueOf(astring[0]);
|
||||
icommandsender.sendChatToPlayer(ChatMessageComponent.createFromText(String.format("\u00A7oOpis ticks set to %s ticks.", astring[0])));
|
||||
icommandsender.addChatMessage(new ChatComponentText(String.format("\u00A7oOpis ticks set to %s ticks.", astring[0])));
|
||||
|
||||
} catch (Exception e){}
|
||||
}
|
||||
@@ -54,7 +50,7 @@ public class CommandTicks extends CommandBase implements IOpisCommand {
|
||||
if (sender instanceof DedicatedServer) return true;
|
||||
if ((sender instanceof EntityPlayerMP) && ((EntityPlayerMP)sender).playerNetServerHandler.netManager instanceof MemoryConnection) return true;
|
||||
if (!(sender instanceof DedicatedServer) && !(sender instanceof EntityPlayerMP)) return true;
|
||||
return PlayerTracker.instance().isPrivileged(((EntityPlayerMP)sender).username);
|
||||
return PlayerTracker.INSTANCE.isPrivileged(((EntityPlayerMP)sender).getDisplayName());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -3,7 +3,6 @@ package mcp.mobius.opis.commands.server;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
||||
import cpw.mods.fml.common.network.Player;
|
||||
import mcp.mobius.opis.commands.IOpisCommand;
|
||||
import mcp.mobius.opis.data.holders.basetypes.CoordinatesChunk;
|
||||
import mcp.mobius.opis.data.holders.newtypes.DataEntity;
|
||||
@@ -16,10 +15,9 @@ import net.minecraft.command.CommandBase;
|
||||
import net.minecraft.command.ICommandSender;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.network.MemoryConnection;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.server.dedicated.DedicatedServer;
|
||||
import net.minecraft.util.ChatMessageComponent;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
|
||||
public class CommandTimingEntities extends CommandBase implements IOpisCommand {
|
||||
|
||||
@@ -40,8 +38,8 @@ public class CommandTimingEntities extends CommandBase implements IOpisCommand {
|
||||
|
||||
@Override
|
||||
public void processCommand(ICommandSender icommandsender, String[] astring) {
|
||||
if (icommandsender instanceof Player){
|
||||
icommandsender.sendChatToPlayer(ChatMessageComponent.createFromText("DEPRECATED ! Please run /opis instead."));
|
||||
if (icommandsender instanceof EntityPlayerMP){
|
||||
icommandsender.addChatMessage(new ChatComponentText("DEPRECATED ! Please run /opis instead."));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -55,9 +53,9 @@ public class CommandTimingEntities extends CommandBase implements IOpisCommand {
|
||||
} catch (Exception e) {return;}
|
||||
}
|
||||
|
||||
icommandsender.sendChatToPlayer(ChatMessageComponent.createFromText("[DIM X Z] Time NTEs"));
|
||||
icommandsender.addChatMessage(new ChatComponentText("[DIM X Z] Time NTEs"));
|
||||
for (DataEntity stat : ents){
|
||||
icommandsender.sendChatToPlayer(ChatMessageComponent.createFromText(stat.toString()));
|
||||
icommandsender.addChatMessage(new ChatComponentText(stat.toString()));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@ package mcp.mobius.opis.commands.server;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import cpw.mods.fml.common.network.Player;
|
||||
import mcp.mobius.opis.commands.IOpisCommand;
|
||||
import mcp.mobius.opis.data.holders.newtypes.DataBlockTileEntity;
|
||||
import mcp.mobius.opis.data.managers.TileEntityManager;
|
||||
@@ -14,10 +13,9 @@ import net.minecraft.command.CommandBase;
|
||||
import net.minecraft.command.ICommandSender;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.network.MemoryConnection;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.server.dedicated.DedicatedServer;
|
||||
import net.minecraft.util.ChatMessageComponent;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
|
||||
public class CommandTimingTileEntities extends CommandBase implements IOpisCommand {
|
||||
|
||||
@@ -38,8 +36,8 @@ public class CommandTimingTileEntities extends CommandBase implements IOpisComma
|
||||
|
||||
@Override
|
||||
public void processCommand(ICommandSender icommandsender, String[] astring) {
|
||||
if (icommandsender instanceof Player){
|
||||
icommandsender.sendChatToPlayer(ChatMessageComponent.createFromText("DEPRECATED ! Please run /opis instead."));
|
||||
if (icommandsender instanceof EntityPlayerMP){
|
||||
icommandsender.addChatMessage(new ChatComponentText("DEPRECATED ! Please run /opis instead."));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -54,7 +52,7 @@ public class CommandTimingTileEntities extends CommandBase implements IOpisComma
|
||||
}
|
||||
|
||||
for (DataBlockTileEntity stat : tes){
|
||||
icommandsender.sendChatToPlayer(ChatMessageComponent.createFromText(stat.toString()));
|
||||
icommandsender.addChatMessage(new ChatComponentText(stat.toString()));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -4,8 +4,11 @@ import java.io.DataInputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
import com.google.common.io.ByteArrayDataInput;
|
||||
import com.google.common.io.ByteArrayDataOutput;
|
||||
|
||||
import mcp.mobius.opis.data.holders.ISerializable;
|
||||
import net.minecraft.network.packet.Packet;
|
||||
import mcp.mobius.opis.network.PacketManager;
|
||||
|
||||
public class AmountHolder implements ISerializable {
|
||||
|
||||
@@ -18,13 +21,13 @@ public class AmountHolder implements ISerializable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToStream(DataOutputStream stream) throws IOException {
|
||||
Packet.writeString(this.key, stream);
|
||||
public void writeToStream(ByteArrayDataOutput stream){
|
||||
stream.writeUTF(this.key);
|
||||
stream.writeInt(this.value);
|
||||
}
|
||||
|
||||
public static AmountHolder readFromStream(DataInputStream istream) throws IOException {
|
||||
String key = Packet.readString(istream, 255);
|
||||
public static AmountHolder readFromStream(ByteArrayDataInput istream){
|
||||
String key = istream.readUTF();
|
||||
Integer value = istream.readInt();
|
||||
|
||||
return new AmountHolder(key, value);
|
||||
|
||||
@@ -4,6 +4,9 @@ import java.io.DataInputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
import com.google.common.io.ByteArrayDataInput;
|
||||
import com.google.common.io.ByteArrayDataOutput;
|
||||
|
||||
import mcp.mobius.opis.data.holders.ISerializable;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
@@ -110,14 +113,14 @@ public final class CoordinatesBlock implements ISerializable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToStream(DataOutputStream stream) throws IOException {
|
||||
public void writeToStream(ByteArrayDataOutput stream){
|
||||
stream.writeInt(this.dim);
|
||||
stream.writeInt(this.x);
|
||||
stream.writeInt(this.y);
|
||||
stream.writeInt(this.z);
|
||||
}
|
||||
|
||||
public static CoordinatesBlock readFromStream(DataInputStream stream) throws IOException {
|
||||
public static CoordinatesBlock readFromStream(ByteArrayDataInput stream){
|
||||
return new CoordinatesBlock(stream.readInt(), stream.readInt(), stream.readInt(), stream.readInt());
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,9 @@ import java.io.DataInputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
import com.google.common.io.ByteArrayDataInput;
|
||||
import com.google.common.io.ByteArrayDataOutput;
|
||||
|
||||
import mcp.mobius.opis.data.holders.ISerializable;
|
||||
|
||||
public class SerialDouble implements ISerializable {
|
||||
@@ -16,11 +19,11 @@ public class SerialDouble implements ISerializable {
|
||||
|
||||
|
||||
@Override
|
||||
public void writeToStream(DataOutputStream stream) throws IOException {
|
||||
public void writeToStream(ByteArrayDataOutput stream){
|
||||
stream.writeDouble(this.value);
|
||||
}
|
||||
|
||||
public static SerialDouble readFromStream(DataInputStream stream) throws IOException {
|
||||
public static SerialDouble readFromStream(ByteArrayDataInput stream){
|
||||
return new SerialDouble(stream.readDouble());
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,9 @@ import java.io.DataInputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
import com.google.common.io.ByteArrayDataInput;
|
||||
import com.google.common.io.ByteArrayDataOutput;
|
||||
|
||||
import mcp.mobius.opis.data.holders.ISerializable;
|
||||
|
||||
public class SerialFloat implements ISerializable {
|
||||
@@ -15,11 +18,11 @@ public class SerialFloat implements ISerializable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToStream(DataOutputStream stream) throws IOException {
|
||||
public void writeToStream(ByteArrayDataOutput stream){
|
||||
stream.writeFloat(this.value);
|
||||
}
|
||||
|
||||
public static SerialFloat readFromStream(DataInputStream stream) throws IOException {
|
||||
public static SerialFloat readFromStream(ByteArrayDataInput stream){
|
||||
return new SerialFloat(stream.readFloat());
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,9 @@ import java.io.DataInputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
import com.google.common.io.ByteArrayDataInput;
|
||||
import com.google.common.io.ByteArrayDataOutput;
|
||||
|
||||
import mcp.mobius.opis.data.holders.ISerializable;
|
||||
|
||||
public class SerialInt implements ISerializable {
|
||||
@@ -15,11 +18,11 @@ public class SerialInt implements ISerializable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToStream(DataOutputStream stream) throws IOException {
|
||||
public void writeToStream(ByteArrayDataOutput stream){
|
||||
stream.writeInt(this.value);
|
||||
}
|
||||
|
||||
public static SerialInt readFromStream(DataInputStream stream) throws IOException {
|
||||
public static SerialInt readFromStream(ByteArrayDataInput stream){
|
||||
return new SerialInt(stream.readInt());
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,9 @@ import java.io.DataInputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
import com.google.common.io.ByteArrayDataInput;
|
||||
import com.google.common.io.ByteArrayDataOutput;
|
||||
|
||||
import mcp.mobius.opis.data.holders.ISerializable;
|
||||
|
||||
public class SerialLong implements ISerializable {
|
||||
@@ -15,11 +18,11 @@ public class SerialLong implements ISerializable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToStream(DataOutputStream stream) throws IOException {
|
||||
public void writeToStream(ByteArrayDataOutput stream){
|
||||
stream.writeLong(this.value);
|
||||
}
|
||||
|
||||
public static SerialLong readFromStream(DataInputStream stream) throws IOException {
|
||||
public static SerialLong readFromStream(ByteArrayDataInput stream){
|
||||
return new SerialLong(stream.readLong());
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,9 @@ import java.io.DataInputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
import net.minecraft.network.packet.Packet;
|
||||
import com.google.common.io.ByteArrayDataInput;
|
||||
import com.google.common.io.ByteArrayDataOutput;
|
||||
|
||||
import mcp.mobius.opis.data.holders.ISerializable;
|
||||
|
||||
public class SerialString implements ISerializable {
|
||||
@@ -16,11 +18,11 @@ public class SerialString implements ISerializable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToStream(DataOutputStream stream) throws IOException {
|
||||
Packet.writeString(this.value, stream);
|
||||
public void writeToStream(ByteArrayDataOutput stream){
|
||||
stream.writeUTF(this.value);
|
||||
}
|
||||
|
||||
public static SerialString readFromStream(DataInputStream stream) throws IOException {
|
||||
return new SerialString(Packet.readString(stream, 255));
|
||||
public static SerialString readFromStream(ByteArrayDataInput stream){
|
||||
return new SerialString(stream.readUTF());
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,9 @@ import java.io.DataInputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
import com.google.common.io.ByteArrayDataInput;
|
||||
import com.google.common.io.ByteArrayDataOutput;
|
||||
|
||||
import mcp.mobius.opis.data.holders.ISerializable;
|
||||
|
||||
public class TargetEntity implements ISerializable {
|
||||
@@ -17,12 +20,12 @@ public class TargetEntity implements ISerializable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToStream(DataOutputStream stream) throws IOException {
|
||||
public void writeToStream(ByteArrayDataOutput stream){
|
||||
stream.writeInt(this.entityID);
|
||||
stream.writeInt(this.dim);
|
||||
}
|
||||
|
||||
public static TargetEntity readFromStream(DataInputStream stream) throws IOException {
|
||||
public static TargetEntity readFromStream(ByteArrayDataInput stream){
|
||||
return new TargetEntity(stream.readInt(), stream.readInt());
|
||||
}
|
||||
}
|
||||
@@ -6,9 +6,10 @@ import java.io.IOException;
|
||||
import java.util.LinkedHashSet;
|
||||
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import com.google.common.io.ByteArrayDataInput;
|
||||
import com.google.common.io.ByteArrayDataOutput;
|
||||
|
||||
import mcp.mobius.opis.data.holders.ISerializable;
|
||||
import net.minecraft.network.packet.Packet;
|
||||
import net.minecraft.world.ChunkCoordIntPair;
|
||||
import net.minecraftforge.common.ForgeChunkManager.Ticket;
|
||||
|
||||
@@ -44,15 +45,14 @@ public final class TicketData implements ISerializable{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToStream(DataOutputStream stream) throws IOException {
|
||||
public void writeToStream(ByteArrayDataOutput stream){
|
||||
this.coord.writeToStream(stream);
|
||||
stream.writeInt(this.nchunks);
|
||||
Packet.writeString(this.modID, stream);
|
||||
|
||||
stream.writeUTF(this.modID);
|
||||
}
|
||||
|
||||
public static TicketData readFromStream(DataInputStream stream) throws IOException {
|
||||
return new TicketData(CoordinatesChunk.readFromStream(stream), stream.readInt(), Packet.readString(stream, 255));
|
||||
public static TicketData readFromStream(ByteArrayDataInput stream){
|
||||
return new TicketData(CoordinatesChunk.readFromStream(stream), stream.readInt(), stream.readUTF());
|
||||
}
|
||||
|
||||
public boolean equals(Object o) {
|
||||
|
||||
@@ -4,6 +4,9 @@ import java.io.DataInputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
import com.google.common.io.ByteArrayDataInput;
|
||||
import com.google.common.io.ByteArrayDataOutput;
|
||||
|
||||
import net.minecraft.server.ServerListenThread;
|
||||
import net.minecraft.server.ThreadMinecraftServer;
|
||||
import net.minecraft.network.TcpReaderThread;
|
||||
@@ -50,11 +53,11 @@ public class CachedString implements Comparable, ISerializable{
|
||||
return str;
|
||||
}
|
||||
|
||||
public void writeToStream(DataOutputStream stream) throws IOException{
|
||||
public void writeToStream(ByteArrayDataOutput stream){
|
||||
stream.writeInt(this.index);
|
||||
}
|
||||
|
||||
public static CachedString readFromStream(DataInputStream stream) throws IOException {
|
||||
public static CachedString readFromStream(ByteArrayDataInput stream){
|
||||
return new CachedString(stream.readInt());
|
||||
}
|
||||
|
||||
|
||||
@@ -7,6 +7,10 @@ import java.util.HashMap;
|
||||
|
||||
import org.apache.commons.math3.stat.descriptive.DescriptiveStatistics;
|
||||
|
||||
import com.google.common.io.ByteArrayDataInput;
|
||||
import com.google.common.io.ByteArrayDataOutput;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.DimensionManager;
|
||||
@@ -26,7 +30,7 @@ public class DataBlockTileEntity implements ISerializable, Comparable {
|
||||
this.pos = coord;
|
||||
World world = DimensionManager.getWorld(this.pos.dim);
|
||||
|
||||
this.id = (short) world.getBlockId(this.pos.x, this.pos.y, this.pos.z);
|
||||
this.id = (short) Block.getIdFromBlock(world.getBlock(this.pos.x, this.pos.y, this.pos.z));
|
||||
this.meta = (short) world.getBlockMetadata(this.pos.x, this.pos.y, this.pos.z);
|
||||
|
||||
HashMap<CoordinatesBlock, DescriptiveStatistics> data = ((ProfilerTileEntityUpdate)(ProfilerSection.TILEENT_UPDATETIME.getProfiler())).data;
|
||||
@@ -36,14 +40,14 @@ public class DataBlockTileEntity implements ISerializable, Comparable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToStream(DataOutputStream stream) throws IOException {
|
||||
public void writeToStream(ByteArrayDataOutput stream) {
|
||||
stream.writeShort(this.id);
|
||||
stream.writeShort(this.meta);
|
||||
this.pos.writeToStream(stream);
|
||||
this.update.writeToStream(stream);
|
||||
}
|
||||
|
||||
public static DataBlockTileEntity readFromStream(DataInputStream stream) throws IOException {
|
||||
public static DataBlockTileEntity readFromStream(ByteArrayDataInput stream){
|
||||
DataBlockTileEntity retVal = new DataBlockTileEntity();
|
||||
retVal.id = stream.readShort();
|
||||
retVal.meta = stream.readShort();
|
||||
|
||||
@@ -7,8 +7,9 @@ import java.io.IOException;
|
||||
import org.apache.commons.math3.stat.descriptive.DescriptiveStatistics;
|
||||
|
||||
import com.google.common.collect.Table.Cell;
|
||||
import com.google.common.io.ByteArrayDataInput;
|
||||
import com.google.common.io.ByteArrayDataOutput;
|
||||
|
||||
import net.minecraft.network.packet.Packet;
|
||||
import mcp.mobius.opis.data.holders.ISerializable;
|
||||
|
||||
public class DataEvent implements ISerializable, Comparable {
|
||||
@@ -44,7 +45,7 @@ public class DataEvent implements ISerializable, Comparable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToStream(DataOutputStream stream) throws IOException {
|
||||
public void writeToStream(ByteArrayDataOutput stream){
|
||||
this.event.writeToStream(stream);
|
||||
this.package_.writeToStream(stream);
|
||||
this.handler.writeToStream(stream);
|
||||
@@ -52,7 +53,7 @@ public class DataEvent implements ISerializable, Comparable {
|
||||
stream.writeLong(this.nCalls);
|
||||
}
|
||||
|
||||
public static DataEvent readFromStream(DataInputStream stream) throws IOException {
|
||||
public static DataEvent readFromStream(ByteArrayDataInput stream){
|
||||
DataEvent retVal = new DataEvent();
|
||||
retVal.event = CachedString.readFromStream(stream);
|
||||
retVal.package_= CachedString.readFromStream(stream);
|
||||
|
||||
@@ -4,12 +4,13 @@ import java.io.DataInputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
import net.minecraft.network.packet.Packet;
|
||||
import com.google.common.io.ByteArrayDataInput;
|
||||
import com.google.common.io.ByteArrayDataOutput;
|
||||
|
||||
import mcp.mobius.mobiuscore.profiler.ProfilerSection;
|
||||
import mcp.mobius.opis.data.holders.ISerializable;
|
||||
import mcp.mobius.opis.data.managers.TickHandlerManager;
|
||||
import mcp.mobius.opis.data.profilers.ProfilerHandler;
|
||||
import cpw.mods.fml.common.IScheduledTickHandler;
|
||||
|
||||
public class DataHandler implements ISerializable, Comparable {
|
||||
public CachedString name;
|
||||
@@ -36,12 +37,12 @@ public class DataHandler implements ISerializable, Comparable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToStream(DataOutputStream stream) throws IOException {
|
||||
public void writeToStream(ByteArrayDataOutput stream){
|
||||
this.name.writeToStream(stream);
|
||||
this.update.writeToStream(stream);
|
||||
}
|
||||
|
||||
public static DataHandler readFromStream(DataInputStream stream) throws IOException {
|
||||
public static DataHandler readFromStream(ByteArrayDataInput stream){
|
||||
DataHandler retVal = new DataHandler();
|
||||
retVal.name = CachedString.readFromStream(stream);
|
||||
retVal.update = DataTiming.readFromStream(stream);
|
||||
|
||||
@@ -4,6 +4,9 @@ import java.io.DataInputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
import com.google.common.io.ByteArrayDataInput;
|
||||
import com.google.common.io.ByteArrayDataOutput;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.DimensionManager;
|
||||
@@ -38,7 +41,7 @@ public class DataTileEntity implements ISerializable {
|
||||
*/
|
||||
|
||||
@Override
|
||||
public void writeToStream(DataOutputStream stream) throws IOException {
|
||||
public void writeToStream(ByteArrayDataOutput stream){
|
||||
this.clazz.writeToStream(stream);
|
||||
this.pos.writeToStream(stream);
|
||||
this.cause.writeToStream(stream);
|
||||
@@ -47,7 +50,7 @@ public class DataTileEntity implements ISerializable {
|
||||
|
||||
}
|
||||
|
||||
public static DataTileEntity readFromStream(DataInputStream stream) throws IOException {
|
||||
public static DataTileEntity readFromStream(ByteArrayDataInput stream){
|
||||
DataTileEntity retVal = new DataTileEntity();
|
||||
retVal.clazz = CachedString.readFromStream(stream);
|
||||
retVal.pos = CoordinatesBlock.readFromStream(stream);
|
||||
@@ -56,4 +59,5 @@ public class DataTileEntity implements ISerializable {
|
||||
retVal.isValid = stream.readBoolean();
|
||||
return retVal;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -4,6 +4,9 @@ import java.io.DataInputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
import com.google.common.io.ByteArrayDataInput;
|
||||
import com.google.common.io.ByteArrayDataOutput;
|
||||
|
||||
import mcp.mobius.opis.data.holders.ISerializable;
|
||||
|
||||
public class DataTiming implements Comparable, ISerializable{
|
||||
@@ -25,11 +28,11 @@ public class DataTiming implements Comparable, ISerializable{
|
||||
return String.format("%.3f µs", this.timing / 1000.0);
|
||||
}
|
||||
|
||||
public void writeToStream(DataOutputStream stream) throws IOException{
|
||||
public void writeToStream(ByteArrayDataOutput stream){
|
||||
stream.writeDouble(this.timing);
|
||||
}
|
||||
|
||||
public static DataTiming readFromStream(DataInputStream stream) throws IOException {
|
||||
public static DataTiming readFromStream(ByteArrayDataInput stream){
|
||||
return new DataTiming(stream.readDouble());
|
||||
}
|
||||
}
|
||||
@@ -9,6 +9,8 @@ import mcp.mobius.opis.data.holders.basetypes.CoordinatesChunk;
|
||||
|
||||
import org.apache.commons.math3.stat.descriptive.DescriptiveStatistics;
|
||||
|
||||
import com.google.common.io.ByteArrayDataOutput;
|
||||
|
||||
public abstract class StatAbstract implements Comparable, ISerializable{
|
||||
protected DescriptiveStatistics dstat = new DescriptiveStatistics();
|
||||
public Long dataPoints = 0L;
|
||||
@@ -86,6 +88,6 @@ public abstract class StatAbstract implements Comparable, ISerializable{
|
||||
public CoordinatesBlock getTeleportTarget(){return this.coord;}
|
||||
|
||||
|
||||
public abstract void writeToStream(DataOutputStream stream) throws IOException;
|
||||
public abstract void writeToStream(ByteArrayDataOutput stream);
|
||||
|
||||
}
|
||||
@@ -4,6 +4,9 @@ import java.io.DataInputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
import com.google.common.io.ByteArrayDataInput;
|
||||
import com.google.common.io.ByteArrayDataOutput;
|
||||
|
||||
import mcp.mobius.opis.data.holders.basetypes.CoordinatesChunk;
|
||||
|
||||
public class StatsChunk extends StatAbstract{
|
||||
@@ -41,14 +44,14 @@ public class StatsChunk extends StatAbstract{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToStream(DataOutputStream stream) throws IOException{
|
||||
public void writeToStream(ByteArrayDataOutput stream){
|
||||
this.chunk.writeToStream(stream);
|
||||
stream.writeInt(this.tileEntities);
|
||||
stream.writeInt(this.entities);
|
||||
stream.writeDouble(this.getDataSum());
|
||||
}
|
||||
|
||||
public static StatsChunk readFromStream(DataInputStream stream) throws IOException {
|
||||
public static StatsChunk readFromStream(ByteArrayDataInput stream){
|
||||
CoordinatesChunk chunk = CoordinatesChunk.readFromStream(stream);
|
||||
StatsChunk chunkStats = new StatsChunk(chunk, stream.readInt(), stream.readInt());
|
||||
chunkStats.setDataSum(stream.readDouble());
|
||||
|
||||
@@ -7,8 +7,6 @@ import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import cpw.mods.fml.common.network.PacketDispatcher;
|
||||
import cpw.mods.fml.common.network.Player;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.Entity;
|
||||
@@ -18,12 +16,8 @@ import net.minecraft.entity.monster.EntityMob;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.network.packet.Packet3Chat;
|
||||
import net.minecraft.network.packet.Packet41EntityEffect;
|
||||
import net.minecraft.network.packet.Packet9Respawn;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.util.ChatMessageComponent;
|
||||
import net.minecraft.util.ChunkCoordinates;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.Teleporter;
|
||||
|
||||
@@ -20,6 +20,7 @@ import mcp.mobius.opis.data.holders.stats.StatsChunk;
|
||||
import mcp.mobius.opis.data.profilers.ProfilerTileEntityUpdate;
|
||||
import mcp.mobius.opis.helpers.ModIdentification;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
@@ -132,11 +133,11 @@ public enum TileEntityManager {
|
||||
|
||||
if (registeredEntities.contains(hash)) continue; //This entitie has already been seen;
|
||||
|
||||
int id = world.getBlockId(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord);
|
||||
if (id == 0 || Block.blocksList[id] == null
|
||||
|| !Block.blocksList[id].hasTileEntity()
|
||||
|| world.getBlockTileEntity(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord) == null
|
||||
|| world.getBlockTileEntity(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord).getClass() != tileEntity.getClass()){
|
||||
Block block = world.getBlock(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord);
|
||||
if (block == Blocks.air || block == null
|
||||
|| block.hasTileEntity()
|
||||
|| world.getTileEntity(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord) == null
|
||||
|| world.getTileEntity(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord).getClass() != tileEntity.getClass()){
|
||||
|
||||
orphans.add(new DataTileEntity().fill(tileEntity, "Orphan"));
|
||||
registeredEntities.add(hash);
|
||||
@@ -167,7 +168,7 @@ public enum TileEntityManager {
|
||||
for (WorldServer world : DimensionManager.getWorlds()){
|
||||
for (Object o : world.loadedTileEntityList){
|
||||
TileEntity tileEntity = (TileEntity)o;
|
||||
int id = world.getBlockId(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord);
|
||||
int id = Block.getIdFromBlock(world.getBlock(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord));
|
||||
int meta = world.getBlockMetadata(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord);
|
||||
|
||||
if (!data.contains(id, meta))
|
||||
@@ -185,7 +186,7 @@ public enum TileEntityManager {
|
||||
|
||||
for (CoordinatesBlock coord : ((ProfilerTileEntityUpdate)ProfilerSection.TILEENT_UPDATETIME.getProfiler()).data.keySet()){
|
||||
World world = DimensionManager.getWorld(coord.dim);
|
||||
int id = world.getBlockId(coord.x, coord.y, coord.z);
|
||||
int id = Block.getIdFromBlock(world.getBlock(coord.x, coord.y, coord.z));
|
||||
int meta = world.getBlockMetadata(coord.x, coord.y, coord.z);
|
||||
|
||||
if (!data.contains(id, meta))
|
||||
|
||||
@@ -5,6 +5,7 @@ import java.util.ArrayList;
|
||||
|
||||
import org.lwjgl.input.Mouse;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -285,7 +286,7 @@ public class OverlayMeanTime implements IMwDataProvider, IMessageHandler{
|
||||
String name = String.format("te.%d.%d", data.id, data.meta);
|
||||
|
||||
try{
|
||||
is = new ItemStack(data.id, 1, data.meta);
|
||||
is = new ItemStack(Block.getBlockById(data.id), 1, data.meta);
|
||||
name = is.getDisplayName();
|
||||
} catch (Exception e) { }
|
||||
|
||||
|
||||
@@ -49,9 +49,6 @@ import mcp.mobius.opis.gui.overlay.entperchunk.OverlayEntityPerChunk;
|
||||
import mcp.mobius.opis.network.enums.AccessLevel;
|
||||
import mcp.mobius.opis.network.enums.Message;
|
||||
import mcp.mobius.opis.network.enums.Packets;
|
||||
import mcp.mobius.opis.network.packets.client.Packet_ReqChunks;
|
||||
import mcp.mobius.opis.network.packets.client.Packet_ReqData;
|
||||
import mcp.mobius.opis.network.packets.custom.Packet250Metadata;
|
||||
import mcp.mobius.opis.network.packets.server.Packet_Chunks_OLD;
|
||||
import mcp.mobius.opis.network.packets.server.NetDataCommand_OLD;
|
||||
import mcp.mobius.opis.network.packets.server.NetDataRaw_OLD;
|
||||
@@ -62,19 +59,11 @@ import mcp.mobius.opis.network.packets.server.Packet_Tickets_OLD;
|
||||
import mcp.mobius.opis.swing.SwingUI;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.network.INetworkManager;
|
||||
import net.minecraft.network.packet.Packet250CustomPayload;
|
||||
import net.minecraft.network.packet.Packet3Chat;
|
||||
import net.minecraft.network.packet.Packet56MapChunks;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.util.ChatMessageComponent;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.chunk.Chunk;
|
||||
import net.minecraftforge.common.DimensionManager;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.network.IPacketHandler;
|
||||
import cpw.mods.fml.common.network.PacketDispatcher;
|
||||
import cpw.mods.fml.common.network.Player;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
|
||||
public class OpisPacketHandler_OLD implements IPacketHandler {
|
||||
|
||||
@@ -138,6 +138,22 @@ public class PacketManager extends FMLIndexedMessageToMessageCodec<PacketBase>
|
||||
return channels.get(FMLCommonHandler.instance().getEffectiveSide()).generatePacketFrom(packet);
|
||||
}
|
||||
|
||||
/*
|
||||
public void writeString(ByteArrayDataOutput buffer, String data) throws IOException
|
||||
{
|
||||
byte[] abyte = data.getBytes(Charsets.UTF_8);
|
||||
buffer.writeShort(abyte.length);
|
||||
buffer.writeBytes(abyte);
|
||||
}
|
||||
|
||||
public String readString(ByteArrayDataInput buffer) throws IOException
|
||||
{
|
||||
int j = buffer.readShort();
|
||||
String s = new String(buffer.readBytes(j).array(), Charsets.UTF_8);
|
||||
return s;
|
||||
}
|
||||
*/
|
||||
|
||||
// OTHER METHODS
|
||||
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user