From 2643c6b3b7e0c70f91c8fd5724bba1f4b6d6e96a Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 15 Sep 2023 00:45:41 +0000 Subject: [PATCH] Format code [skip actions] --- .../grasscutter/game/entity/EntityGadget.java | 2 +- .../recv/HandlerClientScriptEventNotify.java | 20 ++++++++++--------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/main/java/emu/grasscutter/game/entity/EntityGadget.java b/src/main/java/emu/grasscutter/game/entity/EntityGadget.java index 8ed702081..7e9017df8 100644 --- a/src/main/java/emu/grasscutter/game/entity/EntityGadget.java +++ b/src/main/java/emu/grasscutter/game/entity/EntityGadget.java @@ -304,7 +304,7 @@ public class EntityGadget extends EntityBaseGadget { } configRoute.setStartIndex(I); this.position.set(points[I].getPos()); - if(I == points.length - 1) { + if (I == points.length - 1) { configRoute.setStarted(false); } }, diff --git a/src/main/java/emu/grasscutter/server/packet/recv/HandlerClientScriptEventNotify.java b/src/main/java/emu/grasscutter/server/packet/recv/HandlerClientScriptEventNotify.java index 92fbb1b99..3ba1e4a70 100644 --- a/src/main/java/emu/grasscutter/server/packet/recv/HandlerClientScriptEventNotify.java +++ b/src/main/java/emu/grasscutter/server/packet/recv/HandlerClientScriptEventNotify.java @@ -17,9 +17,10 @@ public class HandlerClientScriptEventNotify extends PacketHandler { public void handle(GameSession session, byte[] header, byte[] payload) throws Exception { val data = ClientScriptEventNotify.parseFrom(payload); val scriptManager = session.getPlayer().getScene().getScriptManager(); - val args = new ScriptArgs(0, data.getEventType()) - .setSourceEntityId(data.getSourceEntityId()) - .setTargetEntityId(data.getTargetEntityId()); + val args = + new ScriptArgs(0, data.getEventType()) + .setSourceEntityId(data.getSourceEntityId()) + .setTargetEntityId(data.getTargetEntityId()); for (int i = 0; i < data.getParamListCount(); i++) { switch (i) { @@ -29,11 +30,13 @@ public class HandlerClientScriptEventNotify extends PacketHandler { } } - if(data.getEventType() == EventType.EVENT_AVATAR_NEAR_PLATFORM){ - if(data.getParamList(0) == 0) { - Grasscutter.getLogger().debug("Found a zero Param1 for an EVENT_AVATAR_NEAR_PLATFORM. Doing the configID workaround."); + if (data.getEventType() == EventType.EVENT_AVATAR_NEAR_PLATFORM) { + if (data.getParamList(0) == 0) { + 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()); - if(entity == null) { + if (entity == null) { Grasscutter.getLogger().debug("But it failed."); } else { args.setParam1(entity.getConfigId()); @@ -43,5 +46,4 @@ public class HandlerClientScriptEventNotify extends PacketHandler { scriptManager.callEvent(args); } - -} \ No newline at end of file +}