Snowiiii / Pumpkin

Empowering everyone to host fast and efficient Minecraft servers.
https://snowiiii.github.io/Pumpkin/
MIT License
2.49k stars 72 forks source link

Worldborder Doesn't Check for Negatives #210

Open DirefulBelt6803 opened 3 days ago

DirefulBelt6803 commented 3 days ago

I've searched existing issues and couldn't find a duplicate.

Operating System

Arch Linux

Server Software Version/Commit

79d2f91

What happened?

Worldborder command can be executed using negative numbers, which can cause the player to be kicked from the game and unable to rejoin. Vanilla minecraft doesn't allow a worldborder less one.

To Reproduce

/worldborder set -1000

Expected behavior

log syntax error "Worldborder cannot be smaller than 1 block wide"

suprohub commented 3 days ago

Just add check > 0

Snowiiii commented 2 days ago

I was thinking of adding 3 argument consumers.

  1. only negative numbers.
  2. positive and negative numbers.
  3. only positive numbers

This should make Command creation for us and future Plugin maintainers easier

Alvsch commented 2 days ago

I think a BoundedNumberConsumer<f64>, or something in that direction would be more flexible.