Compare commits
5 Commits
Author | SHA1 | Date | |
---|---|---|---|
1da61dc820 | |||
48f69000b0 | |||
4ddfafe6ec | |||
3f3566089e | |||
0b701ddef1 |
113
.gitignore
vendored
Normal file
113
.gitignore
vendored
Normal file
@@ -0,0 +1,113 @@
|
|||||||
|
# User-specific stuff
|
||||||
|
.idea/
|
||||||
|
|
||||||
|
*.iml
|
||||||
|
*.ipr
|
||||||
|
*.iws
|
||||||
|
|
||||||
|
# IntelliJ
|
||||||
|
out/
|
||||||
|
|
||||||
|
# Compiled class file
|
||||||
|
*.class
|
||||||
|
|
||||||
|
# Log file
|
||||||
|
*.log
|
||||||
|
|
||||||
|
# BlueJ files
|
||||||
|
*.ctxt
|
||||||
|
|
||||||
|
# Package Files #
|
||||||
|
*.jar
|
||||||
|
*.war
|
||||||
|
*.nar
|
||||||
|
*.ear
|
||||||
|
*.zip
|
||||||
|
*.tar.gz
|
||||||
|
*.rar
|
||||||
|
|
||||||
|
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
|
||||||
|
hs_err_pid*
|
||||||
|
|
||||||
|
*~
|
||||||
|
|
||||||
|
# temporary files which can be created if a process still has a handle open of a deleted file
|
||||||
|
.fuse_hidden*
|
||||||
|
|
||||||
|
# KDE directory preferences
|
||||||
|
.directory
|
||||||
|
|
||||||
|
# Linux trash folder which might appear on any partition or disk
|
||||||
|
.Trash-*
|
||||||
|
|
||||||
|
# .nfs files are created when an open file is removed but is still being accessed
|
||||||
|
.nfs*
|
||||||
|
|
||||||
|
# General
|
||||||
|
.DS_Store
|
||||||
|
.AppleDouble
|
||||||
|
.LSOverride
|
||||||
|
|
||||||
|
# Icon must end with two \r
|
||||||
|
Icon
|
||||||
|
|
||||||
|
# Thumbnails
|
||||||
|
._*
|
||||||
|
|
||||||
|
# Files that might appear in the root of a volume
|
||||||
|
.DocumentRevisions-V100
|
||||||
|
.fseventsd
|
||||||
|
.Spotlight-V100
|
||||||
|
.TemporaryItems
|
||||||
|
.Trashes
|
||||||
|
.VolumeIcon.icns
|
||||||
|
.com.apple.timemachine.donotpresent
|
||||||
|
|
||||||
|
# Directories potentially created on remote AFP share
|
||||||
|
.AppleDB
|
||||||
|
.AppleDesktop
|
||||||
|
Network Trash Folder
|
||||||
|
Temporary Items
|
||||||
|
.apdisk
|
||||||
|
|
||||||
|
# Windows thumbnail cache files
|
||||||
|
Thumbs.db
|
||||||
|
Thumbs.db:encryptable
|
||||||
|
ehthumbs.db
|
||||||
|
ehthumbs_vista.db
|
||||||
|
|
||||||
|
# Dump file
|
||||||
|
*.stackdump
|
||||||
|
|
||||||
|
# Folder config file
|
||||||
|
[Dd]esktop.ini
|
||||||
|
|
||||||
|
# Recycle Bin used on file shares
|
||||||
|
$RECYCLE.BIN/
|
||||||
|
|
||||||
|
# Windows Installer files
|
||||||
|
*.cab
|
||||||
|
*.msi
|
||||||
|
*.msix
|
||||||
|
*.msm
|
||||||
|
*.msp
|
||||||
|
|
||||||
|
# Windows shortcuts
|
||||||
|
*.lnk
|
||||||
|
|
||||||
|
target/
|
||||||
|
|
||||||
|
pom.xml.tag
|
||||||
|
pom.xml.releaseBackup
|
||||||
|
pom.xml.versionsBackup
|
||||||
|
pom.xml.next
|
||||||
|
|
||||||
|
release.properties
|
||||||
|
dependency-reduced-pom.xml
|
||||||
|
buildNumber.properties
|
||||||
|
.mvn/timing.properties
|
||||||
|
.mvn/wrapper/maven-wrapper.jar
|
||||||
|
.flattened-pom.xml
|
||||||
|
|
||||||
|
# Common working directory
|
||||||
|
run/
|
4
pom.xml
4
pom.xml
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
<groupId>net.knarcraft</groupId>
|
<groupId>net.knarcraft</groupId>
|
||||||
<artifactId>BooksWithoutBorders</artifactId>
|
<artifactId>BooksWithoutBorders</artifactId>
|
||||||
<version>1.3.5</version>
|
<version>1.3.6</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<licenses>
|
<licenses>
|
||||||
@@ -113,7 +113,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.spigotmc</groupId>
|
<groupId>org.spigotmc</groupId>
|
||||||
<artifactId>spigot-api</artifactId>
|
<artifactId>spigot-api</artifactId>
|
||||||
<version>1.21-R0.1-SNAPSHOT</version>
|
<version>1.21.8-R0.1-SNAPSHOT</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
@@ -35,7 +35,7 @@ public class CommandLoad implements TabExecutor {
|
|||||||
* @param loadPublic <p>Whether to list public files as loadable</p>
|
* @param loadPublic <p>Whether to list public files as loadable</p>
|
||||||
* @return <p>True if the book was loaded successfully</p>
|
* @return <p>True if the book was loaded successfully</p>
|
||||||
*/
|
*/
|
||||||
boolean loadBook(CommandSender sender, String[] args, String directory, boolean loadPublic) {
|
public boolean loadBook(CommandSender sender, String[] args, String directory, boolean loadPublic) {
|
||||||
if (!(sender instanceof Player player)) {
|
if (!(sender instanceof Player player)) {
|
||||||
BooksWithoutBorders.sendErrorMessage(sender, "This command can only be used by a player!");
|
BooksWithoutBorders.sendErrorMessage(sender, "This command can only be used by a player!");
|
||||||
return false;
|
return false;
|
||||||
|
@@ -3,6 +3,8 @@ package net.knarcraft.bookswithoutborders.command;
|
|||||||
import net.knarcraft.bookswithoutborders.BooksWithoutBorders;
|
import net.knarcraft.bookswithoutborders.BooksWithoutBorders;
|
||||||
import net.knarcraft.bookswithoutborders.state.ItemSlot;
|
import net.knarcraft.bookswithoutborders.state.ItemSlot;
|
||||||
import net.knarcraft.bookswithoutborders.utility.InventoryHelper;
|
import net.knarcraft.bookswithoutborders.utility.InventoryHelper;
|
||||||
|
import net.knarcraft.knarlib.property.ColorConversion;
|
||||||
|
import net.knarcraft.knarlib.util.ColorHelper;
|
||||||
import org.bukkit.command.Command;
|
import org.bukkit.command.Command;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.command.TabExecutor;
|
import org.bukkit.command.TabExecutor;
|
||||||
@@ -42,7 +44,7 @@ public class CommandSetAuthor implements TabExecutor {
|
|||||||
ItemStack heldBook = InventoryHelper.getHeldItem(player, mainHand);
|
ItemStack heldBook = InventoryHelper.getHeldItem(player, mainHand);
|
||||||
BookMeta bookMetaData = InventoryHelper.getHeldBookMetadata(player, mainHand);
|
BookMeta bookMetaData = InventoryHelper.getHeldBookMetadata(player, mainHand);
|
||||||
|
|
||||||
String author = String.join(" ", args);
|
String author = ColorHelper.translateColorCodes(String.join(" ", args), ColorConversion.RGB);
|
||||||
bookMetaData.setAuthor(author);
|
bookMetaData.setAuthor(author);
|
||||||
heldBook.setItemMeta(bookMetaData);
|
heldBook.setItemMeta(bookMetaData);
|
||||||
BooksWithoutBorders.sendSuccessMessage(player, "Book author set to " + author + "!");
|
BooksWithoutBorders.sendSuccessMessage(player, "Book author set to " + author + "!");
|
||||||
|
@@ -3,6 +3,7 @@ package net.knarcraft.bookswithoutborders.listener;
|
|||||||
import net.knarcraft.bookswithoutborders.config.BooksWithoutBordersConfig;
|
import net.knarcraft.bookswithoutborders.config.BooksWithoutBordersConfig;
|
||||||
import net.knarcraft.bookswithoutborders.utility.IntegerToRomanConverter;
|
import net.knarcraft.bookswithoutborders.utility.IntegerToRomanConverter;
|
||||||
import net.md_5.bungee.api.ChatColor;
|
import net.md_5.bungee.api.ChatColor;
|
||||||
|
import org.bukkit.NamespacedKey;
|
||||||
import org.bukkit.block.ChiseledBookshelf;
|
import org.bukkit.block.ChiseledBookshelf;
|
||||||
import org.bukkit.enchantments.Enchantment;
|
import org.bukkit.enchantments.Enchantment;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
@@ -140,7 +141,12 @@ public class BookshelfListener implements Listener {
|
|||||||
* @return <p>The prettified enchantment name</p>
|
* @return <p>The prettified enchantment name</p>
|
||||||
*/
|
*/
|
||||||
private String getEnchantmentName(Enchantment enchantment) {
|
private String getEnchantmentName(Enchantment enchantment) {
|
||||||
return uppercaseFirst(enchantment.getKey().getKey().replace("_", " "));
|
NamespacedKey key = enchantment.getKeyOrNull();
|
||||||
|
if (key != null) {
|
||||||
|
return uppercaseFirst(key.getKey().replace("_", " "));
|
||||||
|
} else {
|
||||||
|
return "Unknown Enchantment";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -158,8 +158,9 @@ public final class BookFileHelper {
|
|||||||
String userName = data[1].substring(0, data[1].length() - 4);
|
String userName = data[1].substring(0, data[1].length() - 4);
|
||||||
data[1] = BookHelper.authorFromUUID(userName) + extension;
|
data[1] = BookHelper.authorFromUUID(userName) + extension;
|
||||||
fileList.add(String.join(separator, data));
|
fileList.add(String.join(separator, data));
|
||||||
|
} else {
|
||||||
|
fileList.add(fileName);
|
||||||
}
|
}
|
||||||
fileList.add(fileName);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return fileList;
|
return fileList;
|
||||||
|
Reference in New Issue
Block a user