Jump to content

Noah_Beech

Members
  • Posts

    121
  • Joined

  • Last visited

Everything posted by Noah_Beech

  1. When updating to 1.6.2, an old variable I used to use was changed from public to private, landSpeedFactor. Hopefully I wold be able to use reflection to modify it accordingly, but I can't seem to get it to work. if(player.inventory.hasItem(mod_rareores.ItemEmblemFlight.itemID)){ landMovementFactor = landMovementFactor > 0.001F ? landMovementFactor : (Float)ObfuscationReflectionHelper.getPrivateValue(EntityLivingBase.class, player, "landMovementFactor", "field_70746_aG"); landMovementFactor *=1.45; ObfuscationReflectionHelper.setPrivateValue(EntityLivingBase.class, player,landMovementFactor ,"landMovementFactor", "field_70746_aG"); player.jumpMovementFactor *=1.45; System.out.println(landMovementFactor); } The above code is what I did from what I know, I asked around on the IRC and everyone said they couldn't find a problem. Help is appreciated, thanks in advance! ~Noah
  2. *headbash* That variable CANNOT be Entityliving! The method Renderitem takes AN EntityLiving, which cannot be taken from data[1]. YES is can be casted to EntityLivingBase but Not EntityLiving.
  3. A while back I with the help of people here figured out a way to render bows properly when held by other players/monsters. Unfortunately when the 1.6 update came rolling out I ran into a few problems with it. first, when I run the mod and pick out a bow, it throws this error. java.lang.ClassCastException: net.minecraft.client.entity.EntityClientPlayerMP cannot be cast to net.minecraft.entity.EntityLiving 2013-07-10 15:41:26 [iNFO] [sTDERR] at mod_Rareores.RenderBow.renderItem(RenderBow.java:40) 2013-07-10 15:41:26 [iNFO] [sTDERR] at net.minecraftforge.client.ForgeHooksClient.renderEquippedItem(ForgeHooksClient.java:201) 2013-07-10 15:41:26 [iNFO] [sTDERR] at net.minecraft.client.renderer.ItemRenderer.renderItem(ItemRenderer.java:89) 2013-07-10 15:41:26 [iNFO] [sTDERR] at net.minecraft.client.renderer.ItemRenderer.renderItemInFirstPerson(ItemRenderer.java:490) 2013-07-10 15:41:26 [iNFO] [sTDERR] at net.minecraft.client.renderer.EntityRenderer.renderHand(EntityRenderer.java:712) 2013-07-10 15:41:26 [iNFO] [sTDERR] at net.minecraft.client.renderer.EntityRenderer.renderWorld(EntityRenderer.java:1292) 2013-07-10 15:41:26 [iNFO] [sTDERR] at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1006) 2013-07-10 15:41:26 [iNFO] [sTDERR] at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:934) 2013-07-10 15:41:26 [iNFO] [sTDERR] at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:826) 2013-07-10 15:41:26 [iNFO] [sTDERR] at net.minecraft.client.main.Main.main(Main.java:93) 2013-07-10 15:41:26 [iNFO] [sTDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 2013-07-10 15:41:26 [iNFO] [sTDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) 2013-07-10 15:41:26 [iNFO] [sTDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) 2013-07-10 15:41:26 [iNFO] [sTDERR] at java.lang.reflect.Method.invoke(Unknown Source) 2013-07-10 15:41:26 [iNFO] [sTDERR] at net.minecraft.launchwrapper.Launch.launch(Launch.java:57) 2013-07-10 15:41:26 [iNFO] [sTDERR] at net.minecraft.launchwrapper.Launch.main(Launch.java:18) Instantly I see it is a classcast exception, so I look into IItemRenderer to figure out how to fix this, this is the data I am given. Data parameters: * RenderBlocks render - The RenderBlocks instance[0] * EntityLiving entity - The entity holding this item[1] I don't get it, why when I'm given an entityLiving data is it throwing an exception when Im making an entityliving parameter? at EntityLiving entity = (EntityLiving) data[1]; I am stumped here and could use some help. Secondly, What have icon.getSheetWidth() & icon.getSheetHeight() been replaced with? My class file package mod_Rareores; import net.minecraft.client.Minecraft; import net.minecraft.client.entity.EntityClientPlayerMP; import net.minecraft.client.renderer.ItemRenderer; import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.entity.EntityLiving; import net.minecraft.entity.EntityLivingBase; import net.minecraft.item.ItemStack; import net.minecraft.util.Icon; import net.minecraft.util.ResourceLocation; import net.minecraftforge.client.IItemRenderer; import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL12; public class RenderBow implements IItemRenderer { private RenderManager renderManager; private Minecraft mc; public static final ResourceLocation RESOURCELOCATION = new ResourceLocation("/terrain.png"); public static final ResourceLocation RESOURCELOCATION2 = new ResourceLocation("/gui/items.png"); public static final ResourceLocation RESOURCELOCATION3 = new ResourceLocation("%blur%/misc/glint.png"); public RenderBow() { this.renderManager = RenderManager.instance; this.mc = Minecraft.getMinecraft(); } @Override public boolean handleRenderType(ItemStack item, ItemRenderType type) { return type == ItemRenderType.EQUIPPED || type == ItemRenderType.EQUIPPED_FIRST_PERSON; } @Override public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) { return false; } @Override public void renderItem(ItemRenderType type, ItemStack item, Object... data) { EntityLiving entity = (EntityLiving) data[1]; ItemRenderer irInstance = this.mc.entityRenderer.itemRenderer; GL11.glPopMatrix(); if(type == ItemRenderType.EQUIPPED_FIRST_PERSON) { this.renderItem(entity, item, 0); } else { GL11.glPushMatrix(); float f2 = 3F - (1F/3F); GL11.glRotatef(-20.0F, 0.0F, 0.0F, 1.0F); GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F); GL11.glRotatef(-60.0F, 0.0F, 0.0F, 1.0F); GL11.glScalef(f2, f2, f2); GL11.glTranslatef(-0.25F, -0.1875F, 0.1875F); float f3 = 0.625F; GL11.glTranslatef(0.0F, 0.125F, 0.3125F); GL11.glRotatef(-20.0F, 0.0F, 1.0F, 0.0F); GL11.glScalef(f3, -f3, f3); GL11.glRotatef(-100.0F, 1.0F, 0.0F, 0.0F); GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); this.renderItem(entity, item, 0); GL11.glPopMatrix(); } GL11.glPushMatrix(); private void renderItem(EntityLiving par1EntityLiving, ItemStack par2ItemStack, int par3) { Icon icon = par1EntityLiving.getItemIcon(par2ItemStack, par3); if (icon == null) { return; } if (par2ItemStack.getItemSpriteNumber() == 0) { this.mc.renderEngine.func_110577_a(RESOURCELOCATION); } else { this.mc.renderEngine.func_110577_a(RESOURCELOCATION2); } Tessellator tessellator = Tessellator.instance; float f = icon.getMinU(); float f1 = icon.getMaxU(); float f2 = icon.getMinV(); float f3 = icon.getMaxV(); float f4 = 0.0F; float f5 = 0.3F; GL11.glEnable(GL12.GL_RESCALE_NORMAL); GL11.glTranslatef(-f4, -f5, 0.0F); float f6 = 1.5F; GL11.glScalef(f6, f6, f6); GL11.glRotatef(50.0F, 0.0F, 1.0F, 0.0F); GL11.glRotatef(335.0F, 0.0F, 0.0F, 1.0F); GL11.glTranslatef(-0.9375F, -0.0625F, 0.0F); ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, icon.getSheetWidth(), icon.getSheetHeight(), 0.0625F); if (par2ItemStack != null && par2ItemStack.hasEffect() && par3 == 0) { GL11.glDepthFunc(GL11.GL_EQUAL); GL11.glDisable(GL11.GL_LIGHTING); this.mc.renderEngine.func_110577_a(RESOURCELOCATION3); GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE); float f7 = 0.76F; GL11.glColor4f(0.5F * f7, 0.25F * f7, 0.8F * f7, 1.0F); GL11.glMatrixMode(GL11.GL_TEXTURE); GL11.glPushMatrix(); float f8 = 0.125F; GL11.glScalef(f8, f8, f8); float f9 = (float)(Minecraft.getSystemTime() % 3000L) / 3000.0F * 8.0F; GL11.glTranslatef(f9, 0.0F, 0.0F); GL11.glRotatef(-50.0F, 0.0F, 0.0F, 1.0F); ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); GL11.glPopMatrix(); GL11.glPushMatrix(); GL11.glScalef(f8, f8, f8); f9 = (float)(Minecraft.getSystemTime() % 4873L) / 4873.0F * 8.0F; GL11.glTranslatef(-f9, 0.0F, 0.0F); GL11.glRotatef(10.0F, 0.0F, 0.0F, 1.0F); ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); GL11.glPopMatrix(); GL11.glMatrixMode(GL11.GL_MODELVIEW); GL11.glDisable(GL11.GL_BLEND); GL11.glEnable(GL11.GL_LIGHTING); GL11.glDepthFunc(GL11.GL_LEQUAL); } GL11.glDisable(GL12.GL_RESCALE_NORMAL); } }
  4. Uhh, bullets go so fast that you can't see them, make it a "feature"!
  5. Uhh, Isn't there something called a configuration file?
  6. You had it partially right, IT DID need to be onblockactivated but there were other hidden problems within the code that I ended up fixing, but thanks for the help!
  7. Today I was trying to make certain features of my mod work with all other mods. I got the first one to work perfectly fine but The second (And last) one has been giving me trouble. I've been trying to get my block to "smelt" whatever you hit it with. (Say one takes iron ore, when the player hits the block while holding the ore it would smelt some it and and drop the corresponding smelting result, which in this case would be iron ingots. This enables it to work with other mods ores and smelting ingredients such as copper! The block is supposed to be an end game item that smelts things way faster than any furnace, if you were wondering) However after I hit it for the first time it doesn't seem to work, as every time I hit it afterwards it doesn't drop anything, but all conditions seem to be met. Hopefully someone here will know what the problem is. package mod_Rareores; import java.util.Random; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.item.EntityXPOrb; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.FurnaceRecipes; import net.minecraft.util.Icon; import net.minecraft.world.World; public class BlockSmeltingBlock extends Block { Random generator = new Random(); @SideOnly(Side.CLIENT) private Icon Block_Top; public BlockSmeltingBlock(int par1) { super(par1, Material.iron); setCreativeTab(CreativeTabs.tabBlock); } public void onBlockClicked(World world, int par2, int par3, int par4, EntityPlayer player) { ItemStack stack = player.inventory.getCurrentItem(); int size; if(stack==null){ player.setFire(4); return; } if(stack != null && player.inventory.hasItem(Item.coal.itemID)){ ItemStack itemstack = FurnaceRecipes.smelting().getSmeltingResult(player.getHeldItem()); if(itemstack != null) { size=stack.stackSize; if(size > 8 && size <= 64) { stack.stackSize -= 8; if(!world.isRemote) { player.entityDropItem(itemstack, 0.0F); } } else { if(!world.isRemote) { player.inventory.setInventorySlotContents(player.inventory.currentItem, null); player.entityDropItem(itemstack, 0.0F); } } } } } public Icon getIcon(int par1, int par2) { return par1 == 1 ? this.Block_Top : (this.blockIcon); } public void registerIcons(IconRegister par1IconRegister) { this.blockIcon = par1IconRegister.registerIcon("Rareores:SmeltSide"); this.Block_Top = par1IconRegister.registerIcon("Rareores:SmeltTop"); } } Thanks in advance! ~Noah
  8. Never mind, it was a GUI problem, completely unrelated to the container. I just needed to set the X and Y size in the constructor.
  9. I'm not sure if the problem is in the container, or the tileentity, btw. I've looked at the container 100 times now and couldn't find anything.
  10. Hello, as of recent I have been working with basic tileentities and containers. Since I am new to them, it has been very difficult, however I have been starting to get the hang of containers. Everything with them is almost done expect for the annoying fact that my larger container has slot/stack transfer issues, and I can't seem to pinpoint why. All my code for my larger container came off of the smaller one, but I changed all the values to fit the size. But Whenever I try to transfer items via shiftclicking OR just plain drag-n-drop one item is ejected into the world and the stack size I click goes down by 1. My code is below Below in this spoiler is the smaller container that works, it has 36 slots per inventory Below in this spoiler is the container that is larger and does not work I really hope someone can figure this out, I've just about had it...
  11. Never mind, this post is REALLY old, I just needed to register it on the client and fixed a logic issue, use a forge event to prevent / reduce fall damage.
  12. Okay so I've been trying to make an item that lets to fly for a short period of time. I have all the logic correct and everything SHOULD work, but when I set player.capabilities.allowFlying to true I can't fly (But I don't take fall damage) Here is my code Tickhandler package rareores.Common; import java.util.EnumSet; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import cpw.mods.fml.common.ITickHandler; import cpw.mods.fml.common.TickType; public class ServerTickHandler implements ITickHandler { int count = 0; int delay = 0; private void onPlayerTick(EntityPlayer player) { if(player.inventory.hasItem(Item.stick.itemID) && player.capabilities.isCreativeMode == false && this.count < 100 && this.delay == 0) { player.capabilities.allowFlying = true; if(player.capabilities.isFlying){ this.count++; } if(this.count > 0 && !player.capabilities.isFlying){ count = 100; } System.out.println("We should be flying"); } else { this.count = 0; this.delay++; if (this.delay >= 320) { this.delay = 0; } player.capabilities.allowFlying = false; System.out.println("We should NOT be flying"); } System.out.println(this.count); System.out.println(this.delay); } @Override public void tickStart(EnumSet<TickType> type, Object... tickData) { if (type.equals(EnumSet.of(TickType.PLAYER))) { onPlayerTick((EntityPlayer)tickData[0]); } } @Override public void tickEnd(EnumSet<TickType> type, Object... tickData) { } @Override public EnumSet<TickType> ticks() { return EnumSet.of(TickType.PLAYER, TickType.SERVER); } @Override public String getLabel() { return null; } } 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 registerClientTickHandler() { } public void registerServerTickHandler() { TickRegistry.registerTickHandler(new ServerTickHandler(), Side.SERVER); } public void bowRender() { ; } } 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 net.minecraftforge.client.MinecraftForgeClient; 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()); MinecraftForgeClient.registerItemRenderer(mod_rareores.ItemPherithiumBow.itemID, new RenderBow()); MinecraftForgeClient.registerItemRenderer(mod_rareores.ItemCrystiniumBow.itemID, new RenderBow()); MinecraftForgeClient.registerItemRenderer(mod_rareores.ItemTophiniteBow.itemID, new RenderBow()); MinecraftForgeClient.registerItemRenderer(mod_rareores.ItemMagrolithBow.itemID, new RenderBow()); MinecraftForgeClient.registerItemRenderer(mod_rareores.ItemNecroniteBow.itemID, new RenderBow()); MinecraftForgeClient.registerItemRenderer(mod_rareores.ItemNetherBow.itemID, new RenderBow()); MinecraftForgeClient.registerItemRenderer(mod_rareores.ItemTrillintBow.itemID, new RenderBow()); MinecraftForgeClient.registerItemRenderer(mod_rareores.ItemDiamondBow.itemID, new RenderBow()); MinecraftForgeClient.registerItemRenderer(mod_rareores.ItemIronBow.itemID, new RenderBow()); MinecraftForgeClient.registerItemRenderer(mod_rareores.ItemGoldBow.itemID, new RenderBow()); } 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 / 33.0F; if (f1 > 1.0F) { f1 = 1.0F; } else { f1 *= f1; } f *= 1.0F - f1 * 0.4F; 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.3F; 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 / 19.0F; if (f1 > 1.0F) { f1 = 1.0F; } else { f1 *= f1; } f *= 1.0F - f1 * 0.15F; 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.6F; 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 registerClientTickHandler() { TickRegistry.registerTickHandler(new ClientTickHandlerFOV(), Side.CLIENT); } } Thanks ahead of time ~Noah
  13. Then get that guy to update his mod? It shouldn't be your problem...
  14. Never mind fixed it, just replace the code segment float f2 = 3F - (1F/3F); GL11.glRotatef(-20.0F, 0.0F, 0.0F, 1.0F); GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F); GL11.glRotatef(-60.0F, 0.0F, 0.0F, 1.0F); GL11.glScalef(f2, f2, f2); GL11.glTranslatef(-0.25F, -0.1875F, 0.1875F); // render the item as 'real' bow float f3 = 0.625F; GL11.glTranslatef(0.0F, 0.125F, 0.3125F); GL11.glRotatef(-20.0F, 0.0F, 1.0F, 0.0F); GL11.glScalef(f3, -f3, f3); GL11.glRotatef(-100.0F, 1.0F, 0.0F, 0.0F); GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); with GL11.glTranslatef(0.0F, -0.6F, -0.025F); GL11.glRotatef(-17.0F, 0.0F, 0.0F, 1.0F); GL11.glRotatef(14.0F, 1.0F, 0.0F, 0.0F); GL11.glRotatef(4.5F, 0.0F, 1.0F, 0.0F); I dunno what was up with your translations and rotations (Maybe something else you did different) But This works for me. Thanks!
  15. I am using forge version 7.8.0.703 Here I go hunting with my new bow Here I am relaxin with mah new bow Here is it normally Thanks for the help, sorry to be a burden, rendering are my Achilles's Heel.
  16. Wait umm why is the bow like super big and held on the side pointing away from his left hip?
  17. Just a question, Using Minecraft.getMinecraft().thePlayer is okay if your using it just on the client right? (Like for renderings)
  18. I'm going to say this now, but I have 2 recommendations. 1. Learn some basic JAVA or at least basic C based code. 2. Look at itembow or entityplayer and see how it is done there, We don't just give out free code to people because they don't know something :3 If you are really stumped I can help you though, but look at what I said and try to figure it out for yourself. Also, your getting Item and Itemstack variables mixed up. Edit: Why the hell is the Item declaration In your main mod file PRIVATE?
  19. Thanks man! Yeah I'm using 1.5.2 so I should have 7.8.0.700. But I will double check!
  20. Okay, As summer is creeping up on me, I'm starting to have alot more time for minecraft modding, and plan on ramping up my mod to the next level. To start Im ironing out some unprofessional errors/bugs that seem to detract from the mod. I've gotten them all done except for 1 thing. I got bows to be held correctly while the person is in third person view, however, if the player isn't then other players hold it incorrectly. How would I go about fixing this? This is the segment of code I put in the item class (geticon method)to make it work the way it currently does. if(Minecraft.getMinecraft().gameSettings.thirdPersonView != 0){ GL11.glTranslatef(0.0F, -0.6F, -0.025F); GL11.glRotatef(-17.0F, 0.0F, 0.0F, 1.0F); GL11.glRotatef(14.0F, 1.0F, 0.0F, 0.0F); GL11.glRotatef(4.5F, 0.0F, 1.0F, 0.0F); }
  21. What is with the stray @Sideonly above the feild that doesn't appear to the server? hmmmm...
  22. What is with the stray @Sideonly above the feild that doesn't appear to the server? hmmmm...
×
×
  • Create New...

Important Information

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