Jump to content

Busti

Forge Modder
  • Posts

    624
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Busti

  1. It is at: /net/minecraft/client/renderer/RenderBlocks.class starting at line ~5100...
  2. There is no Event which is called when the player first enters the game. You have to save the Information if the player already got the Item. For instance in the players NBT Tag.
  3. Ghost Items normally exist because their ItemStack is existing but has an ItemCount of 0 or the Item is existing on the client but not on the Server. Make sure to set the ItemStack = null when you delete the item and not just remove a number from the count and make sure to sync the TileEntity with the client my using methods such as onDataPacket() and getDescriptionPacket() in your TileEntity. These will be called when the block gets updated (world.markBlockForUpdate) and are used to send a Packet of NBT Data to the Client for rendering purposes. The commonly used packet class is S35PacketUpdateTileEntity.class.
  4. Hello, how can I add Libraries in 1.7? In 1.6.4 we had a folder (/libs/) for that. Is that folder still existing or do we have to handle it manually, because I would like to install ForgeMultipart. Thank you for any Help - Busti
  5. You should always register TileEntitys by using: GameRegistry.registerTileEntity(YourTileEntity.class, "YourTileEntityName");
  6. Yep just place all the block in your IWorldGenerator class.
  7. There seems to be an error in the method you are using to register the different sub-Names. You could use LanguageRegistry.instance().addStringLocalization("tile.MultiBlock_UN.name", "en_US", "Solidified Knowledge"); But then they would all have the same Name... Make sure you add an extra Localization for every sub block. This could be done when You are adding them to their Creative Tab.
  8. You could also use the onBlockDestroyed() method wich is called when a Block is broken by the Item and not when the Item is Used (right clicked...) Your full code would be: @Override public boolean onBlockDestroyed(ItemStack item, World world, Block destroyedBlock, int x, int y, int z, EntityLivingBase entity) { for (int ix = -1; x < 2; x++) { for (int iy = -1; x < 2; x++) { for (int iz = -1; x < 2; x++) { world.func_147480_a(x+ix, y+iy, z+iz, true); } } } return true; } You could also damage the ItemStack after that happens...
  9. Hello, in 1.6.4 we had a method called getDescriptionPacket() in the TileEntity Class to send a Packet of renderInfo or other data to the client when a TileEntity Updates. This method still exists but I cant find the Packet I used to send the Information. In 1.6.4 I used: public Packet getDescriptionPacket() { NBTTagCompound tag = new NBTTagCompound(); //Write tag Data... return new Packet132TileEntityData(xCoord, yCoord, zCoord, 0, tag); } But Packet132TileEntityData doesn't exist anymore. Is there a replacement or did the name change? - Busti
  10. @Override public void onBlockDestroyedByPlayer(World world, int x, int y, int z, int meta) { for (int ix = -1; x < 2; x++) { for (int iy = -1; x < 2; x++) { for (int iz = -1; x < 2; x++) { //Do all the block break stuff... world.setBlock(x+ix, y+iy, z+iz, Blocks.air); //This will just delete the blocks in a 3x3 area around the broken block but it won't drop anything. } } } } EDIT: @coolAlias Oh I haven't noticed the destroyBlock method in World...
  11. Override the onItemUse() method in your Item... It will give you coordinates and a world object... Then just break the blocks around the item
  12. Thank you captain
  13. Hello, is Item NBT data automatically synced with the client when I add a tag when the item is crafted or must I do it manually? - Busti
  14. An easy to use software would be http://craftstud.io/ It has osx support and can (when you pay it [10$]) compile into java. But there is no documentation on how to use it for minecraft. Otherwise you would have to wait for techne online.
  15. You should make a new class file for every item/block that behaves differently than the ones you already have. Otherwise you just need to change the parameters in the constructor.
  16. EDIT: Replace the false with a true.
  17. Whoops its meant to be: index < par3EntityPlayer.inventory.getSizeInventory() && (itemstack != null ? itemstack.getItem() == RangerMain.crystal_orb : false);
  18. Put this in your onPlayerStoppedUsing method to damage the itemstack. ItemStack itemstack; for (int index = 0; index < player.inventory.getSizeInventory() && (itemstack != null ? itemstack.getItem() == YourModClass.youritem) ; index++) { //You could use 35 instead of the size here but i like it that way. itemstack = player.inventory.getStackInSlot(index); } if (itemstack != null && itemstack.getItem() == YourModClass.youritem) { if (itemStack.attemptDamageItem(1, rand)) { itemStack.stackSize--; if (itemStack.stackSize < 0) //This will consume your item once it breaks. itemStack.stackSize = 0; itemStack.setItemDamage(0); itemStack = null; } } EDIT: You might need to return the Item to the players Inverntory
  19. http://www.minecraftforge.net/wiki/Rendering_a_Techne_Model_as_a_Block This should still be working in 1.7 BTW: Welcome to the Minecraft Forge Forums ^^
  20. Forge will now automatically download and use mcp. Gradle is just the managing system.
  21. I added the players EyeHeight to the y coordinates
  22. Perfect solution: Tested! public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player) { if (!world.isRemote) { Vec3 v3 = player.getLook(1); EntitySmallFireball smallfireball = new EntitySmallFireball(world, player.posX, player.posY + player.eyeHeight, player.posZ, v3.xCoord, v3.yCoord, v3.zCoord); smallfireball.shootingEntity = player; world.spawnEntityInWorld(smallfireball); } return itemStack; }
  23. And how do I use a certain ore in the recipe? Should I just insert my ore or do i have to call a method to get the ore from the dictionary?
  24. Hello again, How can I use the ore dictionary in recipes so i can use copper from every other mod to craft my Items? Busti
  25. 1. Its shooting tow, because the method is called on the client and on the server. The entity on the client will become a ghost and do nothing. The other one is an actual entity. To spawn it only on the server surround your code with: if (!world.isRemote) { } 2. I thought the vector function would give you the direction the player is looking at. Try getLookVec(); instead. Otherwise you might have to calculate the view vector by using the player heads rotation yaw and pitch and calculate the entity motion manually. This is done by translating 3d polar coordinates into a vector. (http://en.wikipedia.org/wiki/Polar_coordinate_system) p.rotationYaw; p.rotationPitch; But I think the vector function should work since its used to detect which block the player is looking at. But you might need to invert some variables. 3. My signature is also a link to the forum page. Just try it out :DDD
×
×
  • Create New...

Important Information

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