5 Commits
1.3.5 ... 1.3.6

Author SHA1 Message Date
1da61dc820 Bumps version for release
All checks were successful
EpicKnarvik97/Books-Without-Borders/pipeline/head This commit looks good
2025-07-27 20:57:16 +02:00
48f69000b0 Adds color support to book authors
All checks were successful
EpicKnarvik97/Books-Without-Borders/pipeline/head This commit looks good
2025-07-27 20:45:00 +02:00
4ddfafe6ec Fixes books being loaded twice
All checks were successful
EpicKnarvik97/Books-Without-Borders/pipeline/head This commit looks good
2025-07-27 18:42:43 +02:00
3f3566089e Adds gitignore to repo
All checks were successful
EpicKnarvik97/Books-Without-Borders/pipeline/head This commit looks good
2024-11-27 12:18:23 +01:00
0b701ddef1 Bumps version for development
All checks were successful
EpicKnarvik97/Books-Without-Borders/pipeline/head This commit looks good
2024-09-07 01:44:40 +02:00
6 changed files with 128 additions and 6 deletions

113
.gitignore vendored Normal file
View 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/

View File

@@ -6,7 +6,7 @@
<groupId>net.knarcraft</groupId>
<artifactId>BooksWithoutBorders</artifactId>
<version>1.3.5</version>
<version>1.3.6</version>
<packaging>jar</packaging>
<licenses>
@@ -113,7 +113,7 @@
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.21-R0.1-SNAPSHOT</version>
<version>1.21.8-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>

View File

@@ -35,7 +35,7 @@ public class CommandLoad implements TabExecutor {
* @param loadPublic <p>Whether to list public files as loadable</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)) {
BooksWithoutBorders.sendErrorMessage(sender, "This command can only be used by a player!");
return false;

View File

@@ -3,6 +3,8 @@ package net.knarcraft.bookswithoutborders.command;
import net.knarcraft.bookswithoutborders.BooksWithoutBorders;
import net.knarcraft.bookswithoutborders.state.ItemSlot;
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.CommandSender;
import org.bukkit.command.TabExecutor;
@@ -42,7 +44,7 @@ public class CommandSetAuthor implements TabExecutor {
ItemStack heldBook = InventoryHelper.getHeldItem(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);
heldBook.setItemMeta(bookMetaData);
BooksWithoutBorders.sendSuccessMessage(player, "Book author set to " + author + "!");

View File

@@ -3,6 +3,7 @@ package net.knarcraft.bookswithoutborders.listener;
import net.knarcraft.bookswithoutborders.config.BooksWithoutBordersConfig;
import net.knarcraft.bookswithoutborders.utility.IntegerToRomanConverter;
import net.md_5.bungee.api.ChatColor;
import org.bukkit.NamespacedKey;
import org.bukkit.block.ChiseledBookshelf;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.entity.Player;
@@ -140,7 +141,12 @@ public class BookshelfListener implements Listener {
* @return <p>The prettified enchantment name</p>
*/
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";
}
}
/**

View File

@@ -158,8 +158,9 @@ public final class BookFileHelper {
String userName = data[1].substring(0, data[1].length() - 4);
data[1] = BookHelper.authorFromUUID(userName) + extension;
fileList.add(String.join(separator, data));
} else {
fileList.add(fileName);
}
fileList.add(fileName);
}
return fileList;