mirror of
https://github.com/PikaMug/Quests.git
synced 2024-11-25 20:25:45 +01:00
Default to Quests Journal without item
This commit is contained in:
parent
81f7fb4d3c
commit
2db149067d
16
core/pom.xml
16
core/pom.xml
@ -134,6 +134,11 @@
|
||||
<artifactId>LocaleLib</artifactId>
|
||||
<version>12e12cbadc</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>xyz.upperlevel.spigot.book</groupId>
|
||||
<artifactId>spigot-book-api</artifactId>
|
||||
<version>1.6</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
@ -244,9 +249,10 @@
|
||||
<include>me.*</include>
|
||||
<include>com.github.PikaMug:LocaleLib</include>
|
||||
<include>com.zaxxer:HikariCP</include>
|
||||
<include>mysql</include>
|
||||
<include>org.slf4j:slf4j-simple</include>
|
||||
<include>org.slf4j:slf4j-api</include>
|
||||
<include>mysql</include>
|
||||
<include>xyz.upperlevel.spigot.book:spigot-book-api</include>
|
||||
</includes>
|
||||
</artifactSet>
|
||||
<relocations>
|
||||
@ -258,13 +264,17 @@
|
||||
<pattern>com.zaxxer.hikari</pattern>
|
||||
<shadedPattern>me.blackvein.quests.libs.hikari</shadedPattern>
|
||||
</relocation>
|
||||
<relocation>
|
||||
<pattern>com.mysql</pattern>
|
||||
<shadedPattern>me.blackvein.quests.libs.mysql</shadedPattern>
|
||||
</relocation>
|
||||
<relocation>
|
||||
<pattern>org.slf4j</pattern>
|
||||
<shadedPattern>me.blackvein.quests.libs.slf4j</shadedPattern>
|
||||
</relocation>
|
||||
<relocation>
|
||||
<pattern>com.mysql</pattern>
|
||||
<shadedPattern>me.blackvein.quests.libs.mysql</shadedPattern>
|
||||
<pattern>xyz.upperlevel.spigot.book</pattern>
|
||||
<shadedPattern>me.blackvein.quests.libs.bookutil</shadedPattern>
|
||||
</relocation>
|
||||
</relocations>
|
||||
</configuration>
|
||||
|
@ -35,6 +35,7 @@ public class Settings implements ISettings {
|
||||
private int consoleLogging = 1;
|
||||
private boolean disableCommandFeedback = true;
|
||||
private boolean genFilesOnJoin = true;
|
||||
private boolean giveJournalItem = false;
|
||||
private boolean ignoreLockedQuests = false;
|
||||
private int killDelay = 0;
|
||||
private int maxQuests = 0;
|
||||
@ -134,6 +135,12 @@ public class Settings implements ISettings {
|
||||
public void setGenFilesOnJoin(final boolean genFilesOnJoin) {
|
||||
this.genFilesOnJoin = genFilesOnJoin;
|
||||
}
|
||||
public boolean canGiveJournalItem() {
|
||||
return giveJournalItem;
|
||||
}
|
||||
public void setGiveJournalItem(final boolean giveJournalItem) {
|
||||
this.giveJournalItem = giveJournalItem;
|
||||
}
|
||||
public boolean canIgnoreLockedQuests() {
|
||||
return ignoreLockedQuests;
|
||||
}
|
||||
|
@ -24,6 +24,7 @@ import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.Inventory;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import xyz.upperlevel.spigot.book.BookUtil;
|
||||
|
||||
public class QuestsJournalCommand extends QuestsSubCommand {
|
||||
|
||||
@ -78,6 +79,10 @@ public class QuestsJournalCommand extends QuestsSubCommand {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!plugin.getSettings().canGiveJournalItem()) {
|
||||
final QuestJournal journal = new QuestJournal(quester);
|
||||
BookUtil.openPlayer(player, journal.toItemStack());
|
||||
} else {
|
||||
final Inventory inv = player.getInventory();
|
||||
final int index = quester.getJournalIndex();
|
||||
if (index != -1) {
|
||||
@ -107,3 +112,4 @@ public class QuestsJournalCommand extends QuestsSubCommand {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user