item retexture - most fixed

This commit is contained in:
Sen 2025-07-29 14:10:19 +02:00
parent ff4b41acc1
commit 9c4287dcad
Signed by: sen
GPG key ID: 3AC50A6F47D1B722
132 changed files with 757 additions and 746 deletions

View file

@ -87,7 +87,7 @@ import common.util.ExtMath;
import common.util.Pair;
import common.util.PortalType;
import common.util.Position;
import common.util.TextColor;
import common.util.Color;
import common.util.Triplet;
import common.util.Util;
import common.util.Var;
@ -1074,8 +1074,8 @@ public final class Server implements IThreadListener, Executor {
nplayer.setHealth(nplayer.getHealth());
conn.sendPlayerAbilities();
if(message != null)
conn.addHotbar(TextColor.DARK_RED + message);
conn.addFeed(TextColor.RED + "* Bei %d, %d, %d in Dimension %s gestorben", pos.getX(), pos.getY(), pos.getZ(),
conn.addHotbar(Color.DARK_RED + message);
conn.addFeed(Color.RED + "* Bei %d, %d, %d in Dimension %s gestorben", pos.getX(), pos.getY(), pos.getZ(),
old.worldObj.dimension.getDisplay());
}

View file

@ -15,7 +15,7 @@ import common.block.tech.BlockAnvil;
import common.init.BlockRegistry;
import common.init.Blocks;
import common.init.WoodType;
import common.util.TextColor;
import common.util.Color;
import common.util.Vec3i;
import common.world.State;
@ -48,7 +48,7 @@ public abstract class ReorderRegistry {
PLACE_LAST.add(BlockRegistry.byName(wood.getName() + "_sapling"));
}
// PLACE_LAST.add(Blocks.bed);
for(TextColor color : BlockBed.COLORS) {
for(Color color : BlockBed.COLORS) {
PLACE_LAST.add(BlockRegistry.byName(color.getName() + "_bed"));
}
PLACE_LAST.add(Blocks.tallgrass);

View file

@ -1,6 +1,6 @@
package server.command;
import common.util.TextColor;
import common.util.Color;
public class ColorParser extends IntParser {
public ColorParser(String name, Integer def, Object ... completions) {
@ -8,7 +8,7 @@ public class ColorParser extends IntParser {
}
public ColorParser(String name, Integer def) {
this(name, def, (Object[])TextColor.values());
this(name, def, (Object[])Color.values());
}
public Integer parse(CommandEnvironment env, String input) {
@ -16,7 +16,7 @@ public class ColorParser extends IntParser {
input = input.substring(1);
}
else {
TextColor color = TextColor.getExact(input);
Color color = Color.getExact(input);
if(color != null)
return color.getColor();
}

View file

@ -9,7 +9,7 @@ import common.collect.Lists;
import common.collect.Maps;
import common.util.BlockPos;
import common.util.CharValidator;
import common.util.TextColor;
import common.util.Color;
import common.util.Vec3;
import common.world.World;
import server.command.DoubleParser.DefType;
@ -23,8 +23,8 @@ public abstract class Command implements Executable {
private int parPos = 0;
private boolean parReq = true;
public static String asCommand(TextColor color, String command, Object ... args) {
return String.format(TextColor.DARK_GRAY + "[" + TextColor.COMMAND + "%s" + TextColor.DARK_GRAY + "]" + (color == null ? TextColor.RESET : color), String.format(command, args));
public static String asCommand(Color color, String command, Object ... args) {
return String.format(Color.DARK_GRAY + "[" + Color.COMMAND + "%s" + Color.DARK_GRAY + "]" + (color == null ? Color.RESET : color), String.format(command, args));
}
protected Command(String name) {

View file

@ -12,7 +12,7 @@ import common.collect.Lists;
import common.collect.Maps;
import common.collect.Sets;
import common.log.Log;
import common.util.TextColor;
import common.util.Color;
import server.Server;
import server.command.commands.*;
@ -171,13 +171,13 @@ public class CommandEnvironment {
catch(RunException e) {
Throwable cause = e;
do {
exec.log(TextColor.RED + cause.getMessage());
exec.log(Color.RED + cause.getMessage());
cause = cause.getCause();
}
while(cause != null);
}
catch(Throwable t) {
exec.log(TextColor.RED + "Fehler: %s", t.getMessage());
exec.log(Color.RED + "Fehler: %s", t.getMessage());
Log.CONSOLE.error(t, "Fehler beim Ausführen von Befehl '%s'", cmd);
}
finally {

View file

@ -1,7 +1,7 @@
package server.command.commands;
import common.dimension.Space;
import common.util.TextColor;
import common.util.Color;
import server.command.Command;
import server.command.CommandEnvironment;
import server.command.Executor;
@ -20,8 +20,8 @@ public class CommandExterminatus extends Command {
throw new RunException("Der Weltraum kann nicht zerstört werden (lol?)");
else if(world.isExterminated())
throw new RunException("Dimension %s ist bereits zerstört", world.dimension.getDisplay());
exec.log(TextColor.YELLOW + "Dimension %s wird zerstört ...", world.dimension.getDisplay());
exec.log(Color.YELLOW + "Dimension %s wird zerstört ...", world.dimension.getDisplay());
world.exterminate();
exec.log(TextColor.CRIMSON + "Die Welt %s wurde vernichtet >:)-", world.dimension.getDisplay());
exec.log(Color.CRIMSON + "Die Welt %s wurde vernichtet >:)-", world.dimension.getDisplay());
}
}

View file

@ -4,7 +4,7 @@ import java.util.List;
import common.effect.Effect;
import common.entity.npc.EntityNPC;
import common.util.TextColor;
import common.util.Color;
import server.command.Command;
import server.command.CommandEnvironment;
import server.command.Executor;
@ -25,7 +25,7 @@ public class CommandGod extends Command {
for(EntityNPC player : players) {
player.setGodMode(!remove);
if(!quiet)
player.connection.addFeed(!remove ? (TextColor.GREEN + "Statuseffekte wurden hinzugefügt") : (TextColor.RED + "Statuseffekte wurden entfernt"));
player.connection.addFeed(!remove ? (Color.GREEN + "Statuseffekte wurden hinzugefügt") : (Color.RED + "Statuseffekte wurden entfernt"));
if(quiet || player.connection != exec)
exec.log("Statuseffekte " + (!remove ? "an %s gegeben" : "von %s entfernt"), player.getCommandName());
}

View file

@ -14,7 +14,7 @@ import common.init.Blocks;
import common.init.NameRegistry;
import common.packet.SPacketDimensions;
import common.rng.Random;
import common.util.TextColor;
import common.util.Color;
import server.Server;
import server.command.ArgumentParser;
import server.command.Command;
@ -126,7 +126,7 @@ public class CommandLoad extends Command {
if(Converter.convert(dir, name, pos -> env.getServer().schedule(() -> {
Planet planet = registerPlanet(env.getServer(), star, name, display, sky, fog, clouds, orbit, rotation, (float)offset, (float)gravity, (float)temperature, brightness);
this.loadingDim = null;
exec.log(TextColor.GREEN + "Welt %s wurde erfolgreich in Dimension '%s' konvertiert", dir, display);
exec.log(Color.GREEN + "Welt %s wurde erfolgreich in Dimension '%s' konvertiert", dir, display);
if(teleport && pos != null) {
Player player = env.getServer().getPlayer(((Player)exec).getUser());
if(player != null && player.getPresentEntity() != null)
@ -137,12 +137,12 @@ public class CommandLoad extends Command {
throw new RunException("Welt %s konnte nicht konvertiert werden", dir);
}
else {
exec.log(TextColor.ACID + "Welt %s wird in Dimension '%s' konvertiert ...", dir, display);
exec.log(Color.ACID + "Welt %s wird in Dimension '%s' konvertiert ...", dir, display);
}
return;
}
Planet planet = registerPlanet(env.getServer(), star, name, display, sky, fog, clouds, orbit, rotation, (float)offset, (float)gravity, (float)temperature, brightness);
exec.log(TextColor.GREEN + "Dimension '%s' wurde registriert", display);
exec.log(Color.GREEN + "Dimension '%s' wurde registriert", display);
if(teleport && ((Player)exec).getPresentEntity() != null)
((Player)exec).getPresentEntity().teleport(CommandWorld.adjust(env.getServer().getWorld(planet), ((Player)exec).getPresentEntity().getPosition()), planet);
}

View file

@ -3,7 +3,7 @@ package server.command.commands;
import java.util.List;
import common.entity.npc.EntityNPC;
import common.util.TextColor;
import common.util.Color;
import server.command.Command;
import server.command.CommandEnvironment;
import server.command.Executor;
@ -27,7 +27,7 @@ public class CommandNoclip extends Command {
continue;
player.setNoclip(!remove);
if(!quiet)
player.connection.addFeed((!remove ? TextColor.GREEN : TextColor.RED) + "NoClip wurde " + (!remove ? "eingeschaltet" : "ausgeschaltet"));
player.connection.addFeed((!remove ? Color.GREEN : Color.RED) + "NoClip wurde " + (!remove ? "eingeschaltet" : "ausgeschaltet"));
if(quiet || player.connection != exec)
exec.log("NoClip für %s " + (!remove ? "eingeschaltet" : "ausgeschaltet"), player.getCommandName());
done++;

View file

@ -4,7 +4,7 @@ import java.security.MessageDigest;
import common.network.IPlayer;
import common.util.EncryptUtil;
import common.util.TextColor;
import common.util.Color;
import server.command.Command;
import server.command.CommandEnvironment;
import server.command.Executor;
@ -50,20 +50,20 @@ public class CommandPasswd extends Command {
protected void accept() {
User plr = env.getServer().getUser(user.getUser());
if(!((Player)exec).isAdmin() || plr == null || (plr.isAdmin() && plr != exec) || (plr.getPasswordHash() == null && plr == exec) || (plr.getPubkey() != null && plr == exec)) {
exec.log(TextColor.DARK_RED + "Ein Fehler ist aufgetreten");
exec.log(Color.DARK_RED + "Ein Fehler ist aufgetreten");
return;
}
if(this.checkField != null && !MessageDigest.isEqual(EncryptUtil.hashPassword(this.checkField.get(), plr.getPasswordHash().second()), plr.getPasswordHash().first())) {
exec.log(TextColor.RED + "Falsches Passwort eingegeben");
exec.log(Color.RED + "Falsches Passwort eingegeben");
return;
}
if(!this.passwordField.get().equals(this.confirmField.get())) {
exec.log(TextColor.RED + "Passwörter stimmen nicht überein");
exec.log(Color.RED + "Passwörter stimmen nicht überein");
return;
}
plr.setPasswordHash(EncryptUtil.hashPassword(this.passwordField.get()));
plr.setPubkey(null);
exec.log(TextColor.GREEN + "Passwort" + (plr != exec ? " für %s" : "") + " gesetzt", plr.getUser());
exec.log(Color.GREEN + "Passwort" + (plr != exec ? " für %s" : "") + " gesetzt", plr.getUser());
}
});
}
@ -74,7 +74,7 @@ public class CommandPasswd extends Command {
throw new RunException("Das Passwort ist zu kurz, mindestens 8 Zeichen sind erforderlich");
user.setPasswordHash(EncryptUtil.hashPassword(password));
user.setPubkey(null);
exec.log(TextColor.GREEN + "Passwort für %s gesetzt", user.getUser());
exec.log(Color.GREEN + "Passwort für %s gesetzt", user.getUser());
}
}
}

View file

@ -4,7 +4,7 @@ import java.util.List;
import common.entity.npc.EntityNPC;
import common.util.ExtMath;
import common.util.TextColor;
import common.util.Color;
import server.command.Command;
import server.command.CommandEnvironment;
import server.command.Executor;
@ -21,13 +21,13 @@ public class CommandPlayers extends Command {
public void exec(CommandEnvironment env, Executor exec, boolean coords) {
List<Player> players = env.getServer().getPlayers();
if(players.isEmpty()) {
exec.log(TextColor.DARK_GRAY + "Es sind keine Spieler online");
exec.log(Color.DARK_GRAY + "Es sind keine Spieler online");
return;
}
exec.log(TextColor.GREEN + "Es " + (players.size() == 1 ? "ist" : "sind") + " " + TextColor.YELLOW + "%d" + TextColor.GREEN + " Spieler online", players.size());
exec.log(Color.GREEN + "Es " + (players.size() == 1 ? "ist" : "sind") + " " + Color.YELLOW + "%d" + Color.GREEN + " Spieler online", players.size());
for(Player player : players) {
EntityNPC entity = player.getPresentEntity();
exec.log("%s%s" + TextColor.GRAY + ": '%s" + TextColor.GRAY + "'" + (coords && entity != null ? " [" + TextColor.ORANGE + "%s @ %d, %d, %d" + TextColor.GRAY + "]" : ""), player.isAdmin() ? TextColor.RED : TextColor.NEON, player.getUser(), entity == null ? TextColor.DARK_GRAY + "<->" : TextColor.ACID + entity.getCommandName(), entity == null ? null : entity.worldObj.dimension.getDisplay(), entity == null ? null : ExtMath.floord(entity.posX), entity == null ? null : ExtMath.floord(entity.posY), entity == null ? null : ExtMath.floord(entity.posZ));
exec.log("%s%s" + Color.GRAY + ": '%s" + Color.GRAY + "'" + (coords && entity != null ? " [" + Color.ORANGE + "%s @ %d, %d, %d" + Color.GRAY + "]" : ""), player.isAdmin() ? Color.RED : Color.NEON, player.getUser(), entity == null ? Color.DARK_GRAY + "<->" : Color.ACID + entity.getCommandName(), entity == null ? null : entity.worldObj.dimension.getDisplay(), entity == null ? null : ExtMath.floord(entity.posX), entity == null ? null : ExtMath.floord(entity.posY), entity == null ? null : ExtMath.floord(entity.posZ));
}
}
}

View file

@ -6,7 +6,7 @@ import java.security.PublicKey;
import common.network.IPlayer;
import common.util.EncryptUtil;
import common.util.Pair;
import common.util.TextColor;
import common.util.Color;
import server.command.Command;
import server.command.CommandEnvironment;
import server.command.Executor;
@ -48,11 +48,11 @@ public class CommandPubkey extends Command {
protected void accept() {
User plr = env.getServer().getUser(user.getUser());
if(!((Player)exec).isAdmin() || plr == null || (plr.isAdmin() && plr != exec)) {
exec.log(TextColor.DARK_RED + "Ein Fehler ist aufgetreten");
exec.log(Color.DARK_RED + "Ein Fehler ist aufgetreten");
return;
}
if(this.checkField != null && plr.getPasswordHash() != null && !MessageDigest.isEqual(EncryptUtil.hashPassword(this.checkField.get(), plr.getPasswordHash().second()), plr.getPasswordHash().first())) {
exec.log(TextColor.RED + "Falsches Passwort eingegeben");
exec.log(Color.RED + "Falsches Passwort eingegeben");
return;
}
Pair<PublicKey, String> key;
@ -60,12 +60,12 @@ public class CommandPubkey extends Command {
key = EncryptUtil.parseArmoredPubkey(this.keyField.get());
}
catch(IllegalArgumentException e) {
exec.log(TextColor.RED + "Ungültiger Schlüssel");
exec.log(Color.RED + "Ungültiger Schlüssel");
return;
}
plr.setPasswordHash(null);
plr.setPubkey(key.first());
exec.log(TextColor.GREEN + "Schlüssel" + (plr != exec ? " für %s" : "") + " gesetzt", plr.getUser());
exec.log(Color.GREEN + "Schlüssel" + (plr != exec ? " für %s" : "") + " gesetzt", plr.getUser());
}
});
}
@ -81,7 +81,7 @@ public class CommandPubkey extends Command {
}
user.setPasswordHash(null);
user.setPubkey(key.first());
exec.log(TextColor.GREEN + "Schlüssel für %s gesetzt", user.getUser());
exec.log(Color.GREEN + "Schlüssel für %s gesetzt", user.getUser());
}
}
}

View file

@ -2,7 +2,7 @@ package server.command.commands;
import common.network.IPlayer;
import common.util.EncryptUtil;
import common.util.TextColor;
import common.util.Color;
import server.command.Command;
import server.command.CommandEnvironment;
import server.command.Executor;
@ -45,18 +45,18 @@ public class CommandRegister extends Command {
protected void accept() {
if(!((Player)exec).isAdmin() || env.getServer().getUser(username) != null || env.getServer().loadPlayerData(username) != null) {
exec.log(TextColor.DARK_RED + "Ein Fehler ist aufgetreten");
exec.log(Color.DARK_RED + "Ein Fehler ist aufgetreten");
return;
}
if(!this.passwordField.get().equals(this.confirmField.get())) {
exec.log(TextColor.RED + "Passwörter stimmen nicht überein");
exec.log(Color.RED + "Passwörter stimmen nicht überein");
return;
}
User user = new User(username);
user.setPasswordHash(EncryptUtil.hashPassword(this.passwordField.get()));
user.setAdmin(admin);
env.getServer().addUser(user);
exec.log(TextColor.GREEN + "Spieler %s registriert", username);
exec.log(Color.GREEN + "Spieler %s registriert", username);
}
});
}
@ -69,7 +69,7 @@ public class CommandRegister extends Command {
user.setPasswordHash(EncryptUtil.hashPassword(password));
user.setAdmin(admin);
env.getServer().addUser(user);
exec.log(TextColor.GREEN + "Spieler %s registriert", username);
exec.log(Color.GREEN + "Spieler %s registriert", username);
}
}
}

View file

@ -5,7 +5,7 @@ import java.security.PublicKey;
import common.network.IPlayer;
import common.util.EncryptUtil;
import common.util.Pair;
import common.util.TextColor;
import common.util.Color;
import server.command.Command;
import server.command.CommandEnvironment;
import server.command.Executor;
@ -48,7 +48,7 @@ public class CommandRegkey extends Command {
protected void accept() {
if(!((Player)exec).isAdmin() || env.getServer().getUser(username) != null || env.getServer().loadPlayerData(username) != null) {
exec.log(TextColor.DARK_RED + "Ein Fehler ist aufgetreten");
exec.log(Color.DARK_RED + "Ein Fehler ist aufgetreten");
return;
}
Pair<PublicKey, String> key;
@ -56,14 +56,14 @@ public class CommandRegkey extends Command {
key = EncryptUtil.parseArmoredPubkey(this.keyField.get());
}
catch(IllegalArgumentException e) {
exec.log(TextColor.RED + "Ungültiger Schlüssel");
exec.log(Color.RED + "Ungültiger Schlüssel");
return;
}
User user = new User(username);
user.setPubkey(key.first());
user.setAdmin(admin);
env.getServer().addUser(user);
exec.log(TextColor.GREEN + "Spieler %s registriert", username);
exec.log(Color.GREEN + "Spieler %s registriert", username);
}
});
}
@ -81,7 +81,7 @@ public class CommandRegkey extends Command {
user.setPubkey(key.first());
user.setAdmin(admin);
env.getServer().addUser(user);
exec.log(TextColor.GREEN + "Spieler %s registriert", username);
exec.log(Color.GREEN + "Spieler %s registriert", username);
}
}
}

View file

@ -2,7 +2,7 @@ package server.command.commands;
import common.packet.SPacketMessage;
import common.packet.SPacketMessage.Type;
import common.util.TextColor;
import common.util.Color;
import server.command.Command;
import server.command.CommandEnvironment;
import server.command.Executor;
@ -19,18 +19,18 @@ public class CommandSave extends Command {
public void exec(CommandEnvironment env, Executor exec, boolean message, boolean flush) {
if(message)
env.getServer().sendPacket(new SPacketMessage(TextColor.RED + "Speichere Serverdaten, der Server könnte kurz einfrieren", Type.FEED));
exec.log(TextColor.ORANGE + "Speichere Spielerdaten ...");
env.getServer().sendPacket(new SPacketMessage(Color.RED + "Speichere Serverdaten, der Server könnte kurz einfrieren", Type.FEED));
exec.log(Color.ORANGE + "Speichere Spielerdaten ...");
env.getServer().saveAllPlayerData(true);
exec.log(TextColor.ORANGE + "Speichere Weltdaten ...");
exec.log(Color.ORANGE + "Speichere Weltdaten ...");
env.getServer().saveAllWorlds(true);
env.getServer().resetSaveTimer();
if(flush) {
exec.log(TextColor.ORANGE + "Beende E/A ...");
exec.log(Color.ORANGE + "Beende E/A ...");
Region.finishWrite();
}
exec.log(TextColor.DARK_GREEN + "Alle Serverdaten wurden gespeichert");
exec.log(Color.DARK_GREEN + "Alle Serverdaten wurden gespeichert");
if(message)
env.getServer().sendPacket(new SPacketMessage(TextColor.GREEN + "Die Serverdaten wurden gespeichert", Type.FEED));
env.getServer().sendPacket(new SPacketMessage(Color.GREEN + "Die Serverdaten wurden gespeichert", Type.FEED));
}
}

View file

@ -5,7 +5,7 @@ import java.util.Map.Entry;
import common.collect.Lists;
import common.packet.SPacketServerConfig;
import common.util.TextColor;
import common.util.Color;
import server.command.ArgumentSplitter;
import server.command.Command;
import server.command.CommandEnvironment;
@ -41,17 +41,17 @@ public class CommandSv extends Command {
private String formatVariable(String name, SVar sv, String separator, boolean censor) {
String value = sv.get();
StringBuilder sb = new StringBuilder(TextColor.YELLOW + name + TextColor.GRAY + " " + separator + " ");
StringBuilder sb = new StringBuilder(Color.YELLOW + name + Color.GRAY + " " + separator + " ");
if(sv.noDef && sv.def.equals(value))
sb.append(TextColor.DARK_GRAY + "[ - ]");
sb.append(Color.DARK_GRAY + "[ - ]");
else if(censor && name.equals("password") && !value.isEmpty())
sb.append(TextColor.NEON + "'****'");
sb.append(Color.NEON + "'****'");
else if(sv.type == ValueType.STRING)
sb.append(TextColor.NEON + "'" + value + "'");
sb.append(Color.NEON + "'" + value + "'");
else
sb.append(((sv.type == ValueType.BOOLEAN ? (value.equals("true") ? TextColor.GREEN : TextColor.RED) : TextColor.BLUE)) + value);
sb.append(((sv.type == ValueType.BOOLEAN ? (value.equals("true") ? Color.GREEN : Color.RED) : Color.BLUE)) + value);
if(!sv.def.equals(value))
sb.append(TextColor.GRAY + " (" + (sv.noDef ? TextColor.DARK_GRAY + "[ - ]" : TextColor.BROWN + sv.def) + TextColor.GRAY + ")");
sb.append(Color.GRAY + " (" + (sv.noDef ? Color.DARK_GRAY + "[ - ]" : Color.BROWN + sv.def) + Color.GRAY + ")");
return sb.toString();
}
@ -62,7 +62,7 @@ public class CommandSv extends Command {
for(Entry<String, SVar> entry : env.getServer().getVariables().entrySet()) {
exec.log(this.formatVariable(entry.getKey(), entry.getValue(), "=", true));
}
exec.log(TextColor.GREEN + "SVARs insgesamt registriert: %d", env.getServer().getVariables().size());
exec.log(Color.GREEN + "SVARs insgesamt registriert: %d", env.getServer().getVariables().size());
return null;
}
SVar sv = env.getServer().getVariables().get(variable);
@ -82,7 +82,7 @@ public class CommandSv extends Command {
Integer.parseInt(value);
}
catch(NumberFormatException e) {
throw new RunException(TextColor.DARK_RED + "'%s' ist keine gültige Zahl", value);
throw new RunException(Color.DARK_RED + "'%s' ist keine gültige Zahl", value);
}
}
else if(sv.type == ValueType.FLOAT) {
@ -90,7 +90,7 @@ public class CommandSv extends Command {
Float.parseFloat(value);
}
catch(NumberFormatException e) {
throw new RunException(TextColor.DARK_RED + "'%s' ist keine gültige Zahl", value);
throw new RunException(Color.DARK_RED + "'%s' ist keine gültige Zahl", value);
}
}
sv.set(value, false, true);

View file

@ -2,7 +2,7 @@ package server.command.commands;
import java.util.Collection;
import common.util.TextColor;
import common.util.Color;
import server.command.Command;
import server.command.CommandEnvironment;
import server.command.Executor;
@ -16,12 +16,12 @@ public class CommandUsers extends Command {
public void exec(CommandEnvironment env, Executor exec) {
Collection<User> users = env.getServer().getUsers();
if(users.isEmpty()) {
exec.log(TextColor.DARK_GRAY + "Es sind keine Spieler registriert");
exec.log(Color.DARK_GRAY + "Es sind keine Spieler registriert");
return;
}
exec.log(TextColor.GREEN + "Es " + (users.size() == 1 ? "ist" : "sind") + " " + TextColor.YELLOW + "%d" + TextColor.GREEN + " Spieler registriert", users.size());
exec.log(Color.GREEN + "Es " + (users.size() == 1 ? "ist" : "sind") + " " + Color.YELLOW + "%d" + Color.GREEN + " Spieler registriert", users.size());
for(User user : users) {
exec.log("%s%s" + TextColor.GRAY + ": %s" + TextColor.GRAY + ", %s", user.isAdmin() ? TextColor.RED : TextColor.NEON, user.getUser(), user.isOnline() ? TextColor.DARK_GREEN + "Online" : TextColor.DARK_GRAY + "Offline", user.getPubkey() != null ? TextColor.YELLOW + "Pubkey" : (user.getPasswordHash() != null ? TextColor.MAGENTA + "Passwort" : TextColor.BLACK + "Kein Login"));
exec.log("%s%s" + Color.GRAY + ": %s" + Color.GRAY + ", %s", user.isAdmin() ? Color.RED : Color.NEON, user.getUser(), user.isOnline() ? Color.DARK_GREEN + "Online" : Color.DARK_GRAY + "Offline", user.getPubkey() != null ? Color.YELLOW + "Pubkey" : (user.getPasswordHash() != null ? Color.MAGENTA + "Passwort" : Color.BLACK + "Kein Login"));
}
}
}

View file

@ -6,7 +6,7 @@ import java.util.Map.Entry;
import common.dimension.Dimension;
import common.util.ExtMath;
import common.util.Position;
import common.util.TextColor;
import common.util.Color;
import server.command.Command;
import server.command.CommandEnvironment;
import server.command.Executor;
@ -22,7 +22,7 @@ public class CommandWarps extends Command {
public void exec(CommandEnvironment env, Executor exec, Dimension dim) {
Map<String, Position> warps = env.getServer().getWarps();
if(warps.isEmpty()) {
exec.log(TextColor.DARK_GRAY + "Es sind keine Warps definiert");
exec.log(Color.DARK_GRAY + "Es sind keine Warps definiert");
return;
}
int n = 0;
@ -32,15 +32,15 @@ public class CommandWarps extends Command {
n++;
}
if(dim != null && n == 0) {
exec.log(TextColor.DARK_GRAY + "Es sind keine Warps in %s vorhanden", dim.getDisplay());
exec.log(Color.DARK_GRAY + "Es sind keine Warps in %s vorhanden", dim.getDisplay());
return;
}
exec.log(TextColor.GREEN + "Es " + (n == 1 ? "ist" : "sind") + " " + TextColor.YELLOW + "%d" + TextColor.GREEN + " Warp" + (n == 1 ? "" : "s") + " " + (dim == null ? "" : "in Dimension %s ") + "vorhanden", n, dim == null ? null : dim.getDisplay());
exec.log(Color.GREEN + "Es " + (n == 1 ? "ist" : "sind") + " " + Color.YELLOW + "%d" + Color.GREEN + " Warp" + (n == 1 ? "" : "s") + " " + (dim == null ? "" : "in Dimension %s ") + "vorhanden", n, dim == null ? null : dim.getDisplay());
for(Entry<String, Position> warp : warps.entrySet()) {
Position pos = warp.getValue();
Dimension wdim = pos.getDimension();
if(wdim != null && (dim == null || wdim == dim))
exec.log(TextColor.NEON + "%s" + TextColor.GRAY + ": " + TextColor.ORANGE + "%s" + (dim == null ? " @ " : "") + "%d, %d, %d", warp.getKey(), dim != null ? "" : wdim.getDisplay(), ExtMath.floord(pos.xCoord), ExtMath.floord(pos.yCoord), ExtMath.floord(pos.zCoord));
exec.log(Color.NEON + "%s" + Color.GRAY + ": " + Color.ORANGE + "%s" + (dim == null ? " @ " : "") + "%d, %d, %d", warp.getKey(), dim != null ? "" : wdim.getDisplay(), ExtMath.floord(pos.xCoord), ExtMath.floord(pos.yCoord), ExtMath.floord(pos.zCoord));
}
}
}

View file

@ -22,7 +22,7 @@ import common.packet.RPacketRequestEncrypt;
import common.packet.RPacketResponse;
import common.packet.RPacketServerConfig;
import common.util.EncryptUtil;
import common.util.TextColor;
import common.util.Color;
import server.Server;
import server.vars.SVars;
@ -68,7 +68,7 @@ public class LoginHandler implements ILoginHandler
public void onDisconnect(String reason)
{
Log.NETWORK.info(this.getConnectionInfo() + " wurde beim Login getrennt: " + TextColor.stripCodes(reason));
Log.NETWORK.info(this.getConnectionInfo() + " wurde beim Login getrennt: " + Color.stripCodes(reason));
}
public String getConnectionInfo()

View file

@ -116,7 +116,7 @@ import common.util.Facing;
import common.util.IntHashMap;
import common.util.PortalType;
import common.util.Position;
import common.util.TextColor;
import common.util.Color;
import common.util.Vec3i;
import common.util.WorldPos;
import common.vars.Vars;
@ -559,24 +559,24 @@ public class Player extends User implements Executor, IPlayer
public void sendPickupMessage(Entity entity, int amount) {
if(entity instanceof EntityItem)
if(amount == 1)
this.addFeed(TextColor.DARK_GREEN + "* %s aufgelesen",
((EntityItem)entity).getEntityItem().getColoredName(TextColor.DARK_GREEN));
this.addFeed(Color.DARK_GREEN + "* %s aufgelesen",
((EntityItem)entity).getEntityItem().getColoredName(Color.DARK_GREEN));
else
this.addFeed(TextColor.DARK_GREEN + "* %d %s aufgelesen", amount,
((EntityItem)entity).getEntityItem().getColoredName(TextColor.DARK_GREEN));
this.addFeed(Color.DARK_GREEN + "* %d %s aufgelesen", amount,
((EntityItem)entity).getEntityItem().getColoredName(Color.DARK_GREEN));
else if(entity instanceof EntityArrow)
this.addFeed(TextColor.DARK_GREEN + "* Pfeil aufgelesen", amount);
this.addFeed(Color.DARK_GREEN + "* Pfeil aufgelesen", amount);
else if(entity instanceof EntityXp)
this.addFeed(TextColor.GREEN + "* %d Erfahrung gesammelt", amount);
this.addFeed(Color.GREEN + "* %d Erfahrung gesammelt", amount);
}
public void sendThrowMessage(ItemStack stack) {
if(stack.getSize() == 1)
this.addFeed(TextColor.DARK_RED + "* %s weg geworfen",
stack.getColoredName(TextColor.DARK_RED));
this.addFeed(Color.DARK_RED + "* %s weg geworfen",
stack.getColoredName(Color.DARK_RED));
else
this.addFeed(TextColor.DARK_RED + "* %d %s weg geworfen", stack.getSize(),
stack.getColoredName(TextColor.DARK_RED));
this.addFeed(Color.DARK_RED + "* %d %s weg geworfen", stack.getSize(),
stack.getColoredName(Color.DARK_RED));
}
@ -683,7 +683,7 @@ public class Player extends User implements Executor, IPlayer
{
if (chest.getLockCode() != null && !this.entity.canOpen(chest.getLockCode()))
{
this.addHotbar(TextColor.RED + "%s ist verschlossen!", chest.getName());
this.addHotbar(Color.RED + "%s ist verschlossen!", chest.getName());
this.sendPacket(new SPacketSoundEffect(SoundEvent.DOOR, this.entity.posX, this.entity.posY, this.entity.posZ, 1.0F));
return;
}
@ -1337,14 +1337,14 @@ public class Player extends User implements Executor, IPlayer
BlockPos point = pos == null ? this.entity.getPosition() : pos;
String msg = this.selectPoint(point, false);
if(msg != null)
this.addHotbar(TextColor.DARK_RED + msg);
this.addHotbar(Color.DARK_RED + msg);
}
private void selectPos2(BlockPos pos) {
BlockPos point = pos == null ? this.entity.getPosition() : pos;
String msg = this.selectPoint(point, true);
if(msg != null)
this.addHotbar(TextColor.MIDNIGHT + msg);
this.addHotbar(Color.MIDNIGHT + msg);
}
private String selectPoint(BlockPos position, boolean second) {
@ -1389,7 +1389,7 @@ public class Player extends User implements Executor, IPlayer
}
if(this.edit == EditAction.TRANSFORM && (this.rotation != 0 || this.flipX || this.flipZ))
msg += "; " + this.getRotationInfo();
this.addHotbar(TextColor.YELLOW + msg);
this.addHotbar(Color.YELLOW + msg);
}
private int getSelectionArea() {
@ -1433,7 +1433,7 @@ public class Player extends User implements Executor, IPlayer
to = to.add(transform.mulX(this.selOffset.getX(), this.selOffset.getZ()), this.selOffset.getY(), transform.mulZ(this.selOffset.getX(), this.selOffset.getZ()));
}
placer.commit();
this.addHotbar(TextColor.YELLOW + "Zwischenablage wurde bei %d, %d, %d eingefügt", to.getX(), to.getY(), to.getZ());
this.addHotbar(Color.YELLOW + "Zwischenablage wurde bei %d, %d, %d eingefügt", to.getX(), to.getY(), to.getZ());
return true;
}
@ -1505,7 +1505,7 @@ public class Player extends User implements Executor, IPlayer
this.flipX = this.flipZ = false;
BlockPos pos = this.entity.getPosition();
this.selOffset = new Vec3i(mx - pos.getX(), my - pos.getY(), mz - pos.getZ());
this.addHotbar(TextColor.YELLOW + "Auswahl wurde in die Zwischenablage kopiert");
this.addHotbar(Color.YELLOW + "Auswahl wurde in die Zwischenablage kopiert");
return true;
}
@ -1534,7 +1534,7 @@ public class Player extends User implements Executor, IPlayer
else
return;
String info = this.getRotationInfo();
this.addHotbar(TextColor.YELLOW + (info.isEmpty() ? "Keine Drehung" : info));
this.addHotbar(Color.YELLOW + (info.isEmpty() ? "Keine Drehung" : info));
}
private void rotateClipboard() {
@ -1542,7 +1542,7 @@ public class Player extends User implements Executor, IPlayer
return;
this.rotation = (this.rotation + 90) % 360;
String info = this.getRotationInfo();
this.addHotbar(TextColor.YELLOW + (info.isEmpty() ? "Keine Drehung" : info));
this.addHotbar(Color.YELLOW + (info.isEmpty() ? "Keine Drehung" : info));
}
public TagObject readCharacter() {
@ -1576,7 +1576,7 @@ public class Player extends User implements Executor, IPlayer
public void onDisconnect(String reason)
{
Log.NETWORK.info(this.getUser() + " wurde getrennt: " + TextColor.stripCodes(reason));
Log.NETWORK.info(this.getUser() + " wurde getrennt: " + Color.stripCodes(reason));
this.server.sendPacket(new SPacketMessage(String.format("%s hat das Spiel verlassen", this.getUser()), Type.FEED));
this.server.removePlayer(this);
}
@ -1690,10 +1690,10 @@ public class Player extends User implements Executor, IPlayer
Player target = this.server.getPlayer(space < 0 ? line.substring(1) : line.substring(1, space));
if(target == null)
return false;
target.addChat(this.entity.getColoredName(TextColor.LIGHT_GRAY) + " -> " + target.entity.getColoredName(TextColor.LIGHT_GRAY) + " " +
target.addChat(this.entity.getColoredName(Color.LIGHT_GRAY) + " -> " + target.entity.getColoredName(Color.LIGHT_GRAY) + " " +
line);
if(target != this)
this.addChat(target.entity.getColoredName(TextColor.LIGHT_GRAY) + " -> " + this.entity.getColoredName(TextColor.LIGHT_GRAY) + " " +
this.addChat(target.entity.getColoredName(Color.LIGHT_GRAY) + " -> " + this.entity.getColoredName(Color.LIGHT_GRAY) + " " +
line);
return true;
}
@ -1704,7 +1704,7 @@ public class Player extends User implements Executor, IPlayer
String str = line.substring(1).trim();
if(str.isEmpty())
return false;
this.server.sendPacket(new SPacketMessage(String.format(TextColor.LIGHT_GRAY + "* %s %s", this.entity.getColoredName(TextColor.LIGHT_GRAY), str), Type.CHAT));
this.server.sendPacket(new SPacketMessage(String.format(Color.LIGHT_GRAY + "* %s %s", this.entity.getColoredName(Color.LIGHT_GRAY), str), Type.CHAT));
return true;
}
@ -1715,7 +1715,7 @@ public class Player extends User implements Executor, IPlayer
this.entity.flying &= this.entity.hasEffect(Effect.FLYING) || this.entity.canNaturallyFly();
this.entity.fallDistance = 0.0F;
this.sendPlayerAbilities();
this.addFeed(TextColor.RED + "NoClip wurde deaktiviert");
this.addFeed(Color.RED + "NoClip wurde deaktiviert");
}
}
@ -1873,7 +1873,7 @@ public class Player extends User implements Executor, IPlayer
if(this.isAdmin())
this.server.getScriptEnvironment().execute(command, this);
else
this.addConsole(TextColor.DARK_RED + "Nur Admins können Befehle ausführen");
this.addConsole(Color.DARK_RED + "Nur Admins können Befehle ausführen");
}
private List<String> completeCommand(String command) {
@ -1891,7 +1891,7 @@ public class Player extends User implements Executor, IPlayer
public void log(String msg) {
if(this.forcedExec != null)
this.forcedExec.log(TextColor.ACID + "Als " + TextColor.GREEN + "%s" + TextColor.DARK_GRAY + ": " + TextColor.RESET + "%s", this.getUser(), msg);
this.forcedExec.log(Color.ACID + "Als " + Color.GREEN + "%s" + Color.DARK_GRAY + ": " + Color.RESET + "%s", this.getUser(), msg);
else
this.addConsole(msg);
}
@ -1934,7 +1934,7 @@ public class Player extends User implements Executor, IPlayer
case CHAT:
if(!this.sendPlayer(msg) && !this.sendEmote(msg))
this.server.sendPacket(new SPacketMessage(String.format("%s %s", this.entity.getColoredName(TextColor.LIGHT_GRAY), msg), Type.CHAT));
this.server.sendPacket(new SPacketMessage(String.format("%s %s", this.entity.getColoredName(Color.LIGHT_GRAY), msg), Type.CHAT));
break;
case DISPLAY:
@ -2653,14 +2653,14 @@ public class Player extends User implements Executor, IPlayer
if(this.isAdmin()) {
boolean god = !this.entity.hasEffect(Effect.HASTE) || this.entity.getEffect(Effect.HASTE).getAmplifier() != 255;
this.entity.setGodMode(god);
this.addFeed(god ? (TextColor.GREEN + "Statuseffekte wurden hinzugefügt") : (TextColor.RED + "Statuseffekte wurden entfernt"));
this.addFeed(god ? (Color.GREEN + "Statuseffekte wurden hinzugefügt") : (Color.RED + "Statuseffekte wurden entfernt"));
}
break;
case NOCLIP:
if(this.isAdmin()) {
this.entity.setNoclip(!this.entity.noclip);
this.addFeed((this.entity.noclip ? TextColor.GREEN : TextColor.RED) + "NoClip ist jetzt " + (this.entity.noclip ? "eingeschaltet" : "ausgeschaltet"));
this.addFeed((this.entity.noclip ? Color.GREEN : Color.RED) + "NoClip ist jetzt " + (this.entity.noclip ? "eingeschaltet" : "ausgeschaltet"));
}
break;
@ -2670,7 +2670,7 @@ public class Player extends User implements Executor, IPlayer
this.entity.removeEffect(Effect.SPEED);
else
this.entity.addEffect(new StatusEffect(Effect.SPEED, Integer.MAX_VALUE, 19));
this.addFeed(TextColor.GREEN + "Deine Geschwindigkeit wurde auf %dx geändert", (int)(this.entity.getAIMoveSpeed() * 10.0f));
this.addFeed(Color.GREEN + "Deine Geschwindigkeit wurde auf %dx geändert", (int)(this.entity.getAIMoveSpeed() * 10.0f));
// int speed = this.playerEntity.speed != 1.0f ? 1 : 5;
// this.playerEntity.speed = (float)speed;
// this.playerEntity.sendPlayerAbilities();
@ -2684,7 +2684,7 @@ public class Player extends User implements Executor, IPlayer
this.entity.setHealth(this.entity.getMaxHealth());
this.entity.setManaPoints(this.entity.getMaxMana());
this.entity.clearEffects(true);
this.addFeed(TextColor.DARK_GREEN + "Du wurdest geheilt");
this.addFeed(Color.DARK_GREEN + "Du wurdest geheilt");
}
break;
@ -2745,7 +2745,7 @@ public class Player extends User implements Executor, IPlayer
mem = Runtime.getRuntime().freeMemory() - mem;
mem = mem < 0L ? 0L : mem;
// sender.addConsole("Server-JVM GC ausgeführt: ", );
this.addFeed(TextColor.DARK_GREEN + "%s%s MB freigegeben, %s MB von %s MB verwendet (%s %%)", worlds > 0 ? worlds + " entladen, " : "", mem / 1024L / 1024L, (Runtime.getRuntime().totalMemory() -
this.addFeed(Color.DARK_GREEN + "%s%s MB freigegeben, %s MB von %s MB verwendet (%s %%)", worlds > 0 ? worlds + " entladen, " : "", mem / 1024L / 1024L, (Runtime.getRuntime().totalMemory() -
Runtime.getRuntime().freeMemory()) / 1024L / 1024L, Runtime.getRuntime().totalMemory() / 1024L / 1024L,
Runtime.getRuntime().freeMemory() * 100L / Runtime.getRuntime().maxMemory());
}
@ -2919,11 +2919,11 @@ public class Player extends User implements Executor, IPlayer
if(!slot.isItemValid(stack))
return;
if(old.getSize() == 1)
this.addFeed(TextColor.DARK_RED + "* %s zerstört",
old.getColoredName(TextColor.DARK_RED));
this.addFeed(Color.DARK_RED + "* %s zerstört",
old.getColoredName(Color.DARK_RED));
else
this.addFeed(TextColor.DARK_RED + "* %d %s zerstört", old.getSize(),
old.getColoredName(TextColor.DARK_RED));
this.addFeed(Color.DARK_RED + "* %d %s zerstört", old.getSize(),
old.getColoredName(Color.DARK_RED));
}
}
else if(!slot.isItemValid(stack))
@ -2933,11 +2933,11 @@ public class Player extends User implements Executor, IPlayer
this.entity.openContainer.detectAndSendChanges();
this.entity.worldObj.playSoundAtEntity(this.entity, SoundEvent.POP, 0.2F);
if(amount == 1)
this.addFeed(TextColor.DARK_GREEN + "* %s geschummelt",
stack.getColoredName(TextColor.DARK_GREEN));
this.addFeed(Color.DARK_GREEN + "* %s geschummelt",
stack.getColoredName(Color.DARK_GREEN));
else
this.addFeed(TextColor.DARK_GREEN + "* %d %s geschummelt", amount,
stack.getColoredName(TextColor.DARK_GREEN));
this.addFeed(Color.DARK_GREEN + "* %d %s geschummelt", amount,
stack.getColoredName(Color.DARK_GREEN));
}
public void processSign(CPacketSign packetIn)
@ -2971,7 +2971,7 @@ public class Player extends User implements Executor, IPlayer
// boolean color = this.playerEntity.canUse(Permissions.SIGNFORMAT);
for (int i = 0; i < lines.length; ++i)
{
tileentitysign.text[i] = TextColor.stripCodes(lines[i]); // lines[i]; // color ? lines[i] : ChatFormat.stripCodes(lines[i]);
tileentitysign.text[i] = Color.stripCodes(lines[i]); // lines[i]; // color ? lines[i] : ChatFormat.stripCodes(lines[i]);
}
// if(this.signCommand != null) {

View file

@ -108,7 +108,7 @@ import common.util.BlockPos;
import common.util.Facing;
import common.util.Facing.Axis;
import common.util.NibbleArray;
import common.util.TextColor;
import common.util.Color;
import common.world.State;
public abstract class Converter {
@ -290,9 +290,9 @@ public abstract class Converter {
private static final Map<String, String> ENTITY_MAP = Maps.newHashMap();
private static final Map<String, Class<? extends TileEntity>> TILE_MAP = Maps.newHashMap();
private static final State[] BLOCK_MAP = new State[65536];
private static final TextColor[] COLOR_LOOKUP = new TextColor[] {
TextColor.WHITE, TextColor.ORANGE, TextColor.MAGENTA, TextColor.LIGHT_BLUE, TextColor.YELLOW, TextColor.GREEN, TextColor.MAGENTA, TextColor.GRAY,
TextColor.LIGHT_GRAY, TextColor.CYAN, TextColor.VIOLET, TextColor.BLUE, TextColor.BROWN, TextColor.DARK_GREEN, TextColor.RED, TextColor.BLACK
private static final Color[] COLOR_LOOKUP = new Color[] {
Color.WHITE, Color.ORANGE, Color.MAGENTA, Color.LIGHT_BLUE, Color.YELLOW, Color.GREEN, Color.MAGENTA, Color.GRAY,
Color.LIGHT_GRAY, Color.CYAN, Color.VIOLET, Color.BLUE, Color.BROWN, Color.DARK_GREEN, Color.RED, Color.BLACK
};
private static void mapEntity(Class<? extends Entity> clazz, String ... names) {