Skip to content

Commit

Permalink
Add getDisplayName to IIngredientMatcher
Browse files Browse the repository at this point in the history
  • Loading branch information
rubensworks committed Mar 21, 2021
1 parent 4090335 commit dd29fc0
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/org/cyclops/commoncapabilities/api
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package org.cyclops.commoncapabilities.ingredient;

import net.minecraft.util.text.IFormattableTextComponent;
import net.minecraft.util.text.TranslationTextComponent;
import org.cyclops.commoncapabilities.api.ingredient.IIngredientMatcher;
import org.cyclops.cyclopscore.helper.Helpers;
import org.cyclops.cyclopscore.helper.L10NHelpers;
Expand Down Expand Up @@ -94,6 +96,11 @@ public String localize(Integer instance) {
return L10NHelpers.localize("recipecomponent.minecraft.energy");
}

@Override
public IFormattableTextComponent getDisplayName(Integer instance) {
return new TranslationTextComponent("recipecomponent.minecraft.energy");
}

@Override
public int compare(Integer o1, Integer o2) {
return o1 - o2;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.cyclops.commoncapabilities.ingredient;

import net.minecraft.fluid.Fluids;
import net.minecraft.util.text.IFormattableTextComponent;
import net.minecraftforge.fluids.FluidStack;
import org.cyclops.commoncapabilities.api.capability.fluidhandler.FluidMatch;
import org.cyclops.commoncapabilities.api.ingredient.IIngredientMatcher;
Expand Down Expand Up @@ -115,6 +116,11 @@ public String localize(FluidStack instance) {
return instance.getDisplayName().getString();
}

@Override
public IFormattableTextComponent getDisplayName(FluidStack instance) {
return (IFormattableTextComponent) instance.getDisplayName();
}

@Override
public int compare(FluidStack o1, FluidStack o2) {
if (o1.isEmpty()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.text.IFormattableTextComponent;
import org.cyclops.commoncapabilities.api.capability.itemhandler.ItemMatch;
import org.cyclops.commoncapabilities.api.ingredient.IIngredientMatcher;
import org.cyclops.cyclopscore.helper.Helpers;
Expand Down Expand Up @@ -102,6 +103,11 @@ public String localize(ItemStack instance) {
return instance.getDisplayName().getString();
}

@Override
public IFormattableTextComponent getDisplayName(ItemStack instance) {
return (IFormattableTextComponent) instance.getDisplayName();
}

@Override
public int compare(ItemStack o1, ItemStack o2) {
if (o1.isEmpty()) {
Expand Down

0 comments on commit dd29fc0

Please sign in to comment.