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



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Im trying to build my mod using shade since i use the luaj library however i keep getting this error Reason: Task ':reobfJar' uses this output of task ':shadowJar' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. So i try adding reobfJar.dependsOn shadowJar  Could not get unknown property 'reobfJar' for object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler. my gradle file plugins { id 'eclipse' id 'idea' id 'maven-publish' id 'net.minecraftforge.gradle' version '[6.0,6.2)' id 'com.github.johnrengelman.shadow' version '7.1.2' id 'org.spongepowered.mixin' version '0.7.+' } apply plugin: 'net.minecraftforge.gradle' apply plugin: 'org.spongepowered.mixin' apply plugin: 'com.github.johnrengelman.shadow' version = mod_version group = mod_group_id base { archivesName = mod_id } // Mojang ships Java 17 to end users in 1.18+, so your mod should target Java 17. java.toolchain.languageVersion = JavaLanguageVersion.of(17) //jarJar.enable() println "Java: ${System.getProperty 'java.version'}, JVM: ${System.getProperty 'java.vm.version'} (${System.getProperty 'java.vendor'}), Arch: ${System.getProperty 'os.arch'}" minecraft { mappings channel: mapping_channel, version: mapping_version copyIdeResources = true runs { configureEach { workingDirectory project.file('run') property 'forge.logging.markers', 'REGISTRIES' property 'forge.logging.console.level', 'debug' arg "-mixin.config=derp.mixin.json" mods { "${mod_id}" { source sourceSets.main } } } client { // Comma-separated list of namespaces to load gametests from. Empty = all namespaces. property 'forge.enabledGameTestNamespaces', mod_id } server { property 'forge.enabledGameTestNamespaces', mod_id args '--nogui' } gameTestServer { property 'forge.enabledGameTestNamespaces', mod_id } data { workingDirectory project.file('run-data') args '--mod', mod_id, '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/') } } } sourceSets.main.resources { srcDir 'src/generated/resources' } repositories { flatDir { dirs './libs' } maven { url = "https://jitpack.io" } } configurations { shade implementation.extendsFrom shade } dependencies { minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}" implementation 'org.luaj:luaj-jse-3.0.2' implementation fg.deobf("com.github.Virtuoel:Pehkui:${pehkui_version}") annotationProcessor 'org.spongepowered:mixin:0.8.5:processor' minecraftLibrary 'luaj:luaj-jse:3.0.2' shade 'luaj:luaj-jse:3.0.2' } // Example for how to get properties into the manifest for reading at runtime. tasks.named('jar', Jar).configure { manifest { attributes([ 'Specification-Title' : mod_id, 'Specification-Vendor' : mod_authors, 'Specification-Version' : '1', // We are version 1 of ourselves 'Implementation-Title' : project.name, 'Implementation-Version' : project.jar.archiveVersion, 'Implementation-Vendor' : mod_authors, 'Implementation-Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"), "TweakClass" : "org.spongepowered.asm.launch.MixinTweaker", "TweakOrder" : 0, "MixinConfigs" : "derp.mixin.json" ]) } rename 'mixin.refmap.json', 'derp.mixin-refmap.json' } shadowJar { archiveClassifier = '' configurations = [project.configurations.shade] finalizedBy 'reobfShadowJar' } assemble.dependsOn shadowJar reobf { re shadowJar {} } publishing { publications { mavenJava(MavenPublication) { artifact jar } } repositories { maven { url "file://${project.projectDir}/mcmodsrepo" } } }  
    • Todas as versões do Minecraft Forge são repentinamente tela preta, mesmo sem mods (tentei reinstalar o Minecraft original, Java, atualizar os drivers não funciona)
    • When i join minecraft all ok, when i join world all working fine, but when i open indentity menu, i get this The game crashed whilst unexpected error Error: java.lang.NullPointerException: Cannot invoke "top.ribs.scguns.common.Gun$Projectile.getDamage()" because "this.projectile" is null crash report here https://paste.ee/p/0vKaf
  • Topics

×
×
  • Create New...

Important Information

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