Mirror von
https://github.com/GeyserMC/Geyser.git
synchronisiert 2024-11-03 14:50:19 +01:00
Use mappings to generate bed colors
Dieser Commit ist enthalten in:
Ursprung
e5766ef96a
Commit
7a402c40b3
@ -105,46 +105,11 @@ public class BlockTranslator {
|
|||||||
|
|
||||||
// If the Java ID is bed, signal that it needs a tag to show color
|
// If the Java ID is bed, signal that it needs a tag to show color
|
||||||
// The color is in the namespace ID in Java Edition but it's a tag in Bedrock.
|
// The color is in the namespace ID in Java Edition but it's a tag in Bedrock.
|
||||||
byte bedcolor = -1;
|
JsonNode bedColor = entry.getValue().get("bed_color");
|
||||||
if (javaId.contains("_bed[")) {
|
if (bedColor != null) {
|
||||||
if (javaId.contains("minecraft:white")) {
|
System.out.println(bedColor.intValue());
|
||||||
bedcolor = 0;
|
// Converting to byte because the final tag value is a byte. bedColor.binaryValue() returns an array
|
||||||
} else if (javaId.contains("minecraft:orange")) {
|
BEDCOLORS.put(javaBlockState, (byte) bedColor.intValue());
|
||||||
bedcolor = 1;
|
|
||||||
} else if (javaId.contains("minecraft:magenta")) {
|
|
||||||
bedcolor = 2;
|
|
||||||
} else if (javaId.contains("minecraft:light_blue")) {
|
|
||||||
bedcolor = 3;
|
|
||||||
} else if (javaId.contains("minecraft:yellow")) {
|
|
||||||
bedcolor = 4;
|
|
||||||
} else if (javaId.contains("minecraft:lime")) {
|
|
||||||
bedcolor = 5;
|
|
||||||
} else if (javaId.contains("minecraft:pink")) {
|
|
||||||
bedcolor = 6;
|
|
||||||
} else if (javaId.contains("minecraft:gray")) {
|
|
||||||
bedcolor = 7;
|
|
||||||
} else if (javaId.contains("minecraft:light_gray")) {
|
|
||||||
bedcolor = 8;
|
|
||||||
} else if (javaId.contains("minecraft:cyan")) {
|
|
||||||
bedcolor = 9;
|
|
||||||
} else if (javaId.contains("minecraft:purple")) {
|
|
||||||
bedcolor = 10;
|
|
||||||
} else if (javaId.contains("minecraft:blue")) {
|
|
||||||
bedcolor = 11;
|
|
||||||
} else if (javaId.contains("minecraft:brown")) {
|
|
||||||
bedcolor = 12;
|
|
||||||
} else if (javaId.contains("minecraft:green")) {
|
|
||||||
bedcolor = 13;
|
|
||||||
} else if (javaId.contains("minecraft:red")) {
|
|
||||||
bedcolor = 14;
|
|
||||||
} else if (javaId.contains("minecraft:black")) {
|
|
||||||
bedcolor = 15;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
// -1 is used throughout the code to indicate no bed color.
|
|
||||||
if (bedcolor > -1) {
|
|
||||||
BEDCOLORS.put(javaBlockState, bedcolor);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ("minecraft:water[level=0]".equals(javaId)) {
|
if ("minecraft:water[level=0]".equals(javaId)) {
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren