Java源码示例:cn.nukkit.network.protocol.types.CommandOriginData
示例1
public CommandOriginData getCommandOriginData() {
CommandOriginData result = new CommandOriginData();
result.type = this.getUnsignedVarInt();
result.uuid = this.getUUID();
result.requestId = this.getString();
if(result.type == CommandOriginData.ORIGIN_DEV_CONSOLE || result.type == CommandOriginData.ORIGIN_TEST) {
result.varLong1 = this.getVarLong();
}
return result;
}
示例2
public void putCommandOriginData(CommandOriginData data) {
this.putUnsignedVarInt(data.type);
this.putUUID(data.uuid);
this.putString(data.requestId);
if(data.type == CommandOriginData.ORIGIN_DEV_CONSOLE || data.type == CommandOriginData.ORIGIN_TEST) {
this.putVarLong(data.varLong1);
}
}
示例3
@Override
public void decode() {
this.command = this.getString();
CommandOriginData.Origin type = CommandOriginData.Origin.values()[this.getVarInt()];
UUID uuid = this.getUUID();
String requestId = this.getString();
Long varLong = null;
if (type == CommandOriginData.Origin.DEV_CONSOLE || type == CommandOriginData.Origin.TEST) {
varLong = this.getVarLong();
}
this.data = new CommandOriginData(type, uuid, requestId, varLong);
}
示例4
@Override
public void decode() {
this.command = this.getString();
CommandOriginData.Origin type = CommandOriginData.Origin.values()[this.getVarInt()];
UUID uuid = this.getUUID();
String requestId = this.getString();
Long varLong = null;
if (type == CommandOriginData.Origin.DEV_CONSOLE || type == CommandOriginData.Origin.TEST) {
varLong = this.getVarLong();
}
this.data = new CommandOriginData(type, uuid, requestId, varLong);
}