Skip to content
This repository has been archived by the owner on Apr 22, 2019. It is now read-only.

Commit

Permalink
Stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
pahimar committed Oct 6, 2016
1 parent f25e8ed commit eda68d5
Show file tree
Hide file tree
Showing 5 changed files with 73 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public enum FuelVariant implements IEnumMeta, Comparable<FuelVariant> {
MOBIUS_FUEL,
AETERNALIS_FUEL;

private final int meta;
private int meta;
protected static final FuelVariant[] VARIANTS = values();

FuelVariant() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ public void handleItemTooltipEvent(ItemTooltipEvent event) {
if (energyValue != null && (BlacklistRegistryProxy.isExchangeable(wrappedItemStack) || BlacklistRegistryProxy.isLearnable(wrappedItemStack))) {

if (wrappedItemStack.getStackSize() > 1) {
event.getToolTip().add(String.format("Exchange Energy (Item): %s", energyValue)); // TODO Localize
event.getToolTip().add(String.format("Exchange Energy (Stack of %s): %s", event.getItemStack().stackSize, stackEnergyValue)); // TODO Localize
event.getToolTip().add(String.format("\u00A7aEMC Value (Item)\u00A7a: %s", energyValue)); // TODO Localize
event.getToolTip().add(String.format("\u00A7aEMC Value (Stack of %s)\u00A7a: %s", event.getItemStack().stackSize, stackEnergyValue)); // TODO Localize
}
else {

event.getToolTip().add(String.format("Exchange Energy: %s", stackEnergyValue)); // TODO Localize
event.getToolTip().add(String.format("\u00A7aEMC Value: %s\u00A7a", stackEnergyValue)); // TODO Localize

// TODO Move away from deprecated FluidContainerRegistry
if (FluidContainerRegistry.getFluidForFilledItem(event.getItemStack()) != null) {
Expand Down
28 changes: 28 additions & 0 deletions src/main/java/com/pahimar/ee3/item/ItemAlchenomicon.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,38 @@
package com.pahimar.ee3.item;

import com.pahimar.ee3.EquivalentExchange3;
import com.pahimar.ee3.item.base.ItemEE;
import com.pahimar.ee3.reference.GUIs;
import com.pahimar.ee3.reference.Messages;
import com.pahimar.ee3.util.ItemStackUtils;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ActionResult;
import net.minecraft.util.EnumActionResult;
import net.minecraft.util.EnumHand;
import net.minecraft.util.text.TextComponentTranslation;
import net.minecraft.world.World;

public class ItemAlchenomicon extends ItemEE {

public ItemAlchenomicon() {
super("alchenomicon");
}

@Override
public ActionResult<ItemStack> onItemRightClick(ItemStack itemStack, World world, EntityPlayer entityPlayer, EnumHand hand) {

if (!world.isRemote)
{
if (!ItemStackUtils.hasOwner(itemStack)) {
ItemStackUtils.setOwner(itemStack, entityPlayer);
entityPlayer.addChatComponentMessage(new TextComponentTranslation(Messages.OWNER_SET_TO_SELF, itemStack.getTextComponent()));
}
else {
entityPlayer.openGui(EquivalentExchange3.instance, GUIs.ALCHENOMICON.ordinal(), entityPlayer.worldObj, (int) entityPlayer.posX, (int) entityPlayer.posY, (int) entityPlayer.posZ);
}
}

return new ActionResult(EnumActionResult.SUCCESS, itemStack);
}
}
28 changes: 28 additions & 0 deletions src/main/java/com/pahimar/ee3/reference/Colors.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,32 @@ public class Colors {
public static final int[] DUST_COLOURS = new int[]{DUST_ASH, DUST_MINIUM};

public static final String[] DYE_NAMES = {"dyeBlack", "dyeRed", "dyeGreen", "dyeBrown", "dyeBlue", "dyePurple", "dyeCyan", "dyeLightGray", "dyeGray", "dyePink", "dyeLime", "dyeYellow", "dyeLightBlue", "dyeMagenta", "dyeOrange", "dyeWhite"};

public enum TextColor {
BLACK("\u00A70"),
DARK_BLUE("\u00A71"),
DARK_GREEN("\u00A72"),
DARK_CYAN("\u00A73"),
DARK_RED("\u00A74"),
PURPLE("\u00A75"),
ORANGE("\u00A76"),
LIGHT_GREY("\u00A77"),
DARK_GREY("\u00A78"),
LIGHT_GREEN("\u00A7a"),
LIGHT_CYAN("\u00A7b"),
LIGHT_RED("\u00A7c"),
PINK("\u00A7d"),
YELLOW("\u00A7e"),
WHITE("\u00A7f");

private String color;

TextColor(String color) {
this.color = color;
}

public String getColor() {
return color;
}
}
}
13 changes: 13 additions & 0 deletions src/main/java/com/pahimar/ee3/util/StringHelper.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.pahimar.ee3.util;

import com.pahimar.ee3.reference.Colors;

public class StringHelper {

private StringHelper() {}

public static String colorizeString(String string, Colors.TextColor color) {
// TODO Complete this
return null;
}
}

0 comments on commit eda68d5

Please sign in to comment.