From e122c4c5fa2edf9f6be46db65938b7f1de0cc4b8 Mon Sep 17 00:00:00 2001 From: Wild1145 Date: Sun, 19 Sep 2021 17:32:05 +0100 Subject: [PATCH 1/7] Bump to 2021.09-RC01 Release --- SECURITY.md | 7 +++++-- pom.xml | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/SECURITY.md b/SECURITY.md index adc91e1d..a18bd56e 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -11,20 +11,23 @@ These versions are currently actively supported by our team, and you should expe | Version | Supported | Support End: | | ------------------- | ------------------ | ------------------------------ | -| 2021.05 | :white_check_mark: | No Earlier than August 2021 | +| 2021.09 | :white_check_mark: | No Earlier than December 2021 | ### 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.04 | :white_check_mark: | July 2021 | +| 2021.06 | :white_check_mark: | October 2021 | + ### No Longer Supported These versions are no longer supported at all. It is strongly advised to update if you are running any of these versions. | Version | Supported | Support Ended: | | ------------------- | ------------------ | ------------------- | +| 2021.05 | :white_check_mark: | September 2021 | +| 2021.04 | :white_check_mark: | 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/pom.xml b/pom.xml index 7dfc2488..6d275ae7 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ me.totalfreedom TotalFreedomMod - 2021.06 + 2021.09-RC01 jar From 4c287ca9b81a748750407bd1feb563376871a7c1 Mon Sep 17 00:00:00 2001 From: Ryan Wild Date: Sun, 3 Oct 2021 15:50:33 +0100 Subject: [PATCH 2/7] Bump to RC02 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index ee78b3c4..07c1c073 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ me.totalfreedom TotalFreedomMod - 2021.09-RC01 + 2021.09-RC02 jar From 4d469cdc0a529a5c3a8b916b82c4626e9c7859e7 Mon Sep 17 00:00:00 2001 From: Ryan Date: Sun, 3 Oct 2021 15:57:47 +0100 Subject: [PATCH 3/7] Move from Java 16 to Java 17 (#149) * Move from Java 16 to Java 17 * Update java17-maven.yml --- .github/workflows/{java16-maven.yml => java17-maven.yml} | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) rename .github/workflows/{java16-maven.yml => java17-maven.yml} (75%) diff --git a/.github/workflows/java16-maven.yml b/.github/workflows/java17-maven.yml similarity index 75% rename from .github/workflows/java16-maven.yml rename to .github/workflows/java17-maven.yml index 92896df8..43d090ab 100644 --- a/.github/workflows/java16-maven.yml +++ b/.github/workflows/java17-maven.yml @@ -1,9 +1,9 @@ -name: Java16-Maven-Build +name: Java17-Maven-Build on: [push] jobs: - build-java-16: + build-java-17: runs-on: ubuntu-latest @@ -12,10 +12,10 @@ jobs: - uses: actions/checkout@v1 # Java 16 Builds - - name: Set up JDK 16 + - name: Set up JDK 17 uses: actions/setup-java@v2.3.0 with: - java-version: 16 + java-version: 17 distribution: 'adopt' - name: Build with Maven run: mvn -B package --file pom.xml From 74a71b1843dc5410893c5e614b77a6271cae5518 Mon Sep 17 00:00:00 2001 From: Video Date: Mon, 4 Oct 2021 16:02:39 -0600 Subject: [PATCH 4/7] Important bugfix It appears someone had an extremely big brain moment. --- .../totalfreedom/totalfreedommod/bridge/CoreProtectBridge.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/me/totalfreedom/totalfreedommod/bridge/CoreProtectBridge.java b/src/main/java/me/totalfreedom/totalfreedommod/bridge/CoreProtectBridge.java index dc846cd1..30d51a9d 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/bridge/CoreProtectBridge.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/bridge/CoreProtectBridge.java @@ -283,7 +283,6 @@ public class CoreProtectBridge extends FreedomService if (block != null) { event.setCancelled(true); - List lookup = coreProtect.blockLookup(block, -1); int cooldownTime = 3; @@ -298,6 +297,8 @@ public class CoreProtectBridge extends FreedomService } } + List lookup = coreProtect.blockLookup(block, -1); + if (!plugin.al.isAdmin(player)) { cooldown.put(player.getName(), System.currentTimeMillis()); From abfa3b977c92b7e179f1070692ecd97c86ba6071 Mon Sep 17 00:00:00 2001 From: Video Date: Sat, 13 Nov 2021 02:35:30 -0700 Subject: [PATCH 5/7] Whoops This commit fixes 2 things: 1. A redundant check that was completely unnecessary 2. A loophole in my original bugfix commit I didn't initially discover until afterwards which enables players to do the same thing except with right clicking instead The block inspector should be completely rewritten in the future, but for now it works. --- .../bridge/CoreProtectBridge.java | 157 ++++++++---------- 1 file changed, 72 insertions(+), 85 deletions(-) diff --git a/src/main/java/me/totalfreedom/totalfreedommod/bridge/CoreProtectBridge.java b/src/main/java/me/totalfreedom/totalfreedommod/bridge/CoreProtectBridge.java index 30d51a9d..c0a00e39 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/bridge/CoreProtectBridge.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/bridge/CoreProtectBridge.java @@ -276,27 +276,30 @@ public class CoreProtectBridge extends FreedomService Block block = event.getClickedBlock(); final CoreProtectAPI coreProtect = getCoreProtectAPI(); + // TODO: Rewrite this if (data.hasInspection()) { + int cooldownTime = 3; + + // Cooldown check + if ((event.getAction() == Action.LEFT_CLICK_BLOCK || event.getAction() == Action.RIGHT_CLICK_BLOCK) + && cooldown.containsKey(player.getName())) + { + long secondsLeft = getSecondsLeft(cooldown.get(player.getName()), cooldownTime); + if (secondsLeft > 0L) + { + event.setCancelled(true); + player.sendMessage(ChatColor.RED + String.valueOf(secondsLeft) + " seconds left before next query."); + return; + } + } + + // Actual lookup time if (event.getAction() == Action.LEFT_CLICK_BLOCK) { if (block != null) { event.setCancelled(true); - - int cooldownTime = 3; - - if (cooldown.containsKey(player.getName())) - { - long secondsLeft = getSecondsLeft(cooldown.get(player.getName()), cooldownTime); - if (secondsLeft > 0L) - { - event.setCancelled(true); - player.sendMessage(ChatColor.RED + String.valueOf(secondsLeft) + " seconds left before next query."); - return; - } - } - List lookup = coreProtect.blockLookup(block, -1); if (!plugin.al.isAdmin(player)) @@ -365,91 +368,75 @@ public class CoreProtectBridge extends FreedomService { if (block != null) { - if (data.hasInspection()) - { - BlockState blockState = block.getRelative(event.getBlockFace()).getState(); - Block placedBlock = blockState.getBlock(); - event.setCancelled(true); - List lookup = coreProtect.blockLookup(placedBlock, -1); + BlockState blockState = block.getRelative(event.getBlockFace()).getState(); + Block placedBlock = blockState.getBlock(); + event.setCancelled(true); + List lookup = coreProtect.blockLookup(placedBlock, -1); + if (lookup.isEmpty()) + { + lookup = coreProtect.blockLookup(block, -1); + } + + if (!plugin.al.isAdmin(player)) + { + cooldown.put(player.getName(), System.currentTimeMillis()); + } + + if (lookup != null) + { if (lookup.isEmpty()) { - lookup = coreProtect.blockLookup(block, -1); + player.sendMessage(net.md_5.bungee.api.ChatColor.of("#30ade4") + "Block Inspector " + ChatColor.WHITE + "- " + "No block data found for this location"); + return; } - int cooldownTime = 3; + HISTORY_MAP.remove(event.getPlayer()); + HISTORY_MAP.put(event.getPlayer(), new FUtil.PaginationList<>(10)); + FUtil.PaginationList paged = HISTORY_MAP.get(event.getPlayer()); - if (cooldown.containsKey(player.getName())) + player.sendMessage("---- " + net.md_5.bungee.api.ChatColor.of("#30ade4") + "Block Inspector" + ChatColor.WHITE + " ---- " + + ChatColor.GRAY + "(x" + block.getX() + "/" + "y" + block.getY() + "/" + "z" + block.getZ() + ")"); + + for (String[] value : lookup) { - long secondsLeft = getSecondsLeft(cooldown.get(player.getName()), cooldownTime); - if (secondsLeft > 0L) + CoreProtectAPI.ParseResult result = coreProtect.parseResult(value); + BlockData bl = result.getBlockData(); + + String s; + String st = ""; + + if (result.getActionString().equals("Placement")) { - event.setCancelled(true); - player.sendMessage(ChatColor.RED + String.valueOf(secondsLeft) + " seconds left before next query."); - return; + s = " placed "; } + else if (result.getActionString().equals("Removal")) + { + s = " broke "; + } + else + { + s = " interacted with "; + } + + if (result.isRolledBack()) + { + st += "§m"; + } + + int time = (int)(System.currentTimeMillis() / 1000L); + + paged.add(ChatColor.GRAY + getTimeAgo(result.getTime(), time) + ChatColor.WHITE + " - " + net.md_5.bungee.api.ChatColor.of("#30ade4") + + st + result.getPlayer() + ChatColor.WHITE + st + s + net.md_5.bungee.api.ChatColor.of("#30ade4") + st + bl.getMaterial().toString().toLowerCase()); } - if (!plugin.al.isAdmin(player)) + List page = paged.getPage(1); + for (String entries : page) { - cooldown.put(player.getName(), System.currentTimeMillis()); + player.sendMessage(entries); } - if (lookup != null) - { - if (lookup.isEmpty()) - { - player.sendMessage(net.md_5.bungee.api.ChatColor.of("#30ade4") + "Block Inspector " + ChatColor.WHITE + "- " + "No block data found for this location"); - return; - } - - HISTORY_MAP.remove(event.getPlayer()); - HISTORY_MAP.put(event.getPlayer(), new FUtil.PaginationList<>(10)); - FUtil.PaginationList paged = HISTORY_MAP.get(event.getPlayer()); - - player.sendMessage("---- " + net.md_5.bungee.api.ChatColor.of("#30ade4") + "Block Inspector" + ChatColor.WHITE + " ---- " + - ChatColor.GRAY + "(x" + block.getX() + "/" + "y" + block.getY() + "/" + "z" + block.getZ() + ")"); - - for (String[] value : lookup) - { - CoreProtectAPI.ParseResult result = coreProtect.parseResult(value); - BlockData bl = result.getBlockData(); - - String s; - String st = ""; - - if (result.getActionString().equals("Placement")) - { - s = " placed "; - } - else if (result.getActionString().equals("Removal")) - { - s = " broke "; - } - else - { - s = " interacted with "; - } - - if (result.isRolledBack()) - { - st += "§m"; - } - - int time = (int)(System.currentTimeMillis() / 1000L); - - paged.add(ChatColor.GRAY + getTimeAgo(result.getTime(), time) + ChatColor.WHITE + " - " + net.md_5.bungee.api.ChatColor.of("#30ade4") + - st + result.getPlayer() + ChatColor.WHITE + st + s + net.md_5.bungee.api.ChatColor.of("#30ade4") + st + bl.getMaterial().toString().toLowerCase()); - } - - List page = paged.getPage(1); - for (String entries : page) - { - player.sendMessage(entries); - } - - player.sendMessage("Page 1/" + paged.getPageCount() + " | To index through the pages, type " + net.md_5.bungee.api.ChatColor.of("#30ade4") + "/ins history "); - } + player.sendMessage("Page 1/" + paged.getPageCount() + " | To index through the pages, type " + net.md_5.bungee.api.ChatColor.of("#30ade4") + "/ins history "); } } } From 1e1367d08f9f13580efb19e2c440f9146c0b5ba4 Mon Sep 17 00:00:00 2001 From: Video Date: Sat, 13 Nov 2021 02:58:36 -0700 Subject: [PATCH 6/7] Bump to RC03 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 07c1c073..966d1c59 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ me.totalfreedom TotalFreedomMod - 2021.09-RC02 + 2021.09-RC03 jar From 9155ac90b5003c4bb84464b492bff1129cc47e4a Mon Sep 17 00:00:00 2001 From: Paldiu Date: Mon, 22 Nov 2021 12:29:54 -0600 Subject: [PATCH 7/7] Official Release --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 966d1c59..77a1b10f 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ me.totalfreedom TotalFreedomMod - 2021.09-RC03 + 2021.09 jar