-
-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
52 changed files
with
491 additions
and
487 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 16 additions & 5 deletions
21
Common/src/main/java/jeresources/entry/EnchantmentEntry.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,34 @@ | ||
package jeresources.entry; | ||
|
||
import jeresources.util.TranslationHelper; | ||
import net.minecraft.core.Holder; | ||
import net.minecraft.core.HolderSet; | ||
import net.minecraft.world.item.Item; | ||
import net.minecraft.world.item.enchantment.Enchantment; | ||
|
||
public class EnchantmentEntry { | ||
private Enchantment enchantment; | ||
private Holder<Enchantment> enchantment; | ||
|
||
public EnchantmentEntry(Enchantment enchantment) { | ||
public EnchantmentEntry(Holder<Enchantment> enchantment) { | ||
this.enchantment = enchantment; | ||
} | ||
|
||
public String getTranslatedWithLevels() { | ||
String s = this.enchantment.getFullname(1).getString(); | ||
if (this.enchantment.getMinLevel() != this.enchantment.getMaxLevel()) | ||
s += "-" + TranslationHelper.translateAndFormat("enchantment.level." + this.enchantment.getMaxLevel()); | ||
String s = Enchantment.getFullname(this.enchantment, 1).getString(); | ||
if (this.enchantment.value().getMinLevel() != this.enchantment.value().getMaxLevel()) | ||
s += "-" + TranslationHelper.translateAndFormat("enchantment.level." + this.enchantment.value().getMaxLevel()); | ||
return s; | ||
} | ||
|
||
public Enchantment getEnchantment() { | ||
return enchantment.value(); | ||
} | ||
|
||
public Holder<Enchantment> getEnchantmentHolder() { | ||
return enchantment; | ||
} | ||
|
||
public HolderSet<Item> getSupportedItems() { | ||
return enchantment.value().getSupportedItems(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
Common/src/main/java/jeresources/jei/dungeon/DungeonTooltip.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package jeresources.jei.dungeon; | ||
|
||
import jeresources.entry.DungeonEntry; | ||
import mezz.jei.api.gui.ingredient.IRecipeSlotTooltipCallback; | ||
import mezz.jei.api.gui.ingredient.IRecipeSlotView; | ||
import net.minecraft.network.chat.Component; | ||
import net.minecraft.world.item.ItemStack; | ||
|
||
import java.util.List; | ||
|
||
public class DungeonTooltip implements IRecipeSlotTooltipCallback { | ||
private final DungeonEntry entry; | ||
|
||
public DungeonTooltip(DungeonEntry entry) { | ||
this.entry = entry; | ||
} | ||
|
||
@Override | ||
public void onTooltip(IRecipeSlotView recipeSlotView, List<Component> tooltip) { | ||
tooltip.add(entry.getChestDrop((ItemStack) recipeSlotView.getDisplayedIngredient().get().getIngredient()).toStringTextComponent()); | ||
} | ||
} |
Oops, something went wrong.