diff --git a/README.md b/README.md
index 398ffb1..8a3c025 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-
+
# Zero Inventory Problems - ZIP
[](https://github.com/Imprex-Development/zero-inventory-problems/releases/latest) [](https://github.com/Imprex-Development/zero-inventory-problems/actions?query=workflow%3ABuild)
diff --git a/zip-plugin/src/main/java/net/imprex/zip/command/LinkCommand.java b/zip-plugin/src/main/java/net/imprex/zip/command/LinkCommand.java
index 49dbe18..da4f1e3 100644
--- a/zip-plugin/src/main/java/net/imprex/zip/command/LinkCommand.java
+++ b/zip-plugin/src/main/java/net/imprex/zip/command/LinkCommand.java
@@ -71,6 +71,9 @@ public void onCommand(CommandSender sender, String[] args) {
} else if (linkingBackpack.equals(backpack)) {
this.messageConfig.send(player, MessageKey.ThisBackpackIsAlreadyLinkedThoThat);
return;
+ } else if (item.getAmount() > 1) {
+ this.messageConfig.send(player, MessageKey.StackedBackpacksCanNotBeLinked);
+ return;
}
linkingBackpack.applyOnItem(item);
diff --git a/zip-plugin/src/main/java/net/imprex/zip/config/MessageKey.java b/zip-plugin/src/main/java/net/imprex/zip/config/MessageKey.java
index c9b2c94..86451b3 100644
--- a/zip-plugin/src/main/java/net/imprex/zip/config/MessageKey.java
+++ b/zip-plugin/src/main/java/net/imprex/zip/config/MessageKey.java
@@ -54,6 +54,7 @@ public enum MessageKey {
YourBackpackLinkRequestWasCancelled("yourBackpackLinkRequestWasCancelled", "Your backpack link request was cancelled"),
BothBackpacksNeedToBeTheSameType("bothBackpacksNeedToBeTheSameType", "Both Backpacks need to be the same type"),
ThisBackpackIsAlreadyLinkedThoThat("thisBackpackIsAlreadyLinkedThoThat", "This backpack is already linked to that backpack"),
+ StackedBackpacksCanNotBeLinked("stackedBackpacksCanNotBeLinked", "Stacked backpacks can not be linked"),
PleaseEnterANumber("pleaseEnterANumber", "Please enter a number"),
EnterANumberBetweenArgsAndArgs("enterANumberBetweenArgsAndArgs", "Please enter a number between {0} and {1}"),
LoreLineCreate("loreLineCreate", "The lore line {0} was added"),
diff --git a/zip-plugin/src/main/java/net/imprex/zip/config/StorageConfig.java b/zip-plugin/src/main/java/net/imprex/zip/config/StorageConfig.java
new file mode 100644
index 0000000..69cb771
--- /dev/null
+++ b/zip-plugin/src/main/java/net/imprex/zip/config/StorageConfig.java
@@ -0,0 +1,27 @@
+package net.imprex.zip.config;
+
+import org.bukkit.configuration.ConfigurationSection;
+import org.bukkit.configuration.file.YamlConfiguration;
+
+public class StorageConfig {
+
+ public LocalConfig local;
+
+ public StorageConfig(ConfigurationSection config) {
+
+ config.addDefault("local", new YamlConfiguration());
+ ConfigurationSection localSection = config.getConfigurationSection("local");
+ this.local = new LocalConfig(localSection);
+ }
+
+ public class LocalConfig {
+
+ public String dataFolder;
+
+ public LocalConfig(ConfigurationSection config) {
+ config.addDefault("dataFolder", "plugins/ZeroInventoryProblems/storage");
+
+ this.dataFolder = config.getString("dataFolder");
+ }
+ }
+}
\ No newline at end of file
diff --git a/zip-plugin/src/main/java/net/imprex/zip/storage/Storage.java b/zip-plugin/src/main/java/net/imprex/zip/storage/Storage.java
new file mode 100644
index 0000000..0564087
--- /dev/null
+++ b/zip-plugin/src/main/java/net/imprex/zip/storage/Storage.java
@@ -0,0 +1,27 @@
+package net.imprex.zip.storage;
+
+import java.util.Set;
+
+import net.imprex.zip.api.ZIPUniqueId;
+import net.imprex.zip.config.StorageConfig;
+
+public interface Storage {
+
+ void connect(StorageConfig config);
+
+ void disconnect();
+
+ boolean isConnected();
+
+ StorageData load(ZIPUniqueId id);
+
+ boolean save(StorageData data);
+
+ boolean lock(ZIPUniqueId id);
+
+ boolean unlock(ZIPUniqueId id);
+
+ boolean isLocked(ZIPUniqueId id);
+
+ Set getLockedIds();
+}
\ No newline at end of file
diff --git a/zip-plugin/src/main/java/net/imprex/zip/storage/StorageData.java b/zip-plugin/src/main/java/net/imprex/zip/storage/StorageData.java
new file mode 100644
index 0000000..88eee11
--- /dev/null
+++ b/zip-plugin/src/main/java/net/imprex/zip/storage/StorageData.java
@@ -0,0 +1,8 @@
+package net.imprex.zip.storage;
+
+import org.bukkit.inventory.ItemStack;
+
+import net.imprex.zip.api.ZIPUniqueId;
+
+public record StorageData(ZIPUniqueId id, String type, ItemStack[] content) {
+}
diff --git a/zip-plugin/src/main/java/net/imprex/zip/storage/StorageManager.java b/zip-plugin/src/main/java/net/imprex/zip/storage/StorageManager.java
new file mode 100644
index 0000000..fa14db5
--- /dev/null
+++ b/zip-plugin/src/main/java/net/imprex/zip/storage/StorageManager.java
@@ -0,0 +1,19 @@
+package net.imprex.zip.storage;
+
+import net.imprex.zip.BackpackPlugin;
+
+public class StorageManager {
+
+ private Storage storage;
+
+ public StorageManager(BackpackPlugin plugin) {
+ }
+
+ public void setStorage(Storage storage) {
+
+ }
+
+ public Storage getStorage() {
+ return this.storage;
+ }
+}
diff --git a/zip-plugin/src/main/java/net/imprex/zip/storage/StorageType.java b/zip-plugin/src/main/java/net/imprex/zip/storage/StorageType.java
new file mode 100644
index 0000000..1805da2
--- /dev/null
+++ b/zip-plugin/src/main/java/net/imprex/zip/storage/StorageType.java
@@ -0,0 +1,5 @@
+package net.imprex.zip.storage;
+
+public class StorageType {
+
+}
diff --git a/zip-plugin/src/main/java/net/imprex/zip/storage/type/LocalStorage.java b/zip-plugin/src/main/java/net/imprex/zip/storage/type/LocalStorage.java
new file mode 100644
index 0000000..50ebc83
--- /dev/null
+++ b/zip-plugin/src/main/java/net/imprex/zip/storage/type/LocalStorage.java
@@ -0,0 +1,80 @@
+package net.imprex.zip.storage.type;
+
+import java.nio.file.Path;
+import java.util.Collections;
+import java.util.LinkedHashSet;
+import java.util.Set;
+import java.util.concurrent.atomic.AtomicBoolean;
+
+import net.imprex.zip.api.ZIPUniqueId;
+import net.imprex.zip.config.StorageConfig;
+import net.imprex.zip.storage.Storage;
+import net.imprex.zip.storage.StorageData;
+
+public class LocalStorage implements Storage {
+
+ private Path dataFolder;
+
+ private AtomicBoolean connected = new AtomicBoolean(false);
+
+ private Set locked = new LinkedHashSet<>();
+
+ @Override
+ public void connect(StorageConfig config) {
+ if (this.connected.compareAndSet(false, true)) {
+
+ } else {
+ throw new IllegalStateException("Local storage is already connected");
+ }
+ }
+
+ @Override
+ public void disconnect() {
+ if (this.connected.compareAndSet(true, false)) {
+
+ } else {
+ throw new IllegalStateException("Local storage is already disconnected");
+ }
+ }
+
+ @Override
+ public boolean isConnected() {
+ return this.connected.get();
+ }
+
+ @Override
+ public StorageData load(ZIPUniqueId id) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public boolean save(StorageData data) {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public boolean lock(ZIPUniqueId id) {
+ synchronized (this.locked) {
+ return this.locked.add(id);
+ }
+ }
+
+ @Override
+ public boolean unlock(ZIPUniqueId id) {
+ synchronized (this.locked) {
+ return this.locked.remove(id);
+ }
+ }
+
+ @Override
+ public boolean isLocked(ZIPUniqueId id) {
+ return this.locked.contains(id);
+ }
+
+ @Override
+ public Set getLockedIds() {
+ return Collections.unmodifiableSet(this.locked);
+ }
+}
\ No newline at end of file
diff --git a/zip-plugin/src/main/resources/lang/de_DE.yml b/zip-plugin/src/main/resources/lang/de_DE.yml
new file mode 100644
index 0000000..1f4167d
--- /dev/null
+++ b/zip-plugin/src/main/resources/lang/de_DE.yml
@@ -0,0 +1,39 @@
+prefix: "&8[&eZIP&8] &7"
+notAConsoleCommand: "Dieser Command kann nur von einen Spieler genutzt werden"
+youDontHaveTheFollowingPermission: "Du brauche folgende Rechte um diesen Command zu nutzen &8\"&e{0}&8\""
+ThisBackpackNoLongerExist: "Dieses Backpack existiert nicht mehr"
+clickHereToSeeTheLatestRelease: "Klicke hier um die neuste Version zu sehen"
+ANewReleaseIsAvailable: "Eine neue Version ist verfügbar"
+clickHere: "&f&l[Hier Klicken]"
+commandHelpStart: "&8[]&7========== &eZeroInventoryProblems &7==========&8[]"
+commandHelpPickup: "&8/&7zip &epickup &8| &7Greife auf nicht mehr verfügbare Items zu&8."
+commandHelpLink: "&8/&7zip &elink &7<&ecancel&7> &8| &7Linke ein zwei Backpacks aufs selbe Inventar&8."
+commandHelpGive: "&8/&7zip &egive &7[&eType&7] &7<&eSpieler&7> &8| &7Gib dir oder anderen ein Backpack&8."
+commandHelpType: "&8/&7zip &etype &8| &7Eine Liste mit allen Backpack Typen&8."
+commandHelpEnd: "&8[]&7========== &eZeroInventoryProblems &7==========&8[]"
+commandTypeStart: "&8[]&7========== &eZeroInventoryProblems Types &7==========&8[]"
+commandTypeContent: "&8-&e{0}"
+commandTypeButtonGive: "&7[&eHerstellen&7]"
+commandTypeButtonGiveHover: "&eKlicke hier um dir ein &8\"&e{0}&8\" §eBackpack zu geben"
+commandTypeEnd: "&8[]&7========== &eZeroInventoryProblems Types &7==========&8[]"
+noOnlinePlayerWasFound: "Es wurde kein Spieler namens &8\"&e{0}&8" &7gefunden"
+pleaseEnterABackpackType: "Bitte gebe ein Backpack typen ein"
+backpackTypeWasNotFound: "Backpack type &8\"&e{0}&8\" &7wurde nicht gefunden"
+youHaveGivenYourselfABackpack: "Du hast dir selbst ein &8\"&e{0}&8\" &7Backpack gegeben"
+youHaveGivenTargetPlayerABackpack: "Du hast &8\"&e{1}&8\" &7ein &8\"&e{0}&8\" Backpack gegeben"
+youNeedToHoldABackpackInYourHand: "Du musst ein Backpack in deiner Hand halten"
+yourBackpackHasNoUnusableItems: "Dein Backpack hat keine nicht Verfügbaren Items"
+youNeedMoreSpaceInYourInventory: "Du brauchst mehr Platz in deinen Inventar"
+targetPlayerNeedMoreSpaceInYourInventory: "&8\"&e{0}&8\" &7hat kein platz in seinen Inventar mehr"
+youReceivedAllUnusableItems: "Du hast alle nicht verfügbaren Items erhalten"
+youHaveUnusableItemsUsePickup: "Dein Backpack enthält nicht mehr verfügbare Items&8! &7Nutze &e/zip pickup"
+yourBackpackIsNotEmpty: "Dein Backpack ist nicht leer"
+youNeedToHoldBothBackpacksInYourInventory: "Du musst beide Backpack in deinen Inventar haben"
+youCanNowHoldTheBackpackWhichShouldBeLinked: "Halte nun das Backpack welches zu diesen Inventar verlinkt werden soll in deiner Hand und gebe diesen Command erneut ein"
+thisShouldNotHappenedPleaseTryToLinkAgain: "Es ist ein Fehler aufgetreten, bitte versuche es erneut"
+yourBackpackIsNowLinked: "Dein Backpacks teilen nun das selbe Inventar"
+youNeedToLinkABackpackFirst: "Du musst zuerst ein Backpack verlinken"
+yourBackpackLinkRequestWasCancelled: "Deine Backpack link anfrage wurde abgebrochen"
+bothBackpacksNeedToBeTheSameType: "Beide Backpacks müssen vom gleichen typen sein"
+thisBackpackIsAlreadyLinkedThoThat: "Dieses Backpacks habe bereits das gleiche Inventar verlinkt"
+stackedBackpacksCanNotBeLinked: "Mehrere Backpacks können nicht auf einmal verlinkt werden"
\ No newline at end of file
diff --git a/zip-plugin/src/main/resources/lang/en_US.yml b/zip-plugin/src/main/resources/lang/en_US.yml
index 46c27e3..604b0f8 100644
--- a/zip-plugin/src/main/resources/lang/en_US.yml
+++ b/zip-plugin/src/main/resources/lang/en_US.yml
@@ -26,7 +26,7 @@ commandLoreButtonDelete: "&7[&eDelete&7]"
commandLoreButtonDeleteHover: "&eClick here to delete this line"
commandLoreEnd: "&8[]&7========== &eZeroInventoryProblems Lore &7==========&8[]"
noOnlinePlayerWasFound: "No online player with the name &8\"&e{0}&8} &7was found"
-pleaseEnterABackpackType: "Please enter a backpack type &8(small/medium/big)"
+pleaseEnterABackpackType: "Please enter a backpack type"
backpackTypeWasNotFound: "Backpack type &8\"&e{0}&8\" &7was not found"
youHaveGivenYourselfABackpack: "You received a &8\"&e{0}&8\" &7backpack"
youHaveGivenTargetPlayerABackpack: "You given a &8\"&e{0}&8\" &7backpack to &8\"&e{1}&8\""
@@ -45,9 +45,13 @@ youNeedToLinkABackpackFirst: "You need to link a backpack at first"
yourBackpackLinkRequestWasCancelled: "Your backpack link request was cancelled"
bothBackpacksNeedToBeTheSameType: "Both Backpacks need to be the same type"
thisBackpackIsAlreadyLinkedThoThat: "This backpack is already linked to that backpack"
+<<<<<<< feat-storage-system
+stackedBackpacksCanNotBeLinked: "Stacked backpacks can not be linked"
+=======
pleaseEnterANumber: "Please enter a number"
enterANumberBetweenArgsAndArgs: "Please enter a number between {0} and {1}"
loreLineCreate: "The lore line {0} was added"
loreLineChange: "The lore line {0} was changed"
loreLineDelete: "The lore line {0} was deleted"
-maxLoreCountReached: "You have reached the max lore count of {0}"
\ No newline at end of file
+maxLoreCountReached: "You have reached the max lore count of {0}"
+>>>>>>> master