Skip to content

Commit

Permalink
fix: painted slabs use the wrong tint
Browse files Browse the repository at this point in the history
  • Loading branch information
ferriarnus committed Dec 30, 2024
1 parent 78e6272 commit cb5d016
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public int getColor(BlockState state, @Nullable BlockAndTintGetter level, @Nulla
if (entity instanceof PaintedBlockEntity paintedBlockEntity) {

Optional<Block> paint = paintedBlockEntity.getPrimaryPaint();
if (state.getBlock() instanceof PaintedSlabBlock && tintIndex < 0) {
if (state.getBlock() instanceof PaintedSlabBlock && tintIndex >= 0) {
paint = paintedBlockEntity.getSecondaryPaint();
}

Expand Down Expand Up @@ -61,11 +61,12 @@ public int getColor(ItemStack itemStack, int tintIndex) {
public static int moveTintIndex(int original) {
return -original - 2;
}

public static int unmoveTintIndex(int original) {
if (original > 0) {
return original;
} else {
return -original + 2;
return -original - 2;
}
}
}

0 comments on commit cb5d016

Please sign in to comment.