本文整理汇总了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;未经允许,请勿转载。 |
请发表评论