If you want to apply the simplified patch without a config variable, you'll just need to insert 5 lines of code in PlayerInstance.java, as Mobius shared above.
Try this.
Index: java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java
===================================================================
--- java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java (revision 7949)
+++ java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java (working copy)
@@ -13426,6 +13426,11 @@
}
if (_fallingDamageTask != null)
{
+ final int nearestZ = GeoEngine.getInstance().getHeightNearest(getX(), getY(), getZ());
+ if (getZ() < nearestZ)
+ {
+ teleToLocation(new Location(getX(), getY(), nearestZ));
+ }
_fallingDamageTask.cancel(true);
}
_fallingDamageTask = ThreadPool.schedule(() ->
Please do extensive tests because this can cause many problems if it is not proper.
If it works, also test without geodata.
Yon can apply it as a patch (copy all the provided patch, right click project on Eclipse > Team > Apply Patch...) or manually in the case you have some customs that can interfere with the patch provided, but i doubt it will be the case
For further understanding of what this patch does:
final int nearestZ = GeoEngine.getInstance().getHeightNearest(getX(), getY(), getZ());Store the nearest Z value of the world (Z is relative to Height).
if (getZ() < nearestZ)Check if Player's Z position is below the nearest world Z position.
teleToLocation(new Location(getX(), getY(), nearestZ));Teleports the Player to the same X and Y coordinates, but replaces his Z position with the nearest world Z value, so it gets bumped to the surface.
If you are new to Java (or new to OOP in general), you should try to analyze code this way, line by line and step by step. Also, try to learn the project structure, so it will be easier to understand how thing works and making further changes. You can find PlayerInstance.java inside java/org/l2jmobius/gameserver/model/actor/instance for example, as it's written on the patch header.
Cheers!