mirror of
https://github.com/Xiao-MoMi/Custom-Fishing.git
synced 2025-12-28 19:39:06 +00:00
api
This commit is contained in:
@@ -52,6 +52,7 @@ public class CommandManagerImpl implements CommandManager {
|
||||
getReloadCommand(),
|
||||
getMarketCommand(),
|
||||
getAboutCommand(),
|
||||
GUIEditorCommand.INSTANCE.getEditorCommand(),
|
||||
DataCommand.INSTANCE.getDataCommand(),
|
||||
CompetitionCommand.INSTANCE.getCompetitionCommand(),
|
||||
ItemCommand.INSTANCE.getItemCommand(),
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
package net.momirealms.customfishing.command.sub;
|
||||
|
||||
import dev.jorel.commandapi.CommandAPICommand;
|
||||
|
||||
public class GUIEditorCommand {
|
||||
|
||||
public static GUIEditorCommand INSTANCE = new GUIEditorCommand();
|
||||
|
||||
public CommandAPICommand getEditorCommand() {
|
||||
return new CommandAPICommand("edit")
|
||||
.withSubcommands(
|
||||
|
||||
);
|
||||
}
|
||||
|
||||
private CommandAPICommand getLootCommand() {
|
||||
return new CommandAPICommand("loot")
|
||||
.withSubcommands(
|
||||
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package net.momirealms.customfishing.gui;
|
||||
|
||||
public class EditConditionGUI {
|
||||
|
||||
private String[] guiLayout = new String[] {
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" "
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
@@ -955,18 +955,4 @@ public class ActionManagerImpl implements ActionManager {
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
private void registerTempEffectAction() {
|
||||
registerAction("temp-effects", (args, chance) -> {
|
||||
if (args instanceof ConfigurationSection section) {
|
||||
return condition -> {
|
||||
if (Math.random() > chance) return;
|
||||
|
||||
};
|
||||
} else {
|
||||
LogUtils.warn("Illegal value format found at action: temp-effects");
|
||||
return EmptyAction.instance;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -546,12 +546,13 @@ public class FishingManagerImpl implements Listener, FishingManager {
|
||||
ItemUtils.decreaseDurability(rod, 1, true);
|
||||
}
|
||||
|
||||
fishHook.remove();
|
||||
|
||||
if (gamingPlayer.isSuccessful())
|
||||
success(tempFishingState, fishHook);
|
||||
else
|
||||
fail(tempFishingState, fishHook);
|
||||
|
||||
fishHook.remove();
|
||||
|
||||
}, fishHook.getLocation());
|
||||
}
|
||||
|
||||
@@ -571,6 +572,7 @@ public class FishingManagerImpl implements Listener, FishingManager {
|
||||
FishingResultEvent fishingResultEvent = new FishingResultEvent(
|
||||
fishingPreparation.getPlayer(),
|
||||
FishingResultEvent.Result.FAILURE,
|
||||
hook,
|
||||
loot,
|
||||
fishingPreparation.getArgs()
|
||||
);
|
||||
@@ -611,6 +613,7 @@ public class FishingManagerImpl implements Listener, FishingManager {
|
||||
FishingResultEvent fishingResultEvent = new FishingResultEvent(
|
||||
player,
|
||||
FishingResultEvent.Result.SUCCESS,
|
||||
hook,
|
||||
loot,
|
||||
fishingPreparation.getArgs()
|
||||
);
|
||||
|
||||
@@ -222,6 +222,7 @@ public class LootManagerImpl implements LootManager {
|
||||
for (Map.Entry<String, Object> entry : yaml.getValues(false).entrySet()) {
|
||||
if (entry.getValue() instanceof ConfigurationSection section) {
|
||||
var loot = getSingleSectionItem(
|
||||
file.getPath(),
|
||||
section,
|
||||
namespace,
|
||||
entry.getKey()
|
||||
@@ -252,8 +253,9 @@ public class LootManagerImpl implements LootManager {
|
||||
* @param key The unique key identifying the loot configuration.
|
||||
* @return A CFLoot object representing the loot configuration.
|
||||
*/
|
||||
private CFLoot getSingleSectionItem(ConfigurationSection section, String namespace, String key) {
|
||||
private CFLoot getSingleSectionItem(String filePath, ConfigurationSection section, String namespace, String key) {
|
||||
return new CFLoot.Builder(key, LootType.valueOf(namespace.toUpperCase(Locale.ENGLISH)))
|
||||
.filePath(filePath)
|
||||
.disableStats(section.getBoolean("disable-stat", false))
|
||||
.disableGames(section.getBoolean("disable-game", false))
|
||||
.instantGame(section.getBoolean("instant-game", false))
|
||||
|
||||
@@ -99,6 +99,8 @@ public class MongoDBImpl extends AbstractStorage {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Get the collection name for a specific subcategory of data.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user