Format code [skip actions]

This commit is contained in:
github-actions 2023-09-15 00:45:41 +00:00
parent 84e1371499
commit 2643c6b3b7
2 changed files with 12 additions and 10 deletions

View File

@ -304,7 +304,7 @@ public class EntityGadget extends EntityBaseGadget {
} }
configRoute.setStartIndex(I); configRoute.setStartIndex(I);
this.position.set(points[I].getPos()); this.position.set(points[I].getPos());
if(I == points.length - 1) { if (I == points.length - 1) {
configRoute.setStarted(false); configRoute.setStarted(false);
} }
}, },

View File

@ -17,9 +17,10 @@ public class HandlerClientScriptEventNotify extends PacketHandler {
public void handle(GameSession session, byte[] header, byte[] payload) throws Exception { public void handle(GameSession session, byte[] header, byte[] payload) throws Exception {
val data = ClientScriptEventNotify.parseFrom(payload); val data = ClientScriptEventNotify.parseFrom(payload);
val scriptManager = session.getPlayer().getScene().getScriptManager(); val scriptManager = session.getPlayer().getScene().getScriptManager();
val args = new ScriptArgs(0, data.getEventType()) val args =
.setSourceEntityId(data.getSourceEntityId()) new ScriptArgs(0, data.getEventType())
.setTargetEntityId(data.getTargetEntityId()); .setSourceEntityId(data.getSourceEntityId())
.setTargetEntityId(data.getTargetEntityId());
for (int i = 0; i < data.getParamListCount(); i++) { for (int i = 0; i < data.getParamListCount(); i++) {
switch (i) { switch (i) {
@ -29,11 +30,13 @@ public class HandlerClientScriptEventNotify extends PacketHandler {
} }
} }
if(data.getEventType() == EventType.EVENT_AVATAR_NEAR_PLATFORM){ if (data.getEventType() == EventType.EVENT_AVATAR_NEAR_PLATFORM) {
if(data.getParamList(0) == 0) { if (data.getParamList(0) == 0) {
Grasscutter.getLogger().debug("Found a zero Param1 for an EVENT_AVATAR_NEAR_PLATFORM. Doing the configID workaround."); Grasscutter.getLogger()
.debug(
"Found a zero Param1 for an EVENT_AVATAR_NEAR_PLATFORM. Doing the configID workaround.");
val entity = session.getPlayer().getScene().getEntityById(data.getSourceEntityId()); val entity = session.getPlayer().getScene().getEntityById(data.getSourceEntityId());
if(entity == null) { if (entity == null) {
Grasscutter.getLogger().debug("But it failed."); Grasscutter.getLogger().debug("But it failed.");
} else { } else {
args.setParam1(entity.getConfigId()); args.setParam1(entity.getConfigId());
@ -43,5 +46,4 @@ public class HandlerClientScriptEventNotify extends PacketHandler {
scriptManager.callEvent(args); scriptManager.callEvent(args);
} }
} }