diff --git a/src/generated/main/emu/lunarcore/proto/PropExtraInfoOuterClass.java b/src/generated/main/emu/lunarcore/proto/PropExtraInfoOuterClass.java new file mode 100644 index 0000000..c038afc --- /dev/null +++ b/src/generated/main/emu/lunarcore/proto/PropExtraInfoOuterClass.java @@ -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 implements Cloneable { + private static final long serialVersionUID = 0L; + + /** + * optional .PropRogueInfo rogue_info = 9; + */ + 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; + } + + /** + * optional .PropRogueInfo rogue_info = 9; + * @return whether the rogueInfo field is set + */ + public boolean hasRogueInfo() { + return (bitField0_ & 0x00000001) != 0; + } + + /** + * optional .PropRogueInfo rogue_info = 9; + * @return this + */ + public PropExtraInfo clearRogueInfo() { + bitField0_ &= ~0x00000001; + rogueInfo.clear(); + return this; + } + + /** + * optional .PropRogueInfo rogue_info = 9; + * + * 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; + } + + /** + * optional .PropRogueInfo rogue_info = 9; + * + * 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; + } + + /** + * optional .PropRogueInfo rogue_info = 9; + * @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 getFactory() { + return PropExtraInfoFactory.INSTANCE; + } + + private enum PropExtraInfoFactory implements MessageFactory { + 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"); + } + } +} diff --git a/src/generated/main/emu/lunarcore/proto/PropRogueInfoOuterClass.java b/src/generated/main/emu/lunarcore/proto/PropRogueInfoOuterClass.java new file mode 100644 index 0000000..19d7ae3 --- /dev/null +++ b/src/generated/main/emu/lunarcore/proto/PropRogueInfoOuterClass.java @@ -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 implements Cloneable { + private static final long serialVersionUID = 0L; + + /** + * optional uint32 IKCJDPMPMKL = 5; + */ + private int iKCJDPMPMKL; + + /** + * optional uint32 room_id = 6; + */ + private int roomId; + + /** + * optional uint32 LDDCAIKLKDO = 7; + */ + private int lDDCAIKLKDO; + + /** + * optional uint32 site_id = 13; + */ + private int siteId; + + private PropRogueInfo() { + } + + /** + * @return a new empty instance of {@code PropRogueInfo} + */ + public static PropRogueInfo newInstance() { + return new PropRogueInfo(); + } + + /** + * optional uint32 IKCJDPMPMKL = 5; + * @return whether the iKCJDPMPMKL field is set + */ + public boolean hasIKCJDPMPMKL() { + return (bitField0_ & 0x00000001) != 0; + } + + /** + * optional uint32 IKCJDPMPMKL = 5; + * @return this + */ + public PropRogueInfo clearIKCJDPMPMKL() { + bitField0_ &= ~0x00000001; + iKCJDPMPMKL = 0; + return this; + } + + /** + * optional uint32 IKCJDPMPMKL = 5; + * @return the iKCJDPMPMKL + */ + public int getIKCJDPMPMKL() { + return iKCJDPMPMKL; + } + + /** + * optional uint32 IKCJDPMPMKL = 5; + * @param value the iKCJDPMPMKL to set + * @return this + */ + public PropRogueInfo setIKCJDPMPMKL(final int value) { + bitField0_ |= 0x00000001; + iKCJDPMPMKL = value; + return this; + } + + /** + * optional uint32 room_id = 6; + * @return whether the roomId field is set + */ + public boolean hasRoomId() { + return (bitField0_ & 0x00000002) != 0; + } + + /** + * optional uint32 room_id = 6; + * @return this + */ + public PropRogueInfo clearRoomId() { + bitField0_ &= ~0x00000002; + roomId = 0; + return this; + } + + /** + * optional uint32 room_id = 6; + * @return the roomId + */ + public int getRoomId() { + return roomId; + } + + /** + * optional uint32 room_id = 6; + * @param value the roomId to set + * @return this + */ + public PropRogueInfo setRoomId(final int value) { + bitField0_ |= 0x00000002; + roomId = value; + return this; + } + + /** + * optional uint32 LDDCAIKLKDO = 7; + * @return whether the lDDCAIKLKDO field is set + */ + public boolean hasLDDCAIKLKDO() { + return (bitField0_ & 0x00000004) != 0; + } + + /** + * optional uint32 LDDCAIKLKDO = 7; + * @return this + */ + public PropRogueInfo clearLDDCAIKLKDO() { + bitField0_ &= ~0x00000004; + lDDCAIKLKDO = 0; + return this; + } + + /** + * optional uint32 LDDCAIKLKDO = 7; + * @return the lDDCAIKLKDO + */ + public int getLDDCAIKLKDO() { + return lDDCAIKLKDO; + } + + /** + * optional uint32 LDDCAIKLKDO = 7; + * @param value the lDDCAIKLKDO to set + * @return this + */ + public PropRogueInfo setLDDCAIKLKDO(final int value) { + bitField0_ |= 0x00000004; + lDDCAIKLKDO = value; + return this; + } + + /** + * optional uint32 site_id = 13; + * @return whether the siteId field is set + */ + public boolean hasSiteId() { + return (bitField0_ & 0x00000008) != 0; + } + + /** + * optional uint32 site_id = 13; + * @return this + */ + public PropRogueInfo clearSiteId() { + bitField0_ &= ~0x00000008; + siteId = 0; + return this; + } + + /** + * optional uint32 site_id = 13; + * @return the siteId + */ + public int getSiteId() { + return siteId; + } + + /** + * optional uint32 site_id = 13; + * @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 getFactory() { + return PropRogueInfoFactory.INSTANCE; + } + + private enum PropRogueInfoFactory implements MessageFactory { + 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"); + } + } +} diff --git a/src/generated/main/emu/lunarcore/proto/ScenePropInfoOuterClass.java b/src/generated/main/emu/lunarcore/proto/ScenePropInfoOuterClass.java index 8465e83..01b830b 100644 --- a/src/generated/main/emu/lunarcore/proto/ScenePropInfoOuterClass.java +++ b/src/generated/main/emu/lunarcore/proto/ScenePropInfoOuterClass.java @@ -38,6 +38,11 @@ public final class ScenePropInfoOuterClass { */ private int propId; + /** + * optional .PropExtraInfo extra_info = 6; + */ + private final PropExtraInfoOuterClass.PropExtraInfo extraInfo = PropExtraInfoOuterClass.PropExtraInfo.newInstance(); + private ScenePropInfo() { } @@ -196,6 +201,63 @@ public final class ScenePropInfoOuterClass { return this; } + /** + * optional .PropExtraInfo extra_info = 6; + * @return whether the extraInfo field is set + */ + public boolean hasExtraInfo() { + return (bitField0_ & 0x00000010) != 0; + } + + /** + * optional .PropExtraInfo extra_info = 6; + * @return this + */ + public ScenePropInfo clearExtraInfo() { + bitField0_ &= ~0x00000010; + extraInfo.clear(); + return this; + } + + /** + * optional .PropExtraInfo extra_info = 6; + * + * 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; + } + + /** + * optional .PropExtraInfo extra_info = 6; + * + * 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; + } + + /** + * optional .PropExtraInfo extra_info = 6; + * @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"); } } } diff --git a/src/main/java/emu/lunarcore/game/rogue/RogueEntityLoader.java b/src/main/java/emu/lunarcore/game/rogue/RogueEntityLoader.java index 176cda8..cfbb470 100644 --- a/src/main/java/emu/lunarcore/game/rogue/RogueEntityLoader.java +++ b/src/main/java/emu/lunarcore/game/rogue/RogueEntityLoader.java @@ -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; + } } diff --git a/src/main/java/emu/lunarcore/game/scene/entity/EntityProp.java b/src/main/java/emu/lunarcore/game/scene/entity/EntityProp.java index b3e3562..845c935 100644 --- a/src/main/java/emu/lunarcore/game/scene/entity/EntityProp.java +++ b/src/main/java/emu/lunarcore/game/scene/entity/EntityProp.java @@ -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()) diff --git a/src/main/java/emu/lunarcore/game/scene/entity/extra/PropRogueData.java b/src/main/java/emu/lunarcore/game/scene/entity/extra/PropRogueData.java new file mode 100644 index 0000000..15e3f25 --- /dev/null +++ b/src/main/java/emu/lunarcore/game/scene/entity/extra/PropRogueData.java @@ -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); + } + +}