mirror of
https://github.com/kolbytn/mindcraft.git
synced 2025-03-28 14:56:24 +01:00
'physicTick' to 'physicsTick' patch
This commit is contained in:
parent
b82af55c4b
commit
4e5000b8da
2 changed files with 28 additions and 2 deletions
|
@ -1,8 +1,8 @@
|
||||||
diff --git a/node_modules/mineflayer-collectblock/lib/CollectBlock.js b/node_modules/mineflayer-collectblock/lib/CollectBlock.js
|
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
|
--- a/node_modules/mineflayer-collectblock/lib/CollectBlock.js
|
||||||
+++ b/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);
|
yield bot.tool.equipForBlock(block, equipToolOptions);
|
||||||
// @ts-expect-error
|
// @ts-expect-error
|
||||||
|
@ -11,3 +11,16 @@ index 2c11e8c..bc47dc7 100644
|
||||||
options.targets.removeTarget(block);
|
options.targets.removeTarget(block);
|
||||||
return;
|
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();
|
||||||
|
|
13
patches/mineflayer-pvp+1.3.2.patch
Normal file
13
patches/mineflayer-pvp+1.3.2.patch
Normal 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(); });
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue