Fix furnace minecart custom item for 1.17.30
@@ -100,7 +100,7 @@ public class ItemRegistryPopulator {
for (Map.Entry<String, PaletteVersion> palette : PALETTE_VERSIONS.entrySet()) {
stream = FileUtils.getResource(String.format("bedrock/runtime_item_states.%s.json", palette.getKey()));
- TypeReference<List<PaletteItem>> paletteEntriesType = new TypeReference<List<PaletteItem>>() { };
+ TypeReference<List<PaletteItem>> paletteEntriesType = new TypeReference<>() {};
// Used to get the Bedrock namespaced ID (in instances where there are small differences)
Object2IntMap<String> bedrockIdentifierToId = new Object2IntOpenHashMap<>();
@@ -470,9 +470,17 @@ public class ItemRegistryPopulator {
builder.putString("name", "geysermc:furnace_minecart")
.putInt("id", furnaceMinecartId);
+ NbtMapBuilder itemProperties = NbtMap.builder();
+
NbtMapBuilder componentBuilder = NbtMap.builder();
// Conveniently, as of 1.16.200, the furnace minecart has a texture AND translation string already.
- componentBuilder.putCompound("minecraft:icon", NbtMap.builder().putString("texture", "minecart_furnace").build());
+ // 1.17.30 moves the icon to the item properties section
+ (palette.getValue().getProtocolVersion() >= Bedrock_v465.V465_CODEC.getProtocolVersion() ?
+ itemProperties : componentBuilder).putCompound("minecraft:icon", NbtMap.builder()
+ .putString("texture", "minecart_furnace")
+ .putString("frame", "0.000000")
+ .putInt("frame_version", 1)
+ .putString("legacy_id", "").build());
componentBuilder.putCompound("minecraft:display_name", NbtMap.builder().putString("value", "item.minecartFurnace.name").build());
// Indicate that the arm animation should play on rails
@@ -483,7 +491,6 @@ public class ItemRegistryPopulator {
.putList("use_on", NbtType.COMPOUND, useOnTag)
.build());
- NbtMapBuilder itemProperties = NbtMap.builder();
// We always want to allow offhand usage when we can - matches Java Edition
itemProperties.putBoolean("allow_off_hand", true);
itemProperties.putBoolean("hand_equipped", false);
