Comments (2)
While this gets fixed, you can try doing something like this:
- Create the Armor Material before registering the items
- Register an armor piece (like an helmet) providing an Holder.direct(yourArmorMaterial) as the ArmorMaterial Holder
It's not the best solution but at least it works for now. Of course when this will get patched I recommend switching to the DeferredRegister methods and using the proper RegistryObjects
from minecraftforge.
So, it is an issue with the way I sort the registry fire events. Currently it's being sorted by the first time register is called.
Which usually works, except in cases where the first entry in the registry doesn't force another registry to be initialized, but the nth entry does.
Unfortunately, there is no generic "we're done making all vanilla entries" event in a registry. At least not one that isn't a stagnant order. So we can't gather the order on last register.
For now i've made a solution that works for this simple test case:
private static final DeferredRegister<ArmorMaterial> ARMORS = deferred(Registries.ARMOR_MATERIAL);
private static final RegistryObject<ArmorMaterial> ARMOR = ARMORS.register("test", () -> {
return new ArmorMaterial(
Collections.emptyMap(),
1,
SoundEvents.ARMOR_EQUIP_CHAIN,
() -> Ingredient.of(Items.IRON_INGOT),
Collections.emptyList(),
1.0f, 1.0f
);
});
private static final DeferredRegister<Item> ITEMS = deferred(Registries.ITEM);
private static final RegistryObject<Item> ARMOR_CHEST = ITEMS.register("test_chest", () -> {
return new ArmorItem(
ARMOR.getHolder().orElseThrow(),
ArmorItem.Type.CHESTPLATE,
new Item.Properties().durability(ArmorItem.Type.CHESTPLATE.getDurability(15))
);
});
Eventually I need to go in and simplify the registry system yet again. I really wish Mojang would get their crap together and solve the few minor things that make all our registry hooks necessary. Namely, ID syncing between network and saves for non-data driven registries.
from minecraftforge.
Related Issues (20)
- [SECURITY] Vulnerabilities in Forge 47.2.X HOT 1
- [1.20.6] ATs still use SRG mappings HOT 1
- Vault Block crash in 1.20.6 HOT 2
- [1.20.6] getArmorTexture bug HOT 1
- update mcp for 1.20.6 HOT 1
- finalizeSpawn() is always passed null SpawnGroupData
- forge 1.20.6 patches the stencil enable into the wrong spot
- [1.20.6] Shield does not work HOT 3
- Forge Crashes HOT 1
- Crash when mods folder contains jar file without mods.toml HOT 6
- The game crashed whilst unexpected error Error: java.lang.IllegalStateException: Missing registry: ResourceKey[minecraft:root / minecraft:dimension_type] HOT 1
- [1.20.6] Potion Brewing is broken
- [1.20.6] Cancelling MobSpawnEvent.FinalizeSpawn for a spawner causes NullPointerException
- 1.20.1 Forge Redstone differs from Vanilla and Fabric HOT 3
- [1.20.6] Game crashes when reloading a world that uses custom placed features HOT 2
- The drawing order of page numbers in CreativeModeInventoryScreen is incorrect HOT 3
- EntityInteractSpecific event isn't posted on the server side anymore HOT 3
- [1.20.6] Forge fails to load brigadier classes in time for RegisterCommandsEvent leading to mod crashes HOT 2
- LivingAttackEvent working inconsistently with Entity.setDeltaMovement when the event is cancelled. HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from minecraftforge.