• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java Type类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中cpw.mods.fml.common.registry.GameRegistry.Type的典型用法代码示例。如果您正苦于以下问题:Java Type类的具体用法?Java Type怎么用?Java Type使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Type类属于cpw.mods.fml.common.registry.GameRegistry包,在下文中一共展示了Type类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: missingMapping

import cpw.mods.fml.common.registry.GameRegistry.Type; //导入依赖的package包/类
@EventHandler
public void missingMapping(FMLMissingMappingsEvent event) {
	for(MissingMapping m: event.get()) {
		// This bug was introduced along with Chisel 1.5.2, and was fixed in 1.5.3.
		// Ice Stairs were called null.0-7 instead of other names, and Marble/Limestone stairs did not exist.
		// This fixes the bug.
		if(m.name.startsWith("null.") && m.name.length() == 6 && m.type == Type.BLOCK) {
			m.setAction(Action.WARN);
		}
	}
}
 
开发者ID:asiekierka,项目名称:Chisel-1.7.2,代码行数:12,代码来源:Chisel.java


示例2: missingMapping

import cpw.mods.fml.common.registry.GameRegistry.Type; //导入依赖的package包/类
@EventHandler
public void missingMapping(FMLMissingMappingsEvent event) {
	BlockNameConversion.init();

	for (MissingMapping m : event.get()) {
		// This bug was introduced along with Chisel 1.5.2, and was fixed in
		// 1.5.3.
		// Ice Stairs were called null.0-7 instead of other names, and
		// Marble/Limestone stairs did not exist.
		// This fixes the bug.
		if (m.name.startsWith("null.") && m.name.length() == 6 && m.type == Type.BLOCK) {
			m.warn();// (Action.WARN);
		}

		// Fix mapping of snakestoneSand, snakestoneStone, limestoneStairs,
		// marbleStairs when loading an old (1.5.4) save
		else if (m.type == Type.BLOCK) {
			final Block block = BlockNameConversion.findBlock(m.name);

			if (block != null) {
				m.remap(block);
				FMLLog.getLogger().info("Remapping block " + m.name + " to " + General.getName(block));
			} else
				FMLLog.getLogger().warn("Block " + m.name + " could not get remapped.");
		} else if (m.type == Type.ITEM) {
			final Item item = BlockNameConversion.findItem(m.name);

			if (item != null) {
				m.remap(item);
				FMLLog.getLogger().info("Remapping item " + m.name + " to " + General.getName(item));

			} else
				FMLLog.getLogger().warn("Item " + m.name + " could not get remapped.");
		}
	}
}
 
开发者ID:Chisel-2,项目名称:Chisel-2,代码行数:37,代码来源:Chisel.java


示例3: init

import cpw.mods.fml.common.registry.GameRegistry.Type; //导入依赖的package包/类
@EventHandler
public void init(FMLInitializationEvent event) {
    try {
        GameRegistry.addSubstitutionAlias("minecraft:anvil", Type.BLOCK, BetterAnvil.ANVIL);
        GameRegistry.addSubstitutionAlias("minecraft:anvil", Type.ITEM, new ItemAnvilBlock(BetterAnvil.ANVIL));
    } catch(ExistingSubstitutionException e) {
        e.printStackTrace();
    }
    MinecraftForge.EVENT_BUS.register(EventHandlerBA.INSTANCE);

    //register gui
    NetworkRegistry.INSTANCE.registerGuiHandler(BetterAnvil.instance, new GuiHandler());
}
 
开发者ID:vdvman1,项目名称:betterAnvil-forge,代码行数:14,代码来源:BetterAnvil.java


示例4: registerSubstitutionAlias

import cpw.mods.fml.common.registry.GameRegistry.Type; //导入依赖的package包/类
void registerSubstitutionAlias(String nameToSubstitute, Type type, Object toReplace) throws ExistingSubstitutionException
{
    type.getRegistry().addSubstitutionAlias(Loader.instance().activeModContainer().getModId(),nameToSubstitute, toReplace);
    type.getRegistry().activateSubstitution(nameToSubstitute);
}
 
开发者ID:SchrodingersSpy,项目名称:TRHS_Club_Mod_2016,代码行数:6,代码来源:GameData.java



注:本文中的cpw.mods.fml.common.registry.GameRegistry.Type类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Roster类代码示例发布时间:2022-05-22
下一篇:
Java IFormatter2类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap