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


Java PlayerTickEvent类代码示例

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


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

示例1: onEvent

import cpw.mods.fml.common.gameevent.TickEvent.PlayerTickEvent; //导入依赖的package包/类
@SubscribeEvent(priority=EventPriority.NORMAL, receiveCanceled=true)
public void onEvent(PlayerTickEvent event)
{
  
    if (!ClientProxy.haveWarnedVersionOutOfDate && event.player.worldObj.isRemote 
          && !ClientProxy.versionChecker.isLatestVersion())
    {
        ClickEvent versionCheckChatClickEvent = new ClickEvent(ClickEvent.Action.OPEN_URL, 
              "http://www.planetminecraft.com/mod/popularmmos-epicproportions-mod-season-9/");
        ChatStyle clickableChatStyle = new ChatStyle().setChatClickEvent(versionCheckChatClickEvent);
        ChatComponentText versionWarningChatComponent = 
              new ChatComponentText("Your EpicProportions Mod is not latest version!  Click here to update.");
        versionWarningChatComponent.setChatStyle(clickableChatStyle);
        event.player.addChatMessage(versionWarningChatComponent);
        ClientProxy.haveWarnedVersionOutOfDate = true;
    }
  
}
 
开发者ID:jtrent238,项目名称:PopularMMOS-EpicProportions-Mod,代码行数:19,代码来源:ClientProxy.java

示例2: onEvent

import cpw.mods.fml.common.gameevent.TickEvent.PlayerTickEvent; //导入依赖的package包/类
@SubscribeEvent(priority=EventPriority.NORMAL, receiveCanceled=true)
public void onEvent(PlayerTickEvent event)
{
  
    if (!ClientProxy.haveWarnedVersionOutOfDate && event.player.worldObj.isRemote 
          && !ClientProxy.versionChecker.isLatestVersion())
    {
        ClickEvent versionCheckChatClickEvent = new ClickEvent(ClickEvent.Action.OPEN_URL, 
              "http://www.planetminecraft.com/mod/popularmmos-epicproportions-mod-season-9/");
        ChatStyle clickableChatStyle = new ChatStyle().setChatClickEvent(versionCheckChatClickEvent);
        ChatComponentText versionWarningChatComponent = 
              new ChatComponentText("�4�l" + "Your EpicProportions Mod is not latest version!  Click here to update.");
        versionWarningChatComponent.setChatStyle(clickableChatStyle);
        event.player.addChatMessage(versionWarningChatComponent);
        ClientProxy.haveWarnedVersionOutOfDate = true;
    }
  
}
 
开发者ID:jtrent238,项目名称:PopularMMOS-EpicProportions-Mod,代码行数:19,代码来源:VersionChecker.java

示例3: tickStart

import cpw.mods.fml.common.gameevent.TickEvent.PlayerTickEvent; //导入依赖的package包/类
@SubscribeEvent
public void tickStart(PlayerTickEvent evt) {
	if (evt.phase != Phase.START) {
		return;
	}
	if (ticksToPoll > 0) {
		ticksToPoll--;
		return;
	}
	ticksToPoll = TICK_POLL_INTERVAL;
	
	if (versionInfo.versionCheckComplete) {
		unsubscribeFromBus();
		
		if (updateNotificationsEnabledOrCriticalUpdate()) {
			sendNotificationToPlayer(evt.player);
		}
	}
}
 
开发者ID:MagicBees,项目名称:MagicBees,代码行数:20,代码来源:TickHandlerVersion.java

示例4: Point_CuringFog

import cpw.mods.fml.common.gameevent.TickEvent.PlayerTickEvent; //导入依赖的package包/类
/** ʵ��Skill331-������֮����Ч���� */
@SubscribeEvent
public void Point_CuringFog(PlayerTickEvent event) {
	if (event.phase == Phase.END) {
		return;
	}
	
	EntityPlayer player = event.player;
	if (!player.worldObj.isRemote // ����¼�ֻ�����ڷ�����
		&& RewriteHelper.hasSkill(player, RewriteHelper.CuringFog.id)
		&& new Random().nextInt(1200) == 600
		) {
		List entities = player.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(player.posX-3.0D, player.posY-2.0D, player.posZ-3.0D, player.posX+3.0D, player.posY+2.0D, player.posZ+3.0D));
   		for (Iterator iterator = entities.iterator(); iterator.hasNext(); ) {
   			EntityLivingBase entity = (EntityLivingBase)iterator.next();
   			if (entity.isPotionActive(Potion.blindness)) entity.removePotionEffect(Potion.blindness.id);
   			if (entity.isPotionActive(Potion.confusion)) entity.removePotionEffect(Potion.confusion.id);
   			if (entity.isPotionActive(Potion.digSlowdown)) entity.removePotionEffect(Potion.digSlowdown.id);
   			if (entity.isPotionActive(Potion.hunger)) entity.removePotionEffect(Potion.hunger.id);
   			if (entity.isPotionActive(Potion.poison)) entity.removePotionEffect(Potion.poison.id);
   			if (entity.isPotionActive(Potion.weakness)) entity.removePotionEffect(Potion.weakness.id);
   			if (entity.isPotionActive(Potion.wither)) entity.removePotionEffect(Potion.wither.id);			
   		}
		player.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("keycraft.prompt.cure")));
	}
}
 
开发者ID:NullaDev,项目名称:KeyCraft,代码行数:27,代码来源:SubscribeOnTick_Effect.java

示例5: Point_HealingFog

import cpw.mods.fml.common.gameevent.TickEvent.PlayerTickEvent; //导入依赖的package包/类
/** ʵ��Skill332-������֮����Ч���� */
@SubscribeEvent
public void Point_HealingFog(PlayerTickEvent event) {
	if (event.phase == Phase.END) {
		return;
	}
	
	EntityPlayer player = event.player;
	if (!player.worldObj.isRemote // ����¼�ֻ�����ڷ�����
		&& RewriteHelper.hasSkill(player, RewriteHelper.HealingFog.id)
		&& new Random().nextInt(2400) == 800
		) {
		List entities = player.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(player.posX-3.0D, player.posY-2.0D, player.posZ-3.0D, player.posX+3.0D, player.posY+2.0D, player.posZ+3.0D));
   		for (Iterator iterator = entities.iterator(); iterator.hasNext(); ) {
   			EntityLivingBase entity = (EntityLivingBase)iterator.next();
   			entity.addPotionEffect(new PotionEffect(Potion.heal.id, 1, 0));
   		}
		player.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("keycraft.prompt.heal")));
	}
}
 
开发者ID:NullaDev,项目名称:KeyCraft,代码行数:21,代码来源:SubscribeOnTick_Effect.java

示例6: Point_HurtingFog

import cpw.mods.fml.common.gameevent.TickEvent.PlayerTickEvent; //导入依赖的package包/类
/** ʵ��Skill333-���˺�֮����Ч���� */
@SubscribeEvent
public void Point_HurtingFog(PlayerTickEvent event) {
	if (event.phase == Phase.END) {
		return;
	}
	
	EntityPlayer player = event.player;
	if (!player.worldObj.isRemote // ����¼�ֻ�����ڷ�����
		&& RewriteHelper.hasSkill(player, RewriteHelper.HurtingFog.id)
		&& new Random().nextInt(2400) == 1600
		) {
		List entities = player.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(player.posX-3.0D, player.posY-2.0D, player.posZ-3.0D, player.posX+3.0D, player.posY+2.0D, player.posZ+3.0D));
   		for (Iterator iterator = entities.iterator(); iterator.hasNext(); ) {
   			EntityLivingBase entity = (EntityLivingBase)iterator.next();
   			if (!entity.equals(player)) entity.attackEntityFrom(DamageSource.causePlayerDamage(player), 10.0F);
   		}
		player.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("keycraft.prompt.hurt")));
	}
}
 
开发者ID:NullaDev,项目名称:KeyCraft,代码行数:21,代码来源:SubscribeOnTick_Effect.java

示例7: Point_AuroraAutoRecover

import cpw.mods.fml.common.gameevent.TickEvent.PlayerTickEvent; //导入依赖的package包/类
/** �������Skill343-��ŷ������������ŷ�������� */
@SubscribeEvent
public void Point_AuroraAutoRecover(PlayerTickEvent event) {
	if (event.phase == Phase.END) {
		return;
	}
	
	EntityPlayer player = event.player;
	if (!player.worldObj.isRemote // ����¼�ֻ�����ڷ�����
		&& RewriteHelper.hasSkill(player, RewriteHelper.AuroraRegeneration.id)
		&& new Random().nextInt(6000) == 3000
		) {
		RewriteHelper.modifyAuroraPoint(player, 1);
		player.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("keycraft.prompt.aurorarecovery")));
	}
}
 
开发者ID:NullaDev,项目名称:KeyCraft,代码行数:17,代码来源:SubscribeOnTick_Effect.java

示例8: Point_AutoSpeedUp

import cpw.mods.fml.common.gameevent.TickEvent.PlayerTickEvent; //导入依赖的package包/类
/** �������Skill100-�������ɶ������ٶ�Buff */
@SubscribeEvent
public void Point_AutoSpeedUp(PlayerTickEvent event) {
	EntityPlayer player = event.player;
	if (RewriteHelper.hasSkill(player, RewriteHelper.HuntingRhythm.id)
		&& !player.isPotionActive(Potion.moveSpeed)
		) {
		List entities = player.worldObj.getEntitiesWithinAABB(EntityLiving.class, AxisAlignedBB.getBoundingBox(player.posX-8.0D, player.posY-2.0D, player.posZ-8.0D, player.posX+8.0D, player.posY+2.0D, player.posZ+8.0D));
		for (Iterator iterator = entities.iterator(); iterator.hasNext(); ) {
			EntityLiving entity = (EntityLiving)iterator.next();
			if(!entity.equals(player)) {
				player.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 100));
				return;
			}
		}
	}
}
 
开发者ID:NullaDev,项目名称:KeyCraft,代码行数:18,代码来源:SubscribeOnTick_Buff.java

示例9: Point_ER

import cpw.mods.fml.common.gameevent.TickEvent.PlayerTickEvent; //导入依赖的package包/类
/** �������Skill200-���������������ٶ�Buff */
@SubscribeEvent
public void Point_ER(PlayerTickEvent event) {
	EntityPlayer player = event.player;
	if (RewriteHelper.hasSkill(player, RewriteHelper.UrgentProtect.id)
		&& player.getHealth() > 0
		&& player.getHealth() <= player.getEntityAttribute(SharedMonsterAttributes.maxHealth).getAttributeValue() * 0.25
		&& RewriteHelper.getAuroraPoint(player) > 5
		&& isCD_Buff_ER(player)
		) {
    	RewriteHelper.modifyAuroraPoint(player, -5);
		player.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 200, 1));
		player.addPotionEffect(new PotionEffect(Potion.regeneration.id, 200, 4));
		player.addPotionEffect(new PotionEffect(Potion.resistance.id, 200, 1));
	}
}
 
开发者ID:NullaDev,项目名称:KeyCraft,代码行数:17,代码来源:SubscribeOnTick_Buff.java

示例10: onPlayerTickEvent

import cpw.mods.fml.common.gameevent.TickEvent.PlayerTickEvent; //导入依赖的package包/类
@SubscribeEvent
public void onPlayerTickEvent(PlayerTickEvent event)
{
	EntityPlayer player = event.player;
	int i = MathHelper.floor_double(player.posX);
	int j = MathHelper.floor_double(player.posY);
	int k = MathHelper.floor_double(player.posZ);
	
	if (player.isEntityAlive() && player.worldObj.isRaining() && player.worldObj.getBiomeGenForCoords(i, k).getIntRainfall() > 0)
	{
		if (player.ticksExisted%Config.configTicks == 0 && player.rotationPitch < -65f && player.getFoodStats().needFood() && player.worldObj.canBlockSeeTheSky(i, j, k))
		{
			player.getFoodStats().addStats(1, 1.0f);
			if (ItsRainingFood.proxy.shouldPlaySound())
				player.worldObj.playSoundAtEntity(player, "itsrainingfood:omnomnom", 0.8f, 1.0f);
		}
	}
}
 
开发者ID:MikeLydeamore,项目名称:ItsRainingFood,代码行数:19,代码来源:FoodEventHandler.java

示例11: tickEnd

import cpw.mods.fml.common.gameevent.TickEvent.PlayerTickEvent; //导入依赖的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

示例12: playerTick

import cpw.mods.fml.common.gameevent.TickEvent.PlayerTickEvent; //导入依赖的package包/类
@SubscribeEvent
public void playerTick(final PlayerTickEvent e)
{
    if (e.player.worldObj.isRemote)
    {
        // server only.
        return;
    }
    
    final PlayerState state = new PlayerState(e.player);

    PlayerStateContainer container = containers.get(e.player.getUniqueID());
    if (container == null)
    {
        container = new PlayerStateContainer(e.player.getUniqueID(), e.player.getDisplayName(), state);
        containers.put(e.player.getUniqueID(), container);
        LogManager.getLogger().trace("Creating container for {}", e.player.getDisplayName());
    }
    else
    {
        container.addState(state);
    }
}
 
开发者ID:Ubiquitous-Spice,项目名称:ModJam-4,代码行数:24,代码来源:StainManager.java

示例13: onPlayerTick

import cpw.mods.fml.common.gameevent.TickEvent.PlayerTickEvent; //导入依赖的package包/类
@SubscribeEvent
public void onPlayerTick(PlayerTickEvent event) {
	// this happens on every tick (20x per second)
	EntityClientPlayerMP player = _mc.thePlayer;

	IAttributeInstance movement = player.getEntityAttribute(SharedMonsterAttributes.movementSpeed); 
	if (player.getCurrentArmor(0) != null && player.getCurrentArmor(0).getItem() instanceof BaconBoots) {
		// if they're wearing bacon boots and they don't have the move bonus applied, then apply it
		if (movement.getModifier(BaconBoots.BaconBootsMoveBonusUUID) == null) {
			movement.applyModifier(BaconBoots.BaconBootsMoveBonus);
		}
	}
	else {
		// if they're not wearing bacon boots and they have the move bonus applied, then remove it
		if (movement.getModifier(BaconBoots.BaconBootsMoveBonusUUID) != null) {
			movement.removeModifier(BaconBoots.BaconBootsMoveBonus);
		}
	}
}
 
开发者ID:pvanhouten,项目名称:thatconference-baconmod,代码行数:20,代码来源:PlayerTickHandler.java

示例14: air

import cpw.mods.fml.common.gameevent.TickEvent.PlayerTickEvent; //导入依赖的package包/类
@SubscribeEvent
   public void air(PlayerTickEvent event) {
	if (event.player.getAir() < 300 && event.player.worldObj.getTotalWorldTime() % 10 == 0) {
		if (AbilityData.get(event.player).isSkillLearned(SkillAirControl.INSTANCE)) {
			event.player.setAir(300);
		}
	}
}
 
开发者ID:Kanbe-Kotori,项目名称:ExtraAcC,代码行数:9,代码来源:DamageRecalc.java

示例15: onPlayerTick

import cpw.mods.fml.common.gameevent.TickEvent.PlayerTickEvent; //导入依赖的package包/类
@SubscribeEvent
public void onPlayerTick(PlayerTickEvent event) {
    if (!addPlayerTick.isEmpty()) {
        hPlayerTick.addAll(addPlayerTick);
        addPlayerTick.clear();
    }
    for (Iterator<LIHandler> it = hPlayerTick.iterator(); it.hasNext(); ) {
        LIHandler handler = it.next();
        if (handler.isDead())
            it.remove();
        else
            handler.trigger(event);
    }
}
 
开发者ID:LambdaInnovation,项目名称:LambdaLib,代码行数:15,代码来源:LIFMLGameEventDispatcher.java


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