diff --git a/.github/workflows/codacy-analysis.yml b/.github/workflows/codacy-analysis.yml index e5aa4641..d4f05a9e 100644 --- a/.github/workflows/codacy-analysis.yml +++ b/.github/workflows/codacy-analysis.yml @@ -21,11 +21,11 @@ jobs: steps: # Checkout the repository to the GitHub Actions runner - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v3 # Execute Codacy Analysis CLI and generate a SARIF output with the security issues identified during the analysis - name: Run Codacy Analysis CLI - uses: codacy/codacy-analysis-cli-action@4.0.0 + uses: codacy/codacy-analysis-cli-action@4.0.2 with: # Check https://github.com/codacy/codacy-analysis-cli#project-token to get your project token from your Codacy repository # You can also omit the token and run the tools that support default configurations @@ -41,6 +41,6 @@ jobs: # Upload the SARIF file generated in the previous step - name: Upload SARIF results file - uses: github/codeql-action/upload-sarif@v1 + uses: github/codeql-action/upload-sarif@v2 with: sarif_file: results.sarif diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index eaf30927..972ab7f7 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -35,10 +35,10 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Setup Java JDK - uses: actions/setup-java@v2.3.0 + uses: actions/setup-java@v3.3.0 with: # The Java version to make available on the path. Takes a whole or semver Java version, or 1.x syntax (e.g. 1.8 => Java 8.x). Early access versions can be specified in the form of e.g. 14-ea, 14.0.0-ea, or 14.0.0-ea.28 java-version: 17 @@ -46,7 +46,7 @@ jobs: # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@v1 + uses: github/codeql-action/init@v2 with: languages: ${{ matrix.language }} # If you wish to specify custom queries, you can do so here or in a config file. @@ -57,7 +57,7 @@ jobs: # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # If this step fails, then you should remove it and run the build manually (see below) - name: Autobuild - uses: github/codeql-action/autobuild@v1 + uses: github/codeql-action/autobuild@v2 # ℹī¸ Command-line programs to run using the OS shell. # 📚 https://git.io/JvXDl @@ -71,4 +71,4 @@ jobs: # make release - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v1 + uses: github/codeql-action/analyze@v2 diff --git a/.github/workflows/downstream.yml b/.github/workflows/downstream.yml index b5e72dcc..ea613917 100644 --- a/.github/workflows/downstream.yml +++ b/.github/workflows/downstream.yml @@ -18,7 +18,7 @@ jobs: steps: # Step 1: run a standard checkout action, provided by github - name: Checkout main - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: ref: main # submodules: 'recursive' ### may be needed in your situation @@ -26,7 +26,7 @@ jobs: # Step 2: run this sync action - specify the upstream repo, upstream branch to sync with, and target sync branch - name: Pull (Fast-Forward) upstream changes id: sync - uses: aormsby/Fork-Sync-With-Upstream-action@v2.1 + uses: aormsby/Fork-Sync-With-Upstream-action@v3.3 with: upstream_repository: AtlasMediaGroup/TotalFreedomMod upstream_branch: main diff --git a/.github/workflows/java17-maven.yml b/.github/workflows/java17-maven.yml index 43d090ab..6f55c804 100644 --- a/.github/workflows/java17-maven.yml +++ b/.github/workflows/java17-maven.yml @@ -9,11 +9,11 @@ jobs: steps: # Checkout the code - - uses: actions/checkout@v1 + - uses: actions/checkout@v3 # Java 16 Builds - name: Set up JDK 17 - uses: actions/setup-java@v2.3.0 + uses: actions/setup-java@v3.3.0 with: java-version: 17 distribution: 'adopt' diff --git a/SECURITY.md b/SECURITY.md index a18bd56e..65277440 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -9,16 +9,16 @@ In terms of plugin releases, our support matrix is as follows: ### Actively Supported These versions are currently actively supported by our team, and you should expect security patches where appropriate for these versions. -| Version | Supported | Support End: | -| ------------------- | ------------------ | ------------------------------ | -| 2021.09 | :white_check_mark: | No Earlier than December 2021 | +| Version | Supported | Support End: | +| ------------------- | ---------- | ------------------------------ | +| 2022.02 | ✅ | No Earlier than May 2022 | ### Legacy Supported These versions are no longer under active development, however we will look to release critical secuirty patches where appropriate. -| Version | Supported | Support End: | -| ------------------- | ------------------ | ------------ | -| 2021.06 | :white_check_mark: | October 2021 | +| Version | Supported | Support End: | +| ------------------- | ---------- | ------------ | +| 2021.09 | ⚠ī¸ | April 2022 | ### No Longer Supported @@ -26,8 +26,9 @@ These versions are no longer supported at all. It is strongly advised to update | Version | Supported | Support Ended: | | ------------------- | ------------------ | ------------------- | -| 2021.05 | :white_check_mark: | September 2021 | -| 2021.04 | :white_check_mark: | July 2021 | +| 2021.06 | :x: | October 2021 | +| 2021.05 | :x: | September 2021 | +| 2021.04 | :x: | July 2021 | | 2021.02 | :x: | 6 June 2021 | | 2020.11 | :x: | 3 May 2021 | | 6.0.x (Pre-Release) | :x: | December 2020 | diff --git a/nb-configuration.xml b/nb-configuration.xml index 65f12570..08e4e03c 100644 --- a/nb-configuration.xml +++ b/nb-configuration.xml @@ -13,7 +13,7 @@ You can copy and paste the single properties, into the pom.xml file and the IDE That way multiple projects can share the same settings (useful for formatting rules for example). Any value defined here will override the pom.xml file value but is only applicable to the current project. --> - JDK_11 + JDK_17 true diff --git a/pom.xml b/pom.xml index 117fdaaf..7134f378 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ me.totalfreedom TotalFreedomMod - 2022.02-RC01 + 2022.02 jar @@ -151,7 +151,7 @@ com.sk89q.worldedit worldedit-bukkit - 7.2.8 + 7.2.10 provided @@ -267,7 +267,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.8.1 + 3.10.1 TotalFreedomMod.jar 17 @@ -396,7 +396,7 @@ org.apache.maven.plugins maven-shade-plugin - 3.3.1-SNAPSHOT + 3.3.0 package diff --git a/src/main/java/me/totalfreedom/totalfreedommod/blocking/InteractBlocker.java b/src/main/java/me/totalfreedom/totalfreedommod/blocking/InteractBlocker.java index 2e53f9de..17f6c5fe 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/blocking/InteractBlocker.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/blocking/InteractBlocker.java @@ -5,6 +5,8 @@ import me.totalfreedom.totalfreedommod.config.ConfigEntry; import me.totalfreedom.totalfreedommod.util.Groups; import org.bukkit.ChatColor; import org.bukkit.Material; +import org.bukkit.block.Block; +import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; @@ -79,9 +81,33 @@ public class InteractBlocker extends FreedomService if (Groups.SPAWN_EGGS.contains(event.getMaterial())) { - player.getInventory().clear(player.getInventory().getHeldItemSlot()); - player.sendMessage(ChatColor.GRAY + "Spawn eggs are currently disabled."); event.setCancelled(true); + Block clickedBlock = event.getClickedBlock(); + if (clickedBlock == null) + { + return; + } + EntityType eggType = null; + try + { + Material mat = event.getMaterial(); + if (mat == Material.MOOSHROOM_SPAWN_EGG) + { + eggType = EntityType.MUSHROOM_COW; + } + else + { + eggType = EntityType.valueOf(mat.name().substring(0, mat.name().length() - 10)); + } + } + catch (IllegalArgumentException ignored) + { + // + } + if (eggType != null) + { + clickedBlock.getWorld().spawnEntity(clickedBlock.getLocation().add(event.getBlockFace().getDirection()).add(0.5, 0.5, 0.5), eggType); + } return; } diff --git a/src/main/java/me/totalfreedom/totalfreedommod/httpd/NanoHTTPD.java b/src/main/java/me/totalfreedom/totalfreedommod/httpd/NanoHTTPD.java index c0566cc1..bd045b95 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/httpd/NanoHTTPD.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/httpd/NanoHTTPD.java @@ -337,12 +337,12 @@ public abstract class NanoHTTPD */ protected String decodePercent(String str) { - String decoded = null; + String decoded = str; try { decoded = URLDecoder.decode(str, "UTF8"); } - catch (UnsupportedEncodingException ignored) + catch (UnsupportedEncodingException | IllegalArgumentException ignored) { } return decoded; diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index d5bd702c..308beb03 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -14,4 +14,4 @@ softdepend: - JDA - Votifier authors: [Madgeek1450, Prozza] -api-version: "1.16" \ No newline at end of file +api-version: "1.17" \ No newline at end of file