Implement more block mappings

This commit is contained in:
RednedEpic 2019-09-13 18:49:46 -05:00 committed by RednedEpic
parent ab6bd51334
commit 03bf12ee65
2 changed files with 20 additions and 1 deletions

View file

@ -67,7 +67,6 @@ public class JavaChunkDataTranslator extends PacketTranslator<ServerChunkDataPac
} catch (Exception ex) {
ex.printStackTrace();
}
GeyserLogger.DEFAULT.info("Sent chunk packet!");
});
}
}

View file

@ -34,6 +34,7 @@ public class Remapper {
BedrockItem bedrockItem = bedrockItemEntry.getValue();
String identifier = bedrockItem.getIdentifier();
// Colorable block remapping
for (ColoredBlock coloredBlock : ColoredBlock.values()) {
if (!getBedrockIdentifier(coloredBlock.name()).equalsIgnoreCase(bedrockItem.getIdentifier().replace(MINECRAFT, "")))
continue;
@ -48,6 +49,7 @@ public class Remapper {
}
}
// Wood remapping
for (WoodBlock woodBlock : WoodBlock.values()) {
if (!getBedrockIdentifier(woodBlock.name()).equalsIgnoreCase(bedrockItem.getIdentifier().replace(MINECRAFT, "")))
continue;
@ -66,6 +68,7 @@ public class Remapper {
}
}
// Stone remapping
if (bedrockItem.getIdentifier().replace(MINECRAFT, "").equalsIgnoreCase("stone") && !isTool(bedrockItem.getIdentifier())) {
for (StoneType stoneType : StoneType.values()) {
if (stoneType.getId() != bedrockItem.getData())
@ -76,6 +79,23 @@ public class Remapper {
}
}
// Grass remapping
if (bedrockItem.getIdentifier().replace(MINECRAFT, "").equalsIgnoreCase("grass")) {
identifier = MINECRAFT + "grass_block";
}
if (bedrockItem.getIdentifier().replace(MINECRAFT, "").equalsIgnoreCase("tallgrass")) {
identifier = MINECRAFT + "grass";
}
// Dirt remapping
if (bedrockItem.getIdentifier().replace(MINECRAFT, "").equalsIgnoreCase("dirt")) {
if (bedrockItem.getData() == 0)
identifier = MINECRAFT + "dirt";
else
identifier = MINECRAFT + "coarse_dirt";
}
for (Map.Entry<String, JavaItem> javaItemEntry : javaItems.entrySet()) {
if (identifier.equalsIgnoreCase(javaItemEntry.getKey())) {
bedrockToJava.put(bedrockItemEntry.getValue(), javaItemEntry.getValue());