'physicTick' to 'physicsTick' patch

This commit is contained in:
BF5258 2024-09-26 16:45:40 +10:00
parent b82af55c4b
commit 4e5000b8da
2 changed files with 28 additions and 2 deletions

View file

@ -1,8 +1,8 @@
diff --git a/node_modules/mineflayer-collectblock/lib/CollectBlock.js b/node_modules/mineflayer-collectblock/lib/CollectBlock.js
index 2c11e8c..bc47dc7 100644
index 2c11e8c..a79a4fb 100644
--- a/node_modules/mineflayer-collectblock/lib/CollectBlock.js
+++ b/node_modules/mineflayer-collectblock/lib/CollectBlock.js
@@ -77,7 +77,7 @@ function mineBlock(bot, block, options) {
@@ -77,10 +77,11 @@ function mineBlock(bot, block, options) {
}
yield bot.tool.equipForBlock(block, equipToolOptions);
// @ts-expect-error
@ -11,3 +11,16 @@ index 2c11e8c..bc47dc7 100644
options.targets.removeTarget(block);
return;
}
+
const tempEvents = new TemporarySubscriber_1.TemporarySubscriber(bot);
tempEvents.subscribeTo('itemDrop', (entity) => {
if (entity.position.distanceTo(block.position.offset(0.5, 0.5, 0.5)) <= 0.5) {
@@ -92,7 +93,7 @@ function mineBlock(bot, block, options) {
// Waiting for items to drop
yield new Promise(resolve => {
let remainingTicks = 10;
- tempEvents.subscribeTo('physicTick', () => {
+ tempEvents.subscribeTo('physicsTick', () => {
remainingTicks--;
if (remainingTicks <= 0) {
tempEvents.cleanup();

View file

@ -0,0 +1,13 @@
diff --git a/node_modules/mineflayer-pvp/lib/PVP.js b/node_modules/mineflayer-pvp/lib/PVP.js
index 758c2b3..7c7220e 100644
--- a/node_modules/mineflayer-pvp/lib/PVP.js
+++ b/node_modules/mineflayer-pvp/lib/PVP.js
@@ -48,7 +48,7 @@ class PVP {
this.meleeAttackRate = new TimingSolver_1.MaxDamageOffset();
this.bot = bot;
this.movements = new mineflayer_pathfinder_1.Movements(bot, require('minecraft-data')(bot.version));
- this.bot.on('physicTick', () => this.update());
+ this.bot.on('physicsTick', () => this.update());
this.bot.on('entityGone', e => { if (e === this.target)
this.stop(); });
}