This commit is contained in:
Sunky.MP3G
2026-09-01 11:05:01 -04:00
committed by GitHub
parent 7f009df50f
commit 1f5fe1ae13
@@ -29,6 +29,7 @@ public class Duct extends Block implements Autotiler{
public @Load(value = "@-top-#", length = 5) TextureRegion[] topRegions;
public @Load(value = "@-bottom-#", length = 5, fallback = "duct-bottom-#") TextureRegion[] botRegions;
public @Load("@-cap") TextureRegion capRegion;
public @Nullable Block bridgeReplacement, junctionReplacement;
@@ -132,8 +133,9 @@ public class Duct extends Block implements Autotiler{
public @Nullable Item current;
public int recDir = 0;
public int blendbits, xscl, yscl, blending;
public @Nullable Building next;
public @Nullable Building next, prev;
public @Nullable DuctBuild nextc;
public boolean capped, backCapped = false;
@Override
public void draw(){
@@ -174,6 +176,11 @@ public class Duct extends Block implements Autotiler{
Draw.z(Layer.blockUnder + 0.2f);
drawAt(x, y, blendbits, rotation, SliceMode.none, under);
Draw.reset();
if(!under) return;
if(capped && capRegion.found()) Draw.rect(capRegion, x, y, rotdeg());
if(backCapped && capRegion.found()) Draw.rect(capRegion, x, y, rotdeg() + 180);
}
@Override
@@ -254,6 +261,10 @@ public class Duct extends Block implements Autotiler{
blending = bits[4];
next = front();
nextc = next instanceof DuctBuild d ? d : null;
prev = back();
capped = next == null || next.team != team || !next.block.hasItems;
backCapped = blendbits == 0 && (prev == null || prev.team != team || !prev.block.hasItems);
}
@Override