当前位置: 首页>>代码示例>>Java>>正文


Java FMLServerAboutToStartEvent类代码示例

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


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

示例1: applyStateEventPatch

import net.minecraftforge.fml.common.event.FMLServerAboutToStartEvent; //导入依赖的package包/类
@Override
public <T extends FMLStateEvent> boolean applyStateEventPatch(T e) {
	FMLServerAboutToStartEvent event = (FMLServerAboutToStartEvent) e;
	Field commandManager = ReflectionHelper.getField(ObfuscatedField.MinecraftServer_commandManager);
	
	if (commandManager != null) {
		try {
			commandManager.set(event.getServer(), new ServerCommandManager(event.getServer(), event.getServer().getCommandManager()));
			
			PatchManager.instance().getGlobalAppliedPatches().setPatchSuccessfullyApplied(this.displayName, true);
			return true;
		}
		catch (Exception ex) {
			PatchManager.instance().getGlobalAppliedPatches().setPatchSuccessfullyApplied(this.displayName, false);
			return false;
		}
	}
	else {
		PatchManager.instance().getGlobalAppliedPatches().setPatchSuccessfullyApplied(this.displayName, false);
		return false;
	}
}
 
开发者ID:MrNobody98,项目名称:morecommands,代码行数:23,代码来源:PatchServerCommandManager.java

示例2: applyServerStartPatches

import net.minecraftforge.fml.common.event.FMLServerAboutToStartEvent; //导入依赖的package包/类
private boolean applyServerStartPatches(FMLServerAboutToStartEvent event) {
	boolean success = networkManagers == null ? false : ReflectionHelper.set(ObfuscatedField.NetworkSystem_networkManagers, 
			networkManagers, event.getServer().getNetworkSystem(), Collections.<NetworkManager>synchronizedList(new ArrayList<NetworkManager>() {
			
			private static final long serialVersionUID = 498247631553542876L;
			
			@Override
			public boolean add(NetworkManager manager) {
				PatchEntityPlayerSP.this.onNetworkManagerAdd(manager);
				return super.add(manager);
			}
	}));
	
	PatchManager.instance().getGlobalAppliedPatches().setPatchSuccessfullyApplied(this.displayName, success);
	return success;
}
 
开发者ID:MrNobody98,项目名称:morecommands,代码行数:17,代码来源:PatchEntityPlayerSP.java

示例3: beforeServerStart

import net.minecraftforge.fml.common.event.FMLServerAboutToStartEvent; //导入依赖的package包/类
@Mod.EventHandler
public void beforeServerStart(FMLServerAboutToStartEvent event) {
    ICommandManager manager = event.getServer().getCommandManager();
    if (manager instanceof CommandHandler) {
        ((CommandHandler) manager).registerCommand(new DebugDamageCommand());
    }
}
 
开发者ID:ichttt,项目名称:FirstAid,代码行数:8,代码来源:FirstAid.java

示例4: serverPreInit

import net.minecraftforge.fml.common.event.FMLServerAboutToStartEvent; //导入依赖的package包/类
@Mod.EventHandler
public void serverPreInit(FMLServerAboutToStartEvent event) {
	// System.out.println("Starting server");
	
	if (!event.getServer().isDedicatedServer())
		for (WeaponData weapon : MapList.nameToData.values())
			ClientProxy.RegisterWeaponData(weapon);
	
	/*if(event.getSide()==Side.SERVER)
		AchievementPage.registerAchievementPage(new TF2Achievements());*/
}
 
开发者ID:rafradek,项目名称:Mods,代码行数:12,代码来源:TF2weapons.java

示例5: onServerAboutToStart

import net.minecraftforge.fml.common.event.FMLServerAboutToStartEvent; //导入依赖的package包/类
@Mod.EventHandler
public void onServerAboutToStart(FMLServerAboutToStartEvent event)
{
    File worldDir = new File(((AnvilSaveConverter) event.getServer().getActiveAnvilConverter()).savesDirectory, event.getServer().getFolderName());
    DimensionConfig.instance().readDimensionConfig(worldDir);

    // This needs to be here so that we are able to override existing dimensions before
    // they get loaded during server start.
    // But on the other hand we don't want to register the rest of the dimensions yet,
    // otherwise they would be considered 'static dimensions' and get loaded on server start.
    DimensionConfig.instance().registerOverriddenDimensions();
}
 
开发者ID:maruohon,项目名称:justenoughdimensions,代码行数:13,代码来源:JustEnoughDimensions.java

示例6: applyStateEventPatch

import net.minecraftforge.fml.common.event.FMLServerAboutToStartEvent; //导入依赖的package包/类
@Override
public <T extends FMLStateEvent> boolean applyStateEventPatch(T e) {
	FMLServerAboutToStartEvent event = (FMLServerAboutToStartEvent) e;
	
	try {
		Constructor<PlayerList> ctor;
		
		if (event.getServer().isDedicatedServer())
			ctor = (Constructor<PlayerList>) (Constructor<?>) DedicatedPlayerList.class.getDeclaredConstructor(DedicatedServer.class);
		else
			ctor = (Constructor<PlayerList>) (Constructor<?>) IntegratedPlayerList.class.getDeclaredConstructor(IntegratedServer.class);
		
		ctor.setAccessible(true);
		
		if (event.getServer().isDedicatedServer())
			event.getServer().setPlayerList(ctor.newInstance((DedicatedServer) event.getServer()));
		else
			event.getServer().setPlayerList(ctor.newInstance((IntegratedServer) event.getServer()));
	
		PatchManager.instance().getGlobalAppliedPatches().setPatchSuccessfullyApplied(this.displayName, true);
		return true;
	}
	catch (Exception ex) {
		PatchManager.instance().getGlobalAppliedPatches().setPatchSuccessfullyApplied(this.displayName, false);
		return false;
	}
}
 
开发者ID:MrNobody98,项目名称:morecommands,代码行数:28,代码来源:PatchEntityPlayerMP.java

示例7: applyStateEventPatch

import net.minecraftforge.fml.common.event.FMLServerAboutToStartEvent; //导入依赖的package包/类
@Override
public boolean applyStateEventPatch(FMLStateEvent event) {
	if (event instanceof FMLPostInitializationEvent)
		return applyPostInitPatches((FMLPostInitializationEvent) event);
	else if (event instanceof FMLServerAboutToStartEvent)
		return applyServerStartPatches((FMLServerAboutToStartEvent) event);
	else
		throw new IllegalArgumentException("Invalid Event");
}
 
开发者ID:MrNobody98,项目名称:morecommands,代码行数:10,代码来源:PatchEntityPlayerSP.java

示例8: serverAboutToStart

import net.minecraftforge.fml.common.event.FMLServerAboutToStartEvent; //导入依赖的package包/类
@Mod.EventHandler
public void serverAboutToStart(FMLServerAboutToStartEvent event)
{
    // (Re-)Load the config when the server is about to start.
    // This means that in single player you can just save and exit to main menu,
    // make changes to the config and then load a world and have the new configs be used.
    Configs.reload();
}
 
开发者ID:maruohon,项目名称:paintedbiomes,代码行数:9,代码来源:PaintedBiomes.java

示例9: onServerAboutToStartEvent

import net.minecraftforge.fml.common.event.FMLServerAboutToStartEvent; //导入依赖的package包/类
@Mod.EventHandler
public void onServerAboutToStartEvent(FMLServerAboutToStartEvent event)
{
    // Register data fixers
    ModFixs dataFixer = proxy.getDataFixer();
    TileEntityID renames = new TileEntityID();
    dataFixer.registerFix(FixTypes.BLOCK_ENTITY, renames);
    dataFixer.registerFix(FixTypes.ITEM_INSTANCE, renames);
}
 
开发者ID:maruohon,项目名称:enderutilities,代码行数:10,代码来源:EnderUtilities.java

示例10: serverStarting

import net.minecraftforge.fml.common.event.FMLServerAboutToStartEvent; //导入依赖的package包/类
@Mod.EventHandler
public void serverStarting(FMLServerAboutToStartEvent event)
{
    SessionState.serverHasMod = 1;
    SessionState.currentKing = "";

    proxy.initCommands(event.getServer());
}
 
开发者ID:iChun,项目名称:Hats,代码行数:9,代码来源:Hats.java

示例11: serverAboutToStart

import net.minecraftforge.fml.common.event.FMLServerAboutToStartEvent; //导入依赖的package包/类
@EventHandler
public void serverAboutToStart(FMLServerAboutToStartEvent event)
{
   	proxy.serverAboutToStart(event);
}
 
开发者ID:orbwoi,项目名称:UniversalRemote,代码行数:6,代码来源:UniversalRemote.java

示例12: serverAboutToStart

import net.minecraftforge.fml.common.event.FMLServerAboutToStartEvent; //导入依赖的package包/类
@Override
public void serverAboutToStart(FMLServerAboutToStartEvent event) {
	// inject server
   	ServerInjector.InjectIntegrated(FMLCommonHandler.instance().getMinecraftServerInstance());
}
 
开发者ID:orbwoi,项目名称:UniversalRemote,代码行数:6,代码来源:ClientProxy.java

示例13: serverAboutToStart

import net.minecraftforge.fml.common.event.FMLServerAboutToStartEvent; //导入依赖的package包/类
@Override
public void serverAboutToStart(FMLServerAboutToStartEvent event) {
	// inject server
   	ServerInjector.InjectDedicated(FMLCommonHandler.instance().getMinecraftServerInstance());
}
 
开发者ID:orbwoi,项目名称:UniversalRemote,代码行数:6,代码来源:ServerProxy.java

示例14: serverSet

import net.minecraftforge.fml.common.event.FMLServerAboutToStartEvent; //导入依赖的package包/类
@Mod.EventHandler
public void serverSet(FMLServerAboutToStartEvent event) {
    server = event.getServer();
}
 
开发者ID:Baughn,项目名称:signal-catcher,代码行数:5,代码来源:SignalCatcher.java

示例15: serverAboutToStart

import net.minecraftforge.fml.common.event.FMLServerAboutToStartEvent; //导入依赖的package包/类
@EventHandler
public void serverAboutToStart(@Nonnull final FMLServerAboutToStartEvent event) {
	proxy.serverAboutToStart(event);
}
 
开发者ID:OreCruncher,项目名称:DynamicSurroundings,代码行数:5,代码来源:DSurround.java


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