mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-06-25 10:14:43 +02:00
@ -236,7 +236,7 @@ public class PotionConfig extends ConfigLoader {
|
||||
}
|
||||
|
||||
public boolean isValidPotion(ItemStack item) {
|
||||
return potionMap.containsKey(item.getDurability());
|
||||
return getPotion(item) != null;
|
||||
}
|
||||
|
||||
public AlchemyPotion getPotion(String name) {
|
||||
|
@ -139,15 +139,15 @@ public class AlchemyPotion {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (!meta.hasLore()) {
|
||||
if (!meta.hasLore() && !lore.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
if (!meta.getLore().equals(lore)) {
|
||||
if (!(lore.isEmpty() && !meta.hasLore()) && !meta.getLore().equals(lore)) {
|
||||
return false;
|
||||
}
|
||||
if (!meta.hasDisplayName()) {
|
||||
if (!meta.hasDisplayName() && name != null) {
|
||||
return false;
|
||||
}
|
||||
return meta.getDisplayName().equals(name);
|
||||
return (name == null && !meta.hasDisplayName()) || meta.getDisplayName().equals(name);
|
||||
}
|
||||
}
|
||||
|
@ -54,8 +54,8 @@ public enum PotionStage {
|
||||
|
||||
int stage = 1;
|
||||
|
||||
// Check if potion has base effect
|
||||
if (data.getType().getEffectType() != null) {
|
||||
// Check if potion has an effect of any sort
|
||||
if (data.getType().getEffectType() != null || !effects.isEmpty()) {
|
||||
stage++;
|
||||
}
|
||||
|
||||
@ -63,8 +63,7 @@ public enum PotionStage {
|
||||
// Else check if the potion has a custom effect with an amplifier added by mcMMO
|
||||
if (data.isUpgraded()) {
|
||||
stage++;
|
||||
}
|
||||
if(!effects.isEmpty()){
|
||||
} else if(!effects.isEmpty()) {
|
||||
for (PotionEffect effect : effects){
|
||||
if(effect.getAmplifier() > 0){
|
||||
stage++;
|
||||
|
@ -165,7 +165,7 @@ public class InventoryListener implements Listener {
|
||||
ItemStack clicked = event.getCurrentItem();
|
||||
ItemStack cursor = event.getCursor();
|
||||
|
||||
if ((clicked != null && clicked.getType() == Material.POTION) || (cursor != null && cursor.getType() == Material.POTION)) {
|
||||
if ((clicked != null && (clicked.getType() == Material.POTION || clicked.getType() == Material.SPLASH_POTION || clicked.getType() == Material.LINGERING_POTION)) || (cursor != null && (cursor.getType() == Material.POTION || cursor.getType() == Material.SPLASH_POTION || cursor.getType() == Material.LINGERING_POTION))) {
|
||||
AlchemyPotionBrewer.scheduleCheck(player, stand);
|
||||
return;
|
||||
}
|
||||
@ -296,12 +296,12 @@ public class InventoryListener implements Listener {
|
||||
|
||||
ItemStack item = event.getItem();
|
||||
|
||||
if (Config.getInstance().getPreventHopperTransferIngredients() && item.getType() != Material.POTION) {
|
||||
if (Config.getInstance().getPreventHopperTransferIngredients() && item.getType() != Material.POTION && item.getType() != Material.SPLASH_POTION && item.getType() != Material.LINGERING_POTION) {
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
|
||||
if (Config.getInstance().getPreventHopperTransferBottles() && item.getType() == Material.POTION) {
|
||||
if (Config.getInstance().getPreventHopperTransferBottles() && (item.getType() == Material.POTION || item.getType() == Material.SPLASH_POTION || item.getType() == Material.LINGERING_POTION)) {
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
|
@ -32,7 +32,7 @@ public final class AlchemyPotionBrewer {
|
||||
}
|
||||
|
||||
for (int i = 0; i < 3; i++) {
|
||||
if (contents[i] == null || contents[i].getType() != Material.POTION) {
|
||||
if (contents[i] == null || contents[i].getType() != Material.POTION && contents[i].getType() != Material.SPLASH_POTION && contents[i].getType() != Material.LINGERING_POTION) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user