@serenityjs/protocol 0.1.0-beta.4 → 0.1.0-beta.5
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/dist/index.d.ts +365 -173
- package/dist/index.js +1434 -1218
- package/package.json +7 -7
package/dist/index.d.ts
CHANGED
|
@@ -731,12 +731,12 @@ declare enum MetadataFlags {
|
|
|
731
731
|
LayingDown = 64
|
|
732
732
|
}
|
|
733
733
|
|
|
734
|
-
declare enum
|
|
735
|
-
|
|
734
|
+
declare enum ComplexInventoryTransaction {
|
|
735
|
+
NormalTransaction = 0,
|
|
736
736
|
InventoryMismatch = 1,
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
737
|
+
ItemUseTransaction = 2,
|
|
738
|
+
ItemUseOnEntityTransaction = 3,
|
|
739
|
+
ItemReleaseTransaction = 4
|
|
740
740
|
}
|
|
741
741
|
|
|
742
742
|
declare enum TransactionSourceType {
|
|
@@ -748,22 +748,6 @@ declare enum TransactionSourceType {
|
|
|
748
748
|
Craft = 9999
|
|
749
749
|
}
|
|
750
750
|
|
|
751
|
-
declare enum UseItemAction {
|
|
752
|
-
ClickBlock = 0,
|
|
753
|
-
ClickAir = 1,
|
|
754
|
-
BreakBlock = 2
|
|
755
|
-
}
|
|
756
|
-
|
|
757
|
-
declare enum UseItemOnEntityAction {
|
|
758
|
-
Interact = 0,
|
|
759
|
-
Attack = 1
|
|
760
|
-
}
|
|
761
|
-
|
|
762
|
-
declare enum ItemReleaseAction {
|
|
763
|
-
Release = 0,
|
|
764
|
-
Consume = 1
|
|
765
|
-
}
|
|
766
|
-
|
|
767
751
|
declare enum DeviceOS {
|
|
768
752
|
Undefined = 0,
|
|
769
753
|
Android = 1,
|
|
@@ -1476,6 +1460,39 @@ declare enum PackType {
|
|
|
1476
1460
|
WorldTemplate = 8
|
|
1477
1461
|
}
|
|
1478
1462
|
|
|
1463
|
+
declare enum InventorySourceType {
|
|
1464
|
+
ContainerInventory = 0,
|
|
1465
|
+
GlobalInventory = 1,
|
|
1466
|
+
WorldInteraction = 2,
|
|
1467
|
+
CreativeInventory = 3,
|
|
1468
|
+
NonImplementedFeatureTODO = 99999
|
|
1469
|
+
}
|
|
1470
|
+
|
|
1471
|
+
declare enum ItemUseInventoryTransactionType {
|
|
1472
|
+
Place = 0,
|
|
1473
|
+
Use = 1,
|
|
1474
|
+
Destroy = 2
|
|
1475
|
+
}
|
|
1476
|
+
|
|
1477
|
+
declare enum ItemUseOnEntityInventoryTransactionType {
|
|
1478
|
+
Interact = 0,
|
|
1479
|
+
Attack = 1
|
|
1480
|
+
}
|
|
1481
|
+
|
|
1482
|
+
declare enum ItemReleaseInventoryTransactionType {
|
|
1483
|
+
Release = 0,
|
|
1484
|
+
Consume = 1
|
|
1485
|
+
}
|
|
1486
|
+
|
|
1487
|
+
declare enum BlockFace {
|
|
1488
|
+
Bottom = 0,
|
|
1489
|
+
Top = 1,
|
|
1490
|
+
North = 2,
|
|
1491
|
+
South = 3,
|
|
1492
|
+
West = 4,
|
|
1493
|
+
East = 5
|
|
1494
|
+
}
|
|
1495
|
+
|
|
1479
1496
|
declare class LoginTokens extends DataType {
|
|
1480
1497
|
client: string;
|
|
1481
1498
|
identity: string;
|
|
@@ -1757,147 +1774,6 @@ declare class EntityProperties extends DataType {
|
|
|
1757
1774
|
static write(stream: BinaryStream, value: EntityProperties): void;
|
|
1758
1775
|
}
|
|
1759
1776
|
|
|
1760
|
-
interface Transactions {
|
|
1761
|
-
changedSlots: Array<number>;
|
|
1762
|
-
containerId: number;
|
|
1763
|
-
}
|
|
1764
|
-
declare class TransactionLegacy extends DataType {
|
|
1765
|
-
requestId: number;
|
|
1766
|
-
transactions: Array<Transactions> | null;
|
|
1767
|
-
constructor(requestId: number, transactions: Array<Transactions> | null);
|
|
1768
|
-
static read(stream: BinaryStream): TransactionLegacy;
|
|
1769
|
-
static write(stream: BinaryStream, value: TransactionLegacy): void;
|
|
1770
|
-
}
|
|
1771
|
-
|
|
1772
|
-
interface ItemStackNbt {
|
|
1773
|
-
display?: CompoundTag<ItemStackDisplay> | null;
|
|
1774
|
-
}
|
|
1775
|
-
interface ItemStackDisplay {
|
|
1776
|
-
Name?: StringTag;
|
|
1777
|
-
}
|
|
1778
|
-
|
|
1779
|
-
declare class ItemInstanceUserData extends DataType {
|
|
1780
|
-
nbt: CompoundTag<ItemStackNbt> | null;
|
|
1781
|
-
canPlaceOn: Array<string>;
|
|
1782
|
-
canDestroy: Array<string>;
|
|
1783
|
-
ticking?: bigint | null;
|
|
1784
|
-
/**
|
|
1785
|
-
* Creates an instance of ItemInstanceUserData.
|
|
1786
|
-
* @param nbt NBT data for the item.
|
|
1787
|
-
* @param canPlaceOn Blocks the item can be placed on.
|
|
1788
|
-
* @param canDestroy Blocks the item can destroy.
|
|
1789
|
-
*/
|
|
1790
|
-
constructor(nbt: CompoundTag<ItemStackNbt> | null, canPlaceOn: Array<string>, canDestroy: Array<string>, ticking?: bigint | null);
|
|
1791
|
-
static read(stream: BinaryStream, _endian: Endianness, id: number): ItemInstanceUserData;
|
|
1792
|
-
static write(stream: BinaryStream, value: ItemInstanceUserData, _endian: Endianness, id: number): void;
|
|
1793
|
-
}
|
|
1794
|
-
|
|
1795
|
-
declare class NetworkItemStackDescriptor extends DataType {
|
|
1796
|
-
network: number;
|
|
1797
|
-
stackSize?: number;
|
|
1798
|
-
metadata?: number;
|
|
1799
|
-
stackNetId?: number | null;
|
|
1800
|
-
blockRuntimeId?: number;
|
|
1801
|
-
extras?: ItemInstanceUserData | null;
|
|
1802
|
-
/**
|
|
1803
|
-
* Creates an instance of NetworkItemStackDescriptor.
|
|
1804
|
-
* @param id The network id of the item.
|
|
1805
|
-
* @param stackSize The size of the stack.
|
|
1806
|
-
* @param metadata The metadata of the item.
|
|
1807
|
-
* @param includeStackNetId Whether to include the stack net id.
|
|
1808
|
-
* @param auxValue The aux value of the item.
|
|
1809
|
-
* @param userData The user data of the item.
|
|
1810
|
-
*/
|
|
1811
|
-
constructor(network: number, stackSize?: number, metadata?: number, stackNetId?: number | null, blockRuntimeId?: number, extras?: ItemInstanceUserData | null);
|
|
1812
|
-
static read(stream: BinaryStream): NetworkItemStackDescriptor;
|
|
1813
|
-
static write(stream: BinaryStream, value: NetworkItemStackDescriptor): void;
|
|
1814
|
-
}
|
|
1815
|
-
|
|
1816
|
-
declare class TransactionActions extends DataType {
|
|
1817
|
-
action: number | null;
|
|
1818
|
-
flags: number | null;
|
|
1819
|
-
inventoryId: ContainerId | null;
|
|
1820
|
-
newItem: NetworkItemStackDescriptor;
|
|
1821
|
-
oldItem: NetworkItemStackDescriptor;
|
|
1822
|
-
slot: number;
|
|
1823
|
-
sourceType: TransactionSourceType;
|
|
1824
|
-
constructor(action: number | null, flags: number | null, inventoryId: ContainerId | null, newItem: NetworkItemStackDescriptor, oldItem: NetworkItemStackDescriptor, slot: number, sourceType: TransactionSourceType);
|
|
1825
|
-
static read(stream: BinaryStream): Array<TransactionActions>;
|
|
1826
|
-
static write(stream: BinaryStream, value: TransactionActions): void;
|
|
1827
|
-
}
|
|
1828
|
-
|
|
1829
|
-
declare class TransactionUseItem extends DataType {
|
|
1830
|
-
action: UseItemAction;
|
|
1831
|
-
blockPosition: BlockCoordinates;
|
|
1832
|
-
blockRuntimeId: number;
|
|
1833
|
-
clickPosition: Vector3f;
|
|
1834
|
-
face: number;
|
|
1835
|
-
heldItem: NetworkItemStackDescriptor;
|
|
1836
|
-
hotbarSlot: number;
|
|
1837
|
-
playerPosition: Vector3f;
|
|
1838
|
-
constructor(action: UseItemAction, blockPosition: BlockCoordinates, blockRuntimeId: number, clickPosition: Vector3f, face: number, heldItem: NetworkItemStackDescriptor, hotbarSlot: number, playerPosition: Vector3f);
|
|
1839
|
-
static read(stream: BinaryStream): TransactionUseItem;
|
|
1840
|
-
static write(stream: BinaryStream, value: TransactionUseItem): void;
|
|
1841
|
-
}
|
|
1842
|
-
|
|
1843
|
-
declare class TransactionUseItemOnEntity extends DataType {
|
|
1844
|
-
/**
|
|
1845
|
-
* The action.
|
|
1846
|
-
*/
|
|
1847
|
-
action: UseItemOnEntityAction;
|
|
1848
|
-
/**
|
|
1849
|
-
* The click position.
|
|
1850
|
-
*/
|
|
1851
|
-
clickPosition: Vector3f;
|
|
1852
|
-
/**
|
|
1853
|
-
* The entity runtime id.
|
|
1854
|
-
*/
|
|
1855
|
-
entityRuntimeId: bigint;
|
|
1856
|
-
/**
|
|
1857
|
-
* The held item.
|
|
1858
|
-
*/
|
|
1859
|
-
heldItem: NetworkItemStackDescriptor;
|
|
1860
|
-
/**
|
|
1861
|
-
* The hotbar slot.
|
|
1862
|
-
*/
|
|
1863
|
-
hotbarSlot: number;
|
|
1864
|
-
/**
|
|
1865
|
-
* The player position.
|
|
1866
|
-
*/
|
|
1867
|
-
playerPosition: Vector3f;
|
|
1868
|
-
/**
|
|
1869
|
-
* Creates a new TransactionUseItemOnEntity.
|
|
1870
|
-
*/
|
|
1871
|
-
constructor(action: UseItemOnEntityAction, clickPosition: Vector3f, entityRuntimeId: bigint, heldItem: NetworkItemStackDescriptor, hotbarSlot: number, playerPosition: Vector3f);
|
|
1872
|
-
static read(stream: BinaryStream): TransactionUseItemOnEntity;
|
|
1873
|
-
static write(stream: BinaryStream, value: TransactionUseItemOnEntity): void;
|
|
1874
|
-
}
|
|
1875
|
-
|
|
1876
|
-
declare class TransactionData extends DataType {
|
|
1877
|
-
action: ItemReleaseAction | UseItemAction | UseItemOnEntityAction | null;
|
|
1878
|
-
blockPosition: BlockCoordinates | null;
|
|
1879
|
-
blockRuntimeId: number | null;
|
|
1880
|
-
clickPosition: Vector3f | null;
|
|
1881
|
-
entityRuntimeId: bigint | null;
|
|
1882
|
-
face: number | null;
|
|
1883
|
-
headPosition: Vector3f | null;
|
|
1884
|
-
heldItem: NetworkItemStackDescriptor | null;
|
|
1885
|
-
hotbarSlot: number | null;
|
|
1886
|
-
playerPosition: Vector3f | null;
|
|
1887
|
-
constructor(action: ItemReleaseAction | UseItemAction | UseItemOnEntityAction | null, blockPosition: BlockCoordinates | null, blockRuntimeId: number | null, clickPosition: Vector3f | null, entityRuntimeId: bigint | null, face: number | null, headPosition: Vector3f | null, heldItem: NetworkItemStackDescriptor | null, hotbarSlot: number | null, playerPosition: Vector3f | null);
|
|
1888
|
-
static read(stream: BinaryStream, endian: Endianness, type: TransactionType): TransactionData | null;
|
|
1889
|
-
}
|
|
1890
|
-
|
|
1891
|
-
declare class TransactionItemRelease extends DataType {
|
|
1892
|
-
action: ItemReleaseAction;
|
|
1893
|
-
headPosition: Vector3f;
|
|
1894
|
-
heldItem: NetworkItemStackDescriptor;
|
|
1895
|
-
hotbarSlot: number;
|
|
1896
|
-
constructor(action: ItemReleaseAction, headPosition: Vector3f, heldItem: NetworkItemStackDescriptor, hotbarSlot: number);
|
|
1897
|
-
static read(stream: BinaryStream): TransactionItemRelease;
|
|
1898
|
-
static write(stream: BinaryStream, value: TransactionItemRelease): void;
|
|
1899
|
-
}
|
|
1900
|
-
|
|
1901
1777
|
declare class Links extends DataType {
|
|
1902
1778
|
immediate: boolean;
|
|
1903
1779
|
riddenEntityId: bigint;
|
|
@@ -1970,12 +1846,35 @@ declare class StackRequestSlotInfo extends DataType {
|
|
|
1970
1846
|
static write(stream: BinaryStream, value: StackRequestSlotInfo): void;
|
|
1971
1847
|
}
|
|
1972
1848
|
|
|
1849
|
+
interface ItemStackNbt {
|
|
1850
|
+
display?: CompoundTag<ItemStackDisplay> | null;
|
|
1851
|
+
}
|
|
1852
|
+
interface ItemStackDisplay {
|
|
1853
|
+
Name?: StringTag;
|
|
1854
|
+
}
|
|
1855
|
+
|
|
1856
|
+
declare class ItemInstanceUserData extends DataType {
|
|
1857
|
+
nbt: CompoundTag<ItemStackNbt> | null;
|
|
1858
|
+
canPlaceOn: Array<string>;
|
|
1859
|
+
canDestroy: Array<string>;
|
|
1860
|
+
ticking?: bigint | null;
|
|
1861
|
+
/**
|
|
1862
|
+
* Creates an instance of ItemInstanceUserData.
|
|
1863
|
+
* @param nbt NBT data for the item.
|
|
1864
|
+
* @param canPlaceOn Blocks the item can be placed on.
|
|
1865
|
+
* @param canDestroy Blocks the item can destroy.
|
|
1866
|
+
*/
|
|
1867
|
+
constructor(nbt: CompoundTag<ItemStackNbt> | null, canPlaceOn: Array<string>, canDestroy: Array<string>, ticking?: bigint | null);
|
|
1868
|
+
static read(stream: BinaryStream, _endian: Endianness, id: number): ItemInstanceUserData;
|
|
1869
|
+
static write(stream: BinaryStream, value: ItemInstanceUserData, _endian: Endianness, id: number): void;
|
|
1870
|
+
}
|
|
1871
|
+
|
|
1973
1872
|
declare class NetworkItemInstanceDescriptor extends DataType {
|
|
1974
1873
|
network: number;
|
|
1975
|
-
stackSize
|
|
1976
|
-
metadata
|
|
1977
|
-
|
|
1978
|
-
extras
|
|
1874
|
+
stackSize: number | null;
|
|
1875
|
+
metadata: number | null;
|
|
1876
|
+
networkBlockId: number | null;
|
|
1877
|
+
extras: ItemInstanceUserData | null;
|
|
1979
1878
|
/**
|
|
1980
1879
|
* Creates an instance of NetworkItemInstanceDescriptor.
|
|
1981
1880
|
* @param id The network id of the item.
|
|
@@ -1984,7 +1883,7 @@ declare class NetworkItemInstanceDescriptor extends DataType {
|
|
|
1984
1883
|
* @param auxValue The aux value of the item.
|
|
1985
1884
|
* @param userData The user data of the item.
|
|
1986
1885
|
*/
|
|
1987
|
-
constructor(network: number, stackSize?: number, metadata?: number,
|
|
1886
|
+
constructor(network: number, stackSize?: number | null, metadata?: number | null, networkBlockId?: number | null, extras?: ItemInstanceUserData | null);
|
|
1988
1887
|
static read(stream: BinaryStream): NetworkItemInstanceDescriptor;
|
|
1989
1888
|
static write(stream: BinaryStream, value: NetworkItemInstanceDescriptor): void;
|
|
1990
1889
|
}
|
|
@@ -2039,6 +1938,48 @@ declare class ItemStackResponses extends DataType {
|
|
|
2039
1938
|
static write(stream: BinaryStream, value: Array<ItemStackResponses>): void;
|
|
2040
1939
|
}
|
|
2041
1940
|
|
|
1941
|
+
/**
|
|
1942
|
+
* Represents a network item stack descriptor.
|
|
1943
|
+
*/
|
|
1944
|
+
declare class NetworkItemStackDescriptor extends DataType {
|
|
1945
|
+
/**
|
|
1946
|
+
* The network id of the item.
|
|
1947
|
+
*/
|
|
1948
|
+
readonly network: number;
|
|
1949
|
+
/**
|
|
1950
|
+
* The size of the stack.
|
|
1951
|
+
*/
|
|
1952
|
+
readonly stackSize: number | null;
|
|
1953
|
+
/**
|
|
1954
|
+
* The metadata of the item.
|
|
1955
|
+
*/
|
|
1956
|
+
readonly metadata: number | null;
|
|
1957
|
+
/**
|
|
1958
|
+
* The stack net id of the item.
|
|
1959
|
+
*/
|
|
1960
|
+
readonly stackNetId: number | null;
|
|
1961
|
+
/**
|
|
1962
|
+
* The network block id of the item.
|
|
1963
|
+
*/
|
|
1964
|
+
readonly networkBlockId: number | null;
|
|
1965
|
+
/**
|
|
1966
|
+
* The extra data of the item.
|
|
1967
|
+
*/
|
|
1968
|
+
readonly extras: ItemInstanceUserData | null;
|
|
1969
|
+
/**
|
|
1970
|
+
* Creates an instance of NetworkItemStackDescriptor.
|
|
1971
|
+
* @param id The network id of the item.
|
|
1972
|
+
* @param stackSize The size of the stack.
|
|
1973
|
+
* @param metadata The metadata of the item.
|
|
1974
|
+
* @param stackNetId The stack net id of the item.
|
|
1975
|
+
* @param networkBlockid The network block id of the item.
|
|
1976
|
+
* @param extras The extra data of the item.
|
|
1977
|
+
*/
|
|
1978
|
+
constructor(network: number, stackSize?: number | null, metadata?: number | null, stackNetId?: number | null, networkBlockid?: number | null, extras?: ItemInstanceUserData | null);
|
|
1979
|
+
static read(stream: BinaryStream): NetworkItemStackDescriptor;
|
|
1980
|
+
static write(stream: BinaryStream, value: NetworkItemStackDescriptor): void;
|
|
1981
|
+
}
|
|
1982
|
+
|
|
2042
1983
|
declare class ItemStacks extends DataType {
|
|
2043
1984
|
static read(stream: BinaryStream): Array<NetworkItemStackDescriptor>;
|
|
2044
1985
|
static write(stream: BinaryStream, value: Array<NetworkItemStackDescriptor>): void;
|
|
@@ -2227,6 +2168,259 @@ declare class ComponentItem extends DataType {
|
|
|
2227
2168
|
static write(stream: BinaryStream, value: Array<ComponentItem>): void;
|
|
2228
2169
|
}
|
|
2229
2170
|
|
|
2171
|
+
interface Transactions {
|
|
2172
|
+
containerId: ContainerId;
|
|
2173
|
+
changedSlots: Array<number>;
|
|
2174
|
+
}
|
|
2175
|
+
/**
|
|
2176
|
+
* The LegacyTransaction class is used to represent a legacy transaction.
|
|
2177
|
+
* This system is still used for some inventory related transactions.
|
|
2178
|
+
*/
|
|
2179
|
+
declare class LegacyTransaction extends DataType {
|
|
2180
|
+
/**
|
|
2181
|
+
* The request identifier of the legacy transaction.
|
|
2182
|
+
*/
|
|
2183
|
+
readonly request: number;
|
|
2184
|
+
/**
|
|
2185
|
+
* The actions of the legacy transaction.
|
|
2186
|
+
* If the request identifier is 0, then this value will not be present.
|
|
2187
|
+
*/
|
|
2188
|
+
readonly actions: Array<Transactions> | null;
|
|
2189
|
+
/**
|
|
2190
|
+
* Creates an instance of LegacyTransaction.
|
|
2191
|
+
*
|
|
2192
|
+
* @param request The request identifier of the legacy transaction.
|
|
2193
|
+
* @param actions The actions of the legacy transaction.
|
|
2194
|
+
*/
|
|
2195
|
+
constructor(request: number, actions?: Array<Transactions> | null);
|
|
2196
|
+
static read(stream: BinaryStream): LegacyTransaction;
|
|
2197
|
+
static write(stream: BinaryStream, value: LegacyTransaction): void;
|
|
2198
|
+
}
|
|
2199
|
+
|
|
2200
|
+
/**
|
|
2201
|
+
* Represents the source of an inventory action.
|
|
2202
|
+
*/
|
|
2203
|
+
declare class InventorySource extends DataType {
|
|
2204
|
+
/**
|
|
2205
|
+
* The source type of the inventory action.
|
|
2206
|
+
*/
|
|
2207
|
+
readonly type: InventorySourceType;
|
|
2208
|
+
/**
|
|
2209
|
+
* The container id of the inventory source.
|
|
2210
|
+
* If the source type is not ContainerInventory, then this value will not be present.
|
|
2211
|
+
*/
|
|
2212
|
+
readonly containerId: ContainerId | null;
|
|
2213
|
+
/**
|
|
2214
|
+
* The bit flags of the inventory source.
|
|
2215
|
+
* If the source type is not GlobalInteraction, then this value will not be present.
|
|
2216
|
+
*/
|
|
2217
|
+
readonly bitFlags: number | null;
|
|
2218
|
+
/**
|
|
2219
|
+
* Creates an instance of InventorySource.
|
|
2220
|
+
*
|
|
2221
|
+
* @param type The source type of the inventory action.
|
|
2222
|
+
* @param containerId The container id of the inventory source.
|
|
2223
|
+
* @param bitFlags The bit flags of the inventory source.
|
|
2224
|
+
*/
|
|
2225
|
+
constructor(type: InventorySourceType, containerId?: ContainerId | null, bitFlags?: number | null);
|
|
2226
|
+
static read(stream: BinaryStream): InventorySource;
|
|
2227
|
+
static write(stream: BinaryStream, value: InventorySource): void;
|
|
2228
|
+
}
|
|
2229
|
+
|
|
2230
|
+
/**
|
|
2231
|
+
* Represents an inventory action with in a inventory transaction.
|
|
2232
|
+
*/
|
|
2233
|
+
declare class InventoryAction extends DataType {
|
|
2234
|
+
/**
|
|
2235
|
+
* The source type of the inventory action.
|
|
2236
|
+
*/
|
|
2237
|
+
readonly source: InventorySource;
|
|
2238
|
+
/**
|
|
2239
|
+
* The slot of the inventory action.
|
|
2240
|
+
*/
|
|
2241
|
+
readonly slot: number;
|
|
2242
|
+
/**
|
|
2243
|
+
* The old item of the inventory action.
|
|
2244
|
+
*/
|
|
2245
|
+
readonly oldItem: NetworkItemStackDescriptor;
|
|
2246
|
+
/**
|
|
2247
|
+
* The new item of the inventory action.
|
|
2248
|
+
*/
|
|
2249
|
+
readonly newItem: NetworkItemStackDescriptor;
|
|
2250
|
+
/**
|
|
2251
|
+
* Creates a new instance of InventoryAction.
|
|
2252
|
+
*
|
|
2253
|
+
* @param source - The source type of the inventory action.
|
|
2254
|
+
* @param slot - The slot of the inventory action.
|
|
2255
|
+
* @param oldItem - The old item of the inventory action.
|
|
2256
|
+
* @param newItem - The new item of the inventory action.
|
|
2257
|
+
*/
|
|
2258
|
+
constructor(source: InventorySource, slot: number, oldItem: NetworkItemStackDescriptor, newItem: NetworkItemStackDescriptor);
|
|
2259
|
+
static read(stream: BinaryStream): InventoryAction;
|
|
2260
|
+
static write(stream: BinaryStream, value: InventoryAction): void;
|
|
2261
|
+
}
|
|
2262
|
+
|
|
2263
|
+
/**
|
|
2264
|
+
* Represents an item use inventory transaction.
|
|
2265
|
+
*/
|
|
2266
|
+
declare class ItemUseInventoryTransaction extends DataType {
|
|
2267
|
+
/**
|
|
2268
|
+
* The type of the item use inventory transaction.
|
|
2269
|
+
*/
|
|
2270
|
+
readonly type: ItemUseInventoryTransactionType;
|
|
2271
|
+
/**
|
|
2272
|
+
* The block position of the item use inventory transaction.
|
|
2273
|
+
*/
|
|
2274
|
+
readonly blockPosition: BlockCoordinates;
|
|
2275
|
+
/**
|
|
2276
|
+
* The block face of the item use inventory transaction.
|
|
2277
|
+
*/
|
|
2278
|
+
readonly face: BlockFace;
|
|
2279
|
+
/**
|
|
2280
|
+
* The slot of the item use inventory transaction.
|
|
2281
|
+
*/
|
|
2282
|
+
readonly slot: number;
|
|
2283
|
+
/**
|
|
2284
|
+
* The item of the item use inventory transaction.
|
|
2285
|
+
*/
|
|
2286
|
+
readonly item: NetworkItemStackDescriptor;
|
|
2287
|
+
/**
|
|
2288
|
+
* The from position of the item use inventory transaction.
|
|
2289
|
+
*/
|
|
2290
|
+
readonly fromPosition: Vector3f;
|
|
2291
|
+
/**
|
|
2292
|
+
* The click position of the item use inventory transaction.
|
|
2293
|
+
*/
|
|
2294
|
+
readonly clickPosition: Vector3f;
|
|
2295
|
+
/**
|
|
2296
|
+
* The network block id of the item use inventory transaction.
|
|
2297
|
+
*/
|
|
2298
|
+
readonly networkBlockId: number;
|
|
2299
|
+
/**
|
|
2300
|
+
* Creates an instance of ItemUseInventoryTransaction.
|
|
2301
|
+
*
|
|
2302
|
+
* @param type The type of the item use inventory transaction.
|
|
2303
|
+
* @param blockPosition The block position of the item use inventory transaction.
|
|
2304
|
+
* @param face The block face of the item use inventory transaction.
|
|
2305
|
+
* @param slot The slot of the item use inventory transaction.
|
|
2306
|
+
* @param item The item of the item use inventory transaction.
|
|
2307
|
+
* @param fromPosition The from position of the item use inventory transaction.
|
|
2308
|
+
* @param clickPosition The click position of the item use inventory transaction.
|
|
2309
|
+
* @param networkBlockId The network block id of the item use inventory transaction.
|
|
2310
|
+
*/
|
|
2311
|
+
constructor(type: ItemUseInventoryTransactionType, blockPosition: BlockCoordinates, face: BlockFace, slot: number, item: NetworkItemStackDescriptor, fromPosition: Vector3f, clickPosition: Vector3f, networkBlockId: number);
|
|
2312
|
+
static read(stream: BinaryStream): ItemUseInventoryTransaction;
|
|
2313
|
+
static write(stream: BinaryStream, value: ItemUseInventoryTransaction): void;
|
|
2314
|
+
}
|
|
2315
|
+
|
|
2316
|
+
/**
|
|
2317
|
+
* Represents an item use on entity inventory transaction.
|
|
2318
|
+
*/
|
|
2319
|
+
declare class ItemUseOnEntityInventoryTransaction extends DataType {
|
|
2320
|
+
/**
|
|
2321
|
+
* The runtime ID of the actor.
|
|
2322
|
+
*/
|
|
2323
|
+
readonly actorRuntimeId: bigint;
|
|
2324
|
+
/**
|
|
2325
|
+
* The type of the item use on entity inventory transaction.
|
|
2326
|
+
*/
|
|
2327
|
+
readonly type: ItemUseOnEntityInventoryTransactionType;
|
|
2328
|
+
/**
|
|
2329
|
+
* The slot of the item use on entity inventory transaction.
|
|
2330
|
+
*/
|
|
2331
|
+
readonly slot: number;
|
|
2332
|
+
/**
|
|
2333
|
+
* The item of the item use on entity inventory transaction.
|
|
2334
|
+
*/
|
|
2335
|
+
readonly item: NetworkItemStackDescriptor;
|
|
2336
|
+
/**
|
|
2337
|
+
* The from position of the item use on entity inventory transaction.
|
|
2338
|
+
*/
|
|
2339
|
+
readonly fromPosition: Vector3f;
|
|
2340
|
+
/**
|
|
2341
|
+
* The click position of the item use on entity inventory transaction.
|
|
2342
|
+
*/
|
|
2343
|
+
readonly clickPosition: Vector3f;
|
|
2344
|
+
/**
|
|
2345
|
+
* Creates an instance of ItemUseOnEntityInventoryTransaction.
|
|
2346
|
+
* @param actorRuntimeId - The runtime ID of the actor.
|
|
2347
|
+
* @param type - The type of the item use on entity inventory transaction.
|
|
2348
|
+
* @param slot - The slot of the item use on entity inventory transaction.
|
|
2349
|
+
* @param item - The item of the item use on entity inventory transaction.
|
|
2350
|
+
* @param fromPosition - The from position of the item use on entity inventory transaction.
|
|
2351
|
+
* @param clickPosition - The click position of the item use on entity inventory transaction.
|
|
2352
|
+
*/
|
|
2353
|
+
constructor(actorRuntimeId: bigint, type: ItemUseOnEntityInventoryTransactionType, slot: number, item: NetworkItemStackDescriptor, fromPosition: Vector3f, clickPosition: Vector3f);
|
|
2354
|
+
static read(stream: BinaryStream): ItemUseOnEntityInventoryTransaction;
|
|
2355
|
+
static write(stream: BinaryStream, value: ItemUseOnEntityInventoryTransaction): void;
|
|
2356
|
+
}
|
|
2357
|
+
|
|
2358
|
+
declare class ItemReleaseInventoryTransaction extends DataType {
|
|
2359
|
+
/**
|
|
2360
|
+
* The type of the item release inventory transaction.
|
|
2361
|
+
*/
|
|
2362
|
+
readonly type: ItemReleaseInventoryTransactionType;
|
|
2363
|
+
/**
|
|
2364
|
+
* The slot of the item release inventory transaction.
|
|
2365
|
+
*/
|
|
2366
|
+
readonly slot: number;
|
|
2367
|
+
/**
|
|
2368
|
+
* The item of the item release inventory transaction.
|
|
2369
|
+
*/
|
|
2370
|
+
readonly item: NetworkItemStackDescriptor;
|
|
2371
|
+
/**
|
|
2372
|
+
* The head position of the item release inventory transaction.
|
|
2373
|
+
*/
|
|
2374
|
+
readonly headPosition: Vector3f;
|
|
2375
|
+
/**
|
|
2376
|
+
* Creates an instance of ItemReleaseInventoryTransaction.
|
|
2377
|
+
* @param type - The type of the item release inventory transaction.
|
|
2378
|
+
* @param slot - The slot of the item release inventory transaction.
|
|
2379
|
+
* @param item - The item of the item release inventory transaction.
|
|
2380
|
+
* @param headPosition - The head position of the item release inventory transaction.
|
|
2381
|
+
*/
|
|
2382
|
+
constructor(type: ItemReleaseInventoryTransactionType, slot: number, item: NetworkItemStackDescriptor, headPosition: Vector3f);
|
|
2383
|
+
static read(stream: BinaryStream): ItemReleaseInventoryTransaction;
|
|
2384
|
+
static write(stream: BinaryStream, value: ItemReleaseInventoryTransaction): void;
|
|
2385
|
+
}
|
|
2386
|
+
|
|
2387
|
+
/**
|
|
2388
|
+
* Represents an inventory transaction.
|
|
2389
|
+
*/
|
|
2390
|
+
declare class InventoryTransaction extends DataType {
|
|
2391
|
+
/**
|
|
2392
|
+
* The type of the inventory transaction.
|
|
2393
|
+
*/
|
|
2394
|
+
readonly type: ComplexInventoryTransaction;
|
|
2395
|
+
/**
|
|
2396
|
+
* The actions of the inventory transaction.
|
|
2397
|
+
*/
|
|
2398
|
+
readonly actions: Array<InventoryAction>;
|
|
2399
|
+
/**
|
|
2400
|
+
* The item use of the inventory transaction.
|
|
2401
|
+
*/
|
|
2402
|
+
readonly itemUse: ItemUseInventoryTransaction | null;
|
|
2403
|
+
/**
|
|
2404
|
+
* The item use on entity of the inventory transaction.
|
|
2405
|
+
*/
|
|
2406
|
+
readonly itemUseOnEntity: ItemUseOnEntityInventoryTransaction | null;
|
|
2407
|
+
/**
|
|
2408
|
+
* The item release of the inventory transaction.
|
|
2409
|
+
*/
|
|
2410
|
+
readonly itemRelease: ItemReleaseInventoryTransaction | null;
|
|
2411
|
+
/**
|
|
2412
|
+
* Creates a new instance of InventoryTransaction.
|
|
2413
|
+
* @param actions - The actions of the inventory transaction.
|
|
2414
|
+
* @param type - The type of the inventory transaction.
|
|
2415
|
+
* @param itemUse - The item use of the inventory transaction.
|
|
2416
|
+
* @param itemUseOnEntity - The item use on entity of the inventory transaction.
|
|
2417
|
+
* @param itemRelease - The item release of the inventory transaction.
|
|
2418
|
+
*/
|
|
2419
|
+
constructor(type: ComplexInventoryTransaction, actions: Array<InventoryAction>, itemUse?: ItemUseInventoryTransaction | null, itemUseOnEntity?: ItemUseOnEntityInventoryTransaction | null, itemRelease?: ItemReleaseInventoryTransaction | null);
|
|
2420
|
+
static read(stream: BinaryStream): InventoryTransaction;
|
|
2421
|
+
static write(stream: BinaryStream, value: InventoryTransaction): void;
|
|
2422
|
+
}
|
|
2423
|
+
|
|
2230
2424
|
/**
|
|
2231
2425
|
* Represents a Minecraft Bedrock Edition data packet
|
|
2232
2426
|
*/
|
|
@@ -2378,10 +2572,8 @@ declare class InventorySlotPacket extends DataPacket {
|
|
|
2378
2572
|
}
|
|
2379
2573
|
|
|
2380
2574
|
declare class InventoryTransactionPacket extends DataPacket {
|
|
2381
|
-
legacy:
|
|
2382
|
-
|
|
2383
|
-
actions: Array<TransactionActions>;
|
|
2384
|
-
data: TransactionData;
|
|
2575
|
+
legacy: LegacyTransaction;
|
|
2576
|
+
transaction: InventoryTransaction;
|
|
2385
2577
|
}
|
|
2386
2578
|
|
|
2387
2579
|
declare class ItemComponentPacket extends DataPacket {
|
|
@@ -2752,7 +2944,7 @@ declare class UpdateAttributesPacket extends DataPacket {
|
|
|
2752
2944
|
|
|
2753
2945
|
declare class UpdateBlockPacket extends DataPacket {
|
|
2754
2946
|
position: BlockCoordinates;
|
|
2755
|
-
|
|
2947
|
+
networkBlockId: number;
|
|
2756
2948
|
flags: UpdateBlockFlagsType;
|
|
2757
2949
|
layer: UpdateBlockLayerType;
|
|
2758
2950
|
}
|
|
@@ -2842,4 +3034,4 @@ declare const PROTOCOL_VERSION = 662;
|
|
|
2842
3034
|
declare const MINECRAFT_VERSION = "1.20.71";
|
|
2843
3035
|
declare const MINECRAFT_TICK_SPEED = 50;
|
|
2844
3036
|
|
|
2845
|
-
export { AbilityLayerFlag, AbilityLayerType, AbilityLayers, AbilitySet, ActionIds, AddEntityPacket, AddItemActorPacket, AddPlayerPacket, AnimateAction, AnimateId, AnimatePacket, Attribute, AvailableCommandsPacket, BehaviorPackInfo, BiomeDefinitionListPacket, BlockCoordinates, BlockPickRequestPacket, BlockProperties, ChangeDimensionPacket, ChunkCoords, ChunkRadiusUpdatePacket, CommandOriginData, CommandOutputData, CommandOutputMessage, CommandOutputPacket, CommandParameterType, CommandPermissionLevel, CommandRequestPacket, Commands, ComponentItem, CompressionMethod, ContainerClosePacket, ContainerId, ContainerName, ContainerOpenPacket, ContainerType, CreativeContentPacket, CreativeItems, DataPacket, DeviceOS, Difficulty, DimensionType, DisconnectPacket, DisconnectReason, DynamicEnums, EntityAttributes, EntityProperties, EnumConstraints, Enums, Experiments, FormType, Framer, GameRuleType, GameRules, Gamemode, InteractActions, InteractPacket, InteractPosition, InventoryContentPacket, InventorySlotPacket, InventoryTransactionPacket, ItemComponentPacket, ItemData, ItemInstanceUserData,
|
|
3037
|
+
export { AbilityLayerFlag, AbilityLayerType, AbilityLayers, AbilitySet, ActionIds, AddEntityPacket, AddItemActorPacket, AddPlayerPacket, AnimateAction, AnimateId, AnimatePacket, Attribute, AvailableCommandsPacket, BehaviorPackInfo, BiomeDefinitionListPacket, BlockCoordinates, BlockFace, BlockPickRequestPacket, BlockProperties, ChangeDimensionPacket, ChunkCoords, ChunkRadiusUpdatePacket, CommandOriginData, CommandOutputData, CommandOutputMessage, CommandOutputPacket, CommandParameterType, CommandPermissionLevel, CommandRequestPacket, Commands, ComplexInventoryTransaction, ComponentItem, CompressionMethod, ContainerClosePacket, ContainerId, ContainerName, ContainerOpenPacket, ContainerType, CreativeContentPacket, CreativeItems, DataPacket, DeviceOS, Difficulty, DimensionType, DisconnectPacket, DisconnectReason, DynamicEnums, EntityAttributes, EntityProperties, EnumConstraints, Enums, Experiments, FormType, Framer, GameRuleType, GameRules, Gamemode, InteractActions, InteractPacket, InteractPosition, InventoryAction, InventoryContentPacket, InventorySlotPacket, InventorySource, InventorySourceType, InventoryTransaction, InventoryTransactionPacket, ItemComponentPacket, ItemData, ItemInstanceUserData, ItemReleaseInventoryTransaction, ItemReleaseInventoryTransactionType, type ItemStackAction, ItemStackActionType, type ItemStackContainer, ItemStackRequestPacket, ItemStackRequests, ItemStackResponsePacket, ItemStackResponses, ItemStackStatus, ItemStacks, ItemUseInventoryTransaction, ItemUseInventoryTransactionType, ItemUseOnEntityInventoryTransaction, ItemUseOnEntityInventoryTransactionType, LegacyTransaction, LevelChunkPacket, LevelEvent, LevelEventPacket, LevelSoundEvent, LevelSoundEventPacket, Links, LoginPacket, LoginTokens, MINECRAFT_TICK_SPEED, MINECRAFT_VERSION, MetadataDictionary, MetadataFlags, MetadataKey, MetadataType, MobEquipmentPacket, ModalFormCanceled, ModalFormCanceledReason, ModalFormData, ModalFormRequestPacket, ModalFormResponsePacket, MoveActorAbsolutePacket, MoveMode, MovePlayerPacket, NetworkChunkPublisherUpdatePacket, NetworkItemInstanceDescriptor, NetworkItemStackDescriptor, NetworkSettingsPacket, PROTOCOL_VERSION, PackLinks, PackType, Packet, PacketViolationWarningPacket, Packets, PermissionLevel, PlayStatus, PlayStatusPacket, PlayerActionPacket, PlayerAttributes, PlayerAuthInputPacket, PlayerHotbarPacket, PlayerListPacket, RecordAction, Records, RemoveEntityPacket, RequestChunkRadiusPacket, RequestNetworkSettingsPacket, ResourceIdVersions, ResourcePackChunkDataPacket, ResourcePackChunkRequestPacket, ResourcePackClientResponsePacket, ResourcePackDataInfoPacket, ResourcePackIds, ResourcePackResponse, ResourcePackStackPacket, ResourcePacksInfoPacket, RespawnPacket, RespawnState, Rotation, ScriptMessagePacket, SetActorMotionPacket, SetCommandsEnabledPacket, SetEntityDataPacket, SetLocalPlayerAsInitializedPacket, SetPlayerGameTypePacket, SetTitlePacket, StackRequestSlotInfo, StartGamePacket, Subcommands, TeleportCause, TextPacket, TextPacketType, TextParameters, TextSource, TexturePackInfo, TitleTypes, ToastRequestPacket, TransactionSourceType, UpdateAbilitiesPacket, UpdateAdventureSettingsPacket, UpdateAttributesPacket, UpdateBlockFlagsType, UpdateBlockLayerType, UpdateBlockPacket, VariableStringArray as VarStringArray, VarintArray, Vector2f, Vector3f, ViolationSeverity, ViolationType, getPacketId };
|