Jump to content

[Fixed bug] Moodle - HeavyLoad (always just 3rd lvl) [PZ 2.9.9.10]


ToshioSM

Recommended Posts

Hi all, icon_clyde.gif 

I noticed that moodle HeavyLoad has a small bug. Always read 3rd lvl moodle named "Very Heavy Load" icon_rolleyes.gif 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. icon_eek.gif 

So, i corrected this part for: icon_tophat.gif

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: icon_clyde.gif

 

1st lvl: http://scr.hu/194k/o2l8a
2nd lvl: http://scr.hu/194k/x1dle
3rd lvl: http://scr.hu/194k/ymu1j
4th lvl: http://http://scr.hu/194k/eq00a

 

Download link:
Fixed Moodle.class (6 KB)

 

https://mega.co.nz/#!0U8GyCKA!RiRHrHB9n ... NqYnLAJoQQ

 

 

 

 

Link to comment
Share on other sites

  • 3 weeks later...

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

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

  • 1 month later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...