Put everything into bedrock mapping

This commit is contained in:
OnlyBMan 2020-04-14 19:34:11 -04:00
parent 3972cc7f87
commit 87e372ce21

View file

@ -149,168 +149,15 @@ public class BlockTranslator {
JAVA_ID_TO_BLOCK_ENTITY_MAP.put(javaBlockState, javaId);
}
int lastIndex = javaId.length() -1;
byte rotation = 0;
if (javaId.contains("skeleton_skull[")) {
if (javaId.indexOf("=") == lastIndex - 2) {
rotation = Byte.parseByte(javaId.substring(lastIndex -1, lastIndex));
}
else {
rotation = Byte.parseByte(javaId.substring(lastIndex -2, lastIndex));
}
SKULL_VARIANTS.put(javaBlockState, (byte) 0);
SKULL_ROTATIONS.put(javaBlockState, rotation);
}
else if (javaId.contains("skeleton_wall")) {
if (javaId.contains("north")) {
rotation = 0;
}
else if (javaId.contains("east")) {
rotation = 4;
}
else if (javaId.contains("south")) {
rotation = 8;
}
else if(javaId.contains("west")) {
rotation = 12;
}
SKULL_VARIANTS.put(javaBlockState, (byte) 0);
SKULL_ROTATIONS.put(javaBlockState, rotation);
JsonNode skullVariation = entry.getValue().get("variation");
if(skullVariation != null) {
SKULL_VARIANTS.put(javaBlockState, (byte) skullVariation.intValue());
}
if (javaId.contains("wither_skeleton_skull[")) {
if (javaId.indexOf("=") == lastIndex - 2) {
rotation = Byte.parseByte(javaId.substring(lastIndex -1, lastIndex));
}
else {
rotation = Byte.parseByte(javaId.substring(lastIndex -2, lastIndex));
}
SKULL_VARIANTS.put(javaBlockState, (byte) 1);
SKULL_ROTATIONS.put(javaBlockState, rotation);
}
else if (javaId.contains("wither_skeleton_wall")) {
if (javaId.contains("north")) {
rotation = 0;
}
else if (javaId.contains("east")) {
rotation = 4;
}
else if (javaId.contains("south")) {
rotation = 8;
}
else if(javaId.contains("west")) {
rotation = 12;
}
SKULL_VARIANTS.put(javaBlockState, (byte) 1);
SKULL_ROTATIONS.put(javaBlockState, rotation);
}
if (javaId.contains("zombie_head[")) {
if (javaId.indexOf("=") == lastIndex - 2) {
rotation = Byte.parseByte(javaId.substring(lastIndex -1, lastIndex));
}
else {
rotation = Byte.parseByte(javaId.substring(lastIndex -2, lastIndex));
}
SKULL_VARIANTS.put(javaBlockState, (byte) 2);
SKULL_ROTATIONS.put(javaBlockState, rotation);
}
else if (javaId.contains("zombie_wall")) {
if (javaId.contains("north")) {
rotation = 0;
}
else if (javaId.contains("east")) {
rotation = 4;
}
else if (javaId.contains("south")) {
rotation = 8;
}
else if(javaId.contains("west")) {
rotation = 12;
}
SKULL_VARIANTS.put(javaBlockState, (byte) 2);
SKULL_ROTATIONS.put(javaBlockState, rotation);
}
if (javaId.contains("player_head[")) {
if (javaId.indexOf("=") == lastIndex - 2) {
rotation = Byte.parseByte(javaId.substring(lastIndex -1, lastIndex));
}
else {
rotation = Byte.parseByte(javaId.substring(lastIndex -2, lastIndex));
}
SKULL_VARIANTS.put(javaBlockState, (byte) 3);
SKULL_ROTATIONS.put(javaBlockState, rotation);
}
else if (javaId.contains("player_wall")) {
if (javaId.contains("north")) {
rotation = 0;
}
else if (javaId.contains("east")) {
rotation = 4;
}
else if (javaId.contains("south")) {
rotation = 8;
}
else if(javaId.contains("west")) {
rotation = 12;
}
SKULL_VARIANTS.put(javaBlockState, (byte) 3);
SKULL_ROTATIONS.put(javaBlockState, rotation);
}
if (javaId.contains("creeper_head[")) {
if (javaId.indexOf("=") == lastIndex - 2) {
rotation = Byte.parseByte(javaId.substring(lastIndex -1, lastIndex));
}
else {
rotation = Byte.parseByte(javaId.substring(lastIndex -2, lastIndex));
}
SKULL_VARIANTS.put(javaBlockState, (byte) 4);
SKULL_ROTATIONS.put(javaBlockState, rotation);
}
else if (javaId.contains("creeper_wall")) {
if (javaId.contains("north")) {
rotation = 0;
}
else if (javaId.contains("east")) {
rotation = 4;
}
else if (javaId.contains("south")) {
rotation = 8;
}
else if(javaId.contains("west")) {
rotation = 12;
}
SKULL_VARIANTS.put(javaBlockState, (byte) 4);
SKULL_ROTATIONS.put(javaBlockState, rotation);
}
if (javaId.contains("dragon_head[")) {
if (javaId.indexOf("=") == lastIndex - 2) {
rotation = Byte.parseByte(javaId.substring(lastIndex -1, lastIndex));
}
else {
rotation = Byte.parseByte(javaId.substring(lastIndex -2, lastIndex));
}
SKULL_VARIANTS.put(javaBlockState, (byte) 5);
SKULL_ROTATIONS.put(javaBlockState, rotation);
}
else if (javaId.contains("dragon_wall")) {
if (javaId.contains("north")) {
rotation = 0;
}
else if (javaId.contains("east")) {
rotation = 4;
}
else if (javaId.contains("south")) {
rotation = 8;
}
else if(javaId.contains("west")) {
rotation = 12;
}
SKULL_VARIANTS.put(javaBlockState, (byte) 5);
SKULL_ROTATIONS.put(javaBlockState, rotation);
JsonNode skullRotation = entry.getValue().get("skull_rotation");
if (skullRotation != null) {
SKULL_ROTATIONS.put(javaBlockState, (byte) skullRotation.intValue());
}
// If the Java ID is bed, signal that it needs a tag to show color