ToshioSM Posted July 24, 2013 Share Posted July 24, 2013 Hi all, I noticed that moodle HeavyLoad has a small bug. Always read 3rd lvl moodle named "Very Heavy Load" When i tested to receive 4th lvl moodle named "Extremely Heavy Load", it was impossible.So, i checked code in Moodle.java: if (this.Type == MoodleType.HeavyLoad) { int LevelToSet = 0; float weight = this.Parent.getInventory().getRealWeight(); float maxWeight = this.Parent.getMaxWeight().intValue(); float Ratio = weight / maxWeight; if (this.Parent.getBodyDamage().getHealth() != 0.0F) { if (Ratio > 1.0F) { LevelToSet = 3; } } if (LevelToSet != getLevel()) { SetLevel(LevelToSet); MoodleStatusChanged = true; } }And already i'd know why i couldn't receive 4th lvl moodle HeavyLoad or 1st lvl moodle HeavyLoad. So, i corrected this part for: if (this.Type == MoodleType.HeavyLoad) { int LevelToSet = 0; float weight = this.Parent.getInventory().getRealWeight(); float maxWeight = this.Parent.getMaxWeight().intValue(); float Ratio = weight / maxWeight; if (this.Parent.getBodyDamage().getHealth() != 0.0F) { if ((Ratio > 1.0F) && (Ratio < 1.5F)) { LevelToSet = 1; } if ((Ratio >= 1.5F) && (Ratio < 2.5F)) { LevelToSet = 2; } if ((Ratio >= 2.5F) && (Ratio < 5.0F)) { LevelToSet = 3; } if (Ratio >= 5.0F) { LevelToSet = 4; } } if (LevelToSet != getLevel()) { SetLevel(LevelToSet); MoodleStatusChanged = true; } }Compiled back to Moodle.class and turned on game. Without problems. Screenshots: 1st lvl: http://scr.hu/194k/o2l8a2nd lvl: http://scr.hu/194k/x1dle3rd lvl: http://scr.hu/194k/ymu1j4th lvl: http://http://scr.hu/194k/eq00a Download link:Fixed Moodle.class (6 KB) https://mega.co.nz/#!0U8GyCKA!RiRHrHB9n ... NqYnLAJoQQ RoboMat and Kaptain Kallum 2 Link to comment Share on other sites More sharing options...
bmckee89 Posted July 25, 2013 Share Posted July 25, 2013 Very nice, thank you Link to comment Share on other sites More sharing options...
dida55 Posted August 11, 2013 Share Posted August 11, 2013 Didn't work 'unsupported major.minor version 51.0' Link to comment Share on other sites More sharing options...
Rathlord Posted August 11, 2013 Share Posted August 11, 2013 You might want to compile for Java 6 so that this mod is compatible with Mac users running old(ish) operating systems who can't update to Java 7. Link to comment Share on other sites More sharing options...
ToshioSM Posted August 14, 2013 Author Share Posted August 14, 2013 Didn't work 'unsupported major.minor version 51.0'This file was compiled with using JDK 7u25. If you can that update your Java to latest version. You might want to compile for Java 6 so that this mod is compatible with Mac users running old(ish) operating systems who can't update to Java 7.You're right, i compiled it with JDK 7u25. Link to comment Share on other sites More sharing options...
Rathlord Posted August 14, 2013 Share Posted August 14, 2013 A lot of the Mac users can only use up to JRE 6, so you might consider recompiling for us if you know how. Edit: It will still be compatible with JRE 7. Link to comment Share on other sites More sharing options...
harakka Posted August 15, 2013 Share Posted August 15, 2013 You should be able to compile to a 1.6 compliance level by adding "-source 1.6 -target 1.6" to your javac parameters. Or if you're using some fancy IDE, there is probably a compliance level setting in your project settings somewhere. Link to comment Share on other sites More sharing options...
Freakling Posted September 30, 2013 Share Posted September 30, 2013 Necro here. Where did you find moodle.java? I'd like to make some changes myselft but can only find the .class file Link to comment Share on other sites More sharing options...
RoboMat Posted September 30, 2013 Share Posted September 30, 2013 Necro here. Where did you find moodle.java? I'd like to make some changes myselft but can only find the .class file You'll have to decompile it yourself. Eggplanticus shows you how to do it here: http://theindiestone.com/forums/index.php/topic/1156-pz-source-code-spelunking-debugging-and-decompiling/ Recompiling is another issue alltogether Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now