Jump to content

Vogner

Members
  • Posts

    73
  • Joined

  • Last visited

Everything posted by Vogner

  1. Did you register it in your main class? If not, you probably missed something obvious. Event handling is one of the simpler things to do in FML, tbh.
  2. You make a class with a method that accepts a FillBucketEvent as a parameter. Put the @ForgeSubscribed annotation above the method. You then have access to all the objects inside the FillBucketEvent. Use those objects to replace the liquid source with air, and actually fill the bucket. Oh, and the register it in your main class with the Forge event bus. And check out Buildcraft's bucket handling code, I'm pretty sure that one is open source.
  3. To be clear, forge has no direct equivalent of Delayed Events. There's a ITickHandler interface to manage time-restricted code, but I personally have no experience with that at this time.
  4. For the save-related stuff, I'm just getting into it myself. I'll sort of move it up higher on my queue of crap to program and see if I learn anything worth telling you. Hopefully somebody with more (or just some) experience with NBT stuff replies, for both our sakes. How often do you want to check for this? And what are you checking it from? Also,here's probably plenty of non-Minercraft related Java that could do this, too. I'll reply later tonight if I can, if not I'll try some time tomorrow.
  5. If you can get a World reference, you could probably use getTotalWorldTime() or getWorldTime() for this purpose.
  6. You'll want to look into NBT stuff for the save data. For a simpler example, see the tile entity at cpw's IronChests2. Don't worry, it's open source. Check TileEntityChest for date dependent code, it does something with Christmas.
  7. You can't fill buckets without an event handler permitting your code to do so. Coincidentally, I already have a bucket of blood in my mod, as well as a placeable blood liquid. And a whole class of wooden buckets, because I think buckets should be available earlier in survival mode. Just remember to put the @ForgeSubscribed annotation on any method that accepts an event as a parameter. The event you'll (obviously) be using is the FillBucketEvent.
  8. Mods, like technology in general, have no inherent moral leanings. They can be good or not good, and therefor mods are cheats... When they're cheats. And not when they're not.
  9. Could I get all the crashes?
  10. You're preaching to the choir, we've all been there. Good luck!
  11. Solved, and I did it without creating any new classes. There's a method in Item that's triggered when you pull the item out of the crafting result slot, and, conveniently enough, has an EntityPlayer as one of its parameters. I used the player reference to decrement one bucket from the crafting matrix. Booya!
  12. Yes, I came back in here to post that... That is probably a simpler solution. Kudos anywys, though. I'm an idgit.
  13. If you check the tooltip of the screenshot you took, it says that the constructor for BlockStep requires an int and a bool. You have given it an int and a Material.
  14. Ah, easy fix: extend BlockStep. That particular rendering method only accepts BlockStep, or subclasses of BlockStep. Your class extends Block.
  15. Just take the compliment. I'm working on a version that fades on and off. Might be way system intensive, but I'm just going for proof of concept.
  16. It's also how the daylight sensor tells day from night. WorldTime % 24000 should also work. How would this be added to the code provided by draco18s? In my version I have a boolean method that checks if the value of WorldTime % 24000 > 13100, which I am considering to be night. Then I query that method before triggering the change. For what its worth, Draco18 appears to be a more experienced modder (and a more scrupulous coder) than myself, so it's probably wise to use his approach even after I post my version. My code often contains an alarming amount of ghetto.
  17. It's also how the daylight sensor tells day from night. WorldTime % 24000 should also work.
  18. That raises a question: does the OP want this block to light up in the dark, or light up at night? There's a difference.
  19. Update: I was thinking back to the old EE (before Pahimar took over), and if I remember correctly, you could craft iron buckets back into iron ingots with the philosopher's stone (or whatever it was called), couldn't you? This has got to be possible. I'm going to try to write a PlayerEvent handler that accesses EntityPlayer's current open inventory, and see if I can decrement a bucket from the crafting inventory as I remove the item from the result slot. If anybody thinks of something simpler, let me know, otherwise I'll post an update later about how this goes.
  20. I tried to keep this within one block ID, but there's no way (that I know of) to do it that simply. There doesn't seem to be any way to force the lighting engine to recognize an updated lightValue, which is a pity. Minecraft's lighting engine generally seems rather buggy and featureless, tbh. Anyways, I'll play with this more tomorrow and see what I can do, but no matter what the result is going to consume more ID's (and system resources) than I'd like.
  21. I am too, actually. Do it. I'll post mine even if you finish first.
  22. Try harnessing ticks in some way. You'll likely have to set up some code to keep it synced, but a static variable (since they'll all be turning on at the same time) could be checked repeatedly for the correct value, and trigger the change in either light value or block. It would be pretty cool if you could figure out how to dynamically change the light value, as that would allow you to make it pulse softly in the dark, or slowly fade "on" at twilight, instead of turning on abruptly like a light switch. I like this idea, and I'm half tempted to code it and post it here.
  23. Yup, everything you need is in ItemBucketMilk. And it ain't much; that class isn't very big.
  24. That makes a certain amount of sense. Thanks for the rundown, duder.
  25. I suppose my next question is... Why?
×
×
  • Create New...

Important Information

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