Skip to content

Commit

Permalink
Use equals rather than == since Java doesn't like generics soup
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxNeedsSnacks committed Jul 18, 2023
1 parent a62a505 commit e7c8924
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ public JsonElement write(RecipeJS recipe, T value) {
public T read(RecipeJS recipe, Object from) {
if (registryType.isInstance(from)) {
return (T) from;
} else if (registry == Registry.ITEM_REGISTRY && from instanceof ItemStack stack) {
} else if (registry.equals(Registry.ITEM_REGISTRY) && from instanceof ItemStack stack) {
return (T) stack.getItem();
} else if (registry == Registry.FLUID_REGISTRY && from instanceof FluidStackJS fluid) {
} else if (registry.equals(Registry.FLUID_REGISTRY) && from instanceof FluidStackJS fluid) {
return (T) fluid.getFluid();
}

Expand Down

0 comments on commit e7c8924

Please sign in to comment.