本文整理汇总了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));
}
示例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));
}
示例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);
}
}
}
示例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);
}
示例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));
}
示例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);
}
}
示例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));
}
示例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);
}
}
示例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);
}
示例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);
}
}
示例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);
}
}
示例12: onFov
import net.minecraftforge.client.event.FOVUpdateEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void onFov(FOVUpdateEvent event) {
if (isKnockedOut) {
event.setNewfov(0.5f);
}
}
示例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);
}
示例14: onFOVUpdate
import net.minecraftforge.client.event.FOVUpdateEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void onFOVUpdate(FOVUpdateEvent evt) {
if (isUsingBinoculars() && mc.gameSettings.thirdPersonView == 0) {
evt.setNewfov(currentZoom);
}
}
示例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);
}