mirror of
https://github.com/PikaMug/Quests.git
synced 2024-09-27 22:47:27 +02:00
NEW gameplay feature with setting to disable
This commit is contained in:
parent
080006beb2
commit
9cc7945935
@ -25,6 +25,7 @@ public class Settings {
|
|||||||
private int acceptTimeout = 20;
|
private int acceptTimeout = 20;
|
||||||
private boolean allowCommands = true;
|
private boolean allowCommands = true;
|
||||||
private boolean allowCommandsForNpcQuests = false;
|
private boolean allowCommandsForNpcQuests = false;
|
||||||
|
private boolean allowPranks = true;
|
||||||
private boolean askConfirmation = true;
|
private boolean askConfirmation = true;
|
||||||
private boolean genFilesOnJoin = true;
|
private boolean genFilesOnJoin = true;
|
||||||
private boolean ignoreLockedQuests = false;
|
private boolean ignoreLockedQuests = false;
|
||||||
@ -62,6 +63,12 @@ public class Settings {
|
|||||||
public void setAllowCommandsForNpcQuests(boolean allowCommandsForNpcQuests) {
|
public void setAllowCommandsForNpcQuests(boolean allowCommandsForNpcQuests) {
|
||||||
this.allowCommandsForNpcQuests = allowCommandsForNpcQuests;
|
this.allowCommandsForNpcQuests = allowCommandsForNpcQuests;
|
||||||
}
|
}
|
||||||
|
public boolean canAllowPranks() {
|
||||||
|
return allowPranks;
|
||||||
|
}
|
||||||
|
public void setAllowPranks(boolean allowPranks) {
|
||||||
|
this.allowPranks = allowPranks;
|
||||||
|
}
|
||||||
public boolean canAskConfirmation() {
|
public boolean canAskConfirmation() {
|
||||||
return askConfirmation;
|
return askConfirmation;
|
||||||
}
|
}
|
||||||
@ -152,6 +159,7 @@ public class Settings {
|
|||||||
acceptTimeout = config.getInt("accept-timeout", 20);
|
acceptTimeout = config.getInt("accept-timeout", 20);
|
||||||
allowCommands = config.getBoolean("allow-command-questing", true);
|
allowCommands = config.getBoolean("allow-command-questing", true);
|
||||||
allowCommandsForNpcQuests = config.getBoolean("allow-command-quests-with-npcs", false);
|
allowCommandsForNpcQuests = config.getBoolean("allow-command-quests-with-npcs", false);
|
||||||
|
allowPranks = config.getBoolean("allow-pranks", true);
|
||||||
askConfirmation = config.getBoolean("ask-confirmation", true);
|
askConfirmation = config.getBoolean("ask-confirmation", true);
|
||||||
genFilesOnJoin = config.getBoolean("generate-files-on-join", true);
|
genFilesOnJoin = config.getBoolean("generate-files-on-join", true);
|
||||||
ignoreLockedQuests = config.getBoolean("ignore-locked-quests", false);
|
ignoreLockedQuests = config.getBoolean("ignore-locked-quests", false);
|
||||||
|
@ -175,8 +175,15 @@ public class PlayerListener implements Listener {
|
|||||||
// Do nothing, getHand() not present pre-1.9
|
// Do nothing, getHand() not present pre-1.9
|
||||||
}
|
}
|
||||||
if (e == null || e.equals(EquipmentSlot.HAND)) { //If the event is fired by HAND (main hand)
|
if (e == null || e.equals(EquipmentSlot.HAND)) { //If the event is fired by HAND (main hand)
|
||||||
if (evt.hasBlock() && evt.getClickedBlock().getType().name().equals("LECTERN")) {
|
if (evt.hasBlock() && ItemUtil.isJournal(evt.getPlayer().getItemInHand())) {
|
||||||
if (ItemUtil.isJournal(evt.getPlayer().getItemInHand())) {
|
if (evt.getClickedBlock().getType().name().contains("PORTAL")
|
||||||
|
&& plugin.getSettings().canAllowPranks()) {
|
||||||
|
evt.setCancelled(true);
|
||||||
|
evt.getPlayer().sendMessage(" " + ChatColor.AQUA + ChatColor.UNDERLINE
|
||||||
|
+ "https://www.youtube.com/watch?v=dQw4w9WgXcQ");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (evt.getClickedBlock().getType().name().equals("LECTERN")) {
|
||||||
evt.setCancelled(true);
|
evt.setCancelled(true);
|
||||||
evt.getPlayer().sendMessage(ChatColor.RED + Lang.get(evt.getPlayer(), "journalDenied"));
|
evt.getPlayer().sendMessage(ChatColor.RED + Lang.get(evt.getPlayer(), "journalDenied"));
|
||||||
return;
|
return;
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
accept-timeout: 20
|
accept-timeout: 20
|
||||||
allow-command-questing: true
|
allow-command-questing: true
|
||||||
allow-command-quests-with-npcs: false
|
allow-command-quests-with-npcs: false
|
||||||
|
allow-pranks: true
|
||||||
allow-quitting: true
|
allow-quitting: true
|
||||||
ask-confirmation: true
|
ask-confirmation: true
|
||||||
generate-files-on-join: true
|
generate-files-on-join: true
|
||||||
|
Loading…
Reference in New Issue
Block a user