Skip to content

Commit

Permalink
fix BreweryPluginItem
Browse files Browse the repository at this point in the history
  • Loading branch information
Jsinco committed Dec 14, 2024
1 parent 4f1f952 commit cfa8663
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import com.dre.brewery.Brew;
import com.dre.brewery.recipe.BRecipe;
import com.dre.brewery.recipe.PluginItem;
import org.bukkit.ChatColor;
import org.bukkit.inventory.ItemStack;

/**
Expand All @@ -38,12 +37,13 @@ public class BreweryPluginItem extends PluginItem {
@Override
public boolean matches(ItemStack item) {
Brew brew = Brew.get(item);
if (brew != null) {
BRecipe recipe = brew.getCurrentRecipe();
if (recipe != null) {
return recipe.getRecipeName().equalsIgnoreCase(getItemId()) || recipe.getName(10).equalsIgnoreCase(getItemId());
}
return ChatColor.stripColor(item.getItemMeta().getDisplayName()).equalsIgnoreCase(getItemId());
if (brew == null) {
return false;
}

BRecipe recipe = brew.getCurrentRecipe();
if (recipe != null) {
return this.getItemId().equalsIgnoreCase(recipe.getId());
}
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

package com.dre.brewery.utility.releases.impl;

import com.dre.brewery.utility.Logging;
import com.dre.brewery.utility.releases.ReleaseChecker;

import java.io.IOException;
Expand Down Expand Up @@ -50,6 +51,7 @@ public CompletableFuture<String> resolveLatest() {
}
return CONST_UNRESOLVED;
} catch (IOException e) {
Logging.warningLog("Failed to resolve latest BreweryX version from SpigotMC. (No connection?)");
return CONST_UNRESOLVED;
}
});
Expand Down

0 comments on commit cfa8663

Please sign in to comment.