mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-10-01 17:45:57 -04:00
Don't check volume for /buy level
This commit is contained in:
parent
fd9676456d
commit
6a03bffebe
@ -20,6 +20,7 @@ using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using MCGalaxy.Commands.CPE;
|
||||
using MCGalaxy.Commands.Moderation;
|
||||
using MCGalaxy.Generator;
|
||||
|
||||
namespace MCGalaxy.Commands.World {
|
||||
public sealed partial class CmdOverseer : Command2 {
|
||||
@ -159,7 +160,7 @@ namespace MCGalaxy.Commands.World {
|
||||
Level lvl = newLvl.GenerateMap(p, args, p.DefaultCmdData);
|
||||
if (lvl == null) return;
|
||||
|
||||
SetPerms(p, lvl);
|
||||
MapGen.SetRealmPerms(p, lvl);
|
||||
p.Message("Use %T/os zone add [name] %Sto allow other players to build in the map.");
|
||||
|
||||
try {
|
||||
@ -170,18 +171,6 @@ namespace MCGalaxy.Commands.World {
|
||||
}
|
||||
}
|
||||
|
||||
internal static void SetPerms(Player p, Level lvl) {
|
||||
lvl.Config.RealmOwner = p.name;
|
||||
const LevelPermission rank = LevelPermission.Nobody;
|
||||
lvl.BuildAccess.Whitelist(Player.Console, rank, lvl, p.name);
|
||||
lvl.VisitAccess.Whitelist(Player.Console, rank, lvl, p.name);
|
||||
|
||||
Group grp = Group.Find(Server.Config.OSPerbuildDefault);
|
||||
if (grp == null) return;
|
||||
|
||||
lvl.BuildAccess.SetMin(Player.Console, rank, lvl, grp);
|
||||
}
|
||||
|
||||
static void DeleteMap(Player p, string value) {
|
||||
if (value.Length > 0) {
|
||||
p.Message("To delete your current map, type %T/os map delete");
|
||||
|
@ -96,15 +96,13 @@ namespace MCGalaxy.Eco {
|
||||
|
||||
ushort x = 0, y = 0, z = 0;
|
||||
string[] xyz = { preset.x, preset.y, preset.z };
|
||||
if (!MapGen.GetDimensions(p, xyz, 0, ref x, ref y, ref z)) return;
|
||||
if (!MapGen.GetDimensions(p, xyz, 0, ref x, ref y, ref z, false)) return;
|
||||
|
||||
MapGen gen = MapGen.Find(preset.type);
|
||||
Level lvl = MapGen.Generate(p, gen, name, x, y, z, "");
|
||||
if (lvl == null) return;
|
||||
|
||||
CmdOverseer.SetPerms(p, lvl);
|
||||
lvl.SaveSettings();
|
||||
|
||||
MapGen.SetRealmPerms(p, lvl);
|
||||
try {
|
||||
lvl.Save(true);
|
||||
} finally {
|
||||
|
@ -120,12 +120,12 @@ namespace MCGalaxy.Generator {
|
||||
}
|
||||
|
||||
public static bool GetDimensions(Player p, string[] args, int i,
|
||||
ref ushort x, ref ushort y, ref ushort z) {
|
||||
ref ushort x, ref ushort y, ref ushort z, bool checkVolume = true) {
|
||||
return
|
||||
CheckMapAxis(p, args[i ], "Width", ref x) &&
|
||||
CheckMapAxis(p, args[i + 1], "Height", ref y) &&
|
||||
CheckMapAxis(p, args[i + 2], "Length", ref z) &&
|
||||
CheckMapVolume(p, x, y, z);
|
||||
(!checkVolume || CheckMapVolume(p, x, y, z));
|
||||
}
|
||||
|
||||
static bool CheckMapAxis(Player p, string input, string type, ref ushort len) {
|
||||
@ -144,5 +144,18 @@ namespace MCGalaxy.Generator {
|
||||
p.Message(text);
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary> Sets default permissions for a newly generated realm map. </summary>
|
||||
internal static void SetRealmPerms(Player p, Level lvl) {
|
||||
lvl.Config.RealmOwner = p.name;
|
||||
const LevelPermission rank = LevelPermission.Nobody;
|
||||
lvl.BuildAccess.Whitelist(Player.Console, rank, lvl, p.name);
|
||||
lvl.VisitAccess.Whitelist(Player.Console, rank, lvl, p.name);
|
||||
|
||||
Group grp = Group.Find(Server.Config.OSPerbuildDefault);
|
||||
if (grp == null) return;
|
||||
|
||||
lvl.BuildAccess.SetMin(Player.Console, rank, lvl, grp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user