Fix some issues

This commit is contained in:
GeorgH93 2024-06-19 12:45:42 +02:00
parent a2e1fc19e8
commit 5ae86a25c2
No known key found for this signature in database
GPG Key ID: D1630D37F9E4B3C8
2 changed files with 10 additions and 3 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2023 GeorgH93
* Copyright (C) 2024 GeorgH93
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -12,7 +12,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package at.pcgamingfreaks.Minepacks.Bukkit.Command;
@ -21,10 +21,12 @@
import at.pcgamingfreaks.Command.HelpData;
import at.pcgamingfreaks.Message.MessageClickEvent;
import at.pcgamingfreaks.Minepacks.Bukkit.API.MinepacksCommand;
import at.pcgamingfreaks.Minepacks.Bukkit.Backpack;
import at.pcgamingfreaks.Minepacks.Bukkit.Minepacks;
import at.pcgamingfreaks.Minepacks.Bukkit.Permissions;
import at.pcgamingfreaks.Minepacks.Bukkit.Placeholders;
import at.pcgamingfreaks.Util.StringUtils;
import org.bukkit.Bukkit;
import org.bukkit.OfflinePlayer;
import org.bukkit.command.CommandSender;
@ -113,6 +115,11 @@ else if(components.length == 3)
return;
}
getMinepacksPlugin().getBackpack(target, backpack -> {
if (backpack.getSize() != items.length)
{
backpack.clear();
((Backpack) backpack).setSize(items.length);
}
backpack.getInventory().setContents(items);
backpack.setChanged();
messageRestored.send(sender);

View File

@ -7,7 +7,7 @@
<packaging>pom</packaging>
<properties>
<revision>2.4.31.2</revision>
<revision>2.4.31.3-SNAPSHOT</revision>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>