Skip to content

Commit

Permalink
Bug fix release 4.1.1 (#101)
Browse files Browse the repository at this point in the history
* Version 3.2.1

* Remove potential NPE issues

* Version 3.3.0

* Added config option to show or not show particles.

* Add Chinese Translation (#63)

* Rename zh_CN.json to zh_CN.yml (#64)

I'm so stupid. I made a mistake in the format. sorry!

* Add a clearer message when WBAPI is not found (#65)

It is not mandatory to use WorldBorderAPI, so it should be clear for the user
that they have a choice besides integrating with it.

* Remove `hooked` field (refactor) (#66)

Removing the `hooked` field because it was used locally
and could be removed as a simple refactoring to shorter and simpler code.

* Unify wording of WBAPI-excluded configs (#67)

* Unify wording of WBAPI-excluded configs

* Add `show-particles` to README

* Clarify message for show-particles setting

* Implement per-player border type (#69)

* Rename PlayerBorder.barrier to show

* Move player event handlers to PlayerListener

* Remove PlayerBorder

* Implement PerPlayerBorderProxy

Currently defaulting to Customer (non-wbapi) border

* Add BorderTypeCommand

* Create BorderType

* Add messages to BorderTypeCommand

* Prepare PerPlayerBorderProxy for handling edge cases

The user may not have a border type set, then we return with the default.
The user's border type may be unavailable now for two reasons:
1. Border type has been disabled after a server/plugin restart
2. Border type is obsolete and does not exist anymore (forward compatibility).

* Fix message reference at BorderTypeCommand

* Use null for missing wbapiBorder

It is fine since it is never used

* Avoid wbapi "border show" spam on player move

* At command, replace args.isEmpty() with size() != 1

To also show help if more parameters are passed than necessary

* Small refactor

* Fix set-type permission in addon.yml

* Update README

Co-authored-by: tastybento <[email protected]>

* Cleanup documentation (#70)

* Remove commented code

* Purify config.yml

As I see, this is just another place to duplicate our settings, documentation and changes to these.
This file is generated if missing.

* Cleanup Settings.java

This is another place where we duplicated documentation.

* Purify README.md

* Fix failing test: testIsUseWbapi

* Revert "Cleanup Settings.java"

This reverts commit f8e931c.

* Format Settings.java and add documentation link

* Regenerate config.yml

* Avoid raw Optional#get

* Enum elements should be all caps by convention.

* Use isEmpty.

Using Collection.size() to test for emptiness works, but using
Collection.isEmpty() makes the code more readable and can be more
performant. The time complexity of any isEmpty() method implementation
should be O(1) whereas some implementations of size() can be O(n).

In this case, it's not a big deal, just a code smell.

* Map to new variable

* 1.18 support for Particle.BARRIER_BLOCK

* Translate id.yml via GitLocalize (#71)

Co-authored-by: Alunite? <[email protected]>

* Translate hu.yml via GitLocalize (#72)

Co-authored-by: VerusBungee <[email protected]>

* Taiwan translation (#73)

* Translate zh-TW.yml via GitLocalize

* Update zh-TW.yml

Co-authored-by: davgo0103 <[email protected]>
Co-authored-by: tastybento <[email protected]>

* korean translation (#74)

* Translate ko.yml via GitLocalize

* Update ko.yml

Co-authored-by: chickiyeah <[email protected]>
Co-authored-by: tastybento <[email protected]>

* Polish translation (#75)

* Translate pl.yml via GitLocalize

* Update pl.yml

Co-authored-by: PICIGIT <[email protected]>
Co-authored-by: tastybento <[email protected]>

* Switch to use new Bukkit / Paper WorldBorder API (#78)

* Switch to use new Bukkit / Paper WorldBorder API

* Fix nether vanilla border (#80)

Vanilla World Border automatically converts coordinates by dimension multiplayer.
So in the nether it is required to counter it with extra processing.

Co-authored-by: BuildTools <[email protected]>

* disabled enderpearls and chorus fruits + fix (#82)

* run show task ; teleport visitors back in boundaries, bypass spectators (#83)

* Implement a toggle between border types just by writing border type command.

Requested by #87

* Implement new placeholder: %border_type%

Requested by #86

* Disable border changing from other worlds.

This could lead to a showing up a virtual border where it should not be.

* Translate ru.yml via GitLocalize (#93)

Co-authored-by: Marmur2020 <[email protected]>

* Translate pl.yml via GitLocalize (#92)

Co-authored-by: wiktorm12 <[email protected]>

* Update French translation (#91)

* Translate fr.yml via GitLocalize

* Translate fr.yml via GitLocalize

Co-authored-by: HipppB <[email protected]>
Co-authored-by: organizatsiya <[email protected]>

* Translate de.yml via GitLocalize (#89)

Co-authored-by: 0x4096 <[email protected]>

* Update Spanish translation (#90)

* Translate es.yml via GitLocalize

* Translate es.yml via GitLocalize

Co-authored-by: roy0510 <[email protected]>
Co-authored-by: plebexer <[email protected]>

* Update to Java 17

* Permission cannot have a - in it.

Changed the permission for the type command to "border.type" instead of
"border.set-type" because with the hyphen in it, Bukkit always grants
the permission for some reason.

Addresses #96

* Added test class for type command

Had to make some classes non-final so they can be mocked.

* Added IslandBorderCommand test class

* Add ${argLine} to get jacoco coverage

* Fix code smells.

* Fix code smell

* Fix Jacoco errors

* Use default settings in config if player does not have permissions. (#98)

Redoes the config.yml as well.
Adds test classes.

Relates to #97

* Config types (#99)

* Use default settings in config if player does not have permissions.

Redoes the config.yml as well.
Adds test classes.

Relates to #97

* Remove unused import.

* Adds offset config to enable border to be bigger than protection range

#75
Adds test class for ShowBarrier.

* Added ShowVirtualWorldBorder test class

#75

* Finishes up #97

* Fixes #100. Island border was set for home island not visitor's island.

---------

Co-authored-by: hutu <[email protected]>
Co-authored-by: Károly Ozsvárt <[email protected]>
Co-authored-by: gitlocalize-app[bot] <55277160+gitlocalize-app[bot]@users.noreply.github.com>
Co-authored-by: Alunite? <[email protected]>
Co-authored-by: VerusBungee <[email protected]>
Co-authored-by: davgo0103 <[email protected]>
Co-authored-by: chickiyeah <[email protected]>
Co-authored-by: PICIGIT <[email protected]>
Co-authored-by: evlad <[email protected]>
Co-authored-by: BuildTools <[email protected]>
Co-authored-by: BONNe <[email protected]>
Co-authored-by: Marmur2020 <[email protected]>
Co-authored-by: wiktorm12 <[email protected]>
Co-authored-by: HipppB <[email protected]>
Co-authored-by: organizatsiya <[email protected]>
Co-authored-by: 0x4096 <[email protected]>
Co-authored-by: roy0510 <[email protected]>
Co-authored-by: plebexer <[email protected]>
  • Loading branch information
19 people authored Apr 10, 2023
1 parent 6cf5c6f commit c7b1afe
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
<!-- Revision variable removes warning about dynamic version -->
<revision>${build.version}-SNAPSHOT</revision>
<!-- This allows to change between versions and snapshots. -->
<build.version>4.1.0</build.version>
<build.version>4.1.1</build.version>
<build.number>-LOCAL</build.number>
<!-- Sonar Cloud -->
<sonar.projectKey>BentoBoxWorld_Border</sonar.projectKey>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ public boolean canExecute(User user, String label, List<String> args) {
user.sendMessage("general.errors.wrong-world");
return false;
}

island = getIslands().getIsland(getWorld(), user);
island = addon.getIslands().getIslandAt(user.getLocation()).orElse(null);
return island != null;
}

Expand All @@ -53,7 +52,9 @@ public boolean execute(User user, String label, List<String> args) {
} else {
user.sendMessage("border.toggle.border-on");
user.putMetaData(BorderShower.BORDER_STATE_META_DATA, new MetaDataValue(true));
addon.getBorderShower().showBorder(user.getPlayer(), island);
if (island != null) {
addon.getBorderShower().showBorder(user.getPlayer(), island);
}
}
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,9 @@ public void setUp() throws Exception {

// Islands
when(plugin.getIslands()).thenReturn(im);
when(addon.getIslands()).thenReturn(im);
when(im.getIsland(world, user)).thenReturn(island);
when(im.getIslandAt(any())).thenReturn(Optional.of(island));

// IWM
when(plugin.getIWM()).thenReturn(iwm);
Expand Down Expand Up @@ -174,7 +176,7 @@ public void testCanExecuteWrongWorld() {
*/
@Test
public void testCanExecuteNoIsland() {
when(im.getIsland(world, user)).thenReturn(null);
when(im.getIslandAt(any())).thenReturn(Optional.empty());
assertFalse(ic.canExecute(user, "", Collections.emptyList()));
verify(user, never()).sendMessage("general.errors.wrong-world");
}
Expand Down

0 comments on commit c7b1afe

Please sign in to comment.