Skip to content

Commit

Permalink
Fixed custom recipe gui not displaying item on recipe.
Browse files Browse the repository at this point in the history
also version bump (1.6.10)
  • Loading branch information
alexcrea committed Nov 21, 2024
1 parent 73ec340 commit f5d6072
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 11 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ plugins {
}

group = "xyz.alexcrea"
version = "1.6.9"
version = "1.6.10"

repositories {
// EcoEnchants
Expand Down
4 changes: 3 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@ kotlin.code.style=official
# Signing
signing.gnupg.executable=gpg
signing.gnupg.useLegacyGpg=true
signing.gnupg.keyName=B0DBF91F
signing.gnupg.keyName=B0DBF91F

kotlin.daemon.jvmargs=-Xmx8G
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,16 @@
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;
}
Expand All @@ -46,9 +45,9 @@ protected ItemStack createItemForGeneric(AnvilCustomRecipe recipe) {
// 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();
}

Expand All @@ -62,9 +61,9 @@ protected ItemStack createItemForGeneric(AnvilCustomRecipe recipe) {
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()

));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ private void prepareStaticValues() {
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() {
Expand Down

0 comments on commit f5d6072

Please sign in to comment.