Commit Graph

15 Commits

Author SHA1 Message Date
tastybento 94b982f644 Fix tests
Fixes https://github.com/BentoBoxWorld/BentoBox/issues/1918
2022-01-22 12:16:27 -08:00
tastybento 5573e9f329 Fix TNTListener tests 2022-01-22 11:57:11 -08:00
tastybento f25e54f3c8 Return void for event listeners
https://github.com/BentoBoxWorld/BentoBox/issues/1918
2022-01-21 18:47:31 -08:00
Huynh Tien 7088a2736f
Flags for Block Explode (#1899)
* add Block Explosion support for TNT_DAMAGE flag

* prevent block explosion from damaging entities

* seperated flags for block explode

* invert and cancel

* pattern instanceof
2022-01-01 17:42:46 -08:00
tastybento acfc001cd6
Java upgrade (#1814)
* Version 1.17.3

* Use Map.of and List.of instead of Immutable collections

* Replace explicit type argument.

* Replace lamba with method reference

* Replace condition with Objects.requireNonNullElseGet

* Use String.repeat

* Use new switch expressions

* Use instanceof patten variables which are more compact

* Fuse toUnmodifiableList into stream and return it.

* Remove unnecessary toString() calls.

* Remove unnecessary public

* Extracted common part from if

* Simplify conditional expressions

* Remove unused IOExceptions

* Cast to long

* Use Map.putAll

* Use primitives

* Clarify what is null or not

* Addedd @Serial annotation introduced with Java 14.

* Use Optional.isEmpty instead of !isPresent

* Use flatMap then ifPresent

* Just use Arrays.stream

* Swap map and filter for null with Objects::nonNull

* Use expression lambda
2021-07-31 08:48:26 -07:00
tastybento 2c7f54fe10 Use orElseGet instead of orElse
orElse is a trap because it evaluates even if the Optional is empty.
orElseGet is the correct way.
2021-01-08 20:05:23 -08:00
tastybento 2cb1e7c306 Fixes https://github.com/BentoBoxWorld/BentoBox/issues/1579 2020-11-26 18:05:26 -08:00
tastybento 1d4fd435a9 Added World TNT Damage Flag
Enables admins to decide whether TNT should damage outside of island
boundaries

https://github.com/BentoBoxWorld/BentoBox/issues/1562
2020-11-08 10:43:15 -08:00
Florian CUNY c179b3e20a Fixed entities being damaged by TNTs or Creepers even if it was disabled
Fixes https://github.com/BentoBoxWorld/BentoBox/issues/1075
2019-12-27 14:47:15 +01:00
tastybento b1f66eb31b Fixes bugs and code smells from Sonarcloud. 2019-07-04 16:54:05 -07:00
Florian CUNY e0b942063b Fixes TNT protection: split TNT flag into TNT_DAMAGE (SETTING) and TNT_PRIMING (PROTECTION)
#566 and #649
2019-05-12 15:26:51 +02:00
Florian CUNY 5073d9cf5c Fixed code smells 2019-03-24 15:47:25 +01:00
Florian CUNY 1a3049b3b9 Fixed code smells 2019-02-14 10:41:39 +01:00
tastybento f89419f3d8 Made declaring the player mandatory when calling FlagListener#checkIsland(...) (#543)
* WIP - See FlagListener.java for changes

Makes declaring the player mandatory for checkIsland method so it cannot
be forgotten and will be fresh every check.

See BlockInteractionListener for how it will look.

* Update src/main/java/world/bentobox/bentobox/api/flags/FlagListener.java

Co-Authored-By: tastybento <tastybento@users.noreply.github.com>

* Update src/main/java/world/bentobox/bentobox/api/flags/FlagListener.java

Co-Authored-By: tastybento <tastybento@users.noreply.github.com>

* Adjusted all the flags to new API
2019-02-13 07:55:36 +01:00
Florian CUNY ea12d8c167 Moved all the flags listeners to subpackages 2019-02-03 10:22:44 +01:00