Skip to content

Commit df3b1f0

Browse files
committed
Test Power blocks colors
1 parent a2992f0 commit df3b1f0

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

src/main/java/ml/sakii/factoryisland/blocks/TestPowerConsumerBlock.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,17 @@ public class TestPowerConsumerBlock extends SimpleMachine{
1414

1515
PowerConsumerComponent pcc;
1616

17+
private static Color4 disabled = new Color4(50,50,100);
18+
1719
public TestPowerConsumerBlock(int x, int y, int z, GameEngine engine) {
18-
super("TestPowerConsumer", x, y, z, AssetLibrary.stone.copy(), new Surface(new Color4(0,0,0,255)), AssetLibrary.fire.c, new Color4(Color.GRAY), engine);
20+
super("TestPowerConsumer", x, y, z, new Surface(disabled), new Surface(new Color4(0,0,0,255)), AssetLibrary.fire.c, new Color4(Color.GRAY), engine);
1921
pcc = new PowerConsumerComponent(this);
2022
addComponent(pcc);
2123
}
2224

2325
@Override
2426
public Surface[] getSurfaces() {
25-
return Block.generateSurfacesCopy(new Surface(AssetLibrary.stone.Texture,Color.black));
27+
return Block.generateSurfacesCopy(new Surface(disabled,Color.black));
2628
}
2729

2830
@Override

src/main/java/ml/sakii/factoryisland/blocks/TestPowerWireBlock.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package ml.sakii.factoryisland.blocks;
22

3-
import java.awt.Color;
43
import ml.sakii.factoryisland.Color4;
54
import ml.sakii.factoryisland.GameEngine;
65
import ml.sakii.factoryisland.Object3D;
@@ -12,6 +11,9 @@ public class TestPowerWireBlock extends Block implements MetadataListener {
1211

1312
PowerPropagatorComponent ppc;
1413

14+
private static Color4 enabled = new Color4(220,150,40);
15+
private static Color4 disabled = new Color4(150,90,15);
16+
1517
public TestPowerWireBlock(int x, int y, int z, GameEngine engine) {
1618
super("TestPowerWire",x, y, z, engine);
1719
ppc = new PowerPropagatorComponent(this);
@@ -21,7 +23,7 @@ public TestPowerWireBlock(int x, int y, int z, GameEngine engine) {
2123

2224
@Override
2325
public Surface[] getSurfaces() {
24-
return Block.generateSurfaces(new Color4(Color.orange));
26+
return Block.generateSurfaces(disabled);
2527
}
2628

2729
@Override
@@ -30,9 +32,9 @@ public boolean onMetadataUpdate(String key, String value) {
3032
for(Object3D obj : Objects) {
3133
if(obj instanceof Polygon3D poly) {
3234
if(value.equals("1")) {
33-
poly.s.c.set(Color.orange);
35+
poly.s.c.set(enabled);
3436
}else {
35-
poly.s.c.set(Color.gray);
37+
poly.s.c.set(disabled);
3638
}
3739
poly.recalcLightedColor();
3840
}

0 commit comments

Comments
 (0)