Skip to content

Commit

Permalink
* Added the 'VISIT_FILTER_ENTRY' to the ChatInteractionEvent
Browse files Browse the repository at this point in the history
* Added the 'visit-filter-prompt', 'visit-filter-count', & 'visit-filter-none' messages to the lang.yml
* Added the 'filter-item' to the menus.yml for the visit menu

Signed-off-by: Jeremiah Osborne <[email protected]>
Signed-off-by: BuildTools <[email protected]>
  • Loading branch information
BuildTools committed Feb 14, 2022
1 parent 63f4264 commit 3a348d5
Show file tree
Hide file tree
Showing 42 changed files with 185 additions and 97 deletions.
1 change: 0 additions & 1 deletion API Version.txt

This file was deleted.

42 changes: 42 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright (c) 2022 XZot1K, All rights reserved.
-->

<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<properties>
<java.version>1.8</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
</properties>

<repositories>
<repository>
<id>spigotmc-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
</repositories>

<dependencies>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.18.1-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
</dependencies>

<parent>
<groupId>xzot1k.plugins.ds</groupId>
<artifactId>DisplayShops</artifactId>
<version>1.6.6</version>
</parent>
<artifactId>DisplayShopsAPI</artifactId>
<version>1.3.8</version>

</project>
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
/*
* Copyright (c) 2021 XZot1K, All rights reserved.
* Copyright (c) 2022 XZot1K, All rights reserved.
*/

package xzot1k.plugins.ds;

import net.milkbowl.vault.economy.Economy;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
Expand Down Expand Up @@ -147,6 +148,11 @@ public HashMap<UUID, UUID> getShopMemory() {
return null;
}

@Override
public Economy getVaultEconomy() {
return null;
}

@Override
public File getLoggingFile() {
return null;
Expand All @@ -156,4 +162,5 @@ public File getLoggingFile() {
public void writeToLog(String text) {

}
}

}
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
/*
* Copyright (c) 2021 XZot1K, All rights reserved.
* Copyright (c) 2022 XZot1K, All rights reserved.
*/

package xzot1k.plugins.ds;

import net.milkbowl.vault.economy.Economy;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
Expand Down Expand Up @@ -174,4 +175,11 @@ public interface DisplayShopsAPI {

HashMap<UUID, UUID> getShopMemory();

}
/**
* Returns the vault economy hook.
*
* @return Economy class.
*/
Economy getVaultEconomy();

}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 XZot1K, All rights reserved.
* Copyright (c) 2022 XZot1K, All rights reserved.
*/

package xzot1k.plugins.ds.api;
Expand All @@ -15,6 +15,7 @@
import org.bukkit.inventory.ItemStack;
import org.bukkit.potion.PotionType;
import org.bukkit.util.Vector;
import org.jetbrains.annotations.NotNull;
import xzot1k.plugins.ds.api.enums.ChatInteractionType;
import xzot1k.plugins.ds.api.enums.EconomyCallType;
import xzot1k.plugins.ds.api.events.EconomyCallEvent;
Expand Down Expand Up @@ -368,11 +369,11 @@ public interface Manager {
/**
* Gives the passed item stack to the player the passed amount of times in the form of stacks.
*
* @param player The player to give the items to (drops at feet if inventory is full).
* @param player The player to give the item to.
* @param itemStackToClone The item stack to make the stacks from.
* @param amount The amount of the items to give to the player (NOT stacks).
*/
void giveItemStacks(Player player, ItemStack itemStackToClone, int amount);
void giveItemStacks(@NotNull Player player, @NotNull ItemStack itemStackToClone, int amount);

/**
* Remove a certain amount of a certain similar item.
Expand Down Expand Up @@ -500,4 +501,4 @@ public interface Manager {
List<MarketRegion> getMarketRegions();

HashMap<UUID, DataPack> getDataPackMap();
}
}
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
/*
* Copyright (c) 2021 XZot1K, All rights reserved.
* Copyright (c) 2022 XZot1K, All rights reserved.
*/

package xzot1k.plugins.ds.api.enums;

public enum ChatInteractionType {
SHOP_ITEM_AMOUNT(true), BUY_LIMIT(true), SELL_LIMIT(true), BUY_PRICE(true),
SELL_PRICE(true), WITHDRAW_STOCK(true), DEPOSIT_STOCK(true), EDIT_DESCRIPTION(false),
DEPOSIT_BALANCE(true), WITHDRAW_BALANCE(true), ASSISTANTS_ADD(false), ASSISTANTS_REMOVE(false);
DEPOSIT_BALANCE(true), WITHDRAW_BALANCE(true), ASSISTANTS_ADD(false), ASSISTANTS_REMOVE(false),
VISIT_FILTER_ENTRY(false);

boolean numericalEntry;
final boolean numericalEntry;

ChatInteractionType(boolean numericalEntry) {
this.numericalEntry = numericalEntry;
Expand All @@ -20,5 +21,5 @@ public enum ChatInteractionType {
*
* @return whether a numerical entry is required.
*/
public boolean isNumericalEntry() { return numericalEntry; }
}
public boolean isNumericalEntry() {return numericalEntry;}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 XZot1K, All rights reserved.
* Copyright (c) 2022 XZot1K, All rights reserved.
*/

package xzot1k.plugins.ds.api.enums;
Expand All @@ -12,4 +12,4 @@ public enum Direction {
public static Direction getYaw(Player player) {
return values()[Math.round(player.getLocation().getYaw() / 90f) & 0x3];
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/*
* Copyright (c) 2022 XZot1K, All rights reserved.
*/

package xzot1k.plugins.ds.api.enums;

public enum EconomyCallType {
SELL, BUY, EDIT_ACTION, RENT, RENT_RENEW, VISIT,
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/*
* Copyright (c) 2021 XZot1K, All rights reserved.
* Copyright (c) 2022 XZot1K, All rights reserved.
*/

package xzot1k.plugins.ds.api.enums;

public enum EditType {
OPEN_EDIT_MENU, QUICK_WITHDRAW, QUICK_DEPOSIT
}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/*
* Copyright (c) 2021 XZot1K, All rights reserved.
* Copyright (c) 2022 XZot1K, All rights reserved.
*/

package xzot1k.plugins.ds.api.enums;

public enum ItemType {
TRADE, SHOP
}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/*
* Copyright (c) 2021 XZot1K, All rights reserved.
* Copyright (c) 2022 XZot1K, All rights reserved.
*/

package xzot1k.plugins.ds.api.enums;

public enum StageType {
START, FINISH, TIMEOUT, ENTRY, CANCELLED, INCORRECT
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 XZot1K, All rights reserved.
* Copyright (c) 2022 XZot1K, All rights reserved.
*/

package xzot1k.plugins.ds.api.events;
Expand All @@ -9,21 +9,21 @@
import org.bukkit.event.Cancellable;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
import xzot1k.plugins.ds.DisplayShops;
import xzot1k.plugins.ds.DisplayShopsAPI;
import xzot1k.plugins.ds.api.objects.Shop;

public class AffordCheckEvent extends Event implements Cancellable {

private static final HandlerList handlers = new HandlerList();
private final DisplayShops pluginInstance;
private final DisplayShopsAPI pluginInstance;
private final Player investor;
private final OfflinePlayer producer;
private final double price, taxedPrice;
private final EconomyCallEvent economyCallEvent;
private final Shop shop;
private boolean cancelled, canInvestorAfford, canProducerAfford;

public AffordCheckEvent(DisplayShops pluginInstance, Player investor, OfflinePlayer producer, boolean canInvestorAfford,
public AffordCheckEvent(DisplayShopsAPI pluginInstance, Player investor, OfflinePlayer producer, boolean canInvestorAfford,
boolean canProducerAfford, double price, double taxedPrice, EconomyCallEvent economyCallEvent, Shop shop) {
this.pluginInstance = pluginInstance;
this.investor = investor;
Expand Down Expand Up @@ -55,7 +55,7 @@ public HandlerList getHandlers() {
return handlers;
}

private DisplayShops getPluginInstance() {
private DisplayShopsAPI getPluginInstance() {
return pluginInstance;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 XZot1K, All rights reserved.
* Copyright (c) 2022 XZot1K, All rights reserved.
*/

package xzot1k.plugins.ds.api.events;
Expand Down Expand Up @@ -67,4 +67,4 @@ public ChatInteractionType getChatInteractionType() {
private void setChatInteractionType(ChatInteractionType chatInteractionType) {
this.chatInteractionType = chatInteractionType;
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 XZot1K, All rights reserved.
* Copyright (c) 2022 XZot1K, All rights reserved.
*/

package xzot1k.plugins.ds.api.events;
Expand Down Expand Up @@ -59,4 +59,4 @@ public StageType getStageType() {
private void setStageType(StageType stageType) {
this.stageType = stageType;
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 XZot1K, All rights reserved.
* Copyright (c) 2022 XZot1K, All rights reserved.
*/

package xzot1k.plugins.ds.api.events;
Expand All @@ -9,14 +9,14 @@
import org.bukkit.event.Cancellable;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
import xzot1k.plugins.ds.DisplayShops;
import xzot1k.plugins.ds.DisplayShopsAPI;
import xzot1k.plugins.ds.api.enums.EconomyCallType;
import xzot1k.plugins.ds.api.objects.Shop;

public class CurrencyTransferEvent extends Event implements Cancellable {

private static final HandlerList handlers = new HandlerList();
private final DisplayShops pluginInstance;
private final DisplayShopsAPI pluginInstance;
private final boolean reversedTransfer, shouldChargeInvestor;
private final Player investor;
private final OfflinePlayer producer;
Expand All @@ -27,7 +27,7 @@ public class CurrencyTransferEvent extends Event implements Cancellable {
private boolean cancelled;
private boolean chargedInvestor;

public CurrencyTransferEvent(DisplayShops pluginInstance, Shop shop, EconomyCallType economyCallType, Player investor,
public CurrencyTransferEvent(DisplayShopsAPI pluginInstance, Shop shop, EconomyCallType economyCallType, Player investor,
OfflinePlayer producer, double price, double taxedPrice, boolean reversedTransfer, boolean chargedInvestor,
boolean shouldChargeInvestor, EconomyCallEvent economyCallEvent) {
this.pluginInstance = pluginInstance;
Expand Down Expand Up @@ -62,7 +62,7 @@ public HandlerList getHandlers() {
return handlers;
}

private DisplayShops getPluginInstance() {
private DisplayShopsAPI getPluginInstance() {
return pluginInstance;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 XZot1K, All rights reserved.
* Copyright (c) 2022 XZot1K, All rights reserved.
*/

package xzot1k.plugins.ds.api.events;
Expand Down Expand Up @@ -88,4 +88,4 @@ public interface ECEvent {

void setChargedInvestor(boolean chargedInvestor);

}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 XZot1K, All rights reserved.
* Copyright (c) 2022 XZot1K, All rights reserved.
*/

package xzot1k.plugins.ds.api.events;
Expand Down Expand Up @@ -138,4 +138,4 @@ public boolean chargedInvestor() {
public void setChargedInvestor(boolean chargedInvestor) {

}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 XZot1K, All rights reserved.
* Copyright (c) 2022 XZot1K, All rights reserved.
*/
package xzot1k.plugins.ds.api.events;

Expand Down Expand Up @@ -57,4 +57,4 @@ public void setRenew(boolean renewal) {
public MarketRegion getMarketRegion() {
return marketRegion;
}
}
}
Loading

0 comments on commit 3a348d5

Please sign in to comment.