本文整理汇总了Java中net.minecraftforge.fml.common.event.FMLInitializationEvent.getSide方法的典型用法代码示例。如果您正苦于以下问题:Java FMLInitializationEvent.getSide方法的具体用法?Java FMLInitializationEvent.getSide怎么用?Java FMLInitializationEvent.getSide使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraftforge.fml.common.event.FMLInitializationEvent
的用法示例。
在下文中一共展示了FMLInitializationEvent.getSide方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: init
import net.minecraftforge.fml.common.event.FMLInitializationEvent; //导入方法依赖的package包/类
@EventHandler
public void init(FMLInitializationEvent event) {
// init
MinecraftForge.EVENT_BUS.register(this);
scriptyBlock = new ScriptyBlock();
if (event.getSide() == Side.CLIENT) {
RenderItem renderItem = Minecraft.getMinecraft().getRenderItem();
renderItem.getItemModelMesher().register(Item.getItemFromBlock(scriptyBlock), 0, new ModelResourceLocation("scripty:" + scriptyBlock.getName(), "inventory"));
}
NetworkRegistry.INSTANCE.registerGuiHandler(this, gui);
}
示例2: init
import net.minecraftforge.fml.common.event.FMLInitializationEvent; //导入方法依赖的package包/类
@Mod.EventHandler
public void init(FMLInitializationEvent event) {
switch (event.getSide()) {
case CLIENT: {
// add shutdown hook to serialize all binds
Runtime.getRuntime().addShutdownHook(new Thread(() -> getModManager().forEach(BaseMod::unload)));
// registerAll mod events
getModManager().forEach(BaseMod::load);
break;
}
default:
break;
}
}
示例3: init
import net.minecraftforge.fml.common.event.FMLInitializationEvent; //导入方法依赖的package包/类
@Mod.EventHandler
public void init(FMLInitializationEvent event) {
// Don't run client-side, it makes kill not kill the whole client.
if (event.getSide() != Side.SERVER) return;
sig("TERM");
sig("INT");
sig("HUP");
}