SteamWar/BauSystem2.0
Archiviert
12
0

Update to new ColorConfig

Dieser Commit ist enthalten in:
yoyosource 2021-04-17 23:13:13 +02:00
Ursprung faec412eff
Commit 5ec4cf0507
5 geänderte Dateien mit 35 neuen und 39 gelöschten Zeilen

Datei anzeigen

@ -20,10 +20,10 @@
package de.steamwar.bausystem.features.util; package de.steamwar.bausystem.features.util;
import de.steamwar.bausystem.SWUtils; import de.steamwar.bausystem.SWUtils;
import de.steamwar.bausystem.config.ColorConfig;
import de.steamwar.bausystem.linkage.LinkageType; import de.steamwar.bausystem.linkage.LinkageType;
import de.steamwar.bausystem.linkage.Linked; import de.steamwar.bausystem.linkage.Linked;
import de.steamwar.command.SWCommand; import de.steamwar.command.SWCommand;
import net.md_5.bungee.api.ChatColor;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
@ -37,7 +37,7 @@ public class DebugStickCommand extends SWCommand {
@Register(help = true) @Register(help = true)
public void genericHelp(Player p, String... args) { public void genericHelp(Player p, String... args) {
p.sendMessage(ChatColor.DARK_GRAY + "/" + ChatColor.YELLOW + "debugstick " + ChatColor.DARK_GRAY + "-" + ChatColor.GRAY + " Erhalte einen DebugStick"); p.sendMessage(ColorConfig.OTHER + "/" + ColorConfig.HIGHLIGHT + "debugstick " + ColorConfig.OTHER + "-" + ColorConfig.BASE + " Erhalte einen DebugStick");
} }
@Register @Register

Datei anzeigen

@ -20,10 +20,10 @@
package de.steamwar.bausystem.features.util; package de.steamwar.bausystem.features.util;
import de.steamwar.bausystem.SWUtils; import de.steamwar.bausystem.SWUtils;
import de.steamwar.bausystem.config.ColorConfig;
import de.steamwar.bausystem.linkage.LinkageType; import de.steamwar.bausystem.linkage.LinkageType;
import de.steamwar.bausystem.linkage.Linked; import de.steamwar.bausystem.linkage.Linked;
import de.steamwar.command.SWCommand; import de.steamwar.command.SWCommand;
import net.md_5.bungee.api.ChatColor;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType; import org.bukkit.potion.PotionEffectType;
@ -37,17 +37,17 @@ public class NightVisionCommand extends SWCommand {
@Register(help = true) @Register(help = true)
public void genericHelp(Player p, String... args) { public void genericHelp(Player p, String... args) {
p.sendMessage(ChatColor.DARK_GRAY + "/" + ChatColor.YELLOW + "nightvision " + ChatColor.DARK_GRAY + "-" + ChatColor.GRAY + " Schalte Nightvision an oder aus."); p.sendMessage(ColorConfig.OTHER + "/" + ColorConfig.HIGHLIGHT + "nightvision " + ColorConfig.OTHER + "-" + ColorConfig.BASE + " Schalte Nightvision an oder aus.");
} }
@Register @Register
public void genericCommand(Player p) { public void genericCommand(Player p) {
if(p.hasPotionEffect(PotionEffectType.NIGHT_VISION)) { if (p.hasPotionEffect(PotionEffectType.NIGHT_VISION)) {
p.removePotionEffect(PotionEffectType.NIGHT_VISION); p.removePotionEffect(PotionEffectType.NIGHT_VISION);
SWUtils.sendToActionbar(p, ChatColor.YELLOW + "Nightvision aus"); SWUtils.sendToActionbar(p, ColorConfig.HIGHLIGHT + "Nightvision deaktiviert");
} else { return;
p.addPotionEffect(new PotionEffect(PotionEffectType.NIGHT_VISION, 1000000, 255));
SWUtils.sendToActionbar(p, ChatColor.YELLOW + "Nightvision an");
} }
p.addPotionEffect(new PotionEffect(PotionEffectType.NIGHT_VISION, 1000000, 255, false, false));
SWUtils.sendToActionbar(p, ColorConfig.HIGHLIGHT + "Nightvision aktiviert");
} }
} }

Datei anzeigen

@ -20,11 +20,11 @@
package de.steamwar.bausystem.features.util; package de.steamwar.bausystem.features.util;
import de.steamwar.bausystem.SWUtils; import de.steamwar.bausystem.SWUtils;
import de.steamwar.bausystem.config.ColorConfig;
import de.steamwar.bausystem.linkage.LinkageType; import de.steamwar.bausystem.linkage.LinkageType;
import de.steamwar.bausystem.linkage.Linked; import de.steamwar.bausystem.linkage.Linked;
import de.steamwar.command.SWCommand; import de.steamwar.command.SWCommand;
import de.steamwar.inventory.SWItem; import de.steamwar.inventory.SWItem;
import net.md_5.bungee.api.ChatColor;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.SkullMeta; import org.bukkit.inventory.meta.SkullMeta;
@ -38,7 +38,7 @@ public class SkullCommand extends SWCommand {
@Register(help = true) @Register(help = true)
public void genericHelp(Player p, String... args) { public void genericHelp(Player p, String... args) {
p.sendMessage(ChatColor.DARK_GRAY + "/" + ChatColor.YELLOW + "skull " + ChatColor.DARK_GRAY + "[" + ChatColor.YELLOW + "Spieler" + ChatColor.DARK_GRAY + "] - " + ChatColor.GRAY + "Gibt einen SpielerKopf"); p.sendMessage(ColorConfig.OTHER + "/" + ColorConfig.HIGHLIGHT + "skull " + ColorConfig.OTHER + "[" + ColorConfig.HIGHLIGHT + "Spieler" + ColorConfig.OTHER + "] - " + ColorConfig.BASE + "Gibt einen SpielerKopf");
} }
@Register @Register
@ -46,7 +46,7 @@ public class SkullCommand extends SWCommand {
ItemStack is = SWItem.getPlayerSkull(skull).getItemStack(); ItemStack is = SWItem.getPlayerSkull(skull).getItemStack();
SkullMeta sm = (SkullMeta) is.getItemMeta(); SkullMeta sm = (SkullMeta) is.getItemMeta();
assert sm != null; assert sm != null;
sm.setDisplayName(ChatColor.YELLOW + skull + ChatColor.DARK_GRAY + "s Kopf"); sm.setDisplayName(ColorConfig.HIGHLIGHT + skull + ColorConfig.OTHER + "s Kopf");
is.setItemMeta(sm); is.setItemMeta(sm);
SWUtils.giveItemToPlayer(p, is); SWUtils.giveItemToPlayer(p, is);
} }

Datei anzeigen

@ -20,10 +20,10 @@
package de.steamwar.bausystem.features.util; package de.steamwar.bausystem.features.util;
import de.steamwar.bausystem.BauSystem; import de.steamwar.bausystem.BauSystem;
import de.steamwar.bausystem.config.ColorConfig;
import de.steamwar.bausystem.linkage.LinkageType; import de.steamwar.bausystem.linkage.LinkageType;
import de.steamwar.bausystem.linkage.Linked; import de.steamwar.bausystem.linkage.Linked;
import de.steamwar.command.SWCommand; import de.steamwar.command.SWCommand;
import net.md_5.bungee.api.ChatColor;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@Linked(LinkageType.COMMAND) @Linked(LinkageType.COMMAND)
@ -35,21 +35,21 @@ public class SpeedCommand extends SWCommand {
@Register(help = true) @Register(help = true)
public void genericHelp(Player p, String... args) { public void genericHelp(Player p, String... args) {
p.sendMessage(ChatColor.DARK_GRAY + "/" + ChatColor.YELLOW + "speed " + ChatColor.DARK_GRAY + "[" + ChatColor.YELLOW + "1" + ChatColor.DARK_GRAY + "-" + ChatColor.YELLOW + "10" + ChatColor.DARK_GRAY + "] - " + ChatColor.GRAY + "Setzte deine Flug- und Laufgeschindigkeit."); p.sendMessage(ColorConfig.OTHER + "/" + ColorConfig.HIGHLIGHT + "speed " + ColorConfig.OTHER + "[" + ColorConfig.HIGHLIGHT + "1" + ColorConfig.OTHER + "-" + ColorConfig.HIGHLIGHT + "10" + ColorConfig.OTHER + "] - " + ColorConfig.BASE + "Setzte deine Flug- und Laufgeschindigkeit.");
p.sendMessage(BauSystem.PREFIX + "Aktuelle geschwindigkeit: " + ChatColor.YELLOW + p.getFlySpeed() * 10F); p.sendMessage(BauSystem.PREFIX + "Aktuelle geschwindigkeit: " + ColorConfig.HIGHLIGHT + p.getFlySpeed() * 10F);
} }
@Register @Register
public void speedCommand(Player p, float speed) { public void speedCommand(Player p, float speed) {
speed = speed / 10F; speed = speed / 10F;
if (speed < -1F) { if (speed < -1F) {
p.sendMessage(BauSystem.PREFIX + ChatColor.RED + speed + " ist zu klein"); p.sendMessage(BauSystem.PREFIX + ColorConfig.DISABLE + speed + " ist zu klein");
} else if (speed > 1F) { } else if (speed > 1F) {
p.sendMessage(BauSystem.PREFIX + ChatColor.RED + speed + " ist zu hoch"); p.sendMessage(BauSystem.PREFIX + ColorConfig.DISABLE + speed + " ist zu hoch");
} else { } else {
p.setFlySpeed(speed); p.setFlySpeed(speed);
p.setWalkSpeed(speed); p.setWalkSpeed(speed);
p.sendMessage(BauSystem.PREFIX + "Aktuelle geschwindigkeit: " + ChatColor.YELLOW + p.getFlySpeed() * 10F); p.sendMessage(BauSystem.PREFIX + "Aktuelle geschwindigkeit: " + ColorConfig.HIGHLIGHT + p.getFlySpeed() * 10F);
} }
} }
} }

Datei anzeigen

@ -19,39 +19,35 @@
package de.steamwar.bausystem.features.util; package de.steamwar.bausystem.features.util;
import de.steamwar.bausystem.BauSystem; import de.steamwar.bausystem.SWUtils;
import de.steamwar.bausystem.config.ColorConfig;
import de.steamwar.bausystem.linkage.LinkageType; import de.steamwar.bausystem.linkage.LinkageType;
import de.steamwar.bausystem.linkage.Linked; import de.steamwar.bausystem.linkage.Linked;
import de.steamwar.command.SWCommand; import de.steamwar.command.SWCommand;
import net.md_5.bungee.api.ChatColor;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType; import org.bukkit.potion.PotionEffectType;
@Linked(LinkageType.COMMAND) @Linked(LinkageType.COMMAND)
public class WatervisionCommand extends SWCommand { public class WaterVisionCommand extends SWCommand {
public WatervisionCommand() { public WaterVisionCommand() {
super("watervision", "wv"); super("watervision", "wv");
} }
@Register(help = true) @Register(help = true)
public void help(final Player p, final String... args) { public void help(final Player p, final String... args) {
p.sendMessage(ChatColor.RED + "Too many arguments."); p.sendMessage(ColorConfig.OTHER + "/" + ColorConfig.HIGHLIGHT + "watervision " + ColorConfig.OTHER + "-" + ColorConfig.BASE + " Schalte Watervision an oder aus.");
} }
@Register @Register
public void genericCommand(final Player p) { public void genericCommand(Player p) {
WatervisionCommand.toggleWatervision(p); if (p.hasPotionEffect(PotionEffectType.WATER_BREATHING)) {
} p.removePotionEffect(PotionEffectType.WATER_BREATHING);
SWUtils.sendToActionbar(p, ColorConfig.HIGHLIGHT + "Wassersicht deaktiviert");
public static void toggleWatervision(final Player player) {
if (player.hasPotionEffect(PotionEffectType.WATER_BREATHING)) {
player.sendMessage(BauSystem.PREFIX + "Wassersicht deaktiviert");
player.removePotionEffect(PotionEffectType.WATER_BREATHING);
return; return;
} }
player.addPotionEffect(new PotionEffect(PotionEffectType.WATER_BREATHING, 1000000, 255, false, false)); p.addPotionEffect(new PotionEffect(PotionEffectType.WATER_BREATHING, 1000000, 255, false, false));
player.sendMessage(BauSystem.PREFIX + "Wassersicht aktiviert"); SWUtils.sendToActionbar(p, ColorConfig.HIGHLIGHT + "Wassersicht aktiviert");
} }
} }