3
0
Mirror von https://github.com/GeyserMC/Geyser.git synchronisiert 2024-12-26 00:00:41 +01:00

Implement more block mappings

Dieser Commit ist enthalten in:
RednedEpic 2019-09-13 18:49:46 -05:00 committet von RednedEpic
Ursprung ab6bd51334
Commit 03bf12ee65
2 geänderte Dateien mit 20 neuen und 1 gelöschten Zeilen

Datei anzeigen

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

Datei anzeigen

@ -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());