Skip to content

Commit

Permalink
made the cable insulation texture grayscale
Browse files Browse the repository at this point in the history
  • Loading branch information
Trinsdar committed Dec 31, 2024
1 parent ffd5119 commit 1b2cc9a
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions common/src/main/java/muramasa/antimatter/pipe/BlockCable.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@

public class BlockCable<T extends Cable<T>> extends BlockPipe<T> {

public static final int INSULATION_COLOR = 0x404040;
public final boolean insulated;

public BlockCable(T type, PipeSize size, boolean insulated) {
Expand All @@ -40,12 +41,12 @@ public BlockCable(T type, PipeSize size, boolean insulated) {
String prefix = insulated ? "cable" : "wire";
this.side = new Texture(Ref.ID, "block/pipe/" + prefix + "_side");
this.faces = new Texture[]{
new Texture(Ref.ID, "block/pipe/" + prefix + "_vtiny"),
new Texture(Ref.ID, "block/pipe/" + prefix + "_tiny"),
new Texture(Ref.ID, "block/pipe/" + prefix + "_small"),
new Texture(Ref.ID, "block/pipe/" + prefix + "_normal"),
new Texture(Ref.ID, "block/pipe/" + prefix + "_large"),
new Texture(Ref.ID, "block/pipe/" + prefix + "_huge")
new Texture(Ref.ID, "block/pipe/" + "wire_vtiny"),
new Texture(Ref.ID, "block/pipe/" + "wire_tiny"),
new Texture(Ref.ID, "block/pipe/" + "wire_small"),
new Texture(Ref.ID, "block/pipe/" + "wire_normal"),
new Texture(Ref.ID, "block/pipe/" + "wire_large"),
new Texture(Ref.ID, "block/pipe/" + "wire_huge")
};
}

Expand All @@ -71,7 +72,7 @@ public int getBlockColor(BlockState state, @Nullable BlockGetter world, @Nullabl
if (!(state.getBlock() instanceof BlockCable) && world == null || pos == null) return -1;
BlockEntityPipe<?> pipe = getTilePipe(world, pos);
if (insulated && pipe != null && pipe.getPipeColor() != -1 && i == 0) return pipe.getPipeColor();
if (insulated) return i == 1 ? getRGB() : -1;
if (insulated) return i == 1 ? getRGB() : i == 0 ? INSULATION_COLOR : -1;
return i == 0 || i == 1 ? getRGB() : -1;
}

Expand All @@ -80,7 +81,7 @@ public int getItemColor(ItemStack stack, @Nullable Block block, int i) {
if (insulated && stack.getTag() != null && stack.getTag().contains(Ref.KEY_PIPE_TILE_COLOR) && i == 0){
return stack.getTag().getInt(Ref.KEY_PIPE_TILE_COLOR);
}
return insulated ? i == 1 ? getRGB() : -1 : getRGB();
return insulated ? i == 1 ? getRGB() : i == 0 ? INSULATION_COLOR : -1 : getRGB();
}

@Override
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 1b2cc9a

Please sign in to comment.