mirror of
https://github.com/kolbytn/mindcraft.git
synced 2025-04-29 19:44:53 +02:00
Merge pull request #247 from kolbytn/fix-inf-jump
Fix Infinite Jumping (mostly)
This commit is contained in:
commit
8784519a79
9 changed files with 18 additions and 12 deletions
|
@ -11,6 +11,7 @@
|
||||||
|
|
||||||
"modes": {
|
"modes": {
|
||||||
"self_preservation": true,
|
"self_preservation": true,
|
||||||
|
"unstuck": true,
|
||||||
"cowardice": true,
|
"cowardice": true,
|
||||||
"self_defense": true,
|
"self_defense": true,
|
||||||
"hunting": true,
|
"hunting": true,
|
||||||
|
|
|
@ -1,17 +1,16 @@
|
||||||
diff --git a/node_modules/mineflayer-pathfinder/index.js b/node_modules/mineflayer-pathfinder/index.js
|
diff --git a/node_modules/mineflayer-pathfinder/index.js b/node_modules/mineflayer-pathfinder/index.js
|
||||||
index b38bd30..cfaa677 100644
|
index b38bd30..bf16a63 100644
|
||||||
--- a/node_modules/mineflayer-pathfinder/index.js
|
--- a/node_modules/mineflayer-pathfinder/index.js
|
||||||
+++ b/node_modules/mineflayer-pathfinder/index.js
|
+++ b/node_modules/mineflayer-pathfinder/index.js
|
||||||
@@ -541,7 +541,7 @@ function inject (bot) {
|
@@ -550,6 +550,7 @@ function inject (bot) {
|
||||||
let canPlace = true
|
lockEquipItem.release()
|
||||||
if (placingBlock.jump) {
|
const refBlock = bot.blockAt(new Vec3(placingBlock.x, placingBlock.y, placingBlock.z), false)
|
||||||
bot.setControlState('jump', true)
|
if (!lockPlaceBlock.tryAcquire()) return
|
||||||
- canPlace = placingBlock.y + 1 < bot.entity.position.y
|
+ bot.world.setBlockStateId(refBlock.position.offset(placingBlock.dx, placingBlock.dy, placingBlock.dz), 1)
|
||||||
+ canPlace = placingBlock.y + 1.8 < bot.entity.position.y
|
if (interactableBlocks.includes(refBlock.name)) {
|
||||||
}
|
bot.setControlState('sneak', true)
|
||||||
if (canPlace) {
|
}
|
||||||
if (!lockEquipItem.tryAcquire()) return
|
@@ -557,6 +558,7 @@ function inject (bot) {
|
||||||
@@ -557,6 +557,7 @@ function inject (bot) {
|
|
||||||
.then(function () {
|
.then(function () {
|
||||||
// Dont release Sneak if the block placement was not successful
|
// Dont release Sneak if the block placement was not successful
|
||||||
bot.setControlState('sneak', false)
|
bot.setControlState('sneak', false)
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
|
|
||||||
"modes": {
|
"modes": {
|
||||||
"self_preservation": true,
|
"self_preservation": true,
|
||||||
|
"unstuck": true,
|
||||||
"cowardice": true,
|
"cowardice": true,
|
||||||
"self_defense": true,
|
"self_defense": true,
|
||||||
"hunting": true,
|
"hunting": true,
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
|
|
||||||
"modes": {
|
"modes": {
|
||||||
"self_preservation": true,
|
"self_preservation": true,
|
||||||
|
"unstuck": true,
|
||||||
"cowardice": false,
|
"cowardice": false,
|
||||||
"self_defense": true,
|
"self_defense": true,
|
||||||
"hunting": true,
|
"hunting": true,
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
|
|
||||||
"modes": {
|
"modes": {
|
||||||
"self_preservation": true,
|
"self_preservation": true,
|
||||||
|
"unstuck": true,
|
||||||
"cowardice": true,
|
"cowardice": true,
|
||||||
"self_defense": true,
|
"self_defense": true,
|
||||||
"hunting": true,
|
"hunting": true,
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
|
|
||||||
"modes": {
|
"modes": {
|
||||||
"self_preservation": true,
|
"self_preservation": true,
|
||||||
|
"unstuck": true,
|
||||||
"cowardice": false,
|
"cowardice": false,
|
||||||
"self_defense": true,
|
"self_defense": true,
|
||||||
"hunting": true,
|
"hunting": true,
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
|
|
||||||
"modes": {
|
"modes": {
|
||||||
"self_preservation": true,
|
"self_preservation": true,
|
||||||
|
"unstuck": true,
|
||||||
"cowardice": false,
|
"cowardice": false,
|
||||||
"self_defense": true,
|
"self_defense": true,
|
||||||
"hunting": true,
|
"hunting": true,
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
|
|
||||||
"modes": {
|
"modes": {
|
||||||
"self_preservation": true,
|
"self_preservation": true,
|
||||||
|
"unstuck": true,
|
||||||
"cowardice": false,
|
"cowardice": false,
|
||||||
"self_defense": true,
|
"self_defense": true,
|
||||||
"hunting": true,
|
"hunting": true,
|
||||||
|
|
|
@ -14,7 +14,7 @@ export function getCommand(name) {
|
||||||
return commandMap[name];
|
return commandMap[name];
|
||||||
}
|
}
|
||||||
|
|
||||||
const commandRegex = /!(\w+)(?:\(((?:[^)(]+|'[^']*'|"[^"]*")*)\))?/
|
const commandRegex = /!(\w+)(?:\(([\s\S]*)\))?/
|
||||||
const argRegex = /(?:"[^"]*"|'[^']*'|[^,])+/g;
|
const argRegex = /(?:"[^"]*"|'[^']*'|[^,])+/g;
|
||||||
|
|
||||||
export function containsCommand(message) {
|
export function containsCommand(message) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue