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
|
@ -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…
Add table
Add a link
Reference in a new issue