Signed-off-by: yoyosource <yoyosource@nidido.de>
Dieser Commit ist enthalten in:
Ursprung
0b992a5663
Commit
fd1e021e80
@ -37,6 +37,7 @@ public class FireListener implements Listener, ScoreboardElement {
|
||||
|
||||
@Override
|
||||
public String get(Region region, Player p) {
|
||||
if (region.get(Flag.FIRE) == Flag.FIRE.getDefaultValue()) return null;
|
||||
return "§e" + BauSystem.MESSAGE.parse(Flag.FIRE.getChatValue(), p) + "§8: " + BauSystem.MESSAGE.parse(region.get(Flag.FIRE).getChatValue(), p);
|
||||
}
|
||||
}
|
||||
|
@ -199,6 +199,7 @@ public class FreezeListener implements Listener, ScoreboardElement {
|
||||
|
||||
@Override
|
||||
public String get(Region region, Player p) {
|
||||
if (region.get(Flag.FREEZE) == Flag.FREEZE.getDefaultValue()) return null;
|
||||
return "§e" + BauSystem.MESSAGE.parse(Flag.FREEZE.getChatValue(), p) + "§8: " + BauSystem.MESSAGE.parse(region.get(Flag.FREEZE).getChatValue(), p);
|
||||
}
|
||||
}
|
||||
|
@ -54,16 +54,6 @@ public class ItemsCommand extends SWCommand {
|
||||
}
|
||||
}
|
||||
|
||||
@Register(value = "global")
|
||||
public void globalToggleCommand(@Validator Player p) {
|
||||
Region region = GlobalRegion.getInstance();
|
||||
if (toggle(region)) {
|
||||
RegionUtils.actionBar(region, getEnableMessage());
|
||||
} else {
|
||||
RegionUtils.actionBar(region, getDisableMessage());
|
||||
}
|
||||
}
|
||||
|
||||
private String getNoPermMessage() {
|
||||
return "REGION_ITEMS_NO_PERMS";
|
||||
}
|
||||
|
@ -20,7 +20,6 @@
|
||||
package de.steamwar.bausystem.features.region;
|
||||
|
||||
import de.steamwar.bausystem.BauSystem;
|
||||
import de.steamwar.bausystem.region.GlobalRegion;
|
||||
import de.steamwar.bausystem.region.Region;
|
||||
import de.steamwar.bausystem.region.flags.Flag;
|
||||
import de.steamwar.bausystem.region.flags.flagvalues.ItemMode;
|
||||
@ -37,8 +36,6 @@ import org.bukkit.event.entity.ItemSpawnEvent;
|
||||
public class ItemsListener implements Listener, ScoreboardElement {
|
||||
|
||||
private static ItemMode getMode(Region region) {
|
||||
ItemMode itemMode = GlobalRegion.getInstance().getPlain(Flag.ITEMS, ItemMode.class);
|
||||
if (itemMode == ItemMode.INACTIVE) return ItemMode.INACTIVE;
|
||||
return region.getPlain(Flag.ITEMS, ItemMode.class);
|
||||
}
|
||||
|
||||
@ -61,8 +58,7 @@ public class ItemsListener implements Listener, ScoreboardElement {
|
||||
|
||||
@Override
|
||||
public String get(Region region, Player p) {
|
||||
ItemMode itemMode = getMode(region);
|
||||
if (itemMode == ItemMode.ACTIVE) return null;
|
||||
return "§e" + BauSystem.MESSAGE.parse(Flag.ITEMS.getChatValue(), p) + "§8: " + BauSystem.MESSAGE.parse(itemMode.getChatValue(), p);
|
||||
if (region.get(Flag.ITEMS) == Flag.ITEMS.getDefaultValue()) return null;
|
||||
return "§e" + BauSystem.MESSAGE.parse(Flag.ITEMS.getChatValue(), p) + "§8: " + BauSystem.MESSAGE.parse(region.get(Flag.ITEMS).getChatValue(), p);
|
||||
}
|
||||
}
|
||||
|
@ -53,6 +53,7 @@ public class ProtectListener implements Listener, ScoreboardElement {
|
||||
@Override
|
||||
public String get(Region region, Player p) {
|
||||
if (region.getFloorLevel() == 0) return null;
|
||||
if (region.get(Flag.PROTECT) != Flag.PROTECT.getDefaultValue()) return null;
|
||||
return "§e" + BauSystem.MESSAGE.parse(Flag.PROTECT.getChatValue(), p) + "§8: " + BauSystem.MESSAGE.parse(region.get(Flag.PROTECT).getChatValue(), p);
|
||||
}
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ public enum Flag implements EnumDisplay {
|
||||
FIRE("FLAG_FIRE", FireMode.class, FireMode.ALLOW),
|
||||
FREEZE("FLAG_FREEZE", FreezeMode.class, FreezeMode.INACTIVE),
|
||||
PROTECT("FLAG_PROTECT", ProtectMode.class, ProtectMode.ACTIVE),
|
||||
ITEMS("FLAG_ITEMS", ItemMode.class, ItemMode.ACTIVE),
|
||||
ITEMS("FLAG_ITEMS", ItemMode.class, ItemMode.INACTIVE),
|
||||
;
|
||||
|
||||
@Getter
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren