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
|
@Override
|
||||||
public String get(Region region, Player p) {
|
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);
|
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
|
@Override
|
||||||
public String get(Region region, Player p) {
|
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);
|
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() {
|
private String getNoPermMessage() {
|
||||||
return "REGION_ITEMS_NO_PERMS";
|
return "REGION_ITEMS_NO_PERMS";
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,6 @@
|
|||||||
package de.steamwar.bausystem.features.region;
|
package de.steamwar.bausystem.features.region;
|
||||||
|
|
||||||
import de.steamwar.bausystem.BauSystem;
|
import de.steamwar.bausystem.BauSystem;
|
||||||
import de.steamwar.bausystem.region.GlobalRegion;
|
|
||||||
import de.steamwar.bausystem.region.Region;
|
import de.steamwar.bausystem.region.Region;
|
||||||
import de.steamwar.bausystem.region.flags.Flag;
|
import de.steamwar.bausystem.region.flags.Flag;
|
||||||
import de.steamwar.bausystem.region.flags.flagvalues.ItemMode;
|
import de.steamwar.bausystem.region.flags.flagvalues.ItemMode;
|
||||||
@ -37,8 +36,6 @@ import org.bukkit.event.entity.ItemSpawnEvent;
|
|||||||
public class ItemsListener implements Listener, ScoreboardElement {
|
public class ItemsListener implements Listener, ScoreboardElement {
|
||||||
|
|
||||||
private static ItemMode getMode(Region region) {
|
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);
|
return region.getPlain(Flag.ITEMS, ItemMode.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -61,8 +58,7 @@ public class ItemsListener implements Listener, ScoreboardElement {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String get(Region region, Player p) {
|
public String get(Region region, Player p) {
|
||||||
ItemMode itemMode = getMode(region);
|
if (region.get(Flag.ITEMS) == Flag.ITEMS.getDefaultValue()) return null;
|
||||||
if (itemMode == ItemMode.ACTIVE) return null;
|
return "§e" + BauSystem.MESSAGE.parse(Flag.ITEMS.getChatValue(), p) + "§8: " + BauSystem.MESSAGE.parse(region.get(Flag.ITEMS).getChatValue(), p);
|
||||||
return "§e" + BauSystem.MESSAGE.parse(Flag.ITEMS.getChatValue(), p) + "§8: " + BauSystem.MESSAGE.parse(itemMode.getChatValue(), p);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -53,6 +53,7 @@ public class ProtectListener implements Listener, ScoreboardElement {
|
|||||||
@Override
|
@Override
|
||||||
public String get(Region region, Player p) {
|
public String get(Region region, Player p) {
|
||||||
if (region.getFloorLevel() == 0) return null;
|
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);
|
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),
|
FIRE("FLAG_FIRE", FireMode.class, FireMode.ALLOW),
|
||||||
FREEZE("FLAG_FREEZE", FreezeMode.class, FreezeMode.INACTIVE),
|
FREEZE("FLAG_FREEZE", FreezeMode.class, FreezeMode.INACTIVE),
|
||||||
PROTECT("FLAG_PROTECT", ProtectMode.class, ProtectMode.ACTIVE),
|
PROTECT("FLAG_PROTECT", ProtectMode.class, ProtectMode.ACTIVE),
|
||||||
ITEMS("FLAG_ITEMS", ItemMode.class, ItemMode.ACTIVE),
|
ITEMS("FLAG_ITEMS", ItemMode.class, ItemMode.INACTIVE),
|
||||||
;
|
;
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren