diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0fe1fc0..10d6e08 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,11 +10,11 @@ on: workflow_dispatch: inputs: force-release: - description: "Force disable release if you enter 0, force release if you enter 1, default release if not released else skip release" + description: "Force disable release if you enter 2, force release if you enter 1, default release if not released else skip release" required: false default: "" force-push: - description: "Force disable push to repo if you enter 0, push to repo if you enter 1, default push if not released else skip push repo" + description: "Force disable push to repo if you enter 2, push to repo if you enter 1, default push if not released else skip push repo" required: false default: "" comments: @@ -85,7 +85,7 @@ jobs: echo "release_exists=${release_exists}" >> $GITHUB_ENV - name: Publish To Repo - if: (( github.event_name != 'pull_request' && env.flag_release == 'true' && env.release_exists != 'true' && inputs.force-push != '0' ) || inputs.force-push == '1') && false # do not push to any repo + if: (( github.event_name != 'pull_request' && env.flag_release == 'true' && env.release_exists != 'true' && !(inputs.force-push == '2')) || inputs.force-push == '1') && false # do not push to any repo continue-on-error: true run: ./gradlew --refresh-dependencies generateDevelopmentBundle publish -PpublishDevBundle=true env: @@ -93,7 +93,7 @@ jobs: PRIVATE_MAVEN_REPO_USERNAME: ${{ secrets.PRIVATE_MAVEN_REPO_USERNAME }} - name: Create Release - Pre Process - if: ( github.event_name != 'pull_request' && env.flag_release == 'true' && env.release_exists != 'true' && inputs.force-release != '0' ) || inputs.force-release == '1' + if: ( github.event_name != 'pull_request' && env.flag_release == 'true' && env.release_exists != 'true' && !(inputs.force-release == '2')) || inputs.force-release == '1' run: | if [ ${{ inputs.comments }} == "" ]; then echo "No comments provided" diff --git a/lophine-server/src/main/java/org/leavesmc/leaves/protocol/servux/ServuxEntityDataProtocol.java b/lophine-server/src/main/java/org/leavesmc/leaves/protocol/servux/ServuxEntityDataProtocol.java index cd6c83f..629a282 100644 --- a/lophine-server/src/main/java/org/leavesmc/leaves/protocol/servux/ServuxEntityDataProtocol.java +++ b/lophine-server/src/main/java/org/leavesmc/leaves/protocol/servux/ServuxEntityDataProtocol.java @@ -41,6 +41,7 @@ import org.slf4j.Logger; import java.util.HashMap; import java.util.Map; import java.util.UUID; +import java.util.concurrent.ConcurrentHashMap; // Powered by Servux(https://github.com/sakura-ryoko/servux) @@ -50,7 +51,7 @@ public class ServuxEntityDataProtocol implements LeavesProtocol { public static final int PROTOCOL_VERSION = 1; - private static final Map readingSessionKeys = new HashMap<>(); + private static final Map readingSessionKeys = new ConcurrentHashMap<>(); @ProtocolHandler.PlayerJoin public static void onPlayerJoin(ServerPlayer player) { diff --git a/lophine-server/src/main/java/org/leavesmc/leaves/protocol/servux/ServuxHudDataProtocol.java b/lophine-server/src/main/java/org/leavesmc/leaves/protocol/servux/ServuxHudDataProtocol.java index c5eca86..e5bbfbd 100644 --- a/lophine-server/src/main/java/org/leavesmc/leaves/protocol/servux/ServuxHudDataProtocol.java +++ b/lophine-server/src/main/java/org/leavesmc/leaves/protocol/servux/ServuxHudDataProtocol.java @@ -46,17 +46,18 @@ import org.leavesmc.leaves.protocol.servux.logger.DataLogger; import javax.annotation.Nonnull; import java.util.*; +import java.util.concurrent.ConcurrentHashMap; @LeavesProtocol.Register(namespace = "servux") public class ServuxHudDataProtocol implements LeavesProtocol { public static final int PROTOCOL_VERSION = 2; - private static final List players = new ArrayList<>(); + private static final List players = Collections.synchronizedList(new ArrayList<>()); private static final int updateInterval = 80; - private static final HashMap> loggerPlayers = new HashMap<>(); - private static final HashMap> LOGGERS = new HashMap<>(); + private static final ConcurrentHashMap> loggerPlayers = new ConcurrentHashMap<>(); + private static final ConcurrentHashMap> LOGGERS = new ConcurrentHashMap<>(); private static final Table DATA = HashBasedTable.create(); public static boolean refreshSpawnMetadata = false; diff --git a/lophine-server/src/main/java/org/leavesmc/leaves/protocol/servux/ServuxStructuresProtocol.java b/lophine-server/src/main/java/org/leavesmc/leaves/protocol/servux/ServuxStructuresProtocol.java index 4b9a913..deaf96a 100644 --- a/lophine-server/src/main/java/org/leavesmc/leaves/protocol/servux/ServuxStructuresProtocol.java +++ b/lophine-server/src/main/java/org/leavesmc/leaves/protocol/servux/ServuxStructuresProtocol.java @@ -58,7 +58,7 @@ public class ServuxStructuresProtocol implements LeavesProtocol { public static final int PROTOCOL_VERSION = 2; private static final int updateInterval = 40; private static final Map players = new ConcurrentHashMap<>(); - private static final Map> timeouts = new HashMap<>(); + private static final Map> timeouts = new ConcurrentHashMap<>(); private static int retainDistance; @ProtocolHandler.PlayerJoin diff --git a/lophine-server/src/main/java/org/leavesmc/leaves/protocol/servux/litematics/ServuxLitematicsProtocol.java b/lophine-server/src/main/java/org/leavesmc/leaves/protocol/servux/litematics/ServuxLitematicsProtocol.java index a1175ef..0db50aa 100644 --- a/lophine-server/src/main/java/org/leavesmc/leaves/protocol/servux/litematics/ServuxLitematicsProtocol.java +++ b/lophine-server/src/main/java/org/leavesmc/leaves/protocol/servux/litematics/ServuxLitematicsProtocol.java @@ -54,6 +54,7 @@ import org.leavesmc.leaves.protocol.servux.litematics.utils.ReplaceBehavior; import org.leavesmc.leaves.util.TagUtil; import java.util.*; +import java.util.concurrent.ConcurrentHashMap; @LeavesProtocol.Register(namespace = "servux") public class ServuxLitematicsProtocol implements LeavesProtocol { @@ -61,7 +62,7 @@ public class ServuxLitematicsProtocol implements LeavesProtocol { public static final int PROTOCOL_VERSION = 1; private static final CompoundTag metadata = new CompoundTag(); - private static final Map playerSession = new HashMap<>(); + private static final Map playerSession = new ConcurrentHashMap<>(); @ProtocolHandler.Init public static void init() {