mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2024-12-22 09:08:03 +01:00
Removed Util#sendMessage and Util#sendEnterExit
They will be replaced soon
This commit is contained in:
parent
71bbde1687
commit
02c72d9506
@ -623,10 +623,10 @@ public class IslandsManager {
|
|||||||
//home.getChunk().load();
|
//home.getChunk().load();
|
||||||
player.teleport(home);
|
player.teleport(home);
|
||||||
//player.sendBlockChange(home, Material.GLOWSTONE, (byte)0);
|
//player.sendBlockChange(home, Material.GLOWSTONE, (byte)0);
|
||||||
if (number ==1 ) {
|
if (number == 1) {
|
||||||
Util.sendMessage(player, ChatColor.GREEN + plugin.getLocale(player.getUniqueId()).get("island.teleport").replace("[label]", Settings.ISLANDCOMMAND));
|
player.sendMessage(plugin.getLocale(player.getUniqueId()).get("island.teleport").replace("[label]", Settings.ISLANDCOMMAND));
|
||||||
} else {
|
} else {
|
||||||
Util.sendMessage(player, ChatColor.GREEN + plugin.getLocale(player.getUniqueId()).get("island.teleported").replace("[number]", String.valueOf(number)));
|
player.sendMessage(plugin.getLocale(player.getUniqueId()).get("island.teleported").replace("[number]", String.valueOf(number)));
|
||||||
}
|
}
|
||||||
// Exit spectator mode if in it
|
// Exit spectator mode if in it
|
||||||
if (player.getGameMode().equals(GameMode.SPECTATOR)) {
|
if (player.getGameMode().equals(GameMode.SPECTATOR)) {
|
||||||
@ -853,7 +853,6 @@ public class IslandsManager {
|
|||||||
* This removes players from an island overworld and nether - used when reseting or deleting an island
|
* This removes players from an island overworld and nether - used when reseting or deleting an island
|
||||||
* Mobs are killed when the chunks are refreshed.
|
* Mobs are killed when the chunks are refreshed.
|
||||||
* @param island to remove players from
|
* @param island to remove players from
|
||||||
* @param uuid
|
|
||||||
*/
|
*/
|
||||||
public void removePlayersFromIsland(final Island island) {
|
public void removePlayersFromIsland(final Island island) {
|
||||||
// Teleport players away
|
// Teleport players away
|
||||||
@ -931,7 +930,6 @@ public class IslandsManager {
|
|||||||
/**
|
/**
|
||||||
* Puts a player in a team. Removes them from their old island if required.
|
* Puts a player in a team. Removes them from their old island if required.
|
||||||
* @param playerUUID
|
* @param playerUUID
|
||||||
* @param teamLeader
|
|
||||||
* @return true if successful, false if not
|
* @return true if successful, false if not
|
||||||
*/
|
*/
|
||||||
public boolean setJoinTeam(Island teamIsland, UUID playerUUID) {
|
public boolean setJoinTeam(Island teamIsland, UUID playerUUID) {
|
||||||
|
@ -77,7 +77,7 @@ public class JoinLeaveListener implements Listener {
|
|||||||
&& !VaultHelper.hasPerm(player, Settings.PERMPREFIX + "mod.bypassprotect")) {
|
&& !VaultHelper.hasPerm(player, Settings.PERMPREFIX + "mod.bypassprotect")) {
|
||||||
if (DEBUG)
|
if (DEBUG)
|
||||||
plugin.getLogger().info("DEBUG: No bypass - teleporting");
|
plugin.getLogger().info("DEBUG: No bypass - teleporting");
|
||||||
Util.sendMessage(player, plugin.getLocale(player.getUniqueId()).get("locked.islandlocked"));
|
player.sendMessage(plugin.getLocale(player).get("locked.islandlocked"));
|
||||||
plugin.getIslands().homeTeleport(player);
|
plugin.getIslands().homeTeleport(player);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -119,7 +119,7 @@ public class NetherPortals implements Listener {
|
|||||||
if (DEBUG)
|
if (DEBUG)
|
||||||
plugin.getLogger().info("DEBUG: Portal use not allowed");
|
plugin.getLogger().info("DEBUG: Portal use not allowed");
|
||||||
if (!event.getPlayer().isOp() && !VaultHelper.hasPerm(event.getPlayer(), Settings.PERMPREFIX + "mod.bypassprotect")) {
|
if (!event.getPlayer().isOp() && !VaultHelper.hasPerm(event.getPlayer(), Settings.PERMPREFIX + "mod.bypassprotect")) {
|
||||||
Util.sendMessage(event.getPlayer(), plugin.getLocale(event.getPlayer().getUniqueId()).get("island.protected"));
|
event.getPlayer().sendMessage(plugin.getLocale(event.getPlayer()).get("island.protected"));
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -141,7 +141,7 @@ public class NetherPortals implements Listener {
|
|||||||
// end_place.getBlock().getType(),end_place.getBlock().getData());
|
// end_place.getBlock().getType(),end_place.getBlock().getData());
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
Util.sendMessage(event.getPlayer(), plugin.getLocale(event.getPlayer().getUniqueId()).get("warps.error.NotSafe"));
|
event.getPlayer().sendMessage(plugin.getLocale(event.getPlayer()).get("warps.error.NotSafe"));
|
||||||
plugin.getIslands().homeTeleport(event.getPlayer());
|
plugin.getIslands().homeTeleport(event.getPlayer());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -121,7 +121,7 @@ public class IslandGuard implements Listener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Elsewhere - not allowed
|
// Elsewhere - not allowed
|
||||||
Util.sendMessage(event.getWhoClicked(), plugin.getLocale(event.getWhoClicked().getUniqueId()).get("island.protected"));
|
event.getWhoClicked().sendMessage(plugin.getLocale(event.getWhoClicked().getUniqueId()).get("island.protected"));
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -184,7 +184,7 @@ public class IslandGuard implements Listener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Not allowed
|
// Not allowed
|
||||||
Util.sendMessage(p, plugin.getLocale(p.getUniqueId()).get("island.protected"));
|
p.sendMessage(plugin.getLocale(p.getUniqueId()).get("island.protected"));
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -229,7 +229,7 @@ public class IslandGuard implements Listener {
|
|||||||
if (!islandTo.getMembers().contains(player.getUniqueId()) && !player.isOp()
|
if (!islandTo.getMembers().contains(player.getUniqueId()) && !player.isOp()
|
||||||
&& !VaultHelper.hasPerm(player, Settings.PERMPREFIX + "mod.bypassprotect")
|
&& !VaultHelper.hasPerm(player, Settings.PERMPREFIX + "mod.bypassprotect")
|
||||||
&& !VaultHelper.hasPerm(player, Settings.PERMPREFIX + "mod.bypasslock")) {
|
&& !VaultHelper.hasPerm(player, Settings.PERMPREFIX + "mod.bypasslock")) {
|
||||||
Util.sendMessage(player, plugin.getLocale(player.getUniqueId()).get("lock.islandlocked"));
|
player.sendMessage(plugin.getLocale(player.getUniqueId()).get("lock.islandlocked"));
|
||||||
// Get the vector away from this island
|
// Get the vector away from this island
|
||||||
Vector v = e.getVehicle().getLocation().toVector().subtract(islandTo.getCenter().toVector()).normalize().multiply(new Vector(1.2,0,1.2));
|
Vector v = e.getVehicle().getLocation().toVector().subtract(islandTo.getCenter().toVector()).normalize().multiply(new Vector(1.2,0,1.2));
|
||||||
if (DEBUG)
|
if (DEBUG)
|
||||||
@ -244,13 +244,13 @@ public class IslandGuard implements Listener {
|
|||||||
if (islandTo.isSpawn()) {
|
if (islandTo.isSpawn()) {
|
||||||
if (!plugin.getLocale(player.getUniqueId()).get("lock.enteringspawn").isEmpty()) {
|
if (!plugin.getLocale(player.getUniqueId()).get("lock.enteringspawn").isEmpty()) {
|
||||||
if(islandTo.getFlag(SettingsFlag.ENTER_EXIT_MESSAGES)) {
|
if(islandTo.getFlag(SettingsFlag.ENTER_EXIT_MESSAGES)) {
|
||||||
Util.sendEnterExit(player, plugin.getLocale(player.getUniqueId()).get("lock.enteringspawn"));
|
player.sendMessage(plugin.getLocale(player).get("lock.enteringspawn"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!plugin.getLocale(player.getUniqueId()).get("lock.nowentering").isEmpty()) {
|
if (!plugin.getLocale(player.getUniqueId()).get("lock.nowentering").isEmpty()) {
|
||||||
if(islandTo.getFlag(SettingsFlag.ENTER_EXIT_MESSAGES)) {
|
if(islandTo.getFlag(SettingsFlag.ENTER_EXIT_MESSAGES)) {
|
||||||
Util.sendEnterExit(player, plugin.getLocale(player.getUniqueId()).get("lock.nowentering").replace("[name]", plugin.getIslands().getIslandName(islandTo.getOwner())));
|
player.sendMessage(plugin.getLocale(player).get("lock.nowentering").replace("[name]", plugin.getIslands().getIslandName(islandTo.getOwner())));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -260,13 +260,13 @@ public class IslandGuard implements Listener {
|
|||||||
// Leaving
|
// Leaving
|
||||||
if (!plugin.getLocale(player.getUniqueId()).get("lock.leavingspawn").isEmpty()) {
|
if (!plugin.getLocale(player.getUniqueId()).get("lock.leavingspawn").isEmpty()) {
|
||||||
if(islandFrom.getFlag(SettingsFlag.ENTER_EXIT_MESSAGES)) {
|
if(islandFrom.getFlag(SettingsFlag.ENTER_EXIT_MESSAGES)) {
|
||||||
Util.sendEnterExit(player, plugin.getLocale(player.getUniqueId()).get("lock.leavingspawn"));
|
player.sendMessage(plugin.getLocale(player.getUniqueId()).get("lock.leavingspawn"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!plugin.getLocale(player.getUniqueId()).get("lock.nowleaving").isEmpty()) {
|
if (!plugin.getLocale(player.getUniqueId()).get("lock.nowleaving").isEmpty()) {
|
||||||
if(islandFrom.getFlag(SettingsFlag.ENTER_EXIT_MESSAGES)) {
|
if(islandFrom.getFlag(SettingsFlag.ENTER_EXIT_MESSAGES)) {
|
||||||
Util.sendEnterExit(player, plugin.getLocale(player.getUniqueId()).get("lock.nowleaving").replace("[name]", plugin.getIslands().getIslandName(islandFrom.getOwner())));
|
player.sendMessage(plugin.getLocale(player.getUniqueId()).get("lock.nowleaving").replace("[name]", plugin.getIslands().getIslandName(islandFrom.getOwner())));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -276,26 +276,26 @@ public class IslandGuard implements Listener {
|
|||||||
// Leaving
|
// Leaving
|
||||||
if (!plugin.getLocale(player.getUniqueId()).get("lock.leavingspawn").isEmpty()) {
|
if (!plugin.getLocale(player.getUniqueId()).get("lock.leavingspawn").isEmpty()) {
|
||||||
if(islandFrom.getFlag(SettingsFlag.ENTER_EXIT_MESSAGES)) {
|
if(islandFrom.getFlag(SettingsFlag.ENTER_EXIT_MESSAGES)) {
|
||||||
Util.sendEnterExit(player, plugin.getLocale(player.getUniqueId()).get("lock.leavingspawn"));
|
player.sendMessage(plugin.getLocale(player).get("lock.leavingspawn"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (islandFrom.getOwner() != null){
|
} else if (islandFrom.getOwner() != null){
|
||||||
if (!plugin.getLocale(player.getUniqueId()).get("lock.nowleaving").isEmpty()) {
|
if (!plugin.getLocale(player.getUniqueId()).get("lock.nowleaving").isEmpty()) {
|
||||||
if(islandFrom.getFlag(SettingsFlag.ENTER_EXIT_MESSAGES)) {
|
if(islandFrom.getFlag(SettingsFlag.ENTER_EXIT_MESSAGES)) {
|
||||||
Util.sendEnterExit(player, plugin.getLocale(player.getUniqueId()).get("lock.nowleaving").replace("[name]", plugin.getIslands().getIslandName(islandFrom.getOwner())));
|
player.sendMessage(plugin.getLocale(player).get("lock.nowleaving").replace("[name]", plugin.getIslands().getIslandName(islandFrom.getOwner())));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (islandTo.isSpawn()) {
|
if (islandTo.isSpawn()) {
|
||||||
if (!plugin.getLocale(player.getUniqueId()).get("lock.enteringspawn").isEmpty()) {
|
if (!plugin.getLocale(player.getUniqueId()).get("lock.enteringspawn").isEmpty()) {
|
||||||
if(islandTo.getFlag(SettingsFlag.ENTER_EXIT_MESSAGES)) {
|
if(islandTo.getFlag(SettingsFlag.ENTER_EXIT_MESSAGES)) {
|
||||||
Util.sendEnterExit(player, plugin.getLocale(player.getUniqueId()).get("lock.enteringspawn"));
|
player.sendMessage(plugin.getLocale(player).get("lock.enteringspawn"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (islandTo.getOwner() != null) {
|
} else if (islandTo.getOwner() != null) {
|
||||||
if (!plugin.getLocale(player.getUniqueId()).get("lock.nowentering").isEmpty()) {
|
if (!plugin.getLocale(player.getUniqueId()).get("lock.nowentering").isEmpty()) {
|
||||||
if(islandTo.getFlag(SettingsFlag.ENTER_EXIT_MESSAGES)) {
|
if(islandTo.getFlag(SettingsFlag.ENTER_EXIT_MESSAGES)) {
|
||||||
Util.sendEnterExit(player, plugin.getLocale(player.getUniqueId()).get("lock.nowentering").replace("[name]", plugin.getIslands().getIslandName(islandTo.getOwner())));
|
player.sendMessage(plugin.getLocale(player).get("lock.nowentering").replace("[name]", plugin.getIslands().getIslandName(islandTo.getOwner())));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -343,7 +343,7 @@ public class IslandGuard implements Listener {
|
|||||||
if (!islandTo.getMembers().contains(e.getPlayer().getUniqueId()) && !e.getPlayer().isOp()
|
if (!islandTo.getMembers().contains(e.getPlayer().getUniqueId()) && !e.getPlayer().isOp()
|
||||||
&& !VaultHelper.hasPerm(e.getPlayer(), Settings.PERMPREFIX + "mod.bypassprotect")
|
&& !VaultHelper.hasPerm(e.getPlayer(), Settings.PERMPREFIX + "mod.bypassprotect")
|
||||||
&& !VaultHelper.hasPerm(e.getPlayer(), Settings.PERMPREFIX + "mod.bypasslock")) {
|
&& !VaultHelper.hasPerm(e.getPlayer(), Settings.PERMPREFIX + "mod.bypasslock")) {
|
||||||
Util.sendMessage(e.getPlayer(), plugin.getLocale(e.getPlayer().getUniqueId()).get("lock.islandlocked"));
|
e.getPlayer().sendMessage(plugin.getLocale(e.getPlayer().getUniqueId()).get("lock.islandlocked"));
|
||||||
|
|
||||||
// Get the vector away from this island
|
// Get the vector away from this island
|
||||||
if (e.getPlayer().isInsideVehicle()) {
|
if (e.getPlayer().isInsideVehicle()) {
|
||||||
@ -367,18 +367,18 @@ public class IslandGuard implements Listener {
|
|||||||
if (islandTo != null && islandFrom == null && (islandTo.getOwner() != null || islandTo.isSpawn())) {
|
if (islandTo != null && islandFrom == null && (islandTo.getOwner() != null || islandTo.isSpawn())) {
|
||||||
// Entering
|
// Entering
|
||||||
if (islandTo.isLocked() || plugin.getPlayers().isBanned(islandTo.getOwner(),e.getPlayer().getUniqueId())) {
|
if (islandTo.isLocked() || plugin.getPlayers().isBanned(islandTo.getOwner(),e.getPlayer().getUniqueId())) {
|
||||||
Util.sendMessage(e.getPlayer(), plugin.getLocale(e.getPlayer().getUniqueId()).get("lock.islandlocked"));
|
e.getPlayer().sendMessage(plugin.getLocale(e.getPlayer()).get("lock.islandlocked"));
|
||||||
}
|
}
|
||||||
if (islandTo.isSpawn()) {
|
if (islandTo.isSpawn()) {
|
||||||
if (!plugin.getLocale(e.getPlayer().getUniqueId()).get("lock.enteringspawn").isEmpty()) {
|
if (!plugin.getLocale(e.getPlayer().getUniqueId()).get("lock.enteringspawn").isEmpty()) {
|
||||||
if(islandTo.getFlag(SettingsFlag.ENTER_EXIT_MESSAGES)) {
|
if(islandTo.getFlag(SettingsFlag.ENTER_EXIT_MESSAGES)) {
|
||||||
Util.sendEnterExit(e.getPlayer(), plugin.getLocale(e.getPlayer().getUniqueId()).get("lock.enteringspawn"));
|
e.getPlayer().sendMessage(plugin.getLocale(e.getPlayer()).get("lock.enteringspawn"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!plugin.getLocale(e.getPlayer().getUniqueId()).get("lock.nowentering").isEmpty()) {
|
if (!plugin.getLocale(e.getPlayer().getUniqueId()).get("lock.nowentering").isEmpty()) {
|
||||||
if(islandTo.getFlag(SettingsFlag.ENTER_EXIT_MESSAGES)) {
|
if(islandTo.getFlag(SettingsFlag.ENTER_EXIT_MESSAGES)) {
|
||||||
Util.sendEnterExit(e.getPlayer(), plugin.getLocale(e.getPlayer().getUniqueId()).get("lock.nowentering").replace("[name]", plugin.getIslands().getIslandName(islandTo.getOwner())));
|
e.getPlayer().sendMessage(plugin.getLocale(e.getPlayer()).get("lock.nowentering").replace("[name]", plugin.getIslands().getIslandName(islandTo.getOwner())));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -395,11 +395,12 @@ public class IslandGuard implements Listener {
|
|||||||
if (islandFrom.isSpawn()) {
|
if (islandFrom.isSpawn()) {
|
||||||
// Leaving
|
// Leaving
|
||||||
if(islandFrom.getFlag(SettingsFlag.ENTER_EXIT_MESSAGES)) {
|
if(islandFrom.getFlag(SettingsFlag.ENTER_EXIT_MESSAGES)) {
|
||||||
Util.sendEnterExit(e.getPlayer(), plugin.getLocale(e.getPlayer().getUniqueId()).get("lock.leavingspawn"));
|
e.getPlayer().sendMessage(plugin.getLocale(e.getPlayer()).get("lock.leavingspawn"));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if(islandFrom.getFlag(SettingsFlag.ENTER_EXIT_MESSAGES)) {
|
if(islandFrom.getFlag(SettingsFlag.ENTER_EXIT_MESSAGES)) {
|
||||||
Util.sendEnterExit(e.getPlayer(), plugin.getLocale(e.getPlayer().getUniqueId()).get("lock.nowleaving").replace("[name]", plugin.getIslands().getIslandName(islandFrom.getOwner()))); }
|
e.getPlayer().sendMessage(plugin.getLocale(e.getPlayer()).get("lock.nowleaving").replace("[name]", plugin.getIslands().getIslandName(islandFrom.getOwner())));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// Fire exit event
|
// Fire exit event
|
||||||
final IslandEvent event = IslandEvent.builder()
|
final IslandEvent event = IslandEvent.builder()
|
||||||
@ -414,20 +415,20 @@ public class IslandGuard implements Listener {
|
|||||||
if (islandFrom.isSpawn()) {
|
if (islandFrom.isSpawn()) {
|
||||||
// Leaving
|
// Leaving
|
||||||
if(islandFrom.getFlag(SettingsFlag.ENTER_EXIT_MESSAGES)) {
|
if(islandFrom.getFlag(SettingsFlag.ENTER_EXIT_MESSAGES)) {
|
||||||
Util.sendEnterExit(e.getPlayer(), plugin.getLocale(e.getPlayer().getUniqueId()).get("lock.leavingspawn"));
|
e.getPlayer().sendMessage(plugin.getLocale(e.getPlayer()).get("lock.leavingspawn"));
|
||||||
}
|
}
|
||||||
} else if (islandFrom.getOwner() != null) {
|
} else if (islandFrom.getOwner() != null) {
|
||||||
if(islandFrom.getFlag(SettingsFlag.ENTER_EXIT_MESSAGES)) {
|
if(islandFrom.getFlag(SettingsFlag.ENTER_EXIT_MESSAGES)) {
|
||||||
Util.sendEnterExit(e.getPlayer(), plugin.getLocale(e.getPlayer().getUniqueId()).get("lock.nowleaving").replace("[name]", plugin.getIslands().getIslandName(islandFrom.getOwner())));
|
e.getPlayer().sendMessage(plugin.getLocale(e.getPlayer()).get("lock.nowleaving").replace("[name]", plugin.getIslands().getIslandName(islandFrom.getOwner())));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (islandTo.isSpawn()) {
|
if (islandTo.isSpawn()) {
|
||||||
if(islandTo.getFlag(SettingsFlag.ENTER_EXIT_MESSAGES)) {
|
if(islandTo.getFlag(SettingsFlag.ENTER_EXIT_MESSAGES)) {
|
||||||
Util.sendEnterExit(e.getPlayer(), plugin.getLocale(e.getPlayer().getUniqueId()).get("lock.enteringspawn"));
|
e.getPlayer().sendMessage(plugin.getLocale(e.getPlayer()).get("lock.enteringspawn"));
|
||||||
}
|
}
|
||||||
} else if (islandTo.getOwner() != null) {
|
} else if (islandTo.getOwner() != null) {
|
||||||
if(islandTo.getFlag(SettingsFlag.ENTER_EXIT_MESSAGES)) {
|
if(islandTo.getFlag(SettingsFlag.ENTER_EXIT_MESSAGES)) {
|
||||||
Util.sendEnterExit(e.getPlayer(), plugin.getLocale(e.getPlayer().getUniqueId()).get("lock.nowentering").replace("[name]", plugin.getIslands().getIslandName(islandTo.getOwner())));
|
e.getPlayer().sendMessage(plugin.getLocale(e.getPlayer().getUniqueId()).get("lock.nowentering").replace("[name]", plugin.getIslands().getIslandName(islandTo.getOwner())));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Fire exit event
|
// Fire exit event
|
||||||
@ -705,7 +706,7 @@ public class IslandGuard implements Listener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Everyone else - not allowed
|
// Everyone else - not allowed
|
||||||
Util.sendMessage(e.getPlayer(), plugin.getLocale(e.getPlayer().getUniqueId()).get("island.protected"));
|
e.getPlayer().sendMessage(plugin.getLocale(e.getPlayer()).get("island.protected"));
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -876,7 +877,7 @@ public class IslandGuard implements Listener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Else not allowed
|
// Else not allowed
|
||||||
Util.sendMessage(attacker, plugin.getLocale(attacker.getUniqueId()).get("island.protected"));
|
attacker.sendMessage(plugin.getLocale(attacker).get("island.protected"));
|
||||||
if (flamingArrow)
|
if (flamingArrow)
|
||||||
e.getEntity().setFireTicks(0);
|
e.getEntity().setFireTicks(0);
|
||||||
if (projectile)
|
if (projectile)
|
||||||
@ -907,7 +908,7 @@ public class IslandGuard implements Listener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Not allowed
|
// Not allowed
|
||||||
Util.sendMessage(attacker, plugin.getLocale(attacker.getUniqueId()).get("island.protected"));
|
attacker.sendMessage(plugin.getLocale(attacker).get("island.protected"));
|
||||||
if (flamingArrow)
|
if (flamingArrow)
|
||||||
e.getEntity().setFireTicks(0);
|
e.getEntity().setFireTicks(0);
|
||||||
if (projectile)
|
if (projectile)
|
||||||
@ -925,7 +926,7 @@ public class IslandGuard implements Listener {
|
|||||||
if (DEBUG)
|
if (DEBUG)
|
||||||
plugin.getLogger().info("DEBUG: Mobs not allowed to be hurt. Blocking");
|
plugin.getLogger().info("DEBUG: Mobs not allowed to be hurt. Blocking");
|
||||||
// Else not allowed
|
// Else not allowed
|
||||||
Util.sendMessage(attacker, plugin.getLocale(attacker.getUniqueId()).get("island.protected"));
|
attacker.sendMessage(plugin.getLocale(attacker).get("island.protected"));
|
||||||
if (flamingArrow)
|
if (flamingArrow)
|
||||||
e.getEntity().setFireTicks(0);
|
e.getEntity().setFireTicks(0);
|
||||||
if (projectile)
|
if (projectile)
|
||||||
@ -944,7 +945,7 @@ public class IslandGuard implements Listener {
|
|||||||
// Players being hurt PvP
|
// Players being hurt PvP
|
||||||
if (e.getEntity() instanceof Player) {
|
if (e.getEntity() instanceof Player) {
|
||||||
if (!pvp) {
|
if (!pvp) {
|
||||||
Util.sendMessage(attacker, plugin.getLocale(attacker.getUniqueId()).get("targetInPVPArea"));
|
attacker.sendMessage(plugin.getLocale(attacker).get("targetInPVPArea"));
|
||||||
if (flamingArrow)
|
if (flamingArrow)
|
||||||
e.getEntity().setFireTicks(0);
|
e.getEntity().setFireTicks(0);
|
||||||
if (projectile)
|
if (projectile)
|
||||||
@ -984,7 +985,7 @@ public class IslandGuard implements Listener {
|
|||||||
// Outside of island protection zone
|
// Outside of island protection zone
|
||||||
if (island == null) {
|
if (island == null) {
|
||||||
if (!Settings.defaultWorldSettings.get(SettingsFlag.PLACE_BLOCKS)) {
|
if (!Settings.defaultWorldSettings.get(SettingsFlag.PLACE_BLOCKS)) {
|
||||||
Util.sendMessage(e.getPlayer(), plugin.getLocale(e.getPlayer().getUniqueId()).get("island.protected"));
|
e.getPlayer().sendMessage(plugin.getLocale(e.getPlayer()).get("island.protected"));
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
@ -1006,7 +1007,7 @@ public class IslandGuard implements Listener {
|
|||||||
int count = island.getTileEntityCount(e.getBlock().getType(),e.getBlock().getWorld());
|
int count = island.getTileEntityCount(e.getBlock().getType(),e.getBlock().getWorld());
|
||||||
//plugin.getLogger().info("DEBUG: count is "+ count);
|
//plugin.getLogger().info("DEBUG: count is "+ count);
|
||||||
if (Settings.limitedBlocks.get(type) <= count) {
|
if (Settings.limitedBlocks.get(type) <= count) {
|
||||||
Util.sendMessage(e.getPlayer(), (plugin.getLocale(e.getPlayer().getUniqueId()).get("moblimits.entity").replace("[entity]",
|
e.getPlayer().sendMessage((plugin.getLocale(e.getPlayer()).get("moblimits.entity").replace("[entity]",
|
||||||
Util.prettifyText(type))).replace("[number]", String.valueOf(Settings.limitedBlocks.get(type))));
|
Util.prettifyText(type))).replace("[number]", String.valueOf(Settings.limitedBlocks.get(type))));
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
}
|
}
|
||||||
@ -1014,7 +1015,7 @@ public class IslandGuard implements Listener {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Visitor
|
// Visitor
|
||||||
Util.sendMessage(e.getPlayer(), plugin.getLocale(e.getPlayer().getUniqueId()).get("island.protected"));
|
e.getPlayer().sendMessage(plugin.getLocale(e.getPlayer()).get("island.protected"));
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1043,7 +1044,7 @@ public class IslandGuard implements Listener {
|
|||||||
Island island = plugin.getIslands().getProtectedIslandAt(e.getBlock().getLocation());
|
Island island = plugin.getIslands().getProtectedIslandAt(e.getBlock().getLocation());
|
||||||
if (island == null) {
|
if (island == null) {
|
||||||
if (!Settings.defaultWorldSettings.get(SettingsFlag.PLACE_BLOCKS)) {
|
if (!Settings.defaultWorldSettings.get(SettingsFlag.PLACE_BLOCKS)) {
|
||||||
Util.sendMessage(e.getPlayer(), plugin.getLocale(e.getPlayer().getUniqueId()).get("island.protected"));
|
e.getPlayer().sendMessage(plugin.getLocale(e.getPlayer()).get("island.protected"));
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
@ -1065,7 +1066,7 @@ public class IslandGuard implements Listener {
|
|||||||
if (Settings.limitedBlocks.containsKey(type) && Settings.limitedBlocks.get(type) > -1) {
|
if (Settings.limitedBlocks.containsKey(type) && Settings.limitedBlocks.get(type) > -1) {
|
||||||
int count = island.getTileEntityCount(e.getBlock().getType(),e.getBlock().getWorld());
|
int count = island.getTileEntityCount(e.getBlock().getType(),e.getBlock().getWorld());
|
||||||
if (Settings.limitedBlocks.get(type) <= count) {
|
if (Settings.limitedBlocks.get(type) <= count) {
|
||||||
Util.sendMessage(e.getPlayer(), (plugin.getLocale(e.getPlayer().getUniqueId()).get("moblimits.entity").replace("[entity]",
|
e.getPlayer().sendMessage((plugin.getLocale(e.getPlayer()).get("moblimits.entity").replace("[entity]",
|
||||||
Util.prettifyText(type))).replace("[number]", String.valueOf(Settings.limitedBlocks.get(type))));
|
Util.prettifyText(type))).replace("[number]", String.valueOf(Settings.limitedBlocks.get(type))));
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
@ -1075,7 +1076,7 @@ public class IslandGuard implements Listener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Outside of protection area or visitor
|
// Outside of protection area or visitor
|
||||||
Util.sendMessage(e.getPlayer(), plugin.getLocale(e.getPlayer().getUniqueId()).get("island.protected"));
|
e.getPlayer().sendMessage(plugin.getLocale(e.getPlayer()).get("island.protected"));
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1094,7 +1095,7 @@ public class IslandGuard implements Listener {
|
|||||||
if (Util.inWorld(e.getPlayer())) {
|
if (Util.inWorld(e.getPlayer())) {
|
||||||
if (e.getEntity() != null && e.getEntity().getType().equals(EntityType.LEASH_HITCH)) {
|
if (e.getEntity() != null && e.getEntity().getType().equals(EntityType.LEASH_HITCH)) {
|
||||||
if (!actionAllowed(e.getPlayer(), e.getBlock().getLocation(), SettingsFlag.LEASH)) {
|
if (!actionAllowed(e.getPlayer(), e.getBlock().getLocation(), SettingsFlag.LEASH)) {
|
||||||
Util.sendMessage(e.getPlayer(), plugin.getLocale(e.getPlayer().getUniqueId()).get("island.protected"));
|
e.getPlayer().sendMessage(plugin.getLocale(e.getPlayer()).get("island.protected"));
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1122,7 +1123,7 @@ public class IslandGuard implements Listener {
|
|||||||
// Outside of island protection zone
|
// Outside of island protection zone
|
||||||
if (island == null) {
|
if (island == null) {
|
||||||
if (!Settings.defaultWorldSettings.get(SettingsFlag.PLACE_BLOCKS)) {
|
if (!Settings.defaultWorldSettings.get(SettingsFlag.PLACE_BLOCKS)) {
|
||||||
Util.sendMessage(e.getPlayer(), plugin.getLocale(e.getPlayer().getUniqueId()).get("island.protected"));
|
e.getPlayer().sendMessage(plugin.getLocale(e.getPlayer()).get("island.protected"));
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
@ -1136,7 +1137,7 @@ public class IslandGuard implements Listener {
|
|||||||
// Convert from EntityType to Material via string - ugh
|
// Convert from EntityType to Material via string - ugh
|
||||||
int count = island.getTileEntityCount(Material.valueOf(type),e.getEntity().getWorld());
|
int count = island.getTileEntityCount(Material.valueOf(type),e.getEntity().getWorld());
|
||||||
if (Settings.limitedBlocks.get(type) <= count) {
|
if (Settings.limitedBlocks.get(type) <= count) {
|
||||||
Util.sendMessage(e.getPlayer(), (plugin.getLocale(e.getPlayer().getUniqueId()).get("moblimits.entity").replace("[entity]",
|
e.getPlayer().sendMessage((plugin.getLocale(e.getPlayer()).get("moblimits.entity").replace("[entity]",
|
||||||
Util.prettifyText(type))).replace("[number]", String.valueOf(Settings.limitedBlocks.get(type))));
|
Util.prettifyText(type))).replace("[number]", String.valueOf(Settings.limitedBlocks.get(type))));
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
}
|
}
|
||||||
@ -1144,7 +1145,7 @@ public class IslandGuard implements Listener {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Visitor
|
// Visitor
|
||||||
Util.sendMessage(e.getPlayer(), plugin.getLocale(e.getPlayer().getUniqueId()).get("island.protected"));
|
e.getPlayer().sendMessage(plugin.getLocale(e.getPlayer()).get("island.protected"));
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1162,7 +1163,7 @@ public class IslandGuard implements Listener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Not allowed
|
// Not allowed
|
||||||
Util.sendMessage(e.getPlayer(), plugin.getLocale(e.getPlayer().getUniqueId()).get("island.protected"));
|
e.getPlayer().sendMessage(plugin.getLocale(e.getPlayer()).get("island.protected"));
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1215,7 +1216,7 @@ public class IslandGuard implements Listener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Not allowed
|
// Not allowed
|
||||||
Util.sendMessage(p, plugin.getLocale(p.getUniqueId()).get("island.protected"));
|
p.sendMessage(plugin.getLocale(p.getUniqueId()).get("island.protected"));
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1237,7 +1238,7 @@ public class IslandGuard implements Listener {
|
|||||||
if (actionAllowed(player, e.getEntity().getLocation(),SettingsFlag.LEASH)) {
|
if (actionAllowed(player, e.getEntity().getLocation(),SettingsFlag.LEASH)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Util.sendMessage(player, plugin.getLocale(player.getUniqueId()).get("island.protected"));
|
player.sendMessage(plugin.getLocale(player).get("island.protected"));
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1260,7 +1261,7 @@ public class IslandGuard implements Listener {
|
|||||||
if (actionAllowed(player, e.getEntity().getLocation(),SettingsFlag.LEASH)) {
|
if (actionAllowed(player, e.getEntity().getLocation(),SettingsFlag.LEASH)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Util.sendMessage(player, plugin.getLocale(player.getUniqueId()).get("island.protected"));
|
player.sendMessage(plugin.getLocale(player).get("island.protected"));
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1334,7 +1335,7 @@ public class IslandGuard implements Listener {
|
|||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
e.getPlayer().getItemInHand().setType(Material.BUCKET);
|
e.getPlayer().getItemInHand().setType(Material.BUCKET);
|
||||||
e.getPlayer().getWorld().playSound(e.getPlayer().getLocation(), Sound.valueOf("FIZZ"), 1F, 2F);
|
e.getPlayer().getWorld().playSound(e.getPlayer().getLocation(), Sound.valueOf("FIZZ"), 1F, 2F);
|
||||||
Util.sendMessage(e.getPlayer(), plugin.getLocale(e.getPlayer().getUniqueId()).get("biome.set").replace("[biome]", "Nether"));
|
e.getPlayer().sendMessage(plugin.getLocale(e.getPlayer()).get("biome.set").replace("[biome]", "Nether"));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (Util.playerIsHolding(e.getPlayer(), Material.WATER_BUCKET)) {
|
if (Util.playerIsHolding(e.getPlayer(), Material.WATER_BUCKET)) {
|
||||||
@ -1345,14 +1346,14 @@ public class IslandGuard implements Listener {
|
|||||||
e.getPlayer().getInventory().setItemInOffHand(new ItemStack(Material.BUCKET));
|
e.getPlayer().getInventory().setItemInOffHand(new ItemStack(Material.BUCKET));
|
||||||
}
|
}
|
||||||
e.getPlayer().getWorld().playSound(e.getPlayer().getLocation(), Sound.ENTITY_CREEPER_PRIMED, 1F, 2F);
|
e.getPlayer().getWorld().playSound(e.getPlayer().getLocation(), Sound.ENTITY_CREEPER_PRIMED, 1F, 2F);
|
||||||
Util.sendMessage(e.getPlayer(), plugin.getLocale(e.getPlayer().getUniqueId()).get("biome.set").replace("[biome]", "Nether"));
|
e.getPlayer().sendMessage(plugin.getLocale(e.getPlayer()).get("biome.set").replace("[biome]", "Nether"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Not allowed
|
// Not allowed
|
||||||
Util.sendMessage(p, plugin.getLocale(p.getUniqueId()).get("island.protected"));
|
p.sendMessage(plugin.getLocale(p.getUniqueId()).get("island.protected"));
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1417,7 +1418,7 @@ public class IslandGuard implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Not allowed
|
// Not allowed
|
||||||
Util.sendMessage(e.getPlayer(), plugin.getLocale(e.getPlayer().getUniqueId()).get("island.protected"));
|
e.getPlayer().sendMessage(plugin.getLocale(e.getPlayer()).get("island.protected"));
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1433,7 +1434,7 @@ public class IslandGuard implements Listener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Not allowed
|
// Not allowed
|
||||||
Util.sendMessage(e.getPlayer(), plugin.getLocale(e.getPlayer().getUniqueId()).get("island.protected"));
|
e.getPlayer().sendMessage(plugin.getLocale(e.getPlayer()).get("island.protected"));
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1496,7 +1497,7 @@ public class IslandGuard implements Listener {
|
|||||||
plugin.getLogger().info("DEBUG: fire found");
|
plugin.getLogger().info("DEBUG: fire found");
|
||||||
if (island != null) {
|
if (island != null) {
|
||||||
if (!island.getFlag(SettingsFlag.FIRE_EXTINGUISH)) {
|
if (!island.getFlag(SettingsFlag.FIRE_EXTINGUISH)) {
|
||||||
Util.sendMessage(e.getPlayer(), plugin.getLocale(e.getPlayer().getUniqueId()).get("island.protected"));
|
e.getPlayer().sendMessage(plugin.getLocale(e.getPlayer()).get("island.protected"));
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1506,7 +1507,7 @@ public class IslandGuard implements Listener {
|
|||||||
plugin.getLogger().info("DEBUG: extinguishing is allowed");
|
plugin.getLogger().info("DEBUG: extinguishing is allowed");
|
||||||
continue;
|
continue;
|
||||||
} else {
|
} else {
|
||||||
Util.sendMessage(e.getPlayer(), plugin.getLocale(e.getPlayer().getUniqueId()).get("island.protected"));
|
e.getPlayer().sendMessage(plugin.getLocale(e.getPlayer()).get("island.protected"));
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1524,11 +1525,11 @@ public class IslandGuard implements Listener {
|
|||||||
if (e.getClickedBlock().getType().toString().contains("SHULKER_BOX")) {
|
if (e.getClickedBlock().getType().toString().contains("SHULKER_BOX")) {
|
||||||
if (island == null) {
|
if (island == null) {
|
||||||
if (!Settings.defaultWorldSettings.get(SettingsFlag.OPEN_CHESTS)) {
|
if (!Settings.defaultWorldSettings.get(SettingsFlag.OPEN_CHESTS)) {
|
||||||
Util.sendMessage(e.getPlayer(), plugin.getLocale(e.getPlayer().getUniqueId()).get("island.protected"));
|
e.getPlayer().sendMessage(plugin.getLocale(e.getPlayer()).get("island.protected"));
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
}
|
}
|
||||||
} else if (!island.getFlag(SettingsFlag.OPEN_CHESTS)) {
|
} else if (!island.getFlag(SettingsFlag.OPEN_CHESTS)) {
|
||||||
Util.sendMessage(e.getPlayer(), plugin.getLocale(e.getPlayer().getUniqueId()).get("island.protected"));
|
e.getPlayer().sendMessage(plugin.getLocale(e.getPlayer()).get("island.protected"));
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
@ -1537,11 +1538,11 @@ public class IslandGuard implements Listener {
|
|||||||
if (e.getMaterial() != null && e.getMaterial().equals(Material.FIREWORK)) {
|
if (e.getMaterial() != null && e.getMaterial().equals(Material.FIREWORK)) {
|
||||||
if (island == null) {
|
if (island == null) {
|
||||||
if (!Settings.defaultWorldSettings.get(SettingsFlag.PLACE_BLOCKS)) {
|
if (!Settings.defaultWorldSettings.get(SettingsFlag.PLACE_BLOCKS)) {
|
||||||
Util.sendMessage(e.getPlayer(), plugin.getLocale(e.getPlayer().getUniqueId()).get("island.protected"));
|
e.getPlayer().sendMessage(plugin.getLocale(e.getPlayer()).get("island.protected"));
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
}
|
}
|
||||||
} else if (!island.getFlag(SettingsFlag.PLACE_BLOCKS)) {
|
} else if (!island.getFlag(SettingsFlag.PLACE_BLOCKS)) {
|
||||||
Util.sendMessage(e.getPlayer(), plugin.getLocale(e.getPlayer().getUniqueId()).get("island.protected"));
|
e.getPlayer().sendMessage(plugin.getLocale(e.getPlayer()).get("island.protected"));
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
@ -1560,13 +1561,13 @@ public class IslandGuard implements Listener {
|
|||||||
if (Settings.defaultWorldSettings.get(SettingsFlag.DOOR)) {
|
if (Settings.defaultWorldSettings.get(SettingsFlag.DOOR)) {
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
Util.sendMessage(e.getPlayer(), plugin.getLocale(e.getPlayer().getUniqueId()).get("island.protected"));
|
e.getPlayer().sendMessage(plugin.getLocale(e.getPlayer()).get("island.protected"));
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!island.getFlag(SettingsFlag.DOOR)) {
|
if (!island.getFlag(SettingsFlag.DOOR)) {
|
||||||
Util.sendMessage(e.getPlayer(), plugin.getLocale(e.getPlayer().getUniqueId()).get("island.protected"));
|
e.getPlayer().sendMessage(plugin.getLocale(e.getPlayer()).get("island.protected"));
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1581,13 +1582,13 @@ public class IslandGuard implements Listener {
|
|||||||
if (Settings.defaultWorldSettings.get(SettingsFlag.GATE)) {
|
if (Settings.defaultWorldSettings.get(SettingsFlag.GATE)) {
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
Util.sendMessage(e.getPlayer(), plugin.getLocale(e.getPlayer().getUniqueId()).get("island.protected"));
|
e.getPlayer().sendMessage(plugin.getLocale(e.getPlayer()).get("island.protected"));
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!island.getFlag(SettingsFlag.GATE)) {
|
if (!island.getFlag(SettingsFlag.GATE)) {
|
||||||
Util.sendMessage(e.getPlayer(), plugin.getLocale(e.getPlayer().getUniqueId()).get("island.protected"));
|
e.getPlayer().sendMessage(plugin.getLocale(e.getPlayer()).get("island.protected"));
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1605,13 +1606,13 @@ public class IslandGuard implements Listener {
|
|||||||
if (Settings.defaultWorldSettings.get(SettingsFlag.OPEN_CHESTS)) {
|
if (Settings.defaultWorldSettings.get(SettingsFlag.OPEN_CHESTS)) {
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
Util.sendMessage(e.getPlayer(), plugin.getLocale(e.getPlayer().getUniqueId()).get("island.protected"));
|
e.getPlayer().sendMessage(plugin.getLocale(e.getPlayer()).get("island.protected"));
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!island.getFlag(SettingsFlag.OPEN_CHESTS)) {
|
if (!island.getFlag(SettingsFlag.OPEN_CHESTS)) {
|
||||||
Util.sendMessage(e.getPlayer(), plugin.getLocale(e.getPlayer().getUniqueId()).get("island.protected"));
|
e.getPlayer().sendMessage(plugin.getLocale(e.getPlayer()).get("island.protected"));
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1621,13 +1622,13 @@ public class IslandGuard implements Listener {
|
|||||||
if (Settings.defaultWorldSettings.get(SettingsFlag.CROP_TRAMPLE)) {
|
if (Settings.defaultWorldSettings.get(SettingsFlag.CROP_TRAMPLE)) {
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
Util.sendMessage(e.getPlayer(), plugin.getLocale(e.getPlayer().getUniqueId()).get("island.protected"));
|
e.getPlayer().sendMessage(plugin.getLocale(e.getPlayer()).get("island.protected"));
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!island.getFlag(SettingsFlag.CROP_TRAMPLE)) {
|
if (!island.getFlag(SettingsFlag.CROP_TRAMPLE)) {
|
||||||
Util.sendMessage(e.getPlayer(), plugin.getLocale(e.getPlayer().getUniqueId()).get("island.protected"));
|
e.getPlayer().sendMessage(plugin.getLocale(e.getPlayer()).get("island.protected"));
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1638,13 +1639,13 @@ public class IslandGuard implements Listener {
|
|||||||
if (Settings.defaultWorldSettings.get(SettingsFlag.BREWING)) {
|
if (Settings.defaultWorldSettings.get(SettingsFlag.BREWING)) {
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
Util.sendMessage(e.getPlayer(), plugin.getLocale(e.getPlayer().getUniqueId()).get("island.protected"));
|
e.getPlayer().sendMessage(plugin.getLocale(e.getPlayer()).get("island.protected"));
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!island.getFlag(SettingsFlag.BREWING)) {
|
if (!island.getFlag(SettingsFlag.BREWING)) {
|
||||||
Util.sendMessage(e.getPlayer(), plugin.getLocale(e.getPlayer().getUniqueId()).get("island.protected"));
|
e.getPlayer().sendMessage(plugin.getLocale(e.getPlayer()).get("island.protected"));
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1660,13 +1661,13 @@ public class IslandGuard implements Listener {
|
|||||||
if (Settings.defaultWorldSettings.get(SettingsFlag.REDSTONE)) {
|
if (Settings.defaultWorldSettings.get(SettingsFlag.REDSTONE)) {
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
Util.sendMessage(e.getPlayer(), plugin.getLocale(e.getPlayer().getUniqueId()).get("island.protected"));
|
e.getPlayer().sendMessage(plugin.getLocale(e.getPlayer()).get("island.protected"));
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!island.getFlag(SettingsFlag.REDSTONE)) {
|
if (!island.getFlag(SettingsFlag.REDSTONE)) {
|
||||||
Util.sendMessage(e.getPlayer(), plugin.getLocale(e.getPlayer().getUniqueId()).get("island.protected"));
|
e.getPlayer().sendMessage(plugin.getLocale(e.getPlayer()).get("island.protected"));
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1676,13 +1677,13 @@ public class IslandGuard implements Listener {
|
|||||||
if (Settings.defaultWorldSettings.get(SettingsFlag.ENCHANTING)) {
|
if (Settings.defaultWorldSettings.get(SettingsFlag.ENCHANTING)) {
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
Util.sendMessage(e.getPlayer(), plugin.getLocale(e.getPlayer().getUniqueId()).get("island.protected"));
|
e.getPlayer().sendMessage(plugin.getLocale(e.getPlayer()).get("island.protected"));
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!island.getFlag(SettingsFlag.ENCHANTING)) {
|
if (!island.getFlag(SettingsFlag.ENCHANTING)) {
|
||||||
Util.sendMessage(e.getPlayer(), plugin.getLocale(e.getPlayer().getUniqueId()).get("island.protected"));
|
e.getPlayer().sendMessage(plugin.getLocale(e.getPlayer()).get("island.protected"));
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1693,13 +1694,13 @@ public class IslandGuard implements Listener {
|
|||||||
if (Settings.defaultWorldSettings.get(SettingsFlag.FURNACE)) {
|
if (Settings.defaultWorldSettings.get(SettingsFlag.FURNACE)) {
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
Util.sendMessage(e.getPlayer(), plugin.getLocale(e.getPlayer().getUniqueId()).get("island.protected"));
|
e.getPlayer().sendMessage(plugin.getLocale(e.getPlayer()).get("island.protected"));
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!island.getFlag(SettingsFlag.FURNACE)) {
|
if (!island.getFlag(SettingsFlag.FURNACE)) {
|
||||||
Util.sendMessage(e.getPlayer(), plugin.getLocale(e.getPlayer().getUniqueId()).get("island.protected"));
|
e.getPlayer().sendMessage(plugin.getLocale(e.getPlayer()).get("island.protected"));
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1720,7 +1721,7 @@ public class IslandGuard implements Listener {
|
|||||||
} else {
|
} else {
|
||||||
if (DEBUG)
|
if (DEBUG)
|
||||||
plugin.getLogger().info("DEBUG: Jukebox not allowed");
|
plugin.getLogger().info("DEBUG: Jukebox not allowed");
|
||||||
Util.sendMessage(e.getPlayer(), plugin.getLocale(e.getPlayer().getUniqueId()).get("island.protected"));
|
e.getPlayer().sendMessage(plugin.getLocale(e.getPlayer()).get("island.protected"));
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1728,7 +1729,7 @@ public class IslandGuard implements Listener {
|
|||||||
if (!island.getFlag(SettingsFlag.MUSIC)) {
|
if (!island.getFlag(SettingsFlag.MUSIC)) {
|
||||||
if (DEBUG)
|
if (DEBUG)
|
||||||
plugin.getLogger().info("DEBUG: Jukebox not allowed");
|
plugin.getLogger().info("DEBUG: Jukebox not allowed");
|
||||||
Util.sendMessage(e.getPlayer(), plugin.getLocale(e.getPlayer().getUniqueId()).get("island.protected"));
|
e.getPlayer().sendMessage(plugin.getLocale(e.getPlayer()).get("island.protected"));
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1741,13 +1742,13 @@ public class IslandGuard implements Listener {
|
|||||||
if (Settings.defaultWorldSettings.get(SettingsFlag.BUTTON)) {
|
if (Settings.defaultWorldSettings.get(SettingsFlag.BUTTON)) {
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
Util.sendMessage(e.getPlayer(), plugin.getLocale(e.getPlayer().getUniqueId()).get("island.protected"));
|
e.getPlayer().sendMessage(plugin.getLocale(e.getPlayer()).get("island.protected"));
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!island.getFlag(SettingsFlag.LEVER)) {
|
if (!island.getFlag(SettingsFlag.LEVER)) {
|
||||||
Util.sendMessage(e.getPlayer(), plugin.getLocale(e.getPlayer().getUniqueId()).get("island.protected"));
|
e.getPlayer().sendMessage(plugin.getLocale(e.getPlayer()).get("island.protected"));
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1757,13 +1758,13 @@ public class IslandGuard implements Listener {
|
|||||||
if (Settings.defaultWorldSettings.get(SettingsFlag.LEVER)) {
|
if (Settings.defaultWorldSettings.get(SettingsFlag.LEVER)) {
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
Util.sendMessage(e.getPlayer(), plugin.getLocale(e.getPlayer().getUniqueId()).get("island.protected"));
|
e.getPlayer().sendMessage(plugin.getLocale(e.getPlayer()).get("island.protected"));
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!island.getFlag(SettingsFlag.LEVER)) {
|
if (!island.getFlag(SettingsFlag.LEVER)) {
|
||||||
Util.sendMessage(e.getPlayer(), plugin.getLocale(e.getPlayer().getUniqueId()).get("island.protected"));
|
e.getPlayer().sendMessage(plugin.getLocale(e.getPlayer()).get("island.protected"));
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1775,13 +1776,13 @@ public class IslandGuard implements Listener {
|
|||||||
if (Settings.defaultWorldSettings.get(SettingsFlag.CRAFTING)) {
|
if (Settings.defaultWorldSettings.get(SettingsFlag.CRAFTING)) {
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
Util.sendMessage(e.getPlayer(), plugin.getLocale(e.getPlayer().getUniqueId()).get("island.protected"));
|
e.getPlayer().sendMessage(plugin.getLocale(e.getPlayer()).get("island.protected"));
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!island.getFlag(SettingsFlag.CRAFTING)) {
|
if (!island.getFlag(SettingsFlag.CRAFTING)) {
|
||||||
Util.sendMessage(e.getPlayer(), plugin.getLocale(e.getPlayer().getUniqueId()).get("island.protected"));
|
e.getPlayer().sendMessage(plugin.getLocale(e.getPlayer()).get("island.protected"));
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1791,13 +1792,13 @@ public class IslandGuard implements Listener {
|
|||||||
if (Settings.defaultWorldSettings.get(SettingsFlag.ANVIL)) {
|
if (Settings.defaultWorldSettings.get(SettingsFlag.ANVIL)) {
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
Util.sendMessage(e.getPlayer(), plugin.getLocale(e.getPlayer().getUniqueId()).get("island.protected"));
|
e.getPlayer().sendMessage(plugin.getLocale(e.getPlayer()).get("island.protected"));
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!island.getFlag(SettingsFlag.ANVIL)) {
|
if (!island.getFlag(SettingsFlag.ANVIL)) {
|
||||||
Util.sendMessage(e.getPlayer(), plugin.getLocale(e.getPlayer().getUniqueId()).get("island.protected"));
|
e.getPlayer().sendMessage(plugin.getLocale(e.getPlayer()).get("island.protected"));
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1809,7 +1810,7 @@ public class IslandGuard implements Listener {
|
|||||||
// If they are not on an island, it's protected
|
// If they are not on an island, it's protected
|
||||||
if (island == null) {
|
if (island == null) {
|
||||||
if (!Settings.defaultWorldSettings.get(SettingsFlag.PLACE_BLOCKS)) {
|
if (!Settings.defaultWorldSettings.get(SettingsFlag.PLACE_BLOCKS)) {
|
||||||
Util.sendMessage(e.getPlayer(), plugin.getLocale(e.getPlayer().getUniqueId()).get("island.protected"));
|
e.getPlayer().sendMessage(plugin.getLocale(e.getPlayer()).get("island.protected"));
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
@ -1818,7 +1819,7 @@ public class IslandGuard implements Listener {
|
|||||||
if (e.getMaterial() == Material.MINECART || e.getMaterial() == Material.STORAGE_MINECART || e.getMaterial() == Material.HOPPER_MINECART
|
if (e.getMaterial() == Material.MINECART || e.getMaterial() == Material.STORAGE_MINECART || e.getMaterial() == Material.HOPPER_MINECART
|
||||||
|| e.getMaterial() == Material.EXPLOSIVE_MINECART || e.getMaterial() == Material.POWERED_MINECART) {
|
|| e.getMaterial() == Material.EXPLOSIVE_MINECART || e.getMaterial() == Material.POWERED_MINECART) {
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
Util.sendMessage(e.getPlayer(), plugin.getLocale(e.getPlayer().getUniqueId()).get("island.protected"));
|
e.getPlayer().sendMessage(plugin.getLocale(e.getPlayer()).get("island.protected"));
|
||||||
e.getPlayer().updateInventory();
|
e.getPlayer().updateInventory();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1828,13 +1829,13 @@ public class IslandGuard implements Listener {
|
|||||||
if (Settings.defaultWorldSettings.get(SettingsFlag.BEACON)) {
|
if (Settings.defaultWorldSettings.get(SettingsFlag.BEACON)) {
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
Util.sendMessage(e.getPlayer(), plugin.getLocale(e.getPlayer().getUniqueId()).get("island.protected"));
|
e.getPlayer().sendMessage(plugin.getLocale(e.getPlayer()).get("island.protected"));
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!island.getFlag(SettingsFlag.BEACON)) {
|
if (!island.getFlag(SettingsFlag.BEACON)) {
|
||||||
Util.sendMessage(e.getPlayer(), plugin.getLocale(e.getPlayer().getUniqueId()).get("island.protected"));
|
e.getPlayer().sendMessage(plugin.getLocale(e.getPlayer()).get("island.protected"));
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1844,14 +1845,14 @@ public class IslandGuard implements Listener {
|
|||||||
if (Settings.defaultWorldSettings.get(SettingsFlag.BREAK_BLOCKS)) {
|
if (Settings.defaultWorldSettings.get(SettingsFlag.BREAK_BLOCKS)) {
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
Util.sendMessage(e.getPlayer(), plugin.getLocale(e.getPlayer().getUniqueId()).get("island.protected"));
|
e.getPlayer().sendMessage(plugin.getLocale(e.getPlayer()).get("island.protected"));
|
||||||
e.getPlayer().setFoodLevel(e.getPlayer().getFoodLevel() - 2);
|
e.getPlayer().setFoodLevel(e.getPlayer().getFoodLevel() - 2);
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!island.getFlag(SettingsFlag.BREAK_BLOCKS)) {
|
if (!island.getFlag(SettingsFlag.BREAK_BLOCKS)) {
|
||||||
Util.sendMessage(e.getPlayer(), plugin.getLocale(e.getPlayer().getUniqueId()).get("island.protected"));
|
e.getPlayer().sendMessage(plugin.getLocale(e.getPlayer()).get("island.protected"));
|
||||||
e.getPlayer().setFoodLevel(e.getPlayer().getFoodLevel() - 2);
|
e.getPlayer().setFoodLevel(e.getPlayer().getFoodLevel() - 2);
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
@ -1862,13 +1863,13 @@ public class IslandGuard implements Listener {
|
|||||||
if (Settings.defaultWorldSettings.get(SettingsFlag.BREAK_BLOCKS)) {
|
if (Settings.defaultWorldSettings.get(SettingsFlag.BREAK_BLOCKS)) {
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
Util.sendMessage(e.getPlayer(), plugin.getLocale(e.getPlayer().getUniqueId()).get("island.protected"));
|
e.getPlayer().sendMessage(plugin.getLocale(e.getPlayer()).get("island.protected"));
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!island.getFlag(SettingsFlag.BREAK_BLOCKS)) {
|
if (!island.getFlag(SettingsFlag.BREAK_BLOCKS)) {
|
||||||
Util.sendMessage(e.getPlayer(), plugin.getLocale(e.getPlayer().getUniqueId()).get("island.protected"));
|
e.getPlayer().sendMessage(plugin.getLocale(e.getPlayer()).get("island.protected"));
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1878,13 +1879,13 @@ public class IslandGuard implements Listener {
|
|||||||
if (Settings.defaultWorldSettings.get(SettingsFlag.BREAK_BLOCKS)) {
|
if (Settings.defaultWorldSettings.get(SettingsFlag.BREAK_BLOCKS)) {
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
Util.sendMessage(e.getPlayer(), plugin.getLocale(e.getPlayer().getUniqueId()).get("island.protected"));
|
e.getPlayer().sendMessage(plugin.getLocale(e.getPlayer()).get("island.protected"));
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!island.getFlag(SettingsFlag.BREAK_BLOCKS)) {
|
if (!island.getFlag(SettingsFlag.BREAK_BLOCKS)) {
|
||||||
Util.sendMessage(e.getPlayer(), plugin.getLocale(e.getPlayer().getUniqueId()).get("island.protected"));
|
e.getPlayer().sendMessage(plugin.getLocale(e.getPlayer()).get("island.protected"));
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1892,7 +1893,7 @@ public class IslandGuard implements Listener {
|
|||||||
case BED_BLOCK:
|
case BED_BLOCK:
|
||||||
if (e.getPlayer().getWorld().getEnvironment().equals(Environment.NETHER)) {
|
if (e.getPlayer().getWorld().getEnvironment().equals(Environment.NETHER)) {
|
||||||
// Prevent explosions
|
// Prevent explosions
|
||||||
Util.sendMessage(e.getPlayer(), plugin.getLocale(e.getPlayer().getUniqueId()).get("island.protected"));
|
e.getPlayer().sendMessage(plugin.getLocale(e.getPlayer()).get("island.protected"));
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1912,7 +1913,7 @@ public class IslandGuard implements Listener {
|
|||||||
|| e.getMaterial() == Material.TRAPPED_CHEST || e.getMaterial() == Material.IRON_DOOR) {
|
|| e.getMaterial() == Material.TRAPPED_CHEST || e.getMaterial() == Material.IRON_DOOR) {
|
||||||
if ((island == null && Settings.defaultWorldSettings.get(SettingsFlag.PLACE_BLOCKS))
|
if ((island == null && Settings.defaultWorldSettings.get(SettingsFlag.PLACE_BLOCKS))
|
||||||
|| (island !=null && !island.getFlag(SettingsFlag.PLACE_BLOCKS))) {
|
|| (island !=null && !island.getFlag(SettingsFlag.PLACE_BLOCKS))) {
|
||||||
Util.sendMessage(e.getPlayer(), plugin.getLocale(e.getPlayer().getUniqueId()).get("island.protected"));
|
e.getPlayer().sendMessage(plugin.getLocale(e.getPlayer()).get("island.protected"));
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
e.getPlayer().updateInventory();
|
e.getPlayer().updateInventory();
|
||||||
}
|
}
|
||||||
@ -1920,13 +1921,13 @@ public class IslandGuard implements Listener {
|
|||||||
// Trying to put a boat on non-liquid
|
// Trying to put a boat on non-liquid
|
||||||
if ((island == null && Settings.defaultWorldSettings.get(SettingsFlag.PLACE_BLOCKS))
|
if ((island == null && Settings.defaultWorldSettings.get(SettingsFlag.PLACE_BLOCKS))
|
||||||
|| (island !=null && !island.getFlag(SettingsFlag.PLACE_BLOCKS))) {
|
|| (island !=null && !island.getFlag(SettingsFlag.PLACE_BLOCKS))) {
|
||||||
Util.sendMessage(e.getPlayer(), plugin.getLocale(e.getPlayer().getUniqueId()).get("island.protected"));
|
e.getPlayer().sendMessage(plugin.getLocale(e.getPlayer()).get("island.protected"));
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
}
|
}
|
||||||
} else if (e.getMaterial().equals(Material.ENDER_PEARL)) {
|
} else if (e.getMaterial().equals(Material.ENDER_PEARL)) {
|
||||||
if ((island == null && Settings.defaultWorldSettings.get(SettingsFlag.THROW_ENDERPEARLS))
|
if ((island == null && Settings.defaultWorldSettings.get(SettingsFlag.THROW_ENDERPEARLS))
|
||||||
|| (island !=null && !island.getFlag(SettingsFlag.THROW_ENDERPEARLS))) {
|
|| (island !=null && !island.getFlag(SettingsFlag.THROW_ENDERPEARLS))) {
|
||||||
Util.sendMessage(e.getPlayer(), plugin.getLocale(e.getPlayer().getUniqueId()).get("island.protected"));
|
e.getPlayer().sendMessage(plugin.getLocale(e.getPlayer()).get("island.protected"));
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
}
|
}
|
||||||
} else if (e.getMaterial().equals(Material.FLINT_AND_STEEL)) {
|
} else if (e.getMaterial().equals(Material.FLINT_AND_STEEL)) {
|
||||||
@ -1937,7 +1938,7 @@ public class IslandGuard implements Listener {
|
|||||||
//return;
|
//return;
|
||||||
}
|
}
|
||||||
if (!actionAllowed(e.getPlayer(), e.getClickedBlock().getLocation(), SettingsFlag.FIRE)) {
|
if (!actionAllowed(e.getPlayer(), e.getClickedBlock().getLocation(), SettingsFlag.FIRE)) {
|
||||||
Util.sendMessage(e.getPlayer(), plugin.getLocale(e.getPlayer().getUniqueId()).get("island.protected"));
|
e.getPlayer().sendMessage(plugin.getLocale(e.getPlayer()).get("island.protected"));
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1945,7 +1946,7 @@ public class IslandGuard implements Listener {
|
|||||||
if (DEBUG)
|
if (DEBUG)
|
||||||
plugin.getLogger().info("DEBUG: allowMonsterEggs = " + island.getFlag(SettingsFlag.SPAWN_EGGS));
|
plugin.getLogger().info("DEBUG: allowMonsterEggs = " + island.getFlag(SettingsFlag.SPAWN_EGGS));
|
||||||
if (!actionAllowed(e.getPlayer(),e.getClickedBlock().getLocation(),SettingsFlag.SPAWN_EGGS)) {
|
if (!actionAllowed(e.getPlayer(),e.getClickedBlock().getLocation(),SettingsFlag.SPAWN_EGGS)) {
|
||||||
Util.sendMessage(e.getPlayer(), plugin.getLocale(e.getPlayer().getUniqueId()).get("island.protected"));
|
e.getPlayer().sendMessage(plugin.getLocale(e.getPlayer()).get("island.protected"));
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
}
|
}
|
||||||
} else if (e.getMaterial().equals(Material.POTION) && e.getItem().getDurability() != 0) {
|
} else if (e.getMaterial().equals(Material.POTION) && e.getItem().getDurability() != 0) {
|
||||||
@ -1971,7 +1972,7 @@ public class IslandGuard implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Not allowed
|
// Not allowed
|
||||||
Util.sendMessage(e.getPlayer(), plugin.getLocale(e.getPlayer().getUniqueId()).get("island.protected"));
|
e.getPlayer().sendMessage(plugin.getLocale(e.getPlayer()).get("island.protected"));
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
}
|
}
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
@ -1995,7 +1996,7 @@ public class IslandGuard implements Listener {
|
|||||||
if (Util.inWorld(player) || player.getWorld().equals(IslandWorld.getNetherWorld())) {
|
if (Util.inWorld(player) || player.getWorld().equals(IslandWorld.getNetherWorld())) {
|
||||||
if (event.getRecipe().getResult().getType() == Material.ENDER_CHEST) {
|
if (event.getRecipe().getResult().getType() == Material.ENDER_CHEST) {
|
||||||
if (!(player.hasPermission(Settings.PERMPREFIX + "craft.enderchest"))) {
|
if (!(player.hasPermission(Settings.PERMPREFIX + "craft.enderchest"))) {
|
||||||
Util.sendMessage(player, plugin.getLocale(player.getUniqueId()).get("general.errors.no-permission"));
|
player.sendMessage(plugin.getLocale(player).get("general.errors.no-permission"));
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2018,7 +2019,7 @@ public class IslandGuard implements Listener {
|
|||||||
if (event.getAction() == Action.RIGHT_CLICK_BLOCK) {
|
if (event.getAction() == Action.RIGHT_CLICK_BLOCK) {
|
||||||
if (event.getClickedBlock().getType() == Material.ENDER_CHEST) {
|
if (event.getClickedBlock().getType() == Material.ENDER_CHEST) {
|
||||||
if (!(event.getPlayer().hasPermission(Settings.PERMPREFIX + "craft.enderchest"))) {
|
if (!(event.getPlayer().hasPermission(Settings.PERMPREFIX + "craft.enderchest"))) {
|
||||||
Util.sendMessage(player, plugin.getLocale(player.getUniqueId()).get("general.errors.no-permission"));
|
player.sendMessage(plugin.getLocale(player).get("general.errors.no-permission"));
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2063,7 +2064,7 @@ public class IslandGuard implements Listener {
|
|||||||
plugin.getLogger().info("DEBUG: villager trading is " + island.getFlag(SettingsFlag.VILLAGER_TRADING));
|
plugin.getLogger().info("DEBUG: villager trading is " + island.getFlag(SettingsFlag.VILLAGER_TRADING));
|
||||||
}
|
}
|
||||||
if ((!island.getFlag(SettingsFlag.VILLAGER_TRADING) && !island.getMembers().contains(p.getUniqueId()))) {
|
if ((!island.getFlag(SettingsFlag.VILLAGER_TRADING) && !island.getMembers().contains(p.getUniqueId()))) {
|
||||||
Util.sendMessage(e.getPlayer(), plugin.getLocale(e.getPlayer().getUniqueId()).get("island.protected"));
|
e.getPlayer().sendMessage(plugin.getLocale(e.getPlayer()).get("island.protected"));
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -2071,7 +2072,7 @@ public class IslandGuard implements Listener {
|
|||||||
}
|
}
|
||||||
// Handle name tags and dyes
|
// Handle name tags and dyes
|
||||||
if (Util.playerIsHolding(p, Material.NAME_TAG) || Util.playerIsHolding(p, Material.INK_SACK)) {
|
if (Util.playerIsHolding(p, Material.NAME_TAG) || Util.playerIsHolding(p, Material.INK_SACK)) {
|
||||||
Util.sendMessage(e.getPlayer(), plugin.getLocale(e.getPlayer().getUniqueId()).get("island.protected"));
|
e.getPlayer().sendMessage(plugin.getLocale(e.getPlayer()).get("island.protected"));
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
e.getPlayer().updateInventory();
|
e.getPlayer().updateInventory();
|
||||||
return;
|
return;
|
||||||
@ -2079,13 +2080,13 @@ public class IslandGuard implements Listener {
|
|||||||
// Handle cookies (to animals)
|
// Handle cookies (to animals)
|
||||||
if (Util.playerIsHolding(p, Material.COOKIE) && e.getRightClicked() instanceof Animals) {
|
if (Util.playerIsHolding(p, Material.COOKIE) && e.getRightClicked() instanceof Animals) {
|
||||||
if (island == null && !Settings.defaultWorldSettings.get(SettingsFlag.HURT_ANIMALS)) {
|
if (island == null && !Settings.defaultWorldSettings.get(SettingsFlag.HURT_ANIMALS)) {
|
||||||
Util.sendMessage(e.getPlayer(), plugin.getLocale(e.getPlayer().getUniqueId()).get("island.protected"));
|
e.getPlayer().sendMessage(plugin.getLocale(e.getPlayer()).get("island.protected"));
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (island != null) {
|
if (island != null) {
|
||||||
if ((!island.getFlag(SettingsFlag.HURT_ANIMALS) && !island.getMembers().contains(p.getUniqueId()))) {
|
if ((!island.getFlag(SettingsFlag.HURT_ANIMALS) && !island.getMembers().contains(p.getUniqueId()))) {
|
||||||
Util.sendMessage(e.getPlayer(), plugin.getLocale(e.getPlayer().getUniqueId()).get("island.protected"));
|
e.getPlayer().sendMessage(plugin.getLocale(e.getPlayer()).get("island.protected"));
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -2097,13 +2098,13 @@ public class IslandGuard implements Listener {
|
|||||||
Material type = item.getType();
|
Material type = item.getType();
|
||||||
if (type == Material.EGG || type == Material.WHEAT || type == Material.CARROT_ITEM || type == Material.SEEDS) {
|
if (type == Material.EGG || type == Material.WHEAT || type == Material.CARROT_ITEM || type == Material.SEEDS) {
|
||||||
if (island == null && !Settings.defaultWorldSettings.get(SettingsFlag.BREEDING)) {
|
if (island == null && !Settings.defaultWorldSettings.get(SettingsFlag.BREEDING)) {
|
||||||
Util.sendMessage(e.getPlayer(), plugin.getLocale(e.getPlayer().getUniqueId()).get("island.protected"));
|
e.getPlayer().sendMessage(plugin.getLocale(e.getPlayer()).get("island.protected"));
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (island != null) {
|
if (island != null) {
|
||||||
if ((!island.getFlag(SettingsFlag.BREEDING) && !island.getMembers().contains(p.getUniqueId()))) {
|
if ((!island.getFlag(SettingsFlag.BREEDING) && !island.getMembers().contains(p.getUniqueId()))) {
|
||||||
Util.sendMessage(e.getPlayer(), plugin.getLocale(e.getPlayer().getUniqueId()).get("island.protected"));
|
e.getPlayer().sendMessage(plugin.getLocale(e.getPlayer()).get("island.protected"));
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -2134,23 +2135,23 @@ public class IslandGuard implements Listener {
|
|||||||
case HORSE:
|
case HORSE:
|
||||||
//plugin.getLogger().info("Horse riding");
|
//plugin.getLogger().info("Horse riding");
|
||||||
if (island == null && !Settings.defaultWorldSettings.get(SettingsFlag.MOUNT_RIDING)) {
|
if (island == null && !Settings.defaultWorldSettings.get(SettingsFlag.MOUNT_RIDING)) {
|
||||||
Util.sendMessage(e.getPlayer(), plugin.getLocale(e.getPlayer().getUniqueId()).get("island.protected"));
|
e.getPlayer().sendMessage(plugin.getLocale(e.getPlayer()).get("island.protected"));
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
}
|
}
|
||||||
if (island != null && !island.getFlag(SettingsFlag.MOUNT_RIDING)) {
|
if (island != null && !island.getFlag(SettingsFlag.MOUNT_RIDING)) {
|
||||||
Util.sendMessage(e.getPlayer(), plugin.getLocale(e.getPlayer().getUniqueId()).get("island.protected"));
|
e.getPlayer().sendMessage(plugin.getLocale(e.getPlayer()).get("island.protected"));
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ITEM_FRAME:
|
case ITEM_FRAME:
|
||||||
// This is to place items in an item frame
|
// This is to place items in an item frame
|
||||||
if (island == null && !Settings.defaultWorldSettings.get(SettingsFlag.PLACE_BLOCKS)) {
|
if (island == null && !Settings.defaultWorldSettings.get(SettingsFlag.PLACE_BLOCKS)) {
|
||||||
Util.sendMessage(e.getPlayer(), plugin.getLocale(e.getPlayer().getUniqueId()).get("island.protected"));
|
e.getPlayer().sendMessage(plugin.getLocale(e.getPlayer()).get("island.protected"));
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
}
|
}
|
||||||
if (island != null) {
|
if (island != null) {
|
||||||
if (!island.getFlag(SettingsFlag.PLACE_BLOCKS)) {
|
if (!island.getFlag(SettingsFlag.PLACE_BLOCKS)) {
|
||||||
Util.sendMessage(e.getPlayer(), plugin.getLocale(e.getPlayer().getUniqueId()).get("island.protected"));
|
e.getPlayer().sendMessage(plugin.getLocale(e.getPlayer()).get("island.protected"));
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2160,12 +2161,12 @@ public class IslandGuard implements Listener {
|
|||||||
case MINECART_HOPPER:
|
case MINECART_HOPPER:
|
||||||
//plugin.getLogger().info("Minecarts");
|
//plugin.getLogger().info("Minecarts");
|
||||||
if (island == null && !Settings.defaultWorldSettings.get(SettingsFlag.OPEN_CHESTS)) {
|
if (island == null && !Settings.defaultWorldSettings.get(SettingsFlag.OPEN_CHESTS)) {
|
||||||
Util.sendMessage(e.getPlayer(), plugin.getLocale(e.getPlayer().getUniqueId()).get("island.protected"));
|
e.getPlayer().sendMessage(plugin.getLocale(e.getPlayer()).get("island.protected"));
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
}
|
}
|
||||||
if (island != null) {
|
if (island != null) {
|
||||||
if (!island.getFlag(SettingsFlag.OPEN_CHESTS)) {
|
if (!island.getFlag(SettingsFlag.OPEN_CHESTS)) {
|
||||||
Util.sendMessage(e.getPlayer(), plugin.getLocale(e.getPlayer().getUniqueId()).get("island.protected"));
|
e.getPlayer().sendMessage(plugin.getLocale(e.getPlayer()).get("island.protected"));
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2330,7 +2331,7 @@ public class IslandGuard implements Listener {
|
|||||||
// Block action
|
// Block action
|
||||||
UUID playerUUID = e.getPlayer().getUniqueId();
|
UUID playerUUID = e.getPlayer().getUniqueId();
|
||||||
if (!onPlate.containsKey(playerUUID)) {
|
if (!onPlate.containsKey(playerUUID)) {
|
||||||
Util.sendMessage(e.getPlayer(), plugin.getLocale(playerUUID).get("island.protected"));
|
e.getPlayer().sendMessage(plugin.getLocale(e.getPlayer()).get("island.protected"));
|
||||||
Vector v = e.getPlayer().getLocation().toVector();
|
Vector v = e.getPlayer().getLocation().toVector();
|
||||||
onPlate.put(playerUUID, new Vector(v.getBlockX(), v.getBlockY(), v.getBlockZ()));
|
onPlate.put(playerUUID, new Vector(v.getBlockX(), v.getBlockY(), v.getBlockZ()));
|
||||||
}
|
}
|
||||||
@ -2397,7 +2398,7 @@ public class IslandGuard implements Listener {
|
|||||||
}
|
}
|
||||||
if (!island.getFlag(SettingsFlag.THROW_EGGS)) {
|
if (!island.getFlag(SettingsFlag.THROW_EGGS)) {
|
||||||
e.setHatching(false);
|
e.setHatching(false);
|
||||||
Util.sendMessage(e.getPlayer(), plugin.getLocale(e.getPlayer().getUniqueId()).get("island.protected"));
|
e.getPlayer().sendMessage(plugin.getLocale(e.getPlayer()).get("island.protected"));
|
||||||
//e.getPlayer().updateInventory();
|
//e.getPlayer().updateInventory();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2480,7 +2481,7 @@ public class IslandGuard implements Listener {
|
|||||||
// Only say it once a second
|
// Only say it once a second
|
||||||
// Debounce event (it can be called twice for the same action)
|
// Debounce event (it can be called twice for the same action)
|
||||||
if (!tntBlocks.contains(e.getBlock().getLocation())) {
|
if (!tntBlocks.contains(e.getBlock().getLocation())) {
|
||||||
Util.sendMessage(shooter, plugin.getLocale(shooter.getUniqueId()).get("island.protected"));
|
shooter.sendMessage(plugin.getLocale(shooter).get("island.protected"));
|
||||||
tntBlocks.add(e.getBlock().getLocation());
|
tntBlocks.add(e.getBlock().getLocation());
|
||||||
plugin.getServer().getScheduler().runTaskLater(plugin, () -> tntBlocks.remove(e.getBlock().getLocation()), 20L);
|
plugin.getServer().getScheduler().runTaskLater(plugin, () -> tntBlocks.remove(e.getBlock().getLocation()), 20L);
|
||||||
}
|
}
|
||||||
@ -2563,7 +2564,7 @@ public class IslandGuard implements Listener {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// Not allowed
|
// Not allowed
|
||||||
Util.sendMessage(attacker, plugin.getLocale(attacker.getUniqueId()).get("island.protected"));
|
attacker.sendMessage(plugin.getLocale(attacker).get("island.protected"));
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -2576,7 +2577,7 @@ public class IslandGuard implements Listener {
|
|||||||
}
|
}
|
||||||
if (DEBUG)
|
if (DEBUG)
|
||||||
plugin.getLogger().info("DEBUG: Mobs not allowed to be hurt. Blocking");
|
plugin.getLogger().info("DEBUG: Mobs not allowed to be hurt. Blocking");
|
||||||
Util.sendMessage(attacker, plugin.getLocale(attacker.getUniqueId()).get("island.protected"));
|
attacker.sendMessage(plugin.getLocale(attacker).get("island.protected"));
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -2592,7 +2593,7 @@ public class IslandGuard implements Listener {
|
|||||||
if (entity instanceof Player) {
|
if (entity instanceof Player) {
|
||||||
if (!pvp) {
|
if (!pvp) {
|
||||||
if (DEBUG) plugin.getLogger().info("DEBUG: PVP not allowed");
|
if (DEBUG) plugin.getLogger().info("DEBUG: PVP not allowed");
|
||||||
Util.sendMessage(attacker, plugin.getLocale(attacker.getUniqueId()).get("targetInPVPArea"));
|
attacker.sendMessage(plugin.getLocale(attacker).get("targetInPVPArea"));
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -78,7 +78,7 @@ public class IslandGuard1_8 implements Listener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
Util.sendMessage(e.getPlayer(), plugin.getLocale(e.getPlayer().getUniqueId()).get("island.protected"));
|
e.getPlayer().sendMessage(plugin.getLocale(e.getPlayer().getUniqueId()).get("island.protected"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -155,7 +155,7 @@ public class IslandGuard1_8 implements Listener {
|
|||||||
int count = island.getTileEntityCount(Material.ARMOR_STAND,e.getPlayer().getWorld());
|
int count = island.getTileEntityCount(Material.ARMOR_STAND,e.getPlayer().getWorld());
|
||||||
//plugin.getLogger().info("1.8 " + "DEBUG: count is " + count + " limit is " + Settings.limitedBlocks.get("ARMOR_STAND"));
|
//plugin.getLogger().info("1.8 " + "DEBUG: count is " + count + " limit is " + Settings.limitedBlocks.get("ARMOR_STAND"));
|
||||||
if (Settings.limitedBlocks.get("ARMOR_STAND") <= count) {
|
if (Settings.limitedBlocks.get("ARMOR_STAND") <= count) {
|
||||||
Util.sendMessage(e.getPlayer(), (plugin.getLocale(e.getPlayer().getUniqueId()).get("moblimits.entity").replace("[entity]",
|
e.getPlayer().sendMessage((plugin.getLocale(e.getPlayer().getUniqueId()).get("moblimits.entity").replace("[entity]",
|
||||||
Util.prettifyText(Material.ARMOR_STAND.toString()))).replace("[number]", String.valueOf(Settings.limitedBlocks.get("ARMOR_STAND"))));
|
Util.prettifyText(Material.ARMOR_STAND.toString()))).replace("[number]", String.valueOf(Settings.limitedBlocks.get("ARMOR_STAND"))));
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
@ -165,7 +165,7 @@ public class IslandGuard1_8 implements Listener {
|
|||||||
}
|
}
|
||||||
// plugin.getLogger().info("1.8 " + "DEBUG: stand place cancelled");
|
// plugin.getLogger().info("1.8 " + "DEBUG: stand place cancelled");
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
Util.sendMessage(e.getPlayer(), plugin.getLocale(e.getPlayer().getUniqueId()).get("island.protected"));
|
e.getPlayer().sendMessage(plugin.getLocale(e.getPlayer().getUniqueId()).get("island.protected"));
|
||||||
e.getPlayer().updateInventory();
|
e.getPlayer().updateInventory();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -203,7 +203,7 @@ public class IslandGuard1_8 implements Listener {
|
|||||||
if (island != null && island.getFlag(SettingsFlag.BREAK_BLOCKS)) {
|
if (island != null && island.getFlag(SettingsFlag.BREAK_BLOCKS)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Util.sendMessage(p, plugin.getLocale(p.getUniqueId()).get("island.protected"));
|
p.sendMessage(plugin.getLocale(p.getUniqueId()).get("island.protected"));
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -125,7 +125,7 @@ public class IslandGuard1_9 implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
Util.sendMessage(e.getPlayer(), plugin.getLocale(e.getPlayer().getUniqueId()).get("island.protected"));
|
e.getPlayer().sendMessage(plugin.getLocale(e.getPlayer()).get("island.protected"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -160,7 +160,7 @@ public class IslandGuard1_9 implements Listener {
|
|||||||
int count = island.getTileEntityCount(Material.END_CRYSTAL,e.getPlayer().getWorld());
|
int count = island.getTileEntityCount(Material.END_CRYSTAL,e.getPlayer().getWorld());
|
||||||
//plugin.getLogger().info("1.9 " +"DEBUG: count is " + count + " limit is " + Settings.limitedBlocks.get("ARMOR_STAND"));
|
//plugin.getLogger().info("1.9 " +"DEBUG: count is " + count + " limit is " + Settings.limitedBlocks.get("ARMOR_STAND"));
|
||||||
if (Settings.limitedBlocks.get("END_CRYSTAL") <= count) {
|
if (Settings.limitedBlocks.get("END_CRYSTAL") <= count) {
|
||||||
Util.sendMessage(e.getPlayer(), (plugin.getLocale(e.getPlayer().getUniqueId()).get("moblimits.entity").replace("[entity]",
|
e.getPlayer().sendMessage((plugin.getLocale(e.getPlayer().getUniqueId()).get("moblimits.entity").replace("[entity]",
|
||||||
Util.prettifyText(Material.END_CRYSTAL.toString()))).replace("[number]", String.valueOf(Settings.limitedBlocks.get("END_CRYSTAL"))));
|
Util.prettifyText(Material.END_CRYSTAL.toString()))).replace("[number]", String.valueOf(Settings.limitedBlocks.get("END_CRYSTAL"))));
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
@ -170,7 +170,7 @@ public class IslandGuard1_9 implements Listener {
|
|||||||
}
|
}
|
||||||
// plugin.getLogger().info("1.9 " +"DEBUG: stand place cancelled");
|
// plugin.getLogger().info("1.9 " +"DEBUG: stand place cancelled");
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
Util.sendMessage(e.getPlayer(), plugin.getLocale(e.getPlayer().getUniqueId()).get("island.protected"));
|
e.getPlayer().sendMessage(plugin.getLocale(e.getPlayer()).get("island.protected"));
|
||||||
e.getPlayer().updateInventory();
|
e.getPlayer().updateInventory();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -241,7 +241,7 @@ public class IslandGuard1_9 implements Listener {
|
|||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Util.sendMessage(p, plugin.getLocale(p.getUniqueId()).get("island.protected"));
|
p.sendMessage(plugin.getLocale(p).get("island.protected"));
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -123,7 +123,7 @@ public class NetherEvents implements Listener {
|
|||||||
if (DEBUG)
|
if (DEBUG)
|
||||||
plugin.getLogger().info("Block break in island nether");
|
plugin.getLogger().info("Block break in island nether");
|
||||||
if (!awayFromSpawn(e.getPlayer()) && !e.getPlayer().isOp()) {
|
if (!awayFromSpawn(e.getPlayer()) && !e.getPlayer().isOp()) {
|
||||||
Util.sendMessage(e.getPlayer(), plugin.getLocale(e.getPlayer().getUniqueId()).get("nether.spawnisprotected"));
|
e.getPlayer().sendMessage(plugin.getLocale(e.getPlayer()).get("nether.spawnisprotected"));
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -90,7 +90,7 @@ public class VisitorGuard implements Listener {
|
|||||||
|| plugin.getIslands().locationIsOnIsland(e.getPlayer(), e.getItemDrop().getLocation())) {
|
|| plugin.getIslands().locationIsOnIsland(e.getPlayer(), e.getItemDrop().getLocation())) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Util.sendMessage(e.getPlayer(), plugin.getLocale(e.getPlayer().getUniqueId()).get("island.protected"));
|
e.getPlayer().sendMessage(plugin.getLocale(e.getPlayer()).get("island.protected"));
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -113,7 +113,7 @@ public class VisitorGuard implements Listener {
|
|||||||
//plugin.getLogger().info(Settings.visitorCommandBlockList.toString());
|
//plugin.getLogger().info(Settings.visitorCommandBlockList.toString());
|
||||||
String[] args = e.getMessage().substring(1).toLowerCase().split(" ");
|
String[] args = e.getMessage().substring(1).toLowerCase().split(" ");
|
||||||
if (Settings.visitorBannedCommands.contains(args[0])) {
|
if (Settings.visitorBannedCommands.contains(args[0])) {
|
||||||
Util.sendMessage(e.getPlayer(), plugin.getLocale(e.getPlayer().getUniqueId()).get("island.protected"));
|
e.getPlayer().sendMessage(plugin.getLocale(e.getPlayer()).get("island.protected"));
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -223,9 +223,9 @@ public class SafeSpotTeleport {
|
|||||||
//plugin.getLogger().info("DEBUG: safe spot not found");
|
//plugin.getLogger().info("DEBUG: safe spot not found");
|
||||||
if (entity instanceof Player) {
|
if (entity instanceof Player) {
|
||||||
if (!failureMessage.isEmpty()) {
|
if (!failureMessage.isEmpty()) {
|
||||||
Util.sendMessage(entity, failureMessage);
|
entity.sendMessage(failureMessage);
|
||||||
} else {
|
} else {
|
||||||
Util.sendMessage(entity, "Warp not safe");
|
entity.sendMessage("Warp not safe");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -45,16 +45,6 @@ public class Util {
|
|||||||
|
|
||||||
private static NMSAbstraction nmsHandler;
|
private static NMSAbstraction nmsHandler;
|
||||||
|
|
||||||
public static void sendMessage(CommandSender receiver, String message){
|
|
||||||
message = PlaceholderHandler.replacePlaceholders(receiver, message);
|
|
||||||
|
|
||||||
if (!ChatColor.stripColor(message).trim().isEmpty()) {
|
|
||||||
for(String part : message.split("\n")){
|
|
||||||
receiver.sendMessage(part);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks what version the server is running and picks the appropriate NMS handler, or fallback
|
* Checks what version the server is running and picks the appropriate NMS handler, or fallback
|
||||||
* @return NMSAbstraction class
|
* @return NMSAbstraction class
|
||||||
@ -241,24 +231,6 @@ public class Util {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Display message to player in action bar (1.11+ or chat)
|
|
||||||
* @param player
|
|
||||||
* @param message
|
|
||||||
*/
|
|
||||||
public static void sendEnterExit(Player player, String message) {
|
|
||||||
if (!Settings.showInActionBar
|
|
||||||
|| plugin.getServer().getVersion().contains("(MC: 1.7")
|
|
||||||
|| plugin.getServer().getVersion().contains("(MC: 1.8")
|
|
||||||
|| plugin.getServer().getVersion().contains("(MC: 1.9")
|
|
||||||
|| plugin.getServer().getVersion().contains("(MC: 1.10")) {
|
|
||||||
sendMessage(player, message);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
plugin.getServer().dispatchCommand(plugin.getServer().getConsoleSender(),
|
|
||||||
"minecraft:title " + player.getName() + " actionbar {\"text\":\"" + ChatColor.stripColor(message) + "\"}");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Determines if a location is in the island world or not or
|
* Determines if a location is in the island world or not or
|
||||||
* in the new nether if it is activated
|
* in the new nether if it is activated
|
||||||
|
Loading…
Reference in New Issue
Block a user