Jump to content

[Solved]FOV multiplier


Noah_Beech

Recommended Posts

replace this:

(EntityPlayer)tickData[0]

with this:

Minecraft.getMinecraft().thePlayer

 

tickData[0] is the partialTickTime, which is a float.

 

Also you should check if Minecraft.getMinecraft().thePlayer is not null before executing your code.

Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! |

mah twitter

This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.

Link to comment
Share on other sites

Okay, I've got it to almost work! :D, just that, The jiggling thing is happening again :/.

 

TickHandler

package mod_Rareores;

import java.util.EnumSet;

import net.minecraft.client.Minecraft;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;

import cpw.mods.fml.common.ITickHandler;
import cpw.mods.fml.common.TickType;

public class ClientTickHandler implements ITickHandler {


private void onPlayerTick(EntityPlayer player) {
	if(player != null){
if (player.isUsingItem() && player.getItemInUse().itemID == mod_rareores.ItemPherithiumBow.itemID){
	System.out.println("This works 10");
	mod_rareores.proxy.onBowFOVZoom(player);
}
	}
}
@Override
public void tickStart(EnumSet<TickType> type, Object... tickData) {
	if(type.equals(EnumSet.of(TickType.RENDER))){
		System.out.println("This works 1");
		this.onPlayerTick(Minecraft.getMinecraft().thePlayer);


}
}
@Override
public void tickEnd(EnumSet<TickType> type, Object... tickData) {
	// TODO Auto-generated method stub

}

@Override
public EnumSet<TickType> ticks() {
	// TODO Auto-generated method stub
	 return EnumSet.of(TickType.RENDER, TickType.CLIENT);
}

@Override
public String getLabel() {
	// TODO Auto-generated method stub
	return null;
}

}

 

commonproxy

package rareores.Common;

import cpw.mods.fml.common.registry.TickRegistry;
import cpw.mods.fml.relauncher.Side;
import mod_Rareores.ClientTickHandler;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;

public class CommonProxyRareores {

public void registerRenderers(){


}
public void onBowFOVZoom(EntityPlayer player){


}
public void registerClientTickHandler()
 {
  TickRegistry.registerTickHandler(new ClientTickHandler(), Side.CLIENT);
 }
}

 

clientproxy

package mod_Rareores;

import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.EntityRenderer;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.client.IItemRenderer;
import net.minecraftforge.client.MinecraftForgeClient;
import cpw.mods.fml.client.registry.RenderingRegistry;
import cpw.mods.fml.common.ObfuscationReflectionHelper;
import rareores.Common.CommonProxyRareores;

public class ClientProxyRareores extends CommonProxyRareores {

@Override
public void registerRenderers(){

RenderingRegistry.registerEntityRenderingHandler(EntityInvisibleArrow.class, new RenderInvisibleArrow());
}
@Override
public void onBowFOVZoom(EntityPlayer player){
System.out.println("This works 100");
float f = 1.0F;

    if (player.isUsingItem() && player.getItemInUse().itemID == mod_rareores.ItemPherithiumBow.itemID)
    {
    	
    	
        int i = player.getItemInUseDuration();
        float f1 = (float)i / 16.0F;

        if (f1 > 1.0F)
        {
            f1 = 1.0F;
            
        }
        else
        {
            f1 *= f1;
        }
    	
        f *= 1.0F - f1 * 0.15F;
    	}
    	
    
    float fovModifierHand = ObfuscationReflectionHelper.getPrivateValue(EntityRenderer.class, Minecraft.getMinecraft().entityRenderer, "fovModifierHand", "field_78507_R");
    fovModifierHand += (f - fovModifierHand) * 0.5F;

    if (fovModifierHand > 1.5F)
    {
        fovModifierHand = 1.5F;
    }

    if (fovModifierHand < 0.1F)
    {
        fovModifierHand = 0.1F;
    }
    ObfuscationReflectionHelper.setPrivateValue(EntityRenderer.class, Minecraft.getMinecraft().entityRenderer, fovModifierHand, "fovModifierHand", "field_78507_R");
}
}

Thanks, hopefully this will be the last post :D.

This is the creator of the Rareores mod! Be sure to check it out at

Link to comment
Share on other sites

Okay, I've got it to almost work! :D, just that, The jiggling thing is happening again :/.

 

TickHandler

package mod_Rareores;

import java.util.EnumSet;

import net.minecraft.client.Minecraft;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;

import cpw.mods.fml.common.ITickHandler;
import cpw.mods.fml.common.TickType;

public class ClientTickHandler implements ITickHandler {


private void onPlayerTick(EntityPlayer player) {
	if(player != null){
if (player.isUsingItem() && player.getItemInUse().itemID == mod_rareores.ItemPherithiumBow.itemID){
	System.out.println("This works 10");
	mod_rareores.proxy.onBowFOVZoom(player);
}
	}
}
@Override
public void tickStart(EnumSet<TickType> type, Object... tickData) {
	if(type.equals(EnumSet.of(TickType.RENDER))){
		System.out.println("This works 1");
		this.onPlayerTick(Minecraft.getMinecraft().thePlayer);


}
}
@Override
public void tickEnd(EnumSet<TickType> type, Object... tickData) {
	// TODO Auto-generated method stub

}

@Override
public EnumSet<TickType> ticks() {
	// TODO Auto-generated method stub
	 return EnumSet.of(TickType.RENDER, TickType.CLIENT);
}

@Override
public String getLabel() {
	// TODO Auto-generated method stub
	return null;
}

}

 

commonproxy

package rareores.Common;

import cpw.mods.fml.common.registry.TickRegistry;
import cpw.mods.fml.relauncher.Side;
import mod_Rareores.ClientTickHandler;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;

public class CommonProxyRareores {

public void registerRenderers(){


}
public void onBowFOVZoom(EntityPlayer player){


}
public void registerClientTickHandler()
 {
  TickRegistry.registerTickHandler(new ClientTickHandler(), Side.CLIENT);
 }
}

 

clientproxy

package mod_Rareores;

import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.EntityRenderer;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.client.IItemRenderer;
import net.minecraftforge.client.MinecraftForgeClient;
import cpw.mods.fml.client.registry.RenderingRegistry;
import cpw.mods.fml.common.ObfuscationReflectionHelper;
import rareores.Common.CommonProxyRareores;

public class ClientProxyRareores extends CommonProxyRareores {

@Override
public void registerRenderers(){

RenderingRegistry.registerEntityRenderingHandler(EntityInvisibleArrow.class, new RenderInvisibleArrow());
}
@Override
public void onBowFOVZoom(EntityPlayer player){
System.out.println("This works 100");
float f = 1.0F;

    if (player.isUsingItem() && player.getItemInUse().itemID == mod_rareores.ItemPherithiumBow.itemID)
    {
    	
    	
        int i = player.getItemInUseDuration();
        float f1 = (float)i / 16.0F;

        if (f1 > 1.0F)
        {
            f1 = 1.0F;
            
        }
        else
        {
            f1 *= f1;
        }
    	
        f *= 1.0F - f1 * 0.15F;
    	}
    	
    
    float fovModifierHand = ObfuscationReflectionHelper.getPrivateValue(EntityRenderer.class, Minecraft.getMinecraft().entityRenderer, "fovModifierHand", "field_78507_R");
    fovModifierHand += (f - fovModifierHand) * 0.5F;

    if (fovModifierHand > 1.5F)
    {
        fovModifierHand = 1.5F;
    }

    if (fovModifierHand < 0.1F)
    {
        fovModifierHand = 0.1F;
    }
    ObfuscationReflectionHelper.setPrivateValue(EntityRenderer.class, Minecraft.getMinecraft().entityRenderer, fovModifierHand, "fovModifierHand", "field_78507_R");
}
}

Thanks, hopefully this will be the last post :D.

This is the creator of the Rareores mod! Be sure to check it out at

Link to comment
Share on other sites

Here's my code. Yours is similar... find out what I did differently :P

TickHandler (tickStart)

		if(type.equals(EnumSet.of(TickType.RENDER))) {
		if(this.mc.thePlayer != null
				&& this.mc.thePlayer.isUsingItem()
				&& this.mc.thePlayer.getItemInUse().itemID == ESPModRegistry.niobBow.itemID) {
			ESPModRegistry.proxy.onBowUse(this.mc.thePlayer.getItemInUse(), this.mc.thePlayer);
		} else {
			ESPModRegistry.proxy.resetSavedFOV();
		}
	}

 

CommonProxy

	public void onBowUse(ItemStack stack, EntityPlayer player) {
	;
}

public void resetSavedFOV() {
	;
}

 

Client Proxy

	public float fovModifierHand = 0F;

    @Override
    public void onBowUse(ItemStack stack, EntityPlayer player) {
        float f = 1.0F;

        if (player.capabilities.isFlying)
        {
            f *= 1.1F;
        }
        
        float speedOnGround = 0.1F;

        f *= (player.landMovementFactor * player.getSpeedModifier() / speedOnGround + 1.0F) / 2.0F;
        
	int i = player.getItemInUseDuration();
        float f1 = (float)i / 10.0F;

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

        f *= 1.0F - f1 * 0.25F;
        
        fovModifierHand = fovModifierHand > 0.001F ? fovModifierHand : (Float)ObfuscationReflectionHelper.getPrivateValue(EntityRenderer.class, Minecraft.getMinecraft().entityRenderer, "fovModifierHand", "field_78507_R");
        fovModifierHand += (f - fovModifierHand) * 0.5F;

        if (fovModifierHand > 1.5F)
        {
            fovModifierHand = 1.5F;
        }

        if (fovModifierHand < 0.1F)
        {
            fovModifierHand = 0.1F;
        }
        
	ObfuscationReflectionHelper.setPrivateValue(EntityRenderer.class, Minecraft.getMinecraft().entityRenderer, fovModifierHand, "fovModifierHand", "field_78507_R");
    }
    
    @Override
    public void resetSavedFOV() {
    	this.fovModifierHand = 0F;
    }

 

I saved the fovModifierHand into a class variable when first called, modify that and set this variable. When the FOV should reset, the variable is set to 0F again.

Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! |

mah twitter

This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.

Link to comment
Share on other sites

Here's my code. Yours is similar... find out what I did differently :P

TickHandler (tickStart)

		if(type.equals(EnumSet.of(TickType.RENDER))) {
		if(this.mc.thePlayer != null
				&& this.mc.thePlayer.isUsingItem()
				&& this.mc.thePlayer.getItemInUse().itemID == ESPModRegistry.niobBow.itemID) {
			ESPModRegistry.proxy.onBowUse(this.mc.thePlayer.getItemInUse(), this.mc.thePlayer);
		} else {
			ESPModRegistry.proxy.resetSavedFOV();
		}
	}

 

CommonProxy

	public void onBowUse(ItemStack stack, EntityPlayer player) {
	;
}

public void resetSavedFOV() {
	;
}

 

Client Proxy

	public float fovModifierHand = 0F;

    @Override
    public void onBowUse(ItemStack stack, EntityPlayer player) {
        float f = 1.0F;

        if (player.capabilities.isFlying)
        {
            f *= 1.1F;
        }
        
        float speedOnGround = 0.1F;

        f *= (player.landMovementFactor * player.getSpeedModifier() / speedOnGround + 1.0F) / 2.0F;
        
	int i = player.getItemInUseDuration();
        float f1 = (float)i / 10.0F;

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

        f *= 1.0F - f1 * 0.25F;
        
        fovModifierHand = fovModifierHand > 0.001F ? fovModifierHand : (Float)ObfuscationReflectionHelper.getPrivateValue(EntityRenderer.class, Minecraft.getMinecraft().entityRenderer, "fovModifierHand", "field_78507_R");
        fovModifierHand += (f - fovModifierHand) * 0.5F;

        if (fovModifierHand > 1.5F)
        {
            fovModifierHand = 1.5F;
        }

        if (fovModifierHand < 0.1F)
        {
            fovModifierHand = 0.1F;
        }
        
	ObfuscationReflectionHelper.setPrivateValue(EntityRenderer.class, Minecraft.getMinecraft().entityRenderer, fovModifierHand, "fovModifierHand", "field_78507_R");
    }
    
    @Override
    public void resetSavedFOV() {
    	this.fovModifierHand = 0F;
    }

 

I saved the fovModifierHand into a class variable when first called, modify that and set this variable. When the FOV should reset, the variable is set to 0F again.

Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! |

mah twitter

This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.

Link to comment
Share on other sites

Okay, Jumped to a conclusion a bit too fast. It works lovely with just one bow, but when I try doing with Multiple bows I get the jiggling issue again.

 

commonproxy

package rareores.Common;

import cpw.mods.fml.common.registry.TickRegistry;
import cpw.mods.fml.relauncher.Side;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;

public class CommonProxyRareores {

public void registerRenderers(){


}
public void onBowFOVZoomPherithium(EntityPlayer player, ItemStack stack){
	;

}
public void onBowFOVZoomCrystinium(EntityPlayer player, ItemStack stack){
	;

}
public void onBowFOVZoomTophinite(EntityPlayer player, ItemStack stack){
	;

}
public void onBowFOVZoomMagrolith(EntityPlayer player, ItemStack stack){
	;

}
public void onBowFOVZoomNecronite(EntityPlayer player, ItemStack stack){
	;

}
public void onBowFOVZoomGold(EntityPlayer player, ItemStack stack){
	;

}
public void onBowFOVZoomIron(EntityPlayer player, ItemStack stack){
	;

}
public void onBowFOVZoomDiamond(EntityPlayer player, ItemStack stack){
	;

}
public void onBowFOVZoomTrillint(EntityPlayer player, ItemStack stack){
	;

}
public void onBowFOVZoomNether(EntityPlayer player, ItemStack stack){
	;

}
public void resetSavedFOV() {
	  ;
	 }
public void registerClientTickHandlerPherithium()
 {
  
 }
public void registerClientTickHandlerNether()
 {
  
 }
public void registerClientTickHandlerCrystinium()
 {
  
 }
public void registerClientTickHandlerTophinite()
 {
  
 }
public void registerClientTickHandlerNecronite()
 {
  
 }
public void registerClientTickHandlerMagrolith()
 {
  
 }
public void registerClientTickHandlerIron()
 {
  
 }
public void registerClientTickHandlerGold()
 {
  
 }
public void registerClientTickHandlerDiamond()
 {
  
 }
public void registerClientTickHandlerTrillint()
 {
  
 }
}

 

clientproxy

package mod_Rareores;

import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.EntityRenderer;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import rareores.Common.CommonProxyRareores;
import cpw.mods.fml.client.registry.RenderingRegistry;
import cpw.mods.fml.common.ObfuscationReflectionHelper;
import cpw.mods.fml.common.registry.TickRegistry;
import cpw.mods.fml.relauncher.Side;

public class ClientProxyRareores extends CommonProxyRareores {

@Override
public void registerRenderers(){

RenderingRegistry.registerEntityRenderingHandler(EntityInvisibleArrow.class, new RenderInvisibleArrow());
}
public float fovModifierHand = 0F;

@Override
public void onBowFOVZoomPherithium(EntityPlayer player,ItemStack stack) {
    float f = 1.0F;

    if (player.capabilities.isFlying)
    {
        f *= 1.1F;
    }
    
    float speedOnGround = 0.1F;

    f *= (player.landMovementFactor * player.getSpeedModifier() / speedOnGround + 1.0F) / 2.0F;
    
int i = player.getItemInUseDuration();
    float f1 = (float)i / 16.0F;

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

    f *= 1.0F - f1 * 0.2F;
    
    fovModifierHand = fovModifierHand > 0.001F ? fovModifierHand : (Float)ObfuscationReflectionHelper.getPrivateValue(EntityRenderer.class, Minecraft.getMinecraft().entityRenderer, "fovModifierHand", "field_78507_R");
    fovModifierHand += (f - fovModifierHand) * 0.5F;

    if (fovModifierHand > 1.5F)
    {
        fovModifierHand = 1.5F;
    }

    if (fovModifierHand < 0.1F)
    {
        fovModifierHand = 0.1F;
    }
    
ObfuscationReflectionHelper.setPrivateValue(EntityRenderer.class, Minecraft.getMinecraft().entityRenderer, fovModifierHand, "fovModifierHand", "field_78507_R");
}
@Override
public void onBowFOVZoomCrystinium(EntityPlayer player, ItemStack stack){
float f = 1.0F;

    if (player.capabilities.isFlying)
    {
        f *= 1.1F;
    }
    
    float speedOnGround = 0.1F;

    f *= (player.landMovementFactor * player.getSpeedModifier() / speedOnGround + 1.0F) / 2.0F;
    
int i = player.getItemInUseDuration();
    float f1 = (float)i / 15.0F;

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

    f *= 1.0F - f1 * 0.2F;
    
    fovModifierHand = fovModifierHand > 0.001F ? fovModifierHand : (Float)ObfuscationReflectionHelper.getPrivateValue(EntityRenderer.class, Minecraft.getMinecraft().entityRenderer, "fovModifierHand", "field_78507_R");
    fovModifierHand += (f - fovModifierHand) * 0.5F;

    if (fovModifierHand > 1.5F)
    {
        fovModifierHand = 1.5F;
    }

    if (fovModifierHand < 0.1F)
    {
        fovModifierHand = 0.1F;
    }
    
ObfuscationReflectionHelper.setPrivateValue(EntityRenderer.class, Minecraft.getMinecraft().entityRenderer, fovModifierHand, "fovModifierHand", "field_78507_R");
}
@Override
public void onBowFOVZoomTophinite(EntityPlayer player, ItemStack stack){
float f = 1.0F;

    if (player.capabilities.isFlying)
    {
        f *= 1.1F;
    }
    
    float speedOnGround = 0.1F;

    f *= (player.landMovementFactor * player.getSpeedModifier() / speedOnGround + 1.0F) / 2.0F;
    
int i = player.getItemInUseDuration();
    float f1 = (float)i / 16.0F;

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

    f *= 1.0F - f1 * 0.525F;
    
    fovModifierHand = fovModifierHand > 0.001F ? fovModifierHand : (Float)ObfuscationReflectionHelper.getPrivateValue(EntityRenderer.class, Minecraft.getMinecraft().entityRenderer, "fovModifierHand", "field_78507_R");
    fovModifierHand += (f - fovModifierHand) * 0.5F;

    if (fovModifierHand > 1.5F)
    {
        fovModifierHand = 1.5F;
    }

    if (fovModifierHand < 0.1F)
    {
        fovModifierHand = 0.1F;
    }
    
ObfuscationReflectionHelper.setPrivateValue(EntityRenderer.class, Minecraft.getMinecraft().entityRenderer, fovModifierHand, "fovModifierHand", "field_78507_R");
}
@Override
public void onBowFOVZoomMagrolith(EntityPlayer player, ItemStack stack){
float f = 1.0F;

    if (player.capabilities.isFlying)
    {
        f *= 1.1F;
    }
    
    float speedOnGround = 0.1F;

    f *= (player.landMovementFactor * player.getSpeedModifier() / speedOnGround + 1.0F) / 2.0F;
    
int i = player.getItemInUseDuration();
    float f1 = (float)i / 36.0F;

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

    f *= 1.0F - f1 * 0.375F;
    
    fovModifierHand = fovModifierHand > 0.001F ? fovModifierHand : (Float)ObfuscationReflectionHelper.getPrivateValue(EntityRenderer.class, Minecraft.getMinecraft().entityRenderer, "fovModifierHand", "field_78507_R");
    fovModifierHand += (f - fovModifierHand) * 0.5F;

    if (fovModifierHand > 1.5F)
    {
        fovModifierHand = 1.5F;
    }

    if (fovModifierHand < 0.1F)
    {
        fovModifierHand = 0.1F;
    }
    
ObfuscationReflectionHelper.setPrivateValue(EntityRenderer.class, Minecraft.getMinecraft().entityRenderer, fovModifierHand, "fovModifierHand", "field_78507_R");

}
@Override
public void onBowFOVZoomNecronite(EntityPlayer player, ItemStack stack){
float f = 1.0F;

    if (player.capabilities.isFlying)
    {
        f *= 1.1F;
    }
    
    float speedOnGround = 0.1F;

    f *= (player.landMovementFactor * player.getSpeedModifier() / speedOnGround + 1.0F) / 2.0F;
    
int i = player.getItemInUseDuration();
    float f1 = (float)i / 14.0F;

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

    f *= 1.0F - f1 * 0.2F;
    
    fovModifierHand = fovModifierHand > 0.001F ? fovModifierHand : (Float)ObfuscationReflectionHelper.getPrivateValue(EntityRenderer.class, Minecraft.getMinecraft().entityRenderer, "fovModifierHand", "field_78507_R");
    fovModifierHand += (f - fovModifierHand) * 0.5F;

    if (fovModifierHand > 1.5F)
    {
        fovModifierHand = 1.5F;
    }

    if (fovModifierHand < 0.1F)
    {
        fovModifierHand = 0.1F;
    }
    
ObfuscationReflectionHelper.setPrivateValue(EntityRenderer.class, Minecraft.getMinecraft().entityRenderer, fovModifierHand, "fovModifierHand", "field_78507_R");
}
@Override
public void onBowFOVZoomGold(EntityPlayer player, ItemStack stack){
float f = 1.0F;

    if (player.capabilities.isFlying)
    {
        f *= 1.1F;
    }
    
    float speedOnGround = 0.1F;

    f *= (player.landMovementFactor * player.getSpeedModifier() / speedOnGround + 1.0F) / 2.0F;
    
int i = player.getItemInUseDuration();
    float f1 = (float)i / 10.0F;

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

    f *= 1.0F - f1 * 0.1F;
    
    fovModifierHand = fovModifierHand > 0.001F ? fovModifierHand : (Float)ObfuscationReflectionHelper.getPrivateValue(EntityRenderer.class, Minecraft.getMinecraft().entityRenderer, "fovModifierHand", "field_78507_R");
    fovModifierHand += (f - fovModifierHand) * 0.5F;

    if (fovModifierHand > 1.5F)
    {
        fovModifierHand = 1.5F;
    }

    if (fovModifierHand < 0.1F)
    {
        fovModifierHand = 0.1F;
    }
    
ObfuscationReflectionHelper.setPrivateValue(EntityRenderer.class, Minecraft.getMinecraft().entityRenderer, fovModifierHand, "fovModifierHand", "field_78507_R");

}
@Override
public void onBowFOVZoomIron(EntityPlayer player, ItemStack stack){
float f = 1.0F;

    if (player.capabilities.isFlying)
    {
        f *= 1.1F;
    }
    
    float speedOnGround = 0.1F;

    f *= (player.landMovementFactor * player.getSpeedModifier() / speedOnGround + 1.0F) / 2.0F;
    
int i = player.getItemInUseDuration();
    float f1 = (float)i / 19.0F;

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

    f *= 1.0F - f1 * 0.16F;
    
    fovModifierHand = fovModifierHand > 0.001F ? fovModifierHand : (Float)ObfuscationReflectionHelper.getPrivateValue(EntityRenderer.class, Minecraft.getMinecraft().entityRenderer, "fovModifierHand", "field_78507_R");
    fovModifierHand += (f - fovModifierHand) * 0.5F;

    if (fovModifierHand > 1.5F)
    {
        fovModifierHand = 1.5F;
    }

    if (fovModifierHand < 0.1F)
    {
        fovModifierHand = 0.1F;
    }
    
ObfuscationReflectionHelper.setPrivateValue(EntityRenderer.class, Minecraft.getMinecraft().entityRenderer, fovModifierHand, "fovModifierHand", "field_78507_R");

}
@Override
public void onBowFOVZoomDiamond(EntityPlayer player, ItemStack stack){
float f = 1.0F;

    if (player.capabilities.isFlying)
    {
        f *= 1.1F;
    }
    
    float speedOnGround = 0.1F;

    f *= (player.landMovementFactor * player.getSpeedModifier() / speedOnGround + 1.0F) / 2.0F;
    
int i = player.getItemInUseDuration();
    float f1 = (float)i / 18.0F;

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

    f *= 1.0F - f1 * 0.175F;
    
    fovModifierHand = fovModifierHand > 0.001F ? fovModifierHand : (Float)ObfuscationReflectionHelper.getPrivateValue(EntityRenderer.class, Minecraft.getMinecraft().entityRenderer, "fovModifierHand", "field_78507_R");
    fovModifierHand += (f - fovModifierHand) * 0.5F;

    if (fovModifierHand > 1.5F)
    {
        fovModifierHand = 1.5F;
    }

    if (fovModifierHand < 0.1F)
    {
        fovModifierHand = 0.1F;
    }
    
ObfuscationReflectionHelper.setPrivateValue(EntityRenderer.class, Minecraft.getMinecraft().entityRenderer, fovModifierHand, "fovModifierHand", "field_78507_R");

}
@Override
public void onBowFOVZoomTrillint(EntityPlayer player, ItemStack stack){
float f = 1.0F;

    if (player.capabilities.isFlying)
    {
        f *= 1.1F;
    }
    
    float speedOnGround = 0.1F;

    f *= (player.landMovementFactor * player.getSpeedModifier() / speedOnGround + 1.0F) / 2.0F;
    
int i = player.getItemInUseDuration();
    float f1 = (float)i / 16.0F;

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

    f *= 1.0F - f1 * 0.2F;
    
    fovModifierHand = fovModifierHand > 0.001F ? fovModifierHand : (Float)ObfuscationReflectionHelper.getPrivateValue(EntityRenderer.class, Minecraft.getMinecraft().entityRenderer, "fovModifierHand", "field_78507_R");
    fovModifierHand += (f - fovModifierHand) * 0.5F;

    if (fovModifierHand > 1.5F)
    {
        fovModifierHand = 1.5F;
    }

    if (fovModifierHand < 0.1F)
    {
        fovModifierHand = 0.1F;
    }
    
ObfuscationReflectionHelper.setPrivateValue(EntityRenderer.class, Minecraft.getMinecraft().entityRenderer, fovModifierHand, "fovModifierHand", "field_78507_R");

}
@Override
public void onBowFOVZoomNether(EntityPlayer player, ItemStack stack){
float f = 1.0F;

    if (player.capabilities.isFlying)
    {
        f *= 1.1F;
    }
    
    float speedOnGround = 0.1F;

    f *= (player.landMovementFactor * player.getSpeedModifier() / speedOnGround + 1.0F) / 2.0F;
    
int i = player.getItemInUseDuration();
    float f1 = (float)i / 26.0F;

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

    f *= 1.0F - f1 * 0.87F;
    
    fovModifierHand = fovModifierHand > 0.001F ? fovModifierHand : (Float)ObfuscationReflectionHelper.getPrivateValue(EntityRenderer.class, Minecraft.getMinecraft().entityRenderer, "fovModifierHand", "field_78507_R");
    fovModifierHand += (f - fovModifierHand) * 0.5F;

    if (fovModifierHand > 1.5F)
    {
        fovModifierHand = 1.5F;
    }

    if (fovModifierHand < 0.1F)
    {
        fovModifierHand = 0.1F;
    }
    
ObfuscationReflectionHelper.setPrivateValue(EntityRenderer.class, Minecraft.getMinecraft().entityRenderer, fovModifierHand, "fovModifierHand", "field_78507_R");

}
@Override
public void resetSavedFOV() {
this.fovModifierHand = 0F;
}
@Override
public void registerClientTickHandlerPherithium()
{
TickRegistry.registerTickHandler(new ClientTickHandlerPherithium(), Side.CLIENT);

}
@Override
public void registerClientTickHandlerCrystinium()
{
TickRegistry.registerTickHandler(new ClientTickHandlerCrystinium(), Side.CLIENT);

}
@Override
public void registerClientTickHandlerTophinite()
{
TickRegistry.registerTickHandler(new ClientTickHandlerTophinite(), Side.CLIENT);

}
@Override
public void registerClientTickHandlerDiamond()
{
TickRegistry.registerTickHandler(new ClientTickHandlerDiamond(), Side.CLIENT);

}
@Override
public void registerClientTickHandlerIron()
{
TickRegistry.registerTickHandler(new ClientTickHandlerIron(), Side.CLIENT);

}
@Override
public void registerClientTickHandlerGold()
{
TickRegistry.registerTickHandler(new ClientTickHandlerGold(), Side.CLIENT);

}
@Override
public void registerClientTickHandlerNecronite()
{
TickRegistry.registerTickHandler(new ClientTickHandlerNecronite(), Side.CLIENT);

}
@Override
public void registerClientTickHandlerMagrolith()
{
TickRegistry.registerTickHandler(new ClientTickHandlerMagrolith(), Side.CLIENT);

}
@Override
public void registerClientTickHandlerTrillint()
{
TickRegistry.registerTickHandler(new ClientTickHandlerTrillint(), Side.CLIENT);

}
@Override
public void registerClientTickHandlerNether()
{
TickRegistry.registerTickHandler(new ClientTickHandlerNether(), Side.CLIENT);

}
}

 

one of my tick handlers(They are all identical except for which bowFOVZoom it chooses and the itemstack check)

package mod_Rareores;

import java.util.EnumSet;

import net.minecraft.client.Minecraft;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;

import cpw.mods.fml.common.ITickHandler;
import cpw.mods.fml.common.TickType;

public class ClientTickHandlerPherithium implements ITickHandler {

@Override
public void tickStart(EnumSet<TickType> type, Object... tickData) {

EntityPlayer player = Minecraft.getMinecraft().thePlayer;	
	if(type.equals(EnumSet.of(TickType.RENDER))) {
		   if(player != null
		     && player.isUsingItem()
		     && player.getItemInUse().itemID == mod_rareores.ItemPherithiumBow.itemID) {
		    mod_rareores.proxy.onBowFOVZoomPherithium(player, player.getItemInUse());
		   } 
		   
		   else {
		    mod_rareores.proxy.resetSavedFOV();
		   }
	}


}
@Override
public void tickEnd(EnumSet<TickType> type, Object... tickData) {
	// TODO Auto-generated method stub

}

@Override
public EnumSet<TickType> ticks() {
	// TODO Auto-generated method stub
	 return EnumSet.of(TickType.RENDER);
}

@Override
public String getLabel() {
	// TODO Auto-generated method stub
	return null;
}

}

 

And Each one was registered with it's own thingamagigger in the main mod file (too tired to think at this point).

 

Sorry to bug you one last time :/, but this is really strange.

This is the creator of the Rareores mod! Be sure to check it out at

Link to comment
Share on other sites

Okay, Jumped to a conclusion a bit too fast. It works lovely with just one bow, but when I try doing with Multiple bows I get the jiggling issue again.

 

commonproxy

package rareores.Common;

import cpw.mods.fml.common.registry.TickRegistry;
import cpw.mods.fml.relauncher.Side;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;

public class CommonProxyRareores {

public void registerRenderers(){


}
public void onBowFOVZoomPherithium(EntityPlayer player, ItemStack stack){
	;

}
public void onBowFOVZoomCrystinium(EntityPlayer player, ItemStack stack){
	;

}
public void onBowFOVZoomTophinite(EntityPlayer player, ItemStack stack){
	;

}
public void onBowFOVZoomMagrolith(EntityPlayer player, ItemStack stack){
	;

}
public void onBowFOVZoomNecronite(EntityPlayer player, ItemStack stack){
	;

}
public void onBowFOVZoomGold(EntityPlayer player, ItemStack stack){
	;

}
public void onBowFOVZoomIron(EntityPlayer player, ItemStack stack){
	;

}
public void onBowFOVZoomDiamond(EntityPlayer player, ItemStack stack){
	;

}
public void onBowFOVZoomTrillint(EntityPlayer player, ItemStack stack){
	;

}
public void onBowFOVZoomNether(EntityPlayer player, ItemStack stack){
	;

}
public void resetSavedFOV() {
	  ;
	 }
public void registerClientTickHandlerPherithium()
 {
  
 }
public void registerClientTickHandlerNether()
 {
  
 }
public void registerClientTickHandlerCrystinium()
 {
  
 }
public void registerClientTickHandlerTophinite()
 {
  
 }
public void registerClientTickHandlerNecronite()
 {
  
 }
public void registerClientTickHandlerMagrolith()
 {
  
 }
public void registerClientTickHandlerIron()
 {
  
 }
public void registerClientTickHandlerGold()
 {
  
 }
public void registerClientTickHandlerDiamond()
 {
  
 }
public void registerClientTickHandlerTrillint()
 {
  
 }
}

 

clientproxy

package mod_Rareores;

import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.EntityRenderer;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import rareores.Common.CommonProxyRareores;
import cpw.mods.fml.client.registry.RenderingRegistry;
import cpw.mods.fml.common.ObfuscationReflectionHelper;
import cpw.mods.fml.common.registry.TickRegistry;
import cpw.mods.fml.relauncher.Side;

public class ClientProxyRareores extends CommonProxyRareores {

@Override
public void registerRenderers(){

RenderingRegistry.registerEntityRenderingHandler(EntityInvisibleArrow.class, new RenderInvisibleArrow());
}
public float fovModifierHand = 0F;

@Override
public void onBowFOVZoomPherithium(EntityPlayer player,ItemStack stack) {
    float f = 1.0F;

    if (player.capabilities.isFlying)
    {
        f *= 1.1F;
    }
    
    float speedOnGround = 0.1F;

    f *= (player.landMovementFactor * player.getSpeedModifier() / speedOnGround + 1.0F) / 2.0F;
    
int i = player.getItemInUseDuration();
    float f1 = (float)i / 16.0F;

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

    f *= 1.0F - f1 * 0.2F;
    
    fovModifierHand = fovModifierHand > 0.001F ? fovModifierHand : (Float)ObfuscationReflectionHelper.getPrivateValue(EntityRenderer.class, Minecraft.getMinecraft().entityRenderer, "fovModifierHand", "field_78507_R");
    fovModifierHand += (f - fovModifierHand) * 0.5F;

    if (fovModifierHand > 1.5F)
    {
        fovModifierHand = 1.5F;
    }

    if (fovModifierHand < 0.1F)
    {
        fovModifierHand = 0.1F;
    }
    
ObfuscationReflectionHelper.setPrivateValue(EntityRenderer.class, Minecraft.getMinecraft().entityRenderer, fovModifierHand, "fovModifierHand", "field_78507_R");
}
@Override
public void onBowFOVZoomCrystinium(EntityPlayer player, ItemStack stack){
float f = 1.0F;

    if (player.capabilities.isFlying)
    {
        f *= 1.1F;
    }
    
    float speedOnGround = 0.1F;

    f *= (player.landMovementFactor * player.getSpeedModifier() / speedOnGround + 1.0F) / 2.0F;
    
int i = player.getItemInUseDuration();
    float f1 = (float)i / 15.0F;

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

    f *= 1.0F - f1 * 0.2F;
    
    fovModifierHand = fovModifierHand > 0.001F ? fovModifierHand : (Float)ObfuscationReflectionHelper.getPrivateValue(EntityRenderer.class, Minecraft.getMinecraft().entityRenderer, "fovModifierHand", "field_78507_R");
    fovModifierHand += (f - fovModifierHand) * 0.5F;

    if (fovModifierHand > 1.5F)
    {
        fovModifierHand = 1.5F;
    }

    if (fovModifierHand < 0.1F)
    {
        fovModifierHand = 0.1F;
    }
    
ObfuscationReflectionHelper.setPrivateValue(EntityRenderer.class, Minecraft.getMinecraft().entityRenderer, fovModifierHand, "fovModifierHand", "field_78507_R");
}
@Override
public void onBowFOVZoomTophinite(EntityPlayer player, ItemStack stack){
float f = 1.0F;

    if (player.capabilities.isFlying)
    {
        f *= 1.1F;
    }
    
    float speedOnGround = 0.1F;

    f *= (player.landMovementFactor * player.getSpeedModifier() / speedOnGround + 1.0F) / 2.0F;
    
int i = player.getItemInUseDuration();
    float f1 = (float)i / 16.0F;

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

    f *= 1.0F - f1 * 0.525F;
    
    fovModifierHand = fovModifierHand > 0.001F ? fovModifierHand : (Float)ObfuscationReflectionHelper.getPrivateValue(EntityRenderer.class, Minecraft.getMinecraft().entityRenderer, "fovModifierHand", "field_78507_R");
    fovModifierHand += (f - fovModifierHand) * 0.5F;

    if (fovModifierHand > 1.5F)
    {
        fovModifierHand = 1.5F;
    }

    if (fovModifierHand < 0.1F)
    {
        fovModifierHand = 0.1F;
    }
    
ObfuscationReflectionHelper.setPrivateValue(EntityRenderer.class, Minecraft.getMinecraft().entityRenderer, fovModifierHand, "fovModifierHand", "field_78507_R");
}
@Override
public void onBowFOVZoomMagrolith(EntityPlayer player, ItemStack stack){
float f = 1.0F;

    if (player.capabilities.isFlying)
    {
        f *= 1.1F;
    }
    
    float speedOnGround = 0.1F;

    f *= (player.landMovementFactor * player.getSpeedModifier() / speedOnGround + 1.0F) / 2.0F;
    
int i = player.getItemInUseDuration();
    float f1 = (float)i / 36.0F;

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

    f *= 1.0F - f1 * 0.375F;
    
    fovModifierHand = fovModifierHand > 0.001F ? fovModifierHand : (Float)ObfuscationReflectionHelper.getPrivateValue(EntityRenderer.class, Minecraft.getMinecraft().entityRenderer, "fovModifierHand", "field_78507_R");
    fovModifierHand += (f - fovModifierHand) * 0.5F;

    if (fovModifierHand > 1.5F)
    {
        fovModifierHand = 1.5F;
    }

    if (fovModifierHand < 0.1F)
    {
        fovModifierHand = 0.1F;
    }
    
ObfuscationReflectionHelper.setPrivateValue(EntityRenderer.class, Minecraft.getMinecraft().entityRenderer, fovModifierHand, "fovModifierHand", "field_78507_R");

}
@Override
public void onBowFOVZoomNecronite(EntityPlayer player, ItemStack stack){
float f = 1.0F;

    if (player.capabilities.isFlying)
    {
        f *= 1.1F;
    }
    
    float speedOnGround = 0.1F;

    f *= (player.landMovementFactor * player.getSpeedModifier() / speedOnGround + 1.0F) / 2.0F;
    
int i = player.getItemInUseDuration();
    float f1 = (float)i / 14.0F;

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

    f *= 1.0F - f1 * 0.2F;
    
    fovModifierHand = fovModifierHand > 0.001F ? fovModifierHand : (Float)ObfuscationReflectionHelper.getPrivateValue(EntityRenderer.class, Minecraft.getMinecraft().entityRenderer, "fovModifierHand", "field_78507_R");
    fovModifierHand += (f - fovModifierHand) * 0.5F;

    if (fovModifierHand > 1.5F)
    {
        fovModifierHand = 1.5F;
    }

    if (fovModifierHand < 0.1F)
    {
        fovModifierHand = 0.1F;
    }
    
ObfuscationReflectionHelper.setPrivateValue(EntityRenderer.class, Minecraft.getMinecraft().entityRenderer, fovModifierHand, "fovModifierHand", "field_78507_R");
}
@Override
public void onBowFOVZoomGold(EntityPlayer player, ItemStack stack){
float f = 1.0F;

    if (player.capabilities.isFlying)
    {
        f *= 1.1F;
    }
    
    float speedOnGround = 0.1F;

    f *= (player.landMovementFactor * player.getSpeedModifier() / speedOnGround + 1.0F) / 2.0F;
    
int i = player.getItemInUseDuration();
    float f1 = (float)i / 10.0F;

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

    f *= 1.0F - f1 * 0.1F;
    
    fovModifierHand = fovModifierHand > 0.001F ? fovModifierHand : (Float)ObfuscationReflectionHelper.getPrivateValue(EntityRenderer.class, Minecraft.getMinecraft().entityRenderer, "fovModifierHand", "field_78507_R");
    fovModifierHand += (f - fovModifierHand) * 0.5F;

    if (fovModifierHand > 1.5F)
    {
        fovModifierHand = 1.5F;
    }

    if (fovModifierHand < 0.1F)
    {
        fovModifierHand = 0.1F;
    }
    
ObfuscationReflectionHelper.setPrivateValue(EntityRenderer.class, Minecraft.getMinecraft().entityRenderer, fovModifierHand, "fovModifierHand", "field_78507_R");

}
@Override
public void onBowFOVZoomIron(EntityPlayer player, ItemStack stack){
float f = 1.0F;

    if (player.capabilities.isFlying)
    {
        f *= 1.1F;
    }
    
    float speedOnGround = 0.1F;

    f *= (player.landMovementFactor * player.getSpeedModifier() / speedOnGround + 1.0F) / 2.0F;
    
int i = player.getItemInUseDuration();
    float f1 = (float)i / 19.0F;

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

    f *= 1.0F - f1 * 0.16F;
    
    fovModifierHand = fovModifierHand > 0.001F ? fovModifierHand : (Float)ObfuscationReflectionHelper.getPrivateValue(EntityRenderer.class, Minecraft.getMinecraft().entityRenderer, "fovModifierHand", "field_78507_R");
    fovModifierHand += (f - fovModifierHand) * 0.5F;

    if (fovModifierHand > 1.5F)
    {
        fovModifierHand = 1.5F;
    }

    if (fovModifierHand < 0.1F)
    {
        fovModifierHand = 0.1F;
    }
    
ObfuscationReflectionHelper.setPrivateValue(EntityRenderer.class, Minecraft.getMinecraft().entityRenderer, fovModifierHand, "fovModifierHand", "field_78507_R");

}
@Override
public void onBowFOVZoomDiamond(EntityPlayer player, ItemStack stack){
float f = 1.0F;

    if (player.capabilities.isFlying)
    {
        f *= 1.1F;
    }
    
    float speedOnGround = 0.1F;

    f *= (player.landMovementFactor * player.getSpeedModifier() / speedOnGround + 1.0F) / 2.0F;
    
int i = player.getItemInUseDuration();
    float f1 = (float)i / 18.0F;

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

    f *= 1.0F - f1 * 0.175F;
    
    fovModifierHand = fovModifierHand > 0.001F ? fovModifierHand : (Float)ObfuscationReflectionHelper.getPrivateValue(EntityRenderer.class, Minecraft.getMinecraft().entityRenderer, "fovModifierHand", "field_78507_R");
    fovModifierHand += (f - fovModifierHand) * 0.5F;

    if (fovModifierHand > 1.5F)
    {
        fovModifierHand = 1.5F;
    }

    if (fovModifierHand < 0.1F)
    {
        fovModifierHand = 0.1F;
    }
    
ObfuscationReflectionHelper.setPrivateValue(EntityRenderer.class, Minecraft.getMinecraft().entityRenderer, fovModifierHand, "fovModifierHand", "field_78507_R");

}
@Override
public void onBowFOVZoomTrillint(EntityPlayer player, ItemStack stack){
float f = 1.0F;

    if (player.capabilities.isFlying)
    {
        f *= 1.1F;
    }
    
    float speedOnGround = 0.1F;

    f *= (player.landMovementFactor * player.getSpeedModifier() / speedOnGround + 1.0F) / 2.0F;
    
int i = player.getItemInUseDuration();
    float f1 = (float)i / 16.0F;

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

    f *= 1.0F - f1 * 0.2F;
    
    fovModifierHand = fovModifierHand > 0.001F ? fovModifierHand : (Float)ObfuscationReflectionHelper.getPrivateValue(EntityRenderer.class, Minecraft.getMinecraft().entityRenderer, "fovModifierHand", "field_78507_R");
    fovModifierHand += (f - fovModifierHand) * 0.5F;

    if (fovModifierHand > 1.5F)
    {
        fovModifierHand = 1.5F;
    }

    if (fovModifierHand < 0.1F)
    {
        fovModifierHand = 0.1F;
    }
    
ObfuscationReflectionHelper.setPrivateValue(EntityRenderer.class, Minecraft.getMinecraft().entityRenderer, fovModifierHand, "fovModifierHand", "field_78507_R");

}
@Override
public void onBowFOVZoomNether(EntityPlayer player, ItemStack stack){
float f = 1.0F;

    if (player.capabilities.isFlying)
    {
        f *= 1.1F;
    }
    
    float speedOnGround = 0.1F;

    f *= (player.landMovementFactor * player.getSpeedModifier() / speedOnGround + 1.0F) / 2.0F;
    
int i = player.getItemInUseDuration();
    float f1 = (float)i / 26.0F;

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

    f *= 1.0F - f1 * 0.87F;
    
    fovModifierHand = fovModifierHand > 0.001F ? fovModifierHand : (Float)ObfuscationReflectionHelper.getPrivateValue(EntityRenderer.class, Minecraft.getMinecraft().entityRenderer, "fovModifierHand", "field_78507_R");
    fovModifierHand += (f - fovModifierHand) * 0.5F;

    if (fovModifierHand > 1.5F)
    {
        fovModifierHand = 1.5F;
    }

    if (fovModifierHand < 0.1F)
    {
        fovModifierHand = 0.1F;
    }
    
ObfuscationReflectionHelper.setPrivateValue(EntityRenderer.class, Minecraft.getMinecraft().entityRenderer, fovModifierHand, "fovModifierHand", "field_78507_R");

}
@Override
public void resetSavedFOV() {
this.fovModifierHand = 0F;
}
@Override
public void registerClientTickHandlerPherithium()
{
TickRegistry.registerTickHandler(new ClientTickHandlerPherithium(), Side.CLIENT);

}
@Override
public void registerClientTickHandlerCrystinium()
{
TickRegistry.registerTickHandler(new ClientTickHandlerCrystinium(), Side.CLIENT);

}
@Override
public void registerClientTickHandlerTophinite()
{
TickRegistry.registerTickHandler(new ClientTickHandlerTophinite(), Side.CLIENT);

}
@Override
public void registerClientTickHandlerDiamond()
{
TickRegistry.registerTickHandler(new ClientTickHandlerDiamond(), Side.CLIENT);

}
@Override
public void registerClientTickHandlerIron()
{
TickRegistry.registerTickHandler(new ClientTickHandlerIron(), Side.CLIENT);

}
@Override
public void registerClientTickHandlerGold()
{
TickRegistry.registerTickHandler(new ClientTickHandlerGold(), Side.CLIENT);

}
@Override
public void registerClientTickHandlerNecronite()
{
TickRegistry.registerTickHandler(new ClientTickHandlerNecronite(), Side.CLIENT);

}
@Override
public void registerClientTickHandlerMagrolith()
{
TickRegistry.registerTickHandler(new ClientTickHandlerMagrolith(), Side.CLIENT);

}
@Override
public void registerClientTickHandlerTrillint()
{
TickRegistry.registerTickHandler(new ClientTickHandlerTrillint(), Side.CLIENT);

}
@Override
public void registerClientTickHandlerNether()
{
TickRegistry.registerTickHandler(new ClientTickHandlerNether(), Side.CLIENT);

}
}

 

one of my tick handlers(They are all identical except for which bowFOVZoom it chooses and the itemstack check)

package mod_Rareores;

import java.util.EnumSet;

import net.minecraft.client.Minecraft;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;

import cpw.mods.fml.common.ITickHandler;
import cpw.mods.fml.common.TickType;

public class ClientTickHandlerPherithium implements ITickHandler {

@Override
public void tickStart(EnumSet<TickType> type, Object... tickData) {

EntityPlayer player = Minecraft.getMinecraft().thePlayer;	
	if(type.equals(EnumSet.of(TickType.RENDER))) {
		   if(player != null
		     && player.isUsingItem()
		     && player.getItemInUse().itemID == mod_rareores.ItemPherithiumBow.itemID) {
		    mod_rareores.proxy.onBowFOVZoomPherithium(player, player.getItemInUse());
		   } 
		   
		   else {
		    mod_rareores.proxy.resetSavedFOV();
		   }
	}


}
@Override
public void tickEnd(EnumSet<TickType> type, Object... tickData) {
	// TODO Auto-generated method stub

}

@Override
public EnumSet<TickType> ticks() {
	// TODO Auto-generated method stub
	 return EnumSet.of(TickType.RENDER);
}

@Override
public String getLabel() {
	// TODO Auto-generated method stub
	return null;
}

}

 

And Each one was registered with it's own thingamagigger in the main mod file (too tired to think at this point).

 

Sorry to bug you one last time :/, but this is really strange.

This is the creator of the Rareores mod! Be sure to check it out at

Link to comment
Share on other sites

	public void onBowFOVZoomDiamond(EntityPlayer player, ItemStack stack){
	;

}
public void onBowFOVZoomTrillint(EntityPlayer player, ItemStack stack){
	;

}
public void onBowFOVZoomNether(EntityPlayer player, ItemStack stack){
	;

}

 

What's the difference between those?

 

EDIT: I see the problem here, you have many seperate TickHandlers and each reset the FOV variable, since their bow is not equal to the current used item! What I strongly suggest is that you have only ONE TickHandler, then do something like this:

if(type.equals(EnumSet.of(TickType.RENDER))) {
    if(player != null && player.isUsingItem()) {
        int itemID = player.getItemInUse().itemID;
        if(itemID  == firstBow.itemID) {
            MyMod.proxy.onBowFOVZoomFirstBow(player, player.getItemInUse());
        } else if(itemID == secondBow.itemID) {
            MyMod.proxy.onBowFOVZoomSecondBow(player, player.getItemInUse());
        } else if ......
    } else {
        mod_rareores.proxy.resetSavedFOV();
    }
}

Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! |

mah twitter

This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.

Link to comment
Share on other sites

	public void onBowFOVZoomDiamond(EntityPlayer player, ItemStack stack){
	;

}
public void onBowFOVZoomTrillint(EntityPlayer player, ItemStack stack){
	;

}
public void onBowFOVZoomNether(EntityPlayer player, ItemStack stack){
	;

}

 

What's the difference between those?

 

EDIT: I see the problem here, you have many seperate TickHandlers and each reset the FOV variable, since their bow is not equal to the current used item! What I strongly suggest is that you have only ONE TickHandler, then do something like this:

if(type.equals(EnumSet.of(TickType.RENDER))) {
    if(player != null && player.isUsingItem()) {
        int itemID = player.getItemInUse().itemID;
        if(itemID  == firstBow.itemID) {
            MyMod.proxy.onBowFOVZoomFirstBow(player, player.getItemInUse());
        } else if(itemID == secondBow.itemID) {
            MyMod.proxy.onBowFOVZoomSecondBow(player, player.getItemInUse());
        } else if ......
    } else {
        mod_rareores.proxy.resetSavedFOV();
    }
}

Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! |

mah twitter

This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Use Temu Coupon Code $100 Off [act965193] if you are living in California USA. Temu doesn't let you use many coupons at once, but you can still save more. New users get an extra 10% off the 30% discount. Also, text alerts give you 20% off. Using these with Temu's 90% off Daily Deals helps you save a lot. How to use Temu Coupon Code $100 Off [act965193] Both new and existing users at Temu can save a lot by using coupon codes and bundles. New users get a $200 discount with the code aci384098 on their first buy. This is a big welcome bonus that helps them save right away. Follow below steps to apply Temu Coupon Code $100 Off [act965193] Choose Your Items: Pick the products you want to buy from TEMU. Go to Checkout: When you are ready to pay, go to the checkout page. Enter the Code: Type (act847220) into the coupon code box. Enjoy Your Savings: Your total will be reduced, and you'll save money on your purchase. Keep an eye on new deals to save more. Check the Temu app, sign up for newsletters, and follow Temu on social media. Sites like RetailMeNot or Coupons.com also list Temu coupon codes, so you won't miss out.   Using these tips, shopping on Temu can be a smart way to save money. Plan your buys with sale cycles in mind, stack coupons wisely, and watch for new deals. This will make your shopping trips more rewarding.   Temu Coupon Codes & Bundles: New Installs and Existing Users For existing customers, the code aci384098 also gives $200 off. The Temu $200 Coupon Bundle is great for both new and current users. It includes $120 worth of coupons. Plus, Temu offers a 40% discount with certain codes for everyone.   Temu also has special app discounts. By signing up with the code aci384098 and spending $200 or more, customers can save $200 plus get 30% off on their purchase. The code aci384098 also gives a $200 discount and an extra 50% off on the next buy. This is a great way to thank users for their engagement.   Shopping at Temu can lead to big savings. The average discount is an impressive 59%, with 84% of orders getting free shipping or gifts. About 48% of discounts have a time limit, encouraging shoppers to act fast. With deals like a $100 coupon bundle for new users and savings from the code aci384098, Temu offers many ways to save.   Existing customers also have many ways to save, like app alerts, website coupons, and referral programs. There are also games, seasonal sales, and discounts on certain items. This means both new and current users have lots of options to save, showing Temu's dedication to rewarding users.   Comparing Temu Coupon Codes with Other Retailers   Looking at the world of online shopping, comparing Temu coupon codes with others shows Temu's big competitive advantages.   Advantages of Temu Coupons   Temu's coupons offer big discounts, often more than other stores. This means customers save a lot of money. Temu also throws in freebies, making their coupons even more valuable.   Temu's coupons work on many products, not just a few. This makes it easy for customers to save on what they buy.   How Temu Stands Out in the Market   When we look at Temu vs. other retailers, Temu's deals are made with the customer in mind. They focus on what shoppers want and need. This makes Temu's coupons not just competitive but also very attractive to many buyers.   Our benchmarking deals show Temu leading in coupon offers. They offer big discounts and special perks. This makes Temu stand out in the online shopping world.   Conclusion   Using Temu coupon codes and bundles helps save money and make shopping better. For new and returning customers, codes like "acr880792" and "aci384098" offer big discounts. New users get £20 off their first order and up to 50% off on various deals.   Temu offers many coupons for smart shoppers to save more. Whether it's standalone discounts, special deals, or loyalty rewards, using these codes can cut down costs. This way, shoppers get quality products at great prices, from $1 phone cases to discounted electronics.   It's important to keep up with new discounts and promotions. By watching daily deals and signing up for alerts, shoppers won't miss out on great offers. Temu connects manufacturers directly with consumers, leading to lower costs. This unique approach, along with big savings from coupons, makes Temu a top choice for budget-friendly shopping. Start your Temu shopping today for unmatched savings and satisfaction.  
    • Use Temu coupon code $100 off [acq783769] for Belgium and special 30% discount plus get 3 free itemsTemu has always been a shopper's paradise, offering a vast collection of trending items at unbeatable prices. With fast delivery and free shipping to 67 countries, it's no wonder Temu has become a go-to platform for savvy shoppers. Now, with these exclusive Temu coupon codes, you can enjoy even more savings: act581784: Temu coupon code 40% off for existing users act581784: $100 off Temu coupon for new customers act581784: $100 off Temu coupon for existing customers act581784: 40% discount for new users act581784: Temu coupon code 40 off for existing and new users Why You Shouldn't Miss Out on the Temu Coupon Code 40% Off The Temu coupon code 40% off is a game-changer for both new and existing customers. Whether you're a first-time user or a loyal Temu shopper, these codes offer substantial savings on your purchases. With a flat 40% extra off, you can stretch your budget further and indulge in more of your favorite items. Maximizing Your Savings with Temu 40 Off Coupon Code To make the most of your Temu shopping experience, it's crucial to understand how to apply these coupon codes effectively. When you use the Temu coupon code 40 off, you're not just saving money – you're unlocking a world of possibilities. From fashion to home decor, electronics to beauty products, your 40% discount applies across a wide range of categories. How to Apply Your Temu Coupon Code 40% Off Using your Temu coupon code 40% off is a breeze. Here's a step-by-step guide to ensure you don't miss out on these incredible savings: Browse through Temu's extensive collection and add your desired items to your cart. Proceed to checkout when you're ready to make your purchase. Look for the "Promo Code" or "Coupon Code" field. Enter your Temu coupon code 40 off [act581784]. Watch as your total amount gets reduced by a whopping 40%! The Power of Temu Coupon Code 40 Off First Order For those new to Temu, the Temu coupon code 40% off first order is an excellent opportunity to experience the platform's offerings at a discounted price. This introductory offer allows you to explore Temu's vast catalog while enjoying significant savings on your inaugural purchase.Be sure to use it before it expires!
    • Use Temu coupon code $100 off [acq783769] and special 30% discount Plus get 90% on cleranceTemu has always been a shopper's paradise, offering a vast collection of trending items at unbeatable prices. With fast delivery and free shipping to 67 countries, it's no wonder Temu has become a go-to platform for savvy shoppers. Now, with these exclusive Temu coupon codes, you can enjoy even more savings: act581784: Temu coupon code 40% off for existing users act581784: $100 off Temu coupon for new customers act581784: $100 off Temu coupon for existing customers act581784: 40% discount for new users act581784: Temu coupon code 40 off for existing and new users Why You Shouldn't Miss Out on the Temu Coupon Code 40% Off The Temu coupon code 40% off is a game-changer for both new and existing customers. Whether you're a first-time user or a loyal Temu shopper, these codes offer substantial savings on your purchases. With a flat 40% extra off, you can stretch your budget further and indulge in more of your favorite items. Maximizing Your Savings with Temu 40 Off Coupon Code To make the most of your Temu shopping experience, it's crucial to understand how to apply these coupon codes effectively. When you use the Temu coupon code 40 off, you're not just saving money – you're unlocking a world of possibilities. From fashion to home decor, electronics to beauty products, your 40% discount applies across a wide range of categories. How to Apply Your Temu Coupon Code 40% Off Using your Temu coupon code 40% off is a breeze. Here's a step-by-step guide to ensure you don't miss out on these incredible savings: Browse through Temu's extensive collection and add your desired items to your cart. Proceed to checkout when you're ready to make your purchase. Look for the "Promo Code" or "Coupon Code" field. Enter your Temu coupon code 40 off [act581784]. Watch as your total amount gets reduced by a whopping 40%! The Power of Temu Coupon Code 40 Off First Order For those new to Temu, the Temu coupon code 40% off first order is an excellent opportunity to experience the platform's offerings at a discounted price. This introductory offer allows you to explore Temu's vast catalog while enjoying significant savings on your inaugural purchase.Be sure to use it before it expires!
    • Use Temu coupon code $100 off [ACQ783769] for Bahrain and special 30% discount Plus get free shipping Temu has always been a shopper's paradise, offering a vast collection of trending items at unbeatable prices. With fast delivery and free shipping to 67 countries, it's no wonder Temu has become a go-to platform for savvy shoppers. Now, with these exclusive Temu coupon codes, you can enjoy even more savings: ACQ783769: Temu coupon code 40% off for existing users act581784: $100 off Temu coupon for new customers act581784: $100 off Temu coupon for existing customers act581784: 40% discount for new users act581784: Temu coupon code 40 off for existing and new users Why You Shouldn't Miss Out on the Temu Coupon Code 40% Off The Temu coupon code 40% off is a game-changer for both new and existing customers. Whether you're a first-time user or a loyal Temu shopper, these codes offer substantial savings on your purchases. With a flat 40% extra off, you can stretch your budget further and indulge in more of your favorite items. Maximizing Your Savings with Temu 40 Off Coupon Code To make the most of your Temu shopping experience, it's crucial to understand how to apply these coupon codes effectively. When you use the Temu coupon code 40 off, you're not just saving money – you're unlocking a world of possibilities. From fashion to home decor, electronics to beauty products, your 40% discount applies across a wide range of categories. How to Apply Your Temu Coupon Code 40% Off Using your Temu coupon code 40% off is a breeze. Here's a step-by-step guide to ensure you don't miss out on these incredible savings: Browse through Temu's extensive collection and add your desired items to your cart. Proceed to checkout when you're ready to make your purchase. Look for the "Promo Code" or "Coupon Code" field. Enter your Temu coupon code 40 off [act581784]. Watch as your total amount gets reduced by a whopping 40%! The Power of Temu Coupon Code 40 Off First Order For those new to Temu, the Temu coupon code 40% off first order is an excellent opportunity to experience the platform's offerings at a discounted price. This introductory offer allows you to explore Temu's vast catalog while enjoying significant savings on your inaugural purchase.Be sure to use it before it expires!
    • Use Temu coupon code $200 off [act965193] for Bahrain and special 30% discount Plus get free shipping Temu has always been a shopper's paradise, offering a vast collection of trending items at unbeatable prices. With fast delivery and free shipping to 67 countries, it's no wonder Temu has become a go-to platform for savvy shoppers. Now, with these exclusive Temu coupon codes, you can enjoy even more savings: act965193: Temu coupon code 40% off for existing users act965193: $100 off Temu coupon for new customers act965193: $100 off Temu coupon for existing customers act965193: 40% discount for new users act965193: Temu coupon code 40 off for existing and new users Why You Shouldn't Miss Out on the Temu Coupon Code 40% Off The Temu coupon code 40% off is a game-changer for both new and existing customers. Whether you're a first-time user or a loyal Temu shopper, these codes offer substantial savings on your purchases. With a flat 40% extra off, you can stretch your budget further and indulge in more of your favorite items. Maximizing Your Savings with Temu 40 Off Coupon Code To make the most of your Temu shopping experience, it's crucial to understand how to apply these coupon codes effectively. When you use the Temu coupon code 40 off, you're not just saving money – you're unlocking a world of possibilities. From fashion to home decor, electronics to beauty products, your 40% discount applies across a wide range of categories. How to Apply Your Temu Coupon Code 40% Off Using your Temu coupon code 40% off is a breeze. Here's a step-by-step guide to ensure you don't miss out on these incredible savings: Browse through Temu's extensive collection and add your desired items to your cart. Proceed to checkout when you're ready to make your purchase. Look for the "Promo Code" or "Coupon Code" field. Enter your Temu coupon code 40 off [act581784]. Watch as your total amount gets reduced by a whopping 40%! The Power of Temu Coupon Code 40 Off First Order For those new to Temu, the Temu coupon code 40% off first order is an excellent opportunity to experience the platform's offerings at a discounted price. This introductory offer allows you to explore Temu's vast catalog while enjoying significant savings on your inaugural purchase.Be sure to use it before it expires!
  • Topics

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.