This commit is contained in:
Anuken 2024-04-10 15:31:09 -04:00
parent fec423213f
commit e280edac67
7 changed files with 32 additions and 3 deletions

View File

@ -2782,6 +2782,7 @@ public class Blocks{
ambientSoundVolume = 0.06f;
hasLiquids = true;
boostScale = 1f / 9f;
itemCapacity = 0;
outputLiquid = new LiquidStack(Liquids.water, 30f / 60f);
consumePower(0.5f);
liquidCapacity = 60f;
@ -5791,6 +5792,8 @@ public class Blocks{
heatOutput = 1000f;
warmupRate = 1000f;
regionRotated1 = 1;
itemCapacity = 0;
alwaysUnlocked = false;
ambientSound = Sounds.none;
}};

View File

@ -74,7 +74,7 @@ public class Puddles{
Puddle puddle = Puddle.create();
puddle.tile = tile;
puddle.liquid = liquid;
puddle.amount = amount;
puddle.amount = Math.min(amount, maxLiquid);
puddle.set(ax, ay);
register(puddle);
puddle.add();

View File

@ -59,6 +59,7 @@ abstract class PuddleComp implements Posc, Puddlec, Drawc, Syncc{
amount -= Time.delta * (1f - liquid.viscosity) / (5f + addSpeed);
amount += accepting;
amount = Math.min(amount, maxLiquid);
accepting = 0f;
if(amount >= maxLiquid / 1.5f){

View File

@ -11,6 +11,7 @@ import arc.scene.ui.layout.*;
import arc.struct.*;
import arc.util.*;
import mindustry.*;
import mindustry.ai.types.*;
import mindustry.content.*;
import mindustry.game.EventType.*;
import mindustry.game.*;
@ -169,7 +170,8 @@ public class HintsFragment{
depositItems(() -> player.unit().hasItem(), () -> !player.unit().hasItem()),
desktopPause(visibleDesktop, () -> isTutorial.get() && !Vars.net.active() && state.wave >= 2, () -> Core.input.keyTap(Binding.pause)),
unitControl(() -> isSerpulo() && state.rules.defaultTeam.data().units.size > 2 && !net.active() && !player.dead(), () -> !player.dead() && !player.unit().spawnedByCore),
unitSelectControl(() -> isSerpulo() && state.rules.defaultTeam.data().units.size > 3 && !net.active() && !player.dead(), () -> control.input.commandMode && control.input.selectedUnits.size > 0),
unitSelectControl(() -> isSerpulo() && state.rules.defaultTeam.data().units.size > 3 && !net.active() && !player.dead(),
() -> control.input.commandMode && control.input.selectedUnits.size > 0 && control.input.selectedUnits.first().controller() instanceof CommandAI ai && ai.targetPos != null),
respawn(visibleMobile, () -> !player.dead() && !player.unit().spawnedByCore, () -> !player.dead() && player.unit().spawnedByCore),
launch(() -> (isTutorial.get() || Vars.state.rules.sector == SectorPresets.onset.sector) && state.rules.sector.isCaptured(), () -> ui.planet.isShown()),
schematicSelect(visibleDesktop, () -> ui.hints.placedBlocks.contains(Blocks.router) || ui.hints.placedBlocks.contains(Blocks.ductRouter), () -> Core.input.keyRelease(Binding.schematic_select) || Core.input.keyTap(Binding.pick)),

View File

@ -189,6 +189,13 @@ public class StackConveyor extends Block implements Autotiler{
Draw.rect(lastItem.fullIcon, Tmp.v1.x, Tmp.v1.y, size, size, 0);
}
@Override
public void dropped(){
super.dropped();
var prev = Geometry.d4[(rotation + 2) % 4];
link = Point2.pack(tile.x + prev.x, tile.y + prev.y);
}
@Override
public void drawCracks(){
Draw.z(Layer.block - 0.15f);

View File

@ -12,6 +12,7 @@ import mindustry.graphics.*;
import mindustry.type.*;
import mindustry.ui.*;
import mindustry.world.blocks.payloads.PayloadUnloader.*;
import mindustry.world.blocks.sandbox.*;
import static mindustry.Vars.*;
@ -152,6 +153,7 @@ public class PayloadLoader extends PayloadBlock{
//load up items
if(payload.block().hasItems && items.any()){
boolean acceptedAny = false;
if(efficiency > 0.01f && timer(timerLoad, loadTime / efficiency)){
//load up items a set amount of times
for(int j = 0; j < itemsLoaded && items.any(); j++){
@ -162,6 +164,7 @@ public class PayloadLoader extends PayloadBlock{
if(payload.build.acceptItem(payload.build, item)){
payload.build.handleItem(payload.build, item);
items.remove(item, 1);
acceptedAny = true;
break;
}else if(payload.block().separateItemCapacity || payload.block().consumesItem(item)){
exporting = true;
@ -171,6 +174,9 @@ public class PayloadLoader extends PayloadBlock{
}
}
}
if(!acceptedAny){
exporting = true;
}
}
//load up liquids
@ -180,8 +186,12 @@ public class PayloadLoader extends PayloadBlock{
float flow = Math.min(Math.min(liquidsLoaded * edelta(), payload.block().liquidCapacity - payload.build.liquids.get(liq)), total);
//TODO potential crash here
if(payload.build.acceptLiquid(payload.build, liq)){
payload.build.liquids.add(liq, flow);
if(!(payload.block() instanceof LiquidVoid)){
payload.build.liquids.add(liq, flow);
}
liquids.remove(liq, flow);
}else{
exporting = true;
}
}

View File

@ -24,6 +24,12 @@ public class LiquidVoid extends Block{
}
public class LiquidVoidBuild extends Building{
@Override
public void placed(){
super.placed();
liquids.clear();
}
@Override
public boolean acceptLiquid(Building source, Liquid liquid){
return enabled;