mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-11-01 05:57:09 +00:00
Add configuration option for disabling books (#275)
FS-458 Co-authored-by: Video <videogamesm12@gmail.com> Co-authored-by: Paldiu <pawereus@gmail.com>
This commit is contained in:
parent
3bd177ea6f
commit
71127c3152
@ -171,6 +171,11 @@ public class InteractBlocker extends FreedomService
|
|||||||
}
|
}
|
||||||
case WRITTEN_BOOK:
|
case WRITTEN_BOOK:
|
||||||
{
|
{
|
||||||
|
if (ConfigEntry.ALLOW_BOOKS.getBoolean())
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
player.getInventory().clear(player.getInventory().getHeldItemSlot());
|
player.getInventory().clear(player.getInventory().getHeldItemSlot());
|
||||||
player.sendMessage(ChatColor.GRAY + "Books are currently disabled.");
|
player.sendMessage(ChatColor.GRAY + "Books are currently disabled.");
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
|
@ -19,7 +19,7 @@ public class Command_toggle extends FreedomCommand
|
|||||||
private final List<String> toggles = Arrays.asList(
|
private final List<String> toggles = Arrays.asList(
|
||||||
"waterplace", "fireplace", "lavaplace", "fluidspread", "lavadmg", "firespread", "frostwalk",
|
"waterplace", "fireplace", "lavaplace", "fluidspread", "lavadmg", "firespread", "frostwalk",
|
||||||
"firework", "prelog", "lockdown", "petprotect", "entitywipe", "nonuke [range] [count]",
|
"firework", "prelog", "lockdown", "petprotect", "entitywipe", "nonuke [range] [count]",
|
||||||
"explosives [radius]", "unsafeenchs", "bells", "armorstands", "masterblocks", "grindstones",
|
"explosives [radius]", "unsafeenchs", "bells", "armorstands", "masterblocks", "books", "grindstones",
|
||||||
"jukeboxes", "spawners", "4chan", "beehives", "respawnanchors", "autotp", "autoclear", "minecarts", "mp44",
|
"jukeboxes", "spawners", "4chan", "beehives", "respawnanchors", "autotp", "autoclear", "minecarts", "mp44",
|
||||||
"landmines", "tossmob", "gravity");
|
"landmines", "tossmob", "gravity");
|
||||||
|
|
||||||
@ -199,6 +199,12 @@ public class Command_toggle extends FreedomCommand
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case "books":
|
||||||
|
{
|
||||||
|
toggle("Books are", ConfigEntry.ALLOW_BOOKS);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case "grindstones":
|
case "grindstones":
|
||||||
{
|
{
|
||||||
toggle("Grindstones are", ConfigEntry.ALLOW_GRINDSTONES);
|
toggle("Grindstones are", ConfigEntry.ALLOW_GRINDSTONES);
|
||||||
|
@ -34,6 +34,7 @@ public enum ConfigEntry
|
|||||||
AUTO_CLEAR(Boolean.class, "allow.auto_clear"),
|
AUTO_CLEAR(Boolean.class, "allow.auto_clear"),
|
||||||
ALLOW_GRAVITY(Boolean.class, "allow.gravity"),
|
ALLOW_GRAVITY(Boolean.class, "allow.gravity"),
|
||||||
ALLOW_MASTERBLOCKS(Boolean.class, "allow.masterblocks"),
|
ALLOW_MASTERBLOCKS(Boolean.class, "allow.masterblocks"),
|
||||||
|
ALLOW_BOOKS(Boolean.class, "allow.books"),
|
||||||
//
|
//
|
||||||
BLOCKED_CHATCODES(String.class, "blocked_chatcodes"),
|
BLOCKED_CHATCODES(String.class, "blocked_chatcodes"),
|
||||||
//
|
//
|
||||||
|
@ -220,6 +220,7 @@ allow:
|
|||||||
auto_clear: false
|
auto_clear: false
|
||||||
gravity: false
|
gravity: false
|
||||||
masterblocks: false
|
masterblocks: false
|
||||||
|
books: true
|
||||||
|
|
||||||
blocked_commands:
|
blocked_commands:
|
||||||
#
|
#
|
||||||
|
Loading…
Reference in New Issue
Block a user