File Details
RIGR 2.0.1
- R
- Jul 1, 2026
- 57.73 KB
- 91
- 1.20.1+1
- Forge
File Name
random_item_generator_resurrected-2.0.1.jar
Supported Versions
- 1.20.1
- 1.20
Curse Maven Snippet
Random Item Generator Resurrected — NeoForge 1.21.1 → Forge 1.20.1 Port
RIGR.java (main mod class)
net.neoforged.*→net.minecraftforge.*package roots throughout.- Removed constructor-injected
IEventBus/ModContainer(a NeoForge-only pattern). Mod constructor is now no-arg; the event bus is retrieved viaFMLJavaModLoadingContext.get().getModEventBus(). DeferredHolder→RegistryObject.DeferredRegister.createBlocks(MODID)/.createItems(MODID)(NeoForge sugar methods) → explicitDeferredRegister.create(ForgeRegistries.BLOCKS, MODID)/create(ForgeRegistries.ITEMS, MODID).- Config registration moved from the injected
ModContainertoModLoadingContext.get().registerConfig(...).
RIGConfig.java
net.neoforged.neoforge.common.ModConfigSpec→net.minecraftforge.common.ForgeConfigSpec(Forge's original, pre-rename class — API is otherwise identical:Builder,push/pop,defineList,buildall unchanged).isEnchantAllowed(Holder<Enchantment>)→isEnchantAllowed(Enchantment). In 1.20.1 enchantments aren't aHolder-wrapped dynamic registry entry; ID lookup now goes throughForgeRegistries.ENCHANTMENTS.getKey(ench).- Legacy alias methods
isEnchantBlacklisted/isEnchantModBlacklistedupdated to match the newEnchantmentparameter type.
ItemBlock.java
- Removed the
Holder<Enchantment>registry-lookup dance for Silk Touch/Fortune. In 1.20.1,Enchantments.SILK_TOUCHandEnchantments.BLOCK_FORTUNEare plainEnchantmentobjects usable directly withEnchantmentHelper.getItemEnchantmentLevel(...). Enchantments.FORTUNE→Enchantments.BLOCK_FORTUNE(renamed in 1.20.1).
EntityBlock.java
net.neoforged.bus.api.SubscribeEvent→net.minecraftforge.eventbus.api.SubscribeEvent.@EventBusSubscriber→@Mod.EventBusSubscriber, with explicitbus = Mod.EventBusSubscriber.Bus.MOD.- Bug fix: Forge's default bus for
@Mod.EventBusSubscriberis the Forge/game bus, not the mod bus.FMLCommonSetupEventonly fires on the mod bus, so without this the listener silently never ran,RANDOM_ENTITIESstayed permanently empty, and — because both the mob-spawn branch and the Silk Touch drop branch were nested insideif (!RANDOM_ENTITIES.isEmpty())— neither mob spawning nor Silk Touch drops ever worked.
- Bug fix: Forge's default bus for
- Same
Holder<Enchantment>→ plainEnchantmentsimplification asItemBlock, in bothonDestroyedByPlayerandgetDrops. Enchantments.FORTUNE→Enchantments.BLOCK_FORTUNE.
EnchantsBlock.java
net.minecraft.tags.EnchantmentTagsdoesn't exist in 1.20.1 (curse tagging is a later-version feature). Curse filtering now usesEnchantment#isCurse().- Enchantment pool no longer comes from
level.registryAccess().registryOrThrow(Registries.ENCHANTMENT)(a dynamic/datapack registry in 1.21). It's now sourced fromForgeRegistries.ENCHANTMENTS.getValues(), since enchantments are a static Forge registry in 1.20.1. EnchantmentInstancenow built directly fromEnchantment, notHolder<Enchantment>.- Same Silk Touch/Fortune simplification and rename as the other blocks.
LootBlock.java
Registries.LOOT_TABLEdoesn't exist in 1.20.1 — loot tables aren't a queryable registry until 1.21. Dynamic enumeration of all registered loot tables was removed entirely.server.getServer().reloadableRegistries().getLootTable(chosen)→server.getServer().getLootData().getLootTable(chosen)(1.20.1'sLootDataManagerAPI).- Pool type changed from
List<ResourceKey<LootTable>>toList<ResourceLocation>to match the above. - Known limitation: the loot pool is now built solely from the hardcoded vanilla fallback list (15 vanilla
chests/...tables). Modded loot tables are never included, since there's no public API in Forge 1.20.1 to enumerate them.
RIGStats.java
net.neoforged.*→net.minecraftforge.*package roots.@EventBusSubscriber→@Mod.EventBusSubscriber, also given explicitbus = Mod.EventBusSubscriber.Bus.MOD—RegisterEventis a mod-bus event, same underlying issue asEntityBlock. Left un-fixed,ITEM_BLOCK_USESetc. would have stayednull, risking an NPE onsp.awardStat(...).ResourceLocation.fromNamespaceAndPath(...)(1.21-only) →new ResourceLocation(...)constructor (deprecated-for-removal in 1.20.1 but functional; produces a compiler warning, not an error).
Cross-cutting notes
- Modded items, mobs, and enchantments are all picked up automatically (Item Block, Entity Block, Enchants Block all read from shared cross-mod registries).
- Modded loot tables are not picked up (Loot Block) — this is a hard limitation of Forge 1.20.1's loot table API, not a bug.
- File structure was kept as one class per block type (not merged) — standard practice, no functional difference.