Skip to content

Commit

Permalink
Change item names if acting as a replacement
Browse files Browse the repository at this point in the history
  • Loading branch information
Camotoy committed Jun 6, 2021
1 parent 3cdc4c7 commit 715b9ab
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -404,13 +404,16 @@ public static void init() {
"", bedrockBlockId,
stackSize);
}
} else if (entry.getKey().equals("minecraft:spectral_arrow") || entry.getKey().equals("minecraft:knowledge_book")) {
// These items don't exist on Java, so set up a container that indicates they should have custom names
} else if (entry.getKey().equals("minecraft:spectral_arrow") || entry.getKey().equals("minecraft:knowledge_book")
// To remove later... hopefully
|| entry.getKey().contains("candle") || entry.getKey().equals("minecraft:bundle") || entry.getKey().equals("minecraft:sculk_sensor")) {
// These items don't exist on Bedrock, so set up a container that indicates they should have custom names
itemEntry = new TranslatableItemEntry(
entry.getKey(), bedrockIdentifier, itemIndex, bedrockId,
entry.getValue().get("bedrock_data").intValue(),
bedrockBlockId,
stackSize);
GeyserConnector.getInstance().getLogger().debug("Adding " + entry.getKey() + " as an item that needs to be translated.");
} else {
itemEntry = new ItemEntry(
entry.getKey(), bedrockIdentifier, itemIndex, bedrockId,
Expand Down Expand Up @@ -530,7 +533,13 @@ public static void init() {

Set<String> javaOnlyItems = new ObjectOpenHashSet<>();
Collections.addAll(javaOnlyItems, "minecraft:spectral_arrow", "minecraft:debug_stick",
"minecraft:knowledge_book", "minecraft:tipped_arrow", "minecraft:trader_llama_spawn_egg");
"minecraft:knowledge_book", "minecraft:tipped_arrow", "minecraft:trader_llama_spawn_egg",
// To be removed in Bedrock 1.17.10... right??? RIGHT???
"minecraft:candle", "minecraft:white_candle", "minecraft:orange_candle", "minecraft:magenta_candle",
"minecraft:light_blue_candle", "minecraft:yellow_candle", "minecraft:lime_candle", "minecraft:pink_candle",
"minecraft:gray_candle", "minecraft:light_gray_candle", "minecraft:cyan_candle", "minecraft:purple_candle",
"minecraft:blue_candle", "minecraft:brown_candle", "minecraft:green_candle", "minecraft:red_candle", "minecraft:black_candle",
"minecraft:bundle", "minecraft:sculk_sensor");
if (!usingFurnaceMinecart) {
javaOnlyItems.add("minecraft:furnace_minecart");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ public class TranslatableItemEntry extends ItemEntry {

public TranslatableItemEntry(String javaIdentifier, String bedrockIdentifier, int javaId, int bedrockId, int bedrockData, int bedrockBlockId, int stackSize) {
super(javaIdentifier, bedrockIdentifier, javaId, bedrockId, bedrockData, bedrockBlockId, stackSize);
this.translationString = "item." + javaIdentifier.replace(":", ".");
this.translationString = (isBlock() ? "block." : "item.") + javaIdentifier.replace(":", ".");
}
}

0 comments on commit 715b9ab

Please sign in to comment.