Skip to content

Commit

Permalink
Merge into master
Browse files Browse the repository at this point in the history
  • Loading branch information
BONNe committed May 17, 2022
2 parents d93f060 + 0dea651 commit 076b71c
Show file tree
Hide file tree
Showing 29 changed files with 1,031 additions and 793 deletions.
7 changes: 6 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
<!-- Do not change unless you want different name for local builds. -->
<build.number>-LOCAL</build.number>
<!-- This allows to change between versions. -->
<build.version>1.11.2</build.version>
<build.version>1.12.0</build.version>
<!-- Sonar Cloud -->
<sonar.projectKey>BentoBoxWorld_Warps</sonar.projectKey>
<sonar.organization>bentobox-world</sonar.organization>
Expand Down Expand Up @@ -138,6 +138,11 @@
<version>${spigot.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>plugin-annotations</artifactId>
<version>1.2.3-SNAPSHOT</version>
</dependency>
<!-- Mockito (Unit testing) -->
<dependency>
<groupId>org.mockito</groupId>
Expand Down
25 changes: 16 additions & 9 deletions src/main/java/world/bentobox/warps/Warp.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
import world.bentobox.warps.commands.WarpsCommand;
import world.bentobox.warps.config.Settings;
import world.bentobox.warps.listeners.WarpSignsListener;
import world.bentobox.warps.managers.SignCacheManager;
import world.bentobox.warps.managers.WarpSignsManager;


/**
* Addin to BentoBox that enables welcome warp signs
Expand All @@ -39,14 +42,14 @@ public class Warp extends Addon {
public static final String WELCOME_WARP_SIGNS = "welcomewarpsigns";

/**
* Warp panel Manager
* Worlds Sign manager.
*/
private WarpPanelManager warpPanelManager;
private WarpSignsManager warpSignsManager;

/**
* Worlds Sign manager.
* Sign Cache Manager
*/
private WarpSignsManager warpSignsManager;
private SignCacheManager signCacheManager;

/**
* This variable stores in which worlds this addon is working.
Expand Down Expand Up @@ -136,7 +139,7 @@ public void onEnable() {
{
// Start warp signs
warpSignsManager = new WarpSignsManager(this, this.getPlugin());
warpPanelManager = new WarpPanelManager(this);
signCacheManager = new SignCacheManager(this);
// Load the listener
this.registerListener(new WarpSignsListener(this));
} else {
Expand Down Expand Up @@ -169,17 +172,21 @@ private boolean loadSettings() {
this.setState(State.DISABLED);
return false;
}

// Save existing panels.
this.saveResource("panels/warps_panel.yml", false);

settingsConfig.saveConfigObject(settings);
return true;
}


/**
* Get warp panel manager
* @return Warp Panel Manager
* Get sign cache manager
* @return Sign Cache Manager
*/
public WarpPanelManager getWarpPanelManager() {
return warpPanelManager;
public SignCacheManager getSignCacheManager() {
return signCacheManager;
}

public WarpSignsManager getWarpSignsManager() {
Expand Down
187 changes: 0 additions & 187 deletions src/main/java/world/bentobox/warps/WarpPanelManager.java

This file was deleted.

7 changes: 7 additions & 0 deletions src/main/java/world/bentobox/warps/WarpsPladdon.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
package world.bentobox.warps;

import org.bukkit.plugin.java.annotation.dependency.Dependency;
import org.bukkit.plugin.java.annotation.plugin.ApiVersion;
import org.bukkit.plugin.java.annotation.plugin.Plugin;

import world.bentobox.bentobox.api.addons.Addon;
import world.bentobox.bentobox.api.addons.Pladdon;

@Plugin(name="Pladdon", version="1.0")
@ApiVersion(ApiVersion.Target.v1_16)
@Dependency(value = "BentoBox")
public class WarpsPladdon extends Pladdon {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
import world.bentobox.bentobox.api.commands.CompositeCommand;
import world.bentobox.bentobox.api.user.User;
import world.bentobox.warps.Warp;
import world.bentobox.warps.panels.WarpsPanel;


/**
* Handles the warps command
Expand Down Expand Up @@ -51,7 +53,9 @@ public boolean execute(User user, String label, List<String> args) {
user.sendMessage("warps.warpTip", "[text]", addon.getSettings().getWelcomeLine());
return false;
}
addon.getWarpPanelManager().showWarpPanel(world, user, 0);

WarpsPanel.openPanel(this.addon, world, user);

return true;
}

Expand Down
Loading

0 comments on commit 076b71c

Please sign in to comment.