Merge remote-tracking branch 'origin/master'
Dieser Commit ist enthalten in:
Commit
f677ac23c0
@ -68,7 +68,7 @@ public class KillAllCommand extends SWCommand {
|
||||
entity.remove();
|
||||
count.incrementAndGet();
|
||||
});
|
||||
RegionUtils.actionBar(GlobalRegion.getInstance(), BauSystem.MESSAGE.parse("OTHER_KILLALL_GLOBAL", player, count.get()));
|
||||
RegionUtils.actionBar(GlobalRegion.getInstance(), "OTHER_KILLALL_GLOBAL", count.get());
|
||||
} else {
|
||||
WORLD.getEntities()
|
||||
.stream()
|
||||
@ -78,7 +78,7 @@ public class KillAllCommand extends SWCommand {
|
||||
entity.remove();
|
||||
count.incrementAndGet();
|
||||
});
|
||||
RegionUtils.actionBar(region, BauSystem.MESSAGE.parse("OTHER_KILLALL_REGION", player, count.get()));
|
||||
RegionUtils.actionBar(region, "OTHER_KILLALL_REGION", count.get());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -49,9 +49,9 @@ public class DamageCommand extends SWCommand {
|
||||
if (!permissionCheck(p)) return;
|
||||
Region region = Region.getRegion(p.getLocation());
|
||||
if (toggle(region)) {
|
||||
RegionUtils.actionBar(region, BauSystem.MESSAGE.parse(getEnableMessage(), p));
|
||||
RegionUtils.actionBar(region, getEnableMessage());
|
||||
} else {
|
||||
RegionUtils.actionBar(region, BauSystem.MESSAGE.parse(getDisableMessage(), p));
|
||||
RegionUtils.actionBar(region, getDisableMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -48,9 +48,9 @@ public class FireCommand extends SWCommand {
|
||||
if (!permissionCheck(p)) return;
|
||||
Region region = Region.getRegion(p.getLocation());
|
||||
if (toggle(region)) {
|
||||
RegionUtils.actionBar(region, BauSystem.MESSAGE.parse(getEnableMessage(), p));
|
||||
RegionUtils.actionBar(region, getEnableMessage());
|
||||
} else {
|
||||
RegionUtils.actionBar(region, BauSystem.MESSAGE.parse(getDisableMessage(), p));
|
||||
RegionUtils.actionBar(region, getDisableMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -48,9 +48,9 @@ public class FreezeCommand extends SWCommand {
|
||||
if (!permissionCheck(p)) return;
|
||||
Region region = Region.getRegion(p.getLocation());
|
||||
if (toggle(region)) {
|
||||
RegionUtils.actionBar(region, BauSystem.MESSAGE.parse(getEnableMessage(), p));
|
||||
RegionUtils.actionBar(region, getEnableMessage());
|
||||
} else {
|
||||
RegionUtils.actionBar(region, BauSystem.MESSAGE.parse(getDisableMessage(), p));
|
||||
RegionUtils.actionBar(region, getDisableMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -52,12 +52,12 @@ public class ProtectCommand extends SWCommand {
|
||||
switch (region.getPlain(Flag.PROTECT, ProtectMode.class)) {
|
||||
case ACTIVE:
|
||||
region.set(Flag.PROTECT, ProtectMode.INACTIVE);
|
||||
RegionUtils.actionBar(region, BauSystem.MESSAGE.parse("REGION_PROTECT_DISABLE", p));
|
||||
RegionUtils.actionBar(region, "REGION_PROTECT_DISABLE");
|
||||
break;
|
||||
default:
|
||||
case INACTIVE:
|
||||
region.set(Flag.PROTECT, ProtectMode.ACTIVE);
|
||||
RegionUtils.actionBar(region, BauSystem.MESSAGE.parse("REGION_PROTECT_ENABLE", p));
|
||||
RegionUtils.actionBar(region, "REGION_PROTECT_ENABLE");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -76,7 +76,7 @@ public class TNTCommand extends SWCommand {
|
||||
requestedMessage = getTestblockEnableMessage();
|
||||
break;
|
||||
}
|
||||
tntToggle(region, tntMode, BauSystem.MESSAGE.parse(requestedMessage, p));
|
||||
tntToggle(region, tntMode, requestedMessage);
|
||||
}
|
||||
|
||||
@ClassMapper(value = TNTMode.class, local = true)
|
||||
|
@ -47,11 +47,11 @@ public class TNTListener implements Listener {
|
||||
return false;
|
||||
}
|
||||
if (region.hasType(RegionType.BUILD) && region.inRegion(block.getLocation(), RegionType.BUILD, RegionExtensionType.NORMAL)) {
|
||||
RegionUtils.actionBarNew(region, "REGION_TNT_BUILD");
|
||||
RegionUtils.actionBar(region, "REGION_TNT_BUILD");
|
||||
return true;
|
||||
}
|
||||
if (region.hasType(RegionType.BUILD) && region.inRegion(block.getLocation(), RegionType.BUILD, RegionExtensionType.EXTENSION)) {
|
||||
RegionUtils.actionBarNew(region, "REGION_TNT_BUILD");
|
||||
RegionUtils.actionBar(region, "REGION_TNT_BUILD");
|
||||
return true;
|
||||
}
|
||||
return value == TNTMode.DENY;
|
||||
|
@ -39,15 +39,7 @@ import java.util.function.Function;
|
||||
@UtilityClass
|
||||
public class RegionUtils {
|
||||
|
||||
public void actionBar(Region region, String s) {
|
||||
Bukkit.getOnlinePlayers()
|
||||
.stream()
|
||||
.filter(player -> region.inRegion(player.getLocation(), RegionType.NORMAL, RegionExtensionType.NORMAL))
|
||||
.filter(player -> !region.isGlobal() || Region.getRegion(player.getLocation()).isGlobal())
|
||||
.forEach(player -> player.spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText(s)));
|
||||
}
|
||||
|
||||
public void actionBarNew(Region region, String s, Object... objects) {
|
||||
public void actionBar(Region region, String s, Object... objects) {
|
||||
Bukkit.getOnlinePlayers()
|
||||
.stream()
|
||||
.filter(player -> region.inRegion(player.getLocation(), RegionType.NORMAL, RegionExtensionType.NORMAL))
|
||||
@ -55,22 +47,12 @@ public class RegionUtils {
|
||||
.forEach(player -> player.spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText(BauSystem.MESSAGE.parse(s, player, objects))));
|
||||
}
|
||||
|
||||
public static void messageOLD(Region region, String s) {
|
||||
Bukkit.getOnlinePlayers()
|
||||
.stream()
|
||||
.filter(player -> region.inRegion(player.getLocation(), RegionType.NORMAL, RegionExtensionType.NORMAL))
|
||||
.filter(player -> !region.isGlobal() || Region.getRegion(player.getLocation()).isGlobal())
|
||||
.forEach(player -> player.sendMessage(s));
|
||||
}
|
||||
|
||||
public static void message(Region region, String message, Object... objects) {
|
||||
Bukkit.getOnlinePlayers()
|
||||
.stream()
|
||||
.filter(player -> region.inRegion(player.getLocation(), RegionType.NORMAL, RegionExtensionType.NORMAL))
|
||||
.filter(player -> !region.isGlobal() || Region.getRegion(player.getLocation()).isGlobal())
|
||||
.forEach(player -> {
|
||||
BauSystem.MESSAGE.send(message, player, objects);
|
||||
});
|
||||
.forEach(player -> BauSystem.MESSAGE.send(message, player, objects));
|
||||
}
|
||||
|
||||
public static void message(Region region, Function<Player, String> function) {
|
||||
|
@ -35,11 +35,11 @@ public class Updater {
|
||||
if (file.lastModified() > lastUpdate + 10) {
|
||||
try {
|
||||
updaterCode.run();
|
||||
lastUpdate = file.lastModified();
|
||||
Bukkit.getLogger().log(Level.INFO, "Update complete of " + file.getAbsolutePath());
|
||||
} catch (Exception e) {
|
||||
Bukkit.getLogger().log(Level.INFO, "Error while loading file " + file.getAbsolutePath() + " for config: " + e.getMessage(), e);
|
||||
}
|
||||
lastUpdate = file.lastModified();
|
||||
}
|
||||
}, 20, 20);
|
||||
}
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren