9
0
mirror of https://github.com/Xiao-MoMi/Custom-Crops.git synced 2025-12-23 00:49:33 +00:00
This commit is contained in:
XiaoMoMi
2024-09-30 21:06:28 +08:00
parent 23fec3458c
commit cfcf716e9d
10 changed files with 110 additions and 6 deletions

View File

@@ -47,6 +47,8 @@ dependencies {
compileOnly("org.betonquest:betonquest:2.1.3")
// item
compileOnly(files("libs/zaphkiel-2.0.24.jar"))
compileOnly(files("libs/ExecutableItems-7.24.9.29.jar"))
compileOnly(files("libs/SCore-5.24.9.29.jar"))
compileOnly("net.Indyuce:MMOItems-API:6.10-SNAPSHOT")
compileOnly("io.lumine:MythicLib-dist:1.6.2-SNAPSHOT")
compileOnly("pers.neige.neigeitems:NeigeItems:1.17.13")

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,47 @@
/*
* Copyright (C) <2024> <XiaoMoMi>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package net.momirealms.customcrops.bukkit.integration.item;
import com.ssomar.executableitems.executableitems.manager.ExecutableItemsManager;
import com.ssomar.score.api.executableitems.config.ExecutableItemInterface;
import net.momirealms.customcrops.api.integration.ItemProvider;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.Optional;
public class ExecutableItemProvider implements ItemProvider {
@Override
public @NotNull ItemStack buildItem(@NotNull Player player, @NotNull String id) {
return ExecutableItemsManager.getInstance().getExecutableItem(id).get().buildItem(1, Optional.of(player));
}
@Nullable
@Override
public String itemID(@NotNull ItemStack itemStack) {
return ExecutableItemsManager.getInstance().getExecutableItem(itemStack).map(ExecutableItemInterface::getId).orElse(null);
}
@Override
public String identifier() {
return "ExecutableItems";
}
}