Skip to content

Commit 9e99d22

Browse files
author
Jan Kluka
committed
1.1-SNAPSHOT
Removed SellRegions as they are not used anymore
1 parent 24e7aeb commit 9e99d22

4 files changed

Lines changed: 21 additions & 99 deletions

File tree

src/main/java/dev/drawethree/xprison/api/autosell/XPrisonAutoSellAPI.java

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
package dev.drawethree.xprison.api.autosell;
22

3-
import dev.drawethree.xprison.api.autosell.model.SellRegion;
4-
import org.bukkit.Location;
3+
import com.cryptomorin.xseries.XMaterial;
54
import org.bukkit.block.Block;
65
import org.bukkit.entity.Player;
76
import org.bukkit.inventory.ItemStack;
87

9-
import java.util.Collection;
108
import java.util.List;
119

1210
/**
@@ -24,13 +22,12 @@ public interface XPrisonAutoSellAPI {
2422
double getCurrentEarnings(Player player);
2523

2624
/**
27-
* Gets the price of a specific item in a given sell region.
25+
* Gets the price of a specific item
2826
*
29-
* @param region the sell region to check pricing in
3027
* @param item the item to get the price for
31-
* @return the price of the item in the specified region
28+
* @return the price of the item
3229
*/
33-
double getPriceForItem(SellRegion region, ItemStack item);
30+
double getPriceForItem(ItemStack item);
3431

3532
/**
3633
* Gets the price for a given block.
@@ -57,17 +54,25 @@ public interface XPrisonAutoSellAPI {
5754
boolean hasAutoSellEnabled(Player p);
5855

5956
/**
60-
* Gets a collection of all loaded and active sell regions.
57+
* Adds or updates the sell price for a specific material
6158
*
62-
* @return a collection of all sell regions
59+
* @param material the material to set the sell price for
60+
* @param price the price at which the material will be sold
6361
*/
64-
Collection<SellRegion> getSellRegions();
62+
void addSellPrice(XMaterial material, double price);
6563

6664
/**
67-
* Gets the sell region at a specified location.
65+
* Removes a material from being sellable in this region.
6866
*
69-
* @param location the location to check
70-
* @return the sell region at the given location, or {@code null} if none exists there
67+
* @param material the material to remove from the sell price list
7168
*/
72-
SellRegion getSellRegionAtLocation(Location location);
69+
void removeSellPrice(XMaterial material);
70+
71+
/**
72+
* Gets the sell price for a specific material in this region.
73+
*
74+
* @param material the material to get the price for
75+
* @return the sell price of the material, or 0 if not sellable
76+
*/
77+
double getSellPriceForMaterial(XMaterial material);
7378
}

src/main/java/dev/drawethree/xprison/api/autosell/events/XPrisonAutoSellEvent.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package dev.drawethree.xprison.api.autosell.events;
22

33
import dev.drawethree.xprison.api.autosell.model.AutoSellItemStack;
4-
import dev.drawethree.xprison.api.autosell.model.SellRegion;
54
import dev.drawethree.xprison.api.shared.events.player.XPrisonPlayerEvent;
65
import lombok.Getter;
76
import lombok.Setter;
@@ -20,7 +19,6 @@ public final class XPrisonAutoSellEvent extends XPrisonPlayerEvent implements Ca
2019
private static final HandlerList handlers = new HandlerList();
2120

2221
private final Player player;
23-
private final SellRegion region;
2422

2523
@Setter
2624
private Map<AutoSellItemStack, Double> itemsToSell;
@@ -32,13 +30,11 @@ public final class XPrisonAutoSellEvent extends XPrisonPlayerEvent implements Ca
3230
* Constructs a new auto-sell event.
3331
*
3432
* @param player The player who mined the blocks and triggered auto-sell
35-
* @param reg The sell region where the blocks were mined
3633
* @param itemsToSell A map of items to be sold with their respective prices
3734
*/
38-
public XPrisonAutoSellEvent(Player player, SellRegion reg, Map<AutoSellItemStack, Double> itemsToSell) {
35+
public XPrisonAutoSellEvent(Player player, Map<AutoSellItemStack, Double> itemsToSell) {
3936
super(player);
4037
this.player = player;
41-
this.region = reg;
4238
this.itemsToSell = itemsToSell;
4339
}
4440

src/main/java/dev/drawethree/xprison/api/autosell/events/XPrisonSellAllEvent.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package dev.drawethree.xprison.api.autosell.events;
22

33
import dev.drawethree.xprison.api.autosell.model.AutoSellItemStack;
4-
import dev.drawethree.xprison.api.autosell.model.SellRegion;
54
import dev.drawethree.xprison.api.shared.events.player.XPrisonPlayerEvent;
65
import lombok.Getter;
76
import lombok.Setter;
@@ -20,7 +19,6 @@ public final class XPrisonSellAllEvent extends XPrisonPlayerEvent implements Can
2019
private static final HandlerList handlers = new HandlerList();
2120

2221
private final Player player;
23-
private final SellRegion region;
2422

2523
@Getter
2624
@Setter
@@ -34,13 +32,11 @@ public final class XPrisonSellAllEvent extends XPrisonPlayerEvent implements Can
3432
* Constructs a new sell-all event.
3533
*
3634
* @param player The player performing the sell-all
37-
* @param reg The sell region where the blocks were mined
3835
* @param itemsToSell A map of items to sell and their respective prices
3936
*/
40-
public XPrisonSellAllEvent(Player player, SellRegion reg, Map<AutoSellItemStack, Double> itemsToSell) {
37+
public XPrisonSellAllEvent(Player player, Map<AutoSellItemStack, Double> itemsToSell) {
4138
super(player);
4239
this.player = player;
43-
this.region = reg;
4440
this.itemsToSell = itemsToSell;
4541
}
4642

src/main/java/dev/drawethree/xprison/api/autosell/model/SellRegion.java

Lines changed: 0 additions & 75 deletions
This file was deleted.

0 commit comments

Comments
 (0)