Jump to content

Sbeagin

Members
  • Posts

    34
  • Joined

  • Last visited

Everything posted by Sbeagin

  1. So, I made a bow for my mod and used "this.setFull3D();" in the constructor to make it render in 3d, but the offset seems to be off. https://lh3.googleusercontent.com/JfBd59Gq_0ML6qYQmjeVlz2VZD35jWjsdK54AZt1PXyAOk5EkY7XHph2VisVcAesgloMTOv7jMDt3II=w1256-h817[/img] The textures should be fine because all I did was edit the colors of the vanilla bow in paint.net. Does anyone have a solution? Here is the vanilla bow for comparison: https://lh3.googleusercontent.com/NmVAXlRtvEo2l43A2N8EPTyDvoABZbEnWpuQHCXth8zcnyXmanrjvywWyTBjQXJSxIjBmBidsFT6TiU=w1256-h817[/img]
  2. This code seems to work fine: @Override public void onUpdate(ItemStack batteryStack, World world, Entity entity, int par4, boolean par5) { EntityPlayer player = (EntityPlayer)entity; if(!world.isRemote) { for(int i = 0; i < 36; i++) { ItemStack itemStack = player.inventory.getStackInSlot(i); if(itemStack != null) { if(Commons.isChargeable(itemStack.getItem()) && itemStack.getItemDamage() > 0) { itemStack.setItemDamage(itemStack.getItemDamage() - 1); batteryStack.setItemDamage(batteryStack.getItemDamage() + 1); } } } } } Oh and by the way... im new to the forums, how do I put the [solved] tag?
  3. That will not be necessary. I found out that checking for slots 36 - 99, which do not exist, crashes the game. LOL And Minecraft also doesn't seem to like checking for slots 100 - 103, which are supposed to be the armor slots, either.
  4. 103 is the head slot which is less than 104.... batteryStack is defined in the parameters for my onUpdate function.... Anyways, I null checked and I still get the same crash with the same error. Here is the new code: @Override public void onUpdate(ItemStack batteryStack, World world, Entity entity, int par4, boolean par5) { EntityPlayer player = (EntityPlayer)entity; if(!world.isRemote) { for(int i = 0; i < 104; i++) { ItemStack itemStack = player.inventory.getStackInSlot(i); if(itemStack != null) { if(Commons.isChargeable(itemStack.getItem()) && itemStack.getItemDamage() > 0) { itemStack.setItemDamage(itemStack.getItemDamage() - 1); batteryStack.setItemDamage(batteryStack.getItemDamage() + 1); } } } } }
  5. .............-facepalm-. Thank you. I'll fix that tomorrow morning. I'm obviously too tired right now.
  6. Given that that is the first post on your account im just going to assume that you are trolling. If not go learn how minecraft works. As for the topic of this post overriding getCollisionBoundingBoxFromPool and returning null should work i have done it in the past and it worked perfectly. Just to make sure i wrote the following to test it. import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.util.AxisAlignedBB; import net.minecraft.world.World; /** * Created by Brandon on 7/01/2015. */ public class TestBlock extends Block { protected TestBlock() { super(Material.wood); this.setBlockName("testblock"); this.setCreativeTab(CreativeTabs.tabBlock); } @Override public AxisAlignedBB getCollisionBoundingBoxFromPool(World p_149668_1_, int p_149668_2_, int p_149668_3_, int p_149668_4_) { return null; } } That worked just fine for me so if it dosnt work for you there is something else going on. But given how old this thread is im guessing no one cares anymore because this has long since been solved or abandoned. Edit: So i figured out that the problem is when you stack two of them and try to walk through them. To fix it override renderAsNormalBlock and return false. So maby Sbeagin's post wasnt as trolly as i thought but still not a great explanation. I am so sorry I didn't copy/paste the right thing lol I meant to put this: @Override public boolean renderAsNormalBlock() { return false; } @Override public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int wx, int wy, int wz) { return null; } I don't know how I screwed that up...
  7. So I was trying to create a battery of sorts that will automatically recharge any item that I specify that is in the players inventory. When I load my world with this item already in my inventory I get this Error: AL lib: (EE) alc_cleanup: 1 device not closed. Here is the onUpdate() function in my item class (Everything else is working as intended): @Override public void onUpdate(ItemStack batteryStack, World world, Entity entity, int par4, boolean par5) { EntityPlayer player = (EntityPlayer)entity; if(!world.isRemote) { for(int i = 0; i < 104; i++) { ItemStack itemStack = player.inventory.getStackInSlot(i); if(Commons.isChargeable(itemStack.getItem()) && itemStack.getItemDamage() > 0) { itemStack.setItemDamage(itemStack.getItemDamage() - 1); batteryStack.setItemDamage(batteryStack.getItemDamage() + 1); } } } }
  8. Just in case you were still trying to get this to work... Add this to your code: @Override public boolean renderAsNormalBlock() { return ConfigurationHelper.markerBlockCollide; }
×
×
  • Create New...

Important Information

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