Added oil extractor

This commit is contained in:
Anuken
2018-03-13 01:16:15 -04:00
parent d1b51844e4
commit 2a0d3b05d3
11 changed files with 370 additions and 339 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 491 B

After

Width:  |  Height:  |  Size: 484 B

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 90 KiB

After

Width:  |  Height:  |  Size: 90 KiB

View File

@ -1,7 +1,7 @@
#Autogenerated file. Do not modify.
#Tue Mar 13 00:12:47 EDT 2018
#Tue Mar 13 01:15:39 EDT 2018
version=release
androidBuildCode=474
androidBuildCode=479
name=Mindustry
code=3.4
build=custom build

View File

@ -68,6 +68,7 @@ public class Recipes {
new Recipe(production, ProductionBlocks.cultivator, stack(Item.titanium, 40), stack(Item.dirium, 40)),
new Recipe(production, ProductionBlocks.laserdrill, stack(Item.titanium, 40), stack(Item.dirium, 40)),
new Recipe(production, ProductionBlocks.waterextractor, stack(Item.titanium, 40), stack(Item.dirium, 40)),
new Recipe(production, ProductionBlocks.oilextractor, stack(Item.titanium, 40), stack(Item.dirium, 40)),
new Recipe(power, ProductionBlocks.coalgenerator, stack(Item.iron, 30), stack(Item.stone, 20)),
new Recipe(power, ProductionBlocks.thermalgenerator, stack(Item.steel, 30), stack(Item.iron, 30)),

View File

@ -72,7 +72,7 @@ public abstract class BaseBlock {
}
public void tryMoveLiquid(Tile tile, Tile tileSource, Tile next, float amount){
float flow = Math.min(next.block().liquidCapacity - next.entity.liquid.amount, amount);
float flow = Math.min(next.block().liquidCapacity - next.entity.liquid.amount - 0.001f, amount);
if(next.block().acceptLiquid(next, tileSource, tile.entity.liquid.liquid, flow)){
next.block().handleLiquid(next, tileSource, tile.entity.liquid.liquid, flow);

View File

@ -22,14 +22,14 @@ public class DistributionBlocks{
}},
liquidrouter = new LiquidRouter("liquidrouter"){{
liquidCapacity = 30f;
liquidCapacity = 40f;
liquidRegion = "liquidrouter-liquid";
}},
liquidtank = new LiquidRouter("liquidtank"){{
size = 3;
liquidRegion = "liquidtank-liquid";
liquidCapacity = 1300f;
liquidCapacity = 1500f;
}},
conveyor = new Conveyor("conveyor"){{

View File

@ -16,11 +16,15 @@ public class ProductionBlocks{
core = new CoreBlock("core"){},
pump = new Pump("pump"){},
pump = new Pump("pump"){
{
pumpAmount = 0.8f;
}
},
fluxpump = new Pump("fluxpump"){
{
pumpAmount = 3f;
pumpAmount = 1.2f;
}
},
@ -87,9 +91,9 @@ public class ProductionBlocks{
oilrefinery = new LiquidCrafter("oilrefinery"){
{
inputLiquid = Liquid.oil;
liquidAmount = 45f;
liquidCapacity = 46f;
purifyTime = 60;
liquidAmount = 55f;
liquidCapacity = 56f;
purifyTime = 65;
output = Item.coal;
health = 80;
craftEffect = Fx.purifyoil;
@ -213,12 +217,23 @@ public class ProductionBlocks{
}
},
//TODO test it
waterextractor = new SolidPump("waterextractor"){
{
result = Liquid.water;
powerUse = 0.1f;
pumpAmount = 0.4f;
size = 2;
liquidCapacity = 30f;
}
},
oilextractor = new SolidPump("oilextractor"){
{
result = Liquid.oil;
powerUse = 0.5f;
pumpAmount = 0.4f;
size = 3;
liquidCapacity = 80f;
}
},

View File

@ -14,13 +14,13 @@ public class LiquidModule extends BlockModule {
@Override
public void write(DataOutputStream stream) throws IOException {
stream.writeByte(liquid.id);
stream.writeByte((byte)(amount));
stream.writeFloat(amount);
}
@Override
public void read(DataInputStream stream) throws IOException{
byte id = stream.readByte();
liquid = Liquid.getByID(id);
amount = stream.readByte();
amount = stream.readFloat();
}
}

View File

@ -12,7 +12,7 @@ import io.anuke.ucore.util.Mathf;
import io.anuke.ucore.util.Strings;
public class Pump extends LiquidBlock{
protected float pumpAmount = 2f;
protected float pumpAmount = 1f;
public Pump(String name) {
super(name);

View File

@ -8,6 +8,7 @@ import io.anuke.ucore.core.Timers;
/**Pump that makes liquid from solids and takes in power. Only works on solid floor blocks.*/
public class SolidPump extends Pump {
protected Liquid result = Liquid.water;
/**Power use per liquid unit.*/
protected float powerUse = 0.1f;
protected final Array<Tile> drawTiles = new Array<>();