Added some missing stuff for MB World (#61)

* Added some missing stuff for MB World

* Fix isExecutive method
This commit is contained in:
Nathan Curran 2018-05-15 16:11:24 +10:00 committed by Seth
parent 6853baebdd
commit 7b1a8cb527
3 changed files with 16 additions and 8 deletions

View File

@ -1,8 +1,5 @@
package me.totalfreedom.totalfreedommod.fun;
import java.util.HashSet;
import java.util.Random;
import java.util.Set;
import me.totalfreedom.totalfreedommod.FreedomService;
import me.totalfreedom.totalfreedommod.TotalFreedomMod;
import me.totalfreedom.totalfreedommod.util.DepreciationAggregator;
@ -14,6 +11,10 @@ import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.player.PlayerMoveEvent;
import java.util.HashSet;
import java.util.Random;
import java.util.Set;
public class Trailer extends FreedomService
{
private final Random random = new Random();
@ -47,6 +48,11 @@ public class Trailer extends FreedomService
return;
}
if (event.getPlayer().getWorld().equals(plugin.wm.masterBuilderWorld.getWorld()))
{
return;
}
Block fromBlock = event.getFrom().getBlock();
if (!fromBlock.isEmpty())
{
@ -70,7 +76,8 @@ public class Trailer extends FreedomService
{
final Location trail_pos;
trail_pos = new Location(event.getPlayer().getWorld(), fromBlock.getX() + x, fromBlock.getY(), fromBlock.getZ() + z);
if (trailPlayers.contains(event.getPlayer().getName())) {
if (trailPlayers.contains(event.getPlayer().getName()))
{
plugin.cpb.getCoreProtectAPI().logPlacement(event.getPlayer().getName(), trail_pos, material, data);
}
}

View File

@ -9,10 +9,10 @@ import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.block.BlockBreakEvent;
import org.bukkit.event.block.BlockPlaceEvent;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.event.player.PlayerArmorStandManipulateEvent;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
import org.bukkit.event.player.PlayerArmorStandManipulateEvent;
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
import org.bukkit.event.player.PlayerInteractEvent;
import java.util.Arrays;
import java.util.List;
@ -21,7 +21,7 @@ public class MasterBuilderWorldRestrictions extends FreedomService
{
private final List<String> BLOCKED_WORLDEDIT_COMMANDS = Arrays.asList(
"green", "fixlava", "fixwater", "br", "brush", "tool", "mat", "range", "cs");
"green", "fixlava", "fixwater", "br", "brush", "tool", "mat", "range", "cs", "up", "fill", "setblock");
public MasterBuilderWorldRestrictions(TotalFreedomMod plugin)
{
@ -124,6 +124,7 @@ public class MasterBuilderWorldRestrictions extends FreedomService
if (plugin.al.isAdmin(player) && !plugin.al.isSeniorAdmin(player) && message.startsWith("/co"))
{
player.sendMessage(ChatColor.RED + "Only Senior Admins are allowed to use CoreProtect in the Master Builder world.");
event.setCancelled(true);
}
}
}

View File

@ -81,7 +81,7 @@ public class FUtil
public static boolean isExecutive(String name)
{
return (ConfigEntry.SERVER_OWNERS.getList().contains(name) || ConfigEntry.SERVER_EXECUTIVES.getList().contains(name));
return ConfigEntry.SERVER_OWNERS.getStringList().contains(name) || ConfigEntry.SERVER_EXECUTIVES.getStringList().contains(name);
}
public static void bcastMsg(String message, ChatColor color)