mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-04 23:47:59 +01:00
Merge branch 'master' into new-block-api
This commit is contained in:
commit
6c4cb66737
@ -254,10 +254,8 @@ public class ArgumentType {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see ArgumentLoop
|
* @see ArgumentLong
|
||||||
* @deprecated brigadier does not support long
|
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
|
||||||
public static ArgumentLong Long(@NotNull String id) {
|
public static ArgumentLong Long(@NotNull String id) {
|
||||||
return new ArgumentLong(id);
|
return new ArgumentLong(id);
|
||||||
}
|
}
|
||||||
|
@ -35,16 +35,14 @@ public class ArgumentLong extends ArgumentNumber<Long> {
|
|||||||
@Override
|
@Override
|
||||||
public void processNodes(@NotNull NodeMaker nodeMaker, boolean executable) {
|
public void processNodes(@NotNull NodeMaker nodeMaker, boolean executable) {
|
||||||
DeclareCommandsPacket.Node argumentNode = simpleArgumentNode(this, executable, false, false);
|
DeclareCommandsPacket.Node argumentNode = simpleArgumentNode(this, executable, false, false);
|
||||||
|
|
||||||
// TODO maybe use ArgumentLiteral/ArgumentWord and impose long restriction server side?
|
argumentNode.parser = "brigadier:long";
|
||||||
|
|
||||||
argumentNode.parser = "brigadier:integer";
|
|
||||||
argumentNode.properties = BinaryWriter.makeArray(packetWriter -> {
|
argumentNode.properties = BinaryWriter.makeArray(packetWriter -> {
|
||||||
packetWriter.writeByte(getNumberProperties());
|
packetWriter.writeByte(getNumberProperties());
|
||||||
if (this.hasMin())
|
if (this.hasMin())
|
||||||
packetWriter.writeInt(this.getMin().intValue());
|
packetWriter.writeLong(this.getMin());
|
||||||
if (this.hasMax())
|
if (this.hasMax())
|
||||||
packetWriter.writeInt(this.getMax().intValue());
|
packetWriter.writeLong(this.getMax());
|
||||||
});
|
});
|
||||||
|
|
||||||
nodeMaker.addNodes(new DeclareCommandsPacket.Node[]{argumentNode});
|
nodeMaker.addNodes(new DeclareCommandsPacket.Node[]{argumentNode});
|
||||||
|
Loading…
Reference in New Issue
Block a user