Skip to content

Commit

Permalink
Made God colors use Hex for more color variety
Browse files Browse the repository at this point in the history
  • Loading branch information
GirafiStudios committed Jan 9, 2021
1 parent 8ea81af commit caffb40
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 22 deletions.
45 changes: 26 additions & 19 deletions src/main/java/com/teammetallurgy/atum/api/God.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,38 @@

import com.google.common.collect.Maps;
import net.minecraft.util.IStringSerializable;
import net.minecraft.util.text.Color;
import net.minecraft.util.text.TextFormatting;

import javax.annotation.Nonnull;
import java.util.Map;

public enum God implements IStringSerializable {
ANPUT("anput", TextFormatting.BLACK),
ANUBIS("anubis", TextFormatting.DARK_PURPLE),
ATEM("atem", TextFormatting.DARK_AQUA),
GEB("geb", TextFormatting.GOLD),
HORUS("horus", TextFormatting.AQUA),
ISIS("isis", TextFormatting.LIGHT_PURPLE),
MONTU("montu", TextFormatting.DARK_RED),
NEPTHYS("nepthys", TextFormatting.DARK_PURPLE),
NUIT("nuit", TextFormatting.GRAY),
OSIRIS("osiris", TextFormatting.DARK_GREEN),
PTAH("ptah", TextFormatting.YELLOW),
RA("ra", TextFormatting.DARK_RED),
SETH("seth", TextFormatting.GREEN),
SHU("shu", TextFormatting.BLUE),
TEFNUT("tefnut", TextFormatting.DARK_BLUE);
ANPUT("anput", "#46403F"),
ANUBIS("anubis", "#780162"),
ATEM("atem", "#229F89"),
GEB("geb", "#c65e00"),
HORUS("horus", "#6e60e6"),
ISIS("isis", "#b853c6"),
MONTU("montu", "#893c2e"),
NEPTHYS("nepthys", "#9703c9"),
NUIT("nuit", "#493e74"),
OSIRIS("osiris", "#31ab1c"),
PTAH("ptah", "#b39c05"),
RA("ra", "#9d0d14"),
SETH("seth","#5a7F1a"),
SHU("shu", "#a6b4bF"),
TEFNUT("tefnut", "#1a70FF");

static Map<Integer, God> MAP;
private final String name;
private final TextFormatting color;
private final Color color;
private final String hex;

God(String name, TextFormatting color) {
God(String name, String hex) {
this.name = name;
this.color = color;
this.hex = hex;
this.color = Color.fromHex(hex);
}

@Override
Expand All @@ -43,10 +46,14 @@ public String getName() {
return this.name;
}

public TextFormatting getColor() {
public Color getColor() {
return this.color;
}

public String getHex() {
return this.hex;
}

public static God getGod(int godType) {
if (MAP == null) {
MAP = Maps.newHashMap();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public void spawn(PlayerEntity player, DifficultyInstance difficulty, @Nullable
if (this.world instanceof ServerWorld) {
ServerWorld serverWorld = (ServerWorld) this.world;
for (ServerPlayerEntity playerMP : serverWorld.getServer().getPlayerList().getPlayers()) {
playerMP.sendMessage(pharaoh.getName().deepCopy().appendString(" ").append(new TranslationTextComponent("chat.atum.summon_pharaoh")).appendString(" " + player.getGameProfile().getName()).mergeStyle(God.getGod(pharaoh.getVariant()).getColor()), Util.DUMMY_UUID);
playerMP.sendMessage(pharaoh.getName().deepCopy().appendString(" ").append(new TranslationTextComponent("chat.atum.summon_pharaoh")).appendString(" " + player.getGameProfile().getName()).setStyle(pharaoh.getName().getStyle().setColor(God.getGod(pharaoh.getVariant()).getColor())), Util.DUMMY_UUID);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ public void onDeath(@Nonnull DamageSource source) {
if (!this.world.isRemote && slayer != null) {
List<ServerPlayerEntity> players = ServerLifecycleHooks.getCurrentServer().getPlayerList().getPlayers();
for (PlayerEntity player : players) {
player.sendMessage(this.getName().deepCopy().appendString(" ").append(new TranslationTextComponent("chat.atum.kill_pharaoh")).appendString(" " + slayer.getGameProfile().getName()).mergeStyle(God.getGod(this.getVariant()).getColor()), Util.DUMMY_UUID);
player.sendMessage(this.getName().deepCopy().appendString(" ").append(new TranslationTextComponent("chat.atum.kill_pharaoh")).appendString(" " + slayer.getGameProfile().getName()).setStyle(this.getName().getStyle().setColor(God.getGod(this.getVariant()).getColor())), Util.DUMMY_UUID);
}
}
}
Expand Down Expand Up @@ -484,6 +484,6 @@ private void trySpawnMummy(BlockPos pos, Direction facing) {
}

private void setBossInfo(int variant) {
this.bossInfo.setName(this.getDisplayName().deepCopy().mergeStyle(God.getGod(variant).getColor()));
this.bossInfo.setName(this.getDisplayName().deepCopy().setStyle(this.getDisplayName().getStyle().setColor(God.getGod(variant).getColor())));
}
}

0 comments on commit caffb40

Please sign in to comment.