Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

DanielRuns

Members
  • Posts

    25
  • Joined

  • Last visited

Converted

  • Gender
    Male
  • Location
    oregon

DanielRuns's Achievements

Tree Puncher

Tree Puncher (2/8)

5

Reputation

  1. This is cool. I don't record, but I'll probably show it to some of my friends who do LP's
  2. The download seems to be broken.
  3. It would be very useful if there was an option to get max stack size based on a damage value or NBT data.
  4. You have to use a CraftingHandler. There are a number of tutorials on them.
  5. You need to make your own recipe class that implements IRecipe. Then add it with GameRegistry.addRecipe(yourIRecipe);. look at some of the classes in net.minecraft.item.crafting for examples of this.
  6. Okay, I resolved this by installing forge the old-fashioned way (downloading mcp, extracting forge, etc.)
  7. When I tried to update to 1.5.1 today, there where errors in both the minecraft code and the forge code (there where errors within my own code too, but this is expected when updating.) It appeared as if some of the classes where missing. install log: I will upload my forge directory if needed, but would like to avoid doing that.
  8. If the player's hand is empty the ItemStack is null, not item ID 0. You can either null check or try/catch. public void onBlockClicked(World par1World, int par2, int par3, int par4, EntityPlayer p5EP) { if( p5ep != null && && p5EP.inventory.getCurrentItem().itemID != null){ if(p5EP.inventory.getCurrentItem().itemID == 1 && par2 * par3 != 0 && par2 * par4 != 0){ par1World.setBlock(par2, par3, par4, 4); } } System.out.println("debug tick."); } Thought I should add: When null checking, go from least specific to most specific. For example: if(Object1.method1() != null && Object1 != null){ System.out.println(Object1.method1().toString()); } This will cause a null pointer exception if Object1 is null because it is trying to call a method (method1) from a null object. However, if you did this: if(Object1 != null && Object1.method1() != null){ System.out.println(Object1.method1().toString()); } This will not cause a null pointer exception because it will break out of the if statement before it tries to call a method from a null object.
  9. In response to op: Have an item ItemSpawner.class When ItemSpawner.class is right clicked set a mob spawner and the mob type. Decrease ItemSpawner stack size. Because I'm a nice guy, here's some code ItemSpawner.class public class ItemSpawner extends Item{ public ItemSpawner(int par1) { super(par1); maxStackSize = 64; setIconIndex(0); this.setTextureFile(MainProxy.ITEMS_PNG); } public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10){ par3World.setBlockWithNotify(par4, par5, par6, Block.mobSpawner.blockID); TileEntityMobSpawner spawner = (TileEntityMobSpawner)par1World.getBlockTileEntity(par3, par4, par5); if(spawner != null) { spawner.setMobID( *** String goes here (mobType) ***); } if (!par2EntityPlayer.capabilities.isCreativeMode) { --par1ItemStack.stackSize; } return false; } }
  10. When I added that code to the packet handler it created an infinite loop, which resulted in a stack overflow.
  11. You have to add the new buttons in the update screen method. public void updateScreen() { super.updateScreen(); //Your code to add, remove, or change buttons, text, images, etc. goes here. }
  12. My packets are not sending properly from client to server -- they are staying on the client side. I checked the packet handler with World.isRemote, and it was always called on the client side. If you could help that'd be great. Packet class: http://pastebin.com/suiV6Xx5 Packet handler Class: http://pastebin.com/Wn3YnuRV
  13. Why is your image 100 x 100? Texture file dimension must be a power of 2.
×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.