Damn, might use this. Thank you for the contribution, highly appreciated for both the idea and the snippet <3
Printable View
Damn, might use this. Thank you for the contribution, highly appreciated for both the idea and the snippet <3
I'm a little confused on this part. Your dayOfWeek() is an int, what do you mean it wouldn't parse to an int? You shouldn't need to parse or anything like that, just return cal.get(Calendar.DAY_OF_WEEK);Quote:
Originally Posted by TheQuantum [Only registered and activated users can see links. Click Here To Register...]
Naming is whatever, but you should get into the practice of using private variables with getters/setters instead of making everything public.Quote:
Originally Posted by TheQuantum [Only registered and activated users can see links. Click Here To Register...]
Really all above. This is just a standalone static class, don't include all that 'extends Action' and all of the auto-generated methods and shit.Quote:
Originally Posted by TheQuantum [Only registered and activated users can see links. Click Here To Register...]
Use getters/setters, maybe just make this not a static class, and save the class on the player so you can instead store variables inside of the class instead of player, and avoid the naming issues you said you had. Will keep your player class a lot cleaner as well.
When doing it that method, when it tried to save to the player file as that int, it returned as a different format. Don't ask me why, i actually did that, and even :Quote:
Originally Posted by Cody_ [Only registered and activated users can see links. Click Here To Register...]
None of those was for some reason sending the right format to the player file and reverting back to 0 everytime, allowing them to do it multiple times. When doing it, it got errors saying that it was Wrong Format.Quote:
int val = DayOfWeekObject.getValue()
int dayOfWeek = getDayOfWeek(c.get(Calendar.DAY_OF_WEEK));
As for doing getter/setter, thats something i haven't learned yet, im not sure how those work. I will look into guides on how those work and how it would be able to make files like this better, only way i know how to set player specific variables like that is to making it public so i shall look into that way if it is better.
If you're using the same serializer for player saving, you should look at how Matrix does their "Manager" system. I am not a fan of that system to begin with but it is more organized than having all the variables in the Player class. Just search your player class for anything with the word "Manager" as the type name (IE: PrayerManager, EmotesManager, AuraManager, etc)Quote:
Originally Posted by TheQuantum [Only registered and activated users can see links. Click Here To Register...]