Compare commits
1
Commits
main
..
af6c052404
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
af6c052404 |
No files matched your search
+1
-1
@@ -68,7 +68,7 @@ publishing {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compileOnly("com.alttd.cosmos:cosmos-api:26.3.build.19-alpha")
|
compileOnly("com.alttd.cosmos:cosmos-api:26.2.build.17-stable")
|
||||||
compileOnly("com.github.milkbowl:VaultAPI:1.7") {
|
compileOnly("com.github.milkbowl:VaultAPI:1.7") {
|
||||||
exclude("org.bukkit","bukkit")
|
exclude("org.bukkit","bukkit")
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-9.8.0-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.1-bin.zip
|
||||||
networkTimeout=10000
|
networkTimeout=10000
|
||||||
validateDistributionUrl=true
|
validateDistributionUrl=true
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
|
|||||||
+1
-4
@@ -20,10 +20,7 @@ dependencyResolutionManagement {
|
|||||||
password = nexusPass
|
password = nexusPass
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// maven("https://repo.destro.xyz/snapshots")
|
maven("https://repo.destro.xyz/snapshots")
|
||||||
maven(url = "https://repo.papermc.io/repository/maven-public/") {
|
|
||||||
name = "papermc"
|
|
||||||
}
|
|
||||||
maven("https://jitpack.io") { // Vault
|
maven("https://jitpack.io") { // Vault
|
||||||
content {
|
content {
|
||||||
includeGroup("com.github.milkbowl")
|
includeGroup("com.github.milkbowl")
|
||||||
|
|||||||
@@ -4,21 +4,29 @@ import com.alttd.playershops.shop.PlayerShop;
|
|||||||
import com.alttd.playershops.shop.ShopType;
|
import com.alttd.playershops.shop.ShopType;
|
||||||
import com.alttd.playershops.utils.EconomyUtils;
|
import com.alttd.playershops.utils.EconomyUtils;
|
||||||
import com.alttd.playershops.utils.ShopUtil;
|
import com.alttd.playershops.utils.ShopUtil;
|
||||||
|
import com.alttd.playershops.utils.Util;
|
||||||
import io.papermc.paper.dialog.Dialog;
|
import io.papermc.paper.dialog.Dialog;
|
||||||
import io.papermc.paper.registry.data.dialog.ActionButton;
|
import io.papermc.paper.registry.data.dialog.ActionButton;
|
||||||
import io.papermc.paper.registry.data.dialog.DialogBase;
|
import io.papermc.paper.registry.data.dialog.DialogBase;
|
||||||
import io.papermc.paper.registry.data.dialog.action.DialogAction;
|
import io.papermc.paper.registry.data.dialog.action.DialogAction;
|
||||||
|
import io.papermc.paper.registry.data.dialog.body.DialogBody;
|
||||||
import io.papermc.paper.registry.data.dialog.input.DialogInput;
|
import io.papermc.paper.registry.data.dialog.input.DialogInput;
|
||||||
import io.papermc.paper.registry.data.dialog.input.SingleOptionDialogInput;
|
import io.papermc.paper.registry.data.dialog.input.SingleOptionDialogInput;
|
||||||
import io.papermc.paper.registry.data.dialog.type.DialogType;
|
import io.papermc.paper.registry.data.dialog.type.DialogType;
|
||||||
|
import net.kyori.adventure.text.Component;
|
||||||
import net.kyori.adventure.text.event.ClickCallback;
|
import net.kyori.adventure.text.event.ClickCallback;
|
||||||
import net.kyori.adventure.text.minimessage.MiniMessage;
|
import net.kyori.adventure.text.minimessage.MiniMessage;
|
||||||
import net.kyori.adventure.text.minimessage.tag.resolver.Placeholder;
|
import net.kyori.adventure.text.minimessage.tag.resolver.Placeholder;
|
||||||
|
import net.kyori.adventure.text.minimessage.tag.resolver.TagResolver;
|
||||||
|
import org.bukkit.Material;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
import org.bukkit.inventory.meta.ItemMeta;
|
||||||
|
|
||||||
import java.time.Duration;
|
import java.time.Duration;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
public class ManageShopDialog extends AbstractDialog {
|
public class ManageShopDialog extends AbstractDialog {
|
||||||
|
|||||||
@@ -217,9 +217,6 @@ public class ShopHandler {
|
|||||||
if (!shop.isInitialized()) {
|
if (!shop.isInitialized()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (shop.getItemStack() == null) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
Material material = shop.getShopItemType();
|
Material material = shop.getShopItemType();
|
||||||
List<PlayerShop> shopList = shopByMaterialTreeSet.computeIfAbsent(material, v -> new ArrayList<>());
|
List<PlayerShop> shopList = shopByMaterialTreeSet.computeIfAbsent(material, v -> new ArrayList<>());
|
||||||
|
|||||||
@@ -109,20 +109,17 @@ public class InventoryUtils {
|
|||||||
if (itemStack.getAmount() <= 0)
|
if (itemStack.getAmount() <= 0)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
int remaining = itemStack.getAmount();
|
int overflow = addItem(inventory, itemStack);
|
||||||
|
|
||||||
for (ItemStack stack : inventory.getStorageContents()) {
|
//revert back if inventory cannot hold all of the items
|
||||||
if (stack == null || stack.getType().isAir()) {
|
if (overflow > 0) {
|
||||||
remaining -= itemStack.getMaxStackSize();
|
ItemStack revert = itemStack.clone();
|
||||||
} else if (stack.isSimilar(itemStack)) {
|
revert.setAmount(revert.getAmount() - overflow);
|
||||||
remaining -= stack.getMaxStackSize() - stack.getAmount();
|
InventoryUtils.removeItem(inventory, revert);
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
removeItem(inventory, itemStack);
|
||||||
if (remaining <= 0)
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -266,8 +266,8 @@ public class ItemMatcher {
|
|||||||
return false; // not the same color
|
return false; // not the same color
|
||||||
|
|
||||||
// Do we need all of the above checks inside the shulker?
|
// Do we need all of the above checks inside the shulker?
|
||||||
// same content if true
|
if (Arrays.equals(shulkerBox1.getInventory().getContents(), shulkerBox2.getInventory().getContents()))
|
||||||
return Arrays.equals(shulkerBox1.getInventory().getContents(), shulkerBox2.getInventory().getContents());
|
return true; // same content
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@@ -295,7 +295,7 @@ public class ItemMatcher {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (item1 == null || item2 == null) {
|
if (item1 == null || item2 == null) {
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!item1.getType().equals(item2.getType())) {
|
if (!item1.getType().equals(item2.getType())) {
|
||||||
@@ -310,7 +310,7 @@ public class ItemMatcher {
|
|||||||
return metaMatches(item1, item2);
|
return metaMatches(item1, item2);
|
||||||
}
|
}
|
||||||
|
|
||||||
return !item1.hasItemMeta() && !item2.hasItemMeta();
|
return !item1.hasItemMeta() && !item1.hasItemMeta();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static boolean metaMatches(ItemStack item1, ItemStack item2) {
|
protected static boolean metaMatches(ItemStack item1, ItemStack item2) {
|
||||||
|
|||||||
Reference in new issue
Block a user