1
0
mirror of https://github.com/BentoBoxWorld/Warps.git synced 2024-11-29 14:15:23 +01:00

The Flattening + renamed to "WelcomeWarps" + codemc CI

This commit is contained in:
Florian CUNY 2018-10-31 14:32:21 +01:00
parent 9284cf7287
commit 695e8b4c6b
16 changed files with 70 additions and 48 deletions

20
pom.xml
View File

@ -3,7 +3,7 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>bskyblock.addon</groupId> <groupId>world.bentobox</groupId>
<artifactId>WelcomeWarpSigns</artifactId> <artifactId>WelcomeWarpSigns</artifactId>
<version>0.1.0-SNAPSHOT</version> <version>0.1.0-SNAPSHOT</version>
@ -18,11 +18,27 @@
<url>https://github.com/BentoBoxWorld/addon-welcomewarpsigns</url> <url>https://github.com/BentoBoxWorld/addon-welcomewarpsigns</url>
</scm> </scm>
<ciManagement>
<system>jenkins</system>
<url>http://ci.codemc.org/job/BentoBoxWorld/job/addon-welcomewarpsigns</url>
</ciManagement>
<issueManagement> <issueManagement>
<system>GitHub</system> <system>GitHub</system>
<url>https://github.com/BentoBoxWorld/addon-welcomewarpsigns/issues</url> <url>https://github.com/BentoBoxWorld/addon-welcomewarpsigns/issues</url>
</issueManagement> </issueManagement>
<distributionManagement>
<snapshotRepository>
<id>codemc-snapshots</id>
<url>https://repo.codemc.org/repository/maven-snapshots</url>
</snapshotRepository>
<repository>
<id>codemc-releases</id>
<url>https://repo.codemc.org/repository/maven-releases</url>
</repository>
</distributionManagement>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
@ -73,7 +89,7 @@
<version>0.12.0-SNAPSHOT</version> <version>0.12.0-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>bskyblock.addon</groupId> <groupId>world.bentobox</groupId>
<artifactId>Level</artifactId> <artifactId>Level</artifactId>
<version>0.1.0-SNAPSHOT</version> <version>0.1.0-SNAPSHOT</version>
<scope>provided</scope> <scope>provided</scope>

View File

@ -1,4 +1,4 @@
package bentobox.addon.warps; package world.bentobox.warps;
import java.util.HashSet; import java.util.HashSet;
import java.util.Set; import java.util.Set;
@ -6,10 +6,10 @@ import java.util.UUID;
import org.bukkit.World; import org.bukkit.World;
import bentobox.addon.level.Level; import world.bentobox.level.Level;
import bentobox.addon.warps.commands.WarpCommand; import world.bentobox.warps.commands.WarpCommand;
import bentobox.addon.warps.commands.WarpsCommand; import world.bentobox.warps.commands.WarpsCommand;
import bentobox.addon.warps.config.PluginConfig; import world.bentobox.warps.config.PluginConfig;
import world.bentobox.bentobox.BentoBox; import world.bentobox.bentobox.BentoBox;
import world.bentobox.bentobox.api.addons.Addon; import world.bentobox.bentobox.api.addons.Addon;
import world.bentobox.bentobox.api.commands.CompositeCommand; import world.bentobox.bentobox.api.commands.CompositeCommand;
@ -24,15 +24,15 @@ public class Warp extends Addon {
private static final String BSKYBLOCK = "BSkyBlock"; private static final String BSKYBLOCK = "BSkyBlock";
private static final String ACIDISLAND = "AcidIsland"; private static final String ACIDISLAND = "AcidIsland";
private static final String LEVEL_PLUGIN_NAME = "BentoBox-Level"; private static final String LEVEL_ADDON_NAME = "Level";
// The plugin instance. // The plugin instance.
private BentoBox plugin; private BentoBox plugin;
// Warp panel object // Warp panel objects
private WarpPanelManager warpPanelManager; private WarpPanelManager warpPanelManager;
// Warps signs object // Warps signs objects
private WarpSignsManager warpSignsManager; private WarpSignsManager warpSignsManager;
private Set<World> registeredWorlds; private Set<World> registeredWorlds;
@ -126,7 +126,7 @@ public class Warp extends Addon {
* @return island level or null if there is no level plugin * @return island level or null if there is no level plugin
*/ */
public Long getLevel(World world, UUID uniqueId) { public Long getLevel(World world, UUID uniqueId) {
return plugin.getAddonsManager().getAddonByName(LEVEL_PLUGIN_NAME).map(l -> ((Level) l).getIslandLevel(world, uniqueId)).orElse(null); return plugin.getAddonsManager().getAddonByName(LEVEL_ADDON_NAME).map(l -> ((Level) l).getIslandLevel(world, uniqueId)).orElse(null);
} }
} }

View File

@ -1,4 +1,4 @@
package bentobox.addon.warps; package world.bentobox.warps;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;

View File

@ -1,4 +1,4 @@
package bentobox.addon.warps; package world.bentobox.warps;
import java.util.Map; import java.util.Map;
import java.util.UUID; import java.util.UUID;
@ -15,7 +15,7 @@ import org.bukkit.event.Listener;
import org.bukkit.event.block.BlockBreakEvent; import org.bukkit.event.block.BlockBreakEvent;
import org.bukkit.event.block.SignChangeEvent; import org.bukkit.event.block.SignChangeEvent;
import bentobox.addon.warps.event.WarpRemoveEvent; import world.bentobox.warps.event.WarpRemoveEvent;
import world.bentobox.bentobox.BentoBox; import world.bentobox.bentobox.BentoBox;
import world.bentobox.bentobox.api.user.User; import world.bentobox.bentobox.api.user.User;

View File

@ -1,4 +1,4 @@
package bentobox.addon.warps; package world.bentobox.warps;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
@ -24,9 +24,9 @@ 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 bentobox.addon.warps.database.object.WarpsData; import world.bentobox.warps.objects.WarpsData;
import bentobox.addon.warps.event.WarpInitiateEvent; import world.bentobox.warps.event.WarpInitiateEvent;
import bentobox.addon.warps.event.WarpListEvent; import world.bentobox.warps.event.WarpListEvent;
import world.bentobox.bentobox.BentoBox; import world.bentobox.bentobox.BentoBox;
import world.bentobox.bentobox.api.user.User; import world.bentobox.bentobox.api.user.User;
import world.bentobox.bentobox.database.Database; import world.bentobox.bentobox.database.Database;

View File

@ -1,4 +1,4 @@
package bentobox.addon.warps.commands; package world.bentobox.warps.commands;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -6,7 +6,7 @@ import java.util.Optional;
import java.util.Set; import java.util.Set;
import java.util.UUID; import java.util.UUID;
import bentobox.addon.warps.Warp; import world.bentobox.warps.Warp;
import world.bentobox.bentobox.api.commands.CompositeCommand; import world.bentobox.bentobox.api.commands.CompositeCommand;
import world.bentobox.bentobox.api.user.User; import world.bentobox.bentobox.api.user.User;

View File

@ -1,11 +1,11 @@
/** /**
* *
*/ */
package bentobox.addon.warps.commands; package world.bentobox.warps.commands;
import java.util.List; import java.util.List;
import bentobox.addon.warps.Warp; import world.bentobox.warps.Warp;
import world.bentobox.bentobox.api.commands.CompositeCommand; import world.bentobox.bentobox.api.commands.CompositeCommand;
import world.bentobox.bentobox.api.user.User; import world.bentobox.bentobox.api.user.User;

View File

@ -1,6 +1,6 @@
package bentobox.addon.warps.config; package world.bentobox.warps.config;
import bentobox.addon.warps.Warp; import world.bentobox.warps.Warp;
public class PluginConfig { public class PluginConfig {

View File

@ -1,4 +1,4 @@
package bentobox.addon.warps.event; package world.bentobox.warps.event;
import java.util.UUID; import java.util.UUID;
@ -6,7 +6,7 @@ import org.bukkit.Location;
import org.bukkit.event.Event; import org.bukkit.event.Event;
import org.bukkit.event.HandlerList; import org.bukkit.event.HandlerList;
import bentobox.addon.warps.Warp; import world.bentobox.warps.Warp;
/** /**
* This event is fired when a Warp is created * This event is fired when a Warp is created
@ -22,7 +22,7 @@ public class WarpCreateEvent extends Event{
private UUID creator; private UUID creator;
/** /**
* @param plugin - BSkyBlock plugin object * @param plugin - BSkyBlock plugin objects
* @param warpLoc * @param warpLoc
* @param creator * @param creator
*/ */

View File

@ -1,4 +1,4 @@
package bentobox.addon.warps.event; package world.bentobox.warps.event;
import java.util.UUID; import java.util.UUID;
@ -7,7 +7,7 @@ import org.bukkit.event.Cancellable;
import org.bukkit.event.Event; import org.bukkit.event.Event;
import org.bukkit.event.HandlerList; import org.bukkit.event.HandlerList;
import bentobox.addon.warps.Warp; import world.bentobox.warps.Warp;
/** /**
* This event is fired when a player tries to do a warp * This event is fired when a player tries to do a warp
@ -23,7 +23,7 @@ public class WarpInitiateEvent extends Event implements Cancellable {
private final UUID player; private final UUID player;
/** /**
* @param plugin - BSkyBlock plugin object * @param plugin - BSkyBlock plugin objects
* @param warpLoc - where the player is warping to * @param warpLoc - where the player is warping to
* @param player - the UUID of the player * @param player - the UUID of the player
*/ */

View File

@ -15,7 +15,7 @@
* along with ASkyBlock. If not, see <http://www.gnu.org/licenses/>. * along with ASkyBlock. If not, see <http://www.gnu.org/licenses/>.
*******************************************************************************/ *******************************************************************************/
package bentobox.addon.warps.event; package world.bentobox.warps.event;
import java.util.List; import java.util.List;
import java.util.UUID; import java.util.UUID;
@ -23,7 +23,7 @@ import java.util.UUID;
import org.bukkit.event.Event; import org.bukkit.event.Event;
import org.bukkit.event.HandlerList; import org.bukkit.event.HandlerList;
import bentobox.addon.warps.Warp; import world.bentobox.warps.Warp;
/** /**
* This event is fired when request is made for a sorted list of warps or when * This event is fired when request is made for a sorted list of warps or when
@ -39,7 +39,7 @@ public class WarpListEvent extends Event {
private List<UUID> warps; private List<UUID> warps;
/** /**
* @param plugin - BSkyBlock plugin object * @param plugin - BSkyBlock plugin objects
* @param warps * @param warps
*/ */
public WarpListEvent(Warp plugin, List<UUID> warps) { public WarpListEvent(Warp plugin, List<UUID> warps) {

View File

@ -1,4 +1,4 @@
package bentobox.addon.warps.event; package world.bentobox.warps.event;
import java.util.UUID; import java.util.UUID;
@ -6,7 +6,7 @@ import org.bukkit.Location;
import org.bukkit.event.Event; import org.bukkit.event.Event;
import org.bukkit.event.HandlerList; import org.bukkit.event.HandlerList;
import bentobox.addon.warps.Warp; import world.bentobox.warps.Warp;
/** /**
* This event is fired when a Warp is removed (when a warp sign is broken) * This event is fired when a Warp is removed (when a warp sign is broken)
@ -22,7 +22,7 @@ public class WarpRemoveEvent extends Event{
private UUID remover; private UUID remover;
/** /**
* @param plugin - BSkyBlock plugin object * @param plugin - BSkyBlock plugin objects
* @param warpLoc * @param warpLoc
* @param remover * @param remover
*/ */

View File

@ -1,4 +1,4 @@
package bentobox.addon.warps.database.object; package world.bentobox.warps.objects;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
@ -41,7 +41,7 @@ public class WarpsData implements DataObject {
} }
/** /**
* Puts all the data from the map into this object ready for saving * Puts all the data from the map into this objects ready for saving
* @param worldsWarpList * @param worldsWarpList
* @return this class filled with data * @return this class filled with data
*/ */

View File

@ -1,5 +1,5 @@
name: BentoBox-WelcomeWarps name: WelcomeWarps
main: bentobox.addon.warps.Warp main: world.bentobox.warps.Warp
version: ${version} version: ${version}
authors: tastybento authors: tastybento

View File

@ -1,7 +1,7 @@
/** /**
* *
*/ */
package bentobox.addon.warps; package world.bentobox.warps;
import static org.mockito.Mockito.mock; import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when; import static org.mockito.Mockito.when;
@ -30,6 +30,9 @@ import org.powermock.modules.junit4.PowerMockRunner;
import world.bentobox.bentobox.BentoBox; import world.bentobox.bentobox.BentoBox;
import world.bentobox.bentobox.api.user.User; import world.bentobox.bentobox.api.user.User;
import world.bentobox.bentobox.managers.PlayersManager; import world.bentobox.bentobox.managers.PlayersManager;
import world.bentobox.warps.Warp;
import world.bentobox.warps.WarpPanelManager;
import world.bentobox.warps.WarpSignsManager;
/** /**
* @author ben * @author ben
@ -99,7 +102,7 @@ public class WarpPanelManagerTest {
when(Bukkit.createInventory(Mockito.any(), Mockito.anyInt(), Mockito.any())).thenReturn(top); } when(Bukkit.createInventory(Mockito.any(), Mockito.anyInt(), Mockito.any())).thenReturn(top); }
/** /**
* Test method for {@link bentobox.addon.warps.WarpPanelManager#showWarpPanel(org.bukkit.World, world.bentobox.bbox.api.user.User, int)}. * Test method for {@link WarpPanelManager#showWarpPanel(org.bukkit.World, world.bentobox.bbox.api.user.User, int)}.
*/ */
@Test @Test
public void testShowWarpPanelFirst() { public void testShowWarpPanelFirst() {
@ -111,7 +114,7 @@ public class WarpPanelManagerTest {
} }
/** /**
* Test method for {@link bentobox.addon.warps.WarpPanelManager#showWarpPanel(org.bukkit.World, world.bentobox.bbox.api.user.User, int)}. * Test method for {@link WarpPanelManager#showWarpPanel(org.bukkit.World, world.bentobox.bbox.api.user.User, int)}.
*/ */
@Test @Test
public void testShowWarpPanelMiddle() { public void testShowWarpPanelMiddle() {
@ -123,7 +126,7 @@ public class WarpPanelManagerTest {
} }
/** /**
* Test method for {@link bentobox.addon.warps.WarpPanelManager#showWarpPanel(org.bukkit.World, world.bentobox.bbox.api.user.User, int)}. * Test method for {@link WarpPanelManager#showWarpPanel(org.bukkit.World, world.bentobox.bbox.api.user.User, int)}.
*/ */
@Test @Test
public void testShowWarpPanelLast() { public void testShowWarpPanelLast() {
@ -135,7 +138,7 @@ public class WarpPanelManagerTest {
} }
/** /**
* Test method for {@link bentobox.addon.warps.WarpPanelManager#showWarpPanel(org.bukkit.World, world.bentobox.bbox.api.user.User, int)}. * Test method for {@link WarpPanelManager#showWarpPanel(org.bukkit.World, world.bentobox.bbox.api.user.User, int)}.
*/ */
@Test @Test
public void testShowWarpPanelTestCache() { public void testShowWarpPanelTestCache() {
@ -150,7 +153,7 @@ public class WarpPanelManagerTest {
/** /**
* Test method for {@link bentobox.addon.warps.WarpPanelManager#removeWarp(org.bukkit.World, java.util.UUID)}. * Test method for {@link WarpPanelManager#removeWarp(org.bukkit.World, java.util.UUID)}.
*/ */
@Test @Test
public void testRemoveWarp() { public void testRemoveWarp() {

View File

@ -1,4 +1,4 @@
package bentobox.addon.warps; package world.bentobox.warps;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertFalse;
@ -33,7 +33,10 @@ import org.powermock.api.mockito.PowerMockito;
import org.powermock.core.classloader.annotations.PrepareForTest; import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner; import org.powermock.modules.junit4.PowerMockRunner;
import bentobox.addon.warps.config.PluginConfig; import world.bentobox.warps.Warp;
import world.bentobox.warps.WarpSignsListener;
import world.bentobox.warps.WarpSignsManager;
import world.bentobox.warps.config.PluginConfig;
import world.bentobox.bentobox.BentoBox; import world.bentobox.bentobox.BentoBox;
import world.bentobox.bentobox.api.user.User; import world.bentobox.bentobox.api.user.User;
import world.bentobox.bentobox.managers.IslandsManager; import world.bentobox.bentobox.managers.IslandsManager;