diff --git a/Bukkit/src/main/resources/plugin.yml b/Bukkit/src/main/resources/plugin.yml index 4c6f33b10..f60db3d67 100644 --- a/Bukkit/src/main/resources/plugin.yml +++ b/Bukkit/src/main/resources/plugin.yml @@ -126,6 +126,7 @@ permissions: plots.toggle: true plots.toggle.titles: true plots.toggle.chat: true + plots.toggle.time: true plots.set.biome: true plots.set.home: true plots.set.alias: true diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Toggle.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Toggle.java index e19d81762..11715fcbf 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Toggle.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Toggle.java @@ -75,6 +75,18 @@ import com.github.intellectualsites.plotsquared.plot.util.MainUtil; } } + @CommandDeclaration(command = "time", permission = "plots.toggle.time", + description = "Toggle plot time settings") + public void time(Command command, PlotPlayer player, String[] args, + RunnableVal3 confirm, + RunnableVal2 whenDone) { + if (toggle(player, "disabletime")) { + MainUtil.sendMessage(player, Captions.TOGGLE_ENABLED, command.toString()); + } else { + MainUtil.sendMessage(player, Captions.TOGGLE_DISABLED, command.toString()); + } + } + public boolean toggle(PlotPlayer player, String key) { if (player.getAttribute(key)) { player.removeAttribute(key); diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/Captions.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/Captions.java index 5fd74a9ea..f9f33c20e 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/Captions.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/Captions.java @@ -52,6 +52,7 @@ public enum Captions { PERMISSION_WORLDEDIT_BYPASS("plots.worldedit.bypass", "static.permissions"), PERMISSION_PLOT_TOGGLE_TITLES("plots.toggle.titles", "static.permissions"), PERMISSION_PLOT_TOGGLE_CHAT("plots.toggle.chat", "static.permissions"), + PERMISSION_PLOT_TOGGLE_TIME("plots.toggle.time", "static.permissions"), PERMISSION_ADMIN_UPDATE_NOTIFICATION("plots.admin.update.notify", "static.permissions"), PERMISSION_ADMIN_EXIT_DENIED("plots.admin.exit.denied", "static.permissions"), PERMISSION_ADMIN_ENTRY_DENIED("plots.admin.entry.denied", "static.permissions"), diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/HybridPlotManager.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/HybridPlotManager.java index 2634f4af1..c3aaa3857 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/HybridPlotManager.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/HybridPlotManager.java @@ -44,7 +44,7 @@ public class HybridPlotManager extends ClassicPlotManager { Files.readAllBytes(sideRoad.toPath()))); } File intersection = - MainUtil.getFile(PlotSquared.get().IMP.getDirectory(), "intersection.schem"); + MainUtil.getFile(PlotSquared.get().IMP.getDirectory(), dir + "intersection.schem"); if (intersection.exists()) { files.add(new FileBytes(newDir + "intersection.schem", Files.readAllBytes(intersection.toPath()))); diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/PlotListener.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/PlotListener.java index c26c4231e..6d738b758 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/PlotListener.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/PlotListener.java @@ -122,7 +122,7 @@ public class PlotListener { } } Optional timeFlag = plot.getFlag(Flags.TIME); - if (timeFlag.isPresent()) { + if (timeFlag.isPresent() && !player.getAttribute("disabletime")) { try { long time = timeFlag.get(); player.setTime(time); diff --git a/Core/src/main/resources/addplots.js b/Core/src/main/resources/addplots.js index b45f8d4ff..f3696d7ff 100644 --- a/Core/src/main/resources/addplots.js +++ b/Core/src/main/resources/addplots.js @@ -1,6 +1,6 @@ /* This will increase a player's allowed plots by the provided value -/plot debugexec runasync addperm +/plot debugexec runasync addplots.js */ var uuid = UUIDHandler.getUUID('%s0', null); if (uuid === null) { diff --git a/Core/src/main/resources/automerge.js b/Core/src/main/resources/automerge.js index 220a24867..e2846f87e 100644 --- a/Core/src/main/resources/automerge.js +++ b/Core/src/main/resources/automerge.js @@ -1,32 +1,6 @@ /* -Need to script something quick with PlotSquared? -/plot debugexec runasync automerge.js - This is an example script that will auto merge all plots - -The following utility classes are usable: - - PlotSquared - - TaskManager - - TitleManager - - ConsolePlayer - - SchematicHandler - - ChunkManager - - BlockManager - - SetupUtils - - EventUtil - - UUIDHandler - - DBFunc - - HybridUtils - - IMP ( BukkitMain or SpongeMain) - - MainCommand - - MainUtil - - Settings - - StringMan - - MathMan - - C ( use C_ ) - - Permissions ( use Permissions_ ) - - For more information see: https://github.com/IntellectualSites/PlotSquared/wiki/Scripting +/plot debugexec runasync automerge.js */ var plots = PS.sortPlotsByTemp(PS.getPlots()); PS.class.static.log("Attempting to auto merge " + plots.size() + " plots"); diff --git a/Core/src/main/resources/bridge.template b/Core/src/main/resources/bridge.template index d5f9ccd93..0e21a3a17 100644 Binary files a/Core/src/main/resources/bridge.template and b/Core/src/main/resources/bridge.template differ diff --git a/Core/src/main/resources/fixborders.js b/Core/src/main/resources/fixborders.js index 779b54c61..1becaeb60 100644 --- a/Core/src/main/resources/fixborders.js +++ b/Core/src/main/resources/fixborders.js @@ -1,31 +1,6 @@ /* -Need to script something quick with PlotSquared? -/plot debugexec runasync fixborder.js - - -The following utility classes are usable: - - PS - - TaskManager - - TitleManager - - ConsolePlayer - - SchematicHandler - - ChunkManager - - BlockManager - - SetupUtils - - EventUtil - - UUIDHandler - - DBFunc - - HybridUtils - - IMP ( BukkitMain or SpongeMain) - - MainCommand - - MainUtil - - Settings - - StringMan - - MathMan - - C ( use C_ ) - - Permissions ( use Permissions_ ) - - For more information see: https://github.com/IntellectualSites/PlotSquared/wiki/Scripting +Fixes border around plots +/plot debugexec runasync fixborder.js */ var plots = PS.sortPlotsByTemp(PS.getPlots()); PS.class.static.log("Attempting to fix border for " + plots.size() + " plots"); diff --git a/Core/src/main/resources/skyblock.template b/Core/src/main/resources/skyblock.template deleted file mode 100644 index 1801175de..000000000 Binary files a/Core/src/main/resources/skyblock.template and /dev/null differ diff --git a/Core/src/main/resources/town.template b/Core/src/main/resources/town.template index f655fbd0a..5210fc432 100644 Binary files a/Core/src/main/resources/town.template and b/Core/src/main/resources/town.template differ diff --git a/Nukkit/src/main/resources/plugin.yml b/Nukkit/src/main/resources/plugin.yml index a25e26cf9..d17737c50 100644 --- a/Nukkit/src/main/resources/plugin.yml +++ b/Nukkit/src/main/resources/plugin.yml @@ -119,6 +119,7 @@ permissions: plots.toggle: true plots.toggle.titles: true plots.toggle.chat: true + plots.toggle.time: true plots.set.biome: true plots.set.home: true plots.set.alias: true