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

Jacky2611

Members
  • Posts

    499
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Jacky2611

  1. I meant that I couldn't use the system time. And yeah, in retrospect it is obvious that I can and should use getTotalWorldTime. I did something similar a few days ago and for some reason thought that I couldn't use the total world time for the same reason I couldn't use it back then.
  2. Riiiight. The problem with getTotalWorldTime was that it didn't add values when someone used the time command. Which was important when I was counting days but that doesn't matter now. I got them both mixed up. Thaanks.
  3. Nah, I am doing it on a server. Using timestamps is an option, but that would get complicated should the server be shut down for a while or crash. I would have to save the already passed ticks and set the timer to the current time every few minutes. And I don't really want to use getTotalWorldTime because as soon as an admin decides that he wants to skip the night my counter needs to be reset. I had the same problem a while ago when I tried to count the world age in days.
  4. I need a (short) countdown. And I know that it's not the most perfect solution. But I doubt that it will ever become a real performance bottleneck and I would rather avoid writing a Capability. (Mainly because a: I need to port this item back a few mc versions for a friend and b: I don't want to manually sync my data with the clients.)
  5. The problem is that the animation starts when I change from sloat a to b (both containing the same item) but gets canceld a few moments later when the item in slot b updates it nbt.
  6. Whoa! I didn't know that autocomplete could be used for overwriting methods. I only used it for fields, to create new methods or to fix spelling. NO MORE SEARCHING THE ORIGINAL CLASSES TO FIND THE DAMN PARAMETERS!
  7. I know, I know. I hadn't slept in 24 hours when I first wrote that piece of code yesterday and was absolutely sure that I didn't make any mistakes. (thats why I usually rewrite half my code in the morning) And what IDE do you have that generates method overrided for you? I am using eclipse and it doesn't even help me at all when I try to overwrite something.
  8. Yeah, I misspelled the method name. I wrote that yesterday evening when I was way too tired. Sorry for bothering you guys with it. Only problem left is that when I switch between the same items (which both save data to nbt in their update method) the switch animation gets canceled after the first few frames. I am guessing that a nbt changes a few moments after the animation starts playing makes the shouldCauseReequipAnimation function return false and then cancels the already started animation. Any good ideas on how to solve this? if not I will just not trigger the animation in the first place if I switch to the same item.
  9. I am already doing that. EDIT: Somehow forgot the override annotation and spelled reequip with only one "e".
  10. Whenever I change my items nbt data the item switch animation gets triggered. Is there any good reason why this happens or is it a bug?
  11. Hahaha! I did it! It works! with just one json file! Turns out that my entire approach was wrong. what I should have used instead was the built in override/predicate stuff. I rewrote my json to look like this: created my own property getter: and added it to my item with addPropertyOverride(new ResourceLocation("type"), new SubItemPropertyGetter()); And that's all that I had to do! I feel so dumb now. Shouldn't have stayed up so long trying to figure this out yesterday. Thanks for all your ideas guys, really helped to get this working. Now I just have to somehow merge this back into my main project.
  12. class Empire extends NBTBase{ @Override public void write(DataOutput output){ //your code here } @Override public void read(DataInput input, int depth, NBTSizeTracker sizeTracker){ //your code here } //other code here } Or look at the NBTTagList class.
  13. It sure is possible. But trust me, it will be a nightmare. Even more so if you want to stay compatible with other mods. I would start with something else first and get a feel for forge before you tackle such a task. The only way I could come up with that doesn't require you to rewrite the rendering system is to replace vanilla dirt with your custom block and switch between it's blockstates (and models) depending on the surrounding blocks.
  14. Ok, I did some research. First, you could probably use the NBTTagList to store your list. And NBTTagList is a list that storesd NBTBase objects. So if you make your Empire class a child of NBTBase and overwrite the write and read method you should be fine.
  15. Interesting that I have to place items in the blockstate folder. As far as I can tell Minecraft doesn't have item files in the blockstates folder. And I had a really good reason why I copied the entire generated file instead of extending it, but right now I have absolutely no idea what it was. Thing something else was under some conditions buggy when I didn't put all that stuff into my own file. I will try to extend generated again when I get back to work. Oh, and thanks for pointing out that I could use the search tab. I wasn't sure which one I wanted to use for all my items and in the end I just decided to screw it and override the method in my own item class so that I could ignore the tab. Will report back in a few hours when I wake up again.
  16. Ok, so apparently I need my password to access the bitbucket webinterface. Which I only have on my laptop. I revived my github account and uploaded the project there instead. What I uploaded is the most slimmed down version I could come up with, it should only contain the bare minimum necessary to get MetaItems working. Thanks for helping me btw. Really appreciate it.
  17. Right now I am in the process of removing all the unnecessary code I can find to check if any of it interfered with my meta item. I will check how I can make my bit bucket public once I am back on my PC. And yes all my other items are working (as long as I am not trying to create meta items)
  18. move the array to the top of your class? And if your BlankRunes parent class is a custom one you could add somthing like this to its constructor: _Items.items.add(this); To avoid filing the list by hand. And read the java coding conventions. Variables are lowerCamelCase or UPPERCASE.
  19. Ok, I updated forge. As far as I can tell there are still no obvious file not found errors. Again, everything worked fine with the same file names back when I only tried to add a normal item. Here is the new log: My Items Class: Item Basic And my ItemRegistry
  20. Ok, gonna update forge. Again. But I used the same file names and same locations before I gave meta items a try. And back then they worked. I will report back once I update forge.
  21. Ok: ItemRender thingy: Json: standard: And log
  22. I tried it with a "=", didn't work either. The items are just transparent. Any ideas why?
  23. well yeah, I could create multiple json files. But now that we have to use the json stuff I want to at least use it properly. And I am afraid that I will need a lot of subitems in the future. Creating new json files for each and every one of them would be a nightmare.
  24. Didn't know we had register events for the client side too. Thanks. I switched over to ItemModelMesher too. But are you sure that the second argument is supposed to be the max metadata? I think it's supposed to be the current sub items meta, so that variants can be mapped to metadata(numbers). But I didn't actually get the variants working. Sorry if this is something totally obvious, I recently returned to forge and a LOT has changed. Here are my json file and what I currently use to register my items: Now at least I can put something else than inventory in the last string without mc crashing.
×
×
  • Create New...

Important Information

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