From 732fa2e0155b6b10efa6d97df96da6f47f59491c Mon Sep 17 00:00:00 2001 From: RoboMWM Date: Mon, 8 Jun 2020 23:15:52 -0700 Subject: [PATCH] these changes are sometimes not getting exported or something --- .editorconfig | 2 +- .../GriefPrevention/BlockEventHandler.java | 3 +- .../ryanhamshire/GriefPrevention/Claim.java | 21 +- .../CleanupUnusedClaimTask.java | 3 +- .../GriefPrevention/DataStore.java | 42 ++-- .../GriefPrevention/DatabaseDataStore.java | 15 +- .../GriefPrevention/EntityCleanupTask.java | 6 +- .../GriefPrevention/EntityEventHandler.java | 36 ++-- .../EquipShovelProcessingTask.java | 3 +- .../GriefPrevention/FlatFileDataStore.java | 21 +- .../GriefPrevention/GriefPrevention.java | 195 ++++++++++++------ .../GriefPrevention/MaterialInfo.java | 3 +- .../GriefPrevention/PlayerData.java | 6 +- .../GriefPrevention/PlayerEventHandler.java | 75 ++++--- .../GriefPrevention/PlayerKickBanTask.java | 3 +- .../GriefPrevention/PlayerRescueTask.java | 3 +- .../PvPImmunityValidationTask.java | 3 +- .../RestoreNatureProcessingTask.java | 6 +- .../GriefPrevention/SpamDetector.java | 9 +- .../GriefPrevention/UUIDFetcher.java | 3 +- .../GriefPrevention/Visualization.java | 12 +- .../GriefPrevention/events/package-info.java | 1 + 22 files changed, 314 insertions(+), 157 deletions(-) diff --git a/.editorconfig b/.editorconfig index 5a418aa..96baa51 100644 --- a/.editorconfig +++ b/.editorconfig @@ -90,7 +90,7 @@ ij_java_doc_keep_invalid_tags = true ij_java_doc_param_description_on_new_line = false ij_java_doc_preserve_line_breaks = false ij_java_doc_use_throws_not_exception_tag = false -ij_java_else_on_new_line = false +ij_java_else_on_new_line = true ij_java_enum_constants_wrap = off ij_java_extends_keyword_wrap = off ij_java_extends_list_wrap = off diff --git a/src/main/java/me/ryanhamshire/GriefPrevention/BlockEventHandler.java b/src/main/java/me/ryanhamshire/GriefPrevention/BlockEventHandler.java index 533e3e9..e1fed5e 100644 --- a/src/main/java/me/ryanhamshire/GriefPrevention/BlockEventHandler.java +++ b/src/main/java/me/ryanhamshire/GriefPrevention/BlockEventHandler.java @@ -195,7 +195,8 @@ public class BlockEventHandler implements Listener if (GriefPrevention.instance.pvpRulesApply(world)) { return GriefPrevention.instance.config_pvp_allowFireNearPlayers; - } else + } + else { return GriefPrevention.instance.config_pvp_allowFireNearPlayers_NonPvp; } diff --git a/src/main/java/me/ryanhamshire/GriefPrevention/Claim.java b/src/main/java/me/ryanhamshire/GriefPrevention/Claim.java index 5d3c92a..4472320 100644 --- a/src/main/java/me/ryanhamshire/GriefPrevention/Claim.java +++ b/src/main/java/me/ryanhamshire/GriefPrevention/Claim.java @@ -469,10 +469,12 @@ public class Claim if (!breakable) { return GriefPrevention.instance.dataStore.getMessage(Messages.NonSiegeMaterial); - } else if (player.getUniqueId().equals(this.ownerID)) + } + else if (player.getUniqueId().equals(this.ownerID)) { return GriefPrevention.instance.dataStore.getMessage(Messages.NoOwnerBuildUnderSiege); - } else + } + else { return null; } @@ -664,10 +666,12 @@ public class Claim if (entry.getValue() == ClaimPermission.Build) { builders.add(entry.getKey()); - } else if (entry.getValue() == ClaimPermission.Inventory) + } + else if (entry.getValue() == ClaimPermission.Inventory) { containers.add(entry.getKey()); - } else + } + else { accessors.add(entry.getKey()); } @@ -918,7 +922,8 @@ public class Claim if (block.getType() == Material.CHEST && !creativeMode) { score += 10; - } else + } + else { score += .5; } @@ -933,10 +938,12 @@ public class Claim if (block.getType() == Material.CHEST && !creativeMode) { score += 10; - } else if (creativeMode && (block.getType() == Material.LAVA)) + } + else if (creativeMode && (block.getType() == Material.LAVA)) { score -= 10; - } else + } + else { score += 1; } diff --git a/src/main/java/me/ryanhamshire/GriefPrevention/CleanupUnusedClaimTask.java b/src/main/java/me/ryanhamshire/GriefPrevention/CleanupUnusedClaimTask.java index 48bb979..5a7d5ea 100644 --- a/src/main/java/me/ryanhamshire/GriefPrevention/CleanupUnusedClaimTask.java +++ b/src/main/java/me/ryanhamshire/GriefPrevention/CleanupUnusedClaimTask.java @@ -105,7 +105,8 @@ class CleanupUnusedClaimTask implements Runnable } } } - } else if (GriefPrevention.instance.config_claims_unusedClaimExpirationDays > 0 && GriefPrevention.instance.creativeRulesApply(claim.getLesserBoundaryCorner())) + } + else if (GriefPrevention.instance.config_claims_unusedClaimExpirationDays > 0 && GriefPrevention.instance.creativeRulesApply(claim.getLesserBoundaryCorner())) { //avoid scanning large claims and administrative claims if (claim.isAdminClaim() || claim.getWidth() > 25 || claim.getHeight() > 25) return; diff --git a/src/main/java/me/ryanhamshire/GriefPrevention/DataStore.java b/src/main/java/me/ryanhamshire/GriefPrevention/DataStore.java index 5d2bc72..2378483 100644 --- a/src/main/java/me/ryanhamshire/GriefPrevention/DataStore.java +++ b/src/main/java/me/ryanhamshire/GriefPrevention/DataStore.java @@ -117,7 +117,8 @@ public abstract class DataStore if (this.currentSchemaVersion >= 0) { return this.currentSchemaVersion; - } else + } + else { this.currentSchemaVersion = this.getSchemaVersionFromStorage(); return this.currentSchemaVersion; @@ -776,7 +777,8 @@ public abstract class DataStore if (chunkClaims != null) { return Collections.unmodifiableCollection(chunkClaims); - } else + } + else { return Collections.unmodifiableCollection(new ArrayList()); } @@ -827,7 +829,8 @@ public abstract class DataStore { smallx = x1; bigx = x2; - } else + } + else { smallx = x2; bigx = x1; @@ -837,7 +840,8 @@ public abstract class DataStore { smally = y1; bigy = y2; - } else + } + else { smally = y2; bigy = y1; @@ -847,7 +851,8 @@ public abstract class DataStore { smallz = z1; bigz = z2; - } else + } + else { smallz = z2; bigz = z1; @@ -889,7 +894,8 @@ public abstract class DataStore if (newClaim.parent != null) { claimsToCheck = newClaim.parent.children; - } else + } + else { claimsToCheck = this.claims; } @@ -1058,16 +1064,19 @@ public abstract class DataStore if (siegeData.attacker.getName().equals(loserName)) { winnerName = siegeData.defender.getName(); - } else + } + else { winnerName = siegeData.attacker.getName(); } - } else if (winnerName != null && loserName == null) + } + else if (winnerName != null && loserName == null) { if (siegeData.attacker.getName().equals(winnerName)) { loserName = siegeData.defender.getName(); - } else + } + else { loserName = siegeData.attacker.getName(); } @@ -1370,7 +1379,8 @@ public abstract class DataStore if (ownerID == player.getUniqueId()) { claimBlocksRemaining = playerData.getRemainingClaimBlocks(); - } else + } + else { PlayerData ownerData = this.getPlayerData(ownerID); claimBlocksRemaining = ownerData.getRemainingClaimBlocks(); @@ -1411,7 +1421,8 @@ public abstract class DataStore //clean up playerData.claimResizing = null; playerData.lastShovelLocation = null; - } else + } + else { if (result.claim != null) { @@ -1421,7 +1432,8 @@ public abstract class DataStore //show the player the conflicting claim Visualization visualization = Visualization.FromClaim(result.claim, player.getEyeLocation().getBlockY(), VisualizationType.ErrorClaim, player.getLocation()); Visualization.Apply(player, visualization); - } else + } + else { GriefPrevention.sendMessage(player, TextMode.Err, Messages.ResizeFailOverlapRegion); } @@ -1434,10 +1446,12 @@ public abstract class DataStore if (player.hasPermission("griefprevention.adminclaims") && player.hasPermission("griefprevention.adjustclaimblocks")) { GriefPrevention.sendMessage(player, TextMode.Info, Messages.AdvertiseACandACB); - } else if (player.hasPermission("griefprevention.adminclaims")) + } + else if (player.hasPermission("griefprevention.adminclaims")) { GriefPrevention.sendMessage(player, TextMode.Info, Messages.AdvertiseAdminClaims); - } else if (player.hasPermission("griefprevention.adjustclaimblocks")) + } + else if (player.hasPermission("griefprevention.adjustclaimblocks")) { GriefPrevention.sendMessage(player, TextMode.Info, Messages.AdvertiseACB); } diff --git a/src/main/java/me/ryanhamshire/GriefPrevention/DatabaseDataStore.java b/src/main/java/me/ryanhamshire/GriefPrevention/DatabaseDataStore.java index 89765aa..9b34c7e 100644 --- a/src/main/java/me/ryanhamshire/GriefPrevention/DatabaseDataStore.java +++ b/src/main/java/me/ryanhamshire/GriefPrevention/DatabaseDataStore.java @@ -303,7 +303,8 @@ public class DatabaseDataStore extends DataStore { GriefPrevention.AddLogEntry("Failed to load a claim (ID:" + claimID.toString() + ") because its world isn't loaded (yet?). Please delete the claim or contact the GriefPrevention developer with information about which plugin(s) you're using to load or create worlds. " + lesserCornerString); continue; - } else + } + else { throw e; } @@ -314,7 +315,8 @@ public class DatabaseDataStore extends DataStore if (ownerName.isEmpty() || ownerName.startsWith("--")) { ownerID = null; //administrative land claim or subdivision - } else if (this.getSchemaVersion() < 1) + } + else if (this.getSchemaVersion() < 1) { try { @@ -325,7 +327,8 @@ public class DatabaseDataStore extends DataStore GriefPrevention.AddLogEntry("This owner name did not convert to a UUID: " + ownerName + "."); GriefPrevention.AddLogEntry(" Converted land claim to administrative @ " + lesserBoundaryCorner.toString()); } - } else + } + else { try { @@ -358,11 +361,13 @@ public class DatabaseDataStore extends DataStore if (removeClaim) { claimsToRemove.add(claim); - } else if (parentId == -1) + } + else if (parentId == -1) { //top level claim this.addClaim(claim, false); - } else + } + else { //subdivision subdivisionsToLoad.add(claim); diff --git a/src/main/java/me/ryanhamshire/GriefPrevention/EntityCleanupTask.java b/src/main/java/me/ryanhamshire/GriefPrevention/EntityCleanupTask.java index 3194a39..980ad24 100644 --- a/src/main/java/me/ryanhamshire/GriefPrevention/EntityCleanupTask.java +++ b/src/main/java/me/ryanhamshire/GriefPrevention/EntityCleanupTask.java @@ -73,7 +73,8 @@ class EntityCleanupTask implements Runnable { Boat boat = (Boat) entity; if (boat.isEmpty()) remove = true; - } else if (entity instanceof Vehicle) + } + else if (entity instanceof Vehicle) { Vehicle vehicle = (Vehicle) entity; @@ -104,7 +105,8 @@ class EntityCleanupTask implements Runnable if (claim != null) { cachedClaim = claim; - } else + } + else { remove = true; } diff --git a/src/main/java/me/ryanhamshire/GriefPrevention/EntityEventHandler.java b/src/main/java/me/ryanhamshire/GriefPrevention/EntityEventHandler.java index c789671..4e135be 100644 --- a/src/main/java/me/ryanhamshire/GriefPrevention/EntityEventHandler.java +++ b/src/main/java/me/ryanhamshire/GriefPrevention/EntityEventHandler.java @@ -137,13 +137,16 @@ public class EntityEventHandler implements Listener if (!GriefPrevention.instance.config_endermenMoveBlocks && event.getEntityType() == EntityType.ENDERMAN) { event.setCancelled(true); - } else if (!GriefPrevention.instance.config_silverfishBreakBlocks && event.getEntityType() == EntityType.SILVERFISH) + } + else if (!GriefPrevention.instance.config_silverfishBreakBlocks && event.getEntityType() == EntityType.SILVERFISH) { event.setCancelled(true); - } else if (!GriefPrevention.instance.config_rabbitsEatCrops && event.getEntityType() == EntityType.RABBIT) + } + else if (!GriefPrevention.instance.config_rabbitsEatCrops && event.getEntityType() == EntityType.RABBIT) { event.setCancelled(true); - } else if (GriefPrevention.instance.config_claims_worldModes.get(event.getBlock().getWorld()) != ClaimsMode.Disabled) + } + else if (GriefPrevention.instance.config_claims_worldModes.get(event.getBlock().getWorld()) != ClaimsMode.Disabled) { if (event.getEntityType() == EntityType.WITHER) { @@ -152,7 +155,8 @@ public class EntityEventHandler implements Listener { event.setCancelled(true); } - } else if (!GriefPrevention.instance.config_claims_ravagersBreakBlocks && event.getEntityType() == EntityType.RAVAGER) + } + else if (!GriefPrevention.instance.config_claims_ravagersBreakBlocks && event.getEntityType() == EntityType.RAVAGER) { event.setCancelled(true); } @@ -163,7 +167,8 @@ public class EntityEventHandler implements Listener if (event.getEntityType() != EntityType.PLAYER) { event.setCancelled(true); - } else + } + else { Player player = (Player) event.getEntity(); Block block = event.getBlock(); @@ -276,7 +281,8 @@ public class EntityEventHandler implements Listener if (!GriefPrevention.instance.config_creaturesTrampleCrops) { event.setCancelled(true); - } else + } + else { Entity rider = event.getEntity().getPassenger(); if (rider != null && rider.getType() == EntityType.PLAYER) @@ -745,14 +751,16 @@ public class EntityEventHandler implements Listener if (damageSource.getType() == EntityType.PLAYER) { attacker = (Player) damageSource; - } else if (damageSource instanceof Projectile) + } + else if (damageSource instanceof Projectile) { arrow = (Projectile) damageSource; if (arrow.getShooter() instanceof Player) { attacker = (Player) arrow.getShooter(); } - } else if (subEvent.getDamager() instanceof Firework) + } + else if (subEvent.getDamager() instanceof Firework) { damageSource = subEvent.getDamager(); if (damageSource.hasMetadata("GP_FIREWORK")) @@ -1182,14 +1190,16 @@ public class EntityEventHandler implements Listener if (damageSource.getType() == EntityType.PLAYER) { attacker = (Player) damageSource; - } else if (damageSource instanceof Projectile) + } + else if (damageSource instanceof Projectile) { arrow = (Projectile) damageSource; if (arrow.getShooter() instanceof Player) { attacker = (Player) arrow.getShooter(); } - } else if (damageSource instanceof Firework) + } + else if (damageSource instanceof Firework) { if (damageSource.hasMetadata("GP_FIREWORK")) { @@ -1244,14 +1254,16 @@ public class EntityEventHandler implements Listener if (damageSource.getType() == EntityType.PLAYER) { attacker = (Player) damageSource; - } else if (damageSource instanceof Projectile) + } + else if (damageSource instanceof Projectile) { Projectile arrow = (Projectile) damageSource; if (arrow.getShooter() instanceof Player) { attacker = (Player) arrow.getShooter(); } - } else if (damageSource instanceof Firework) + } + else if (damageSource instanceof Firework) { if (damageSource.hasMetadata("GP_FIREWORK")) { diff --git a/src/main/java/me/ryanhamshire/GriefPrevention/EquipShovelProcessingTask.java b/src/main/java/me/ryanhamshire/GriefPrevention/EquipShovelProcessingTask.java index 59673b6..b27abef 100644 --- a/src/main/java/me/ryanhamshire/GriefPrevention/EquipShovelProcessingTask.java +++ b/src/main/java/me/ryanhamshire/GriefPrevention/EquipShovelProcessingTask.java @@ -62,7 +62,8 @@ class EquipShovelProcessingTask implements Runnable if (GriefPrevention.instance.creativeRulesApply(player.getLocation())) { GriefPrevention.sendMessage(player, TextMode.Instr, Messages.CreativeBasicsVideo2, DataStore.CREATIVE_VIDEO_URL); - } else if (GriefPrevention.instance.claimsEnabledForWorld(player.getLocation().getWorld())) + } + else if (GriefPrevention.instance.claimsEnabledForWorld(player.getLocation().getWorld())) { GriefPrevention.sendMessage(player, TextMode.Instr, Messages.SurvivalBasicsVideo2, DataStore.SURVIVAL_VIDEO_URL); } diff --git a/src/main/java/me/ryanhamshire/GriefPrevention/FlatFileDataStore.java b/src/main/java/me/ryanhamshire/GriefPrevention/FlatFileDataStore.java index 1241e99..6d9ed8e 100644 --- a/src/main/java/me/ryanhamshire/GriefPrevention/FlatFileDataStore.java +++ b/src/main/java/me/ryanhamshire/GriefPrevention/FlatFileDataStore.java @@ -206,7 +206,8 @@ public class FlatFileDataStore extends DataStore if (this.getSchemaVersion() <= 1) { this.loadClaimData_Legacy(files); - } else + } + else { this.loadClaimData(files); } @@ -283,7 +284,8 @@ public class FlatFileDataStore extends DataStore if (ownerName.isEmpty() || ownerName.startsWith("--")) { ownerID = null; //administrative land claim or subdivision - } else if (this.getSchemaVersion() == 0) + } + else if (this.getSchemaVersion() == 0) { try { @@ -294,7 +296,8 @@ public class FlatFileDataStore extends DataStore GriefPrevention.AddLogEntry("Couldn't resolve this name to a UUID: " + ownerName + "."); GriefPrevention.AddLogEntry(" Converted land claim to administrative @ " + lesserBoundaryCorner.toString()); } - } else + } + else { try { @@ -370,7 +373,8 @@ public class FlatFileDataStore extends DataStore GriefPrevention.AddLogEntry("Failed to load a claim " + files[i].getName() + " because its world isn't loaded (yet?). Please delete the claim file or contact the GriefPrevention developer with information about which plugin(s) you're using to load or create worlds. " + lesserCornerString); inStream.close(); - } else + } + else { StringWriter errors = new StringWriter(); e.printStackTrace(new PrintWriter(errors)); @@ -431,7 +435,8 @@ public class FlatFileDataStore extends DataStore if (out_parentID.size() == 0 || out_parentID.get(0) == -1) { this.addClaim(claim, false); - } else + } + else { orphans.put(claim, out_parentID.get(0)); } @@ -443,7 +448,8 @@ public class FlatFileDataStore extends DataStore if (e.getMessage() != null && e.getMessage().contains("World not found")) { files[i].delete(); - } else + } + else { StringWriter errors = new StringWriter(); e.printStackTrace(new PrintWriter(errors)); @@ -897,7 +903,8 @@ public class FlatFileDataStore extends DataStore catch (IOException exception) {} return schemaVersion; - } else + } + else { this.updateSchemaVersionInStorage(0); return 0; diff --git a/src/main/java/me/ryanhamshire/GriefPrevention/GriefPrevention.java b/src/main/java/me/ryanhamshire/GriefPrevention/GriefPrevention.java index 0dc8c19..79aa3bb 100644 --- a/src/main/java/me/ryanhamshire/GriefPrevention/GriefPrevention.java +++ b/src/main/java/me/ryanhamshire/GriefPrevention/GriefPrevention.java @@ -475,7 +475,8 @@ public class GriefPrevention extends JavaPlugin this.config_claims_worldModes.put(world, claimsMode); if (claimsMode == ClaimsMode.Creative) this.config_creativeWorldsExist = true; continue; - } else + } + else { GriefPrevention.AddLogEntry("Error: Invalid claim mode \"" + configSetting + "\". Options are Survival, Creative, and Disabled."); this.config_claims_worldModes.put(world, ClaimsMode.Creative); @@ -488,7 +489,8 @@ public class GriefPrevention extends JavaPlugin { this.config_claims_worldModes.put(world, ClaimsMode.Creative); this.config_creativeWorldsExist = true; - } else if (deprecated_claimsEnabledWorldNames.contains(world.getName())) + } + else if (deprecated_claimsEnabledWorldNames.contains(world.getName())) { this.config_claims_worldModes.put(world, ClaimsMode.Survival); } @@ -497,7 +499,8 @@ public class GriefPrevention extends JavaPlugin else if (world.getName().toLowerCase().contains("survival")) { this.config_claims_worldModes.put(world, ClaimsMode.Survival); - } else if (world.getName().toLowerCase().contains("creative")) + } + else if (world.getName().toLowerCase().contains("creative")) { this.config_claims_worldModes.put(world, ClaimsMode.Creative); this.config_creativeWorldsExist = true; @@ -508,10 +511,12 @@ public class GriefPrevention extends JavaPlugin { this.config_claims_worldModes.put(world, ClaimsMode.Creative); this.config_creativeWorldsExist = true; - } else if (world.getEnvironment() == Environment.NORMAL) + } + else if (world.getEnvironment() == Environment.NORMAL) { this.config_claims_worldModes.put(world, ClaimsMode.Survival); - } else + } + else { this.config_claims_worldModes.put(world, ClaimsMode.Disabled); } @@ -688,7 +693,8 @@ public class GriefPrevention extends JavaPlugin if (world == null) { AddLogEntry("Error: Siege Configuration: There's no world named \"" + worldName + "\". Please update your config.yml."); - } else + } + else { this.config_siege_enabledWorlds.add(world); } @@ -755,7 +761,8 @@ public class GriefPrevention extends JavaPlugin if (material == null) { GriefPrevention.AddLogEntry("Siege Configuration: Material not found: " + blockName + "."); - } else + } + else { this.config_siege_blocks.add(material); } @@ -975,16 +982,20 @@ public class GriefPrevention extends JavaPlugin if (configSetting.equalsIgnoreCase("Survival")) { return ClaimsMode.Survival; - } else if (configSetting.equalsIgnoreCase("Creative")) + } + else if (configSetting.equalsIgnoreCase("Creative")) { return ClaimsMode.Creative; - } else if (configSetting.equalsIgnoreCase("Disabled")) + } + else if (configSetting.equalsIgnoreCase("Disabled")) { return ClaimsMode.Disabled; - } else if (configSetting.equalsIgnoreCase("SurvivalRequiringClaims")) + } + else if (configSetting.equalsIgnoreCase("SurvivalRequiringClaims")) { return ClaimsMode.SurvivalRequiringClaims; - } else + } + else { return null; } @@ -1061,7 +1072,8 @@ public class GriefPrevention extends JavaPlugin { GriefPrevention.sendMessage(player, TextMode.Err, Messages.MinimumRadius, String.valueOf(radius)); return true; - } else + } + else { radius = specifiedRadius; } @@ -1096,11 +1108,13 @@ public class GriefPrevention extends JavaPlugin Visualization visualization = Visualization.FromClaim(result.claim, player.getEyeLocation().getBlockY(), VisualizationType.ErrorClaim, player.getLocation()); Visualization.Apply(player, visualization); - } else + } + else { GriefPrevention.sendMessage(player, TextMode.Err, Messages.CreateClaimFailOverlapRegion); } - } else + } + else { GriefPrevention.sendMessage(player, TextMode.Success, Messages.CreateClaimSuccess); @@ -1108,7 +1122,8 @@ public class GriefPrevention extends JavaPlugin if (GriefPrevention.instance.creativeRulesApply(player.getLocation())) { GriefPrevention.sendMessage(player, TextMode.Instr, Messages.CreativeBasicsVideo2, DataStore.CREATIVE_VIDEO_URL); - } else if (GriefPrevention.instance.claimsEnabledForWorld(player.getLocation().getWorld())) + } + else if (GriefPrevention.instance.claimsEnabledForWorld(player.getLocation().getWorld())) { GriefPrevention.sendMessage(player, TextMode.Instr, Messages.SurvivalBasicsVideo2, DataStore.SURVIVAL_VIDEO_URL); } @@ -1132,7 +1147,8 @@ public class GriefPrevention extends JavaPlugin if (GriefPrevention.instance.creativeRulesApply(player.getLocation())) { GriefPrevention.sendMessage(player, TextMode.Instr, Messages.CreativeBasicsVideo2, DataStore.CREATIVE_VIDEO_URL); - } else if (GriefPrevention.instance.claimsEnabledForWorld(player.getLocation().getWorld())) + } + else if (GriefPrevention.instance.claimsEnabledForWorld(player.getLocation().getWorld())) { GriefPrevention.sendMessage(player, TextMode.Instr, Messages.SurvivalBasicsVideo2, DataStore.SURVIVAL_VIDEO_URL); } @@ -1150,7 +1166,8 @@ public class GriefPrevention extends JavaPlugin if (GriefPrevention.instance.creativeRulesApply(player.getLocation())) { GriefPrevention.sendMessage(player, TextMode.Instr, Messages.CreativeBasicsVideo2, DataStore.CREATIVE_VIDEO_URL); - } else if (GriefPrevention.instance.claimsEnabledForWorld(player.getLocation().getWorld())) + } + else if (GriefPrevention.instance.claimsEnabledForWorld(player.getLocation().getWorld())) { GriefPrevention.sendMessage(player, TextMode.Instr, Messages.SurvivalBasicsVideo2, DataStore.SURVIVAL_VIDEO_URL); } @@ -1210,7 +1227,8 @@ public class GriefPrevention extends JavaPlugin if (direction.getZ() > 0) { newz2 += amount; //north - } else + } + else { newz1 -= amount; //south } @@ -1222,7 +1240,8 @@ public class GriefPrevention extends JavaPlugin if (direction.getX() > 0) { newx2 += amount; //east - } else + } + else { newx1 -= amount; //west } @@ -1234,7 +1253,8 @@ public class GriefPrevention extends JavaPlugin if (direction.getX() > 0) { newx2 += amount; - } else + } + else { newx1 -= amount; } @@ -1242,7 +1262,8 @@ public class GriefPrevention extends JavaPlugin if (direction.getZ() > 0) { newz2 += amount; - } else + } + else { newz1 -= amount; } @@ -1279,7 +1300,8 @@ public class GriefPrevention extends JavaPlugin if (!playerData.ignoreClaims) { GriefPrevention.sendMessage(player, TextMode.Success, Messages.RespectingClaims); - } else + } + else { GriefPrevention.sendMessage(player, TextMode.Success, Messages.IgnoringClaims); } @@ -1541,12 +1563,14 @@ public class GriefPrevention extends JavaPlugin if (claim == null || claim.allowEdit(player) == null) { clearPermissions = true; - } else + } + else { GriefPrevention.sendMessage(player, TextMode.Err, Messages.ClearPermsOwnerOnly); return true; } - } else + } + else { //validate player argument or group argument if (!args[0].startsWith("[") || !args[0].endsWith("]")) @@ -1616,7 +1640,8 @@ public class GriefPrevention extends JavaPlugin if (!clearPermissions) { GriefPrevention.sendMessage(player, TextMode.Success, Messages.UntrustIndividualAllClaims, args[0]); - } else + } + else { GriefPrevention.sendMessage(player, TextMode.Success, Messages.UntrustEveryoneAllClaims); } @@ -1627,7 +1652,8 @@ public class GriefPrevention extends JavaPlugin { GriefPrevention.sendMessage(player, TextMode.Err, Messages.NoPermissionTrust, claim.getOwnerName()); return true; - } else + } + else { //if clearing all if (clearPermissions) @@ -1665,7 +1691,8 @@ public class GriefPrevention extends JavaPlugin { GriefPrevention.sendMessage(player, TextMode.Err, Messages.ManagersDontUntrustManagers, claim.getOwnerName()); return true; - } else + } + else { //calling the event TrustChangedEvent event = new TrustChangedEvent(player, claim, null, false, idToDrop); @@ -1753,7 +1780,8 @@ public class GriefPrevention extends JavaPlugin { claim.setSubclaimRestrictions(false); GriefPrevention.sendMessage(player, TextMode.Success, Messages.SubclaimUnrestricted); - } else + } + else { claim.setSubclaimRestrictions(true); GriefPrevention.sendMessage(player, TextMode.Success, Messages.SubclaimRestricted); @@ -1790,7 +1818,8 @@ public class GriefPrevention extends JavaPlugin { GriefPrevention.sendMessage(player, TextMode.Info, Messages.BlockPurchaseCost, String.valueOf(GriefPrevention.instance.config_economy_claimBlocksPurchaseCost), String.valueOf(GriefPrevention.economy.getBalance(player.getName()))); return false; - } else + } + else { PlayerData playerData = this.dataStore.getPlayerData(player.getUniqueId()); @@ -1962,7 +1991,8 @@ public class GriefPrevention extends JavaPlugin if (claim == null) { GriefPrevention.sendMessage(player, TextMode.Err, Messages.DeleteClaimMissing); - } else + } + else { //deleting an admin claim additionally requires the adminclaims permission if (!claim.isAdminClaim() || player.hasPermission("griefprevention.adminclaims")) @@ -1972,7 +2002,8 @@ public class GriefPrevention extends JavaPlugin { GriefPrevention.sendMessage(player, TextMode.Warn, Messages.DeletionSubdivisionWarning); playerData.warnedAboutMajorDeletion = true; - } else + } + else { claim.removeSurfaceFluids(null); this.dataStore.deleteClaim(claim, true, true); @@ -1991,14 +2022,16 @@ public class GriefPrevention extends JavaPlugin playerData.warnedAboutMajorDeletion = false; } - } else + } + else { GriefPrevention.sendMessage(player, TextMode.Err, Messages.CantDeleteAdminClaim); } } return true; - } else if (cmd.getName().equalsIgnoreCase("claimexplosions") && player != null) + } + else if (cmd.getName().equalsIgnoreCase("claimexplosions") && player != null) { //determine which claim the player is standing in Claim claim = this.dataStore.getClaimAt(player.getLocation(), true /*ignore height*/, null); @@ -2006,7 +2039,8 @@ public class GriefPrevention extends JavaPlugin if (claim == null) { GriefPrevention.sendMessage(player, TextMode.Err, Messages.DeleteClaimMissing); - } else + } + else { String noBuildReason = claim.allowBuild(player, Material.STONE); if (noBuildReason != null) @@ -2019,7 +2053,8 @@ public class GriefPrevention extends JavaPlugin { claim.areExplosivesAllowed = false; GriefPrevention.sendMessage(player, TextMode.Success, Messages.ExplosivesDisabled); - } else + } + else { claim.areExplosivesAllowed = true; GriefPrevention.sendMessage(player, TextMode.Success, Messages.ExplosivesEnabled); @@ -2056,7 +2091,8 @@ public class GriefPrevention extends JavaPlugin } return true; - } else if (cmd.getName().equalsIgnoreCase("deleteclaimsinworld")) + } + else if (cmd.getName().equalsIgnoreCase("deleteclaimsinworld")) { //must be executed at the console if (player != null) @@ -2080,7 +2116,8 @@ public class GriefPrevention extends JavaPlugin this.dataStore.deleteClaimsInWorld(world, true); GriefPrevention.AddLogEntry("Deleted all claims in world: " + world.getName() + ".", CustomLogEntryTypes.AdminActivity); return true; - } else if (cmd.getName().equalsIgnoreCase("deleteuserclaimsinworld")) + } + else if (cmd.getName().equalsIgnoreCase("deleteuserclaimsinworld")) { //must be executed at the console if (player != null) @@ -2118,7 +2155,8 @@ public class GriefPrevention extends JavaPlugin { GriefPrevention.sendMessage(player, TextMode.Err, Messages.PlayerNotFound2); return true; - } else + } + else { WelcomeTask task = new WelcomeTask(otherPlayer); task.run(); @@ -2229,7 +2267,8 @@ public class GriefPrevention extends JavaPlugin playerData = this.dataStore.getPlayerData(otherPlayer.getUniqueId()); GriefPrevention.sendMessage(player, TextMode.Success, Messages.DropUnlockOthersConfirmation, otherPlayer.getName()); - } else + } + else { playerData = this.dataStore.getPlayerData(player.getUniqueId()); GriefPrevention.sendMessage(player, TextMode.Success, Messages.DropUnlockConfirmation); @@ -2498,7 +2537,8 @@ public class GriefPrevention extends JavaPlugin { return false; } - } else + } + else { return false; } @@ -2578,7 +2618,8 @@ public class GriefPrevention extends JavaPlugin GriefPrevention.sendMessage(player, TextMode.Success, Messages.SiegeConfirmed, defender.getName()); return true; - } else if (cmd.getName().equalsIgnoreCase("softmute")) + } + else if (cmd.getName().equalsIgnoreCase("softmute")) { //requires one parameter if (args.length != 1) return false; @@ -2603,19 +2644,22 @@ public class GriefPrevention extends JavaPlugin } GriefPrevention.AddLogEntry(executorName + " muted " + targetPlayer.getName() + ".", CustomLogEntryTypes.AdminActivity, true); - } else + } + else { GriefPrevention.sendMessage(player, TextMode.Success, Messages.UnSoftMuted, targetPlayer.getName()); } return true; - } else if (cmd.getName().equalsIgnoreCase("gpreload")) + } + else if (cmd.getName().equalsIgnoreCase("gpreload")) { this.loadConfig(); if (player != null) { GriefPrevention.sendMessage(player, TextMode.Success, "Configuration updated. If you have updated your Grief Prevention JAR, you still need to /reload or reboot your server."); - } else + } + else { GriefPrevention.AddLogEntry("Configuration updated. If you have updated your Grief Prevention JAR, you still need to /reload or reboot your server."); } @@ -2740,7 +2784,8 @@ public class GriefPrevention extends JavaPlugin if (list.isEmpty()) { GriefPrevention.sendMessage(player, TextMode.Info, Messages.NotIgnoringAnyone); - } else + } + else { GriefPrevention.sendMessage(player, TextMode.Info, list); } @@ -2813,7 +2858,8 @@ public class GriefPrevention extends JavaPlugin if (mode == IgnoreMode.None) { playerData.ignoredPlayers.remove(ignoree.getUniqueId()); - } else + } + else { playerData.ignoredPlayers.put(ignoree.getUniqueId(), mode == IgnoreMode.StandardIgnore ? false : true); } @@ -2834,7 +2880,8 @@ public class GriefPrevention extends JavaPlugin if (entry.startsWith("[") || entry.equals("public")) { return entry; - } else + } + else { return GriefPrevention.lookupPlayerName(entry); } @@ -2867,7 +2914,8 @@ public class GriefPrevention extends JavaPlugin { GriefPrevention.sendMessage(player, TextMode.Instr, Messages.DeleteTopLevelClaim); return true; - } else + } + else { //delete it claim.removeSurfaceFluids(null); @@ -2919,10 +2967,12 @@ public class GriefPrevention extends JavaPlugin GriefPrevention.sendMessage(player, TextMode.Err, Messages.InvalidPermissionID); return; } - } else if (recipientName.contains(".")) + } + else if (recipientName.contains(".")) { permission = recipientName; - } else + } + else { otherPlayer = this.resolvePlayerByName(recipientName); if (otherPlayer == null && !recipientName.equals("public") && !recipientName.equals("all")) @@ -2935,7 +2985,8 @@ public class GriefPrevention extends JavaPlugin { recipientName = otherPlayer.getName(); recipientID = otherPlayer.getUniqueId(); - } else + } + else { recipientName = "public"; } @@ -2950,7 +3001,8 @@ public class GriefPrevention extends JavaPlugin { targetClaims.add(playerData.getClaims().get(i)); } - } else + } + else { //check permission here if (claim.allowGrantPermission(player) != null) @@ -3009,7 +3061,8 @@ public class GriefPrevention extends JavaPlugin if (permission != null) { identifierToAdd = "[" + permission + "]"; - } else if (recipientID != null) + } + else if (recipientID != null) { identifierToAdd = recipientID.toString(); } @@ -3034,7 +3087,8 @@ public class GriefPrevention extends JavaPlugin { currentClaim.managers.add(identifierToAdd); } - } else + } + else { currentClaim.setPermission(identifierToAdd, permissionLevel); } @@ -3047,13 +3101,16 @@ public class GriefPrevention extends JavaPlugin if (permissionLevel == null) { permissionDescription = this.dataStore.getMessage(Messages.PermissionsPermission); - } else if (permissionLevel == ClaimPermission.Build) + } + else if (permissionLevel == ClaimPermission.Build) { permissionDescription = this.dataStore.getMessage(Messages.BuildPermission); - } else if (permissionLevel == ClaimPermission.Access) + } + else if (permissionLevel == ClaimPermission.Access) { permissionDescription = this.dataStore.getMessage(Messages.AccessPermission); - } else //ClaimPermission.Inventory + } + else //ClaimPermission.Inventory { permissionDescription = this.dataStore.getMessage(Messages.ContainersPermission); } @@ -3062,7 +3119,8 @@ public class GriefPrevention extends JavaPlugin if (claim == null) { location = this.dataStore.getMessage(Messages.LocationAllClaims); - } else + } + else { location = this.dataStore.getMessage(Messages.LocationCurrentClaim); } @@ -3152,7 +3210,8 @@ public class GriefPrevention extends JavaPlugin if (player.hasPlayedBefore() || player.isOnline()) { return player.getName(); - } else + } + else { return "someone(" + playerID.toString() + ")"; } @@ -3320,7 +3379,8 @@ public class GriefPrevention extends JavaPlugin if (player == null) { GriefPrevention.AddLogEntry(color + message); - } else + } + else { player.sendMessage(color + message); } @@ -3334,7 +3394,8 @@ public class GriefPrevention extends JavaPlugin if (delayInTicks > 0) { GriefPrevention.instance.getServer().getScheduler().runTaskLater(GriefPrevention.instance, task, delayInTicks); - } else + } + else { task.run(); } @@ -3384,7 +3445,8 @@ public class GriefPrevention extends JavaPlugin reason += " " + this.dataStore.getMessage(Messages.IgnoreClaimsAdvertisement); reason += " " + this.dataStore.getMessage(Messages.CreativeBasicsVideo2, DataStore.CREATIVE_VIDEO_URL); return reason; - } else + } + else { return null; } @@ -3439,7 +3501,8 @@ public class GriefPrevention extends JavaPlugin { return null; } - } else + } + else { //cache the claim for later reference playerData.lastClaim = claim; @@ -3545,7 +3608,8 @@ public class GriefPrevention extends JavaPlugin if (overrideValue == null || overrideValue == -1) { return world.getSeaLevel(); - } else + } + else { return overrideValue; } @@ -3633,7 +3697,8 @@ public class GriefPrevention extends JavaPlugin Bukkit.getServer().dispatchCommand( Bukkit.getConsoleSender(), GriefPrevention.instance.config_ban_commandFormat.replace("%name%", player.getName()).replace("%reason%", reason)); - } else + } + else { BanList bans = Bukkit.getServer().getBanList(Type.NAME); bans.addBan(player.getName(), reason, null, source); diff --git a/src/main/java/me/ryanhamshire/GriefPrevention/MaterialInfo.java b/src/main/java/me/ryanhamshire/GriefPrevention/MaterialInfo.java index e90f55f..98e6451 100644 --- a/src/main/java/me/ryanhamshire/GriefPrevention/MaterialInfo.java +++ b/src/main/java/me/ryanhamshire/GriefPrevention/MaterialInfo.java @@ -79,7 +79,8 @@ public class MaterialInfo { allDataValues = true; data = 0; - } else + } + else { allDataValues = false; data = Byte.parseByte(parts[1]); diff --git a/src/main/java/me/ryanhamshire/GriefPrevention/PlayerData.java b/src/main/java/me/ryanhamshire/GriefPrevention/PlayerData.java index d8fcb68..607abfd 100644 --- a/src/main/java/me/ryanhamshire/GriefPrevention/PlayerData.java +++ b/src/main/java/me/ryanhamshire/GriefPrevention/PlayerData.java @@ -223,7 +223,8 @@ public class PlayerData this.accruedClaimBlocks = GriefPrevention.instance.config_claims_initialBlocks; } - } else + } + else { this.accruedClaimBlocks = GriefPrevention.instance.config_claims_initialBlocks; } @@ -234,7 +235,8 @@ public class PlayerData if (storageData.bonusClaimBlocks != null) { this.bonusClaimBlocks = storageData.bonusClaimBlocks; - } else + } + else { this.bonusClaimBlocks = 0; } diff --git a/src/main/java/me/ryanhamshire/GriefPrevention/PlayerEventHandler.java b/src/main/java/me/ryanhamshire/GriefPrevention/PlayerEventHandler.java index 7e56983..c508987 100644 --- a/src/main/java/me/ryanhamshire/GriefPrevention/PlayerEventHandler.java +++ b/src/main/java/me/ryanhamshire/GriefPrevention/PlayerEventHandler.java @@ -167,7 +167,8 @@ class PlayerEventHandler implements Listener if (this.dataStore.isSoftMuted(recipient.getUniqueId())) { recipientsToKeep.add(recipient); - } else if (recipient.hasPermission("griefprevention.eavesdrop")) + } + else if (recipient.hasPermission("griefprevention.eavesdrop")) { recipient.sendMessage(ChatColor.GRAY + notificationMessage); } @@ -235,7 +236,8 @@ class PlayerEventHandler implements Listener if (playerData.ignoredPlayers.containsKey(recipient.getUniqueId())) { recipientsToRemove.add(recipient); - } else + } + else { PlayerData targetPlayerData = this.dataStore.getPlayerData(recipient.getUniqueId()); if (targetPlayerData.ignoredPlayers.containsKey(player.getUniqueId())) @@ -266,7 +268,8 @@ class PlayerEventHandler implements Listener if (instance.creativeRulesApply(player.getLocation())) { instance.sendMessage(player, TextMode.Info, Messages.CreativeBasicsVideo2, 10L, DataStore.CREATIVE_VIDEO_URL); - } else + } + else { instance.sendMessage(player, TextMode.Info, Messages.SurvivalBasicsVideo2, 10L, DataStore.SURVIVAL_VIDEO_URL); } @@ -323,7 +326,8 @@ class PlayerEventHandler implements Listener { instance.sendMessage(player, TextMode.Err, Messages.NoChatUntilMove, 10L); result.muteReason = "pre-movement chat"; - } else + } + else { playerData.noChatLocation = null; } @@ -350,7 +354,8 @@ class PlayerEventHandler implements Listener //kick and ban PlayerKickBanTask task = new PlayerKickBanTask(player, instance.config_spam_banMessage, "GriefPrevention Anti-Spam", true); instance.getServer().getScheduler().scheduleSyncDelayedTask(instance, task, 1L); - } else + } + else { //log entry instance.AddLogEntry("Kicking " + player.getName() + " for spam.", CustomLogEntryTypes.AdminActivity); @@ -359,7 +364,8 @@ class PlayerEventHandler implements Listener PlayerKickBanTask task = new PlayerKickBanTask(player, "", "GriefPrevention Anti-Spam", false); instance.getServer().getScheduler().scheduleSyncDelayedTask(instance, task, 1L); } - } else if (result.shouldWarnChatter) + } + else if (result.shouldWarnChatter) { //warn and log instance.sendMessage(player, TextMode.Warn, instance.config_spam_warningMessage, 10L); @@ -581,7 +587,8 @@ class PlayerEventHandler implements Listener if (instance.config_eavesdrop_whisperCommands.contains("/" + alias)) { category = CommandCategory.Whisper; - } else if (instance.config_spam_monitorSlashCommands.contains("/" + alias)) + } + else if (instance.config_spam_monitorSlashCommands.contains("/" + alias)) { category = CommandCategory.Chat; } @@ -919,7 +926,8 @@ class PlayerEventHandler implements Listener if (playerData.wasKicked) { isBanned = player.isBanned(); - } else + } + else { isBanned = false; } @@ -999,7 +1007,8 @@ class PlayerEventHandler implements Listener if (now - notificationTimestamp > ONE_MINUTE) { this.recentLoginLogoutNotifications.remove(i--); - } else + } + else { break; } @@ -1184,7 +1193,8 @@ class PlayerEventHandler implements Listener return; } } - } else //world repair code for a now-fixed GP bug //TODO: necessary anymore? + } + else //world repair code for a now-fixed GP bug //TODO: necessary anymore? { //ensure this entity can be tamed by players tameable.setOwner(null); @@ -1513,7 +1523,8 @@ class PlayerEventHandler implements Listener if (GriefPrevention.instance.pvpRulesApply(world)) { return GriefPrevention.instance.config_pvp_allowLavaNearPlayers; - } else + } + else { return GriefPrevention.instance.config_pvp_allowLavaNearPlayers_NonPvp; } @@ -1564,7 +1575,8 @@ class PlayerEventHandler implements Listener if (clickedBlock != null) { clickedBlockType = clickedBlock.getType(); - } else + } + else { clickedBlockType = Material.AIR; } @@ -1904,7 +1916,8 @@ class PlayerEventHandler implements Listener } return; - } else if (clickedBlock != null && ( + } + else if (clickedBlock != null && ( materialInHand == Material.OAK_BOAT || materialInHand == Material.SPRUCE_BOAT || materialInHand == Material.BIRCH_BOAT || @@ -2182,10 +2195,12 @@ class PlayerEventHandler implements Listener if (environment == Environment.NETHER) { allowedFillBlocks.add(Material.NETHERRACK); - } else if (environment == Environment.THE_END) + } + else if (environment == Environment.THE_END) { allowedFillBlocks.add(Material.END_STONE); - } else + } + else { allowedFillBlocks.add(Material.GRASS); allowedFillBlocks.add(Material.DIRT); @@ -2271,13 +2286,16 @@ class PlayerEventHandler implements Listener if (allowedFillBlocks.contains(eastBlock.getType())) { block.setType(eastBlock.getType()); - } else if (allowedFillBlocks.contains(westBlock.getType())) + } + else if (allowedFillBlocks.contains(westBlock.getType())) { block.setType(westBlock.getType()); - } else if (allowedFillBlocks.contains(northBlock.getType())) + } + else if (allowedFillBlocks.contains(northBlock.getType())) { block.setType(northBlock.getType()); - } else if (allowedFillBlocks.contains(southBlock.getType())) + } + else if (allowedFillBlocks.contains(southBlock.getType())) { block.setType(southBlock.getType()); } @@ -2313,7 +2331,8 @@ class PlayerEventHandler implements Listener if (playerData.lastShovelLocation.getBlockX() == playerData.claimResizing.getLesserBoundaryCorner().getBlockX()) { newx1 = clickedBlock.getX(); - } else + } + else { newx1 = playerData.claimResizing.getLesserBoundaryCorner().getBlockX(); } @@ -2321,7 +2340,8 @@ class PlayerEventHandler implements Listener if (playerData.lastShovelLocation.getBlockX() == playerData.claimResizing.getGreaterBoundaryCorner().getBlockX()) { newx2 = clickedBlock.getX(); - } else + } + else { newx2 = playerData.claimResizing.getGreaterBoundaryCorner().getBlockX(); } @@ -2329,7 +2349,8 @@ class PlayerEventHandler implements Listener if (playerData.lastShovelLocation.getBlockZ() == playerData.claimResizing.getLesserBoundaryCorner().getBlockZ()) { newz1 = clickedBlock.getZ(); - } else + } + else { newz1 = playerData.claimResizing.getLesserBoundaryCorner().getBlockZ(); } @@ -2337,7 +2358,8 @@ class PlayerEventHandler implements Listener if (playerData.lastShovelLocation.getBlockZ() == playerData.claimResizing.getGreaterBoundaryCorner().getBlockZ()) { newz2 = clickedBlock.getZ(); - } else + } + else { newz2 = playerData.claimResizing.getGreaterBoundaryCorner().getBlockZ(); } @@ -2563,7 +2585,8 @@ class PlayerEventHandler implements Listener instance.dataStore.tryAdvertiseAdminAlternatives(player); return; } - } else + } + else { playerID = null; } @@ -2591,7 +2614,8 @@ class PlayerEventHandler implements Listener Bukkit.getPluginManager().callEvent(new VisualizationEvent(player, result.claim)); Visualization.Apply(player, visualization); - } else + } + else { instance.sendMessage(player, TextMode.Err, Messages.CreateClaimFailOverlapRegion); } @@ -2656,7 +2680,8 @@ class PlayerEventHandler implements Listener { return cachedValue.booleanValue(); - } else + } + else { boolean isHolder = clickedBlock.getState() instanceof InventoryHolder; this.inventoryHolderCache.put(cacheKey, isHolder); diff --git a/src/main/java/me/ryanhamshire/GriefPrevention/PlayerKickBanTask.java b/src/main/java/me/ryanhamshire/GriefPrevention/PlayerKickBanTask.java index 68051e9..e6a60ed 100644 --- a/src/main/java/me/ryanhamshire/GriefPrevention/PlayerKickBanTask.java +++ b/src/main/java/me/ryanhamshire/GriefPrevention/PlayerKickBanTask.java @@ -62,7 +62,8 @@ class PlayerKickBanTask implements Runnable { //ban GriefPrevention.banPlayer(this.player, this.reason, this.source); - } else if (this.player.isOnline()) + } + else if (this.player.isOnline()) { this.player.kickPlayer(this.reason); } diff --git a/src/main/java/me/ryanhamshire/GriefPrevention/PlayerRescueTask.java b/src/main/java/me/ryanhamshire/GriefPrevention/PlayerRescueTask.java index ee1939d..eeaf352 100644 --- a/src/main/java/me/ryanhamshire/GriefPrevention/PlayerRescueTask.java +++ b/src/main/java/me/ryanhamshire/GriefPrevention/PlayerRescueTask.java @@ -63,7 +63,8 @@ class PlayerRescueTask implements Runnable if (this.destination == null) { this.destination = GriefPrevention.instance.ejectPlayer(this.player); - } else + } + else { player.teleport(this.destination); } diff --git a/src/main/java/me/ryanhamshire/GriefPrevention/PvPImmunityValidationTask.java b/src/main/java/me/ryanhamshire/GriefPrevention/PvPImmunityValidationTask.java index 0fc4fe7..43b2758 100644 --- a/src/main/java/me/ryanhamshire/GriefPrevention/PvPImmunityValidationTask.java +++ b/src/main/java/me/ryanhamshire/GriefPrevention/PvPImmunityValidationTask.java @@ -45,7 +45,8 @@ class PvPImmunityValidationTask implements Runnable //if found, cancel invulnerability and notify playerData.pvpImmune = false; GriefPrevention.sendMessage(player, TextMode.Warn, Messages.PvPImmunityEnd); - } else + } + else { //otherwise check again in one minute GriefPrevention.instance.getServer().getScheduler().scheduleSyncDelayedTask(GriefPrevention.instance, this, 1200L); diff --git a/src/main/java/me/ryanhamshire/GriefPrevention/RestoreNatureProcessingTask.java b/src/main/java/me/ryanhamshire/GriefPrevention/RestoreNatureProcessingTask.java index 338d7c8..6550132 100644 --- a/src/main/java/me/ryanhamshire/GriefPrevention/RestoreNatureProcessingTask.java +++ b/src/main/java/me/ryanhamshire/GriefPrevention/RestoreNatureProcessingTask.java @@ -217,7 +217,8 @@ class RestoreNatureProcessingTask implements Runnable underBlock.typeId == Material.SAND) { snapshots[x][y][z].typeId = Material.SAND; - } else + } + else { snapshots[x][y][z].typeId = Material.AIR; } @@ -441,7 +442,8 @@ class RestoreNatureProcessingTask implements Runnable if (this.biome == Biome.DESERT || this.biome == Biome.DESERT_HILLS || this.biome == Biome.BEACH) { this.snapshots[x][y][z].typeId = Material.SAND; - } else + } + else { this.snapshots[x][y][z].typeId = Material.GRASS_BLOCK; } diff --git a/src/main/java/me/ryanhamshire/GriefPrevention/SpamDetector.java b/src/main/java/me/ryanhamshire/GriefPrevention/SpamDetector.java index 0b8adbb..31359dd 100644 --- a/src/main/java/me/ryanhamshire/GriefPrevention/SpamDetector.java +++ b/src/main/java/me/ryanhamshire/GriefPrevention/SpamDetector.java @@ -57,7 +57,8 @@ class SpamDetector chatterData.spamLevel += ++this.duplicateMessageCount; spam = true; result.muteReason = "repeat message"; - } else + } + else { this.lastChatMessage = message; this.lastChatMessageTimestamp = timestamp; @@ -135,7 +136,8 @@ class SpamDetector if (chatterData.spamLevel > 8 && chatterData.spamWarned) { result.shouldBanChatter = true; - } else if (chatterData.spamLevel >= 4) + } + else if (chatterData.spamLevel >= 4) { if (!chatterData.spamWarned) { @@ -175,7 +177,8 @@ class SpamDetector { shorterString = lastMessage; longerString = message; - } else + } + else { shorterString = message; longerString = lastMessage; diff --git a/src/main/java/me/ryanhamshire/GriefPrevention/UUIDFetcher.java b/src/main/java/me/ryanhamshire/GriefPrevention/UUIDFetcher.java index 882a612..b14ac77 100644 --- a/src/main/java/me/ryanhamshire/GriefPrevention/UUIDFetcher.java +++ b/src/main/java/me/ryanhamshire/GriefPrevention/UUIDFetcher.java @@ -136,7 +136,8 @@ class UUIDFetcher GriefPrevention.AddLogEntry("Mojang says we're sending requests too fast. Will retry every 30 seconds until we succeed..."); Thread.sleep(30000); } - } else + } + else { throw e; } diff --git a/src/main/java/me/ryanhamshire/GriefPrevention/Visualization.java b/src/main/java/me/ryanhamshire/GriefPrevention/Visualization.java index 6263a91..bd6b14f 100644 --- a/src/main/java/me/ryanhamshire/GriefPrevention/Visualization.java +++ b/src/main/java/me/ryanhamshire/GriefPrevention/Visualization.java @@ -151,19 +151,23 @@ public class Visualization { cornerBlockData = Material.GLOWSTONE.createBlockData(); accentBlockData = Material.GOLD_BLOCK.createBlockData(); - } else if (visualizationType == VisualizationType.AdminClaim) + } + else if (visualizationType == VisualizationType.AdminClaim) { cornerBlockData = Material.GLOWSTONE.createBlockData(); accentBlockData = Material.PUMPKIN.createBlockData(); - } else if (visualizationType == VisualizationType.Subdivision) + } + else if (visualizationType == VisualizationType.Subdivision) { cornerBlockData = Material.IRON_BLOCK.createBlockData(); accentBlockData = Material.WHITE_WOOL.createBlockData(); - } else if (visualizationType == VisualizationType.RestoreNature) + } + else if (visualizationType == VisualizationType.RestoreNature) { cornerBlockData = Material.DIAMOND_BLOCK.createBlockData(); accentBlockData = Material.DIAMOND_BLOCK.createBlockData(); - } else + } + else { cornerBlockData = Material.REDSTONE_ORE.createBlockData(); ((Lightable) cornerBlockData).setLit(true); diff --git a/src/main/java/me/ryanhamshire/GriefPrevention/events/package-info.java b/src/main/java/me/ryanhamshire/GriefPrevention/events/package-info.java index 660665a..f28cc05 100644 --- a/src/main/java/me/ryanhamshire/GriefPrevention/events/package-info.java +++ b/src/main/java/me/ryanhamshire/GriefPrevention/events/package-info.java @@ -1,4 +1,5 @@ /** + * @author Ryan * @author Ryan */ /**