Jump to content

Guff

Members
  • Posts

    159
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Guff

  1. I answered a similar question a few days ago: http://www.minecraftforge.net/forum/index.php/topic,10407.msg52900.html#msg52900 Read through that and come back if it still isn't fixed.
  2. So for example, you are using the axe to break a dirt block. Above the dirt block is a tree. The timber effect should not take place since you are breaking dirt. That is why it checks for logs first, so that "hey, you're breaking a wood block now, let's know out the rest of 'em" will happen.
  3. Sigh. new ResourceLocation("titaniummod", "textures/gui/furnace.png") Start looking at older threads, questions like these have been answered before.
  4. It's to tell it that breaking a block beneath a wood block won't have the "timber" effect. If that weren't there it could work by breaking it otherwise. Thanks for the concern, though.
  5. if(brokenBlock != null) { ItemStack result = FurnaceRecipes.smelting().getSmeltingResult(new ItemStack(brokenBlock, 1, meta)); if(result != null) { EntityItem drop = new EntityItem(world, par2, par3, par4, result); world.spawnEntityInWorld(drop); return false; } }
  6. Okay, well I kind of need a crash log for that.
  7. EntityItem item = new EntityItem(world, i, j, k, result); world.spawnEntityInWorld(item);
  8. Oh whoops: new ResourceLocation("chargecraft", "textures/villager/chargecraftvillager.png");
  9. Use this as your ResourceLocation: new ResourceLocation("chargecraft", "textures/villager/chargecraftvillager");
  10. ExecutorService exe = Executors.newCachedThreadPool(); exe.execute(new MyWorldGenThread(params)); That will run alongside the main thread. I just tested it with one of my mods by executing the Runnable using the service. By printing a line at the start of the run() method, and then another during a loop, and then placing a line after the exe.execute() invocation, you will see something like this: The thread has started Test 1 Test 2 This should show after the thread has started Test 3 Test 4 Test 5 This should help you run a world gen thread alongside the main thread.
  11. Haha woops. I forgot this. Under delay = cooldown, put this: nbt.setInteger("delay", delay);
  12. Amethyst hasn't been created yet.
  13. Yes.
  14. You'll want to check if result != null and then spawn an EntityItem in the world if it is not remote.
  15. if (!par2World.isRemote) { par2World.spawnEntityInWorld(yourEntity); }
  16. Block brokenBlock = Block.blocksList[world.getBlockId(x, y, z)]; int meta = world.getBlockMetadata(x, y, z); ItemStack result = FurnaceRecipes.smelting().getSmeltingResult(new ItemStack(brokenBlock, 1, meta));
  17. Should be.
  18. It's in the comment: if(delay == 0) { //throw entity par1ItemStack.stackSize--; delay = cooldown; }
  19. Same thing.
  20. Yes, I know this. I'm pretty adept with NBT. However, unless everyone on the server were to be using it at the same time, this wouldn't affect anything much. If it really is a problem: private final int cooldown = 40; //2 second cooldown in ticks, this is the same for all items since it will never change. @Override public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { NBTTagCompound nbt = par1ItemStack.getTagCompound(); if(nbt == null) { nbt = new NBTTagCompound(); par1ItemStack.setTagCompound(nbt); } int delay = nbt.getInteger("delay"); if(delay == 0) { //throw entity par1ItemStack.stackSize--; delay = cooldown; } return par1ItemStack; } @Override public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5) { NBTTagCompound nbt = par1ItemStack.getTagCompound(); if(nbt == null) { nbt = new NBTTagCompound(); par1ItemStack.setTagCompound(); } int delay = nbt.getInteger("delay"); if(delay > 0) { delay--; nbt.setInteger("delay", delay); } }
  21. The modID needs to be a String that represents the mod you are checking for. When you made your @Mod, you gave it modid = "someID". All @Mods have this, so you need to know what the ID of the mod is. You can check that mod's mcmod.info, and it should give it to you. For example, if you wanted to check and see if my mod Plunder Rummage was installed, you'd do this: if(Loader.isModLoader("PR")) { //do stuff }
  22. Well, if you are making the items usable by these other mods, via fuel or pipe connections or EU users or whatever, you're going to need the APIs. In your question you just said you wanted to add new content using another mod's items, in which case would not require the API to make a tin pickaxe. Hopefully that makes sense.
  23. private long delay = 0L; private long cooldown = 2000L; //2 seconds public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { if(delay > System.getCurrentTimeMillis()) { //throw entity par1ItemStack.stackSize--; delay = System.getCurrentTimeMillis() + cooldown; } return par1ItemStack; }
  24. if(Loader.isModLoader(modid)) { //make new items }
×
×
  • Create New...

Important Information

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