Added lesu logic. updated fmp to allow extra utils to run
This commit is contained in:
parent
afdbe69d18
commit
2ded7e0121
3 changed files with 20 additions and 4 deletions
|
@ -94,7 +94,7 @@ dependencies {
|
|||
compile "codechicken:CodeChickenLib:1.7.10-1.1.3.136:dev"
|
||||
compile "codechicken:CodeChickenCore:1.7.10-1.0.6.+:dev"
|
||||
compile "codechicken:NotEnoughItems:1.7.10-1.0.4.+:dev"
|
||||
compile "codechicken:ForgeMultipart:1.7.10-1.1.2.331:dev"
|
||||
compile "codechicken:ForgeMultipart:1.7.10-1.2.0.345:dev"
|
||||
compile "mcp.mobius.waila:Waila:1.5.10_1.7.10:dev"
|
||||
compile name: 'buildcraft', version: '7.0.9', classifier: "dev", ext: 'jar'
|
||||
compile "qmunity:QmunityLib:0.1.+:deobf"
|
||||
|
|
|
@ -69,12 +69,14 @@ public class BlockLesuStorage extends BlockMachineBase {
|
|||
|
||||
@Override
|
||||
public void breakBlock(World world, int x, int y, int z, Block block, int meta) {
|
||||
super.breakBlock(world, x, y, z, block, meta);
|
||||
if(world.getTileEntity(x, y, z) instanceof TileLesuStorage){
|
||||
if(world.getTileEntity(x, y, z) instanceof TileLesuStorage) {
|
||||
((TileLesuStorage) world.getTileEntity(x, y, z)).removeFromNetwork();
|
||||
}
|
||||
super.breakBlock(world, x, y, z, block, meta);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_)
|
||||
{
|
||||
|
|
|
@ -4,6 +4,7 @@ package techreborn.tiles.lesu;
|
|||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import techreborn.tiles.TileAesu;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class TileLesu extends TileAesu {
|
||||
|
@ -13,6 +14,7 @@ public class TileLesu extends TileAesu {
|
|||
|
||||
private ArrayList<LesuNetwork> countedNetworks = new ArrayList<LesuNetwork>();
|
||||
public int connectedBlocks = 0;
|
||||
public int currentBlocks = 0;
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
|
@ -32,6 +34,18 @@ public class TileLesu extends TileAesu {
|
|||
}
|
||||
}
|
||||
}
|
||||
System.out.println(connectedBlocks);
|
||||
if(currentBlocks != connectedBlocks){
|
||||
try {
|
||||
Field field = getClass().getSuperclass().getSuperclass().getDeclaredField("maxStorage");
|
||||
field.setAccessible(true);
|
||||
field.set(this, (connectedBlocks * storgeBlockSize) + baseEU);
|
||||
currentBlocks = connectedBlocks;
|
||||
System.out.println("set output to " + maxStorage + " using " + connectedBlocks);
|
||||
} catch (NoSuchFieldException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue