Added oil extractor
This commit is contained in:
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 |
@@ -1,7 +1,7 @@
|
|||||||
#Autogenerated file. Do not modify.
|
#Autogenerated file. Do not modify.
|
||||||
#Tue Mar 13 00:12:47 EDT 2018
|
#Tue Mar 13 01:15:39 EDT 2018
|
||||||
version=release
|
version=release
|
||||||
androidBuildCode=474
|
androidBuildCode=479
|
||||||
name=Mindustry
|
name=Mindustry
|
||||||
code=3.4
|
code=3.4
|
||||||
build=custom build
|
build=custom build
|
||||||
|
|||||||
@@ -68,6 +68,7 @@ public class Recipes {
|
|||||||
new Recipe(production, ProductionBlocks.cultivator, stack(Item.titanium, 40), stack(Item.dirium, 40)),
|
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.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.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.coalgenerator, stack(Item.iron, 30), stack(Item.stone, 20)),
|
||||||
new Recipe(power, ProductionBlocks.thermalgenerator, stack(Item.steel, 30), stack(Item.iron, 30)),
|
new Recipe(power, ProductionBlocks.thermalgenerator, stack(Item.steel, 30), stack(Item.iron, 30)),
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ public abstract class BaseBlock {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void tryMoveLiquid(Tile tile, Tile tileSource, Tile next, float amount){
|
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)){
|
if(next.block().acceptLiquid(next, tileSource, tile.entity.liquid.liquid, flow)){
|
||||||
next.block().handleLiquid(next, tileSource, tile.entity.liquid.liquid, flow);
|
next.block().handleLiquid(next, tileSource, tile.entity.liquid.liquid, flow);
|
||||||
|
|||||||
@@ -22,14 +22,14 @@ public class DistributionBlocks{
|
|||||||
}},
|
}},
|
||||||
|
|
||||||
liquidrouter = new LiquidRouter("liquidrouter"){{
|
liquidrouter = new LiquidRouter("liquidrouter"){{
|
||||||
liquidCapacity = 30f;
|
liquidCapacity = 40f;
|
||||||
liquidRegion = "liquidrouter-liquid";
|
liquidRegion = "liquidrouter-liquid";
|
||||||
}},
|
}},
|
||||||
|
|
||||||
liquidtank = new LiquidRouter("liquidtank"){{
|
liquidtank = new LiquidRouter("liquidtank"){{
|
||||||
size = 3;
|
size = 3;
|
||||||
liquidRegion = "liquidtank-liquid";
|
liquidRegion = "liquidtank-liquid";
|
||||||
liquidCapacity = 1300f;
|
liquidCapacity = 1500f;
|
||||||
}},
|
}},
|
||||||
|
|
||||||
conveyor = new Conveyor("conveyor"){{
|
conveyor = new Conveyor("conveyor"){{
|
||||||
|
|||||||
@@ -16,11 +16,15 @@ public class ProductionBlocks{
|
|||||||
|
|
||||||
core = new CoreBlock("core"){},
|
core = new CoreBlock("core"){},
|
||||||
|
|
||||||
pump = new Pump("pump"){},
|
pump = new Pump("pump"){
|
||||||
|
{
|
||||||
|
pumpAmount = 0.8f;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
fluxpump = new Pump("fluxpump"){
|
fluxpump = new Pump("fluxpump"){
|
||||||
{
|
{
|
||||||
pumpAmount = 3f;
|
pumpAmount = 1.2f;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -87,9 +91,9 @@ public class ProductionBlocks{
|
|||||||
oilrefinery = new LiquidCrafter("oilrefinery"){
|
oilrefinery = new LiquidCrafter("oilrefinery"){
|
||||||
{
|
{
|
||||||
inputLiquid = Liquid.oil;
|
inputLiquid = Liquid.oil;
|
||||||
liquidAmount = 45f;
|
liquidAmount = 55f;
|
||||||
liquidCapacity = 46f;
|
liquidCapacity = 56f;
|
||||||
purifyTime = 60;
|
purifyTime = 65;
|
||||||
output = Item.coal;
|
output = Item.coal;
|
||||||
health = 80;
|
health = 80;
|
||||||
craftEffect = Fx.purifyoil;
|
craftEffect = Fx.purifyoil;
|
||||||
@@ -213,12 +217,23 @@ public class ProductionBlocks{
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
//TODO test it
|
|
||||||
waterextractor = new SolidPump("waterextractor"){
|
waterextractor = new SolidPump("waterextractor"){
|
||||||
{
|
{
|
||||||
result = Liquid.water;
|
result = Liquid.water;
|
||||||
powerUse = 0.1f;
|
powerUse = 0.1f;
|
||||||
|
pumpAmount = 0.4f;
|
||||||
size = 2;
|
size = 2;
|
||||||
|
liquidCapacity = 30f;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
oilextractor = new SolidPump("oilextractor"){
|
||||||
|
{
|
||||||
|
result = Liquid.oil;
|
||||||
|
powerUse = 0.5f;
|
||||||
|
pumpAmount = 0.4f;
|
||||||
|
size = 3;
|
||||||
|
liquidCapacity = 80f;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -14,13 +14,13 @@ public class LiquidModule extends BlockModule {
|
|||||||
@Override
|
@Override
|
||||||
public void write(DataOutputStream stream) throws IOException {
|
public void write(DataOutputStream stream) throws IOException {
|
||||||
stream.writeByte(liquid.id);
|
stream.writeByte(liquid.id);
|
||||||
stream.writeByte((byte)(amount));
|
stream.writeFloat(amount);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void read(DataInputStream stream) throws IOException{
|
public void read(DataInputStream stream) throws IOException{
|
||||||
byte id = stream.readByte();
|
byte id = stream.readByte();
|
||||||
liquid = Liquid.getByID(id);
|
liquid = Liquid.getByID(id);
|
||||||
amount = stream.readByte();
|
amount = stream.readFloat();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import io.anuke.ucore.util.Mathf;
|
|||||||
import io.anuke.ucore.util.Strings;
|
import io.anuke.ucore.util.Strings;
|
||||||
|
|
||||||
public class Pump extends LiquidBlock{
|
public class Pump extends LiquidBlock{
|
||||||
protected float pumpAmount = 2f;
|
protected float pumpAmount = 1f;
|
||||||
|
|
||||||
public Pump(String name) {
|
public Pump(String name) {
|
||||||
super(name);
|
super(name);
|
||||||
|
|||||||
@@ -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.*/
|
/**Pump that makes liquid from solids and takes in power. Only works on solid floor blocks.*/
|
||||||
public class SolidPump extends Pump {
|
public class SolidPump extends Pump {
|
||||||
protected Liquid result = Liquid.water;
|
protected Liquid result = Liquid.water;
|
||||||
|
/**Power use per liquid unit.*/
|
||||||
protected float powerUse = 0.1f;
|
protected float powerUse = 0.1f;
|
||||||
|
|
||||||
protected final Array<Tile> drawTiles = new Array<>();
|
protected final Array<Tile> drawTiles = new Array<>();
|
||||||
|
|||||||
Reference in New Issue
Block a user