forked from SteamWar/SteamWar
Fix RegionLib.type
This commit is contained in:
@@ -181,7 +181,6 @@ public class RegionListener implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private static void tagChangedRegion(final Location location) {
|
private static void tagChangedRegion(final Location location) {
|
||||||
Region.getRegion(location).getFlags().set(Flag.CHANGED, ChangedMode.HAS_CHANGE);
|
Region.getRegion(location).getFlags().set(Flag.CHANGED, ChangedMode.HAS_CHANGE);
|
||||||
}
|
}
|
||||||
|
|||||||
+8
-3
@@ -29,6 +29,7 @@ import org.luaj.vm2.LuaTable;
|
|||||||
import org.luaj.vm2.LuaValue;
|
import org.luaj.vm2.LuaValue;
|
||||||
import org.luaj.vm2.lib.OneArgFunction;
|
import org.luaj.vm2.lib.OneArgFunction;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.function.Supplier;
|
import java.util.function.Supplier;
|
||||||
|
|
||||||
@@ -46,11 +47,15 @@ public class RegionLib implements LuaLib {
|
|||||||
table.set("name", getter(() -> region.get().getID().toString()));
|
table.set("name", getter(() -> region.get().getID().toString()));
|
||||||
table.set("id", getter(() -> region.get().getID().toString()));
|
table.set("id", getter(() -> region.get().getID().toString()));
|
||||||
table.set("type", getter(() -> {
|
table.set("type", getter(() -> {
|
||||||
Region region1 = region.get();
|
Region rg = region.get();
|
||||||
if (region1.getType().isGlobal()) {
|
if (rg.getType().isGlobal()) {
|
||||||
return "global";
|
return "global";
|
||||||
}
|
}
|
||||||
return region1.getType().name().toLowerCase();
|
List<String> chatNames = rg.getGameModeConfig().getServer().getChatNames();
|
||||||
|
if (chatNames.isEmpty()) {
|
||||||
|
return "unknown";
|
||||||
|
}
|
||||||
|
return chatNames.get(0).toLowerCase();
|
||||||
}));
|
}));
|
||||||
|
|
||||||
LuaValue tntLib = LuaValue.tableOf();
|
LuaValue tntLib = LuaValue.tableOf();
|
||||||
|
|||||||
Reference in New Issue
Block a user