Jump to content

Abastro

Forge Modder
  • Posts

    1075
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by Abastro

  1. Does that related with commented lines? Or did you keep it commenting when you got the issue?
  2. That's not only the problem. There are tons of blocks added by mods works like lapis. Also, some of them uses HarvestDropsEvent, so you should fix lots of the logic. (As you want it to have fortune effects, etc.)
  3. That's the problem that I exactly wanted to say. Your logic breaks there. And, with the code, breaking lapis lazuli would give you the lapis lazuli block. Is that what you want?
  4. Where do you changes the color to green? I cannot find it. Does that related with commented lines?
  5. So what do you want is silk touch+auto smelting? But still, there are many problems. You are not dropping anything if the hammer does not have Auto-Smelting trait.
  6. Please let us know that how you call the method 'draw'/
  7. So console prints "XP: 0.0"? I think it is impossible.
  8. You should remind that the code would be incompatible with many mods. (edit) Many mods uses Block#getDrops(...) and HarvestDropsEvent to modify the drops, but your code just smelts the block and drop it. Do you want your tool to be silk touch with auto-smelting?
  9. Hm, how do you draw the objects? The code only contains code drawing single gui.
  10. The code should work. What was the block?
  11. The GuiDogInfo#player field would be null. Where is the constructor called? GuiHandler? Please post the code.
  12. Use Block#harvestBlock(World world, EntityPlayer player, int x, int y, int z, int meta) to drop the block drops. Remind that Block#getDrops(...) just gets the new instance of the drops. Using the Block#harvestBlock(...), you can use BlockEvent.HarvestDropsEvent to check and smelt the drops.
  13. KeyBinding#unpressKey() is private, so you should use reflection to get reach to it.
  14. You didn't save the NBT for "Owner" in writeEntityToNBT, so fix that.
  15. Where do you need to calculate the 'armorWeared' value? It is easy, you can just add up them when it is needed in most case.
  16. This code makes it nothing to clear the drops. ArrayList<ItemStack> drops = block.getDrops(world, actualX, actualY, actualZ, meta, EnchantmentHelper.getEnchantmentLevel(Enchantment.fortune.effectId, stack)); A new instance of drops is made there, so changing that has no effect! You cannot change drops in the Item#onBlockDestroyed(...). You should subscribe to the BlockEvent#HarvestDropsEvent. + 'it doesn't register the blocks I destroy through my class' means there is something wrong with your logic. What do you mean by 'destroy through my class'? If you are trying to break blocks within your logic, Please post relevant code.
  17. I know that would work, but it causes a block 'blip' meaning the client still breaks the block, then puts it back when the server tells the client it is still there. Would you know how to fix that? PlayerInteractEvent is called before client clicks and breaks the block. So you can just cancel the event when you extinguishes the fire.
  18. Of course it should be in normal case, but in this case the owner's name is also needed when the player is not in the game. So the player's nickname should be saved alongside. (+ The nickname should be updated when the player logs in, because it could be changed)
  19. It seems that fire is treated specially. It is checked before any block method gets called. So in order to make custome fire extinguishes, you should subscribe to PlayerInteractEvent and check if it is clicking fire.
  20. 1. Update the code to your current state. 2. You should also change the name of folder your resources are in.
  21. For player, nickname is not constant, it can be different when his nickname changes. Only UUID is persistent. So save both of them: nickname and UUID.
  22. Then save the player's nickname and UUID, and loads the owner instance when he logs in. (Or in readNBT alongside) (Or it can also be Entity, since entities have UUID and displayname too)
  23. You are not drawing anything in the PapPapRender class. You have to understand what RenderPainting#func_77010_a does, and write the similar code for rendering.
  24. Forge automatically extends the limit using ArrayCopy. Since WorldType is only effective on server side, there is theoretically no limit for WorldType. So don't worry about that.
×
×
  • Create New...

Important Information

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