mirror of
https://github.com/ChestShop-authors/ChestShop-3.git
synced 2024-09-27 14:13:05 +02:00
Posibility to ignore some enchantment from ItemStack
Add configuration IGNORE_ENCHANT_ATTRIBUTE_FOR_SIMILARITY
This commit is contained in:
parent
c7ee705012
commit
86605352be
@ -137,10 +137,18 @@ public class MaterialUtil {
|
||||
if (oneMeta == twoMeta || oneMeta == null || twoMeta == null) {
|
||||
return oneMeta == twoMeta;
|
||||
}
|
||||
|
||||
Map<String, Object> oneSerMeta = new HashMap<>(oneMeta.serialize());
|
||||
Map<String, Object> twoSerMeta = new HashMap<>(twoMeta.serialize());
|
||||
oneSerMeta.remove("repair-cost");
|
||||
twoSerMeta.remove("repair-cost");
|
||||
System.out.println("IGNORE LIST: ");
|
||||
System.out.println(Properties.IGNORE_ENCHANT_ATTRIBUTE_FOR_SIMILARITY);
|
||||
if (!Properties.IGNORE_ENCHANT_ATTRIBUTE_FOR_SIMILARITY.isEmpty()) {
|
||||
for (String ignoreKey : Properties.IGNORE_ENCHANT_ATTRIBUTE_FOR_SIMILARITY) {
|
||||
oneSerMeta.remove(ignoreKey);
|
||||
twoSerMeta.remove(ignoreKey);
|
||||
}
|
||||
}
|
||||
|
||||
if (oneSerMeta.equals(twoSerMeta)) {
|
||||
return true;
|
||||
}
|
||||
|
@ -18,6 +18,7 @@ import java.util.Locale;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import java.util.logging.Level;
|
||||
import java.util.Collections;
|
||||
|
||||
/**
|
||||
* @author Acrobot
|
||||
@ -337,4 +338,10 @@ public class Properties {
|
||||
@PrecededBySpace
|
||||
@ConfigurationComment("Add stock counter to quantity line?")
|
||||
public static boolean USE_STOCK_COUNTER = false;
|
||||
|
||||
@PrecededBySpace
|
||||
@ConfigurationComment("Ignore enchantment attribute for similarity")
|
||||
@Parser("StringSet")
|
||||
public static Set<String> IGNORE_ENCHANT_ATTRIBUTE_FOR_SIMILARITY = new LinkedHashSet<>();
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user