From d9c5ba112e2e0dd77836f54bb7d232d7f295b320 Mon Sep 17 00:00:00 2001 From: Bella Date: Thu, 12 Mar 2020 11:58:50 -0400 Subject: [PATCH] code cleanup in dupe book command --- .../zeroeightsix/kami/command/commands/DupeBookCommand.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/me/zeroeightsix/kami/command/commands/DupeBookCommand.java b/src/main/java/me/zeroeightsix/kami/command/commands/DupeBookCommand.java index 26952aa6..c579c948 100644 --- a/src/main/java/me/zeroeightsix/kami/command/commands/DupeBookCommand.java +++ b/src/main/java/me/zeroeightsix/kami/command/commands/DupeBookCommand.java @@ -38,7 +38,8 @@ public class DupeBookCommand extends Command { pages.appendTag(new NBTTagString(joinedPages.substring(page * 210, (page + 1) * 210))); } - if(is.hasTagCompound()){ + if (is.hasTagCompound()) { + assert is.getTagCompound() != null; is.getTagCompound().setTag("pages", pages); is.getTagCompound().setTag("title", new NBTTagString("")); is.getTagCompound().setTag("author", new NBTTagString(Wrapper.getPlayer().getName())); @@ -54,7 +55,7 @@ public class DupeBookCommand extends Command { Wrapper.getPlayer().connection.sendPacket(new CPacketCustomPayload("MC|BEdit", buf)); Command.sendChatMessage("Dupe book generated."); } else { - Command.sendChatMessage("You must be holding a writable book."); + Command.sendErrorMessage("You must be holding a writable book."); } } }