@serenityjs/protocol 0.0.1-beta.0 → 0.1.0-beta-20240422171939
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 +442 -189
- package/dist/index.js +2018 -1725
- 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,
|
|
@@ -789,7 +773,7 @@ declare enum RespawnState {
|
|
|
789
773
|
ClientReadyToSpawn = 2
|
|
790
774
|
}
|
|
791
775
|
|
|
792
|
-
declare enum
|
|
776
|
+
declare enum ModalFormType {
|
|
793
777
|
Action = "form",
|
|
794
778
|
Message = "modal",
|
|
795
779
|
Modal = "custom_form"
|
|
@@ -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;
|
|
@@ -2049,9 +1990,23 @@ declare class VariableStringArray extends DataType {
|
|
|
2049
1990
|
static write(stream: BinaryStream, value: Array<string>): void;
|
|
2050
1991
|
}
|
|
2051
1992
|
|
|
1993
|
+
/**
|
|
1994
|
+
* Represents a enum for the available command packet.
|
|
1995
|
+
*/
|
|
2052
1996
|
declare class Enums extends DataType {
|
|
2053
|
-
|
|
2054
|
-
|
|
1997
|
+
/**
|
|
1998
|
+
* The name of the enum.
|
|
1999
|
+
*/
|
|
2000
|
+
readonly name: string;
|
|
2001
|
+
/**
|
|
2002
|
+
* The indexed values of the enum.
|
|
2003
|
+
*/
|
|
2004
|
+
readonly values: Array<number>;
|
|
2005
|
+
/**
|
|
2006
|
+
* Creates a new enum.
|
|
2007
|
+
* @param name The name of the enum.
|
|
2008
|
+
* @param values The indexed values of the enum.
|
|
2009
|
+
*/
|
|
2055
2010
|
constructor(name: string, values: Array<number>);
|
|
2056
2011
|
static read(stream: BinaryStream, endian: Endianness, enumValues: Array<string>): Array<Enums>;
|
|
2057
2012
|
static write(stream: BinaryStream, value: Array<Enums>, endian: Endianness, enumValues: Array<string>): void;
|
|
@@ -2074,20 +2029,43 @@ interface CommandsOverload {
|
|
|
2074
2029
|
parameters: Array<OverloadParameter>;
|
|
2075
2030
|
}
|
|
2076
2031
|
interface OverloadParameter {
|
|
2077
|
-
|
|
2032
|
+
symbol: number;
|
|
2078
2033
|
name: string;
|
|
2079
2034
|
optional: boolean;
|
|
2080
2035
|
options: number;
|
|
2081
|
-
valueType: number;
|
|
2082
2036
|
}
|
|
2037
|
+
/**
|
|
2038
|
+
* Represents the commands of a available command packet.
|
|
2039
|
+
*/
|
|
2083
2040
|
declare class Commands extends DataType {
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2041
|
+
/**
|
|
2042
|
+
* The name of the command.
|
|
2043
|
+
*/
|
|
2044
|
+
readonly name: string;
|
|
2045
|
+
/**
|
|
2046
|
+
* The description of the command.
|
|
2047
|
+
*/
|
|
2048
|
+
readonly description: string;
|
|
2049
|
+
/**
|
|
2050
|
+
* The flags of the command. Setting this value to 1 will make the command blue.
|
|
2051
|
+
*/
|
|
2052
|
+
readonly flags: number;
|
|
2053
|
+
/**
|
|
2054
|
+
* The permission level of the command.
|
|
2055
|
+
*/
|
|
2056
|
+
readonly permissionLevel: number;
|
|
2057
|
+
/**
|
|
2058
|
+
* The alias of the command.
|
|
2059
|
+
*/
|
|
2060
|
+
readonly alias: number;
|
|
2061
|
+
/**
|
|
2062
|
+
* The subcommands of the command.
|
|
2063
|
+
*/
|
|
2064
|
+
readonly subcommands: Array<number>;
|
|
2065
|
+
/**
|
|
2066
|
+
* The overloads of the command.
|
|
2067
|
+
*/
|
|
2068
|
+
readonly overloads: Array<CommandsOverload>;
|
|
2091
2069
|
constructor(name: string, description: string, flags: number, permissionLevel: number, alias: number, subcommands: Array<number>, overloads: Array<CommandsOverload>);
|
|
2092
2070
|
static read(stream: BinaryStream): Array<Commands>;
|
|
2093
2071
|
static write(stream: BinaryStream, value: Array<Commands>): void;
|
|
@@ -2227,6 +2205,283 @@ declare class ComponentItem extends DataType {
|
|
|
2227
2205
|
static write(stream: BinaryStream, value: Array<ComponentItem>): void;
|
|
2228
2206
|
}
|
|
2229
2207
|
|
|
2208
|
+
interface Transactions {
|
|
2209
|
+
containerId: ContainerId;
|
|
2210
|
+
changedSlots: Array<number>;
|
|
2211
|
+
}
|
|
2212
|
+
/**
|
|
2213
|
+
* The LegacyTransaction class is used to represent a legacy transaction.
|
|
2214
|
+
* This system is still used for some inventory related transactions.
|
|
2215
|
+
*/
|
|
2216
|
+
declare class LegacyTransaction extends DataType {
|
|
2217
|
+
/**
|
|
2218
|
+
* The request identifier of the legacy transaction.
|
|
2219
|
+
*/
|
|
2220
|
+
readonly request: number;
|
|
2221
|
+
/**
|
|
2222
|
+
* The actions of the legacy transaction.
|
|
2223
|
+
* If the request identifier is 0, then this value will not be present.
|
|
2224
|
+
*/
|
|
2225
|
+
readonly actions: Array<Transactions> | null;
|
|
2226
|
+
/**
|
|
2227
|
+
* Creates an instance of LegacyTransaction.
|
|
2228
|
+
*
|
|
2229
|
+
* @param request The request identifier of the legacy transaction.
|
|
2230
|
+
* @param actions The actions of the legacy transaction.
|
|
2231
|
+
*/
|
|
2232
|
+
constructor(request: number, actions?: Array<Transactions> | null);
|
|
2233
|
+
static read(stream: BinaryStream): LegacyTransaction;
|
|
2234
|
+
static write(stream: BinaryStream, value: LegacyTransaction): void;
|
|
2235
|
+
}
|
|
2236
|
+
|
|
2237
|
+
/**
|
|
2238
|
+
* Represents the source of an inventory action.
|
|
2239
|
+
*/
|
|
2240
|
+
declare class InventorySource extends DataType {
|
|
2241
|
+
/**
|
|
2242
|
+
* The source type of the inventory action.
|
|
2243
|
+
*/
|
|
2244
|
+
readonly type: InventorySourceType;
|
|
2245
|
+
/**
|
|
2246
|
+
* The container id of the inventory source.
|
|
2247
|
+
* If the source type is not ContainerInventory, then this value will not be present.
|
|
2248
|
+
*/
|
|
2249
|
+
readonly containerId: ContainerId | null;
|
|
2250
|
+
/**
|
|
2251
|
+
* The bit flags of the inventory source.
|
|
2252
|
+
* If the source type is not GlobalInteraction, then this value will not be present.
|
|
2253
|
+
*/
|
|
2254
|
+
readonly bitFlags: number | null;
|
|
2255
|
+
/**
|
|
2256
|
+
* Creates an instance of InventorySource.
|
|
2257
|
+
*
|
|
2258
|
+
* @param type The source type of the inventory action.
|
|
2259
|
+
* @param containerId The container id of the inventory source.
|
|
2260
|
+
* @param bitFlags The bit flags of the inventory source.
|
|
2261
|
+
*/
|
|
2262
|
+
constructor(type: InventorySourceType, containerId?: ContainerId | null, bitFlags?: number | null);
|
|
2263
|
+
static read(stream: BinaryStream): InventorySource;
|
|
2264
|
+
static write(stream: BinaryStream, value: InventorySource): void;
|
|
2265
|
+
}
|
|
2266
|
+
|
|
2267
|
+
/**
|
|
2268
|
+
* Represents an inventory action with in a inventory transaction.
|
|
2269
|
+
*/
|
|
2270
|
+
declare class InventoryAction extends DataType {
|
|
2271
|
+
/**
|
|
2272
|
+
* The source type of the inventory action.
|
|
2273
|
+
*/
|
|
2274
|
+
readonly source: InventorySource;
|
|
2275
|
+
/**
|
|
2276
|
+
* The slot of the inventory action.
|
|
2277
|
+
*/
|
|
2278
|
+
readonly slot: number;
|
|
2279
|
+
/**
|
|
2280
|
+
* The old item of the inventory action.
|
|
2281
|
+
*/
|
|
2282
|
+
readonly oldItem: NetworkItemStackDescriptor;
|
|
2283
|
+
/**
|
|
2284
|
+
* The new item of the inventory action.
|
|
2285
|
+
*/
|
|
2286
|
+
readonly newItem: NetworkItemStackDescriptor;
|
|
2287
|
+
/**
|
|
2288
|
+
* Creates a new instance of InventoryAction.
|
|
2289
|
+
*
|
|
2290
|
+
* @param source - The source type of the inventory action.
|
|
2291
|
+
* @param slot - The slot of the inventory action.
|
|
2292
|
+
* @param oldItem - The old item of the inventory action.
|
|
2293
|
+
* @param newItem - The new item of the inventory action.
|
|
2294
|
+
*/
|
|
2295
|
+
constructor(source: InventorySource, slot: number, oldItem: NetworkItemStackDescriptor, newItem: NetworkItemStackDescriptor);
|
|
2296
|
+
static read(stream: BinaryStream): InventoryAction;
|
|
2297
|
+
static write(stream: BinaryStream, value: InventoryAction): void;
|
|
2298
|
+
}
|
|
2299
|
+
|
|
2300
|
+
/**
|
|
2301
|
+
* Represents an item use inventory transaction.
|
|
2302
|
+
*/
|
|
2303
|
+
declare class ItemUseInventoryTransaction extends DataType {
|
|
2304
|
+
/**
|
|
2305
|
+
* The type of the item use inventory transaction.
|
|
2306
|
+
*/
|
|
2307
|
+
readonly type: ItemUseInventoryTransactionType;
|
|
2308
|
+
/**
|
|
2309
|
+
* The block position of the item use inventory transaction.
|
|
2310
|
+
*/
|
|
2311
|
+
readonly blockPosition: BlockCoordinates;
|
|
2312
|
+
/**
|
|
2313
|
+
* The block face of the item use inventory transaction.
|
|
2314
|
+
*/
|
|
2315
|
+
readonly face: BlockFace;
|
|
2316
|
+
/**
|
|
2317
|
+
* The slot of the item use inventory transaction.
|
|
2318
|
+
*/
|
|
2319
|
+
readonly slot: number;
|
|
2320
|
+
/**
|
|
2321
|
+
* The item of the item use inventory transaction.
|
|
2322
|
+
*/
|
|
2323
|
+
readonly item: NetworkItemStackDescriptor;
|
|
2324
|
+
/**
|
|
2325
|
+
* The from position of the item use inventory transaction.
|
|
2326
|
+
*/
|
|
2327
|
+
readonly fromPosition: Vector3f;
|
|
2328
|
+
/**
|
|
2329
|
+
* The click position of the item use inventory transaction.
|
|
2330
|
+
*/
|
|
2331
|
+
readonly clickPosition: Vector3f;
|
|
2332
|
+
/**
|
|
2333
|
+
* The network block id of the item use inventory transaction.
|
|
2334
|
+
*/
|
|
2335
|
+
readonly networkBlockId: number;
|
|
2336
|
+
/**
|
|
2337
|
+
* Creates an instance of ItemUseInventoryTransaction.
|
|
2338
|
+
*
|
|
2339
|
+
* @param type The type of the item use inventory transaction.
|
|
2340
|
+
* @param blockPosition The block position of the item use inventory transaction.
|
|
2341
|
+
* @param face The block face of the item use inventory transaction.
|
|
2342
|
+
* @param slot The slot of the item use inventory transaction.
|
|
2343
|
+
* @param item The item of the item use inventory transaction.
|
|
2344
|
+
* @param fromPosition The from position of the item use inventory transaction.
|
|
2345
|
+
* @param clickPosition The click position of the item use inventory transaction.
|
|
2346
|
+
* @param networkBlockId The network block id of the item use inventory transaction.
|
|
2347
|
+
*/
|
|
2348
|
+
constructor(type: ItemUseInventoryTransactionType, blockPosition: BlockCoordinates, face: BlockFace, slot: number, item: NetworkItemStackDescriptor, fromPosition: Vector3f, clickPosition: Vector3f, networkBlockId: number);
|
|
2349
|
+
static read(stream: BinaryStream): ItemUseInventoryTransaction;
|
|
2350
|
+
static write(stream: BinaryStream, value: ItemUseInventoryTransaction): void;
|
|
2351
|
+
}
|
|
2352
|
+
|
|
2353
|
+
/**
|
|
2354
|
+
* Represents an item use on entity inventory transaction.
|
|
2355
|
+
*/
|
|
2356
|
+
declare class ItemUseOnEntityInventoryTransaction extends DataType {
|
|
2357
|
+
/**
|
|
2358
|
+
* The runtime ID of the actor.
|
|
2359
|
+
*/
|
|
2360
|
+
readonly actorRuntimeId: bigint;
|
|
2361
|
+
/**
|
|
2362
|
+
* The type of the item use on entity inventory transaction.
|
|
2363
|
+
*/
|
|
2364
|
+
readonly type: ItemUseOnEntityInventoryTransactionType;
|
|
2365
|
+
/**
|
|
2366
|
+
* The slot of the item use on entity inventory transaction.
|
|
2367
|
+
*/
|
|
2368
|
+
readonly slot: number;
|
|
2369
|
+
/**
|
|
2370
|
+
* The item of the item use on entity inventory transaction.
|
|
2371
|
+
*/
|
|
2372
|
+
readonly item: NetworkItemStackDescriptor;
|
|
2373
|
+
/**
|
|
2374
|
+
* The from position of the item use on entity inventory transaction.
|
|
2375
|
+
*/
|
|
2376
|
+
readonly fromPosition: Vector3f;
|
|
2377
|
+
/**
|
|
2378
|
+
* The click position of the item use on entity inventory transaction.
|
|
2379
|
+
*/
|
|
2380
|
+
readonly clickPosition: Vector3f;
|
|
2381
|
+
/**
|
|
2382
|
+
* Creates an instance of ItemUseOnEntityInventoryTransaction.
|
|
2383
|
+
* @param actorRuntimeId - The runtime ID of the actor.
|
|
2384
|
+
* @param type - The type of the item use on entity inventory transaction.
|
|
2385
|
+
* @param slot - The slot of the item use on entity inventory transaction.
|
|
2386
|
+
* @param item - The item of the item use on entity inventory transaction.
|
|
2387
|
+
* @param fromPosition - The from position of the item use on entity inventory transaction.
|
|
2388
|
+
* @param clickPosition - The click position of the item use on entity inventory transaction.
|
|
2389
|
+
*/
|
|
2390
|
+
constructor(actorRuntimeId: bigint, type: ItemUseOnEntityInventoryTransactionType, slot: number, item: NetworkItemStackDescriptor, fromPosition: Vector3f, clickPosition: Vector3f);
|
|
2391
|
+
static read(stream: BinaryStream): ItemUseOnEntityInventoryTransaction;
|
|
2392
|
+
static write(stream: BinaryStream, value: ItemUseOnEntityInventoryTransaction): void;
|
|
2393
|
+
}
|
|
2394
|
+
|
|
2395
|
+
declare class ItemReleaseInventoryTransaction extends DataType {
|
|
2396
|
+
/**
|
|
2397
|
+
* The type of the item release inventory transaction.
|
|
2398
|
+
*/
|
|
2399
|
+
readonly type: ItemReleaseInventoryTransactionType;
|
|
2400
|
+
/**
|
|
2401
|
+
* The slot of the item release inventory transaction.
|
|
2402
|
+
*/
|
|
2403
|
+
readonly slot: number;
|
|
2404
|
+
/**
|
|
2405
|
+
* The item of the item release inventory transaction.
|
|
2406
|
+
*/
|
|
2407
|
+
readonly item: NetworkItemStackDescriptor;
|
|
2408
|
+
/**
|
|
2409
|
+
* The head position of the item release inventory transaction.
|
|
2410
|
+
*/
|
|
2411
|
+
readonly headPosition: Vector3f;
|
|
2412
|
+
/**
|
|
2413
|
+
* Creates an instance of ItemReleaseInventoryTransaction.
|
|
2414
|
+
* @param type - The type of the item release inventory transaction.
|
|
2415
|
+
* @param slot - The slot of the item release inventory transaction.
|
|
2416
|
+
* @param item - The item of the item release inventory transaction.
|
|
2417
|
+
* @param headPosition - The head position of the item release inventory transaction.
|
|
2418
|
+
*/
|
|
2419
|
+
constructor(type: ItemReleaseInventoryTransactionType, slot: number, item: NetworkItemStackDescriptor, headPosition: Vector3f);
|
|
2420
|
+
static read(stream: BinaryStream): ItemReleaseInventoryTransaction;
|
|
2421
|
+
static write(stream: BinaryStream, value: ItemReleaseInventoryTransaction): void;
|
|
2422
|
+
}
|
|
2423
|
+
|
|
2424
|
+
/**
|
|
2425
|
+
* Represents an inventory transaction.
|
|
2426
|
+
*/
|
|
2427
|
+
declare class InventoryTransaction extends DataType {
|
|
2428
|
+
/**
|
|
2429
|
+
* The type of the inventory transaction.
|
|
2430
|
+
*/
|
|
2431
|
+
readonly type: ComplexInventoryTransaction;
|
|
2432
|
+
/**
|
|
2433
|
+
* The actions of the inventory transaction.
|
|
2434
|
+
*/
|
|
2435
|
+
readonly actions: Array<InventoryAction>;
|
|
2436
|
+
/**
|
|
2437
|
+
* The item use of the inventory transaction.
|
|
2438
|
+
*/
|
|
2439
|
+
readonly itemUse: ItemUseInventoryTransaction | null;
|
|
2440
|
+
/**
|
|
2441
|
+
* The item use on entity of the inventory transaction.
|
|
2442
|
+
*/
|
|
2443
|
+
readonly itemUseOnEntity: ItemUseOnEntityInventoryTransaction | null;
|
|
2444
|
+
/**
|
|
2445
|
+
* The item release of the inventory transaction.
|
|
2446
|
+
*/
|
|
2447
|
+
readonly itemRelease: ItemReleaseInventoryTransaction | null;
|
|
2448
|
+
/**
|
|
2449
|
+
* Creates a new instance of InventoryTransaction.
|
|
2450
|
+
* @param actions - The actions of the inventory transaction.
|
|
2451
|
+
* @param type - The type of the inventory transaction.
|
|
2452
|
+
* @param itemUse - The item use of the inventory transaction.
|
|
2453
|
+
* @param itemUseOnEntity - The item use on entity of the inventory transaction.
|
|
2454
|
+
* @param itemRelease - The item release of the inventory transaction.
|
|
2455
|
+
*/
|
|
2456
|
+
constructor(type: ComplexInventoryTransaction, actions: Array<InventoryAction>, itemUse?: ItemUseInventoryTransaction | null, itemUseOnEntity?: ItemUseOnEntityInventoryTransaction | null, itemRelease?: ItemReleaseInventoryTransaction | null);
|
|
2457
|
+
static read(stream: BinaryStream): InventoryTransaction;
|
|
2458
|
+
static write(stream: BinaryStream, value: InventoryTransaction): void;
|
|
2459
|
+
}
|
|
2460
|
+
|
|
2461
|
+
/**
|
|
2462
|
+
* Represents the enum values of a available command packet.
|
|
2463
|
+
*/
|
|
2464
|
+
declare class EnumValues extends DataType {
|
|
2465
|
+
static read(stream: BinaryStream): Array<string>;
|
|
2466
|
+
static write(stream: BinaryStream, enumValues: Array<string>): void;
|
|
2467
|
+
}
|
|
2468
|
+
|
|
2469
|
+
/**
|
|
2470
|
+
* Represents the chained subcommand values of a available command packet.
|
|
2471
|
+
*/
|
|
2472
|
+
declare class ChainedSubcommandValues extends DataType {
|
|
2473
|
+
static read(stream: BinaryStream): Array<string>;
|
|
2474
|
+
static write(stream: BinaryStream, chainedSubcommandValues: Array<string>): void;
|
|
2475
|
+
}
|
|
2476
|
+
|
|
2477
|
+
/**
|
|
2478
|
+
* Represents the post fixes of a available command packet.
|
|
2479
|
+
*/
|
|
2480
|
+
declare class PostFixes extends DataType {
|
|
2481
|
+
static read(stream: BinaryStream): Array<string>;
|
|
2482
|
+
static write(stream: BinaryStream, postFixes: Array<string>): void;
|
|
2483
|
+
}
|
|
2484
|
+
|
|
2230
2485
|
/**
|
|
2231
2486
|
* Represents a Minecraft Bedrock Edition data packet
|
|
2232
2487
|
*/
|
|
@@ -2294,8 +2549,8 @@ declare class AnimatePacket extends DataPacket {
|
|
|
2294
2549
|
|
|
2295
2550
|
declare class AvailableCommandsPacket extends DataPacket {
|
|
2296
2551
|
enumValues: Array<string>;
|
|
2297
|
-
|
|
2298
|
-
|
|
2552
|
+
chainedSubcommandValues: Array<string>;
|
|
2553
|
+
postFixes: Array<string>;
|
|
2299
2554
|
enums: Array<Enums>;
|
|
2300
2555
|
subcommands: Array<Subcommands>;
|
|
2301
2556
|
commands: Array<Commands>;
|
|
@@ -2332,8 +2587,8 @@ declare class CommandOutputPacket extends DataPacket {
|
|
|
2332
2587
|
}
|
|
2333
2588
|
|
|
2334
2589
|
declare class CommandRequestPacket extends DataPacket {
|
|
2335
|
-
|
|
2336
|
-
|
|
2590
|
+
command: string;
|
|
2591
|
+
origin: CommandOriginData;
|
|
2337
2592
|
isInternal: boolean;
|
|
2338
2593
|
version: number;
|
|
2339
2594
|
}
|
|
@@ -2378,10 +2633,8 @@ declare class InventorySlotPacket extends DataPacket {
|
|
|
2378
2633
|
}
|
|
2379
2634
|
|
|
2380
2635
|
declare class InventoryTransactionPacket extends DataPacket {
|
|
2381
|
-
legacy:
|
|
2382
|
-
|
|
2383
|
-
actions: Array<TransactionActions>;
|
|
2384
|
-
data: TransactionData;
|
|
2636
|
+
legacy: LegacyTransaction;
|
|
2637
|
+
transaction: InventoryTransaction;
|
|
2385
2638
|
}
|
|
2386
2639
|
|
|
2387
2640
|
declare class ItemComponentPacket extends DataPacket {
|
|
@@ -2752,7 +3005,7 @@ declare class UpdateAttributesPacket extends DataPacket {
|
|
|
2752
3005
|
|
|
2753
3006
|
declare class UpdateBlockPacket extends DataPacket {
|
|
2754
3007
|
position: BlockCoordinates;
|
|
2755
|
-
|
|
3008
|
+
networkBlockId: number;
|
|
2756
3009
|
flags: UpdateBlockFlagsType;
|
|
2757
3010
|
layer: UpdateBlockLayerType;
|
|
2758
3011
|
}
|
|
@@ -2842,4 +3095,4 @@ declare const PROTOCOL_VERSION = 662;
|
|
|
2842
3095
|
declare const MINECRAFT_VERSION = "1.20.71";
|
|
2843
3096
|
declare const MINECRAFT_TICK_SPEED = 50;
|
|
2844
3097
|
|
|
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,
|
|
3098
|
+
export { AbilityLayerFlag, AbilityLayerType, AbilityLayers, AbilitySet, ActionIds, AddEntityPacket, AddItemActorPacket, AddPlayerPacket, AnimateAction, AnimateId, AnimatePacket, Attribute, AvailableCommandsPacket, BehaviorPackInfo, BiomeDefinitionListPacket, BlockCoordinates, BlockFace, BlockPickRequestPacket, BlockProperties, ChainedSubcommandValues, 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, EnumValues, Enums, Experiments, 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, ModalFormType, MoveActorAbsolutePacket, MoveMode, MovePlayerPacket, NetworkChunkPublisherUpdatePacket, NetworkItemInstanceDescriptor, NetworkItemStackDescriptor, NetworkSettingsPacket, PROTOCOL_VERSION, PackLinks, PackType, Packet, PacketViolationWarningPacket, Packets, PermissionLevel, PlayStatus, PlayStatusPacket, PlayerActionPacket, PlayerAttributes, PlayerAuthInputPacket, PlayerHotbarPacket, PlayerListPacket, PostFixes, 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 };
|