368 lines
19 KiB
Java
368 lines
19 KiB
Java
/*
|
|
* Decompiled with CFR 0.152.
|
|
*
|
|
* Could not load the following classes:
|
|
* com.mojang.datafixers.DSL
|
|
* com.mojang.datafixers.DataFix
|
|
* com.mojang.datafixers.DataFixUtils
|
|
* com.mojang.datafixers.OpticFinder
|
|
* com.mojang.datafixers.TypeRewriteRule
|
|
* com.mojang.datafixers.schemas.Schema
|
|
* com.mojang.datafixers.types.Type
|
|
* com.mojang.datafixers.util.Pair
|
|
* it.unimi.dsi.fastutil.ints.Int2ObjectMap
|
|
* it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap
|
|
*/
|
|
package net.minecraft.util.datafix.fixes;
|
|
|
|
import com.mojang.datafixers.DSL;
|
|
import com.mojang.datafixers.DataFix;
|
|
import com.mojang.datafixers.DataFixUtils;
|
|
import com.mojang.datafixers.OpticFinder;
|
|
import com.mojang.datafixers.TypeRewriteRule;
|
|
import com.mojang.datafixers.schemas.Schema;
|
|
import com.mojang.datafixers.types.Type;
|
|
import com.mojang.datafixers.util.Pair;
|
|
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
|
|
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
|
|
import net.minecraft.util.datafix.fixes.References;
|
|
import net.minecraft.util.datafix.schemas.NamespacedSchema;
|
|
|
|
public class ItemIdFix
|
|
extends DataFix {
|
|
private static final Int2ObjectMap<String> ITEM_NAMES = (Int2ObjectMap)DataFixUtils.make((Object)new Int2ObjectOpenHashMap(), map -> {
|
|
map.put(1, (Object)"minecraft:stone");
|
|
map.put(2, (Object)"minecraft:grass");
|
|
map.put(3, (Object)"minecraft:dirt");
|
|
map.put(4, (Object)"minecraft:cobblestone");
|
|
map.put(5, (Object)"minecraft:planks");
|
|
map.put(6, (Object)"minecraft:sapling");
|
|
map.put(7, (Object)"minecraft:bedrock");
|
|
map.put(8, (Object)"minecraft:flowing_water");
|
|
map.put(9, (Object)"minecraft:water");
|
|
map.put(10, (Object)"minecraft:flowing_lava");
|
|
map.put(11, (Object)"minecraft:lava");
|
|
map.put(12, (Object)"minecraft:sand");
|
|
map.put(13, (Object)"minecraft:gravel");
|
|
map.put(14, (Object)"minecraft:gold_ore");
|
|
map.put(15, (Object)"minecraft:iron_ore");
|
|
map.put(16, (Object)"minecraft:coal_ore");
|
|
map.put(17, (Object)"minecraft:log");
|
|
map.put(18, (Object)"minecraft:leaves");
|
|
map.put(19, (Object)"minecraft:sponge");
|
|
map.put(20, (Object)"minecraft:glass");
|
|
map.put(21, (Object)"minecraft:lapis_ore");
|
|
map.put(22, (Object)"minecraft:lapis_block");
|
|
map.put(23, (Object)"minecraft:dispenser");
|
|
map.put(24, (Object)"minecraft:sandstone");
|
|
map.put(25, (Object)"minecraft:noteblock");
|
|
map.put(27, (Object)"minecraft:golden_rail");
|
|
map.put(28, (Object)"minecraft:detector_rail");
|
|
map.put(29, (Object)"minecraft:sticky_piston");
|
|
map.put(30, (Object)"minecraft:web");
|
|
map.put(31, (Object)"minecraft:tallgrass");
|
|
map.put(32, (Object)"minecraft:deadbush");
|
|
map.put(33, (Object)"minecraft:piston");
|
|
map.put(35, (Object)"minecraft:wool");
|
|
map.put(37, (Object)"minecraft:yellow_flower");
|
|
map.put(38, (Object)"minecraft:red_flower");
|
|
map.put(39, (Object)"minecraft:brown_mushroom");
|
|
map.put(40, (Object)"minecraft:red_mushroom");
|
|
map.put(41, (Object)"minecraft:gold_block");
|
|
map.put(42, (Object)"minecraft:iron_block");
|
|
map.put(43, (Object)"minecraft:double_stone_slab");
|
|
map.put(44, (Object)"minecraft:stone_slab");
|
|
map.put(45, (Object)"minecraft:brick_block");
|
|
map.put(46, (Object)"minecraft:tnt");
|
|
map.put(47, (Object)"minecraft:bookshelf");
|
|
map.put(48, (Object)"minecraft:mossy_cobblestone");
|
|
map.put(49, (Object)"minecraft:obsidian");
|
|
map.put(50, (Object)"minecraft:torch");
|
|
map.put(51, (Object)"minecraft:fire");
|
|
map.put(52, (Object)"minecraft:mob_spawner");
|
|
map.put(53, (Object)"minecraft:oak_stairs");
|
|
map.put(54, (Object)"minecraft:chest");
|
|
map.put(56, (Object)"minecraft:diamond_ore");
|
|
map.put(57, (Object)"minecraft:diamond_block");
|
|
map.put(58, (Object)"minecraft:crafting_table");
|
|
map.put(60, (Object)"minecraft:farmland");
|
|
map.put(61, (Object)"minecraft:furnace");
|
|
map.put(62, (Object)"minecraft:lit_furnace");
|
|
map.put(65, (Object)"minecraft:ladder");
|
|
map.put(66, (Object)"minecraft:rail");
|
|
map.put(67, (Object)"minecraft:stone_stairs");
|
|
map.put(69, (Object)"minecraft:lever");
|
|
map.put(70, (Object)"minecraft:stone_pressure_plate");
|
|
map.put(72, (Object)"minecraft:wooden_pressure_plate");
|
|
map.put(73, (Object)"minecraft:redstone_ore");
|
|
map.put(76, (Object)"minecraft:redstone_torch");
|
|
map.put(77, (Object)"minecraft:stone_button");
|
|
map.put(78, (Object)"minecraft:snow_layer");
|
|
map.put(79, (Object)"minecraft:ice");
|
|
map.put(80, (Object)"minecraft:snow");
|
|
map.put(81, (Object)"minecraft:cactus");
|
|
map.put(82, (Object)"minecraft:clay");
|
|
map.put(84, (Object)"minecraft:jukebox");
|
|
map.put(85, (Object)"minecraft:fence");
|
|
map.put(86, (Object)"minecraft:pumpkin");
|
|
map.put(87, (Object)"minecraft:netherrack");
|
|
map.put(88, (Object)"minecraft:soul_sand");
|
|
map.put(89, (Object)"minecraft:glowstone");
|
|
map.put(90, (Object)"minecraft:portal");
|
|
map.put(91, (Object)"minecraft:lit_pumpkin");
|
|
map.put(95, (Object)"minecraft:stained_glass");
|
|
map.put(96, (Object)"minecraft:trapdoor");
|
|
map.put(97, (Object)"minecraft:monster_egg");
|
|
map.put(98, (Object)"minecraft:stonebrick");
|
|
map.put(99, (Object)"minecraft:brown_mushroom_block");
|
|
map.put(100, (Object)"minecraft:red_mushroom_block");
|
|
map.put(101, (Object)"minecraft:iron_bars");
|
|
map.put(102, (Object)"minecraft:glass_pane");
|
|
map.put(103, (Object)"minecraft:melon_block");
|
|
map.put(106, (Object)"minecraft:vine");
|
|
map.put(107, (Object)"minecraft:fence_gate");
|
|
map.put(108, (Object)"minecraft:brick_stairs");
|
|
map.put(109, (Object)"minecraft:stone_brick_stairs");
|
|
map.put(110, (Object)"minecraft:mycelium");
|
|
map.put(111, (Object)"minecraft:waterlily");
|
|
map.put(112, (Object)"minecraft:nether_brick");
|
|
map.put(113, (Object)"minecraft:nether_brick_fence");
|
|
map.put(114, (Object)"minecraft:nether_brick_stairs");
|
|
map.put(116, (Object)"minecraft:enchanting_table");
|
|
map.put(119, (Object)"minecraft:end_portal");
|
|
map.put(120, (Object)"minecraft:end_portal_frame");
|
|
map.put(121, (Object)"minecraft:end_stone");
|
|
map.put(122, (Object)"minecraft:dragon_egg");
|
|
map.put(123, (Object)"minecraft:redstone_lamp");
|
|
map.put(125, (Object)"minecraft:double_wooden_slab");
|
|
map.put(126, (Object)"minecraft:wooden_slab");
|
|
map.put(127, (Object)"minecraft:cocoa");
|
|
map.put(128, (Object)"minecraft:sandstone_stairs");
|
|
map.put(129, (Object)"minecraft:emerald_ore");
|
|
map.put(130, (Object)"minecraft:ender_chest");
|
|
map.put(131, (Object)"minecraft:tripwire_hook");
|
|
map.put(133, (Object)"minecraft:emerald_block");
|
|
map.put(134, (Object)"minecraft:spruce_stairs");
|
|
map.put(135, (Object)"minecraft:birch_stairs");
|
|
map.put(136, (Object)"minecraft:jungle_stairs");
|
|
map.put(137, (Object)"minecraft:command_block");
|
|
map.put(138, (Object)"minecraft:beacon");
|
|
map.put(139, (Object)"minecraft:cobblestone_wall");
|
|
map.put(141, (Object)"minecraft:carrots");
|
|
map.put(142, (Object)"minecraft:potatoes");
|
|
map.put(143, (Object)"minecraft:wooden_button");
|
|
map.put(145, (Object)"minecraft:anvil");
|
|
map.put(146, (Object)"minecraft:trapped_chest");
|
|
map.put(147, (Object)"minecraft:light_weighted_pressure_plate");
|
|
map.put(148, (Object)"minecraft:heavy_weighted_pressure_plate");
|
|
map.put(151, (Object)"minecraft:daylight_detector");
|
|
map.put(152, (Object)"minecraft:redstone_block");
|
|
map.put(153, (Object)"minecraft:quartz_ore");
|
|
map.put(154, (Object)"minecraft:hopper");
|
|
map.put(155, (Object)"minecraft:quartz_block");
|
|
map.put(156, (Object)"minecraft:quartz_stairs");
|
|
map.put(157, (Object)"minecraft:activator_rail");
|
|
map.put(158, (Object)"minecraft:dropper");
|
|
map.put(159, (Object)"minecraft:stained_hardened_clay");
|
|
map.put(160, (Object)"minecraft:stained_glass_pane");
|
|
map.put(161, (Object)"minecraft:leaves2");
|
|
map.put(162, (Object)"minecraft:log2");
|
|
map.put(163, (Object)"minecraft:acacia_stairs");
|
|
map.put(164, (Object)"minecraft:dark_oak_stairs");
|
|
map.put(170, (Object)"minecraft:hay_block");
|
|
map.put(171, (Object)"minecraft:carpet");
|
|
map.put(172, (Object)"minecraft:hardened_clay");
|
|
map.put(173, (Object)"minecraft:coal_block");
|
|
map.put(174, (Object)"minecraft:packed_ice");
|
|
map.put(175, (Object)"minecraft:double_plant");
|
|
map.put(256, (Object)"minecraft:iron_shovel");
|
|
map.put(257, (Object)"minecraft:iron_pickaxe");
|
|
map.put(258, (Object)"minecraft:iron_axe");
|
|
map.put(259, (Object)"minecraft:flint_and_steel");
|
|
map.put(260, (Object)"minecraft:apple");
|
|
map.put(261, (Object)"minecraft:bow");
|
|
map.put(262, (Object)"minecraft:arrow");
|
|
map.put(263, (Object)"minecraft:coal");
|
|
map.put(264, (Object)"minecraft:diamond");
|
|
map.put(265, (Object)"minecraft:iron_ingot");
|
|
map.put(266, (Object)"minecraft:gold_ingot");
|
|
map.put(267, (Object)"minecraft:iron_sword");
|
|
map.put(268, (Object)"minecraft:wooden_sword");
|
|
map.put(269, (Object)"minecraft:wooden_shovel");
|
|
map.put(270, (Object)"minecraft:wooden_pickaxe");
|
|
map.put(271, (Object)"minecraft:wooden_axe");
|
|
map.put(272, (Object)"minecraft:stone_sword");
|
|
map.put(273, (Object)"minecraft:stone_shovel");
|
|
map.put(274, (Object)"minecraft:stone_pickaxe");
|
|
map.put(275, (Object)"minecraft:stone_axe");
|
|
map.put(276, (Object)"minecraft:diamond_sword");
|
|
map.put(277, (Object)"minecraft:diamond_shovel");
|
|
map.put(278, (Object)"minecraft:diamond_pickaxe");
|
|
map.put(279, (Object)"minecraft:diamond_axe");
|
|
map.put(280, (Object)"minecraft:stick");
|
|
map.put(281, (Object)"minecraft:bowl");
|
|
map.put(282, (Object)"minecraft:mushroom_stew");
|
|
map.put(283, (Object)"minecraft:golden_sword");
|
|
map.put(284, (Object)"minecraft:golden_shovel");
|
|
map.put(285, (Object)"minecraft:golden_pickaxe");
|
|
map.put(286, (Object)"minecraft:golden_axe");
|
|
map.put(287, (Object)"minecraft:string");
|
|
map.put(288, (Object)"minecraft:feather");
|
|
map.put(289, (Object)"minecraft:gunpowder");
|
|
map.put(290, (Object)"minecraft:wooden_hoe");
|
|
map.put(291, (Object)"minecraft:stone_hoe");
|
|
map.put(292, (Object)"minecraft:iron_hoe");
|
|
map.put(293, (Object)"minecraft:diamond_hoe");
|
|
map.put(294, (Object)"minecraft:golden_hoe");
|
|
map.put(295, (Object)"minecraft:wheat_seeds");
|
|
map.put(296, (Object)"minecraft:wheat");
|
|
map.put(297, (Object)"minecraft:bread");
|
|
map.put(298, (Object)"minecraft:leather_helmet");
|
|
map.put(299, (Object)"minecraft:leather_chestplate");
|
|
map.put(300, (Object)"minecraft:leather_leggings");
|
|
map.put(301, (Object)"minecraft:leather_boots");
|
|
map.put(302, (Object)"minecraft:chainmail_helmet");
|
|
map.put(303, (Object)"minecraft:chainmail_chestplate");
|
|
map.put(304, (Object)"minecraft:chainmail_leggings");
|
|
map.put(305, (Object)"minecraft:chainmail_boots");
|
|
map.put(306, (Object)"minecraft:iron_helmet");
|
|
map.put(307, (Object)"minecraft:iron_chestplate");
|
|
map.put(308, (Object)"minecraft:iron_leggings");
|
|
map.put(309, (Object)"minecraft:iron_boots");
|
|
map.put(310, (Object)"minecraft:diamond_helmet");
|
|
map.put(311, (Object)"minecraft:diamond_chestplate");
|
|
map.put(312, (Object)"minecraft:diamond_leggings");
|
|
map.put(313, (Object)"minecraft:diamond_boots");
|
|
map.put(314, (Object)"minecraft:golden_helmet");
|
|
map.put(315, (Object)"minecraft:golden_chestplate");
|
|
map.put(316, (Object)"minecraft:golden_leggings");
|
|
map.put(317, (Object)"minecraft:golden_boots");
|
|
map.put(318, (Object)"minecraft:flint");
|
|
map.put(319, (Object)"minecraft:porkchop");
|
|
map.put(320, (Object)"minecraft:cooked_porkchop");
|
|
map.put(321, (Object)"minecraft:painting");
|
|
map.put(322, (Object)"minecraft:golden_apple");
|
|
map.put(323, (Object)"minecraft:sign");
|
|
map.put(324, (Object)"minecraft:wooden_door");
|
|
map.put(325, (Object)"minecraft:bucket");
|
|
map.put(326, (Object)"minecraft:water_bucket");
|
|
map.put(327, (Object)"minecraft:lava_bucket");
|
|
map.put(328, (Object)"minecraft:minecart");
|
|
map.put(329, (Object)"minecraft:saddle");
|
|
map.put(330, (Object)"minecraft:iron_door");
|
|
map.put(331, (Object)"minecraft:redstone");
|
|
map.put(332, (Object)"minecraft:snowball");
|
|
map.put(333, (Object)"minecraft:boat");
|
|
map.put(334, (Object)"minecraft:leather");
|
|
map.put(335, (Object)"minecraft:milk_bucket");
|
|
map.put(336, (Object)"minecraft:brick");
|
|
map.put(337, (Object)"minecraft:clay_ball");
|
|
map.put(338, (Object)"minecraft:reeds");
|
|
map.put(339, (Object)"minecraft:paper");
|
|
map.put(340, (Object)"minecraft:book");
|
|
map.put(341, (Object)"minecraft:slime_ball");
|
|
map.put(342, (Object)"minecraft:chest_minecart");
|
|
map.put(343, (Object)"minecraft:furnace_minecart");
|
|
map.put(344, (Object)"minecraft:egg");
|
|
map.put(345, (Object)"minecraft:compass");
|
|
map.put(346, (Object)"minecraft:fishing_rod");
|
|
map.put(347, (Object)"minecraft:clock");
|
|
map.put(348, (Object)"minecraft:glowstone_dust");
|
|
map.put(349, (Object)"minecraft:fish");
|
|
map.put(350, (Object)"minecraft:cooked_fished");
|
|
map.put(351, (Object)"minecraft:dye");
|
|
map.put(352, (Object)"minecraft:bone");
|
|
map.put(353, (Object)"minecraft:sugar");
|
|
map.put(354, (Object)"minecraft:cake");
|
|
map.put(355, (Object)"minecraft:bed");
|
|
map.put(356, (Object)"minecraft:repeater");
|
|
map.put(357, (Object)"minecraft:cookie");
|
|
map.put(358, (Object)"minecraft:filled_map");
|
|
map.put(359, (Object)"minecraft:shears");
|
|
map.put(360, (Object)"minecraft:melon");
|
|
map.put(361, (Object)"minecraft:pumpkin_seeds");
|
|
map.put(362, (Object)"minecraft:melon_seeds");
|
|
map.put(363, (Object)"minecraft:beef");
|
|
map.put(364, (Object)"minecraft:cooked_beef");
|
|
map.put(365, (Object)"minecraft:chicken");
|
|
map.put(366, (Object)"minecraft:cooked_chicken");
|
|
map.put(367, (Object)"minecraft:rotten_flesh");
|
|
map.put(368, (Object)"minecraft:ender_pearl");
|
|
map.put(369, (Object)"minecraft:blaze_rod");
|
|
map.put(370, (Object)"minecraft:ghast_tear");
|
|
map.put(371, (Object)"minecraft:gold_nugget");
|
|
map.put(372, (Object)"minecraft:nether_wart");
|
|
map.put(373, (Object)"minecraft:potion");
|
|
map.put(374, (Object)"minecraft:glass_bottle");
|
|
map.put(375, (Object)"minecraft:spider_eye");
|
|
map.put(376, (Object)"minecraft:fermented_spider_eye");
|
|
map.put(377, (Object)"minecraft:blaze_powder");
|
|
map.put(378, (Object)"minecraft:magma_cream");
|
|
map.put(379, (Object)"minecraft:brewing_stand");
|
|
map.put(380, (Object)"minecraft:cauldron");
|
|
map.put(381, (Object)"minecraft:ender_eye");
|
|
map.put(382, (Object)"minecraft:speckled_melon");
|
|
map.put(383, (Object)"minecraft:spawn_egg");
|
|
map.put(384, (Object)"minecraft:experience_bottle");
|
|
map.put(385, (Object)"minecraft:fire_charge");
|
|
map.put(386, (Object)"minecraft:writable_book");
|
|
map.put(387, (Object)"minecraft:written_book");
|
|
map.put(388, (Object)"minecraft:emerald");
|
|
map.put(389, (Object)"minecraft:item_frame");
|
|
map.put(390, (Object)"minecraft:flower_pot");
|
|
map.put(391, (Object)"minecraft:carrot");
|
|
map.put(392, (Object)"minecraft:potato");
|
|
map.put(393, (Object)"minecraft:baked_potato");
|
|
map.put(394, (Object)"minecraft:poisonous_potato");
|
|
map.put(395, (Object)"minecraft:map");
|
|
map.put(396, (Object)"minecraft:golden_carrot");
|
|
map.put(397, (Object)"minecraft:skull");
|
|
map.put(398, (Object)"minecraft:carrot_on_a_stick");
|
|
map.put(399, (Object)"minecraft:nether_star");
|
|
map.put(400, (Object)"minecraft:pumpkin_pie");
|
|
map.put(401, (Object)"minecraft:fireworks");
|
|
map.put(402, (Object)"minecraft:firework_charge");
|
|
map.put(403, (Object)"minecraft:enchanted_book");
|
|
map.put(404, (Object)"minecraft:comparator");
|
|
map.put(405, (Object)"minecraft:netherbrick");
|
|
map.put(406, (Object)"minecraft:quartz");
|
|
map.put(407, (Object)"minecraft:tnt_minecart");
|
|
map.put(408, (Object)"minecraft:hopper_minecart");
|
|
map.put(417, (Object)"minecraft:iron_horse_armor");
|
|
map.put(418, (Object)"minecraft:golden_horse_armor");
|
|
map.put(419, (Object)"minecraft:diamond_horse_armor");
|
|
map.put(420, (Object)"minecraft:lead");
|
|
map.put(421, (Object)"minecraft:name_tag");
|
|
map.put(422, (Object)"minecraft:command_block_minecart");
|
|
map.put(2256, (Object)"minecraft:record_13");
|
|
map.put(2257, (Object)"minecraft:record_cat");
|
|
map.put(2258, (Object)"minecraft:record_blocks");
|
|
map.put(2259, (Object)"minecraft:record_chirp");
|
|
map.put(2260, (Object)"minecraft:record_far");
|
|
map.put(2261, (Object)"minecraft:record_mall");
|
|
map.put(2262, (Object)"minecraft:record_mellohi");
|
|
map.put(2263, (Object)"minecraft:record_stal");
|
|
map.put(2264, (Object)"minecraft:record_strad");
|
|
map.put(2265, (Object)"minecraft:record_ward");
|
|
map.put(2266, (Object)"minecraft:record_11");
|
|
map.put(2267, (Object)"minecraft:record_wait");
|
|
map.defaultReturnValue((Object)"minecraft:air");
|
|
});
|
|
|
|
public ItemIdFix(Schema outputSchema, boolean changesType) {
|
|
super(outputSchema, changesType);
|
|
}
|
|
|
|
public static String getItem(int id) {
|
|
return (String)ITEM_NAMES.get(id);
|
|
}
|
|
|
|
public TypeRewriteRule makeRule() {
|
|
Type oldItemType = DSL.or((Type)DSL.intType(), (Type)DSL.named((String)References.ITEM_NAME.typeName(), NamespacedSchema.namespacedString()));
|
|
Type newItemType = DSL.named((String)References.ITEM_NAME.typeName(), NamespacedSchema.namespacedString());
|
|
OpticFinder id = DSL.fieldFinder((String)"id", (Type)oldItemType);
|
|
return this.fixTypeEverywhereTyped("ItemIdFix", this.getInputSchema().getType(References.ITEM_STACK), this.getOutputSchema().getType(References.ITEM_STACK), itemStack -> itemStack.update(id, newItemType, oldId -> (Pair)oldId.map(l -> Pair.of((Object)References.ITEM_NAME.typeName(), (Object)ItemIdFix.getItem(l)), r -> r)));
|
|
}
|
|
}
|
|
|