SteamWar/BauSystem2.0
Archiviert
12
0

Update Permission #220

Zusammengeführt
YoyoNow hat 35 Commits von PermissionUpdate nach master 2024-02-17 08:53:31 +01:00 zusammengeführt
5 geänderte Dateien mit 13 neuen und 4 gelöschten Zeilen
Nur Änderungen aus Commit a61f1e2c8c werden angezeigt - Alle Commits anzeigen

Datei anzeigen

@ -56,7 +56,7 @@ public enum Permission {
return this != SPECTATOR; return this != SPECTATOR;
} }
BauweltMember bauweltMember = BauweltMember.getBauMember(BauServer.getInstance().getOwner(), member.getUniqueId()); BauweltMember bauweltMember = BauweltMember.getBauMember(BauServer.getInstance().getOwner(), member.getUniqueId());
if (bauweltMember == null) return false; if (bauweltMember == null) return this == SPECTATOR;
return permissionPredicate.test(bauweltMember); return permissionPredicate.test(bauweltMember);
} }
} }

Datei anzeigen

@ -47,10 +47,11 @@ public class InfoCommand extends SWCommand {
StringBuilder membermessage = new StringBuilder(); StringBuilder membermessage = new StringBuilder();
membermessage.append(BauSystem.MESSAGE.parsePrefixed("BAU_INFO_COMMAND_MEMBER", p, members.size())); membermessage.append(BauSystem.MESSAGE.parsePrefixed("BAU_INFO_COMMAND_MEMBER", p, members.size()));
for (BauweltMember member : members) { for (int i = 0; i < members.size(); i++) {
if (!membermessage.isEmpty()) { if (i != 0) {
membermessage.append(", "); membermessage.append(", ");
} }
BauweltMember member = members.get(i);
if (Permission.SUPERVISOR.hasPermission(member)) { if (Permission.SUPERVISOR.hasPermission(member)) {
membermessage.append("§c").append(SteamwarUser.get(member.getMemberID()).getUserName()); membermessage.append("§c").append(SteamwarUser.get(member.getMemberID()).getUserName());
} else if (Permission.BUILD.hasPermission(member)) { } else if (Permission.BUILD.hasPermission(member)) {

Datei anzeigen

@ -123,6 +123,7 @@ public class SteamWarLuaPlugin extends TwoArgFunction {
return LuaValue.NIL; return LuaValue.NIL;
} }
command = preprocessEvent.getMessage().substring(1);
Veraltet
Review

Unrelated Bugfix?

Unrelated Bugfix?
Bukkit.getLogger().log(Level.INFO, player.getName() + " dispatched command: " + command); Bukkit.getLogger().log(Level.INFO, player.getName() + " dispatched command: " + command);
String[] commandSplit = command.split(" "); String[] commandSplit = command.split(" ");
if (!commandSplit[0].equals("select") && hasFAWE && WorldEditListener.isWorldEditCommand("/" + commandSplit[0])) { if (!commandSplit[0].equals("select") && hasFAWE && WorldEditListener.isWorldEditCommand("/" + commandSplit[0])) {

Datei anzeigen

@ -20,6 +20,7 @@
package de.steamwar.bausystem.features.script.lua.libs; package de.steamwar.bausystem.features.script.lua.libs;
import de.steamwar.bausystem.BauSystem; import de.steamwar.bausystem.BauSystem;
import de.steamwar.bausystem.Permission;
import de.steamwar.bausystem.features.tpslimit.TPSUtils; import de.steamwar.bausystem.features.tpslimit.TPSUtils;
import de.steamwar.core.TPSWatcher; import de.steamwar.core.TPSWatcher;
import de.steamwar.inventory.SWItem; import de.steamwar.inventory.SWItem;
@ -50,6 +51,9 @@ public class ServerLib implements LuaLib {
serverLib.set("getBlockAt", new OneArgFunction() { serverLib.set("getBlockAt", new OneArgFunction() {
@Override @Override
public LuaValue call(LuaValue arg1) { public LuaValue call(LuaValue arg1) {
if (!Permission.SUPERVISOR.hasPermission(player)) {
return LuaValue.NIL;
}
LuaTable pos = arg1.checktable(); LuaTable pos = arg1.checktable();
return valueOf(player.getWorld().getBlockAt(pos.get("x").checkint(), pos.get("y").checkint(), pos.get("z").checkint()).getType().name()); return valueOf(player.getWorld().getBlockAt(pos.get("x").checkint(), pos.get("y").checkint(), pos.get("z").checkint()).getType().name());
} }
@ -57,6 +61,9 @@ public class ServerLib implements LuaLib {
serverLib.set("setBlockAt", new TwoArgFunction() { serverLib.set("setBlockAt", new TwoArgFunction() {
@Override @Override
public LuaValue call(LuaValue arg1, LuaValue arg2) { public LuaValue call(LuaValue arg1, LuaValue arg2) {
if (!Permission.SUPERVISOR.hasPermission(player)) {
return LuaValue.NIL;
}
LuaTable pos = arg1.checktable(); LuaTable pos = arg1.checktable();
LuaString material = arg2.checkstring(); LuaString material = arg2.checkstring();
Material mat = SWItem.getMaterial(material.tojstring()); Material mat = SWItem.getMaterial(material.tojstring());

Datei anzeigen

@ -32,7 +32,7 @@ public class AxiomPermissionCheck implements Listener {
@EventHandler @EventHandler
public void onAxiomHandshake(AxiomHandshakeEvent event) { public void onAxiomHandshake(AxiomHandshakeEvent event) {
if (Permission.BUILD.hasPermission(event.getPlayer())) return; if (!Permission.BUILD.hasPermission(event.getPlayer())) return;
event.setCancelled(true); event.setCancelled(true);
} }
} }