Merge pull request #3062 from THOMASS47/master

Fix crash when cycling tool ability while looking fully up or down in a ladder
This commit is contained in:
HbmMods 2026-07-27 15:48:11 +02:00 committed by GitHub
commit 5eb2ac0ac6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -569,7 +569,7 @@ public class ItemToolAbility extends ItemTool implements IDepthRockTool, IGUIPro
EntityPlayerMP playerMP = (EntityPlayerMP) player; EntityPlayerMP playerMP = (EntityPlayerMP) player;
MovingObjectPosition mop = EntityDamageUtil.getMouseOver(playerMP, playerMP.theItemInWorldManager.getBlockReachDistance()); MovingObjectPosition mop = EntityDamageUtil.getMouseOver(playerMP, playerMP.theItemInWorldManager.getBlockReachDistance());
if(mop.typeOfHit == mop.typeOfHit.BLOCK) { if(mop != null && mop.typeOfHit == mop.typeOfHit.BLOCK) {
// this is horrifying and won't always produce the correct results, but it beats not having anything // this is horrifying and won't always produce the correct results, but it beats not having anything
// simply put, we check if we are aiming at a block, and if we do, we compare that block's onBlockActivated // simply put, we check if we are aiming at a block, and if we do, we compare that block's onBlockActivated
// method to the one from Block.class. If the declaring class doesn't match, it's overridden, and we // method to the one from Block.class. If the declaring class doesn't match, it's overridden, and we