From 519b45680750a1afd5ca9ba0a1530a50e14a6e21 Mon Sep 17 00:00:00 2001 From: Telesphoreo Date: Thu, 26 Jul 2018 14:08:48 -0700 Subject: [PATCH] Update CoreProtect and masterbuilder restrictions (#100) * Update CoreProtect and masterbuilder restrictions * intellij is gay shit --- TotalFreedomMod.iml | 2 +- pom.xml | 8 ++++---- .../totalfreedom/totalfreedommod/TotalFreedomMod.java | 2 +- .../totalfreedommod/command/Command_gtfo.java | 5 ++--- .../totalfreedommod/command/Command_unban.java | 5 +++-- .../me/totalfreedom/totalfreedommod/fun/ItemFun.java | 4 ++-- .../totalfreedom/totalfreedommod/fun/MobStacker.java | 7 ++----- .../me/totalfreedom/totalfreedommod/fun/Trailer.java | 8 ++++---- .../totalfreedommod/util/MaterialGroup.java | 1 + .../totalfreedommod/world/WorldManager.java | 11 +++++------ 10 files changed, 25 insertions(+), 28 deletions(-) diff --git a/TotalFreedomMod.iml b/TotalFreedomMod.iml index 09afee94..02f904d0 100644 --- a/TotalFreedomMod.iml +++ b/TotalFreedomMod.iml @@ -57,7 +57,7 @@ - + \ No newline at end of file diff --git a/pom.xml b/pom.xml index a3b7404e..aa3ce278 100644 --- a/pom.xml +++ b/pom.xml @@ -76,8 +76,8 @@ - robomwm - https://dl.bintray.com/robomwm/maven + playpro + https://maven.playpro.com/ @@ -162,8 +162,8 @@ net.coreprotect - CoreProtect - 2.14.2 + coreprotect + 2.15.0 provided diff --git a/src/main/java/me/totalfreedom/totalfreedommod/TotalFreedomMod.java b/src/main/java/me/totalfreedom/totalfreedommod/TotalFreedomMod.java index b873cf36..772e3076 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/TotalFreedomMod.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/TotalFreedomMod.java @@ -176,7 +176,7 @@ public class TotalFreedomMod extends AeroPlugin nu = services.registerService(AntiNuke.class); as = services.registerService(AntiSpam.class); mbl = services.registerService(MasterBuilderList.class); - //mbwr = services.registerService(MasterBuilderWorldRestrictions.class); + mbwr = services.registerService(MasterBuilderWorldRestrictions.class); pl = services.registerService(PlayerList.class); an = services.registerService(Announcer.class); diff --git a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_gtfo.java b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_gtfo.java index 93c0a63e..be6ba5a1 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_gtfo.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_gtfo.java @@ -56,7 +56,7 @@ public class Command_gtfo extends FreedomCommand // Deop player.setOp(false); - // Gamemode suvival + // Gamemode survival player.setGameMode(GameMode.SURVIVAL); // Clear inventory @@ -95,7 +95,7 @@ public class Command_gtfo extends FreedomCommand } } - //checks if there is CoreProtect loaded and installed, if not it skips the rollback and uses CoreProtect directly + // Checks if CoreProtect is loaded and installed, and skips the rollback and uses CoreProtect directly if (!cancelRollback) { if (!plugin.cpb.isEnabled()) @@ -111,7 +111,6 @@ public class Command_gtfo extends FreedomCommand // Rollback plugin.rb.rollback(username); - } else { diff --git a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_unban.java b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_unban.java index 15bb13d7..e3acfa14 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_unban.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_unban.java @@ -1,7 +1,5 @@ package me.totalfreedom.totalfreedommod.command; -import java.util.ArrayList; -import java.util.List; import me.totalfreedom.totalfreedommod.banning.Ban; import me.totalfreedom.totalfreedommod.player.PlayerData; import me.totalfreedom.totalfreedommod.rank.Rank; @@ -11,6 +9,9 @@ import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; +import java.util.ArrayList; +import java.util.List; + @CommandPermissions(level = Rank.SUPER_ADMIN, source = SourceType.BOTH) @CommandParameters(description = "Unbans a player", usage = "/ ") public class Command_unban extends FreedomCommand diff --git a/src/main/java/me/totalfreedom/totalfreedommod/fun/ItemFun.java b/src/main/java/me/totalfreedom/totalfreedommod/fun/ItemFun.java index 31c26ba7..86d933d0 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/fun/ItemFun.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/fun/ItemFun.java @@ -139,7 +139,7 @@ public class ItemFun extends FreedomService Location location = player.getLocation().clone(); - Vector playerPostion = location.toVector().add(new Vector(0.0, 1.65, 0.0)); + Vector playerPosition = location.toVector().add(new Vector(0.0, 1.65, 0.0)); Vector playerDirection = location.getDirection().normalize(); double distance = 150.0; @@ -154,7 +154,7 @@ public class ItemFun extends FreedomService Block lastBlock = null; for (double offset = 0.0; offset <= distance; offset += (distance / 25.0)) { - Block block = playerPostion.clone().add(playerDirection.clone().multiply(offset)).toLocation(player.getWorld()).getBlock(); + Block block = playerPosition.clone().add(playerDirection.clone().multiply(offset)).toLocation(player.getWorld()).getBlock(); if (!block.equals(lastBlock)) { diff --git a/src/main/java/me/totalfreedom/totalfreedommod/fun/MobStacker.java b/src/main/java/me/totalfreedom/totalfreedommod/fun/MobStacker.java index 5ee65521..caa49ad5 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/fun/MobStacker.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/fun/MobStacker.java @@ -3,10 +3,10 @@ package me.totalfreedom.totalfreedommod.fun; import me.totalfreedom.totalfreedommod.FreedomService; import me.totalfreedom.totalfreedommod.TotalFreedomMod; import org.bukkit.Material; +import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.entity.EntityDamageByEntityEvent; -import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; public class MobStacker extends FreedomService @@ -35,7 +35,7 @@ public class MobStacker extends FreedomService return; } - Player attacker = (Player)event.getDamager(); + Player attacker = (Player) event.getDamager(); if (!plugin.al.isAdmin(attacker)) { @@ -49,8 +49,5 @@ public class MobStacker extends FreedomService event.setCancelled(true); attacker.addPassenger(event.getEntity()); } - - } - } diff --git a/src/main/java/me/totalfreedom/totalfreedommod/fun/Trailer.java b/src/main/java/me/totalfreedom/totalfreedommod/fun/Trailer.java index b036062d..0b25c654 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/fun/Trailer.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/fun/Trailer.java @@ -48,10 +48,10 @@ public class Trailer extends FreedomService return; } - //if (event.getPlayer().getWorld().equals(plugin.wm.masterBuilderWorld.getWorld())) - //{ - // return; - //} + if (event.getPlayer().getWorld().equals(plugin.wm.masterBuilderWorld.getWorld())) + { + return; + } Block fromBlock = event.getFrom().getBlock(); if (!fromBlock.isEmpty()) diff --git a/src/main/java/me/totalfreedom/totalfreedommod/util/MaterialGroup.java b/src/main/java/me/totalfreedom/totalfreedommod/util/MaterialGroup.java index 2ce46908..d8ae8953 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/util/MaterialGroup.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/util/MaterialGroup.java @@ -1,6 +1,7 @@ package me.totalfreedom.totalfreedommod.util; import org.bukkit.Material; + import java.util.Arrays; import java.util.List; diff --git a/src/main/java/me/totalfreedom/totalfreedommod/world/WorldManager.java b/src/main/java/me/totalfreedom/totalfreedommod/world/WorldManager.java index 5850950c..e4d0152e 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/world/WorldManager.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/world/WorldManager.java @@ -36,10 +36,9 @@ public class WorldManager extends FreedomService @Override protected void onStart() { - // Disabled temporarily flatlands.getWorld(); - //adminworld.getWorld(); - //masterBuilderWorld.getWorld(); + adminworld.getWorld(); + masterBuilderWorld.getWorld(); // Disable weather if (ConfigEntry.DISABLE_WEATHER.getBoolean()) @@ -57,9 +56,9 @@ public class WorldManager extends FreedomService @Override protected void onStop() { - //flatlands.getWorld().save(); - //adminworld.getWorld().save(); - //masterBuilderWorld.getWorld().save(); + flatlands.getWorld().save(); + adminworld.getWorld().save(); + masterBuilderWorld.getWorld().save(); } @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)