item retexture - most fixed
|
@ -168,7 +168,7 @@ import common.util.HitPosition;
|
|||
import common.util.IntHashMap;
|
||||
import common.util.LongHashMap;
|
||||
import common.util.ParticleType;
|
||||
import common.util.TextColor;
|
||||
import common.util.Color;
|
||||
import common.util.Util;
|
||||
import common.util.Var;
|
||||
import common.util.HitPosition.ObjectType;
|
||||
|
@ -1036,7 +1036,7 @@ public class Client implements IThreadListener {
|
|||
private int drawStat(int x, int y, String name, int value, int max, int color) {
|
||||
int w = (int)(246.0f * (float)value / (float)max);
|
||||
Drawing.drawTextboxRight(name, x + 250, y, 0x3f000000);
|
||||
Drawing.drawTextbox(String.format(TextColor.GREEN + "%d " + TextColor.GRAY + "/ " + TextColor.NEON + "%d", value, max), x, y, 0x3f000000);
|
||||
Drawing.drawTextbox(String.format(Color.GREEN + "%d " + Color.GRAY + "/ " + Color.NEON + "%d", value, max), x, y, 0x3f000000);
|
||||
Drawing.drawRectBorder(x, y + 20, 250, 10, 0xff000000, 0xff202020, 0xffcfcfcf, 0xff6f6f6f);
|
||||
Drawing.drawGradient(x + 2 + 246 - w, y + 20 + 2, w, 6, color | 0xff000000, Util.mixColor(color | 0xff000000, 0xff000000));
|
||||
return y + 40;
|
||||
|
@ -1085,10 +1085,10 @@ public class Client implements IThreadListener {
|
|||
Entity ent;
|
||||
if(this.player != null && now - status.getValue() < 10000L && (ent = this.player.worldObj.getEntityByID(status.getKey())) instanceof EntityLiving) {
|
||||
EntityLiving entity = (EntityLiving)ent;
|
||||
String s = entity.getName() + TextColor.GRAY + " [" +
|
||||
String s = entity.getName() + Color.GRAY + " [" +
|
||||
EntityLiving.getHealthColor(entity.getHealth(), entity.getMaxHealth()) +
|
||||
entity.getHealth() + TextColor.GRAY + " / " + EntityLiving.getMaxHpColor(entity.getMaxHealth()) +
|
||||
entity.getMaxHealth() + TextColor.GRAY + "]";
|
||||
entity.getHealth() + Color.GRAY + " / " + EntityLiving.getMaxHpColor(entity.getMaxHealth()) +
|
||||
entity.getMaxHealth() + Color.GRAY + "]";
|
||||
Drawing.drawTextboxCentered(s, x, y, 0x3f000000);
|
||||
Drawing.drawRectBorder(x - 200, y + 20, 400, 10, 0xff000000, 0xff202020, 0xffcfcfcf, 0xff6f6f6f);
|
||||
Drawing.drawGradient(x - 200 + 2, y + 20 + 2, (int)(396.0f * ((float)entity.getHealth() / (float)entity.getMaxHealth())), 6, entity.getColor() | 0xff000000, Util.mixColor(entity.getColor() | 0xff000000, 0xff000000));
|
||||
|
@ -1105,8 +1105,8 @@ public class Client implements IThreadListener {
|
|||
for(StatusEffect effect : this.player.getEffects()) {
|
||||
Effect potion = effect.getPotion();
|
||||
int color = potion.getColor();
|
||||
String name = (potion.isBadEffect() ? TextColor.ORANGE : TextColor.ACID) + effect.getEffectName();
|
||||
String desc = TextColor.NEON + effect.getDurationString();
|
||||
String name = (potion.isBadEffect() ? Color.ORANGE : Color.ACID) + effect.getEffectName();
|
||||
String desc = Color.NEON + effect.getDurationString();
|
||||
Drawing.drawRectBorder(x, y, 250, Font.YGLYPH + 6, 0xff000000, 0xff202020, 0xffcfcfcf, 0xff6f6f6f);
|
||||
Drawing.drawGradient(x + 2, y + 2, effect.isInfinite() ? 246 : ((int)(246.0f * ((float)effect.getRemaining() / (float)effect.getDuration()))), Font.YGLYPH + 2, color | 0xff000000, Util.mixColor(color | 0xff000000, 0xff000000));
|
||||
Drawing.drawText(name, x + 4, y + 3, 0xffffffff);
|
||||
|
@ -1128,16 +1128,16 @@ public class Client implements IThreadListener {
|
|||
y = this.fbY - 40 - stats * 40;
|
||||
int hp = entity.getHealth();
|
||||
int max = entity.getMaxHealth();
|
||||
y = this.drawStat(x, y, TextColor.RED + "Schaden", hp, max, 0xff0000);
|
||||
y = this.drawStat(x, y, Color.RED + "Schaden", hp, max, 0xff0000);
|
||||
if(absorb > 0)
|
||||
y = this.drawStat(x, y, TextColor.YELLOW + "Schadenspuffer", absorb, 1024, 0xffff00);
|
||||
y = this.drawStat(x, y, Color.YELLOW + "Schadenspuffer", absorb, 1024, 0xffff00);
|
||||
if(entity instanceof EntityWaterNPC npc) {
|
||||
int moist = npc.getMoisture();
|
||||
int maxm = npc.getMaxMoisture();
|
||||
y = this.drawStat(x, y, TextColor.BLUE + "Feuchtigkeit", moist, maxm, 0x4f4fff);
|
||||
y = this.drawStat(x, y, Color.BLUE + "Feuchtigkeit", moist, maxm, 0x4f4fff);
|
||||
}
|
||||
if(armor > 0)
|
||||
y = this.drawStat(x, y, TextColor.GRAY + "Rüstung", armor, 1024, 0x707070);
|
||||
y = this.drawStat(x, y, Color.GRAY + "Rüstung", armor, 1024, 0x707070);
|
||||
if(entity.vehicle instanceof EntityLiving living) {
|
||||
int vh = living.getHealth();
|
||||
int vhMax = living.getMaxHealth();
|
||||
|
@ -1146,23 +1146,23 @@ public class Client implements IThreadListener {
|
|||
if(entity.getManaPoints() > 0) {
|
||||
int mana = entity.getManaPoints();
|
||||
int maxm = entity.getMaxMana();
|
||||
y = this.drawStat(x, y, TextColor.CYAN + "Mana", mana, maxm, 0x0000ff);
|
||||
y = this.drawStat(x, y, Color.CYAN + "Mana", mana, maxm, 0x0000ff);
|
||||
}
|
||||
for(int z = 0; z < Energy.values().length; z++) {
|
||||
Energy type = Energy.values()[z];
|
||||
int energy = entity.getEnergy(type);
|
||||
if(energy > 0) {
|
||||
int emax = entity.getEnergyCap(type);
|
||||
y = this.drawStat(x, y, TextColor.LIGHT_GRAY + type.display, energy, emax, entity.hasEnergyEffect(type) ? type.effect : type.color);
|
||||
y = this.drawStat(x, y, Color.LIGHT_GRAY + type.display, energy, emax, entity.hasEnergyEffect(type) ? type.effect : type.color);
|
||||
}
|
||||
}
|
||||
|
||||
x = 40;
|
||||
y = this.fbY - 40 - (this.player.isRidingHorse() && this.player.getHorseJumpPower() != 0.0f ? 2 : 1) * 40;
|
||||
if(this.player.isRidingHorse() && this.player.getHorseJumpPower() != 0.0f) // {
|
||||
y = this.drawBar(x, y, String.format(TextColor.NEON + "Sprungkraft: " + TextColor.CYAN + "%d %%", (int)(this.player.getHorseJumpPower() * 100.0f)),
|
||||
y = this.drawBar(x, y, String.format(Color.NEON + "Sprungkraft: " + Color.CYAN + "%d %%", (int)(this.player.getHorseJumpPower() * 100.0f)),
|
||||
this.player.getHorseJumpPower(), 0x4040ff);
|
||||
y = this.drawBar(x, y, String.format(TextColor.ACID + "EXP: " + TextColor.GREEN + "Level %d, %d/%d", this.player.experienceLevel, (int)((float)this.player.xpBarCap() * this.player.experience), this.player.xpBarCap()), this.player.experience, 0x40ff40);
|
||||
y = this.drawBar(x, y, String.format(Color.ACID + "EXP: " + Color.GREEN + "Level %d, %d/%d", this.player.experienceLevel, (int)((float)this.player.xpBarCap() * this.player.experience), this.player.xpBarCap()), this.player.experience, 0x40ff40);
|
||||
}
|
||||
|
||||
GlState.bindTexture(0);
|
||||
|
@ -1239,9 +1239,9 @@ public class Client implements IThreadListener {
|
|||
this.renderLagometer();
|
||||
}
|
||||
else {
|
||||
Drawing.drawText(String.format("%s%.2f" + TextColor.RESET + " %s [%s" + TextColor.RESET + "], %.3f ms, W %d x %d%s",
|
||||
Drawing.drawText(String.format("%s%.2f" + Color.RESET + " %s [%s" + Color.RESET + "], %.3f ms, W %d x %d%s",
|
||||
this.framecode(), this.framerate < 1.0f ? 1.0f / this.framerate : this.framerate, this.framerate < 1.0f ? "SPF" : "FPS",
|
||||
this.vsync ? TextColor.DARK_GRAY + "VSYNC" : (this.syncLimited ? TextColor.GREEN + "" + this.syncLimit : TextColor.RED + "UNL"),
|
||||
this.vsync ? Color.DARK_GRAY + "VSYNC" : (this.syncLimited ? Color.GREEN + "" + this.syncLimit : Color.RED + "UNL"),
|
||||
(float)PerfSection.getTotal(false) / 1000.0f, this.fbRawX, this.fbRawY,
|
||||
this.fullscreen ? " @ " + (this.vidMode == null ? "?" : this.vidMode.refresh()) + " Hz" : ""),
|
||||
0, 0, 0xffffffff);
|
||||
|
@ -1264,14 +1264,14 @@ public class Client implements IThreadListener {
|
|||
String draw = String.format(
|
||||
"OpenGL: %s\n" +
|
||||
"Renderer: %s (%s)\n" +
|
||||
"Bildrate: %s%.2f" + TextColor.RESET + " %s [%s" + TextColor.RESET + "], %.3f ms, W %d x %d%s\n" +
|
||||
"Tickrate: %s%.2f" + TextColor.RESET + " %s [" + TextColor.GREEN + "%.1f" + TextColor.RESET + "], %.3f ms, E %d ms" +
|
||||
"Bildrate: %s%.2f" + Color.RESET + " %s [%s" + Color.RESET + "], %.3f ms, W %d x %d%s\n" +
|
||||
"Tickrate: %s%.2f" + Color.RESET + " %s [" + Color.GREEN + "%.1f" + Color.RESET + "], %.3f ms, E %d ms" +
|
||||
"%s%s"
|
||||
,
|
||||
GL11.glGetString(GL11.GL_VERSION),
|
||||
GL11.glGetString(GL11.GL_RENDERER), GL11.glGetString(GL11.GL_VENDOR),
|
||||
this.framecode(), this.framerate < 1.0f ? 1.0f / this.framerate : this.framerate, this.framerate < 1.0f ? "SPF" : "FPS",
|
||||
this.vsync ? TextColor.DARK_GRAY + "VSYNC" : (this.syncLimited ? TextColor.GREEN + "" + this.syncLimit : TextColor.RED + "UNL"),
|
||||
this.vsync ? Color.DARK_GRAY + "VSYNC" : (this.syncLimited ? Color.GREEN + "" + this.syncLimit : Color.RED + "UNL"),
|
||||
(float)PerfSection.getTotal(false) / 1000.0f, this.fbRawX, this.fbRawY,
|
||||
this.fullscreen ? " @ " + (this.vidMode == null ? "?" : this.vidMode.refresh()) + " Hz" : "",
|
||||
this.tpscode(), this.tickrate < 1.0f ? 1.0f / this.tickrate : this.tickrate,
|
||||
|
@ -1856,7 +1856,7 @@ public class Client implements IThreadListener {
|
|||
String.format("Richtung: %s (%.1f / %.1f)", dirStr,
|
||||
ExtMath.wrapf(this.viewEntity.rotYaw), ExtMath.wrapf(this.viewEntity.rotPitch)) + "\n" +
|
||||
String.format("Biom: %.2f K, N: %.2f K, D: %s (%s)", chunk.getTemperature(pos), chunk.getOffset(pos),
|
||||
TextColor.stripCodes(this.world.dimension.getDisplay()),
|
||||
Color.stripCodes(this.world.dimension.getDisplay()),
|
||||
this.dimensionName) + "\n" +
|
||||
"Licht: " + chunk.getLightSub(pos, 0) + " (" + chunk.getLight(LightType.SKY, pos) + " Himmel, "
|
||||
+ chunk.getLight(LightType.BLOCK, pos) + " Blöcke, " + String.format(
|
||||
|
@ -1905,7 +1905,7 @@ public class Client implements IThreadListener {
|
|||
String.format("Position: %d %d %d", pos.getX(), pos.getY(), pos.getZ())
|
||||
);
|
||||
for(Entry<Property, Comparable> entry : block.getProperties().entrySet()) {
|
||||
str.append("\n" + (block.getBlock().getSavedProperties().contains(entry.getKey()) ? TextColor.NEON : TextColor.LIGHT_GRAY) + entry.getKey().getName() + TextColor.RESET + ": " + (entry.getValue() instanceof Boolean bool ? (bool ? TextColor.GREEN : TextColor.RED) + "" + entry.getValue() + TextColor.RESET : entry.getValue()));
|
||||
str.append("\n" + (block.getBlock().getSavedProperties().contains(entry.getKey()) ? Color.NEON : Color.LIGHT_GRAY) + entry.getKey().getName() + Color.RESET + ": " + (entry.getValue() instanceof Boolean bool ? (bool ? Color.GREEN : Color.RED) + "" + entry.getValue() + Color.RESET : entry.getValue()));
|
||||
}
|
||||
|
||||
return str.toString();
|
||||
|
@ -1936,7 +1936,7 @@ public class Client implements IThreadListener {
|
|||
+ (entity.isWet() ? "W" : "") + (entity.canAttackWithItem() ? "A" : "")
|
||||
+ (entity.passenger != null ? "H" : "") + (entity.vehicle != null ? "R" : "")
|
||||
+ (entity.doesEntityNotTriggerPressurePlate() ? "L" : "") + "\n" +
|
||||
(entity.hasCustomName() ? "Name: '" + TextColor.stripCodes(entity.getCustomNameTag()) + "'" : "Name: n/a")
|
||||
(entity.hasCustomName() ? "Name: '" + Color.stripCodes(entity.getCustomNameTag()) + "'" : "Name: n/a")
|
||||
;
|
||||
}
|
||||
|
||||
|
@ -2286,7 +2286,7 @@ public class Client implements IThreadListener {
|
|||
public void disconnected(String msg) {
|
||||
Log.NETWORK.info("Getrennt: %s", msg);
|
||||
this.unload(true);
|
||||
this.show(new GuiInfo("Von Server getrennt", TextColor.RED + "Verbindung zum Server wurde getrennt\n\n" + TextColor.RESET + msg));
|
||||
this.show(new GuiInfo("Von Server getrennt", Color.RED + "Verbindung zum Server wurde getrennt\n\n" + Color.RESET + msg));
|
||||
}
|
||||
|
||||
|
||||
|
@ -2397,13 +2397,13 @@ public class Client implements IThreadListener {
|
|||
}, "Screenshot writer").start();
|
||||
}
|
||||
|
||||
public TextColor framecode() {
|
||||
return (this.framerate >= 59.0f) ? TextColor.GREEN : ((this.framerate >= 29.0f) ? TextColor.YELLOW : ((this.framerate >= 14.0f) ? TextColor.ORANGE : TextColor.RED));
|
||||
public Color framecode() {
|
||||
return (this.framerate >= 59.0f) ? Color.GREEN : ((this.framerate >= 29.0f) ? Color.YELLOW : ((this.framerate >= 14.0f) ? Color.ORANGE : Color.RED));
|
||||
}
|
||||
|
||||
public TextColor tpscode() {
|
||||
return (this.tickrate >= (((float)this.tickTarget / 1000.0f) - 1.0f)) ? TextColor.GREEN : ((this.tickrate >= (((float)this.tickTarget / 1000.0f) / 2.0f - 1.0f)) ? TextColor.YELLOW :
|
||||
((this.tickrate >= (((float)this.tickTarget / 1000.0f) / 4.0f - 1.0f)) ? TextColor.ORANGE : TextColor.RED));
|
||||
public Color tpscode() {
|
||||
return (this.tickrate >= (((float)this.tickTarget / 1000.0f) - 1.0f)) ? Color.GREEN : ((this.tickrate >= (((float)this.tickTarget / 1000.0f) / 2.0f - 1.0f)) ? Color.YELLOW :
|
||||
((this.tickrate >= (((float)this.tickTarget / 1000.0f) / 4.0f - 1.0f)) ? Color.ORANGE : Color.RED));
|
||||
}
|
||||
|
||||
private void doTicks() {
|
||||
|
@ -2490,10 +2490,10 @@ public class Client implements IThreadListener {
|
|||
this.registerDebug(Keysym.H, "Hilfe zu Tastenkombinationen anzeigen", new DebugRunner() {
|
||||
public void execute(Keysym key) {
|
||||
String bind = Bind.CHEAT.getInput() == null ? "n/a" : Bind.CHEAT.getInput().getDisplay();
|
||||
Client.this.show(new GuiInfo("Hilfe zu Tastenkombinationen", TextColor.DARK_GREEN + "" + Client.this.debug.size() + " Tastenkombinationen stehen zur Verfügung:\n" +
|
||||
Client.this.show(new GuiInfo("Hilfe zu Tastenkombinationen", Color.DARK_GREEN + "" + Client.this.debug.size() + " Tastenkombinationen stehen zur Verfügung:\n" +
|
||||
Util.buildLines(new Function<DebugFunction, String>() {
|
||||
public String apply(DebugFunction func) {
|
||||
return TextColor.CYAN + bind + TextColor.RED + "+" + TextColor.GREEN + func.key.getDisplay() + TextColor.GRAY + " - " + TextColor.YELLOW + func.help;
|
||||
return Color.CYAN + bind + Color.RED + "+" + Color.GREEN + func.key.getDisplay() + Color.GRAY + " - " + Color.YELLOW + func.help;
|
||||
}
|
||||
}, Client.this.debug.values())));
|
||||
}
|
||||
|
@ -2623,7 +2623,7 @@ public class Client implements IThreadListener {
|
|||
}
|
||||
else {
|
||||
this.lastUsed = System.currentTimeMillis();
|
||||
Client.this.logFeed(TextColor.RED + "VORSICHT: Debug-Absturz nach mehrmaligem Drücken innerhalb einer Sekunde");
|
||||
Client.this.logFeed(Color.RED + "VORSICHT: Debug-Absturz nach mehrmaligem Drücken innerhalb einer Sekunde");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -2862,9 +2862,9 @@ public class Client implements IThreadListener {
|
|||
|
||||
private void printVar(CVar cv) {
|
||||
String values = cv.getValues();
|
||||
this.logConsole("%s " + TextColor.NEON + "%s " + TextColor.DARK_GRAY + "[%s" + TextColor.DARK_GRAY + "]" + TextColor.GRAY + " = " + TextColor.WHITE + "%s " + TextColor.DARK_GRAY +
|
||||
"[" + TextColor.GRAY + "D " + TextColor.CRIMSON + "%s" + TextColor.DARK_GRAY + "]%s", cv.getType(), cv.getCVarName(), cv.getCategory(), cv.format(), cv.getDefault(),
|
||||
values != null ? " [" + TextColor.LIGHT_GRAY + values + TextColor.DARK_GRAY + "]" : "");
|
||||
this.logConsole("%s " + Color.NEON + "%s " + Color.DARK_GRAY + "[%s" + Color.DARK_GRAY + "]" + Color.GRAY + " = " + Color.WHITE + "%s " + Color.DARK_GRAY +
|
||||
"[" + Color.GRAY + "D " + Color.CRIMSON + "%s" + Color.DARK_GRAY + "]%s", cv.getType(), cv.getCVarName(), cv.getCategory(), cv.format(), cv.getDefault(),
|
||||
values != null ? " [" + Color.LIGHT_GRAY + values + Color.DARK_GRAY + "]" : "");
|
||||
}
|
||||
|
||||
public void exec(String line) {
|
||||
|
@ -2872,7 +2872,7 @@ public class Client implements IThreadListener {
|
|||
for(CVar cv : this.cvars.values()) {
|
||||
printVar(cv);
|
||||
}
|
||||
this.logConsole(TextColor.GREEN + "CVARs insgesamt registriert: %d", this.cvars.size());
|
||||
this.logConsole(Color.GREEN + "CVARs insgesamt registriert: %d", this.cvars.size());
|
||||
return;
|
||||
}
|
||||
else if(line.startsWith("#")) {
|
||||
|
@ -2890,7 +2890,7 @@ public class Client implements IThreadListener {
|
|||
this.logConsole("%s -> %s", cv.getCVarName(), cv.format());
|
||||
}
|
||||
else {
|
||||
this.logConsole(TextColor.RED + "Kann CVAR '%s' nicht auf '%s' setzen", cv.getCVarName(), value);
|
||||
this.logConsole(Color.RED + "Kann CVAR '%s' nicht auf '%s' setzen", cv.getCVarName(), value);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
@ -2900,7 +2900,7 @@ public class Client implements IThreadListener {
|
|||
}
|
||||
|
||||
public void reset() {
|
||||
this.buffer = TextColor.NEON + "*** " + VERSION + " ***";
|
||||
this.buffer = Color.NEON + "*** " + VERSION + " ***";
|
||||
this.console.clear();
|
||||
this.chat.clear();
|
||||
this.feed.clear();
|
||||
|
@ -3015,30 +3015,30 @@ public class Client implements IThreadListener {
|
|||
|
||||
private void drawPing(int x, int y, int ping) {
|
||||
int bars;
|
||||
TextColor color;
|
||||
Color color;
|
||||
if(ping < 0 || ping >= 20000) {
|
||||
bars = 0;
|
||||
color = ping < 0 ? TextColor.GRAY : TextColor.DARK_RED;
|
||||
color = ping < 0 ? Color.GRAY : Color.DARK_RED;
|
||||
}
|
||||
else if(ping < 80) {
|
||||
bars = ping < 50 ? 8 : 7;
|
||||
color = TextColor.GREEN;
|
||||
color = Color.GREEN;
|
||||
}
|
||||
else if(ping < 160) {
|
||||
bars = ping < 120 ? 6 : 5;
|
||||
color = TextColor.DARK_GREEN;
|
||||
color = Color.DARK_GREEN;
|
||||
}
|
||||
else if(ping < 350) {
|
||||
bars = ping < 220 ? 4 : 3;
|
||||
color = TextColor.YELLOW;
|
||||
color = Color.YELLOW;
|
||||
}
|
||||
else if(ping < 700) {
|
||||
bars = ping < 500 ? 2 : 1;
|
||||
color = TextColor.RED;
|
||||
color = Color.RED;
|
||||
}
|
||||
else {
|
||||
bars = 1;
|
||||
color = TextColor.DARK_RED;
|
||||
color = Color.DARK_RED;
|
||||
}
|
||||
Drawing.drawTextRight(color + (ping < 10000 ? String.format("%d", ping) + "ms" : String.format("%.1f", ((float)ping) / 1000.0f) + "s"), x - 18, y, 0xffffffff);
|
||||
for(int z = 0; z < bars; z++) {
|
||||
|
|
|
@ -6,7 +6,7 @@ import client.gui.element.SliderCallback;
|
|||
import client.vars.CVar;
|
||||
import client.vars.CVarCategory;
|
||||
import common.sound.EventType;
|
||||
import common.util.TextColor;
|
||||
import common.util.Color;
|
||||
|
||||
public enum Volume implements CVar {
|
||||
MASTER("master", "Gesamt"),
|
||||
|
@ -52,7 +52,7 @@ public enum Volume implements CVar {
|
|||
}
|
||||
|
||||
public String getType() {
|
||||
return TextColor.DARK_GREEN + "volume";
|
||||
return Color.DARK_GREEN + "volume";
|
||||
}
|
||||
|
||||
public CVarCategory getCategory() {
|
||||
|
|
|
@ -20,7 +20,7 @@ import common.log.Log;
|
|||
import common.network.IPlayer;
|
||||
import common.util.EncryptUtil;
|
||||
import common.util.Pair;
|
||||
import common.util.TextColor;
|
||||
import common.util.Color;
|
||||
import common.util.Util;
|
||||
|
||||
public class GuiConnect extends GuiList<GuiConnect.ServerInfo> implements ButtonCallback {
|
||||
|
@ -152,12 +152,12 @@ public class GuiConnect extends GuiList<GuiConnect.ServerInfo> implements Button
|
|||
}
|
||||
|
||||
public void draw(int x, int y, int width, int height, int mouseXIn, int mouseYIn, boolean hover) {
|
||||
Drawing.drawText(this.name + TextColor.GRAY + " - " + TextColor.RESET + this.user, x + 2, y, 0xffffffff);
|
||||
Drawing.drawText(this.name + Color.GRAY + " - " + Color.RESET + this.user, x + 2, y, 0xffffffff);
|
||||
if(this.keypair != null || !this.password.isEmpty())
|
||||
Drawing.drawTextRight(
|
||||
(this.keypair != null ? "Pubkey " + this.keyDigest : "") + (this.keypair != null && !this.password.isEmpty() ? " + " : "") + (!this.password.isEmpty() ? "Passwort" : ""),
|
||||
x + width - 2, y, 0xffffffff);
|
||||
Drawing.drawText(this.address + TextColor.GRAY + " Port " + TextColor.RESET + this.port + (this.enforceEncryption ? TextColor.GRAY + ", nur verschlüsselt" : ""),
|
||||
Drawing.drawText(this.address + Color.GRAY + " Port " + Color.RESET + this.port + (this.enforceEncryption ? Color.GRAY + ", nur verschlüsselt" : ""),
|
||||
x + 2, y + height - Font.YGLYPH * 2, 0xffb0b0b0);
|
||||
if(!this.access.isEmpty())
|
||||
Drawing.drawTextRight((this.keypair != null || !this.password.isEmpty() ? "+ " : "") + "Server-Passwort", x + width - 2, y + height - Font.YGLYPH * 2, 0xffb0b0b0);
|
||||
|
|
|
@ -22,7 +22,7 @@ import common.packet.CPacketComplete;
|
|||
import common.util.BlockPos;
|
||||
import common.util.ExtMath;
|
||||
import common.util.HitPosition;
|
||||
import common.util.TextColor;
|
||||
import common.util.Color;
|
||||
|
||||
public class GuiConsole extends Gui implements FieldCallback {
|
||||
private class ConsoleArea extends Area {
|
||||
|
@ -42,7 +42,7 @@ public class GuiConsole extends Gui implements FieldCallback {
|
|||
if(this.sel_start >= 0 && this.sel_end == this.sel_start) {
|
||||
for(int z = this.sel_start; z >= 0; z--) {
|
||||
char c = this.text.charAt(z);
|
||||
if(c == TextColor.COMMAND) {
|
||||
if(c == Color.COMMAND) {
|
||||
for(int n = z + 1; n < this.text.length(); n++) {
|
||||
c = this.text.charAt(n);
|
||||
if(c < 0x20) {
|
||||
|
@ -189,7 +189,7 @@ public class GuiConsole extends Gui implements FieldCallback {
|
|||
int nl = buffer.indexOf('\n', offset);
|
||||
buffer = nl >= 0 ? buffer.substring(nl + 1) : "";
|
||||
}
|
||||
this.setLog(buffer + "\n" + TextColor.RESET + msg);
|
||||
this.setLog(buffer + "\n" + Color.RESET + msg);
|
||||
}
|
||||
|
||||
public void autocompletePlayerNames()
|
||||
|
|
|
@ -4,13 +4,13 @@ import client.Client;
|
|||
import client.gui.element.MultiLabel;
|
||||
import client.gui.element.NavButton;
|
||||
import common.Version;
|
||||
import common.util.TextColor;
|
||||
import common.util.Color;
|
||||
import common.util.Util;
|
||||
|
||||
public class GuiInfo extends Gui {
|
||||
private static final String VER =
|
||||
TextColor.GREEN + "" + Util.repeatString("\u009a", Version.RELEASE.getId()) + TextColor.DARK_VIOLET + "|-| " + TextColor.VIOLET + Client.VERSION + TextColor.DARK_VIOLET + " |-|" +
|
||||
TextColor.GREEN + Util.repeatString("\u009a", Version.RELEASE.getId());
|
||||
Color.GREEN + "" + Util.repeatString("\u009a", Version.RELEASE.getId()) + Color.DARK_VIOLET + "|-| " + Color.VIOLET + Client.VERSION + Color.DARK_VIOLET + " |-|" +
|
||||
Color.GREEN + Util.repeatString("\u009a", Version.RELEASE.getId());
|
||||
|
||||
private static final String INFO = "Ein Spiel zur Simulation, zum Testen, für Rollenspiele, Mehrspieler und vieles mehr." + "\n" +
|
||||
"Optimiert für Geschwindigkeit, Stabilität und\u007f\u007f [Speicherzugriffsfehler]";
|
||||
|
@ -42,28 +42,28 @@ public class GuiInfo extends Gui {
|
|||
}
|
||||
|
||||
private static String getHeader(boolean hax, String normal, String hacked) {
|
||||
return (hax ? TextColor.RED : TextColor.YELLOW) + (hax ? hacked : normal) + "\n" +
|
||||
(hax ? TextColor.CYAN : TextColor.WHITE) + "==========================+==========================";
|
||||
return (hax ? Color.RED : Color.YELLOW) + (hax ? hacked : normal) + "\n" +
|
||||
(hax ? Color.CYAN : Color.WHITE) + "==========================+==========================";
|
||||
}
|
||||
|
||||
private static void addLines(StringBuilder sb, boolean hax, String alternate, String category, String... authors) {
|
||||
sb.append("\n" + (hax ? TextColor.BLUE : TextColor.GRAY)
|
||||
sb.append("\n" + (hax ? Color.BLUE : Color.GRAY)
|
||||
+ (hax ? alternate : category) + "\n ");
|
||||
for(int z = 0; z < authors.length; z++) {
|
||||
if(z > 0)
|
||||
sb.append((hax ? TextColor.VIOLET : TextColor.GRAY) + ", ");
|
||||
sb.append((hax ? TextColor.DARK_VIOLET : TextColor.WHITE) + authors[z]);
|
||||
sb.append((hax ? Color.VIOLET : Color.GRAY) + ", ");
|
||||
sb.append((hax ? Color.DARK_VIOLET : Color.WHITE) + authors[z]);
|
||||
}
|
||||
}
|
||||
|
||||
private static String getInfo(boolean hax) {
|
||||
return getHeader(hax, VER, VER) + "\n" + (hax ? (TextColor.VIOLET + HACKED) : (TextColor.LIGHT_GRAY + INFO));
|
||||
return getHeader(hax, VER, VER) + "\n" + (hax ? (Color.VIOLET + HACKED) : (Color.LIGHT_GRAY + INFO));
|
||||
}
|
||||
|
||||
private static String getLibraries(boolean hax) {
|
||||
StringBuilder sb = new StringBuilder(getHeader(hax, "Verwendete Programmbibliotheken", "U$3d 3xpl0its"));
|
||||
for(String lib : LIBRARIES) {
|
||||
sb.append("\n" + TextColor.NEON + lib);
|
||||
sb.append("\n" + Color.NEON + lib);
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
@ -71,17 +71,17 @@ public class GuiInfo extends Gui {
|
|||
private static String getCode(boolean hax) {
|
||||
StringBuilder sb = new StringBuilder(getHeader(hax, "Zusätzlicher Quellcode", "M0ar 3xpl01ts"));
|
||||
for(String lib : CODE) {
|
||||
sb.append("\n" + TextColor.NEON + lib);
|
||||
sb.append("\n" + Color.NEON + lib);
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
private static String getColors() {
|
||||
StringBuilder sb = new StringBuilder(TextColor.RESET + "#D ");
|
||||
StringBuilder sb = new StringBuilder(Color.RESET + "#D ");
|
||||
int num = 0;
|
||||
for(TextColor color : TextColor.values()) {
|
||||
if(num == TextColor.values().length / 2)
|
||||
sb.append("\n" + TextColor.COMMAND + "#d ");
|
||||
for(Color color : Color.values()) {
|
||||
if(num == Color.values().length / 2)
|
||||
sb.append("\n" + Color.COMMAND + "#d ");
|
||||
sb.append(color + "#" + color.colorId + ' ');
|
||||
num++;
|
||||
}
|
||||
|
@ -92,8 +92,8 @@ public class GuiInfo extends Gui {
|
|||
StringBuilder sb = new StringBuilder(getHeader(hax, "Mitwirkende dieses Programms", "Das Team -- TCQ"));
|
||||
|
||||
addLines(sb, hax, "Die dunklen Herrscher", "Quellcode, Design, Grafiken, Refactoring und Code-Cleanup",
|
||||
TextColor.CYAN + "Sen der \"kleine\" Dämon",
|
||||
TextColor.RED + "Shen, Herrscher des Schattenlandes");
|
||||
Color.CYAN + "Sen der \"kleine\" Dämon",
|
||||
Color.RED + "Shen, Herrscher des Schattenlandes");
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@ import client.renderer.Drawing;
|
|||
import client.window.Keysym;
|
||||
import common.rng.Random;
|
||||
import common.util.ExtMath;
|
||||
import common.util.TextColor;
|
||||
import common.util.Color;
|
||||
|
||||
public class GuiMenu extends Gui {
|
||||
public static final GuiMenu INSTANCE = new GuiMenu();
|
||||
|
@ -59,7 +59,7 @@ public class GuiMenu extends Gui {
|
|||
}
|
||||
if(GuiMenu.this.hacked == 9) {
|
||||
GuiMenu.this.hacked++;
|
||||
GuiMenu.this.splashLabel.setText(TextColor.VIOLET + "Hax!");
|
||||
GuiMenu.this.splashLabel.setText(Color.VIOLET + "Hax!");
|
||||
}
|
||||
else {
|
||||
GuiMenu.this.gm.show(GuiConnect.INSTANCE);
|
||||
|
@ -104,7 +104,7 @@ public class GuiMenu extends Gui {
|
|||
}
|
||||
}, "Client schließen"));
|
||||
this.shift();
|
||||
this.add(new Label(4, 4, 200, 0, TextColor.VIOLET + Client.VERSION, true));
|
||||
this.add(new Label(4, 4, 200, 0, Color.VIOLET + Client.VERSION, true));
|
||||
this.splashLabel = this.add(new Label(0, 100, width, 0, ""));
|
||||
this.pickSplash();
|
||||
}
|
||||
|
@ -128,7 +128,7 @@ public class GuiMenu extends Gui {
|
|||
}
|
||||
|
||||
private void pickSplash() {
|
||||
this.splashLabel.setText(TextColor.VIOLET + this.rand.pick(Splashes.SPLASHES));
|
||||
this.splashLabel.setText(Color.VIOLET + this.rand.pick(Splashes.SPLASHES));
|
||||
}
|
||||
|
||||
private void resetAnimation() {
|
||||
|
@ -162,9 +162,9 @@ public class GuiMenu extends Gui {
|
|||
}
|
||||
this.animStep = !this.animStep;
|
||||
StringBuilder sb = new StringBuilder(11);
|
||||
sb.append(TextColor.GRAY);
|
||||
sb.append(Color.GRAY);
|
||||
sb.append("[");
|
||||
sb.append(TextColor.YELLOW);
|
||||
sb.append(Color.YELLOW);
|
||||
switch(this.animDir) {
|
||||
case -1:
|
||||
sb.append((this.animStep ? '>' : '-') + "' ");
|
||||
|
@ -176,7 +176,7 @@ public class GuiMenu extends Gui {
|
|||
sb.append(" `" + (this.animStep ? '<' : '-'));
|
||||
break;
|
||||
}
|
||||
sb.append(TextColor.GRAY);
|
||||
sb.append(Color.GRAY);
|
||||
sb.append("]");
|
||||
this.animStr = sb.toString();
|
||||
for(int z = this.animPos; z < this.animPos + 4; z++) {
|
||||
|
@ -186,39 +186,39 @@ public class GuiMenu extends Gui {
|
|||
this.animGrow[this.rand.zrange(this.animWidth)] += 1;
|
||||
}
|
||||
sb = new StringBuilder(this.animWidth + 2);
|
||||
sb.append(TextColor.DARK_GREEN);
|
||||
sb.append(Color.DARK_GREEN);
|
||||
for(int z = 0; z < this.animWidth; z++) {
|
||||
switch(this.animGrow[z] / 5) {
|
||||
case 0:
|
||||
sb.append(TextColor.BLACK);
|
||||
sb.append(Color.BLACK);
|
||||
break;
|
||||
case 1:
|
||||
sb.append(TextColor.GRAY);
|
||||
sb.append(Color.GRAY);
|
||||
break;
|
||||
case 2:
|
||||
case 3:
|
||||
sb.append(TextColor.LIGHT_GRAY);
|
||||
sb.append(Color.LIGHT_GRAY);
|
||||
break;
|
||||
case 4:
|
||||
case 5:
|
||||
case 6:
|
||||
sb.append(TextColor.WHITE);
|
||||
sb.append(Color.WHITE);
|
||||
break;
|
||||
case 7:
|
||||
case 8:
|
||||
case 9:
|
||||
case 10:
|
||||
sb.append(TextColor.MAGENTA);
|
||||
sb.append(Color.MAGENTA);
|
||||
break;
|
||||
case 11:
|
||||
case 12:
|
||||
case 13:
|
||||
case 14:
|
||||
case 15:
|
||||
sb.append(TextColor.DARK_VIOLET);
|
||||
sb.append(Color.DARK_VIOLET);
|
||||
break;
|
||||
default:
|
||||
sb.append(TextColor.VIOLET);
|
||||
sb.append(Color.VIOLET);
|
||||
break;
|
||||
}
|
||||
sb.append(",.");
|
||||
|
|
|
@ -19,7 +19,7 @@ import client.vars.Variable;
|
|||
import client.window.Window;
|
||||
import common.network.IPlayer;
|
||||
import common.util.EncryptUtil;
|
||||
import common.util.TextColor;
|
||||
import common.util.Color;
|
||||
|
||||
public class GuiServer extends Gui implements FieldCallback {
|
||||
public static final GuiServer INSTANCE = new GuiServer(null);
|
||||
|
@ -193,22 +193,22 @@ public class GuiServer extends Gui implements FieldCallback {
|
|||
if(this.server != null) {
|
||||
name = this.nameBox.getText();
|
||||
if(name.isEmpty()) {
|
||||
this.nameLabel.setText(TextColor.RED + "Name in der Liste");
|
||||
this.nameLabel.setText(Color.RED + "Name in der Liste");
|
||||
return;
|
||||
}
|
||||
if(GuiConnect.INSTANCE.isNameTaken(name)) {
|
||||
this.nameLabel.setText("Name in der Liste - " + TextColor.RED + "Bereits vorhanden");
|
||||
this.nameLabel.setText("Name in der Liste - " + Color.RED + "Bereits vorhanden");
|
||||
return;
|
||||
}
|
||||
}
|
||||
String addr = this.addrBox.getText();
|
||||
if(addr.isEmpty()) {
|
||||
this.addrLabel.setText(TextColor.RED + "Adresse / Hostname");
|
||||
this.addrLabel.setText(Color.RED + "Adresse / Hostname");
|
||||
return;
|
||||
}
|
||||
int port = -1;
|
||||
if(this.portBox.getText().isEmpty()) {
|
||||
this.portLabel.setText(TextColor.RED + "Port");
|
||||
this.portLabel.setText(Color.RED + "Port");
|
||||
return;
|
||||
}
|
||||
else {
|
||||
|
@ -216,27 +216,27 @@ public class GuiServer extends Gui implements FieldCallback {
|
|||
port = Integer.parseInt(this.portBox.getText());
|
||||
}
|
||||
catch(NumberFormatException e) {
|
||||
this.rangeLabel.setText("[" + TextColor.RED + "1024..32767" + TextColor.RESET + "]");
|
||||
this.rangeLabel.setText("[" + Color.RED + "1024..32767" + Color.RESET + "]");
|
||||
return;
|
||||
}
|
||||
if(port < 1024 || port > 32767) {
|
||||
this.rangeLabel.setText("[" + (port < 1024 ? TextColor.RED + "1024" + TextColor.RESET + "..32767" : "1024.." + TextColor.RED + "32767" + TextColor.RESET) + "]");
|
||||
this.rangeLabel.setText("[" + (port < 1024 ? Color.RED + "1024" + Color.RESET + "..32767" : "1024.." + Color.RED + "32767" + Color.RESET) + "]");
|
||||
return;
|
||||
}
|
||||
}
|
||||
String user = this.userBox.getText();
|
||||
if(user.isEmpty()) {
|
||||
this.userLabel.setText(TextColor.RED + "Benutzername");
|
||||
this.userLabel.setText(Color.RED + "Benutzername");
|
||||
return;
|
||||
}
|
||||
String pass = this.passBox.getText();
|
||||
if(!pass.isEmpty() && pass.length() < 8) {
|
||||
this.passLabel.setText((this.keypair == null ? "Anmelde" : "Ersatz") + "-Passwort (" + TextColor.RED + "mind. 8 Zeichen" + TextColor.RESET + ")");
|
||||
this.passLabel.setText((this.keypair == null ? "Anmelde" : "Ersatz") + "-Passwort (" + Color.RED + "mind. 8 Zeichen" + Color.RESET + ")");
|
||||
return;
|
||||
}
|
||||
String acc = this.accBox.getText();
|
||||
if(!acc.isEmpty() && acc.length() < 8) {
|
||||
this.accLabel.setText("Zugang (" + TextColor.RED + "mind. 8 Zeichen" + TextColor.RESET + ")");
|
||||
this.accLabel.setText("Zugang (" + Color.RED + "mind. 8 Zeichen" + Color.RESET + ")");
|
||||
return;
|
||||
}
|
||||
if(this.server == null) {
|
||||
|
|
|
@ -15,7 +15,7 @@ import common.entity.npc.PlayerCharacter;
|
|||
import common.packet.CPacketAction;
|
||||
import common.packet.CPacketAction.Action;
|
||||
import common.util.ExtMath;
|
||||
import common.util.TextColor;
|
||||
import common.util.Color;
|
||||
|
||||
public class GuiCharacters extends GuiList<GuiCharacters.CharacterEntry> implements ButtonCallback
|
||||
{
|
||||
|
@ -34,11 +34,11 @@ public class GuiCharacters extends GuiList<GuiCharacters.CharacterEntry> impleme
|
|||
{
|
||||
if(this.initial)
|
||||
Drawing.drawRect(x, y, 1, 36, 0xffaf0000);
|
||||
String str = this.character == null ? TextColor.BLUE + "[" + TextColor.CYAN + "+" + TextColor.BLUE + "]" :
|
||||
String.format(TextColor.GREEN + "Level " + TextColor.DARK_GREEN + "%d " + TextColor.YELLOW + "%s " + TextColor.VIOLET + "%s",
|
||||
String str = this.character == null ? Color.BLUE + "[" + Color.CYAN + "+" + Color.BLUE + "]" :
|
||||
String.format(Color.GREEN + "Level " + Color.DARK_GREEN + "%d " + Color.YELLOW + "%s " + Color.VIOLET + "%s",
|
||||
character.level(), character.type(), character.name());
|
||||
String pos = this.character == null ? TextColor.BROWN + "Neuen Charakter erstellen" :
|
||||
String.format(TextColor.NEON + "%s " + TextColor.GRAY + "bei " + TextColor.ACID + "%d" + TextColor.GRAY + ", " + TextColor.ACID + "%d" + TextColor.GRAY + ", " + TextColor.ACID + "%d",
|
||||
String pos = this.character == null ? Color.BROWN + "Neuen Charakter erstellen" :
|
||||
String.format(Color.NEON + "%s " + Color.GRAY + "bei " + Color.ACID + "%d" + Color.GRAY + ", " + Color.ACID + "%d" + Color.GRAY + ", " + Color.ACID + "%d",
|
||||
character.dim(), character.pos().getX(), character.pos().getY(), character.pos().getZ());
|
||||
Drawing.drawText(str, x + 3, y, 0xffffffff);
|
||||
Drawing.drawText(pos, x + 3, y + height - Font.YGLYPH, 0xffffffff);
|
||||
|
@ -63,7 +63,7 @@ public class GuiCharacters extends GuiList<GuiCharacters.CharacterEntry> impleme
|
|||
|
||||
private void updateButtons() {
|
||||
CharacterEntry entry = this.getSelected();
|
||||
this.descField.setText(entry == null ? "" : (entry.character == null ? "*neuer Charakter*" : String.format(TextColor.GRAY + "[%s%s" + TextColor.GRAY + "]\n" + TextColor.LIGHT_YELLOW + "Herkunft" + TextColor.LIGHT_GRAY + ": " + TextColor.LIGHT_BROWN + "%s\n" + TextColor.RESET + "%s", entry.character.align().color, entry.character.align().display, entry.character.origin() == null ? TextColor.DARK_GRAY + "*unbekannt*" : entry.character.origin(), entry.character.info() == null ? "*keine Beschreibung vorhanden*" : this.getSelected().character.info())));
|
||||
this.descField.setText(entry == null ? "" : (entry.character == null ? "*neuer Charakter*" : String.format(Color.GRAY + "[%s%s" + Color.GRAY + "]\n" + Color.LIGHT_YELLOW + "Herkunft" + Color.LIGHT_GRAY + ": " + Color.LIGHT_BROWN + "%s\n" + Color.RESET + "%s", entry.character.align().color, entry.character.align().display, entry.character.origin() == null ? Color.DARK_GRAY + "*unbekannt*" : entry.character.origin(), entry.character.info() == null ? "*keine Beschreibung vorhanden*" : this.getSelected().character.info())));
|
||||
this.actionButtom.setText(entry != null && entry.character == null ? "Charakter erstellen" : "Charakter spielen");
|
||||
this.actionButtom.enabled = entry != null && !entry.initial;
|
||||
this.deleteButtom.enabled = !this.gm.charEditor && entry != null && entry.character != null && !entry.initial;
|
||||
|
|
|
@ -40,7 +40,7 @@ import common.item.ItemStack;
|
|||
import common.packet.CPacketAction;
|
||||
import common.packet.CPacketCheat;
|
||||
import common.util.ExtMath;
|
||||
import common.util.TextColor;
|
||||
import common.util.Color;
|
||||
|
||||
public abstract class GuiContainer extends Gui
|
||||
{
|
||||
|
@ -125,14 +125,14 @@ public abstract class GuiContainer extends Gui
|
|||
List<String> list = Lists.<String>newArrayList();
|
||||
String s = stack.getColoredName();
|
||||
if(stack.getSize() != 1)
|
||||
s = TextColor.YELLOW + "" + stack.getSize() + " " + TextColor.RESET + s;
|
||||
s = s + TextColor.RESET;
|
||||
s = Color.YELLOW + "" + stack.getSize() + " " + Color.RESET + s;
|
||||
s = s + Color.RESET;
|
||||
list.add(s);
|
||||
stack.getItem().addInformation(stack, this.gm.player, list);
|
||||
if(stack.getItem().isAdminItem())
|
||||
list.add(TextColor.RED + "Admin-Gegenstand");
|
||||
list.add(Color.RED + "Admin-Gegenstand");
|
||||
if(stack.getItem().isMagnetic())
|
||||
list.add(TextColor.LIGHT_GRAY + "Magnetisch");
|
||||
list.add(Color.LIGHT_GRAY + "Magnetisch");
|
||||
if(stack.getItem().canBeDyed())
|
||||
list.add("Farbe: #" + Integer.toHexString(stack.getDyeColor()).toUpperCase());
|
||||
|
||||
|
@ -146,9 +146,9 @@ public abstract class GuiContainer extends Gui
|
|||
damage += EnchantmentHelper.getDamageModifier(stack);
|
||||
if(damage != 0) {
|
||||
if(damage > 0)
|
||||
list.add(TextColor.BLUE + String.format("+%d Angriffsschaden", damage));
|
||||
list.add(Color.BLUE + String.format("+%d Angriffsschaden", damage));
|
||||
else
|
||||
list.add(TextColor.RED + String.format("-%d Angriffsschaden", damage));
|
||||
list.add(Color.RED + String.format("-%d Angriffsschaden", damage));
|
||||
}
|
||||
|
||||
Map<Attribute, Float> mods = stack.getAttributeModifiers(null);
|
||||
|
@ -160,17 +160,17 @@ public abstract class GuiContainer extends Gui
|
|||
if(stack.getSize() != 1) {
|
||||
double total = amt * (double)stack.getSize();
|
||||
if(amt > 0.0D)
|
||||
list.add(TextColor.BLUE + String.format("+%s %s [%dx +%s]", DECIMALFORMAT.format(total), entry.getKey(), stack.getSize(),
|
||||
list.add(Color.BLUE + String.format("+%s %s [%dx +%s]", DECIMALFORMAT.format(total), entry.getKey(), stack.getSize(),
|
||||
DECIMALFORMAT.format(amt)));
|
||||
else if(amt < 0.0D)
|
||||
list.add(TextColor.RED + String.format("-%s %s [%dx -%s]", DECIMALFORMAT.format(total * -1.0), entry.getKey(), stack.getSize(),
|
||||
list.add(Color.RED + String.format("-%s %s [%dx -%s]", DECIMALFORMAT.format(total * -1.0), entry.getKey(), stack.getSize(),
|
||||
DECIMALFORMAT.format(amt * -1.0)));
|
||||
}
|
||||
else {
|
||||
if(amt > 0.0D)
|
||||
list.add(TextColor.BLUE + String.format("+%s %s", DECIMALFORMAT.format(amt), entry.getKey()));
|
||||
list.add(Color.BLUE + String.format("+%s %s", DECIMALFORMAT.format(amt), entry.getKey()));
|
||||
else if(amt < 0.0D)
|
||||
list.add(TextColor.RED + String.format("-%s %s", DECIMALFORMAT.format(amt * -1.0), entry.getKey()));
|
||||
list.add(Color.RED + String.format("-%s %s", DECIMALFORMAT.format(amt * -1.0), entry.getKey()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -188,7 +188,7 @@ public abstract class GuiContainer extends Gui
|
|||
else
|
||||
list.add("Stapelbar bis " + stack.getItem().getMaxAmount());
|
||||
|
||||
list.add(TextColor.GRAY + ItemRegistry.getName(stack.getItem()));
|
||||
list.add(Color.GRAY + ItemRegistry.getName(stack.getItem()));
|
||||
|
||||
return list;
|
||||
}
|
||||
|
@ -420,11 +420,11 @@ public abstract class GuiContainer extends Gui
|
|||
|
||||
if (stack.isEmpty())
|
||||
{
|
||||
s = "" + TextColor.YELLOW + "0";
|
||||
s = "" + Color.YELLOW + "0";
|
||||
}
|
||||
}
|
||||
else if(stack == this.cheatStack) {
|
||||
s = TextColor.DARK_GREEN + "+" + TextColor.GREEN + formatAmount(stack.getSize());
|
||||
s = Color.DARK_GREEN + "+" + Color.GREEN + formatAmount(stack.getSize());
|
||||
}
|
||||
|
||||
this.drawItemStack(stack, mouseX - j2, mouseY - k2, s);
|
||||
|
@ -472,7 +472,7 @@ public abstract class GuiContainer extends Gui
|
|||
StringBuilder sb = new StringBuilder();
|
||||
for(int i = 0; i < list.size(); ++i) {
|
||||
if(i != 0)
|
||||
sb.append("\n" + TextColor.LIGHT_GRAY + (String)list.get(i));
|
||||
sb.append("\n" + Color.LIGHT_GRAY + (String)list.get(i));
|
||||
else
|
||||
sb.append((String)list.get(i));
|
||||
}
|
||||
|
@ -532,13 +532,13 @@ public abstract class GuiContainer extends Gui
|
|||
|
||||
if (itemstack.getSize() > itemstack.getMaxStackSize())
|
||||
{
|
||||
s = TextColor.YELLOW + formatAmount(itemstack.getMaxStackSize());
|
||||
s = Color.YELLOW + formatAmount(itemstack.getMaxStackSize());
|
||||
itemstack.setSize(itemstack.getMaxStackSize());
|
||||
}
|
||||
|
||||
if (itemstack.getSize() > slotIn.getItemStackLimit(itemstack))
|
||||
{
|
||||
s = TextColor.YELLOW + formatAmount(slotIn.getItemStackLimit(itemstack));
|
||||
s = Color.YELLOW + formatAmount(slotIn.getItemStackLimit(itemstack));
|
||||
itemstack.setSize(slotIn.getItemStackLimit(itemstack));
|
||||
}
|
||||
}
|
||||
|
@ -880,7 +880,7 @@ public abstract class GuiContainer extends Gui
|
|||
|
||||
if (text == null && stack.isEmpty())
|
||||
{
|
||||
s = TextColor.RED + formatAmount(stack.getSize());
|
||||
s = Color.RED + formatAmount(stack.getSize());
|
||||
}
|
||||
Drawing.drawTextRight(s, xPosition + scale * 16, yPosition + scale * 16 + 1 - Font.YGLYPH, 0xffffffff);
|
||||
}
|
||||
|
|
|
@ -10,7 +10,7 @@ import common.inventory.ContainerEnchantment;
|
|||
import common.inventory.InventoryPlayer;
|
||||
import common.rng.Random;
|
||||
import common.util.Pair;
|
||||
import common.util.TextColor;
|
||||
import common.util.Color;
|
||||
import common.world.World;
|
||||
|
||||
public class GuiEnchant extends GuiContainer implements ButtonCallback {
|
||||
|
@ -46,13 +46,13 @@ public class GuiEnchant extends GuiContainer implements ButtonCallback {
|
|||
else {
|
||||
if(this.gm.player.getManaPoints() < mana) {
|
||||
this.buttons[l].enabled = false;
|
||||
this.labels[l].setText(TextColor.DARK_GRAY + name);
|
||||
this.mana[l].setText(TextColor.DARK_RED + "Mana-Level " + mana);
|
||||
this.labels[l].setText(Color.DARK_GRAY + name);
|
||||
this.mana[l].setText(Color.DARK_RED + "Mana-Level " + mana);
|
||||
}
|
||||
else {
|
||||
this.buttons[l].enabled = true;
|
||||
this.labels[l].setText(TextColor.GREEN + name);
|
||||
this.mana[l].setText(TextColor.DARK_GREEN + "Mana-Level " + mana + TextColor.GRAY + ", " + TextColor.YELLOW + "-" + (l + 1) + " Mana");
|
||||
this.labels[l].setText(Color.GREEN + name);
|
||||
this.mana[l].setText(Color.DARK_GREEN + "Mana-Level " + mana + Color.GRAY + ", " + Color.YELLOW + "-" + (l + 1) + " Mana");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -95,10 +95,10 @@ public class GuiEnchant extends GuiContainer implements ButtonCallback {
|
|||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
String s = l.first().getFormattedName(l.second());
|
||||
sb.append(TextColor.WHITE + s + " . . . ?");
|
||||
sb.append(Color.WHITE + s + " . . . ?");
|
||||
|
||||
if(this.gm.player.getManaPoints() < k) {
|
||||
sb.append((sb.length() != 0 ? "\n" : "") + TextColor.RED + String.format("%d Mana erforderlich", this.enchantment.mana[j]));
|
||||
sb.append((sb.length() != 0 ? "\n" : "") + Color.RED + String.format("%d Mana erforderlich", this.enchantment.mana[j]));
|
||||
}
|
||||
else {
|
||||
String s1 = "";
|
||||
|
@ -110,7 +110,7 @@ public class GuiEnchant extends GuiContainer implements ButtonCallback {
|
|||
s1 = String.format("%d Manapunkte", i1);
|
||||
}
|
||||
|
||||
sb.append((sb.length() != 0 ? "\n" : "") + TextColor.LIGHT_GRAY.toString() + "" + s1);
|
||||
sb.append((sb.length() != 0 ? "\n" : "") + Color.LIGHT_GRAY.toString() + "" + s1);
|
||||
}
|
||||
|
||||
this.hover(sb.toString(), mouseX, mouseY);
|
||||
|
|
|
@ -3,7 +3,7 @@ package client.gui.container;
|
|||
import client.gui.element.Label;
|
||||
import common.inventory.ContainerRepair;
|
||||
import common.inventory.InventoryPlayer;
|
||||
import common.util.TextColor;
|
||||
import common.util.Color;
|
||||
import common.world.World;
|
||||
|
||||
public class GuiRepair extends GuiContainer {
|
||||
|
@ -20,13 +20,13 @@ public class GuiRepair extends GuiContainer {
|
|||
public void updateScreen() {
|
||||
super.updateScreen();
|
||||
if(this.anvil.maximumCost >= 40)
|
||||
this.info.setText(TextColor.DARK_RED + "Zu teuer!");
|
||||
this.info.setText(Color.DARK_RED + "Zu teuer!");
|
||||
else if(this.anvil.maximumCost <= 0 || !this.anvil.getSlot(2).getHasStack())
|
||||
this.info.setText("");
|
||||
else if(!this.anvil.getSlot(2).canTakeStack(this.playerInv.player))
|
||||
this.info.setText(TextColor.RED + "Manakosten: " + this.anvil.maximumCost);
|
||||
this.info.setText(Color.RED + "Manakosten: " + this.anvil.maximumCost);
|
||||
else
|
||||
this.info.setText(TextColor.GREEN + "Manakosten: " + this.anvil.maximumCost);
|
||||
this.info.setText(Color.GREEN + "Manakosten: " + this.anvil.maximumCost);
|
||||
}
|
||||
|
||||
public void addElements() {
|
||||
|
|
|
@ -18,7 +18,7 @@ import client.gui.element.ToggleCallback;
|
|||
import client.network.ClientPlayer;
|
||||
import common.packet.CPacketForm;
|
||||
import common.util.ExtMath;
|
||||
import common.util.TextColor;
|
||||
import common.util.Color;
|
||||
import common.util.Triplet;
|
||||
|
||||
public class GuiForm extends Gui implements ButtonCallback {
|
||||
|
@ -107,8 +107,8 @@ public class GuiForm extends Gui implements ButtonCallback {
|
|||
int min = (this.inputData[z].third() & 0x7fffffff) >> 16;
|
||||
String text = this.inputs[z].getText();
|
||||
if(text.length() < min) {
|
||||
if(!GuiForm.this.labels[z].getText().startsWith("" + TextColor.RED))
|
||||
GuiForm.this.labels[z].setText(TextColor.RED + GuiForm.this.labels[z].getText());
|
||||
if(!GuiForm.this.labels[z].getText().startsWith("" + Color.RED))
|
||||
GuiForm.this.labels[z].setText(Color.RED + GuiForm.this.labels[z].getText());
|
||||
return;
|
||||
}
|
||||
this.outputData[z] = text;
|
||||
|
|
|
@ -4,7 +4,7 @@ import client.gui.Gui;
|
|||
import client.gui.element.ActButton;
|
||||
import client.gui.element.ButtonCallback;
|
||||
import common.util.ExtMath;
|
||||
import common.util.TextColor;
|
||||
import common.util.Color;
|
||||
import client.gui.element.Label;
|
||||
import client.gui.element.MultiLabel;
|
||||
import client.gui.element.PressType;
|
||||
|
@ -20,8 +20,8 @@ public class GuiGameOver extends Gui {
|
|||
|
||||
public void init(int width, int height) {
|
||||
this.timer = 0;
|
||||
this.add(new Label(0, 0, 400, 0, TextColor.DARK_RED + "Du bist gestorben!"));
|
||||
this.add(new MultiLabel(0, 32, 400, 42, String.format(TextColor.GREEN + "Letzte Position" + TextColor.GRAY + ":\n" + TextColor.YELLOW + "%d, %d, %d\n" + TextColor.YELLOW + "%s", ExtMath.floord(this.gm.player.posX), ExtMath.floord(this.gm.player.posY), ExtMath.floord(this.gm.player.posZ), this.gm.player.worldObj.dimension.getDisplay())));
|
||||
this.add(new Label(0, 0, 400, 0, Color.DARK_RED + "Du bist gestorben!"));
|
||||
this.add(new MultiLabel(0, 32, 400, 42, String.format(Color.GREEN + "Letzte Position" + Color.GRAY + ":\n" + Color.YELLOW + "%d, %d, %d\n" + Color.YELLOW + "%s", ExtMath.floord(this.gm.player.posX), ExtMath.floord(this.gm.player.posY), ExtMath.floord(this.gm.player.posZ), this.gm.player.worldObj.dimension.getDisplay())));
|
||||
this.button = this.add(new ActButton(100, 100, 200, 0, new ButtonCallback() {
|
||||
public void use(ActButton elem, PressType action) {
|
||||
GuiGameOver.this.gm.player.respawnPlayer();
|
||||
|
|
|
@ -12,7 +12,7 @@ import client.gui.element.FieldCallback;
|
|||
import client.network.ClientPlayer;
|
||||
import common.item.ItemStack;
|
||||
import common.packet.CPacketMessage;
|
||||
import common.util.TextColor;
|
||||
import common.util.Color;
|
||||
|
||||
public class GuiRename extends Gui implements FieldCallback, ButtonCallback {
|
||||
private final String itemName;
|
||||
|
@ -37,7 +37,7 @@ public class GuiRename extends Gui implements FieldCallback, ButtonCallback {
|
|||
|
||||
public GuiRename(int slot, ItemStack stack, Gui prev) {
|
||||
this.itemName = stack.getItem().getDisplay();
|
||||
this.origName = stack.hasDisplayName() ? TextColor.stripCodes(stack.getDisplayName()) : "";
|
||||
this.origName = stack.hasDisplayName() ? Color.stripCodes(stack.getDisplayName()) : "";
|
||||
this.slot = slot;
|
||||
this.previous = prev;
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@ import client.gui.element.ButtonCallback;
|
|||
import client.gui.element.Label;
|
||||
import client.gui.element.PressType;
|
||||
import client.window.Bind;
|
||||
import common.util.TextColor;
|
||||
import common.util.Color;
|
||||
|
||||
public class GuiBinds extends GuiOptions {
|
||||
protected GuiBinds() {
|
||||
|
@ -41,9 +41,9 @@ public class GuiBinds extends GuiOptions {
|
|||
}, new Formatter<ActButton>() {
|
||||
public String use(ActButton elem) {
|
||||
if(bind == Bind.getWaiting())
|
||||
return TextColor.BLUE + "***";
|
||||
return Color.BLUE + "***";
|
||||
else
|
||||
return (bind.isDupe() ? TextColor.RED : TextColor.YELLOW) + (bind.getInput() == null ? "---" : bind.getInput().getDisplay());
|
||||
return (bind.isDupe() ? Color.RED : Color.YELLOW) + (bind.getInput() == null ? "---" : bind.getInput().getDisplay());
|
||||
}
|
||||
}));
|
||||
if(++x == cols) {
|
||||
|
|
|
@ -18,7 +18,7 @@ import client.window.DisplayMode;
|
|||
import client.window.Window;
|
||||
import common.collect.Lists;
|
||||
import common.util.ExtMath;
|
||||
import common.util.TextColor;
|
||||
import common.util.Color;
|
||||
|
||||
public class GuiDisplay extends GuiOptions {
|
||||
private static final String[] DISTANCES = new String[] {"Gruselig", "Winzig", "Gering", "Normal", "Weit"};
|
||||
|
@ -61,7 +61,7 @@ public class GuiDisplay extends GuiOptions {
|
|||
}
|
||||
}
|
||||
if(dmodes == null)
|
||||
this.add(new Fill(242, 0, 240, 0, TextColor.RED + "<?>"));
|
||||
this.add(new Fill(242, 0, 240, 0, Color.RED + "<?>"));
|
||||
|
||||
this.add(new Slider(0, 20, 240, 0, 0, 0, 360 - 8, 0, (this.gm.sync < 0) ? (360 - 8) : (this.gm.sync != 0 ? ((this.gm.sync < 10) ? 1 : (this.gm.sync - 9)) : 0), new SliderCallback() {
|
||||
public void use(Slider elem, int value) {
|
||||
|
|
|
@ -56,6 +56,7 @@ import common.inventory.InventoryPlayer;
|
|||
import common.inventory.InventoryWarpChest;
|
||||
import common.item.ItemStack;
|
||||
import common.item.material.ItemDye;
|
||||
import common.item.material.ItemGrindedBones;
|
||||
import common.log.Log;
|
||||
import common.network.IClientPlayer;
|
||||
import common.network.NetConnection;
|
||||
|
@ -1595,7 +1596,7 @@ public class ClientPlayer implements IClientPlayer
|
|||
break;
|
||||
|
||||
case 2005:
|
||||
ItemDye.spawnBonemealParticles(this.gm.world, blockPosIn, data);
|
||||
ItemGrindedBones.spawnParticles(this.gm.world, blockPosIn, data);
|
||||
break;
|
||||
|
||||
case 2016:
|
||||
|
|
|
@ -6,7 +6,7 @@ import client.Client;
|
|||
import client.gui.Font;
|
||||
import client.gui.FontChar;
|
||||
import common.log.Log;
|
||||
import common.util.TextColor;
|
||||
import common.util.Color;
|
||||
import common.util.Util;
|
||||
|
||||
public abstract class Drawing {
|
||||
|
@ -52,7 +52,7 @@ public abstract class Drawing {
|
|||
continue;
|
||||
}
|
||||
else if((ch >= Log.CHR_COLORS1 && ch <= Log.CHR_COLORE1) || (ch >= Log.CHR_COLORS2 && ch <= Log.CHR_COLORE2)) {
|
||||
ncolor = TextColor.getColor(ch) | (color & 0xff000000);
|
||||
ncolor = Color.getColor(ch) | (color & 0xff000000);
|
||||
continue;
|
||||
}
|
||||
else if(ch == Log.CHR_CRESET) {
|
||||
|
@ -315,7 +315,7 @@ public abstract class Drawing {
|
|||
continue;
|
||||
}
|
||||
else if((ch >= Log.CHR_COLORS1 && ch <= Log.CHR_COLORE1) || (ch >= Log.CHR_COLORS2 && ch <= Log.CHR_COLORE2)) {
|
||||
bcolor = TextColor.getShadow(ch) | (scolor & 0xff000000);
|
||||
bcolor = Color.getShadow(ch) | (scolor & 0xff000000);
|
||||
continue;
|
||||
}
|
||||
else if(ch == Log.CHR_CRESET) {
|
||||
|
@ -343,7 +343,7 @@ public abstract class Drawing {
|
|||
continue;
|
||||
}
|
||||
else if((ch >= Log.CHR_COLORS1 && ch <= Log.CHR_COLORE1) || (ch >= Log.CHR_COLORS2 && ch <= Log.CHR_COLORE2)) {
|
||||
ncolor = TextColor.getColor(ch) | (color & 0xff000000);
|
||||
ncolor = Color.getColor(ch) | (color & 0xff000000);
|
||||
continue;
|
||||
}
|
||||
else if(ch == Log.CHR_CRESET) {
|
||||
|
|
|
@ -2,7 +2,7 @@ package client.renderer.entity;
|
|||
|
||||
import client.renderer.model.ModelBase;
|
||||
import common.entity.animal.EntityRabbit;
|
||||
import common.util.TextColor;
|
||||
import common.util.Color;
|
||||
|
||||
|
||||
public class RenderRabbit extends RenderLiving<EntityRabbit> {
|
||||
|
@ -26,7 +26,7 @@ public class RenderRabbit extends RenderLiving<EntityRabbit> {
|
|||
}
|
||||
|
||||
protected String getEntityTexture(EntityRabbit entity) {
|
||||
String name = TextColor.stripCodes(entity.getCustomNameTag());
|
||||
String name = Color.stripCodes(entity.getCustomNameTag());
|
||||
if("Lola".equalsIgnoreCase(name) || "Lolo".equalsIgnoreCase(name))
|
||||
return HALF;
|
||||
int type = entity.getRabbitType();
|
||||
|
|
|
@ -23,7 +23,7 @@ import common.entity.types.EntityAnimal;
|
|||
import common.entity.types.EntityLiving;
|
||||
import common.log.Log;
|
||||
import common.util.ExtMath;
|
||||
import common.util.TextColor;
|
||||
import common.util.Color;
|
||||
|
||||
public abstract class RendererLivingEntity<T extends EntityLiving> extends Render<T>
|
||||
{
|
||||
|
@ -436,7 +436,7 @@ public abstract class RendererLivingEntity<T extends EntityLiving> extends Rende
|
|||
}
|
||||
else
|
||||
{
|
||||
String s = TextColor.stripCodes(bat.getCustomNameTag());
|
||||
String s = Color.stripCodes(bat.getCustomNameTag());
|
||||
|
||||
if (s != null && (s.startsWith("Australia") || s.startsWith("Australien"))) // && (!(bat.isPlayer()) || ((EntityNPC)bat).isWearing(ModelPart.CAPE)))
|
||||
{
|
||||
|
|
|
@ -4,7 +4,7 @@ import java.lang.reflect.Field;
|
|||
|
||||
import client.gui.element.Toggle;
|
||||
import client.gui.element.ToggleCallback;
|
||||
import common.util.TextColor;
|
||||
import common.util.Color;
|
||||
import common.util.Util;
|
||||
|
||||
public class BoolVar extends BaseVar {
|
||||
|
@ -27,7 +27,7 @@ public class BoolVar extends BaseVar {
|
|||
}
|
||||
|
||||
public String getType() {
|
||||
return TextColor.MAGENTA + "bool";
|
||||
return Color.MAGENTA + "bool";
|
||||
}
|
||||
|
||||
public boolean parse(String str) {
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
package client.vars;
|
||||
|
||||
import common.util.TextColor;
|
||||
import common.util.Color;
|
||||
|
||||
public enum CVarCategory {
|
||||
SYSTEM(TextColor.RED + "system"),
|
||||
WINDOW(TextColor.BLUE + "window"),
|
||||
GUI(TextColor.GREEN + "gui"),
|
||||
RENDER(TextColor.NEON + "render"),
|
||||
INPUT(TextColor.ORANGE + "input"),
|
||||
CONSOLE(TextColor.YELLOW + "console"),
|
||||
SOUND(TextColor.CRIMSON + "sound");
|
||||
SYSTEM(Color.RED + "system"),
|
||||
WINDOW(Color.BLUE + "window"),
|
||||
GUI(Color.GREEN + "gui"),
|
||||
RENDER(Color.NEON + "render"),
|
||||
INPUT(Color.ORANGE + "input"),
|
||||
CONSOLE(Color.YELLOW + "console"),
|
||||
SOUND(Color.CRIMSON + "sound");
|
||||
|
||||
private final String name;
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ import client.gui.element.FieldCallback;
|
|||
import client.gui.element.Label;
|
||||
import client.gui.element.Slider;
|
||||
import client.gui.element.FieldAction;
|
||||
import common.util.TextColor;
|
||||
import common.util.Color;
|
||||
import common.util.Util;
|
||||
|
||||
public class ColorVar extends IntVar {
|
||||
|
@ -19,7 +19,7 @@ public class ColorVar extends IntVar {
|
|||
}
|
||||
|
||||
public String getType() {
|
||||
return this.alpha ? (TextColor.GRAY + "color32") : (TextColor.LIGHT_GRAY + "color");
|
||||
return this.alpha ? (Color.GRAY + "color32") : (Color.LIGHT_GRAY + "color");
|
||||
}
|
||||
|
||||
protected Integer parseValue(String str) {
|
||||
|
|
|
@ -8,7 +8,7 @@ import client.gui.element.Element;
|
|||
import client.gui.element.Switch;
|
||||
import client.gui.element.SwitchCallback;
|
||||
import common.util.Identifyable;
|
||||
import common.util.TextColor;
|
||||
import common.util.Color;
|
||||
import common.util.Util;
|
||||
|
||||
public class EnumVar<T extends Enum> extends BaseVar {
|
||||
|
@ -41,7 +41,7 @@ public class EnumVar<T extends Enum> extends BaseVar {
|
|||
}
|
||||
|
||||
public String getType() {
|
||||
return TextColor.CYAN + "enum";
|
||||
return Color.CYAN + "enum";
|
||||
}
|
||||
|
||||
public boolean parse(String str) {
|
||||
|
|
|
@ -5,7 +5,7 @@ import java.lang.reflect.Field;
|
|||
import client.gui.element.Slider;
|
||||
import client.gui.element.SliderFloatCallback;
|
||||
import common.util.ExtMath;
|
||||
import common.util.TextColor;
|
||||
import common.util.Color;
|
||||
|
||||
public class FloatVar extends BaseVar {
|
||||
public static interface FloatFunction extends VarFunction {
|
||||
|
@ -47,7 +47,7 @@ public class FloatVar extends BaseVar {
|
|||
}
|
||||
|
||||
public String getType() {
|
||||
return TextColor.YELLOW + "float";
|
||||
return Color.YELLOW + "float";
|
||||
}
|
||||
|
||||
public boolean parse(String str) {
|
||||
|
|
|
@ -5,7 +5,7 @@ import java.lang.reflect.Field;
|
|||
import client.gui.element.Slider;
|
||||
import client.gui.element.SliderCallback;
|
||||
import common.util.ExtMath;
|
||||
import common.util.TextColor;
|
||||
import common.util.Color;
|
||||
import common.util.Util;
|
||||
|
||||
public class IntVar extends BaseVar {
|
||||
|
@ -36,7 +36,7 @@ public class IntVar extends BaseVar {
|
|||
}
|
||||
|
||||
public String getType() {
|
||||
return TextColor.GREEN + "int";
|
||||
return Color.GREEN + "int";
|
||||
}
|
||||
|
||||
protected Integer parseValue(String str) {
|
||||
|
|
|
@ -5,7 +5,7 @@ import java.lang.reflect.Field;
|
|||
import client.gui.element.FieldCallback;
|
||||
import client.gui.element.FieldAction;
|
||||
import common.util.CharValidator;
|
||||
import common.util.TextColor;
|
||||
import common.util.Color;
|
||||
|
||||
public class StringVar extends BaseVar {
|
||||
public static interface StringFunction extends VarFunction {
|
||||
|
@ -33,7 +33,7 @@ public class StringVar extends BaseVar {
|
|||
}
|
||||
|
||||
public String getType() {
|
||||
return TextColor.YELLOW + "float";
|
||||
return Color.YELLOW + "float";
|
||||
}
|
||||
|
||||
public boolean parse(String str) {
|
||||
|
|
|
@ -5,7 +5,7 @@ import client.gui.element.Element;
|
|||
import client.vars.CVar;
|
||||
import client.vars.CVarCategory;
|
||||
import common.util.Identifyable;
|
||||
import common.util.TextColor;
|
||||
import common.util.Color;
|
||||
import common.util.Util;
|
||||
|
||||
public enum Bind implements Identifyable, CVar {
|
||||
|
@ -180,7 +180,7 @@ public enum Bind implements Identifyable, CVar {
|
|||
}
|
||||
|
||||
public String getType() {
|
||||
return TextColor.VIOLET + "key";
|
||||
return Color.VIOLET + "key";
|
||||
}
|
||||
|
||||
public CVarCategory getCategory() {
|
||||
|
|
BIN
client/src/main/resources/textures/items/acid_green_dye.png
Normal file
After Width: | Height: | Size: 5.4 KiB |
BIN
client/src/main/resources/textures/items/beige_dye.png
Normal file
After Width: | Height: | Size: 5.4 KiB |
BIN
client/src/main/resources/textures/items/black_dye.png
Normal file
After Width: | Height: | Size: 5.1 KiB |
BIN
client/src/main/resources/textures/items/blue_dye.png
Normal file
After Width: | Height: | Size: 5.3 KiB |
BIN
client/src/main/resources/textures/items/brown_dye.png
Normal file
After Width: | Height: | Size: 5.4 KiB |
Before Width: | Height: | Size: 5.4 KiB After Width: | Height: | Size: 5.2 KiB |
Before Width: | Height: | Size: 5.4 KiB After Width: | Height: | Size: 5.5 KiB |
BIN
client/src/main/resources/textures/items/crimson_dye.png
Normal file
After Width: | Height: | Size: 5.3 KiB |
Before Width: | Height: | Size: 5.2 KiB After Width: | Height: | Size: 5.4 KiB |
BIN
client/src/main/resources/textures/items/dark_brown_dye.png
Normal file
After Width: | Height: | Size: 5.3 KiB |
BIN
client/src/main/resources/textures/items/dark_gray_dye.png
Normal file
After Width: | Height: | Size: 5.2 KiB |
Before Width: | Height: | Size: 5 KiB After Width: | Height: | Size: 5.3 KiB |
BIN
client/src/main/resources/textures/items/dark_magenta_dye.png
Normal file
After Width: | Height: | Size: 5.4 KiB |
BIN
client/src/main/resources/textures/items/dark_red_dye.png
Normal file
After Width: | Height: | Size: 5.3 KiB |
BIN
client/src/main/resources/textures/items/dark_violet_dye.png
Normal file
After Width: | Height: | Size: 5.3 KiB |
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 4.7 KiB |
Before Width: | Height: | Size: 5 KiB After Width: | Height: | Size: 5.2 KiB |
Before Width: | Height: | Size: 5.1 KiB After Width: | Height: | Size: 5.3 KiB |
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 4.7 KiB |
Before Width: | Height: | Size: 5.2 KiB After Width: | Height: | Size: 5.4 KiB |
BIN
client/src/main/resources/textures/items/light_brown_dye.png
Normal file
After Width: | Height: | Size: 5.4 KiB |
Before Width: | Height: | Size: 5 KiB After Width: | Height: | Size: 5.2 KiB |
BIN
client/src/main/resources/textures/items/light_yellow_dye.png
Normal file
After Width: | Height: | Size: 5.4 KiB |
Before Width: | Height: | Size: 5.2 KiB After Width: | Height: | Size: 5.4 KiB |
Before Width: | Height: | Size: 5.4 KiB After Width: | Height: | Size: 5.5 KiB |
BIN
client/src/main/resources/textures/items/midnight_dye.png
Normal file
After Width: | Height: | Size: 5.2 KiB |
BIN
client/src/main/resources/textures/items/neon_dye.png
Normal file
After Width: | Height: | Size: 5.4 KiB |
Before Width: | Height: | Size: 5.3 KiB After Width: | Height: | Size: 5.4 KiB |
BIN
client/src/main/resources/textures/items/ork_green_dye.png
Normal file
After Width: | Height: | Size: 5.3 KiB |
Before Width: | Height: | Size: 5 KiB After Width: | Height: | Size: 5.3 KiB |
Before Width: | Height: | Size: 5.2 KiB After Width: | Height: | Size: 5.4 KiB |
BIN
client/src/main/resources/textures/items/white_dye.png
Normal file
After Width: | Height: | Size: 5.2 KiB |
Before Width: | Height: | Size: 5 KiB After Width: | Height: | Size: 5.4 KiB |
|
@ -51,7 +51,7 @@ import common.util.Vec3;
|
|||
import common.util.HitPosition.ObjectType;
|
||||
import common.util.Pair;
|
||||
import common.util.Serverside;
|
||||
import common.util.TextColor;
|
||||
import common.util.Color;
|
||||
import common.vars.Vars;
|
||||
import common.world.Explosion;
|
||||
import common.world.IBlockAccess;
|
||||
|
@ -1102,8 +1102,8 @@ public class Block {
|
|||
return this.getState();
|
||||
}
|
||||
|
||||
public TextColor getItemColor() {
|
||||
return this.radiation > 0.0f ? TextColor.GREEN : null;
|
||||
public Color getItemColor() {
|
||||
return this.radiation > 0.0f ? Color.GREEN : null;
|
||||
}
|
||||
|
||||
@Clientside
|
||||
|
|
|
@ -19,7 +19,7 @@ import common.util.Clientside;
|
|||
import common.util.ExtMath;
|
||||
import common.util.Facing;
|
||||
import common.util.Identifyable;
|
||||
import common.util.TextColor;
|
||||
import common.util.Color;
|
||||
import common.util.WorldPos;
|
||||
import common.world.AWorldServer;
|
||||
import common.world.IWorldAccess;
|
||||
|
@ -47,11 +47,11 @@ public class BlockBed extends Block implements Rotatable {
|
|||
|
||||
public static final PropertyEnum<BlockBed.EnumPartType> PART =
|
||||
PropertyEnum.<BlockBed.EnumPartType>create("part", BlockBed.EnumPartType.class);
|
||||
public static final TextColor[] COLORS = new TextColor[] {TextColor.RED, TextColor.WHITE, TextColor.BLACK, TextColor.VIOLET};
|
||||
public static final Color[] COLORS = new Color[] {Color.RED, Color.WHITE, Color.BLACK, Color.VIOLET};
|
||||
|
||||
private final TextColor color;
|
||||
private final Color color;
|
||||
|
||||
public BlockBed(TextColor color) {
|
||||
public BlockBed(Color color) {
|
||||
super(Material.BURNABLE);
|
||||
this.color = color;
|
||||
this.setDefaultState(this.getBaseState().withProperty(PART, BlockBed.EnumPartType.FOOT));
|
||||
|
@ -73,7 +73,7 @@ public class BlockBed extends Block implements Rotatable {
|
|||
if(player.isEntityAlive() && Math.abs(player.posX - (double)pos.getX()) <= 3.0D
|
||||
&& Math.abs(player.posY - (double)pos.getY()) <= 2.0D && Math.abs(player.posZ - (double)pos.getZ()) <= 3.0D) {
|
||||
player.setSpawnPoint(new WorldPos(pos, player.worldObj));
|
||||
player.connection.addHotbar(TextColor.DARK_GREEN + "Dein Einstiegspunkt wurde auf %s bei [%s, %s, %s] gesetzt",
|
||||
player.connection.addHotbar(Color.DARK_GREEN + "Dein Einstiegspunkt wurde auf %s bei [%s, %s, %s] gesetzt",
|
||||
player.worldObj.dimension.getDisplay(), player.getSpawnPoint().getX(),
|
||||
player.getSpawnPoint().getY(), player.getSpawnPoint().getZ());
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@ import common.model.Model;
|
|||
import common.model.Model.ModelProvider;
|
||||
import common.util.BlockPos;
|
||||
import common.util.Facing;
|
||||
import common.util.TextColor;
|
||||
import common.util.Color;
|
||||
import common.world.AWorldServer;
|
||||
import common.world.IWorldAccess;
|
||||
import common.world.State;
|
||||
|
@ -15,15 +15,15 @@ import common.world.World;
|
|||
|
||||
public class BlockCarpet extends Block
|
||||
{
|
||||
public static final BlockCarpet[] CARPETS = new BlockCarpet[TextColor.values().length];
|
||||
public static final BlockCarpet[] CARPETS = new BlockCarpet[Color.values().length];
|
||||
|
||||
private final TextColor color;
|
||||
private final Color color;
|
||||
|
||||
public static BlockCarpet getByColor(TextColor color) {
|
||||
public static BlockCarpet getByColor(Color color) {
|
||||
return CARPETS[color.ordinal()];
|
||||
}
|
||||
|
||||
public BlockCarpet(TextColor color)
|
||||
public BlockCarpet(Color color)
|
||||
{
|
||||
super(Material.FLEECE);
|
||||
this.color = color;
|
||||
|
@ -34,7 +34,7 @@ public class BlockCarpet extends Block
|
|||
CARPETS[color.ordinal()] = this;
|
||||
}
|
||||
|
||||
public TextColor getColor() {
|
||||
public Color getColor() {
|
||||
return this.color;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,22 +1,22 @@
|
|||
package common.block.artificial;
|
||||
|
||||
import common.util.TextColor;
|
||||
import common.util.Color;
|
||||
|
||||
public class BlockStainedGlass extends BlockGlass {
|
||||
public static final BlockStainedGlass[] GLASS = new BlockStainedGlass[TextColor.values().length];
|
||||
public static final BlockStainedGlass[] GLASS = new BlockStainedGlass[Color.values().length];
|
||||
|
||||
private final TextColor color;
|
||||
private final Color color;
|
||||
|
||||
public static BlockStainedGlass getByColor(TextColor color) {
|
||||
public static BlockStainedGlass getByColor(Color color) {
|
||||
return GLASS[color.ordinal()];
|
||||
}
|
||||
|
||||
public BlockStainedGlass(TextColor color) {
|
||||
public BlockStainedGlass(Color color) {
|
||||
this.color = color;
|
||||
GLASS[color.ordinal()] = this;
|
||||
}
|
||||
|
||||
public TextColor getColor() {
|
||||
public Color getColor() {
|
||||
return this.color;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,19 +3,19 @@ package common.block.artificial;
|
|||
import common.block.Material;
|
||||
import common.item.CheatTab;
|
||||
import common.properties.Property;
|
||||
import common.util.TextColor;
|
||||
import common.util.Color;
|
||||
|
||||
public class BlockStainedGlassPane extends BlockPane
|
||||
{
|
||||
public static final BlockStainedGlassPane[] PANES = new BlockStainedGlassPane[TextColor.values().length];
|
||||
public static final BlockStainedGlassPane[] PANES = new BlockStainedGlassPane[Color.values().length];
|
||||
|
||||
private final TextColor color;
|
||||
private final Color color;
|
||||
|
||||
public static BlockStainedGlassPane getByColor(TextColor color) {
|
||||
public static BlockStainedGlassPane getByColor(Color color) {
|
||||
return PANES[color.ordinal()];
|
||||
}
|
||||
|
||||
public BlockStainedGlassPane(TextColor color)
|
||||
public BlockStainedGlassPane(Color color)
|
||||
{
|
||||
super(Material.TRANSLUCENT);
|
||||
this.color = color;
|
||||
|
@ -24,7 +24,7 @@ public class BlockStainedGlassPane extends BlockPane
|
|||
PANES[color.ordinal()] = this;
|
||||
}
|
||||
|
||||
public TextColor getColor() {
|
||||
public Color getColor() {
|
||||
return this.color;
|
||||
}
|
||||
|
||||
|
|
|
@ -5,19 +5,19 @@ import common.block.Material;
|
|||
import common.item.CheatTab;
|
||||
import common.model.Model;
|
||||
import common.model.Model.ModelProvider;
|
||||
import common.util.TextColor;
|
||||
import common.util.Color;
|
||||
import common.world.State;
|
||||
|
||||
public class BlockWool extends Block {
|
||||
public static final BlockWool[] WOOLS = new BlockWool[TextColor.values().length];
|
||||
public static final BlockWool[] WOOLS = new BlockWool[Color.values().length];
|
||||
|
||||
private final TextColor color;
|
||||
private final Color color;
|
||||
|
||||
public static BlockWool getByColor(TextColor color) {
|
||||
public static BlockWool getByColor(Color color) {
|
||||
return WOOLS[color.ordinal()];
|
||||
}
|
||||
|
||||
public BlockWool(TextColor color) {
|
||||
public BlockWool(Color color) {
|
||||
super(Material.BURNABLE);
|
||||
this.color = color;
|
||||
this.setTab(CheatTab.BLOCKS);
|
||||
|
@ -25,7 +25,7 @@ public class BlockWool extends Block {
|
|||
WOOLS[color.ordinal()] = this;
|
||||
}
|
||||
|
||||
public TextColor getColor() {
|
||||
public Color getColor() {
|
||||
return this.color;
|
||||
}
|
||||
|
||||
|
|
|
@ -5,26 +5,26 @@ import common.block.Material;
|
|||
import common.item.CheatTab;
|
||||
import common.model.Model;
|
||||
import common.model.Model.ModelProvider;
|
||||
import common.util.TextColor;
|
||||
import common.util.Color;
|
||||
import common.world.State;
|
||||
|
||||
public class BlockColoredClay extends Block {
|
||||
public static final BlockColoredClay[] CLAY = new BlockColoredClay[TextColor.values().length];
|
||||
public static final BlockColoredClay[] CLAY = new BlockColoredClay[Color.values().length];
|
||||
|
||||
private final TextColor color;
|
||||
private final Color color;
|
||||
|
||||
public static BlockColoredClay getByColor(TextColor color) {
|
||||
public static BlockColoredClay getByColor(Color color) {
|
||||
return CLAY[color.ordinal()];
|
||||
}
|
||||
|
||||
public BlockColoredClay(TextColor color) {
|
||||
public BlockColoredClay(Color color) {
|
||||
super(Material.SOLID);
|
||||
this.color = color;
|
||||
this.setTab(CheatTab.ROCK);
|
||||
CLAY[color.ordinal()] = this;
|
||||
}
|
||||
|
||||
public TextColor getColor() {
|
||||
public Color getColor() {
|
||||
return this.color;
|
||||
}
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ import common.tileentity.TileEntityChest;
|
|||
import common.util.BlockPos;
|
||||
import common.util.BoundingBox;
|
||||
import common.util.Facing;
|
||||
import common.util.TextColor;
|
||||
import common.util.Color;
|
||||
import common.vars.Vars;
|
||||
import common.world.State;
|
||||
import common.world.World;
|
||||
|
@ -165,14 +165,14 @@ public class BlockChest extends Block implements ITileEntityProvider, Rotatable
|
|||
if(chest.getLockCode() != null) {
|
||||
if(stack.hasDisplayName() && stack.getDisplayName().equals(chest.getLockCode())) {
|
||||
chest.setLockCode(null);
|
||||
playerIn.connection.addHotbar(TextColor.BLUE + "%s wurde entriegelt", chest.getName());
|
||||
playerIn.connection.addHotbar(Color.BLUE + "%s wurde entriegelt", chest.getName());
|
||||
playerIn.connection.sendPacket(new SPacketSoundEffect(SoundEvent.DOOR, playerIn.posX, playerIn.posY, playerIn.posZ, 1.0F));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if(stack.hasDisplayName() && !stack.getDisplayName().isEmpty()) {
|
||||
chest.setLockCode(stack.getDisplayName());
|
||||
playerIn.connection.addHotbar(TextColor.ORANGE + "%s wurde verriegelt", chest.getName());
|
||||
playerIn.connection.addHotbar(Color.ORANGE + "%s wurde verriegelt", chest.getName());
|
||||
playerIn.connection.sendPacket(new SPacketSoundEffect(SoundEvent.DOOR, playerIn.posX, playerIn.posY, playerIn.posZ, 1.0F));
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@ import common.item.CheatTab;
|
|||
import common.model.Model;
|
||||
import common.model.Model.ModelProvider;
|
||||
import common.util.BlockPos;
|
||||
import common.util.TextColor;
|
||||
import common.util.Color;
|
||||
import common.world.Explosion;
|
||||
import common.world.State;
|
||||
import common.world.World;
|
||||
|
@ -54,7 +54,7 @@ public class BlockNuke extends Block
|
|||
return provider.getModel("nuke_side").add().nswe().d("nuke_bottom").u("nuke_top");
|
||||
}
|
||||
|
||||
public TextColor getItemColor() {
|
||||
return TextColor.RED;
|
||||
public Color getItemColor() {
|
||||
return Color.RED;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@ import common.tileentity.TileEntity;
|
|||
import common.util.BlockPos;
|
||||
import common.util.ExtMath;
|
||||
import common.util.Facing;
|
||||
import common.util.TextColor;
|
||||
import common.util.Color;
|
||||
import common.util.Vec3;
|
||||
import common.world.AWorldServer;
|
||||
import common.world.Explosion;
|
||||
|
@ -161,8 +161,8 @@ public class BlockTNT extends Block
|
|||
this.onBroken(world, pos, state.withProperty(BlockTNT.EXPLODE, Boolean.valueOf(true)));
|
||||
}
|
||||
|
||||
public TextColor getItemColor() {
|
||||
return TextColor.RED;
|
||||
public Color getItemColor() {
|
||||
return Color.RED;
|
||||
}
|
||||
|
||||
public boolean dispense(AWorldServer world, TileEntity source, Vec3 position, BlockPos blockpos, Facing facing, ItemStack stack) {
|
||||
|
|
|
@ -7,18 +7,18 @@ import common.entity.npc.EntityNPC;
|
|||
import common.entity.projectile.EntityPotion;
|
||||
import common.entity.types.EntityLiving;
|
||||
import common.item.ItemStack;
|
||||
import common.util.TextColor;
|
||||
import common.util.Color;
|
||||
import common.vars.Vars;
|
||||
|
||||
public enum Effect {
|
||||
SPEED("speed", 2, 180, "Schnelligkeit", "Trank der Schnelligkeit", false, 8171462) {
|
||||
public String getTooltip(int amp) {
|
||||
return String.format(TextColor.BLUE + "+%d%% Geschwindigkeit", 20 * (amp + 1));
|
||||
return String.format(Color.BLUE + "+%d%% Geschwindigkeit", 20 * (amp + 1));
|
||||
}
|
||||
},
|
||||
SLOWNESS("slowness", 1, 90, "Langsamkeit", "Trank der Langsamkeit", true, 5926017) {
|
||||
public String getTooltip(int amp) {
|
||||
return String.format(TextColor.RED + "-%d%% Geschwindigkeit", 15 * (amp + 1));
|
||||
return String.format(Color.RED + "-%d%% Geschwindigkeit", 15 * (amp + 1));
|
||||
}
|
||||
},
|
||||
HASTE("haste", "Eile", "Trank der Eile", false, 14270531) {
|
||||
|
@ -29,7 +29,7 @@ public enum Effect {
|
|||
FATIGUE("mining_fatigue", "Abbaulähmung", "Trank der Trägheit", true, 4866583),
|
||||
STRENGTH("strength", 2, 180, "Stärke", "Trank der Stärke", false, 9643043) {
|
||||
public String getTooltip(int amp) {
|
||||
return String.format(TextColor.BLUE + "+%d%% Angriffsschaden", 50 * (amp + 1));
|
||||
return String.format(Color.BLUE + "+%d%% Angriffsschaden", 50 * (amp + 1));
|
||||
}
|
||||
},
|
||||
HEAL("health", 2, "Direktheilung", "Trank der Heilung", false, 16262179) {
|
||||
|
@ -110,7 +110,7 @@ public enum Effect {
|
|||
STABILITY("stability", 1, 180, "Stabilität", "Trank der Standfestigkeit", false, 5797459),
|
||||
WEAKNESS("weakness", 1, 90, "Schwäche", "Trank der Schwäche", true, 4738376) {
|
||||
public String getTooltip(int amp) {
|
||||
return String.format(TextColor.RED + "-%d%% Angriffsschaden", 20 * (amp + 1));
|
||||
return String.format(Color.RED + "-%d%% Angriffsschaden", 20 * (amp + 1));
|
||||
}
|
||||
},
|
||||
POISON("poison", 2, 45, "Vergiftung", "Trank der Vergiftung", true, 5149489) {
|
||||
|
|
|
@ -2,44 +2,44 @@ package common.entity;
|
|||
|
||||
import common.entity.projectile.EntityProjectile;
|
||||
import common.entity.types.EntityLiving;
|
||||
import common.util.TextColor;
|
||||
import common.util.Color;
|
||||
import common.world.Explosion;
|
||||
|
||||
public class DamageSource
|
||||
{
|
||||
public static final DamageSource inFire =
|
||||
(new DamageSource(TextColor.ORANGE, "%s ging in Flammen auf", "%s lief ins Feuer, während er mit %s kämpfte", "%s ins Feuer gelaufen")).setFireDamage();
|
||||
(new DamageSource(Color.ORANGE, "%s ging in Flammen auf", "%s lief ins Feuer, während er mit %s kämpfte", "%s ins Feuer gelaufen")).setFireDamage();
|
||||
public static final DamageSource onFire =
|
||||
(new DamageSource(TextColor.ORANGE, "%s wurde zu heiß und verbrannte", "%s wurde während des Kampfes mit %s geröstet", "%s geröstet")).setDamageBypassesArmor().setFireDamage();
|
||||
(new DamageSource(Color.ORANGE, "%s wurde zu heiß und verbrannte", "%s wurde während des Kampfes mit %s geröstet", "%s geröstet")).setDamageBypassesArmor().setFireDamage();
|
||||
public static final DamageSource hotLiquid =
|
||||
(new DamageSource(TextColor.ORANGE, "%s versuchte in einer unangenehm brennenden Flüssigkeit zu schwimmen", "%s fiel beim Versuch %s zu entkommen in eine unangenehm brennende Flüssigkeit", "%s in unangenehm brennender Flüssigkeit gelandet")).setFireDamage();
|
||||
(new DamageSource(Color.ORANGE, "%s versuchte in einer unangenehm brennenden Flüssigkeit zu schwimmen", "%s fiel beim Versuch %s zu entkommen in eine unangenehm brennende Flüssigkeit", "%s in unangenehm brennender Flüssigkeit gelandet")).setFireDamage();
|
||||
public static final DamageSource molten =
|
||||
(new DamageSource(TextColor.ORANGE, "%s versuchte dem Magmaregen zu trotzen", "%s geriet beim Versuch %s zu entkommen in Magmaregen", "%s in Magmaregen geraten")).setFireDamage();
|
||||
(new DamageSource(Color.ORANGE, "%s versuchte dem Magmaregen zu trotzen", "%s geriet beim Versuch %s zu entkommen in Magmaregen", "%s in Magmaregen geraten")).setFireDamage();
|
||||
public static final DamageSource inWall =
|
||||
(new DamageSource(TextColor.GRAY, "%s wurde lebendig begraben")).setDamageBypassesArmor();
|
||||
(new DamageSource(Color.GRAY, "%s wurde lebendig begraben")).setDamageBypassesArmor();
|
||||
public static final DamageSource dry =
|
||||
(new DamageSource(TextColor.GRAY, "%s ist vertrocknet", "%s ist beim Versuch %s zu entkommen vertrocknet", "%s vertrocknet")).setDamageBypassesArmor();
|
||||
(new DamageSource(Color.GRAY, "%s ist vertrocknet", "%s ist beim Versuch %s zu entkommen vertrocknet", "%s vertrocknet")).setDamageBypassesArmor();
|
||||
public static final DamageSource cactus =
|
||||
new DamageSource(TextColor.ORK, "%s wurde zu Tode gestochen", "%s rannte beim Versuch %s zu entkommen in einen Kaktus", "%s in Kaktus gerannt");
|
||||
new DamageSource(Color.ORK, "%s wurde zu Tode gestochen", "%s rannte beim Versuch %s zu entkommen in einen Kaktus", "%s in Kaktus gerannt");
|
||||
public static final DamageSource fall =
|
||||
(new DamageSource(TextColor.NEON, "%s fiel der Schwerkraft zum Opfer")).setDamageBypassesArmor();
|
||||
(new DamageSource(Color.NEON, "%s fiel der Schwerkraft zum Opfer")).setDamageBypassesArmor();
|
||||
public static final DamageSource outOfWorld =
|
||||
(new DamageSource(TextColor.DARK_GRAY, "%s fiel aus der Welt")).setDamageBypassesArmor();
|
||||
(new DamageSource(Color.DARK_GRAY, "%s fiel aus der Welt")).setDamageBypassesArmor();
|
||||
public static final DamageSource generic =
|
||||
(new DamageSource(TextColor.LIGHT_GRAY, "%s starb")).setDamageBypassesArmor();
|
||||
(new DamageSource(Color.LIGHT_GRAY, "%s starb")).setDamageBypassesArmor();
|
||||
public static final DamageSource magic =
|
||||
(new DamageSource(TextColor.DARK_MAGENTA, "%s wurde durch Magie getötet")).setDamageBypassesArmor().setMagicDamage();
|
||||
(new DamageSource(Color.DARK_MAGENTA, "%s wurde durch Magie getötet")).setDamageBypassesArmor().setMagicDamage();
|
||||
public static final DamageSource anvil =
|
||||
new DamageSource(TextColor.DARK_RED, "%s wurde von einem fallenden Amboss zerquetscht");
|
||||
new DamageSource(Color.DARK_RED, "%s wurde von einem fallenden Amboss zerquetscht");
|
||||
public static final DamageSource fallingBlock =
|
||||
new DamageSource(TextColor.GRAY, "%s wurde von einem fallenden Block zerquetscht");
|
||||
new DamageSource(Color.GRAY, "%s wurde von einem fallenden Block zerquetscht");
|
||||
public static final DamageSource radiation =
|
||||
(new DamageSource(TextColor.GREEN, "%s hat seine Halbwertszeit nicht rechtzeitig erreicht")).setDamageBypassesArmor();
|
||||
(new DamageSource(Color.GREEN, "%s hat seine Halbwertszeit nicht rechtzeitig erreicht")).setDamageBypassesArmor();
|
||||
|
||||
protected final String display;
|
||||
protected final String displayExtra;
|
||||
protected final String displayKill;
|
||||
protected final TextColor color;
|
||||
protected final Color color;
|
||||
|
||||
private boolean isUnblockable;
|
||||
private boolean fireDamage;
|
||||
|
@ -49,57 +49,57 @@ public class DamageSource
|
|||
|
||||
public static DamageSource causeMobDamage(EntityLiving mob)
|
||||
{
|
||||
return new EntityDamageSource(TextColor.CRIMSON, "%s wurde von %s erschlagen", "%s wurde von %s mit %s erschlagen",
|
||||
return new EntityDamageSource(Color.CRIMSON, "%s wurde von %s erschlagen", "%s wurde von %s mit %s erschlagen",
|
||||
"%s erschlagen", "%s mit %s erschlagen", mob);
|
||||
}
|
||||
|
||||
public static DamageSource causeLightningDamage(EntityLiving mob)
|
||||
{
|
||||
return mob == null ? new DamageSource(TextColor.YELLOW, "%s wurde vom Blitz getroffen und gegrillt") :
|
||||
new EntityDamageSource(TextColor.YELLOW, "%s wurde von %s gegrillt", "%s wurde von %s mit %s gegrillt",
|
||||
return mob == null ? new DamageSource(Color.YELLOW, "%s wurde vom Blitz getroffen und gegrillt") :
|
||||
new EntityDamageSource(Color.YELLOW, "%s wurde von %s gegrillt", "%s wurde von %s mit %s gegrillt",
|
||||
"%s gegrillt", "%s mit %s gegrillt", mob);
|
||||
}
|
||||
|
||||
public static DamageSource causeExterminatusDamage(EntityLiving mob)
|
||||
{
|
||||
return mob == null ? new DamageSource(TextColor.DARK_RED, "%s wurde vernichtet") :
|
||||
new EntityDamageSource(TextColor.DARK_RED, "%s wurde von %s vernichtet", "%s wurde von %s mit %s vernichtet",
|
||||
return mob == null ? new DamageSource(Color.DARK_RED, "%s wurde vernichtet") :
|
||||
new EntityDamageSource(Color.DARK_RED, "%s wurde von %s vernichtet", "%s wurde von %s mit %s vernichtet",
|
||||
"%s vernichtet", "%s mit %s vernichtet", mob);
|
||||
}
|
||||
|
||||
public static DamageSource causeShotDamage(Entity projectile, Entity shooter)
|
||||
{
|
||||
return (new EntityDamageSourceIndirect(TextColor.RED, "%s wurde von %s erschossen", "%s wurde von %s mit %s erschossen", "%s erschossen", "%s mit %s erschossen", projectile, shooter)).setProjectile();
|
||||
return (new EntityDamageSourceIndirect(Color.RED, "%s wurde von %s erschossen", "%s wurde von %s mit %s erschossen", "%s erschossen", "%s mit %s erschossen", projectile, shooter)).setProjectile();
|
||||
}
|
||||
|
||||
public static DamageSource causeFireballDamage(EntityProjectile fireball, Entity shooter)
|
||||
{
|
||||
return shooter == null ? (new EntityDamageSourceIndirect(TextColor.YELLOW, "%s wurde von %s flambiert", fireball)).setFireDamage().setProjectile() : (new EntityDamageSourceIndirect(TextColor.YELLOW, "%s wurde von %s flambiert", "%s wurde von %s mit %s flambiert", "%s flambiert", "%s mit %s flambiert", fireball, shooter)).setFireDamage().setProjectile();
|
||||
return shooter == null ? (new EntityDamageSourceIndirect(Color.YELLOW, "%s wurde von %s flambiert", fireball)).setFireDamage().setProjectile() : (new EntityDamageSourceIndirect(Color.YELLOW, "%s wurde von %s flambiert", "%s wurde von %s mit %s flambiert", "%s flambiert", "%s mit %s flambiert", fireball, shooter)).setFireDamage().setProjectile();
|
||||
}
|
||||
|
||||
public static DamageSource causeThrownDamage(Entity source, Entity thrower)
|
||||
{
|
||||
return (new EntityDamageSourceIndirect(TextColor.DARK_GREEN, "%s wurde von %s zu Tode geprügelt", "%s wurde von %s mit %s zu Tode geprügelt", "%s zu Tode geprügelt", "%s mit %s zu Tode geprügelt", source, thrower)).setProjectile();
|
||||
return (new EntityDamageSourceIndirect(Color.DARK_GREEN, "%s wurde von %s zu Tode geprügelt", "%s wurde von %s mit %s zu Tode geprügelt", "%s zu Tode geprügelt", "%s mit %s zu Tode geprügelt", source, thrower)).setProjectile();
|
||||
}
|
||||
|
||||
public static DamageSource causeTeleFragDamage(Entity source, Entity replacer)
|
||||
{
|
||||
return (new EntityDamageSourceIndirect(TextColor.MAGENTA, "%s wurde von %s verdrängt", "%s wurde von %s mit %s verdrängt", "%s verdrängt", "%s mit %s verdrängt", source, replacer)).setDamageBypassesArmor();
|
||||
return (new EntityDamageSourceIndirect(Color.MAGENTA, "%s wurde von %s verdrängt", "%s wurde von %s mit %s verdrängt", "%s verdrängt", "%s mit %s verdrängt", source, replacer)).setDamageBypassesArmor();
|
||||
}
|
||||
|
||||
public static DamageSource causeIndirectMagicDamage(Entity source, Entity mage)
|
||||
{
|
||||
return (new EntityDamageSourceIndirect(TextColor.DARK_MAGENTA, "%s wurde von %s mit Magie getötet", "%s wurde von %s mit %s getötet", "%s mit Magie getötet", "%s mit %s getötet", source, mage)).setDamageBypassesArmor().setMagicDamage();
|
||||
return (new EntityDamageSourceIndirect(Color.DARK_MAGENTA, "%s wurde von %s mit Magie getötet", "%s wurde von %s mit %s getötet", "%s mit Magie getötet", "%s mit %s getötet", source, mage)).setDamageBypassesArmor().setMagicDamage();
|
||||
}
|
||||
|
||||
public static DamageSource causeThornsDamage(Entity source)
|
||||
{
|
||||
return (new EntityDamageSource(TextColor.ORK, "%s wurde beim Versuch %s zu verletzen getötet", "%s durch Dornen getötet", source)).setIsThornsDamage().setMagicDamage();
|
||||
return (new EntityDamageSource(Color.ORK, "%s wurde beim Versuch %s zu verletzen getötet", "%s durch Dornen getötet", source)).setIsThornsDamage().setMagicDamage();
|
||||
}
|
||||
|
||||
public static DamageSource causeExplosionDamage(Explosion explosion)
|
||||
{
|
||||
return explosion != null && explosion.getExplosivePlacedBy() != null ? (new EntityDamageSource(TextColor.YELLOW, "%s wurde durch %s in die Luft gesprengt", "%s in die Luft gesprengt", explosion.getExplosivePlacedBy())).setExplosion() : (new DamageSource(TextColor.YELLOW, "%s wurde in die Luft gesprengt")).setExplosion();
|
||||
return explosion != null && explosion.getExplosivePlacedBy() != null ? (new EntityDamageSource(Color.YELLOW, "%s wurde durch %s in die Luft gesprengt", "%s in die Luft gesprengt", explosion.getExplosivePlacedBy())).setExplosion() : (new DamageSource(Color.YELLOW, "%s wurde in die Luft gesprengt")).setExplosion();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -135,7 +135,7 @@ public class DamageSource
|
|||
return this.isUnblockable;
|
||||
}
|
||||
|
||||
protected DamageSource(TextColor color, String display, String extra, String kill)
|
||||
protected DamageSource(Color color, String display, String extra, String kill)
|
||||
{
|
||||
this.color = color;
|
||||
this.display = this.color + display;
|
||||
|
@ -143,7 +143,7 @@ public class DamageSource
|
|||
this.displayKill = this.color + "* " + kill;
|
||||
}
|
||||
|
||||
protected DamageSource(TextColor color, String display)
|
||||
protected DamageSource(Color color, String display)
|
||||
{
|
||||
this(color, display, display, "");
|
||||
}
|
||||
|
|
|
@ -37,7 +37,7 @@ import common.util.ParticleType;
|
|||
import common.util.PortalType;
|
||||
import common.util.Position;
|
||||
import common.util.Serverside;
|
||||
import common.util.TextColor;
|
||||
import common.util.Color;
|
||||
import common.util.Vec3;
|
||||
import common.vars.Vars;
|
||||
import common.world.Explosion;
|
||||
|
@ -2410,12 +2410,12 @@ public abstract class Entity
|
|||
|
||||
public final String getCommandName()
|
||||
{
|
||||
return TextColor.stripCodes(this.getName());
|
||||
return Color.stripCodes(this.getName());
|
||||
}
|
||||
|
||||
public final String getColoredName(TextColor reset)
|
||||
public final String getColoredName(Color reset)
|
||||
{
|
||||
return TextColor.DARK_GRAY + "[" + this.getName() + TextColor.DARK_GRAY + "]" + reset;
|
||||
return Color.DARK_GRAY + "[" + this.getName() + Color.DARK_GRAY + "]" + reset;
|
||||
}
|
||||
|
||||
// public Text formatComponent(Text comp) {
|
||||
|
|
|
@ -2,7 +2,7 @@ package common.entity;
|
|||
|
||||
import common.entity.types.EntityLiving;
|
||||
import common.item.ItemStack;
|
||||
import common.util.TextColor;
|
||||
import common.util.Color;
|
||||
|
||||
public class EntityDamageSource extends DamageSource
|
||||
{
|
||||
|
@ -14,14 +14,14 @@ public class EntityDamageSource extends DamageSource
|
|||
*/
|
||||
private boolean isThornsDamage = false;
|
||||
|
||||
public EntityDamageSource(TextColor color, String display, String item, String kill, String killItem, Entity damageSourceEntityIn)
|
||||
public EntityDamageSource(Color color, String display, String item, String kill, String killItem, Entity damageSourceEntityIn)
|
||||
{
|
||||
super(color, display, item, kill);
|
||||
this.damageSourceEntity = damageSourceEntityIn;
|
||||
this.displayKillItem = killItem;
|
||||
}
|
||||
|
||||
public EntityDamageSource(TextColor color, String display, String kill, Entity damageSourceEntityIn)
|
||||
public EntityDamageSource(Color color, String display, String kill, Entity damageSourceEntityIn)
|
||||
{
|
||||
this(color, display, display, kill, kill, damageSourceEntityIn);
|
||||
}
|
||||
|
|
|
@ -2,19 +2,19 @@ package common.entity;
|
|||
|
||||
import common.entity.types.EntityLiving;
|
||||
import common.item.ItemStack;
|
||||
import common.util.TextColor;
|
||||
import common.util.Color;
|
||||
|
||||
public class EntityDamageSourceIndirect extends EntityDamageSource
|
||||
{
|
||||
private Entity indirectEntity;
|
||||
|
||||
public EntityDamageSourceIndirect(TextColor color, String display, String item, String kill, String killItem, Entity source, Entity indirectEntityIn)
|
||||
public EntityDamageSourceIndirect(Color color, String display, String item, String kill, String killItem, Entity source, Entity indirectEntityIn)
|
||||
{
|
||||
super(color, display, item, kill, killItem, source);
|
||||
this.indirectEntity = indirectEntityIn;
|
||||
}
|
||||
|
||||
public EntityDamageSourceIndirect(TextColor color, String display, Entity source)
|
||||
public EntityDamageSourceIndirect(Color color, String display, Entity source)
|
||||
{
|
||||
this(color, display, display, "", "", source, source);
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ import common.rng.Random;
|
|||
import common.tags.TagObject;
|
||||
import common.util.Clientside;
|
||||
import common.util.ExtMath;
|
||||
import common.util.TextColor;
|
||||
import common.util.Color;
|
||||
import common.world.World;
|
||||
|
||||
public class EntitySheep extends EntityAnimal
|
||||
|
@ -100,7 +100,7 @@ public class EntitySheep extends EntityAnimal
|
|||
{
|
||||
super.entityInit();
|
||||
this.dataWatcher.addObject(16, (byte)0);
|
||||
this.dataWatcher.addObject(17, (byte)(TextColor.WHITE.ordinal() & 255));
|
||||
this.dataWatcher.addObject(17, (byte)(Color.WHITE.ordinal() & 255));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -209,7 +209,7 @@ public class EntitySheep extends EntityAnimal
|
|||
{
|
||||
super.readEntity(tagCompund);
|
||||
this.setSheared(tagCompund.getBool("Sheared"));
|
||||
this.setFleeceColor(TextColor.byName(tagCompund.getString("Color")));
|
||||
this.setFleeceColor(Color.byName(tagCompund.getString("Color")));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -244,15 +244,15 @@ public class EntitySheep extends EntityAnimal
|
|||
/**
|
||||
* Gets the wool color of this sheep.
|
||||
*/
|
||||
public TextColor getFleeceColor()
|
||||
public Color getFleeceColor()
|
||||
{
|
||||
return TextColor.values()[(this.dataWatcher.getWatchableObjectByte(17) & 255) % TextColor.values().length];
|
||||
return Color.values()[(this.dataWatcher.getWatchableObjectByte(17) & 255) % Color.values().length];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the wool color of this sheep
|
||||
*/
|
||||
public void setFleeceColor(TextColor color)
|
||||
public void setFleeceColor(Color color)
|
||||
{
|
||||
this.dataWatcher.updateObject(17, (byte)(color.ordinal() & 255));
|
||||
}
|
||||
|
@ -273,23 +273,23 @@ public class EntitySheep extends EntityAnimal
|
|||
this.dataWatcher.updateObject(16, (byte)(sheared ? 1 : 0));
|
||||
}
|
||||
|
||||
private static final TextColor[] RARE_COLORS = {
|
||||
TextColor.BLUE, TextColor.CYAN, TextColor.DARK_GREEN, TextColor.LIGHT_BLUE, TextColor.GREEN,
|
||||
TextColor.MAGENTA, TextColor.ORANGE, TextColor.DARK_VIOLET, TextColor.VIOLET, TextColor.RED
|
||||
private static final Color[] RARE_COLORS = {
|
||||
Color.BLUE, Color.CYAN, Color.DARK_GREEN, Color.LIGHT_BLUE, Color.GREEN,
|
||||
Color.MAGENTA, Color.ORANGE, Color.DARK_VIOLET, Color.VIOLET, Color.RED
|
||||
};
|
||||
|
||||
public static TextColor getRandomSheepColor(Random random, float temp)
|
||||
public static Color getRandomSheepColor(Random random, float temp)
|
||||
{
|
||||
if(temp <= 0.0f)
|
||||
return TextColor.WHITE;
|
||||
return Color.WHITE;
|
||||
int i = random.zrange(140);
|
||||
return i < 20 ? TextColor.BLACK :
|
||||
(i < 30 ? TextColor.GRAY :
|
||||
(i < 40 ? TextColor.LIGHT_GRAY :
|
||||
(i < 70 ? TextColor.BROWN :
|
||||
(i < 120 ? TextColor.WHITE :
|
||||
(i < 130 ? (random.chance(10) ? RARE_COLORS[i - 120] : TextColor.WHITE) :
|
||||
(random.chance(500) ? TextColor.YELLOW : TextColor.WHITE)
|
||||
return i < 20 ? Color.BLACK :
|
||||
(i < 30 ? Color.GRAY :
|
||||
(i < 40 ? Color.LIGHT_GRAY :
|
||||
(i < 70 ? Color.BROWN :
|
||||
(i < 120 ? Color.WHITE :
|
||||
(i < 130 ? (random.chance(10) ? RARE_COLORS[i - 120] : Color.WHITE) :
|
||||
(random.chance(500) ? Color.YELLOW : Color.WHITE)
|
||||
)))));
|
||||
}
|
||||
|
||||
|
@ -322,14 +322,14 @@ public class EntitySheep extends EntityAnimal
|
|||
return livingdata;
|
||||
}
|
||||
|
||||
private TextColor getDyeColorMixFromParents(EntityAnimal father, EntityAnimal mother)
|
||||
private Color getDyeColorMixFromParents(EntityAnimal father, EntityAnimal mother)
|
||||
{
|
||||
TextColor i = ((EntitySheep)father).getFleeceColor();
|
||||
TextColor j = ((EntitySheep)mother).getFleeceColor();
|
||||
Color i = ((EntitySheep)father).getFleeceColor();
|
||||
Color j = ((EntitySheep)mother).getFleeceColor();
|
||||
this.inventoryCrafting.setInventorySlotContents(0, new ItemStack(ItemDye.getByColor(i)));
|
||||
this.inventoryCrafting.setInventorySlotContents(1, new ItemStack(ItemDye.getByColor(j)));
|
||||
ItemStack itemstack = CraftingRegistry.getMatching(this.inventoryCrafting);
|
||||
TextColor k;
|
||||
Color k;
|
||||
|
||||
if (itemstack != null && itemstack.getItem() instanceof ItemDye dye)
|
||||
{
|
||||
|
|
|
@ -33,7 +33,7 @@ import common.tags.TagObject;
|
|||
import common.util.Clientside;
|
||||
import common.util.ExtMath;
|
||||
import common.util.ParticleType;
|
||||
import common.util.TextColor;
|
||||
import common.util.Color;
|
||||
import common.vars.Vars;
|
||||
import common.world.World;
|
||||
|
||||
|
@ -118,7 +118,7 @@ public class EntityWolf extends EntityTameable
|
|||
super.entityInit();
|
||||
this.dataWatcher.addObject(18, this.getHealth());
|
||||
this.dataWatcher.addObject(19, (byte)0);
|
||||
this.dataWatcher.addObject(20, (byte)(TextColor.RED.ordinal() & 255));
|
||||
this.dataWatcher.addObject(20, (byte)(Color.RED.ordinal() & 255));
|
||||
}
|
||||
|
||||
// protected void playStepSound(BlockPos pos, Block blockIn)
|
||||
|
@ -137,7 +137,7 @@ public class EntityWolf extends EntityTameable
|
|||
{
|
||||
super.readEntity(tagCompund);
|
||||
this.setAngry(tagCompund.getBool("Angry"));
|
||||
this.setCollarColor(TextColor.byName(tagCompund.getString("CollarColor")));
|
||||
this.setCollarColor(Color.byName(tagCompund.getString("CollarColor")));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -373,7 +373,7 @@ public class EntityWolf extends EntityTameable
|
|||
}
|
||||
else if (itemstack.getItem() instanceof ItemDye dye)
|
||||
{
|
||||
TextColor enumdyecolor = dye.getColor();
|
||||
Color enumdyecolor = dye.getColor();
|
||||
|
||||
if (enumdyecolor != this.getCollarColor())
|
||||
{
|
||||
|
@ -492,12 +492,12 @@ public class EntityWolf extends EntityTameable
|
|||
}
|
||||
}
|
||||
|
||||
public TextColor getCollarColor()
|
||||
public Color getCollarColor()
|
||||
{
|
||||
return TextColor.values()[(this.dataWatcher.getWatchableObjectByte(20) & 255) % TextColor.values().length];
|
||||
return Color.values()[(this.dataWatcher.getWatchableObjectByte(20) & 255) % Color.values().length];
|
||||
}
|
||||
|
||||
public void setCollarColor(TextColor collarcolor)
|
||||
public void setCollarColor(Color collarcolor)
|
||||
{
|
||||
this.dataWatcher.updateObject(20, (byte)(collarcolor.ordinal() & 255));
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@ import common.util.BlockPos;
|
|||
import common.util.ExtMath;
|
||||
import common.util.ParticleType;
|
||||
import common.util.PortalType;
|
||||
import common.util.TextColor;
|
||||
import common.util.Color;
|
||||
import common.vars.Vars;
|
||||
import common.world.World;
|
||||
import common.world.AWorldServer;
|
||||
|
@ -599,7 +599,7 @@ public class EntityItem extends Entity
|
|||
ItemStack stack = this.getEntityItem();
|
||||
if(!stack.isStacked())
|
||||
return null;
|
||||
return TextColor.DARK_GREEN + "" + stack.getSize();
|
||||
return Color.DARK_GREEN + "" + stack.getSize();
|
||||
}
|
||||
|
||||
public EntityType getType() {
|
||||
|
|
|
@ -14,7 +14,7 @@ import common.util.Clientside;
|
|||
import common.util.ExtMath;
|
||||
import common.util.ParticleType;
|
||||
import common.util.PortalType;
|
||||
import common.util.TextColor;
|
||||
import common.util.Color;
|
||||
import common.vars.Vars;
|
||||
import common.world.World;
|
||||
|
||||
|
@ -396,7 +396,7 @@ public class EntityXp extends Entity implements IObjectData
|
|||
// if(!this.hasCustomName()) {
|
||||
// return super.getDisplayName();
|
||||
// }
|
||||
return this.hasCustomName() ? TextColor.GREEN + this.getCustomNameTag() : null;
|
||||
return this.hasCustomName() ? Color.GREEN + this.getCustomNameTag() : null;
|
||||
}
|
||||
|
||||
public EntityType getType() {
|
||||
|
|
|
@ -3,18 +3,18 @@ package common.entity.npc;
|
|||
import java.util.Map;
|
||||
|
||||
import common.collect.Maps;
|
||||
import common.util.TextColor;
|
||||
import common.util.Color;
|
||||
|
||||
public enum Alignment {
|
||||
LAWFUL_GOOD("lgood", "Rechtsch. gut", 1, 1, TextColor.NEON),
|
||||
GOOD("good", "Gut", 0, 1, TextColor.BLUE),
|
||||
CHAOTIC_GOOD("cgood", "Chaotisch gut", -1, 1, TextColor.CYAN),
|
||||
LAWFUL("lawful", "Rechtschaffen", 1, 0, TextColor.WHITE),
|
||||
NEUTRAL("neutral", "Neutral", 0, 0, TextColor.LIGHT_GRAY),
|
||||
CHAOTIC("chaotic", "Chaotisch", -1, 0, TextColor.GRAY),
|
||||
LAWFUL_EVIL("levil", "Rechtsch. böse", 1, -1, TextColor.ORANGE),
|
||||
EVIL("evil", "Böse", 0, -1, TextColor.RED),
|
||||
CHAOTIC_EVIL("cevil", "Chaotisch böse", -1, -1, TextColor.DARK_RED);
|
||||
LAWFUL_GOOD("lgood", "Rechtsch. gut", 1, 1, Color.NEON),
|
||||
GOOD("good", "Gut", 0, 1, Color.BLUE),
|
||||
CHAOTIC_GOOD("cgood", "Chaotisch gut", -1, 1, Color.CYAN),
|
||||
LAWFUL("lawful", "Rechtschaffen", 1, 0, Color.WHITE),
|
||||
NEUTRAL("neutral", "Neutral", 0, 0, Color.LIGHT_GRAY),
|
||||
CHAOTIC("chaotic", "Chaotisch", -1, 0, Color.GRAY),
|
||||
LAWFUL_EVIL("levil", "Rechtsch. böse", 1, -1, Color.ORANGE),
|
||||
EVIL("evil", "Böse", 0, -1, Color.RED),
|
||||
CHAOTIC_EVIL("cevil", "Chaotisch böse", -1, -1, Color.DARK_RED);
|
||||
|
||||
private static final Map<String, Alignment> LOOKUP = Maps.newHashMap();
|
||||
|
||||
|
@ -22,12 +22,12 @@ public enum Alignment {
|
|||
public final boolean chaotic;
|
||||
public final boolean good;
|
||||
public final boolean evil;
|
||||
public final TextColor color;
|
||||
public final Color color;
|
||||
public final String name;
|
||||
public final String prefix;
|
||||
public final String display;
|
||||
|
||||
private Alignment(String name, String display, int temper, int morale, TextColor color) {
|
||||
private Alignment(String name, String display, int temper, int morale, Color color) {
|
||||
this.lawful = temper == 1;
|
||||
this.chaotic = temper == -1;
|
||||
this.good = morale == 1;
|
||||
|
@ -35,10 +35,10 @@ public enum Alignment {
|
|||
this.color = color;
|
||||
this.name = name;
|
||||
this.display = display;
|
||||
this.prefix = TextColor.GRAY + "[" + (temper == 0 && morale == 0 ? TextColor.LIGHT_GRAY + "~" : "") +
|
||||
(this.good ? TextColor.BLUE + "*" : (this.evil ? TextColor.RED + "!" : "")) +
|
||||
(this.lawful ? TextColor.GREEN + "+" : (this.chaotic ? TextColor.DARK_MAGENTA + "-" : "")) +
|
||||
TextColor.GRAY + "]";
|
||||
this.prefix = Color.GRAY + "[" + (temper == 0 && morale == 0 ? Color.LIGHT_GRAY + "~" : "") +
|
||||
(this.good ? Color.BLUE + "*" : (this.evil ? Color.RED + "!" : "")) +
|
||||
(this.lawful ? Color.GREEN + "+" : (this.chaotic ? Color.DARK_MAGENTA + "-" : "")) +
|
||||
Color.GRAY + "]";
|
||||
}
|
||||
|
||||
public static Alignment getByName(String name) {
|
||||
|
|
|
@ -92,7 +92,7 @@ import common.util.ExtMath;
|
|||
import common.util.Facing;
|
||||
import common.util.ParticleType;
|
||||
import common.util.PortalType;
|
||||
import common.util.TextColor;
|
||||
import common.util.Color;
|
||||
import common.util.Vec3;
|
||||
import common.util.WorldPos;
|
||||
import common.vars.Vars;
|
||||
|
@ -1139,7 +1139,7 @@ public abstract class EntityNPC extends EntityLiving
|
|||
}
|
||||
|
||||
public String formatStats() {
|
||||
return super.formatStats() + (this.getManaPoints() == 0 ? "" : TextColor.GRAY + " [" + TextColor.MIDNIGHT + this.getManaPoints() + TextColor.GRAY + "]");
|
||||
return super.formatStats() + (this.getManaPoints() == 0 ? "" : Color.GRAY + " [" + Color.MIDNIGHT + this.getManaPoints() + Color.GRAY + "]");
|
||||
}
|
||||
|
||||
public MerchantRecipeList getTrades(EntityNPC player) {
|
||||
|
|
|
@ -57,7 +57,7 @@ import common.util.Clientside;
|
|||
import common.util.ExtMath;
|
||||
import common.util.ParticleType;
|
||||
import common.util.Serverside;
|
||||
import common.util.TextColor;
|
||||
import common.util.Color;
|
||||
import common.util.Vec3;
|
||||
import common.vars.Vars;
|
||||
import common.world.State;
|
||||
|
@ -2243,15 +2243,15 @@ public abstract class EntityLiving extends Entity
|
|||
this.effectsDirty = true;
|
||||
}
|
||||
|
||||
public static TextColor getHealthColor(int health, int max) {
|
||||
public static Color getHealthColor(int health, int max) {
|
||||
float perc = (float)health / (float)max;
|
||||
return /* health <= 1.0f ? ChatFormat.DARK_RED : ( */ perc >= 1.0f ? TextColor.DARK_GREEN : (perc >= 0.75f ? TextColor.GREEN :
|
||||
(perc >= 0.5f ? TextColor.YELLOW : (perc >= 0.25f ? TextColor.ORANGE : (perc >= 0.1f ? TextColor.RED : TextColor.DARK_RED))));
|
||||
return /* health <= 1.0f ? ChatFormat.DARK_RED : ( */ perc >= 1.0f ? Color.DARK_GREEN : (perc >= 0.75f ? Color.GREEN :
|
||||
(perc >= 0.5f ? Color.YELLOW : (perc >= 0.25f ? Color.ORANGE : (perc >= 0.1f ? Color.RED : Color.DARK_RED))));
|
||||
}
|
||||
|
||||
public static TextColor getMaxHpColor(int max) {
|
||||
return max >= 2000 ? TextColor.BLACK : (max >= 500 ? TextColor.DARK_MAGENTA : (max >= 120 ? TextColor.MAGENTA :
|
||||
(max >= 40 ? TextColor.CYAN : (max >= 15 ? TextColor.NEON : (max >= 5 ? TextColor.BLUE : TextColor.LIGHT_GRAY)))));
|
||||
public static Color getMaxHpColor(int max) {
|
||||
return max >= 2000 ? Color.BLACK : (max >= 500 ? Color.DARK_MAGENTA : (max >= 120 ? Color.MAGENTA :
|
||||
(max >= 40 ? Color.CYAN : (max >= 15 ? Color.NEON : (max >= 5 ? Color.BLUE : Color.LIGHT_GRAY)))));
|
||||
}
|
||||
|
||||
public int getEnergy(Energy type) {
|
||||
|
@ -2272,7 +2272,7 @@ public abstract class EntityLiving extends Entity
|
|||
|
||||
public String formatStats() {
|
||||
return String.format(this.getAlignment().prefix + " " + getHealthColor(this.getHealth(), this.getMaxHealth()) + "%d" +
|
||||
TextColor.GRAY + "/" + getMaxHpColor(this.getMaxHealth()) + "%d",
|
||||
Color.GRAY + "/" + getMaxHpColor(this.getMaxHealth()) + "%d",
|
||||
this.getHealth(), this.getMaxHealth());
|
||||
}
|
||||
|
||||
|
@ -2327,7 +2327,7 @@ public abstract class EntityLiving extends Entity
|
|||
String kill;
|
||||
IPlayer receiver = null;
|
||||
if(this.combat.size() == 0) {
|
||||
msg = kill = natural ? String.format("%s starb", this.getColoredName(TextColor.LIGHT_GRAY)) : null;
|
||||
msg = kill = natural ? String.format("%s starb", this.getColoredName(Color.LIGHT_GRAY)) : null;
|
||||
}
|
||||
else {
|
||||
CombatEntry strong = null;
|
||||
|
@ -2366,16 +2366,16 @@ public abstract class EntityLiving extends Entity
|
|||
ItemStack fallItem = fallEnt instanceof EntityLiving ? ((EntityLiving)fallEnt).getHeldItem() : null;
|
||||
receiver = fallEnt.isPlayer() ? ((EntityNPC)fallEnt).connection : null;
|
||||
if(fallItem != null) { // && fallItem.hasDisplayName()) {
|
||||
msg = String.format("%s wurde von %s mit %s zum Fallen verdammt", this.getColoredName(TextColor.CYAN),
|
||||
fallEnt.getColoredName(TextColor.CYAN), fallItem.getColoredName(TextColor.CYAN));
|
||||
kill = String.format(TextColor.CYAN + "* %s mit %s zum Fallen verdammt",
|
||||
this.getColoredName(TextColor.CYAN), fallItem.getColoredName(TextColor.CYAN));
|
||||
msg = String.format("%s wurde von %s mit %s zum Fallen verdammt", this.getColoredName(Color.CYAN),
|
||||
fallEnt.getColoredName(Color.CYAN), fallItem.getColoredName(Color.CYAN));
|
||||
kill = String.format(Color.CYAN + "* %s mit %s zum Fallen verdammt",
|
||||
this.getColoredName(Color.CYAN), fallItem.getColoredName(Color.CYAN));
|
||||
}
|
||||
else {
|
||||
msg = String.format("%s wurde von %s zum Fallen verdammt", this.getColoredName(TextColor.CYAN),
|
||||
fallEnt.getColoredName(TextColor.CYAN));
|
||||
kill = String.format(TextColor.CYAN + "* %s zum Fallen verdammt",
|
||||
this.getColoredName(TextColor.CYAN));
|
||||
msg = String.format("%s wurde von %s zum Fallen verdammt", this.getColoredName(Color.CYAN),
|
||||
fallEnt.getColoredName(Color.CYAN));
|
||||
kill = String.format(Color.CYAN + "* %s zum Fallen verdammt",
|
||||
this.getColoredName(Color.CYAN));
|
||||
}
|
||||
}
|
||||
else if(lastEnt != null) {
|
||||
|
@ -2383,24 +2383,24 @@ public abstract class EntityLiving extends Entity
|
|||
receiver = lastEnt.isPlayer() ? ((EntityNPC)lastEnt).connection : null;
|
||||
if(lastItem != null) { // && lastItem.hasDisplayName()) {
|
||||
msg = String.format("%s fiel zu tief und wurde von %s mit %s erledigt",
|
||||
this.getColoredName(TextColor.BLUE),
|
||||
lastEnt.getColoredName(TextColor.BLUE), lastItem.getColoredName(TextColor.BLUE));
|
||||
kill = String.format(TextColor.BLUE + "* %s mit %s erledigt",
|
||||
this.getColoredName(TextColor.BLUE), lastItem.getColoredName(TextColor.BLUE));
|
||||
this.getColoredName(Color.BLUE),
|
||||
lastEnt.getColoredName(Color.BLUE), lastItem.getColoredName(Color.BLUE));
|
||||
kill = String.format(Color.BLUE + "* %s mit %s erledigt",
|
||||
this.getColoredName(Color.BLUE), lastItem.getColoredName(Color.BLUE));
|
||||
}
|
||||
else {
|
||||
msg = String.format("%s fiel zu tief und wurde von %s erledigt", this.getColoredName(TextColor.BLUE),
|
||||
lastEnt.getColoredName(TextColor.BLUE));
|
||||
kill = String.format(TextColor.BLUE + "%s erledigt", this.getColoredName(TextColor.BLUE));
|
||||
msg = String.format("%s fiel zu tief und wurde von %s erledigt", this.getColoredName(Color.BLUE),
|
||||
lastEnt.getColoredName(Color.BLUE));
|
||||
kill = String.format(Color.BLUE + "%s erledigt", this.getColoredName(Color.BLUE));
|
||||
}
|
||||
}
|
||||
else {
|
||||
msg = kill = natural ? String.format("%s wurde zum Fallen verdammt", this.getColoredName(TextColor.CYAN)) : null;
|
||||
msg = kill = natural ? String.format("%s wurde zum Fallen verdammt", this.getColoredName(Color.CYAN)) : null;
|
||||
}
|
||||
}
|
||||
else {
|
||||
msg = kill = natural ? String.format("%s fiel " + (fall.blockType() == null ? "aus zu großer Höhe" : fall.blockType()),
|
||||
this.getColoredName(TextColor.NEON)) : null;
|
||||
this.getColoredName(Color.NEON)) : null;
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -134,7 +134,7 @@ import common.log.Log;
|
|||
import common.model.TextureAnimation;
|
||||
import common.properties.Property;
|
||||
import common.util.PortalType;
|
||||
import common.util.TextColor;
|
||||
import common.util.Color;
|
||||
import common.util.Util;
|
||||
import common.world.State;
|
||||
|
||||
|
@ -265,7 +265,7 @@ public abstract class BlockRegistry {
|
|||
.setDisplay("Obsidian").setMiningLevel(3));
|
||||
register("clay", (new BlockClay()).setHardness(0.6F).setSound(SoundType.GRAVEL).setDisplay("Ton").setShovelHarvestable());
|
||||
register("hardened_clay", (new BlockHardenedClay()).setHardness(1.25F).setResistance(7.0F).setSound(SoundType.STONE).setDisplay("Gebrannter Ton"));
|
||||
for(TextColor color : TextColor.values()) {
|
||||
for(Color color : Color.values()) {
|
||||
register(color.getName() + "_clay", (new BlockColoredClay(color)).setHardness(1.25F).setResistance(7.0F)
|
||||
.setSound(SoundType.STONE).setDisplay(color.getDisplay() + " gefärbter Ton"));
|
||||
}
|
||||
|
@ -414,23 +414,23 @@ public abstract class BlockRegistry {
|
|||
.setSound(SoundType.STONE).setDisplay("Geladener Block").setTab(CheatTab.GEMS));
|
||||
|
||||
register("glass", (new BlockGlass()).setHardness(0.3F).setSound(SoundType.GLASS).setDisplay("Glas"));
|
||||
for(TextColor color : TextColor.values()) {
|
||||
for(Color color : Color.values()) {
|
||||
register(color.getName() + "_glass", (new BlockStainedGlass(color)).setHardness(0.3F).setSound(SoundType.GLASS).setDisplay(color.getDisplay() + " gefärbtes Glas"));
|
||||
}
|
||||
register("glass_pane", (new BlockPane(Material.TRANSLUCENT)).setHardness(0.3F).setSound(SoundType.GLASS).setDisplay("Glasscheibe"));
|
||||
for(TextColor color : TextColor.values()) {
|
||||
for(Color color : Color.values()) {
|
||||
register(color.getName() + "_glass_pane", (new BlockStainedGlassPane(color)).setHardness(0.3F).setSound(SoundType.GLASS).setDisplay(color.getDisplay() + " gefärbte Glasscheibe"));
|
||||
}
|
||||
|
||||
|
||||
for(TextColor color : TextColor.values()) {
|
||||
for(Color color : Color.values()) {
|
||||
register(color.getName() + "_wool", (new BlockWool(color)).setHardness(0.8F).setSound(SoundType.CLOTH).setDisplay(color.getSubject(-1) + " Wolle")
|
||||
.setShearsEfficiency(1));
|
||||
}
|
||||
for(TextColor color : TextColor.values()) {
|
||||
for(Color color : Color.values()) {
|
||||
register(color.getName() + "_carpet", (new BlockCarpet(color)).setHardness(0.1F).setSound(SoundType.CLOTH).setDisplay(color.getSubject(1) + " Teppich").setOpacity(0));
|
||||
}
|
||||
for(TextColor color : BlockBed.COLORS) {
|
||||
for(Color color : BlockBed.COLORS) {
|
||||
register(color.getName() + "_bed", (new BlockBed(color)).setSound(SoundType.WOOD).setHardness(0.2F).setDisplay(color.getSubject(0) + " Bett"));
|
||||
}
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ import common.inventory.InventoryCrafting;
|
|||
import common.item.Item;
|
||||
import common.item.ItemStack;
|
||||
import common.item.material.ItemDye;
|
||||
import common.util.TextColor;
|
||||
import common.util.Color;
|
||||
|
||||
public abstract class CraftingRegistry
|
||||
{
|
||||
|
@ -156,47 +156,51 @@ public abstract class CraftingRegistry
|
|||
add(new ItemStack(Items.blood_brick, 1), "NN", "NN", 'N', Items.bloodbrick);
|
||||
add(new ItemStack(Items.coarse_dirt, 4), "DG", "GD", 'D', Items.dirt, 'G', Items.gravel);
|
||||
|
||||
for (TextColor color : TextColor.values())
|
||||
for (Color color : Color.values())
|
||||
{
|
||||
ItemDye dye = ItemDye.getByColor(color);
|
||||
if(color != TextColor.WHITE)
|
||||
if(color != Color.WHITE)
|
||||
addShapeless(new ItemStack(BlockWool.getByColor(color).getItem()), dye, Items.white_wool);
|
||||
add(new ItemStack(BlockColoredClay.getByColor(color).getItem(), 8), "###", "#X#", "###", '#', Items.hardened_clay, 'X', dye);
|
||||
add(new ItemStack(BlockStainedGlass.getByColor(color).getItem(), 8), "###", "#X#", "###", '#', Items.glass, 'X', dye);
|
||||
add(new ItemStack(BlockStainedGlassPane.getByColor(color).getItem(), 16), "###", "###", '#', BlockStainedGlass.getByColor(color).getItem());
|
||||
}
|
||||
|
||||
addShapeless(new ItemStack(ItemDye.getByColor(TextColor.YELLOW)), Items.dandelion);
|
||||
addShapeless(new ItemStack(ItemDye.getByColor(TextColor.RED)), Items.rose);
|
||||
addShapeless(new ItemStack(ItemDye.getByColor(TextColor.RED)), Items.poppy);
|
||||
addShapeless(new ItemStack(ItemDye.getByColor(TextColor.WHITE), 3), Items.bone);
|
||||
addShapeless(new ItemStack(ItemDye.getByColor(TextColor.MAGENTA), 2), new ItemStack(ItemDye.getByColor(TextColor.RED)), new ItemStack(ItemDye.getByColor(TextColor.WHITE)));
|
||||
addShapeless(new ItemStack(ItemDye.getByColor(TextColor.ORANGE), 2), new ItemStack(ItemDye.getByColor(TextColor.RED)), new ItemStack(ItemDye.getByColor(TextColor.YELLOW)));
|
||||
addShapeless(new ItemStack(ItemDye.getByColor(TextColor.GREEN), 2), new ItemStack(ItemDye.getByColor(TextColor.DARK_GREEN)), new ItemStack(ItemDye.getByColor(TextColor.WHITE)));
|
||||
addShapeless(new ItemStack(ItemDye.getByColor(TextColor.GRAY), 2), new ItemStack(ItemDye.getByColor(TextColor.BLACK)), new ItemStack(ItemDye.getByColor(TextColor.WHITE)));
|
||||
addShapeless(new ItemStack(ItemDye.getByColor(TextColor.LIGHT_GRAY), 2), new ItemStack(ItemDye.getByColor(TextColor.GRAY)), new ItemStack(ItemDye.getByColor(TextColor.WHITE)));
|
||||
addShapeless(new ItemStack(ItemDye.getByColor(TextColor.LIGHT_GRAY), 3), new ItemStack(ItemDye.getByColor(TextColor.BLACK)), new ItemStack(ItemDye.getByColor(TextColor.WHITE)), new ItemStack(ItemDye.getByColor(TextColor.WHITE)));
|
||||
addShapeless(new ItemStack(ItemDye.getByColor(TextColor.LIGHT_BLUE), 2), new ItemStack(ItemDye.getByColor(TextColor.BLUE)), new ItemStack(ItemDye.getByColor(TextColor.WHITE)));
|
||||
addShapeless(new ItemStack(ItemDye.getByColor(TextColor.CYAN), 2), new ItemStack(ItemDye.getByColor(TextColor.BLUE)), new ItemStack(ItemDye.getByColor(TextColor.DARK_GREEN)));
|
||||
addShapeless(new ItemStack(ItemDye.getByColor(TextColor.VIOLET), 2), new ItemStack(ItemDye.getByColor(TextColor.BLUE)), new ItemStack(ItemDye.getByColor(TextColor.RED)));
|
||||
addShapeless(new ItemStack(ItemDye.getByColor(TextColor.DARK_MAGENTA), 2), new ItemStack(ItemDye.getByColor(TextColor.VIOLET)), new ItemStack(ItemDye.getByColor(TextColor.MAGENTA)));
|
||||
addShapeless(new ItemStack(ItemDye.getByColor(TextColor.DARK_MAGENTA), 3), new ItemStack(ItemDye.getByColor(TextColor.BLUE)), new ItemStack(ItemDye.getByColor(TextColor.RED)), new ItemStack(ItemDye.getByColor(TextColor.MAGENTA)));
|
||||
addShapeless(new ItemStack(ItemDye.getByColor(TextColor.MAGENTA), 4), new ItemStack(ItemDye.getByColor(TextColor.BLUE)), new ItemStack(ItemDye.getByColor(TextColor.RED)), new ItemStack(ItemDye.getByColor(TextColor.RED)), new ItemStack(ItemDye.getByColor(TextColor.WHITE)));
|
||||
addShapeless(new ItemStack(ItemDye.getByColor(TextColor.LIGHT_BLUE)), Items.blue_orchid);
|
||||
addShapeless(new ItemStack(ItemDye.getByColor(TextColor.MAGENTA)), Items.allium);
|
||||
addShapeless(new ItemStack(ItemDye.getByColor(TextColor.LIGHT_GRAY)), Items.houstonia);
|
||||
addShapeless(new ItemStack(ItemDye.getByColor(TextColor.RED)), Items.red_tulip);
|
||||
addShapeless(new ItemStack(ItemDye.getByColor(TextColor.ORANGE)), Items.orange_tulip);
|
||||
addShapeless(new ItemStack(ItemDye.getByColor(TextColor.LIGHT_GRAY)), Items.white_tulip);
|
||||
addShapeless(new ItemStack(ItemDye.getByColor(TextColor.MAGENTA)), Items.pink_tulip);
|
||||
addShapeless(new ItemStack(ItemDye.getByColor(TextColor.LIGHT_GRAY)), Items.daisy);
|
||||
addShapeless(new ItemStack(ItemDye.getByColor(TextColor.YELLOW), 2), Items.sunflower);
|
||||
addShapeless(new ItemStack(ItemDye.getByColor(TextColor.MAGENTA), 2), Items.syringa);
|
||||
addShapeless(new ItemStack(ItemDye.getByColor(TextColor.RED), 2), Items.rose_bush);
|
||||
addShapeless(new ItemStack(ItemDye.getByColor(TextColor.MAGENTA), 2), Items.paeonia);
|
||||
addShapeless(new ItemStack(ItemDye.getByColor(TextColor.DARK_GREEN)), Items.cactus);
|
||||
addShapeless(new ItemStack(ItemDye.getByColor(Color.YELLOW)), Items.dandelion);
|
||||
addShapeless(new ItemStack(ItemDye.getByColor(Color.RED)), Items.rose);
|
||||
addShapeless(new ItemStack(ItemDye.getByColor(Color.RED)), Items.poppy);
|
||||
addShapeless(new ItemStack(ItemDye.getByColor(Color.WHITE), 3), Items.bone);
|
||||
addShapeless(new ItemStack(ItemDye.getByColor(Color.MAGENTA), 2), new ItemStack(ItemDye.getByColor(Color.RED)), new ItemStack(ItemDye.getByColor(Color.WHITE)));
|
||||
addShapeless(new ItemStack(ItemDye.getByColor(Color.ORANGE), 2), new ItemStack(ItemDye.getByColor(Color.RED)), new ItemStack(ItemDye.getByColor(Color.YELLOW)));
|
||||
addShapeless(new ItemStack(ItemDye.getByColor(Color.GREEN), 2), new ItemStack(ItemDye.getByColor(Color.DARK_GREEN)), new ItemStack(ItemDye.getByColor(Color.WHITE)));
|
||||
addShapeless(new ItemStack(ItemDye.getByColor(Color.GRAY), 2), new ItemStack(ItemDye.getByColor(Color.BLACK)), new ItemStack(ItemDye.getByColor(Color.WHITE)));
|
||||
addShapeless(new ItemStack(ItemDye.getByColor(Color.LIGHT_GRAY), 2), new ItemStack(ItemDye.getByColor(Color.GRAY)), new ItemStack(ItemDye.getByColor(Color.WHITE)));
|
||||
addShapeless(new ItemStack(ItemDye.getByColor(Color.LIGHT_GRAY), 3), new ItemStack(ItemDye.getByColor(Color.BLACK)), new ItemStack(ItemDye.getByColor(Color.WHITE)), new ItemStack(ItemDye.getByColor(Color.WHITE)));
|
||||
addShapeless(new ItemStack(ItemDye.getByColor(Color.LIGHT_BLUE), 2), new ItemStack(ItemDye.getByColor(Color.BLUE)), new ItemStack(ItemDye.getByColor(Color.WHITE)));
|
||||
addShapeless(new ItemStack(ItemDye.getByColor(Color.CYAN), 2), new ItemStack(ItemDye.getByColor(Color.BLUE)), new ItemStack(ItemDye.getByColor(Color.DARK_GREEN)));
|
||||
addShapeless(new ItemStack(ItemDye.getByColor(Color.VIOLET), 2), new ItemStack(ItemDye.getByColor(Color.BLUE)), new ItemStack(ItemDye.getByColor(Color.RED)));
|
||||
addShapeless(new ItemStack(ItemDye.getByColor(Color.DARK_MAGENTA), 2), new ItemStack(ItemDye.getByColor(Color.VIOLET)), new ItemStack(ItemDye.getByColor(Color.MAGENTA)));
|
||||
addShapeless(new ItemStack(ItemDye.getByColor(Color.DARK_MAGENTA), 3), new ItemStack(ItemDye.getByColor(Color.BLUE)), new ItemStack(ItemDye.getByColor(Color.RED)), new ItemStack(ItemDye.getByColor(Color.MAGENTA)));
|
||||
addShapeless(new ItemStack(ItemDye.getByColor(Color.MAGENTA), 4), new ItemStack(ItemDye.getByColor(Color.BLUE)), new ItemStack(ItemDye.getByColor(Color.RED)), new ItemStack(ItemDye.getByColor(Color.RED)), new ItemStack(ItemDye.getByColor(Color.WHITE)));
|
||||
addShapeless(new ItemStack(ItemDye.getByColor(Color.LIGHT_BLUE)), Items.blue_orchid);
|
||||
addShapeless(new ItemStack(ItemDye.getByColor(Color.MAGENTA)), Items.allium);
|
||||
addShapeless(new ItemStack(ItemDye.getByColor(Color.LIGHT_GRAY)), Items.houstonia);
|
||||
addShapeless(new ItemStack(ItemDye.getByColor(Color.RED)), Items.red_tulip);
|
||||
addShapeless(new ItemStack(ItemDye.getByColor(Color.ORANGE)), Items.orange_tulip);
|
||||
addShapeless(new ItemStack(ItemDye.getByColor(Color.LIGHT_GRAY)), Items.white_tulip);
|
||||
addShapeless(new ItemStack(ItemDye.getByColor(Color.MAGENTA)), Items.pink_tulip);
|
||||
addShapeless(new ItemStack(ItemDye.getByColor(Color.LIGHT_GRAY)), Items.daisy);
|
||||
addShapeless(new ItemStack(ItemDye.getByColor(Color.YELLOW), 2), Items.sunflower);
|
||||
addShapeless(new ItemStack(ItemDye.getByColor(Color.MAGENTA), 2), Items.syringa);
|
||||
addShapeless(new ItemStack(ItemDye.getByColor(Color.RED), 2), Items.rose_bush);
|
||||
addShapeless(new ItemStack(ItemDye.getByColor(Color.MAGENTA), 2), Items.paeonia);
|
||||
addShapeless(new ItemStack(ItemDye.getByColor(Color.DARK_GREEN)), Items.cactus);
|
||||
addShapeless(new ItemStack(ItemDye.getByColor(Color.WHITE)), Items.grinded_bones);
|
||||
addShapeless(new ItemStack(ItemDye.getByColor(Color.BROWN)), Items.cocoa_powder);
|
||||
addShapeless(new ItemStack(ItemDye.getByColor(Color.BLACK)), Items.ink_sack);
|
||||
addShapeless(new ItemStack(ItemDye.getByColor(Color.BLUE)), Items.lapis_lazuli);
|
||||
|
||||
for (TextColor color : TextColor.values())
|
||||
for (Color color : Color.values())
|
||||
{
|
||||
add(new ItemStack(BlockCarpet.getByColor(color).getItem(), 3), "##", '#', BlockWool.getByColor(color).getItem());
|
||||
}
|
||||
|
@ -230,7 +234,7 @@ public abstract class CraftingRegistry
|
|||
add(new ItemStack(Items.wooden_button, 1), "#", '#', planks);
|
||||
add(new ItemStack(Items.wooden_pressure_plate, 1), "##", '#', planks);
|
||||
add(new ItemStack(Items.piston, 1), "TTT", "#X#", "#R#", '#', Items.cobblestone, 'X', Items.iron_ingot, 'R', Items.charged_powder, 'T', planks);
|
||||
for(TextColor color : BlockBed.COLORS) {
|
||||
for(Color color : BlockBed.COLORS) {
|
||||
add(new ItemStack(ItemRegistry.byName(color.getName() + "_bed"), 1), "###", "XXX", '#', BlockWool.getByColor(color).getItem(), 'X', planks);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -36,6 +36,7 @@ import common.item.material.ItemBottle;
|
|||
import common.item.material.ItemBucket;
|
||||
import common.item.material.ItemDye;
|
||||
import common.item.material.ItemEnchantedBook;
|
||||
import common.item.material.ItemGrindedBones;
|
||||
import common.item.material.ItemHorseArmor;
|
||||
import common.item.material.ItemMetal;
|
||||
import common.item.material.ItemRecord;
|
||||
|
@ -79,7 +80,7 @@ import common.item.weapon.ItemSword;
|
|||
import common.item.weapon.ItemTrident;
|
||||
import common.log.Log;
|
||||
import common.util.Pair;
|
||||
import common.util.TextColor;
|
||||
import common.util.Color;
|
||||
import common.util.Util;
|
||||
import common.world.Weather;
|
||||
|
||||
|
@ -204,7 +205,7 @@ public abstract class ItemRegistry {
|
|||
register("green_keycard", (new ItemKey()).setDisplay("Grüne Schlüsselkarte").setTab(CheatTab.TOOLS).setMaxAmount(StackSize.L));
|
||||
register("blue_keycard", (new ItemKey()).setDisplay("Blaue Schlüsselkarte").setTab(CheatTab.TOOLS).setMaxAmount(StackSize.L));
|
||||
register("black_keycard", (new ItemKey()).setDisplay("Schwarze Schlüsselkarte").setTab(CheatTab.TOOLS).setMaxAmount(StackSize.L));
|
||||
for(Pair<Integer, TextColor> sides : ItemDie.DIE_SIDES) {
|
||||
for(Pair<Integer, Color> sides : ItemDie.DIE_SIDES) {
|
||||
register("die_" + sides.first(), (new ItemDie(sides.first(), sides.second())).setMaxAmount(StackSize.L));
|
||||
}
|
||||
register("chick_magnet", (new ItemMagnet(true)).setDisplay("Kükenmagnet"));
|
||||
|
@ -258,12 +259,8 @@ public abstract class ItemRegistry {
|
|||
register(type.getName(), (new ItemFishFood(false, type)));
|
||||
register("cooked_" + type.getName(), (new ItemFishFood(true, type)));
|
||||
}
|
||||
Item lapis = null;
|
||||
for(TextColor color : TextColor.values()) {
|
||||
Item dye = new ItemDye(color);
|
||||
if(color == TextColor.BLUE)
|
||||
lapis = dye;
|
||||
register(color.getDye(), dye);
|
||||
for(Color color : Color.values()) {
|
||||
register(color.getName() + "_dye", new ItemDye(color));
|
||||
}
|
||||
register("bone", (new Item()).setDisplay("Knochen").setTab(CheatTab.MATERIALS).setMaxAmount(StackSize.L));
|
||||
register("sugar", (new Item()).setDisplay("Zucker").setTab(CheatTab.MATERIALS).setMaxAmount(StackSize.XXL));
|
||||
|
@ -295,6 +292,11 @@ public abstract class ItemRegistry {
|
|||
register("fireball", (new ItemFireball()).setDisplay("Feuerkugel"));
|
||||
Item emerald = (new Item()).setDisplay("Smaragd").setTab(CheatTab.METALS);
|
||||
register("emerald", emerald);
|
||||
register("cocoa_powder", new Item().setTab(CheatTab.MATERIALS).setDisplay("Gemahlene Kakaobohnen").setMaxAmount(StackSize.L));
|
||||
Item lapis = new Item().setTab(CheatTab.METALS).setDisplay("Lapislazuli").setMaxAmount(StackSize.L);
|
||||
register("lapis_lazuli", lapis);
|
||||
register("grinded_bones", new ItemGrindedBones().setTab(CheatTab.MATERIALS).setDisplay("Gemahlene Knochen").setMaxAmount(StackSize.L));
|
||||
register("ink_sack", new Item().setTab(CheatTab.MATERIALS).setDisplay("Tintenbeutel").setMaxAmount(StackSize.L));
|
||||
|
||||
|
||||
register("carrot", new ItemSeedFood(3, Blocks.carrots, Blocks.farmland).setDisplay("Karotte").setMaxAmount(StackSize.L));
|
||||
|
@ -305,7 +307,7 @@ public abstract class ItemRegistry {
|
|||
register("melon_seed", new ItemSeeds(Blocks.melon_stem, Blocks.farmland).setDisplay("Melonenkerne").setMaxAmount(StackSize.XL));
|
||||
|
||||
register("whip", (new ItemWhip()).setDisplay("Peitsche"));
|
||||
register("charge_crystal", (new Item()).setDisplay("Energiekristall").setTab(CheatTab.MISC).setColor(TextColor.DARK_MAGENTA).setGleaming());
|
||||
register("charge_crystal", (new Item()).setDisplay("Energiekristall").setTab(CheatTab.MISC).setColor(Color.DARK_MAGENTA).setGleaming());
|
||||
for(Enchantment ench : Enchantment.values()) {
|
||||
register("enchanted_book_" + ench.getName(), (new ItemEnchantedBook(ench, 1)).setUnstackable().setDisplay("Verzaubertes Buch mit " + ench.getFormattedName(1)).setTab(CheatTab.ENCHANTMENTS));
|
||||
int max = ench.getMaxLevel();
|
||||
|
@ -323,7 +325,7 @@ public abstract class ItemRegistry {
|
|||
register("lead", (new ItemLead()).setDisplay("Leine").setMaxAmount(StackSize.L));
|
||||
register("name_tag", (new ItemNameTag()).setDisplay("Namensschild"));
|
||||
for(int z = 0; z < ItemDynamite.DYNAMITE.length; z++) {
|
||||
register("dynamite" + (z == 0 ? "" : ("_" + z)), (new ItemDynamite(z)).setDisplay("Dynamit" + Util.getTierSuffix(z)).setColor(TextColor.RED));
|
||||
register("dynamite" + (z == 0 ? "" : ("_" + z)), (new ItemDynamite(z)).setDisplay("Dynamit" + Util.getTierSuffix(z)).setColor(Color.RED));
|
||||
}
|
||||
register("chain", (new Item()).setDisplay("Kette").setTab(CheatTab.MATERIALS).setMagnetic());
|
||||
Item chargedPowder = (new Item()).setDisplay("Geladener Staub").setTab(CheatTab.METALS).setMagnetic();
|
||||
|
|
|
@ -23,6 +23,7 @@ import common.item.material.ItemBottle;
|
|||
import common.item.material.ItemBucket;
|
||||
import common.item.material.ItemDye;
|
||||
import common.item.material.ItemEnchantedBook;
|
||||
import common.item.material.ItemGrindedBones;
|
||||
import common.item.material.ItemHorseArmor;
|
||||
import common.item.material.ItemMetal;
|
||||
import common.item.material.ItemRecord;
|
||||
|
@ -187,7 +188,6 @@ public abstract class Items {
|
|||
public static final ItemAmmo bolt = get("bolt");
|
||||
public static final ItemBoltgun boltgun = get("boltgun");
|
||||
public static final Item bone = get("bone");
|
||||
public static final ItemDye bonemeal = get("bonemeal");
|
||||
public static final ItemBook book = get("book");
|
||||
public static final Item bookshelf = get("bookshelf");
|
||||
public static final ItemBow bow = get("bow");
|
||||
|
@ -266,7 +266,6 @@ public abstract class Items {
|
|||
public static final Item cobblestone_slab = get("cobblestone_slab");
|
||||
public static final Item cobblestone_stairs = get("cobblestone_stairs");
|
||||
public static final Item cobblestone_wall = get("cobblestone_wall");
|
||||
public static final ItemDye cocoa_powder = get("cocoa_powder");
|
||||
public static final Item construction_table = get("construction_table");
|
||||
public static final ItemFood cooked_beef = get("cooked_beef");
|
||||
public static final ItemFood cooked_chicken = get("cooked_chicken");
|
||||
|
@ -406,7 +405,6 @@ public abstract class Items {
|
|||
public static final ItemBucket hydrogen_bucket = get("hydrogen_bucket");
|
||||
public static final Item ice = get("ice");
|
||||
public static final ItemScanner scanner = get("scanner");
|
||||
public static final ItemDye ink_sack = get("ink_sack");
|
||||
public static final Item iodine_block = get("iodine_block");
|
||||
public static final Item iodine_ore = get("iodine_ore");
|
||||
public static final ItemMetal iodine_powder = get("iodine_powder");
|
||||
|
@ -442,7 +440,6 @@ public abstract class Items {
|
|||
public static final Item jungle_stairs = get("jungle_stairs");
|
||||
public static final Item ladder = get("ladder");
|
||||
public static final Item lapis_block = get("lapis_block");
|
||||
public static final ItemDye lapis_lazuli = get("lapis_lazuli");
|
||||
public static final Item lapis_ore = get("lapis_ore");
|
||||
public static final Item large_fern = get("large_fern");
|
||||
public static final Item large_tallgrass = get("large_tallgrass");
|
||||
|
@ -1066,6 +1063,14 @@ public abstract class Items {
|
|||
public static final Item violet_glass = get("violet_glass");
|
||||
public static final Item violet_glass_pane = get("violet_glass_pane");
|
||||
public static final Item violet_wool = get("violet_wool");
|
||||
public static final ItemDye white_dye = get("white_dye");
|
||||
public static final ItemDye brown_dye = get("brown_dye");
|
||||
public static final ItemDye black_dye = get("black_dye");
|
||||
public static final ItemDye blue_dye = get("blue_dye");
|
||||
public static final ItemGrindedBones grinded_bones = get("grinded_bones");
|
||||
public static final Item cocoa_powder = get("cocoa_powder");
|
||||
public static final Item ink_sack = get("ink_sack");
|
||||
public static final Item lapis_lazuli = get("lapis_lazuli");
|
||||
|
||||
private static <T extends Item> T get(String id) {
|
||||
T item = (T)ItemRegistry.byName(id);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package common.init;
|
||||
|
||||
import common.util.TextColor;
|
||||
import common.util.Color;
|
||||
|
||||
public enum MetalType {
|
||||
IRON("iron", 26, "Fe", "Eisen", 0, new ToolMaterial(2, 8.0f, 0.0f, 250, 6.0F, 2, 14, true, 15, 9, 2, 6, 5, 2).setMagnetic()),
|
||||
|
@ -87,15 +87,15 @@ public enum MetalType {
|
|||
}
|
||||
|
||||
public String formatSymbol() {
|
||||
return TextColor.YELLOW + "Element-Symbol: " + TextColor.ORANGE + this.order + " " + this.sign;
|
||||
return Color.YELLOW + "Element-Symbol: " + Color.ORANGE + this.order + " " + this.sign;
|
||||
}
|
||||
|
||||
public String formatRarity() {
|
||||
return TextColor.DARK_MAGENTA + "Seltenheit: " + TextColor.NEON + "" + (this.rarity + 1);
|
||||
return Color.DARK_MAGENTA + "Seltenheit: " + Color.NEON + "" + (this.rarity + 1);
|
||||
}
|
||||
|
||||
public String formatRadioactivity() {
|
||||
return TextColor.RED + "Radioaktivität: " + TextColor.GREEN + String.format("%.1f RN", this.radioactivity * 100.0f);
|
||||
return Color.RED + "Radioaktivität: " + Color.GREEN + String.format("%.1f RN", this.radioactivity * 100.0f);
|
||||
}
|
||||
|
||||
public boolean isMagnetic() {
|
||||
|
|
|
@ -20,7 +20,7 @@ import common.util.ExtMath;
|
|||
import common.util.Facing;
|
||||
import common.util.HitPosition;
|
||||
import common.util.Serverside;
|
||||
import common.util.TextColor;
|
||||
import common.util.Color;
|
||||
import common.util.Vec3;
|
||||
import common.world.AWorldServer;
|
||||
import common.world.World;
|
||||
|
@ -33,7 +33,7 @@ public class Item {
|
|||
private Item containerItem;
|
||||
private String display;
|
||||
private CheatTab tab;
|
||||
private TextColor color = null;
|
||||
private Color color = null;
|
||||
private int defColor = 0xffffffff;
|
||||
private boolean magnetic = false;
|
||||
private boolean gleaming = false;
|
||||
|
@ -88,7 +88,7 @@ public class Item {
|
|||
return this;
|
||||
}
|
||||
|
||||
public final Item setColor(TextColor color) {
|
||||
public final Item setColor(Color color) {
|
||||
this.color = color;
|
||||
return this;
|
||||
}
|
||||
|
@ -136,8 +136,8 @@ public class Item {
|
|||
return this.containerItem != null;
|
||||
}
|
||||
|
||||
public final TextColor getColor(ItemStack stack) {
|
||||
return this.color != null ? this.color : (stack.isItemEnchanted() ? TextColor.NEON : TextColor.WHITE);
|
||||
public final Color getColor(ItemStack stack) {
|
||||
return this.color != null ? this.color : (stack.isItemEnchanted() ? Color.NEON : Color.WHITE);
|
||||
}
|
||||
|
||||
public final CheatTab getTab() {
|
||||
|
|
|
@ -17,7 +17,7 @@ import common.init.ItemRegistry;
|
|||
import common.item.weapon.ItemBow;
|
||||
import common.rng.Random;
|
||||
import common.tags.TagObject;
|
||||
import common.util.TextColor;
|
||||
import common.util.Color;
|
||||
|
||||
public final class ItemStack {
|
||||
public static final int MAX_SIZE = 67108864;
|
||||
|
@ -232,15 +232,15 @@ public final class ItemStack {
|
|||
return this.getColor() + this.getDisplayName();
|
||||
}
|
||||
|
||||
public String getColoredName(TextColor reset) {
|
||||
return TextColor.DARK_GRAY + "[" + this.getColor() + this.getDisplayName() + TextColor.DARK_GRAY + "]" + reset;
|
||||
public String getColoredName(Color reset) {
|
||||
return Color.DARK_GRAY + "[" + this.getColor() + this.getDisplayName() + Color.DARK_GRAY + "]" + reset;
|
||||
}
|
||||
|
||||
public boolean hasDisplayName() {
|
||||
return this.name != null;
|
||||
}
|
||||
|
||||
public TextColor getColor() {
|
||||
public Color getColor() {
|
||||
return this.item.getColor(this);
|
||||
}
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ import common.effect.Effect;
|
|||
import common.effect.StatusEffect;
|
||||
import common.entity.npc.EntityNPC;
|
||||
import common.item.ItemStack;
|
||||
import common.util.TextColor;
|
||||
import common.util.Color;
|
||||
import common.world.World;
|
||||
|
||||
public class ItemAppleGold extends ItemFood
|
||||
|
@ -15,7 +15,7 @@ public class ItemAppleGold extends ItemFood
|
|||
{
|
||||
super(amount, false);
|
||||
this.powered = powered;
|
||||
this.setColor(powered ? TextColor.MAGENTA : TextColor.NEON);
|
||||
this.setColor(powered ? Color.MAGENTA : Color.NEON);
|
||||
if(this.powered)
|
||||
this.setGleaming();
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@ import common.util.Clientside;
|
|||
import common.util.Facing;
|
||||
import common.util.Pair;
|
||||
import common.util.Serverside;
|
||||
import common.util.TextColor;
|
||||
import common.util.Color;
|
||||
import common.util.Vec3;
|
||||
import common.world.AWorldServer;
|
||||
import common.world.World;
|
||||
|
@ -74,7 +74,7 @@ public class ItemPotion extends Item
|
|||
this.effect = effect;
|
||||
this.setMaxAmount(StackSize.XS);
|
||||
this.setTab(CheatTab.POTIONS);
|
||||
this.setColor(TextColor.ORK);
|
||||
this.setColor(Color.ORK);
|
||||
this.setDisplay(getDisplay(this));
|
||||
if(this.effect != null)
|
||||
this.setGleaming();
|
||||
|
@ -212,18 +212,18 @@ public class ItemPotion extends Item
|
|||
|
||||
if (potion.isBadEffect())
|
||||
{
|
||||
tooltip.add(TextColor.RED + s1);
|
||||
tooltip.add(Color.RED + s1);
|
||||
}
|
||||
else
|
||||
{
|
||||
tooltip.add(TextColor.LIGHT_GRAY + s1);
|
||||
tooltip.add(Color.LIGHT_GRAY + s1);
|
||||
}
|
||||
String effectTip = this.effect.getPotion().getTooltip(this.effect.getAmplifier());
|
||||
if(effectTip != null)
|
||||
tooltip.add(effectTip);
|
||||
}
|
||||
else if(this.type != null) {
|
||||
tooltip.add(TextColor.LIGHT_GRAY + "Wirkungslos");
|
||||
tooltip.add(Color.LIGHT_GRAY + "Wirkungslos");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@ package common.item.material;
|
|||
|
||||
import common.block.Block;
|
||||
import common.block.artificial.BlockBed;
|
||||
import common.block.foliage.IGrowable;
|
||||
import common.entity.animal.EntitySheep;
|
||||
import common.entity.npc.EntityNPC;
|
||||
import common.entity.types.EntityLiving;
|
||||
|
@ -12,43 +11,34 @@ import common.item.CheatTab;
|
|||
import common.item.Item;
|
||||
import common.item.ItemStack;
|
||||
import common.item.StackSize;
|
||||
import common.tileentity.TileEntity;
|
||||
import common.util.BlockPos;
|
||||
import common.util.Clientside;
|
||||
import common.util.Facing;
|
||||
import common.util.ParticleType;
|
||||
import common.util.Serverside;
|
||||
import common.util.TextColor;
|
||||
import common.util.Vec3;
|
||||
import common.util.Color;
|
||||
import common.world.State;
|
||||
import common.world.World;
|
||||
import common.world.AWorldServer;
|
||||
|
||||
public class ItemDye extends Item {
|
||||
private static final ItemDye[] DIES = new ItemDye[TextColor.values().length];
|
||||
private static final ItemDye[] DIES = new ItemDye[Color.values().length];
|
||||
|
||||
private final TextColor color;
|
||||
private final Color color;
|
||||
|
||||
public static ItemDye getByColor(TextColor color) {
|
||||
public static ItemDye getByColor(Color color) {
|
||||
return DIES[color.ordinal()];
|
||||
}
|
||||
|
||||
public ItemDye(TextColor color)
|
||||
public ItemDye(Color color)
|
||||
{
|
||||
this.color = color;
|
||||
this.setTab(color == TextColor.BLUE ? CheatTab.METALS : CheatTab.MATERIALS);
|
||||
this.setDisplay(color.getDyeName());
|
||||
this.setTab(CheatTab.MATERIALS);
|
||||
this.setDisplay(color.getSubject(1) + " Farbstoff");
|
||||
this.setMaxAmount(StackSize.XXL);
|
||||
DIES[this.color.ordinal()] = this;
|
||||
}
|
||||
|
||||
public TextColor getColor() {
|
||||
public Color getColor() {
|
||||
return this.color;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when a Block is right-clicked with this Item
|
||||
*/
|
||||
public boolean onItemUse(ItemStack stack, EntityNPC playerIn, World worldIn, BlockPos pos, Facing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
if (!playerIn.canPlayerEdit(pos.offset(side), side, stack))
|
||||
|
@ -57,18 +47,6 @@ public class ItemDye extends Item {
|
|||
}
|
||||
else
|
||||
{
|
||||
if (this.color == TextColor.WHITE)
|
||||
{
|
||||
if (applyBonemeal(stack, worldIn, pos))
|
||||
{
|
||||
if (!worldIn.client)
|
||||
{
|
||||
worldIn.playEffect(2005, pos, 0);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
State iblockstate = worldIn.getState(pos);
|
||||
if(iblockstate.getBlock() instanceof BlockBed) {
|
||||
Block bedBlock = BlockRegistry.byName(this.color.getName() + "_bed");
|
||||
|
@ -104,57 +82,6 @@ public class ItemDye extends Item {
|
|||
}
|
||||
}
|
||||
|
||||
public static boolean applyBonemeal(ItemStack stack, World worldIn, BlockPos target)
|
||||
{
|
||||
State iblockstate = worldIn.getState(target);
|
||||
|
||||
if (iblockstate.getBlock() instanceof IGrowable)
|
||||
{
|
||||
IGrowable igrowable = (IGrowable)iblockstate.getBlock();
|
||||
|
||||
if (igrowable.canGrow(worldIn, target, iblockstate, worldIn.client))
|
||||
{
|
||||
if (!worldIn.client)
|
||||
{
|
||||
if (igrowable.canUseBonemeal(worldIn, worldIn.rand, target, iblockstate))
|
||||
{
|
||||
igrowable.grow((AWorldServer)worldIn, worldIn.rand, target, iblockstate);
|
||||
}
|
||||
|
||||
stack.decrSize();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Clientside
|
||||
public static void spawnBonemealParticles(World worldIn, BlockPos pos, int amount)
|
||||
{
|
||||
if (amount == 0)
|
||||
{
|
||||
amount = 15;
|
||||
}
|
||||
|
||||
Block block = worldIn.getState(pos).getBlock();
|
||||
|
||||
if (block != Blocks.air)
|
||||
{
|
||||
block.setBlockBounds(worldIn, pos);
|
||||
|
||||
for (int i = 0; i < amount; ++i)
|
||||
{
|
||||
worldIn.clientParticle(ParticleType.GROW, (double)((float)pos.getX() + worldIn.rand.floatv()), (double)pos.getY() + (double)worldIn.rand.floatv() * block.getBlockBoundsMaxY(), (double)((float)pos.getZ() + worldIn.rand.floatv()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the item can be used on the given entity, e.g. shears on sheep.
|
||||
*/
|
||||
public boolean itemInteractionForEntity(ItemStack stack, EntityNPC playerIn, EntityLiving target)
|
||||
{
|
||||
if (target instanceof EntitySheep)
|
||||
|
@ -174,31 +101,4 @@ public class ItemDye extends Item {
|
|||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Serverside
|
||||
public ItemStack dispenseStack(AWorldServer world, TileEntity source, Vec3 position, BlockPos blockpos, Facing facing, ItemStack stack) {
|
||||
if(this.color != TextColor.WHITE)
|
||||
return super.dispenseStack(world, source, position, blockpos, facing, stack);
|
||||
BlockPos pos = blockpos = blockpos.offset(facing);
|
||||
|
||||
if (applyBonemeal(stack, world, pos))
|
||||
{
|
||||
if (!world.client)
|
||||
{
|
||||
world.playEffect(2005, pos, 0);
|
||||
}
|
||||
world.playEffect(1000, blockpos, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
world.playEffect(1001, blockpos, 0);
|
||||
}
|
||||
|
||||
return stack;
|
||||
}
|
||||
|
||||
@Serverside
|
||||
public int getDispenseSoundId() {
|
||||
return this.color == TextColor.WHITE ? 0 : super.getDispenseSoundId();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@ import common.item.ItemStack;
|
|||
import common.item.RngLoot;
|
||||
import common.rng.Random;
|
||||
import common.util.Clientside;
|
||||
import common.util.TextColor;
|
||||
import common.util.Color;
|
||||
|
||||
public class ItemEnchantedBook extends Item
|
||||
{
|
||||
|
@ -25,7 +25,7 @@ public class ItemEnchantedBook extends Item
|
|||
private final int level;
|
||||
|
||||
public ItemEnchantedBook(Enchantment enchantment, int level) {
|
||||
this.setColor(TextColor.YELLOW);
|
||||
this.setColor(Color.YELLOW);
|
||||
this.setGleaming();
|
||||
this.enchantment = enchantment;
|
||||
this.level = level;
|
||||
|
|
115
common/src/main/java/common/item/material/ItemGrindedBones.java
Normal file
|
@ -0,0 +1,115 @@
|
|||
package common.item.material;
|
||||
|
||||
import common.block.Block;
|
||||
import common.block.foliage.IGrowable;
|
||||
import common.entity.npc.EntityNPC;
|
||||
import common.init.Blocks;
|
||||
import common.item.Item;
|
||||
import common.item.ItemStack;
|
||||
import common.tileentity.TileEntity;
|
||||
import common.util.BlockPos;
|
||||
import common.util.Clientside;
|
||||
import common.util.Facing;
|
||||
import common.util.ParticleType;
|
||||
import common.util.Serverside;
|
||||
import common.util.Vec3;
|
||||
import common.world.State;
|
||||
import common.world.World;
|
||||
import common.world.AWorldServer;
|
||||
|
||||
public class ItemGrindedBones extends Item {
|
||||
public boolean onItemUse(ItemStack stack, EntityNPC playerIn, World worldIn, BlockPos pos, Facing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
if (!playerIn.canPlayerEdit(pos.offset(side), side, stack))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (applyBonemeal(stack, worldIn, pos))
|
||||
{
|
||||
if (!worldIn.client)
|
||||
{
|
||||
worldIn.playEffect(2005, pos, 0);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean applyBonemeal(ItemStack stack, World worldIn, BlockPos target)
|
||||
{
|
||||
State iblockstate = worldIn.getState(target);
|
||||
|
||||
if (iblockstate.getBlock() instanceof IGrowable)
|
||||
{
|
||||
IGrowable igrowable = (IGrowable)iblockstate.getBlock();
|
||||
|
||||
if (igrowable.canGrow(worldIn, target, iblockstate, worldIn.client))
|
||||
{
|
||||
if (!worldIn.client)
|
||||
{
|
||||
if (igrowable.canUseBonemeal(worldIn, worldIn.rand, target, iblockstate))
|
||||
{
|
||||
igrowable.grow((AWorldServer)worldIn, worldIn.rand, target, iblockstate);
|
||||
}
|
||||
|
||||
stack.decrSize();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Clientside
|
||||
public static void spawnParticles(World worldIn, BlockPos pos, int amount)
|
||||
{
|
||||
if (amount == 0)
|
||||
{
|
||||
amount = 15;
|
||||
}
|
||||
|
||||
Block block = worldIn.getState(pos).getBlock();
|
||||
|
||||
if (block != Blocks.air)
|
||||
{
|
||||
block.setBlockBounds(worldIn, pos);
|
||||
|
||||
for (int i = 0; i < amount; ++i)
|
||||
{
|
||||
worldIn.clientParticle(ParticleType.GROW, (double)((float)pos.getX() + worldIn.rand.floatv()), (double)pos.getY() + (double)worldIn.rand.floatv() * block.getBlockBoundsMaxY(), (double)((float)pos.getZ() + worldIn.rand.floatv()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Serverside
|
||||
public ItemStack dispenseStack(AWorldServer world, TileEntity source, Vec3 position, BlockPos blockpos, Facing facing, ItemStack stack) {
|
||||
BlockPos pos = blockpos = blockpos.offset(facing);
|
||||
|
||||
if (applyBonemeal(stack, world, pos))
|
||||
{
|
||||
if (!world.client)
|
||||
{
|
||||
world.playEffect(2005, pos, 0);
|
||||
}
|
||||
world.playEffect(1000, blockpos, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
world.playEffect(1001, blockpos, 0);
|
||||
}
|
||||
|
||||
return stack;
|
||||
}
|
||||
|
||||
@Serverside
|
||||
public int getDispenseSoundId() {
|
||||
return 0;
|
||||
}
|
||||
}
|
|
@ -9,7 +9,7 @@ import common.init.MetalType;
|
|||
import common.item.Item;
|
||||
import common.item.ItemStack;
|
||||
import common.util.Clientside;
|
||||
import common.util.TextColor;
|
||||
import common.util.Color;
|
||||
|
||||
public class ItemMetal extends Item {
|
||||
private final MetalType metal;
|
||||
|
@ -17,7 +17,7 @@ public class ItemMetal extends Item {
|
|||
public ItemMetal(MetalType metal) {
|
||||
this.metal = metal;
|
||||
if(this.metal.radioactivity > 0.0f)
|
||||
this.setColor(TextColor.GREEN);
|
||||
this.setColor(Color.GREEN);
|
||||
if(this.metal.isMagnetic())
|
||||
this.setMagnetic();
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@ import common.item.ItemStack;
|
|||
import common.util.BlockPos;
|
||||
import common.util.Facing;
|
||||
import common.util.ParticleType;
|
||||
import common.util.TextColor;
|
||||
import common.util.Color;
|
||||
import common.world.State;
|
||||
import common.world.World;
|
||||
|
||||
|
@ -22,7 +22,7 @@ public class ItemChargedOrb extends Item
|
|||
{
|
||||
this.setTab(CheatTab.MAGIC);
|
||||
this.setMaxDamage(16);
|
||||
this.setColor(TextColor.DARK_MAGENTA);
|
||||
this.setColor(Color.DARK_MAGENTA);
|
||||
this.setFragile();
|
||||
}
|
||||
|
||||
|
|
|
@ -19,25 +19,25 @@ import common.util.Clientside;
|
|||
import common.util.Facing;
|
||||
import common.util.Pair;
|
||||
import common.util.Serverside;
|
||||
import common.util.TextColor;
|
||||
import common.util.Color;
|
||||
import common.util.Vec3;
|
||||
import common.world.AWorldServer;
|
||||
import common.world.World;
|
||||
|
||||
public class ItemDie extends Item
|
||||
{
|
||||
public static final Pair<Integer, TextColor>[] DIE_SIDES = new Pair[] {
|
||||
new Pair(4, TextColor.DARK_GREEN),
|
||||
new Pair(6, TextColor.NEON),
|
||||
new Pair(8, TextColor.DARK_MAGENTA),
|
||||
new Pair(10, TextColor.MAGENTA),
|
||||
new Pair(12, TextColor.DARK_RED),
|
||||
new Pair(20, TextColor.ORANGE)
|
||||
public static final Pair<Integer, Color>[] DIE_SIDES = new Pair[] {
|
||||
new Pair(4, Color.DARK_GREEN),
|
||||
new Pair(6, Color.NEON),
|
||||
new Pair(8, Color.DARK_MAGENTA),
|
||||
new Pair(10, Color.MAGENTA),
|
||||
new Pair(12, Color.DARK_RED),
|
||||
new Pair(20, Color.ORANGE)
|
||||
};
|
||||
public static final Map<Integer, ItemDie> DICE = Maps.newTreeMap();
|
||||
|
||||
private final int sides;
|
||||
private final TextColor color;
|
||||
private final Color color;
|
||||
|
||||
public static final ItemDie getBySides(int sides) {
|
||||
ItemDie die = DICE.get(sides);
|
||||
|
@ -48,7 +48,7 @@ public class ItemDie extends Item
|
|||
return DICE.values();
|
||||
}
|
||||
|
||||
public ItemDie(int sides, TextColor color)
|
||||
public ItemDie(int sides, Color color)
|
||||
{
|
||||
this.sides = sides;
|
||||
this.color = color;
|
||||
|
@ -61,7 +61,7 @@ public class ItemDie extends Item
|
|||
return this.sides;
|
||||
}
|
||||
|
||||
public TextColor getDieColor() {
|
||||
public Color getDieColor() {
|
||||
return this.color;
|
||||
}
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ import common.util.ExtMath;
|
|||
import common.util.Facing;
|
||||
import common.util.HitPosition;
|
||||
import common.util.Serverside;
|
||||
import common.util.TextColor;
|
||||
import common.util.Color;
|
||||
import common.world.State;
|
||||
import common.world.World;
|
||||
|
||||
|
@ -67,7 +67,7 @@ public class ItemCharTemplate extends Item
|
|||
@Clientside
|
||||
public void addInformation(ItemStack stack, EntityNPC player, List<String> tooltip) {
|
||||
Dimension dim = this.spawned.species.origin == null ? null : DimensionRegistry.getDimension(this.spawned.species.origin);
|
||||
tooltip.add(TextColor.ORANGE + "Herkunft: " + (dim == null ? "???" : dim.getDisplay()));
|
||||
tooltip.add(Color.ORANGE + "Herkunft: " + (dim == null ? "???" : dim.getDisplay()));
|
||||
}
|
||||
|
||||
public boolean onItemUse(ItemStack stack, EntityNPC playerIn, World worldIn, BlockPos pos, Facing side, float hitX, float hitY, float hitZ)
|
||||
|
|
|
@ -21,7 +21,7 @@ import common.util.ExtMath;
|
|||
import common.util.Facing;
|
||||
import common.util.HitPosition;
|
||||
import common.util.Serverside;
|
||||
import common.util.TextColor;
|
||||
import common.util.Color;
|
||||
import common.world.State;
|
||||
import common.world.World;
|
||||
|
||||
|
@ -59,7 +59,7 @@ public class ItemMobTemplate extends Item
|
|||
EntityInfo egg = EntityRegistry.DNA.get(this.entityId);
|
||||
if(egg != null) {
|
||||
Dimension dim = egg.origin() == null ? null : DimensionRegistry.getDimension(egg.origin());
|
||||
tooltip.add(TextColor.ORANGE + "Herkunft: " + (dim == null ? "???" : dim.getDisplay()));
|
||||
tooltip.add(Color.ORANGE + "Herkunft: " + (dim == null ? "???" : dim.getDisplay()));
|
||||
}
|
||||
}
|
||||
|
||||
|
|