mirror of
https://github.com/Melledy/LunarCore.git
synced 2025-12-16 15:24:44 +01:00
Implement rogue portals (cant enter yet)
This commit is contained in:
@@ -0,0 +1,291 @@
|
||||
// Code generated by protocol buffer compiler. Do not edit!
|
||||
package emu.lunarcore.proto;
|
||||
|
||||
import java.io.IOException;
|
||||
import us.hebi.quickbuf.FieldName;
|
||||
import us.hebi.quickbuf.InvalidProtocolBufferException;
|
||||
import us.hebi.quickbuf.JsonSink;
|
||||
import us.hebi.quickbuf.JsonSource;
|
||||
import us.hebi.quickbuf.MessageFactory;
|
||||
import us.hebi.quickbuf.ProtoMessage;
|
||||
import us.hebi.quickbuf.ProtoSink;
|
||||
import us.hebi.quickbuf.ProtoSource;
|
||||
|
||||
public final class PropExtraInfoOuterClass {
|
||||
/**
|
||||
* Protobuf type {@code PropExtraInfo}
|
||||
*/
|
||||
public static final class PropExtraInfo extends ProtoMessage<PropExtraInfo> implements Cloneable {
|
||||
private static final long serialVersionUID = 0L;
|
||||
|
||||
/**
|
||||
* <code>optional .PropRogueInfo rogue_info = 9;</code>
|
||||
*/
|
||||
private final PropRogueInfoOuterClass.PropRogueInfo rogueInfo = PropRogueInfoOuterClass.PropRogueInfo.newInstance();
|
||||
|
||||
private PropExtraInfo() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return a new empty instance of {@code PropExtraInfo}
|
||||
*/
|
||||
public static PropExtraInfo newInstance() {
|
||||
return new PropExtraInfo();
|
||||
}
|
||||
|
||||
public boolean hasInfo() {
|
||||
return (((bitField0_ & 0x00000001)) != 0);
|
||||
}
|
||||
|
||||
public PropExtraInfo clearInfo() {
|
||||
if (hasInfo()) {
|
||||
clearRogueInfo();
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional .PropRogueInfo rogue_info = 9;</code>
|
||||
* @return whether the rogueInfo field is set
|
||||
*/
|
||||
public boolean hasRogueInfo() {
|
||||
return (bitField0_ & 0x00000001) != 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional .PropRogueInfo rogue_info = 9;</code>
|
||||
* @return this
|
||||
*/
|
||||
public PropExtraInfo clearRogueInfo() {
|
||||
bitField0_ &= ~0x00000001;
|
||||
rogueInfo.clear();
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional .PropRogueInfo rogue_info = 9;</code>
|
||||
*
|
||||
* This method returns the internal storage object without modifying any has state.
|
||||
* The returned object should not be modified and be treated as read-only.
|
||||
*
|
||||
* Use {@link #getMutableRogueInfo()} if you want to modify it.
|
||||
*
|
||||
* @return internal storage object for reading
|
||||
*/
|
||||
public PropRogueInfoOuterClass.PropRogueInfo getRogueInfo() {
|
||||
return rogueInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional .PropRogueInfo rogue_info = 9;</code>
|
||||
*
|
||||
* This method returns the internal storage object and sets the corresponding
|
||||
* has state. The returned object will become part of this message and its
|
||||
* contents may be modified as long as the has state is not cleared.
|
||||
*
|
||||
* @return internal storage object for modifications
|
||||
*/
|
||||
public PropRogueInfoOuterClass.PropRogueInfo getMutableRogueInfo() {
|
||||
bitField0_ |= 0x00000001;
|
||||
return rogueInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional .PropRogueInfo rogue_info = 9;</code>
|
||||
* @param value the rogueInfo to set
|
||||
* @return this
|
||||
*/
|
||||
public PropExtraInfo setRogueInfo(final PropRogueInfoOuterClass.PropRogueInfo value) {
|
||||
bitField0_ |= 0x00000001;
|
||||
rogueInfo.copyFrom(value);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PropExtraInfo copyFrom(final PropExtraInfo other) {
|
||||
cachedSize = other.cachedSize;
|
||||
if ((bitField0_ | other.bitField0_) != 0) {
|
||||
bitField0_ = other.bitField0_;
|
||||
rogueInfo.copyFrom(other.rogueInfo);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PropExtraInfo mergeFrom(final PropExtraInfo other) {
|
||||
if (other.isEmpty()) {
|
||||
return this;
|
||||
}
|
||||
cachedSize = -1;
|
||||
if (other.hasRogueInfo()) {
|
||||
getMutableRogueInfo().mergeFrom(other.rogueInfo);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PropExtraInfo clear() {
|
||||
if (isEmpty()) {
|
||||
return this;
|
||||
}
|
||||
cachedSize = -1;
|
||||
bitField0_ = 0;
|
||||
rogueInfo.clear();
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PropExtraInfo clearQuick() {
|
||||
if (isEmpty()) {
|
||||
return this;
|
||||
}
|
||||
cachedSize = -1;
|
||||
bitField0_ = 0;
|
||||
rogueInfo.clearQuick();
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (o == this) {
|
||||
return true;
|
||||
}
|
||||
if (!(o instanceof PropExtraInfo)) {
|
||||
return false;
|
||||
}
|
||||
PropExtraInfo other = (PropExtraInfo) o;
|
||||
return bitField0_ == other.bitField0_
|
||||
&& (!hasRogueInfo() || rogueInfo.equals(other.rogueInfo));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeTo(final ProtoSink output) throws IOException {
|
||||
if ((bitField0_ & 0x00000001) != 0) {
|
||||
output.writeRawByte((byte) 74);
|
||||
output.writeMessageNoTag(rogueInfo);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int computeSerializedSize() {
|
||||
int size = 0;
|
||||
if ((bitField0_ & 0x00000001) != 0) {
|
||||
size += 1 + ProtoSink.computeMessageSizeNoTag(rogueInfo);
|
||||
}
|
||||
return size;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("fallthrough")
|
||||
public PropExtraInfo mergeFrom(final ProtoSource input) throws IOException {
|
||||
// Enabled Fall-Through Optimization (QuickBuffers)
|
||||
int tag = input.readTag();
|
||||
while (true) {
|
||||
switch (tag) {
|
||||
case 74: {
|
||||
// rogueInfo
|
||||
input.readMessage(rogueInfo);
|
||||
bitField0_ |= 0x00000001;
|
||||
tag = input.readTag();
|
||||
if (tag != 0) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
case 0: {
|
||||
return this;
|
||||
}
|
||||
default: {
|
||||
if (!input.skipField(tag)) {
|
||||
return this;
|
||||
}
|
||||
tag = input.readTag();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeTo(final JsonSink output) throws IOException {
|
||||
output.beginObject();
|
||||
if ((bitField0_ & 0x00000001) != 0) {
|
||||
output.writeMessage(FieldNames.rogueInfo, rogueInfo);
|
||||
}
|
||||
output.endObject();
|
||||
}
|
||||
|
||||
@Override
|
||||
public PropExtraInfo mergeFrom(final JsonSource input) throws IOException {
|
||||
if (!input.beginObject()) {
|
||||
return this;
|
||||
}
|
||||
while (!input.isAtEnd()) {
|
||||
switch (input.readFieldHash()) {
|
||||
case 655808936:
|
||||
case -1124583437: {
|
||||
if (input.isAtField(FieldNames.rogueInfo)) {
|
||||
if (!input.trySkipNullValue()) {
|
||||
input.readMessage(rogueInfo);
|
||||
bitField0_ |= 0x00000001;
|
||||
}
|
||||
} else {
|
||||
input.skipUnknownField();
|
||||
}
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
input.skipUnknownField();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
input.endObject();
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PropExtraInfo clone() {
|
||||
return new PropExtraInfo().copyFrom(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEmpty() {
|
||||
return ((bitField0_) == 0);
|
||||
}
|
||||
|
||||
public static PropExtraInfo parseFrom(final byte[] data) throws InvalidProtocolBufferException {
|
||||
return ProtoMessage.mergeFrom(new PropExtraInfo(), data).checkInitialized();
|
||||
}
|
||||
|
||||
public static PropExtraInfo parseFrom(final ProtoSource input) throws IOException {
|
||||
return ProtoMessage.mergeFrom(new PropExtraInfo(), input).checkInitialized();
|
||||
}
|
||||
|
||||
public static PropExtraInfo parseFrom(final JsonSource input) throws IOException {
|
||||
return ProtoMessage.mergeFrom(new PropExtraInfo(), input).checkInitialized();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return factory for creating PropExtraInfo messages
|
||||
*/
|
||||
public static MessageFactory<PropExtraInfo> getFactory() {
|
||||
return PropExtraInfoFactory.INSTANCE;
|
||||
}
|
||||
|
||||
private enum PropExtraInfoFactory implements MessageFactory<PropExtraInfo> {
|
||||
INSTANCE;
|
||||
|
||||
@Override
|
||||
public PropExtraInfo create() {
|
||||
return PropExtraInfo.newInstance();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Contains name constants used for serializing JSON
|
||||
*/
|
||||
static class FieldNames {
|
||||
static final FieldName rogueInfo = FieldName.forField("rogueInfo", "rogue_info");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,500 @@
|
||||
// Code generated by protocol buffer compiler. Do not edit!
|
||||
package emu.lunarcore.proto;
|
||||
|
||||
import java.io.IOException;
|
||||
import us.hebi.quickbuf.FieldName;
|
||||
import us.hebi.quickbuf.InvalidProtocolBufferException;
|
||||
import us.hebi.quickbuf.JsonSink;
|
||||
import us.hebi.quickbuf.JsonSource;
|
||||
import us.hebi.quickbuf.MessageFactory;
|
||||
import us.hebi.quickbuf.ProtoMessage;
|
||||
import us.hebi.quickbuf.ProtoSink;
|
||||
import us.hebi.quickbuf.ProtoSource;
|
||||
|
||||
public final class PropRogueInfoOuterClass {
|
||||
/**
|
||||
* Protobuf type {@code PropRogueInfo}
|
||||
*/
|
||||
public static final class PropRogueInfo extends ProtoMessage<PropRogueInfo> implements Cloneable {
|
||||
private static final long serialVersionUID = 0L;
|
||||
|
||||
/**
|
||||
* <code>optional uint32 IKCJDPMPMKL = 5;</code>
|
||||
*/
|
||||
private int iKCJDPMPMKL;
|
||||
|
||||
/**
|
||||
* <code>optional uint32 room_id = 6;</code>
|
||||
*/
|
||||
private int roomId;
|
||||
|
||||
/**
|
||||
* <code>optional uint32 LDDCAIKLKDO = 7;</code>
|
||||
*/
|
||||
private int lDDCAIKLKDO;
|
||||
|
||||
/**
|
||||
* <code>optional uint32 site_id = 13;</code>
|
||||
*/
|
||||
private int siteId;
|
||||
|
||||
private PropRogueInfo() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return a new empty instance of {@code PropRogueInfo}
|
||||
*/
|
||||
public static PropRogueInfo newInstance() {
|
||||
return new PropRogueInfo();
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional uint32 IKCJDPMPMKL = 5;</code>
|
||||
* @return whether the iKCJDPMPMKL field is set
|
||||
*/
|
||||
public boolean hasIKCJDPMPMKL() {
|
||||
return (bitField0_ & 0x00000001) != 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional uint32 IKCJDPMPMKL = 5;</code>
|
||||
* @return this
|
||||
*/
|
||||
public PropRogueInfo clearIKCJDPMPMKL() {
|
||||
bitField0_ &= ~0x00000001;
|
||||
iKCJDPMPMKL = 0;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional uint32 IKCJDPMPMKL = 5;</code>
|
||||
* @return the iKCJDPMPMKL
|
||||
*/
|
||||
public int getIKCJDPMPMKL() {
|
||||
return iKCJDPMPMKL;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional uint32 IKCJDPMPMKL = 5;</code>
|
||||
* @param value the iKCJDPMPMKL to set
|
||||
* @return this
|
||||
*/
|
||||
public PropRogueInfo setIKCJDPMPMKL(final int value) {
|
||||
bitField0_ |= 0x00000001;
|
||||
iKCJDPMPMKL = value;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional uint32 room_id = 6;</code>
|
||||
* @return whether the roomId field is set
|
||||
*/
|
||||
public boolean hasRoomId() {
|
||||
return (bitField0_ & 0x00000002) != 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional uint32 room_id = 6;</code>
|
||||
* @return this
|
||||
*/
|
||||
public PropRogueInfo clearRoomId() {
|
||||
bitField0_ &= ~0x00000002;
|
||||
roomId = 0;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional uint32 room_id = 6;</code>
|
||||
* @return the roomId
|
||||
*/
|
||||
public int getRoomId() {
|
||||
return roomId;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional uint32 room_id = 6;</code>
|
||||
* @param value the roomId to set
|
||||
* @return this
|
||||
*/
|
||||
public PropRogueInfo setRoomId(final int value) {
|
||||
bitField0_ |= 0x00000002;
|
||||
roomId = value;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional uint32 LDDCAIKLKDO = 7;</code>
|
||||
* @return whether the lDDCAIKLKDO field is set
|
||||
*/
|
||||
public boolean hasLDDCAIKLKDO() {
|
||||
return (bitField0_ & 0x00000004) != 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional uint32 LDDCAIKLKDO = 7;</code>
|
||||
* @return this
|
||||
*/
|
||||
public PropRogueInfo clearLDDCAIKLKDO() {
|
||||
bitField0_ &= ~0x00000004;
|
||||
lDDCAIKLKDO = 0;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional uint32 LDDCAIKLKDO = 7;</code>
|
||||
* @return the lDDCAIKLKDO
|
||||
*/
|
||||
public int getLDDCAIKLKDO() {
|
||||
return lDDCAIKLKDO;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional uint32 LDDCAIKLKDO = 7;</code>
|
||||
* @param value the lDDCAIKLKDO to set
|
||||
* @return this
|
||||
*/
|
||||
public PropRogueInfo setLDDCAIKLKDO(final int value) {
|
||||
bitField0_ |= 0x00000004;
|
||||
lDDCAIKLKDO = value;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional uint32 site_id = 13;</code>
|
||||
* @return whether the siteId field is set
|
||||
*/
|
||||
public boolean hasSiteId() {
|
||||
return (bitField0_ & 0x00000008) != 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional uint32 site_id = 13;</code>
|
||||
* @return this
|
||||
*/
|
||||
public PropRogueInfo clearSiteId() {
|
||||
bitField0_ &= ~0x00000008;
|
||||
siteId = 0;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional uint32 site_id = 13;</code>
|
||||
* @return the siteId
|
||||
*/
|
||||
public int getSiteId() {
|
||||
return siteId;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional uint32 site_id = 13;</code>
|
||||
* @param value the siteId to set
|
||||
* @return this
|
||||
*/
|
||||
public PropRogueInfo setSiteId(final int value) {
|
||||
bitField0_ |= 0x00000008;
|
||||
siteId = value;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PropRogueInfo copyFrom(final PropRogueInfo other) {
|
||||
cachedSize = other.cachedSize;
|
||||
if ((bitField0_ | other.bitField0_) != 0) {
|
||||
bitField0_ = other.bitField0_;
|
||||
iKCJDPMPMKL = other.iKCJDPMPMKL;
|
||||
roomId = other.roomId;
|
||||
lDDCAIKLKDO = other.lDDCAIKLKDO;
|
||||
siteId = other.siteId;
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PropRogueInfo mergeFrom(final PropRogueInfo other) {
|
||||
if (other.isEmpty()) {
|
||||
return this;
|
||||
}
|
||||
cachedSize = -1;
|
||||
if (other.hasIKCJDPMPMKL()) {
|
||||
setIKCJDPMPMKL(other.iKCJDPMPMKL);
|
||||
}
|
||||
if (other.hasRoomId()) {
|
||||
setRoomId(other.roomId);
|
||||
}
|
||||
if (other.hasLDDCAIKLKDO()) {
|
||||
setLDDCAIKLKDO(other.lDDCAIKLKDO);
|
||||
}
|
||||
if (other.hasSiteId()) {
|
||||
setSiteId(other.siteId);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PropRogueInfo clear() {
|
||||
if (isEmpty()) {
|
||||
return this;
|
||||
}
|
||||
cachedSize = -1;
|
||||
bitField0_ = 0;
|
||||
iKCJDPMPMKL = 0;
|
||||
roomId = 0;
|
||||
lDDCAIKLKDO = 0;
|
||||
siteId = 0;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PropRogueInfo clearQuick() {
|
||||
if (isEmpty()) {
|
||||
return this;
|
||||
}
|
||||
cachedSize = -1;
|
||||
bitField0_ = 0;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (o == this) {
|
||||
return true;
|
||||
}
|
||||
if (!(o instanceof PropRogueInfo)) {
|
||||
return false;
|
||||
}
|
||||
PropRogueInfo other = (PropRogueInfo) o;
|
||||
return bitField0_ == other.bitField0_
|
||||
&& (!hasIKCJDPMPMKL() || iKCJDPMPMKL == other.iKCJDPMPMKL)
|
||||
&& (!hasRoomId() || roomId == other.roomId)
|
||||
&& (!hasLDDCAIKLKDO() || lDDCAIKLKDO == other.lDDCAIKLKDO)
|
||||
&& (!hasSiteId() || siteId == other.siteId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeTo(final ProtoSink output) throws IOException {
|
||||
if ((bitField0_ & 0x00000001) != 0) {
|
||||
output.writeRawByte((byte) 40);
|
||||
output.writeUInt32NoTag(iKCJDPMPMKL);
|
||||
}
|
||||
if ((bitField0_ & 0x00000002) != 0) {
|
||||
output.writeRawByte((byte) 48);
|
||||
output.writeUInt32NoTag(roomId);
|
||||
}
|
||||
if ((bitField0_ & 0x00000004) != 0) {
|
||||
output.writeRawByte((byte) 56);
|
||||
output.writeUInt32NoTag(lDDCAIKLKDO);
|
||||
}
|
||||
if ((bitField0_ & 0x00000008) != 0) {
|
||||
output.writeRawByte((byte) 104);
|
||||
output.writeUInt32NoTag(siteId);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int computeSerializedSize() {
|
||||
int size = 0;
|
||||
if ((bitField0_ & 0x00000001) != 0) {
|
||||
size += 1 + ProtoSink.computeUInt32SizeNoTag(iKCJDPMPMKL);
|
||||
}
|
||||
if ((bitField0_ & 0x00000002) != 0) {
|
||||
size += 1 + ProtoSink.computeUInt32SizeNoTag(roomId);
|
||||
}
|
||||
if ((bitField0_ & 0x00000004) != 0) {
|
||||
size += 1 + ProtoSink.computeUInt32SizeNoTag(lDDCAIKLKDO);
|
||||
}
|
||||
if ((bitField0_ & 0x00000008) != 0) {
|
||||
size += 1 + ProtoSink.computeUInt32SizeNoTag(siteId);
|
||||
}
|
||||
return size;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("fallthrough")
|
||||
public PropRogueInfo mergeFrom(final ProtoSource input) throws IOException {
|
||||
// Enabled Fall-Through Optimization (QuickBuffers)
|
||||
int tag = input.readTag();
|
||||
while (true) {
|
||||
switch (tag) {
|
||||
case 40: {
|
||||
// iKCJDPMPMKL
|
||||
iKCJDPMPMKL = input.readUInt32();
|
||||
bitField0_ |= 0x00000001;
|
||||
tag = input.readTag();
|
||||
if (tag != 48) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
case 48: {
|
||||
// roomId
|
||||
roomId = input.readUInt32();
|
||||
bitField0_ |= 0x00000002;
|
||||
tag = input.readTag();
|
||||
if (tag != 56) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
case 56: {
|
||||
// lDDCAIKLKDO
|
||||
lDDCAIKLKDO = input.readUInt32();
|
||||
bitField0_ |= 0x00000004;
|
||||
tag = input.readTag();
|
||||
if (tag != 104) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
case 104: {
|
||||
// siteId
|
||||
siteId = input.readUInt32();
|
||||
bitField0_ |= 0x00000008;
|
||||
tag = input.readTag();
|
||||
if (tag != 0) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
case 0: {
|
||||
return this;
|
||||
}
|
||||
default: {
|
||||
if (!input.skipField(tag)) {
|
||||
return this;
|
||||
}
|
||||
tag = input.readTag();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeTo(final JsonSink output) throws IOException {
|
||||
output.beginObject();
|
||||
if ((bitField0_ & 0x00000001) != 0) {
|
||||
output.writeUInt32(FieldNames.iKCJDPMPMKL, iKCJDPMPMKL);
|
||||
}
|
||||
if ((bitField0_ & 0x00000002) != 0) {
|
||||
output.writeUInt32(FieldNames.roomId, roomId);
|
||||
}
|
||||
if ((bitField0_ & 0x00000004) != 0) {
|
||||
output.writeUInt32(FieldNames.lDDCAIKLKDO, lDDCAIKLKDO);
|
||||
}
|
||||
if ((bitField0_ & 0x00000008) != 0) {
|
||||
output.writeUInt32(FieldNames.siteId, siteId);
|
||||
}
|
||||
output.endObject();
|
||||
}
|
||||
|
||||
@Override
|
||||
public PropRogueInfo mergeFrom(final JsonSource input) throws IOException {
|
||||
if (!input.beginObject()) {
|
||||
return this;
|
||||
}
|
||||
while (!input.isAtEnd()) {
|
||||
switch (input.readFieldHash()) {
|
||||
case 1976118198: {
|
||||
if (input.isAtField(FieldNames.iKCJDPMPMKL)) {
|
||||
if (!input.trySkipNullValue()) {
|
||||
iKCJDPMPMKL = input.readUInt32();
|
||||
bitField0_ |= 0x00000001;
|
||||
}
|
||||
} else {
|
||||
input.skipUnknownField();
|
||||
}
|
||||
break;
|
||||
}
|
||||
case -925319338:
|
||||
case 1379892991: {
|
||||
if (input.isAtField(FieldNames.roomId)) {
|
||||
if (!input.trySkipNullValue()) {
|
||||
roomId = input.readUInt32();
|
||||
bitField0_ |= 0x00000002;
|
||||
}
|
||||
} else {
|
||||
input.skipUnknownField();
|
||||
}
|
||||
break;
|
||||
}
|
||||
case -1731282410: {
|
||||
if (input.isAtField(FieldNames.lDDCAIKLKDO)) {
|
||||
if (!input.trySkipNullValue()) {
|
||||
lDDCAIKLKDO = input.readUInt32();
|
||||
bitField0_ |= 0x00000004;
|
||||
}
|
||||
} else {
|
||||
input.skipUnknownField();
|
||||
}
|
||||
break;
|
||||
}
|
||||
case -902090046:
|
||||
case 2100001043: {
|
||||
if (input.isAtField(FieldNames.siteId)) {
|
||||
if (!input.trySkipNullValue()) {
|
||||
siteId = input.readUInt32();
|
||||
bitField0_ |= 0x00000008;
|
||||
}
|
||||
} else {
|
||||
input.skipUnknownField();
|
||||
}
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
input.skipUnknownField();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
input.endObject();
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PropRogueInfo clone() {
|
||||
return new PropRogueInfo().copyFrom(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEmpty() {
|
||||
return ((bitField0_) == 0);
|
||||
}
|
||||
|
||||
public static PropRogueInfo parseFrom(final byte[] data) throws InvalidProtocolBufferException {
|
||||
return ProtoMessage.mergeFrom(new PropRogueInfo(), data).checkInitialized();
|
||||
}
|
||||
|
||||
public static PropRogueInfo parseFrom(final ProtoSource input) throws IOException {
|
||||
return ProtoMessage.mergeFrom(new PropRogueInfo(), input).checkInitialized();
|
||||
}
|
||||
|
||||
public static PropRogueInfo parseFrom(final JsonSource input) throws IOException {
|
||||
return ProtoMessage.mergeFrom(new PropRogueInfo(), input).checkInitialized();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return factory for creating PropRogueInfo messages
|
||||
*/
|
||||
public static MessageFactory<PropRogueInfo> getFactory() {
|
||||
return PropRogueInfoFactory.INSTANCE;
|
||||
}
|
||||
|
||||
private enum PropRogueInfoFactory implements MessageFactory<PropRogueInfo> {
|
||||
INSTANCE;
|
||||
|
||||
@Override
|
||||
public PropRogueInfo create() {
|
||||
return PropRogueInfo.newInstance();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Contains name constants used for serializing JSON
|
||||
*/
|
||||
static class FieldNames {
|
||||
static final FieldName iKCJDPMPMKL = FieldName.forField("IKCJDPMPMKL");
|
||||
|
||||
static final FieldName roomId = FieldName.forField("roomId", "room_id");
|
||||
|
||||
static final FieldName lDDCAIKLKDO = FieldName.forField("LDDCAIKLKDO");
|
||||
|
||||
static final FieldName siteId = FieldName.forField("siteId", "site_id");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -38,6 +38,11 @@ public final class ScenePropInfoOuterClass {
|
||||
*/
|
||||
private int propId;
|
||||
|
||||
/**
|
||||
* <code>optional .PropExtraInfo extra_info = 6;</code>
|
||||
*/
|
||||
private final PropExtraInfoOuterClass.PropExtraInfo extraInfo = PropExtraInfoOuterClass.PropExtraInfo.newInstance();
|
||||
|
||||
private ScenePropInfo() {
|
||||
}
|
||||
|
||||
@@ -196,6 +201,63 @@ public final class ScenePropInfoOuterClass {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional .PropExtraInfo extra_info = 6;</code>
|
||||
* @return whether the extraInfo field is set
|
||||
*/
|
||||
public boolean hasExtraInfo() {
|
||||
return (bitField0_ & 0x00000010) != 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional .PropExtraInfo extra_info = 6;</code>
|
||||
* @return this
|
||||
*/
|
||||
public ScenePropInfo clearExtraInfo() {
|
||||
bitField0_ &= ~0x00000010;
|
||||
extraInfo.clear();
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional .PropExtraInfo extra_info = 6;</code>
|
||||
*
|
||||
* This method returns the internal storage object without modifying any has state.
|
||||
* The returned object should not be modified and be treated as read-only.
|
||||
*
|
||||
* Use {@link #getMutableExtraInfo()} if you want to modify it.
|
||||
*
|
||||
* @return internal storage object for reading
|
||||
*/
|
||||
public PropExtraInfoOuterClass.PropExtraInfo getExtraInfo() {
|
||||
return extraInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional .PropExtraInfo extra_info = 6;</code>
|
||||
*
|
||||
* This method returns the internal storage object and sets the corresponding
|
||||
* has state. The returned object will become part of this message and its
|
||||
* contents may be modified as long as the has state is not cleared.
|
||||
*
|
||||
* @return internal storage object for modifications
|
||||
*/
|
||||
public PropExtraInfoOuterClass.PropExtraInfo getMutableExtraInfo() {
|
||||
bitField0_ |= 0x00000010;
|
||||
return extraInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional .PropExtraInfo extra_info = 6;</code>
|
||||
* @param value the extraInfo to set
|
||||
* @return this
|
||||
*/
|
||||
public ScenePropInfo setExtraInfo(final PropExtraInfoOuterClass.PropExtraInfo value) {
|
||||
bitField0_ |= 0x00000010;
|
||||
extraInfo.copyFrom(value);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ScenePropInfo copyFrom(final ScenePropInfo other) {
|
||||
cachedSize = other.cachedSize;
|
||||
@@ -205,6 +267,7 @@ public final class ScenePropInfoOuterClass {
|
||||
propState = other.propState;
|
||||
lifeTimeMs = other.lifeTimeMs;
|
||||
propId = other.propId;
|
||||
extraInfo.copyFrom(other.extraInfo);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
@@ -227,6 +290,9 @@ public final class ScenePropInfoOuterClass {
|
||||
if (other.hasPropId()) {
|
||||
setPropId(other.propId);
|
||||
}
|
||||
if (other.hasExtraInfo()) {
|
||||
getMutableExtraInfo().mergeFrom(other.extraInfo);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -241,6 +307,7 @@ public final class ScenePropInfoOuterClass {
|
||||
propState = 0;
|
||||
lifeTimeMs = 0;
|
||||
propId = 0;
|
||||
extraInfo.clear();
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -251,6 +318,7 @@ public final class ScenePropInfoOuterClass {
|
||||
}
|
||||
cachedSize = -1;
|
||||
bitField0_ = 0;
|
||||
extraInfo.clearQuick();
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -267,7 +335,8 @@ public final class ScenePropInfoOuterClass {
|
||||
&& (!hasCreateTimeMs() || createTimeMs == other.createTimeMs)
|
||||
&& (!hasPropState() || propState == other.propState)
|
||||
&& (!hasLifeTimeMs() || lifeTimeMs == other.lifeTimeMs)
|
||||
&& (!hasPropId() || propId == other.propId);
|
||||
&& (!hasPropId() || propId == other.propId)
|
||||
&& (!hasExtraInfo() || extraInfo.equals(other.extraInfo));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -288,6 +357,10 @@ public final class ScenePropInfoOuterClass {
|
||||
output.writeRawByte((byte) 120);
|
||||
output.writeUInt32NoTag(propId);
|
||||
}
|
||||
if ((bitField0_ & 0x00000010) != 0) {
|
||||
output.writeRawByte((byte) 50);
|
||||
output.writeMessageNoTag(extraInfo);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -305,6 +378,9 @@ public final class ScenePropInfoOuterClass {
|
||||
if ((bitField0_ & 0x00000008) != 0) {
|
||||
size += 1 + ProtoSink.computeUInt32SizeNoTag(propId);
|
||||
}
|
||||
if ((bitField0_ & 0x00000010) != 0) {
|
||||
size += 1 + ProtoSink.computeMessageSizeNoTag(extraInfo);
|
||||
}
|
||||
return size;
|
||||
}
|
||||
|
||||
@@ -347,6 +423,15 @@ public final class ScenePropInfoOuterClass {
|
||||
propId = input.readUInt32();
|
||||
bitField0_ |= 0x00000008;
|
||||
tag = input.readTag();
|
||||
if (tag != 50) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
case 50: {
|
||||
// extraInfo
|
||||
input.readMessage(extraInfo);
|
||||
bitField0_ |= 0x00000010;
|
||||
tag = input.readTag();
|
||||
if (tag != 0) {
|
||||
break;
|
||||
}
|
||||
@@ -380,6 +465,9 @@ public final class ScenePropInfoOuterClass {
|
||||
if ((bitField0_ & 0x00000008) != 0) {
|
||||
output.writeUInt32(FieldNames.propId, propId);
|
||||
}
|
||||
if ((bitField0_ & 0x00000010) != 0) {
|
||||
output.writeMessage(FieldNames.extraInfo, extraInfo);
|
||||
}
|
||||
output.endObject();
|
||||
}
|
||||
|
||||
@@ -438,6 +526,18 @@ public final class ScenePropInfoOuterClass {
|
||||
}
|
||||
break;
|
||||
}
|
||||
case -253631266:
|
||||
case 747541373: {
|
||||
if (input.isAtField(FieldNames.extraInfo)) {
|
||||
if (!input.trySkipNullValue()) {
|
||||
input.readMessage(extraInfo);
|
||||
bitField0_ |= 0x00000010;
|
||||
}
|
||||
} else {
|
||||
input.skipUnknownField();
|
||||
}
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
input.skipUnknownField();
|
||||
break;
|
||||
@@ -497,6 +597,8 @@ public final class ScenePropInfoOuterClass {
|
||||
static final FieldName lifeTimeMs = FieldName.forField("lifeTimeMs", "life_time_ms");
|
||||
|
||||
static final FieldName propId = FieldName.forField("propId", "prop_id");
|
||||
|
||||
static final FieldName extraInfo = FieldName.forField("extraInfo", "extra_info");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,11 +3,16 @@ package emu.lunarcore.game.rogue;
|
||||
import emu.lunarcore.data.GameData;
|
||||
import emu.lunarcore.data.config.GroupInfo;
|
||||
import emu.lunarcore.data.config.MonsterInfo;
|
||||
import emu.lunarcore.data.config.PropInfo;
|
||||
import emu.lunarcore.data.excel.NpcMonsterExcel;
|
||||
import emu.lunarcore.data.excel.PropExcel;
|
||||
import emu.lunarcore.data.excel.RogueMonsterExcel;
|
||||
import emu.lunarcore.game.enums.PropState;
|
||||
import emu.lunarcore.game.scene.Scene;
|
||||
import emu.lunarcore.game.scene.SceneEntityLoader;
|
||||
import emu.lunarcore.game.scene.entity.EntityMonster;
|
||||
import emu.lunarcore.game.scene.entity.EntityProp;
|
||||
import emu.lunarcore.game.scene.entity.extra.PropRogueData;
|
||||
|
||||
public class RogueEntityLoader extends SceneEntityLoader {
|
||||
|
||||
@@ -37,4 +42,65 @@ public class RogueEntityLoader extends SceneEntityLoader {
|
||||
|
||||
return monster;
|
||||
}
|
||||
|
||||
public EntityProp loadProp(Scene scene, GroupInfo group, PropInfo propInfo) {
|
||||
// Make sure player is in a rogue instance
|
||||
RogueInstance rogue = scene.getPlayer().getRogueInstance();
|
||||
if (rogue == null) return null;
|
||||
|
||||
// Set variables here so we can override them later if we need
|
||||
int propId = propInfo.getPropID();
|
||||
PropState state = propInfo.getState();
|
||||
PropRogueData propExtra = null;
|
||||
|
||||
// Rogue Door id is 1000
|
||||
if (propId == 1000) {
|
||||
// Site index
|
||||
int index = 0;
|
||||
|
||||
// Eww
|
||||
if (propInfo.getName().equals("Door2")) {
|
||||
index = 1;
|
||||
}
|
||||
|
||||
// Get portal data
|
||||
RogueRoomData room = rogue.getCurrentRoom();
|
||||
if (room.getNextSiteIds().length > 0) {
|
||||
int siteId = room.getNextSiteIds()[index];
|
||||
int roomId = rogue.getRooms().get(siteId).getRoomId();
|
||||
|
||||
propExtra = new PropRogueData(roomId, siteId);
|
||||
} else {
|
||||
// Exit portal?
|
||||
}
|
||||
|
||||
// Force rogue door to be open
|
||||
propId = 1021; // TODO get proper portal ids
|
||||
state = PropState.Open;
|
||||
}
|
||||
|
||||
// Get prop excel
|
||||
PropExcel propExcel = GameData.getPropExcelMap().get(propId);
|
||||
if (propExcel == null) return null;
|
||||
|
||||
// Create prop from prop info
|
||||
EntityProp prop = new EntityProp(scene, propExcel, propInfo.getPos());
|
||||
prop.getRot().set(propInfo.getRot());
|
||||
prop.setPropInfo(propInfo);
|
||||
prop.setGroupId(group.getId());
|
||||
prop.setInstId(propInfo.getID());
|
||||
prop.setState(state);
|
||||
|
||||
// Overrides
|
||||
if (propExtra != null) {
|
||||
prop.setRogueData(propExtra);
|
||||
}
|
||||
|
||||
// Add trigger
|
||||
if (propInfo.getTrigger() != null) {
|
||||
scene.getTriggers().add(propInfo.getTrigger());
|
||||
}
|
||||
|
||||
return prop;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import emu.lunarcore.data.config.PropInfo;
|
||||
import emu.lunarcore.data.excel.PropExcel;
|
||||
import emu.lunarcore.game.enums.PropState;
|
||||
import emu.lunarcore.game.scene.Scene;
|
||||
import emu.lunarcore.game.scene.entity.extra.PropRogueData;
|
||||
import emu.lunarcore.proto.MotionInfoOuterClass.MotionInfo;
|
||||
import emu.lunarcore.proto.SceneEntityInfoOuterClass.SceneEntityInfo;
|
||||
import emu.lunarcore.proto.ScenePropInfoOuterClass.ScenePropInfo;
|
||||
@@ -14,6 +15,8 @@ import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
public class EntityProp implements GameEntity {
|
||||
@Setter private PropInfo propInfo;
|
||||
|
||||
@Setter private int entityId;
|
||||
@Setter private int groupId;
|
||||
@Setter private int instId;
|
||||
@@ -23,9 +26,8 @@ public class EntityProp implements GameEntity {
|
||||
private final PropExcel excel;
|
||||
private final Position pos;
|
||||
private final Position rot;
|
||||
|
||||
@Setter
|
||||
private PropInfo propInfo;
|
||||
|
||||
@Setter private PropRogueData rogueData;
|
||||
|
||||
public EntityProp(Scene scene, PropExcel excel, Position pos) {
|
||||
this.scene = scene;
|
||||
@@ -62,6 +64,10 @@ public class EntityProp implements GameEntity {
|
||||
var prop = ScenePropInfo.newInstance()
|
||||
.setPropId(this.getPropId())
|
||||
.setPropState(this.getState().getVal());
|
||||
|
||||
if (this.rogueData != null) {
|
||||
prop.setExtraInfo(this.rogueData.toProto());
|
||||
}
|
||||
|
||||
var proto = SceneEntityInfo.newInstance()
|
||||
.setEntityId(this.getEntityId())
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
package emu.lunarcore.game.scene.entity.extra;
|
||||
|
||||
import emu.lunarcore.proto.PropExtraInfoOuterClass.PropExtraInfo;
|
||||
import emu.lunarcore.proto.PropRogueInfoOuterClass.PropRogueInfo;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
public class PropRogueData {
|
||||
private int roomId;
|
||||
private int siteId;
|
||||
|
||||
public PropRogueData(int roomId, int siteId) {
|
||||
this.roomId = roomId;
|
||||
this.siteId = siteId;
|
||||
}
|
||||
|
||||
public PropExtraInfo toProto() {
|
||||
var data = PropRogueInfo.newInstance()
|
||||
.setRoomId(this.getRoomId())
|
||||
.setSiteId(this.getSiteId());
|
||||
|
||||
return PropExtraInfo.newInstance().setRogueInfo(data);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user