Skip to content

Commit 82bb6ad

Browse files
committed
Fix furnace minecart custom item for 1.17.30
1 parent 94af039 commit 82bb6ad

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

connector/src/main/java/org/geysermc/connector/registry/populator/ItemRegistryPopulator.java

+10-3
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ public static void populate() {
100100
for (Map.Entry<String, PaletteVersion> palette : PALETTE_VERSIONS.entrySet()) {
101101
stream = FileUtils.getResource(String.format("bedrock/runtime_item_states.%s.json", palette.getKey()));
102102

103-
TypeReference<List<PaletteItem>> paletteEntriesType = new TypeReference<List<PaletteItem>>() { };
103+
TypeReference<List<PaletteItem>> paletteEntriesType = new TypeReference<>() {};
104104

105105
// Used to get the Bedrock namespaced ID (in instances where there are small differences)
106106
Object2IntMap<String> bedrockIdentifierToId = new Object2IntOpenHashMap<>();
@@ -470,9 +470,17 @@ public static void populate() {
470470
builder.putString("name", "geysermc:furnace_minecart")
471471
.putInt("id", furnaceMinecartId);
472472

473+
NbtMapBuilder itemProperties = NbtMap.builder();
474+
473475
NbtMapBuilder componentBuilder = NbtMap.builder();
474476
// Conveniently, as of 1.16.200, the furnace minecart has a texture AND translation string already.
475-
componentBuilder.putCompound("minecraft:icon", NbtMap.builder().putString("texture", "minecart_furnace").build());
477+
// 1.17.30 moves the icon to the item properties section
478+
(palette.getValue().getProtocolVersion() >= Bedrock_v465.V465_CODEC.getProtocolVersion() ?
479+
itemProperties : componentBuilder).putCompound("minecraft:icon", NbtMap.builder()
480+
.putString("texture", "minecart_furnace")
481+
.putString("frame", "0.000000")
482+
.putInt("frame_version", 1)
483+
.putString("legacy_id", "").build());
476484
componentBuilder.putCompound("minecraft:display_name", NbtMap.builder().putString("value", "item.minecartFurnace.name").build());
477485

478486
// Indicate that the arm animation should play on rails
@@ -483,7 +491,6 @@ public static void populate() {
483491
.putList("use_on", NbtType.COMPOUND, useOnTag)
484492
.build());
485493

486-
NbtMapBuilder itemProperties = NbtMap.builder();
487494
// We always want to allow offhand usage when we can - matches Java Edition
488495
itemProperties.putBoolean("allow_off_hand", true);
489496
itemProperties.putBoolean("hand_equipped", false);

0 commit comments

Comments
 (0)