Skip to content

Commit

Permalink
✨ update flight & v2.17.0
Browse files Browse the repository at this point in the history
Took 3 minutes
  • Loading branch information
kiranhart committed Jun 14, 2024
1 parent 70a648b commit c29e96c
Show file tree
Hide file tree
Showing 32 changed files with 169 additions and 195 deletions.
44 changes: 22 additions & 22 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@

<name>Markets</name>
<description>A new take on traditional player owned shops</description>
<version>2.16.0</version>
<version>2.17.0</version>
<packaging>jar</packaging>

<properties>
<author>Kiran Hart</author>
<jarName>${project.name}</jarName>
<main.class>${project.groupId}.${project.artifactId}.${project.name}</main.class>
<java.version>16</java.version>
<flight.version>3.19.0</flight.version>
<flight.version>3.21.0</flight.version>
<flight.path>ca.tweetzy</flight.path>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
Expand Down Expand Up @@ -213,26 +213,26 @@
</execution>
</executions>
</plugin>
<!-- <plugin>-->
<!-- <groupId>org.apache.maven.plugins</groupId>-->
<!-- <artifactId>maven-antrun-plugin</artifactId>-->
<!-- <version>1.7</version>-->
<!-- <executions>-->
<!-- <execution>-->
<!-- <phase>test</phase>-->
<!-- <goals>-->
<!-- <goal>run</goal>-->
<!-- </goals>-->
<!-- <configuration>-->
<!-- <tasks>-->
<!-- <delete>-->
<!-- <fileset dir="C:\Dev\Minecraft\latest\plugins\Markets\locales" includes="*.yml"/>-->
<!-- </delete>-->
<!-- </tasks>-->
<!-- </configuration>-->
<!-- </execution>-->
<!-- </executions>-->
<!-- </plugin>-->
<!-- <plugin>-->
<!-- <groupId>org.apache.maven.plugins</groupId>-->
<!-- <artifactId>maven-antrun-plugin</artifactId>-->
<!-- <version>1.7</version>-->
<!-- <executions>-->
<!-- <execution>-->
<!-- <phase>test</phase>-->
<!-- <goals>-->
<!-- <goal>run</goal>-->
<!-- </goals>-->
<!-- <configuration>-->
<!-- <tasks>-->
<!-- <delete>-->
<!-- <fileset dir="C:\Dev\Minecraft\latest\plugins\Markets\locales" includes="*.yml"/>-->
<!-- </delete>-->
<!-- </tasks>-->
<!-- </configuration>-->
<!-- </execution>-->
<!-- </executions>-->
<!-- </plugin>-->
</plugins>
<resources>
<resource>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import ca.tweetzy.markets.api.Navigable;
import ca.tweetzy.markets.settings.Translations;

public enum MarketSortType implements Navigable<MarketSortType> {
public enum MarketSortType implements Navigable<MarketSortType> {

NAME,
REVIEWS,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@

import ca.tweetzy.flight.utils.ItemUtil;
import ca.tweetzy.markets.Markets;
import ca.tweetzy.markets.api.*;
import ca.tweetzy.markets.api.Identifiable;
import ca.tweetzy.markets.api.Storeable;
import ca.tweetzy.markets.api.Synchronize;
import ca.tweetzy.markets.api.SynchronizeResult;
import ca.tweetzy.markets.api.currency.AbstractCurrency;
import ca.tweetzy.markets.api.currency.TransactionResult;
import ca.tweetzy.markets.settings.Settings;
Expand Down
12 changes: 6 additions & 6 deletions src/main/java/ca/tweetzy/markets/commands/CommandAdd.java
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,12 @@ protected List<String> tab(CommandSender sender, String... args) {
return List.of("1.00", "5.00", "10.00", "15.00", "20.00");

if (args.length > 2) {
if (Settings.DISABLE_WHOLESALE.getBoolean()) {
return List.of("-nooffers");
} else {
return List.of("-wholesale", "-nooffers");
}
}
if (Settings.DISABLE_WHOLESALE.getBoolean()) {
return List.of("-nooffers");
} else {
return List.of("-wholesale", "-nooffers");
}
}

return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ protected ReturnType execute(CommandSender sender, String... args) {


// open main menu
switch(args[1].toLowerCase()) {
switch (args[1].toLowerCase()) {
case "openmain":
Markets.getGuiManager().showGUI(target, new MarketsMainGUI(target));
break;
Expand Down
7 changes: 1 addition & 6 deletions src/main/java/ca/tweetzy/markets/commands/CommandDelete.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,11 @@
import ca.tweetzy.markets.Markets;
import ca.tweetzy.markets.api.SynchronizeResult;
import ca.tweetzy.markets.api.market.core.Market;
import ca.tweetzy.markets.api.market.core.MarketItem;
import ca.tweetzy.markets.gui.shared.view.content.MarketViewGUI;
import ca.tweetzy.markets.gui.user.market.MarketOverviewGUI;
import ca.tweetzy.markets.settings.Translations;
import org.bukkit.Bukkit;
import org.bukkit.OfflinePlayer;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;

Expand All @@ -33,7 +28,7 @@ protected ReturnType execute(CommandSender sender, String... args) {
}// 0 1 2


OfflinePlayer target = Bukkit.getPlayerExact(args[0]);
OfflinePlayer target = Bukkit.getPlayerExact(args[0]);

if (target == null) {
// try again with offline user list
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/ca/tweetzy/markets/commands/CommandOffers.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ public CommandOffers() {

@Override
protected ReturnType execute(CommandSender sender, String... args) {
if (sender instanceof final Player player) {
if (Settings.DISABLE_OFFERS.getBoolean()) {
Common.tell(player, TranslationManager.string(player, Translations.OFFERS_DISABLED));
return ReturnType.SUCCESS;
}
if (sender instanceof final Player player) {
if (Settings.DISABLE_OFFERS.getBoolean()) {
Common.tell(player, TranslationManager.string(player, Translations.OFFERS_DISABLED));
return ReturnType.SUCCESS;
}

Markets.getGuiManager().showGUI(player, new OffersGUI(null, player));
}
Expand Down
3 changes: 0 additions & 3 deletions src/main/java/ca/tweetzy/markets/commands/CommandReload.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,9 @@
import ca.tweetzy.flight.command.Command;
import ca.tweetzy.flight.command.ReturnType;
import ca.tweetzy.flight.utils.Common;
import ca.tweetzy.markets.Markets;
import ca.tweetzy.markets.gui.user.BankGUI;
import ca.tweetzy.markets.settings.Settings;
import ca.tweetzy.markets.settings.Translations;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;

import java.util.List;

Expand Down
1 change: 0 additions & 1 deletion src/main/java/ca/tweetzy/markets/gui/MarketsPagedGUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import ca.tweetzy.flight.gui.Gui;
import ca.tweetzy.flight.gui.events.GuiClickEvent;
import ca.tweetzy.flight.gui.template.BaseGUI;
import ca.tweetzy.flight.gui.template.PagedGUI;
import ca.tweetzy.flight.settings.TranslationManager;
import ca.tweetzy.flight.utils.QuickItem;
import ca.tweetzy.markets.settings.Settings;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
package ca.tweetzy.markets.gui.shared;

import ca.tweetzy.flight.gui.template.BaseGUI;
import ca.tweetzy.flight.settings.TranslationManager;
import ca.tweetzy.flight.utils.Common;
import ca.tweetzy.flight.utils.QuickItem;
import ca.tweetzy.flight.utils.SkullUtils;
import ca.tweetzy.markets.Markets;
import ca.tweetzy.markets.api.market.core.Market;
import ca.tweetzy.markets.gui.MarketsBaseGUI;
Expand Down Expand Up @@ -46,7 +44,7 @@ protected void draw() {
// your market
setButton(Settings.GUI_MAIN_VIEW_ITEMS_YOUR_MARKET_SLOT.getInt(),
QuickItem
.of(SkullUtils.getSkull(this.player.getUniqueId()))
.of(this.player)
.hideTags(true)
.name(TranslationManager.string(player, Translations.GUI_MAIN_VIEW_ITEMS_YOUR_MARKET_NAME))
.lore(playerMarket == null ? TranslationManager.list(player, Translations.GUI_MAIN_VIEW_ITEMS_YOUR_MARKET_LORE_CREATE) : TranslationManager.list(player, Translations.GUI_MAIN_VIEW_ITEMS_YOUR_MARKET_LORE_VIEW))
Expand Down Expand Up @@ -82,7 +80,7 @@ protected void draw() {
setButton(Settings.GUI_MAIN_VIEW_ITEMS_PAYMENTS_SLOT.getInt(),
QuickItem
.of(Settings.GUI_MAIN_VIEW_ITEMS_PAYMENTS.getItemStack())
.hideTags(true) .name(TranslationManager.string(this.player, Translations.GUI_MAIN_VIEW_ITEMS_PAYMENTS_NAME))
.hideTags(true).name(TranslationManager.string(this.player, Translations.GUI_MAIN_VIEW_ITEMS_PAYMENTS_NAME))
.lore(TranslationManager.list(this.player, Translations.GUI_MAIN_VIEW_ITEMS_PAYMENTS_LORE, "left_click", TranslationManager.string(this.player, Translations.MOUSE_LEFT_CLICK)))
.make(), click -> click.manager.showGUI(click.player, new OfflinePaymentsGUI(new MarketsMainGUI(click.player), click.player)));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,10 @@ public boolean onResult(String string) {
return;
}

if (Settings.DISABLE_OFFERS.getBoolean()) {
Common.tell(player, TranslationManager.string(player, Translations.OFFERS_DISABLED));
return;
}
if (Settings.DISABLE_OFFERS.getBoolean()) {
Common.tell(player, TranslationManager.string(player, Translations.OFFERS_DISABLED));
return;
}

Markets.getOfferManager().create(
click.player,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@
import ca.tweetzy.flight.gui.events.GuiClickEvent;
import ca.tweetzy.flight.gui.helper.InventoryBorder;
import ca.tweetzy.flight.settings.TranslationManager;
import ca.tweetzy.flight.utils.ChatUtil;
import ca.tweetzy.flight.utils.Common;
import ca.tweetzy.flight.utils.QuickItem;
import ca.tweetzy.flight.utils.SkullUtils;
import ca.tweetzy.flight.utils.input.TitleInput;
import ca.tweetzy.markets.Markets;
import ca.tweetzy.markets.api.market.MarketSortType;
Expand All @@ -20,6 +18,7 @@
import ca.tweetzy.markets.settings.Translations;
import lombok.NonNull;
import org.apache.commons.lang3.StringUtils;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;

Expand Down Expand Up @@ -60,7 +59,7 @@ protected void prePopulate() {
@Override
protected ItemStack makeDisplayItem(Market market) {
return QuickItem
.of(SkullUtils.getSkull(market.getOwnerUUID()))
.of(Bukkit.getOfflinePlayer(market.getOwnerUUID()))
.name(market.getDisplayName())
.lore(market.getDescription())
.lore(TranslationManager.list(this.player, Translations.GUI_ALL_MARKETS_ITEMS_MARKET_LORE,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import ca.tweetzy.flight.gui.events.GuiClickEvent;
import ca.tweetzy.flight.settings.TranslationManager;
import ca.tweetzy.flight.utils.QuickItem;
import ca.tweetzy.flight.utils.SkullUtils;
import ca.tweetzy.flight.utils.TimeUtil;
import ca.tweetzy.markets.Markets;
import ca.tweetzy.markets.api.market.core.MarketUser;
Expand All @@ -14,6 +13,7 @@
import ca.tweetzy.markets.settings.Translations;
import lombok.NonNull;
import org.apache.commons.lang3.StringUtils;
import org.bukkit.Bukkit;
import org.bukkit.OfflinePlayer;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
Expand Down Expand Up @@ -51,7 +51,7 @@ protected void drawFixed() {
@Override
protected ItemStack makeDisplayItem(Rating rating) {
return QuickItem
.of(SkullUtils.getSkull(rating.getRaterUUID()))
.of(Bukkit.getOfflinePlayer(rating.getRaterUUID()))
.name(TranslationManager.string(player, Translations.GUI_USER_PROFILE_ITEMS_RATING_NAME, "rater_name", rating.getRaterName()))
.lore(TranslationManager.list(player, Translations.GUI_USER_PROFILE_ITEMS_RATING_LORE,
"rating_stars", StringUtils.repeat("★", rating.getStars()),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package ca.tweetzy.markets.gui.shared.view.content;

import ca.tweetzy.flight.utils.SkullUtils;
import ca.tweetzy.flight.gui.Gui;
import ca.tweetzy.flight.gui.events.GuiClickEvent;
import ca.tweetzy.flight.settings.TranslationManager;
Expand Down Expand Up @@ -69,9 +68,9 @@ protected ItemStack makeDisplayItem(MarketItem marketItem) {

item.lore(TranslationManager.list(this.player, Translations.GUI_MARKET_CATEGORY_VIEW_ITEMS_ITEM_LORE_BUY, "left_click", TranslationManager.string(this.player, Translations.MOUSE_LEFT_CLICK)));

if (!Settings.DISABLE_OFFERS.getBoolean() && marketItem.isAcceptingOffers()) {
item.lore(TranslationManager.list(this.player, Translations.GUI_MARKET_CATEGORY_VIEW_ITEMS_ITEM_LORE_MAKE_OFFER, "right_click", TranslationManager.string(this.player, Translations.MOUSE_RIGHT_CLICK)));
}
if (!Settings.DISABLE_OFFERS.getBoolean() && marketItem.isAcceptingOffers()) {
item.lore(TranslationManager.list(this.player, Translations.GUI_MARKET_CATEGORY_VIEW_ITEMS_ITEM_LORE_MAKE_OFFER, "right_click", TranslationManager.string(this.player, Translations.MOUSE_RIGHT_CLICK)));
}

if (marketItem.isCurrencyOfItem())
item.lore(TranslationManager.list(this.player, Translations.GUI_MARKET_CATEGORY_VIEW_ITEMS_ITEM_LORE_VIEW_CURRENCY, "shift_right_click", TranslationManager.string(this.player, Translations.MOUSE_SHIFT_RIGHT_CLICK)));
Expand All @@ -87,31 +86,31 @@ protected void drawFixed() {

// set custom shit
setButton(this.market.getCategoryLayout().getOwnerProfileSlot(), QuickItem
.of(SkullUtils.getSkull(this.market.getOwnerUUID()))
.of(Bukkit.getOfflinePlayer(this.market.getOwnerUUID()))
.name(TranslationManager.string(this.player, Translations.GUI_MARKET_CATEGORY_VIEW_ITEMS_PROFILE_NAME))
.lore(TranslationManager.list(this.player, Translations.GUI_MARKET_CATEGORY_VIEW_ITEMS_PROFILE_LORE,
"market_owner", this.market.getOwnerName(),
"left_click", TranslationManager.string(this.player, Translations.MOUSE_LEFT_CLICK)
))
.make(), click -> click.manager.showGUI(click.player, new UserProfileGUI(this, click.player, Bukkit.getOfflinePlayer(this.market.getOwnerUUID()))));

if (!Settings.DISABLE_REVIEWS.getBoolean()) {
setButton(this.market.getCategoryLayout().getReviewButtonSlot(), QuickItem
.of(Settings.GUI_MARKET_VIEW_ITEMS_REVIEW.getItemStack())
.name(TranslationManager.string(this.player, Translations.GUI_MARKET_CATEGORY_VIEW_ITEMS_REVIEW_NAME))
.lore(TranslationManager.list(this.player, Translations.GUI_MARKET_CATEGORY_VIEW_ITEMS_REVIEW_LORE,
"left_click", TranslationManager.string(this.player, Translations.MOUSE_LEFT_CLICK),
"right_click", TranslationManager.string(this.player, Translations.MOUSE_RIGHT_CLICK)
))
.make(), click -> {

if (click.clickType == ClickType.LEFT)
click.manager.showGUI(click.player, new NewMarketRatingGUI(this, click.player, this.market));

if (click.clickType == ClickType.RIGHT)
click.manager.showGUI(click.player, new MarketRatingsViewGUI(this, click.player, this.market));
});
}
if (!Settings.DISABLE_REVIEWS.getBoolean()) {
setButton(this.market.getCategoryLayout().getReviewButtonSlot(), QuickItem
.of(Settings.GUI_MARKET_VIEW_ITEMS_REVIEW.getItemStack())
.name(TranslationManager.string(this.player, Translations.GUI_MARKET_CATEGORY_VIEW_ITEMS_REVIEW_NAME))
.lore(TranslationManager.list(this.player, Translations.GUI_MARKET_CATEGORY_VIEW_ITEMS_REVIEW_LORE,
"left_click", TranslationManager.string(this.player, Translations.MOUSE_LEFT_CLICK),
"right_click", TranslationManager.string(this.player, Translations.MOUSE_RIGHT_CLICK)
))
.make(), click -> {

if (click.clickType == ClickType.LEFT)
click.manager.showGUI(click.player, new NewMarketRatingGUI(this, click.player, this.market));

if (click.clickType == ClickType.RIGHT)
click.manager.showGUI(click.player, new MarketRatingsViewGUI(this, click.player, this.market));
});
}

if (Settings.ENABLE_SEARCH_IN_MARKETS.getBoolean())
setButton(this.market.getCategoryLayout().getSearchButtonSlot(), QuickItem
Expand Down
Loading

0 comments on commit c29e96c

Please sign in to comment.