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


Java ServerTickEvent类代码示例

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


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

示例1: onServerTick

import net.minecraftforge.fml.common.gameevent.TickEvent.ServerTickEvent; //导入依赖的package包/类
@SubscribeEvent
public void onServerTick(ServerTickEvent event)
{
	if (event.phase != Phase.END) { return; }	// Only doing it once
	if (event.side == Side.CLIENT) { return; }

	dayTick += 1;	// Ticking up

	if (dayTick >= Main.getControlRefreshTick())	// A day has passed. Refreshing faction chunk health now
	{
		TerritoryHandler.refreshChunkControl();
		dayTick = 0;	// Reset
	}

	saveTick += 1;

	if (saveTick >= Main.getSaveTick())	// Autosave
	{
		SaveHandler.saveFactionsToFile();
		saveTick = 0;	// Reset
	}
}
 
开发者ID:Domochevsky,项目名称:minecraft-territorialdealings,代码行数:23,代码来源:EventListener.java

示例2: onServerTick

import net.minecraftforge.fml.common.gameevent.TickEvent.ServerTickEvent; //导入依赖的package包/类
@SubscribeEvent
public void onServerTick(ServerTickEvent event)
{
	if (event.phase != Phase.END) { return; }	// Only doing it once
	if (event.side == Side.CLIENT) { return; }
	
	// Chunk upkeep
	if (Main.shouldCheckUpkeep())
	{
		TerritoryHandler.checkUpkeep();
	}
	
	// Chunk control regeneration
	TerritoryHandler.checkChunkControl();
	
	// Autosave
	Main.checkAutoSave();
	
	Main.checkDisplayTick();
}
 
开发者ID:Domochevsky,项目名称:minecraft-territorialdealings,代码行数:21,代码来源:EventListener.java

示例3: onServerTick

import net.minecraftforge.fml.common.gameevent.TickEvent.ServerTickEvent; //导入依赖的package包/类
@SubscribeEvent
public void onServerTick(ServerTickEvent evt) {
    if (!isEnabled() || evt.phase != Phase.START) {
        return;
    }

    // server is ready now
    if (!serverReady.get()) {
        L.info("Server tick sync ready");
        serverReady.set(true);
        serverTick.set(0);
    }

    // wait for client side
    if (!clientReady.get()) {
        return;
    }

    // now sync with the client
    waitFor(evt.side, serverTick, clientTick, serverAhead, clientAhead);
}
 
开发者ID:ata4,项目名称:minema,代码行数:22,代码来源:TickSynchronizer.java

示例4: onServerTick

import net.minecraftforge.fml.common.gameevent.TickEvent.ServerTickEvent; //导入依赖的package包/类
@SubscribeEvent
public void onServerTick(ServerTickEvent event)
{
    if (event.phase == TickEvent.Phase.END)
    {
        return;
    }

    // Once every second
    if (++this.serverTickCounter >= 20)
    {
        this.serverTickCounter = 0;

        ChunkLoading.getInstance().tickChunkTimeouts();
    }

    // This is currently only used for debug tasks, so let's disable it normally
    //TaskScheduler.getInstance().runTasks();

    this.teleportPlayers();
    ++this.playerTickCounter;
}
 
开发者ID:maruohon,项目名称:enderutilities,代码行数:23,代码来源:TickHandler.java

示例5: onTick

import net.minecraftforge.fml.common.gameevent.TickEvent.ServerTickEvent; //导入依赖的package包/类
@SubscribeEvent
public void onTick(ServerTickEvent event) {
    if (event.phase == Phase.START) {
        SessionManager.getInstance().getAllSessions().forEachRemaining(sess -> {
            sess.taskManager.runTasks();
        });
    }
}
 
开发者ID:kenzierocks,项目名称:HardVox,代码行数:9,代码来源:HVSharedProxy.java

示例6: serverTick

import net.minecraftforge.fml.common.gameevent.TickEvent.ServerTickEvent; //导入依赖的package包/类
@SubscribeEvent
public void serverTick(ServerTickEvent event) {
    if (event.phase == Phase.START) {
        WirelessBolt.update(WirelessBolt.serverboltlist);
        RedstoneEtherAddons.server().processTrackers();
    } else {
        RedstoneEtherAddons.server().tickTriangs();
        RedstoneEtherAddons.server().updateREPTimeouts();
    }
}
 
开发者ID:TheCBProject,项目名称:WirelessRedstone,代码行数:11,代码来源:WREventHandler.java

示例7: onServerTick

import net.minecraftforge.fml.common.gameevent.TickEvent.ServerTickEvent; //导入依赖的package包/类
@Override
protected void onServerTick(ServerTickEvent ev)
{
    if (this.worldCreated && !this.serverStarted)
    {
        // The server has started ticking - we can set up its state machine,
        // and move on to the next state in our own machine.
        this.serverStarted = true;
        MalmoMod.instance.initIntegratedServer(currentMissionInit()); // Needs to be done from the server thread.
        episodeHasCompleted(ClientState.WAITING_FOR_SERVER_READY);
    }
}
 
开发者ID:Yarichi,项目名称:Proyecto-DASI,代码行数:13,代码来源:ClientStateMachine.java

示例8: onServerTick

import net.minecraftforge.fml.common.gameevent.TickEvent.ServerTickEvent; //导入依赖的package包/类
@Override
protected void onServerTick(TickEvent.ServerTickEvent ev)
{
    try
    {
        checkForMissionCommand();
    }
    catch (Exception e)
    {
        // TODO: What now?
        e.printStackTrace();
    }
}
 
开发者ID:Yarichi,项目名称:Proyecto-DASI,代码行数:14,代码来源:ServerStateMachine.java

示例9: onServerTick

import net.minecraftforge.fml.common.gameevent.TickEvent.ServerTickEvent; //导入依赖的package包/类
@SubscribeEvent
public void onServerTick(ServerTickEvent e)
{
	if(counter == 1)
	{
		MinecraftServer server = FMLCommonHandler.instance().getMinecraftServerInstance();
		World world = server.getEntityWorld();
	
		if(world.isRemote == false) 
		{
		
			long totalTime = world.getWorldTime();
			long currentTime = totalTime % 24000;
		
			if(currentTime == 1)
			{
				System.out.println("Time is 0");
				WorldTurn turn = WorldTurn.get(world);
				int currentTurn = turn.advanceTurn();
				System.out.println("New Turn!!  The World Turn is now " + currentTurn);
				ArrayList<EntityPlayerMP> playerList = (ArrayList<EntityPlayerMP>)(world.getMinecraftServer().getServer().getPlayerList().getPlayers());
				for(int i=0; i < playerList.size(); i++)
				{
					EntityPlayer player = playerList.get(i);
					ITurn playerTurn = player.getCapability(CapPlayerTurn.TURN_CAP, null);
					playerTurn.addTurn();
				}
			}
		}
		
		counter = 0;
	}
	else
	{
		counter++;
	}
}
 
开发者ID:stuebz88,项目名称:modName,代码行数:38,代码来源:EventHandlerCommon.java

示例10: onWorldTick

import net.minecraftforge.fml.common.gameevent.TickEvent.ServerTickEvent; //导入依赖的package包/类
/**
 * Event listener for world tick event.
 *
 * This is probably not the optimal solution, but I'm not really sure how
 * to schedule things in Minecraft other way than timers and ticks.
 *
 * This method is responsible for scheduling record unloading and counting
 * down recording process.
 */
@SubscribeEvent
public void onWorldTick(ServerTickEvent event)
{
    if (!CommonProxy.manager.records.isEmpty() && Blockbuster.proxy.config.record_unload)
    {
        this.checkAndUnloadRecords();
    }

    if (!CommonProxy.manager.scheduled.isEmpty())
    {
        this.checkScheduled();
    }
}
 
开发者ID:mchorse,项目名称:blockbuster,代码行数:23,代码来源:ActionHandler.java

示例11: tickServer

import net.minecraftforge.fml.common.gameevent.TickEvent.ServerTickEvent; //导入依赖的package包/类
@SubscribeEvent
public void tickServer(ServerTickEvent event) {
	if (event.phase == Phase.START && event.type == net.minecraftforge.fml.common.gameevent.TickEvent.Type.SERVER) {
		PlayerHandler.update(Phase.START);
	} else if (event.phase == Phase.END && event.type == net.minecraftforge.fml.common.gameevent.TickEvent.Type.SERVER) {
		PlayerHandler.update(Phase.END);
	}
}
 
开发者ID:tom5454,项目名称:Toms-Mod,代码行数:9,代码来源:EventHandler.java

示例12: onServerTick

import net.minecraftforge.fml.common.gameevent.TickEvent.ServerTickEvent; //导入依赖的package包/类
@SubscribeEvent(priority = EventPriority.HIGH)
public static void onServerTick(ServerTickEvent event) {
	String flag = "20";
	if (!System.getProperty("index.alchemy.runtime.debug.server", "").equals(flag)) {
		// runtime do some thing
		{
			//System.out.println(EventHelper.getAllHandler(PlayerDropsEvent.class, 0));
		}
		System.setProperty("index.alchemy.runtime.debug.server", flag);
	}
	onRunnableTick(event.side, event.phase);
}
 
开发者ID:NekoCaffeine,项目名称:Alchemy,代码行数:13,代码来源:AlchemyEventSystem.java

示例13: tickCellSaving

import net.minecraftforge.fml.common.gameevent.TickEvent.ServerTickEvent; //导入依赖的package包/类
@EventHandler
public void tickCellSaving(ServerTickEvent event) {
    if (event.phase != Phase.END) return;
    if (ticks++ < 5*20) return;
    ticks = 0;
    saveCellAllocations();
}
 
开发者ID:purpleposeidon,项目名称:Factorization,代码行数:8,代码来源:HammerInfo.java

示例14: updateRecuringNotifications

import net.minecraftforge.fml.common.gameevent.TickEvent.ServerTickEvent; //导入依赖的package包/类
@SubscribeEvent
public void updateRecuringNotifications(ServerTickEvent event) {
    if (event.phase != Phase.END) return;
    synchronized (recuring_notifications) {
        Iterator<Notice> iterator = recuring_notifications.iterator();
        while (iterator.hasNext()) {
            Notice rn = iterator.next();
            if (rn.isInvalid() || !rn.updateNotice()) {
                iterator.remove();
            }
        }
    }
}
 
开发者ID:purpleposeidon,项目名称:Factorization,代码行数:14,代码来源:NotifyImplementation.java

示例15: tick

import net.minecraftforge.fml.common.gameevent.TickEvent.ServerTickEvent; //导入依赖的package包/类
@SubscribeEvent
public void tick(ServerTickEvent event) {
    if (event.phase == Phase.START) {
        TileEntityWrathLamp.handleAirUpdates();
    } else {
        worldgenManager.tickRetrogenQueue();
    }
}
 
开发者ID:purpleposeidon,项目名称:Factorization,代码行数:9,代码来源:Registry.java


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