diff --git a/bukkit0/src/main/java/com/boydti/fawe/bukkit/FaweBukkit.java b/bukkit0/src/main/java/com/boydti/fawe/bukkit/FaweBukkit.java index 669c5a1c..7825b78f 100644 --- a/bukkit0/src/main/java/com/boydti/fawe/bukkit/FaweBukkit.java +++ b/bukkit0/src/main/java/com/boydti/fawe/bukkit/FaweBukkit.java @@ -219,6 +219,12 @@ public class FaweBukkit implements IFawe, Listener { return world.getName(); } + @Override + public String getUserName(UUID uuid) { + String name = Bukkit.getOfflinePlayer(uuid).getName(); + return name != null ? name : uuid.toString(); + } + /** * A mask manager handles region restrictions e.g. PlotSquared plots / WorldGuard regions */ diff --git a/core/src/main/java/com/boydti/fawe/Fawe.java b/core/src/main/java/com/boydti/fawe/Fawe.java index b4996268..052ed2d1 100644 --- a/core/src/main/java/com/boydti/fawe/Fawe.java +++ b/core/src/main/java/com/boydti/fawe/Fawe.java @@ -32,6 +32,7 @@ import com.sk89q.worldedit.command.NavigationCommands; import com.sk89q.worldedit.command.RegionCommands; import com.sk89q.worldedit.command.SchematicCommands; import com.sk89q.worldedit.command.ScriptingCommands; +import com.sk89q.worldedit.command.ToolCommands; import com.sk89q.worldedit.command.composition.SelectionCommand; import com.sk89q.worldedit.command.tool.brush.GravityBrush; import com.sk89q.worldedit.event.extent.EditSessionEvent; @@ -277,6 +278,7 @@ public class Fawe { LocalSession.inject(); // Add remember order / queue flushing // Commands BrushCommands.inject(); // Translations + heightmap + ToolCommands.inject(); // Translations + inspect ClipboardCommands.inject(); // Translations + lazycopy + paste optimizations SchematicCommands.inject(); // Translations ScriptingCommands.inject(); // Translations diff --git a/core/src/main/java/com/boydti/fawe/FaweCache.java b/core/src/main/java/com/boydti/fawe/FaweCache.java index bc9b0116..153990e2 100644 --- a/core/src/main/java/com/boydti/fawe/FaweCache.java +++ b/core/src/main/java/com/boydti/fawe/FaweCache.java @@ -16,6 +16,7 @@ import com.sk89q.jnbt.StringTag; import com.sk89q.jnbt.Tag; import com.sk89q.worldedit.CuboidClipboard; import com.sk89q.worldedit.blocks.BaseBlock; +import com.sk89q.worldedit.world.registry.BundledBlockData; import java.awt.Color; import java.lang.reflect.Field; import java.util.ArrayList; @@ -507,6 +508,18 @@ public class FaweCache { } } + public static String getMaterialName(int combined) { + return getMaterialName(getId(combined), getData(combined)); + } + + public static String getMaterialName(int id, int data) { + BundledBlockData.BlockEntry entry = BundledBlockData.getInstance().findById(id); + if (entry == null) { + return data != 0 ? id + ":" + data : id + ""; + } + return data != 0 ? entry.id.replace("minecraft:","") + ":" + data : entry.id.replace("minecraft:",""); + } + public static Map asMap(Object... pairs) { HashMap map = new HashMap(pairs.length >> 1); for (int i = 0; i < pairs.length; i+=2) { diff --git a/core/src/main/java/com/boydti/fawe/command/Rollback.java b/core/src/main/java/com/boydti/fawe/command/Rollback.java index f836b321..7d46fd37 100644 --- a/core/src/main/java/com/boydti/fawe/command/Rollback.java +++ b/core/src/main/java/com/boydti/fawe/command/Rollback.java @@ -3,6 +3,7 @@ package com.boydti.fawe.command; import com.boydti.fawe.Fawe; import com.boydti.fawe.FaweAPI; import com.boydti.fawe.config.BBC; +import com.boydti.fawe.config.Settings; import com.boydti.fawe.object.FaweCommand; import com.boydti.fawe.object.FaweLocation; import com.boydti.fawe.object.FawePlayer; @@ -27,6 +28,24 @@ public class Rollback extends FaweCommand { @Override public boolean execute(final FawePlayer player, final String... args) { + if (!Settings.HISTORY.USE_DATABASE) { + BBC.SETTING_DISABLE.send(player, "history.use-database"); + return false; + } + if (args.length != 3) { + BBC.COMMAND_SYNTAX.send(player, "/frb u: r: t: