本文整理匯總了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");
}