Couple of tree farm changes
This commit is contained in:
parent
3dde09d558
commit
33bd22489c
4 changed files with 34 additions and 2 deletions
1
src/assets/ComputerCraft/lua/rom/test
Normal file
1
src/assets/ComputerCraft/lua/rom/test
Normal file
|
@ -0,0 +1 @@
|
|||
print("test")
|
|
@ -71,6 +71,9 @@ public class WarpDriveConfig
|
|||
public double ML_MIN_SPEED = 0.1;
|
||||
public int ML_MAX_SIZE = 128;
|
||||
|
||||
//Tree farm
|
||||
public int TF_MAX_SIZE=32;
|
||||
|
||||
// Laser Emitter
|
||||
public int LE_MAX_BOOSTERS_NUMBER = 10;
|
||||
public int LE_MAX_LASER_ENERGY = 4000000;
|
||||
|
|
|
@ -88,7 +88,7 @@ public abstract class TileEntityAbstractMiner extends WarpChunkTE implements IGr
|
|||
|
||||
protected boolean toBool(Object o)
|
||||
{
|
||||
if(o.toString() == "true" || o.toString() == "1")
|
||||
if(o.toString() == "true" || o.toString() == "1.0" || o.toString() == "1")
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
@ -98,7 +98,7 @@ public abstract class TileEntityAbstractMiner extends WarpChunkTE implements IGr
|
|||
Block block = Block.blocksList[blockID];
|
||||
if (block == null)
|
||||
return null;
|
||||
if (silkTouch())
|
||||
if (silkTouch(blockID))
|
||||
{
|
||||
if (block.canSilkHarvest(worldObj, null, i, j, k, blockMeta))
|
||||
{
|
||||
|
@ -145,6 +145,11 @@ public abstract class TileEntityAbstractMiner extends WarpChunkTE implements IGr
|
|||
return silkTouch;
|
||||
}
|
||||
|
||||
protected boolean silkTouch(int blockID)
|
||||
{
|
||||
return silkTouch();
|
||||
}
|
||||
|
||||
protected boolean silkTouch(boolean b)
|
||||
{
|
||||
silkTouch = canSilkTouch() && b;
|
||||
|
|
|
@ -18,6 +18,7 @@ public class TileEntityLaserTreeFarm extends TileEntityAbstractMiner implements
|
|||
|
||||
private int mode = 0;
|
||||
private boolean doLeaves = false;
|
||||
private boolean silkTouchLeaves = false;
|
||||
|
||||
private final int defSize = 8;
|
||||
private final int scanWait = 40;
|
||||
|
@ -39,6 +40,7 @@ public class TileEntityLaserTreeFarm extends TileEntityAbstractMiner implements
|
|||
"area",
|
||||
"leaves",
|
||||
"silkTouch",
|
||||
"silkTouchLeaves",
|
||||
"state"
|
||||
};
|
||||
|
||||
|
@ -290,6 +292,19 @@ public class TileEntityLaserTreeFarm extends TileEntityAbstractMiner implements
|
|||
return new Object[] { silkTouch() };
|
||||
}
|
||||
|
||||
if(methodStr == "silkTouchLeaves")
|
||||
{
|
||||
try
|
||||
{
|
||||
silkTouchLeaves = toBool(arguments[0]);
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
silkTouchLeaves = false;
|
||||
}
|
||||
return new Object[] { silkTouchLeaves };
|
||||
}
|
||||
|
||||
if(methodStr == "state")
|
||||
{
|
||||
String state = active ? "active" : "inactive";
|
||||
|
@ -315,6 +330,14 @@ public class TileEntityLaserTreeFarm extends TileEntityAbstractMiner implements
|
|||
}
|
||||
|
||||
//ABSTRACT LASER IMPLEMENTATION
|
||||
@Override
|
||||
protected boolean silkTouch(int blockID)
|
||||
{
|
||||
if(isLeaf(blockID))
|
||||
return silkTouchLeaves;
|
||||
return silkTouch();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean canSilkTouch()
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue