mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-21 12:42:26 +00:00
[1.11.2] Fixed Zombie Villagers not setting and getting professions correctly (#3678)
This commit is contained in:
1 parent
460a2189d6
commit
93a4e13837
7 files changed
+97
-8
No files matched your search
@@ -37,6 +37,7 @@ import net.minecraft.world.gen.structure.StructureComponent;
|
||||
import net.minecraft.world.gen.structure.StructureVillagePieces;
|
||||
import net.minecraft.world.gen.structure.StructureVillagePieces.PieceWeight;
|
||||
import net.minecraft.world.gen.structure.StructureVillagePieces.Village;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry.ObjectHolder;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
@@ -46,6 +47,8 @@ import javax.annotation.Nullable;
|
||||
public class VillagerRegistry
|
||||
{
|
||||
public static final ResourceLocation PROFESSIONS = new ResourceLocation("minecraft:villagerprofessions");
|
||||
@ObjectHolder("minecraft:farmer")
|
||||
public static final VillagerProfession FARMER = null;
|
||||
private static final VillagerRegistry INSTANCE = new VillagerRegistry();
|
||||
|
||||
private Map<Class<?>, IVillageCreationHandler> villageCreationHandlers = Maps.newHashMap();
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
package net.minecraftforge.test;
|
||||
|
||||
import net.minecraftforge.event.RegistryEvent;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import net.minecraftforge.fml.common.Mod.EventBusSubscriber;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.registry.VillagerRegistry.VillagerCareer;
|
||||
import net.minecraftforge.fml.common.registry.VillagerRegistry.VillagerProfession;
|
||||
|
||||
@Mod(modid = "professiontest", name = "ProfessionTest2000", version = "1.0", acceptableRemoteVersions = "*")
|
||||
@EventBusSubscriber
|
||||
public class VillagerProfessionTest
|
||||
{
|
||||
@SubscribeEvent
|
||||
public static void registerVillagers(RegistryEvent.Register<VillagerProfession> event)
|
||||
{
|
||||
VillagerProfession profession = new VillagerProfession("professiontest:test_villager", "professiontest:textures/entity/test_villager.png", "professiontest:textures/entity/zombie_test_villager.png");
|
||||
new VillagerCareer(profession, "professiontest:test_villager");
|
||||
event.getRegistry().register(profession);
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.6 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 3.1 KiB |
Reference in new issue
Block a user