当前位置: 首页>>代码示例>>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;未经允许,请勿转载。