當前位置: 首頁>>代碼示例>>Java>>正文


Java TickEvent.ServerTickEvent方法代碼示例

本文整理匯總了Java中net.minecraftforge.fml.common.gameevent.TickEvent.ServerTickEvent方法的典型用法代碼示例。如果您正苦於以下問題:Java TickEvent.ServerTickEvent方法的具體用法?Java TickEvent.ServerTickEvent怎麽用?Java TickEvent.ServerTickEvent使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在net.minecraftforge.fml.common.gameevent.TickEvent的用法示例。


在下文中一共展示了TickEvent.ServerTickEvent方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onServerTick

import net.minecraftforge.fml.common.gameevent.TickEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void onServerTick(TickEvent.ServerTickEvent event) {
    if (event.phase == TickEvent.Phase.END) {
        Iterator<Map.Entry<WorldAndCoord, IHackableBlock>> blockIterator = hackedBlocks.entrySet().iterator();
        while (blockIterator.hasNext()) {
            Map.Entry<WorldAndCoord, IHackableBlock> entry = blockIterator.next();
            IHackableBlock hackableBlock = entry.getValue();
            WorldAndCoord hackedBlock = entry.getKey();

            boolean found = false;
            for (Map.Entry<Block, Class<? extends IHackableBlock>> registeredEntry : PneumaticHelmetRegistry.getInstance().hackableBlocks.entrySet()) {
                if (hackableBlock.getClass() == registeredEntry.getValue()) {
                    if (hackedBlock.getBlock() == registeredEntry.getKey()) {
                        if (!hackableBlock.afterHackTick((World) hackedBlock.world, hackedBlock.pos)) {
                            blockIterator.remove();
                        }
                        found = true;
                        break;
                    }
                }
            }
            if (!found) blockIterator.remove();
        }
    }
}
 
開發者ID:TeamPneumatic,項目名稱:pnc-repressurized,代碼行數:26,代碼來源:HackTickHandler.java

示例2: onServerTick

import net.minecraftforge.fml.common.gameevent.TickEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void onServerTick(TickEvent.ServerTickEvent event) {
    for (ISemiBlock semiBlock : addingBlocks) {
        Chunk chunk = semiBlock.getWorld().getChunkFromBlockCoords(semiBlock.getPos());
        addPendingBlock(chunk, semiBlock);
        chunk.markDirty();

        for (EntityPlayer player : syncList.get(chunk)) {
            NetworkHandler.sendTo(new PacketAddSemiBlock(semiBlock), (EntityPlayerMP) player);
            PacketDescription descPacket = semiBlock.getDescriptionPacket();
            if (descPacket != null) NetworkHandler.sendTo(descPacket, (EntityPlayerMP) player);
        }
    }
    addingBlocks.clear();

    for (Chunk removingChunk : chunksMarkedForRemoval) {
        if (!removingChunk.isLoaded()) {
            semiBlocks.remove(removingChunk);
            syncList.remove(removingChunk);
        }
    }
    chunksMarkedForRemoval.clear();

    semiBlocks.values().forEach(this::update);
}
 
開發者ID:TeamPneumatic,項目名稱:pnc-repressurized,代碼行數:26,代碼來源:SemiBlockManager.java

示例3: serverTickEnd

import net.minecraftforge.fml.common.gameevent.TickEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void serverTickEnd(TickEvent.ServerTickEvent event) {

	if (event.phase == TickEvent.Phase.START)
		if (tickleft <= 0) {
			tickleft = 20;
			Object[] entArray = ItemUsable.lastDamage.keySet().toArray();
			for (int x = 0; x < entArray.length; x++) {
				Entity entity = (Entity) entArray[x];
				float[] dmg = ItemUsable.lastDamage.get(entArray[x]);
				for (int i = 19; i >= 0; i--)
					if (i > 0) {
						dmg[i] = dmg[i - 1];
					} else {
						dmg[0] = 0;
					}
			}

		} else {
			tickleft--;
		}
}
 
開發者ID:rafradek,項目名稱:Mods,代碼行數:23,代碼來源:TF2EventsCommon.java

示例4: onServerTick

import net.minecraftforge.fml.common.gameevent.TickEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void onServerTick(TickEvent.ServerTickEvent event)
{
    if(event.phase == TickEvent.Phase.END)
    {
        Iterator<Track> ite = tracksPlaying.iterator();
        while(ite.hasNext())
        {
            Track track = ite.next();
            if(!track.update())
            {
                ite.remove();
                continue;
            }
        }
    }
}
 
開發者ID:iChun,項目名稱:Clef,代碼行數:18,代碼來源:EventHandlerServer.java

示例5: serverTicks

import net.minecraftforge.fml.common.gameevent.TickEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void serverTicks(TickEvent.ServerTickEvent event) {
    if (event.phase != TickEvent.Phase.START) return;
    i++;
    if (watchDog != null) {
        // Pat Lagssie
        watchDog.ticks++;
    } else if (i == 40) {
        watchDog = new LagssieWatchDog("LAG-SERVER", Thread.currentThread(), Lagssie.intervalServer);
        watchDog.start();
    }
}
 
開發者ID:asiekierka,項目名稱:LagssieMC,代碼行數:13,代碼來源:LagssieServer.java

示例6: clientTick

import net.minecraftforge.fml.common.gameevent.TickEvent; //導入方法依賴的package包/類
@SubscribeEvent
public static void clientTick(TickEvent.ServerTickEvent event) {
    if (event.phase == TickEvent.Phase.END) return;
    if (EventCalendar.isGuiFun()) {
        GuiHealthScreen.BED_ITEMSTACK.setItemDamage(id);
        Minecraft mc = Minecraft.getMinecraft();
        if (mc.world != null && mc.world.getWorldTime() % 3 == 0) id++;
        if (id > 15) id = 0;
    }
}
 
開發者ID:ichttt,項目名稱:FirstAid,代碼行數:11,代碼來源:ClientEventHandler.java

示例7: onServerTick

import net.minecraftforge.fml.common.gameevent.TickEvent; //導入方法依賴的package包/類
/** Tick event called on the Server.<br>
 * Used to send the heart-beat at regular intervals.
 * @param ev ClientTickEvent for this tick.
 */
@SubscribeEvent
public void onServerTick(TickEvent.ServerTickEvent ev)
{
    if (isTimeForBeat())
    {
        beat();
    }
}
 
開發者ID:Yarichi,項目名稱:Proyecto-DASI,代碼行數:13,代碼來源:UDPSocketHelper.java

示例8: onServerTick

import net.minecraftforge.fml.common.gameevent.TickEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void onServerTick(TickEvent.ServerTickEvent ev)
{
    // Pass the event on to the active episode, if there is one:
    this.stateEpisodeLock.readLock().lock();
    if (this.stateEpisode != null && this.stateEpisode.isLive())
    {
        this.stateEpisode.onServerTick(ev);
    }
    this.stateEpisodeLock.readLock().unlock();
}
 
開發者ID:Yarichi,項目名稱:Proyecto-DASI,代碼行數:12,代碼來源:EpisodeEventWrapper.java

示例9: onServerTick

import net.minecraftforge.fml.common.gameevent.TickEvent; //導入方法依賴的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

示例10: onServerTick

import net.minecraftforge.fml.common.gameevent.TickEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void onServerTick(TickEvent.ServerTickEvent event) {
	if (event.phase!=TickEvent.Phase.START) return;
	inc++;
	if (inc>=10) { //Only pulse about twice a second.
		inc = 0;
		synchronized(schedulers) {
			for(Scheduler scheduler : schedulers.values()) {
				scheduler.tick();
			}
		}
	}
}
 
開發者ID:elytra,項目名稱:Thermionics,代碼行數:14,代碼來源:BigExplosionHandler.java

示例11: onServerTick

import net.minecraftforge.fml.common.gameevent.TickEvent; //導入方法依賴的package包/類
/** Uses lowest event priority to run after everything else has */
@SubscribeEvent(priority = EventPriority.LOWEST)
public void onServerTick(TickEvent.ServerTickEvent event)
{
    // Only run at end of tick to catch players that just moved past border
    if (event.phase == TickEvent.Phase.START)
        return;

    if ( WorldBorder.SERVER.getTickCounter() % Config.getTimerTicks() != 0 )
        return;

    for (Object o : WorldBorder.SERVER.getPlayerList().getPlayerList())
        BorderCheck.checkPlayer( (EntityPlayerMP) o, null, false, true );
}
 
開發者ID:abused,項目名稱:World-Border,代碼行數:15,代碼來源:BorderCheckTask.java

示例12: onServerTick

import net.minecraftforge.fml.common.gameevent.TickEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void onServerTick(TickEvent.ServerTickEvent event) {
	AllChunks.onTick();
}
 
開發者ID:coehlrich,項目名稱:chunk-logger,代碼行數:5,代碼來源:EventHandlerCommon.java

示例13: onWorldTick

import net.minecraftforge.fml.common.gameevent.TickEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void onWorldTick(TickEvent.ServerTickEvent event) {
    ServerActionManager.getManager().tick();
}
 
開發者ID:McJty,項目名稱:MeeCreeps,代碼行數:5,代碼來源:ForgeEventHandlers.java

示例14: serverTick

import net.minecraftforge.fml.common.gameevent.TickEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void serverTick(TickEvent.ServerTickEvent event) {
    Pregen.tick();
}
 
開發者ID:ternsip,項目名稱:StructPro,代碼行數:5,代碼來源:Structpro.java

示例15: addTick

import net.minecraftforge.fml.common.gameevent.TickEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void addTick(TickEvent.ServerTickEvent e) {
    if(e.phase == TickEvent.Phase.START) {
        ticks.incrementAndGet();
    }
}
 
開發者ID:TerminatorNL,項目名稱:LagGoggles,代碼行數:7,代碼來源:TickCounter.java


注:本文中的net.minecraftforge.fml.common.gameevent.TickEvent.ServerTickEvent方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。