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 bcfe791 commit e3f770f
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,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 BlockGetter level, List<C
super.appendHoverText(stack, level, list, flag);
list.add(Lang.Blocks.POWER_FLOWER_TOOLTIP.translateColored(ChatFormatting.GRAY, new TextComponent(Config.tickDelay.get().toString()).setStyle(ColorStyle.GREEN), new TextComponent(Config.tickDelay.get() == 1 ? "" : "s").setStyle(ColorStyle.GRAY)));
list.add(Lang.Blocks.POWER_FLOWER_EMC.translateColored(ChatFormatting.GRAY, EMCFormat.getComponent(getMatter().getPowerFlowerOutput()).setStyle(ColorStyle.GREEN)));
if(stack.getCount() > 1) {
list.add(Lang.Blocks.POWER_FLOWER_STACK_EMC.translateColored(ChatFormatting.GRAY, EMCFormat.getComponent(getMatter().getPowerFlowerOutput().multiply(BigInteger.valueOf(stack.getCount()))).setStyle(ColorStyle.GREEN)));
}
list.add(Lang.SEE_WIKI.translateColored(ChatFormatting.AQUA));
}

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

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

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ public void appendHoverText(ItemStack stack, @Nullable Level level, List<Compone
Player player = getPlayer(stack);
list.add(Lang.Items.ALCHEMICAL_BOOK_BOUND_TO.translateColored(ChatFormatting.RED, player == null ? new TextComponent(stack.getOrCreateTag().getString(TagNames.OWNER_NAME)).withStyle(ChatFormatting.DARK_AQUA) : player.getDisplayName().copy().withStyle(ChatFormatting.DARK_AQUA)));
}
list.add(Lang.SEE_WIKI.translateColored(ChatFormatting.AQUA));
}

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

}


@Override
public int getBurnTime(ItemStack stack, @Nullable RecipeType<?> recipeType) {
return level.getBurnTime(recipeType);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,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 @@ -98,6 +99,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 e3f770f

Please sign in to comment.