use of org.spongepowered.mod.interfaces.IMixinVillagerProfession in project SpongeForge by SpongePowered.
the class MixinVillagerRegistry method register.
/**
* @author gabizou - July 1st, 2017
* @reason Rewrite the register method to join Sponge's villager registrations with forge's.
* For some auspiciouos reason, when trying to write a redirect, the redirect will fail...
*
* @param prof The profession being registered
* @param id The id being registered
*/
@Overwrite
private void register(VillagerRegistry.VillagerProfession prof, int id) {
this.REGISTRY.register(id, ((IMixinVillagerProfession) prof).getName(), prof);
final int professionId = this.REGISTRY.getIDForObject(prof);
final IMixinVillagerProfession mixinProfession = (IMixinVillagerProfession) prof;
final SpongeProfession spongeProfession = new SpongeProfession(professionId, mixinProfession.getId(), mixinProfession.getProfessionName());
final SpongeProfession registeredProfession = SpongeForgeVillagerRegistry.validateProfession(prof, spongeProfession);
ProfessionRegistryModule.getInstance().registerAdditionalCatalog(registeredProfession);
}
Aggregations