respawn anchor place prevention

This commit is contained in:
Super_ 2020-07-02 08:13:20 -04:00
parent 556dfa7233
commit 8a60ae2235
4 changed files with 19 additions and 1 deletions

View File

@ -159,6 +159,16 @@ public class BlockBlocker extends FreedomService
}
break;
}
case RESPAWN_ANCHOR:
{
if (!ConfigEntry.ALLOW_RESPAWN_ANCHORS.getBoolean())
{
player.sendMessage(ChatColor.GRAY + "Respawn anchors are disabled.");
player.getInventory().setItem(player.getInventory().getHeldItemSlot(), new ItemStack(Material.COOKIE, 1));
event.setCancelled(true);
}
break;
}
}
if (Groups.BANNERS.contains(event.getBlockPlaced().getType()))

View File

@ -46,6 +46,7 @@ public class Command_toggle extends FreedomCommand
msg("- spawners");
msg("- 4chan");
msg("- beehives");
msg("- respawnanchors");
msg("- autotp");
msg("- autoclear");
return false;
@ -215,6 +216,11 @@ public class Command_toggle extends FreedomCommand
toggle("Beehives are", ConfigEntry.ALLOW_BEEHIVES);
return true;
}
else if (args[0].equalsIgnoreCase("respawnanchors"))
{
toggle("Respawn anchors are", ConfigEntry.ALLOW_RESPAWN_ANCHORS);
return true;
}
else if (args[0].equalsIgnoreCase("autotp"))
{
toggle("Teleportation on join is", ConfigEntry.AUTO_TP);
@ -245,7 +251,7 @@ public class Command_toggle extends FreedomCommand
"waterplace", "fireplace", "lavaplace", "fluidspread", "lavadmg", "firespread", "frostwalk",
"firework", "prelog", "lockdown", "petprotect", "entitywipe", "nonuke", "explosives", "unsafeenchs",
"bells", "armorstands", "structureblocks", "jigsaws", "grindstones", "jukeboxes", "spawners", "4chan", "beehives",
"autotp", "autoclear");
"respawnanchors", "autotp", "autoclear");
}
return Collections.emptyList();

View File

@ -31,6 +31,7 @@ public enum ConfigEntry
ALLOW_JUKEBOXES(Boolean.class, "allow.jukeboxes"),
ALLOW_SPAWNERS(Boolean.class, "allow.spawners"),
ALLOW_BEEHIVES(Boolean.class, "allow.beehives"),
ALLOW_RESPAWN_ANCHORS(Boolean.class, "allow.respawnanchors"),
AUTO_TP(Boolean.class, "allow.auto_tp"),
AUTO_CLEAR(Boolean.class, "allow.auto_clear"),
//

View File

@ -183,6 +183,7 @@ allow:
jukeboxes: false
spawners: false
beehives: false
respawnanchors: false
auto_tp: false
auto_clear: false