Skip to content

Commit

Permalink
Fixes bug where Warps would not hook with no game modes
Browse files Browse the repository at this point in the history
  • Loading branch information
tastybento committed May 21, 2020
1 parent 75feedb commit 9c4a224
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
9 changes: 6 additions & 3 deletions src/main/java/world/bentobox/warps/Warp.java
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public void onLoad()
// Save default config.yml
this.saveDefaultConfig();
// Load the plugin's config
if (this.loadSettings() && settings.isAllowInOtherWorlds()) {
if (this.loadSettings() && getSettings().isAllowInOtherWorlds()) {
// Load the master warp and warps command
new WarpCommand(this);
new WarpsCommand(this);
Expand All @@ -100,7 +100,7 @@ public void onReload()
{
super.onReload();

if (this.hooked) {
if (this.hooked || getSettings().isAllowInOtherWorlds()) {
this.warpSignsManager.saveWarpList();

this.loadSettings();
Expand Down Expand Up @@ -132,13 +132,16 @@ public void onEnable() {
}
});

if (hooked)
if (hooked || getSettings().isAllowInOtherWorlds())
{
// Start warp signs
warpSignsManager = new WarpSignsManager(this, this.getPlugin());
warpPanelManager = new WarpPanelManager(this);
// Load the listener
this.registerListener(new WarpSignsListener(this));
} else {
logWarning("Addon did not hook into anything and is not running stand-alone");
this.setState(State.DISABLED);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ public void setup() {
@Override
public boolean execute(User user, String label, List<String> args) {
World world = getWorld() == null ? user.getWorld() : getWorld();
if (addon.getWarpSignsManager().listWarps(world).isEmpty()) {
if (addon
.getWarpSignsManager()
.listWarps(world)
.isEmpty()) {
user.sendMessage("warps.error.no-warps-yet");
user.sendMessage("warps.warpTip", "[text]", addon.getSettings().getWelcomeLine());
return false;
Expand Down

0 comments on commit 9c4a224

Please sign in to comment.