Fixed custom recipe gui not displaying item on recipe.

also version bump (1.6.10)
This commit is contained in:
alexcrea 2024-11-21 15:23:20 +01:00
parent 73ec340e34
commit f5d607212d
No known key found for this signature in database
GPG key ID: 43FD265DB0DBF91F
4 changed files with 15 additions and 11 deletions

View file

@ -20,17 +20,16 @@ import java.util.Collection;
public class CustomRecipeConfigGui extends MappedGuiListConfigGui<AnvilCustomRecipe,
MappedGuiListConfigGui.LazyElement<CustomRecipeSubSettingGui>> {
private static CustomRecipeConfigGui INSTANCE = new CustomRecipeConfigGui();
@Nullable
public static CustomRecipeConfigGui getCurrentInstance(){
public static CustomRecipeConfigGui getCurrentInstance() {
return INSTANCE;
}
@NotNull
public static CustomRecipeConfigGui getInstance(){
if(INSTANCE == null) INSTANCE = new CustomRecipeConfigGui();
public static CustomRecipeConfigGui getInstance() {
if (INSTANCE == null) INSTANCE = new CustomRecipeConfigGui();
return INSTANCE;
}
@ -46,9 +45,9 @@ public class CustomRecipeConfigGui extends MappedGuiListConfigGui<AnvilCustomRec
// Get base item to display
ItemStack craftResultItem = recipe.getResultItem();
ItemStack displayedItem;
if(craftResultItem == null){
if (craftResultItem == null) {
displayedItem = new ItemStack(Material.BARRIER);
}else{
} else {
displayedItem = craftResultItem.clone();
}
@ -62,9 +61,9 @@ public class CustomRecipeConfigGui extends MappedGuiListConfigGui<AnvilCustomRec
boolean shouldWork = recipe.validate();
meta.setLore(Arrays.asList(
"§7Should work: §"+(shouldWork ? "aYes" : "cNo"),
"§7Exact count: §"+(recipe.getExactCount() ? "aYes" : "cNo"),
"§7Recipe Xp Cost: §e"+recipe.getXpCostPerCraft()
"§7Should work: §" + (shouldWork ? "aYes" : "cNo"),
"§7Exact count: §" + (recipe.getExactCount() ? "aYes" : "cNo"),
"§7Recipe Xp Cost: §e" + recipe.getXpCostPerCraft()
));

View file

@ -107,6 +107,9 @@ public class CustomRecipeSubSettingGui extends MappedToListSubSettingGui {
AnvilCustomRecipe.Companion.getDEFAULT_RESULT_ITEM_CONFIG(),
"§7Set the result item of the custom craft",
"§7\u25A1 + \u25A1 = \u25A0");
// Now we update the items
updateLocal();
}
private ConfirmActionGui createDeleteGui() {