From 0f39a4bfb71b325b5795041fc0e4594541376ec1 Mon Sep 17 00:00:00 2001 From: Pix3lPirat3 Date: Sun, 5 Jan 2025 18:11:25 -0800 Subject: [PATCH 1/4] Patches isInWater for digSpeed If the bot is standing in water it should not be slowed, however passing isInWater is slowing it, while digSpeed should only be slowed if the block at eyeHeight is water --- lib/plugins/digging.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/plugins/digging.js b/lib/plugins/digging.js index 39d3efbc5..492fde9f2 100644 --- a/lib/plugins/digging.js +++ b/lib/plugins/digging.js @@ -242,7 +242,7 @@ function inject (bot) { return block.digTime( type, creative, - bot.entity.isInWater, + bot.blockAt(bot.entity.position.offset(0, bot.entity.eyeHeight, 0)).name === 'water', !bot.entity.onGround, enchantments, bot.entity.effects From dbe086bc029e9f3fdcce0177ecdcb875f65f4087 Mon Sep 17 00:00:00 2001 From: Pix3lPirat3 Date: Mon, 6 Jan 2025 09:58:57 -0800 Subject: [PATCH 2/4] Added bot._getBlockAtEyeLevel --- lib/plugins/digging.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/plugins/digging.js b/lib/plugins/digging.js index 492fde9f2..6d39a4a65 100644 --- a/lib/plugins/digging.js +++ b/lib/plugins/digging.js @@ -242,13 +242,16 @@ function inject (bot) { return block.digTime( type, creative, - bot.blockAt(bot.entity.position.offset(0, bot.entity.eyeHeight, 0)).name === 'water', + _getBlockAtEyeLevel()?.name === 'water', !bot.entity.onGround, enchantments, bot.entity.effects ) } + _getBlockAtEyeLevel = () => bot.entity.position && bot.blockAt(bot.entity.position.offset(0, bot.entity.eyeHeight, 0)) + + bot._getBlockAtEyeLevel = _getBlockAtEyeLevel; bot.dig = dig bot.stopDigging = noop bot.canDigBlock = canDigBlock From 3aa173961f5f39bb29c9be90f799e0e731f78f0c Mon Sep 17 00:00:00 2001 From: Pix3lPirat3 Date: Mon, 6 Jan 2025 14:12:07 -0800 Subject: [PATCH 3/4] Update digging.js --- lib/plugins/digging.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/plugins/digging.js b/lib/plugins/digging.js index 6d39a4a65..23bbc79ea 100644 --- a/lib/plugins/digging.js +++ b/lib/plugins/digging.js @@ -249,9 +249,7 @@ function inject (bot) { ) } - _getBlockAtEyeLevel = () => bot.entity.position && bot.blockAt(bot.entity.position.offset(0, bot.entity.eyeHeight, 0)) - - bot._getBlockAtEyeLevel = _getBlockAtEyeLevel; + bot._getBlockAtEyeLevel = () => bot.entity.position && bot.blockAt(bot.entity.position.offset(0, bot.entity.eyeHeight, 0)) bot.dig = dig bot.stopDigging = noop bot.canDigBlock = canDigBlock From c7ce4ef650a165444fd2ddeb8535262830911ee6 Mon Sep 17 00:00:00 2001 From: Pix3lPirat3 Date: Mon, 6 Jan 2025 14:14:58 -0800 Subject: [PATCH 4/4] Update digging.js --- lib/plugins/digging.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/plugins/digging.js b/lib/plugins/digging.js index 23bbc79ea..a15b68435 100644 --- a/lib/plugins/digging.js +++ b/lib/plugins/digging.js @@ -242,7 +242,7 @@ function inject (bot) { return block.digTime( type, creative, - _getBlockAtEyeLevel()?.name === 'water', + bot._getBlockAtEyeLevel()?.name === 'water', !bot.entity.onGround, enchantments, bot.entity.effects