diff --git a/build.gradle b/build.gradle index 8e62e0204..50027beba 100644 --- a/build.gradle +++ b/build.gradle @@ -23,7 +23,7 @@ if(hasProperty('buildnumber')){ } minecraft { - version = "1.11-13.19.0.2160" + version = "1.11-13.19.0.2180" runDir = "idea" mappings = "snapshot_20161126" @@ -45,7 +45,7 @@ repositories { dependencies { compile "net.darkhax.tesla:Tesla:1.11-1.3.0.51" - deobfCompile "mezz.jei:jei_1.11:4.0.4.198" + deobfCompile "mezz.jei:jei_1.11:4.0.4.199" } processResources { diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityInventoryBase.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityInventoryBase.java index 76e424cc8..39d9babdb 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityInventoryBase.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityInventoryBase.java @@ -19,6 +19,7 @@ import net.minecraft.util.EnumFacing; import net.minecraft.util.math.MathHelper; import net.minecraftforge.items.IItemHandler; import net.minecraftforge.items.IItemHandlerModifiable; +import net.minecraftforge.items.ItemHandlerHelper; import net.minecraftforge.items.ItemStackHandler; public abstract class TileEntityInventoryBase extends TileEntityBase{ @@ -108,20 +109,7 @@ public abstract class TileEntityInventoryBase extends TileEntityBase{ @Override public int getComparatorStrength(){ - int i = 0; - float f = 0; - - for(int j = 0; j < this.slots.getSlots(); ++j){ - ItemStack stack = this.slots.getStackInSlot(j); - - if(StackUtil.isValid(stack)){ - f += (float)StackUtil.getStackSize(stack)/(float)Math.min(this.getMaxStackSizePerSlot(j, stack), stack.getMaxStackSize()); - i++; - } - } - - f = f/(float)this.slots.getSlots(); - return MathHelper.floor(f*14.0F)+(i > 0 ? 1 : 0); + return ItemHandlerHelper.calcRedstoneFromInventory(this.slots); } @Override diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityItemViewer.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityItemViewer.java index d61837599..43cbb34af 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityItemViewer.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityItemViewer.java @@ -20,7 +20,6 @@ import net.minecraft.util.EnumFacing; import net.minecraft.util.math.BlockPos; import net.minecraftforge.items.IItemHandler; -import javax.annotation.Nonnull; import java.util.*; public class TileEntityItemViewer extends TileEntityBase{ @@ -89,6 +88,17 @@ public class TileEntityItemViewer extends TileEntityBase{ } return StackUtil.getNull(); } + + @Override + public int getSlotLimit(int slot){ + SpecificItemHandlerInfo info = TileEntityItemViewer.this.getSwitchedIndexHandler(slot); + if(info != null){ + return info.handler.getSlotLimit(info.switchedIndex); + } + else{ + return 0; + } + } }; }