diff --git a/src/generated/main/emu/lunarcore/proto/BuffInfoOuterClass.java b/src/generated/main/emu/lunarcore/proto/BuffInfoOuterClass.java index 51367b3f9..c72a3e617 100644 --- a/src/generated/main/emu/lunarcore/proto/BuffInfoOuterClass.java +++ b/src/generated/main/emu/lunarcore/proto/BuffInfoOuterClass.java @@ -22,37 +22,37 @@ public static final class BuffInfo extends ProtoMessage implements Clo private static final long serialVersionUID = 0L; /** - * optional uint64 FEDNBDBBHHN = 1; + * optional uint64 add_time_ms = 2; */ - private long fEDNBDBBHHN; + private long addTimeMs; /** - * optional float BNEOPNNPFLE = 6; + * optional float life_time = 3; */ - private float bNEOPNNPFLE; + private float lifeTime; /** - * optional uint32 level = 2; + * optional uint32 base_avatar_id = 5; */ - private int level; + private int baseAvatarId; /** - * optional uint32 IPFABMCJDMN = 4; + * optional uint32 count = 6; */ - private int iPFABMCJDMN; + private int count; /** - * optional uint32 count = 12; + * optional uint32 buff_id = 14; */ - private int count; + private int buffId; /** - * optional uint32 base_avatar_id = 14; + * optional uint32 level = 15; */ - private int baseAvatarId; + private int level; /** - * repeated .BuffInfo.DynamicValuesEntry dynamic_values = 3; + * repeated .BuffInfo.DynamicValuesEntry dynamic_values = 7; */ private final RepeatedMessage dynamicValues = RepeatedMessage.newEmptyInstance(DynamicValuesEntry.getFactory()); @@ -67,229 +67,229 @@ public static BuffInfo newInstance() { } /** - * optional uint64 FEDNBDBBHHN = 1; - * @return whether the fEDNBDBBHHN field is set + * optional uint64 add_time_ms = 2; + * @return whether the addTimeMs field is set */ - public boolean hasFEDNBDBBHHN() { + public boolean hasAddTimeMs() { return (bitField0_ & 0x00000001) != 0; } /** - * optional uint64 FEDNBDBBHHN = 1; + * optional uint64 add_time_ms = 2; * @return this */ - public BuffInfo clearFEDNBDBBHHN() { + public BuffInfo clearAddTimeMs() { bitField0_ &= ~0x00000001; - fEDNBDBBHHN = 0L; + addTimeMs = 0L; return this; } /** - * optional uint64 FEDNBDBBHHN = 1; - * @return the fEDNBDBBHHN + * optional uint64 add_time_ms = 2; + * @return the addTimeMs */ - public long getFEDNBDBBHHN() { - return fEDNBDBBHHN; + public long getAddTimeMs() { + return addTimeMs; } /** - * optional uint64 FEDNBDBBHHN = 1; - * @param value the fEDNBDBBHHN to set + * optional uint64 add_time_ms = 2; + * @param value the addTimeMs to set * @return this */ - public BuffInfo setFEDNBDBBHHN(final long value) { + public BuffInfo setAddTimeMs(final long value) { bitField0_ |= 0x00000001; - fEDNBDBBHHN = value; + addTimeMs = value; return this; } /** - * optional float BNEOPNNPFLE = 6; - * @return whether the bNEOPNNPFLE field is set + * optional float life_time = 3; + * @return whether the lifeTime field is set */ - public boolean hasBNEOPNNPFLE() { + public boolean hasLifeTime() { return (bitField0_ & 0x00000002) != 0; } /** - * optional float BNEOPNNPFLE = 6; + * optional float life_time = 3; * @return this */ - public BuffInfo clearBNEOPNNPFLE() { + public BuffInfo clearLifeTime() { bitField0_ &= ~0x00000002; - bNEOPNNPFLE = 0F; + lifeTime = 0F; return this; } /** - * optional float BNEOPNNPFLE = 6; - * @return the bNEOPNNPFLE + * optional float life_time = 3; + * @return the lifeTime */ - public float getBNEOPNNPFLE() { - return bNEOPNNPFLE; + public float getLifeTime() { + return lifeTime; } /** - * optional float BNEOPNNPFLE = 6; - * @param value the bNEOPNNPFLE to set + * optional float life_time = 3; + * @param value the lifeTime to set * @return this */ - public BuffInfo setBNEOPNNPFLE(final float value) { + public BuffInfo setLifeTime(final float value) { bitField0_ |= 0x00000002; - bNEOPNNPFLE = value; + lifeTime = value; return this; } /** - * optional uint32 level = 2; - * @return whether the level field is set + * optional uint32 base_avatar_id = 5; + * @return whether the baseAvatarId field is set */ - public boolean hasLevel() { + public boolean hasBaseAvatarId() { return (bitField0_ & 0x00000004) != 0; } /** - * optional uint32 level = 2; + * optional uint32 base_avatar_id = 5; * @return this */ - public BuffInfo clearLevel() { + public BuffInfo clearBaseAvatarId() { bitField0_ &= ~0x00000004; - level = 0; + baseAvatarId = 0; return this; } /** - * optional uint32 level = 2; - * @return the level + * optional uint32 base_avatar_id = 5; + * @return the baseAvatarId */ - public int getLevel() { - return level; + public int getBaseAvatarId() { + return baseAvatarId; } /** - * optional uint32 level = 2; - * @param value the level to set + * optional uint32 base_avatar_id = 5; + * @param value the baseAvatarId to set * @return this */ - public BuffInfo setLevel(final int value) { + public BuffInfo setBaseAvatarId(final int value) { bitField0_ |= 0x00000004; - level = value; + baseAvatarId = value; return this; } /** - * optional uint32 IPFABMCJDMN = 4; - * @return whether the iPFABMCJDMN field is set + * optional uint32 count = 6; + * @return whether the count field is set */ - public boolean hasIPFABMCJDMN() { + public boolean hasCount() { return (bitField0_ & 0x00000008) != 0; } /** - * optional uint32 IPFABMCJDMN = 4; + * optional uint32 count = 6; * @return this */ - public BuffInfo clearIPFABMCJDMN() { + public BuffInfo clearCount() { bitField0_ &= ~0x00000008; - iPFABMCJDMN = 0; + count = 0; return this; } /** - * optional uint32 IPFABMCJDMN = 4; - * @return the iPFABMCJDMN + * optional uint32 count = 6; + * @return the count */ - public int getIPFABMCJDMN() { - return iPFABMCJDMN; + public int getCount() { + return count; } /** - * optional uint32 IPFABMCJDMN = 4; - * @param value the iPFABMCJDMN to set + * optional uint32 count = 6; + * @param value the count to set * @return this */ - public BuffInfo setIPFABMCJDMN(final int value) { + public BuffInfo setCount(final int value) { bitField0_ |= 0x00000008; - iPFABMCJDMN = value; + count = value; return this; } /** - * optional uint32 count = 12; - * @return whether the count field is set + * optional uint32 buff_id = 14; + * @return whether the buffId field is set */ - public boolean hasCount() { + public boolean hasBuffId() { return (bitField0_ & 0x00000010) != 0; } /** - * optional uint32 count = 12; + * optional uint32 buff_id = 14; * @return this */ - public BuffInfo clearCount() { + public BuffInfo clearBuffId() { bitField0_ &= ~0x00000010; - count = 0; + buffId = 0; return this; } /** - * optional uint32 count = 12; - * @return the count + * optional uint32 buff_id = 14; + * @return the buffId */ - public int getCount() { - return count; + public int getBuffId() { + return buffId; } /** - * optional uint32 count = 12; - * @param value the count to set + * optional uint32 buff_id = 14; + * @param value the buffId to set * @return this */ - public BuffInfo setCount(final int value) { + public BuffInfo setBuffId(final int value) { bitField0_ |= 0x00000010; - count = value; + buffId = value; return this; } /** - * optional uint32 base_avatar_id = 14; - * @return whether the baseAvatarId field is set + * optional uint32 level = 15; + * @return whether the level field is set */ - public boolean hasBaseAvatarId() { + public boolean hasLevel() { return (bitField0_ & 0x00000020) != 0; } /** - * optional uint32 base_avatar_id = 14; + * optional uint32 level = 15; * @return this */ - public BuffInfo clearBaseAvatarId() { + public BuffInfo clearLevel() { bitField0_ &= ~0x00000020; - baseAvatarId = 0; + level = 0; return this; } /** - * optional uint32 base_avatar_id = 14; - * @return the baseAvatarId + * optional uint32 level = 15; + * @return the level */ - public int getBaseAvatarId() { - return baseAvatarId; + public int getLevel() { + return level; } /** - * optional uint32 base_avatar_id = 14; - * @param value the baseAvatarId to set + * optional uint32 level = 15; + * @param value the level to set * @return this */ - public BuffInfo setBaseAvatarId(final int value) { + public BuffInfo setLevel(final int value) { bitField0_ |= 0x00000020; - baseAvatarId = value; + level = value; return this; } /** - * repeated .BuffInfo.DynamicValuesEntry dynamic_values = 3; + * repeated .BuffInfo.DynamicValuesEntry dynamic_values = 7; * @return whether the dynamicValues field is set */ public boolean hasDynamicValues() { @@ -297,7 +297,7 @@ public boolean hasDynamicValues() { } /** - * repeated .BuffInfo.DynamicValuesEntry dynamic_values = 3; + * repeated .BuffInfo.DynamicValuesEntry dynamic_values = 7; * @return this */ public BuffInfo clearDynamicValues() { @@ -307,7 +307,7 @@ public BuffInfo clearDynamicValues() { } /** - * repeated .BuffInfo.DynamicValuesEntry dynamic_values = 3; + * repeated .BuffInfo.DynamicValuesEntry dynamic_values = 7; * * 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. @@ -321,7 +321,7 @@ public RepeatedMessage getDynamicValues() { } /** - * repeated .BuffInfo.DynamicValuesEntry dynamic_values = 3; + * repeated .BuffInfo.DynamicValuesEntry dynamic_values = 7; * * This method returns the internal storage object and sets the corresponding * has state. The returned object will become part of this message and its @@ -335,7 +335,7 @@ public RepeatedMessage getMutableDynamicValues() { } /** - * repeated .BuffInfo.DynamicValuesEntry dynamic_values = 3; + * repeated .BuffInfo.DynamicValuesEntry dynamic_values = 7; * @param value the dynamicValues to add * @return this */ @@ -346,7 +346,7 @@ public BuffInfo addDynamicValues(final DynamicValuesEntry value) { } /** - * repeated .BuffInfo.DynamicValuesEntry dynamic_values = 3; + * repeated .BuffInfo.DynamicValuesEntry dynamic_values = 7; * @param values the dynamicValues to add * @return this */ @@ -361,12 +361,12 @@ public BuffInfo copyFrom(final BuffInfo other) { cachedSize = other.cachedSize; if ((bitField0_ | other.bitField0_) != 0) { bitField0_ = other.bitField0_; - fEDNBDBBHHN = other.fEDNBDBBHHN; - bNEOPNNPFLE = other.bNEOPNNPFLE; - level = other.level; - iPFABMCJDMN = other.iPFABMCJDMN; - count = other.count; + addTimeMs = other.addTimeMs; + lifeTime = other.lifeTime; baseAvatarId = other.baseAvatarId; + count = other.count; + buffId = other.buffId; + level = other.level; dynamicValues.copyFrom(other.dynamicValues); } return this; @@ -378,23 +378,23 @@ public BuffInfo mergeFrom(final BuffInfo other) { return this; } cachedSize = -1; - if (other.hasFEDNBDBBHHN()) { - setFEDNBDBBHHN(other.fEDNBDBBHHN); - } - if (other.hasBNEOPNNPFLE()) { - setBNEOPNNPFLE(other.bNEOPNNPFLE); + if (other.hasAddTimeMs()) { + setAddTimeMs(other.addTimeMs); } - if (other.hasLevel()) { - setLevel(other.level); + if (other.hasLifeTime()) { + setLifeTime(other.lifeTime); } - if (other.hasIPFABMCJDMN()) { - setIPFABMCJDMN(other.iPFABMCJDMN); + if (other.hasBaseAvatarId()) { + setBaseAvatarId(other.baseAvatarId); } if (other.hasCount()) { setCount(other.count); } - if (other.hasBaseAvatarId()) { - setBaseAvatarId(other.baseAvatarId); + if (other.hasBuffId()) { + setBuffId(other.buffId); + } + if (other.hasLevel()) { + setLevel(other.level); } if (other.hasDynamicValues()) { getMutableDynamicValues().addAll(other.dynamicValues); @@ -409,12 +409,12 @@ public BuffInfo clear() { } cachedSize = -1; bitField0_ = 0; - fEDNBDBBHHN = 0L; - bNEOPNNPFLE = 0F; - level = 0; - iPFABMCJDMN = 0; - count = 0; + addTimeMs = 0L; + lifeTime = 0F; baseAvatarId = 0; + count = 0; + buffId = 0; + level = 0; dynamicValues.clear(); return this; } @@ -440,44 +440,44 @@ public boolean equals(Object o) { } BuffInfo other = (BuffInfo) o; return bitField0_ == other.bitField0_ - && (!hasFEDNBDBBHHN() || fEDNBDBBHHN == other.fEDNBDBBHHN) - && (!hasBNEOPNNPFLE() || ProtoUtil.isEqual(bNEOPNNPFLE, other.bNEOPNNPFLE)) - && (!hasLevel() || level == other.level) - && (!hasIPFABMCJDMN() || iPFABMCJDMN == other.iPFABMCJDMN) - && (!hasCount() || count == other.count) + && (!hasAddTimeMs() || addTimeMs == other.addTimeMs) + && (!hasLifeTime() || ProtoUtil.isEqual(lifeTime, other.lifeTime)) && (!hasBaseAvatarId() || baseAvatarId == other.baseAvatarId) + && (!hasCount() || count == other.count) + && (!hasBuffId() || buffId == other.buffId) + && (!hasLevel() || level == other.level) && (!hasDynamicValues() || dynamicValues.equals(other.dynamicValues)); } @Override public void writeTo(final ProtoSink output) throws IOException { if ((bitField0_ & 0x00000001) != 0) { - output.writeRawByte((byte) 8); - output.writeUInt64NoTag(fEDNBDBBHHN); + output.writeRawByte((byte) 16); + output.writeUInt64NoTag(addTimeMs); } if ((bitField0_ & 0x00000002) != 0) { - output.writeRawByte((byte) 53); - output.writeFloatNoTag(bNEOPNNPFLE); + output.writeRawByte((byte) 29); + output.writeFloatNoTag(lifeTime); } if ((bitField0_ & 0x00000004) != 0) { - output.writeRawByte((byte) 16); - output.writeUInt32NoTag(level); + output.writeRawByte((byte) 40); + output.writeUInt32NoTag(baseAvatarId); } if ((bitField0_ & 0x00000008) != 0) { - output.writeRawByte((byte) 32); - output.writeUInt32NoTag(iPFABMCJDMN); + output.writeRawByte((byte) 48); + output.writeUInt32NoTag(count); } if ((bitField0_ & 0x00000010) != 0) { - output.writeRawByte((byte) 96); - output.writeUInt32NoTag(count); + output.writeRawByte((byte) 112); + output.writeUInt32NoTag(buffId); } if ((bitField0_ & 0x00000020) != 0) { - output.writeRawByte((byte) 112); - output.writeUInt32NoTag(baseAvatarId); + output.writeRawByte((byte) 120); + output.writeUInt32NoTag(level); } if ((bitField0_ & 0x00000040) != 0) { for (int i = 0; i < dynamicValues.length(); i++) { - output.writeRawByte((byte) 26); + output.writeRawByte((byte) 58); output.writeMessageNoTag(dynamicValues.get(i)); } } @@ -487,22 +487,22 @@ public void writeTo(final ProtoSink output) throws IOException { protected int computeSerializedSize() { int size = 0; if ((bitField0_ & 0x00000001) != 0) { - size += 1 + ProtoSink.computeUInt64SizeNoTag(fEDNBDBBHHN); + size += 1 + ProtoSink.computeUInt64SizeNoTag(addTimeMs); } if ((bitField0_ & 0x00000002) != 0) { size += 5; } if ((bitField0_ & 0x00000004) != 0) { - size += 1 + ProtoSink.computeUInt32SizeNoTag(level); + size += 1 + ProtoSink.computeUInt32SizeNoTag(baseAvatarId); } if ((bitField0_ & 0x00000008) != 0) { - size += 1 + ProtoSink.computeUInt32SizeNoTag(iPFABMCJDMN); + size += 1 + ProtoSink.computeUInt32SizeNoTag(count); } if ((bitField0_ & 0x00000010) != 0) { - size += 1 + ProtoSink.computeUInt32SizeNoTag(count); + size += 1 + ProtoSink.computeUInt32SizeNoTag(buffId); } if ((bitField0_ & 0x00000020) != 0) { - size += 1 + ProtoSink.computeUInt32SizeNoTag(baseAvatarId); + size += 1 + ProtoSink.computeUInt32SizeNoTag(level); } if ((bitField0_ & 0x00000040) != 0) { size += (1 * dynamicValues.length()) + ProtoSink.computeRepeatedMessageSizeNoTag(dynamicValues); @@ -517,61 +517,61 @@ public BuffInfo mergeFrom(final ProtoSource input) throws IOException { int tag = input.readTag(); while (true) { switch (tag) { - case 8: { - // fEDNBDBBHHN - fEDNBDBBHHN = input.readUInt64(); + case 16: { + // addTimeMs + addTimeMs = input.readUInt64(); bitField0_ |= 0x00000001; tag = input.readTag(); - if (tag != 53) { + if (tag != 29) { break; } } - case 53: { - // bNEOPNNPFLE - bNEOPNNPFLE = input.readFloat(); + case 29: { + // lifeTime + lifeTime = input.readFloat(); bitField0_ |= 0x00000002; tag = input.readTag(); - if (tag != 16) { + if (tag != 40) { break; } } - case 16: { - // level - level = input.readUInt32(); + case 40: { + // baseAvatarId + baseAvatarId = input.readUInt32(); bitField0_ |= 0x00000004; tag = input.readTag(); - if (tag != 32) { + if (tag != 48) { break; } } - case 32: { - // iPFABMCJDMN - iPFABMCJDMN = input.readUInt32(); + case 48: { + // count + count = input.readUInt32(); bitField0_ |= 0x00000008; tag = input.readTag(); - if (tag != 96) { + if (tag != 112) { break; } } - case 96: { - // count - count = input.readUInt32(); + case 112: { + // buffId + buffId = input.readUInt32(); bitField0_ |= 0x00000010; tag = input.readTag(); - if (tag != 112) { + if (tag != 120) { break; } } - case 112: { - // baseAvatarId - baseAvatarId = input.readUInt32(); + case 120: { + // level + level = input.readUInt32(); bitField0_ |= 0x00000020; tag = input.readTag(); - if (tag != 26) { + if (tag != 58) { break; } } - case 26: { + case 58: { // dynamicValues tag = input.readRepeatedMessage(dynamicValues, tag); bitField0_ |= 0x00000040; @@ -597,22 +597,22 @@ public BuffInfo mergeFrom(final ProtoSource input) throws IOException { public void writeTo(final JsonSink output) throws IOException { output.beginObject(); if ((bitField0_ & 0x00000001) != 0) { - output.writeUInt64(FieldNames.fEDNBDBBHHN, fEDNBDBBHHN); + output.writeUInt64(FieldNames.addTimeMs, addTimeMs); } if ((bitField0_ & 0x00000002) != 0) { - output.writeFloat(FieldNames.bNEOPNNPFLE, bNEOPNNPFLE); + output.writeFloat(FieldNames.lifeTime, lifeTime); } if ((bitField0_ & 0x00000004) != 0) { - output.writeUInt32(FieldNames.level, level); + output.writeUInt32(FieldNames.baseAvatarId, baseAvatarId); } if ((bitField0_ & 0x00000008) != 0) { - output.writeUInt32(FieldNames.iPFABMCJDMN, iPFABMCJDMN); + output.writeUInt32(FieldNames.count, count); } if ((bitField0_ & 0x00000010) != 0) { - output.writeUInt32(FieldNames.count, count); + output.writeUInt32(FieldNames.buffId, buffId); } if ((bitField0_ & 0x00000020) != 0) { - output.writeUInt32(FieldNames.baseAvatarId, baseAvatarId); + output.writeUInt32(FieldNames.level, level); } if ((bitField0_ & 0x00000040) != 0) { output.writeRepeatedMessage(FieldNames.dynamicValues, dynamicValues); @@ -627,10 +627,11 @@ public BuffInfo mergeFrom(final JsonSource input) throws IOException { } while (!input.isAtEnd()) { switch (input.readFieldHash()) { - case -1304199581: { - if (input.isAtField(FieldNames.fEDNBDBBHHN)) { + case 19170644: + case 5373626: { + if (input.isAtField(FieldNames.addTimeMs)) { if (!input.trySkipNullValue()) { - fEDNBDBBHHN = input.readUInt64(); + addTimeMs = input.readUInt64(); bitField0_ |= 0x00000001; } } else { @@ -638,10 +639,11 @@ public BuffInfo mergeFrom(final JsonSource input) throws IOException { } break; } - case -406688439: { - if (input.isAtField(FieldNames.bNEOPNNPFLE)) { + case 959617001: + case -306161104: { + if (input.isAtField(FieldNames.lifeTime)) { if (!input.trySkipNullValue()) { - bNEOPNNPFLE = input.readFloat(); + lifeTime = input.readFloat(); bitField0_ |= 0x00000002; } } else { @@ -649,10 +651,11 @@ public BuffInfo mergeFrom(final JsonSource input) throws IOException { } break; } - case 102865796: { - if (input.isAtField(FieldNames.level)) { + case 118022725: + case -1756826157: { + if (input.isAtField(FieldNames.baseAvatarId)) { if (!input.trySkipNullValue()) { - level = input.readUInt32(); + baseAvatarId = input.readUInt32(); bitField0_ |= 0x00000004; } } else { @@ -660,10 +663,10 @@ public BuffInfo mergeFrom(final JsonSource input) throws IOException { } break; } - case -509586607: { - if (input.isAtField(FieldNames.iPFABMCJDMN)) { + case 94851343: { + if (input.isAtField(FieldNames.count)) { if (!input.trySkipNullValue()) { - iPFABMCJDMN = input.readUInt32(); + count = input.readUInt32(); bitField0_ |= 0x00000008; } } else { @@ -671,10 +674,11 @@ public BuffInfo mergeFrom(final JsonSource input) throws IOException { } break; } - case 94851343: { - if (input.isAtField(FieldNames.count)) { + case -1378119474: + case 227990663: { + if (input.isAtField(FieldNames.buffId)) { if (!input.trySkipNullValue()) { - count = input.readUInt32(); + buffId = input.readUInt32(); bitField0_ |= 0x00000010; } } else { @@ -682,11 +686,10 @@ public BuffInfo mergeFrom(final JsonSource input) throws IOException { } break; } - case 118022725: - case -1756826157: { - if (input.isAtField(FieldNames.baseAvatarId)) { + case 102865796: { + if (input.isAtField(FieldNames.level)) { if (!input.trySkipNullValue()) { - baseAvatarId = input.readUInt32(); + level = input.readUInt32(); bitField0_ |= 0x00000020; } } else { @@ -1112,17 +1115,17 @@ public BuffInfo create() { * Contains name constants used for serializing JSON */ static class FieldNames { - static final FieldName fEDNBDBBHHN = FieldName.forField("FEDNBDBBHHN"); + static final FieldName addTimeMs = FieldName.forField("addTimeMs", "add_time_ms"); - static final FieldName bNEOPNNPFLE = FieldName.forField("BNEOPNNPFLE"); - - static final FieldName level = FieldName.forField("level"); + static final FieldName lifeTime = FieldName.forField("lifeTime", "life_time"); - static final FieldName iPFABMCJDMN = FieldName.forField("IPFABMCJDMN"); + static final FieldName baseAvatarId = FieldName.forField("baseAvatarId", "base_avatar_id"); static final FieldName count = FieldName.forField("count"); - static final FieldName baseAvatarId = FieldName.forField("baseAvatarId", "base_avatar_id"); + static final FieldName buffId = FieldName.forField("buffId", "buff_id"); + + static final FieldName level = FieldName.forField("level"); static final FieldName dynamicValues = FieldName.forField("dynamicValues", "dynamic_values"); } diff --git a/src/generated/main/emu/lunarcore/proto/ClientDownloadDataScNotifyOuterClass.java b/src/generated/main/emu/lunarcore/proto/ClientDownloadDataScNotifyOuterClass.java new file mode 100644 index 000000000..0e01e78d4 --- /dev/null +++ b/src/generated/main/emu/lunarcore/proto/ClientDownloadDataScNotifyOuterClass.java @@ -0,0 +1,730 @@ +// 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; +import us.hebi.quickbuf.RepeatedByte; + +public final class ClientDownloadDataScNotifyOuterClass { + /** + * Protobuf type {@code ClientDownloadDataScNotify} + */ + public static final class ClientDownloadDataScNotify extends ProtoMessage implements Cloneable { + private static final long serialVersionUID = 0L; + + /** + * optional .ClientDownloadDataScNotify.ClientDownloadData download_data = 5; + */ + private final ClientDownloadData downloadData = ClientDownloadData.newInstance(); + + private ClientDownloadDataScNotify() { + } + + /** + * @return a new empty instance of {@code ClientDownloadDataScNotify} + */ + public static ClientDownloadDataScNotify newInstance() { + return new ClientDownloadDataScNotify(); + } + + /** + * optional .ClientDownloadDataScNotify.ClientDownloadData download_data = 5; + * @return whether the downloadData field is set + */ + public boolean hasDownloadData() { + return (bitField0_ & 0x00000001) != 0; + } + + /** + * optional .ClientDownloadDataScNotify.ClientDownloadData download_data = 5; + * @return this + */ + public ClientDownloadDataScNotify clearDownloadData() { + bitField0_ &= ~0x00000001; + downloadData.clear(); + return this; + } + + /** + * optional .ClientDownloadDataScNotify.ClientDownloadData download_data = 5; + * + * 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 #getMutableDownloadData()} if you want to modify it. + * + * @return internal storage object for reading + */ + public ClientDownloadData getDownloadData() { + return downloadData; + } + + /** + * optional .ClientDownloadDataScNotify.ClientDownloadData download_data = 5; + * + * 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 ClientDownloadData getMutableDownloadData() { + bitField0_ |= 0x00000001; + return downloadData; + } + + /** + * optional .ClientDownloadDataScNotify.ClientDownloadData download_data = 5; + * @param value the downloadData to set + * @return this + */ + public ClientDownloadDataScNotify setDownloadData(final ClientDownloadData value) { + bitField0_ |= 0x00000001; + downloadData.copyFrom(value); + return this; + } + + @Override + public ClientDownloadDataScNotify copyFrom(final ClientDownloadDataScNotify other) { + cachedSize = other.cachedSize; + if ((bitField0_ | other.bitField0_) != 0) { + bitField0_ = other.bitField0_; + downloadData.copyFrom(other.downloadData); + } + return this; + } + + @Override + public ClientDownloadDataScNotify mergeFrom(final ClientDownloadDataScNotify other) { + if (other.isEmpty()) { + return this; + } + cachedSize = -1; + if (other.hasDownloadData()) { + getMutableDownloadData().mergeFrom(other.downloadData); + } + return this; + } + + @Override + public ClientDownloadDataScNotify clear() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + downloadData.clear(); + return this; + } + + @Override + public ClientDownloadDataScNotify clearQuick() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + downloadData.clearQuick(); + return this; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (!(o instanceof ClientDownloadDataScNotify)) { + return false; + } + ClientDownloadDataScNotify other = (ClientDownloadDataScNotify) o; + return bitField0_ == other.bitField0_ + && (!hasDownloadData() || downloadData.equals(other.downloadData)); + } + + @Override + public void writeTo(final ProtoSink output) throws IOException { + if ((bitField0_ & 0x00000001) != 0) { + output.writeRawByte((byte) 42); + output.writeMessageNoTag(downloadData); + } + } + + @Override + protected int computeSerializedSize() { + int size = 0; + if ((bitField0_ & 0x00000001) != 0) { + size += 1 + ProtoSink.computeMessageSizeNoTag(downloadData); + } + return size; + } + + @Override + @SuppressWarnings("fallthrough") + public ClientDownloadDataScNotify mergeFrom(final ProtoSource input) throws IOException { + // Enabled Fall-Through Optimization (QuickBuffers) + int tag = input.readTag(); + while (true) { + switch (tag) { + case 42: { + // downloadData + input.readMessage(downloadData); + 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.downloadData, downloadData); + } + output.endObject(); + } + + @Override + public ClientDownloadDataScNotify mergeFrom(final JsonSource input) throws IOException { + if (!input.beginObject()) { + return this; + } + while (!input.isAtEnd()) { + switch (input.readFieldHash()) { + case 1108584530: + case 31388929: { + if (input.isAtField(FieldNames.downloadData)) { + if (!input.trySkipNullValue()) { + input.readMessage(downloadData); + bitField0_ |= 0x00000001; + } + } else { + input.skipUnknownField(); + } + break; + } + default: { + input.skipUnknownField(); + break; + } + } + } + input.endObject(); + return this; + } + + @Override + public ClientDownloadDataScNotify clone() { + return new ClientDownloadDataScNotify().copyFrom(this); + } + + @Override + public boolean isEmpty() { + return ((bitField0_) == 0); + } + + public static ClientDownloadDataScNotify parseFrom(final byte[] data) throws + InvalidProtocolBufferException { + return ProtoMessage.mergeFrom(new ClientDownloadDataScNotify(), data).checkInitialized(); + } + + public static ClientDownloadDataScNotify parseFrom(final ProtoSource input) throws IOException { + return ProtoMessage.mergeFrom(new ClientDownloadDataScNotify(), input).checkInitialized(); + } + + public static ClientDownloadDataScNotify parseFrom(final JsonSource input) throws IOException { + return ProtoMessage.mergeFrom(new ClientDownloadDataScNotify(), input).checkInitialized(); + } + + /** + * @return factory for creating ClientDownloadDataScNotify messages + */ + public static MessageFactory getFactory() { + return ClientDownloadDataScNotifyFactory.INSTANCE; + } + + /** + * Protobuf type {@code ClientDownloadData} + */ + public static final class ClientDownloadData extends ProtoMessage implements Cloneable { + private static final long serialVersionUID = 0L; + + /** + * optional int64 time = 2; + */ + private long time; + + /** + * optional uint32 version = 1; + */ + private int version; + + /** + * optional bytes data = 3; + */ + private final RepeatedByte data = RepeatedByte.newEmptyInstance(); + + private ClientDownloadData() { + } + + /** + * @return a new empty instance of {@code ClientDownloadData} + */ + public static ClientDownloadData newInstance() { + return new ClientDownloadData(); + } + + /** + * optional int64 time = 2; + * @return whether the time field is set + */ + public boolean hasTime() { + return (bitField0_ & 0x00000001) != 0; + } + + /** + * optional int64 time = 2; + * @return this + */ + public ClientDownloadData clearTime() { + bitField0_ &= ~0x00000001; + time = 0L; + return this; + } + + /** + * optional int64 time = 2; + * @return the time + */ + public long getTime() { + return time; + } + + /** + * optional int64 time = 2; + * @param value the time to set + * @return this + */ + public ClientDownloadData setTime(final long value) { + bitField0_ |= 0x00000001; + time = value; + return this; + } + + /** + * optional uint32 version = 1; + * @return whether the version field is set + */ + public boolean hasVersion() { + return (bitField0_ & 0x00000002) != 0; + } + + /** + * optional uint32 version = 1; + * @return this + */ + public ClientDownloadData clearVersion() { + bitField0_ &= ~0x00000002; + version = 0; + return this; + } + + /** + * optional uint32 version = 1; + * @return the version + */ + public int getVersion() { + return version; + } + + /** + * optional uint32 version = 1; + * @param value the version to set + * @return this + */ + public ClientDownloadData setVersion(final int value) { + bitField0_ |= 0x00000002; + version = value; + return this; + } + + /** + * optional bytes data = 3; + * @return whether the data field is set + */ + public boolean hasData() { + return (bitField0_ & 0x00000004) != 0; + } + + /** + * optional bytes data = 3; + * @return this + */ + public ClientDownloadData clearData() { + bitField0_ &= ~0x00000004; + data.clear(); + return this; + } + + /** + * optional bytes data = 3; + * + * 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 #getMutableData()} if you want to modify it. + * + * @return internal storage object for reading + */ + public RepeatedByte getData() { + return data; + } + + /** + * optional bytes data = 3; + * + * 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 RepeatedByte getMutableData() { + bitField0_ |= 0x00000004; + return data; + } + + /** + * optional bytes data = 3; + * @param value the data to add + * @return this + */ + public ClientDownloadData addData(final byte value) { + bitField0_ |= 0x00000004; + data.add(value); + return this; + } + + /** + * optional bytes data = 3; + * @param values the data to add + * @return this + */ + public ClientDownloadData addAllData(final byte... values) { + bitField0_ |= 0x00000004; + data.addAll(values); + return this; + } + + /** + * optional bytes data = 3; + * @param values the data to set + * @return this + */ + public ClientDownloadData setData(final byte... values) { + bitField0_ |= 0x00000004; + data.copyFrom(values); + return this; + } + + @Override + public ClientDownloadData copyFrom(final ClientDownloadData other) { + cachedSize = other.cachedSize; + if ((bitField0_ | other.bitField0_) != 0) { + bitField0_ = other.bitField0_; + time = other.time; + version = other.version; + data.copyFrom(other.data); + } + return this; + } + + @Override + public ClientDownloadData mergeFrom(final ClientDownloadData other) { + if (other.isEmpty()) { + return this; + } + cachedSize = -1; + if (other.hasTime()) { + setTime(other.time); + } + if (other.hasVersion()) { + setVersion(other.version); + } + if (other.hasData()) { + getMutableData().copyFrom(other.data); + } + return this; + } + + @Override + public ClientDownloadData clear() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + time = 0L; + version = 0; + data.clear(); + return this; + } + + @Override + public ClientDownloadData clearQuick() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + data.clear(); + return this; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (!(o instanceof ClientDownloadData)) { + return false; + } + ClientDownloadData other = (ClientDownloadData) o; + return bitField0_ == other.bitField0_ + && (!hasTime() || time == other.time) + && (!hasVersion() || version == other.version) + && (!hasData() || data.equals(other.data)); + } + + @Override + public void writeTo(final ProtoSink output) throws IOException { + if ((bitField0_ & 0x00000001) != 0) { + output.writeRawByte((byte) 16); + output.writeInt64NoTag(time); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeRawByte((byte) 8); + output.writeUInt32NoTag(version); + } + if ((bitField0_ & 0x00000004) != 0) { + output.writeRawByte((byte) 26); + output.writeBytesNoTag(data); + } + } + + @Override + protected int computeSerializedSize() { + int size = 0; + if ((bitField0_ & 0x00000001) != 0) { + size += 1 + ProtoSink.computeInt64SizeNoTag(time); + } + if ((bitField0_ & 0x00000002) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(version); + } + if ((bitField0_ & 0x00000004) != 0) { + size += 1 + ProtoSink.computeBytesSizeNoTag(data); + } + return size; + } + + @Override + @SuppressWarnings("fallthrough") + public ClientDownloadData mergeFrom(final ProtoSource input) throws IOException { + // Enabled Fall-Through Optimization (QuickBuffers) + int tag = input.readTag(); + while (true) { + switch (tag) { + case 16: { + // time + time = input.readInt64(); + bitField0_ |= 0x00000001; + tag = input.readTag(); + if (tag != 8) { + break; + } + } + case 8: { + // version + version = input.readUInt32(); + bitField0_ |= 0x00000002; + tag = input.readTag(); + if (tag != 26) { + break; + } + } + case 26: { + // data + input.readBytes(data); + bitField0_ |= 0x00000004; + 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.writeInt64(FieldNames.time, time); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeUInt32(FieldNames.version, version); + } + if ((bitField0_ & 0x00000004) != 0) { + output.writeBytes(FieldNames.data, data); + } + output.endObject(); + } + + @Override + public ClientDownloadData mergeFrom(final JsonSource input) throws IOException { + if (!input.beginObject()) { + return this; + } + while (!input.isAtEnd()) { + switch (input.readFieldHash()) { + case 3560141: { + if (input.isAtField(FieldNames.time)) { + if (!input.trySkipNullValue()) { + time = input.readInt64(); + bitField0_ |= 0x00000001; + } + } else { + input.skipUnknownField(); + } + break; + } + case 351608024: { + if (input.isAtField(FieldNames.version)) { + if (!input.trySkipNullValue()) { + version = input.readUInt32(); + bitField0_ |= 0x00000002; + } + } else { + input.skipUnknownField(); + } + break; + } + case 3076010: { + if (input.isAtField(FieldNames.data)) { + if (!input.trySkipNullValue()) { + input.readBytes(data); + bitField0_ |= 0x00000004; + } + } else { + input.skipUnknownField(); + } + break; + } + default: { + input.skipUnknownField(); + break; + } + } + } + input.endObject(); + return this; + } + + @Override + public ClientDownloadData clone() { + return new ClientDownloadData().copyFrom(this); + } + + @Override + public boolean isEmpty() { + return ((bitField0_) == 0); + } + + public static ClientDownloadData parseFrom(final byte[] data) throws + InvalidProtocolBufferException { + return ProtoMessage.mergeFrom(new ClientDownloadData(), data).checkInitialized(); + } + + public static ClientDownloadData parseFrom(final ProtoSource input) throws IOException { + return ProtoMessage.mergeFrom(new ClientDownloadData(), input).checkInitialized(); + } + + public static ClientDownloadData parseFrom(final JsonSource input) throws IOException { + return ProtoMessage.mergeFrom(new ClientDownloadData(), input).checkInitialized(); + } + + /** + * @return factory for creating ClientDownloadData messages + */ + public static MessageFactory getFactory() { + return ClientDownloadDataFactory.INSTANCE; + } + + private enum ClientDownloadDataFactory implements MessageFactory { + INSTANCE; + + @Override + public ClientDownloadData create() { + return ClientDownloadData.newInstance(); + } + } + + /** + * Contains name constants used for serializing JSON + */ + static class FieldNames { + static final FieldName time = FieldName.forField("time"); + + static final FieldName version = FieldName.forField("version"); + + static final FieldName data = FieldName.forField("data"); + } + } + + private enum ClientDownloadDataScNotifyFactory implements MessageFactory { + INSTANCE; + + @Override + public ClientDownloadDataScNotify create() { + return ClientDownloadDataScNotify.newInstance(); + } + } + + /** + * Contains name constants used for serializing JSON + */ + static class FieldNames { + static final FieldName downloadData = FieldName.forField("downloadData", "download_data"); + } + } +} diff --git a/src/generated/main/emu/lunarcore/proto/EntityBuffChangeInfoOuterClass.java b/src/generated/main/emu/lunarcore/proto/EntityBuffChangeInfoOuterClass.java new file mode 100644 index 000000000..f887a1d31 --- /dev/null +++ b/src/generated/main/emu/lunarcore/proto/EntityBuffChangeInfoOuterClass.java @@ -0,0 +1,473 @@ +// 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 EntityBuffChangeInfoOuterClass { + /** + * Protobuf type {@code EntityBuffChangeInfo} + */ + public static final class EntityBuffChangeInfo extends ProtoMessage implements Cloneable { + private static final long serialVersionUID = 0L; + + /** + * optional uint32 CBOEIMDHBIJ = 5; + */ + private int cBOEIMDHBIJ; + + /** + * optional uint32 entity_id = 8; + */ + private int entityId; + + /** + * optional .BuffInfo buff_change_info = 4; + */ + private final BuffInfoOuterClass.BuffInfo buffChangeInfo = BuffInfoOuterClass.BuffInfo.newInstance(); + + private EntityBuffChangeInfo() { + } + + /** + * @return a new empty instance of {@code EntityBuffChangeInfo} + */ + public static EntityBuffChangeInfo newInstance() { + return new EntityBuffChangeInfo(); + } + + public boolean hasInfo() { + return (((bitField0_ & 0x00000003)) != 0); + } + + public EntityBuffChangeInfo clearInfo() { + if (hasInfo()) { + clearCBOEIMDHBIJ(); + clearBuffChangeInfo(); + } + return this; + } + + private void clearInfoOtherCBOEIMDHBIJ() { + if ((((bitField0_ & 0x00000002)) != 0)) { + clearBuffChangeInfo(); + } + } + + private void clearInfoOtherBuffChangeInfo() { + if ((((bitField0_ & 0x00000001)) != 0)) { + clearCBOEIMDHBIJ(); + } + } + + /** + * optional uint32 CBOEIMDHBIJ = 5; + * @return whether the cBOEIMDHBIJ field is set + */ + public boolean hasCBOEIMDHBIJ() { + return (bitField0_ & 0x00000001) != 0; + } + + /** + * optional uint32 CBOEIMDHBIJ = 5; + * @return this + */ + public EntityBuffChangeInfo clearCBOEIMDHBIJ() { + bitField0_ &= ~0x00000001; + cBOEIMDHBIJ = 0; + return this; + } + + /** + * optional uint32 CBOEIMDHBIJ = 5; + * @return the cBOEIMDHBIJ + */ + public int getCBOEIMDHBIJ() { + return cBOEIMDHBIJ; + } + + /** + * optional uint32 CBOEIMDHBIJ = 5; + * @param value the cBOEIMDHBIJ to set + * @return this + */ + public EntityBuffChangeInfo setCBOEIMDHBIJ(final int value) { + clearInfoOtherCBOEIMDHBIJ(); + bitField0_ |= 0x00000001; + cBOEIMDHBIJ = value; + return this; + } + + /** + * optional uint32 entity_id = 8; + * @return whether the entityId field is set + */ + public boolean hasEntityId() { + return (bitField0_ & 0x00000004) != 0; + } + + /** + * optional uint32 entity_id = 8; + * @return this + */ + public EntityBuffChangeInfo clearEntityId() { + bitField0_ &= ~0x00000004; + entityId = 0; + return this; + } + + /** + * optional uint32 entity_id = 8; + * @return the entityId + */ + public int getEntityId() { + return entityId; + } + + /** + * optional uint32 entity_id = 8; + * @param value the entityId to set + * @return this + */ + public EntityBuffChangeInfo setEntityId(final int value) { + bitField0_ |= 0x00000004; + entityId = value; + return this; + } + + /** + * optional .BuffInfo buff_change_info = 4; + * @return whether the buffChangeInfo field is set + */ + public boolean hasBuffChangeInfo() { + return (bitField0_ & 0x00000002) != 0; + } + + /** + * optional .BuffInfo buff_change_info = 4; + * @return this + */ + public EntityBuffChangeInfo clearBuffChangeInfo() { + bitField0_ &= ~0x00000002; + buffChangeInfo.clear(); + return this; + } + + /** + * optional .BuffInfo buff_change_info = 4; + * + * 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 #getMutableBuffChangeInfo()} if you want to modify it. + * + * @return internal storage object for reading + */ + public BuffInfoOuterClass.BuffInfo getBuffChangeInfo() { + return buffChangeInfo; + } + + /** + * optional .BuffInfo buff_change_info = 4; + * + * 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 BuffInfoOuterClass.BuffInfo getMutableBuffChangeInfo() { + clearInfoOtherBuffChangeInfo(); + bitField0_ |= 0x00000002; + return buffChangeInfo; + } + + /** + * optional .BuffInfo buff_change_info = 4; + * @param value the buffChangeInfo to set + * @return this + */ + public EntityBuffChangeInfo setBuffChangeInfo(final BuffInfoOuterClass.BuffInfo value) { + clearInfoOtherBuffChangeInfo(); + bitField0_ |= 0x00000002; + buffChangeInfo.copyFrom(value); + return this; + } + + @Override + public EntityBuffChangeInfo copyFrom(final EntityBuffChangeInfo other) { + cachedSize = other.cachedSize; + if ((bitField0_ | other.bitField0_) != 0) { + bitField0_ = other.bitField0_; + cBOEIMDHBIJ = other.cBOEIMDHBIJ; + entityId = other.entityId; + buffChangeInfo.copyFrom(other.buffChangeInfo); + } + return this; + } + + @Override + public EntityBuffChangeInfo mergeFrom(final EntityBuffChangeInfo other) { + if (other.isEmpty()) { + return this; + } + cachedSize = -1; + if (other.hasCBOEIMDHBIJ()) { + setCBOEIMDHBIJ(other.cBOEIMDHBIJ); + } + if (other.hasEntityId()) { + setEntityId(other.entityId); + } + if (other.hasBuffChangeInfo()) { + getMutableBuffChangeInfo().mergeFrom(other.buffChangeInfo); + } + return this; + } + + @Override + public EntityBuffChangeInfo clear() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + cBOEIMDHBIJ = 0; + entityId = 0; + buffChangeInfo.clear(); + return this; + } + + @Override + public EntityBuffChangeInfo clearQuick() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + buffChangeInfo.clearQuick(); + return this; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (!(o instanceof EntityBuffChangeInfo)) { + return false; + } + EntityBuffChangeInfo other = (EntityBuffChangeInfo) o; + return bitField0_ == other.bitField0_ + && (!hasCBOEIMDHBIJ() || cBOEIMDHBIJ == other.cBOEIMDHBIJ) + && (!hasEntityId() || entityId == other.entityId) + && (!hasBuffChangeInfo() || buffChangeInfo.equals(other.buffChangeInfo)); + } + + @Override + public void writeTo(final ProtoSink output) throws IOException { + if ((bitField0_ & 0x00000001) != 0) { + output.writeRawByte((byte) 40); + output.writeUInt32NoTag(cBOEIMDHBIJ); + } + if ((bitField0_ & 0x00000004) != 0) { + output.writeRawByte((byte) 64); + output.writeUInt32NoTag(entityId); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeRawByte((byte) 34); + output.writeMessageNoTag(buffChangeInfo); + } + } + + @Override + protected int computeSerializedSize() { + int size = 0; + if ((bitField0_ & 0x00000001) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(cBOEIMDHBIJ); + } + if ((bitField0_ & 0x00000004) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(entityId); + } + if ((bitField0_ & 0x00000002) != 0) { + size += 1 + ProtoSink.computeMessageSizeNoTag(buffChangeInfo); + } + return size; + } + + @Override + @SuppressWarnings("fallthrough") + public EntityBuffChangeInfo mergeFrom(final ProtoSource input) throws IOException { + // Enabled Fall-Through Optimization (QuickBuffers) + int tag = input.readTag(); + while (true) { + switch (tag) { + case 40: { + // cBOEIMDHBIJ + clearInfoOtherCBOEIMDHBIJ(); + cBOEIMDHBIJ = input.readUInt32(); + bitField0_ |= 0x00000001; + tag = input.readTag(); + if (tag != 64) { + break; + } + } + case 64: { + // entityId + entityId = input.readUInt32(); + bitField0_ |= 0x00000004; + tag = input.readTag(); + if (tag != 34) { + break; + } + } + case 34: { + // buffChangeInfo + clearInfoOtherBuffChangeInfo(); + input.readMessage(buffChangeInfo); + bitField0_ |= 0x00000002; + 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.cBOEIMDHBIJ, cBOEIMDHBIJ); + } + if ((bitField0_ & 0x00000004) != 0) { + output.writeUInt32(FieldNames.entityId, entityId); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeMessage(FieldNames.buffChangeInfo, buffChangeInfo); + } + output.endObject(); + } + + @Override + public EntityBuffChangeInfo mergeFrom(final JsonSource input) throws IOException { + if (!input.beginObject()) { + return this; + } + while (!input.isAtEnd()) { + switch (input.readFieldHash()) { + case 1350914854: { + if (input.isAtField(FieldNames.cBOEIMDHBIJ)) { + if (!input.trySkipNullValue()) { + clearInfoOtherCBOEIMDHBIJ(); + cBOEIMDHBIJ = input.readUInt32(); + bitField0_ |= 0x00000001; + } + } else { + input.skipUnknownField(); + } + break; + } + case -2102099874: + case -740565257: { + if (input.isAtField(FieldNames.entityId)) { + if (!input.trySkipNullValue()) { + entityId = input.readUInt32(); + bitField0_ |= 0x00000004; + } + } else { + input.skipUnknownField(); + } + break; + } + case -731204303: + case -369384975: { + if (input.isAtField(FieldNames.buffChangeInfo)) { + if (!input.trySkipNullValue()) { + clearInfoOtherBuffChangeInfo(); + input.readMessage(buffChangeInfo); + bitField0_ |= 0x00000002; + } + } else { + input.skipUnknownField(); + } + break; + } + default: { + input.skipUnknownField(); + break; + } + } + } + input.endObject(); + return this; + } + + @Override + public EntityBuffChangeInfo clone() { + return new EntityBuffChangeInfo().copyFrom(this); + } + + @Override + public boolean isEmpty() { + return ((bitField0_) == 0); + } + + public static EntityBuffChangeInfo parseFrom(final byte[] data) throws + InvalidProtocolBufferException { + return ProtoMessage.mergeFrom(new EntityBuffChangeInfo(), data).checkInitialized(); + } + + public static EntityBuffChangeInfo parseFrom(final ProtoSource input) throws IOException { + return ProtoMessage.mergeFrom(new EntityBuffChangeInfo(), input).checkInitialized(); + } + + public static EntityBuffChangeInfo parseFrom(final JsonSource input) throws IOException { + return ProtoMessage.mergeFrom(new EntityBuffChangeInfo(), input).checkInitialized(); + } + + /** + * @return factory for creating EntityBuffChangeInfo messages + */ + public static MessageFactory getFactory() { + return EntityBuffChangeInfoFactory.INSTANCE; + } + + private enum EntityBuffChangeInfoFactory implements MessageFactory { + INSTANCE; + + @Override + public EntityBuffChangeInfo create() { + return EntityBuffChangeInfo.newInstance(); + } + } + + /** + * Contains name constants used for serializing JSON + */ + static class FieldNames { + static final FieldName cBOEIMDHBIJ = FieldName.forField("CBOEIMDHBIJ"); + + static final FieldName entityId = FieldName.forField("entityId", "entity_id"); + + static final FieldName buffChangeInfo = FieldName.forField("buffChangeInfo", "buff_change_info"); + } + } +} diff --git a/src/generated/main/emu/lunarcore/proto/RefreshTriggerByClientCsReqOuterClass.java b/src/generated/main/emu/lunarcore/proto/RefreshTriggerByClientCsReqOuterClass.java new file mode 100644 index 000000000..47804311d --- /dev/null +++ b/src/generated/main/emu/lunarcore/proto/RefreshTriggerByClientCsReqOuterClass.java @@ -0,0 +1,597 @@ +// 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; +import us.hebi.quickbuf.RepeatedInt; +import us.hebi.quickbuf.Utf8String; + +public final class RefreshTriggerByClientCsReqOuterClass { + /** + * Protobuf type {@code RefreshTriggerByClientCsReq} + */ + public static final class RefreshTriggerByClientCsReq extends ProtoMessage implements Cloneable { + private static final long serialVersionUID = 0L; + + /** + * optional uint32 trigger_entity_id = 6; + */ + private int triggerEntityId; + + /** + * optional .MotionInfo trigger_motion = 11; + */ + private final MotionInfoOuterClass.MotionInfo triggerMotion = MotionInfoOuterClass.MotionInfo.newInstance(); + + /** + * optional string trigger_name = 8; + */ + private final Utf8String triggerName = Utf8String.newEmptyInstance(); + + /** + * repeated uint32 trigger_target_id_list = 3; + */ + private final RepeatedInt triggerTargetIdList = RepeatedInt.newEmptyInstance(); + + private RefreshTriggerByClientCsReq() { + } + + /** + * @return a new empty instance of {@code RefreshTriggerByClientCsReq} + */ + public static RefreshTriggerByClientCsReq newInstance() { + return new RefreshTriggerByClientCsReq(); + } + + /** + * optional uint32 trigger_entity_id = 6; + * @return whether the triggerEntityId field is set + */ + public boolean hasTriggerEntityId() { + return (bitField0_ & 0x00000001) != 0; + } + + /** + * optional uint32 trigger_entity_id = 6; + * @return this + */ + public RefreshTriggerByClientCsReq clearTriggerEntityId() { + bitField0_ &= ~0x00000001; + triggerEntityId = 0; + return this; + } + + /** + * optional uint32 trigger_entity_id = 6; + * @return the triggerEntityId + */ + public int getTriggerEntityId() { + return triggerEntityId; + } + + /** + * optional uint32 trigger_entity_id = 6; + * @param value the triggerEntityId to set + * @return this + */ + public RefreshTriggerByClientCsReq setTriggerEntityId(final int value) { + bitField0_ |= 0x00000001; + triggerEntityId = value; + return this; + } + + /** + * optional .MotionInfo trigger_motion = 11; + * @return whether the triggerMotion field is set + */ + public boolean hasTriggerMotion() { + return (bitField0_ & 0x00000002) != 0; + } + + /** + * optional .MotionInfo trigger_motion = 11; + * @return this + */ + public RefreshTriggerByClientCsReq clearTriggerMotion() { + bitField0_ &= ~0x00000002; + triggerMotion.clear(); + return this; + } + + /** + * optional .MotionInfo trigger_motion = 11; + * + * 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 #getMutableTriggerMotion()} if you want to modify it. + * + * @return internal storage object for reading + */ + public MotionInfoOuterClass.MotionInfo getTriggerMotion() { + return triggerMotion; + } + + /** + * optional .MotionInfo trigger_motion = 11; + * + * 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 MotionInfoOuterClass.MotionInfo getMutableTriggerMotion() { + bitField0_ |= 0x00000002; + return triggerMotion; + } + + /** + * optional .MotionInfo trigger_motion = 11; + * @param value the triggerMotion to set + * @return this + */ + public RefreshTriggerByClientCsReq setTriggerMotion( + final MotionInfoOuterClass.MotionInfo value) { + bitField0_ |= 0x00000002; + triggerMotion.copyFrom(value); + return this; + } + + /** + * optional string trigger_name = 8; + * @return whether the triggerName field is set + */ + public boolean hasTriggerName() { + return (bitField0_ & 0x00000004) != 0; + } + + /** + * optional string trigger_name = 8; + * @return this + */ + public RefreshTriggerByClientCsReq clearTriggerName() { + bitField0_ &= ~0x00000004; + triggerName.clear(); + return this; + } + + /** + * optional string trigger_name = 8; + * @return the triggerName + */ + public String getTriggerName() { + return triggerName.getString(); + } + + /** + * optional string trigger_name = 8; + * @return internal {@code Utf8String} representation of triggerName for reading + */ + public Utf8String getTriggerNameBytes() { + return this.triggerName; + } + + /** + * optional string trigger_name = 8; + * @return internal {@code Utf8String} representation of triggerName for modifications + */ + public Utf8String getMutableTriggerNameBytes() { + bitField0_ |= 0x00000004; + return this.triggerName; + } + + /** + * optional string trigger_name = 8; + * @param value the triggerName to set + * @return this + */ + public RefreshTriggerByClientCsReq setTriggerName(final CharSequence value) { + bitField0_ |= 0x00000004; + triggerName.copyFrom(value); + return this; + } + + /** + * optional string trigger_name = 8; + * @param value the triggerName to set + * @return this + */ + public RefreshTriggerByClientCsReq setTriggerName(final Utf8String value) { + bitField0_ |= 0x00000004; + triggerName.copyFrom(value); + return this; + } + + /** + * repeated uint32 trigger_target_id_list = 3; + * @return whether the triggerTargetIdList field is set + */ + public boolean hasTriggerTargetIdList() { + return (bitField0_ & 0x00000008) != 0; + } + + /** + * repeated uint32 trigger_target_id_list = 3; + * @return this + */ + public RefreshTriggerByClientCsReq clearTriggerTargetIdList() { + bitField0_ &= ~0x00000008; + triggerTargetIdList.clear(); + return this; + } + + /** + * repeated uint32 trigger_target_id_list = 3; + * + * 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 #getMutableTriggerTargetIdList()} if you want to modify it. + * + * @return internal storage object for reading + */ + public RepeatedInt getTriggerTargetIdList() { + return triggerTargetIdList; + } + + /** + * repeated uint32 trigger_target_id_list = 3; + * + * 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 RepeatedInt getMutableTriggerTargetIdList() { + bitField0_ |= 0x00000008; + return triggerTargetIdList; + } + + /** + * repeated uint32 trigger_target_id_list = 3; + * @param value the triggerTargetIdList to add + * @return this + */ + public RefreshTriggerByClientCsReq addTriggerTargetIdList(final int value) { + bitField0_ |= 0x00000008; + triggerTargetIdList.add(value); + return this; + } + + /** + * repeated uint32 trigger_target_id_list = 3; + * @param values the triggerTargetIdList to add + * @return this + */ + public RefreshTriggerByClientCsReq addAllTriggerTargetIdList(final int... values) { + bitField0_ |= 0x00000008; + triggerTargetIdList.addAll(values); + return this; + } + + @Override + public RefreshTriggerByClientCsReq copyFrom(final RefreshTriggerByClientCsReq other) { + cachedSize = other.cachedSize; + if ((bitField0_ | other.bitField0_) != 0) { + bitField0_ = other.bitField0_; + triggerEntityId = other.triggerEntityId; + triggerMotion.copyFrom(other.triggerMotion); + triggerName.copyFrom(other.triggerName); + triggerTargetIdList.copyFrom(other.triggerTargetIdList); + } + return this; + } + + @Override + public RefreshTriggerByClientCsReq mergeFrom(final RefreshTriggerByClientCsReq other) { + if (other.isEmpty()) { + return this; + } + cachedSize = -1; + if (other.hasTriggerEntityId()) { + setTriggerEntityId(other.triggerEntityId); + } + if (other.hasTriggerMotion()) { + getMutableTriggerMotion().mergeFrom(other.triggerMotion); + } + if (other.hasTriggerName()) { + getMutableTriggerNameBytes().copyFrom(other.triggerName); + } + if (other.hasTriggerTargetIdList()) { + getMutableTriggerTargetIdList().addAll(other.triggerTargetIdList); + } + return this; + } + + @Override + public RefreshTriggerByClientCsReq clear() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + triggerEntityId = 0; + triggerMotion.clear(); + triggerName.clear(); + triggerTargetIdList.clear(); + return this; + } + + @Override + public RefreshTriggerByClientCsReq clearQuick() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + triggerMotion.clearQuick(); + triggerName.clear(); + triggerTargetIdList.clear(); + return this; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (!(o instanceof RefreshTriggerByClientCsReq)) { + return false; + } + RefreshTriggerByClientCsReq other = (RefreshTriggerByClientCsReq) o; + return bitField0_ == other.bitField0_ + && (!hasTriggerEntityId() || triggerEntityId == other.triggerEntityId) + && (!hasTriggerMotion() || triggerMotion.equals(other.triggerMotion)) + && (!hasTriggerName() || triggerName.equals(other.triggerName)) + && (!hasTriggerTargetIdList() || triggerTargetIdList.equals(other.triggerTargetIdList)); + } + + @Override + public void writeTo(final ProtoSink output) throws IOException { + if ((bitField0_ & 0x00000001) != 0) { + output.writeRawByte((byte) 48); + output.writeUInt32NoTag(triggerEntityId); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeRawByte((byte) 90); + output.writeMessageNoTag(triggerMotion); + } + if ((bitField0_ & 0x00000004) != 0) { + output.writeRawByte((byte) 66); + output.writeStringNoTag(triggerName); + } + if ((bitField0_ & 0x00000008) != 0) { + for (int i = 0; i < triggerTargetIdList.length(); i++) { + output.writeRawByte((byte) 24); + output.writeUInt32NoTag(triggerTargetIdList.array()[i]); + } + } + } + + @Override + protected int computeSerializedSize() { + int size = 0; + if ((bitField0_ & 0x00000001) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(triggerEntityId); + } + if ((bitField0_ & 0x00000002) != 0) { + size += 1 + ProtoSink.computeMessageSizeNoTag(triggerMotion); + } + if ((bitField0_ & 0x00000004) != 0) { + size += 1 + ProtoSink.computeStringSizeNoTag(triggerName); + } + if ((bitField0_ & 0x00000008) != 0) { + size += (1 * triggerTargetIdList.length()) + ProtoSink.computeRepeatedUInt32SizeNoTag(triggerTargetIdList); + } + return size; + } + + @Override + @SuppressWarnings("fallthrough") + public RefreshTriggerByClientCsReq mergeFrom(final ProtoSource input) throws IOException { + // Enabled Fall-Through Optimization (QuickBuffers) + int tag = input.readTag(); + while (true) { + switch (tag) { + case 48: { + // triggerEntityId + triggerEntityId = input.readUInt32(); + bitField0_ |= 0x00000001; + tag = input.readTag(); + if (tag != 90) { + break; + } + } + case 90: { + // triggerMotion + input.readMessage(triggerMotion); + bitField0_ |= 0x00000002; + tag = input.readTag(); + if (tag != 66) { + break; + } + } + case 66: { + // triggerName + input.readString(triggerName); + bitField0_ |= 0x00000004; + tag = input.readTag(); + if (tag != 26) { + break; + } + } + case 26: { + // triggerTargetIdList [packed=true] + input.readPackedUInt32(triggerTargetIdList, tag); + bitField0_ |= 0x00000008; + tag = input.readTag(); + if (tag != 0) { + break; + } + } + case 0: { + return this; + } + default: { + if (!input.skipField(tag)) { + return this; + } + tag = input.readTag(); + break; + } + case 24: { + // triggerTargetIdList [packed=false] + tag = input.readRepeatedUInt32(triggerTargetIdList, tag); + bitField0_ |= 0x00000008; + break; + } + } + } + } + + @Override + public void writeTo(final JsonSink output) throws IOException { + output.beginObject(); + if ((bitField0_ & 0x00000001) != 0) { + output.writeUInt32(FieldNames.triggerEntityId, triggerEntityId); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeMessage(FieldNames.triggerMotion, triggerMotion); + } + if ((bitField0_ & 0x00000004) != 0) { + output.writeString(FieldNames.triggerName, triggerName); + } + if ((bitField0_ & 0x00000008) != 0) { + output.writeRepeatedUInt32(FieldNames.triggerTargetIdList, triggerTargetIdList); + } + output.endObject(); + } + + @Override + public RefreshTriggerByClientCsReq mergeFrom(final JsonSource input) throws IOException { + if (!input.beginObject()) { + return this; + } + while (!input.isAtEnd()) { + switch (input.readFieldHash()) { + case 242025014: + case -2081789648: { + if (input.isAtField(FieldNames.triggerEntityId)) { + if (!input.trySkipNullValue()) { + triggerEntityId = input.readUInt32(); + bitField0_ |= 0x00000001; + } + } else { + input.skipUnknownField(); + } + break; + } + case -1754146930: + case 189663261: { + if (input.isAtField(FieldNames.triggerMotion)) { + if (!input.trySkipNullValue()) { + input.readMessage(triggerMotion); + bitField0_ |= 0x00000002; + } + } else { + input.skipUnknownField(); + } + break; + } + case -681138077: + case 375632050: { + if (input.isAtField(FieldNames.triggerName)) { + if (!input.trySkipNullValue()) { + input.readString(triggerName); + bitField0_ |= 0x00000004; + } + } else { + input.skipUnknownField(); + } + break; + } + case -482857182: + case -1827914245: { + if (input.isAtField(FieldNames.triggerTargetIdList)) { + if (!input.trySkipNullValue()) { + input.readRepeatedUInt32(triggerTargetIdList); + bitField0_ |= 0x00000008; + } + } else { + input.skipUnknownField(); + } + break; + } + default: { + input.skipUnknownField(); + break; + } + } + } + input.endObject(); + return this; + } + + @Override + public RefreshTriggerByClientCsReq clone() { + return new RefreshTriggerByClientCsReq().copyFrom(this); + } + + @Override + public boolean isEmpty() { + return ((bitField0_) == 0); + } + + public static RefreshTriggerByClientCsReq parseFrom(final byte[] data) throws + InvalidProtocolBufferException { + return ProtoMessage.mergeFrom(new RefreshTriggerByClientCsReq(), data).checkInitialized(); + } + + public static RefreshTriggerByClientCsReq parseFrom(final ProtoSource input) throws + IOException { + return ProtoMessage.mergeFrom(new RefreshTriggerByClientCsReq(), input).checkInitialized(); + } + + public static RefreshTriggerByClientCsReq parseFrom(final JsonSource input) throws IOException { + return ProtoMessage.mergeFrom(new RefreshTriggerByClientCsReq(), input).checkInitialized(); + } + + /** + * @return factory for creating RefreshTriggerByClientCsReq messages + */ + public static MessageFactory getFactory() { + return RefreshTriggerByClientCsReqFactory.INSTANCE; + } + + private enum RefreshTriggerByClientCsReqFactory implements MessageFactory { + INSTANCE; + + @Override + public RefreshTriggerByClientCsReq create() { + return RefreshTriggerByClientCsReq.newInstance(); + } + } + + /** + * Contains name constants used for serializing JSON + */ + static class FieldNames { + static final FieldName triggerEntityId = FieldName.forField("triggerEntityId", "trigger_entity_id"); + + static final FieldName triggerMotion = FieldName.forField("triggerMotion", "trigger_motion"); + + static final FieldName triggerName = FieldName.forField("triggerName", "trigger_name"); + + static final FieldName triggerTargetIdList = FieldName.forField("triggerTargetIdList", "trigger_target_id_list"); + } + } +} diff --git a/src/generated/main/emu/lunarcore/proto/RefreshTriggerByClientScNotifyOuterClass.java b/src/generated/main/emu/lunarcore/proto/RefreshTriggerByClientScNotifyOuterClass.java new file mode 100644 index 000000000..3c06390ef --- /dev/null +++ b/src/generated/main/emu/lunarcore/proto/RefreshTriggerByClientScNotifyOuterClass.java @@ -0,0 +1,495 @@ +// 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; +import us.hebi.quickbuf.RepeatedInt; +import us.hebi.quickbuf.Utf8String; + +public final class RefreshTriggerByClientScNotifyOuterClass { + /** + * Protobuf type {@code RefreshTriggerByClientScNotify} + */ + public static final class RefreshTriggerByClientScNotify extends ProtoMessage implements Cloneable { + private static final long serialVersionUID = 0L; + + /** + * optional uint32 trigger_entity_id = 14; + */ + private int triggerEntityId; + + /** + * optional string trigger_name = 11; + */ + private final Utf8String triggerName = Utf8String.newEmptyInstance(); + + /** + * repeated uint32 trigger_target_id_list = 3; + */ + private final RepeatedInt triggerTargetIdList = RepeatedInt.newEmptyInstance(); + + private RefreshTriggerByClientScNotify() { + } + + /** + * @return a new empty instance of {@code RefreshTriggerByClientScNotify} + */ + public static RefreshTriggerByClientScNotify newInstance() { + return new RefreshTriggerByClientScNotify(); + } + + /** + * optional uint32 trigger_entity_id = 14; + * @return whether the triggerEntityId field is set + */ + public boolean hasTriggerEntityId() { + return (bitField0_ & 0x00000001) != 0; + } + + /** + * optional uint32 trigger_entity_id = 14; + * @return this + */ + public RefreshTriggerByClientScNotify clearTriggerEntityId() { + bitField0_ &= ~0x00000001; + triggerEntityId = 0; + return this; + } + + /** + * optional uint32 trigger_entity_id = 14; + * @return the triggerEntityId + */ + public int getTriggerEntityId() { + return triggerEntityId; + } + + /** + * optional uint32 trigger_entity_id = 14; + * @param value the triggerEntityId to set + * @return this + */ + public RefreshTriggerByClientScNotify setTriggerEntityId(final int value) { + bitField0_ |= 0x00000001; + triggerEntityId = value; + return this; + } + + /** + * optional string trigger_name = 11; + * @return whether the triggerName field is set + */ + public boolean hasTriggerName() { + return (bitField0_ & 0x00000002) != 0; + } + + /** + * optional string trigger_name = 11; + * @return this + */ + public RefreshTriggerByClientScNotify clearTriggerName() { + bitField0_ &= ~0x00000002; + triggerName.clear(); + return this; + } + + /** + * optional string trigger_name = 11; + * @return the triggerName + */ + public String getTriggerName() { + return triggerName.getString(); + } + + /** + * optional string trigger_name = 11; + * @return internal {@code Utf8String} representation of triggerName for reading + */ + public Utf8String getTriggerNameBytes() { + return this.triggerName; + } + + /** + * optional string trigger_name = 11; + * @return internal {@code Utf8String} representation of triggerName for modifications + */ + public Utf8String getMutableTriggerNameBytes() { + bitField0_ |= 0x00000002; + return this.triggerName; + } + + /** + * optional string trigger_name = 11; + * @param value the triggerName to set + * @return this + */ + public RefreshTriggerByClientScNotify setTriggerName(final CharSequence value) { + bitField0_ |= 0x00000002; + triggerName.copyFrom(value); + return this; + } + + /** + * optional string trigger_name = 11; + * @param value the triggerName to set + * @return this + */ + public RefreshTriggerByClientScNotify setTriggerName(final Utf8String value) { + bitField0_ |= 0x00000002; + triggerName.copyFrom(value); + return this; + } + + /** + * repeated uint32 trigger_target_id_list = 3; + * @return whether the triggerTargetIdList field is set + */ + public boolean hasTriggerTargetIdList() { + return (bitField0_ & 0x00000004) != 0; + } + + /** + * repeated uint32 trigger_target_id_list = 3; + * @return this + */ + public RefreshTriggerByClientScNotify clearTriggerTargetIdList() { + bitField0_ &= ~0x00000004; + triggerTargetIdList.clear(); + return this; + } + + /** + * repeated uint32 trigger_target_id_list = 3; + * + * 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 #getMutableTriggerTargetIdList()} if you want to modify it. + * + * @return internal storage object for reading + */ + public RepeatedInt getTriggerTargetIdList() { + return triggerTargetIdList; + } + + /** + * repeated uint32 trigger_target_id_list = 3; + * + * 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 RepeatedInt getMutableTriggerTargetIdList() { + bitField0_ |= 0x00000004; + return triggerTargetIdList; + } + + /** + * repeated uint32 trigger_target_id_list = 3; + * @param value the triggerTargetIdList to add + * @return this + */ + public RefreshTriggerByClientScNotify addTriggerTargetIdList(final int value) { + bitField0_ |= 0x00000004; + triggerTargetIdList.add(value); + return this; + } + + /** + * repeated uint32 trigger_target_id_list = 3; + * @param values the triggerTargetIdList to add + * @return this + */ + public RefreshTriggerByClientScNotify addAllTriggerTargetIdList(final int... values) { + bitField0_ |= 0x00000004; + triggerTargetIdList.addAll(values); + return this; + } + + @Override + public RefreshTriggerByClientScNotify copyFrom(final RefreshTriggerByClientScNotify other) { + cachedSize = other.cachedSize; + if ((bitField0_ | other.bitField0_) != 0) { + bitField0_ = other.bitField0_; + triggerEntityId = other.triggerEntityId; + triggerName.copyFrom(other.triggerName); + triggerTargetIdList.copyFrom(other.triggerTargetIdList); + } + return this; + } + + @Override + public RefreshTriggerByClientScNotify mergeFrom(final RefreshTriggerByClientScNotify other) { + if (other.isEmpty()) { + return this; + } + cachedSize = -1; + if (other.hasTriggerEntityId()) { + setTriggerEntityId(other.triggerEntityId); + } + if (other.hasTriggerName()) { + getMutableTriggerNameBytes().copyFrom(other.triggerName); + } + if (other.hasTriggerTargetIdList()) { + getMutableTriggerTargetIdList().addAll(other.triggerTargetIdList); + } + return this; + } + + @Override + public RefreshTriggerByClientScNotify clear() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + triggerEntityId = 0; + triggerName.clear(); + triggerTargetIdList.clear(); + return this; + } + + @Override + public RefreshTriggerByClientScNotify clearQuick() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + triggerName.clear(); + triggerTargetIdList.clear(); + return this; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (!(o instanceof RefreshTriggerByClientScNotify)) { + return false; + } + RefreshTriggerByClientScNotify other = (RefreshTriggerByClientScNotify) o; + return bitField0_ == other.bitField0_ + && (!hasTriggerEntityId() || triggerEntityId == other.triggerEntityId) + && (!hasTriggerName() || triggerName.equals(other.triggerName)) + && (!hasTriggerTargetIdList() || triggerTargetIdList.equals(other.triggerTargetIdList)); + } + + @Override + public void writeTo(final ProtoSink output) throws IOException { + if ((bitField0_ & 0x00000001) != 0) { + output.writeRawByte((byte) 112); + output.writeUInt32NoTag(triggerEntityId); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeRawByte((byte) 90); + output.writeStringNoTag(triggerName); + } + if ((bitField0_ & 0x00000004) != 0) { + for (int i = 0; i < triggerTargetIdList.length(); i++) { + output.writeRawByte((byte) 24); + output.writeUInt32NoTag(triggerTargetIdList.array()[i]); + } + } + } + + @Override + protected int computeSerializedSize() { + int size = 0; + if ((bitField0_ & 0x00000001) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(triggerEntityId); + } + if ((bitField0_ & 0x00000002) != 0) { + size += 1 + ProtoSink.computeStringSizeNoTag(triggerName); + } + if ((bitField0_ & 0x00000004) != 0) { + size += (1 * triggerTargetIdList.length()) + ProtoSink.computeRepeatedUInt32SizeNoTag(triggerTargetIdList); + } + return size; + } + + @Override + @SuppressWarnings("fallthrough") + public RefreshTriggerByClientScNotify mergeFrom(final ProtoSource input) throws IOException { + // Enabled Fall-Through Optimization (QuickBuffers) + int tag = input.readTag(); + while (true) { + switch (tag) { + case 112: { + // triggerEntityId + triggerEntityId = input.readUInt32(); + bitField0_ |= 0x00000001; + tag = input.readTag(); + if (tag != 90) { + break; + } + } + case 90: { + // triggerName + input.readString(triggerName); + bitField0_ |= 0x00000002; + tag = input.readTag(); + if (tag != 26) { + break; + } + } + case 26: { + // triggerTargetIdList [packed=true] + input.readPackedUInt32(triggerTargetIdList, tag); + bitField0_ |= 0x00000004; + tag = input.readTag(); + if (tag != 0) { + break; + } + } + case 0: { + return this; + } + default: { + if (!input.skipField(tag)) { + return this; + } + tag = input.readTag(); + break; + } + case 24: { + // triggerTargetIdList [packed=false] + tag = input.readRepeatedUInt32(triggerTargetIdList, tag); + bitField0_ |= 0x00000004; + break; + } + } + } + } + + @Override + public void writeTo(final JsonSink output) throws IOException { + output.beginObject(); + if ((bitField0_ & 0x00000001) != 0) { + output.writeUInt32(FieldNames.triggerEntityId, triggerEntityId); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeString(FieldNames.triggerName, triggerName); + } + if ((bitField0_ & 0x00000004) != 0) { + output.writeRepeatedUInt32(FieldNames.triggerTargetIdList, triggerTargetIdList); + } + output.endObject(); + } + + @Override + public RefreshTriggerByClientScNotify mergeFrom(final JsonSource input) throws IOException { + if (!input.beginObject()) { + return this; + } + while (!input.isAtEnd()) { + switch (input.readFieldHash()) { + case 242025014: + case -2081789648: { + if (input.isAtField(FieldNames.triggerEntityId)) { + if (!input.trySkipNullValue()) { + triggerEntityId = input.readUInt32(); + bitField0_ |= 0x00000001; + } + } else { + input.skipUnknownField(); + } + break; + } + case -681138077: + case 375632050: { + if (input.isAtField(FieldNames.triggerName)) { + if (!input.trySkipNullValue()) { + input.readString(triggerName); + bitField0_ |= 0x00000002; + } + } else { + input.skipUnknownField(); + } + break; + } + case -482857182: + case -1827914245: { + if (input.isAtField(FieldNames.triggerTargetIdList)) { + if (!input.trySkipNullValue()) { + input.readRepeatedUInt32(triggerTargetIdList); + bitField0_ |= 0x00000004; + } + } else { + input.skipUnknownField(); + } + break; + } + default: { + input.skipUnknownField(); + break; + } + } + } + input.endObject(); + return this; + } + + @Override + public RefreshTriggerByClientScNotify clone() { + return new RefreshTriggerByClientScNotify().copyFrom(this); + } + + @Override + public boolean isEmpty() { + return ((bitField0_) == 0); + } + + public static RefreshTriggerByClientScNotify parseFrom(final byte[] data) throws + InvalidProtocolBufferException { + return ProtoMessage.mergeFrom(new RefreshTriggerByClientScNotify(), data).checkInitialized(); + } + + public static RefreshTriggerByClientScNotify parseFrom(final ProtoSource input) throws + IOException { + return ProtoMessage.mergeFrom(new RefreshTriggerByClientScNotify(), input).checkInitialized(); + } + + public static RefreshTriggerByClientScNotify parseFrom(final JsonSource input) throws + IOException { + return ProtoMessage.mergeFrom(new RefreshTriggerByClientScNotify(), input).checkInitialized(); + } + + /** + * @return factory for creating RefreshTriggerByClientScNotify messages + */ + public static MessageFactory getFactory() { + return RefreshTriggerByClientScNotifyFactory.INSTANCE; + } + + private enum RefreshTriggerByClientScNotifyFactory implements MessageFactory { + INSTANCE; + + @Override + public RefreshTriggerByClientScNotify create() { + return RefreshTriggerByClientScNotify.newInstance(); + } + } + + /** + * Contains name constants used for serializing JSON + */ + static class FieldNames { + static final FieldName triggerEntityId = FieldName.forField("triggerEntityId", "trigger_entity_id"); + + static final FieldName triggerName = FieldName.forField("triggerName", "trigger_name"); + + static final FieldName triggerTargetIdList = FieldName.forField("triggerTargetIdList", "trigger_target_id_list"); + } + } +} diff --git a/src/generated/main/emu/lunarcore/proto/RefreshTriggerByClientScRspOuterClass.java b/src/generated/main/emu/lunarcore/proto/RefreshTriggerByClientScRspOuterClass.java new file mode 100644 index 000000000..93d58ad2b --- /dev/null +++ b/src/generated/main/emu/lunarcore/proto/RefreshTriggerByClientScRspOuterClass.java @@ -0,0 +1,533 @@ +// 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; +import us.hebi.quickbuf.Utf8String; + +public final class RefreshTriggerByClientScRspOuterClass { + /** + * Protobuf type {@code RefreshTriggerByClientScRsp} + */ + public static final class RefreshTriggerByClientScRsp extends ProtoMessage implements Cloneable { + private static final long serialVersionUID = 0L; + + /** + * optional uint32 trigger_entity_id = 5; + */ + private int triggerEntityId; + + /** + * optional uint32 retcode = 10; + */ + private int retcode; + + /** + * optional bool refresh_trigger = 14; + */ + private boolean refreshTrigger; + + /** + * optional string trigger_name = 1; + */ + private final Utf8String triggerName = Utf8String.newEmptyInstance(); + + private RefreshTriggerByClientScRsp() { + } + + /** + * @return a new empty instance of {@code RefreshTriggerByClientScRsp} + */ + public static RefreshTriggerByClientScRsp newInstance() { + return new RefreshTriggerByClientScRsp(); + } + + /** + * optional uint32 trigger_entity_id = 5; + * @return whether the triggerEntityId field is set + */ + public boolean hasTriggerEntityId() { + return (bitField0_ & 0x00000001) != 0; + } + + /** + * optional uint32 trigger_entity_id = 5; + * @return this + */ + public RefreshTriggerByClientScRsp clearTriggerEntityId() { + bitField0_ &= ~0x00000001; + triggerEntityId = 0; + return this; + } + + /** + * optional uint32 trigger_entity_id = 5; + * @return the triggerEntityId + */ + public int getTriggerEntityId() { + return triggerEntityId; + } + + /** + * optional uint32 trigger_entity_id = 5; + * @param value the triggerEntityId to set + * @return this + */ + public RefreshTriggerByClientScRsp setTriggerEntityId(final int value) { + bitField0_ |= 0x00000001; + triggerEntityId = value; + return this; + } + + /** + * optional uint32 retcode = 10; + * @return whether the retcode field is set + */ + public boolean hasRetcode() { + return (bitField0_ & 0x00000002) != 0; + } + + /** + * optional uint32 retcode = 10; + * @return this + */ + public RefreshTriggerByClientScRsp clearRetcode() { + bitField0_ &= ~0x00000002; + retcode = 0; + return this; + } + + /** + * optional uint32 retcode = 10; + * @return the retcode + */ + public int getRetcode() { + return retcode; + } + + /** + * optional uint32 retcode = 10; + * @param value the retcode to set + * @return this + */ + public RefreshTriggerByClientScRsp setRetcode(final int value) { + bitField0_ |= 0x00000002; + retcode = value; + return this; + } + + /** + * optional bool refresh_trigger = 14; + * @return whether the refreshTrigger field is set + */ + public boolean hasRefreshTrigger() { + return (bitField0_ & 0x00000004) != 0; + } + + /** + * optional bool refresh_trigger = 14; + * @return this + */ + public RefreshTriggerByClientScRsp clearRefreshTrigger() { + bitField0_ &= ~0x00000004; + refreshTrigger = false; + return this; + } + + /** + * optional bool refresh_trigger = 14; + * @return the refreshTrigger + */ + public boolean getRefreshTrigger() { + return refreshTrigger; + } + + /** + * optional bool refresh_trigger = 14; + * @param value the refreshTrigger to set + * @return this + */ + public RefreshTriggerByClientScRsp setRefreshTrigger(final boolean value) { + bitField0_ |= 0x00000004; + refreshTrigger = value; + return this; + } + + /** + * optional string trigger_name = 1; + * @return whether the triggerName field is set + */ + public boolean hasTriggerName() { + return (bitField0_ & 0x00000008) != 0; + } + + /** + * optional string trigger_name = 1; + * @return this + */ + public RefreshTriggerByClientScRsp clearTriggerName() { + bitField0_ &= ~0x00000008; + triggerName.clear(); + return this; + } + + /** + * optional string trigger_name = 1; + * @return the triggerName + */ + public String getTriggerName() { + return triggerName.getString(); + } + + /** + * optional string trigger_name = 1; + * @return internal {@code Utf8String} representation of triggerName for reading + */ + public Utf8String getTriggerNameBytes() { + return this.triggerName; + } + + /** + * optional string trigger_name = 1; + * @return internal {@code Utf8String} representation of triggerName for modifications + */ + public Utf8String getMutableTriggerNameBytes() { + bitField0_ |= 0x00000008; + return this.triggerName; + } + + /** + * optional string trigger_name = 1; + * @param value the triggerName to set + * @return this + */ + public RefreshTriggerByClientScRsp setTriggerName(final CharSequence value) { + bitField0_ |= 0x00000008; + triggerName.copyFrom(value); + return this; + } + + /** + * optional string trigger_name = 1; + * @param value the triggerName to set + * @return this + */ + public RefreshTriggerByClientScRsp setTriggerName(final Utf8String value) { + bitField0_ |= 0x00000008; + triggerName.copyFrom(value); + return this; + } + + @Override + public RefreshTriggerByClientScRsp copyFrom(final RefreshTriggerByClientScRsp other) { + cachedSize = other.cachedSize; + if ((bitField0_ | other.bitField0_) != 0) { + bitField0_ = other.bitField0_; + triggerEntityId = other.triggerEntityId; + retcode = other.retcode; + refreshTrigger = other.refreshTrigger; + triggerName.copyFrom(other.triggerName); + } + return this; + } + + @Override + public RefreshTriggerByClientScRsp mergeFrom(final RefreshTriggerByClientScRsp other) { + if (other.isEmpty()) { + return this; + } + cachedSize = -1; + if (other.hasTriggerEntityId()) { + setTriggerEntityId(other.triggerEntityId); + } + if (other.hasRetcode()) { + setRetcode(other.retcode); + } + if (other.hasRefreshTrigger()) { + setRefreshTrigger(other.refreshTrigger); + } + if (other.hasTriggerName()) { + getMutableTriggerNameBytes().copyFrom(other.triggerName); + } + return this; + } + + @Override + public RefreshTriggerByClientScRsp clear() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + triggerEntityId = 0; + retcode = 0; + refreshTrigger = false; + triggerName.clear(); + return this; + } + + @Override + public RefreshTriggerByClientScRsp clearQuick() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + triggerName.clear(); + return this; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (!(o instanceof RefreshTriggerByClientScRsp)) { + return false; + } + RefreshTriggerByClientScRsp other = (RefreshTriggerByClientScRsp) o; + return bitField0_ == other.bitField0_ + && (!hasTriggerEntityId() || triggerEntityId == other.triggerEntityId) + && (!hasRetcode() || retcode == other.retcode) + && (!hasRefreshTrigger() || refreshTrigger == other.refreshTrigger) + && (!hasTriggerName() || triggerName.equals(other.triggerName)); + } + + @Override + public void writeTo(final ProtoSink output) throws IOException { + if ((bitField0_ & 0x00000001) != 0) { + output.writeRawByte((byte) 40); + output.writeUInt32NoTag(triggerEntityId); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeRawByte((byte) 80); + output.writeUInt32NoTag(retcode); + } + if ((bitField0_ & 0x00000004) != 0) { + output.writeRawByte((byte) 112); + output.writeBoolNoTag(refreshTrigger); + } + if ((bitField0_ & 0x00000008) != 0) { + output.writeRawByte((byte) 10); + output.writeStringNoTag(triggerName); + } + } + + @Override + protected int computeSerializedSize() { + int size = 0; + if ((bitField0_ & 0x00000001) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(triggerEntityId); + } + if ((bitField0_ & 0x00000002) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(retcode); + } + if ((bitField0_ & 0x00000004) != 0) { + size += 2; + } + if ((bitField0_ & 0x00000008) != 0) { + size += 1 + ProtoSink.computeStringSizeNoTag(triggerName); + } + return size; + } + + @Override + @SuppressWarnings("fallthrough") + public RefreshTriggerByClientScRsp mergeFrom(final ProtoSource input) throws IOException { + // Enabled Fall-Through Optimization (QuickBuffers) + int tag = input.readTag(); + while (true) { + switch (tag) { + case 40: { + // triggerEntityId + triggerEntityId = input.readUInt32(); + bitField0_ |= 0x00000001; + tag = input.readTag(); + if (tag != 80) { + break; + } + } + case 80: { + // retcode + retcode = input.readUInt32(); + bitField0_ |= 0x00000002; + tag = input.readTag(); + if (tag != 112) { + break; + } + } + case 112: { + // refreshTrigger + refreshTrigger = input.readBool(); + bitField0_ |= 0x00000004; + tag = input.readTag(); + if (tag != 10) { + break; + } + } + case 10: { + // triggerName + input.readString(triggerName); + 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.triggerEntityId, triggerEntityId); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeUInt32(FieldNames.retcode, retcode); + } + if ((bitField0_ & 0x00000004) != 0) { + output.writeBool(FieldNames.refreshTrigger, refreshTrigger); + } + if ((bitField0_ & 0x00000008) != 0) { + output.writeString(FieldNames.triggerName, triggerName); + } + output.endObject(); + } + + @Override + public RefreshTriggerByClientScRsp mergeFrom(final JsonSource input) throws IOException { + if (!input.beginObject()) { + return this; + } + while (!input.isAtEnd()) { + switch (input.readFieldHash()) { + case 242025014: + case -2081789648: { + if (input.isAtField(FieldNames.triggerEntityId)) { + if (!input.trySkipNullValue()) { + triggerEntityId = input.readUInt32(); + bitField0_ |= 0x00000001; + } + } else { + input.skipUnknownField(); + } + break; + } + case 1097936398: { + if (input.isAtField(FieldNames.retcode)) { + if (!input.trySkipNullValue()) { + retcode = input.readUInt32(); + bitField0_ |= 0x00000002; + } + } else { + input.skipUnknownField(); + } + break; + } + case 1616019037: + case -1712421804: { + if (input.isAtField(FieldNames.refreshTrigger)) { + if (!input.trySkipNullValue()) { + refreshTrigger = input.readBool(); + bitField0_ |= 0x00000004; + } + } else { + input.skipUnknownField(); + } + break; + } + case -681138077: + case 375632050: { + if (input.isAtField(FieldNames.triggerName)) { + if (!input.trySkipNullValue()) { + input.readString(triggerName); + bitField0_ |= 0x00000008; + } + } else { + input.skipUnknownField(); + } + break; + } + default: { + input.skipUnknownField(); + break; + } + } + } + input.endObject(); + return this; + } + + @Override + public RefreshTriggerByClientScRsp clone() { + return new RefreshTriggerByClientScRsp().copyFrom(this); + } + + @Override + public boolean isEmpty() { + return ((bitField0_) == 0); + } + + public static RefreshTriggerByClientScRsp parseFrom(final byte[] data) throws + InvalidProtocolBufferException { + return ProtoMessage.mergeFrom(new RefreshTriggerByClientScRsp(), data).checkInitialized(); + } + + public static RefreshTriggerByClientScRsp parseFrom(final ProtoSource input) throws + IOException { + return ProtoMessage.mergeFrom(new RefreshTriggerByClientScRsp(), input).checkInitialized(); + } + + public static RefreshTriggerByClientScRsp parseFrom(final JsonSource input) throws IOException { + return ProtoMessage.mergeFrom(new RefreshTriggerByClientScRsp(), input).checkInitialized(); + } + + /** + * @return factory for creating RefreshTriggerByClientScRsp messages + */ + public static MessageFactory getFactory() { + return RefreshTriggerByClientScRspFactory.INSTANCE; + } + + private enum RefreshTriggerByClientScRspFactory implements MessageFactory { + INSTANCE; + + @Override + public RefreshTriggerByClientScRsp create() { + return RefreshTriggerByClientScRsp.newInstance(); + } + } + + /** + * Contains name constants used for serializing JSON + */ + static class FieldNames { + static final FieldName triggerEntityId = FieldName.forField("triggerEntityId", "trigger_entity_id"); + + static final FieldName retcode = FieldName.forField("retcode"); + + static final FieldName refreshTrigger = FieldName.forField("refreshTrigger", "refresh_trigger"); + + static final FieldName triggerName = FieldName.forField("triggerName", "trigger_name"); + } + } +} diff --git a/src/generated/main/emu/lunarcore/proto/SceneEntityInfoOuterClass.java b/src/generated/main/emu/lunarcore/proto/SceneEntityInfoOuterClass.java index 9de264a5b..057a26d7a 100644 --- a/src/generated/main/emu/lunarcore/proto/SceneEntityInfoOuterClass.java +++ b/src/generated/main/emu/lunarcore/proto/SceneEntityInfoOuterClass.java @@ -49,10 +49,6 @@ public static final class SceneEntityInfo extends ProtoMessage private final SceneNpcMonsterInfoOuterClass.SceneNpcMonsterInfo npcMonster = SceneNpcMonsterInfoOuterClass.SceneNpcMonsterInfo.newInstance(); /** - *
-     * SceneSummonUnitInfo summon_unit = 15;
-     * 
- * * optional .ScenePropInfo prop = 10; */ private final ScenePropInfoOuterClass.ScenePropInfo prop = ScenePropInfoOuterClass.ScenePropInfo.newInstance(); @@ -62,6 +58,11 @@ public static final class SceneEntityInfo extends ProtoMessage */ private final SceneActorInfoOuterClass.SceneActorInfo actor = SceneActorInfoOuterClass.SceneActorInfo.newInstance(); + /** + * optional .SceneSummonUnitInfo summon_unit = 15; + */ + private final SceneSummonUnitInfoOuterClass.SceneSummonUnitInfo summonUnit = SceneSummonUnitInfoOuterClass.SceneSummonUnitInfo.newInstance(); + private SceneEntityInfo() { } @@ -73,7 +74,7 @@ public static SceneEntityInfo newInstance() { } public boolean hasEntityCase() { - return (((bitField0_ & 0x0000000f)) != 0); + return (((bitField0_ & 0x0000001f)) != 0); } public SceneEntityInfo clearEntityCase() { @@ -82,39 +83,53 @@ public SceneEntityInfo clearEntityCase() { clearNpcMonster(); clearProp(); clearActor(); + clearSummonUnit(); } return this; } private void clearEntityCaseOtherNpc() { - if ((((bitField0_ & 0x0000000e)) != 0)) { + if ((((bitField0_ & 0x0000001e)) != 0)) { clearNpcMonster(); clearProp(); clearActor(); + clearSummonUnit(); } } private void clearEntityCaseOtherNpcMonster() { - if ((((bitField0_ & 0x0000000d)) != 0)) { + if ((((bitField0_ & 0x0000001d)) != 0)) { clearNpc(); clearProp(); clearActor(); + clearSummonUnit(); } } private void clearEntityCaseOtherProp() { - if ((((bitField0_ & 0x0000000b)) != 0)) { + if ((((bitField0_ & 0x0000001b)) != 0)) { clearNpc(); clearNpcMonster(); clearActor(); + clearSummonUnit(); } } private void clearEntityCaseOtherActor() { - if ((((bitField0_ & 0x00000007)) != 0)) { + if ((((bitField0_ & 0x00000017)) != 0)) { clearNpc(); clearNpcMonster(); clearProp(); + clearSummonUnit(); + } + } + + private void clearEntityCaseOtherSummonUnit() { + if ((((bitField0_ & 0x0000000f)) != 0)) { + clearNpc(); + clearNpcMonster(); + clearProp(); + clearActor(); } } @@ -123,7 +138,7 @@ private void clearEntityCaseOtherActor() { * @return whether the groupId field is set */ public boolean hasGroupId() { - return (bitField0_ & 0x00000010) != 0; + return (bitField0_ & 0x00000020) != 0; } /** @@ -131,7 +146,7 @@ public boolean hasGroupId() { * @return this */ public SceneEntityInfo clearGroupId() { - bitField0_ &= ~0x00000010; + bitField0_ &= ~0x00000020; groupId = 0; return this; } @@ -150,7 +165,7 @@ public int getGroupId() { * @return this */ public SceneEntityInfo setGroupId(final int value) { - bitField0_ |= 0x00000010; + bitField0_ |= 0x00000020; groupId = value; return this; } @@ -160,7 +175,7 @@ public SceneEntityInfo setGroupId(final int value) { * @return whether the instId field is set */ public boolean hasInstId() { - return (bitField0_ & 0x00000020) != 0; + return (bitField0_ & 0x00000040) != 0; } /** @@ -168,7 +183,7 @@ public boolean hasInstId() { * @return this */ public SceneEntityInfo clearInstId() { - bitField0_ &= ~0x00000020; + bitField0_ &= ~0x00000040; instId = 0; return this; } @@ -187,7 +202,7 @@ public int getInstId() { * @return this */ public SceneEntityInfo setInstId(final int value) { - bitField0_ |= 0x00000020; + bitField0_ |= 0x00000040; instId = value; return this; } @@ -197,7 +212,7 @@ public SceneEntityInfo setInstId(final int value) { * @return whether the entityId field is set */ public boolean hasEntityId() { - return (bitField0_ & 0x00000040) != 0; + return (bitField0_ & 0x00000080) != 0; } /** @@ -205,7 +220,7 @@ public boolean hasEntityId() { * @return this */ public SceneEntityInfo clearEntityId() { - bitField0_ &= ~0x00000040; + bitField0_ &= ~0x00000080; entityId = 0; return this; } @@ -224,7 +239,7 @@ public int getEntityId() { * @return this */ public SceneEntityInfo setEntityId(final int value) { - bitField0_ |= 0x00000040; + bitField0_ |= 0x00000080; entityId = value; return this; } @@ -234,7 +249,7 @@ public SceneEntityInfo setEntityId(final int value) { * @return whether the motion field is set */ public boolean hasMotion() { - return (bitField0_ & 0x00000080) != 0; + return (bitField0_ & 0x00000100) != 0; } /** @@ -242,7 +257,7 @@ public boolean hasMotion() { * @return this */ public SceneEntityInfo clearMotion() { - bitField0_ &= ~0x00000080; + bitField0_ &= ~0x00000100; motion.clear(); return this; } @@ -271,7 +286,7 @@ public MotionInfoOuterClass.MotionInfo getMotion() { * @return internal storage object for modifications */ public MotionInfoOuterClass.MotionInfo getMutableMotion() { - bitField0_ |= 0x00000080; + bitField0_ |= 0x00000100; return motion; } @@ -281,7 +296,7 @@ public MotionInfoOuterClass.MotionInfo getMutableMotion() { * @return this */ public SceneEntityInfo setMotion(final MotionInfoOuterClass.MotionInfo value) { - bitField0_ |= 0x00000080; + bitField0_ |= 0x00000100; motion.copyFrom(value); return this; } @@ -406,10 +421,6 @@ public SceneEntityInfo setNpcMonster( } /** - *
-     * SceneSummonUnitInfo summon_unit = 15;
-     * 
- * * optional .ScenePropInfo prop = 10; * @return whether the prop field is set */ @@ -418,10 +429,6 @@ public boolean hasProp() { } /** - *
-     * SceneSummonUnitInfo summon_unit = 15;
-     * 
- * * optional .ScenePropInfo prop = 10; * @return this */ @@ -432,10 +439,6 @@ public SceneEntityInfo clearProp() { } /** - *
-     * SceneSummonUnitInfo summon_unit = 15;
-     * 
- * * optional .ScenePropInfo prop = 10; * * This method returns the internal storage object without modifying any has state. @@ -450,10 +453,6 @@ public ScenePropInfoOuterClass.ScenePropInfo getProp() { } /** - *
-     * SceneSummonUnitInfo summon_unit = 15;
-     * 
- * * optional .ScenePropInfo prop = 10; * * This method returns the internal storage object and sets the corresponding @@ -469,10 +468,6 @@ public ScenePropInfoOuterClass.ScenePropInfo getMutableProp() { } /** - *
-     * SceneSummonUnitInfo summon_unit = 15;
-     * 
- * * optional .ScenePropInfo prop = 10; * @param value the prop to set * @return this @@ -543,6 +538,66 @@ public SceneEntityInfo setActor(final SceneActorInfoOuterClass.SceneActorInfo va return this; } + /** + * optional .SceneSummonUnitInfo summon_unit = 15; + * @return whether the summonUnit field is set + */ + public boolean hasSummonUnit() { + return (bitField0_ & 0x00000010) != 0; + } + + /** + * optional .SceneSummonUnitInfo summon_unit = 15; + * @return this + */ + public SceneEntityInfo clearSummonUnit() { + bitField0_ &= ~0x00000010; + summonUnit.clear(); + return this; + } + + /** + * optional .SceneSummonUnitInfo summon_unit = 15; + * + * 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 #getMutableSummonUnit()} if you want to modify it. + * + * @return internal storage object for reading + */ + public SceneSummonUnitInfoOuterClass.SceneSummonUnitInfo getSummonUnit() { + return summonUnit; + } + + /** + * optional .SceneSummonUnitInfo summon_unit = 15; + * + * 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 SceneSummonUnitInfoOuterClass.SceneSummonUnitInfo getMutableSummonUnit() { + clearEntityCaseOtherSummonUnit(); + bitField0_ |= 0x00000010; + return summonUnit; + } + + /** + * optional .SceneSummonUnitInfo summon_unit = 15; + * @param value the summonUnit to set + * @return this + */ + public SceneEntityInfo setSummonUnit( + final SceneSummonUnitInfoOuterClass.SceneSummonUnitInfo value) { + clearEntityCaseOtherSummonUnit(); + bitField0_ |= 0x00000010; + summonUnit.copyFrom(value); + return this; + } + @Override public SceneEntityInfo copyFrom(final SceneEntityInfo other) { cachedSize = other.cachedSize; @@ -556,6 +611,7 @@ public SceneEntityInfo copyFrom(final SceneEntityInfo other) { npcMonster.copyFrom(other.npcMonster); prop.copyFrom(other.prop); actor.copyFrom(other.actor); + summonUnit.copyFrom(other.summonUnit); } return this; } @@ -590,6 +646,9 @@ public SceneEntityInfo mergeFrom(final SceneEntityInfo other) { if (other.hasActor()) { getMutableActor().mergeFrom(other.actor); } + if (other.hasSummonUnit()) { + getMutableSummonUnit().mergeFrom(other.summonUnit); + } return this; } @@ -608,6 +667,7 @@ public SceneEntityInfo clear() { npcMonster.clear(); prop.clear(); actor.clear(); + summonUnit.clear(); return this; } @@ -623,6 +683,7 @@ public SceneEntityInfo clearQuick() { npcMonster.clearQuick(); prop.clearQuick(); actor.clearQuick(); + summonUnit.clearQuick(); return this; } @@ -643,24 +704,25 @@ public boolean equals(Object o) { && (!hasNpc() || npc.equals(other.npc)) && (!hasNpcMonster() || npcMonster.equals(other.npcMonster)) && (!hasProp() || prop.equals(other.prop)) - && (!hasActor() || actor.equals(other.actor)); + && (!hasActor() || actor.equals(other.actor)) + && (!hasSummonUnit() || summonUnit.equals(other.summonUnit)); } @Override public void writeTo(final ProtoSink output) throws IOException { - if ((bitField0_ & 0x00000010) != 0) { + if ((bitField0_ & 0x00000020) != 0) { output.writeRawByte((byte) 8); output.writeUInt32NoTag(groupId); } - if ((bitField0_ & 0x00000020) != 0) { + if ((bitField0_ & 0x00000040) != 0) { output.writeRawByte((byte) 40); output.writeUInt32NoTag(instId); } - if ((bitField0_ & 0x00000040) != 0) { + if ((bitField0_ & 0x00000080) != 0) { output.writeRawByte((byte) 64); output.writeUInt32NoTag(entityId); } - if ((bitField0_ & 0x00000080) != 0) { + if ((bitField0_ & 0x00000100) != 0) { output.writeRawByte((byte) 34); output.writeMessageNoTag(motion); } @@ -680,21 +742,25 @@ public void writeTo(final ProtoSink output) throws IOException { output.writeRawByte((byte) 106); output.writeMessageNoTag(actor); } + if ((bitField0_ & 0x00000010) != 0) { + output.writeRawByte((byte) 122); + output.writeMessageNoTag(summonUnit); + } } @Override protected int computeSerializedSize() { int size = 0; - if ((bitField0_ & 0x00000010) != 0) { + if ((bitField0_ & 0x00000020) != 0) { size += 1 + ProtoSink.computeUInt32SizeNoTag(groupId); } - if ((bitField0_ & 0x00000020) != 0) { + if ((bitField0_ & 0x00000040) != 0) { size += 1 + ProtoSink.computeUInt32SizeNoTag(instId); } - if ((bitField0_ & 0x00000040) != 0) { + if ((bitField0_ & 0x00000080) != 0) { size += 1 + ProtoSink.computeUInt32SizeNoTag(entityId); } - if ((bitField0_ & 0x00000080) != 0) { + if ((bitField0_ & 0x00000100) != 0) { size += 1 + ProtoSink.computeMessageSizeNoTag(motion); } if ((bitField0_ & 0x00000001) != 0) { @@ -709,6 +775,9 @@ protected int computeSerializedSize() { if ((bitField0_ & 0x00000008) != 0) { size += 1 + ProtoSink.computeMessageSizeNoTag(actor); } + if ((bitField0_ & 0x00000010) != 0) { + size += 1 + ProtoSink.computeMessageSizeNoTag(summonUnit); + } return size; } @@ -722,7 +791,7 @@ public SceneEntityInfo mergeFrom(final ProtoSource input) throws IOException { case 8: { // groupId groupId = input.readUInt32(); - bitField0_ |= 0x00000010; + bitField0_ |= 0x00000020; tag = input.readTag(); if (tag != 40) { break; @@ -731,7 +800,7 @@ public SceneEntityInfo mergeFrom(final ProtoSource input) throws IOException { case 40: { // instId instId = input.readUInt32(); - bitField0_ |= 0x00000020; + bitField0_ |= 0x00000040; tag = input.readTag(); if (tag != 64) { break; @@ -740,7 +809,7 @@ public SceneEntityInfo mergeFrom(final ProtoSource input) throws IOException { case 64: { // entityId entityId = input.readUInt32(); - bitField0_ |= 0x00000040; + bitField0_ |= 0x00000080; tag = input.readTag(); if (tag != 34) { break; @@ -749,7 +818,7 @@ public SceneEntityInfo mergeFrom(final ProtoSource input) throws IOException { case 34: { // motion input.readMessage(motion); - bitField0_ |= 0x00000080; + bitField0_ |= 0x00000100; tag = input.readTag(); if (tag != 50) { break; @@ -791,6 +860,16 @@ public SceneEntityInfo mergeFrom(final ProtoSource input) throws IOException { input.readMessage(actor); bitField0_ |= 0x00000008; tag = input.readTag(); + if (tag != 122) { + break; + } + } + case 122: { + // summonUnit + clearEntityCaseOtherSummonUnit(); + input.readMessage(summonUnit); + bitField0_ |= 0x00000010; + tag = input.readTag(); if (tag != 0) { break; } @@ -812,16 +891,16 @@ public SceneEntityInfo mergeFrom(final ProtoSource input) throws IOException { @Override public void writeTo(final JsonSink output) throws IOException { output.beginObject(); - if ((bitField0_ & 0x00000010) != 0) { + if ((bitField0_ & 0x00000020) != 0) { output.writeUInt32(FieldNames.groupId, groupId); } - if ((bitField0_ & 0x00000020) != 0) { + if ((bitField0_ & 0x00000040) != 0) { output.writeUInt32(FieldNames.instId, instId); } - if ((bitField0_ & 0x00000040) != 0) { + if ((bitField0_ & 0x00000080) != 0) { output.writeUInt32(FieldNames.entityId, entityId); } - if ((bitField0_ & 0x00000080) != 0) { + if ((bitField0_ & 0x00000100) != 0) { output.writeMessage(FieldNames.motion, motion); } if ((bitField0_ & 0x00000001) != 0) { @@ -836,6 +915,9 @@ public void writeTo(final JsonSink output) throws IOException { if ((bitField0_ & 0x00000008) != 0) { output.writeMessage(FieldNames.actor, actor); } + if ((bitField0_ & 0x00000010) != 0) { + output.writeMessage(FieldNames.summonUnit, summonUnit); + } output.endObject(); } @@ -851,7 +933,7 @@ public SceneEntityInfo mergeFrom(final JsonSource input) throws IOException { if (input.isAtField(FieldNames.groupId)) { if (!input.trySkipNullValue()) { groupId = input.readUInt32(); - bitField0_ |= 0x00000010; + bitField0_ |= 0x00000020; } } else { input.skipUnknownField(); @@ -863,7 +945,7 @@ public SceneEntityInfo mergeFrom(final JsonSource input) throws IOException { if (input.isAtField(FieldNames.instId)) { if (!input.trySkipNullValue()) { instId = input.readUInt32(); - bitField0_ |= 0x00000020; + bitField0_ |= 0x00000040; } } else { input.skipUnknownField(); @@ -875,7 +957,7 @@ public SceneEntityInfo mergeFrom(final JsonSource input) throws IOException { if (input.isAtField(FieldNames.entityId)) { if (!input.trySkipNullValue()) { entityId = input.readUInt32(); - bitField0_ |= 0x00000040; + bitField0_ |= 0x00000080; } } else { input.skipUnknownField(); @@ -886,7 +968,7 @@ public SceneEntityInfo mergeFrom(final JsonSource input) throws IOException { if (input.isAtField(FieldNames.motion)) { if (!input.trySkipNullValue()) { input.readMessage(motion); - bitField0_ |= 0x00000080; + bitField0_ |= 0x00000100; } } else { input.skipUnknownField(); @@ -942,6 +1024,19 @@ public SceneEntityInfo mergeFrom(final JsonSource input) throws IOException { } break; } + case 80492037: + case -1790265822: { + if (input.isAtField(FieldNames.summonUnit)) { + if (!input.trySkipNullValue()) { + clearEntityCaseOtherSummonUnit(); + input.readMessage(summonUnit); + bitField0_ |= 0x00000010; + } + } else { + input.skipUnknownField(); + } + break; + } default: { input.skipUnknownField(); break; @@ -1010,6 +1105,8 @@ static class FieldNames { static final FieldName prop = FieldName.forField("prop"); static final FieldName actor = FieldName.forField("actor"); + + static final FieldName summonUnit = FieldName.forField("summonUnit", "summon_unit"); } } } diff --git a/src/generated/main/emu/lunarcore/proto/SceneSummonUnitInfoOuterClass.java b/src/generated/main/emu/lunarcore/proto/SceneSummonUnitInfoOuterClass.java new file mode 100644 index 000000000..12798d184 --- /dev/null +++ b/src/generated/main/emu/lunarcore/proto/SceneSummonUnitInfoOuterClass.java @@ -0,0 +1,699 @@ +// 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; +import us.hebi.quickbuf.RepeatedString; + +public final class SceneSummonUnitInfoOuterClass { + /** + * Protobuf type {@code SceneSummonUnitInfo} + */ + public static final class SceneSummonUnitInfo extends ProtoMessage implements Cloneable { + private static final long serialVersionUID = 0L; + + /** + * optional uint64 create_time_ms = 14; + */ + private long createTimeMs; + + /** + * optional int32 life_time_ms = 6; + */ + private int lifeTimeMs; + + /** + * optional uint32 caster_entity_id = 11; + */ + private int casterEntityId; + + /** + * optional uint32 attach_entity_id = 12; + */ + private int attachEntityId; + + /** + * optional uint32 summon_unit_id = 13; + */ + private int summonUnitId; + + /** + * repeated string custom_triggers = 3; + */ + private final RepeatedString customTriggers = RepeatedString.newEmptyInstance(); + + private SceneSummonUnitInfo() { + } + + /** + * @return a new empty instance of {@code SceneSummonUnitInfo} + */ + public static SceneSummonUnitInfo newInstance() { + return new SceneSummonUnitInfo(); + } + + /** + * optional uint64 create_time_ms = 14; + * @return whether the createTimeMs field is set + */ + public boolean hasCreateTimeMs() { + return (bitField0_ & 0x00000001) != 0; + } + + /** + * optional uint64 create_time_ms = 14; + * @return this + */ + public SceneSummonUnitInfo clearCreateTimeMs() { + bitField0_ &= ~0x00000001; + createTimeMs = 0L; + return this; + } + + /** + * optional uint64 create_time_ms = 14; + * @return the createTimeMs + */ + public long getCreateTimeMs() { + return createTimeMs; + } + + /** + * optional uint64 create_time_ms = 14; + * @param value the createTimeMs to set + * @return this + */ + public SceneSummonUnitInfo setCreateTimeMs(final long value) { + bitField0_ |= 0x00000001; + createTimeMs = value; + return this; + } + + /** + * optional int32 life_time_ms = 6; + * @return whether the lifeTimeMs field is set + */ + public boolean hasLifeTimeMs() { + return (bitField0_ & 0x00000002) != 0; + } + + /** + * optional int32 life_time_ms = 6; + * @return this + */ + public SceneSummonUnitInfo clearLifeTimeMs() { + bitField0_ &= ~0x00000002; + lifeTimeMs = 0; + return this; + } + + /** + * optional int32 life_time_ms = 6; + * @return the lifeTimeMs + */ + public int getLifeTimeMs() { + return lifeTimeMs; + } + + /** + * optional int32 life_time_ms = 6; + * @param value the lifeTimeMs to set + * @return this + */ + public SceneSummonUnitInfo setLifeTimeMs(final int value) { + bitField0_ |= 0x00000002; + lifeTimeMs = value; + return this; + } + + /** + * optional uint32 caster_entity_id = 11; + * @return whether the casterEntityId field is set + */ + public boolean hasCasterEntityId() { + return (bitField0_ & 0x00000004) != 0; + } + + /** + * optional uint32 caster_entity_id = 11; + * @return this + */ + public SceneSummonUnitInfo clearCasterEntityId() { + bitField0_ &= ~0x00000004; + casterEntityId = 0; + return this; + } + + /** + * optional uint32 caster_entity_id = 11; + * @return the casterEntityId + */ + public int getCasterEntityId() { + return casterEntityId; + } + + /** + * optional uint32 caster_entity_id = 11; + * @param value the casterEntityId to set + * @return this + */ + public SceneSummonUnitInfo setCasterEntityId(final int value) { + bitField0_ |= 0x00000004; + casterEntityId = value; + return this; + } + + /** + * optional uint32 attach_entity_id = 12; + * @return whether the attachEntityId field is set + */ + public boolean hasAttachEntityId() { + return (bitField0_ & 0x00000008) != 0; + } + + /** + * optional uint32 attach_entity_id = 12; + * @return this + */ + public SceneSummonUnitInfo clearAttachEntityId() { + bitField0_ &= ~0x00000008; + attachEntityId = 0; + return this; + } + + /** + * optional uint32 attach_entity_id = 12; + * @return the attachEntityId + */ + public int getAttachEntityId() { + return attachEntityId; + } + + /** + * optional uint32 attach_entity_id = 12; + * @param value the attachEntityId to set + * @return this + */ + public SceneSummonUnitInfo setAttachEntityId(final int value) { + bitField0_ |= 0x00000008; + attachEntityId = value; + return this; + } + + /** + * optional uint32 summon_unit_id = 13; + * @return whether the summonUnitId field is set + */ + public boolean hasSummonUnitId() { + return (bitField0_ & 0x00000010) != 0; + } + + /** + * optional uint32 summon_unit_id = 13; + * @return this + */ + public SceneSummonUnitInfo clearSummonUnitId() { + bitField0_ &= ~0x00000010; + summonUnitId = 0; + return this; + } + + /** + * optional uint32 summon_unit_id = 13; + * @return the summonUnitId + */ + public int getSummonUnitId() { + return summonUnitId; + } + + /** + * optional uint32 summon_unit_id = 13; + * @param value the summonUnitId to set + * @return this + */ + public SceneSummonUnitInfo setSummonUnitId(final int value) { + bitField0_ |= 0x00000010; + summonUnitId = value; + return this; + } + + /** + * repeated string custom_triggers = 3; + * @return whether the customTriggers field is set + */ + public boolean hasCustomTriggers() { + return (bitField0_ & 0x00000020) != 0; + } + + /** + * repeated string custom_triggers = 3; + * @return this + */ + public SceneSummonUnitInfo clearCustomTriggers() { + bitField0_ &= ~0x00000020; + customTriggers.clear(); + return this; + } + + /** + * repeated string custom_triggers = 3; + * + * 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 #getMutableCustomTriggers()} if you want to modify it. + * + * @return internal storage object for reading + */ + public RepeatedString getCustomTriggers() { + return customTriggers; + } + + /** + * repeated string custom_triggers = 3; + * + * 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 RepeatedString getMutableCustomTriggers() { + bitField0_ |= 0x00000020; + return customTriggers; + } + + /** + * repeated string custom_triggers = 3; + * @param value the customTriggers to add + * @return this + */ + public SceneSummonUnitInfo addCustomTriggers(final CharSequence value) { + bitField0_ |= 0x00000020; + customTriggers.add(value); + return this; + } + + /** + * repeated string custom_triggers = 3; + * @param values the customTriggers to add + * @return this + */ + public SceneSummonUnitInfo addAllCustomTriggers(final CharSequence... values) { + bitField0_ |= 0x00000020; + customTriggers.addAll(values); + return this; + } + + @Override + public SceneSummonUnitInfo copyFrom(final SceneSummonUnitInfo other) { + cachedSize = other.cachedSize; + if ((bitField0_ | other.bitField0_) != 0) { + bitField0_ = other.bitField0_; + createTimeMs = other.createTimeMs; + lifeTimeMs = other.lifeTimeMs; + casterEntityId = other.casterEntityId; + attachEntityId = other.attachEntityId; + summonUnitId = other.summonUnitId; + customTriggers.copyFrom(other.customTriggers); + } + return this; + } + + @Override + public SceneSummonUnitInfo mergeFrom(final SceneSummonUnitInfo other) { + if (other.isEmpty()) { + return this; + } + cachedSize = -1; + if (other.hasCreateTimeMs()) { + setCreateTimeMs(other.createTimeMs); + } + if (other.hasLifeTimeMs()) { + setLifeTimeMs(other.lifeTimeMs); + } + if (other.hasCasterEntityId()) { + setCasterEntityId(other.casterEntityId); + } + if (other.hasAttachEntityId()) { + setAttachEntityId(other.attachEntityId); + } + if (other.hasSummonUnitId()) { + setSummonUnitId(other.summonUnitId); + } + if (other.hasCustomTriggers()) { + getMutableCustomTriggers().addAll(other.customTriggers); + } + return this; + } + + @Override + public SceneSummonUnitInfo clear() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + createTimeMs = 0L; + lifeTimeMs = 0; + casterEntityId = 0; + attachEntityId = 0; + summonUnitId = 0; + customTriggers.clear(); + return this; + } + + @Override + public SceneSummonUnitInfo clearQuick() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + customTriggers.clear(); + return this; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (!(o instanceof SceneSummonUnitInfo)) { + return false; + } + SceneSummonUnitInfo other = (SceneSummonUnitInfo) o; + return bitField0_ == other.bitField0_ + && (!hasCreateTimeMs() || createTimeMs == other.createTimeMs) + && (!hasLifeTimeMs() || lifeTimeMs == other.lifeTimeMs) + && (!hasCasterEntityId() || casterEntityId == other.casterEntityId) + && (!hasAttachEntityId() || attachEntityId == other.attachEntityId) + && (!hasSummonUnitId() || summonUnitId == other.summonUnitId) + && (!hasCustomTriggers() || customTriggers.equals(other.customTriggers)); + } + + @Override + public void writeTo(final ProtoSink output) throws IOException { + if ((bitField0_ & 0x00000001) != 0) { + output.writeRawByte((byte) 112); + output.writeUInt64NoTag(createTimeMs); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeRawByte((byte) 48); + output.writeInt32NoTag(lifeTimeMs); + } + if ((bitField0_ & 0x00000004) != 0) { + output.writeRawByte((byte) 88); + output.writeUInt32NoTag(casterEntityId); + } + if ((bitField0_ & 0x00000008) != 0) { + output.writeRawByte((byte) 96); + output.writeUInt32NoTag(attachEntityId); + } + if ((bitField0_ & 0x00000010) != 0) { + output.writeRawByte((byte) 104); + output.writeUInt32NoTag(summonUnitId); + } + if ((bitField0_ & 0x00000020) != 0) { + for (int i = 0; i < customTriggers.length(); i++) { + output.writeRawByte((byte) 26); + output.writeStringNoTag(customTriggers.get(i)); + } + } + } + + @Override + protected int computeSerializedSize() { + int size = 0; + if ((bitField0_ & 0x00000001) != 0) { + size += 1 + ProtoSink.computeUInt64SizeNoTag(createTimeMs); + } + if ((bitField0_ & 0x00000002) != 0) { + size += 1 + ProtoSink.computeInt32SizeNoTag(lifeTimeMs); + } + if ((bitField0_ & 0x00000004) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(casterEntityId); + } + if ((bitField0_ & 0x00000008) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(attachEntityId); + } + if ((bitField0_ & 0x00000010) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(summonUnitId); + } + if ((bitField0_ & 0x00000020) != 0) { + size += (1 * customTriggers.length()) + ProtoSink.computeRepeatedStringSizeNoTag(customTriggers); + } + return size; + } + + @Override + @SuppressWarnings("fallthrough") + public SceneSummonUnitInfo mergeFrom(final ProtoSource input) throws IOException { + // Enabled Fall-Through Optimization (QuickBuffers) + int tag = input.readTag(); + while (true) { + switch (tag) { + case 112: { + // createTimeMs + createTimeMs = input.readUInt64(); + bitField0_ |= 0x00000001; + tag = input.readTag(); + if (tag != 48) { + break; + } + } + case 48: { + // lifeTimeMs + lifeTimeMs = input.readInt32(); + bitField0_ |= 0x00000002; + tag = input.readTag(); + if (tag != 88) { + break; + } + } + case 88: { + // casterEntityId + casterEntityId = input.readUInt32(); + bitField0_ |= 0x00000004; + tag = input.readTag(); + if (tag != 96) { + break; + } + } + case 96: { + // attachEntityId + attachEntityId = input.readUInt32(); + bitField0_ |= 0x00000008; + tag = input.readTag(); + if (tag != 104) { + break; + } + } + case 104: { + // summonUnitId + summonUnitId = input.readUInt32(); + bitField0_ |= 0x00000010; + tag = input.readTag(); + if (tag != 26) { + break; + } + } + case 26: { + // customTriggers + tag = input.readRepeatedString(customTriggers, tag); + bitField0_ |= 0x00000020; + 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.writeUInt64(FieldNames.createTimeMs, createTimeMs); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeInt32(FieldNames.lifeTimeMs, lifeTimeMs); + } + if ((bitField0_ & 0x00000004) != 0) { + output.writeUInt32(FieldNames.casterEntityId, casterEntityId); + } + if ((bitField0_ & 0x00000008) != 0) { + output.writeUInt32(FieldNames.attachEntityId, attachEntityId); + } + if ((bitField0_ & 0x00000010) != 0) { + output.writeUInt32(FieldNames.summonUnitId, summonUnitId); + } + if ((bitField0_ & 0x00000020) != 0) { + output.writeRepeatedString(FieldNames.customTriggers, customTriggers); + } + output.endObject(); + } + + @Override + public SceneSummonUnitInfo mergeFrom(final JsonSource input) throws IOException { + if (!input.beginObject()) { + return this; + } + while (!input.isAtEnd()) { + switch (input.readFieldHash()) { + case 1554103663: + case 1902222357: { + if (input.isAtField(FieldNames.createTimeMs)) { + if (!input.trySkipNullValue()) { + createTimeMs = input.readUInt64(); + bitField0_ |= 0x00000001; + } + } else { + input.skipUnknownField(); + } + break; + } + case -1226028177: + case 1665182229: { + if (input.isAtField(FieldNames.lifeTimeMs)) { + if (!input.trySkipNullValue()) { + lifeTimeMs = input.readInt32(); + bitField0_ |= 0x00000002; + } + } else { + input.skipUnknownField(); + } + break; + } + case -1831162710: + case -1550367068: { + if (input.isAtField(FieldNames.casterEntityId)) { + if (!input.trySkipNullValue()) { + casterEntityId = input.readUInt32(); + bitField0_ |= 0x00000004; + } + } else { + input.skipUnknownField(); + } + break; + } + case -900612669: + case -644975235: { + if (input.isAtField(FieldNames.attachEntityId)) { + if (!input.trySkipNullValue()) { + attachEntityId = input.readUInt32(); + bitField0_ |= 0x00000008; + } + } else { + input.skipUnknownField(); + } + break; + } + case 43438592: + case 1094873176: { + if (input.isAtField(FieldNames.summonUnitId)) { + if (!input.trySkipNullValue()) { + summonUnitId = input.readUInt32(); + bitField0_ |= 0x00000010; + } + } else { + input.skipUnknownField(); + } + break; + } + case -1316859828: + case -1929554231: { + if (input.isAtField(FieldNames.customTriggers)) { + if (!input.trySkipNullValue()) { + input.readRepeatedString(customTriggers); + bitField0_ |= 0x00000020; + } + } else { + input.skipUnknownField(); + } + break; + } + default: { + input.skipUnknownField(); + break; + } + } + } + input.endObject(); + return this; + } + + @Override + public SceneSummonUnitInfo clone() { + return new SceneSummonUnitInfo().copyFrom(this); + } + + @Override + public boolean isEmpty() { + return ((bitField0_) == 0); + } + + public static SceneSummonUnitInfo parseFrom(final byte[] data) throws + InvalidProtocolBufferException { + return ProtoMessage.mergeFrom(new SceneSummonUnitInfo(), data).checkInitialized(); + } + + public static SceneSummonUnitInfo parseFrom(final ProtoSource input) throws IOException { + return ProtoMessage.mergeFrom(new SceneSummonUnitInfo(), input).checkInitialized(); + } + + public static SceneSummonUnitInfo parseFrom(final JsonSource input) throws IOException { + return ProtoMessage.mergeFrom(new SceneSummonUnitInfo(), input).checkInitialized(); + } + + /** + * @return factory for creating SceneSummonUnitInfo messages + */ + public static MessageFactory getFactory() { + return SceneSummonUnitInfoFactory.INSTANCE; + } + + private enum SceneSummonUnitInfoFactory implements MessageFactory { + INSTANCE; + + @Override + public SceneSummonUnitInfo create() { + return SceneSummonUnitInfo.newInstance(); + } + } + + /** + * Contains name constants used for serializing JSON + */ + static class FieldNames { + static final FieldName createTimeMs = FieldName.forField("createTimeMs", "create_time_ms"); + + static final FieldName lifeTimeMs = FieldName.forField("lifeTimeMs", "life_time_ms"); + + static final FieldName casterEntityId = FieldName.forField("casterEntityId", "caster_entity_id"); + + static final FieldName attachEntityId = FieldName.forField("attachEntityId", "attach_entity_id"); + + static final FieldName summonUnitId = FieldName.forField("summonUnitId", "summon_unit_id"); + + static final FieldName customTriggers = FieldName.forField("customTriggers", "custom_triggers"); + } + } +} diff --git a/src/generated/main/emu/lunarcore/proto/SyncEntityBuffChangeListScNotifyOuterClass.java b/src/generated/main/emu/lunarcore/proto/SyncEntityBuffChangeListScNotifyOuterClass.java new file mode 100644 index 000000000..57c75d065 --- /dev/null +++ b/src/generated/main/emu/lunarcore/proto/SyncEntityBuffChangeListScNotifyOuterClass.java @@ -0,0 +1,301 @@ +// 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; +import us.hebi.quickbuf.RepeatedMessage; + +public final class SyncEntityBuffChangeListScNotifyOuterClass { + /** + * Protobuf type {@code SyncEntityBuffChangeListScNotify} + */ + public static final class SyncEntityBuffChangeListScNotify extends ProtoMessage implements Cloneable { + private static final long serialVersionUID = 0L; + + /** + * repeated .EntityBuffChangeInfo entity_buff_info_list = 5; + */ + private final RepeatedMessage entityBuffInfoList = RepeatedMessage.newEmptyInstance(EntityBuffChangeInfoOuterClass.EntityBuffChangeInfo.getFactory()); + + private SyncEntityBuffChangeListScNotify() { + } + + /** + * @return a new empty instance of {@code SyncEntityBuffChangeListScNotify} + */ + public static SyncEntityBuffChangeListScNotify newInstance() { + return new SyncEntityBuffChangeListScNotify(); + } + + /** + * repeated .EntityBuffChangeInfo entity_buff_info_list = 5; + * @return whether the entityBuffInfoList field is set + */ + public boolean hasEntityBuffInfoList() { + return (bitField0_ & 0x00000001) != 0; + } + + /** + * repeated .EntityBuffChangeInfo entity_buff_info_list = 5; + * @return this + */ + public SyncEntityBuffChangeListScNotify clearEntityBuffInfoList() { + bitField0_ &= ~0x00000001; + entityBuffInfoList.clear(); + return this; + } + + /** + * repeated .EntityBuffChangeInfo entity_buff_info_list = 5; + * + * 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 #getMutableEntityBuffInfoList()} if you want to modify it. + * + * @return internal storage object for reading + */ + public RepeatedMessage getEntityBuffInfoList( + ) { + return entityBuffInfoList; + } + + /** + * repeated .EntityBuffChangeInfo entity_buff_info_list = 5; + * + * 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 RepeatedMessage getMutableEntityBuffInfoList( + ) { + bitField0_ |= 0x00000001; + return entityBuffInfoList; + } + + /** + * repeated .EntityBuffChangeInfo entity_buff_info_list = 5; + * @param value the entityBuffInfoList to add + * @return this + */ + public SyncEntityBuffChangeListScNotify addEntityBuffInfoList( + final EntityBuffChangeInfoOuterClass.EntityBuffChangeInfo value) { + bitField0_ |= 0x00000001; + entityBuffInfoList.add(value); + return this; + } + + /** + * repeated .EntityBuffChangeInfo entity_buff_info_list = 5; + * @param values the entityBuffInfoList to add + * @return this + */ + public SyncEntityBuffChangeListScNotify addAllEntityBuffInfoList( + final EntityBuffChangeInfoOuterClass.EntityBuffChangeInfo... values) { + bitField0_ |= 0x00000001; + entityBuffInfoList.addAll(values); + return this; + } + + @Override + public SyncEntityBuffChangeListScNotify copyFrom(final SyncEntityBuffChangeListScNotify other) { + cachedSize = other.cachedSize; + if ((bitField0_ | other.bitField0_) != 0) { + bitField0_ = other.bitField0_; + entityBuffInfoList.copyFrom(other.entityBuffInfoList); + } + return this; + } + + @Override + public SyncEntityBuffChangeListScNotify mergeFrom( + final SyncEntityBuffChangeListScNotify other) { + if (other.isEmpty()) { + return this; + } + cachedSize = -1; + if (other.hasEntityBuffInfoList()) { + getMutableEntityBuffInfoList().addAll(other.entityBuffInfoList); + } + return this; + } + + @Override + public SyncEntityBuffChangeListScNotify clear() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + entityBuffInfoList.clear(); + return this; + } + + @Override + public SyncEntityBuffChangeListScNotify clearQuick() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + entityBuffInfoList.clearQuick(); + return this; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (!(o instanceof SyncEntityBuffChangeListScNotify)) { + return false; + } + SyncEntityBuffChangeListScNotify other = (SyncEntityBuffChangeListScNotify) o; + return bitField0_ == other.bitField0_ + && (!hasEntityBuffInfoList() || entityBuffInfoList.equals(other.entityBuffInfoList)); + } + + @Override + public void writeTo(final ProtoSink output) throws IOException { + if ((bitField0_ & 0x00000001) != 0) { + for (int i = 0; i < entityBuffInfoList.length(); i++) { + output.writeRawByte((byte) 42); + output.writeMessageNoTag(entityBuffInfoList.get(i)); + } + } + } + + @Override + protected int computeSerializedSize() { + int size = 0; + if ((bitField0_ & 0x00000001) != 0) { + size += (1 * entityBuffInfoList.length()) + ProtoSink.computeRepeatedMessageSizeNoTag(entityBuffInfoList); + } + return size; + } + + @Override + @SuppressWarnings("fallthrough") + public SyncEntityBuffChangeListScNotify mergeFrom(final ProtoSource input) throws IOException { + // Enabled Fall-Through Optimization (QuickBuffers) + int tag = input.readTag(); + while (true) { + switch (tag) { + case 42: { + // entityBuffInfoList + tag = input.readRepeatedMessage(entityBuffInfoList, tag); + bitField0_ |= 0x00000001; + 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.writeRepeatedMessage(FieldNames.entityBuffInfoList, entityBuffInfoList); + } + output.endObject(); + } + + @Override + public SyncEntityBuffChangeListScNotify mergeFrom(final JsonSource input) throws IOException { + if (!input.beginObject()) { + return this; + } + while (!input.isAtEnd()) { + switch (input.readFieldHash()) { + case -614748318: + case -1583683457: { + if (input.isAtField(FieldNames.entityBuffInfoList)) { + if (!input.trySkipNullValue()) { + input.readRepeatedMessage(entityBuffInfoList); + bitField0_ |= 0x00000001; + } + } else { + input.skipUnknownField(); + } + break; + } + default: { + input.skipUnknownField(); + break; + } + } + } + input.endObject(); + return this; + } + + @Override + public SyncEntityBuffChangeListScNotify clone() { + return new SyncEntityBuffChangeListScNotify().copyFrom(this); + } + + @Override + public boolean isEmpty() { + return ((bitField0_) == 0); + } + + public static SyncEntityBuffChangeListScNotify parseFrom(final byte[] data) throws + InvalidProtocolBufferException { + return ProtoMessage.mergeFrom(new SyncEntityBuffChangeListScNotify(), data).checkInitialized(); + } + + public static SyncEntityBuffChangeListScNotify parseFrom(final ProtoSource input) throws + IOException { + return ProtoMessage.mergeFrom(new SyncEntityBuffChangeListScNotify(), input).checkInitialized(); + } + + public static SyncEntityBuffChangeListScNotify parseFrom(final JsonSource input) throws + IOException { + return ProtoMessage.mergeFrom(new SyncEntityBuffChangeListScNotify(), input).checkInitialized(); + } + + /** + * @return factory for creating SyncEntityBuffChangeListScNotify messages + */ + public static MessageFactory getFactory() { + return SyncEntityBuffChangeListScNotifyFactory.INSTANCE; + } + + private enum SyncEntityBuffChangeListScNotifyFactory implements MessageFactory { + INSTANCE; + + @Override + public SyncEntityBuffChangeListScNotify create() { + return SyncEntityBuffChangeListScNotify.newInstance(); + } + } + + /** + * Contains name constants used for serializing JSON + */ + static class FieldNames { + static final FieldName entityBuffInfoList = FieldName.forField("entityBuffInfoList", "entity_buff_info_list"); + } + } +} diff --git a/src/main/java/emu/lunarcore/data/GameData.java b/src/main/java/emu/lunarcore/data/GameData.java index 49808d625..013bbbe1d 100644 --- a/src/main/java/emu/lunarcore/data/GameData.java +++ b/src/main/java/emu/lunarcore/data/GameData.java @@ -24,6 +24,7 @@ public class GameData { @Getter private static Int2ObjectMap relicExcelMap = new Int2ObjectOpenHashMap<>(); @Getter private static Int2ObjectMap propExcelMap = new Int2ObjectOpenHashMap<>(); @Getter private static Int2ObjectMap npcExcelMap = new Int2ObjectOpenHashMap<>(); + @Getter private static Int2ObjectMap summonUnitExcelMap = new Int2ObjectOpenHashMap<>(); @Getter private static Int2ObjectMap monsterExcelMap = new Int2ObjectOpenHashMap<>(); @Getter private static Int2ObjectMap npcMonsterExcelMap = new Int2ObjectOpenHashMap<>(); @Getter private static Int2ObjectMap stageExcelMap = new Int2ObjectOpenHashMap<>(); diff --git a/src/main/java/emu/lunarcore/data/ResourceLoader.java b/src/main/java/emu/lunarcore/data/ResourceLoader.java index 85895704f..ddde9736b 100644 --- a/src/main/java/emu/lunarcore/data/ResourceLoader.java +++ b/src/main/java/emu/lunarcore/data/ResourceLoader.java @@ -21,6 +21,7 @@ import emu.lunarcore.data.config.FloorInfo.FloorGroupSimpleInfo; import emu.lunarcore.data.config.GroupInfo; import emu.lunarcore.data.config.SkillAbilityInfo; +import emu.lunarcore.data.config.SummonUnitInfo; import it.unimi.dsi.fastutil.ints.Int2ObjectMap; public class ResourceLoader { @@ -227,8 +228,40 @@ private static void loadFloorInfos() { // Might be better to cache private static void loadMazeAbilities() { + // Loaded configs count int count = 0; + + // Load summon unit configs + for (var summonUnitExcel : GameData.getSummonUnitExcelMap().values()) { + if (summonUnitExcel.isIsClient()) { + count++; + continue; + } + + // Get file + File file = new File(LunarCore.getConfig().getResourceDir() + "/" + summonUnitExcel.getJsonPath()); + if (!file.exists()) continue; + + try (FileReader reader = new FileReader(file)) { + SummonUnitInfo info = gson.fromJson(reader, SummonUnitInfo.class); + info.buildMazeSkillActions(); + + summonUnitExcel.setInfo(info); + count++; + } catch (Exception e) { + e.printStackTrace(); + } + } + + // Notify the server owner if we are missing any files + if (count < GameData.getSummonUnitExcelMap().size()) { + LunarCore.getLogger().warn("Summon unit configs are missing, please check your resources folder: {resources}/Config/ConfigSummonUnit. Character summon techniques may not work!"); + } + + // Reset loaded count + count = 0; + // Load maze abilities for (var avatarExcel : GameData.getAvatarExcelMap().values()) { // Get file File file = new File(LunarCore.getConfig().getResourceDir() + "/Config/ConfigAdventureAbility/LocalPlayer/LocalPlayer_" + avatarExcel.getNameKey() + "_Ability.json"); diff --git a/src/main/java/emu/lunarcore/data/config/SkillAbilityInfo.java b/src/main/java/emu/lunarcore/data/config/SkillAbilityInfo.java index 9617abf1c..151c88f68 100644 --- a/src/main/java/emu/lunarcore/data/config/SkillAbilityInfo.java +++ b/src/main/java/emu/lunarcore/data/config/SkillAbilityInfo.java @@ -2,6 +2,7 @@ import java.util.List; +import emu.lunarcore.data.GameData; import emu.lunarcore.data.excel.AvatarExcel; import emu.lunarcore.game.battle.skills.*; import lombok.Getter; @@ -27,6 +28,13 @@ public boolean parse(AvatarExcel avatarExcel) { avatarExcel.setMazeSkill(skill); actionList = skill.getCastActions(); + + // Hacky way to check if an avatar can summon with their skill + var summonUnitExcel = GameData.getSummonUnitExcelMap().get((skill.getId() * 10) + 1); + if (summonUnitExcel != null && !summonUnitExcel.isIsClient()) { + // TODO duration is hardcoded + skill.getCastActions().add(new MazeSkillSummonUnit(summonUnitExcel, 20)); + } } else if (ability.getName().contains("NormalAtk")) { skill = new MazeSkill(avatarExcel, 0); avatarExcel.setMazeAttack(skill); @@ -46,6 +54,7 @@ public boolean parse(AvatarExcel avatarExcel) { } // "Simple" way to parse maze attacks/skills + // TODO parse tasks better private void parseTask(MazeSkill skill, List actionList, TaskInfo task) { if (task.getType().contains("AddMazeBuff")) { // TODO get duration from params if buff duration is dynamic @@ -59,7 +68,7 @@ private void parseTask(MazeSkill skill, List actionList, TaskIn // TODO get sp increase value from params, also handle target alias actionList.add(new MazeSkillModifySP(50)); } else if (task.getType().contains("CreateSummonUnit")) { - + // Ignored } else if (task.getSuccessTaskList() != null) { for (TaskInfo t : task.getSuccessTaskList()) { parseTask(skill, actionList, t); diff --git a/src/main/java/emu/lunarcore/data/config/SummonUnitInfo.java b/src/main/java/emu/lunarcore/data/config/SummonUnitInfo.java new file mode 100644 index 000000000..cd465de70 --- /dev/null +++ b/src/main/java/emu/lunarcore/data/config/SummonUnitInfo.java @@ -0,0 +1,75 @@ +package emu.lunarcore.data.config; + +import java.util.ArrayList; +import java.util.List; + +import emu.lunarcore.game.battle.skills.MazeSkillAction; +import emu.lunarcore.game.battle.skills.MazeSkillAddBuff; +import lombok.Getter; + +/** + * Original name: SummonUnitConfig + */ +@Getter +public class SummonUnitInfo { + private String AttachPoint; + private SummonUnitTriggers TriggerConfig; + + public List getCustomTriggers() { + return TriggerConfig.getCustomTriggers(); + } + + public SummonUnitCustomTrigger getTriggerByName(String name) { + return getCustomTriggers().stream() + .filter(c -> c.getTriggerName().equals(name)) + .findFirst() + .orElse(null); + } + + public void buildMazeSkillActions() { + for (var customTrigger : getCustomTriggers()) { + customTrigger.buildMazeSkillActions(); + } + } + + /** + * Original name: SummonUnitTriggerConfig + */ + @Getter + public static class SummonUnitTriggers { + private List CustomTriggers; + } + + /** + * Original name: UnitCustomTriggerConfig + */ + @Getter + public static class SummonUnitCustomTrigger { + private String TriggerName; + private List OnTriggerEnter; + + private transient List actions; + + public void buildMazeSkillActions() { + // Create actions list + this.actions = new ArrayList<>(); + + // Sanity check + if (this.OnTriggerEnter == null) return; + + // Build maze actions + for (var task : this.OnTriggerEnter) { + if (task.getType().contains("AddMazeBuff")) { + // TODO get duration from params if buff duration is dynamic + var actionAddBuff = new MazeSkillAddBuff(task.getID(), 15); + actionAddBuff.setSendBuffPacket(true); + + actions.add(actionAddBuff); + } else if (task.getType().contains("TriggerHitProp")) { + // actions.add(new MazeSkillAddBuff(task.getID(), 20)); + } + } + } + } + +} diff --git a/src/main/java/emu/lunarcore/data/excel/SummonUnitExcel.java b/src/main/java/emu/lunarcore/data/excel/SummonUnitExcel.java new file mode 100644 index 000000000..fb80fc292 --- /dev/null +++ b/src/main/java/emu/lunarcore/data/excel/SummonUnitExcel.java @@ -0,0 +1,28 @@ +package emu.lunarcore.data.excel; + +import emu.lunarcore.data.GameResource; +import emu.lunarcore.data.ResourceType; +import emu.lunarcore.data.config.SummonUnitInfo; +import lombok.Getter; + +@Getter +@ResourceType(name = {"SummonUnitData.json"}) +public class SummonUnitExcel extends GameResource { + private int ID; + private String JsonPath; + private boolean IsClient; + + private transient SummonUnitInfo info; + + @Override + public int getId() { + return ID; + } + + public void setInfo(SummonUnitInfo info) { + if (this.info == null && !this.IsClient) { + this.info = info; + } + } + +} diff --git a/src/main/java/emu/lunarcore/game/battle/BattleService.java b/src/main/java/emu/lunarcore/game/battle/BattleService.java index 586c613df..6715a08ee 100644 --- a/src/main/java/emu/lunarcore/game/battle/BattleService.java +++ b/src/main/java/emu/lunarcore/game/battle/BattleService.java @@ -80,9 +80,9 @@ public void startBattle(Player player, int casterId, int attackedGroupId, MazeSk if (entity instanceof EntityMonster monster) { monsters.add(monster); - } else if (entity instanceof EntityProp) { + } else if (entity instanceof EntityProp prop) { it.remove(); - player.getScene().removeEntity(entity); + player.getScene().destroyProp(prop); } } diff --git a/src/main/java/emu/lunarcore/game/battle/skills/MazeSkill.java b/src/main/java/emu/lunarcore/game/battle/skills/MazeSkill.java index 240972adc..677e7f339 100644 --- a/src/main/java/emu/lunarcore/game/battle/skills/MazeSkill.java +++ b/src/main/java/emu/lunarcore/game/battle/skills/MazeSkill.java @@ -6,7 +6,7 @@ import emu.lunarcore.data.excel.AvatarExcel; import emu.lunarcore.game.avatar.GameAvatar; import emu.lunarcore.game.battle.Battle; -import emu.lunarcore.game.scene.entity.EntityMonster; +import emu.lunarcore.game.scene.entity.GameEntity; import emu.lunarcore.proto.MotionInfoOuterClass.MotionInfo; import lombok.Getter; import lombok.Setter; @@ -47,11 +47,11 @@ public void onAttack(GameAvatar caster, Battle battle) { } // Triggered when player attacks an enemy - public void onAttack(GameAvatar caster, List monsters) { + public void onAttack(GameAvatar caster, List entities) { if (this.getAttackActions().size() == 0) return; for (var action : this.getAttackActions()) { - action.onAttack(caster, monsters); + action.onAttack(caster, entities); } } } diff --git a/src/main/java/emu/lunarcore/game/battle/skills/MazeSkillAction.java b/src/main/java/emu/lunarcore/game/battle/skills/MazeSkillAction.java index 195aa2373..04eb62aa4 100644 --- a/src/main/java/emu/lunarcore/game/battle/skills/MazeSkillAction.java +++ b/src/main/java/emu/lunarcore/game/battle/skills/MazeSkillAction.java @@ -4,7 +4,7 @@ import emu.lunarcore.game.avatar.GameAvatar; import emu.lunarcore.game.battle.Battle; -import emu.lunarcore.game.scene.entity.EntityMonster; +import emu.lunarcore.game.scene.entity.GameEntity; import emu.lunarcore.proto.MotionInfoOuterClass.MotionInfo; public abstract class MazeSkillAction { @@ -13,6 +13,6 @@ public abstract class MazeSkillAction { public abstract void onAttack(GameAvatar caster, Battle battle); - public abstract void onAttack(GameAvatar caster, List monsters); + public abstract void onAttack(GameAvatar caster, List entities); } diff --git a/src/main/java/emu/lunarcore/game/battle/skills/MazeSkillAddBuff.java b/src/main/java/emu/lunarcore/game/battle/skills/MazeSkillAddBuff.java index 772922a0f..d193ca994 100644 --- a/src/main/java/emu/lunarcore/game/battle/skills/MazeSkillAddBuff.java +++ b/src/main/java/emu/lunarcore/game/battle/skills/MazeSkillAddBuff.java @@ -5,14 +5,20 @@ import emu.lunarcore.game.avatar.GameAvatar; import emu.lunarcore.game.battle.Battle; import emu.lunarcore.game.scene.entity.EntityMonster; +import emu.lunarcore.game.scene.entity.GameEntity; import emu.lunarcore.proto.MotionInfoOuterClass.MotionInfo; +import emu.lunarcore.server.packet.send.PacketSyncEntityBuffChangeListScNotify; import lombok.Getter; +import lombok.Setter; @Getter public class MazeSkillAddBuff extends MazeSkillAction { private int buffId; private int duration; + @Setter + private boolean sendBuffPacket; + public MazeSkillAddBuff(int buffId, int duration) { this.buffId = buffId; this.duration = duration; @@ -34,9 +40,17 @@ public void onAttack(GameAvatar caster, Battle battle) { } @Override - public void onAttack(GameAvatar caster, List monsters) { - for (EntityMonster monster : monsters) { - monster.addBuff(caster.getAvatarId(), buffId, duration); + public void onAttack(GameAvatar caster, List entities) { + for (GameEntity entity : entities) { + if (entity instanceof EntityMonster monster) { + // Add buff to monster + var buff = monster.addBuff(caster.getAvatarId(), buffId, duration); + + // Send packet + if (buff != null && this.sendBuffPacket) { + caster.getOwner().sendPacket(new PacketSyncEntityBuffChangeListScNotify(entity.getEntityId(), buff)); + } + } } } diff --git a/src/main/java/emu/lunarcore/game/battle/skills/MazeSkillHitProp.java b/src/main/java/emu/lunarcore/game/battle/skills/MazeSkillHitProp.java new file mode 100644 index 000000000..7ebed063f --- /dev/null +++ b/src/main/java/emu/lunarcore/game/battle/skills/MazeSkillHitProp.java @@ -0,0 +1,34 @@ +package emu.lunarcore.game.battle.skills; + +import java.util.List; + +import emu.lunarcore.game.avatar.GameAvatar; +import emu.lunarcore.game.battle.Battle; +import emu.lunarcore.game.scene.entity.EntityProp; +import emu.lunarcore.game.scene.entity.GameEntity; +import emu.lunarcore.proto.MotionInfoOuterClass.MotionInfo; +import lombok.Getter; + +@Getter +public class MazeSkillHitProp extends MazeSkillAction { + + @Override + public void onCast(GameAvatar caster, MotionInfo castPosition) { + // Skip + } + + @Override + public void onAttack(GameAvatar caster, Battle battle) { + // Skip + } + + @Override + public void onAttack(GameAvatar caster, List entities) { + for (GameEntity entity : entities) { + if (entity instanceof EntityProp prop) { + caster.getScene().destroyProp(prop); + } + } + } + +} diff --git a/src/main/java/emu/lunarcore/game/battle/skills/MazeSkillModifyHP.java b/src/main/java/emu/lunarcore/game/battle/skills/MazeSkillModifyHP.java index 7872a57bf..6747ef0d0 100644 --- a/src/main/java/emu/lunarcore/game/battle/skills/MazeSkillModifyHP.java +++ b/src/main/java/emu/lunarcore/game/battle/skills/MazeSkillModifyHP.java @@ -4,7 +4,7 @@ import emu.lunarcore.game.avatar.GameAvatar; import emu.lunarcore.game.battle.Battle; -import emu.lunarcore.game.scene.entity.EntityMonster; +import emu.lunarcore.game.scene.entity.GameEntity; import emu.lunarcore.proto.MotionInfoOuterClass.MotionInfo; public class MazeSkillModifyHP extends MazeSkillAction { @@ -25,7 +25,7 @@ public void onAttack(GameAvatar caster, Battle battle) { } @Override - public void onAttack(GameAvatar caster, List monsters) { + public void onAttack(GameAvatar caster, List entities) { } diff --git a/src/main/java/emu/lunarcore/game/battle/skills/MazeSkillModifySP.java b/src/main/java/emu/lunarcore/game/battle/skills/MazeSkillModifySP.java index 1e6e807a2..d1b754fb5 100644 --- a/src/main/java/emu/lunarcore/game/battle/skills/MazeSkillModifySP.java +++ b/src/main/java/emu/lunarcore/game/battle/skills/MazeSkillModifySP.java @@ -4,7 +4,7 @@ import emu.lunarcore.game.avatar.GameAvatar; import emu.lunarcore.game.battle.Battle; -import emu.lunarcore.game.scene.entity.EntityMonster; +import emu.lunarcore.game.scene.entity.GameEntity; import emu.lunarcore.proto.MotionInfoOuterClass.MotionInfo; public class MazeSkillModifySP extends MazeSkillAction { @@ -28,7 +28,7 @@ public void onAttack(GameAvatar caster, Battle battle) { } @Override - public void onAttack(GameAvatar caster, List monsters) { + public void onAttack(GameAvatar caster, List entities) { } diff --git a/src/main/java/emu/lunarcore/game/battle/skills/MazeSkillSummonUnit.java b/src/main/java/emu/lunarcore/game/battle/skills/MazeSkillSummonUnit.java index ae9cdd831..3dfb1c067 100644 --- a/src/main/java/emu/lunarcore/game/battle/skills/MazeSkillSummonUnit.java +++ b/src/main/java/emu/lunarcore/game/battle/skills/MazeSkillSummonUnit.java @@ -2,26 +2,37 @@ import java.util.List; +import emu.lunarcore.data.excel.SummonUnitExcel; import emu.lunarcore.game.avatar.GameAvatar; import emu.lunarcore.game.battle.Battle; -import emu.lunarcore.game.scene.entity.EntityMonster; +import emu.lunarcore.game.scene.entity.GameEntity; import emu.lunarcore.proto.MotionInfoOuterClass.MotionInfo; +import emu.lunarcore.util.Position; +import lombok.Getter; +@Getter public class MazeSkillSummonUnit extends MazeSkillAction { + private SummonUnitExcel excel; + private int duration; + + public MazeSkillSummonUnit(SummonUnitExcel excel, int duration) { + this.excel = excel; + this.duration = duration; + } @Override public void onCast(GameAvatar caster, MotionInfo castPosition) { - // TODO Auto-generated method stub + caster.getScene().summonUnit(caster, excel, new Position(castPosition.getPos()), new Position(castPosition.getRot()), duration); } @Override public void onAttack(GameAvatar caster, Battle battle) { - // TODO Auto-generated method stub + // Skip } @Override - public void onAttack(GameAvatar caster, List monsters) { - // TODO Auto-generated method stub + public void onAttack(GameAvatar caster, List entities) { + // Skip } } diff --git a/src/main/java/emu/lunarcore/game/player/Player.java b/src/main/java/emu/lunarcore/game/player/Player.java index 4481978c6..4e341cde6 100644 --- a/src/main/java/emu/lunarcore/game/player/Player.java +++ b/src/main/java/emu/lunarcore/game/player/Player.java @@ -274,9 +274,16 @@ public int setBirthday(int birthday) { } public void setWorldLevel(int level) { + if (this.worldLevel == level) { + return; + } + this.worldLevel = level; - this.save(); - this.sendPacket(new PacketPlayerSyncScNotify(this)); + + if (this.isOnline()) { + this.save(); + this.getSession().send(new PacketPlayerSyncScNotify(this)); + } } public int getWorldLevel() { @@ -470,7 +477,12 @@ public boolean isInBattle() { } public void setBattle(Battle battle) { + // Set battle first this.battle = battle; + // Scene handler + if (this.getScene() != null) { + this.getScene().onBattleStart(battle); + } } public void forceQuitBattle() { @@ -572,7 +584,7 @@ public EntityProp interactWithProp(int propEntityId) { // Finish puzzle prop.setState(PropState.Locked); // Trigger event - this.getScene().invokeTrigger(PropTriggerType.PUZZLE_FINISH, prop.getGroupId(), prop.getInstId()); + this.getScene().invokePropTrigger(PropTriggerType.PUZZLE_FINISH, prop.getGroupId(), prop.getInstId()); // return prop; } @@ -711,7 +723,12 @@ public void sendPacket(BasePacket packet) { } public void onTick() { + // Update stamina this.updateStamina(); + // Scene update + if (this.getScene() != null) { + this.getScene().onTick(); + } } @SuppressWarnings("deprecation") diff --git a/src/main/java/emu/lunarcore/game/scene/Scene.java b/src/main/java/emu/lunarcore/game/scene/Scene.java index 8d3671934..3f4f6cc90 100644 --- a/src/main/java/emu/lunarcore/game/scene/Scene.java +++ b/src/main/java/emu/lunarcore/game/scene/Scene.java @@ -6,22 +6,27 @@ import emu.lunarcore.data.GameData; import emu.lunarcore.data.config.*; import emu.lunarcore.data.excel.MazePlaneExcel; +import emu.lunarcore.data.excel.SummonUnitExcel; import emu.lunarcore.game.avatar.GameAvatar; +import emu.lunarcore.game.battle.Battle; import emu.lunarcore.game.enums.PlaneType; import emu.lunarcore.game.scene.entity.*; import emu.lunarcore.game.scene.triggers.PropTrigger; import emu.lunarcore.game.scene.triggers.PropTriggerType; import emu.lunarcore.game.player.Player; import emu.lunarcore.game.player.lineup.PlayerLineup; +import emu.lunarcore.proto.MotionInfoOuterClass.MotionInfo; import emu.lunarcore.proto.SceneEntityGroupInfoOuterClass.SceneEntityGroupInfo; import emu.lunarcore.proto.SceneGroupStateOuterClass.SceneGroupState; import emu.lunarcore.proto.SceneInfoOuterClass.SceneInfo; import emu.lunarcore.server.packet.send.PacketActivateFarmElementScRsp; +import emu.lunarcore.server.packet.send.PacketRefreshTriggerByClientScNotify; import emu.lunarcore.server.packet.send.PacketSceneGroupRefreshScNotify; - +import emu.lunarcore.util.Position; import it.unimi.dsi.fastutil.ints.*; import it.unimi.dsi.fastutil.objects.ObjectArrayList; import lombok.Getter; +import us.hebi.quickbuf.RepeatedInt; @Getter public class Scene { @@ -39,6 +44,7 @@ public class Scene { // Avatar entites private final IntSet avatarEntityIds; private final Int2ObjectMap avatars; + private EntitySummonUnit playerSummon; // Other entities private final Int2ObjectMap entities; @@ -208,6 +214,64 @@ public boolean activateFarmElement(int entityId, int worldLevel) { return true; } + // Summons + + public synchronized void summonUnit(GameAvatar caster, SummonUnitExcel excel, Position pos, Position rot, int duration) { + // Remove previous summon + this.removeSummonUnit(); + + // Add a new summoned unit to scene + var summon = new EntitySummonUnit(this, caster, excel, pos, rot); + summon.setDuration(duration); + + this.addEntity(summon, true); + } + + public synchronized void removeSummonUnit() { + if (this.getPlayerSummon() != null) { + this.removeEntity(this.getPlayerSummon()); + } + } + + public void handleSummonUnitTriggers(int entityId, String name, MotionInfo motion, RepeatedInt targetIds) { + // Get summon unit + EntitySummonUnit summonUnit = null; + + var entity = this.getEntityById(entityId); + if (entity instanceof EntitySummonUnit) { + summonUnit = (EntitySummonUnit) entity; + } else { + return; + } + + // Get trigger + var trigger = summonUnit.getExcel().getInfo().getTriggerByName(name); + if (trigger == null) return; + + // Get targets + var targets = new ArrayList(); + + for (int targetId : targetIds) { + var target = this.getEntityById(targetId); + if (target != null) { + targets.add(target); + } + } + + // Handle task actions + for (var action : trigger.getActions()) { + action.onAttack(summonUnit.getCaster(), targets); + } + + // Send packet + this.getPlayer().sendPacket(new PacketRefreshTriggerByClientScNotify(entityId, name, targetIds)); + } + + public void destroyProp(EntityProp prop) { + // TODO sanity check prop to make sure it can be destroyed + this.removeEntity(prop); + } + /** * Returns the nearest spring (Space Anchor) to the player in the scene * @return @@ -238,7 +302,7 @@ public EntityProp getNearestSpring(long minDistSq) { return spring; } - public void invokeTrigger(PropTriggerType type, int param1, int param2) { + public void invokePropTrigger(PropTriggerType type, int param1, int param2) { for (PropTrigger trigger : this.getTriggers()) { if (trigger.shouldRun(param1, param2)) { trigger.run(this); @@ -286,6 +350,26 @@ public synchronized void removeEntity(int entityId) { } } + // Player events + + public void onTick() { + // Remove summoned unit if it expired + if (this.getPlayerSummon() != null) { + if (this.getPlayerSummon().isExpired()) { + this.removeSummonUnit(); + } + } + } + + public void onBattleStart(Battle battle) { + // Remove summoned unit + if (this.getPlayerSummon() != null) { + this.removeSummonUnit(); + } + } + + // Proto serialization + public synchronized SceneInfo toProto() { // Set loaded flag this.loaded = true; diff --git a/src/main/java/emu/lunarcore/game/scene/SceneBuff.java b/src/main/java/emu/lunarcore/game/scene/SceneBuff.java new file mode 100644 index 000000000..9cfb114d3 --- /dev/null +++ b/src/main/java/emu/lunarcore/game/scene/SceneBuff.java @@ -0,0 +1,37 @@ +package emu.lunarcore.game.scene; + +import emu.lunarcore.proto.BuffInfoOuterClass.BuffInfo; +import lombok.Getter; + +@Getter +public class SceneBuff { + private int casterAvatarId; // Owner avatar id + private int buffId; + private int buffLevel; + private int duration; + private long createTime; + private long expiry; + + public SceneBuff(int casterAvatarId, int buffId, int seconds) { + this.casterAvatarId = casterAvatarId; + this.buffId = buffId; + this.buffLevel = 1; + this.createTime = System.currentTimeMillis(); + this.duration = seconds * 1000; + this.expiry = this.createTime + duration; + } + + // Serialization + + public BuffInfo toProto() { + var proto = BuffInfo.newInstance() + .setBuffId(this.getBuffId()) + .setLevel(this.getBuffLevel()) + .setBaseAvatarId(this.getCasterAvatarId()) + .setAddTimeMs(this.getCreateTime()) + .setLifeTime(this.getDuration() / 10) + .setCount(1); + + return proto; + } +} diff --git a/src/main/java/emu/lunarcore/game/scene/SceneEntityBuff.java b/src/main/java/emu/lunarcore/game/scene/SceneEntityBuff.java deleted file mode 100644 index 82afe550d..000000000 --- a/src/main/java/emu/lunarcore/game/scene/SceneEntityBuff.java +++ /dev/null @@ -1,16 +0,0 @@ -package emu.lunarcore.game.scene; - -import lombok.Getter; - -@Getter -public class SceneEntityBuff { - private int owner; // Owner avatar id - private int id; - private long expiry; - - public SceneEntityBuff(int owner, int id, long duration) { - this.owner = owner; - this.id = id; - this.expiry = System.currentTimeMillis() + (duration * 1000); - } -} diff --git a/src/main/java/emu/lunarcore/game/scene/entity/EntityMonster.java b/src/main/java/emu/lunarcore/game/scene/entity/EntityMonster.java index bbdde02aa..16e679b0f 100644 --- a/src/main/java/emu/lunarcore/game/scene/entity/EntityMonster.java +++ b/src/main/java/emu/lunarcore/game/scene/entity/EntityMonster.java @@ -5,7 +5,7 @@ import emu.lunarcore.data.excel.NpcMonsterExcel; import emu.lunarcore.game.battle.Battle; import emu.lunarcore.game.scene.Scene; -import emu.lunarcore.game.scene.SceneEntityBuff; +import emu.lunarcore.game.scene.SceneBuff; import emu.lunarcore.game.scene.triggers.PropTriggerType; import emu.lunarcore.proto.MotionInfoOuterClass.MotionInfo; import emu.lunarcore.proto.SceneEntityInfoOuterClass.SceneEntityInfo; @@ -29,7 +29,7 @@ public class EntityMonster implements GameEntity { private final Position pos; private final Position rot; - private Int2ObjectMap buffs; + private Int2ObjectMap buffs; private int farmElementId; @Setter private int overrideStageId; @Setter private int overrideLevel; @@ -56,12 +56,17 @@ public int getStageId() { } } - public void addBuff(int caster, int buffId, int duration) { + public SceneBuff addBuff(int caster, int buffId, int duration) { if (this.buffs == null) { this.buffs = new Int2ObjectOpenHashMap<>(); } - this.buffs.put(buffId, new SceneEntityBuff(caster, buffId, duration)); + // Create buff + var buff = new SceneBuff(caster, buffId, duration); + + // Add to buff map + this.buffs.put(buffId, buff); + return buff; } public void applyBuffs(Battle battle) { @@ -79,7 +84,7 @@ public void applyBuffs(Battle battle) { } // Get owner index - int ownerIndex = battle.getLineup().indexOf(entry.getValue().getOwner()); + int ownerIndex = battle.getLineup().indexOf(entry.getValue().getCasterAvatarId()); // Add buff to battle if owner exists if (ownerIndex != -1) { @@ -92,7 +97,7 @@ public void applyBuffs(Battle battle) { @Override public void onRemove() { // Try to fire any triggers - getScene().invokeTrigger(PropTriggerType.MONSTER_DIE, this.getGroupId(), this.getInstId()); + getScene().invokePropTrigger(PropTriggerType.MONSTER_DIE, this.getGroupId(), this.getInstId()); } @Override diff --git a/src/main/java/emu/lunarcore/game/scene/entity/EntitySummonUnit.java b/src/main/java/emu/lunarcore/game/scene/entity/EntitySummonUnit.java new file mode 100644 index 000000000..3a33be70b --- /dev/null +++ b/src/main/java/emu/lunarcore/game/scene/entity/EntitySummonUnit.java @@ -0,0 +1,72 @@ +package emu.lunarcore.game.scene.entity; + +import emu.lunarcore.data.excel.SummonUnitExcel; +import emu.lunarcore.game.avatar.GameAvatar; +import emu.lunarcore.game.scene.Scene; +import emu.lunarcore.proto.MotionInfoOuterClass.MotionInfo; +import emu.lunarcore.proto.SceneEntityInfoOuterClass.SceneEntityInfo; +import emu.lunarcore.proto.SceneSummonUnitInfoOuterClass.SceneSummonUnitInfo; +import emu.lunarcore.util.Position; +import lombok.Getter; +import lombok.Setter; + +@Getter +public class EntitySummonUnit implements GameEntity { + @Setter private int entityId; + private final GameAvatar caster; + private final SummonUnitExcel excel; + + private final Scene scene; + private final Position pos; + private final Position rot; + private final long createTime; + + private int attachedEntityId; + private int duration; + private long expiry; + + public EntitySummonUnit(Scene scene, GameAvatar caster, SummonUnitExcel excel, Position pos, Position rot) { + this.scene = scene; + this.caster = caster; + this.excel = excel; + this.pos = pos; + this.rot = rot; + this.createTime = System.currentTimeMillis(); + + // Attach summon unit to an entity + String attachPoint = excel.getInfo().getAttachPoint(); + if (attachPoint != null && attachPoint.equals("Origin")) { + this.attachedEntityId = caster.getEntityId(); + } + } + + public void setDuration(int seconds) { + this.duration = seconds * 1000; + this.expiry = this.createTime + duration; + } + + public boolean isExpired() { + return System.currentTimeMillis() > this.expiry; + } + + @Override + public SceneEntityInfo toSceneEntityProto() { + var summon = SceneSummonUnitInfo.newInstance() + .setLifeTimeMs(this.getDuration()) + .setCreateTimeMs(this.getCreateTime()) + .setCasterEntityId(this.getCaster().getEntityId()) + .setAttachEntityId(this.getAttachedEntityId()) + .setSummonUnitId(this.getExcel().getId()); + + for (var trigger : this.getExcel().getInfo().getCustomTriggers()) { + summon.addCustomTriggers(trigger.getTriggerName()); + } + + var proto = SceneEntityInfo.newInstance() + .setEntityId(this.getEntityId()) + .setMotion(MotionInfo.newInstance().setPos(getPos().toProto()).setRot(getRot().toProto())) + .setSummonUnit(summon); + + return proto; + } +} diff --git a/src/main/java/emu/lunarcore/server/packet/recv/HandlerRefreshTriggerByClientCsReq.java b/src/main/java/emu/lunarcore/server/packet/recv/HandlerRefreshTriggerByClientCsReq.java new file mode 100644 index 000000000..12ab4721e --- /dev/null +++ b/src/main/java/emu/lunarcore/server/packet/recv/HandlerRefreshTriggerByClientCsReq.java @@ -0,0 +1,29 @@ +package emu.lunarcore.server.packet.recv; + +import emu.lunarcore.proto.RefreshTriggerByClientCsReqOuterClass.RefreshTriggerByClientCsReq; +import emu.lunarcore.server.game.GameSession; +import emu.lunarcore.server.packet.CmdId; +import emu.lunarcore.server.packet.Opcodes; +import emu.lunarcore.server.packet.PacketHandler; +import emu.lunarcore.server.packet.send.PacketRefreshTriggerByClientScRsp; + +@Opcodes(CmdId.RefreshTriggerByClientCsReq) +public class HandlerRefreshTriggerByClientCsReq extends PacketHandler { + + @Override + public void handle(GameSession session, byte[] data) throws Exception { + var req = RefreshTriggerByClientCsReq.parseFrom(data); + + if (session.getPlayer().getScene() != null) { + session.getPlayer().getScene().handleSummonUnitTriggers( + req.getTriggerEntityId(), + req.getTriggerName(), + req.getTriggerMotion(), + req.getTriggerTargetIdList() + ); + } + + session.send(new PacketRefreshTriggerByClientScRsp(req)); + } + +} diff --git a/src/main/java/emu/lunarcore/server/packet/send/PacketRefreshTriggerByClientScNotify.java b/src/main/java/emu/lunarcore/server/packet/send/PacketRefreshTriggerByClientScNotify.java new file mode 100644 index 000000000..bc24dc72e --- /dev/null +++ b/src/main/java/emu/lunarcore/server/packet/send/PacketRefreshTriggerByClientScNotify.java @@ -0,0 +1,23 @@ +package emu.lunarcore.server.packet.send; + +import emu.lunarcore.proto.RefreshTriggerByClientScNotifyOuterClass.RefreshTriggerByClientScNotify; +import emu.lunarcore.server.packet.BasePacket; +import emu.lunarcore.server.packet.CmdId; +import us.hebi.quickbuf.RepeatedInt; + +public class PacketRefreshTriggerByClientScNotify extends BasePacket { + + public PacketRefreshTriggerByClientScNotify(int triggerEntityId, String name, RepeatedInt targetIds) { + super(CmdId.RefreshTriggerByClientScNotify); + + var data = RefreshTriggerByClientScNotify.newInstance() + .setTriggerName(name) + .setTriggerEntityId(triggerEntityId); + + for (int id : targetIds) { + data.addTriggerTargetIdList(id); + } + + this.setData(data); + } +} diff --git a/src/main/java/emu/lunarcore/server/packet/send/PacketRefreshTriggerByClientScRsp.java b/src/main/java/emu/lunarcore/server/packet/send/PacketRefreshTriggerByClientScRsp.java new file mode 100644 index 000000000..394dfbfd2 --- /dev/null +++ b/src/main/java/emu/lunarcore/server/packet/send/PacketRefreshTriggerByClientScRsp.java @@ -0,0 +1,20 @@ +package emu.lunarcore.server.packet.send; + +import emu.lunarcore.proto.RefreshTriggerByClientCsReqOuterClass.RefreshTriggerByClientCsReq; +import emu.lunarcore.proto.RefreshTriggerByClientScRspOuterClass.RefreshTriggerByClientScRsp; +import emu.lunarcore.server.packet.BasePacket; +import emu.lunarcore.server.packet.CmdId; + +public class PacketRefreshTriggerByClientScRsp extends BasePacket { + + public PacketRefreshTriggerByClientScRsp(RefreshTriggerByClientCsReq req) { + super(CmdId.RefreshTriggerByClientScRsp); + + var data = RefreshTriggerByClientScRsp.newInstance() + .setTriggerEntityId(req.getTriggerEntityId()) + .setTriggerName(req.getTriggerName()) + .setRefreshTrigger(true); + + this.setData(data); + } +} diff --git a/src/main/java/emu/lunarcore/server/packet/send/PacketSyncEntityBuffChangeListScNotify.java b/src/main/java/emu/lunarcore/server/packet/send/PacketSyncEntityBuffChangeListScNotify.java new file mode 100644 index 000000000..ec29c7d28 --- /dev/null +++ b/src/main/java/emu/lunarcore/server/packet/send/PacketSyncEntityBuffChangeListScNotify.java @@ -0,0 +1,23 @@ +package emu.lunarcore.server.packet.send; + +import emu.lunarcore.game.scene.SceneBuff; +import emu.lunarcore.proto.EntityBuffChangeInfoOuterClass.EntityBuffChangeInfo; +import emu.lunarcore.proto.SyncEntityBuffChangeListScNotifyOuterClass.SyncEntityBuffChangeListScNotify; +import emu.lunarcore.server.packet.BasePacket; +import emu.lunarcore.server.packet.CmdId; + +public class PacketSyncEntityBuffChangeListScNotify extends BasePacket { + + public PacketSyncEntityBuffChangeListScNotify(int entityId, SceneBuff buff) { + super(CmdId.SyncEntityBuffChangeListScNotify); + + var buffChange = EntityBuffChangeInfo.newInstance().setEntityId(entityId) + .setBuffChangeInfo(buff.toProto()) + .setEntityId(entityId); + + var data = SyncEntityBuffChangeListScNotify.newInstance() + .addEntityBuffInfoList(buffChange); + + this.setData(data); + } +} diff --git a/src/main/java/emu/lunarcore/util/Position.java b/src/main/java/emu/lunarcore/util/Position.java index dc31cc215..135b44f3c 100644 --- a/src/main/java/emu/lunarcore/util/Position.java +++ b/src/main/java/emu/lunarcore/util/Position.java @@ -24,6 +24,12 @@ public Position(Position position) { this.y = position.getY(); this.z = position.getZ(); } + + public Position(Vector vector) { + this.x = vector.getX(); + this.y = vector.getY(); + this.z = vector.getZ(); + } public int getX() { return x;