Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
64dde4e
Start Menu system
PuppyTransGirl Feb 13, 2026
d2f2aab
get/set
PuppyTransGirl Feb 13, 2026
43810fc
get/set 2
PuppyTransGirl Feb 13, 2026
52c8789
Merge branch 'master' into feat/menus
PuppyTransGirl Feb 14, 2026
ccf5a0f
Add test commands
PuppyTransGirl Feb 14, 2026
e9ee9d3
Improve slightly
PuppyTransGirl Feb 14, 2026
6cb6a5c
get
PuppyTransGirl Feb 14, 2026
cade0de
Improve Menu constructors
PuppyTransGirl Feb 14, 2026
025cd0d
Reduce code size & duplication (part 1)
PuppyTransGirl Feb 14, 2026
d3b0d01
Reduce code size & duplication (part 2)
PuppyTransGirl Feb 14, 2026
ef5771d
Fix invisible components
PuppyTransGirl Feb 15, 2026
53e2e63
Remove useless dynamicItem methods
PuppyTransGirl Feb 15, 2026
aa5de1f
Fix paginator component being in the wrong position
PuppyTransGirl Feb 15, 2026
4add809
reviews
PuppyTransGirl Feb 15, 2026
8149efa
reviews 2
PuppyTransGirl Feb 15, 2026
e108a05
reviews 3
PuppyTransGirl Feb 15, 2026
0ebbec3
Fixed dupes & fixed losing items, added comments the code is weird to…
PuppyTransGirl Feb 16, 2026
ed6c243
Implement a better, more efficient, and more customizable way of dete…
PuppyTransGirl Feb 16, 2026
64bee41
Add tests for new classes
PuppyTransGirl Feb 16, 2026
bb3005f
Merge branch 'master' into feat/menus
PuppyTransGirl Feb 16, 2026
868e019
Add closing detection of menus
PuppyTransGirl Feb 16, 2026
97145a7
Add the new clicking thingy on the DoubleDropButton
PuppyTransGirl Feb 16, 2026
87212fc
review
PuppyTransGirl Feb 16, 2026
42317f7
review 2
PuppyTransGirl Feb 18, 2026
9500611
Object2ObjectLinkedOpenHashMap
PuppyTransGirl Feb 18, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,12 @@ gradle-app.setting
# run-paper
run/**

# MockBukkit
logs/*


### WIKI ###

# Bun
bun.lock

Expand Down Expand Up @@ -205,4 +211,5 @@ typings/

# dotenv environment variables file
.env
.env.test
.env.test

13 changes: 13 additions & 0 deletions src/main/java/fr/kikoplugins/kikoapi/KikoAPI.java
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
package fr.kikoplugins.kikoapi;

import fr.kikoplugins.kikoapi.lang.Lang;
import fr.kikoplugins.kikoapi.menu.listeners.MenuListener;
import fr.kikoplugins.kikoapi.updatechecker.UpdateChecker;
import org.bstats.bukkit.Metrics;
import org.bukkit.Bukkit;
import org.bukkit.plugin.PluginManager;
import org.bukkit.plugin.java.JavaPlugin;

import java.util.Arrays;

public class KikoAPI extends JavaPlugin {
private static final String MODRINTH_PROJECT_ID = "nwOXHH0K";
private static final int BSTATS_PLUGIN_ID = 29448;
Expand All @@ -32,10 +36,19 @@ public void onEnable() {
if (!isUnitTest())
this.bStats = new Metrics(this, BSTATS_PLUGIN_ID);

registerListeners();

if (this.getConfig().getBoolean("update-checker.enabled", true))
new UpdateChecker(this, MODRINTH_PROJECT_ID);
}

private void registerListeners() {
PluginManager pluginManager = getServer().getPluginManager();
Arrays.asList(
new MenuListener()
).forEach(listener -> pluginManager.registerEvents(listener, this));
}

@Override
public void onDisable() {
if (!isUnitTest())
Expand Down
12 changes: 12 additions & 0 deletions src/main/java/fr/kikoplugins/kikoapi/annotations/Knotty.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package fr.kikoplugins.kikoapi.annotations;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

/**
* Indicates that the annotated code/element is really badly designed, poorly implemented,
* or generally a "knotty" piece of code that may require special attention or refactoring.
*/
@Retention(RetentionPolicy.SOURCE)
public @interface Knotty {
}
12 changes: 12 additions & 0 deletions src/main/java/fr/kikoplugins/kikoapi/annotations/Overexcited.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package fr.kikoplugins.kikoapi.annotations;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

/**
* Indicates that the annotated code/element is expensive in terms of resources or performance.
*/
@Retention(RetentionPolicy.SOURCE)
public @interface Overexcited {
String reason() default "";
}
12 changes: 12 additions & 0 deletions src/main/java/fr/kikoplugins/kikoapi/annotations/Shivery.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package fr.kikoplugins.kikoapi.annotations;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

/**
* Indicates that the annotated code/element can/will break on minecraft updates or other external changes.
*/
@Retention(RetentionPolicy.SOURCE)
public @interface Shivery {
String reason() default "";
}
11 changes: 11 additions & 0 deletions src/main/java/fr/kikoplugins/kikoapi/annotations/Sleepy.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package fr.kikoplugins.kikoapi.annotations;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

/**
* Indicates that the annotated code/element is slow, inefficient.
*/
@Retention(RetentionPolicy.SOURCE)
public @interface Sleepy {
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public static LiteralCommandNode<CommandSourceStack> get() {
.requires(css -> CommandUtils.defaultRequirements(css, "kikoapi.command.kikoapi"))
.then(reloadCommand())
.then(sendTestMessageCommand())
.then(KikoAPITestCommand.get())
.build();
}

Expand Down
100 changes: 100 additions & 0 deletions src/main/java/fr/kikoplugins/kikoapi/commands/KikoAPITestCommand.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
package fr.kikoplugins.kikoapi.commands;

import com.mojang.brigadier.Command;
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
import fr.kikoplugins.kikoapi.menu.component.premade.ConfirmationMenu;
import fr.kikoplugins.kikoapi.menu.test.BasicTestMenu;
import fr.kikoplugins.kikoapi.menu.test.DynamicTestMenu;
import fr.kikoplugins.kikoapi.menu.test.PaginatedTestMenu;
import fr.kikoplugins.kikoapi.menu.test.PreviousTestMenu;
import fr.kikoplugins.kikoapi.utils.CommandUtils;
import fr.kikoplugins.kikoapi.utils.ItemBuilder;
import io.papermc.paper.command.brigadier.CommandSourceStack;
import io.papermc.paper.command.brigadier.Commands;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.format.NamedTextColor;
import org.bukkit.Material;
import org.bukkit.entity.Player;

public class KikoAPITestCommand {
private KikoAPITestCommand() {
throw new IllegalStateException("Command class");
}

public static LiteralArgumentBuilder<CommandSourceStack> get() {
return Commands.literal("test")
.requires(css -> CommandUtils.defaultRequirements(css, "kikoapi.command.kikoapi.test", true))
.then(basicCommand())
.then(confirmationCommand())
.then(dynamicCommand())
.then(paginatorCommand())
.then(previousCommand());
}

private static LiteralArgumentBuilder<CommandSourceStack> basicCommand() {
return Commands.literal("basic")
.requires(css -> CommandUtils.defaultRequirements(css, "kikoapi.command.kikoapi.test.basic", true))
.executes(ctx -> {
Player player = (Player) ctx.getSource().getExecutor();
BasicTestMenu menu = new BasicTestMenu(player);
menu.open();

return Command.SINGLE_SUCCESS;
});
}

private static LiteralArgumentBuilder<CommandSourceStack> confirmationCommand() {
return Commands.literal("confirmation")
.requires(css -> CommandUtils.defaultRequirements(css, "kikoapi.command.kikoapi.test.confirmation", true))
.executes(ctx -> {
Player player = (Player) ctx.getSource().getExecutor();
ConfirmationMenu menu = new ConfirmationMenu(
player,
Component.text("Are you sure ?"),
ItemBuilder.of(Material.LIME_DYE).name(Component.text("Yes", NamedTextColor.GREEN)).build(),
ItemBuilder.of(Material.RED_DYE).name(Component.text("No", NamedTextColor.RED)).build(),
ItemBuilder.of(Material.OAK_SIGN).name(Component.text("This action is irreversible")).build(),
event -> event.getPlayer().sendRichMessage("You clicked <green>Yes"),
event -> event.getPlayer().sendRichMessage("You clicked <red>No")
);
menu.open();

return Command.SINGLE_SUCCESS;
});
}

private static LiteralArgumentBuilder<CommandSourceStack> dynamicCommand() {
return Commands.literal("dynamic")
.requires(css -> CommandUtils.defaultRequirements(css, "kikoapi.command.kikoapi.test.dynamic", true))
.executes(ctx -> {
Player player = (Player) ctx.getSource().getExecutor();
DynamicTestMenu menu = new DynamicTestMenu(player);
menu.open();

return Command.SINGLE_SUCCESS;
});
}

private static LiteralArgumentBuilder<CommandSourceStack> paginatorCommand() {
return Commands.literal("paginator")
.requires(css -> CommandUtils.defaultRequirements(css, "kikoapi.command.kikoapi.test.paginator", true))
.executes(ctx -> {
Player player = (Player) ctx.getSource().getExecutor();
PaginatedTestMenu menu = new PaginatedTestMenu(player);
menu.open();

return Command.SINGLE_SUCCESS;
});
}

private static LiteralArgumentBuilder<CommandSourceStack> previousCommand() {
return Commands.literal("previous")
.requires(css -> CommandUtils.defaultRequirements(css, "kikoapi.command.kikoapi.test.previous", true))
.executes(ctx -> {
Player player = (Player) ctx.getSource().getExecutor();
new PreviousTestMenu(player).open();

return Command.SINGLE_SUCCESS;
});
}
}
Loading