Fix AS cannot get in normally and 2nd half of MOC doesnt load enemy

This commit is contained in:
Hotaru
2024-09-16 03:01:23 +07:00
committed by Melledy
parent 5694ed9a80
commit d979b2d054
2 changed files with 183 additions and 301 deletions

View File

@@ -1,4 +1,3 @@
// Code generated by protocol buffer compiler. Do not edit!
package emu.lunarcore.proto;
import java.io.IOException;
@@ -12,374 +11,257 @@ import us.hebi.quickbuf.ProtoSink;
import us.hebi.quickbuf.ProtoSource;
public final class ChallengeStoryInfoOuterClass {
/**
* Protobuf type {@code ChallengeStoryInfo}
*/
public static final class ChallengeStoryInfo extends ProtoMessage<ChallengeStoryInfo> implements Cloneable {
private static final long serialVersionUID = 0L;
/**
* <code>optional .ChallengeStoryBuffInfo cur_story_buffs = 1;</code>
*/
private final ChallengeStoryBuffInfoOuterClass.ChallengeStoryBuffInfo curStoryBuffs = ChallengeStoryBuffInfoOuterClass.ChallengeStoryBuffInfo.newInstance();
/**
* <code>optional .ChallengeBossBuffInfo cur_boss_buffs = 9;</code>
*/
private final ChallengeBossBuffInfoOuterClass.ChallengeBossBuffInfo curBossBuffs = ChallengeBossBuffInfoOuterClass.ChallengeBossBuffInfo.newInstance();
private ChallengeStoryInfo() {
}
/**
* @return a new empty instance of {@code ChallengeStoryInfo}
*/
private final ChallengeStoryBuffInfoOuterClass.ChallengeStoryBuffInfo curStoryBuffs = ChallengeStoryBuffInfoOuterClass.ChallengeStoryBuffInfo.newInstance();
public static ChallengeStoryInfo newInstance() {
return new ChallengeStoryInfo();
}
/**
* <code>optional .ChallengeStoryBuffInfo cur_story_buffs = 1;</code>
* @return whether the curStoryBuffs field is set
*/
public boolean hasCurStoryBuffs() {
return (bitField0_ & 0x00000001) != 0;
}
/**
* <code>optional .ChallengeStoryBuffInfo cur_story_buffs = 1;</code>
* @return this
*/
public ChallengeStoryInfo clearCurStoryBuffs() {
bitField0_ &= ~0x00000001;
curStoryBuffs.clear();
return this;
}
/**
* <code>optional .ChallengeStoryBuffInfo cur_story_buffs = 1;</code>
*
* This method returns the internal storage object without modifying any has state.
* The returned object should not be modified and be treated as read-only.
*
* Use {@link #getMutableCurStoryBuffs()} if you want to modify it.
*
* @return internal storage object for reading
*/
public ChallengeStoryBuffInfoOuterClass.ChallengeStoryBuffInfo getCurStoryBuffs() {
return curStoryBuffs;
}
/**
* <code>optional .ChallengeStoryBuffInfo cur_story_buffs = 1;</code>
*
* This method returns the internal storage object and sets the corresponding
* has state. The returned object will become part of this message and its
* contents may be modified as long as the has state is not cleared.
*
* @return internal storage object for modifications
*/
public ChallengeStoryBuffInfoOuterClass.ChallengeStoryBuffInfo getMutableCurStoryBuffs() {
bitField0_ |= 0x00000001;
return curStoryBuffs;
}
/**
* <code>optional .ChallengeStoryBuffInfo cur_story_buffs = 1;</code>
* @param value the curStoryBuffs to set
* @return this
*/
public ChallengeStoryInfo setCurStoryBuffs(
final ChallengeStoryBuffInfoOuterClass.ChallengeStoryBuffInfo value) {
bitField0_ |= 0x00000001;
curStoryBuffs.copyFrom(value);
return this;
}
/**
* <code>optional .ChallengeBossBuffInfo cur_boss_buffs = 9;</code>
* @return whether the curBossBuffs field is set
*/
public boolean hasCurBossBuffs() {
return (bitField0_ & 0x00000002) != 0;
return ((this.bitField0_ & 0x1) != 0);
}
/**
* <code>optional .ChallengeBossBuffInfo cur_boss_buffs = 9;</code>
* @return this
*/
public ChallengeStoryInfo clearCurBossBuffs() {
bitField0_ &= ~0x00000002;
curBossBuffs.clear();
this.bitField0_ &= 0xFFFFFFFE;
this.curBossBuffs.clear();
return this;
}
/**
* <code>optional .ChallengeBossBuffInfo cur_boss_buffs = 9;</code>
*
* This method returns the internal storage object without modifying any has state.
* The returned object should not be modified and be treated as read-only.
*
* Use {@link #getMutableCurBossBuffs()} if you want to modify it.
*
* @return internal storage object for reading
*/
public ChallengeBossBuffInfoOuterClass.ChallengeBossBuffInfo getCurBossBuffs() {
return curBossBuffs;
return this.curBossBuffs;
}
/**
* <code>optional .ChallengeBossBuffInfo cur_boss_buffs = 9;</code>
*
* This method returns the internal storage object and sets the corresponding
* has state. The returned object will become part of this message and its
* contents may be modified as long as the has state is not cleared.
*
* @return internal storage object for modifications
*/
public ChallengeBossBuffInfoOuterClass.ChallengeBossBuffInfo getMutableCurBossBuffs() {
bitField0_ |= 0x00000002;
return curBossBuffs;
this.bitField0_ |= 0x1;
return this.curBossBuffs;
}
/**
* <code>optional .ChallengeBossBuffInfo cur_boss_buffs = 9;</code>
* @param value the curBossBuffs to set
* @return this
*/
public ChallengeStoryInfo setCurBossBuffs(
final ChallengeBossBuffInfoOuterClass.ChallengeBossBuffInfo value) {
bitField0_ |= 0x00000002;
curBossBuffs.copyFrom(value);
public ChallengeStoryInfo setCurBossBuffs(ChallengeBossBuffInfoOuterClass.ChallengeBossBuffInfo value) {
this.bitField0_ |= 0x1;
this.curBossBuffs.copyFrom(value);
return this;
}
@Override
public ChallengeStoryInfo copyFrom(final ChallengeStoryInfo other) {
cachedSize = other.cachedSize;
if ((bitField0_ | other.bitField0_) != 0) {
bitField0_ = other.bitField0_;
curStoryBuffs.copyFrom(other.curStoryBuffs);
curBossBuffs.copyFrom(other.curBossBuffs);
}
public boolean hasCurStoryBuffs() {
return ((this.bitField0_ & 0x2) != 0);
}
public ChallengeStoryInfo clearCurStoryBuffs() {
this.bitField0_ &= 0xFFFFFFFD;
this.curStoryBuffs.clear();
return this;
}
@Override
public ChallengeStoryInfo mergeFrom(final ChallengeStoryInfo other) {
if (other.isEmpty()) {
return this;
}
cachedSize = -1;
if (other.hasCurStoryBuffs()) {
getMutableCurStoryBuffs().mergeFrom(other.curStoryBuffs);
}
if (other.hasCurBossBuffs()) {
getMutableCurBossBuffs().mergeFrom(other.curBossBuffs);
}
public ChallengeStoryBuffInfoOuterClass.ChallengeStoryBuffInfo getCurStoryBuffs() {
return this.curStoryBuffs;
}
public ChallengeStoryBuffInfoOuterClass.ChallengeStoryBuffInfo getMutableCurStoryBuffs() {
this.bitField0_ |= 0x2;
return this.curStoryBuffs;
}
public ChallengeStoryInfo setCurStoryBuffs(ChallengeStoryBuffInfoOuterClass.ChallengeStoryBuffInfo value) {
this.bitField0_ |= 0x2;
this.curStoryBuffs.copyFrom(value);
return this;
}
@Override
public ChallengeStoryInfo copyFrom(ChallengeStoryInfo other) {
this.cachedSize = other.cachedSize;
if ((this.bitField0_ | other.bitField0_) != 0) {
this.bitField0_ = other.bitField0_;
this.curBossBuffs.copyFrom(other.curBossBuffs);
this.curStoryBuffs.copyFrom(other.curStoryBuffs);
}
return this;
}
public ChallengeStoryInfo mergeFrom(ChallengeStoryInfo other) {
if (other.isEmpty())
return this;
this.cachedSize = -1;
if (other.hasCurBossBuffs())
getMutableCurBossBuffs().mergeFrom(other.curBossBuffs);
if (other.hasCurStoryBuffs())
getMutableCurStoryBuffs().mergeFrom(other.curStoryBuffs);
return this;
}
public ChallengeStoryInfo clear() {
if (isEmpty()) {
return this;
}
cachedSize = -1;
bitField0_ = 0;
curStoryBuffs.clear();
curBossBuffs.clear();
if (isEmpty())
return this;
this.cachedSize = -1;
this.bitField0_ = 0;
this.curBossBuffs.clear();
this.curStoryBuffs.clear();
return this;
}
@Override
public ChallengeStoryInfo clearQuick() {
if (isEmpty()) {
return this;
}
cachedSize = -1;
bitField0_ = 0;
curStoryBuffs.clearQuick();
curBossBuffs.clearQuick();
if (isEmpty())
return this;
this.cachedSize = -1;
this.bitField0_ = 0;
this.curBossBuffs.clearQuick();
this.curStoryBuffs.clearQuick();
return this;
}
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (!(o instanceof ChallengeStoryInfo)) {
return false;
}
ChallengeStoryInfo other = (ChallengeStoryInfo) o;
return bitField0_ == other.bitField0_
&& (!hasCurStoryBuffs() || curStoryBuffs.equals(other.curStoryBuffs))
&& (!hasCurBossBuffs() || curBossBuffs.equals(other.curBossBuffs));
if (o == this)
return true;
if (!(o instanceof ChallengeStoryInfo))
return false;
ChallengeStoryInfo other = (ChallengeStoryInfo)o;
return (this.bitField0_ == other.bitField0_ && (
!hasCurBossBuffs() || this.curBossBuffs.equals(other.curBossBuffs)) && (
!hasCurStoryBuffs() || this.curStoryBuffs.equals(other.curStoryBuffs)));
}
@Override
public void writeTo(final ProtoSink output) throws IOException {
if ((bitField0_ & 0x00000001) != 0) {
output.writeRawByte((byte) 10);
output.writeMessageNoTag(curStoryBuffs);
}
if ((bitField0_ & 0x00000002) != 0) {
output.writeRawByte((byte) 74);
output.writeMessageNoTag(curBossBuffs);
}
public void writeTo(ProtoSink output) throws IOException {
if ((this.bitField0_ & 0x1) != 0) {
output.writeRawByte((byte)66);
output.writeMessageNoTag(this.curBossBuffs);
}
if ((this.bitField0_ & 0x2) != 0) {
output.writeRawByte((byte)74);
output.writeMessageNoTag(this.curStoryBuffs);
}
}
@Override
protected int computeSerializedSize() {
int size = 0;
if ((bitField0_ & 0x00000001) != 0) {
size += 1 + ProtoSink.computeMessageSizeNoTag(curStoryBuffs);
}
if ((bitField0_ & 0x00000002) != 0) {
size += 1 + ProtoSink.computeMessageSizeNoTag(curBossBuffs);
}
if ((this.bitField0_ & 0x1) != 0)
size += 1 + ProtoSink.computeMessageSizeNoTag(this.curBossBuffs);
if ((this.bitField0_ & 0x2) != 0)
size += 1 + ProtoSink.computeMessageSizeNoTag(this.curStoryBuffs);
return size;
}
@Override
@SuppressWarnings("fallthrough")
public ChallengeStoryInfo mergeFrom(final ProtoSource input) throws IOException {
// Enabled Fall-Through Optimization (QuickBuffers)
public ChallengeStoryInfo mergeFrom(ProtoSource input) throws IOException {
int tag = input.readTag();
while (true) {
switch (tag) {
case 10: {
// curStoryBuffs
input.readMessage(curStoryBuffs);
bitField0_ |= 0x00000001;
case 66:
input.readMessage(this.curBossBuffs);
this.bitField0_ |= 0x1;
tag = input.readTag();
if (tag != 74) {
break;
}
}
case 74: {
// curBossBuffs
input.readMessage(curBossBuffs);
bitField0_ |= 0x00000002;
if (tag != 74)
continue;
case 74:
input.readMessage(this.curStoryBuffs);
this.bitField0_ |= 0x2;
tag = input.readTag();
if (tag != 0) {
break;
}
}
case 0: {
if (tag != 0)
continue;
case 0:
return this;
}
default: {
if (!input.skipField(tag)) {
return this;
}
tag = input.readTag();
break;
}
}
}
}
if (!input.skipField(tag))
return this;
tag = input.readTag();
}
}
@Override
public void writeTo(final JsonSink output) throws IOException {
public void writeTo(JsonSink output) throws IOException {
output.beginObject();
if ((bitField0_ & 0x00000001) != 0) {
output.writeMessage(FieldNames.curStoryBuffs, curStoryBuffs);
}
if ((bitField0_ & 0x00000002) != 0) {
output.writeMessage(FieldNames.curBossBuffs, curBossBuffs);
}
if ((this.bitField0_ & 0x1) != 0)
output.writeMessage(FieldNames.curBossBuffs, this.curBossBuffs);
if ((this.bitField0_ & 0x2) != 0)
output.writeMessage(FieldNames.curStoryBuffs, this.curStoryBuffs);
output.endObject();
}
@Override
public ChallengeStoryInfo mergeFrom(final JsonSource input) throws IOException {
if (!input.beginObject()) {
return this;
}
public ChallengeStoryInfo mergeFrom(JsonSource input) throws IOException {
if (!input.beginObject())
return this;
while (!input.isAtEnd()) {
switch (input.readFieldHash()) {
case -587091733:
case -738440393: {
if (input.isAtField(FieldNames.curStoryBuffs)) {
if (!input.trySkipNullValue()) {
input.readMessage(curStoryBuffs);
bitField0_ |= 0x00000001;
}
} else {
input.skipUnknownField();
}
break;
}
case -1632186189:
case -340377971: {
case -340377971:
if (input.isAtField(FieldNames.curBossBuffs)) {
if (!input.trySkipNullValue()) {
input.readMessage(curBossBuffs);
bitField0_ |= 0x00000002;
}
} else {
input.skipUnknownField();
}
break;
}
default: {
input.readMessage(this.curBossBuffs);
this.bitField0_ |= 0x1;
}
continue;
}
input.skipUnknownField();
break;
}
}
}
continue;
case -738440393:
case -587091733:
if (input.isAtField(FieldNames.curStoryBuffs)) {
if (!input.trySkipNullValue()) {
input.readMessage(this.curStoryBuffs);
this.bitField0_ |= 0x2;
}
continue;
}
input.skipUnknownField();
continue;
}
input.skipUnknownField();
}
input.endObject();
return this;
}
@Override
public ChallengeStoryInfo clone() {
return new ChallengeStoryInfo().copyFrom(this);
return (new ChallengeStoryInfo()).copyFrom(this);
}
@Override
public boolean isEmpty() {
return ((bitField0_) == 0);
return (this.bitField0_ == 0);
}
public static ChallengeStoryInfo parseFrom(final byte[] data) throws
InvalidProtocolBufferException {
return ProtoMessage.mergeFrom(new ChallengeStoryInfo(), data).checkInitialized();
public static ChallengeStoryInfo parseFrom(byte[] data) throws InvalidProtocolBufferException {
return (ChallengeStoryInfo)((ChallengeStoryInfo)ProtoMessage.mergeFrom(new ChallengeStoryInfo(), data)).checkInitialized();
}
public static ChallengeStoryInfo parseFrom(final ProtoSource input) throws IOException {
return ProtoMessage.mergeFrom(new ChallengeStoryInfo(), input).checkInitialized();
public static ChallengeStoryInfo parseFrom(ProtoSource input) throws IOException {
return (ChallengeStoryInfo)((ChallengeStoryInfo)ProtoMessage.mergeFrom(new ChallengeStoryInfo(), input)).checkInitialized();
}
public static ChallengeStoryInfo parseFrom(final JsonSource input) throws IOException {
return ProtoMessage.mergeFrom(new ChallengeStoryInfo(), input).checkInitialized();
public static ChallengeStoryInfo parseFrom(JsonSource input) throws IOException {
return (ChallengeStoryInfo)((ChallengeStoryInfo)ProtoMessage.mergeFrom(new ChallengeStoryInfo(), input)).checkInitialized();
}
/**
* @return factory for creating ChallengeStoryInfo messages
*/
public static MessageFactory<ChallengeStoryInfo> getFactory() {
return ChallengeStoryInfoFactory.INSTANCE;
}
private enum ChallengeStoryInfoFactory implements MessageFactory<ChallengeStoryInfo> {
INSTANCE;
@Override
public ChallengeStoryInfo create() {
return ChallengeStoryInfo.newInstance();
public ChallengeStoryInfoOuterClass.ChallengeStoryInfo create() {
return ChallengeStoryInfoOuterClass.ChallengeStoryInfo.newInstance();
}
}
/**
* Contains name constants used for serializing JSON
*/
static class FieldNames {
static final FieldName curStoryBuffs = FieldName.forField("curStoryBuffs", "cur_story_buffs");
static final FieldName curBossBuffs = FieldName.forField("curBossBuffs", "cur_boss_buffs");
static final FieldName curStoryBuffs = FieldName.forField("curStoryBuffs", "cur_story_buffs");
}
}
private enum ChallengeStoryInfoFactory implements MessageFactory<ChallengeStoryInfo> {
INSTANCE;
public ChallengeStoryInfoOuterClass.ChallengeStoryInfo create() {
return ChallengeStoryInfoOuterClass.ChallengeStoryInfo.newInstance();
}
}
static class FieldNames {
static final FieldName curBossBuffs = FieldName.forField("curBossBuffs", "cur_boss_buffs");
static final FieldName curStoryBuffs = FieldName.forField("curStoryBuffs", "cur_story_buffs");
}
}

View File

@@ -16,13 +16,13 @@ public class PacketSceneGroupRefreshScNotify extends BasePacket {
super(CmdId.SceneGroupRefreshScNotify);
var group = SceneGroupRefreshInfo.newInstance();
group.setGroupRefreshType(SceneGroupRefreshType.SCENE_GROUP_REFRESH_TYPE_LOADED);
if (toAdd != null) {
group.setGroupId(toAdd.getGroupId());
group.addRefreshEntity(SceneEntityRefreshInfo.newInstance().setAddEntity(toAdd.toSceneEntityProto()));
} else if (toRemove != null) {
group.setGroupId(toRemove.getGroupId());
group.setGroupRefreshType(SceneGroupRefreshType.SCENE_GROUP_REFRESH_TYPE_UNLOAD);
group.addRefreshEntity(SceneEntityRefreshInfo.newInstance().setDelEntity(toRemove.getEntityId()));
}