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


Java TickEvent类代码示例

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


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

示例1: onTickEvent

import cpw.mods.fml.common.gameevent.TickEvent; //导入依赖的package包/类
@SubscribeEvent
public void onTickEvent(TickEvent.PlayerTickEvent evt) {
	if (tick >= 15) {
		for (TileEntity t : (List<TileEntity>) evt.player.worldObj.loadedTileEntityList) {
			if (t instanceof LobbyTileEntity) {
				tile = (LobbyTileEntity) t;
				
				if (tile.players.size() != tile.blockMetadata)
					tile.check();
			}
		}

		tick = 0;
	}
}
 
开发者ID:TominoCZ,项目名称:PAYDAY,代码行数:16,代码来源:MEventHandler.java

示例2: onWorldTick

import cpw.mods.fml.common.gameevent.TickEvent; //导入依赖的package包/类
@SubscribeEvent
@SuppressWarnings("unchecked")
public void onWorldTick(TickEvent.ServerTickEvent event) {
	if (event.phase != TickEvent.Phase.END || event.side != Side.SERVER)
		return;

	if (EtFuturum.enablePlayerSkinOverlay)
		if (playerLoggedInCooldown != null)
			if (--playerLoggedInCooldown <= 0) {
				for (World world : MinecraftServer.getServer().worldServers)
					for (EntityPlayer player : (List<EntityPlayer>) world.playerEntities) {
						NBTTagCompound nbt = player.getEntityData();
						if (nbt.hasKey(SetPlayerModelCommand.MODEL_KEY, Constants.NBT.TAG_BYTE)) {
							boolean isAlex = nbt.getBoolean(SetPlayerModelCommand.MODEL_KEY);
							EtFuturum.networkWrapper.sendToAll(new SetPlayerModelMessage(player, isAlex));
						}
					}
				playerLoggedInCooldown = null;
			}
}
 
开发者ID:jm-organization,项目名称:connor41-etfuturum2,代码行数:21,代码来源:ServerEventHandler.java

示例3: renderTick

import cpw.mods.fml.common.gameevent.TickEvent; //导入依赖的package包/类
@SideOnly(Side.CLIENT)
@SubscribeEvent
public void renderTick(TickEvent.RenderTickEvent event)
{
	Minecraft mc = FMLClientHandler.instance().getClient();
	World world = mc.theWorld;
	
	if (event.phase != TickEvent.Phase.START) {
	    if ((Minecraft.getMinecraft().renderViewEntity instanceof EntityPlayer)) {
	    	EntityPlayer player = (EntityPlayer)Minecraft.getMinecraft().renderViewEntity;

	        if ((player != null) && (mc.inGameHasFocus) && (Minecraft.isGuiEnabled())) {
	        	// If player have radiation detector on hotbar.
	        	if (isPlayerHasItemOnHotbar(player.inventory, ItemsHZDS.radiation_detector)) {
        			PlayerTracker tracker = TrackerManager.lookupTrackerFromUsername(mc.thePlayer.getCommandSenderName());
        			
        			if (tracker != null) {
        				renderRadiation(tracker);
        			}
        		}

	        }
	    }
	}
}
 
开发者ID:TwilightWingsStudio,项目名称:HazardsLib,代码行数:26,代码来源:ClientEventHandler.java

示例4: onServerTick

import cpw.mods.fml.common.gameevent.TickEvent; //导入依赖的package包/类
@SubscribeEvent
public void onServerTick(final TickEvent.ServerTickEvent event) {
    if (event.phase != TickEvent.Phase.END || CommandTPSTimer.playerSet.isEmpty()) {
        return;
    }
    final MinecraftServer server = MinecraftServer.getServer();
    final int counter = server.getTickCounter() % 100;
    final long[] longs = server.tickTimeArray;
    if (longs == null) {
        return;
    }
    for (final Object o : server.getConfigurationManager().playerEntityList) {
        final EntityPlayer player = (EntityPlayer)o;
        if (CommandTPSTimer.playerSet.contains(player.getCommandSenderName())) {
            NetworkHandler.sendPacketToPlayer(new PacketTime(longs[counter], counter), player);
        }
    }
}
 
开发者ID:sameer,项目名称:ExtraUtilities,代码行数:19,代码来源:CommandTPSTimer.java

示例5: onDraw

import cpw.mods.fml.common.gameevent.TickEvent; //导入依赖的package包/类
@SubscribeEvent
@SideOnly(Side.CLIENT)
public void onDraw(final TickEvent.RenderTickEvent event) {
    if (event.phase != TickEvent.Phase.END || !this.display || CommandTPSTimer.displayString.length() == 0) {
        return;
    }
    final Minecraft minecraft = Minecraft.getMinecraft();
    if (minecraft.theWorld == null) {
        CommandTPSTimer.displayString = "";
        return;
    }
    final FontRenderer fontrenderer = minecraft.fontRenderer;
    GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
    GL11.glEnable(3042);
    OpenGlHelper.glBlendFunc(770, 771, 1, 0);
    GL11.glBlendFunc(770, 771);
    RenderHelper.disableStandardItemLighting();
    fontrenderer.drawString(CommandTPSTimer.displayString, 0, 0, -1, true);
}
 
开发者ID:sameer,项目名称:ExtraUtilities,代码行数:20,代码来源:CommandTPSTimer.java

示例6: playerTick

import cpw.mods.fml.common.gameevent.TickEvent; //导入依赖的package包/类
@SubscribeEvent
public void playerTick(final TickEvent.PlayerTickEvent event) {
    if (event.phase == TickEvent.Phase.START) {
        return;
    }
    final EntityPlayer player = event.player;
    if (player.worldObj.isRemote) {
        return;
    }
    if (LogHelper.isDeObf) {}
    if ((player.worldObj.getTotalWorldTime() & 0x1FL) > 0L) {
        return;
    }
    final int i = this.chunkmap.adjustOrPutValue(new ChunkLocation(event.player), 1, 1);
    if (i > 2250) {}
}
 
开发者ID:sameer,项目名称:ExtraUtilities,代码行数:17,代码来源:SpecialEventCoordinator.java

示例7: onServerTick

import cpw.mods.fml.common.gameevent.TickEvent; //导入依赖的package包/类
@SubscribeEvent
public void onServerTick(TickEvent.ServerTickEvent event)
{
	MinecraftServer server = FMLCommonHandler.instance().getMinecraftServerInstance();
	//Prevent issues when clients switch to LAN servers
	if (server == null) return;

	if (event.phase == TickEvent.Phase.START)
    {
        if (AsteroidsTickHandlerServer.spaceRaceData == null)
        {
            World world = server.worldServerForDimension(0);
            AsteroidsTickHandlerServer.spaceRaceData = (ShortRangeTelepadHandler) world.mapStorage.loadData(ShortRangeTelepadHandler.class, ShortRangeTelepadHandler.saveDataID);

            if (AsteroidsTickHandlerServer.spaceRaceData == null)
            {
                AsteroidsTickHandlerServer.spaceRaceData = new ShortRangeTelepadHandler(ShortRangeTelepadHandler.saveDataID);
                world.mapStorage.setData(ShortRangeTelepadHandler.saveDataID, AsteroidsTickHandlerServer.spaceRaceData);
            }
        }
    }
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:23,代码来源:AsteroidsTickHandlerServer.java

示例8: onTick

import cpw.mods.fml.common.gameevent.TickEvent; //导入依赖的package包/类
@SubscribeEvent
public void onTick(TickEvent.ServerTickEvent e) {
    if (e.phase == TickEvent.Phase.START) {
        final Runnable[] adds;
        synchronized (pending) {
            adds = pending.toArray(new Runnable[pending.size()]);
            pending.clear();
        }
        for (Runnable runnable : adds) {
            try {
                runnable.run();
            } catch (Throwable t) {
                log.warn("Error in scheduled tick action.", t);
            }
        }
    }
}
 
开发者ID:Avaja,项目名称:OpenTechnology,代码行数:18,代码来源:SimpleComponentTickHandler.java

示例9: onRenderTick

import cpw.mods.fml.common.gameevent.TickEvent; //导入依赖的package包/类
@SideOnly(Side.CLIENT)
@SubscribeEvent
public void onRenderTick(TickEvent.RenderTickEvent event) {
	// If no client world we're not playing. Abort.
	if (Minecraft.getMinecraft().theWorld == null) return;
	if (event.phase == TickEvent.Phase.START) {
		// Anything we need to render for the current frame should happen either during or before the main world render
		// Here we call the renderer for "live portal" renders.
		PerspectiveRenderManager.onRenderTick(printstream);
		return;
	}
	if (event.phase == TickEvent.Phase.END) {
		// We render the world views at the end of the render tick.  
		WorldViewRenderManager.onRenderTick(printstream);
		return;
	}
}
 
开发者ID:XCompWiz,项目名称:LookingGlass,代码行数:18,代码来源:LookingGlassEventHandler.java

示例10: onWorldTickLoad

import cpw.mods.fml.common.gameevent.TickEvent; //导入依赖的package包/类
@SubscribeEvent
public void onWorldTickLoad(TickEvent.WorldTickEvent event)
{
	EAWorldData eaWD = EAWorldData.forWorld((WorldServer)event.world);
	eaWD.markDirty();
	
	if(event.phase == TickEvent.Phase.START)
	{
		EAPlugin.internalTick();
		for(EAPluginContainer plugin : EALoader.instance().loadedPlugins)
		{	
			try
			{
				plugin.plugin.onTick(event.world);
			}
			catch(Exception e)
			{
				e.printStackTrace();
			}
		}
	}
}
 
开发者ID:Cephrus,项目名称:Elite-Armageddon,代码行数:23,代码来源:Handler.java

示例11: onEvent

import cpw.mods.fml.common.gameevent.TickEvent; //导入依赖的package包/类
@SubscribeEvent
public void onEvent(TickEvent.ServerTickEvent event)
{
    // Only need once a tick
    if(event.phase == TickEvent.Phase.START)
    {
        return;
    }

    // This is useless :p
    if(tickCount < TICK_DELAY)
    {
        tickCount++;
    }

    if(tickCount == TICK_DELAY)
    {
        InventoryPlayerUnificationHandler.unifyAll();
        tickCount = 0;
    }
}
 
开发者ID:Technici4n,项目名称:ProjectU,代码行数:22,代码来源:ServerTickEventHandler.java

示例12: onClientTick

import cpw.mods.fml.common.gameevent.TickEvent; //导入依赖的package包/类
@SubscribeEvent
public void onClientTick(TickEvent.ClientTickEvent event) {
    if (Minecraft.getMinecraft().theWorld == null && !nowPlaying.isEmpty()) {
        stop();
        return;
    }

    boolean currentState = false;
    if (Minecraft.getMinecraft().isGamePaused()) {
        currentState = true;
    }

    if (currentState && !gamePause) {
        pause();
        gamePause = true;
    } else if (!currentState && gamePause) {
        resume();
        gamePause = false;
    }
}
 
开发者ID:dmillerw,项目名称:EventMod,代码行数:21,代码来源:SoundHandler.java

示例13: onPlayerTick

import cpw.mods.fml.common.gameevent.TickEvent; //导入依赖的package包/类
@SubscribeEvent
public void onPlayerTick(TickEvent.PlayerTickEvent event)
{
	if (event.phase != Phase.START)
		return;

	updatePosition();
	if (!moved)
		return;

	Block b = getBlockUnderPlayer();
	onElevator = (b == IndicatorMod.instance.elevatorBlock);

	if (onElevator)
		findElevators();
}
 
开发者ID:bartbes,项目名称:OpenBlocks-Elevator-Indicator,代码行数:17,代码来源:IndicatorOverlay.java

示例14: tickEnd

import cpw.mods.fml.common.gameevent.TickEvent; //导入依赖的package包/类
public void tickEnd( PlayerTickEvent event )
{
	if ( !event.phase.equals( TickEvent.Phase.END ) )
	{
		return;
	}
	EntityPlayer player = ( EntityPlayer ) event.player;
	
	if ( !player.openContainer.getClass().getName().equals( "thaumcraft.common.container.ContainerArcaneBore" ) )
	{
		return;
	}
	
	Slot oldSlot = player.openContainer.getSlot( 1 );
	if ( oldSlot instanceof PickaxeSlot )
	{
		return;
	}
	
	PickaxeSlot newSlot = new PickaxeSlot( oldSlot.inventory, 1, oldSlot.xDisplayPosition, oldSlot.yDisplayPosition );
	newSlot.slotNumber = oldSlot.slotNumber;
	player.openContainer.inventorySlots.set( 1, newSlot );
}
 
开发者ID:spacechase0,项目名称:ComponentEquipment,代码行数:24,代码来源:ArcaneBoreSlotChanger.java

示例15: tick

import cpw.mods.fml.common.gameevent.TickEvent; //导入依赖的package包/类
@SubscribeEvent
public void tick(TickEvent.ServerTickEvent event) {
	//Tick satellites
	if(event.phase == event.phase.END) {
		DimensionManager.getInstance().tickDimensions();
		time++;

		if(!transitionMap.isEmpty()) {
			Iterator<Entry<Long, TransitionEntity>> itr = transitionMap.entrySet().iterator();

			while(itr.hasNext()) {
				Entry<Long, TransitionEntity> entry = itr.next();
				TransitionEntity ent = entry.getValue();
				if(ent.entity.worldObj.getTotalWorldTime() >= entry.getKey()) {
					ent.entity.setLocationAndAngles(ent.location.x, ent.location.y, ent.location.z, ent.entity.rotationYaw, ent.entity.rotationPitch);

					MinecraftServer.getServer().getConfigurationManager().transferPlayerToDimension((EntityPlayerMP)ent.entity, ent.dimId, new TeleporterNoPortal(MinecraftServer.getServer().worldServerForDimension(ent.dimId)));

					ent.entity.mountEntity(ent.entity2);
					itr.remove();
				}
			}
		}
	}
}
 
开发者ID:zmaster587,项目名称:AdvancedRocketry,代码行数:26,代码来源:PlanetEventHandler.java


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