Update forge

This commit is contained in:
Ellpeck 2016-12-05 17:10:23 +01:00
parent c377d54e52
commit 9b7177fbe9
3 changed files with 15 additions and 17 deletions

View file

@ -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 {

View file

@ -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

View file

@ -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;
}
}
};
}