Skip to content

Commit

Permalink
Bump to 4.18.2 - Fixes #4, #5, #6
Browse files Browse the repository at this point in the history
  • Loading branch information
Rongmario committed Mar 13, 2022
1 parent 424064a commit cb15590
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 9 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ curse_project_id=238222

version_major=4
version_minor=18
version_patch=1
version_patch=2
9 changes: 9 additions & 0 deletions src/api/java/mezz/jei/api/ISubtypeRegistry.java
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,15 @@ public interface ISubtypeRegistry {
interface ISubtypeInterpreter extends IIngredientSubtypeInterpreter<ItemStack> {
@Deprecated
String NONE = IIngredientSubtypeInterpreter.NONE;

@Override
String apply(ItemStack itemStack);

@Deprecated
@Nullable
default String getSubtypeInfo(ItemStack itemStack) {
return apply(itemStack);
}
}

@FunctionalInterface
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/mezz/jei/config/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public final class Constants {

// Mod info
public static final String MOD_ID = "jei";
public static final String NAME = "Just Enough Items";
public static final String NAME = "Had Enough Items";
public static final String VERSION = "@VERSION@";

// Textures
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
import net.minecraft.potion.PotionType;
import net.minecraft.potion.PotionUtils;

import mezz.jei.api.ISubtypeRegistry;
import mezz.jei.api.ISubtypeRegistry.ISubtypeInterpreter;

public class PotionSubtypeInterpreter implements ISubtypeRegistry.ISubtypeInterpreter {
public class PotionSubtypeInterpreter implements ISubtypeInterpreter {
public static final PotionSubtypeInterpreter INSTANCE = new PotionSubtypeInterpreter();

private PotionSubtypeInterpreter() {
Expand All @@ -19,7 +19,7 @@ private PotionSubtypeInterpreter() {
@Override
public String apply(ItemStack itemStack) {
if (!itemStack.hasTagCompound()) {
return ISubtypeRegistry.ISubtypeInterpreter.NONE;
return NONE;
}
PotionType potionType = PotionUtils.getPotionFromItem(itemStack);
String potionTypeString = potionType.getNamePrefixed("");
Expand Down
6 changes: 4 additions & 2 deletions src/main/java/mezz/jei/runtime/SubtypeRegistry.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ public void registerSubtypeInterpreter(Fluid fluid, IFluidSubtypeInterpreter int
@Override
public String getSubtypeInfo(ItemStack itemStack) {
ErrorUtil.checkNotEmpty(itemStack);
IIngredientSubtypeInterpreter interpreter = interpreters.get(itemStack);
Item item = itemStack.getItem();
IIngredientSubtypeInterpreter interpreter = interpreters.get(item);
if (interpreter != null) {
return interpreter.apply(itemStack);
}
Expand All @@ -78,7 +79,8 @@ public String getSubtypeInfo(ItemStack itemStack) {
@Override
public String getSubtypeInfo(FluidStack fluidStack) {
ErrorUtil.checkNotNull(fluidStack, "fluid");
IIngredientSubtypeInterpreter interpreter = interpreters.get(fluidStack);
Fluid fluid = fluidStack.getFluid();
IIngredientSubtypeInterpreter interpreter = interpreters.get(fluid);
if (interpreter != null) {
return interpreter.apply(fluidStack);
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/mcmod.info
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"mcversion": "${mcversion}",
"url": "https://github.com/CleanroomMC/HadEnoughItems",
"updateUrl": "",
"authorList": ["mezz"],
"authorList": ["mezz", "Rongmario"],
"logoFile": "",
"screenshots": [],
"dependencies": []
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/pack.mcmeta
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"pack":{
"pack_format":3,
"description":"JEI Resources"
"description":"HEI Resources"
}
}

0 comments on commit cb15590

Please sign in to comment.