From 7d1fe8bf2ffadc1242dd1fb2c1ac5b4bc57e5c23 Mon Sep 17 00:00:00 2001 From: destro174 <40720638+destro174@users.noreply.github.com> Date: Fri, 25 Feb 2022 23:51:32 +0100 Subject: [PATCH] remove bloat --- .../GriefPrevention/BlockEventHandler.java | 6 ------ .../ryanhamshire/GriefPrevention/DataStore.java | 12 ------------ .../EquipShovelProcessingTask.java | 6 ------ .../GriefPrevention/GriefPrevention.java | 16 ---------------- .../GriefPrevention/PlayerEventHandler.java | 1 - 5 files changed, 41 deletions(-) diff --git a/src/main/java/me/ryanhamshire/GriefPrevention/BlockEventHandler.java b/src/main/java/me/ryanhamshire/GriefPrevention/BlockEventHandler.java index 05e4936..44123a5 100644 --- a/src/main/java/me/ryanhamshire/GriefPrevention/BlockEventHandler.java +++ b/src/main/java/me/ryanhamshire/GriefPrevention/BlockEventHandler.java @@ -396,7 +396,6 @@ public class BlockEventHandler implements Listener } } - GriefPrevention.sendMessage(player, TextMode.Instr, Messages.SurvivalBasicsVideo2, DataStore.SURVIVAL_VIDEO_URL); } //check to see if this chest is in a claim, and warn when it isn't @@ -437,11 +436,6 @@ public class BlockEventHandler implements Listener if (now == null) now = System.currentTimeMillis(); playerData.buildWarningTimestamp = now; - if (playerData.getClaims().size() < 2) - { - GriefPrevention.sendMessage(player, TextMode.Instr, Messages.SurvivalBasicsVideo2, DataStore.SURVIVAL_VIDEO_URL); - } - if (playerData.lastClaim != null) { Visualization visualization = Visualization.FromClaim(playerData.lastClaim, block.getY(), VisualizationType.Claim, player.getLocation()); diff --git a/src/main/java/me/ryanhamshire/GriefPrevention/DataStore.java b/src/main/java/me/ryanhamshire/GriefPrevention/DataStore.java index b85f0a1..b5a4bd7 100644 --- a/src/main/java/me/ryanhamshire/GriefPrevention/DataStore.java +++ b/src/main/java/me/ryanhamshire/GriefPrevention/DataStore.java @@ -105,11 +105,6 @@ public abstract class DataStore //current version of the schema of data in secondary storage private int currentSchemaVersion = -1; //-1 means not determined yet - //video links - static final String SURVIVAL_VIDEO_URL = "" + ChatColor.DARK_AQUA + ChatColor.UNDERLINE + "bit.ly/mcgpuser" + ChatColor.RESET; - static final String CREATIVE_VIDEO_URL = "" + ChatColor.DARK_AQUA + ChatColor.UNDERLINE + "bit.ly/mcgpcrea" + ChatColor.RESET; - static final String SUBDIVISION_VIDEO_URL = "" + ChatColor.DARK_AQUA + ChatColor.UNDERLINE + "bit.ly/mcgpsub" + ChatColor.RESET; - //list of UUIDs which are soft-muted ConcurrentHashMap softMuteMap = new ConcurrentHashMap<>(); @@ -1285,13 +1280,6 @@ public abstract class DataStore GriefPrevention.AddLogEntry(player.getName() + " resized " + playerData.claimResizing.getOwnerName() + "'s claim at " + GriefPrevention.getfriendlyLocationString(playerData.claimResizing.lesserBoundaryCorner) + "."); } - //if increased to a sufficiently large size and no subdivisions yet, send subdivision instructions - if (oldClaim.getArea() < 1000 && result.claim.getArea() >= 1000 && result.claim.children.size() == 0 && !player.hasPermission("griefprevention.adminclaims")) - { - GriefPrevention.sendMessage(player, TextMode.Info, Messages.BecomeMayor, 200L); - GriefPrevention.sendMessage(player, TextMode.Instr, Messages.SubdivisionVideo2, 201L, DataStore.SUBDIVISION_VIDEO_URL); - } - //clean up playerData.claimResizing = null; playerData.lastShovelLocation = null; diff --git a/src/main/java/me/ryanhamshire/GriefPrevention/EquipShovelProcessingTask.java b/src/main/java/me/ryanhamshire/GriefPrevention/EquipShovelProcessingTask.java index 5840510..4339c06 100644 --- a/src/main/java/me/ryanhamshire/GriefPrevention/EquipShovelProcessingTask.java +++ b/src/main/java/me/ryanhamshire/GriefPrevention/EquipShovelProcessingTask.java @@ -58,12 +58,6 @@ class EquipShovelProcessingTask implements Runnable int remainingBlocks = playerData.getRemainingClaimBlocks(); GriefPrevention.sendMessage(player, TextMode.Instr, Messages.RemainingBlocks, String.valueOf(remainingBlocks)); - //link to a video demo of land claiming, based on world type - if (GriefPrevention.instance.claimsEnabledForWorld(player.getLocation().getWorld())) - { - GriefPrevention.sendMessage(player, TextMode.Instr, Messages.SurvivalBasicsVideo2, DataStore.SURVIVAL_VIDEO_URL); - } - //if standing in a claim owned by the player, visualize it Claim claim = GriefPrevention.instance.dataStore.getClaimAt(player.getLocation(), true, playerData.lastClaim); if (claim != null && claim.checkPermission(player, ClaimPermission.Edit, null) == null) diff --git a/src/main/java/me/ryanhamshire/GriefPrevention/GriefPrevention.java b/src/main/java/me/ryanhamshire/GriefPrevention/GriefPrevention.java index 15c2505..2f993aa 100644 --- a/src/main/java/me/ryanhamshire/GriefPrevention/GriefPrevention.java +++ b/src/main/java/me/ryanhamshire/GriefPrevention/GriefPrevention.java @@ -959,11 +959,6 @@ public class GriefPrevention extends JavaPlugin { GriefPrevention.sendMessage(player, TextMode.Success, Messages.CreateClaimSuccess); - //link to a video demo of land claiming, based on world type - if (GriefPrevention.instance.claimsEnabledForWorld(player.getLocation().getWorld())) - { - GriefPrevention.sendMessage(player, TextMode.Instr, Messages.SurvivalBasicsVideo2, DataStore.SURVIVAL_VIDEO_URL); - } Visualization visualization = Visualization.FromClaim(result.claim, player.getEyeLocation().getBlockY(), VisualizationType.Claim, player.getLocation()); Visualization.Apply(player, visualization); playerData.claimResizing = null; @@ -980,11 +975,6 @@ public class GriefPrevention extends JavaPlugin { if (args.length < 1) { - //link to a video demo of land claiming, based on world type - if (GriefPrevention.instance.claimsEnabledForWorld(player.getLocation().getWorld())) - { - GriefPrevention.sendMessage(player, TextMode.Instr, Messages.SurvivalBasicsVideo2, DataStore.SURVIVAL_VIDEO_URL); - } return false; } @@ -995,11 +985,6 @@ public class GriefPrevention extends JavaPlugin } catch (NumberFormatException e) { - //link to a video demo of land claiming, based on world type - if (GriefPrevention.instance.claimsEnabledForWorld(player.getLocation().getWorld())) - { - GriefPrevention.sendMessage(player, TextMode.Instr, Messages.SurvivalBasicsVideo2, DataStore.SURVIVAL_VIDEO_URL); - } return false; } @@ -1860,7 +1845,6 @@ public class GriefPrevention extends JavaPlugin playerData.shovelMode = ShovelMode.Subdivide; playerData.claimSubdividing = null; GriefPrevention.sendMessage(player, TextMode.Instr, Messages.SubdivisionMode); - GriefPrevention.sendMessage(player, TextMode.Instr, Messages.SubdivisionVideo2, DataStore.SUBDIVISION_VIDEO_URL); return true; } diff --git a/src/main/java/me/ryanhamshire/GriefPrevention/PlayerEventHandler.java b/src/main/java/me/ryanhamshire/GriefPrevention/PlayerEventHandler.java index 24a68ca..b988ad2 100644 --- a/src/main/java/me/ryanhamshire/GriefPrevention/PlayerEventHandler.java +++ b/src/main/java/me/ryanhamshire/GriefPrevention/PlayerEventHandler.java @@ -1908,7 +1908,6 @@ class PlayerEventHandler implements Listener if (!player.hasPermission("griefprevention.adminclaims") && result.claim.getArea() >= 1000) { GriefPrevention.sendMessage(player, TextMode.Info, Messages.BecomeMayor, 200L); - GriefPrevention.sendMessage(player, TextMode.Instr, Messages.SubdivisionVideo2, 201L, DataStore.SUBDIVISION_VIDEO_URL); } instance.autoExtendClaim(result.claim);