color changes
This commit is contained in:
parent
c8bb712930
commit
9e72902142
145 changed files with 667 additions and 734 deletions
|
@ -24,7 +24,6 @@ import common.collect.Lists;
|
|||
import common.collect.Maps;
|
||||
import common.collect.Sets;
|
||||
import common.collect.UnmodifiableIterator;
|
||||
import common.color.TextColor;
|
||||
import common.enchantment.EnchantmentHelper;
|
||||
import common.entity.Entity;
|
||||
import common.entity.item.EntityItem;
|
||||
|
@ -52,6 +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.vars.Vars;
|
||||
import common.world.Explosion;
|
||||
import common.world.IBlockAccess;
|
||||
|
|
|
@ -3,8 +3,6 @@ package common.block.artificial;
|
|||
import common.block.Block;
|
||||
import common.block.Rotatable;
|
||||
import common.block.Material;
|
||||
import common.color.DyeColor;
|
||||
import common.color.TextColor;
|
||||
import common.entity.npc.EntityNPC;
|
||||
import common.item.CheatTab;
|
||||
import common.item.Item;
|
||||
|
@ -21,6 +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.WorldPos;
|
||||
import common.world.AWorldServer;
|
||||
import common.world.IWorldAccess;
|
||||
|
@ -48,12 +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 DyeColor[] COLORS = new DyeColor[]
|
||||
{DyeColor.RED, DyeColor.WHITE, DyeColor.BLACK, DyeColor.PURPLE};
|
||||
public static final TextColor[] COLORS = new TextColor[] {TextColor.RED, TextColor.WHITE, TextColor.BLACK, TextColor.VIOLET};
|
||||
|
||||
private final DyeColor color;
|
||||
private final TextColor color;
|
||||
|
||||
public BlockBed(DyeColor color) {
|
||||
public BlockBed(TextColor color) {
|
||||
super(Material.BURNABLE);
|
||||
this.color = color;
|
||||
this.setDefaultState(this.getBaseState().withProperty(PART, BlockBed.EnumPartType.FOOT));
|
||||
|
@ -75,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.DGREEN + "Dein Einstiegspunkt wurde auf %s bei [%s, %s, %s] gesetzt",
|
||||
player.connection.addHotbar(TextColor.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());
|
||||
}
|
||||
|
@ -188,15 +186,15 @@ public class BlockBed extends Block implements Rotatable {
|
|||
@Clientside
|
||||
public Model getModel(ModelProvider provider, String name, State state) {
|
||||
if(state.getValue(PART) == EnumPartType.HEAD)
|
||||
return provider.getModel(this.color + "_bed_head_top").add(0, 0, 0, 16, 9, 16)
|
||||
.u().rot(90).noCull().s(this.color + "_bed_head_end").noCull()
|
||||
.w(this.color + "_bed_head_side").uv(0, 7, 16, 16).noCull().e(this.color + "_bed_head_side").uv(16, 7, 0, 16).noCull()
|
||||
return provider.getModel(this.color.getName() + "_bed_head_top").add(0, 0, 0, 16, 9, 16)
|
||||
.u().rot(90).noCull().s(this.color.getName() + "_bed_head_end").noCull()
|
||||
.w(this.color.getName() + "_bed_head_side").uv(0, 7, 16, 16).noCull().e(this.color.getName() + "_bed_head_side").uv(16, 7, 0, 16).noCull()
|
||||
.add(0, 3, 0, 16, 3, 16)
|
||||
.d("oak_planks").noCull().rotate(ModelRotation.getNorthRot(state.getValue(FACING).getOpposite()));
|
||||
else
|
||||
return provider.getModel(this.color + "_bed_foot_top").add(0, 0, 0, 16, 9, 16)
|
||||
.u().rot(90).noCull().n(this.color + "_bed_foot_end").noCull()
|
||||
.w(this.color + "_bed_foot_side").uv(0, 7, 16, 16).noCull().e(this.color + "_bed_foot_side").uv(16, 7, 0, 16).noCull()
|
||||
return provider.getModel(this.color.getName() + "_bed_foot_top").add(0, 0, 0, 16, 9, 16)
|
||||
.u().rot(90).noCull().n(this.color.getName() + "_bed_foot_end").noCull()
|
||||
.w(this.color.getName() + "_bed_foot_side").uv(0, 7, 16, 16).noCull().e(this.color.getName() + "_bed_foot_side").uv(16, 7, 0, 16).noCull()
|
||||
.add(0, 3, 0, 16, 3, 16)
|
||||
.d("oak_planks").noCull().rotate(ModelRotation.getNorthRot(state.getValue(FACING).getOpposite()));
|
||||
}
|
||||
|
|
|
@ -2,12 +2,12 @@ package common.block.artificial;
|
|||
|
||||
import common.block.Block;
|
||||
import common.block.Material;
|
||||
import common.color.DyeColor;
|
||||
import common.item.CheatTab;
|
||||
import common.model.Model;
|
||||
import common.model.Model.ModelProvider;
|
||||
import common.util.BlockPos;
|
||||
import common.util.Facing;
|
||||
import common.util.TextColor;
|
||||
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[DyeColor.values().length];
|
||||
public static final BlockCarpet[] CARPETS = new BlockCarpet[TextColor.values().length];
|
||||
|
||||
private final DyeColor color;
|
||||
private final TextColor color;
|
||||
|
||||
public static BlockCarpet getByColor(DyeColor color) {
|
||||
public static BlockCarpet getByColor(TextColor color) {
|
||||
return CARPETS[color.ordinal()];
|
||||
}
|
||||
|
||||
public BlockCarpet(DyeColor color)
|
||||
public BlockCarpet(TextColor color)
|
||||
{
|
||||
super(Material.FLEECE);
|
||||
this.color = color;
|
||||
|
@ -34,7 +34,7 @@ public class BlockCarpet extends Block
|
|||
CARPETS[color.ordinal()] = this;
|
||||
}
|
||||
|
||||
public DyeColor getColor() {
|
||||
public TextColor getColor() {
|
||||
return this.color;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,22 +1,22 @@
|
|||
package common.block.artificial;
|
||||
|
||||
import common.color.DyeColor;
|
||||
import common.util.TextColor;
|
||||
|
||||
public class BlockStainedGlass extends BlockGlass {
|
||||
public static final BlockStainedGlass[] GLASS = new BlockStainedGlass[DyeColor.values().length];
|
||||
public static final BlockStainedGlass[] GLASS = new BlockStainedGlass[TextColor.values().length];
|
||||
|
||||
private final DyeColor color;
|
||||
private final TextColor color;
|
||||
|
||||
public static BlockStainedGlass getByColor(DyeColor color) {
|
||||
public static BlockStainedGlass getByColor(TextColor color) {
|
||||
return GLASS[color.ordinal()];
|
||||
}
|
||||
|
||||
public BlockStainedGlass(DyeColor color) {
|
||||
public BlockStainedGlass(TextColor color) {
|
||||
this.color = color;
|
||||
GLASS[color.ordinal()] = this;
|
||||
}
|
||||
|
||||
public DyeColor getColor() {
|
||||
public TextColor getColor() {
|
||||
return this.color;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,21 +1,21 @@
|
|||
package common.block.artificial;
|
||||
|
||||
import common.block.Material;
|
||||
import common.color.DyeColor;
|
||||
import common.item.CheatTab;
|
||||
import common.properties.Property;
|
||||
import common.util.TextColor;
|
||||
|
||||
public class BlockStainedGlassPane extends BlockPane
|
||||
{
|
||||
public static final BlockStainedGlassPane[] PANES = new BlockStainedGlassPane[DyeColor.values().length];
|
||||
public static final BlockStainedGlassPane[] PANES = new BlockStainedGlassPane[TextColor.values().length];
|
||||
|
||||
private final DyeColor color;
|
||||
private final TextColor color;
|
||||
|
||||
public static BlockStainedGlassPane getByColor(DyeColor color) {
|
||||
public static BlockStainedGlassPane getByColor(TextColor color) {
|
||||
return PANES[color.ordinal()];
|
||||
}
|
||||
|
||||
public BlockStainedGlassPane(DyeColor color)
|
||||
public BlockStainedGlassPane(TextColor color)
|
||||
{
|
||||
super(Material.TRANSLUCENT);
|
||||
this.color = color;
|
||||
|
@ -24,7 +24,7 @@ public class BlockStainedGlassPane extends BlockPane
|
|||
PANES[color.ordinal()] = this;
|
||||
}
|
||||
|
||||
public DyeColor getColor() {
|
||||
public TextColor getColor() {
|
||||
return this.color;
|
||||
}
|
||||
|
||||
|
|
|
@ -2,22 +2,22 @@ package common.block.artificial;
|
|||
|
||||
import common.block.Block;
|
||||
import common.block.Material;
|
||||
import common.color.DyeColor;
|
||||
import common.item.CheatTab;
|
||||
import common.model.Model;
|
||||
import common.model.Model.ModelProvider;
|
||||
import common.util.TextColor;
|
||||
import common.world.State;
|
||||
|
||||
public class BlockWool extends Block {
|
||||
public static final BlockWool[] WOOLS = new BlockWool[DyeColor.values().length];
|
||||
public static final BlockWool[] WOOLS = new BlockWool[TextColor.values().length];
|
||||
|
||||
private final DyeColor color;
|
||||
private final TextColor color;
|
||||
|
||||
public static BlockWool getByColor(DyeColor color) {
|
||||
public static BlockWool getByColor(TextColor color) {
|
||||
return WOOLS[color.ordinal()];
|
||||
}
|
||||
|
||||
public BlockWool(DyeColor color) {
|
||||
public BlockWool(TextColor 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 DyeColor getColor() {
|
||||
public TextColor getColor() {
|
||||
return this.color;
|
||||
}
|
||||
|
||||
|
|
|
@ -2,29 +2,29 @@ package common.block.natural;
|
|||
|
||||
import common.block.Block;
|
||||
import common.block.Material;
|
||||
import common.color.DyeColor;
|
||||
import common.item.CheatTab;
|
||||
import common.model.Model;
|
||||
import common.model.Model.ModelProvider;
|
||||
import common.util.TextColor;
|
||||
import common.world.State;
|
||||
|
||||
public class BlockColoredClay extends Block {
|
||||
public static final BlockColoredClay[] CLAY = new BlockColoredClay[DyeColor.values().length];
|
||||
public static final BlockColoredClay[] CLAY = new BlockColoredClay[TextColor.values().length];
|
||||
|
||||
private final DyeColor color;
|
||||
private final TextColor color;
|
||||
|
||||
public static BlockColoredClay getByColor(DyeColor color) {
|
||||
public static BlockColoredClay getByColor(TextColor color) {
|
||||
return CLAY[color.ordinal()];
|
||||
}
|
||||
|
||||
public BlockColoredClay(DyeColor color) {
|
||||
public BlockColoredClay(TextColor color) {
|
||||
super(Material.SOLID);
|
||||
this.color = color;
|
||||
this.setTab(CheatTab.ROCK);
|
||||
CLAY[color.ordinal()] = this;
|
||||
}
|
||||
|
||||
public DyeColor getColor() {
|
||||
public TextColor getColor() {
|
||||
return this.color;
|
||||
}
|
||||
|
||||
|
|
|
@ -8,7 +8,6 @@ import common.block.Rotatable;
|
|||
import common.block.SoundType;
|
||||
import common.collect.Maps;
|
||||
import common.block.Material;
|
||||
import common.color.TextColor;
|
||||
import common.entity.Entity;
|
||||
import common.entity.animal.EntityCat;
|
||||
import common.entity.npc.EntityNPC;
|
||||
|
@ -30,6 +29,7 @@ import common.tileentity.TileEntityChest;
|
|||
import common.util.BlockPos;
|
||||
import common.util.BoundingBox;
|
||||
import common.util.Facing;
|
||||
import common.util.TextColor;
|
||||
import common.vars.Vars;
|
||||
import common.world.State;
|
||||
import common.world.World;
|
||||
|
|
|
@ -2,7 +2,6 @@ package common.block.tech;
|
|||
|
||||
import common.block.Block;
|
||||
import common.block.Material;
|
||||
import common.color.TextColor;
|
||||
import common.entity.item.EntityNuke;
|
||||
import common.init.Blocks;
|
||||
import common.init.SoundEvent;
|
||||
|
@ -10,6 +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.world.Explosion;
|
||||
import common.world.State;
|
||||
import common.world.World;
|
||||
|
|
|
@ -2,7 +2,6 @@ package common.block.tech;
|
|||
|
||||
import common.block.Block;
|
||||
import common.block.Material;
|
||||
import common.color.TextColor;
|
||||
import common.entity.Entity;
|
||||
import common.entity.item.EntityTnt;
|
||||
import common.entity.npc.EntityNPC;
|
||||
|
@ -21,6 +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.Vec3;
|
||||
import common.world.AWorldServer;
|
||||
import common.world.Explosion;
|
||||
|
|
|
@ -1,97 +0,0 @@
|
|||
package common.color;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import common.collect.Maps;
|
||||
import common.util.Displayable;
|
||||
import common.util.Identifyable;
|
||||
|
||||
public enum DyeColor implements Identifyable, Displayable {
|
||||
WHITE("white", "Weiß", "Weißes", "Weißer", "Weiße", "bonemeal", "Knochenmehl", 16777215, TextColor.WHITE),
|
||||
ORANGE("orange", "Orange", "Oranges", "Oranger", "Orange", null, "Oranger Farbstoff", 14188339, TextColor.ORANGE),
|
||||
MAGENTA("magenta", "Magenta", "Magenta", "Magenta", "Magenta", null, "Magenta Farbstoff", 11685080, TextColor.VIOLET),
|
||||
LIGHT_BLUE("light_blue", "Hellblau", "Hellblaues", "Hellblauer", "Hellblaue", null, "Hellblauer Farbstoff", 6724056, TextColor.BLUE),
|
||||
YELLOW("yellow", "Gelb", "Gelbes", "Gelber", "Gelbe", null, "Gelber Farbstoff", 15066419, TextColor.YELLOW),
|
||||
LIME("lime", "Hellgrün", "Hellgrünes", "Hellgrüner", "Hellgrüne", null, "Hellgrüner Farbstoff", 8375321, TextColor.GREEN),
|
||||
PINK("pink", "Rosa", "Rosa", "Rosa", "Rosa", null, "Rosa Farbstoff", 15892389, TextColor.MAGENTA),
|
||||
GRAY("gray", "Grau", "Graues", "Grauer", "Graue", null, "Grauer Farbstoff", 5000268, TextColor.GRAY),
|
||||
SILVER("silver", "Hellgrau", "Hellgraues", "Hellgrauer", "Hellgraue", null, "Hellgrauer Farbstoff", 10066329, TextColor.LGRAY),
|
||||
CYAN("cyan", "Türkis", "Türkises", "Türkiser", "Türkise", null, "Türkiser Farbstoff", 5013401, TextColor.CYAN),
|
||||
PURPLE("purple", "Violett", "Violettes", "Violetter", "Violette", null, "Violetter Farbstoff", 8339378, TextColor.DMAGENTA),
|
||||
BLUE("blue", "Blau", "Blaues", "Blauer", "Blaue", "lapis_lazuli", "Lapislazuli", 3361970, TextColor.MIDNIGHT),
|
||||
BROWN("brown", "Braun", "Braunes", "Brauner", "Braune", "cocoa_powder", "Gemahlene Kakaobohnen", 6704179, TextColor.BROWN),
|
||||
GREEN("green", "Grün", "Grünes", "Grüner", "Grüne", null, "Kaktusgrün", 6717235, TextColor.DGREEN),
|
||||
RED("red", "Rot", "Rotes", "Roter", "Rote", null, "Roter Farbstoff", 10040115, TextColor.DRED),
|
||||
BLACK("black", "Schwarz", "Schwarzes", "Schwarzer", "Schwarze", "ink_sack", "Tintenbeutel", 1644825, TextColor.BLACK);
|
||||
|
||||
private static final Map<String, DyeColor> LOOKUP = Maps.newHashMap();
|
||||
|
||||
private final String name;
|
||||
private final String display;
|
||||
private final String subject;
|
||||
private final String msubject;
|
||||
private final String fsubject;
|
||||
private final String dye;
|
||||
private final String dyeName;
|
||||
private final int color;
|
||||
private final TextColor textColor;
|
||||
|
||||
static {
|
||||
for(DyeColor color : values()) {
|
||||
LOOKUP.put(color.name, color);
|
||||
}
|
||||
}
|
||||
|
||||
public static DyeColor byName(String name) {
|
||||
DyeColor type = LOOKUP.get(name.toLowerCase());
|
||||
return type == null ? WHITE : type;
|
||||
}
|
||||
|
||||
public static DyeColor getExact(String name) {
|
||||
return LOOKUP.get(name.toLowerCase());
|
||||
}
|
||||
|
||||
private DyeColor(String name, String display, String subject, String msubject, String fsubject, String dye, String dyeName, int color, TextColor textColor) {
|
||||
this.name = name;
|
||||
this.display = display;
|
||||
this.subject = subject;
|
||||
this.msubject = msubject;
|
||||
this.fsubject = fsubject;
|
||||
this.dye = dye == null ? name + "_dye" : dye;
|
||||
this.dyeName = dyeName;
|
||||
this.color = color;
|
||||
this.textColor = textColor;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return this.name;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return this.name;
|
||||
}
|
||||
|
||||
public String getDisplay() {
|
||||
return this.display;
|
||||
}
|
||||
|
||||
public String getSubject(Integer type) {
|
||||
return type == null ? this.display : (type < 0 ? this.fsubject : (type > 0 ? this.msubject : this.subject));
|
||||
}
|
||||
|
||||
public String getDye() {
|
||||
return this.dye;
|
||||
}
|
||||
|
||||
public String getDyeName() {
|
||||
return this.dyeName;
|
||||
}
|
||||
|
||||
public int getColor() {
|
||||
return this.color;
|
||||
}
|
||||
|
||||
public TextColor getTextColor() {
|
||||
return this.textColor;
|
||||
}
|
||||
}
|
|
@ -1,100 +0,0 @@
|
|||
package common.color;
|
||||
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import common.util.Util;
|
||||
|
||||
public enum TextColor {
|
||||
NULL(0x00, "null"),
|
||||
RESET(0x01, 0, "reset", 'D'),
|
||||
CRIMSON(0x02, 0x601010, "crimson", 'C'),
|
||||
DRED(0x03, 0x7f0000, "dark_red", 'r'),
|
||||
RED(0x04, 0xcf0000, "red", 'R'),
|
||||
DBROWN(0x05, 0x56250b, "dark_brown", 'w'),
|
||||
ORANGE(0x06, 0xff7000, "orange", 'o'),
|
||||
BROWN(0x07, 0x8c5606, "brown", 'W'),
|
||||
LBROWN(0x08, 0x9c7636, "light_brown", 'l'),
|
||||
BEIGE(0x09, 0xcfcfaf, "beige", 'L'),
|
||||
NEWLINE(0x0a, "newline"),
|
||||
YELLOW(0x0b, 0xbfbf00, "yellow", 'y'),
|
||||
LYELLOW(0x0c, 0xffff7f, "light_yellow", 'Y'),
|
||||
ORK(0x0d, 0x487c00, "ork_green", 'O'),
|
||||
ACID(0x0e, 0x80ff00, "acid_green", 'a'),
|
||||
DGREEN(0x0f, 0x007f00, "dark_green", 'g'),
|
||||
GREEN(0x10, 0x00cf00, "green", 'G'),
|
||||
COMMAND(0x11, 0x00ff80, "command_green", 'd'),
|
||||
CYAN(0x12, 0x00bfbf, "cyan", 'c'),
|
||||
NEON(0x13, 0x80c0f0, "neon", 'n'),
|
||||
MIDNIGHT(0x14, 0x000080, "midnight", 'm'),
|
||||
BLUE(0x15, 0x0000cf, "blue", 'b'),
|
||||
LBLUE(0x16, 0x5f5fff, "light_blue", 'B'),
|
||||
VIOLET(0x17, 0x6000ff, "violet", 'V'),
|
||||
DVIOLET(0x18, 0x5400be, "dark_violet", 'v'),
|
||||
DMAGENTA(0x19, 0x6f006f, "dark_magenta", 'm'),
|
||||
MAGENTA(0x1a, 0xbf00bf, "magenta", 'M'),
|
||||
WHITE(0x1b, 0xffffff, "white", '4'),
|
||||
LGRAY(0x1c, 0xc0c0c0, "light_gray", '3'),
|
||||
GRAY(0x1d, 0x808080, "gray", '2'),
|
||||
DGRAY(0x1e, 0x585858, "dark_gray", '1'),
|
||||
BLACK(0x1f, 0x000000, "black", '0'),
|
||||
SPACE(0x20, "space"),
|
||||
UNKNOWN(0x7f, "unknown"),
|
||||
SGA_A(0x80, "dc_a"),
|
||||
SGA_Z(0x99, "dc_z"),
|
||||
BUG(0x9a, "bug"),
|
||||
INVALID(0x9b, "invalid"),
|
||||
DEMON(0x9c, "demon"),
|
||||
IMP(0x9d, "imp"),
|
||||
HORNS(0x9e, "horns"),
|
||||
BLKHEART(0x9f, "heart");
|
||||
|
||||
private static final Pattern STRIP_PATTERN = Pattern.compile("[\u0001\u0002\u0003\u0004\u0005\u0006\u0007\u0008\u0009\u000b\u000c\r\u000e\u000f"
|
||||
+ "\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f]");
|
||||
|
||||
private static final int[] COLORS = new int[32];
|
||||
private static final int[] SHADOW = new int[32];
|
||||
|
||||
private final String format;
|
||||
public final char code;
|
||||
public final String id;
|
||||
public final char colorId;
|
||||
public final int color;
|
||||
public final int shadow;
|
||||
|
||||
public static String stripCodes(String text) {
|
||||
return text == null ? null : STRIP_PATTERN.matcher(text).replaceAll("");
|
||||
}
|
||||
|
||||
public static int getColor(char code) {
|
||||
return code < COLORS.length ? COLORS[code] : 0x000000;
|
||||
}
|
||||
|
||||
public static int getShadow(char code) {
|
||||
return code < SHADOW.length ? SHADOW[code] : 0x000000;
|
||||
}
|
||||
|
||||
private TextColor(int code, String id) {
|
||||
this(code, 0, id, (char)0);
|
||||
}
|
||||
|
||||
private TextColor(int code, int color, String id, char colorId) {
|
||||
this.format = Character.toString(this.code = (char)code);
|
||||
this.color = color;
|
||||
this.shadow = Util.mixColor(Util.mixColor(this.color, 0x000000), 0x000000);
|
||||
this.id = id;
|
||||
this.colorId = colorId;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return this.format;
|
||||
}
|
||||
|
||||
static {
|
||||
for(TextColor color : values()) {
|
||||
if(color.code < COLORS.length) {
|
||||
COLORS[color.code] = color.color;
|
||||
SHADOW[color.code] = color.shadow;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -2,12 +2,12 @@ package common.effect;
|
|||
|
||||
import java.util.Map;
|
||||
import common.collect.Maps;
|
||||
import common.color.TextColor;
|
||||
import common.entity.DamageSource;
|
||||
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.vars.Vars;
|
||||
|
||||
public enum Effect {
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package common.entity;
|
||||
|
||||
import common.color.TextColor;
|
||||
import common.entity.projectile.EntityProjectile;
|
||||
import common.entity.types.EntityLiving;
|
||||
import common.util.TextColor;
|
||||
import common.world.Explosion;
|
||||
|
||||
public class DamageSource
|
||||
|
@ -24,13 +24,13 @@ public class DamageSource
|
|||
public static final DamageSource fall =
|
||||
(new DamageSource(TextColor.NEON, "%s fiel der Schwerkraft zum Opfer")).setDamageBypassesArmor();
|
||||
public static final DamageSource outOfWorld =
|
||||
(new DamageSource(TextColor.DGRAY, "%s fiel aus der Welt")).setDamageBypassesArmor();
|
||||
(new DamageSource(TextColor.DARK_GRAY, "%s fiel aus der Welt")).setDamageBypassesArmor();
|
||||
public static final DamageSource generic =
|
||||
(new DamageSource(TextColor.LGRAY, "%s starb")).setDamageBypassesArmor();
|
||||
(new DamageSource(TextColor.LIGHT_GRAY, "%s starb")).setDamageBypassesArmor();
|
||||
public static final DamageSource magic =
|
||||
(new DamageSource(TextColor.DMAGENTA, "%s wurde durch Magie getötet")).setDamageBypassesArmor().setMagicDamage();
|
||||
(new DamageSource(TextColor.DARK_MAGENTA, "%s wurde durch Magie getötet")).setDamageBypassesArmor().setMagicDamage();
|
||||
public static final DamageSource anvil =
|
||||
new DamageSource(TextColor.DRED, "%s wurde von einem fallenden Amboss zerquetscht");
|
||||
new DamageSource(TextColor.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");
|
||||
public static final DamageSource radiation =
|
||||
|
@ -62,8 +62,8 @@ public class DamageSource
|
|||
|
||||
public static DamageSource causeExterminatusDamage(EntityLiving mob)
|
||||
{
|
||||
return mob == null ? new DamageSource(TextColor.DRED, "%s wurde vernichtet") :
|
||||
new EntityDamageSource(TextColor.DRED, "%s wurde von %s vernichtet", "%s wurde von %s mit %s vernichtet",
|
||||
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",
|
||||
"%s vernichtet", "%s mit %s vernichtet", mob);
|
||||
}
|
||||
|
||||
|
@ -79,7 +79,7 @@ public class DamageSource
|
|||
|
||||
public static DamageSource causeThrownDamage(Entity source, Entity thrower)
|
||||
{
|
||||
return (new EntityDamageSourceIndirect(TextColor.DGREEN, "%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(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();
|
||||
}
|
||||
|
||||
public static DamageSource causeTeleFragDamage(Entity source, Entity replacer)
|
||||
|
@ -89,7 +89,7 @@ public class DamageSource
|
|||
|
||||
public static DamageSource causeIndirectMagicDamage(Entity source, Entity mage)
|
||||
{
|
||||
return (new EntityDamageSourceIndirect(TextColor.DMAGENTA, "%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(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();
|
||||
}
|
||||
|
||||
public static DamageSource causeThornsDamage(Entity source)
|
||||
|
|
|
@ -9,7 +9,6 @@ import common.block.artificial.BlockFence;
|
|||
import common.block.artificial.BlockFenceGate;
|
||||
import common.block.artificial.BlockWall;
|
||||
import common.block.liquid.BlockLiquid;
|
||||
import common.color.TextColor;
|
||||
import common.dimension.Dimension;
|
||||
import common.dimension.Space;
|
||||
import common.enchantment.Enchantment;
|
||||
|
@ -38,6 +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.Vec3;
|
||||
import common.vars.Vars;
|
||||
import common.world.Explosion;
|
||||
|
@ -2415,7 +2415,7 @@ public abstract class Entity
|
|||
|
||||
public final String getColoredName(TextColor reset)
|
||||
{
|
||||
return TextColor.DGRAY + "[" + this.getName() + TextColor.DGRAY + "]" + reset;
|
||||
return TextColor.DARK_GRAY + "[" + this.getName() + TextColor.DARK_GRAY + "]" + reset;
|
||||
}
|
||||
|
||||
// public Text formatComponent(Text comp) {
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package common.entity;
|
||||
|
||||
import common.color.TextColor;
|
||||
import common.entity.types.EntityLiving;
|
||||
import common.item.ItemStack;
|
||||
import common.util.TextColor;
|
||||
|
||||
public class EntityDamageSource extends DamageSource
|
||||
{
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package common.entity;
|
||||
|
||||
import common.color.TextColor;
|
||||
import common.entity.types.EntityLiving;
|
||||
import common.item.ItemStack;
|
||||
import common.util.TextColor;
|
||||
|
||||
public class EntityDamageSourceIndirect extends EntityDamageSource
|
||||
{
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
package common.entity.animal;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import common.ai.EntityAIEatGrass;
|
||||
import common.ai.EntityAIFollowParent;
|
||||
import common.ai.EntityAILookIdle;
|
||||
|
@ -12,8 +10,6 @@ import common.ai.EntityAITempt;
|
|||
import common.ai.EntityAIWander;
|
||||
import common.ai.EntityAIWatchClosest;
|
||||
import common.block.artificial.BlockWool;
|
||||
import common.collect.Maps;
|
||||
import common.color.DyeColor;
|
||||
import common.entity.item.EntityItem;
|
||||
import common.entity.npc.EntityNPC;
|
||||
import common.entity.types.EntityAnimal;
|
||||
|
@ -33,6 +29,7 @@ import common.rng.Random;
|
|||
import common.tags.TagObject;
|
||||
import common.util.Clientside;
|
||||
import common.util.ExtMath;
|
||||
import common.util.TextColor;
|
||||
import common.world.World;
|
||||
|
||||
public class EntitySheep extends EntityAnimal
|
||||
|
@ -48,7 +45,6 @@ public class EntitySheep extends EntityAnimal
|
|||
return false;
|
||||
}
|
||||
}, 2, 1);
|
||||
private static final Map<DyeColor, float[]> DYE_TO_RGB = Maps.newEnumMap(DyeColor.class);
|
||||
|
||||
/**
|
||||
* Used to control movement as well as wool regrowth. Set to 40 on handleHealthUpdate and counts down with each
|
||||
|
@ -57,11 +53,6 @@ public class EntitySheep extends EntityAnimal
|
|||
private int sheepTimer;
|
||||
private EntityAIEatGrass entityAIEatGrass = new EntityAIEatGrass(this);
|
||||
|
||||
public static float[] getDyeRgb(DyeColor dyeColor)
|
||||
{
|
||||
return (float[])DYE_TO_RGB.get(dyeColor);
|
||||
}
|
||||
|
||||
public EntitySheep(World worldIn)
|
||||
{
|
||||
super(worldIn);
|
||||
|
@ -109,7 +100,7 @@ public class EntitySheep extends EntityAnimal
|
|||
{
|
||||
super.entityInit();
|
||||
this.dataWatcher.addObject(16, (byte)0);
|
||||
this.dataWatcher.addObject(17, (byte)(DyeColor.WHITE.ordinal() & 255));
|
||||
this.dataWatcher.addObject(17, (byte)(TextColor.WHITE.ordinal() & 255));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -218,7 +209,7 @@ public class EntitySheep extends EntityAnimal
|
|||
{
|
||||
super.readEntity(tagCompund);
|
||||
this.setSheared(tagCompund.getBool("Sheared"));
|
||||
this.setFleeceColor(DyeColor.byName(tagCompund.getString("Color")));
|
||||
this.setFleeceColor(TextColor.byName(tagCompund.getString("Color")));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -253,15 +244,15 @@ public class EntitySheep extends EntityAnimal
|
|||
/**
|
||||
* Gets the wool color of this sheep.
|
||||
*/
|
||||
public DyeColor getFleeceColor()
|
||||
public TextColor getFleeceColor()
|
||||
{
|
||||
return DyeColor.values()[(this.dataWatcher.getWatchableObjectByte(17) & 255) % DyeColor.values().length];
|
||||
return TextColor.values()[(this.dataWatcher.getWatchableObjectByte(17) & 255) % TextColor.values().length];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the wool color of this sheep
|
||||
*/
|
||||
public void setFleeceColor(DyeColor color)
|
||||
public void setFleeceColor(TextColor color)
|
||||
{
|
||||
this.dataWatcher.updateObject(17, (byte)(color.ordinal() & 255));
|
||||
}
|
||||
|
@ -282,23 +273,23 @@ public class EntitySheep extends EntityAnimal
|
|||
this.dataWatcher.updateObject(16, (byte)(sheared ? 1 : 0));
|
||||
}
|
||||
|
||||
private static final DyeColor[] RARE_COLORS = {
|
||||
DyeColor.BLUE, DyeColor.CYAN, DyeColor.GREEN, DyeColor.LIGHT_BLUE, DyeColor.LIME,
|
||||
DyeColor.MAGENTA, DyeColor.ORANGE, DyeColor.PINK, DyeColor.PURPLE, DyeColor.RED
|
||||
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
|
||||
};
|
||||
|
||||
public static DyeColor getRandomSheepColor(Random random, float temp)
|
||||
public static TextColor getRandomSheepColor(Random random, float temp)
|
||||
{
|
||||
if(temp <= 0.0f)
|
||||
return DyeColor.WHITE;
|
||||
return TextColor.WHITE;
|
||||
int i = random.zrange(140);
|
||||
return i < 20 ? DyeColor.BLACK :
|
||||
(i < 30 ? DyeColor.GRAY :
|
||||
(i < 40 ? DyeColor.SILVER :
|
||||
(i < 70 ? DyeColor.BROWN :
|
||||
(i < 120 ? DyeColor.WHITE :
|
||||
(i < 130 ? (random.chance(10) ? RARE_COLORS[i - 120] : DyeColor.WHITE) :
|
||||
(random.chance(500) ? DyeColor.YELLOW : DyeColor.WHITE)
|
||||
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)
|
||||
)))));
|
||||
}
|
||||
|
||||
|
@ -331,14 +322,14 @@ public class EntitySheep extends EntityAnimal
|
|||
return livingdata;
|
||||
}
|
||||
|
||||
private DyeColor getDyeColorMixFromParents(EntityAnimal father, EntityAnimal mother)
|
||||
private TextColor getDyeColorMixFromParents(EntityAnimal father, EntityAnimal mother)
|
||||
{
|
||||
DyeColor i = ((EntitySheep)father).getFleeceColor();
|
||||
DyeColor j = ((EntitySheep)mother).getFleeceColor();
|
||||
TextColor i = ((EntitySheep)father).getFleeceColor();
|
||||
TextColor 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);
|
||||
DyeColor k;
|
||||
TextColor k;
|
||||
|
||||
if (itemstack != null && itemstack.getItem() instanceof ItemDye dye)
|
||||
{
|
||||
|
@ -360,24 +351,4 @@ public class EntitySheep extends EntityAnimal
|
|||
public int getColor() {
|
||||
return 0xd9d9d9;
|
||||
}
|
||||
|
||||
static
|
||||
{
|
||||
DYE_TO_RGB.put(DyeColor.WHITE, new float[] {1.0F, 1.0F, 1.0F});
|
||||
DYE_TO_RGB.put(DyeColor.ORANGE, new float[] {0.85F, 0.5F, 0.2F});
|
||||
DYE_TO_RGB.put(DyeColor.MAGENTA, new float[] {0.7F, 0.3F, 0.85F});
|
||||
DYE_TO_RGB.put(DyeColor.LIGHT_BLUE, new float[] {0.4F, 0.6F, 0.85F});
|
||||
DYE_TO_RGB.put(DyeColor.YELLOW, new float[] {0.9F, 0.9F, 0.2F});
|
||||
DYE_TO_RGB.put(DyeColor.LIME, new float[] {0.5F, 0.8F, 0.1F});
|
||||
DYE_TO_RGB.put(DyeColor.PINK, new float[] {0.95F, 0.5F, 0.65F});
|
||||
DYE_TO_RGB.put(DyeColor.GRAY, new float[] {0.3F, 0.3F, 0.3F});
|
||||
DYE_TO_RGB.put(DyeColor.SILVER, new float[] {0.6F, 0.6F, 0.6F});
|
||||
DYE_TO_RGB.put(DyeColor.CYAN, new float[] {0.3F, 0.5F, 0.6F});
|
||||
DYE_TO_RGB.put(DyeColor.PURPLE, new float[] {0.5F, 0.25F, 0.7F});
|
||||
DYE_TO_RGB.put(DyeColor.BLUE, new float[] {0.2F, 0.3F, 0.7F});
|
||||
DYE_TO_RGB.put(DyeColor.BROWN, new float[] {0.4F, 0.3F, 0.2F});
|
||||
DYE_TO_RGB.put(DyeColor.GREEN, new float[] {0.4F, 0.5F, 0.2F});
|
||||
DYE_TO_RGB.put(DyeColor.RED, new float[] {0.6F, 0.2F, 0.2F});
|
||||
DYE_TO_RGB.put(DyeColor.BLACK, new float[] {0.1F, 0.1F, 0.1F});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,7 +15,6 @@ import common.ai.EntityAISwimming;
|
|||
import common.ai.EntityAITargetNonTamed;
|
||||
import common.ai.EntityAIWander;
|
||||
import common.ai.EntityAIWatchClosest;
|
||||
import common.color.DyeColor;
|
||||
import common.entity.DamageSource;
|
||||
import common.entity.Entity;
|
||||
import common.entity.npc.Alignment;
|
||||
|
@ -34,6 +33,7 @@ import common.tags.TagObject;
|
|||
import common.util.Clientside;
|
||||
import common.util.ExtMath;
|
||||
import common.util.ParticleType;
|
||||
import common.util.TextColor;
|
||||
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)(DyeColor.RED.ordinal() & 255));
|
||||
this.dataWatcher.addObject(20, (byte)(TextColor.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(DyeColor.byName(tagCompund.getString("CollarColor")));
|
||||
this.setCollarColor(TextColor.byName(tagCompund.getString("CollarColor")));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -373,7 +373,7 @@ public class EntityWolf extends EntityTameable
|
|||
}
|
||||
else if (itemstack.getItem() instanceof ItemDye dye)
|
||||
{
|
||||
DyeColor enumdyecolor = dye.getColor();
|
||||
TextColor enumdyecolor = dye.getColor();
|
||||
|
||||
if (enumdyecolor != this.getCollarColor())
|
||||
{
|
||||
|
@ -492,12 +492,12 @@ public class EntityWolf extends EntityTameable
|
|||
}
|
||||
}
|
||||
|
||||
public DyeColor getCollarColor()
|
||||
public TextColor getCollarColor()
|
||||
{
|
||||
return DyeColor.values()[(this.dataWatcher.getWatchableObjectByte(20) & 255) % DyeColor.values().length];
|
||||
return TextColor.values()[(this.dataWatcher.getWatchableObjectByte(20) & 255) % TextColor.values().length];
|
||||
}
|
||||
|
||||
public void setCollarColor(DyeColor collarcolor)
|
||||
public void setCollarColor(TextColor collarcolor)
|
||||
{
|
||||
this.dataWatcher.updateObject(20, (byte)(collarcolor.ordinal() & 255));
|
||||
}
|
||||
|
@ -593,12 +593,7 @@ public class EntityWolf extends EntityTameable
|
|||
}
|
||||
|
||||
public int getLeashColor() {
|
||||
if(this.isTamed()) {
|
||||
DyeColor color = this.getCollarColor();
|
||||
float[] rgb = EntitySheep.getDyeRgb(color);
|
||||
return (((int)(rgb[0] * 255.0f)) << 16) | (((int)(rgb[1] * 255.0f)) << 8) | ((int)(rgb[2] * 255.0f));
|
||||
}
|
||||
return super.getLeashColor();
|
||||
return this.isTamed() ? this.getCollarColor().getColor() : super.getLeashColor();
|
||||
}
|
||||
|
||||
public int getColor() {
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package common.entity.item;
|
||||
|
||||
import common.block.Material;
|
||||
import common.color.TextColor;
|
||||
import common.dimension.Dimension;
|
||||
import common.entity.DamageSource;
|
||||
import common.entity.Entity;
|
||||
|
@ -19,6 +18,7 @@ import common.util.BlockPos;
|
|||
import common.util.ExtMath;
|
||||
import common.util.ParticleType;
|
||||
import common.util.PortalType;
|
||||
import common.util.TextColor;
|
||||
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.DGREEN + "" + stack.getSize();
|
||||
return TextColor.DARK_GREEN + "" + stack.getSize();
|
||||
}
|
||||
|
||||
public EntityType getType() {
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package common.entity.item;
|
||||
|
||||
import common.block.Material;
|
||||
import common.color.TextColor;
|
||||
import common.dimension.Dimension;
|
||||
import common.entity.DamageSource;
|
||||
import common.entity.Entity;
|
||||
|
@ -15,6 +14,7 @@ import common.util.Clientside;
|
|||
import common.util.ExtMath;
|
||||
import common.util.ParticleType;
|
||||
import common.util.PortalType;
|
||||
import common.util.TextColor;
|
||||
import common.vars.Vars;
|
||||
import common.world.World;
|
||||
|
||||
|
|
|
@ -3,18 +3,18 @@ package common.entity.npc;
|
|||
import java.util.Map;
|
||||
|
||||
import common.collect.Maps;
|
||||
import common.color.TextColor;
|
||||
import common.util.TextColor;
|
||||
|
||||
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.LGRAY),
|
||||
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.DRED);
|
||||
CHAOTIC_EVIL("cevil", "Chaotisch böse", -1, -1, TextColor.DARK_RED);
|
||||
|
||||
private static final Map<String, Alignment> LOOKUP = Maps.newHashMap();
|
||||
|
||||
|
@ -35,9 +35,9 @@ public enum Alignment {
|
|||
this.color = color;
|
||||
this.name = name;
|
||||
this.display = display;
|
||||
this.prefix = TextColor.GRAY + "[" + (temper == 0 && morale == 0 ? TextColor.LGRAY + "~" : "") +
|
||||
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.DMAGENTA + "-" : "")) +
|
||||
(this.lawful ? TextColor.GREEN + "+" : (this.chaotic ? TextColor.DARK_MAGENTA + "-" : "")) +
|
||||
TextColor.GRAY + "]";
|
||||
}
|
||||
|
||||
|
|
|
@ -24,7 +24,6 @@ import common.attributes.UsageSlot;
|
|||
import common.block.Block;
|
||||
import common.block.artificial.BlockBed;
|
||||
import common.collect.Lists;
|
||||
import common.color.TextColor;
|
||||
import common.dimension.Dimension;
|
||||
import common.dimension.Space;
|
||||
import common.effect.Effect;
|
||||
|
@ -93,6 +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.Vec3;
|
||||
import common.util.WorldPos;
|
||||
import common.vars.Vars;
|
||||
|
|
|
@ -19,7 +19,6 @@ import common.block.Block;
|
|||
import common.block.SoundType;
|
||||
import common.collect.Lists;
|
||||
import common.collect.Maps;
|
||||
import common.color.TextColor;
|
||||
import common.effect.Effect;
|
||||
import common.effect.StatusEffect;
|
||||
import common.enchantment.EnchantmentHelper;
|
||||
|
@ -58,6 +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.Vec3;
|
||||
import common.vars.Vars;
|
||||
import common.world.State;
|
||||
|
@ -2245,13 +2245,13 @@ public abstract class EntityLiving extends Entity
|
|||
|
||||
public static TextColor getHealthColor(int health, int max) {
|
||||
float perc = (float)health / (float)max;
|
||||
return /* health <= 1.0f ? ChatFormat.DARK_RED : ( */ perc >= 1.0f ? TextColor.DGREEN : (perc >= 0.75f ? TextColor.GREEN :
|
||||
(perc >= 0.5f ? TextColor.YELLOW : (perc >= 0.25f ? TextColor.ORANGE : (perc >= 0.1f ? TextColor.RED : TextColor.DRED))));
|
||||
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))));
|
||||
}
|
||||
|
||||
public static TextColor getMaxHpColor(int max) {
|
||||
return max >= 2000 ? TextColor.BLACK : (max >= 500 ? TextColor.DMAGENTA : (max >= 120 ? TextColor.MAGENTA :
|
||||
(max >= 40 ? TextColor.CYAN : (max >= 15 ? TextColor.NEON : (max >= 5 ? TextColor.BLUE : TextColor.LGRAY)))));
|
||||
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 int getEnergy(Energy type) {
|
||||
|
@ -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.LGRAY)) : null;
|
||||
msg = kill = natural ? String.format("%s starb", this.getColoredName(TextColor.LIGHT_GRAY)) : null;
|
||||
}
|
||||
else {
|
||||
CombatEntry strong = null;
|
||||
|
|
|
@ -129,12 +129,12 @@ import common.collect.BiMap;
|
|||
import common.collect.HashBiMap;
|
||||
import common.collect.Lists;
|
||||
import common.collect.Maps;
|
||||
import common.color.DyeColor;
|
||||
import common.item.CheatTab;
|
||||
import common.log.Log;
|
||||
import common.model.TextureAnimation;
|
||||
import common.properties.Property;
|
||||
import common.util.PortalType;
|
||||
import common.util.TextColor;
|
||||
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(DyeColor color : DyeColor.values()) {
|
||||
for(TextColor color : TextColor.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(DyeColor color : DyeColor.values()) {
|
||||
for(TextColor color : TextColor.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(DyeColor color : DyeColor.values()) {
|
||||
for(TextColor color : TextColor.values()) {
|
||||
register(color.getName() + "_glass_pane", (new BlockStainedGlassPane(color)).setHardness(0.3F).setSound(SoundType.GLASS).setDisplay(color.getDisplay() + " gefärbte Glasscheibe"));
|
||||
}
|
||||
|
||||
|
||||
for(DyeColor color : DyeColor.values()) {
|
||||
for(TextColor color : TextColor.values()) {
|
||||
register(color.getName() + "_wool", (new BlockWool(color)).setHardness(0.8F).setSound(SoundType.CLOTH).setDisplay(color.getSubject(-1) + " Wolle")
|
||||
.setShearsEfficiency(1));
|
||||
}
|
||||
for(DyeColor color : DyeColor.values()) {
|
||||
for(TextColor color : TextColor.values()) {
|
||||
register(color.getName() + "_carpet", (new BlockCarpet(color)).setHardness(0.1F).setSound(SoundType.CLOTH).setDisplay(color.getSubject(1) + " Teppich").setOpacity(0));
|
||||
}
|
||||
for(DyeColor color : BlockBed.COLORS) {
|
||||
for(TextColor color : BlockBed.COLORS) {
|
||||
register(color.getName() + "_bed", (new BlockBed(color)).setSound(SoundType.WOOD).setHardness(0.2F).setDisplay(color.getSubject(0) + " Bett"));
|
||||
}
|
||||
|
||||
|
|
|
@ -297,11 +297,6 @@ public abstract class Blocks {
|
|||
public static final BlockStainedGlassPane light_blue_glass_pane = get("light_blue_glass_pane");
|
||||
public static final BlockWool light_blue_wool = get("light_blue_wool");
|
||||
public static final BlockPressurePlateWeighted light_weighted_pressure_plate = get("light_weighted_pressure_plate");
|
||||
public static final BlockCarpet lime_carpet = get("lime_carpet");
|
||||
public static final BlockColoredClay lime_clay = get("lime_clay");
|
||||
public static final BlockStainedGlass lime_glass = get("lime_glass");
|
||||
public static final BlockStainedGlassPane lime_glass_pane = get("lime_glass_pane");
|
||||
public static final BlockWool lime_wool = get("lime_wool");
|
||||
public static final BlockFurnace lit_furnace = get("lit_furnace");
|
||||
public static final BlockMetalBlock lithium_block = get("lithium_block");
|
||||
public static final BlockMetalOre lithium_ore = get("lithium_ore");
|
||||
|
@ -375,12 +370,7 @@ public abstract class Blocks {
|
|||
public static final Block pentagram = get("pentagram");
|
||||
public static final BlockMetalBlock phosphor_block = get("phosphor_block");
|
||||
public static final BlockMetalOre phosphor_ore = get("phosphor_ore");
|
||||
public static final BlockCarpet pink_carpet = get("pink_carpet");
|
||||
public static final BlockColoredClay pink_clay = get("pink_clay");
|
||||
public static final BlockStainedGlass pink_glass = get("pink_glass");
|
||||
public static final BlockStainedGlassPane pink_glass_pane = get("pink_glass_pane");
|
||||
public static final BlockFlower pink_tulip = get("pink_tulip");
|
||||
public static final BlockWool pink_wool = get("pink_wool");
|
||||
public static final BlockPistonBase piston = get("piston");
|
||||
public static final BlockPistonHead piston_head = get("piston_head");
|
||||
public static final BlockPistonHead sticky_piston_head = get("sticky_piston_head");
|
||||
|
@ -398,12 +388,6 @@ public abstract class Blocks {
|
|||
public static final BlockMetalOre praseodymium_ore = get("praseodymium_ore");
|
||||
public static final BlockPumpkin pumpkin = get("pumpkin");
|
||||
public static final BlockStem pumpkin_stem = get("pumpkin_stem");
|
||||
public static final BlockBed purple_bed = get("purple_bed");
|
||||
public static final BlockCarpet purple_carpet = get("purple_carpet");
|
||||
public static final BlockColoredClay purple_clay = get("purple_clay");
|
||||
public static final BlockStainedGlass purple_glass = get("purple_glass");
|
||||
public static final BlockStainedGlassPane purple_glass_pane = get("purple_glass_pane");
|
||||
public static final BlockWool purple_wool = get("purple_wool");
|
||||
public static final BlockQuartz quartz_block = get("quartz_block");
|
||||
public static final BlockOre quartz_ore = get("quartz_ore");
|
||||
public static final BlockQuartz quartz_ornaments = get("quartz_ornaments");
|
||||
|
@ -442,12 +426,7 @@ public abstract class Blocks {
|
|||
public static final BlockMetalBlock silicon_block = get("silicon_block");
|
||||
public static final BlockMetalOre silicon_ore = get("silicon_ore");
|
||||
public static final BlockMetalBlock silver_block = get("silver_block");
|
||||
public static final BlockCarpet silver_carpet = get("silver_carpet");
|
||||
public static final BlockColoredClay silver_clay = get("silver_clay");
|
||||
public static final BlockStainedGlass silver_glass = get("silver_glass");
|
||||
public static final BlockStainedGlassPane silver_glass_pane = get("silver_glass_pane");
|
||||
public static final BlockMetalOre silver_ore = get("silver_ore");
|
||||
public static final BlockWool silver_wool = get("silver_wool");
|
||||
public static final BlockSkull skull = get("skull");
|
||||
public static final BlockStaticLiquid slime = get("slime");
|
||||
public static final BlockSlime slime_block = get("slime_block");
|
||||
|
@ -617,6 +596,87 @@ public abstract class Blocks {
|
|||
public static final BlockPortal shining_portal = get("shining_portal");
|
||||
public static final BlockStaticLiquid milk = get("milk");
|
||||
public static final BlockDynamicLiquid flowing_milk = get("flowing_milk");
|
||||
public static final BlockCarpet acid_green_carpet = get("acid_green_carpet");
|
||||
public static final BlockColoredClay acid_green_clay = get("acid_green_clay");
|
||||
public static final BlockStainedGlass acid_green_glass = get("acid_green_glass");
|
||||
public static final BlockStainedGlassPane acid_green_glass_pane = get("acid_green_glass_pane");
|
||||
public static final BlockWool acid_green_wool = get("acid_green_wool");
|
||||
public static final BlockCarpet beige_carpet = get("beige_carpet");
|
||||
public static final BlockColoredClay beige_clay = get("beige_clay");
|
||||
public static final BlockStainedGlass beige_glass = get("beige_glass");
|
||||
public static final BlockStainedGlassPane beige_glass_pane = get("beige_glass_pane");
|
||||
public static final BlockWool beige_wool = get("beige_wool");
|
||||
public static final BlockCarpet crimson_carpet = get("crimson_carpet");
|
||||
public static final BlockColoredClay crimson_clay = get("crimson_clay");
|
||||
public static final BlockStainedGlass crimson_glass = get("crimson_glass");
|
||||
public static final BlockStainedGlassPane crimson_glass_pane = get("crimson_glass_pane");
|
||||
public static final BlockWool crimson_wool = get("crimson_wool");
|
||||
public static final BlockCarpet dark_brown_carpet = get("dark_brown_carpet");
|
||||
public static final BlockColoredClay dark_brown_clay = get("dark_brown_clay");
|
||||
public static final BlockStainedGlass dark_brown_glass = get("dark_brown_glass");
|
||||
public static final BlockStainedGlassPane dark_brown_glass_pane = get("dark_brown_glass_pane");
|
||||
public static final BlockWool dark_brown_wool = get("dark_brown_wool");
|
||||
public static final BlockCarpet dark_gray_carpet = get("dark_gray_carpet");
|
||||
public static final BlockColoredClay dark_gray_clay = get("dark_gray_clay");
|
||||
public static final BlockStainedGlass dark_gray_glass = get("dark_gray_glass");
|
||||
public static final BlockStainedGlassPane dark_gray_glass_pane = get("dark_gray_glass_pane");
|
||||
public static final BlockWool dark_gray_wool = get("dark_gray_wool");
|
||||
public static final BlockCarpet dark_green_carpet = get("dark_green_carpet");
|
||||
public static final BlockColoredClay dark_green_clay = get("dark_green_clay");
|
||||
public static final BlockStainedGlass dark_green_glass = get("dark_green_glass");
|
||||
public static final BlockStainedGlassPane dark_green_glass_pane = get("dark_green_glass_pane");
|
||||
public static final BlockWool dark_green_wool = get("dark_green_wool");
|
||||
public static final BlockCarpet dark_magenta_carpet = get("dark_magenta_carpet");
|
||||
public static final BlockColoredClay dark_magenta_clay = get("dark_magenta_clay");
|
||||
public static final BlockStainedGlass dark_magenta_glass = get("dark_magenta_glass");
|
||||
public static final BlockStainedGlassPane dark_magenta_glass_pane = get("dark_magenta_glass_pane");
|
||||
public static final BlockWool dark_magenta_wool = get("dark_magenta_wool");
|
||||
public static final BlockCarpet dark_red_carpet = get("dark_red_carpet");
|
||||
public static final BlockColoredClay dark_red_clay = get("dark_red_clay");
|
||||
public static final BlockStainedGlass dark_red_glass = get("dark_red_glass");
|
||||
public static final BlockStainedGlassPane dark_red_glass_pane = get("dark_red_glass_pane");
|
||||
public static final BlockWool dark_red_wool = get("dark_red_wool");
|
||||
public static final BlockCarpet dark_violet_carpet = get("dark_violet_carpet");
|
||||
public static final BlockColoredClay dark_violet_clay = get("dark_violet_clay");
|
||||
public static final BlockStainedGlass dark_violet_glass = get("dark_violet_glass");
|
||||
public static final BlockStainedGlassPane dark_violet_glass_pane = get("dark_violet_glass_pane");
|
||||
public static final BlockWool dark_violet_wool = get("dark_violet_wool");
|
||||
public static final BlockCarpet light_brown_carpet = get("light_brown_carpet");
|
||||
public static final BlockColoredClay light_brown_clay = get("light_brown_clay");
|
||||
public static final BlockStainedGlass light_brown_glass = get("light_brown_glass");
|
||||
public static final BlockStainedGlassPane light_brown_glass_pane = get("light_brown_glass_pane");
|
||||
public static final BlockWool light_brown_wool = get("light_brown_wool");
|
||||
public static final BlockCarpet light_gray_carpet = get("light_gray_carpet");
|
||||
public static final BlockColoredClay light_gray_clay = get("light_gray_clay");
|
||||
public static final BlockStainedGlass light_gray_glass = get("light_gray_glass");
|
||||
public static final BlockStainedGlassPane light_gray_glass_pane = get("light_gray_glass_pane");
|
||||
public static final BlockWool light_gray_wool = get("light_gray_wool");
|
||||
public static final BlockCarpet light_yellow_carpet = get("light_yellow_carpet");
|
||||
public static final BlockColoredClay light_yellow_clay = get("light_yellow_clay");
|
||||
public static final BlockStainedGlass light_yellow_glass = get("light_yellow_glass");
|
||||
public static final BlockStainedGlassPane light_yellow_glass_pane = get("light_yellow_glass_pane");
|
||||
public static final BlockWool light_yellow_wool = get("light_yellow_wool");
|
||||
public static final BlockCarpet midnight_carpet = get("midnight_carpet");
|
||||
public static final BlockColoredClay midnight_clay = get("midnight_clay");
|
||||
public static final BlockStainedGlass midnight_glass = get("midnight_glass");
|
||||
public static final BlockStainedGlassPane midnight_glass_pane = get("midnight_glass_pane");
|
||||
public static final BlockWool midnight_wool = get("midnight_wool");
|
||||
public static final BlockCarpet neon_carpet = get("neon_carpet");
|
||||
public static final BlockColoredClay neon_clay = get("neon_clay");
|
||||
public static final BlockStainedGlass neon_glass = get("neon_glass");
|
||||
public static final BlockStainedGlassPane neon_glass_pane = get("neon_glass_pane");
|
||||
public static final BlockWool neon_wool = get("neon_wool");
|
||||
public static final BlockCarpet ork_green_carpet = get("ork_green_carpet");
|
||||
public static final BlockColoredClay ork_green_clay = get("ork_green_clay");
|
||||
public static final BlockStainedGlass ork_green_glass = get("ork_green_glass");
|
||||
public static final BlockStainedGlassPane ork_green_glass_pane = get("ork_green_glass_pane");
|
||||
public static final BlockWool ork_green_wool = get("ork_green_wool");
|
||||
public static final BlockBed violet_bed = get("violet_bed");
|
||||
public static final BlockCarpet violet_carpet = get("violet_carpet");
|
||||
public static final BlockColoredClay violet_clay = get("violet_clay");
|
||||
public static final BlockStainedGlass violet_glass = get("violet_glass");
|
||||
public static final BlockStainedGlassPane violet_glass_pane = get("violet_glass_pane");
|
||||
public static final BlockWool violet_wool = get("violet_wool");
|
||||
|
||||
private static <T extends Block> T get(String id) {
|
||||
T block = (T)BlockRegistry.byNameExact(id);
|
||||
|
|
|
@ -14,12 +14,11 @@ import common.block.artificial.BlockWool;
|
|||
import common.block.natural.BlockColoredClay;
|
||||
import common.collect.Lists;
|
||||
import common.collect.Maps;
|
||||
import common.color.DyeColor;
|
||||
import common.entity.animal.EntitySheep;
|
||||
import common.inventory.InventoryCrafting;
|
||||
import common.item.Item;
|
||||
import common.item.ItemStack;
|
||||
import common.item.material.ItemDye;
|
||||
import common.util.TextColor;
|
||||
|
||||
public abstract class CraftingRegistry
|
||||
{
|
||||
|
@ -157,47 +156,47 @@ 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 (DyeColor color : DyeColor.values())
|
||||
for (TextColor color : TextColor.values())
|
||||
{
|
||||
ItemDye dye = ItemDye.getByColor(color);
|
||||
if(color != DyeColor.WHITE)
|
||||
if(color != TextColor.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(DyeColor.YELLOW)), Items.dandelion);
|
||||
addShapeless(new ItemStack(ItemDye.getByColor(DyeColor.RED)), Items.rose);
|
||||
addShapeless(new ItemStack(ItemDye.getByColor(DyeColor.RED)), Items.poppy);
|
||||
addShapeless(new ItemStack(ItemDye.getByColor(DyeColor.WHITE), 3), Items.bone);
|
||||
addShapeless(new ItemStack(ItemDye.getByColor(DyeColor.PINK), 2), new ItemStack(ItemDye.getByColor(DyeColor.RED)), new ItemStack(ItemDye.getByColor(DyeColor.WHITE)));
|
||||
addShapeless(new ItemStack(ItemDye.getByColor(DyeColor.ORANGE), 2), new ItemStack(ItemDye.getByColor(DyeColor.RED)), new ItemStack(ItemDye.getByColor(DyeColor.YELLOW)));
|
||||
addShapeless(new ItemStack(ItemDye.getByColor(DyeColor.LIME), 2), new ItemStack(ItemDye.getByColor(DyeColor.GREEN)), new ItemStack(ItemDye.getByColor(DyeColor.WHITE)));
|
||||
addShapeless(new ItemStack(ItemDye.getByColor(DyeColor.GRAY), 2), new ItemStack(ItemDye.getByColor(DyeColor.BLACK)), new ItemStack(ItemDye.getByColor(DyeColor.WHITE)));
|
||||
addShapeless(new ItemStack(ItemDye.getByColor(DyeColor.SILVER), 2), new ItemStack(ItemDye.getByColor(DyeColor.GRAY)), new ItemStack(ItemDye.getByColor(DyeColor.WHITE)));
|
||||
addShapeless(new ItemStack(ItemDye.getByColor(DyeColor.SILVER), 3), new ItemStack(ItemDye.getByColor(DyeColor.BLACK)), new ItemStack(ItemDye.getByColor(DyeColor.WHITE)), new ItemStack(ItemDye.getByColor(DyeColor.WHITE)));
|
||||
addShapeless(new ItemStack(ItemDye.getByColor(DyeColor.LIGHT_BLUE), 2), new ItemStack(ItemDye.getByColor(DyeColor.BLUE)), new ItemStack(ItemDye.getByColor(DyeColor.WHITE)));
|
||||
addShapeless(new ItemStack(ItemDye.getByColor(DyeColor.CYAN), 2), new ItemStack(ItemDye.getByColor(DyeColor.BLUE)), new ItemStack(ItemDye.getByColor(DyeColor.GREEN)));
|
||||
addShapeless(new ItemStack(ItemDye.getByColor(DyeColor.PURPLE), 2), new ItemStack(ItemDye.getByColor(DyeColor.BLUE)), new ItemStack(ItemDye.getByColor(DyeColor.RED)));
|
||||
addShapeless(new ItemStack(ItemDye.getByColor(DyeColor.MAGENTA), 2), new ItemStack(ItemDye.getByColor(DyeColor.PURPLE)), new ItemStack(ItemDye.getByColor(DyeColor.PINK)));
|
||||
addShapeless(new ItemStack(ItemDye.getByColor(DyeColor.MAGENTA), 3), new ItemStack(ItemDye.getByColor(DyeColor.BLUE)), new ItemStack(ItemDye.getByColor(DyeColor.RED)), new ItemStack(ItemDye.getByColor(DyeColor.PINK)));
|
||||
addShapeless(new ItemStack(ItemDye.getByColor(DyeColor.MAGENTA), 4), new ItemStack(ItemDye.getByColor(DyeColor.BLUE)), new ItemStack(ItemDye.getByColor(DyeColor.RED)), new ItemStack(ItemDye.getByColor(DyeColor.RED)), new ItemStack(ItemDye.getByColor(DyeColor.WHITE)));
|
||||
addShapeless(new ItemStack(ItemDye.getByColor(DyeColor.LIGHT_BLUE)), Items.blue_orchid);
|
||||
addShapeless(new ItemStack(ItemDye.getByColor(DyeColor.MAGENTA)), Items.allium);
|
||||
addShapeless(new ItemStack(ItemDye.getByColor(DyeColor.SILVER)), Items.houstonia);
|
||||
addShapeless(new ItemStack(ItemDye.getByColor(DyeColor.RED)), Items.red_tulip);
|
||||
addShapeless(new ItemStack(ItemDye.getByColor(DyeColor.ORANGE)), Items.orange_tulip);
|
||||
addShapeless(new ItemStack(ItemDye.getByColor(DyeColor.SILVER)), Items.white_tulip);
|
||||
addShapeless(new ItemStack(ItemDye.getByColor(DyeColor.PINK)), Items.pink_tulip);
|
||||
addShapeless(new ItemStack(ItemDye.getByColor(DyeColor.SILVER)), Items.daisy);
|
||||
addShapeless(new ItemStack(ItemDye.getByColor(DyeColor.YELLOW), 2), Items.sunflower);
|
||||
addShapeless(new ItemStack(ItemDye.getByColor(DyeColor.MAGENTA), 2), Items.syringa);
|
||||
addShapeless(new ItemStack(ItemDye.getByColor(DyeColor.RED), 2), Items.rose_bush);
|
||||
addShapeless(new ItemStack(ItemDye.getByColor(DyeColor.PINK), 2), Items.paeonia);
|
||||
addShapeless(new ItemStack(ItemDye.getByColor(DyeColor.GREEN)), Items.cactus);
|
||||
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);
|
||||
|
||||
for (DyeColor color : DyeColor.values())
|
||||
for (TextColor color : TextColor.values())
|
||||
{
|
||||
add(new ItemStack(BlockCarpet.getByColor(color).getItem(), 3), "##", '#', BlockWool.getByColor(color).getItem());
|
||||
}
|
||||
|
@ -231,7 +230,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(DyeColor color : BlockBed.COLORS) {
|
||||
for(TextColor color : BlockBed.COLORS) {
|
||||
add(new ItemStack(ItemRegistry.byName(color.getName() + "_bed"), 1), "###", "XXX", '#', BlockWool.getByColor(color).getItem(), 'X', planks);
|
||||
}
|
||||
}
|
||||
|
@ -685,10 +684,10 @@ public abstract class CraftingRegistry
|
|||
return null;
|
||||
}
|
||||
|
||||
float[] afloat = EntitySheep.getDyeRgb(dye.getColor());
|
||||
int l1 = (int)(afloat[0] * 255.0F);
|
||||
int i2 = (int)(afloat[1] * 255.0F);
|
||||
int j2 = (int)(afloat[2] * 255.0F);
|
||||
int afloat = dye.getColor().getColor();
|
||||
int l1 = (afloat >> 16) & 0xff;
|
||||
int i2 = (afloat >> 8) & 0xff;
|
||||
int j2 = afloat & 0xff;
|
||||
i += Math.max(l1, Math.max(i2, j2));
|
||||
aint[0] += l1;
|
||||
aint[1] += i2;
|
||||
|
|
|
@ -15,8 +15,6 @@ import common.block.natural.BlockOre;
|
|||
import common.collect.BiMap;
|
||||
import common.collect.HashBiMap;
|
||||
import common.collect.Lists;
|
||||
import common.color.DyeColor;
|
||||
import common.color.TextColor;
|
||||
import common.effect.Effect;
|
||||
import common.effect.StatusEffect;
|
||||
import common.enchantment.Enchantment;
|
||||
|
@ -81,6 +79,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.Util;
|
||||
import common.world.Weather;
|
||||
|
||||
|
@ -260,9 +259,9 @@ public abstract class ItemRegistry {
|
|||
register("cooked_" + type.getName(), (new ItemFishFood(true, type)));
|
||||
}
|
||||
Item lapis = null;
|
||||
for(DyeColor color : DyeColor.values()) {
|
||||
for(TextColor color : TextColor.values()) {
|
||||
Item dye = new ItemDye(color);
|
||||
if(color == DyeColor.BLUE)
|
||||
if(color == TextColor.BLUE)
|
||||
lapis = dye;
|
||||
register(color.getDye(), dye);
|
||||
}
|
||||
|
@ -306,7 +305,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.DMAGENTA).setGleaming());
|
||||
register("charge_crystal", (new Item()).setDisplay("Energiekristall").setTab(CheatTab.MISC).setColor(TextColor.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();
|
||||
|
|
|
@ -465,12 +465,6 @@ public abstract class Items {
|
|||
public static final Item light_blue_wool = get("light_blue_wool");
|
||||
public static final Item light_weighted_pressure_plate = get("light_weighted_pressure_plate");
|
||||
public static final ItemTrident trident = get("trident");
|
||||
public static final Item lime_carpet = get("lime_carpet");
|
||||
public static final Item lime_clay = get("lime_clay");
|
||||
public static final ItemDye lime_dye = get("lime_dye");
|
||||
public static final Item lime_glass = get("lime_glass");
|
||||
public static final Item lime_glass_pane = get("lime_glass_pane");
|
||||
public static final Item lime_wool = get("lime_wool");
|
||||
public static final Item lithium_block = get("lithium_block");
|
||||
public static final ItemMetal lithium_ingot = get("lithium_ingot");
|
||||
public static final Item lithium_ore = get("lithium_ore");
|
||||
|
@ -571,13 +565,7 @@ public abstract class Items {
|
|||
public static final Item phosphor_block = get("phosphor_block");
|
||||
public static final Item phosphor_ore = get("phosphor_ore");
|
||||
public static final ItemMetal phosphor_powder = get("phosphor_powder");
|
||||
public static final Item pink_carpet = get("pink_carpet");
|
||||
public static final Item pink_clay = get("pink_clay");
|
||||
public static final ItemDye pink_dye = get("pink_dye");
|
||||
public static final Item pink_glass = get("pink_glass");
|
||||
public static final Item pink_glass_pane = get("pink_glass_pane");
|
||||
public static final Item pink_tulip = get("pink_tulip");
|
||||
public static final Item pink_wool = get("pink_wool");
|
||||
public static final Item piston = get("piston");
|
||||
public static final Item platinum_block = get("platinum_block");
|
||||
public static final ItemMetal platinum_ingot = get("platinum_ingot");
|
||||
|
@ -598,13 +586,6 @@ public abstract class Items {
|
|||
public static final Item praseodymium_ore = get("praseodymium_ore");
|
||||
public static final Item pumpkin = get("pumpkin");
|
||||
public static final ItemSeeds pumpkin_seed = get("pumpkin_seed");
|
||||
public static final Item purple_bed = get("purple_bed");
|
||||
public static final Item purple_carpet = get("purple_carpet");
|
||||
public static final Item purple_clay = get("purple_clay");
|
||||
public static final ItemDye purple_dye = get("purple_dye");
|
||||
public static final Item purple_glass = get("purple_glass");
|
||||
public static final Item purple_glass_pane = get("purple_glass_pane");
|
||||
public static final Item purple_wool = get("purple_wool");
|
||||
public static final Item quartz = get("quartz");
|
||||
public static final Item quartz_block = get("quartz_block");
|
||||
public static final Item quartz_ore = get("quartz_ore");
|
||||
|
@ -675,14 +656,8 @@ public abstract class Items {
|
|||
public static final ItemMetal silicon_ingot = get("silicon_ingot");
|
||||
public static final Item silicon_ore = get("silicon_ore");
|
||||
public static final Item silver_block = get("silver_block");
|
||||
public static final Item silver_carpet = get("silver_carpet");
|
||||
public static final Item silver_clay = get("silver_clay");
|
||||
public static final ItemDye silver_dye = get("silver_dye");
|
||||
public static final Item silver_glass = get("silver_glass");
|
||||
public static final Item silver_glass_pane = get("silver_glass_pane");
|
||||
public static final ItemMetal silver_ingot = get("silver_ingot");
|
||||
public static final Item silver_ore = get("silver_ore");
|
||||
public static final Item silver_wool = get("silver_wool");
|
||||
public static final Item skull = get("skull");
|
||||
public static final Item slime_blob = get("slime_blob");
|
||||
public static final Item slime_block = get("slime_block");
|
||||
|
@ -994,6 +969,103 @@ public abstract class Items {
|
|||
public static final Item swamp = get("swamp");
|
||||
public static final ItemBucket milk_bucket = get("milk_bucket");
|
||||
public static final ItemBucket recursive_milk_bucket = get("recursive_milk_bucket");
|
||||
public static final Item acid_green_carpet = get("acid_green_carpet");
|
||||
public static final Item acid_green_clay = get("acid_green_clay");
|
||||
public static final ItemDye acid_green_dye = get("acid_green_dye");
|
||||
public static final Item acid_green_glass = get("acid_green_glass");
|
||||
public static final Item acid_green_glass_pane = get("acid_green_glass_pane");
|
||||
public static final Item acid_green_wool = get("acid_green_wool");
|
||||
public static final Item beige_carpet = get("beige_carpet");
|
||||
public static final Item beige_clay = get("beige_clay");
|
||||
public static final ItemDye beige_dye = get("beige_dye");
|
||||
public static final Item beige_glass = get("beige_glass");
|
||||
public static final Item beige_glass_pane = get("beige_glass_pane");
|
||||
public static final Item beige_wool = get("beige_wool");
|
||||
public static final Item crimson_carpet = get("crimson_carpet");
|
||||
public static final Item crimson_clay = get("crimson_clay");
|
||||
public static final ItemDye crimson_dye = get("crimson_dye");
|
||||
public static final Item crimson_glass = get("crimson_glass");
|
||||
public static final Item crimson_glass_pane = get("crimson_glass_pane");
|
||||
public static final Item crimson_wool = get("crimson_wool");
|
||||
public static final Item dark_brown_carpet = get("dark_brown_carpet");
|
||||
public static final Item dark_brown_clay = get("dark_brown_clay");
|
||||
public static final ItemDye dark_brown_dye = get("dark_brown_dye");
|
||||
public static final Item dark_brown_glass = get("dark_brown_glass");
|
||||
public static final Item dark_brown_glass_pane = get("dark_brown_glass_pane");
|
||||
public static final Item dark_brown_wool = get("dark_brown_wool");
|
||||
public static final Item dark_gray_carpet = get("dark_gray_carpet");
|
||||
public static final Item dark_gray_clay = get("dark_gray_clay");
|
||||
public static final ItemDye dark_gray_dye = get("dark_gray_dye");
|
||||
public static final Item dark_gray_glass = get("dark_gray_glass");
|
||||
public static final Item dark_gray_glass_pane = get("dark_gray_glass_pane");
|
||||
public static final Item dark_gray_wool = get("dark_gray_wool");
|
||||
public static final Item dark_green_carpet = get("dark_green_carpet");
|
||||
public static final Item dark_green_clay = get("dark_green_clay");
|
||||
public static final ItemDye dark_green_dye = get("dark_green_dye");
|
||||
public static final Item dark_green_glass = get("dark_green_glass");
|
||||
public static final Item dark_green_glass_pane = get("dark_green_glass_pane");
|
||||
public static final Item dark_green_wool = get("dark_green_wool");
|
||||
public static final Item dark_magenta_carpet = get("dark_magenta_carpet");
|
||||
public static final Item dark_magenta_clay = get("dark_magenta_clay");
|
||||
public static final ItemDye dark_magenta_dye = get("dark_magenta_dye");
|
||||
public static final Item dark_magenta_glass = get("dark_magenta_glass");
|
||||
public static final Item dark_magenta_glass_pane = get("dark_magenta_glass_pane");
|
||||
public static final Item dark_magenta_wool = get("dark_magenta_wool");
|
||||
public static final Item dark_red_carpet = get("dark_red_carpet");
|
||||
public static final Item dark_red_clay = get("dark_red_clay");
|
||||
public static final ItemDye dark_red_dye = get("dark_red_dye");
|
||||
public static final Item dark_red_glass = get("dark_red_glass");
|
||||
public static final Item dark_red_glass_pane = get("dark_red_glass_pane");
|
||||
public static final Item dark_red_wool = get("dark_red_wool");
|
||||
public static final Item dark_violet_carpet = get("dark_violet_carpet");
|
||||
public static final Item dark_violet_clay = get("dark_violet_clay");
|
||||
public static final ItemDye dark_violet_dye = get("dark_violet_dye");
|
||||
public static final Item dark_violet_glass = get("dark_violet_glass");
|
||||
public static final Item dark_violet_glass_pane = get("dark_violet_glass_pane");
|
||||
public static final Item dark_violet_wool = get("dark_violet_wool");
|
||||
public static final Item light_brown_carpet = get("light_brown_carpet");
|
||||
public static final Item light_brown_clay = get("light_brown_clay");
|
||||
public static final ItemDye light_brown_dye = get("light_brown_dye");
|
||||
public static final Item light_brown_glass = get("light_brown_glass");
|
||||
public static final Item light_brown_glass_pane = get("light_brown_glass_pane");
|
||||
public static final Item light_brown_wool = get("light_brown_wool");
|
||||
public static final Item light_gray_carpet = get("light_gray_carpet");
|
||||
public static final Item light_gray_clay = get("light_gray_clay");
|
||||
public static final ItemDye light_gray_dye = get("light_gray_dye");
|
||||
public static final Item light_gray_glass = get("light_gray_glass");
|
||||
public static final Item light_gray_glass_pane = get("light_gray_glass_pane");
|
||||
public static final Item light_gray_wool = get("light_gray_wool");
|
||||
public static final Item light_yellow_carpet = get("light_yellow_carpet");
|
||||
public static final Item light_yellow_clay = get("light_yellow_clay");
|
||||
public static final ItemDye light_yellow_dye = get("light_yellow_dye");
|
||||
public static final Item light_yellow_glass = get("light_yellow_glass");
|
||||
public static final Item light_yellow_glass_pane = get("light_yellow_glass_pane");
|
||||
public static final Item light_yellow_wool = get("light_yellow_wool");
|
||||
public static final Item midnight_carpet = get("midnight_carpet");
|
||||
public static final Item midnight_clay = get("midnight_clay");
|
||||
public static final ItemDye midnight_dye = get("midnight_dye");
|
||||
public static final Item midnight_glass = get("midnight_glass");
|
||||
public static final Item midnight_glass_pane = get("midnight_glass_pane");
|
||||
public static final Item midnight_wool = get("midnight_wool");
|
||||
public static final Item neon_carpet = get("neon_carpet");
|
||||
public static final Item neon_clay = get("neon_clay");
|
||||
public static final ItemDye neon_dye = get("neon_dye");
|
||||
public static final Item neon_glass = get("neon_glass");
|
||||
public static final Item neon_glass_pane = get("neon_glass_pane");
|
||||
public static final Item neon_wool = get("neon_wool");
|
||||
public static final Item ork_green_carpet = get("ork_green_carpet");
|
||||
public static final Item ork_green_clay = get("ork_green_clay");
|
||||
public static final ItemDye ork_green_dye = get("ork_green_dye");
|
||||
public static final Item ork_green_glass = get("ork_green_glass");
|
||||
public static final Item ork_green_glass_pane = get("ork_green_glass_pane");
|
||||
public static final Item ork_green_wool = get("ork_green_wool");
|
||||
public static final Item violet_bed = get("violet_bed");
|
||||
public static final Item violet_carpet = get("violet_carpet");
|
||||
public static final Item violet_clay = get("violet_clay");
|
||||
public static final ItemDye violet_dye = get("violet_dye");
|
||||
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");
|
||||
|
||||
private static <T extends Item> T get(String id) {
|
||||
T item = (T)ItemRegistry.byName(id);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package common.init;
|
||||
|
||||
import common.color.TextColor;
|
||||
import common.util.TextColor;
|
||||
|
||||
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()),
|
||||
|
@ -91,7 +91,7 @@ public enum MetalType {
|
|||
}
|
||||
|
||||
public String formatRarity() {
|
||||
return TextColor.DMAGENTA + "Seltenheit: " + TextColor.NEON + "" + (this.rarity + 1);
|
||||
return TextColor.DARK_MAGENTA + "Seltenheit: " + TextColor.NEON + "" + (this.rarity + 1);
|
||||
}
|
||||
|
||||
public String formatRadioactivity() {
|
||||
|
|
|
@ -34,7 +34,7 @@ public abstract class TradeRegistry {
|
|||
new ItemForGem(Items.black_wool, new PriceInfo(1, 2)),
|
||||
new ItemForGem(Items.brown_wool, new PriceInfo(1, 2)),
|
||||
new ItemForGem(Items.gray_wool, new PriceInfo(1, 2)),
|
||||
new ItemForGem(Items.silver_wool, new PriceInfo(1, 2)),
|
||||
new ItemForGem(Items.light_gray_wool, new PriceInfo(1, 2)),
|
||||
new GemForItem(Items.string, new PriceInfo(15, 20)),
|
||||
new ItemForGem(Items.arrow, new PriceInfo(-12, -8)),
|
||||
new ItemForGem(Items.bow, new PriceInfo(2, 3)),
|
||||
|
|
|
@ -6,7 +6,6 @@ import common.attributes.Attribute;
|
|||
import common.attributes.UsageSlot;
|
||||
import common.block.Block;
|
||||
import common.block.tech.BlockDispenser;
|
||||
import common.color.TextColor;
|
||||
import common.entity.Entity;
|
||||
import common.entity.npc.EntityNPC;
|
||||
import common.entity.types.EntityLiving;
|
||||
|
@ -21,6 +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.Vec3;
|
||||
import common.world.AWorldServer;
|
||||
import common.world.World;
|
||||
|
|
|
@ -9,7 +9,6 @@ import common.attributes.Attribute;
|
|||
import common.attributes.UsageSlot;
|
||||
import common.collect.Lists;
|
||||
import common.collect.Maps;
|
||||
import common.color.TextColor;
|
||||
import common.enchantment.Enchantment;
|
||||
import common.enchantment.EnchantmentHelper;
|
||||
import common.entity.npc.EntityNPC;
|
||||
|
@ -18,6 +17,7 @@ import common.init.ItemRegistry;
|
|||
import common.item.weapon.ItemBow;
|
||||
import common.rng.Random;
|
||||
import common.tags.TagObject;
|
||||
import common.util.TextColor;
|
||||
|
||||
public final class ItemStack {
|
||||
public static final int MAX_SIZE = 67108864;
|
||||
|
@ -233,7 +233,7 @@ public final class ItemStack {
|
|||
}
|
||||
|
||||
public String getColoredName(TextColor reset) {
|
||||
return TextColor.DGRAY + "[" + this.getColor() + this.getDisplayName() + TextColor.DGRAY + "]" + reset;
|
||||
return TextColor.DARK_GRAY + "[" + this.getColor() + this.getDisplayName() + TextColor.DARK_GRAY + "]" + reset;
|
||||
}
|
||||
|
||||
public boolean hasDisplayName() {
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
package common.item.consumable;
|
||||
|
||||
import common.color.TextColor;
|
||||
import common.effect.Effect;
|
||||
import common.effect.StatusEffect;
|
||||
import common.entity.npc.EntityNPC;
|
||||
import common.item.ItemStack;
|
||||
import common.util.TextColor;
|
||||
import common.world.World;
|
||||
|
||||
public class ItemAppleGold extends ItemFood
|
||||
|
|
|
@ -3,7 +3,6 @@ package common.item.consumable;
|
|||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import common.collect.Lists;
|
||||
import common.color.TextColor;
|
||||
import common.effect.Effect;
|
||||
import common.effect.StatusEffect;
|
||||
import common.entity.npc.EntityNPC;
|
||||
|
@ -23,6 +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.Vec3;
|
||||
import common.world.AWorldServer;
|
||||
import common.world.World;
|
||||
|
@ -216,14 +216,14 @@ public class ItemPotion extends Item
|
|||
}
|
||||
else
|
||||
{
|
||||
tooltip.add(TextColor.LGRAY + s1);
|
||||
tooltip.add(TextColor.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.LGRAY + "Wirkungslos");
|
||||
tooltip.add(TextColor.LIGHT_GRAY + "Wirkungslos");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -3,7 +3,6 @@ package common.item.material;
|
|||
import common.block.Block;
|
||||
import common.block.artificial.BlockBed;
|
||||
import common.block.foliage.IGrowable;
|
||||
import common.color.DyeColor;
|
||||
import common.entity.animal.EntitySheep;
|
||||
import common.entity.npc.EntityNPC;
|
||||
import common.entity.types.EntityLiving;
|
||||
|
@ -19,30 +18,31 @@ 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.world.State;
|
||||
import common.world.World;
|
||||
import common.world.AWorldServer;
|
||||
|
||||
public class ItemDye extends Item {
|
||||
private static final ItemDye[] DIES = new ItemDye[DyeColor.values().length];
|
||||
private static final ItemDye[] DIES = new ItemDye[TextColor.values().length];
|
||||
|
||||
private final DyeColor color;
|
||||
private final TextColor color;
|
||||
|
||||
public static ItemDye getByColor(DyeColor color) {
|
||||
public static ItemDye getByColor(TextColor color) {
|
||||
return DIES[color.ordinal()];
|
||||
}
|
||||
|
||||
public ItemDye(DyeColor color)
|
||||
public ItemDye(TextColor color)
|
||||
{
|
||||
this.color = color;
|
||||
this.setTab(color == DyeColor.BLUE ? CheatTab.METALS : CheatTab.MATERIALS);
|
||||
this.setTab(color == TextColor.BLUE ? CheatTab.METALS : CheatTab.MATERIALS);
|
||||
this.setDisplay(color.getDyeName());
|
||||
this.setMaxAmount(StackSize.XXL);
|
||||
DIES[this.color.ordinal()] = this;
|
||||
}
|
||||
|
||||
public DyeColor getColor() {
|
||||
public TextColor getColor() {
|
||||
return this.color;
|
||||
}
|
||||
|
||||
|
@ -57,7 +57,7 @@ public class ItemDye extends Item {
|
|||
}
|
||||
else
|
||||
{
|
||||
if (this.color == DyeColor.WHITE)
|
||||
if (this.color == TextColor.WHITE)
|
||||
{
|
||||
if (applyBonemeal(stack, worldIn, pos))
|
||||
{
|
||||
|
@ -177,7 +177,7 @@ public class ItemDye extends Item {
|
|||
|
||||
@Serverside
|
||||
public ItemStack dispenseStack(AWorldServer world, TileEntity source, Vec3 position, BlockPos blockpos, Facing facing, ItemStack stack) {
|
||||
if(this.color != DyeColor.WHITE)
|
||||
if(this.color != TextColor.WHITE)
|
||||
return super.dispenseStack(world, source, position, blockpos, facing, stack);
|
||||
BlockPos pos = blockpos = blockpos.offset(facing);
|
||||
|
||||
|
@ -199,6 +199,6 @@ public class ItemDye extends Item {
|
|||
|
||||
@Serverside
|
||||
public int getDispenseSoundId() {
|
||||
return this.color == DyeColor.WHITE ? 0 : super.getDispenseSoundId();
|
||||
return this.color == TextColor.WHITE ? 0 : super.getDispenseSoundId();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,7 +5,6 @@ import java.util.Map;
|
|||
|
||||
import common.collect.Lists;
|
||||
import common.collect.Maps;
|
||||
import common.color.TextColor;
|
||||
import common.enchantment.Enchantment;
|
||||
import common.enchantment.EnchantmentHelper;
|
||||
import common.entity.npc.EntityNPC;
|
||||
|
@ -15,6 +14,7 @@ import common.item.ItemStack;
|
|||
import common.item.RngLoot;
|
||||
import common.rng.Random;
|
||||
import common.util.Clientside;
|
||||
import common.util.TextColor;
|
||||
|
||||
public class ItemEnchantedBook extends Item
|
||||
{
|
||||
|
|
|
@ -4,12 +4,12 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
import common.attributes.Attribute;
|
||||
import common.attributes.UsageSlot;
|
||||
import common.color.TextColor;
|
||||
import common.entity.npc.EntityNPC;
|
||||
import common.init.MetalType;
|
||||
import common.item.Item;
|
||||
import common.item.ItemStack;
|
||||
import common.util.Clientside;
|
||||
import common.util.TextColor;
|
||||
|
||||
public class ItemMetal extends Item {
|
||||
private final MetalType metal;
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package common.item.projectile;
|
||||
|
||||
import common.block.artificial.BlockPortalFrame;
|
||||
import common.color.TextColor;
|
||||
import common.entity.item.EntityOrb;
|
||||
import common.entity.npc.EntityNPC;
|
||||
import common.init.Blocks;
|
||||
|
@ -13,6 +12,7 @@ import common.item.ItemStack;
|
|||
import common.util.BlockPos;
|
||||
import common.util.Facing;
|
||||
import common.util.ParticleType;
|
||||
import common.util.TextColor;
|
||||
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.DMAGENTA);
|
||||
this.setColor(TextColor.DARK_MAGENTA);
|
||||
this.setFragile();
|
||||
}
|
||||
|
||||
|
|
|
@ -4,7 +4,6 @@ import java.util.Collection;
|
|||
import java.util.Map;
|
||||
|
||||
import common.collect.Maps;
|
||||
import common.color.TextColor;
|
||||
import common.entity.npc.EntityNPC;
|
||||
import common.entity.projectile.EntityDie;
|
||||
import common.init.SoundEvent;
|
||||
|
@ -20,6 +19,7 @@ import common.util.Clientside;
|
|||
import common.util.Facing;
|
||||
import common.util.Pair;
|
||||
import common.util.Serverside;
|
||||
import common.util.TextColor;
|
||||
import common.util.Vec3;
|
||||
import common.world.AWorldServer;
|
||||
import common.world.World;
|
||||
|
@ -27,11 +27,11 @@ import common.world.World;
|
|||
public class ItemDie extends Item
|
||||
{
|
||||
public static final Pair<Integer, TextColor>[] DIE_SIDES = new Pair[] {
|
||||
new Pair(4, TextColor.DGREEN),
|
||||
new Pair(4, TextColor.DARK_GREEN),
|
||||
new Pair(6, TextColor.NEON),
|
||||
new Pair(8, TextColor.DMAGENTA),
|
||||
new Pair(8, TextColor.DARK_MAGENTA),
|
||||
new Pair(10, TextColor.MAGENTA),
|
||||
new Pair(12, TextColor.DRED),
|
||||
new Pair(12, TextColor.DARK_RED),
|
||||
new Pair(20, TextColor.ORANGE)
|
||||
};
|
||||
public static final Map<Integer, ItemDie> DICE = Maps.newTreeMap();
|
||||
|
|
|
@ -6,7 +6,6 @@ import java.util.List;
|
|||
import common.block.artificial.BlockFence;
|
||||
import common.block.liquid.BlockLiquid;
|
||||
import common.collect.Lists;
|
||||
import common.color.TextColor;
|
||||
import common.dimension.Dimension;
|
||||
import common.entity.Entity;
|
||||
import common.entity.npc.CharacterInfo;
|
||||
|
@ -24,6 +23,7 @@ import common.util.ExtMath;
|
|||
import common.util.Facing;
|
||||
import common.util.HitPosition;
|
||||
import common.util.Serverside;
|
||||
import common.util.TextColor;
|
||||
import common.world.State;
|
||||
import common.world.World;
|
||||
|
||||
|
|
|
@ -5,7 +5,6 @@ import java.util.List;
|
|||
import common.block.artificial.BlockFence;
|
||||
import common.block.liquid.BlockLiquid;
|
||||
import common.collect.Lists;
|
||||
import common.color.TextColor;
|
||||
import common.dimension.Dimension;
|
||||
import common.entity.Entity;
|
||||
import common.entity.npc.EntityNPC;
|
||||
|
@ -22,6 +21,7 @@ import common.util.ExtMath;
|
|||
import common.util.Facing;
|
||||
import common.util.HitPosition;
|
||||
import common.util.Serverside;
|
||||
import common.util.TextColor;
|
||||
import common.world.State;
|
||||
import common.world.World;
|
||||
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
package common.item.tool;
|
||||
|
||||
import common.color.TextColor;
|
||||
import common.entity.npc.EntityNPC;
|
||||
import common.item.ItemStack;
|
||||
import common.item.WieldType;
|
||||
import common.util.BlockPos;
|
||||
import common.util.TextColor;
|
||||
import common.util.Vec3;
|
||||
import common.world.AWorldServer;
|
||||
|
||||
|
|
|
@ -2,12 +2,12 @@ package common.item.tool;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import common.color.TextColor;
|
||||
import common.entity.npc.EntityNPC;
|
||||
import common.item.Item;
|
||||
import common.item.ItemStack;
|
||||
import common.util.BlockPos;
|
||||
import common.util.Clientside;
|
||||
import common.util.TextColor;
|
||||
|
||||
public class ItemSpaceNavigator extends Item {
|
||||
@Clientside
|
||||
|
@ -15,7 +15,7 @@ public class ItemSpaceNavigator extends Item {
|
|||
|
||||
public ItemSpaceNavigator() {
|
||||
this.setUnstackable();
|
||||
this.setColor(TextColor.DGREEN);
|
||||
this.setColor(TextColor.DARK_GREEN);
|
||||
this.setMagnetic();
|
||||
}
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@ package common.item.tool;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import common.color.TextColor;
|
||||
import common.entity.npc.EntityNPC;
|
||||
import common.item.CheatTab;
|
||||
import common.item.Item;
|
||||
|
@ -13,6 +12,7 @@ import common.util.BlockPos;
|
|||
import common.util.Clientside;
|
||||
import common.util.ExtMath;
|
||||
import common.util.Facing;
|
||||
import common.util.TextColor;
|
||||
import common.util.Vec3;
|
||||
import common.world.World;
|
||||
import common.world.AWorldServer;
|
||||
|
@ -43,7 +43,7 @@ public abstract class ItemWand extends Item {
|
|||
|
||||
@Clientside
|
||||
public void addInformation(ItemStack stack, EntityNPC playerIn, List<String> tooltip) {
|
||||
tooltip.add(TextColor.DGREEN + "Reichweite: " + TextColor.GREEN + this.getRange(stack, playerIn) + " Blöcke");
|
||||
tooltip.add(TextColor.DARK_GREEN + "Reichweite: " + TextColor.GREEN + this.getRange(stack, playerIn) + " Blöcke");
|
||||
}
|
||||
|
||||
public abstract int getRange(ItemStack stack, EntityNPC player);
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
package common.item.tool;
|
||||
|
||||
import common.color.TextColor;
|
||||
import common.entity.npc.EntityNPC;
|
||||
import common.init.SoundEvent;
|
||||
import common.item.Item;
|
||||
import common.item.ItemStack;
|
||||
import common.util.TextColor;
|
||||
import common.world.Weather;
|
||||
import common.world.World;
|
||||
import common.world.AWorldServer;
|
||||
|
|
|
@ -2,7 +2,6 @@ package common.item.weapon;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import common.color.TextColor;
|
||||
import common.entity.DamageSource;
|
||||
import common.entity.npc.EntityNPC;
|
||||
import common.entity.types.EntityLiving;
|
||||
|
@ -10,12 +9,13 @@ import common.item.CheatTab;
|
|||
import common.item.ItemStack;
|
||||
import common.item.tool.ItemWand;
|
||||
import common.util.BoundingBox;
|
||||
import common.util.TextColor;
|
||||
import common.util.Vec3;
|
||||
import common.world.AWorldServer;
|
||||
|
||||
public class ItemBanHammer extends ItemWand {
|
||||
public ItemBanHammer() {
|
||||
this.setColor(TextColor.DRED);
|
||||
this.setColor(TextColor.DARK_RED);
|
||||
this.setTab(CheatTab.WEAPONS);
|
||||
this.setMagnetic();
|
||||
}
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
package common.item.weapon;
|
||||
|
||||
import common.color.TextColor;
|
||||
import common.dimension.Space;
|
||||
import common.entity.npc.EntityNPC;
|
||||
import common.init.SoundEvent;
|
||||
import common.item.CheatTab;
|
||||
import common.item.Item;
|
||||
import common.item.ItemStack;
|
||||
import common.util.TextColor;
|
||||
import common.world.World;
|
||||
import common.world.AWorldServer;
|
||||
|
||||
public class ItemExterminator extends Item {
|
||||
public ItemExterminator() {
|
||||
this.setUnstackable();
|
||||
this.setColor(TextColor.DRED);
|
||||
this.setColor(TextColor.DARK_RED);
|
||||
this.setTab(CheatTab.WEAPONS);
|
||||
this.setMagnetic();
|
||||
}
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
package common.item.weapon;
|
||||
|
||||
import common.color.TextColor;
|
||||
import common.entity.npc.EntityNPC;
|
||||
import common.item.CheatTab;
|
||||
import common.item.ItemStack;
|
||||
import common.item.tool.ItemWand;
|
||||
import common.util.TextColor;
|
||||
import common.util.Vec3;
|
||||
import common.world.AWorldServer;
|
||||
|
||||
|
|
|
@ -5,8 +5,8 @@ import java.io.StringWriter;
|
|||
import java.util.List;
|
||||
|
||||
import common.collect.Lists;
|
||||
import common.color.TextColor;
|
||||
import common.network.IThreadListener;
|
||||
import common.util.TextColor;
|
||||
import common.util.Util;
|
||||
|
||||
public enum Log {
|
||||
|
@ -143,8 +143,8 @@ public enum Log {
|
|||
public void log(LogLevel level, String msg) {
|
||||
if(level.ordinal() > Log.level.ordinal())
|
||||
return;
|
||||
String prefix = String.format(TextColor.DGRAY + "[" + TextColor.GREEN + "%s" + TextColor.DGRAY + "][" + TextColor.LGRAY + "%s" + TextColor.DGRAY + "|" + TextColor.LGRAY + "%s" +
|
||||
TextColor.DGRAY + "][%s%s" + TextColor.DGRAY + "] ",
|
||||
String prefix = String.format(TextColor.DARK_GRAY + "[" + TextColor.GREEN + "%s" + TextColor.DARK_GRAY + "][" + TextColor.LIGHT_GRAY + "%s" + TextColor.DARK_GRAY + "|" + TextColor.LIGHT_GRAY + "%s" +
|
||||
TextColor.DARK_GRAY + "][%s%s" + TextColor.DARK_GRAY + "] ",
|
||||
str_time(Util.rtime()), this.prefix, Thread.currentThread().getName(), level.color, level.log);
|
||||
String[] lines = msg.split("\n");
|
||||
if(/* Game.getGame() == null || */ Log.sync.isMainThread()) {
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
package common.log;
|
||||
|
||||
import common.color.TextColor;
|
||||
import common.util.Displayable;
|
||||
import common.util.ExtMath;
|
||||
import common.util.Identifyable;
|
||||
import common.util.TextColor;
|
||||
|
||||
public enum LogLevel implements Displayable, Identifyable {
|
||||
SILENT("silent", "Nichts", "UNK?", TextColor.BLACK),
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package common.tileentity;
|
||||
|
||||
import common.collect.Lists;
|
||||
import common.color.TextColor;
|
||||
import common.entity.npc.EntityNPC;
|
||||
import common.inventory.ContainerTile;
|
||||
import common.inventory.IInventory;
|
||||
|
@ -12,10 +11,11 @@ import common.rng.Random;
|
|||
import common.tags.TagObject;
|
||||
import java.util.List;
|
||||
import common.util.ExtMath;
|
||||
import common.util.TextColor;
|
||||
|
||||
public abstract class Device extends TileEntity implements IInventory, ITickable {
|
||||
public static enum Status {
|
||||
OFF(TextColor.DGRAY, "Inaktiv"),
|
||||
OFF(TextColor.DARK_GRAY, "Inaktiv"),
|
||||
COOLING(TextColor.YELLOW, "Abkühlen ..."),
|
||||
RUNNING(TextColor.GREEN, "Aktiv"),
|
||||
OVERHEAT(TextColor.RED, "Überhitzt!"),
|
||||
|
|
143
common/src/main/java/common/util/TextColor.java
Executable file
143
common/src/main/java/common/util/TextColor.java
Executable file
|
@ -0,0 +1,143 @@
|
|||
package common.util;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import common.collect.Maps;
|
||||
|
||||
public enum TextColor implements Identifyable, Displayable {
|
||||
CRIMSON(0x02, 0x601010, "crimson", 'C', "Blutrot", "Blutrotes", "Blutroter", "Blutrote"),
|
||||
DARK_RED(0x03, 0x7f0000, "dark_red", 'r', "Dunkelrot", "Dunkelrotes", "Dunkelroter", "Dunkelrote"),
|
||||
RED(0x04, 0xcf0000, "red", 'R', "Rot", "Rotes", "Roter", "Rote"),
|
||||
DARK_BROWN(0x05, 0x56250b, "dark_brown", 'w', "Dunkelbraun", "Dunkelbraunes", "Dunkelbrauner", "Dunkelbraune"),
|
||||
ORANGE(0x06, 0xff7000, "orange", 'o', "Orange", "Oranges", "Oranger", "Orange"),
|
||||
BROWN(0x07, 0x8c5606, "brown", 'W', "Braun", "Braunes", "Brauner", "Braune", "cocoa_powder", "Gemahlene Kakaobohnen"),
|
||||
LIGHT_BROWN(0x08, 0x9c7636, "light_brown", 'l', "Hellbraun", "Hellbraunes", "Hellbrauner", "Hellbraune"),
|
||||
BEIGE(0x09, 0xcfcfaf, "beige", 'L', "Beige", "Beiges", "Beiger", "Beige"),
|
||||
YELLOW(0x0b, 0xbfbf00, "yellow", 'y', "Gelb", "Gelbes", "Gelber", "Gelbe"),
|
||||
LIGHT_YELLOW(0x0c, 0xffff7f, "light_yellow", 'Y', "Hellgelb", "Hellgelbes", "Hellgelber", "Hellgelbe"),
|
||||
ORK(0x0d, 0x487c00, "ork_green", 'O', "Orkgrün", "Orkgrünes", "Orkgrüner", "Orkgrüne"),
|
||||
ACID(0x0e, 0x80ff00, "acid_green", 'a', "Säuregrün", "Säuregrünes", "Säuregrüner", "Säuregrüne"),
|
||||
DARK_GREEN(0x0f, 0x007f00, "dark_green", 'g', "Dunkelgrün", "Dunkelgrünes", "Dunkelgrüner", "Dunkelgrüne"),
|
||||
GREEN(0x10, 0x00cf00, "green", 'G', "Grün", "Grünes", "Grüner", "Grüne"),
|
||||
CYAN(0x12, 0x00bfbf, "cyan", 'c', "Türkis", "Türkises", "Türkiser", "Türkise"),
|
||||
NEON(0x13, 0x80c0f0, "neon", 'n', "Neongrün", "Neongrünes", "Neongrüner", "Neongrüne"),
|
||||
MIDNIGHT(0x14, 0x000080, "midnight", 'm', "Mitternachtsblau", "Mitternachtsblaues", "Mitternachtsblauer", "Mitternachtsblaue"),
|
||||
BLUE(0x15, 0x0000cf, "blue", 'b', "Blau", "Blaues", "Blauer", "Blaue", "lapis_lazuli", "Lapislazuli"),
|
||||
LIGHT_BLUE(0x16, 0x5f5fff, "light_blue", 'B', "Hellblau", "Hellblaues", "Hellblauer", "Hellblaue"),
|
||||
VIOLET(0x17, 0x6000ff, "violet", 'V', "Violett", "Violettes", "Violetter", "Violette"),
|
||||
DARK_VIOLET(0x18, 0x5400be, "dark_violet", 'v', "Dunkelviolett", "Dunkelviolettes", "Dunkelvioletter", "Dunkelviolette"),
|
||||
DARK_MAGENTA(0x19, 0x6f006f, "dark_magenta", 'm', "Dunkelmagenta", "Dunkelmagenta", "Dunkelmagenta", "Dunkelmagenta"),
|
||||
MAGENTA(0x1a, 0xbf00bf, "magenta", 'M', "Magenta", "Magenta", "Magenta", "Magenta"),
|
||||
WHITE(0x1b, 0xffffff, "white", '4', "Weiß", "Weißes", "Weißer", "Weiße", "bonemeal", "Knochenmehl"),
|
||||
LIGHT_GRAY(0x1c, 0xc0c0c0, "light_gray", '3', "Hellgrau", "Hellgraues", "Hellgrauer", "Hellgraue"),
|
||||
GRAY(0x1d, 0x808080, "gray", '2', "Grau", "Graues", "Grauer", "Graue"),
|
||||
DARK_GRAY(0x1e, 0x585858, "dark_gray", '1', "Dunkelgrau", "Dunkelgraues", "Dunkelgrauer", "Dunkelgraue"),
|
||||
BLACK(0x1f, 0x000000, "black", '0', "Schwarz", "Schwarzes", "Schwarzer", "Schwarze", "ink_sack", "Tintenbeutel");
|
||||
|
||||
public static final char RESET = 0x01;
|
||||
public static final char COMMAND = 0x11;
|
||||
|
||||
private static final Map<String, TextColor> LOOKUP = Maps.newHashMap();
|
||||
private static final Map<Character, Character> CODE_LOOKUP = Maps.newHashMap();
|
||||
private static final Pattern STRIP_PATTERN = Pattern.compile("[\u0001\u0002\u0003\u0004\u0005\u0006\u0007\u0008\u0009\u000b\u000c\r\u000e\u000f"
|
||||
+ "\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f]");
|
||||
|
||||
private static final int[] COLORS = new int[32];
|
||||
private static final int[] SHADOW = new int[32];
|
||||
|
||||
private final String format;
|
||||
public final char code;
|
||||
public final String id;
|
||||
public final char colorId;
|
||||
public final int color;
|
||||
public final int shadow;
|
||||
private final String display;
|
||||
private final String subject;
|
||||
private final String msubject;
|
||||
private final String fsubject;
|
||||
private final String dye;
|
||||
private final String dyeName;
|
||||
|
||||
static {
|
||||
for(TextColor color : values()) {
|
||||
if(color.code < COLORS.length) {
|
||||
COLORS[color.code] = color.color;
|
||||
SHADOW[color.code] = color.shadow;
|
||||
LOOKUP.put(color.id, color);
|
||||
CODE_LOOKUP.put(color.colorId, color.code);
|
||||
}
|
||||
}
|
||||
COLORS[COMMAND] = 0x00ff80;
|
||||
SHADOW[COMMAND] = Util.mixColor(Util.mixColor(COLORS[COMMAND], 0x000000), 0x000000);
|
||||
CODE_LOOKUP.put('D', RESET);
|
||||
CODE_LOOKUP.put('d', COMMAND);
|
||||
}
|
||||
|
||||
public static String stripCodes(String text) {
|
||||
return text == null ? null : STRIP_PATTERN.matcher(text).replaceAll("");
|
||||
}
|
||||
|
||||
public static int getColor(char code) {
|
||||
return code < COLORS.length ? COLORS[code] : 0x000000;
|
||||
}
|
||||
|
||||
public static int getShadow(char code) {
|
||||
return code < SHADOW.length ? SHADOW[code] : 0x000000;
|
||||
}
|
||||
|
||||
public static TextColor byName(String name) {
|
||||
TextColor type = LOOKUP.get(name.toLowerCase());
|
||||
return type == null ? WHITE : type;
|
||||
}
|
||||
|
||||
public static TextColor getExact(String name) {
|
||||
return LOOKUP.get(name.toLowerCase());
|
||||
}
|
||||
|
||||
private TextColor(int code, int color, String id, char colorId, String display, String subject, String msubject, String fsubject, String dye, String dyeName) {
|
||||
this.format = Character.toString(this.code = (char)code);
|
||||
this.color = color;
|
||||
this.shadow = Util.mixColor(Util.mixColor(this.color, 0x000000), 0x000000);
|
||||
this.id = id;
|
||||
this.colorId = colorId;
|
||||
this.display = display;
|
||||
this.subject = subject;
|
||||
this.msubject = msubject;
|
||||
this.fsubject = fsubject;
|
||||
this.dye = dye;
|
||||
this.dyeName = dyeName;
|
||||
}
|
||||
|
||||
private TextColor(int code, int color, String id, char colorId, String display, String subject, String msubject, String fsubject) {
|
||||
this(code, color, id, colorId, display, subject, msubject, fsubject, id + "_dye", msubject + " Farbstoff");
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return this.format;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
public String getDisplay() {
|
||||
return this.display;
|
||||
}
|
||||
|
||||
public String getSubject(Integer type) {
|
||||
return type == null ? this.display : (type < 0 ? this.fsubject : (type > 0 ? this.msubject : this.subject));
|
||||
}
|
||||
|
||||
public String getDye() {
|
||||
return this.dye;
|
||||
}
|
||||
|
||||
public String getDyeName() {
|
||||
return this.dyeName;
|
||||
}
|
||||
|
||||
public int getColor() {
|
||||
return this.color;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue