Skip to content

Commit

Permalink
* Added the "balance-command-usage" message to the "lang.yml" file.
Browse files Browse the repository at this point in the history
* Added a couple "Nullable" annotations to some methods within the "Shop", "Manager", and "PacketManager" classes.

* Added the "toString" method to the "PacketManager" class.

Signed-off-by: BuildTools <[email protected]>
  • Loading branch information
XZot1K authored and BuildTools committed Dec 15, 2022
1 parent 5c34e8e commit f39c688
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 14 deletions.
13 changes: 7 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@

<modelVersion>4.0.0</modelVersion>

<groupId>dev.zotware.displayshops</groupId>
<groupId>xzot1k.plugins.ds</groupId>
<artifactId>DisplayShopsAPI</artifactId>
<name>DisplayShopsAPI</name>
<version>1.3.8</version>
<version>1.3.9</version>
<packaging>jar</packaging>

<properties>
<maven.compiler.source>8</maven.compiler.source>
Expand All @@ -21,7 +22,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<version>3.10.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
Expand All @@ -31,7 +32,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.4</version>
<version>3.3.0</version>
<executions>
<execution>
<phase>package</phase>
Expand Down Expand Up @@ -68,14 +69,14 @@
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.19-R0.1-SNAPSHOT</version>
<version>1.19.3-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
<version>23.0.0</version>
<scope>compile</scope>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.github.MilkBowl</groupId>
Expand Down
9 changes: 2 additions & 7 deletions src/main/java/xzot1k/plugins/ds/api/Manager.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,10 @@
import org.bukkit.potion.PotionType;
import org.bukkit.util.Vector;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import xzot1k.plugins.ds.api.enums.ChatInteractionType;
import xzot1k.plugins.ds.api.enums.EconomyCallType;
import xzot1k.plugins.ds.api.events.EconomyCallEvent;
import xzot1k.plugins.ds.api.handlers.ActionBarHandler;
import xzot1k.plugins.ds.api.handlers.ParticleHandler;
import xzot1k.plugins.ds.api.objects.DataPack;
import xzot1k.plugins.ds.api.objects.MarketRegion;
import xzot1k.plugins.ds.api.objects.Shop;
Expand Down Expand Up @@ -427,7 +426,7 @@ EconomyCallEvent initiateShopEconomyTransaction(@NotNull Player investor, @NotNu
* @param amount The amount of the item stack.
* @return The shop creation physical item stack.
*/
ItemStack buildShopCreationItem(@NotNull Player player, int amount);
ItemStack buildShopCreationItem(@Nullable Player player, int amount);

/**
* Builds and returns the shop currency item.
Expand Down Expand Up @@ -492,10 +491,6 @@ EconomyCallEvent initiateShopEconomyTransaction(@NotNull Player investor, @NotNu
// getters & setters
Map<UUID, Shop> getShopMap();

ParticleHandler getParticleHandler();

ActionBarHandler getActionBarHandler();

List<MarketRegion> getMarketRegions();

Map<UUID, DataPack> getDataPackMap();
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/xzot1k/plugins/ds/api/PacketManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ public interface PacketManager {

SerializeUtil getSerializeUtil();

String toString(@NotNull ItemStack itemStack);

ItemStack toItem(@NotNull String itemString);

String toJSON(@NotNull ItemStack itemStack);
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/xzot1k/plugins/ds/api/objects/Shop.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import xzot1k.plugins.ds.api.enums.EconomyCallType;

import java.util.List;
Expand Down Expand Up @@ -290,7 +291,7 @@ public interface Shop {
*
* @param currentEditor The unique ID of the player editing.
*/
void setCurrentEditor(@NotNull UUID currentEditor);
void setCurrentEditor(@Nullable UUID currentEditor);

/**
* Resets the shop entirely. The time stamp is also updated.
Expand Down
7 changes: 7 additions & 0 deletions src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ mysql:
# immediately after all packets are sent out and managed. This will resolve the increasing memory usage until garbage collection automates later on.
run-gc-immediately: true

# When shops are loaded or the cleanup command is executed all shops with owners that have been in-active for
# this amount of time (in seconds) will be deleted.
clean-inactive-duration: -1

# These will completely determine how piston protection is handled.
piston-protection:
# This option determines if piston protection should even be used (WARNING: base-block will be damaged if pushed/retracted, if disabled).
Expand Down Expand Up @@ -146,6 +150,9 @@ empty-shop-item: true
# If this option is enabled, shops will use the owner's balance instead of the stored balance when they are online.
sync-owner-balance: false

# This cooldown acts as a delay between performing a buy/sell action within the transaction menu as an attempt to prevent auto-clicking.
transaction-cooldown: 1

# This is the price the player must pay to get a shop creation item.
creation-item-price: 250

Expand Down
1 change: 1 addition & 0 deletions src/main/resources/lang.yml
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ notify-toggle-off: "&aShop sale notifications have been &eDisabled &afor you."
visit-filter-prompt: "&aPlease enter the shop's item name and/or material type to find matches (Type &e{cancel} &ato cancel):"
visit-filter-count: "&aFound &e{count} &ashop results with &e{filter} &ain either the name, description, type, and/or price!"
visit-filter-none: "&cNo shops contain &e{filter} &cin their name, description, type, and/or price."
balance-command-usage: "&cUsage: &e/displayshops balance <deposit|withdraw> <amount>"

## Hook Messages ##
towny-no-access: "&cYou do not have access to this shop plot."
Expand Down

0 comments on commit f39c688

Please sign in to comment.