Jump to content

Recommended Posts

Posted

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.

Posted

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

Posted

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

Posted

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.

Posted

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.

Posted

Holy crapamoly it worked man, my silly function getting called every tick was messing everything up, this fixes it :).

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

Posted

Holy crapamoly it worked man, my silly function getting called every tick was messing everything up, this fixes it :).

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

Posted

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

Posted

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

Posted

	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.

Posted

	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.

Posted

Thanks, Didn't see this till after I got home from school, Haven't tried yet, but now that I read it that is what would be causing the problem, thanks!

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

Posted

Thanks, Didn't see this till after I got home from school, Haven't tried yet, but now that I read it that is what would be causing the problem, thanks!

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

Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

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