Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ public static MultiverseCoreConfiguration getInstance() {
private volatile boolean autopurge;
@Property
private volatile boolean idonotwanttodonate;
@Property
private volatile boolean ignoregamemoderestriction;

public MultiverseCoreConfiguration() {
super();
Expand Down Expand Up @@ -111,6 +113,7 @@ protected void setDefaults() {
portalsearchradius = 128;
autopurge = true;
idonotwanttodonate = false;
ignoregamemoderestriction = false;
// END CHECKSTYLE-SUPPRESSION: MagicNumberCheck
}

Expand Down Expand Up @@ -382,4 +385,14 @@ public boolean isShowingDonateMessage() {
public void setShowDonateMessage(boolean showDonateMessage) {
this.idonotwanttodonate = !showDonateMessage;
}

@Override
public boolean getIgnoreGameModeRestriction() {
return ignoregamemoderestriction;
}

@Override
public void setIgnoreGameModeRestriction(boolean ignoreGameModeRestriction) {
this.ignoregamemoderestriction = ignoreGameModeRestriction;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -239,4 +239,16 @@ public interface MultiverseCoreConfig extends ConfigurationSerializable {
* @param idonotwanttodonate True if donation/patreon messages should be shown.
*/
void setShowDonateMessage(boolean idonotwanttodonate);

/**
* Sets ignoregamemoderestriction.
* @param ignoreGameModeRestriction The new value.
*/
void setIgnoreGameModeRestriction(boolean ignoreGameModeRestriction);

/**
* Gets ignoregamemoderestriction.
* @return ignoregamemoderestriction.
*/
boolean getIgnoreGameModeRestriction();
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public MVPermissions(MultiverseCore plugin) {
* @return True if they should bypass restrictions.
*/
public boolean canIgnoreGameModeRestriction(Player p, MultiverseWorld w) {
return p.hasPermission("mv.bypass.gamemode." + w.getName());
return p.hasPermission("mv.bypass.gamemode." + w.getName()) || this.plugin.getMVConfig().getIgnoreGameModeRestriction();
}

/**
Expand Down