diff --git a/assets/sprites/blocks/hybrid/item-liquid-junction-item.png b/assets/sprites/blocks/hybrid/item-liquid-junction-item.png new file mode 100644 index 0000000..6b25a54 Binary files /dev/null and b/assets/sprites/blocks/hybrid/item-liquid-junction-item.png differ diff --git a/assets/sprites/blocks/hybrid/item-liquid-junction-liquid.png b/assets/sprites/blocks/hybrid/item-liquid-junction-liquid.png new file mode 100644 index 0000000..4c4195f Binary files /dev/null and b/assets/sprites/blocks/hybrid/item-liquid-junction-liquid.png differ diff --git a/assets/sprites/blocks/hybrid/item-liquid-junction.png b/assets/sprites/blocks/hybrid/item-liquid-junction.png new file mode 100644 index 0000000..69ccb14 Binary files /dev/null and b/assets/sprites/blocks/hybrid/item-liquid-junction.png differ diff --git a/src/tranqol/world/blocks/hybrid/ItemLiquidJunction.java b/src/tranqol/world/blocks/hybrid/ItemLiquidJunction.java index 23c5350..12cde1f 100644 --- a/src/tranqol/world/blocks/hybrid/ItemLiquidJunction.java +++ b/src/tranqol/world/blocks/hybrid/ItemLiquidJunction.java @@ -1,8 +1,11 @@ package tranqol.world.blocks.hybrid; +import arc.*; +import arc.graphics.g2d.*; import arc.math.*; import arc.util.*; import arc.util.io.*; +import mindustry.entities.units.*; import mindustry.gen.*; import mindustry.type.*; import mindustry.world.*; @@ -15,16 +18,44 @@ public class ItemLiquidJunction extends LiquidBlock{ public float speed = 26; //frames taken for item go through this junction public int capacity = 6; + protected TextureRegion[][] directionRegions; + public ItemLiquidJunction(String name){ super(name); rotate = true; - //rotateDraw = false; + rotateDraw = false; + drawArrow = false; unloadable = false; floating = true; noUpdateDisabled = true; } + @Override + public void load(){ + super.load(); + + directionRegions = new TextureRegion[2][2]; + for(int j = 0; j <= 1; j++){ + directionRegions[j][0] = Core.atlas.find(name + "-item" + j, name + "-item"); + directionRegions[j][1] = Core.atlas.find(name + "-liquid" + j, name + "-liquid"); + } + } + + @Override + public void drawPlanRegion(BuildPlan plan, Eachable list){ + super.drawPlanRegion(plan, list); + + for(int i = 0; i < 4; i++){ + Draw.rect(directionRegions[i > 1 ? 1 : 0][(plan.rotation + i) % 2], plan.drawx(), plan.drawy(), i * 90f); + } + } + + @Override + public TextureRegion[] icons(){ + return new TextureRegion[]{region}; + } + @Override public void setStats(){ super.setStats(); @@ -45,6 +76,15 @@ public boolean outputsItems(){ public class ItemLiquidJunctionBuild extends LiquidBuild{ public DirectionalItemBuffer buffer = new DirectionalItemBuffer(capacity); + @Override + public void draw(){ + Draw.rect(region, x, y); + + for(int i = 0; i < 4; i++){ + Draw.rect(directionRegions[i > 1 ? 1 : 0][(rotation + i) % 2], x, y, i * 90f); + } + } + @Override public Building getLiquidDestination(Building source, Liquid liquid){ if(!enabled || relativeSelf(source) % 2 == 0) return this;