/snip
But, i have this error: Caused by: java.lang.ClassNotFoundException: File 'data/hullmods/LT_PortableFarm.java', Line 25, Column 16: Assignment conversion not possible from type "com.fs.starfarer.api.combat.ShipAPI$HullSize" to type "int"
That's an error coming from the Janino compiler.
Something about the enum switch it doesn't like.
Perhaps a bug in Janino, as it's supposed to support Java 1.5 enum switches.
Though you appear to have a filename case mismatch too, which might be contributing to the problem.
The class "Lt_PortableFarm" is defined in the file "LT_PortableFarm.java". (Note "Lt_" vs "LT_".)
The Java class file format & compiler require the two to be identical. (it's possible Janino doesn't explicitly check for this, and consequently fails at a later unrelated compilation step).
If correcting that mismatch doesn't fix it, I'd try tweaking the code to see if it's a bug in Janino's compiler that can be avoided.
e.g.
1) Try re-ordering the case statements.
2) Try adding the missing "case DEFAULT:" and/or add a "default:" case too.
3) Try assigning the hullsize to a local variable & switching on that instead.
Worst case scenario; avoid using the Janino compiler completely by compiling the class yourself.