8.8 update

This commit is contained in:
mfnalex 2020-05-27 15:44:56 +02:00
parent b32ca7185c
commit 89c4d9e827
6 changed files with 59 additions and 33 deletions

View File

@ -1,7 +1,9 @@
# Changelog
## 8.8-pre1
- Improved Minepacks hook
## 8.8
- Improved Minepacks hook and prevents backpacks from being put into itself
- Prevent ItemStacks > 64 slots from being sorted at all
- Update Checker interval is now configurable (default: every 4 hours)
- Updated French, Hungarian and Japanese translation
- Changed class names and moved API to its own class - can be accessed via ChestSortPlugin#getAPI()
## 8.7

View File

@ -1,5 +1,9 @@
# Todo
## StackableItems
Make it configurable whether ItemStacks > 64 items will stay unsorted, or sorted and reverted back to stacks of 64 items
-> https://www.spigotmc.org/threads/1-8-1-15-chestsort-api.334121/page-19#post-3821591
## Auto-Refill
Auto refills your hotbar with stuff from your inventory when you run out of items / a tool breaks.

View File

@ -6,7 +6,7 @@
<groupId>de.jeffclan</groupId>
<artifactId>JeffChestSort</artifactId>
<version>8.8-pre1</version>
<version>8.8</version>
<packaging>jar</packaging>
<name>JeffChestSort</name>

View File

@ -426,6 +426,13 @@ public class ChestSortOrganizer {
}
}
}
// Do not move ItemStacks with more than 64 items
for(int i = startSlot; i<= endSlot; i++) {
if(isOversizedStack(items[i])) {
items[i] = null;
unsortableSlots.add(i);
}
}
// Remove the stuff from the original inventory
for (int i = startSlot; i <= endSlot; i++) {
@ -546,6 +553,11 @@ public class ChestSortOrganizer {
}
}
public boolean isOversizedStack(ItemStack item) {
if(item!=null && item.getAmount()>64) return true;
return false;
}
public void stuffInventoryIntoAnother(Inventory source, Inventory destination,Inventory origSource) {
Material placeholderMaterial = Material.DIRT;
@ -567,6 +579,7 @@ public class ChestSortOrganizer {
ItemStack current = source.getItem(i);
if(current == null) continue;
if(isOversizedStack(current)) continue;
source.clear(i);
HashMap<Integer,ItemStack> currentLeftovers = destination.addItem(current);
@ -592,8 +605,17 @@ public class ChestSortOrganizer {
Inventory temp = Bukkit.createInventory(null, maxInventorySize);
for(int i = playerInvStartSlot;i<=playerInvEndSlot;i++) {
if(source.getItem(i)==null) continue;
if(plugin.hookInventoryPages && plugin.organizer.inventoryPagesHook.isButton(source.getItem(i), i, source)) continue;
if(plugin.hookMinepacks && plugin.listener.minepacksHook.isMinepacksBackpack(destination)
&& plugin.listener.minepacksHook.isMinepacksBackpack(source.getItem(i))) continue;
if(plugin.hookInventoryPages
&& plugin.organizer.inventoryPagesHook.isButton(source.getItem(i), i, source)) continue;
if(destinationIsShulkerBox && source.getItem(i).getType().name().endsWith("SHULKER_BOX")) continue;
if(isOversizedStack(source.getItem(i))) continue;
temp.addItem(source.getItem(i));
source.clear(i);
}

View File

@ -380,25 +380,24 @@ message-gui-right-click: "Empty Chest (Right-Click)"
#message-gui-left-click: "Kiste füllen (Linksklick)"
#message-gui-right-click: "Kiste leeren (Rechtsklick)"
##### Hungarian - Thanks to Letter for translating!
##### Note: Some messages are still untranslated. Please send me your translation at SpigotMC
##### Hungarian - Thanks to Letter and Polaroli for translating!
#message-when-using-chest: "&7Automatikus láda rendezés bekapcsolás: &6/chestsort"
#message-when-using-chest2: "&7Automatikus láda rendezés bekapcsolás: &6/chestsort"
#message-sorting-disabled: "&7Automatikus láda rendezés kikapcsolva."
#message-sorting-enabled: "&7Automatikus láda rendezés bekapcsolva."
#message-inv-sorting-disabled: "&7Automatic inventory sorting has been &cdisabled&7."
#message-inv-sorting-enabled: "&7Automatic inventory sorting has been &aenabled&7."
#message-inv-sorting-disabled: "&7Automatikus leltár rendezés &ckikapcsolva&7."
#message-inv-sorting-enabled: "&7Automatikus leltár rendezés &cbekapcsolva&7."
#message-error-players-only: "&cHiba: Ezt a parancsot csak játékos használhatja."
#message-player-inventory-sorted: "&7A leltárad rendezve lett."
#message-error-invalid-options: "&cHiba: Ismeretlen opció %s. Helyes opció %s."
#message-gui-enabled: "&aEnabled"
#message-gui-disabled: "&cDisabled"
#message-gui-middle-click: "Middle-Click"
#message-gui-shift-click: "Shift + Click"
#message-gui-double-click: "Double-Click"
#message-gui-shift-right-click: "Shift + Right-Click"
#message-gui-left-click: "Fill Chest (Left-Click)"
#message-gui-right-click: "Empty Chest (Right-Click)"
#message-gui-enabled: "&aEngedélyezve"
#message-gui-disabled: "&cKikapcsolva"
#message-gui-middle-click: "Középső egérgomb"
#message-gui-shift-click: "Shift + Klikk"
#message-gui-double-click: "Dupla Kattintás"
#message-gui-shift-right-click: "Shift + Jobb klikk"
#message-gui-left-click: "Láda feltöltés (Bal klikk)"
#message-gui-right-click: "Láda ürítés (Jobb klikk)"
##### Italian
##### Note: Some messages are still untranslated. Please send me your translation at SpigotMC
@ -420,25 +419,24 @@ message-gui-right-click: "Empty Chest (Right-Click)"
#message-gui-left-click: "Fill Chest (Left-Click)"
#message-gui-right-click: "Empty Chest (Right-Click)"
##### Japanese
##### Note: Some messages are still untranslated. Please send me your translation at SpigotMC
##### Japanese - Thanks to Sefyy for translating!
#message-when-using-chest: "&7ヒント: &6/chestsort&7 と入力して自動チェスト整理を有効にできます。"
#message-when-using-chest2: "&7ヒント: &6/chestsort&7 と入力すると自動チェスト整理を無効にできます。"
#message-sorting-disabled: "&7自動チェスト整理は現在 &cOFF&7です。"
#message-sorting-enabled: "&7自動チェスト整理は現在 &aON&7です。"
#message-inv-sorting-disabled: "&7Automatic inventory sorting has been &cdisabled&7."
#message-inv-sorting-enabled: "&7Automatic inventory sorting has been &aenabled&7."
#message-sorting-disabled: "&7自動チェスト整理は現在&c無効&7です。"
#message-sorting-enabled: "&7自動チェスト整理は現在&a有効&7です。"
#message-inv-sorting-disabled: "&7自動インベントリ整理は現在&c無効&7です。"
#message-inv-sorting-enabled: "&7自動インベントリ整理は現在&a有効&7です。"
#message-error-players-only: "&cエラー: このコマンドはプレイヤーのみ実行できます。"
#message-player-inventory-sorted: "&7Your inventory has been sorted."
#message-error-invalid-options: "&cError: Unknown option %s. Valid options are %s."
#message-gui-enabled: "&aEnabled"
#message-gui-disabled: "&cDisabled"
#message-gui-middle-click: "Middle-Click"
#message-gui-shift-click: "Shift + Click"
#message-gui-double-click: "Double-Click"
#message-gui-shift-right-click: "Shift + Right-Click"
#message-gui-left-click: "Fill Chest (Left-Click)"
#message-gui-right-click: "Empty Chest (Right-Click)"
#message-player-inventory-sorted: "&7あなたのインベントリは整理されました。"
#message-error-invalid-options: "&cエラー: 不明なオプションです%s 有効なオプションは%s"
#message-gui-enabled: "&a有効"
#message-gui-disabled: "&c無効"
#message-gui-middle-click: "ミドルクリック"
#message-gui-shift-click: "シフト+左クリック"
#message-gui-double-click: "ダブルクリック"
#message-gui-shift-right-click: "シフト+右クリック"
#message-gui-left-click: "チェストを埋める(左クリック)"
#message-gui-right-click: "チェストを空ける(右クリック)"
##### Korean (한국어) - Thanks to kf12 for translating!
##### Note: Some messages are still untranslated. Please send me your translation at SpigotMC

View File

@ -1,6 +1,6 @@
main: de.jeff_media.ChestSort.ChestSortPlugin
name: ChestSort
version: 8.8-pre1
version: 8.8
api-version: 1.13
description: Allows automatic chest sorting
author: mfnalex