
Jacky2611
Members-
Content Count
499 -
Joined
-
Last visited
-
Days Won
1
Jacky2611 last won the day on July 19 2017
Jacky2611 had the most liked content!
Community Reputation
42 ExcellentAbout Jacky2611
-
Rank
Diamond Finder
Converted
-
Gender
Undisclosed
-
Location
Austria
-
Personal Text
Where are you sweet little bug? Come to me!
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
-
[1.12, latest][Solved]Item switch animation when nbt changes.
Jacky2611 replied to Jacky2611's topic in Modder Support
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. -
[1.12, latest][Solved]Item switch animation when nbt changes.
Jacky2611 replied to Jacky2611's topic in Modder Support
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. -
[1.12, latest][Solved]Item switch animation when nbt changes.
Jacky2611 replied to Jacky2611's topic in Modder Support
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. -
[1.12, latest][Solved]Item switch animation when nbt changes.
Jacky2611 replied to Jacky2611's topic in Modder Support
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.) -
[1.12, latest][Solved]Item switch animation when nbt changes.
Jacky2611 replied to Jacky2611's topic in Modder Support
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. -
[1.12, latest][Solved]Item switch animation when nbt changes.
Jacky2611 replied to Jacky2611's topic in Modder Support
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! -
[1.12, latest][Solved]Item switch animation when nbt changes.
Jacky2611 replied to Jacky2611's topic in Modder Support
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. -
[1.12, latest][Solved]Item switch animation when nbt changes.
Jacky2611 replied to Jacky2611's topic in Modder Support
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 -
[1.12, latest][Solved]Item switch animation when nbt changes.
Jacky2611 replied to Jacky2611's topic in Modder Support
I am already doing that. EDIT: Somehow forgot the override annotation and spelled reequip with only one "e". -
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.
-
Help with WorldSavedData and custom objects
Jacky2611 replied to powerLineDayDreams's topic in Modder Support
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. -
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.
-
Help with WorldSavedData and custom objects
Jacky2611 replied to powerLineDayDreams's topic in Modder Support
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. -
Help with WorldSavedData and custom objects
Jacky2611 replied to powerLineDayDreams's topic in Modder Support
Have you tried implementing INBTSerializeable?