9
0
mirror of https://github.com/Xiao-MoMi/Custom-Fishing.git synced 2025-12-31 12:56:43 +00:00

Added CraftEngine support

This commit is contained in:
XiaoMoMi
2024-11-06 15:46:04 +08:00
parent c54d580a24
commit 615cea236a
9 changed files with 121 additions and 4 deletions

View File

@@ -59,6 +59,7 @@ import net.momirealms.customfishing.common.plugin.logging.PluginLogger;
import net.momirealms.sparrow.heart.SparrowHeart;
import org.bstats.bukkit.Metrics;
import org.bukkit.Bukkit;
import org.bukkit.Particle;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.java.JavaPlugin;

View File

@@ -55,7 +55,8 @@ public class BukkitCommandManager extends AbstractCommandManager<CommandSender>
new SetStatisticsCommand(this),
new ResetStatisticsCommand(this),
new QueryStatisticsCommand(this),
new DebugLootCommand(this)
new DebugLootCommand(this),
new DebugBiomeCommand(this)
);
private final Index<String, CommandFeature<CommandSender>> INDEX = Index.create(CommandFeature::getFeatureID, FEATURES);

View File

@@ -0,0 +1,49 @@
/*
* 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.customfishing.bukkit.command.feature;
import net.kyori.adventure.text.Component;
import net.momirealms.customfishing.api.BukkitCustomFishingPlugin;
import net.momirealms.customfishing.bukkit.command.BukkitCommandFeature;
import net.momirealms.customfishing.common.command.CustomFishingCommandManager;
import net.momirealms.sparrow.heart.SparrowHeart;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.incendo.cloud.Command;
import org.incendo.cloud.CommandManager;
public class DebugBiomeCommand extends BukkitCommandFeature<CommandSender> {
public DebugBiomeCommand(CustomFishingCommandManager<CommandSender> commandManager) {
super(commandManager);
}
@Override
public Command.Builder<? extends CommandSender> assembleCommand(CommandManager<CommandSender> manager, Command.Builder<CommandSender> builder) {
return builder
.senderType(Player.class)
.handler(context -> {
BukkitCustomFishingPlugin.getInstance().getSenderFactory().wrap(context.sender()).sendMessage(Component.text(SparrowHeart.getInstance().getBiomeResourceLocation(context.sender().getLocation())));
});
}
@Override
public String getFeatureID() {
return "debug_biome";
}
}

View File

@@ -81,6 +81,9 @@ public class BukkitIntegrationManager implements IntegrationManager {
registerBlockProvider(new ItemsAdderBlockProvider());
registerEntityProvider(new ItemsAdderEntityProvider());
}
if (isHooked("CraftEngine")) {
registerItemProvider(new CraftEngineProvider());
}
if (isHooked("MMOItems")) {
registerItemProvider(new MMOItemsItemProvider());
}

View File

@@ -192,4 +192,13 @@ debug_loot:
permission: customfishing.command.debug
usage:
- /customfishing debug loot
- /cfishing debug loot
- /cfishing debug loot
# A command to debug the biome
# Usage: [COMMAND]
debug_biome:
enable: true
permission: customfishing.command.debug
usage:
- /customfishing debug biome
- /cfishing debug biome