diff --git a/.changelog/SNAPSHOTS/6.3.0.0-SNAPSHOT-11.md b/.changelog/SNAPSHOTS/6.3.0.0-SNAPSHOT-11.md index b02df06dbd..3edf2f946f 100644 --- a/.changelog/SNAPSHOTS/6.3.0.0-SNAPSHOT-11.md +++ b/.changelog/SNAPSHOTS/6.3.0.0-SNAPSHOT-11.md @@ -9,4 +9,13 @@ - "TROPICAL_FISH/BASE_COLOR" ## Internal Changes -- Adjusted trade ui to use a stock variable instead of the cache, this should fix issues where stock information was sometimes inaccurate while not sacrificing performance. \ No newline at end of file +- Adjusted trade ui to use a stock variable instead of the cache, this should fix issues where stock information was sometimes inaccurate while not sacrificing performance. +- A very minor improvement in the find subcommand, skips doing a sqrt and playerAuthorize test for shops that are outside of the max distance.(Thanks to Warriorrrr) + +## Bug Fixes +- Corrected UI not showing correct items for potions and books +- Fixed issue where display-type 3 wasn't showing on rejoin +- Fixed issue with lower MC versions not being compatible with 6.3.0.0 +- Fixed issue iwth lower versions of MC and protocollib not working. +- Fixed an issue where a warning was thrown during the first database initialization.(Thanks to YuanYuanOwO) +- Fix shop preview locales being sticky(Thanks to Warriorrrr) diff --git a/.github/workflows/snapshot-gh-release.yml b/.github/workflows/snapshot-gh-release.yml index 4594ad37a5..7b5462f5c0 100644 --- a/.github/workflows/snapshot-gh-release.yml +++ b/.github/workflows/snapshot-gh-release.yml @@ -4,7 +4,7 @@ on: workflow_dispatch: inputs: snapshot_tag: - description: "Snapshot tag/version, example: snapshot/6.3.0.0-8" + description: "Snapshot tag/version, example: snapshot/6.3.0.0-SNAPSHOT-8" required: true type: string diff --git a/addon/reremake-migrator/pom.xml b/addon/reremake-migrator/pom.xml index 07c50fb0e5..b0f81fc4e9 100644 --- a/addon/reremake-migrator/pom.xml +++ b/addon/reremake-migrator/pom.xml @@ -38,7 +38,7 @@ org.apache.maven.plugins maven-shade-plugin - 3.6.0 + 3.6.2 package diff --git a/pom.xml b/pom.xml index 102e9c92b3..43483f2a95 100644 --- a/pom.xml +++ b/pom.xml @@ -202,7 +202,7 @@ org.apache.maven.plugins maven-shade-plugin - 3.6.0 + 3.6.2 package @@ -396,7 +396,7 @@ io.takari.maven.plugins takari-lifecycle-plugin - 2.3.3 + 2.3.4 true proc @@ -459,7 +459,7 @@ org.projectlombok lombok - 1.18.38 + 1.18.46 provided diff --git a/quickshop-bukkit/pom.xml b/quickshop-bukkit/pom.xml index 139dbe02c3..b87c87dc2d 100644 --- a/quickshop-bukkit/pom.xml +++ b/quickshop-bukkit/pom.xml @@ -13,7 +13,7 @@ 1.7.0.1-SNAPSHOT-5 - 0.1.3.1-SNAPSHOT-1 + 0.2.0.0-SNAPSHOT-3 quickshop-bukkit diff --git a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/menu/keeper/MainPage.java b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/menu/keeper/MainPage.java index 2fdc3dc031..bd7da3affc 100644 --- a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/menu/keeper/MainPage.java +++ b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/menu/keeper/MainPage.java @@ -124,15 +124,6 @@ public void open(final PageOpenCallback open) { final ItemStack shopItem = shop.get().getItem(); final int shopItemSlot = shopItemConfig != null? shopItemConfig.getSlot() : 4; final AbstractItemStack shopItemStack = QuickShop.getInstance().stack(shopItem); - if(shopItem.getItemMeta() instanceof final EnchantmentStorageMeta enchantmentStorageMeta) { - - final LinkedList lore = new LinkedList<>(); - for(final Map.Entry entry : enchantmentStorageMeta.getStoredEnchants().entrySet()) { - - lore.add(Util.enchantmentDataToComponent(entry.getKey(), entry.getValue())); - } - shopItemStack.lore(lore); - } open.getPage().addIcon(new IconBuilder(shopItemStack).withSlot(shopItemSlot).build()); // Always read price directly from shop to get the latest value diff --git a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/menu/trade/MainPage.java b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/menu/trade/MainPage.java index 6f1dab17c8..9b10be1dd9 100644 --- a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/menu/trade/MainPage.java +++ b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/menu/trade/MainPage.java @@ -97,7 +97,6 @@ public void handle(final PageOpenCallback open) { // Set up our borders from config (gray for modern look) final String borderMaterial = (borderConfig != null)? borderConfig.getMaterial() : "GRAY_STAINED_GLASS_PANE"; final IconBuilder borderBuilder = new IconBuilder(QuickShop.getInstance().stack().of(borderMaterial, 1)); - // Get border rows from config or use defaults (rows 1, 4, 6 for modern 6-row layout) final List borderRows = (borderConfig != null)? borderConfig.getRows() : List.of(1, 4, 6); for(final int row : borderRows) { @@ -128,15 +127,6 @@ public void handle(final PageOpenCallback open) { final int shopItemSlot = (shopItemConfig != null)? shopItemConfig.getSlot() : 13; final AbstractItemStack shopItemStack = QuickShop.getInstance().stack(shopItem); - if(shopItem.getItemMeta() instanceof final EnchantmentStorageMeta enchantmentStorageMeta) { - - final LinkedList lore = new LinkedList<>(); - for(final Map.Entry entry : enchantmentStorageMeta.getStoredEnchants().entrySet()) { - - lore.add(Util.enchantmentDataToComponent(entry.getKey(), entry.getValue())); - } - shopItemStack.lore(lore); - } open.getPage().addIcon(new IconBuilder(shopItemStack).withSlot(shopItemSlot).build()); diff --git a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/ContainerShop.java b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/ContainerShop.java index a6549f25c2..f90adefe09 100644 --- a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/ContainerShop.java +++ b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/ContainerShop.java @@ -354,6 +354,7 @@ public void checkDisplay() { return; } } + if(this.displayItem != null) { if(!this.displayItem.isSpawned()) { /* Not spawned yet. */ diff --git a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/display/display/DisplayEntityDisplayItem.java b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/display/display/DisplayEntityDisplayItem.java index a8eac3f866..4f028e7650 100644 --- a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/display/display/DisplayEntityDisplayItem.java +++ b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/display/display/DisplayEntityDisplayItem.java @@ -41,6 +41,8 @@ import org.joml.AxisAngle4f; import org.joml.Vector3f; +import java.util.concurrent.TimeUnit; + import static com.ghostchu.quickshop.shop.display.display.DisplayEntityItemManager.DISPLAY_ITEM_KEY_INSTANCE; /** @@ -215,7 +217,6 @@ public void remove(final boolean dontTouchWorld) { } if (isSpawned()) { - isSpawned = false; if(QuickShop.getInstance().getDisplayManager() instanceof DisplayEntityItemManager) { @@ -293,7 +294,10 @@ public void spawn() { } initEntities(); - sendFakeItemToAll(); + //sendFakeItemToAll(); + QuickShop.folia().getScheduler().runAtLocationLater(getDisplayLocation(), task -> { + sendFakeItemToAll(); + }, 1, TimeUnit.SECONDS); isSpawned = true; } @@ -311,6 +315,7 @@ public void sendFakeItemToPlayer(final Player player) { public void sendFakeItemToAll() { for(final Player player : Bukkit.getOnlinePlayers()) { + player.showEntity(QuickShop.getInstance().getJavaPlugin(), itemDisplay); player.showEntity(QuickShop.getInstance().getJavaPlugin(), interactionEntity); diff --git a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/display/display/DisplayEntityItemManager.java b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/display/display/DisplayEntityItemManager.java index 9f25f85186..93d524d53c 100644 --- a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/display/display/DisplayEntityItemManager.java +++ b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/display/display/DisplayEntityItemManager.java @@ -103,14 +103,19 @@ public DisplayEntityDisplayItem create(@NotNull final Shop shop) { final ShopChunk chunk = SimpleShopChunk.fromLocation(shop.bukkitLocation()); - return chunksMapping - .computeIfAbsent(chunk, k -> new ConcurrentHashMap<>()) + //output if display is in chunks map + + return chunksMapping.computeIfAbsent(chunk, k -> new ConcurrentHashMap<>()) .computeIfAbsent(shop.bukkitLocation().hashCode(), k -> new DisplayEntityDisplayItem(shop, chunk)); } public void addPlayer(final Player player) { - chunksMapping.values().forEach(map ->map.values().forEach(display -> display.sendFakeItemToPlayer(player))); + final ShopChunk chunk = SimpleShopChunk.fromLocation(player.getLocation()); + chunksMapping.computeIfPresent(chunk, (k, v) -> { + v.values().forEach(display -> display.sendFakeItemToPlayer(player)); + return v; + }); } } \ No newline at end of file diff --git a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/display/virtual/packet/protocollib/PacketFactoryv1_20.java b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/display/virtual/packet/protocollib/PacketFactoryv1_20.java index 0047372c53..b69a1c7360 100644 --- a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/display/virtual/packet/protocollib/PacketFactoryv1_20.java +++ b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/display/virtual/packet/protocollib/PacketFactoryv1_20.java @@ -171,9 +171,6 @@ public PacketContainer createTextDisplaySpawnPacket(final int id, @NotNull final packet.getDoubles().write(0, location.getX()); packet.getDoubles().write(1, location.getY()); packet.getDoubles().write(2, location.getZ()); - - packet.getIntegers().write(4, 0); - packet.getIntegers().write(5, 0); return packet; } diff --git a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/display/virtual/packet/protocollib/PacketFactoryv1_21.java b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/display/virtual/packet/protocollib/PacketFactoryv1_21.java index fbe72d15d3..e31f9a7854 100644 --- a/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/display/virtual/packet/protocollib/PacketFactoryv1_21.java +++ b/quickshop-bukkit/src/main/java/com/ghostchu/quickshop/shop/display/virtual/packet/protocollib/PacketFactoryv1_21.java @@ -174,9 +174,6 @@ public PacketContainer createTextDisplaySpawnPacket(final int id, @NotNull final packet.getDoubles().write(0, location.getX()); packet.getDoubles().write(1, location.getY()); packet.getDoubles().write(2, location.getZ()); - - packet.getIntegers().write(4, 0); - packet.getIntegers().write(5, 0); return packet; } diff --git a/quickshop-bukkit/src/main/resources/config.yml b/quickshop-bukkit/src/main/resources/config.yml index c68b07da1c..ed94de6732 100644 --- a/quickshop-bukkit/src/main/resources/config.yml +++ b/quickshop-bukkit/src/main/resources/config.yml @@ -339,7 +339,6 @@ limits: shop-blocks: - CHEST - TRAPPED_CHEST - - ENDER_CHEST - BARREL shop: