3
0
Mirror von https://github.com/GeyserMC/Geyser.git synchronisiert 2024-12-24 15:20:25 +01:00

Fix furnace minecart custom item for 1.17.30

Dieser Commit ist enthalten in:
Camotoy 2021-09-22 15:11:14 -04:00
Ursprung 94af039f71
Commit 82bb6ad61f
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 7EEFB66FE798081F

Datei anzeigen

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