Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion .changelog/6.2.0.11.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,16 @@
- Wildcard patterns like *_AXE and *_SPAWN_EGG now work in blacklist configuration
- Supports * for any characters and ? for single character matching
- Case-insensitive pattern matching
- Overhauled GUI system(thanks to Yusakidev)
- Implemented gui.yml configuration file for customizing the GUI.
- Implemented better filtering for qs browse
- Implement GUI system to be more stable, and less error prone.
- Added gui.yml for fully configurable GUI layouts and text
- Browse menu: search, sort (price/name/stock), and filter (all/buying/selling/in-stock)
- Staff menu: search functionality for player/staff selection
- Grouped item pages for better shop browsing
- Refactored all menu pages to use configurable display/lore
- Moved GUI messages from messages.yml to gui.yml

## Addons/Compats Changes
- Added UltimateClaims compat
Expand Down Expand Up @@ -88,6 +98,9 @@
- Deprecated the ShopType enum, and the ShopTypeEvent. These are replaced with the new IShopType interface, and implementing classes.
- The new event is ShopTypeEnhancedEvent.
- This allows for third-party addons to add their own shop types, and simplifies code checks for translations.
- Updated config system to use Boosted-yaml
- this allows for auto-updating of config files without complex update scripts
- this also allows for the config system to not be minecraft-dependent.

## Minor Changes
- Bump Java version up to 21
Expand All @@ -97,6 +110,8 @@
- Bumped Residence version for the compat(thanks to YuanYuanOwO)
- add world whitelist support(thanks to wling-art)
- added /qs database save command, which saves all currently dirty-marked shops to the database.
- Split up interactions _SHOPBLOCK into _SHOPBLOCK and _CONTAINER.
- _SHOPBLOCK relates to shops, where _CONTAINER relates to shop-valid containers that are not currently shops.

## Fixes
- Fixes issue with item price restrictions(thanks to maxcom1)
Expand All @@ -114,4 +129,9 @@
- Fixed issue with 1.20.4 packetevents virtual displays not staying put.
- Fixes critical issue in GriefPrevention compatibility plugin.
- Fixes issue with shop owner not getting money when benefits active.
- Fixes for lands addon on folia, Use regionThread for Folia compatibility(thanks to YusakiDev)
- Fixes for lands addon on folia, Use regionThread for Folia compatibility(thanks to YusakiDev)
- Fixes for TRADE_DIRECT on stacking shops
- Fixes issue for protocollib 5.4.0 with undocumented packet changes.
- Fixes issue where item stacks could be used on creation above the max stack size.
- Fixes issue with BukkitAudiences-related crashes on 1.21.11.
- Fix issue with shop deletion when getting too impatient.
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public DisplayControlDatabaseHelper getDatabaseHelper() {
}

@Override
public void onPluginMessageReceived(@NotNull final String channel, @NotNull final Player player, final byte @NotNull [] message) {
public void onPluginMessageReceived(@NotNull final String channel, @NotNull final Player player, final @NotNull byte[] message) {

if(!channel.equalsIgnoreCase(BUNGEE_CHANNEL)) {
return;
Expand Down
12 changes: 5 additions & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,15 @@
<depend.adventure-platform-facet>4.3.4</depend.adventure-platform-facet>
<depend.adventure-platform-viaversion>4.3.4</depend.adventure-platform-viaversion>
<depend.adventure-text-serializer-bungeecord>4.3.4</depend.adventure-text-serializer-bungeecord>
<depend.boosted>1.3.7</depend.boosted>
<depend.commons.lang3>3.18.0</depend.commons.lang3>
<depend.easy>0.4.7</depend.easy>
<depend.examination-api>1.3.0</depend.examination-api>
<depend.examination-string>1.3.0</depend.examination-string>
<depend.nbtapi>2.15.0</depend.nbtapi>
<depend.packetevents>2.9.0-SNAPSHOT</depend.packetevents>
<depend.paper>1.21-R0.1-SNAPSHOT</depend.paper>
<depend.protocollib>5.3.0</depend.protocollib>
<depend.protocollib>5.4.0</depend.protocollib>
<depend.vault>1.7.1</depend.vault>
<depend.vaultunlocked>2.13</depend.vaultunlocked>

Expand Down Expand Up @@ -213,6 +214,7 @@
<include>io.vertx:vertx-core:*</include>
<include>io.vertx:vertx-web:*</include>
<include>org.eclipse.aether:*:*</include>
<include>dev.dejvokep:boosted-yaml</include>
<include>org.slf4j:slf4j-jdk14:*</include>
<include>cc.carm.lib:*</include>
<include>com.rollbar:*</include>
Expand Down Expand Up @@ -427,12 +429,6 @@
<version>1.18.38</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
<version>26.0.2</version>
<scope>provided</scope>
</dependency>
<!-- SLF4J is a real dickhead. -->
<dependency>
<groupId>org.slf4j</groupId>
Expand All @@ -457,6 +453,8 @@
<dependency>
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
<version>26.0.2-1</version>
<scope>provided</scope>
</dependency>
</dependencies>

Expand Down
24 changes: 24 additions & 0 deletions quickshop-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@
<packaging>takari-jar</packaging>

<dependencies>
<dependency>
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
<version>26.0.2-1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.ghostchu</groupId>
<artifactId>quickshop-common</artifactId>
Expand All @@ -23,6 +29,24 @@
<groupId>io.papermc.paper</groupId>
<artifactId>paper-api</artifactId>
<version>${depend.paper}</version>
<exclusions>
<exclusion>
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>dev.dejvokep</groupId>
<artifactId>boosted-yaml</artifactId>
<version>1.3.7</version>
<scope>compile</scope>
<exclusions>
<exclusion>
<groupId>org.jetbrains</groupId>
<artifactId>annotations-java5</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
package com.ghostchu.quickshop.api.config;

/*
* QuickShop-Hikari
* Copyright (C) 2025 Daniel "creatorfromhell" Vidmar
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import com.ghostchu.quickshop.api.QuickShopAPI;
import dev.dejvokep.boostedyaml.YamlDocument;
import dev.dejvokep.boostedyaml.settings.Settings;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.net.URLConnection;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
* QSConfig
*
* @author creatorfromhell
* @since 6.2.0.11
*/
public class QSConfig {

protected final String fileName;
protected final File file;
protected final String defaults;
protected final List<String> nodes = new ArrayList<>();
protected YamlDocument yaml;
protected Settings[] settings;

public QSConfig(final String fileName, final String defaults, final List<String> nodes, final Settings... settings) {

this.defaults = defaults;
this.fileName = fileName;
this.nodes.addAll(nodes);
file = new File(QuickShopAPI.getPluginInstance().getDataFolder(), fileName);

this.settings = settings;

if(!file.exists()) {
QuickShopAPI.getPluginInstance().getLogger().warning("Configuration doesn't exist! File Name:" + fileName);
}
}

public boolean load() {

try(final InputStream in = getResource(defaults)) {

if(in != null) {
this.yaml = YamlDocument.create(file, in, settings);

return true;
}
} catch(final IOException ignore) {

QuickShopAPI.getPluginInstance().getLogger().warning("Error while creating config \"" + file.getName() + "\".");
return false;
}
return false;
}

public YamlDocument getYaml() {

return yaml;
}

public void setYaml(final YamlDocument yaml) {

this.yaml = yaml;
}

public boolean save() {

try {

yaml.save(file);
return true;
} catch(final IOException ignore) {

QuickShopAPI.getPluginInstance().getLogger().warning("Error while saving config \"" + nodes.get(0) + "\".");
return false;
}
}

public void setComment(final String route, final List<String> comments) {

if(yaml.contains(route)) {
yaml.getBlock(route).setComments(comments);
}
}

public void setComment(final String route, final String comment) {

setComment(route, Collections.singletonList(comment));
}

public @Nullable InputStream getResource(@NotNull final String filename) {

try {
final URL url = this.getClass().getClassLoader().getResource(filename);
if(url == null) {
return null;
} else {

final URLConnection connection = url.openConnection();
connection.setUseCaches(false);

return connection.getInputStream();
}
} catch(final IOException ignore) {
return null;
}
}
}
6 changes: 6 additions & 0 deletions quickshop-bukkit/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,12 @@
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
<version>26.0.2-1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.papermc.paper</groupId>
<artifactId>paper-api</artifactId>
Expand Down
Loading