workaround for damaged tools and gtce tools not being set as damageable
This commit is contained in:
@@ -80,7 +80,7 @@ configurations {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compileOnly "gregtechce:gregtech:1.12.2:1.12.0.662"
|
||||
compileOnly "gregtechce:gregtech:1.12.2:1.15.1.735"
|
||||
|
||||
// installable runtime dependencies
|
||||
mods "mcp.mobius.waila:Hwyla:${hwyla_version}"
|
||||
|
||||
@@ -29,6 +29,7 @@ import java.util.Iterator;
|
||||
import appeng.api.config.FuzzyMode;
|
||||
import appeng.api.storage.data.IItemList;
|
||||
import appeng.container.implementations.ContainerPatternTerm;
|
||||
import gregtech.common.items.MetaTool;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.buffer.Unpooled;
|
||||
|
||||
@@ -215,7 +216,7 @@ public class PacketJEIRecipe extends AppEngPacket
|
||||
IAEItemStack mostDamaged = null;
|
||||
for( IAEItemStack is : outList )
|
||||
{
|
||||
if( !is.isCraftable() )
|
||||
if( !is.isCraftable() && (is.getItem().isDamageable() || (Platform.isModLoaded( "gregtech" ) && is.getItem() instanceof MetaTool ) ) )
|
||||
{
|
||||
if( mostDamaged == null || mostDamaged.getItemDamage() < is.getItemDamage() )
|
||||
{
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -25,6 +25,8 @@ import java.util.Iterator;
|
||||
import java.util.NoSuchElementException;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
import appeng.util.Platform;
|
||||
import gregtech.common.items.MetaTool;
|
||||
import net.minecraft.item.Item;
|
||||
|
||||
import it.unimi.dsi.fastutil.objects.Reference2ObjectMap;
|
||||
@@ -149,7 +151,7 @@ public final class ItemList implements IItemList<IAEItemStack> {
|
||||
}
|
||||
|
||||
private ItemVariantList makeRecordMap(Item item) {
|
||||
if (item.isDamageable()) {
|
||||
if (item.isDamageable() || (Platform.isModLoaded( "gregtech" ) && item instanceof MetaTool) ) {
|
||||
return new FuzzyItemVariantList();
|
||||
} else {
|
||||
return new NormalItemVariantList();
|
||||
|
||||
Reference in New Issue
Block a user