From f41a378d6b3006b574e8a44fdc2cc9ae54f27de7 Mon Sep 17 00:00:00 2001 From: ix0rai Date: Thu, 4 Apr 2024 18:00:53 -0500 Subject: [PATCH] registry and inventory work --- gradle/libs.versions.toml | 2 +- .../minecraft/inventory/Inventories.mapping | 6 ++++++ .../net/minecraft/inventory/Inventory.mapping | 2 ++ .../inventory/LootableInventory.mapping | 2 ++ .../inventory/SimpleInventory.mapping | 2 ++ .../minecraft/registry/HolderLookup.mapping | 3 ++- .../registry/RegistrationInfo.mapping | 2 ++ .../net/minecraft/registry/Registry.mapping | 5 +++++ .../registry/RegistryFixedCodec.mapping | 1 + .../minecraft/registry/RegistryKey.mapping | 1 + .../minecraft/registry/RegistryLoader.mapping | 4 ++++ .../registry/ReloadableRegistries.mapping | 21 +++++++++++++++++++ 12 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 mappings/net/minecraft/registry/RegistrationInfo.mapping create mode 100644 mappings/net/minecraft/registry/ReloadableRegistries.mapping diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 2e54d4da96..8056d40f66 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -4,7 +4,7 @@ download_task = "4.1.1" guava = "31.1-jre" jackson_xml = "2.14.1" launchermeta_parser = "1.0.0" -enigma = "2.2.1" +enigma = "2.2.1+local" enigma_plugin = "2.2.0" tiny_remapper = "0.7.2" stitch = "0.6.1" diff --git a/mappings/net/minecraft/inventory/Inventories.mapping b/mappings/net/minecraft/inventory/Inventories.mapping index 556b241943..97c9b427cc 100644 --- a/mappings/net/minecraft/inventory/Inventories.mapping +++ b/mappings/net/minecraft/inventory/Inventories.mapping @@ -12,6 +12,11 @@ CLASS net/minecraft/unmapped/C_encuwkkg net/minecraft/inventory/Inventories ARG 0 nbt ARG 1 stacks ARG 2 lookupProvider + METHOD m_goclvinq writeNbt (Lnet/minecraft/unmapped/C_hhlwcnih;Lnet/minecraft/unmapped/C_rnrfftze;ZLnet/minecraft/unmapped/C_vtbxyypo$C_etmlgbig;)Lnet/minecraft/unmapped/C_hhlwcnih; + ARG 0 nbt + ARG 1 stacks + ARG 2 putIfEmpty + ARG 3 lookupProvider METHOD m_hltkhklh remove (Lnet/minecraft/unmapped/C_pjtstjoq;Ljava/util/function/Predicate;IZ)I COMMENT Removes a number, not exceeding {@code maxCount}, of items from an inventory based on a predicate and returns that number. COMMENT @return the number of items removed @@ -27,3 +32,4 @@ CLASS net/minecraft/unmapped/C_encuwkkg net/minecraft/inventory/Inventories METHOD m_rczebuiz removeStack (Ljava/util/List;I)Lnet/minecraft/unmapped/C_sddaxwyk; ARG 0 stacks ARG 1 slot + METHOD m_yjhimrox writeNbt (Lnet/minecraft/unmapped/C_hhlwcnih;Lnet/minecraft/unmapped/C_rnrfftze;Lnet/minecraft/unmapped/C_vtbxyypo$C_etmlgbig;)Lnet/minecraft/unmapped/C_hhlwcnih; diff --git a/mappings/net/minecraft/inventory/Inventory.mapping b/mappings/net/minecraft/inventory/Inventory.mapping index 172ca8fbbe..794f0c235b 100644 --- a/mappings/net/minecraft/inventory/Inventory.mapping +++ b/mappings/net/minecraft/inventory/Inventory.mapping @@ -23,6 +23,8 @@ CLASS net/minecraft/unmapped/C_pjtstjoq net/minecraft/inventory/Inventory COMMENT Fetches the stack currently stored at the given slot. If the slot is empty, COMMENT or is outside the bounds of this inventory, returns see {@link ItemStack#EMPTY}. ARG 1 slot + METHOD m_kvljutzx getMaxCountPerSlot (Lnet/minecraft/unmapped/C_sddaxwyk;)I + METHOD m_mwetohsb getMaxCountPerSlot ()I METHOD m_noresdqq canPlayerUse (Lnet/minecraft/unmapped/C_jzrpycqo;)Z ARG 1 player METHOD m_ofgoacbo canTransferTo (Lnet/minecraft/unmapped/C_pjtstjoq;ILnet/minecraft/unmapped/C_sddaxwyk;)Z diff --git a/mappings/net/minecraft/inventory/LootableInventory.mapping b/mappings/net/minecraft/inventory/LootableInventory.mapping index cd2e3771a1..090b6410c6 100644 --- a/mappings/net/minecraft/inventory/LootableInventory.mapping +++ b/mappings/net/minecraft/inventory/LootableInventory.mapping @@ -1,6 +1,7 @@ CLASS net/minecraft/unmapped/C_ehawoasn net/minecraft/inventory/LootableInventory FIELD f_yeibkfzd LOOT_TABLE_SEED_KEY Ljava/lang/String; FIELD f_ztchflsp LOOT_TABLE_KEY Ljava/lang/String; + METHOD m_dmdivonx setLootTable (Lnet/minecraft/unmapped/C_xhhleach;)V METHOD m_drfdhyfv getLootTableId ()Lnet/minecraft/unmapped/C_xhhleach; METHOD m_mtzsyvbu setupLoot (Lnet/minecraft/unmapped/C_jzrpycqo;)V ARG 1 player @@ -12,5 +13,6 @@ CLASS net/minecraft/unmapped/C_ehawoasn net/minecraft/inventory/LootableInventor ARG 1 seed METHOD m_uxrpqxab getLootTableSeed ()J METHOD m_vhsehsrn setupLootTable (Lnet/minecraft/unmapped/C_peaveboq;Lnet/minecraft/unmapped/C_rlomrsco;Lnet/minecraft/unmapped/C_hynzadkk;Lnet/minecraft/unmapped/C_xhhleach;)V + METHOD m_xukvibrq setLootTable (Lnet/minecraft/unmapped/C_xhhleach;J)V METHOD m_ycwokqel writeLootTableNbt (Lnet/minecraft/unmapped/C_hhlwcnih;)Z ARG 1 nbt diff --git a/mappings/net/minecraft/inventory/SimpleInventory.mapping b/mappings/net/minecraft/inventory/SimpleInventory.mapping index f060f29e43..bf0c506d30 100644 --- a/mappings/net/minecraft/inventory/SimpleInventory.mapping +++ b/mappings/net/minecraft/inventory/SimpleInventory.mapping @@ -9,6 +9,7 @@ CLASS net/minecraft/unmapped/C_rsloiwzx net/minecraft/inventory/SimpleInventory METHOD m_hdajgqnv removeListener (Lnet/minecraft/unmapped/C_uaqlxobv;)V ARG 1 listener METHOD m_hzsqwpzp toNbtList (Lnet/minecraft/unmapped/C_vtbxyypo$C_etmlgbig;)Lnet/minecraft/unmapped/C_hqhtfwlr; + ARG 1 lookupProvider METHOD m_iqnieoui clearToList ()Ljava/util/List; COMMENT Clears this inventory and return all the non-empty stacks in a list. METHOD m_kcvdipnh stacks ()Lnet/minecraft/unmapped/C_rnrfftze; @@ -20,6 +21,7 @@ CLASS net/minecraft/unmapped/C_rsloiwzx net/minecraft/inventory/SimpleInventory ARG 2 count METHOD m_mrxizevu readNbtList (Lnet/minecraft/unmapped/C_hqhtfwlr;Lnet/minecraft/unmapped/C_vtbxyypo$C_etmlgbig;)V ARG 1 nbtList + ARG 2 lookupProvider METHOD m_ofqehuzw (Lnet/minecraft/unmapped/C_sddaxwyk;)Z ARG 0 stack METHOD m_ozbredpu addToNewSlot (Lnet/minecraft/unmapped/C_sddaxwyk;)V diff --git a/mappings/net/minecraft/registry/HolderLookup.mapping b/mappings/net/minecraft/registry/HolderLookup.mapping index 299294c5c1..bddc85ae88 100644 --- a/mappings/net/minecraft/registry/HolderLookup.mapping +++ b/mappings/net/minecraft/registry/HolderLookup.mapping @@ -15,9 +15,10 @@ CLASS net/minecraft/unmapped/C_vtbxyypo net/minecraft/registry/HolderLookup CLASS C_etmlgbig Provider METHOD m_dnidhibf create (Ljava/util/stream/Stream;)Lnet/minecraft/unmapped/C_vtbxyypo$C_etmlgbig; ARG 0 lookups - METHOD m_ejzrnhrb getHolderProvider ()Lnet/minecraft/unmapped/C_pzdchrcy$C_pbvqpmst; + METHOD m_ejzrnhrb createLookupProvider ()Lnet/minecraft/unmapped/C_pzdchrcy$C_pbvqpmst; METHOD m_iwetggkj getLookup (Lnet/minecraft/unmapped/C_xhhleach;)Ljava/util/Optional; METHOD m_onxuqmul getLookupOrThrow (Lnet/minecraft/unmapped/C_xhhleach;)Lnet/minecraft/unmapped/C_vtbxyypo$C_drwjtlvl; + METHOD m_pbceiquw streamRegistryKeys ()Ljava/util/stream/Stream; METHOD m_uwaazyzq createSerializationContext (Lcom/mojang/serialization/DynamicOps;)Lnet/minecraft/unmapped/C_piadqmzm; CLASS C_ikewmnmv METHOD m_axtnqmym (Lnet/minecraft/unmapped/C_vtbxyypo$C_drwjtlvl;)Lnet/minecraft/unmapped/C_pzdchrcy; diff --git a/mappings/net/minecraft/registry/RegistrationInfo.mapping b/mappings/net/minecraft/registry/RegistrationInfo.mapping new file mode 100644 index 0000000000..463305d8b2 --- /dev/null +++ b/mappings/net/minecraft/registry/RegistrationInfo.mapping @@ -0,0 +1,2 @@ +CLASS net/minecraft/unmapped/C_jhxfjegj net/minecraft/registry/RegistrationInfo + FIELD f_hakwatyg DEFAULT Lnet/minecraft/unmapped/C_jhxfjegj; diff --git a/mappings/net/minecraft/registry/Registry.mapping b/mappings/net/minecraft/registry/Registry.mapping index 6f49dac7e6..b5d50afd46 100644 --- a/mappings/net/minecraft/registry/Registry.mapping +++ b/mappings/net/minecraft/registry/Registry.mapping @@ -31,9 +31,11 @@ CLASS net/minecraft/unmapped/C_tqxyjqsk net/minecraft/registry/Registry ARG 1 key METHOD m_keyttxmd getTagOrEmpty (Lnet/minecraft/unmapped/C_ednuhnnn;)Ljava/lang/Iterable; ARG 1 tag + METHOD m_ksueyykv getReferenceHolderWithLifecycle ()Lcom/mojang/serialization/Codec; METHOD m_leajtcub stream ()Ljava/util/stream/Stream; METHOD m_mazpxlja get (Lnet/minecraft/unmapped/C_ncpywfca;)Ljava/lang/Object; ARG 1 id + METHOD m_nlhggctm getRegistrationInfo (Lnet/minecraft/unmapped/C_xhhleach;)Ljava/util/Optional; METHOD m_nqhcjajy register (Lnet/minecraft/unmapped/C_tqxyjqsk;Lnet/minecraft/unmapped/C_ncpywfca;Ljava/lang/Object;)Ljava/lang/Object; ARG 0 registry ARG 1 id @@ -41,10 +43,13 @@ CLASS net/minecraft/unmapped/C_tqxyjqsk net/minecraft/registry/Registry METHOD m_nqoydeav getEntries ()Ljava/util/Set; METHOD m_nxhthmir getHolder (Lnet/minecraft/unmapped/C_ncpywfca;)Ljava/util/Optional; ARG 1 id + METHOD m_nzuihlla getRandomElement (Lnet/minecraft/unmapped/C_ednuhnnn;Lnet/minecraft/unmapped/C_rlomrsco;)Ljava/util/Optional; METHOD m_ojrrpohi getTagKeys ()Ljava/util/stream/Stream; METHOD m_pquqhkot holderByNameCodec ()Lcom/mojang/serialization/Codec; METHOD m_pvyfqcdo getCodec ()Lcom/mojang/serialization/Codec; METHOD m_qeyctvgm asHolderIdMap ()Lnet/minecraft/unmapped/C_feaetnaz; + METHOD m_qkhirdbw validateReference (Lnet/minecraft/unmapped/C_cjzoxshv;)Lcom/mojang/serialization/DataResult; + ARG 1 holder METHOD m_qomglfhh getOrThrow (Lnet/minecraft/unmapped/C_xhhleach;)Ljava/lang/Object; COMMENT Gets an entry from the registry. COMMENT diff --git a/mappings/net/minecraft/registry/RegistryFixedCodec.mapping b/mappings/net/minecraft/registry/RegistryFixedCodec.mapping index e10e421390..673a012cf5 100644 --- a/mappings/net/minecraft/registry/RegistryFixedCodec.mapping +++ b/mappings/net/minecraft/registry/RegistryFixedCodec.mapping @@ -4,6 +4,7 @@ CLASS net/minecraft/unmapped/C_qosrsbdy net/minecraft/registry/RegistryFixedCode ARG 1 registryKey METHOD decode decode (Lcom/mojang/serialization/DynamicOps;Ljava/lang/Object;)Lcom/mojang/serialization/DataResult; ARG 1 dynamicOps + ARG 2 input METHOD encode encode (Ljava/lang/Object;Lcom/mojang/serialization/DynamicOps;Ljava/lang/Object;)Lcom/mojang/serialization/DataResult; ARG 1 holder ARG 2 dynamicOps diff --git a/mappings/net/minecraft/registry/RegistryKey.mapping b/mappings/net/minecraft/registry/RegistryKey.mapping index 632bdba4e1..364a95b421 100644 --- a/mappings/net/minecraft/registry/RegistryKey.mapping +++ b/mappings/net/minecraft/registry/RegistryKey.mapping @@ -14,6 +14,7 @@ CLASS net/minecraft/unmapped/C_xhhleach net/minecraft/registry/RegistryKey ARG 2 value METHOD m_achtcauh (Lnet/minecraft/unmapped/C_xhhleach;Lnet/minecraft/unmapped/C_ncpywfca;)Lnet/minecraft/unmapped/C_xhhleach; ARG 1 value + METHOD m_acppaety registryKey ()Lnet/minecraft/unmapped/C_xhhleach; METHOD m_bbzwrvpr packetCodec (Lnet/minecraft/unmapped/C_xhhleach;)Lnet/minecraft/unmapped/C_qsrmwluu; METHOD m_fvrtwzrl of (Lnet/minecraft/unmapped/C_xhhleach;Lnet/minecraft/unmapped/C_ncpywfca;)Lnet/minecraft/unmapped/C_xhhleach; COMMENT Creates a registry key for a value in a registry with a registry key for diff --git a/mappings/net/minecraft/registry/RegistryLoader.mapping b/mappings/net/minecraft/registry/RegistryLoader.mapping index b568fb5aaa..baf7052e66 100644 --- a/mappings/net/minecraft/registry/RegistryLoader.mapping +++ b/mappings/net/minecraft/registry/RegistryLoader.mapping @@ -1,5 +1,8 @@ CLASS net/minecraft/unmapped/C_ratuauki net/minecraft/registry/RegistryLoader + FIELD f_cwqigkbo EXPERIMENTAL_REGISTRATION_INFO Lnet/minecraft/unmapped/C_jhxfjegj; + FIELD f_jezobqyr SYNCED_REGISTRIES Ljava/util/List; FIELD f_mbwjyulc WORLDGEN_REGISTRIES Ljava/util/List; + FIELD f_mwvwmgqu REGISTRATION_INFO_CACHE Ljava/util/function/Function; FIELD f_ytrbmnwo DIMENSION_REGISTRIES Ljava/util/List; METHOD m_bszcilsu printExceptions (Ljava/util/Map;)V ARG 0 collectedExceptions @@ -10,6 +13,7 @@ CLASS net/minecraft/unmapped/C_ratuauki net/minecraft/registry/RegistryLoader METHOD m_mcjxwvrf createContext (Lnet/minecraft/unmapped/C_wqxmvzdq;Ljava/util/List;)Lnet/minecraft/unmapped/C_piadqmzm$C_raywzonl; ARG 1 registriesAndLoaders METHOD m_rlsjdntz createInfoForContextRegistry (Lnet/minecraft/unmapped/C_tqxyjqsk;)Lnet/minecraft/unmapped/C_piadqmzm$C_sznlrmbg; + METHOD m_utyouqei load (Lnet/minecraft/unmapped/C_ratuauki$C_kprmzsuj;Lnet/minecraft/unmapped/C_wqxmvzdq;Ljava/util/List;)Lnet/minecraft/unmapped/C_wqxmvzdq$C_ggmzysrd; CLASS C_kfdvqtiv ContentLoader CLASS C_qpshoosu DecodingData METHOD m_qxfeaogn createRegistryAndLoader (Lcom/mojang/serialization/Lifecycle;Ljava/util/Map;)Lnet/minecraft/unmapped/C_ratuauki$C_kfdvqtiv; diff --git a/mappings/net/minecraft/registry/ReloadableRegistries.mapping b/mappings/net/minecraft/registry/ReloadableRegistries.mapping new file mode 100644 index 0000000000..f435c5de07 --- /dev/null +++ b/mappings/net/minecraft/registry/ReloadableRegistries.mapping @@ -0,0 +1,21 @@ +CLASS net/minecraft/unmapped/C_ihseotxf net/minecraft/registry/ReloadableRegistries + FIELD f_mtejqtll GSON Lcom/google/gson/Gson; + FIELD f_tziodfyh DEFAULT_REGISTRATION_INFO Lnet/minecraft/unmapped/C_jhxfjegj; + METHOD m_nnifhcon reload (Lnet/minecraft/unmapped/C_bcpxdrik;Lnet/minecraft/unmapped/C_tmnrpasf;Ljava/util/concurrent/Executor;)Ljava/util/concurrent/CompletableFuture; + METHOD m_spiepebv withUpdatedRegistries (Lnet/minecraft/unmapped/C_bcpxdrik;Ljava/util/List;)Lnet/minecraft/unmapped/C_bcpxdrik; + ARG 0 registryManager + METHOD m_uxxtvsuw scheduleParsing (Lnet/minecraft/unmapped/C_gvzqwcwq;Lnet/minecraft/unmapped/C_piadqmzm;Lnet/minecraft/unmapped/C_tmnrpasf;Ljava/util/concurrent/Executor;)Ljava/util/concurrent/CompletableFuture; + ARG 0 type + ARG 1 ops + METHOD m_wrwpezud apply (Lnet/minecraft/unmapped/C_bcpxdrik;Ljava/util/List;)Lnet/minecraft/unmapped/C_bcpxdrik; + ARG 0 registryManager + METHOD m_xrkbdssc validateRegistry (Lnet/minecraft/unmapped/C_eumtgsbp;Lnet/minecraft/unmapped/C_gvzqwcwq;Lnet/minecraft/unmapped/C_wqxmvzdq;)V + ARG 0 reporter + ARG 1 lootDataType + CLASS C_eetbager TagAwareLookupWrapper + CLASS C_hnvzydbq Holder + FIELD f_uxidcgck registryManager Lnet/minecraft/unmapped/C_wqxmvzdq$C_ggmzysrd; + METHOD m_lrvgvrfo getIds (Lnet/minecraft/unmapped/C_xhhleach;)Ljava/util/Collection; + METHOD m_ootvrhbi getRegistryManager ()Lnet/minecraft/unmapped/C_wqxmvzdq$C_ggmzysrd; + METHOD m_rgbjhfac getLootTable (Lnet/minecraft/unmapped/C_xhhleach;)Lnet/minecraft/unmapped/C_inwsuliy; + METHOD m_ssljecqh createLookupProvider ()Lnet/minecraft/unmapped/C_pzdchrcy$C_pbvqpmst;