Skip to content

Commit

Permalink
Add stack emc generation on collectors & flowers
Browse files Browse the repository at this point in the history
  • Loading branch information
DonovanDMC committed Oct 17, 2023
1 parent 69a31f6 commit 427d765
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.math.BigInteger;
import java.util.List;

@SuppressWarnings("deprecation")
Expand Down Expand Up @@ -80,6 +81,9 @@ public void appendHoverText(ItemStack stack, @Nullable IBlockReader level, List<
super.appendHoverText(stack, level, list, flag);
list.add(Lang.Blocks.POWER_FLOWER_TOOLTIP.translateColored(TextFormatting.GRAY, new StringTextComponent(Config.tickDelay.get().toString()).setStyle(ColorStyle.GREEN), new StringTextComponent(Config.tickDelay.get() == 1 ? "" : "s").setStyle(ColorStyle.GRAY)));
list.add(Lang.Blocks.POWER_FLOWER_EMC.translateColored(TextFormatting.GRAY, EMCFormat.getComponent(getMatter().getPowerFlowerOutput()).setStyle(ColorStyle.GREEN)));
if(stack.getCount() > 1) {
list.add(Lang.Blocks.POWER_FLOWER_STACK_EMC.translateColored(TextFormatting.GRAY, EMCFormat.getComponent(getMatter().getPowerFlowerOutput().multiply(BigInteger.valueOf(stack.getCount()))).setStyle(ColorStyle.GREEN)));
}
list.add(Lang.SEE_WIKI.translateColored(TextFormatting.AQUA));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.math.BigInteger;
import java.util.List;

@SuppressWarnings("deprecation")
Expand Down Expand Up @@ -54,6 +55,9 @@ public void appendHoverText(ItemStack stack, @Nullable IBlockReader level, List<
list.add(Lang.Blocks.RELAY_TOOLTIP.translateColored(TextFormatting.GRAY));
list.add(Lang.Blocks.RELAY_BONUS.translateColored(TextFormatting.GRAY, EMCFormat.getComponent(getMatter().getRelayBonusForTicks(Config.tickDelay.get())).setStyle(ColorStyle.GREEN)));
list.add(Lang.Blocks.RELAY_TRANSFER.translateColored(TextFormatting.GRAY, getMatter().getRelayTransferComponent().setStyle(ColorStyle.GREEN)));
if(stack.getCount() > 1) {
list.add(Lang.Blocks.COLLECTOR_STACK_EMC.translateColored(TextFormatting.GRAY, EMCFormat.getComponent(getMatter().getCollectorOutputForTicks(Config.tickDelay.get()).multiply(BigInteger.valueOf(stack.getCount()))).setStyle(ColorStyle.GREEN)));
}
list.add(Lang.SEE_WIKI.translateColored(TextFormatting.AQUA));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ public void appendHoverText(ItemStack stack, @Nullable World level, List<ITextCo
PlayerEntity player = getPlayer(stack);
list.add(Lang.Items.ALCHEMICAL_BOOK_BOUND_TO.translateColored(TextFormatting.RED, player == null ? new StringTextComponent(stack.getOrCreateTag().getString(NBTNames.OWNER_NAME)).withStyle(TextFormatting.DARK_AQUA) : player.getDisplayName().copy().withStyle(TextFormatting.DARK_AQUA)));
}
list.add(Lang.SEE_WIKI.translateColored(TextFormatting.AQUA));
}

public @Nullable ServerPlayerEntity getPlayer(ItemStack stack) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ public class ItemFuel extends Item {
public ItemFuel(Fuel level) {
super(new Item.Properties().tab(Main.tab).rarity(level.rarity));
this.level = level;

}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ public enum Blocks implements ILangEntry {
// Collector
COLLECTOR_TOOLTIP("collector", "tooltip"),
COLLECTOR_EMC("collector", "emc"),
COLLECTOR_STACK_EMC("collector", "stack_emc"),

// EMC Link
EMC_LINK_TOOLTIP("emc_link", "tooltip"),
Expand All @@ -99,6 +100,7 @@ public enum Blocks implements ILangEntry {
// Power Flower
POWER_FLOWER_TOOLTIP("power_flower", "tooltip"),
POWER_FLOWER_EMC("power_flower", "emc"),
POWER_FLOWER_STACK_EMC("power_flower", "stack_emc"),

// Relay
RELAY_TOOLTIP("relay", "tooltip"),
Expand Down

0 comments on commit 427d765

Please sign in to comment.