本文整理汇总了Java中cpw.mods.fml.common.registry.VillagerRegistry类的典型用法代码示例。如果您正苦于以下问题:Java VillagerRegistry类的具体用法?Java VillagerRegistry怎么用?Java VillagerRegistry使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
VillagerRegistry类属于cpw.mods.fml.common.registry包,在下文中一共展示了VillagerRegistry类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getEntityTexture
import cpw.mods.fml.common.registry.VillagerRegistry; //导入依赖的package包/类
/**
* Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
*/
protected ResourceLocation getEntityTexture(EntityVillager p_110775_1_)
{
switch (p_110775_1_.getProfession())
{
case 0:
return farmerVillagerTextures;
case 1:
return librarianVillagerTextures;
case 2:
return priestVillagerTextures;
case 3:
return smithVillagerTextures;
case 4:
return butcherVillagerTextures;
default:
return VillagerRegistry.getVillagerSkin(p_110775_1_.getProfession(), villagerTextures);
}
}
示例2: getStructureVillageWeightedPieceList
import cpw.mods.fml.common.registry.VillagerRegistry; //导入依赖的package包/类
public static List getStructureVillageWeightedPieceList(Random p_75084_0_, int p_75084_1_)
{
ArrayList arraylist = new ArrayList();
arraylist.add(new StructureVillagePieces.PieceWeight(StructureVillagePieces.House1.class, 20, MathHelper.getRandomIntegerInRange(p_75084_0_, 0 + p_75084_1_, 2 + p_75084_1_)));
VillagerRegistry.addExtraVillageComponents(arraylist, p_75084_0_, p_75084_1_);
Iterator iterator = arraylist.iterator();
while (iterator.hasNext())
{
if (((StructureVillagePieces.PieceWeight)iterator.next()).villagePiecesLimit == 0)
{
iterator.remove();
}
}
return arraylist;
}
示例3: preInit
import cpw.mods.fml.common.registry.VillagerRegistry; //导入依赖的package包/类
@EventHandler
public void preInit(FMLPreInitializationEvent event){
if (FMLCommonHandler.instance().getSide().isClient())
{
KeyBindings.SetupKeyBindings();
FMLCommonHandler.instance().bus().register(new KeyInputHandler());
}
ModRegistry.preInit();
NetworkRegistry.INSTANCE.registerGuiHandler(this, new GuiHandler());
//FMLCommonHandler.instance().bus().register(new ClientTickHandler());
System.out.println("[TectoCraft] AutoUpdate System initialized");
for (int i = 0; i < 5; ++i) {
VillagerRegistry.instance().registerVillageTradeHandler(i, new TradeHandler());
}
}
示例4: init
import cpw.mods.fml.common.registry.VillagerRegistry; //导入依赖的package包/类
@Override
public void init() {
super.init();
ModLibs.altarRenderID = RenderingRegistry.getNextAvailableRenderId();
ModLibs.ctRenderID = RenderingRegistry.getNextAvailableRenderId();
RenderAltar altarRenderer = new RenderAltar();
RenderingRegistry.registerBlockHandler(new RenderCTBlock(ModLibs.ctRenderID));
ClientRegistry.bindTileEntitySpecialRenderer(TileAltar.class, altarRenderer);
ClientRegistry.bindTileEntitySpecialRenderer(TileItemAltar.class, altarRenderer);
MinecraftForgeClient.registerItemRenderer(ModItems.spellParchment, new RenderSpellParchment());
MinecraftForgeClient.registerItemRenderer(ModItems.ghostSword, new RenderGhostSword());
MinecraftForgeClient.registerItemRenderer(ModItems.magicRing, new RenderRing());
FMLCommonHandler.instance().bus().register(tickClient);
MinecraftForge.EVENT_BUS.register(renderHandler);
VillagerRegistry.instance().registerVillagerSkin(ModLibs.villagerID, new ResourceLocation(ModLibs.MOD_ID.toLowerCase() + ":textures/entities/manaVillager.png"));
}
示例5: preInit
import cpw.mods.fml.common.registry.VillagerRegistry; //导入依赖的package包/类
public void preInit() {
ModItems.loadItems();
ModBlocks.loadBlocks();
spellRegistry = new SpellRegistry();
ringMaterials = new RingMaterialRegistry();
genManager = new WorldGenHandler();
tickHandler = new TickHandlerCore();
manaHandler = new ManaHandler();
pageUtil = new PageUtil();
infusionRegistry = new InfusionRegistry();
renderHandler = new RenderHandler();
tickClient = new TickHandlerClient();
VillagerRegistry.instance().registerVillagerId(ModLibs.villagerID);
VillagerRegistry.instance().registerVillageTradeHandler(ModLibs.villagerID, new RingVillager());
}
示例6: getStructureVillageWeightedPieceList
import cpw.mods.fml.common.registry.VillagerRegistry; //导入依赖的package包/类
public static List getStructureVillageWeightedPieceList(Random p_75084_0_, int p_75084_1_)
{
ArrayList arraylist = new ArrayList();
arraylist.add(new StructureVillagePieces.PieceWeight(StructureVillagePieces.House4Garden.class, 4, MathHelper.getRandomIntegerInRange(p_75084_0_, 2 + p_75084_1_, 4 + p_75084_1_ * 2)));
arraylist.add(new StructureVillagePieces.PieceWeight(StructureVillagePieces.Church.class, 20, MathHelper.getRandomIntegerInRange(p_75084_0_, 0 + p_75084_1_, 1 + p_75084_1_)));
arraylist.add(new StructureVillagePieces.PieceWeight(StructureVillagePieces.House1.class, 20, MathHelper.getRandomIntegerInRange(p_75084_0_, 0 + p_75084_1_, 2 + p_75084_1_)));
arraylist.add(new StructureVillagePieces.PieceWeight(StructureVillagePieces.WoodHut.class, 3, MathHelper.getRandomIntegerInRange(p_75084_0_, 2 + p_75084_1_, 5 + p_75084_1_ * 3)));
arraylist.add(new StructureVillagePieces.PieceWeight(StructureVillagePieces.Hall.class, 15, MathHelper.getRandomIntegerInRange(p_75084_0_, 0 + p_75084_1_, 2 + p_75084_1_)));
arraylist.add(new StructureVillagePieces.PieceWeight(StructureVillagePieces.Field1.class, 3, MathHelper.getRandomIntegerInRange(p_75084_0_, 1 + p_75084_1_, 4 + p_75084_1_)));
arraylist.add(new StructureVillagePieces.PieceWeight(StructureVillagePieces.Field2.class, 3, MathHelper.getRandomIntegerInRange(p_75084_0_, 2 + p_75084_1_, 4 + p_75084_1_ * 2)));
arraylist.add(new StructureVillagePieces.PieceWeight(StructureVillagePieces.House2.class, 15, MathHelper.getRandomIntegerInRange(p_75084_0_, 0, 1 + p_75084_1_)));
arraylist.add(new StructureVillagePieces.PieceWeight(StructureVillagePieces.House3.class, 8, MathHelper.getRandomIntegerInRange(p_75084_0_, 0 + p_75084_1_, 3 + p_75084_1_ * 2)));
VillagerRegistry.addExtraVillageComponents(arraylist, p_75084_0_, p_75084_1_);
Iterator iterator = arraylist.iterator();
while (iterator.hasNext())
{
if (((StructureVillagePieces.PieceWeight)iterator.next()).villagePiecesLimit == 0)
{
iterator.remove();
}
}
return arraylist;
}
示例7: getEntityTexture
import cpw.mods.fml.common.registry.VillagerRegistry; //导入依赖的package包/类
protected ResourceLocation getEntityTexture(EntityVillager p_110775_1_)
{
switch (p_110775_1_.getProfession())
{
case 0:
return farmerVillagerTextures;
case 1:
return librarianVillagerTextures;
case 2:
return priestVillagerTextures;
case 3:
return smithVillagerTextures;
case 4:
return butcherVillagerTextures;
default:
return VillagerRegistry.getVillagerSkin(p_110775_1_.getProfession(), villagerTextures);
}
}
示例8: getStructureVillageWeightedPieceList
import cpw.mods.fml.common.registry.VillagerRegistry; //导入依赖的package包/类
public static List getStructureVillageWeightedPieceList(Random par0Random, int par1)
{
ArrayList arraylist = new ArrayList();
arraylist.add(new StructureVillagePieceWeight(ComponentVillageHouse4_Garden.class, 4, MathHelper.getRandomIntegerInRange(par0Random, 2 + par1, 4 + par1 * 2)));
arraylist.add(new StructureVillagePieceWeight(ComponentVillageChurch.class, 20, MathHelper.getRandomIntegerInRange(par0Random, 0 + par1, 1 + par1)));
arraylist.add(new StructureVillagePieceWeight(ComponentVillageHouse1.class, 20, MathHelper.getRandomIntegerInRange(par0Random, 0 + par1, 2 + par1)));
arraylist.add(new StructureVillagePieceWeight(ComponentVillageWoodHut.class, 3, MathHelper.getRandomIntegerInRange(par0Random, 2 + par1, 5 + par1 * 3)));
arraylist.add(new StructureVillagePieceWeight(ComponentVillageHall.class, 15, MathHelper.getRandomIntegerInRange(par0Random, 0 + par1, 2 + par1)));
arraylist.add(new StructureVillagePieceWeight(ComponentVillageField.class, 3, MathHelper.getRandomIntegerInRange(par0Random, 1 + par1, 4 + par1)));
arraylist.add(new StructureVillagePieceWeight(ComponentVillageField2.class, 3, MathHelper.getRandomIntegerInRange(par0Random, 2 + par1, 4 + par1 * 2)));
arraylist.add(new StructureVillagePieceWeight(ComponentVillageHouse2.class, 15, MathHelper.getRandomIntegerInRange(par0Random, 0, 1 + par1)));
arraylist.add(new StructureVillagePieceWeight(ComponentVillageHouse3.class, 8, MathHelper.getRandomIntegerInRange(par0Random, 0 + par1, 3 + par1 * 2)));
VillagerRegistry.addExtraVillageComponents(arraylist, par0Random, par1);
Iterator iterator = arraylist.iterator();
while (iterator.hasNext())
{
if (((StructureVillagePieceWeight)iterator.next()).villagePiecesLimit == 0)
{
iterator.remove();
}
}
return arraylist;
}
示例9: func_110902_a
import cpw.mods.fml.common.registry.VillagerRegistry; //导入依赖的package包/类
protected ResourceLocation func_110902_a(EntityVillager par1EntityVillager)
{
switch (par1EntityVillager.getProfession())
{
case 0:
return farmerVillagerTextures;
case 1:
return librarianVillagerTextures;
case 2:
return priestVillagerTextures;
case 3:
return smithVillagerTextures;
case 4:
return butcherVillagerTextures;
default:
return VillagerRegistry.getVillagerSkin(par1EntityVillager.getProfession(), villagerTextures);
}
}
示例10: registerRenderers
import cpw.mods.fml.common.registry.VillagerRegistry; //导入依赖的package包/类
@Override
public void registerRenderers() {
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityPipe.class, new TileEntityRenderPipe());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityCable.class, new TileEntityRenderCable());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityShell.class, new TileEntityRenderShell());
MinecraftForgeClient.registerItemRenderer(ModArmour.shell, new CustomItemRenderer(new TileEntityRenderShell(), new TileEntityShell()));
RenderingRegistry.registerEntityRenderingHandler(EntityMummy.class, new RenderMummy(new ModelZombie(), 0));;
RenderingRegistry.registerEntityRenderingHandler(EntityPirate.class, new RenderPirate(new ModelPirate(), 0));;
RenderingRegistry.registerEntityRenderingHandler(EntitySenthant.class, new RenderSenthant(new ModelSenthant(), 0));;
RenderingRegistry.registerEntityRenderingHandler(EntityTurtle.class, new RenderTurtle(new ModelTurtle(), 0));;
RenderingRegistry.registerEntityRenderingHandler(EntityBear.class, new RenderBear(new ModelBear(), 0));;
RenderingRegistry.registerEntityRenderingHandler(EntityPanda.class, new RenderPanda(new ModelBear(), 0));;
RenderingRegistry.registerEntityRenderingHandler(EntityGrawquat.class, new RenderGrawquat(new ModelGrawquat(), 0));;
RenderingRegistry.registerEntityRenderingHandler(EntityLyekhwrone.class, new RenderLyekhwrone(new ModelLyekhwrone(), 0));;
RenderingRegistry.registerEntityRenderingHandler(EntityLyekstone.class, new RenderSnowball(ModItems.lyekstone));
VillagerRegistry.instance().registerVillagerSkin(56329, new ResourceLocation(Reference.MOD_ID, "textures/entity/villager.png"));
}
示例11: init
import cpw.mods.fml.common.registry.VillagerRegistry; //导入依赖的package包/类
@Mod.EventHandler
public void init(FMLInitializationEvent event) {
ModBlocksPreItems.init();
ModMisc.init();
ModOreDictRegister.init();
ModTileEntities.init();
ModAchievements.init();
ModBiomes.init();
ModEntities.init();
ModPotions.init();
ModDungeonLoot.init();
proxy.registerRenderers();
GameRegistry.registerFuelHandler(new FuelHandler());
GameRegistry.registerWorldGenerator(new ModWorldGen(), 0);
VillagerRegistry.instance().registerVillageCreationHandler(new VillageHouseHandler());
MapGenStructureIO.func_143031_a(VillageStructureHouse.class, Reference.MOD_ID+":HouseStructure");
MinecraftForge.EVENT_BUS.register(BucketHandler.INSTANCE);
MinecraftForge.EVENT_BUS.register(new ChatHandler());
MinecraftForge.TERRAIN_GEN_BUS.register(new FlowerHandler());
LogHelper.info("World Gen initialised successfully!");
NetworkRegistry.INSTANCE.registerGuiHandler(this, new GuiHandler());
}
示例12: preInit
import cpw.mods.fml.common.registry.VillagerRegistry; //导入依赖的package包/类
@Mod.EventHandler
public void preInit(FMLPreInitializationEvent event) {
TechnicalBlock.registerBlocks();
TechnicalItem.registerItems();
TechnicalTools.registerTools();
GameRegistry.registerWorldGenerator(this.eventWorldGen, 0);
proxy.registerTileEntities();
((Item) Item.itemRegistry.getObject("water_bucket")).setMaxStackSize(16);
for (int i = 0; i < 5; ++i) {
VillagerRegistry.instance().registerVillageTradeHandler(i, new TradeHandler());
}
Potion[] potionTypes;
for (Field f : Potion.class.getDeclaredFields()) {
f.setAccessible(true);
try {
if (f.getName().equals("potionTypes") || f.getName().equals("field_76425_a")) {
Field modfield = Field.class.getDeclaredField("modifiers");
modfield.setAccessible(true);
modfield.setInt(f, f.getModifiers() & ~Modifier.FINAL);
potionTypes = (Potion[]) f.get(null);
final Potion[] newPotionTypes = new Potion[256];
System.arraycopy(potionTypes, 0, newPotionTypes, 0, potionTypes.length);
f.set(null, newPotionTypes);
}
} catch (Exception e) {
e.printStackTrace();
}
}
MinecraftForge.EVENT_BUS.register(new TechnicalEventHooks());
MinecraftForge.ORE_GEN_BUS.register(new TechnicalOreGenEventHooks());
}
示例13: load
import cpw.mods.fml.common.registry.VillagerRegistry; //导入依赖的package包/类
public void load()
{
BlockRegister.load();
ItemRegister.load();
CreativesTabsRegister.load();
CreativesTabsRegister.loadAll();
EntityRegister.load();
CraftRegister.load();
DimensionManager.registerProviderType(Main.DIM_ID, WorldProviderMagic.class, true);
DimensionManager.registerDimension(Main.DIM_ID, Main.DIM_ID);
for (Dungeon d : Main.DUNGEONS)
{
DimensionManager.registerProviderType(d.DIM_ID, WorldProviderDungeon.class, true);
DimensionManager.registerDimension(d.DIM_ID, d.DIM_ID);
}
GameRegistry.registerWorldGenerator(new WorldGenChestElficStaff(), 0);
GameRegistry.registerWorldGenerator(new WorldGenOrc(), 0);
GameRegistry.registerWorldGenerator(new WorldGenFloatingHouse(), 0);
GameRegistry.registerWorldGenerator(new WorldGenFloatingHouse2(), 0);
GameRegistry.registerWorldGenerator(new WorldGenFloatingDungeon(), 0);
GameRegistry.registerWorldGenerator(new WorldGenVillage(), 0);
ServerPlayerAPI.register("Magic Crusade", ServerPlayerBaseMagic.class);
for (int i = 0; i < 5; ++i)
VillagerRegistry.instance().registerVillageTradeHandler(i, new TradeHandler());
this.register_event(new ServerEvent());
this.register_event(new JoueurEvent());
this.register_event(new LivingEntityEvent());
AchievementList.load();
}
示例14: init
import cpw.mods.fml.common.registry.VillagerRegistry; //导入依赖的package包/类
public static void init() {
BarWenchCreationHandler barWench = new BarWenchCreationHandler();
VillagerRegistry.instance().registerVillageTradeHandler(BarWenchCreationHandler.BAR_WENCH, barWench);
VillagerRegistry.instance().registerVillagerId(BarWenchCreationHandler.BAR_WENCH);
texture = new ResourceLocation(REFERENCE.MODID + ":textures/entity/barwench.png");
VillagerRegistry.instance().registerVillagerSkin(BarWenchCreationHandler.BAR_WENCH, texture);
}
示例15: init
import cpw.mods.fml.common.registry.VillagerRegistry; //导入依赖的package包/类
public static void init() {
VillagerBakeryTradeHandler baker = new VillagerBakeryTradeHandler();
VillagerRegistry.instance().registerVillageTradeHandler(VillagerBakeryTradeHandler.BAKER, baker);
VillagerRegistry.instance().registerVillagerId(VillagerBakeryTradeHandler.BAKER);
texture = new ResourceLocation(REFERENCE.MODID + ":textures/entity/baker.png");
VillagerRegistry.instance().registerVillagerSkin(VillagerBakeryTradeHandler.BAKER, texture);
}