Skip to content

Implement translucency for drawing the bingo card#85

Merged
Extremelyd1 merged 1 commit intoExtremelyd1:masterfrom
nolmoonen:translucent
Apr 10, 2025
Merged

Implement translucency for drawing the bingo card#85
Extremelyd1 merged 1 commit intoExtremelyd1:masterfrom
nolmoonen:translucent

Conversation

@nolmoonen
Copy link
Copy Markdown
Contributor

Implements the drawing of translucent items on the bingo card, see https://minecraft.wiki/w/Translucency. It's not a perfect solution (honey and slime still look a bit weird), but the stained glass becomes much more readable.

Before

old

After

new

Check the difference using

diff --git a/src/main/java/com/extremelyd1/bingo/BingoCard.java b/src/main/java/com/extremelyd1/bingo/BingoCard.java
index c51f624..3c2f110 100644
--- a/src/main/java/com/extremelyd1/bingo/BingoCard.java
+++ b/src/main/java/com/extremelyd1/bingo/BingoCard.java
@@ -61,6 +61,34 @@ public class BingoCard {
             }
         }
 
+        Material[] mats = {
+                Material.ICE,
+                // Material.FROSTED_ICE,
+                Material.SLIME_BLOCK,
+                Material.HONEY_BLOCK,
+                Material.TINTED_GLASS,
+                Material.WHITE_STAINED_GLASS,
+                Material.ORANGE_STAINED_GLASS,
+                Material.MAGENTA_STAINED_GLASS,
+                Material.LIGHT_BLUE_STAINED_GLASS,
+                Material.YELLOW_STAINED_GLASS,
+                Material.LIME_STAINED_GLASS,
+                Material.PINK_STAINED_GLASS,
+                Material.GRAY_STAINED_GLASS,
+                Material.LIGHT_GRAY_STAINED_GLASS,
+                Material.CYAN_STAINED_GLASS,
+                Material.PURPLE_STAINED_GLASS,
+                Material.BLUE_STAINED_GLASS,
+                Material.BROWN_STAINED_GLASS,
+                Material.GREEN_STAINED_GLASS,
+                Material.RED_STAINED_GLASS,
+                Material.BLACK_STAINED_GLASS
+        };
+
+        for (int i = 0; i < mats.length; i++) {
+            this.bingoItems[(i / BOARD_SIZE) % BOARD_SIZE][i % BOARD_SIZE] = new BingoItem(mats[i]);
+        }
+
         bingoCardInventory = new BingoCardInventory(bingoItems);
     }
 

Copy link
Copy Markdown
Owner

@Extremelyd1 Extremelyd1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR, this looks much better!

@Extremelyd1 Extremelyd1 merged commit b748682 into Extremelyd1:master Apr 10, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants