item retexture - most fixed

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

View file

@ -51,7 +51,7 @@ import common.util.Vec3;
import common.util.HitPosition.ObjectType;
import common.util.Pair;
import common.util.Serverside;
import common.util.TextColor;
import common.util.Color;
import common.vars.Vars;
import common.world.Explosion;
import common.world.IBlockAccess;
@ -1102,8 +1102,8 @@ public class Block {
return this.getState();
}
public TextColor getItemColor() {
return this.radiation > 0.0f ? TextColor.GREEN : null;
public Color getItemColor() {
return this.radiation > 0.0f ? Color.GREEN : null;
}
@Clientside

View file

@ -19,7 +19,7 @@ import common.util.Clientside;
import common.util.ExtMath;
import common.util.Facing;
import common.util.Identifyable;
import common.util.TextColor;
import common.util.Color;
import common.util.WorldPos;
import common.world.AWorldServer;
import common.world.IWorldAccess;
@ -47,11 +47,11 @@ public class BlockBed extends Block implements Rotatable {
public static final PropertyEnum<BlockBed.EnumPartType> PART =
PropertyEnum.<BlockBed.EnumPartType>create("part", BlockBed.EnumPartType.class);
public static final TextColor[] COLORS = new TextColor[] {TextColor.RED, TextColor.WHITE, TextColor.BLACK, TextColor.VIOLET};
public static final Color[] COLORS = new Color[] {Color.RED, Color.WHITE, Color.BLACK, Color.VIOLET};
private final TextColor color;
private final Color color;
public BlockBed(TextColor color) {
public BlockBed(Color color) {
super(Material.BURNABLE);
this.color = color;
this.setDefaultState(this.getBaseState().withProperty(PART, BlockBed.EnumPartType.FOOT));
@ -73,7 +73,7 @@ public class BlockBed extends Block implements Rotatable {
if(player.isEntityAlive() && Math.abs(player.posX - (double)pos.getX()) <= 3.0D
&& Math.abs(player.posY - (double)pos.getY()) <= 2.0D && Math.abs(player.posZ - (double)pos.getZ()) <= 3.0D) {
player.setSpawnPoint(new WorldPos(pos, player.worldObj));
player.connection.addHotbar(TextColor.DARK_GREEN + "Dein Einstiegspunkt wurde auf %s bei [%s, %s, %s] gesetzt",
player.connection.addHotbar(Color.DARK_GREEN + "Dein Einstiegspunkt wurde auf %s bei [%s, %s, %s] gesetzt",
player.worldObj.dimension.getDisplay(), player.getSpawnPoint().getX(),
player.getSpawnPoint().getY(), player.getSpawnPoint().getZ());
}

View file

@ -7,7 +7,7 @@ import common.model.Model;
import common.model.Model.ModelProvider;
import common.util.BlockPos;
import common.util.Facing;
import common.util.TextColor;
import common.util.Color;
import common.world.AWorldServer;
import common.world.IWorldAccess;
import common.world.State;
@ -15,15 +15,15 @@ import common.world.World;
public class BlockCarpet extends Block
{
public static final BlockCarpet[] CARPETS = new BlockCarpet[TextColor.values().length];
public static final BlockCarpet[] CARPETS = new BlockCarpet[Color.values().length];
private final TextColor color;
private final Color color;
public static BlockCarpet getByColor(TextColor color) {
public static BlockCarpet getByColor(Color color) {
return CARPETS[color.ordinal()];
}
public BlockCarpet(TextColor color)
public BlockCarpet(Color color)
{
super(Material.FLEECE);
this.color = color;
@ -34,7 +34,7 @@ public class BlockCarpet extends Block
CARPETS[color.ordinal()] = this;
}
public TextColor getColor() {
public Color getColor() {
return this.color;
}

View file

@ -1,22 +1,22 @@
package common.block.artificial;
import common.util.TextColor;
import common.util.Color;
public class BlockStainedGlass extends BlockGlass {
public static final BlockStainedGlass[] GLASS = new BlockStainedGlass[TextColor.values().length];
public static final BlockStainedGlass[] GLASS = new BlockStainedGlass[Color.values().length];
private final TextColor color;
private final Color color;
public static BlockStainedGlass getByColor(TextColor color) {
public static BlockStainedGlass getByColor(Color color) {
return GLASS[color.ordinal()];
}
public BlockStainedGlass(TextColor color) {
public BlockStainedGlass(Color color) {
this.color = color;
GLASS[color.ordinal()] = this;
}
public TextColor getColor() {
public Color getColor() {
return this.color;
}
}

View file

@ -3,19 +3,19 @@ package common.block.artificial;
import common.block.Material;
import common.item.CheatTab;
import common.properties.Property;
import common.util.TextColor;
import common.util.Color;
public class BlockStainedGlassPane extends BlockPane
{
public static final BlockStainedGlassPane[] PANES = new BlockStainedGlassPane[TextColor.values().length];
public static final BlockStainedGlassPane[] PANES = new BlockStainedGlassPane[Color.values().length];
private final TextColor color;
private final Color color;
public static BlockStainedGlassPane getByColor(TextColor color) {
public static BlockStainedGlassPane getByColor(Color color) {
return PANES[color.ordinal()];
}
public BlockStainedGlassPane(TextColor color)
public BlockStainedGlassPane(Color color)
{
super(Material.TRANSLUCENT);
this.color = color;
@ -24,7 +24,7 @@ public class BlockStainedGlassPane extends BlockPane
PANES[color.ordinal()] = this;
}
public TextColor getColor() {
public Color getColor() {
return this.color;
}

View file

@ -5,19 +5,19 @@ import common.block.Material;
import common.item.CheatTab;
import common.model.Model;
import common.model.Model.ModelProvider;
import common.util.TextColor;
import common.util.Color;
import common.world.State;
public class BlockWool extends Block {
public static final BlockWool[] WOOLS = new BlockWool[TextColor.values().length];
public static final BlockWool[] WOOLS = new BlockWool[Color.values().length];
private final TextColor color;
private final Color color;
public static BlockWool getByColor(TextColor color) {
public static BlockWool getByColor(Color color) {
return WOOLS[color.ordinal()];
}
public BlockWool(TextColor color) {
public BlockWool(Color color) {
super(Material.BURNABLE);
this.color = color;
this.setTab(CheatTab.BLOCKS);
@ -25,7 +25,7 @@ public class BlockWool extends Block {
WOOLS[color.ordinal()] = this;
}
public TextColor getColor() {
public Color getColor() {
return this.color;
}

View file

@ -5,26 +5,26 @@ import common.block.Material;
import common.item.CheatTab;
import common.model.Model;
import common.model.Model.ModelProvider;
import common.util.TextColor;
import common.util.Color;
import common.world.State;
public class BlockColoredClay extends Block {
public static final BlockColoredClay[] CLAY = new BlockColoredClay[TextColor.values().length];
public static final BlockColoredClay[] CLAY = new BlockColoredClay[Color.values().length];
private final TextColor color;
private final Color color;
public static BlockColoredClay getByColor(TextColor color) {
public static BlockColoredClay getByColor(Color color) {
return CLAY[color.ordinal()];
}
public BlockColoredClay(TextColor color) {
public BlockColoredClay(Color color) {
super(Material.SOLID);
this.color = color;
this.setTab(CheatTab.ROCK);
CLAY[color.ordinal()] = this;
}
public TextColor getColor() {
public Color getColor() {
return this.color;
}

View file

@ -29,7 +29,7 @@ import common.tileentity.TileEntityChest;
import common.util.BlockPos;
import common.util.BoundingBox;
import common.util.Facing;
import common.util.TextColor;
import common.util.Color;
import common.vars.Vars;
import common.world.State;
import common.world.World;
@ -165,14 +165,14 @@ public class BlockChest extends Block implements ITileEntityProvider, Rotatable
if(chest.getLockCode() != null) {
if(stack.hasDisplayName() && stack.getDisplayName().equals(chest.getLockCode())) {
chest.setLockCode(null);
playerIn.connection.addHotbar(TextColor.BLUE + "%s wurde entriegelt", chest.getName());
playerIn.connection.addHotbar(Color.BLUE + "%s wurde entriegelt", chest.getName());
playerIn.connection.sendPacket(new SPacketSoundEffect(SoundEvent.DOOR, playerIn.posX, playerIn.posY, playerIn.posZ, 1.0F));
return true;
}
}
else if(stack.hasDisplayName() && !stack.getDisplayName().isEmpty()) {
chest.setLockCode(stack.getDisplayName());
playerIn.connection.addHotbar(TextColor.ORANGE + "%s wurde verriegelt", chest.getName());
playerIn.connection.addHotbar(Color.ORANGE + "%s wurde verriegelt", chest.getName());
playerIn.connection.sendPacket(new SPacketSoundEffect(SoundEvent.DOOR, playerIn.posX, playerIn.posY, playerIn.posZ, 1.0F));
return true;
}

View file

@ -9,7 +9,7 @@ import common.item.CheatTab;
import common.model.Model;
import common.model.Model.ModelProvider;
import common.util.BlockPos;
import common.util.TextColor;
import common.util.Color;
import common.world.Explosion;
import common.world.State;
import common.world.World;
@ -54,7 +54,7 @@ public class BlockNuke extends Block
return provider.getModel("nuke_side").add().nswe().d("nuke_bottom").u("nuke_top");
}
public TextColor getItemColor() {
return TextColor.RED;
public Color getItemColor() {
return Color.RED;
}
}

View file

@ -20,7 +20,7 @@ import common.tileentity.TileEntity;
import common.util.BlockPos;
import common.util.ExtMath;
import common.util.Facing;
import common.util.TextColor;
import common.util.Color;
import common.util.Vec3;
import common.world.AWorldServer;
import common.world.Explosion;
@ -161,8 +161,8 @@ public class BlockTNT extends Block
this.onBroken(world, pos, state.withProperty(BlockTNT.EXPLODE, Boolean.valueOf(true)));
}
public TextColor getItemColor() {
return TextColor.RED;
public Color getItemColor() {
return Color.RED;
}
public boolean dispense(AWorldServer world, TileEntity source, Vec3 position, BlockPos blockpos, Facing facing, ItemStack stack) {

View file

@ -7,18 +7,18 @@ import common.entity.npc.EntityNPC;
import common.entity.projectile.EntityPotion;
import common.entity.types.EntityLiving;
import common.item.ItemStack;
import common.util.TextColor;
import common.util.Color;
import common.vars.Vars;
public enum Effect {
SPEED("speed", 2, 180, "Schnelligkeit", "Trank der Schnelligkeit", false, 8171462) {
public String getTooltip(int amp) {
return String.format(TextColor.BLUE + "+%d%% Geschwindigkeit", 20 * (amp + 1));
return String.format(Color.BLUE + "+%d%% Geschwindigkeit", 20 * (amp + 1));
}
},
SLOWNESS("slowness", 1, 90, "Langsamkeit", "Trank der Langsamkeit", true, 5926017) {
public String getTooltip(int amp) {
return String.format(TextColor.RED + "-%d%% Geschwindigkeit", 15 * (amp + 1));
return String.format(Color.RED + "-%d%% Geschwindigkeit", 15 * (amp + 1));
}
},
HASTE("haste", "Eile", "Trank der Eile", false, 14270531) {
@ -29,7 +29,7 @@ public enum Effect {
FATIGUE("mining_fatigue", "Abbaulähmung", "Trank der Trägheit", true, 4866583),
STRENGTH("strength", 2, 180, "Stärke", "Trank der Stärke", false, 9643043) {
public String getTooltip(int amp) {
return String.format(TextColor.BLUE + "+%d%% Angriffsschaden", 50 * (amp + 1));
return String.format(Color.BLUE + "+%d%% Angriffsschaden", 50 * (amp + 1));
}
},
HEAL("health", 2, "Direktheilung", "Trank der Heilung", false, 16262179) {
@ -110,7 +110,7 @@ public enum Effect {
STABILITY("stability", 1, 180, "Stabilität", "Trank der Standfestigkeit", false, 5797459),
WEAKNESS("weakness", 1, 90, "Schwäche", "Trank der Schwäche", true, 4738376) {
public String getTooltip(int amp) {
return String.format(TextColor.RED + "-%d%% Angriffsschaden", 20 * (amp + 1));
return String.format(Color.RED + "-%d%% Angriffsschaden", 20 * (amp + 1));
}
},
POISON("poison", 2, 45, "Vergiftung", "Trank der Vergiftung", true, 5149489) {

View file

@ -2,44 +2,44 @@ package common.entity;
import common.entity.projectile.EntityProjectile;
import common.entity.types.EntityLiving;
import common.util.TextColor;
import common.util.Color;
import common.world.Explosion;
public class DamageSource
{
public static final DamageSource inFire =
(new DamageSource(TextColor.ORANGE, "%s ging in Flammen auf", "%s lief ins Feuer, während er mit %s kämpfte", "%s ins Feuer gelaufen")).setFireDamage();
(new DamageSource(Color.ORANGE, "%s ging in Flammen auf", "%s lief ins Feuer, während er mit %s kämpfte", "%s ins Feuer gelaufen")).setFireDamage();
public static final DamageSource onFire =
(new DamageSource(TextColor.ORANGE, "%s wurde zu heiß und verbrannte", "%s wurde während des Kampfes mit %s geröstet", "%s geröstet")).setDamageBypassesArmor().setFireDamage();
(new DamageSource(Color.ORANGE, "%s wurde zu heiß und verbrannte", "%s wurde während des Kampfes mit %s geröstet", "%s geröstet")).setDamageBypassesArmor().setFireDamage();
public static final DamageSource hotLiquid =
(new DamageSource(TextColor.ORANGE, "%s versuchte in einer unangenehm brennenden Flüssigkeit zu schwimmen", "%s fiel beim Versuch %s zu entkommen in eine unangenehm brennende Flüssigkeit", "%s in unangenehm brennender Flüssigkeit gelandet")).setFireDamage();
(new DamageSource(Color.ORANGE, "%s versuchte in einer unangenehm brennenden Flüssigkeit zu schwimmen", "%s fiel beim Versuch %s zu entkommen in eine unangenehm brennende Flüssigkeit", "%s in unangenehm brennender Flüssigkeit gelandet")).setFireDamage();
public static final DamageSource molten =
(new DamageSource(TextColor.ORANGE, "%s versuchte dem Magmaregen zu trotzen", "%s geriet beim Versuch %s zu entkommen in Magmaregen", "%s in Magmaregen geraten")).setFireDamage();
(new DamageSource(Color.ORANGE, "%s versuchte dem Magmaregen zu trotzen", "%s geriet beim Versuch %s zu entkommen in Magmaregen", "%s in Magmaregen geraten")).setFireDamage();
public static final DamageSource inWall =
(new DamageSource(TextColor.GRAY, "%s wurde lebendig begraben")).setDamageBypassesArmor();
(new DamageSource(Color.GRAY, "%s wurde lebendig begraben")).setDamageBypassesArmor();
public static final DamageSource dry =
(new DamageSource(TextColor.GRAY, "%s ist vertrocknet", "%s ist beim Versuch %s zu entkommen vertrocknet", "%s vertrocknet")).setDamageBypassesArmor();
(new DamageSource(Color.GRAY, "%s ist vertrocknet", "%s ist beim Versuch %s zu entkommen vertrocknet", "%s vertrocknet")).setDamageBypassesArmor();
public static final DamageSource cactus =
new DamageSource(TextColor.ORK, "%s wurde zu Tode gestochen", "%s rannte beim Versuch %s zu entkommen in einen Kaktus", "%s in Kaktus gerannt");
new DamageSource(Color.ORK, "%s wurde zu Tode gestochen", "%s rannte beim Versuch %s zu entkommen in einen Kaktus", "%s in Kaktus gerannt");
public static final DamageSource fall =
(new DamageSource(TextColor.NEON, "%s fiel der Schwerkraft zum Opfer")).setDamageBypassesArmor();
(new DamageSource(Color.NEON, "%s fiel der Schwerkraft zum Opfer")).setDamageBypassesArmor();
public static final DamageSource outOfWorld =
(new DamageSource(TextColor.DARK_GRAY, "%s fiel aus der Welt")).setDamageBypassesArmor();
(new DamageSource(Color.DARK_GRAY, "%s fiel aus der Welt")).setDamageBypassesArmor();
public static final DamageSource generic =
(new DamageSource(TextColor.LIGHT_GRAY, "%s starb")).setDamageBypassesArmor();
(new DamageSource(Color.LIGHT_GRAY, "%s starb")).setDamageBypassesArmor();
public static final DamageSource magic =
(new DamageSource(TextColor.DARK_MAGENTA, "%s wurde durch Magie getötet")).setDamageBypassesArmor().setMagicDamage();
(new DamageSource(Color.DARK_MAGENTA, "%s wurde durch Magie getötet")).setDamageBypassesArmor().setMagicDamage();
public static final DamageSource anvil =
new DamageSource(TextColor.DARK_RED, "%s wurde von einem fallenden Amboss zerquetscht");
new DamageSource(Color.DARK_RED, "%s wurde von einem fallenden Amboss zerquetscht");
public static final DamageSource fallingBlock =
new DamageSource(TextColor.GRAY, "%s wurde von einem fallenden Block zerquetscht");
new DamageSource(Color.GRAY, "%s wurde von einem fallenden Block zerquetscht");
public static final DamageSource radiation =
(new DamageSource(TextColor.GREEN, "%s hat seine Halbwertszeit nicht rechtzeitig erreicht")).setDamageBypassesArmor();
(new DamageSource(Color.GREEN, "%s hat seine Halbwertszeit nicht rechtzeitig erreicht")).setDamageBypassesArmor();
protected final String display;
protected final String displayExtra;
protected final String displayKill;
protected final TextColor color;
protected final Color color;
private boolean isUnblockable;
private boolean fireDamage;
@ -49,57 +49,57 @@ public class DamageSource
public static DamageSource causeMobDamage(EntityLiving mob)
{
return new EntityDamageSource(TextColor.CRIMSON, "%s wurde von %s erschlagen", "%s wurde von %s mit %s erschlagen",
return new EntityDamageSource(Color.CRIMSON, "%s wurde von %s erschlagen", "%s wurde von %s mit %s erschlagen",
"%s erschlagen", "%s mit %s erschlagen", mob);
}
public static DamageSource causeLightningDamage(EntityLiving mob)
{
return mob == null ? new DamageSource(TextColor.YELLOW, "%s wurde vom Blitz getroffen und gegrillt") :
new EntityDamageSource(TextColor.YELLOW, "%s wurde von %s gegrillt", "%s wurde von %s mit %s gegrillt",
return mob == null ? new DamageSource(Color.YELLOW, "%s wurde vom Blitz getroffen und gegrillt") :
new EntityDamageSource(Color.YELLOW, "%s wurde von %s gegrillt", "%s wurde von %s mit %s gegrillt",
"%s gegrillt", "%s mit %s gegrillt", mob);
}
public static DamageSource causeExterminatusDamage(EntityLiving mob)
{
return mob == null ? new DamageSource(TextColor.DARK_RED, "%s wurde vernichtet") :
new EntityDamageSource(TextColor.DARK_RED, "%s wurde von %s vernichtet", "%s wurde von %s mit %s vernichtet",
return mob == null ? new DamageSource(Color.DARK_RED, "%s wurde vernichtet") :
new EntityDamageSource(Color.DARK_RED, "%s wurde von %s vernichtet", "%s wurde von %s mit %s vernichtet",
"%s vernichtet", "%s mit %s vernichtet", mob);
}
public static DamageSource causeShotDamage(Entity projectile, Entity shooter)
{
return (new EntityDamageSourceIndirect(TextColor.RED, "%s wurde von %s erschossen", "%s wurde von %s mit %s erschossen", "%s erschossen", "%s mit %s erschossen", projectile, shooter)).setProjectile();
return (new EntityDamageSourceIndirect(Color.RED, "%s wurde von %s erschossen", "%s wurde von %s mit %s erschossen", "%s erschossen", "%s mit %s erschossen", projectile, shooter)).setProjectile();
}
public static DamageSource causeFireballDamage(EntityProjectile fireball, Entity shooter)
{
return shooter == null ? (new EntityDamageSourceIndirect(TextColor.YELLOW, "%s wurde von %s flambiert", fireball)).setFireDamage().setProjectile() : (new EntityDamageSourceIndirect(TextColor.YELLOW, "%s wurde von %s flambiert", "%s wurde von %s mit %s flambiert", "%s flambiert", "%s mit %s flambiert", fireball, shooter)).setFireDamage().setProjectile();
return shooter == null ? (new EntityDamageSourceIndirect(Color.YELLOW, "%s wurde von %s flambiert", fireball)).setFireDamage().setProjectile() : (new EntityDamageSourceIndirect(Color.YELLOW, "%s wurde von %s flambiert", "%s wurde von %s mit %s flambiert", "%s flambiert", "%s mit %s flambiert", fireball, shooter)).setFireDamage().setProjectile();
}
public static DamageSource causeThrownDamage(Entity source, Entity thrower)
{
return (new EntityDamageSourceIndirect(TextColor.DARK_GREEN, "%s wurde von %s zu Tode geprügelt", "%s wurde von %s mit %s zu Tode geprügelt", "%s zu Tode geprügelt", "%s mit %s zu Tode geprügelt", source, thrower)).setProjectile();
return (new EntityDamageSourceIndirect(Color.DARK_GREEN, "%s wurde von %s zu Tode geprügelt", "%s wurde von %s mit %s zu Tode geprügelt", "%s zu Tode geprügelt", "%s mit %s zu Tode geprügelt", source, thrower)).setProjectile();
}
public static DamageSource causeTeleFragDamage(Entity source, Entity replacer)
{
return (new EntityDamageSourceIndirect(TextColor.MAGENTA, "%s wurde von %s verdrängt", "%s wurde von %s mit %s verdrängt", "%s verdrängt", "%s mit %s verdrängt", source, replacer)).setDamageBypassesArmor();
return (new EntityDamageSourceIndirect(Color.MAGENTA, "%s wurde von %s verdrängt", "%s wurde von %s mit %s verdrängt", "%s verdrängt", "%s mit %s verdrängt", source, replacer)).setDamageBypassesArmor();
}
public static DamageSource causeIndirectMagicDamage(Entity source, Entity mage)
{
return (new EntityDamageSourceIndirect(TextColor.DARK_MAGENTA, "%s wurde von %s mit Magie getötet", "%s wurde von %s mit %s getötet", "%s mit Magie getötet", "%s mit %s getötet", source, mage)).setDamageBypassesArmor().setMagicDamage();
return (new EntityDamageSourceIndirect(Color.DARK_MAGENTA, "%s wurde von %s mit Magie getötet", "%s wurde von %s mit %s getötet", "%s mit Magie getötet", "%s mit %s getötet", source, mage)).setDamageBypassesArmor().setMagicDamage();
}
public static DamageSource causeThornsDamage(Entity source)
{
return (new EntityDamageSource(TextColor.ORK, "%s wurde beim Versuch %s zu verletzen getötet", "%s durch Dornen getötet", source)).setIsThornsDamage().setMagicDamage();
return (new EntityDamageSource(Color.ORK, "%s wurde beim Versuch %s zu verletzen getötet", "%s durch Dornen getötet", source)).setIsThornsDamage().setMagicDamage();
}
public static DamageSource causeExplosionDamage(Explosion explosion)
{
return explosion != null && explosion.getExplosivePlacedBy() != null ? (new EntityDamageSource(TextColor.YELLOW, "%s wurde durch %s in die Luft gesprengt", "%s in die Luft gesprengt", explosion.getExplosivePlacedBy())).setExplosion() : (new DamageSource(TextColor.YELLOW, "%s wurde in die Luft gesprengt")).setExplosion();
return explosion != null && explosion.getExplosivePlacedBy() != null ? (new EntityDamageSource(Color.YELLOW, "%s wurde durch %s in die Luft gesprengt", "%s in die Luft gesprengt", explosion.getExplosivePlacedBy())).setExplosion() : (new DamageSource(Color.YELLOW, "%s wurde in die Luft gesprengt")).setExplosion();
}
/**
@ -135,7 +135,7 @@ public class DamageSource
return this.isUnblockable;
}
protected DamageSource(TextColor color, String display, String extra, String kill)
protected DamageSource(Color color, String display, String extra, String kill)
{
this.color = color;
this.display = this.color + display;
@ -143,7 +143,7 @@ public class DamageSource
this.displayKill = this.color + "* " + kill;
}
protected DamageSource(TextColor color, String display)
protected DamageSource(Color color, String display)
{
this(color, display, display, "");
}

View file

@ -37,7 +37,7 @@ import common.util.ParticleType;
import common.util.PortalType;
import common.util.Position;
import common.util.Serverside;
import common.util.TextColor;
import common.util.Color;
import common.util.Vec3;
import common.vars.Vars;
import common.world.Explosion;
@ -2410,12 +2410,12 @@ public abstract class Entity
public final String getCommandName()
{
return TextColor.stripCodes(this.getName());
return Color.stripCodes(this.getName());
}
public final String getColoredName(TextColor reset)
public final String getColoredName(Color reset)
{
return TextColor.DARK_GRAY + "[" + this.getName() + TextColor.DARK_GRAY + "]" + reset;
return Color.DARK_GRAY + "[" + this.getName() + Color.DARK_GRAY + "]" + reset;
}
// public Text formatComponent(Text comp) {

View file

@ -2,7 +2,7 @@ package common.entity;
import common.entity.types.EntityLiving;
import common.item.ItemStack;
import common.util.TextColor;
import common.util.Color;
public class EntityDamageSource extends DamageSource
{
@ -14,14 +14,14 @@ public class EntityDamageSource extends DamageSource
*/
private boolean isThornsDamage = false;
public EntityDamageSource(TextColor color, String display, String item, String kill, String killItem, Entity damageSourceEntityIn)
public EntityDamageSource(Color color, String display, String item, String kill, String killItem, Entity damageSourceEntityIn)
{
super(color, display, item, kill);
this.damageSourceEntity = damageSourceEntityIn;
this.displayKillItem = killItem;
}
public EntityDamageSource(TextColor color, String display, String kill, Entity damageSourceEntityIn)
public EntityDamageSource(Color color, String display, String kill, Entity damageSourceEntityIn)
{
this(color, display, display, kill, kill, damageSourceEntityIn);
}

View file

@ -2,19 +2,19 @@ package common.entity;
import common.entity.types.EntityLiving;
import common.item.ItemStack;
import common.util.TextColor;
import common.util.Color;
public class EntityDamageSourceIndirect extends EntityDamageSource
{
private Entity indirectEntity;
public EntityDamageSourceIndirect(TextColor color, String display, String item, String kill, String killItem, Entity source, Entity indirectEntityIn)
public EntityDamageSourceIndirect(Color color, String display, String item, String kill, String killItem, Entity source, Entity indirectEntityIn)
{
super(color, display, item, kill, killItem, source);
this.indirectEntity = indirectEntityIn;
}
public EntityDamageSourceIndirect(TextColor color, String display, Entity source)
public EntityDamageSourceIndirect(Color color, String display, Entity source)
{
this(color, display, display, "", "", source, source);
}

View file

@ -29,7 +29,7 @@ import common.rng.Random;
import common.tags.TagObject;
import common.util.Clientside;
import common.util.ExtMath;
import common.util.TextColor;
import common.util.Color;
import common.world.World;
public class EntitySheep extends EntityAnimal
@ -100,7 +100,7 @@ public class EntitySheep extends EntityAnimal
{
super.entityInit();
this.dataWatcher.addObject(16, (byte)0);
this.dataWatcher.addObject(17, (byte)(TextColor.WHITE.ordinal() & 255));
this.dataWatcher.addObject(17, (byte)(Color.WHITE.ordinal() & 255));
}
/**
@ -209,7 +209,7 @@ public class EntitySheep extends EntityAnimal
{
super.readEntity(tagCompund);
this.setSheared(tagCompund.getBool("Sheared"));
this.setFleeceColor(TextColor.byName(tagCompund.getString("Color")));
this.setFleeceColor(Color.byName(tagCompund.getString("Color")));
}
/**
@ -244,15 +244,15 @@ public class EntitySheep extends EntityAnimal
/**
* Gets the wool color of this sheep.
*/
public TextColor getFleeceColor()
public Color getFleeceColor()
{
return TextColor.values()[(this.dataWatcher.getWatchableObjectByte(17) & 255) % TextColor.values().length];
return Color.values()[(this.dataWatcher.getWatchableObjectByte(17) & 255) % Color.values().length];
}
/**
* Sets the wool color of this sheep
*/
public void setFleeceColor(TextColor color)
public void setFleeceColor(Color color)
{
this.dataWatcher.updateObject(17, (byte)(color.ordinal() & 255));
}
@ -273,23 +273,23 @@ public class EntitySheep extends EntityAnimal
this.dataWatcher.updateObject(16, (byte)(sheared ? 1 : 0));
}
private static final TextColor[] RARE_COLORS = {
TextColor.BLUE, TextColor.CYAN, TextColor.DARK_GREEN, TextColor.LIGHT_BLUE, TextColor.GREEN,
TextColor.MAGENTA, TextColor.ORANGE, TextColor.DARK_VIOLET, TextColor.VIOLET, TextColor.RED
private static final Color[] RARE_COLORS = {
Color.BLUE, Color.CYAN, Color.DARK_GREEN, Color.LIGHT_BLUE, Color.GREEN,
Color.MAGENTA, Color.ORANGE, Color.DARK_VIOLET, Color.VIOLET, Color.RED
};
public static TextColor getRandomSheepColor(Random random, float temp)
public static Color getRandomSheepColor(Random random, float temp)
{
if(temp <= 0.0f)
return TextColor.WHITE;
return Color.WHITE;
int i = random.zrange(140);
return i < 20 ? TextColor.BLACK :
(i < 30 ? TextColor.GRAY :
(i < 40 ? TextColor.LIGHT_GRAY :
(i < 70 ? TextColor.BROWN :
(i < 120 ? TextColor.WHITE :
(i < 130 ? (random.chance(10) ? RARE_COLORS[i - 120] : TextColor.WHITE) :
(random.chance(500) ? TextColor.YELLOW : TextColor.WHITE)
return i < 20 ? Color.BLACK :
(i < 30 ? Color.GRAY :
(i < 40 ? Color.LIGHT_GRAY :
(i < 70 ? Color.BROWN :
(i < 120 ? Color.WHITE :
(i < 130 ? (random.chance(10) ? RARE_COLORS[i - 120] : Color.WHITE) :
(random.chance(500) ? Color.YELLOW : Color.WHITE)
)))));
}
@ -322,14 +322,14 @@ public class EntitySheep extends EntityAnimal
return livingdata;
}
private TextColor getDyeColorMixFromParents(EntityAnimal father, EntityAnimal mother)
private Color getDyeColorMixFromParents(EntityAnimal father, EntityAnimal mother)
{
TextColor i = ((EntitySheep)father).getFleeceColor();
TextColor j = ((EntitySheep)mother).getFleeceColor();
Color i = ((EntitySheep)father).getFleeceColor();
Color j = ((EntitySheep)mother).getFleeceColor();
this.inventoryCrafting.setInventorySlotContents(0, new ItemStack(ItemDye.getByColor(i)));
this.inventoryCrafting.setInventorySlotContents(1, new ItemStack(ItemDye.getByColor(j)));
ItemStack itemstack = CraftingRegistry.getMatching(this.inventoryCrafting);
TextColor k;
Color k;
if (itemstack != null && itemstack.getItem() instanceof ItemDye dye)
{

View file

@ -33,7 +33,7 @@ import common.tags.TagObject;
import common.util.Clientside;
import common.util.ExtMath;
import common.util.ParticleType;
import common.util.TextColor;
import common.util.Color;
import common.vars.Vars;
import common.world.World;
@ -118,7 +118,7 @@ public class EntityWolf extends EntityTameable
super.entityInit();
this.dataWatcher.addObject(18, this.getHealth());
this.dataWatcher.addObject(19, (byte)0);
this.dataWatcher.addObject(20, (byte)(TextColor.RED.ordinal() & 255));
this.dataWatcher.addObject(20, (byte)(Color.RED.ordinal() & 255));
}
// protected void playStepSound(BlockPos pos, Block blockIn)
@ -137,7 +137,7 @@ public class EntityWolf extends EntityTameable
{
super.readEntity(tagCompund);
this.setAngry(tagCompund.getBool("Angry"));
this.setCollarColor(TextColor.byName(tagCompund.getString("CollarColor")));
this.setCollarColor(Color.byName(tagCompund.getString("CollarColor")));
}
/**
@ -373,7 +373,7 @@ public class EntityWolf extends EntityTameable
}
else if (itemstack.getItem() instanceof ItemDye dye)
{
TextColor enumdyecolor = dye.getColor();
Color enumdyecolor = dye.getColor();
if (enumdyecolor != this.getCollarColor())
{
@ -492,12 +492,12 @@ public class EntityWolf extends EntityTameable
}
}
public TextColor getCollarColor()
public Color getCollarColor()
{
return TextColor.values()[(this.dataWatcher.getWatchableObjectByte(20) & 255) % TextColor.values().length];
return Color.values()[(this.dataWatcher.getWatchableObjectByte(20) & 255) % Color.values().length];
}
public void setCollarColor(TextColor collarcolor)
public void setCollarColor(Color collarcolor)
{
this.dataWatcher.updateObject(20, (byte)(collarcolor.ordinal() & 255));
}

View file

@ -18,7 +18,7 @@ import common.util.BlockPos;
import common.util.ExtMath;
import common.util.ParticleType;
import common.util.PortalType;
import common.util.TextColor;
import common.util.Color;
import common.vars.Vars;
import common.world.World;
import common.world.AWorldServer;
@ -599,7 +599,7 @@ public class EntityItem extends Entity
ItemStack stack = this.getEntityItem();
if(!stack.isStacked())
return null;
return TextColor.DARK_GREEN + "" + stack.getSize();
return Color.DARK_GREEN + "" + stack.getSize();
}
public EntityType getType() {

View file

@ -14,7 +14,7 @@ import common.util.Clientside;
import common.util.ExtMath;
import common.util.ParticleType;
import common.util.PortalType;
import common.util.TextColor;
import common.util.Color;
import common.vars.Vars;
import common.world.World;
@ -396,7 +396,7 @@ public class EntityXp extends Entity implements IObjectData
// if(!this.hasCustomName()) {
// return super.getDisplayName();
// }
return this.hasCustomName() ? TextColor.GREEN + this.getCustomNameTag() : null;
return this.hasCustomName() ? Color.GREEN + this.getCustomNameTag() : null;
}
public EntityType getType() {

View file

@ -3,18 +3,18 @@ package common.entity.npc;
import java.util.Map;
import common.collect.Maps;
import common.util.TextColor;
import common.util.Color;
public enum Alignment {
LAWFUL_GOOD("lgood", "Rechtsch. gut", 1, 1, TextColor.NEON),
GOOD("good", "Gut", 0, 1, TextColor.BLUE),
CHAOTIC_GOOD("cgood", "Chaotisch gut", -1, 1, TextColor.CYAN),
LAWFUL("lawful", "Rechtschaffen", 1, 0, TextColor.WHITE),
NEUTRAL("neutral", "Neutral", 0, 0, TextColor.LIGHT_GRAY),
CHAOTIC("chaotic", "Chaotisch", -1, 0, TextColor.GRAY),
LAWFUL_EVIL("levil", "Rechtsch. böse", 1, -1, TextColor.ORANGE),
EVIL("evil", "Böse", 0, -1, TextColor.RED),
CHAOTIC_EVIL("cevil", "Chaotisch böse", -1, -1, TextColor.DARK_RED);
LAWFUL_GOOD("lgood", "Rechtsch. gut", 1, 1, Color.NEON),
GOOD("good", "Gut", 0, 1, Color.BLUE),
CHAOTIC_GOOD("cgood", "Chaotisch gut", -1, 1, Color.CYAN),
LAWFUL("lawful", "Rechtschaffen", 1, 0, Color.WHITE),
NEUTRAL("neutral", "Neutral", 0, 0, Color.LIGHT_GRAY),
CHAOTIC("chaotic", "Chaotisch", -1, 0, Color.GRAY),
LAWFUL_EVIL("levil", "Rechtsch. böse", 1, -1, Color.ORANGE),
EVIL("evil", "Böse", 0, -1, Color.RED),
CHAOTIC_EVIL("cevil", "Chaotisch böse", -1, -1, Color.DARK_RED);
private static final Map<String, Alignment> LOOKUP = Maps.newHashMap();
@ -22,12 +22,12 @@ public enum Alignment {
public final boolean chaotic;
public final boolean good;
public final boolean evil;
public final TextColor color;
public final Color color;
public final String name;
public final String prefix;
public final String display;
private Alignment(String name, String display, int temper, int morale, TextColor color) {
private Alignment(String name, String display, int temper, int morale, Color color) {
this.lawful = temper == 1;
this.chaotic = temper == -1;
this.good = morale == 1;
@ -35,10 +35,10 @@ public enum Alignment {
this.color = color;
this.name = name;
this.display = display;
this.prefix = TextColor.GRAY + "[" + (temper == 0 && morale == 0 ? TextColor.LIGHT_GRAY + "~" : "") +
(this.good ? TextColor.BLUE + "*" : (this.evil ? TextColor.RED + "!" : "")) +
(this.lawful ? TextColor.GREEN + "+" : (this.chaotic ? TextColor.DARK_MAGENTA + "-" : "")) +
TextColor.GRAY + "]";
this.prefix = Color.GRAY + "[" + (temper == 0 && morale == 0 ? Color.LIGHT_GRAY + "~" : "") +
(this.good ? Color.BLUE + "*" : (this.evil ? Color.RED + "!" : "")) +
(this.lawful ? Color.GREEN + "+" : (this.chaotic ? Color.DARK_MAGENTA + "-" : "")) +
Color.GRAY + "]";
}
public static Alignment getByName(String name) {

View file

@ -92,7 +92,7 @@ import common.util.ExtMath;
import common.util.Facing;
import common.util.ParticleType;
import common.util.PortalType;
import common.util.TextColor;
import common.util.Color;
import common.util.Vec3;
import common.util.WorldPos;
import common.vars.Vars;
@ -1139,7 +1139,7 @@ public abstract class EntityNPC extends EntityLiving
}
public String formatStats() {
return super.formatStats() + (this.getManaPoints() == 0 ? "" : TextColor.GRAY + " [" + TextColor.MIDNIGHT + this.getManaPoints() + TextColor.GRAY + "]");
return super.formatStats() + (this.getManaPoints() == 0 ? "" : Color.GRAY + " [" + Color.MIDNIGHT + this.getManaPoints() + Color.GRAY + "]");
}
public MerchantRecipeList getTrades(EntityNPC player) {

View file

@ -57,7 +57,7 @@ import common.util.Clientside;
import common.util.ExtMath;
import common.util.ParticleType;
import common.util.Serverside;
import common.util.TextColor;
import common.util.Color;
import common.util.Vec3;
import common.vars.Vars;
import common.world.State;
@ -2243,15 +2243,15 @@ public abstract class EntityLiving extends Entity
this.effectsDirty = true;
}
public static TextColor getHealthColor(int health, int max) {
public static Color getHealthColor(int health, int max) {
float perc = (float)health / (float)max;
return /* health <= 1.0f ? ChatFormat.DARK_RED : ( */ perc >= 1.0f ? TextColor.DARK_GREEN : (perc >= 0.75f ? TextColor.GREEN :
(perc >= 0.5f ? TextColor.YELLOW : (perc >= 0.25f ? TextColor.ORANGE : (perc >= 0.1f ? TextColor.RED : TextColor.DARK_RED))));
return /* health <= 1.0f ? ChatFormat.DARK_RED : ( */ perc >= 1.0f ? Color.DARK_GREEN : (perc >= 0.75f ? Color.GREEN :
(perc >= 0.5f ? Color.YELLOW : (perc >= 0.25f ? Color.ORANGE : (perc >= 0.1f ? Color.RED : Color.DARK_RED))));
}
public static TextColor getMaxHpColor(int max) {
return max >= 2000 ? TextColor.BLACK : (max >= 500 ? TextColor.DARK_MAGENTA : (max >= 120 ? TextColor.MAGENTA :
(max >= 40 ? TextColor.CYAN : (max >= 15 ? TextColor.NEON : (max >= 5 ? TextColor.BLUE : TextColor.LIGHT_GRAY)))));
public static Color getMaxHpColor(int max) {
return max >= 2000 ? Color.BLACK : (max >= 500 ? Color.DARK_MAGENTA : (max >= 120 ? Color.MAGENTA :
(max >= 40 ? Color.CYAN : (max >= 15 ? Color.NEON : (max >= 5 ? Color.BLUE : Color.LIGHT_GRAY)))));
}
public int getEnergy(Energy type) {
@ -2272,7 +2272,7 @@ public abstract class EntityLiving extends Entity
public String formatStats() {
return String.format(this.getAlignment().prefix + " " + getHealthColor(this.getHealth(), this.getMaxHealth()) + "%d" +
TextColor.GRAY + "/" + getMaxHpColor(this.getMaxHealth()) + "%d",
Color.GRAY + "/" + getMaxHpColor(this.getMaxHealth()) + "%d",
this.getHealth(), this.getMaxHealth());
}
@ -2327,7 +2327,7 @@ public abstract class EntityLiving extends Entity
String kill;
IPlayer receiver = null;
if(this.combat.size() == 0) {
msg = kill = natural ? String.format("%s starb", this.getColoredName(TextColor.LIGHT_GRAY)) : null;
msg = kill = natural ? String.format("%s starb", this.getColoredName(Color.LIGHT_GRAY)) : null;
}
else {
CombatEntry strong = null;
@ -2366,16 +2366,16 @@ public abstract class EntityLiving extends Entity
ItemStack fallItem = fallEnt instanceof EntityLiving ? ((EntityLiving)fallEnt).getHeldItem() : null;
receiver = fallEnt.isPlayer() ? ((EntityNPC)fallEnt).connection : null;
if(fallItem != null) { // && fallItem.hasDisplayName()) {
msg = String.format("%s wurde von %s mit %s zum Fallen verdammt", this.getColoredName(TextColor.CYAN),
fallEnt.getColoredName(TextColor.CYAN), fallItem.getColoredName(TextColor.CYAN));
kill = String.format(TextColor.CYAN + "* %s mit %s zum Fallen verdammt",
this.getColoredName(TextColor.CYAN), fallItem.getColoredName(TextColor.CYAN));
msg = String.format("%s wurde von %s mit %s zum Fallen verdammt", this.getColoredName(Color.CYAN),
fallEnt.getColoredName(Color.CYAN), fallItem.getColoredName(Color.CYAN));
kill = String.format(Color.CYAN + "* %s mit %s zum Fallen verdammt",
this.getColoredName(Color.CYAN), fallItem.getColoredName(Color.CYAN));
}
else {
msg = String.format("%s wurde von %s zum Fallen verdammt", this.getColoredName(TextColor.CYAN),
fallEnt.getColoredName(TextColor.CYAN));
kill = String.format(TextColor.CYAN + "* %s zum Fallen verdammt",
this.getColoredName(TextColor.CYAN));
msg = String.format("%s wurde von %s zum Fallen verdammt", this.getColoredName(Color.CYAN),
fallEnt.getColoredName(Color.CYAN));
kill = String.format(Color.CYAN + "* %s zum Fallen verdammt",
this.getColoredName(Color.CYAN));
}
}
else if(lastEnt != null) {
@ -2383,24 +2383,24 @@ public abstract class EntityLiving extends Entity
receiver = lastEnt.isPlayer() ? ((EntityNPC)lastEnt).connection : null;
if(lastItem != null) { // && lastItem.hasDisplayName()) {
msg = String.format("%s fiel zu tief und wurde von %s mit %s erledigt",
this.getColoredName(TextColor.BLUE),
lastEnt.getColoredName(TextColor.BLUE), lastItem.getColoredName(TextColor.BLUE));
kill = String.format(TextColor.BLUE + "* %s mit %s erledigt",
this.getColoredName(TextColor.BLUE), lastItem.getColoredName(TextColor.BLUE));
this.getColoredName(Color.BLUE),
lastEnt.getColoredName(Color.BLUE), lastItem.getColoredName(Color.BLUE));
kill = String.format(Color.BLUE + "* %s mit %s erledigt",
this.getColoredName(Color.BLUE), lastItem.getColoredName(Color.BLUE));
}
else {
msg = String.format("%s fiel zu tief und wurde von %s erledigt", this.getColoredName(TextColor.BLUE),
lastEnt.getColoredName(TextColor.BLUE));
kill = String.format(TextColor.BLUE + "%s erledigt", this.getColoredName(TextColor.BLUE));
msg = String.format("%s fiel zu tief und wurde von %s erledigt", this.getColoredName(Color.BLUE),
lastEnt.getColoredName(Color.BLUE));
kill = String.format(Color.BLUE + "%s erledigt", this.getColoredName(Color.BLUE));
}
}
else {
msg = kill = natural ? String.format("%s wurde zum Fallen verdammt", this.getColoredName(TextColor.CYAN)) : null;
msg = kill = natural ? String.format("%s wurde zum Fallen verdammt", this.getColoredName(Color.CYAN)) : null;
}
}
else {
msg = kill = natural ? String.format("%s fiel " + (fall.blockType() == null ? "aus zu großer Höhe" : fall.blockType()),
this.getColoredName(TextColor.NEON)) : null;
this.getColoredName(Color.NEON)) : null;
}
}
else {

View file

@ -134,7 +134,7 @@ import common.log.Log;
import common.model.TextureAnimation;
import common.properties.Property;
import common.util.PortalType;
import common.util.TextColor;
import common.util.Color;
import common.util.Util;
import common.world.State;
@ -265,7 +265,7 @@ public abstract class BlockRegistry {
.setDisplay("Obsidian").setMiningLevel(3));
register("clay", (new BlockClay()).setHardness(0.6F).setSound(SoundType.GRAVEL).setDisplay("Ton").setShovelHarvestable());
register("hardened_clay", (new BlockHardenedClay()).setHardness(1.25F).setResistance(7.0F).setSound(SoundType.STONE).setDisplay("Gebrannter Ton"));
for(TextColor color : TextColor.values()) {
for(Color color : Color.values()) {
register(color.getName() + "_clay", (new BlockColoredClay(color)).setHardness(1.25F).setResistance(7.0F)
.setSound(SoundType.STONE).setDisplay(color.getDisplay() + " gefärbter Ton"));
}
@ -414,23 +414,23 @@ public abstract class BlockRegistry {
.setSound(SoundType.STONE).setDisplay("Geladener Block").setTab(CheatTab.GEMS));
register("glass", (new BlockGlass()).setHardness(0.3F).setSound(SoundType.GLASS).setDisplay("Glas"));
for(TextColor color : TextColor.values()) {
for(Color color : Color.values()) {
register(color.getName() + "_glass", (new BlockStainedGlass(color)).setHardness(0.3F).setSound(SoundType.GLASS).setDisplay(color.getDisplay() + " gefärbtes Glas"));
}
register("glass_pane", (new BlockPane(Material.TRANSLUCENT)).setHardness(0.3F).setSound(SoundType.GLASS).setDisplay("Glasscheibe"));
for(TextColor color : TextColor.values()) {
for(Color color : Color.values()) {
register(color.getName() + "_glass_pane", (new BlockStainedGlassPane(color)).setHardness(0.3F).setSound(SoundType.GLASS).setDisplay(color.getDisplay() + " gefärbte Glasscheibe"));
}
for(TextColor color : TextColor.values()) {
for(Color color : Color.values()) {
register(color.getName() + "_wool", (new BlockWool(color)).setHardness(0.8F).setSound(SoundType.CLOTH).setDisplay(color.getSubject(-1) + " Wolle")
.setShearsEfficiency(1));
}
for(TextColor color : TextColor.values()) {
for(Color color : Color.values()) {
register(color.getName() + "_carpet", (new BlockCarpet(color)).setHardness(0.1F).setSound(SoundType.CLOTH).setDisplay(color.getSubject(1) + " Teppich").setOpacity(0));
}
for(TextColor color : BlockBed.COLORS) {
for(Color color : BlockBed.COLORS) {
register(color.getName() + "_bed", (new BlockBed(color)).setSound(SoundType.WOOD).setHardness(0.2F).setDisplay(color.getSubject(0) + " Bett"));
}

View file

@ -18,7 +18,7 @@ import common.inventory.InventoryCrafting;
import common.item.Item;
import common.item.ItemStack;
import common.item.material.ItemDye;
import common.util.TextColor;
import common.util.Color;
public abstract class CraftingRegistry
{
@ -156,47 +156,51 @@ public abstract class CraftingRegistry
add(new ItemStack(Items.blood_brick, 1), "NN", "NN", 'N', Items.bloodbrick);
add(new ItemStack(Items.coarse_dirt, 4), "DG", "GD", 'D', Items.dirt, 'G', Items.gravel);
for (TextColor color : TextColor.values())
for (Color color : Color.values())
{
ItemDye dye = ItemDye.getByColor(color);
if(color != TextColor.WHITE)
if(color != Color.WHITE)
addShapeless(new ItemStack(BlockWool.getByColor(color).getItem()), dye, Items.white_wool);
add(new ItemStack(BlockColoredClay.getByColor(color).getItem(), 8), "###", "#X#", "###", '#', Items.hardened_clay, 'X', dye);
add(new ItemStack(BlockStainedGlass.getByColor(color).getItem(), 8), "###", "#X#", "###", '#', Items.glass, 'X', dye);
add(new ItemStack(BlockStainedGlassPane.getByColor(color).getItem(), 16), "###", "###", '#', BlockStainedGlass.getByColor(color).getItem());
}
addShapeless(new ItemStack(ItemDye.getByColor(TextColor.YELLOW)), Items.dandelion);
addShapeless(new ItemStack(ItemDye.getByColor(TextColor.RED)), Items.rose);
addShapeless(new ItemStack(ItemDye.getByColor(TextColor.RED)), Items.poppy);
addShapeless(new ItemStack(ItemDye.getByColor(TextColor.WHITE), 3), Items.bone);
addShapeless(new ItemStack(ItemDye.getByColor(TextColor.MAGENTA), 2), new ItemStack(ItemDye.getByColor(TextColor.RED)), new ItemStack(ItemDye.getByColor(TextColor.WHITE)));
addShapeless(new ItemStack(ItemDye.getByColor(TextColor.ORANGE), 2), new ItemStack(ItemDye.getByColor(TextColor.RED)), new ItemStack(ItemDye.getByColor(TextColor.YELLOW)));
addShapeless(new ItemStack(ItemDye.getByColor(TextColor.GREEN), 2), new ItemStack(ItemDye.getByColor(TextColor.DARK_GREEN)), new ItemStack(ItemDye.getByColor(TextColor.WHITE)));
addShapeless(new ItemStack(ItemDye.getByColor(TextColor.GRAY), 2), new ItemStack(ItemDye.getByColor(TextColor.BLACK)), new ItemStack(ItemDye.getByColor(TextColor.WHITE)));
addShapeless(new ItemStack(ItemDye.getByColor(TextColor.LIGHT_GRAY), 2), new ItemStack(ItemDye.getByColor(TextColor.GRAY)), new ItemStack(ItemDye.getByColor(TextColor.WHITE)));
addShapeless(new ItemStack(ItemDye.getByColor(TextColor.LIGHT_GRAY), 3), new ItemStack(ItemDye.getByColor(TextColor.BLACK)), new ItemStack(ItemDye.getByColor(TextColor.WHITE)), new ItemStack(ItemDye.getByColor(TextColor.WHITE)));
addShapeless(new ItemStack(ItemDye.getByColor(TextColor.LIGHT_BLUE), 2), new ItemStack(ItemDye.getByColor(TextColor.BLUE)), new ItemStack(ItemDye.getByColor(TextColor.WHITE)));
addShapeless(new ItemStack(ItemDye.getByColor(TextColor.CYAN), 2), new ItemStack(ItemDye.getByColor(TextColor.BLUE)), new ItemStack(ItemDye.getByColor(TextColor.DARK_GREEN)));
addShapeless(new ItemStack(ItemDye.getByColor(TextColor.VIOLET), 2), new ItemStack(ItemDye.getByColor(TextColor.BLUE)), new ItemStack(ItemDye.getByColor(TextColor.RED)));
addShapeless(new ItemStack(ItemDye.getByColor(TextColor.DARK_MAGENTA), 2), new ItemStack(ItemDye.getByColor(TextColor.VIOLET)), new ItemStack(ItemDye.getByColor(TextColor.MAGENTA)));
addShapeless(new ItemStack(ItemDye.getByColor(TextColor.DARK_MAGENTA), 3), new ItemStack(ItemDye.getByColor(TextColor.BLUE)), new ItemStack(ItemDye.getByColor(TextColor.RED)), new ItemStack(ItemDye.getByColor(TextColor.MAGENTA)));
addShapeless(new ItemStack(ItemDye.getByColor(TextColor.MAGENTA), 4), new ItemStack(ItemDye.getByColor(TextColor.BLUE)), new ItemStack(ItemDye.getByColor(TextColor.RED)), new ItemStack(ItemDye.getByColor(TextColor.RED)), new ItemStack(ItemDye.getByColor(TextColor.WHITE)));
addShapeless(new ItemStack(ItemDye.getByColor(TextColor.LIGHT_BLUE)), Items.blue_orchid);
addShapeless(new ItemStack(ItemDye.getByColor(TextColor.MAGENTA)), Items.allium);
addShapeless(new ItemStack(ItemDye.getByColor(TextColor.LIGHT_GRAY)), Items.houstonia);
addShapeless(new ItemStack(ItemDye.getByColor(TextColor.RED)), Items.red_tulip);
addShapeless(new ItemStack(ItemDye.getByColor(TextColor.ORANGE)), Items.orange_tulip);
addShapeless(new ItemStack(ItemDye.getByColor(TextColor.LIGHT_GRAY)), Items.white_tulip);
addShapeless(new ItemStack(ItemDye.getByColor(TextColor.MAGENTA)), Items.pink_tulip);
addShapeless(new ItemStack(ItemDye.getByColor(TextColor.LIGHT_GRAY)), Items.daisy);
addShapeless(new ItemStack(ItemDye.getByColor(TextColor.YELLOW), 2), Items.sunflower);
addShapeless(new ItemStack(ItemDye.getByColor(TextColor.MAGENTA), 2), Items.syringa);
addShapeless(new ItemStack(ItemDye.getByColor(TextColor.RED), 2), Items.rose_bush);
addShapeless(new ItemStack(ItemDye.getByColor(TextColor.MAGENTA), 2), Items.paeonia);
addShapeless(new ItemStack(ItemDye.getByColor(TextColor.DARK_GREEN)), Items.cactus);
addShapeless(new ItemStack(ItemDye.getByColor(Color.YELLOW)), Items.dandelion);
addShapeless(new ItemStack(ItemDye.getByColor(Color.RED)), Items.rose);
addShapeless(new ItemStack(ItemDye.getByColor(Color.RED)), Items.poppy);
addShapeless(new ItemStack(ItemDye.getByColor(Color.WHITE), 3), Items.bone);
addShapeless(new ItemStack(ItemDye.getByColor(Color.MAGENTA), 2), new ItemStack(ItemDye.getByColor(Color.RED)), new ItemStack(ItemDye.getByColor(Color.WHITE)));
addShapeless(new ItemStack(ItemDye.getByColor(Color.ORANGE), 2), new ItemStack(ItemDye.getByColor(Color.RED)), new ItemStack(ItemDye.getByColor(Color.YELLOW)));
addShapeless(new ItemStack(ItemDye.getByColor(Color.GREEN), 2), new ItemStack(ItemDye.getByColor(Color.DARK_GREEN)), new ItemStack(ItemDye.getByColor(Color.WHITE)));
addShapeless(new ItemStack(ItemDye.getByColor(Color.GRAY), 2), new ItemStack(ItemDye.getByColor(Color.BLACK)), new ItemStack(ItemDye.getByColor(Color.WHITE)));
addShapeless(new ItemStack(ItemDye.getByColor(Color.LIGHT_GRAY), 2), new ItemStack(ItemDye.getByColor(Color.GRAY)), new ItemStack(ItemDye.getByColor(Color.WHITE)));
addShapeless(new ItemStack(ItemDye.getByColor(Color.LIGHT_GRAY), 3), new ItemStack(ItemDye.getByColor(Color.BLACK)), new ItemStack(ItemDye.getByColor(Color.WHITE)), new ItemStack(ItemDye.getByColor(Color.WHITE)));
addShapeless(new ItemStack(ItemDye.getByColor(Color.LIGHT_BLUE), 2), new ItemStack(ItemDye.getByColor(Color.BLUE)), new ItemStack(ItemDye.getByColor(Color.WHITE)));
addShapeless(new ItemStack(ItemDye.getByColor(Color.CYAN), 2), new ItemStack(ItemDye.getByColor(Color.BLUE)), new ItemStack(ItemDye.getByColor(Color.DARK_GREEN)));
addShapeless(new ItemStack(ItemDye.getByColor(Color.VIOLET), 2), new ItemStack(ItemDye.getByColor(Color.BLUE)), new ItemStack(ItemDye.getByColor(Color.RED)));
addShapeless(new ItemStack(ItemDye.getByColor(Color.DARK_MAGENTA), 2), new ItemStack(ItemDye.getByColor(Color.VIOLET)), new ItemStack(ItemDye.getByColor(Color.MAGENTA)));
addShapeless(new ItemStack(ItemDye.getByColor(Color.DARK_MAGENTA), 3), new ItemStack(ItemDye.getByColor(Color.BLUE)), new ItemStack(ItemDye.getByColor(Color.RED)), new ItemStack(ItemDye.getByColor(Color.MAGENTA)));
addShapeless(new ItemStack(ItemDye.getByColor(Color.MAGENTA), 4), new ItemStack(ItemDye.getByColor(Color.BLUE)), new ItemStack(ItemDye.getByColor(Color.RED)), new ItemStack(ItemDye.getByColor(Color.RED)), new ItemStack(ItemDye.getByColor(Color.WHITE)));
addShapeless(new ItemStack(ItemDye.getByColor(Color.LIGHT_BLUE)), Items.blue_orchid);
addShapeless(new ItemStack(ItemDye.getByColor(Color.MAGENTA)), Items.allium);
addShapeless(new ItemStack(ItemDye.getByColor(Color.LIGHT_GRAY)), Items.houstonia);
addShapeless(new ItemStack(ItemDye.getByColor(Color.RED)), Items.red_tulip);
addShapeless(new ItemStack(ItemDye.getByColor(Color.ORANGE)), Items.orange_tulip);
addShapeless(new ItemStack(ItemDye.getByColor(Color.LIGHT_GRAY)), Items.white_tulip);
addShapeless(new ItemStack(ItemDye.getByColor(Color.MAGENTA)), Items.pink_tulip);
addShapeless(new ItemStack(ItemDye.getByColor(Color.LIGHT_GRAY)), Items.daisy);
addShapeless(new ItemStack(ItemDye.getByColor(Color.YELLOW), 2), Items.sunflower);
addShapeless(new ItemStack(ItemDye.getByColor(Color.MAGENTA), 2), Items.syringa);
addShapeless(new ItemStack(ItemDye.getByColor(Color.RED), 2), Items.rose_bush);
addShapeless(new ItemStack(ItemDye.getByColor(Color.MAGENTA), 2), Items.paeonia);
addShapeless(new ItemStack(ItemDye.getByColor(Color.DARK_GREEN)), Items.cactus);
addShapeless(new ItemStack(ItemDye.getByColor(Color.WHITE)), Items.grinded_bones);
addShapeless(new ItemStack(ItemDye.getByColor(Color.BROWN)), Items.cocoa_powder);
addShapeless(new ItemStack(ItemDye.getByColor(Color.BLACK)), Items.ink_sack);
addShapeless(new ItemStack(ItemDye.getByColor(Color.BLUE)), Items.lapis_lazuli);
for (TextColor color : TextColor.values())
for (Color color : Color.values())
{
add(new ItemStack(BlockCarpet.getByColor(color).getItem(), 3), "##", '#', BlockWool.getByColor(color).getItem());
}
@ -230,7 +234,7 @@ public abstract class CraftingRegistry
add(new ItemStack(Items.wooden_button, 1), "#", '#', planks);
add(new ItemStack(Items.wooden_pressure_plate, 1), "##", '#', planks);
add(new ItemStack(Items.piston, 1), "TTT", "#X#", "#R#", '#', Items.cobblestone, 'X', Items.iron_ingot, 'R', Items.charged_powder, 'T', planks);
for(TextColor color : BlockBed.COLORS) {
for(Color color : BlockBed.COLORS) {
add(new ItemStack(ItemRegistry.byName(color.getName() + "_bed"), 1), "###", "XXX", '#', BlockWool.getByColor(color).getItem(), 'X', planks);
}
}

View file

@ -36,6 +36,7 @@ import common.item.material.ItemBottle;
import common.item.material.ItemBucket;
import common.item.material.ItemDye;
import common.item.material.ItemEnchantedBook;
import common.item.material.ItemGrindedBones;
import common.item.material.ItemHorseArmor;
import common.item.material.ItemMetal;
import common.item.material.ItemRecord;
@ -79,7 +80,7 @@ import common.item.weapon.ItemSword;
import common.item.weapon.ItemTrident;
import common.log.Log;
import common.util.Pair;
import common.util.TextColor;
import common.util.Color;
import common.util.Util;
import common.world.Weather;
@ -204,7 +205,7 @@ public abstract class ItemRegistry {
register("green_keycard", (new ItemKey()).setDisplay("Grüne Schlüsselkarte").setTab(CheatTab.TOOLS).setMaxAmount(StackSize.L));
register("blue_keycard", (new ItemKey()).setDisplay("Blaue Schlüsselkarte").setTab(CheatTab.TOOLS).setMaxAmount(StackSize.L));
register("black_keycard", (new ItemKey()).setDisplay("Schwarze Schlüsselkarte").setTab(CheatTab.TOOLS).setMaxAmount(StackSize.L));
for(Pair<Integer, TextColor> sides : ItemDie.DIE_SIDES) {
for(Pair<Integer, Color> sides : ItemDie.DIE_SIDES) {
register("die_" + sides.first(), (new ItemDie(sides.first(), sides.second())).setMaxAmount(StackSize.L));
}
register("chick_magnet", (new ItemMagnet(true)).setDisplay("Kükenmagnet"));
@ -258,12 +259,8 @@ public abstract class ItemRegistry {
register(type.getName(), (new ItemFishFood(false, type)));
register("cooked_" + type.getName(), (new ItemFishFood(true, type)));
}
Item lapis = null;
for(TextColor color : TextColor.values()) {
Item dye = new ItemDye(color);
if(color == TextColor.BLUE)
lapis = dye;
register(color.getDye(), dye);
for(Color color : Color.values()) {
register(color.getName() + "_dye", new ItemDye(color));
}
register("bone", (new Item()).setDisplay("Knochen").setTab(CheatTab.MATERIALS).setMaxAmount(StackSize.L));
register("sugar", (new Item()).setDisplay("Zucker").setTab(CheatTab.MATERIALS).setMaxAmount(StackSize.XXL));
@ -295,6 +292,11 @@ public abstract class ItemRegistry {
register("fireball", (new ItemFireball()).setDisplay("Feuerkugel"));
Item emerald = (new Item()).setDisplay("Smaragd").setTab(CheatTab.METALS);
register("emerald", emerald);
register("cocoa_powder", new Item().setTab(CheatTab.MATERIALS).setDisplay("Gemahlene Kakaobohnen").setMaxAmount(StackSize.L));
Item lapis = new Item().setTab(CheatTab.METALS).setDisplay("Lapislazuli").setMaxAmount(StackSize.L);
register("lapis_lazuli", lapis);
register("grinded_bones", new ItemGrindedBones().setTab(CheatTab.MATERIALS).setDisplay("Gemahlene Knochen").setMaxAmount(StackSize.L));
register("ink_sack", new Item().setTab(CheatTab.MATERIALS).setDisplay("Tintenbeutel").setMaxAmount(StackSize.L));
register("carrot", new ItemSeedFood(3, Blocks.carrots, Blocks.farmland).setDisplay("Karotte").setMaxAmount(StackSize.L));
@ -305,7 +307,7 @@ public abstract class ItemRegistry {
register("melon_seed", new ItemSeeds(Blocks.melon_stem, Blocks.farmland).setDisplay("Melonenkerne").setMaxAmount(StackSize.XL));
register("whip", (new ItemWhip()).setDisplay("Peitsche"));
register("charge_crystal", (new Item()).setDisplay("Energiekristall").setTab(CheatTab.MISC).setColor(TextColor.DARK_MAGENTA).setGleaming());
register("charge_crystal", (new Item()).setDisplay("Energiekristall").setTab(CheatTab.MISC).setColor(Color.DARK_MAGENTA).setGleaming());
for(Enchantment ench : Enchantment.values()) {
register("enchanted_book_" + ench.getName(), (new ItemEnchantedBook(ench, 1)).setUnstackable().setDisplay("Verzaubertes Buch mit " + ench.getFormattedName(1)).setTab(CheatTab.ENCHANTMENTS));
int max = ench.getMaxLevel();
@ -323,7 +325,7 @@ public abstract class ItemRegistry {
register("lead", (new ItemLead()).setDisplay("Leine").setMaxAmount(StackSize.L));
register("name_tag", (new ItemNameTag()).setDisplay("Namensschild"));
for(int z = 0; z < ItemDynamite.DYNAMITE.length; z++) {
register("dynamite" + (z == 0 ? "" : ("_" + z)), (new ItemDynamite(z)).setDisplay("Dynamit" + Util.getTierSuffix(z)).setColor(TextColor.RED));
register("dynamite" + (z == 0 ? "" : ("_" + z)), (new ItemDynamite(z)).setDisplay("Dynamit" + Util.getTierSuffix(z)).setColor(Color.RED));
}
register("chain", (new Item()).setDisplay("Kette").setTab(CheatTab.MATERIALS).setMagnetic());
Item chargedPowder = (new Item()).setDisplay("Geladener Staub").setTab(CheatTab.METALS).setMagnetic();

View file

@ -23,6 +23,7 @@ import common.item.material.ItemBottle;
import common.item.material.ItemBucket;
import common.item.material.ItemDye;
import common.item.material.ItemEnchantedBook;
import common.item.material.ItemGrindedBones;
import common.item.material.ItemHorseArmor;
import common.item.material.ItemMetal;
import common.item.material.ItemRecord;
@ -187,7 +188,6 @@ public abstract class Items {
public static final ItemAmmo bolt = get("bolt");
public static final ItemBoltgun boltgun = get("boltgun");
public static final Item bone = get("bone");
public static final ItemDye bonemeal = get("bonemeal");
public static final ItemBook book = get("book");
public static final Item bookshelf = get("bookshelf");
public static final ItemBow bow = get("bow");
@ -266,7 +266,6 @@ public abstract class Items {
public static final Item cobblestone_slab = get("cobblestone_slab");
public static final Item cobblestone_stairs = get("cobblestone_stairs");
public static final Item cobblestone_wall = get("cobblestone_wall");
public static final ItemDye cocoa_powder = get("cocoa_powder");
public static final Item construction_table = get("construction_table");
public static final ItemFood cooked_beef = get("cooked_beef");
public static final ItemFood cooked_chicken = get("cooked_chicken");
@ -406,7 +405,6 @@ public abstract class Items {
public static final ItemBucket hydrogen_bucket = get("hydrogen_bucket");
public static final Item ice = get("ice");
public static final ItemScanner scanner = get("scanner");
public static final ItemDye ink_sack = get("ink_sack");
public static final Item iodine_block = get("iodine_block");
public static final Item iodine_ore = get("iodine_ore");
public static final ItemMetal iodine_powder = get("iodine_powder");
@ -442,7 +440,6 @@ public abstract class Items {
public static final Item jungle_stairs = get("jungle_stairs");
public static final Item ladder = get("ladder");
public static final Item lapis_block = get("lapis_block");
public static final ItemDye lapis_lazuli = get("lapis_lazuli");
public static final Item lapis_ore = get("lapis_ore");
public static final Item large_fern = get("large_fern");
public static final Item large_tallgrass = get("large_tallgrass");
@ -1066,6 +1063,14 @@ public abstract class Items {
public static final Item violet_glass = get("violet_glass");
public static final Item violet_glass_pane = get("violet_glass_pane");
public static final Item violet_wool = get("violet_wool");
public static final ItemDye white_dye = get("white_dye");
public static final ItemDye brown_dye = get("brown_dye");
public static final ItemDye black_dye = get("black_dye");
public static final ItemDye blue_dye = get("blue_dye");
public static final ItemGrindedBones grinded_bones = get("grinded_bones");
public static final Item cocoa_powder = get("cocoa_powder");
public static final Item ink_sack = get("ink_sack");
public static final Item lapis_lazuli = get("lapis_lazuli");
private static <T extends Item> T get(String id) {
T item = (T)ItemRegistry.byName(id);

View file

@ -1,6 +1,6 @@
package common.init;
import common.util.TextColor;
import common.util.Color;
public enum MetalType {
IRON("iron", 26, "Fe", "Eisen", 0, new ToolMaterial(2, 8.0f, 0.0f, 250, 6.0F, 2, 14, true, 15, 9, 2, 6, 5, 2).setMagnetic()),
@ -87,15 +87,15 @@ public enum MetalType {
}
public String formatSymbol() {
return TextColor.YELLOW + "Element-Symbol: " + TextColor.ORANGE + this.order + " " + this.sign;
return Color.YELLOW + "Element-Symbol: " + Color.ORANGE + this.order + " " + this.sign;
}
public String formatRarity() {
return TextColor.DARK_MAGENTA + "Seltenheit: " + TextColor.NEON + "" + (this.rarity + 1);
return Color.DARK_MAGENTA + "Seltenheit: " + Color.NEON + "" + (this.rarity + 1);
}
public String formatRadioactivity() {
return TextColor.RED + "Radioaktivität: " + TextColor.GREEN + String.format("%.1f RN", this.radioactivity * 100.0f);
return Color.RED + "Radioaktivität: " + Color.GREEN + String.format("%.1f RN", this.radioactivity * 100.0f);
}
public boolean isMagnetic() {

View file

@ -20,7 +20,7 @@ import common.util.ExtMath;
import common.util.Facing;
import common.util.HitPosition;
import common.util.Serverside;
import common.util.TextColor;
import common.util.Color;
import common.util.Vec3;
import common.world.AWorldServer;
import common.world.World;
@ -33,7 +33,7 @@ public class Item {
private Item containerItem;
private String display;
private CheatTab tab;
private TextColor color = null;
private Color color = null;
private int defColor = 0xffffffff;
private boolean magnetic = false;
private boolean gleaming = false;
@ -88,7 +88,7 @@ public class Item {
return this;
}
public final Item setColor(TextColor color) {
public final Item setColor(Color color) {
this.color = color;
return this;
}
@ -136,8 +136,8 @@ public class Item {
return this.containerItem != null;
}
public final TextColor getColor(ItemStack stack) {
return this.color != null ? this.color : (stack.isItemEnchanted() ? TextColor.NEON : TextColor.WHITE);
public final Color getColor(ItemStack stack) {
return this.color != null ? this.color : (stack.isItemEnchanted() ? Color.NEON : Color.WHITE);
}
public final CheatTab getTab() {

View file

@ -17,7 +17,7 @@ import common.init.ItemRegistry;
import common.item.weapon.ItemBow;
import common.rng.Random;
import common.tags.TagObject;
import common.util.TextColor;
import common.util.Color;
public final class ItemStack {
public static final int MAX_SIZE = 67108864;
@ -232,15 +232,15 @@ public final class ItemStack {
return this.getColor() + this.getDisplayName();
}
public String getColoredName(TextColor reset) {
return TextColor.DARK_GRAY + "[" + this.getColor() + this.getDisplayName() + TextColor.DARK_GRAY + "]" + reset;
public String getColoredName(Color reset) {
return Color.DARK_GRAY + "[" + this.getColor() + this.getDisplayName() + Color.DARK_GRAY + "]" + reset;
}
public boolean hasDisplayName() {
return this.name != null;
}
public TextColor getColor() {
public Color getColor() {
return this.item.getColor(this);
}

View file

@ -4,7 +4,7 @@ import common.effect.Effect;
import common.effect.StatusEffect;
import common.entity.npc.EntityNPC;
import common.item.ItemStack;
import common.util.TextColor;
import common.util.Color;
import common.world.World;
public class ItemAppleGold extends ItemFood
@ -15,7 +15,7 @@ public class ItemAppleGold extends ItemFood
{
super(amount, false);
this.powered = powered;
this.setColor(powered ? TextColor.MAGENTA : TextColor.NEON);
this.setColor(powered ? Color.MAGENTA : Color.NEON);
if(this.powered)
this.setGleaming();
}

View file

@ -22,7 +22,7 @@ import common.util.Clientside;
import common.util.Facing;
import common.util.Pair;
import common.util.Serverside;
import common.util.TextColor;
import common.util.Color;
import common.util.Vec3;
import common.world.AWorldServer;
import common.world.World;
@ -74,7 +74,7 @@ public class ItemPotion extends Item
this.effect = effect;
this.setMaxAmount(StackSize.XS);
this.setTab(CheatTab.POTIONS);
this.setColor(TextColor.ORK);
this.setColor(Color.ORK);
this.setDisplay(getDisplay(this));
if(this.effect != null)
this.setGleaming();
@ -212,18 +212,18 @@ public class ItemPotion extends Item
if (potion.isBadEffect())
{
tooltip.add(TextColor.RED + s1);
tooltip.add(Color.RED + s1);
}
else
{
tooltip.add(TextColor.LIGHT_GRAY + s1);
tooltip.add(Color.LIGHT_GRAY + s1);
}
String effectTip = this.effect.getPotion().getTooltip(this.effect.getAmplifier());
if(effectTip != null)
tooltip.add(effectTip);
}
else if(this.type != null) {
tooltip.add(TextColor.LIGHT_GRAY + "Wirkungslos");
tooltip.add(Color.LIGHT_GRAY + "Wirkungslos");
}
}

View file

@ -2,7 +2,6 @@ package common.item.material;
import common.block.Block;
import common.block.artificial.BlockBed;
import common.block.foliage.IGrowable;
import common.entity.animal.EntitySheep;
import common.entity.npc.EntityNPC;
import common.entity.types.EntityLiving;
@ -12,43 +11,34 @@ import common.item.CheatTab;
import common.item.Item;
import common.item.ItemStack;
import common.item.StackSize;
import common.tileentity.TileEntity;
import common.util.BlockPos;
import common.util.Clientside;
import common.util.Facing;
import common.util.ParticleType;
import common.util.Serverside;
import common.util.TextColor;
import common.util.Vec3;
import common.util.Color;
import common.world.State;
import common.world.World;
import common.world.AWorldServer;
public class ItemDye extends Item {
private static final ItemDye[] DIES = new ItemDye[TextColor.values().length];
private static final ItemDye[] DIES = new ItemDye[Color.values().length];
private final TextColor color;
private final Color color;
public static ItemDye getByColor(TextColor color) {
public static ItemDye getByColor(Color color) {
return DIES[color.ordinal()];
}
public ItemDye(TextColor color)
public ItemDye(Color color)
{
this.color = color;
this.setTab(color == TextColor.BLUE ? CheatTab.METALS : CheatTab.MATERIALS);
this.setDisplay(color.getDyeName());
this.setTab(CheatTab.MATERIALS);
this.setDisplay(color.getSubject(1) + " Farbstoff");
this.setMaxAmount(StackSize.XXL);
DIES[this.color.ordinal()] = this;
}
public TextColor getColor() {
public Color getColor() {
return this.color;
}
/**
* Called when a Block is right-clicked with this Item
*/
public boolean onItemUse(ItemStack stack, EntityNPC playerIn, World worldIn, BlockPos pos, Facing side, float hitX, float hitY, float hitZ)
{
if (!playerIn.canPlayerEdit(pos.offset(side), side, stack))
@ -57,18 +47,6 @@ public class ItemDye extends Item {
}
else
{
if (this.color == TextColor.WHITE)
{
if (applyBonemeal(stack, worldIn, pos))
{
if (!worldIn.client)
{
worldIn.playEffect(2005, pos, 0);
}
return true;
}
}
State iblockstate = worldIn.getState(pos);
if(iblockstate.getBlock() instanceof BlockBed) {
Block bedBlock = BlockRegistry.byName(this.color.getName() + "_bed");
@ -104,57 +82,6 @@ public class ItemDye extends Item {
}
}
public static boolean applyBonemeal(ItemStack stack, World worldIn, BlockPos target)
{
State iblockstate = worldIn.getState(target);
if (iblockstate.getBlock() instanceof IGrowable)
{
IGrowable igrowable = (IGrowable)iblockstate.getBlock();
if (igrowable.canGrow(worldIn, target, iblockstate, worldIn.client))
{
if (!worldIn.client)
{
if (igrowable.canUseBonemeal(worldIn, worldIn.rand, target, iblockstate))
{
igrowable.grow((AWorldServer)worldIn, worldIn.rand, target, iblockstate);
}
stack.decrSize();
}
return true;
}
}
return false;
}
@Clientside
public static void spawnBonemealParticles(World worldIn, BlockPos pos, int amount)
{
if (amount == 0)
{
amount = 15;
}
Block block = worldIn.getState(pos).getBlock();
if (block != Blocks.air)
{
block.setBlockBounds(worldIn, pos);
for (int i = 0; i < amount; ++i)
{
worldIn.clientParticle(ParticleType.GROW, (double)((float)pos.getX() + worldIn.rand.floatv()), (double)pos.getY() + (double)worldIn.rand.floatv() * block.getBlockBoundsMaxY(), (double)((float)pos.getZ() + worldIn.rand.floatv()));
}
}
}
/**
* Returns true if the item can be used on the given entity, e.g. shears on sheep.
*/
public boolean itemInteractionForEntity(ItemStack stack, EntityNPC playerIn, EntityLiving target)
{
if (target instanceof EntitySheep)
@ -174,31 +101,4 @@ public class ItemDye extends Item {
return false;
}
}
@Serverside
public ItemStack dispenseStack(AWorldServer world, TileEntity source, Vec3 position, BlockPos blockpos, Facing facing, ItemStack stack) {
if(this.color != TextColor.WHITE)
return super.dispenseStack(world, source, position, blockpos, facing, stack);
BlockPos pos = blockpos = blockpos.offset(facing);
if (applyBonemeal(stack, world, pos))
{
if (!world.client)
{
world.playEffect(2005, pos, 0);
}
world.playEffect(1000, blockpos, 0);
}
else
{
world.playEffect(1001, blockpos, 0);
}
return stack;
}
@Serverside
public int getDispenseSoundId() {
return this.color == TextColor.WHITE ? 0 : super.getDispenseSoundId();
}
}

View file

@ -14,7 +14,7 @@ import common.item.ItemStack;
import common.item.RngLoot;
import common.rng.Random;
import common.util.Clientside;
import common.util.TextColor;
import common.util.Color;
public class ItemEnchantedBook extends Item
{
@ -25,7 +25,7 @@ public class ItemEnchantedBook extends Item
private final int level;
public ItemEnchantedBook(Enchantment enchantment, int level) {
this.setColor(TextColor.YELLOW);
this.setColor(Color.YELLOW);
this.setGleaming();
this.enchantment = enchantment;
this.level = level;

View file

@ -0,0 +1,115 @@
package common.item.material;
import common.block.Block;
import common.block.foliage.IGrowable;
import common.entity.npc.EntityNPC;
import common.init.Blocks;
import common.item.Item;
import common.item.ItemStack;
import common.tileentity.TileEntity;
import common.util.BlockPos;
import common.util.Clientside;
import common.util.Facing;
import common.util.ParticleType;
import common.util.Serverside;
import common.util.Vec3;
import common.world.State;
import common.world.World;
import common.world.AWorldServer;
public class ItemGrindedBones extends Item {
public boolean onItemUse(ItemStack stack, EntityNPC playerIn, World worldIn, BlockPos pos, Facing side, float hitX, float hitY, float hitZ)
{
if (!playerIn.canPlayerEdit(pos.offset(side), side, stack))
{
return false;
}
else
{
if (applyBonemeal(stack, worldIn, pos))
{
if (!worldIn.client)
{
worldIn.playEffect(2005, pos, 0);
}
return true;
}
return false;
}
}
public static boolean applyBonemeal(ItemStack stack, World worldIn, BlockPos target)
{
State iblockstate = worldIn.getState(target);
if (iblockstate.getBlock() instanceof IGrowable)
{
IGrowable igrowable = (IGrowable)iblockstate.getBlock();
if (igrowable.canGrow(worldIn, target, iblockstate, worldIn.client))
{
if (!worldIn.client)
{
if (igrowable.canUseBonemeal(worldIn, worldIn.rand, target, iblockstate))
{
igrowable.grow((AWorldServer)worldIn, worldIn.rand, target, iblockstate);
}
stack.decrSize();
}
return true;
}
}
return false;
}
@Clientside
public static void spawnParticles(World worldIn, BlockPos pos, int amount)
{
if (amount == 0)
{
amount = 15;
}
Block block = worldIn.getState(pos).getBlock();
if (block != Blocks.air)
{
block.setBlockBounds(worldIn, pos);
for (int i = 0; i < amount; ++i)
{
worldIn.clientParticle(ParticleType.GROW, (double)((float)pos.getX() + worldIn.rand.floatv()), (double)pos.getY() + (double)worldIn.rand.floatv() * block.getBlockBoundsMaxY(), (double)((float)pos.getZ() + worldIn.rand.floatv()));
}
}
}
@Serverside
public ItemStack dispenseStack(AWorldServer world, TileEntity source, Vec3 position, BlockPos blockpos, Facing facing, ItemStack stack) {
BlockPos pos = blockpos = blockpos.offset(facing);
if (applyBonemeal(stack, world, pos))
{
if (!world.client)
{
world.playEffect(2005, pos, 0);
}
world.playEffect(1000, blockpos, 0);
}
else
{
world.playEffect(1001, blockpos, 0);
}
return stack;
}
@Serverside
public int getDispenseSoundId() {
return 0;
}
}

View file

@ -9,7 +9,7 @@ import common.init.MetalType;
import common.item.Item;
import common.item.ItemStack;
import common.util.Clientside;
import common.util.TextColor;
import common.util.Color;
public class ItemMetal extends Item {
private final MetalType metal;
@ -17,7 +17,7 @@ public class ItemMetal extends Item {
public ItemMetal(MetalType metal) {
this.metal = metal;
if(this.metal.radioactivity > 0.0f)
this.setColor(TextColor.GREEN);
this.setColor(Color.GREEN);
if(this.metal.isMagnetic())
this.setMagnetic();
}

View file

@ -12,7 +12,7 @@ import common.item.ItemStack;
import common.util.BlockPos;
import common.util.Facing;
import common.util.ParticleType;
import common.util.TextColor;
import common.util.Color;
import common.world.State;
import common.world.World;
@ -22,7 +22,7 @@ public class ItemChargedOrb extends Item
{
this.setTab(CheatTab.MAGIC);
this.setMaxDamage(16);
this.setColor(TextColor.DARK_MAGENTA);
this.setColor(Color.DARK_MAGENTA);
this.setFragile();
}

View file

@ -19,25 +19,25 @@ import common.util.Clientside;
import common.util.Facing;
import common.util.Pair;
import common.util.Serverside;
import common.util.TextColor;
import common.util.Color;
import common.util.Vec3;
import common.world.AWorldServer;
import common.world.World;
public class ItemDie extends Item
{
public static final Pair<Integer, TextColor>[] DIE_SIDES = new Pair[] {
new Pair(4, TextColor.DARK_GREEN),
new Pair(6, TextColor.NEON),
new Pair(8, TextColor.DARK_MAGENTA),
new Pair(10, TextColor.MAGENTA),
new Pair(12, TextColor.DARK_RED),
new Pair(20, TextColor.ORANGE)
public static final Pair<Integer, Color>[] DIE_SIDES = new Pair[] {
new Pair(4, Color.DARK_GREEN),
new Pair(6, Color.NEON),
new Pair(8, Color.DARK_MAGENTA),
new Pair(10, Color.MAGENTA),
new Pair(12, Color.DARK_RED),
new Pair(20, Color.ORANGE)
};
public static final Map<Integer, ItemDie> DICE = Maps.newTreeMap();
private final int sides;
private final TextColor color;
private final Color color;
public static final ItemDie getBySides(int sides) {
ItemDie die = DICE.get(sides);
@ -48,7 +48,7 @@ public class ItemDie extends Item
return DICE.values();
}
public ItemDie(int sides, TextColor color)
public ItemDie(int sides, Color color)
{
this.sides = sides;
this.color = color;
@ -61,7 +61,7 @@ public class ItemDie extends Item
return this.sides;
}
public TextColor getDieColor() {
public Color getDieColor() {
return this.color;
}

View file

@ -23,7 +23,7 @@ import common.util.ExtMath;
import common.util.Facing;
import common.util.HitPosition;
import common.util.Serverside;
import common.util.TextColor;
import common.util.Color;
import common.world.State;
import common.world.World;
@ -67,7 +67,7 @@ public class ItemCharTemplate extends Item
@Clientside
public void addInformation(ItemStack stack, EntityNPC player, List<String> tooltip) {
Dimension dim = this.spawned.species.origin == null ? null : DimensionRegistry.getDimension(this.spawned.species.origin);
tooltip.add(TextColor.ORANGE + "Herkunft: " + (dim == null ? "???" : dim.getDisplay()));
tooltip.add(Color.ORANGE + "Herkunft: " + (dim == null ? "???" : dim.getDisplay()));
}
public boolean onItemUse(ItemStack stack, EntityNPC playerIn, World worldIn, BlockPos pos, Facing side, float hitX, float hitY, float hitZ)

View file

@ -21,7 +21,7 @@ import common.util.ExtMath;
import common.util.Facing;
import common.util.HitPosition;
import common.util.Serverside;
import common.util.TextColor;
import common.util.Color;
import common.world.State;
import common.world.World;
@ -59,7 +59,7 @@ public class ItemMobTemplate extends Item
EntityInfo egg = EntityRegistry.DNA.get(this.entityId);
if(egg != null) {
Dimension dim = egg.origin() == null ? null : DimensionRegistry.getDimension(egg.origin());
tooltip.add(TextColor.ORANGE + "Herkunft: " + (dim == null ? "???" : dim.getDisplay()));
tooltip.add(Color.ORANGE + "Herkunft: " + (dim == null ? "???" : dim.getDisplay()));
}
}

View file

@ -4,19 +4,19 @@ import common.entity.npc.EntityNPC;
import common.item.ItemStack;
import common.item.WieldType;
import common.util.BlockPos;
import common.util.TextColor;
import common.util.Color;
import common.util.Vec3;
import common.world.AWorldServer;
public class ItemScanner extends ItemWand {
public ItemScanner() {
this.setColor(TextColor.BLUE);
this.setColor(Color.BLUE);
}
public void onUse(ItemStack stack, EntityNPC player, AWorldServer world, Vec3 vec)
{
BlockPos pos = new BlockPos(vec);
player.connection.addHotbar(TextColor.NEON + "* Position in %s: %.1f %.1f %.1f, %.1f K, %.1f °C, G: %.1f °C, %.1f %%", world.dimension.getDisplay(),
player.connection.addHotbar(Color.NEON + "* Position in %s: %.1f %.1f %.1f, %.1f K, %.1f °C, G: %.1f °C, %.1f %%", world.dimension.getDisplay(),
vec.xCoord, vec.yCoord, vec.zCoord,
world.getTemperatureK(pos), world.getTemperatureC(pos), world.getGenTemperature(pos.getX(), pos.getZ()), world.getGenHumidity(pos.getX(), pos.getZ()));
}

View file

@ -7,7 +7,7 @@ import common.item.Item;
import common.item.ItemStack;
import common.util.BlockPos;
import common.util.Clientside;
import common.util.TextColor;
import common.util.Color;
public class ItemSpaceNavigator extends Item {
@Clientside
@ -15,7 +15,7 @@ public class ItemSpaceNavigator extends Item {
public ItemSpaceNavigator() {
this.setUnstackable();
this.setColor(TextColor.DARK_GREEN);
this.setColor(Color.DARK_GREEN);
this.setMagnetic();
}
@ -30,20 +30,20 @@ public class ItemSpaceNavigator extends Item {
@Clientside
public String getHotbarText(EntityNPC player, ItemStack stack) {
BlockPos pos = player.getPosition();
return TextColor.ORANGE + this.localTime + " / " +
String.format("%s bei %d, %d, %d", player.worldObj.dimension.getDisplay() + TextColor.ORANGE,
return Color.ORANGE + this.localTime + " / " +
String.format("%s bei %d, %d, %d", player.worldObj.dimension.getDisplay() + Color.ORANGE,
pos.getX(), pos.getY(), pos.getZ());
}
@Clientside
public void addInformation(ItemStack stack, EntityNPC player, List<String> tooltip) {
tooltip.add(TextColor.ORANGE + this.localTime);
tooltip.add(Color.ORANGE + this.localTime);
String[] dims = player.worldObj.dimension.getBaseNames();
for(int z = dims.length - 1; z >= 0; z--) {
tooltip.add(TextColor.ORANGE + dims[z]);
tooltip.add(Color.ORANGE + dims[z]);
}
BlockPos pos = player.getPosition();
tooltip.add(TextColor.ORANGE + String.format("%s bei %d, %d, %d", player.worldObj.dimension.getDisplay()
+ TextColor.ORANGE, pos.getX(), pos.getY(), pos.getZ()));
tooltip.add(Color.ORANGE + String.format("%s bei %d, %d, %d", player.worldObj.dimension.getDisplay()
+ Color.ORANGE, pos.getX(), pos.getY(), pos.getZ()));
}
}

View file

@ -12,7 +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.Color;
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.DARK_GREEN + "Reichweite: " + TextColor.GREEN + this.getRange(stack, playerIn) + " Blöcke");
tooltip.add(Color.DARK_GREEN + "Reichweite: " + Color.GREEN + this.getRange(stack, playerIn) + " Blöcke");
}
public abstract int getRange(ItemStack stack, EntityNPC player);

View file

@ -4,7 +4,7 @@ import common.entity.npc.EntityNPC;
import common.init.SoundEvent;
import common.item.Item;
import common.item.ItemStack;
import common.util.TextColor;
import common.util.Color;
import common.world.Weather;
import common.world.World;
import common.world.AWorldServer;
@ -15,7 +15,7 @@ public class ItemWeatherToken extends Item {
public ItemWeatherToken(Weather weather) {
this.weather = weather;
this.setUnstackable();
this.setColor(TextColor.VIOLET);
this.setColor(Color.VIOLET);
this.setDisplay("Wetterkristall (" + this.weather.getDisplay() + ")");
this.setMagnetic();
}

View file

@ -9,13 +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.Color;
import common.util.Vec3;
import common.world.AWorldServer;
public class ItemBanHammer extends ItemWand {
public ItemBanHammer() {
this.setColor(TextColor.DARK_RED);
this.setColor(Color.DARK_RED);
this.setTab(CheatTab.WEAPONS);
this.setMagnetic();
}

View file

@ -6,14 +6,14 @@ import common.init.SoundEvent;
import common.item.CheatTab;
import common.item.Item;
import common.item.ItemStack;
import common.util.TextColor;
import common.util.Color;
import common.world.World;
import common.world.AWorldServer;
public class ItemExterminator extends Item {
public ItemExterminator() {
this.setUnstackable();
this.setColor(TextColor.DARK_RED);
this.setColor(Color.DARK_RED);
this.setTab(CheatTab.WEAPONS);
this.setMagnetic();
}
@ -22,11 +22,11 @@ public class ItemExterminator extends Item {
if(!world.client && player.connection.isAdmin()) {
world.playSoundAtEntity(player, SoundEvent.CLICK, 1.0F);
if(world.dimension == Space.INSTANCE)
player.connection.addHotbar(TextColor.RED + "Der Weltraum kann nicht zerstört werden (lol)");
player.connection.addHotbar(Color.RED + "Der Weltraum kann nicht zerstört werden (lol)");
else if(!((AWorldServer)world).exterminate())
player.connection.addHotbar(TextColor.YELLOW + "Die Welt %s ist bereits zerstört", world.dimension.getDisplay());
player.connection.addHotbar(Color.YELLOW + "Die Welt %s ist bereits zerstört", world.dimension.getDisplay());
else
player.connection.addHotbar(TextColor.CRIMSON + "Die Welt %s wurde vernichtet >:)-", world.dimension.getDisplay());
player.connection.addHotbar(Color.CRIMSON + "Die Welt %s wurde vernichtet >:)-", world.dimension.getDisplay());
// if (!playerIn.capabilities.isCreativeMode)
// {

View file

@ -4,13 +4,13 @@ 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.Color;
import common.util.Vec3;
import common.world.AWorldServer;
public class ItemTrident extends ItemWand {
public ItemTrident() {
this.setColor(TextColor.NEON);
this.setColor(Color.NEON);
this.setTab(CheatTab.WEAPONS);
this.setMagnetic();
}

View file

@ -6,7 +6,7 @@ import java.util.List;
import common.collect.Lists;
import common.network.IThreadListener;
import common.util.TextColor;
import common.util.Color;
import common.util.Util;
public enum Log {
@ -68,7 +68,7 @@ public enum Log {
if(((c >= CHR_COLORS1) && (c <= CHR_COLORE1)) || ((c >= CHR_COLORS2) && (c <= CHR_COLORE2))) {
if(pos - last != 0)
System.err.print(str.substring(last, pos));
color = TextColor.getColor(c); // (c >= CHR_COLORS2) && (c <= CHR_COLORE2) ? aux_colors[c - CHR_COLORS2] : text_colors[c - CHR_COLORS1];
color = Color.getColor(c); // (c >= CHR_COLORS2) && (c <= CHR_COLORE2) ? aux_colors[c - CHR_COLORS2] : text_colors[c - CHR_COLORS1];
if(colors)
System.err.printf("\u001b[38;2;%d;%d;%dm", (color >> 16) & 0xff, (color >> 8) & 0xff, color & 0xff);
last = ++pos;
@ -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.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 + "] ",
String prefix = String.format(Color.DARK_GRAY + "[" + Color.GREEN + "%s" + Color.DARK_GRAY + "][" + Color.LIGHT_GRAY + "%s" + Color.DARK_GRAY + "|" + Color.LIGHT_GRAY + "%s" +
Color.DARK_GRAY + "][%s%s" + Color.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()) {

View file

@ -3,22 +3,22 @@ package common.log;
import common.util.Displayable;
import common.util.ExtMath;
import common.util.Identifyable;
import common.util.TextColor;
import common.util.Color;
public enum LogLevel implements Displayable, Identifyable {
SILENT("silent", "Nichts", "UNK?", TextColor.BLACK),
USER("user", "Benutzer", "USER", TextColor.WHITE),
ERROR("error", "Fehler", "ERR!", TextColor.RED),
WARN("warn", "Warnung", "WARN", TextColor.YELLOW),
INFO("info", "Info", "INFO", TextColor.BLUE),
PERF("perf", "Leistung", "PERF", TextColor.CYAN),
DEBUG("debug", "*Debug*", "DBG#", TextColor.MAGENTA),
TRACE("trace", "*Trace*", "TRC#", TextColor.VIOLET);
SILENT("silent", "Nichts", "UNK?", Color.BLACK),
USER("user", "Benutzer", "USER", Color.WHITE),
ERROR("error", "Fehler", "ERR!", Color.RED),
WARN("warn", "Warnung", "WARN", Color.YELLOW),
INFO("info", "Info", "INFO", Color.BLUE),
PERF("perf", "Leistung", "PERF", Color.CYAN),
DEBUG("debug", "*Debug*", "DBG#", Color.MAGENTA),
TRACE("trace", "*Trace*", "TRC#", Color.VIOLET);
public final String id;
public final String name;
public final String log;
public final TextColor color;
public final Color color;
public static LogLevel parse(String str) {
for(LogLevel level : values()) {
@ -33,7 +33,7 @@ public enum LogLevel implements Displayable, Identifyable {
}
}
private LogLevel(String id, String name, String log, TextColor color) {
private LogLevel(String id, String name, String log, Color color) {
this.id = id;
this.name = name;
this.log = log;

View file

@ -11,20 +11,20 @@ import common.rng.Random;
import common.tags.TagObject;
import java.util.List;
import common.util.ExtMath;
import common.util.TextColor;
import common.util.Color;
public abstract class Device extends TileEntity implements IInventory, ITickable {
public static enum Status {
OFF(TextColor.DARK_GRAY, "Inaktiv"),
COOLING(TextColor.YELLOW, "Abkühlen ..."),
RUNNING(TextColor.GREEN, "Aktiv"),
OVERHEAT(TextColor.RED, "Überhitzt!"),
BROKEN(TextColor.BLACK, "Defekt!");
OFF(Color.DARK_GRAY, "Inaktiv"),
COOLING(Color.YELLOW, "Abkühlen ..."),
RUNNING(Color.GREEN, "Aktiv"),
OVERHEAT(Color.RED, "Überhitzt!"),
BROKEN(Color.BLACK, "Defekt!");
public final TextColor color;
public final Color color;
public final String name;
private Status(TextColor color, String name) {
private Status(Color color, String name) {
this.color = color;
this.name = name;
}

View file

@ -5,13 +5,13 @@ import java.util.regex.Pattern;
import common.collect.Maps;
public enum TextColor implements Identifyable, Displayable {
public enum Color 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"),
BROWN(0x07, 0x8c5606, "brown", 'W', "Braun", "Braunes", "Brauner", "Braune"),
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"),
@ -23,22 +23,22 @@ public enum TextColor implements Identifyable, Displayable {
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"),
BLUE(0x15, 0x0000cf, "blue", 'b', "Blau", "Blaues", "Blauer", "Blaue"),
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"),
WHITE(0x1b, 0xffffff, "white", '4', "Weiß", "Weißes", "Weißer", "Weiße"),
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");
BLACK(0x1f, 0x000000, "black", '0', "Schwarz", "Schwarzes", "Schwarzer", "Schwarze");
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<String, Color> 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]");
@ -56,11 +56,9 @@ public enum TextColor implements Identifyable, Displayable {
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()) {
for(Color color : values()) {
if(color.code < COLORS.length) {
COLORS[color.code] = color.color;
SHADOW[color.code] = color.shadow;
@ -86,16 +84,16 @@ public enum TextColor implements Identifyable, Displayable {
return code < SHADOW.length ? SHADOW[code] : 0x000000;
}
public static TextColor byName(String name) {
TextColor type = LOOKUP.get(name.toLowerCase());
public static Color byName(String name) {
Color type = LOOKUP.get(name.toLowerCase());
return type == null ? WHITE : type;
}
public static TextColor getExact(String name) {
public static Color 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) {
private Color(int code, int color, String id, char colorId, String display, String subject, String msubject, String fsubject) {
this.format = Character.toString(this.code = (char)code);
this.color = color;
this.shadow = Util.mixColor(Util.mixColor(this.color, 0x000000), 0x000000);
@ -105,12 +103,6 @@ public enum TextColor implements Identifyable, Displayable {
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() {
@ -129,14 +121,6 @@ public enum TextColor implements Identifyable, Displayable {
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;
}