workaround for damaged tools and gtce tools not being set as damageable

This commit is contained in:
Salomão
2021-06-15 12:46:44 -03:00
parent 6cb583c918
commit 8468b47443
4 changed files with 10 additions and 5 deletions
@@ -22,8 +22,10 @@ import java.util.Collection;
import java.util.Comparator;
import java.util.Map;
import appeng.util.Platform;
import com.google.common.base.Preconditions;
import gregtech.common.items.MetaTool;
import net.minecraft.item.ItemStack;
import it.unimi.dsi.fastutil.objects.Object2ObjectAVLTreeMap;
@@ -146,7 +148,7 @@ class FuzzyItemVariantList extends ItemVariantList {
*/
static ItemDamageBound makeLowerBound(final ItemStack stack, final FuzzyMode fuzzy)
{
Preconditions.checkState( stack.getItem().isDamageable(), "Item#isDamageable() has to be true" );
Preconditions.checkState( stack.getItem().isDamageable() || (Platform.isModLoaded( "gregtech" ) && stack.getItem() instanceof MetaTool), "Item#isDamageable() has to be true" );
int damage;
if( fuzzy == FuzzyMode.IGNORE_ALL )
@@ -174,7 +176,7 @@ class FuzzyItemVariantList extends ItemVariantList {
* lower number than the lower bound. It also is exclusive.
*/
static ItemDamageBound makeUpperBound(final ItemStack stack, final FuzzyMode fuzzy) {
Preconditions.checkState(stack.getItem().isDamageable(), "Item#isDamageable() has to be true");
Preconditions.checkState(stack.getItem().isDamageable() || (Platform.isModLoaded( "gregtech" ) && stack.getItem() instanceof MetaTool), "Item#isDamageable() has to be true");
int damage;
if (fuzzy == FuzzyMode.IGNORE_ALL) {