Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/1.8' into 1.8.8
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/main/java/mezz/jei/plugins/vanilla/crafting/CraftingRecipeMaker.java
#	src/main/java/mezz/jei/util/ItemStackElement.java
#	src/main/java/mezz/jei/util/ModList.java
  • Loading branch information
mezz committed Dec 11, 2015
2 parents f0df1ef + 9cff918 commit af896d1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

public class CraftingRecipeMaker {

@SuppressWarnings("unchecked")
public static List<IRecipe> getCraftingRecipes() {
return CraftingManager.getInstance().getRecipeList();
}
Expand Down
6 changes: 4 additions & 2 deletions src/main/java/mezz/jei/util/ItemStackElement.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import java.util.Locale;

import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;

import net.minecraftforge.fml.common.registry.GameData;

Expand Down Expand Up @@ -35,8 +36,9 @@ public static ItemStackElement create(@Nonnull ItemStack itemStack) {
private ItemStackElement(@Nonnull ItemStack itemStack) {
this.itemStack = itemStack;
this.localizedName = itemStack.getDisplayName().toLowerCase();

String modId = GameData.getItemRegistry().getNameForObject(itemStack.getItem()).getResourceDomain();

ResourceLocation itemResourceLocation = (ResourceLocation) GameData.getItemRegistry().getNameForObject(itemStack.getItem());
String modId = itemResourceLocation.getResourceDomain();
String modName = JEIManager.itemRegistry.getModNameForItem(itemStack.getItem());

this.modName = modId.toLowerCase(Locale.ENGLISH) + ' ' + modName.toLowerCase(Locale.ENGLISH);
Expand Down
8 changes: 6 additions & 2 deletions src/main/java/mezz/jei/util/ModList.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import org.apache.commons.lang3.text.WordUtils;

import net.minecraft.item.Item;
import net.minecraft.util.ResourceLocation;

import net.minecraftforge.fml.common.Loader;
import net.minecraftforge.fml.common.ModContainer;
Expand All @@ -28,10 +29,13 @@ public ModList() {

@Nonnull
public String getModNameForItem(@Nonnull Item item) {
String modId = GameData.getItemRegistry().getNameForObject(item).getResourceDomain();
String modName = modNamesForIds.get(modId.toLowerCase(Locale.ENGLISH));
ResourceLocation itemResourceLocation = (ResourceLocation) GameData.getItemRegistry().getNameForObject(item);
String modId = itemResourceLocation.getResourceDomain();
String lowercaseModId = modId.toLowerCase(Locale.ENGLISH);
String modName = modNamesForIds.get(lowercaseModId);
if (modName == null) {
modName = WordUtils.capitalize(modId);
modNamesForIds.put(lowercaseModId, modName);
}
return modName;
}
Expand Down

0 comments on commit af896d1

Please sign in to comment.