Release 1.11.2 (#101)

* Version 1.11.2

* Renamed plugin Pladdon

* Update es.yml (#98)

* Build to BentoBox 1.18 API

* Fix plugin.yml

* Fix null player on removeWarp (#100)

Co-authored-by: KrazyxWolf <68208993+KrazyxWolf@users.noreply.github.com>
Co-authored-by: Huynh Tien <huynhqtienvtag@gmail.com>
This commit is contained in:
tastybento 2021-12-31 15:29:29 -08:00 committed by GitHub
parent 70457afe65
commit d93f0608ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 54 additions and 26 deletions

32
pom.xml
View File

@ -59,14 +59,14 @@
<powermock.version>2.0.9</powermock.version> <powermock.version>2.0.9</powermock.version>
<!-- More visible way how to change dependency versions --> <!-- More visible way how to change dependency versions -->
<spigot.version>1.17-R0.1-SNAPSHOT</spigot.version> <spigot.version>1.17-R0.1-SNAPSHOT</spigot.version>
<bentobox.version>1.17.0</bentobox.version> <bentobox.version>1.18.0-SNAPSHOT</bentobox.version>
<level.version>2.7.0-SNAPSHOT</level.version> <level.version>2.7.0-SNAPSHOT</level.version>
<!-- Revision variable removes warning about dynamic version --> <!-- Revision variable removes warning about dynamic version -->
<revision>${build.version}-SNAPSHOT</revision> <revision>${build.version}-SNAPSHOT</revision>
<!-- Do not change unless you want different name for local builds. --> <!-- Do not change unless you want different name for local builds. -->
<build.number>-LOCAL</build.number> <build.number>-LOCAL</build.number>
<!-- This allows to change between versions. --> <!-- This allows to change between versions. -->
<build.version>1.11.1</build.version> <build.version>1.11.2</build.version>
<!-- Sonar Cloud --> <!-- Sonar Cloud -->
<sonar.projectKey>BentoBoxWorld_Warps</sonar.projectKey> <sonar.projectKey>BentoBoxWorld_Warps</sonar.projectKey>
<sonar.organization>bentobox-world</sonar.organization> <sonar.organization>bentobox-world</sonar.organization>
@ -229,7 +229,33 @@
<version>3.0.0-M5</version> <version>3.0.0-M5</version>
<configuration> <configuration>
<argLine> <argLine>
--illegal-access=permit --add-opens java.base/java.lang=ALL-UNNAMED
--add-opens java.base/java.math=ALL-UNNAMED
--add-opens java.base/java.io=ALL-UNNAMED
--add-opens java.base/java.util=ALL-UNNAMED
--add-opens
java.base/java.util.stream=ALL-UNNAMED
--add-opens java.base/java.text=ALL-UNNAMED
--add-opens
java.base/java.util.regex=ALL-UNNAMED
--add-opens
java.base/java.nio.channels.spi=ALL-UNNAMED
--add-opens java.base/sun.nio.ch=ALL-UNNAMED
--add-opens java.base/java.net=ALL-UNNAMED
--add-opens
java.base/java.util.concurrent=ALL-UNNAMED
--add-opens java.base/sun.nio.fs=ALL-UNNAMED
--add-opens java.base/sun.nio.cs=ALL-UNNAMED
--add-opens java.base/java.nio.file=ALL-UNNAMED
--add-opens
java.base/java.nio.charset=ALL-UNNAMED
--add-opens
java.base/java.lang.reflect=ALL-UNNAMED
--add-opens
java.logging/java.util.logging=ALL-UNNAMED
--add-opens java.base/java.lang.ref=ALL-UNNAMED
--add-opens java.base/java.util.jar=ALL-UNNAMED
--add-opens java.base/java.util.zip=ALL-UNNAMED
</argLine> </argLine>
</configuration> </configuration>
</plugin> </plugin>

View File

@ -25,6 +25,7 @@ import org.bukkit.World;
import org.bukkit.block.Block; import org.bukkit.block.Block;
import org.bukkit.block.BlockFace; import org.bukkit.block.BlockFace;
import org.bukkit.block.Sign; import org.bukkit.block.Sign;
import org.bukkit.entity.Player;
import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause; import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
import org.bukkit.permissions.PermissionAttachmentInfo; import org.bukkit.permissions.PermissionAttachmentInfo;
import org.eclipse.jdt.annotation.NonNull; import org.eclipse.jdt.annotation.NonNull;
@ -241,11 +242,9 @@ public class WarpSignsManager {
Entry<UUID, Location> en = it.next(); Entry<UUID, Location> en = it.next();
if (en.getValue().equals(loc)) { if (en.getValue().equals(loc)) {
// Inform player // Inform player
User user = User.getInstance(addon.getServer().getPlayer(en.getKey())); Optional.ofNullable(addon.getServer().getPlayer(en.getKey()))
if (user != null) { .map(User::getInstance)
// Inform the player .ifPresent(user -> user.sendMessage("warps.sign-removed"));
user.sendMessage("warps.sign-removed");
}
// Remove sign from warp panel cache // Remove sign from warp panel cache
addon.getWarpPanelManager().removeWarp(loc.getWorld(), en.getKey()); addon.getWarpPanelManager().removeWarp(loc.getWorld(), en.getKey());
it.remove(); it.remove();

View File

@ -6,25 +6,26 @@
warp: warp:
help: help:
description: "Teletransportarte hacia el warp del jugador" description: "Teletransportarte hacia el warp del jugador"
parameters: <name> parameters: <player name>
warps: warps:
deactivate: "&cViejo cartel a sido desactivado!" deactivate: "&c¡El cartel viejo ha sido desactivado!"
error: error:
does-not-exist: "&cOh snap! Ese warp ya no existe!" does-not-exist: "&c¡Oh vaya! !Ese warp ya no existe!"
no-permission: "&CNo tienes permiso para hacer eso!" no-permission: "&No tienes permiso para hacer eso!"
no-remove: "&CNo puedes quitar ese cartel!" no-remove: "&No puedes quitar ese cartel!"
no-warps-yet: "&CNo hay warps disponibles aun" no-warps-yet: "&cNo hay warps disponibles aún"
not-enough-level: "&CTu nivel de isla no es lo suficientemente alto!" not-enough-level: "&Tu nivel de isla no es lo suficientemente alto!"
not-on-island: "&CDebes estar en tu isla para hacer eso!" not-on-island: "&Debes estar en tu isla para hacer eso!"
not-safe: "&cEse warp no es seguro!" not-safe: "&c¡Ese warp no es seguro!"
your-level-is: "&cTu nivel de isla es solo [level] y debe ser mayor que [required]" your-level-is: "&cTu nivel de isla es solo [level] y debe ser mayor que [required]"
help: help:
description: "Abre el panel de warps" description: "Abre el panel de warps"
next: "&6Siguiente página" next: "&6Siguiente página"
player-warped: "&2[name] teletransportarte a tu warp!" player-warped: "&2[name] ¡se ha teletransportado a tu warp!"
previous: "&6Pagina anterior" previous: "&6Página anterior"
sign-removed: "&CCartel removido!" random: "&4Teletransporte aleatorio"
success: "&AExito!" sign-removed: "&c¡Cartel removido!"
title: "Carteles de Warps" success: "&a¡Éxito!"
warpTip: "&6Coloca un cartel con este texto [text] arriba" title: "Carteles de Warps"
warpToPlayersSign: "&6Teletransportandote al warp de [player]" warpTip: "&6Coloca un cartel que contenga el texto [text] arriba"
warpToPlayersSign: "&6Teletransportandote al warp de [player]"

View File

@ -1,7 +1,7 @@
name: Warps name: Pladdon
main: world.bentobox.warps.WarpsPladdon main: world.bentobox.warps.WarpsPladdon
version: ${version} version: ${version}
api-version: 1.17 api-version: 1.16
description: A Warp Pladdon for BentoBox description: A Warp Pladdon for BentoBox
author: tastybento author: tastybento
depend: depend:

View File

@ -157,6 +157,7 @@ public class WarpSignsManagerTest {
PowerMockito.mockStatic(Util.class); PowerMockito.mockStatic(Util.class);
when(Util.getWorld(any())).thenAnswer((Answer<World>) invocation -> invocation.getArgument(0, World.class)); when(Util.getWorld(any())).thenAnswer((Answer<World>) invocation -> invocation.getArgument(0, World.class));
when(Util.sameWorld(any(), any())).thenReturn(true); when(Util.sameWorld(any(), any())).thenReturn(true);
when(Util.translateColorCodes(any())).thenAnswer((Answer<String>) invocation -> invocation.getArgument(0, String.class));
// Location // Location
when(location.getWorld()).thenReturn(world); when(location.getWorld()).thenReturn(world);

View File

@ -166,6 +166,7 @@ public class WarpSignsListenerTest {
PowerMockito.mockStatic(Util.class); PowerMockito.mockStatic(Util.class);
when(Util.getWorld(any())).thenReturn(world); when(Util.getWorld(any())).thenReturn(world);
when(Util.stripSpaceAfterColorCodes(anyString())).thenAnswer(invocation -> invocation.getArgument(0, String.class)); when(Util.stripSpaceAfterColorCodes(anyString())).thenAnswer(invocation -> invocation.getArgument(0, String.class));
when(Util.translateColorCodes(any())).thenAnswer((Answer<String>) invocation -> invocation.getArgument(0, String.class));
// Locales // Locales
when(lm.get(any(User.class), anyString())).thenAnswer(answer); when(lm.get(any(User.class), anyString())).thenAnswer(answer);