geforkt von Mirrors/FastAsyncWorldEdit
Added /worldedit tz to set your timezone. It currently does not persist yet. Example: /we tz america/los_angeles
Dieser Commit ist enthalten in:
Ursprung
12ba1a9fc4
Commit
66edfbbae6
@ -19,6 +19,10 @@
|
|||||||
|
|
||||||
package com.sk89q.worldedit.commands;
|
package com.sk89q.worldedit.commands;
|
||||||
|
|
||||||
|
import java.text.DateFormat;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.Calendar;
|
||||||
|
import java.util.TimeZone;
|
||||||
import com.sk89q.minecraft.util.commands.Command;
|
import com.sk89q.minecraft.util.commands.Command;
|
||||||
import com.sk89q.minecraft.util.commands.CommandContext;
|
import com.sk89q.minecraft.util.commands.CommandContext;
|
||||||
import com.sk89q.minecraft.util.commands.CommandPermissions;
|
import com.sk89q.minecraft.util.commands.CommandPermissions;
|
||||||
@ -29,6 +33,8 @@ import com.sk89q.worldedit.WorldEdit;
|
|||||||
import com.sk89q.worldedit.WorldEditException;
|
import com.sk89q.worldedit.WorldEditException;
|
||||||
|
|
||||||
public class WorldEditCommands {
|
public class WorldEditCommands {
|
||||||
|
private static DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss z");
|
||||||
|
|
||||||
@Command(
|
@Command(
|
||||||
aliases = {"version", "ver"},
|
aliases = {"version", "ver"},
|
||||||
usage = "",
|
usage = "",
|
||||||
@ -73,4 +79,21 @@ public class WorldEditCommands {
|
|||||||
session.setCUISupport(true);
|
session.setCUISupport(true);
|
||||||
session.dispatchCUISetup(player);
|
session.dispatchCUISetup(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Command(
|
||||||
|
aliases = {"tz"},
|
||||||
|
usage = "[timezone]",
|
||||||
|
desc = "Set your timezone",
|
||||||
|
min = 1,
|
||||||
|
max = 1
|
||||||
|
)
|
||||||
|
public static void tz(CommandContext args, WorldEdit we,
|
||||||
|
LocalSession session, LocalPlayer player, EditSession editSession)
|
||||||
|
throws WorldEditException {
|
||||||
|
TimeZone tz = TimeZone.getTimeZone(args.getString(0));
|
||||||
|
session.setTimezone(tz);
|
||||||
|
player.print("Timezone set for this session to: " + tz.getDisplayName());
|
||||||
|
player.print("The current time in that timezone is: "
|
||||||
|
+ dateFormat.format(Calendar.getInstance(tz).getTime()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren