Everything posted by Vogner
-
How do I create a custom bucket with the normal bucket?
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.
-
How do I create a custom bucket with the normal bucket?
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.
-
Forge's equivalent of bukkit's Delayed Events
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.
-
Item Not Doing what it should [Unsolved]
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.
-
Forge's equivalent of bukkit's Delayed Events
If you can get a World reference, you could probably use getTotalWorldTime() or getWorldTime() for this purpose.
-
Item Not Doing what it should [Unsolved]
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.
-
How do I create a custom bucket with the normal bucket?
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.
-
Are mods a type of cheating?
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.
-
[UNSOLVED]Issue with getRenderType()
Could I get all the crashes?
-
[UNSOLVED]Issue with getRenderType()
You're preaching to the choir, we've all been there. Good luck!
-
[Solved] Consuming buckets during crafting
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!
-
[Solved] Consuming buckets during crafting
Yes, I came back in here to post that... That is probably a simpler solution. Kudos anywys, though. I'm an idgit.
-
[UNSOLVED]Issue with getRenderType()
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.
-
[UNSOLVED]Issue with getRenderType()
Ah, easy fix: extend BlockStep. That particular rendering method only accepts BlockStep, or subclasses of BlockStep. Your class extends Block.
-
Flower that glows at night, not in the day
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.
-
Flower that glows at night, not in the day
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.
-
Flower that glows at night, not in the day
It's also how the daylight sensor tells day from night. WorldTime % 24000 should also work.
-
Flower that glows at night, not in the day
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.
-
[Solved] Consuming buckets during crafting
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.
-
Flower that glows at night, not in the day
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.
-
Flower that glows at night, not in the day
I am too, actually. Do it. I'll post mine even if you finish first.
-
Flower that glows at night, not in the day
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.
-
Make a custom drink item
Yup, everything you need is in ItemBucketMilk. And it ain't much; that class isn't very big.
-
[SOLVED] BlockActivated method being ran twice
That makes a certain amount of sense. Thanks for the rundown, duder.
-
[SOLVED] BlockActivated method being ran twice
I suppose my next question is... Why?
IPS spam blocked by CleanTalk.