Fixed startup error with furnace/campfire recipes

This commit is contained in:
Jules 2023-10-01 01:09:26 +02:00
parent 79ec79b4c5
commit 56359e0b61

View File

@ -36,9 +36,13 @@ import org.jetbrains.annotations.NotNull;
@Deprecated @Deprecated
public class RMGRR_LegacyBurning implements RecipeRegistry { public class RMGRR_LegacyBurning implements RecipeRegistry {
private final CraftingType craftingType; private final CraftingType craftingType;
@SuppressWarnings("NotNullFieldNotInitialized")
@NotNull
private final ItemStack displayListItem;
public RMGRR_LegacyBurning(CraftingType craftingType) { public RMGRR_LegacyBurning(CraftingType craftingType) {
this.craftingType = craftingType; this.craftingType = craftingType;
displayListItem = RecipeEditorGUI.rename(craftingType.getItem(), FFPMMOItems.get().getExampleFormat() + capitalizeFirst(getRecipeConfigPath()) + " Recipe");
} }
@NotNull @NotNull
@ -48,14 +52,10 @@ public class RMGRR_LegacyBurning implements RecipeRegistry {
@NotNull public static String capitalizeFirst(@NotNull String str) { return str.substring(0, 1).toUpperCase() + str.substring(1); } @NotNull public static String capitalizeFirst(@NotNull String str) { return str.substring(0, 1).toUpperCase() + str.substring(1); }
@NotNull @Override public String getRecipeConfigPath() { return getLegacyBurningType().name().toLowerCase(); } @NotNull @Override public String getRecipeConfigPath() { return craftingType.name().toLowerCase(); }
@NotNull @Override public String getRecipeTypeName() { return "§8{§4§oL§8} " + capitalizeFirst(getRecipeConfigPath()); } @NotNull @Override public String getRecipeTypeName() { return "§8{§4§oL§8} " + capitalizeFirst(getRecipeConfigPath()); }
@SuppressWarnings("NotNullFieldNotInitialized")
@NotNull
private final ItemStack displayListItem = RecipeEditorGUI.rename(getLegacyBurningType().getItem(), FFPMMOItems.get().getExampleFormat() + capitalizeFirst(getRecipeConfigPath()) + " Recipe");
@NotNull @NotNull
@Override @Override
public ItemStack getDisplayListItem() { public ItemStack getDisplayListItem() {
@ -93,7 +93,7 @@ public class RMGRR_LegacyBurning implements RecipeRegistry {
// Yes // Yes
MMOItems.plugin.getRecipes().registerBurningRecipe( MMOItems.plugin.getRecipes().registerBurningRecipe(
getLegacyBurningType().getBurningType(), craftingType.getBurningType(),
template.newBuilder(0, null).build(), template.newBuilder(0, null).build(),
info, outputAmount, namespace.getValue(), hideBook); info, outputAmount, namespace.getValue(), hideBook);