diff --git a/core/assets-raw/sprites/blocks/distribution/bridgeconduit.png b/core/assets-raw/sprites/blocks/distribution/bridgeconduit.png new file mode 100644 index 0000000000..60dd3b840c Binary files /dev/null and b/core/assets-raw/sprites/blocks/distribution/bridgeconduit.png differ diff --git a/core/assets-raw/sprites/blocks/distribution/bridgeconveyor-arrow.png b/core/assets-raw/sprites/blocks/distribution/bridgeconveyor-arrow.png new file mode 100644 index 0000000000..2d8e45aa34 Binary files /dev/null and b/core/assets-raw/sprites/blocks/distribution/bridgeconveyor-arrow.png differ diff --git a/core/assets-raw/sprites/blocks/distribution/bridgeconveyor-bridge.png b/core/assets-raw/sprites/blocks/distribution/bridgeconveyor-bridge.png new file mode 100644 index 0000000000..3ec3a10f7e Binary files /dev/null and b/core/assets-raw/sprites/blocks/distribution/bridgeconveyor-bridge.png differ diff --git a/core/assets-raw/sprites/blocks/distribution/bridgeconveyor-end.png b/core/assets-raw/sprites/blocks/distribution/bridgeconveyor-end.png new file mode 100644 index 0000000000..c2d5660ad5 Binary files /dev/null and b/core/assets-raw/sprites/blocks/distribution/bridgeconveyor-end.png differ diff --git a/core/assets-raw/sprites/blocks/distribution/bridgeconveyor.png b/core/assets-raw/sprites/blocks/distribution/bridgeconveyor.png new file mode 100644 index 0000000000..ef1ade6a87 Binary files /dev/null and b/core/assets-raw/sprites/blocks/distribution/bridgeconveyor.png differ diff --git a/core/assets-raw/sprites/blocks/distribution/liquidjunction.png b/core/assets-raw/sprites/blocks/distribution/liquidjunction.png index 0a0bfdcfba..29808c9146 100644 Binary files a/core/assets-raw/sprites/blocks/distribution/liquidjunction.png and b/core/assets-raw/sprites/blocks/distribution/liquidjunction.png differ diff --git a/core/assets/sprites/sprites.atlas b/core/assets/sprites/sprites.atlas index e8b6a73599..36784c6d49 100644 --- a/core/assets/sprites/sprites.atlas +++ b/core/assets/sprites/sprites.atlas @@ -11,44 +11,79 @@ background orig: 421, 316 offset: 0, 0 index: -1 +bridgeconduit + rotate: false + xy: 623, 198 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +bridgeconveyor + rotate: false + xy: 633, 198 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +bridgeconveyor-arrow + rotate: false + xy: 643, 198 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +bridgeconveyor-bridge + rotate: false + xy: 592, 188 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +bridgeconveyor-end + rotate: false + xy: 592, 178 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 conduit-bottom - rotate: false - xy: 612, 188 - size: 8, 8 - orig: 8, 8 - offset: 0, 0 - index: -1 -conduit-top - rotate: false - xy: 602, 168 - size: 8, 8 - orig: 8, 8 - offset: 0, 0 - index: -1 -conduittunnel - rotate: false - xy: 612, 178 - size: 8, 8 - orig: 8, 8 - offset: 0, 0 - index: -1 -conveyor - rotate: false - xy: 622, 188 - size: 8, 8 - orig: 8, 8 - offset: 0, 0 - index: -1 -conveyormove rotate: false xy: 602, 158 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 +conduit-top + rotate: false + xy: 622, 178 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +conduittunnel + rotate: false + xy: 632, 188 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +conveyor + rotate: false + xy: 612, 158 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +conveyormove + rotate: false + xy: 622, 168 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 conveyortunnel rotate: false - xy: 612, 168 + xy: 632, 178 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -60,63 +95,63 @@ core orig: 24, 24 offset: 0, 0 index: -1 -itembridge - rotate: false - xy: 463, 144 - size: 8, 8 - orig: 8, 8 - offset: 0, 0 - index: -1 -itembridge-arrow - rotate: false - xy: 443, 114 - size: 8, 8 - orig: 8, 8 - offset: 0, 0 - index: -1 -itembridge-bridge - rotate: false - xy: 453, 124 - size: 8, 8 - orig: 8, 8 - offset: 0, 0 - index: -1 -itembridge-end - rotate: false - xy: 463, 134 - size: 8, 8 - orig: 8, 8 - offset: 0, 0 - index: -1 junction rotate: false - xy: 463, 124 + xy: 473, 134 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 -liquidbridge +laserconduit + rotate: false + xy: 483, 144 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +laserconduit-arrow + rotate: false + xy: 463, 114 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +laserconduit-bridge + rotate: false + xy: 473, 124 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +laserconduit-end + rotate: false + xy: 483, 134 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +laserconveyor rotate: false xy: 493, 144 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 -liquidbridge-arrow +laserconveyor-arrow rotate: false xy: 473, 114 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 -liquidbridge-bridge +laserconveyor-bridge rotate: false xy: 483, 124 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 -liquidbridge-end +laserconveyor-end rotate: false xy: 493, 134 size: 8, 8 @@ -125,35 +160,35 @@ liquidbridge-end index: -1 liquidjunction rotate: false - xy: 493, 124 + xy: 503, 123 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 liquidrouter rotate: false - xy: 493, 114 + xy: 513, 133 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 liquidrouter-bottom rotate: false - xy: 503, 143 + xy: 523, 143 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 liquidrouter-liquid rotate: false - xy: 503, 133 + xy: 513, 123 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 liquidrouter-top rotate: false - xy: 513, 143 + xy: 523, 133 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -188,77 +223,77 @@ multiplexer index: -1 overflowgate rotate: false - xy: 553, 143 + xy: 563, 133 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 poweredconveyor rotate: false - xy: 553, 133 + xy: 503, 113 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 poweredconveyormove rotate: false - xy: 563, 143 + xy: 513, 113 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 pulseconduit-bottom rotate: false - xy: 503, 113 + xy: 553, 113 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 pulseconduit-top rotate: false - xy: 513, 113 + xy: 563, 113 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 router rotate: false - xy: 573, 116 + xy: 596, 148 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 sortedunloader rotate: false - xy: 917, 405 + xy: 786, 385 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 sorter rotate: false - xy: 927, 405 + xy: 796, 395 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 splitter rotate: false - xy: 776, 385 + xy: 806, 395 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 steelconveyor rotate: false - xy: 786, 395 + xy: 806, 385 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 steelconveyormove rotate: false - xy: 786, 385 + xy: 816, 395 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -272,7 +307,7 @@ teleporter-top index: -1 unloader rotate: false - xy: 926, 395 + xy: 947, 407 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -286,7 +321,7 @@ vault index: -1 vault-icon rotate: false - xy: 926, 385 + xy: 957, 407 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -363,49 +398,49 @@ blackstoneedge index: -1 coal1 rotate: false - xy: 643, 198 + xy: 602, 178 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 coal2 rotate: false - xy: 592, 188 + xy: 612, 188 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 coal3 rotate: false - xy: 592, 178 + xy: 592, 158 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 deepwater rotate: false - xy: 632, 188 + xy: 622, 158 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 dirt1 rotate: false - xy: 612, 158 + xy: 632, 168 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 dirt2 rotate: false - xy: 622, 168 + xy: 642, 178 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 dirt3 rotate: false - xy: 632, 178 + xy: 632, 158 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -419,35 +454,35 @@ dirtedge index: -1 grass1 rotate: false - xy: 363, 113 + xy: 413, 113 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 grass2 rotate: false - xy: 373, 114 + xy: 346, 59 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 grass3 rotate: false - xy: 383, 114 + xy: 356, 59 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 grassblock1 rotate: false - xy: 393, 113 + xy: 677, 281 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 grassblock2 rotate: false - xy: 403, 113 + xy: 687, 281 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -461,21 +496,21 @@ grassedge index: -1 ice1 rotate: false - xy: 413, 113 + xy: 697, 281 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 ice2 rotate: false - xy: 346, 59 + xy: 756, 384 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 ice3 rotate: false - xy: 356, 59 + xy: 766, 384 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -489,70 +524,70 @@ iceedge index: -1 icerock1 rotate: false - xy: 677, 281 + xy: 653, 198 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 icerock2 rotate: false - xy: 687, 281 + xy: 652, 188 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 icerockshadow1 rotate: false - xy: 697, 281 + xy: 652, 178 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 rockshadow1 rotate: false - xy: 697, 281 + xy: 652, 178 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 icerockshadow2 rotate: false - xy: 756, 384 + xy: 652, 168 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 rockshadow2 rotate: false - xy: 756, 384 + xy: 652, 168 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 iron1 rotate: false - xy: 653, 198 + xy: 366, 59 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 iron2 rotate: false - xy: 652, 188 + xy: 423, 143 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 iron3 rotate: false - xy: 652, 178 + xy: 423, 133 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 lava rotate: false - xy: 473, 134 + xy: 483, 114 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -566,63 +601,63 @@ lavaedge index: -1 lead1 rotate: false - xy: 463, 114 + xy: 493, 114 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 lead2 rotate: false - xy: 473, 124 + xy: 503, 143 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 lead3 rotate: false - xy: 483, 134 + xy: 503, 133 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 metalfloor1 rotate: false - xy: 523, 143 + xy: 533, 133 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 metalfloor2 rotate: false - xy: 513, 123 + xy: 543, 143 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 metalfloor3 rotate: false - xy: 523, 133 + xy: 533, 123 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 metalfloor4 rotate: false - xy: 533, 143 + xy: 543, 133 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 metalfloor5 rotate: false - xy: 523, 123 + xy: 553, 143 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 metalfloor6 rotate: false - xy: 533, 133 + xy: 543, 123 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -636,14 +671,14 @@ metalflooredge index: -1 mossblock rotate: false - xy: 543, 143 + xy: 553, 133 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 oil rotate: false - xy: 533, 123 + xy: 563, 143 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -657,56 +692,56 @@ oiledge index: -1 rock1 rotate: false - xy: 573, 136 + xy: 583, 126 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 rock2 rotate: false - xy: 573, 126 + xy: 583, 116 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 sand1 rotate: false - xy: 583, 126 + xy: 626, 148 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 sand2 rotate: false - xy: 583, 116 + xy: 636, 148 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 sand3 rotate: false - xy: 596, 148 + xy: 646, 148 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 sandblock1 rotate: false - xy: 606, 148 + xy: 656, 148 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 sandblock2 rotate: false - xy: 616, 148 + xy: 777, 405 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 sandblock3 rotate: false - xy: 626, 148 + xy: 787, 405 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -720,56 +755,56 @@ sandedge index: -1 shrub rotate: false - xy: 807, 405 + xy: 857, 405 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 shrubshadow rotate: false - xy: 817, 405 + xy: 867, 405 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 snow1 rotate: false - xy: 847, 405 + xy: 897, 405 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 snow2 rotate: false - xy: 857, 405 + xy: 907, 405 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 snow3 rotate: false - xy: 867, 405 + xy: 917, 405 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 snowblock1 rotate: false - xy: 877, 405 + xy: 927, 405 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 snowblock2 rotate: false - xy: 887, 405 + xy: 776, 395 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 snowblock3 rotate: false - xy: 897, 405 + xy: 776, 385 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -783,7 +818,7 @@ snowedge index: -1 space rotate: false - xy: 776, 395 + xy: 796, 385 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -797,42 +832,42 @@ spaceedge index: -1 stone1 rotate: false - xy: 816, 395 + xy: 836, 385 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 stone2 rotate: false - xy: 816, 385 + xy: 846, 395 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 stone3 rotate: false - xy: 826, 395 + xy: 846, 385 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 stoneblock1 rotate: false - xy: 826, 385 + xy: 856, 395 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 stoneblock2 rotate: false - xy: 836, 395 + xy: 856, 385 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 stoneblock3 rotate: false - xy: 836, 385 + xy: 866, 395 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -846,49 +881,49 @@ stoneedge index: -1 thorium1 rotate: false - xy: 866, 395 + xy: 886, 385 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 thorium2 rotate: false - xy: 866, 385 + xy: 896, 395 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 thorium3 rotate: false - xy: 876, 395 + xy: 896, 385 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 titanium1 rotate: false - xy: 876, 385 + xy: 906, 395 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 titanium2 rotate: false - xy: 886, 395 + xy: 906, 385 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 titanium3 rotate: false - xy: 886, 385 + xy: 916, 395 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 water rotate: false - xy: 936, 385 + xy: 987, 407 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -916,14 +951,14 @@ pump-liquid index: -1 conduit-liquid rotate: false - xy: 592, 158 + xy: 612, 168 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 cross-1 rotate: false - xy: 622, 178 + xy: 642, 188 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -951,14 +986,14 @@ cross-4 index: -1 enemyspawn rotate: false - xy: 632, 158 + xy: 383, 114 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 playerspawn rotate: false - xy: 543, 123 + xy: 563, 123 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -993,14 +1028,14 @@ batterylarge index: -1 combustiongenerator rotate: false - xy: 602, 188 + xy: 602, 168 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 combustiongenerator-top rotate: false - xy: 592, 168 + xy: 612, 178 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1070,7 +1105,7 @@ largesolarpanel index: -1 liquidcombustiongenerator rotate: false - xy: 483, 114 + xy: 513, 143 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1098,14 +1133,14 @@ nuclearreactor-lights index: -1 powerinfinite rotate: false - xy: 553, 123 + xy: 523, 113 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 powernode rotate: false - xy: 563, 133 + xy: 533, 113 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1119,28 +1154,28 @@ powernodelarge index: -1 powervoid rotate: false - xy: 563, 123 + xy: 543, 113 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 rtgenerator rotate: false - xy: 586, 146 + xy: 606, 148 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 rtgenerator-top rotate: false - xy: 583, 136 + xy: 616, 148 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 shieldgenerator rotate: false - xy: 656, 148 + xy: 817, 405 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1154,7 +1189,7 @@ shieldprojector index: -1 solarpanel rotate: false - xy: 907, 405 + xy: 786, 395 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1175,7 +1210,7 @@ teleporter-top index: -1 thermalgenerator rotate: false - xy: 856, 385 + xy: 886, 395 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1287,63 +1322,63 @@ cultivator-top index: -1 extractor rotate: false - xy: 642, 168 + xy: 393, 113 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 fluxpump rotate: false - xy: 642, 158 + xy: 403, 113 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 incinerator rotate: false - xy: 766, 384 + xy: 652, 158 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 irondrill rotate: false - xy: 652, 168 + xy: 423, 123 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 irondrill-rotator rotate: false - xy: 652, 158 + xy: 423, 113 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 titaniumdrill-rotator rotate: false - xy: 652, 158 + xy: 423, 113 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 irondrill-top rotate: false - xy: 366, 59 + xy: 433, 144 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 itemsource rotate: false - xy: 473, 144 + xy: 453, 114 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 itemvoid rotate: false - xy: 453, 114 + xy: 463, 124 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1371,21 +1406,21 @@ laserdrill-top index: -1 lavasmelter rotate: false - xy: 483, 144 + xy: 493, 124 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 liquidsource rotate: false - xy: 503, 123 + xy: 533, 143 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 melter rotate: false - xy: 513, 133 + xy: 523, 123 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1448,7 +1483,7 @@ oilextractor-top index: -1 oilrefinery rotate: false - xy: 543, 133 + xy: 553, 123 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1532,63 +1567,63 @@ siliconsmelter-top index: -1 pulverizer rotate: false - xy: 523, 113 + xy: 576, 146 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 pulverizer-rotator rotate: false - xy: 533, 113 + xy: 573, 136 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 pump rotate: false - xy: 543, 113 + xy: 573, 126 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 reinforceddrill rotate: false - xy: 553, 113 + xy: 573, 116 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 reinforceddrill-rotator rotate: false - xy: 563, 113 + xy: 586, 146 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 reinforceddrill-top rotate: false - xy: 576, 146 + xy: 583, 136 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 separator rotate: false - xy: 636, 148 + xy: 797, 405 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 separator-liquid rotate: false - xy: 646, 148 + xy: 807, 405 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 siliconextractor rotate: false - xy: 827, 405 + xy: 877, 405 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1602,56 +1637,56 @@ siliconsmelter index: -1 smelter rotate: false - xy: 837, 405 + xy: 887, 405 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 steeldrill rotate: false - xy: 796, 395 + xy: 816, 385 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 steeldrill-rotator rotate: false - xy: 796, 385 + xy: 826, 395 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 steeldrill-top rotate: false - xy: 806, 395 + xy: 826, 385 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 stonedrill rotate: false - xy: 846, 395 + xy: 866, 385 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 stoneformer rotate: false - xy: 846, 385 + xy: 876, 395 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 titaniumdrill rotate: false - xy: 896, 395 + xy: 916, 385 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 titaniumdrill-top rotate: false - xy: 896, 385 + xy: 926, 395 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1728,7 +1763,7 @@ chainturret index: -1 doubleturret rotate: false - xy: 632, 168 + xy: 363, 113 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1924,14 +1959,14 @@ walkerfactory-top-open index: -1 compositewall rotate: false - xy: 602, 178 + xy: 622, 188 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 door rotate: false - xy: 642, 188 + xy: 642, 168 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1952,14 +1987,14 @@ door-large-open index: -1 door-open rotate: false - xy: 622, 158 + xy: 642, 158 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 duriumwall rotate: false - xy: 642, 178 + xy: 373, 114 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1973,14 +2008,14 @@ duriumwall-large index: -1 ironwall rotate: false - xy: 423, 143 + xy: 433, 134 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 steelwall rotate: false - xy: 806, 385 + xy: 836, 395 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1994,21 +2029,21 @@ steelwall-large index: -1 stonewall rotate: false - xy: 856, 395 + xy: 876, 385 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 titaniumshieldwall rotate: false - xy: 906, 395 + xy: 926, 385 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 titaniumwall rotate: false - xy: 906, 385 + xy: 937, 405 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -2092,91 +2127,91 @@ shell-back index: -1 shot rotate: false - xy: 797, 405 + xy: 847, 405 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-biomatter rotate: false - xy: 423, 133 + xy: 443, 144 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-coal rotate: false - xy: 423, 123 + xy: 433, 124 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-densealloy rotate: false - xy: 423, 113 + xy: 443, 134 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-iron rotate: false - xy: 433, 144 + xy: 453, 144 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-lead rotate: false - xy: 433, 134 + xy: 433, 114 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-plastic rotate: false - xy: 443, 144 + xy: 443, 124 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-sand rotate: false - xy: 433, 124 + xy: 453, 134 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-silicon rotate: false - xy: 443, 134 + xy: 463, 144 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-steel rotate: false - xy: 453, 144 + xy: 443, 114 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-stone rotate: false - xy: 433, 114 + xy: 453, 124 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-thorium rotate: false - xy: 443, 124 + xy: 463, 134 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-titanium rotate: false - xy: 453, 134 + xy: 473, 144 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -3232,56 +3267,56 @@ blaster-equip index: -1 clustergun rotate: false - xy: 623, 198 + xy: 602, 188 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 clustergun-equip rotate: false - xy: 633, 198 + xy: 592, 168 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 shockgun rotate: false - xy: 777, 405 + xy: 827, 405 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 shockgun-equip rotate: false - xy: 787, 405 + xy: 837, 405 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 triblaster rotate: false - xy: 916, 395 + xy: 936, 395 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 triblaster-equip rotate: false - xy: 916, 385 + xy: 936, 385 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 vulcan rotate: false - xy: 937, 405 + xy: 967, 407 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 vulcan-equip rotate: false - xy: 936, 395 + xy: 977, 407 size: 8, 8 orig: 8, 8 offset: 0, 0 diff --git a/core/assets/sprites/sprites.png b/core/assets/sprites/sprites.png index a5294f4d71..97736563ac 100644 Binary files a/core/assets/sprites/sprites.png and b/core/assets/sprites/sprites.png differ diff --git a/core/assets/version.properties b/core/assets/version.properties index 64e790cd00..28ce3f36d3 100644 --- a/core/assets/version.properties +++ b/core/assets/version.properties @@ -1,7 +1,7 @@ #Autogenerated file. Do not modify. -#Tue Apr 10 22:25:05 EDT 2018 +#Wed Apr 11 21:11:23 EDT 2018 version=release -androidBuildCode=897 +androidBuildCode=908 name=Mindustry code=3.5 build=custom build diff --git a/core/src/io/anuke/mindustry/content/Recipes.java b/core/src/io/anuke/mindustry/content/Recipes.java index 77c0be0b12..c2a73026ea 100644 --- a/core/src/io/anuke/mindustry/content/Recipes.java +++ b/core/src/io/anuke/mindustry/content/Recipes.java @@ -40,6 +40,7 @@ public class Recipes { new Recipe(distribution, StorageBlocks.unloader, stack(Items.steel, 5)), new Recipe(distribution, StorageBlocks.sortedunloader, stack(Items.steel, 5)), new Recipe(distribution, DistributionBlocks.bridgeconveyor, stack(Items.steel, 5)), + new Recipe(distribution, DistributionBlocks.laserconveyor, stack(Items.steel, 5)), new Recipe(weapon, WeaponBlocks.doubleturret, stack(Items.iron, 7)), new Recipe(weapon, WeaponBlocks.gatlingturret, stack(Items.iron, 8)), @@ -71,7 +72,6 @@ public class Recipes { new Recipe(crafting, CraftingBlocks.incinerator, stack(Items.steel, 60), stack(Items.iron, 60)), new Recipe(crafting, CraftingBlocks.weaponFactory, stack(Items.steel, 60), stack(Items.iron, 60)).setDesktop(), - //new Recipe(production, ProductionBlocks.stonedrill, stack(Item.stone, 12)), new Recipe(production, ProductionBlocks.ironDrill, stack(Items.iron, 25)), new Recipe(production, ProductionBlocks.reinforcedDrill, stack(Items.iron, 25)), new Recipe(production, ProductionBlocks.steelDrill, stack(Items.iron, 25)), @@ -79,11 +79,6 @@ public class Recipes { new Recipe(production, ProductionBlocks.laserdrill, stack(Items.titanium, 40), stack(Items.densealloy, 40)), new Recipe(production, ProductionBlocks.nucleardrill, stack(Items.titanium, 40), stack(Items.densealloy, 40)), new Recipe(production, ProductionBlocks.plasmadrill, stack(Items.titanium, 40), stack(Items.densealloy, 40)), - //new Recipe(production, ProductionBlocks.leaddrill, stack(Items.iron, 25)), - //new Recipe(production, ProductionBlocks.coaldrill, stack(Items.iron, 25), stack(Items.iron, 40)), - //new Recipe(production, ProductionBlocks.titaniumdrill, stack(Items.iron, 50), stack(Items.steel, 50)), - //new Recipe(production, ProductionBlocks.thoriumdrill, stack(Items.iron, 40), stack(Items.steel, 40)), - //new Recipe(production, ProductionBlocks.quartzextractor, stack(Items.titanium, 40), stack(Items.densealloy, 40)), new Recipe(production, ProductionBlocks.cultivator, stack(Items.titanium, 40), stack(Items.densealloy, 40)), new Recipe(production, ProductionBlocks.waterextractor, stack(Items.titanium, 40), stack(Items.densealloy, 40)), new Recipe(production, ProductionBlocks.oilextractor, stack(Items.titanium, 40), stack(Items.densealloy, 40)), diff --git a/core/src/io/anuke/mindustry/content/blocks/DistributionBlocks.java b/core/src/io/anuke/mindustry/content/blocks/DistributionBlocks.java index fc4a28d5ca..f17074fc84 100644 --- a/core/src/io/anuke/mindustry/content/blocks/DistributionBlocks.java +++ b/core/src/io/anuke/mindustry/content/blocks/DistributionBlocks.java @@ -34,8 +34,9 @@ public class DistributionBlocks{ capacity = 32; }}, - bridgeconveyor = new ItemBridge("bridgeconveyor"){{ - range = 2; + bridgeconveyor = new BufferedItemBridge("bridgeconveyor"){{ + range = 3; + hasPower = false; }}, laserconveyor = new ItemBridge("laserconveyor"){{ diff --git a/core/src/io/anuke/mindustry/content/blocks/LiquidBlocks.java b/core/src/io/anuke/mindustry/content/blocks/LiquidBlocks.java index 10c2354b1e..f6e9acfc17 100644 --- a/core/src/io/anuke/mindustry/content/blocks/LiquidBlocks.java +++ b/core/src/io/anuke/mindustry/content/blocks/LiquidBlocks.java @@ -37,7 +37,7 @@ public class LiquidBlocks { liquidjunction = new LiquidJunction("liquidjunction"), bridgeconduit = new LiquidBridge("bridgeconduit"){{ - range = 7; + range = 3; }}, laserconduit = new LiquidBridge("laserconduit"){{ diff --git a/core/src/io/anuke/mindustry/world/Block.java b/core/src/io/anuke/mindustry/world/Block.java index 9dd930c7d4..04d02e146f 100644 --- a/core/src/io/anuke/mindustry/world/Block.java +++ b/core/src/io/anuke/mindustry/world/Block.java @@ -5,12 +5,12 @@ import com.badlogic.gdx.math.Vector2; import com.badlogic.gdx.utils.Array; import com.badlogic.gdx.utils.ObjectMap; import com.badlogic.gdx.utils.reflect.ClassReflection; +import io.anuke.mindustry.content.fx.ExplosionFx; import io.anuke.mindustry.core.GameState.State; import io.anuke.mindustry.entities.TileEntity; import io.anuke.mindustry.entities.Unit; import io.anuke.mindustry.graphics.DrawLayer; import io.anuke.mindustry.graphics.Layer; -import io.anuke.mindustry.content.fx.ExplosionFx; import io.anuke.mindustry.net.Net; import io.anuke.mindustry.net.NetEvents; import io.anuke.mindustry.resource.ItemStack; diff --git a/core/src/io/anuke/mindustry/world/ItemBuffer.java b/core/src/io/anuke/mindustry/world/ItemBuffer.java new file mode 100644 index 0000000000..5f23f4714e --- /dev/null +++ b/core/src/io/anuke/mindustry/world/ItemBuffer.java @@ -0,0 +1,44 @@ +package io.anuke.mindustry.world; + +import com.badlogic.gdx.utils.NumberUtils; +import io.anuke.mindustry.resource.Item; +import io.anuke.ucore.core.Timers; +import io.anuke.ucore.util.Bits; + +public class ItemBuffer { + private final float speed; + + private long[] buffer; + private int index; + + public ItemBuffer(int capacity, float speed){ + this.buffer = new long[capacity]; + this.speed = speed; + } + + public boolean accepts(){ + return index < buffer.length; + } + + public void accept(Item item){ + //if(!accepts()) return; + buffer[index ++] = Bits.packLong(NumberUtils.floatToIntBits(Timers.time()), item.id); + } + + public Item poll(){ + if(index > 0){ + long l = buffer[0]; + float time = NumberUtils.intBitsToFloat(Bits.getLeftInt(l)); + + if(Timers.time() >= time + speed || Timers.time() < time){ + return Item.getByID(Bits.getRightInt(l)); + } + } + return null; + } + + public void remove(){ + System.arraycopy(buffer, 1, buffer, 0, index - 1); + index --; + } +} diff --git a/core/src/io/anuke/mindustry/world/blocks/types/distribution/BufferedItemBridge.java b/core/src/io/anuke/mindustry/world/blocks/types/distribution/BufferedItemBridge.java new file mode 100644 index 0000000000..f8cef21570 --- /dev/null +++ b/core/src/io/anuke/mindustry/world/blocks/types/distribution/BufferedItemBridge.java @@ -0,0 +1,108 @@ +package io.anuke.mindustry.world.blocks.types.distribution; + +import io.anuke.mindustry.entities.TileEntity; +import io.anuke.mindustry.resource.Item; +import io.anuke.mindustry.world.ItemBuffer; +import io.anuke.mindustry.world.Tile; +import io.anuke.ucore.graphics.CapStyle; +import io.anuke.ucore.graphics.Draw; +import io.anuke.ucore.graphics.Lines; +import io.anuke.ucore.util.Geometry; +import io.anuke.ucore.util.Mathf; + +import java.io.DataInputStream; +import java.io.DataOutputStream; +import java.io.IOException; + +import static io.anuke.mindustry.Vars.tilesize; +import static io.anuke.mindustry.Vars.world; + +public class BufferedItemBridge extends ItemBridge { + protected int timerAccept = timers ++; + + protected float speed = 40f; + protected int bufferCapacity = 50; + + public BufferedItemBridge(String name) { + super(name); + hasPower = false; + } + + @Override + public void updateTransport(Tile tile, Tile other){ + BufferedItemBridgeEntity entity = tile.entity(); + + if(entity.buffer.accepts() && entity.inventory.totalItems() > 0){ + entity.buffer.accept(entity.inventory.takeItem()); + } + + Item item = entity.buffer.poll(); + if(entity.timer.get(timerAccept, 4) && item != null && other.block().acceptItem(item, other, tile)){ + entity.cycleSpeed = Mathf.lerpDelta(entity.cycleSpeed, 4f, 0.05f); + other.block().handleItem(item, other, tile); + entity.buffer.remove(); + }else{ + entity.cycleSpeed = Mathf.lerpDelta(entity.cycleSpeed, 0f, 0.008f); + } + } + + @Override + public void drawLayer(Tile tile) { + BufferedItemBridgeEntity entity = tile.entity(); + + Tile other = world.tile(entity.link); + if(!linkValid(tile, other)) return; + + int i = tile.absoluteRelativeTo(other.x, other.y); + + float ex = other.worldx() - tile.worldx(), + ey = other.worldy() - tile.worldy(); + + ex *= entity.uptime; + ey *= entity.uptime; + + Lines.stroke(8f); + Lines.line(Draw.region(name + "-bridge"), + tile.worldx(), + tile.worldy(), + tile.worldx() + ex, + tile.worldy() + ey, CapStyle.none, -tilesize/2f); + + Draw.rect(name + "-end", tile.drawx(), tile.drawy(), i*90 + 90); + Draw.rect(name + "-end", tile.worldx() + ex, tile.worldy() + ey, i*90 + 270); + + int dist = Math.max(Math.abs(other.x - tile.x), Math.abs(other.y - tile.y)); + + int arrows = (dist)*tilesize/6-1; + + Draw.color(); + + for(int a = 0; a < arrows; a ++){ + Draw.alpha(Mathf.absin(a/(float)arrows - entity.time/100f, 0.1f, 1f) * entity.uptime); + Draw.rect(name + "-arrow", + tile.worldx() + Geometry.d4[i].x*(tilesize/2f + a*6f + 2) * entity.uptime, + tile.worldy() + Geometry.d4[i].y*(tilesize/2f + a*6f + 2) * entity.uptime, + i*90f); + } + Draw.reset(); + } + + @Override + public TileEntity getEntity() { + return new BufferedItemBridgeEntity(); + } + + class BufferedItemBridgeEntity extends ItemBridgeEntity{ + ItemBuffer buffer = new ItemBuffer(bufferCapacity, speed); + + @Override + public void write(DataOutputStream stream) throws IOException { + super.write(stream); + } + + @Override + public void read(DataInputStream stream) throws IOException { + super.read(stream); + } + } +} diff --git a/core/src/io/anuke/mindustry/world/blocks/types/distribution/Conveyor.java b/core/src/io/anuke/mindustry/world/blocks/types/distribution/Conveyor.java index 6f585e291b..8035d7b96e 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/distribution/Conveyor.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/distribution/Conveyor.java @@ -28,9 +28,10 @@ public class Conveyor extends Block{ private static ItemPos pos2 = new ItemPos(); private static final float itemSpace = 0.135f * 2.2f; private static final float offsetScl = 128f*3f; - private static final float itemSize = 5f; private static final float minmove = 1f / (Short.MAX_VALUE - 2); + public static final float itemSize = 5f; + private final Translator tr1 = new Translator(); private final Translator tr2 = new Translator(); diff --git a/core/src/io/anuke/mindustry/world/blocks/types/distribution/ItemBridge.java b/core/src/io/anuke/mindustry/world/blocks/types/distribution/ItemBridge.java index 35a3754ccd..dd05265571 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/distribution/ItemBridge.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/distribution/ItemBridge.java @@ -1,6 +1,9 @@ package io.anuke.mindustry.world.blocks.types.distribution; import com.badlogic.gdx.graphics.Color; +import com.badlogic.gdx.utils.IntArray; +import com.badlogic.gdx.utils.IntSet; +import com.badlogic.gdx.utils.IntSet.IntSetIterator; import io.anuke.mindustry.entities.TileEntity; import io.anuke.mindustry.graphics.Layer; import io.anuke.mindustry.resource.Item; @@ -27,6 +30,7 @@ public class ItemBridge extends Block { protected int range; protected float powerUse = 0.05f; protected float transportTime = 2f; + protected IntArray removals = new IntArray(); public ItemBridge(String name) { super(name); @@ -40,9 +44,12 @@ public class ItemBridge extends Block { @Override public void placed(Tile tile) { - if(linkValid(tile, world.tile(lastPlaced))){ - ItemBridgeEntity entity = tile.entity(); - entity.link = lastPlaced; + Tile last = world.tile(lastPlaced); + if(linkValid(tile, last)){ + ItemBridgeEntity entity = last.entity(); + if(!linkValid(last, world.tile(entity.link))){ + link(last, tile); + } } lastPlaced = tile.packedPosition(); } @@ -99,9 +106,9 @@ public class ItemBridge extends Block { if(linkValid(tile, other)){ if(entity.link == other.packedPosition()){ - entity.link = -1; + unlink(tile, other); }else{ - entity.link = other.packedPosition(); + link(tile, other); } return false; } @@ -115,9 +122,25 @@ public class ItemBridge extends Block { entity.time += entity.cycleSpeed*Timers.delta(); entity.time2 += (entity.cycleSpeed-1f)*Timers.delta(); + removals.clear(); + + IntSetIterator it = entity.incoming.iterator(); + + while(it.hasNext){ + int i = it.next(); + Tile other = world.tile(i); + if(!linkValid(tile, other, false)){ + removals.add(i); + } + } + + for(int j = 0; j < removals.size; j ++) + entity.incoming.remove(removals.get(j)); + Tile other = world.tile(entity.link); if(!linkValid(tile, other)){ tryDump(tile); + entity.uptime = 0f; }else{ float use = Math.min(powerCapacity, powerUse * Timers.delta()); @@ -128,15 +151,21 @@ public class ItemBridge extends Block { entity.uptime = Mathf.lerpDelta(entity.uptime, 0f, 0.02f); } - if(entity.uptime >= 0.5f && entity.timer.get(timerTransport, transportTime)){ - Item item = entity.inventory.takeItem(); - if(item != null && other.block().acceptItem(item, other, tile)){ - other.block().handleItem(item, other, tile); - entity.cycleSpeed = Mathf.lerpDelta(entity.cycleSpeed, 4f, 0.05f); - }else{ - entity.cycleSpeed = Mathf.lerpDelta(entity.cycleSpeed, 1f, 0.01f); - if(item != null) entity.inventory.addItem(item, 1); - } + updateTransport(tile, other); + } + } + + public void updateTransport(Tile tile, Tile other){ + ItemBridgeEntity entity = tile.entity(); + + if(entity.uptime >= 0.5f && entity.timer.get(timerTransport, transportTime)){ + Item item = entity.inventory.takeItem(); + if(item != null && other.block().acceptItem(item, other, tile)){ + other.block().handleItem(item, other, tile); + entity.cycleSpeed = Mathf.lerpDelta(entity.cycleSpeed, 4f, 0.05f); + }else{ + entity.cycleSpeed = Mathf.lerpDelta(entity.cycleSpeed, 1f, 0.01f); + if(item != null) entity.inventory.addItem(item, 1); } } } @@ -185,26 +214,74 @@ public class ItemBridge extends Block { return tile.entity.inventory.totalItems() < itemCapacity; } + @Override + public boolean canDump(Tile tile, Tile to, Item item) { + ItemBridgeEntity entity = tile.entity(); + + Tile other = world.tile(entity.link); + if(!linkValid(tile, other)){ + int i = tile.absoluteRelativeTo(to.x, to.y); + + IntSetIterator it = entity.incoming.iterator(); + + while(it.hasNext){ + int v = it.next(); + int x = v % world.width(); + int y = v / world.width(); + if(tile.absoluteRelativeTo(x, y) == i){ + return false; + } + } + return true; + } + + int rel = tile.absoluteRelativeTo(other.x, other.y); + int rel2 = tile.relativeTo(to.x, to.y); + + return rel != rel2; + } + @Override public TileEntity getEntity() { return new ItemBridgeEntity(); } + public void link(Tile tile, Tile other){ + ItemBridgeEntity entity = tile.entity(); + ItemBridgeEntity oe = other.entity(); + entity.link = other.packedPosition(); + oe.incoming.add(tile.packedPosition()); + } + + public void unlink(Tile tile, Tile other){ + ItemBridgeEntity entity = tile.entity(); + entity.link = -1; + if(other != null) { + ItemBridgeEntity oe = other.entity(); + oe.incoming.remove(tile.packedPosition()); + } + } + public boolean linkValid(Tile tile, Tile other){ + return linkValid(tile, other, true); + } + + public boolean linkValid(Tile tile, Tile other, boolean checkDouble){ if(other == null) return false; if(tile.x == other.x){ - if(Math.abs(tile.x - other.x) > range) return false; - }else if(tile.y == other.y){ if(Math.abs(tile.y - other.y) > range) return false; + }else if(tile.y == other.y){ + if(Math.abs(tile.x - other.x) > range) return false; }else{ return false; } - return other.block() == this && other.entity().link != tile.packedPosition(); + return other.block() == this && (!checkDouble || other.entity().link != tile.packedPosition()); } public static class ItemBridgeEntity extends TileEntity{ public int link = -1; + public IntSet incoming = new IntSet(); public float uptime; public float time; public float time2; @@ -213,11 +290,24 @@ public class ItemBridge extends Block { @Override public void write(DataOutputStream stream) throws IOException { stream.writeInt(link); + stream.writeFloat(uptime); + stream.writeByte(incoming.size); + + IntSetIterator it = incoming.iterator(); + + while(it.hasNext){ + stream.writeInt(it.next()); + } } @Override public void read(DataInputStream stream) throws IOException { link = stream.readInt(); + uptime = stream.readFloat(); + byte links = stream.readByte(); + for(int i = 0; i < links; i ++){ + incoming.add(stream.readInt()); + } } } } diff --git a/core/src/io/anuke/mindustry/world/blocks/types/distribution/TunnelConveyor.java b/core/src/io/anuke/mindustry/world/blocks/types/distribution/TunnelConveyor.java index e75fcaa616..c52a1a52b4 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/distribution/TunnelConveyor.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/distribution/TunnelConveyor.java @@ -1,6 +1,5 @@ package io.anuke.mindustry.world.blocks.types.distribution; -import com.badlogic.gdx.graphics.Color; import com.badlogic.gdx.utils.Array; import com.badlogic.gdx.utils.NumberUtils; import io.anuke.mindustry.entities.TileEntity; @@ -61,11 +60,10 @@ public class TunnelConveyor extends Block{ } @Override - public boolean acceptItem(Item item, Tile tile, Tile source){ + public boolean acceptItem(Item item, Tile tile, Tile source) { TunnelEntity entity = tile.entity(); int rot = source.relativeTo(tile.x, tile.y); - if(rot != (tile.getRotation() + 2)%4) return false; - return entity.index < entity.buffer.length - 1; + return rot == (tile.getRotation() + 2) % 4 && entity.index < entity.buffer.length - 1; } @Override