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


Java FOVUpdateEvent.setNewfov方法代码示例

本文整理汇总了Java中net.minecraftforge.client.event.FOVUpdateEvent.setNewfov方法的典型用法代码示例。如果您正苦于以下问题:Java FOVUpdateEvent.setNewfov方法的具体用法?Java FOVUpdateEvent.setNewfov怎么用?Java FOVUpdateEvent.setNewfov使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraftforge.client.event.FOVUpdateEvent的用法示例。


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

示例1: onFovUpdateEvent

import net.minecraftforge.client.event.FOVUpdateEvent; //导入方法依赖的package包/类
@SideOnly(Side.CLIENT)
@SubscribeEvent
public void onFovUpdateEvent(FOVUpdateEvent fovEvt) {
	ItemStack currentItem = fovEvt.getEntity().getActiveItemStack();
	if (ItemStackTools.isNullStack(currentItem) || currentItem.getItem() != this || fovEvt.getEntity().getItemInUseCount() <= 0) {
		return;
	}

	int drawDuration = getMaxItemUseDuration(currentItem) - fovEvt.getEntity().getItemInUseCount();
	float ratio = drawDuration / (float) 20.0F;

	if (ratio > 1.0F) {
		ratio = 1.0F;
	} else {
		ratio *= ratio;
	}
	fovEvt.setNewfov((1.0F - ratio * 0.35f));
}
 
开发者ID:Alec-WAM,项目名称:CrystalMod,代码行数:19,代码来源:ItemBlowGun.java

示例2: onFovUpdateEvent

import net.minecraftforge.client.event.FOVUpdateEvent; //导入方法依赖的package包/类
@SideOnly(Side.CLIENT)
@SubscribeEvent
public void onFovUpdateEvent(FOVUpdateEvent fovEvt) {
  ItemStack currentItem = fovEvt.getEntity().getActiveItemStack();
  if (ItemStackTools.isNullStack(currentItem) || currentItem.getItem() != this || fovEvt.getEntity().getItemInUseCount() <= 0) {
    return;
  }

  int drawDuration = getMaxItemUseDuration(currentItem) - fovEvt.getEntity().getItemInUseCount();
  float ratio = drawDuration / (float) getDrawTime(currentItem);

  if (ratio > 1.0F) {
    ratio = 1.0F;
  } else {
    ratio *= ratio;
  }
  fovEvt.setNewfov((1.0F - ratio * fovMultiplier));

}
 
开发者ID:Alec-WAM,项目名称:CrystalMod,代码行数:20,代码来源:ItemDarkIronBow.java

示例3: getModelVariation

import net.minecraftforge.client.event.FOVUpdateEvent; //导入方法依赖的package包/类
/**
	 * Helper function for getModel() that allows subclasses to easily overwrite custom animation
	 * sequences for bow pull
	 * 
	 * @param useTime
	 * @return
	 *//*
	protected int getModelVariation(int useTime) {
    	if(useTime >= 21) {
    		return 2;
        } else if(useTime > 10) {
            return 1;
        } else {
            return 0;
        }
	}
*/
	@SubscribeEvent
	public void fovUpdate(FOVUpdateEvent event) {
		if (event.getEntity() instanceof EntityPlayer) {
			if (event.getEntity().isHandActive() && event.getEntity().getActiveItemStack().getItem() == this) {
				float fovModifier = getNewFovModifier(event.getEntity().getItemInUseMaxCount()); // getItemInUseMaxCount() seems to be mis-named.  functionally, it is like the old getItemUseDuration()
		        float fov = 1.0f;
		        fov *= 1.0F - fovModifier * 0.15F;
//				MEMLogger.info("ItemCustomBow fovUpdate(): itemUseDuration = " + event.entity.getItemInUseDuration() + "; fovModifier = " + fovModifier + "; newfov = " + fov);
	            event.setNewfov(fov);
			}
		}
	}
 
开发者ID:freneticfeline,项目名称:mod_quiver,代码行数:30,代码来源:ItemCustomBow.java

示例4: onUpdateFOV

import net.minecraftforge.client.event.FOVUpdateEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void onUpdateFOV(FOVUpdateEvent event) {
	float fov = event.getFov();

	if( event.getEntity().isHandActive() && event.getEntity().getActiveItemStack() != null
			&& event.getEntity().getActiveItemStack().getItem() == ACItems.coralium_longbow) {
		int duration = event.getEntity().getItemInUseCount();
		float multiplier = duration / 20.0F;

		if( multiplier > 1.0F )
			multiplier = 1.0F;
		else
			multiplier *= multiplier;

		fov *= 1.0F - multiplier * 0.15F;
	}

	event.setNewfov(fov);
}
 
开发者ID:Shinoow,项目名称:AbyssalCraft,代码行数:20,代码来源:AbyssalCraftClientEventHooks.java

示例5: onFovUpdateEvent

import net.minecraftforge.client.event.FOVUpdateEvent; //导入方法依赖的package包/类
@SideOnly(Side.CLIENT)
@SubscribeEvent
public void onFovUpdateEvent(FOVUpdateEvent fovEvt) {
  ItemStack currentItem = fovEvt.getEntity().getHeldItemMainhand();
  if(currentItem == null || currentItem.getItem() != this || fovEvt.getEntity().getItemInUseCount() <= 0) {
    return;
  }

  int drawDuration = getMaxItemUseDuration(currentItem) - fovEvt.getEntity().getItemInUseCount();
  float ratio = drawDuration / (float) getDrawTime();

  if(ratio > 1.0F) {
    ratio = 1.0F;
  } else {
    ratio *= ratio;
  }
  fovEvt.setNewfov((1.0F - ratio * fovMultiplier));

}
 
开发者ID:SleepyTrousers,项目名称:EnderZoo,代码行数:20,代码来源:ItemGuardiansBow.java

示例6: handleFovUpdate

import net.minecraftforge.client.event.FOVUpdateEvent; //导入方法依赖的package包/类
@SideOnly(Side.CLIENT)
@SubscribeEvent
public static void handleFovUpdate(@Nonnull FOVUpdateEvent evt) {

  if (ignoreFovEvent) {
    return;
  }

  EntityPlayer player = NullHelper.notnullF(evt.getEntity(), "FOVUpdateEvent has no player");

  if (clearModifiers(player)) {
    // set the same as vanilla does without our speed buff
    evt.setNewfov(getVanillaFovModifier(player));
    setModifiers(player);
  }
}
 
开发者ID:SleepyTrousers,项目名称:EnderIO,代码行数:17,代码来源:SpeedController.java

示例7: onFovUpdateEvent

import net.minecraftforge.client.event.FOVUpdateEvent; //导入方法依赖的package包/类
@SideOnly(Side.CLIENT)
@SubscribeEvent
public void onFovUpdateEvent(FOVUpdateEvent fovEvt) {
  ItemStack currentItem = fovEvt.getEntity().getHeldItemMainhand();
  if (currentItem.getItem() != this || fovEvt.getEntity().getItemInUseCount() <= 0) {
    return;
  }

  int drawDuration = getMaxItemUseDuration(currentItem) - fovEvt.getEntity().getItemInUseCount();
  float ratio = drawDuration / (float) getDrawTime(currentItem);

  if (ratio > 1.0F) {
    ratio = 1.0F;
  } else {
    ratio *= ratio;
  }

  float mult = (float) Config.darkSteelBowFovMultipliers[0];
  EnergyUpgradeHolder upgrade = EnergyUpgradeManager.loadFromItem(currentItem);
  if (upgrade != null && upgrade.getEnergy() > 0) {
    mult = (float) Config.darkSteelBowFovMultipliers[upgrade.getUpgrade().getLevel() + 1];
  }
  fovEvt.setNewfov((1.0F - ratio * mult));
}
 
开发者ID:SleepyTrousers,项目名称:EnderIO,代码行数:25,代码来源:ItemDarkSteelBow.java

示例8: updateFOV

import net.minecraftforge.client.event.FOVUpdateEvent; //导入方法依赖的package包/类
@SubscribeEvent
@SideOnly(Side.CLIENT)
public void updateFOV(FOVUpdateEvent event) {
	if (event.getEntity().getActivePotionEffect(Thermionics.POTION_EFFORTLESS_SPEED)!=null) {
		event.setNewfov(1.0f);
	}
}
 
开发者ID:elytra,项目名称:Thermionics,代码行数:8,代码来源:Thermionics.java

示例9: getFov

import net.minecraftforge.client.event.FOVUpdateEvent; //导入方法依赖的package包/类
@SideOnly(Side.CLIENT)
@SubscribeEvent
public void getFov(FOVUpdateEvent event) {
	if (!event.getEntity().getHeldItem(EnumHand.MAIN_HAND).isEmpty()
			&& event.getEntity().getHeldItem(EnumHand.MAIN_HAND).getItem() instanceof TNTCannon)
		if (!event.getEntity().getActiveItemStack().isEmpty()
				&& ((TNTCannon) event.getEntity().getHeldItem(EnumHand.MAIN_HAND).getItem())
						.getType(event.getEntity().getHeldItem(EnumHand.MAIN_HAND)) == 5)
			event.setNewfov(event.getNewfov() * 0.4f);
}
 
开发者ID:rafradek,项目名称:Mods,代码行数:11,代码来源:BlockEventBus.java

示例10: getFov

import net.minecraftforge.client.event.FOVUpdateEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void getFov(FOVUpdateEvent event) {
	if (event.getEntity().getHeldItem(EnumHand.MAIN_HAND) != null && event.getEntity().getHeldItem(EnumHand.MAIN_HAND).getItem() instanceof ItemUsable)
		if (event.getEntity().getHeldItem(EnumHand.MAIN_HAND).getItem() instanceof ItemSniperRifle && event.getEntity().getCapability(TF2weapons.WEAPONS_CAP, null).isCharging()) {
			event.setNewfov(event.getFov() * 0.55f);
		} else if (event.getEntity().getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).getModifier(ItemMinigun.slowdownUUID) != null) {
			event.setNewfov(event.getFov() * 1.4f);
		}
}
 
开发者ID:rafradek,项目名称:Mods,代码行数:10,代码来源:TF2EventsClient.java

示例11: onBowPulled

import net.minecraftforge.client.event.FOVUpdateEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void onBowPulled(FOVUpdateEvent event)
{
	EntityPlayer player = Minecraft.getMinecraft().thePlayer;

	if (player == null || (player != null && player.getActiveItemStack() == null))
	{
		return;
	}

	Item item = player.getActiveItemStack().getItem();

	if (item == ItemsAether.phoenix_bow)
	{
        int i = player.getItemInUseMaxCount();
        float f1 = (float)i / 20.0F;

        if (f1 > 1.0F)
        {
            f1 = 1.0F;
        }
        else
        {
            f1 = f1 * f1;
        }

        float original = event.getFov();

        original *= 1.0F - f1 * 0.15F;

        event.setNewfov(original);
	}
}
 
开发者ID:Modding-Legacy,项目名称:Aether-Legacy,代码行数:34,代码来源:AetherClientEvents.java

示例12: onFov

import net.minecraftforge.client.event.FOVUpdateEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void onFov(FOVUpdateEvent event) {
	if (isKnockedOut) {
		event.setNewfov(0.5f);
	}
}
 
开发者ID:blay09,项目名称:HardcoreRevival,代码行数:7,代码来源:ClientProxy.java

示例13: onFOVUpdate

import net.minecraftforge.client.event.FOVUpdateEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void onFOVUpdate(FOVUpdateEvent evt)
{
	if (mc.gameSettings.thirdPersonView == 0 && (showScopeOverlap || showSpyglassOverlay))
		evt.setNewfov(evt.getNewfov() / 6.0F);
}
 
开发者ID:BubbleTrouble14,项目名称:ARKCraft,代码行数:7,代码来源:ClientEventHandler.java

示例14: onFOVUpdate

import net.minecraftforge.client.event.FOVUpdateEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void onFOVUpdate(FOVUpdateEvent evt) {
    if (isUsingBinoculars() && mc.gameSettings.thirdPersonView == 0) {
        evt.setNewfov(currentZoom);
    }
}
 
开发者ID:Tonius,项目名称:Zoom,代码行数:7,代码来源:EventHandler.java

示例15: fovUpdate

import net.minecraftforge.client.event.FOVUpdateEvent; //导入方法依赖的package包/类
@SideOnly (Side.CLIENT)
@SubscribeEvent
public void fovUpdate (FOVUpdateEvent event) {
    if (event.getEntity().getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).getAttributeValue() == 0) event.setNewfov(1f);
}
 
开发者ID:Wehavecookies56,项目名称:Kingdom-Keys-Re-Coded,代码行数:6,代码来源:RenderingEvents.java


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