Skip to content

Commit

Permalink
Bug Fixes + 2.2.5
Browse files Browse the repository at this point in the history
- Fixed SHOP_BAD_COLOUR bug
- Fix for filled shulker duplication bug
  • Loading branch information
KillerOfPie committed Oct 28, 2020
1 parent 3bc59df commit 7026bd4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

<groupId>org.shanerx</groupId>
<artifactId>tradeshop</artifactId>
<version>2.2.4-STABLE</version>
<version>2.2.5-STABLE</version>
<packaging>jar</packaging>
<name>TradeShop</name>
<url>https://tradeshop.github.io/</url>
Expand Down
21 changes: 13 additions & 8 deletions src/main/java/org/shanerx/tradeshop/utils/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ public boolean canExchange(Inventory inv, ItemStack itmOut, ItemStack itmIn) {
* @param shop Shoptype enum to get header
*/
public void failedSignReset(SignChangeEvent e, ShopType shop) {
e.setLine(0, colorize(Setting.SHOP_BAD_COLOUR + shop.toString()));
e.setLine(0, colorize(Setting.SHOP_BAD_COLOUR.getString() + shop.toString()));
e.setLine(1, "");
e.setLine(2, "");
e.setLine(3, "");
Expand Down Expand Up @@ -495,7 +495,11 @@ public ArrayList<ItemStack> getItems(Inventory inventory, List<ShopItemStack> it
ret.add(itm);
currentCount++;
}

debugger.log("ShopTradeListener > CurrentCount: " + currentCount, DebugLevels.TRADE);
}

if (currentCount >= totalCount) break;
}
} else {
int count = item.getItemStack().getAmount() * multiplier, traded;
Expand Down Expand Up @@ -548,20 +552,21 @@ public ArrayList<ItemStack> getItems(Inventory inventory, List<ShopItemStack> it
}

public boolean compareShulkers(ItemStack item1, ItemStack item2) {

if (item1 == null || item2 == null)
return false;

try {
ArrayList<ItemStack> contents1 = Lists.newArrayList(((ShulkerBox) ((BlockStateMeta) item1.getItemMeta()).getBlockState()).getInventory().getContents());
ShulkerBox shulker2 = (ShulkerBox) ((BlockStateMeta) item2.getItemMeta()).getBlockState();
ArrayList<ItemStack> contents1 = Lists.newArrayList(((ShulkerBox) ((BlockStateMeta) item1.clone().getItemMeta()).getBlockState()).getInventory().getContents());
ShulkerBox shulker2 = (ShulkerBox) ((BlockStateMeta) item2.clone().getItemMeta()).getBlockState();

for (ItemStack itm : shulker2.getInventory().getContents()) {
contents1.remove(itm);
}
for (ItemStack itm : shulker2.getInventory().getContents()) {
contents1.remove(itm);
}

return contents1.isEmpty();
return contents1.isEmpty();

} catch (ClassCastException ex) {
} catch (ClassCastException ex) {
return false;
}
}
Expand Down

0 comments on commit 7026bd4

Please sign in to comment.