Skip to content

Commit

Permalink
iShop 2.26 Update Part 2
Browse files Browse the repository at this point in the history
  • Loading branch information
Beez0r committed Jul 13, 2024
1 parent 9ca491d commit deb34d3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/com/minedhype/ishop/CommandShop.java
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ else if(args[0].equalsIgnoreCase("view") && args.length >= 2)

private void listSubCmd(Player player, String label) {
player.sendMessage(ChatColor.GOLD + "iShop Commands:");
player.sendMessage(ChatColor.GRAY + "/" + label + " copy <shop id>");
player.sendMessage(ChatColor.GRAY + "/" + label + " copy <id>");
player.sendMessage(ChatColor.GRAY + "/" + label + " count <item>");
player.sendMessage(ChatColor.GRAY + "/" + label + " create");
player.sendMessage(ChatColor.GRAY + "/" + label + " delete");
Expand Down
4 changes: 2 additions & 2 deletions src/com/minedhype/ishop/Shop.java
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ public static void findItem(Player player, ItemStack item, String itemName) {
if(row.isPresent() && !foundItemInShop.get()) {
boolean itemMatch = row.get().getItemOut().isSimilar(item);
boolean itemMatch2 = row.get().getItemOut2().isSimilar(item);
if(((itemMatch && itemMatch2) && Utils.hasDoubleItemStock(s, item, item)) || ((itemMatch && !itemMatch2) && Utils.hasStock(s, row.get().getItemOut2())) || ((!itemMatch && itemMatch2) && Utils.hasStock(s, row.get().getItemOut()))) {
if(((itemMatch && itemMatch2) && Utils.hasDoubleItemStock(s, row.get().getItemOut(), row.get().getItemOut2())) || ((itemMatch && !itemMatch2) && Utils.hasStock(s, row.get().getItemOut())) || ((!itemMatch && itemMatch2) && Utils.hasStock(s, row.get().getItemOut2()))) {
foundItem.set(true);
foundItemInShop.set(true);
player.sendMessage(Messages.SHOP_LOCATION.toString().replaceAll("%id", String.valueOf(s.idTienda)).replaceAll("%x", String.valueOf(s.location.getBlockX())).replaceAll("%y", String.valueOf(s.location.getBlockY())).replaceAll("%z", String.valueOf(s.location.getBlockZ())).replaceAll("%world", s.location.getWorld().getName()));
Expand Down Expand Up @@ -728,7 +728,7 @@ public static void loadData() {
invOut2.setContents(decodeByte(blob.getBinaryStream()));
}
catch(Exception e) { invOut2.addItem(airItem); }
rows[index] = new RowStore(invIn.getItem(0), invIn2.getItem(0), invOut.getItem(0), invOut2.getItem(0), broadcast);
rows[index] = new RowStore(invOut.getItem(0), invOut2.getItem(0), invIn.getItem(0), invIn2.getItem(0), broadcast);
}
} catch(Exception e) {
e.printStackTrace();
Expand Down
7 changes: 6 additions & 1 deletion src/com/minedhype/ishop/inventories/InvShopList.java
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,14 @@ private static void getShopList(UUID uuid) {
ItemStack item = new ItemStack(playerHead);
SkullMeta skullMeta = (SkullMeta) item.getItemMeta();
OfflinePlayer offlinePlayer = Bukkit.getOfflinePlayer(Shop.shopList.get(id));
skullMeta.setOwningPlayer(offlinePlayer);
boolean playerNotFound = false;
try {
skullMeta.setOwningPlayer(offlinePlayer); }
catch(Exception e) { playerNotFound = true; }
if(Shop.getShopById(id).get().isAdmin())
skullMeta.setDisplayName(Messages.ADMIN_SHOP_NUMBER.toString().replaceAll("%id", id.toString()));
else if(playerNotFound)
skullMeta.setDisplayName(Messages.SHOP_NUMBER.toString().replaceAll("%player", "Unknown Player").replaceAll("%id", id.toString()));
else
skullMeta.setDisplayName(Messages.SHOP_NUMBER.toString().replaceAll("%player", offlinePlayer.getName()).replaceAll("%id", id.toString()));
List<String> skullLore = new ArrayList<>();
Expand Down

0 comments on commit deb34d3

Please sign in to comment.