mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-28 07:25:35 -04:00
geolyzer should also update scan level, acting as crop scanner
add 'maxSize' to the scan output to better decide harvest time
This commit is contained in:
parent
0aeca03d6c
commit
dbf4dfdc1d
@ -18,21 +18,7 @@ public final class DriverCrop extends DriverSidedTileEntity {
|
||||
|
||||
@Override
|
||||
public ManagedEnvironment createEnvironment(World world, int x, int y, int z, ForgeDirection side) {
|
||||
ICropTile tile = (ICropTile) world.getTileEntity(x, y, z);
|
||||
if (tile.getScanLevel() < 4)
|
||||
return new DriverCrop.DummyEnvironment((ICropTile) world.getTileEntity(x, y, z));
|
||||
else
|
||||
return new DriverCrop.Environment((ICropTile) world.getTileEntity(x, y, z));
|
||||
}
|
||||
public static final class DummyEnvironment extends ManagedTileEntityEnvironment<ICropTile> {
|
||||
public DummyEnvironment(final ICropTile tileEntity) {
|
||||
super(tileEntity, "crop");
|
||||
}
|
||||
|
||||
@Callback
|
||||
public Object[] getScanLevel(final Context context, final Arguments args) {
|
||||
return new Object[]{tileEntity.getScanLevel()};
|
||||
}
|
||||
return new DriverCrop.Environment((ICropTile) world.getTileEntity(x, y, z));
|
||||
}
|
||||
public static final class Environment extends ManagedTileEntityEnvironment<ICropTile> {
|
||||
public Environment(final ICropTile tileEntity) {
|
||||
|
@ -18,10 +18,12 @@ object EventHandlerIndustrialCraft2 {
|
||||
val world = e.host.world
|
||||
val tile = world.getTileEntity(e.x, e.y, e.z) match {
|
||||
case crop : ICropTile => {
|
||||
crop.setScanLevel(4)
|
||||
val cc = crop.getCrop
|
||||
e.data += "crop:name" -> cc.name()
|
||||
e.data += "crop:tier" -> Int.box(cc.tier)
|
||||
e.data += "crop:size" -> Int.box(crop.getSize)
|
||||
e.data += "crop:maxSize" -> Int.box(cc.maxSize)
|
||||
e.data += "crop:growth" -> Int.box(crop.getGrowth)
|
||||
e.data += "crop:gain" -> Int.box(crop.getGain)
|
||||
e.data += "crop:resistance" -> Int.box(crop.getResistance)
|
||||
|
Loading…
x
Reference in New Issue
Block a user