2015-08-29 14:33:25 +02:00
|
|
|
/*
|
2016-05-16 22:52:27 +02:00
|
|
|
* This file ("InitVillager.java") is part of the Actually Additions mod for Minecraft.
|
2015-08-29 14:33:25 +02:00
|
|
|
* It is created and owned by Ellpeck and distributed
|
|
|
|
* under the Actually Additions License to be found at
|
2016-05-16 22:52:27 +02:00
|
|
|
* http://ellpeck.de/actaddlicense
|
2015-08-29 14:33:25 +02:00
|
|
|
* View the source code at https://github.com/Ellpeck/ActuallyAdditions
|
|
|
|
*
|
2016-05-16 22:54:42 +02:00
|
|
|
* © 2015-2016 Ellpeck
|
2015-08-29 14:33:25 +02:00
|
|
|
*/
|
|
|
|
|
2016-01-05 04:47:35 +01:00
|
|
|
package de.ellpeck.actuallyadditions.mod.gen;
|
2015-04-06 15:51:59 +02:00
|
|
|
|
2016-01-05 04:47:35 +01:00
|
|
|
import de.ellpeck.actuallyadditions.mod.config.values.ConfigBoolValues;
|
|
|
|
import de.ellpeck.actuallyadditions.mod.util.ModUtil;
|
2015-04-06 15:51:59 +02:00
|
|
|
import net.minecraft.world.gen.structure.MapGenStructureIO;
|
2016-05-07 12:55:59 +02:00
|
|
|
import net.minecraftforge.fml.common.registry.VillagerRegistry;
|
2016-11-01 20:47:37 +01:00
|
|
|
import net.minecraftforge.fml.common.registry.VillagerRegistry.VillagerCareer;
|
|
|
|
import net.minecraftforge.fml.common.registry.VillagerRegistry.VillagerProfession;
|
2015-04-06 15:51:59 +02:00
|
|
|
|
2016-06-17 23:50:38 +02:00
|
|
|
public final class InitVillager{
|
2015-04-06 15:51:59 +02:00
|
|
|
|
2016-11-01 20:47:37 +01:00
|
|
|
public static VillagerProfession jamProfession;
|
2015-04-06 15:51:59 +02:00
|
|
|
|
|
|
|
public static void init(){
|
2015-07-01 21:32:48 +02:00
|
|
|
ModUtil.LOGGER.info("Initializing Village Addons...");
|
2015-04-06 15:51:59 +02:00
|
|
|
|
2015-04-24 19:22:03 +02:00
|
|
|
if(ConfigBoolValues.JAM_VILLAGER_EXISTS.isEnabled()){
|
2015-06-28 03:12:32 +02:00
|
|
|
initJamVillagePart();
|
|
|
|
}
|
2015-06-29 20:55:56 +02:00
|
|
|
if(ConfigBoolValues.CROP_FIELD_EXISTS.isEnabled()){
|
|
|
|
initCustomCropFieldPart();
|
|
|
|
}
|
2015-06-28 03:12:32 +02:00
|
|
|
}
|
2015-04-06 15:51:59 +02:00
|
|
|
|
2015-06-28 03:12:32 +02:00
|
|
|
private static void initJamVillagePart(){
|
2016-11-20 12:06:28 +01:00
|
|
|
jamProfession = new VillagerProfession(ModUtil.MOD_ID+":jamGuy", ModUtil.MOD_ID+":textures/entity/villager/jam_villager.png", ModUtil.MOD_ID+":textures/entity/villager/jam_villager_zombie.png");
|
2016-11-01 20:47:37 +01:00
|
|
|
VillagerRegistry.instance().register(jamProfession);
|
|
|
|
|
|
|
|
VillagerCareer career = new VillagerCareer(jamProfession, ModUtil.MOD_ID+".jammer");
|
|
|
|
for(int i = 0; i < 3; i++){
|
|
|
|
career.addTrade(i+1, new JamVillagerTradeList());
|
2015-04-06 15:51:59 +02:00
|
|
|
}
|
2015-06-28 03:12:32 +02:00
|
|
|
|
|
|
|
VillagerRegistry.instance().registerVillageCreationHandler(new VillageJamHouseHandler());
|
2016-05-07 12:55:59 +02:00
|
|
|
MapGenStructureIO.registerStructureComponent(VillageComponentJamHouse.class, ModUtil.MOD_ID+":jamHouseStructure");
|
2015-04-06 15:51:59 +02:00
|
|
|
}
|
|
|
|
|
2015-06-29 20:55:56 +02:00
|
|
|
private static void initCustomCropFieldPart(){
|
2016-05-07 12:55:59 +02:00
|
|
|
VillagerRegistry.instance().registerVillageCreationHandler(new VillageCustomCropFieldHandler());
|
2016-04-20 21:39:03 +02:00
|
|
|
MapGenStructureIO.registerStructureComponent(VillageComponentCustomCropField.class, ModUtil.MOD_ID+":customCropFieldStructure");
|
2015-06-29 20:55:56 +02:00
|
|
|
}
|
|
|
|
|
2015-04-06 15:51:59 +02:00
|
|
|
}
|