mineflayer 4.26.0 → 4.27.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/docs/api.md CHANGED
@@ -2122,7 +2122,19 @@ These are lower level methods for the inventory, they can be useful sometimes bu
2122
2122
 
2123
2123
  This function returns a `Promise`, with `void` as its argument upon completion.
2124
2124
 
2125
- The only valid mode option at the moment is 0. Shift clicking or mouse dragging is not implemented.
2125
+ mode support:
2126
+ - stable:
2127
+ - mouse clicks (0)
2128
+
2129
+ - experimental:
2130
+ - shift clicks (1)
2131
+ - number clicks (2)
2132
+ - middle clicks (3)
2133
+ - drop clicks (4)
2134
+
2135
+ - unimplemented:
2136
+ - drag clicks (5)
2137
+ - double clicks (6)
2126
2138
 
2127
2139
  Click on the current window. See details at https://wiki.vg/Protocol#Click_Container
2128
2140
 
package/docs/history.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## 4.27.0
2
+ * [Entity Passengers get pushed wrongly (#3601)](https://github.com/PrismarineJS/mineflayer/commit/deb03b52d1e015ece9df1f14536f168f64895c81) (thanks @SinanAkkoyun)
3
+ * [Update bot.clickWindow documentation (#3574)](https://github.com/PrismarineJS/mineflayer/commit/188db17bbb95461743aec2823695c360685559b0) (thanks @kaduvert)
4
+ * [Saving uuid for non-players too (#3603)](https://github.com/PrismarineJS/mineflayer/commit/9937be9b49bb3dd7cd5502c0424809fa66eb60b3) (thanks @SinanAkkoyun)
5
+
1
6
  ## 4.26.0
2
7
  * [Use node 22 (#3570)](https://github.com/PrismarineJS/mineflayer/commit/dbff9314418d30df203c32fe83f2a1b56653d0a6) (thanks @rom1504)
3
8
  * [Fix infinity setTimeout by throwing error (#3561)](https://github.com/PrismarineJS/mineflayer/commit/69539494c88c2ca718330142839a35414ecd3bda) (thanks @BBpezsgo)
@@ -207,6 +207,7 @@ function inject (bot) {
207
207
  const entityData = bot.registry.entities[entityType]
208
208
  setEntityData(entity, entityType, entityData)
209
209
  updateEntityPos(entity, pos)
210
+ entity.uuid = uuid
210
211
  return entity
211
212
  }
212
213
 
@@ -807,9 +808,9 @@ function inject (bot) {
807
808
  const vehicle = packet.vehicleId === -1 ? null : fetchEntity(packet.vehicleId)
808
809
 
809
810
  const originalVehicle = passenger.vehicle
810
- if (originalVehicle !== null) {
811
+ if (originalVehicle) {
811
812
  const index = originalVehicle.passengers.indexOf(passenger)
812
- originalVehicle.passengers = originalVehicle.passengers.splice(index, 1)
813
+ originalVehicle.passengers.splice(index, 1)
813
814
  }
814
815
  passenger.vehicle = vehicle
815
816
  vehicle.passengers.push(passenger)
@@ -832,12 +833,12 @@ function inject (bot) {
832
833
 
833
834
  for (const passengerEntity of passengerEntities) {
834
835
  const originalVehicle = passengerEntity.vehicle
835
- if (originalVehicle !== null) {
836
+ if (originalVehicle) {
836
837
  const index = originalVehicle.passengers.indexOf(passengerEntity)
837
- originalVehicle.passengers = originalVehicle.passengers.splice(index, 1)
838
+ originalVehicle.passengers.splice(index, 1)
838
839
  }
839
840
  passengerEntity.vehicle = vehicle
840
- if (vehicle !== null) {
841
+ if (vehicle) {
841
842
  vehicle.passengers.push(passengerEntity)
842
843
  }
843
844
  }
@@ -868,7 +869,7 @@ function inject (bot) {
868
869
  if (entity.vehicle) {
869
870
  const index = entity.vehicle.passengers.indexOf(entity)
870
871
  if (index !== -1) {
871
- entity.vehicle.passengers = entity.vehicle.passengers.splice(index, 1)
872
+ entity.vehicle.passengers.splice(index, 1)
872
873
  }
873
874
  }
874
875
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mineflayer",
3
- "version": "4.26.0",
3
+ "version": "4.27.0",
4
4
  "description": "create minecraft bots with a stable, high level API",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",