Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
836f26b
fix: handle inventory closure for VInventory on player quit
1robie Apr 12, 2026
deba6b6
refactor: rename and reorganize item component loaders for max stack …
1robie Apr 12, 2026
4fb52e6
feat: add Spigot components for attack range + fix maxstacksize parse…
1robie Apr 12, 2026
d7e43e1
chore: update Gradle wrapper to version 9.3.0 (support java 25))
1robie Apr 28, 2026
96b5dd0
chore: update Gradle wrapper to version 9.4.0
1robie Apr 28, 2026
c95b5ee
Merge branch 'Maxlego08:main' into developement
1robie Apr 28, 2026
7c86b7f
Merge remote-tracking branch 'origin/developement' into developement
1robie Apr 28, 2026
5f5bc3d
feat: add new annotations for component loaders and update plugin.yml…
1robie Apr 28, 2026
59c578b
feat: implement variant loaders for Axolotl, Cat, Fox, and other enti…
1robie Apr 29, 2026
9a29afd
feat: add GEMINI.md to .gitignore
1robie Apr 29, 2026
8bd49c1
feat: implement automatic listener registration using AutoListener an…
1robie Apr 29, 2026
165044f
feat: support for view-requirement for CustomRender buttons
1robie May 1, 2026
8102644
feat: replace NmsVersion with MinecraftVersion for version checks acr…
1robie May 1, 2026
9b82328
fix: remove debug logs
1robie May 5, 2026
93ffca1
feat: add TakeItemAction and TakeItemLoader for item removal function…
1robie May 5, 2026
3ba5e95
refactor: remove debug logging from VersionFilter class
1robie May 5, 2026
f7402b9
fix: update loadItemStack to use createSection for item map
1robie May 6, 2026
78b075b
fix: TakeItemAction and improve item loading requirement for TakeItem…
1robie May 6, 2026
a6da9a6
remove debug message
1robie May 6, 2026
439ef38
fix: switch with clear-inv and packet event don't hide items in playe…
1robie May 7, 2026
b1f08bc
feat: add support for command action requirements
1robie May 8, 2026
8a7bf09
fix: enhance error handling and debug logging in MMOItemsLoader
1robie May 8, 2026
3af2842
feat: add debug logging functionality to TakeItemAction and Action cl…
1robie May 8, 2026
6ad9326
Merge remote-tracking branch 'upstream/develop' into developement
1robie May 8, 2026
a84d288
fix: add nullable annotation import in ZInventory
1robie May 8, 2026
6121ce2
feat: update changelog.md
1robie May 8, 2026
21bdc8e
feat: enhance ButtonLoader to support aliases and update dialog type …
1robie May 10, 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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,4 @@ opencode.json
CLAUDE.md
.claude/settings.local.json
build-and-deploy.sh
GEMINI.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package fr.maxlego08.menu.api.annotations;

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

@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public @interface AutoListener {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package fr.maxlego08.menu.api.annotations;

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

@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public @interface ComponentLoader {
}
11 changes: 11 additions & 0 deletions API/src/main/java/fr/maxlego08/menu/api/annotations/PaperOnly.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package fr.maxlego08.menu.api.annotations;

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

@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public @interface PaperOnly {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package fr.maxlego08.menu.api.annotations;

import org.jetbrains.annotations.NotNull;

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

@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public @interface SinceVersion {
@NotNull
String value();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package fr.maxlego08.menu.api.annotations;


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

@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public @interface SpigotOnly {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package fr.maxlego08.menu.api.annotations;

import org.jetbrains.annotations.NotNull;

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

@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public @interface UntilVersion {

@NotNull
String value();
}
7 changes: 7 additions & 0 deletions API/src/main/java/fr/maxlego08/menu/api/command/Command.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package fr.maxlego08.menu.api.command;

import fr.maxlego08.menu.api.requirement.Action;
import fr.maxlego08.menu.api.requirement.Requirement;
import org.bukkit.plugin.Plugin;

import java.io.File;
Expand Down Expand Up @@ -102,6 +103,12 @@ public interface Command {
*/
List<Command> subCommands();

/**
* Gets the list of requirements that must be met for the command's actions to be executed.
* @return The list of requirements that must be met for the command's actions to be executed.
*/
List<Requirement> actions_requirements();

/**
* Gets the message to display when the player does not have the required permission.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,17 @@
package fr.maxlego08.menu.api.itemstack.components;

import fr.maxlego08.menu.api.context.BuildContext;
import fr.maxlego08.menu.api.itemstack.ItemComponent;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

@SuppressWarnings("unused")
public class AttackRangeComponent extends ItemComponent {
public abstract class AttackRangeComponent extends ItemComponent {
protected final float minReach;
protected final float maxReach;
protected final float minCreativeReach;
protected final float maxCreativeReach;
protected final float hitboxMargin;
protected final float mobFactor;

private final float minReach;
private final float maxReach;
private final float minCreativeReach;
private final float maxCreativeReach;
private final float hitboxMargin;
private final float mobFactor;

public AttackRangeComponent(float minReach, float maxReach, float minCreativeReach, float maxCreativeReach, float hitboxMargin, float mobFactor) {
protected AttackRangeComponent(float minReach, float maxReach, float minCreativeReach, float maxCreativeReach, float hitboxMargin, float mobFactor) {
this.minReach = minReach;
this.maxReach = maxReach;
this.minCreativeReach = minCreativeReach;
Expand Down Expand Up @@ -50,19 +43,4 @@ public float getHitboxMargin() {
public float getMobFactor() {
return this.mobFactor;
}

@Override
public void apply(@NotNull BuildContext context, @NotNull ItemStack itemStack, @Nullable Player player) {
ItemMeta itemMeta = itemStack.getItemMeta();
if (itemMeta == null) return;
org.bukkit.inventory.meta.components.AttackRangeComponent attackRange = itemMeta.getAttackRange();
attackRange.setMinReach(this.minReach);
attackRange.setMaxReach(this.maxReach);
attackRange.setMinCreativeReach(this.minCreativeReach);
attackRange.setMaxCreativeReach(this.maxCreativeReach);
attackRange.setHitboxMargin(this.hitboxMargin);
attackRange.setMobFactor(this.mobFactor);
itemStack.setItemMeta(itemMeta);
}

}
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
package fr.maxlego08.menu.api.itemstack.components;

import fr.maxlego08.menu.api.context.BuildContext;
import fr.maxlego08.menu.api.itemstack.ItemComponent;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

@SuppressWarnings("unused")
public class MaxStackSizeComponent extends ItemComponent {
private final int maxStackSize;
public abstract class MaxStackSizeComponent extends ItemComponent {
protected final int maxStackSize;

public MaxStackSizeComponent(int maxStackSize) {
this.maxStackSize = maxStackSize;
Expand All @@ -19,14 +12,4 @@ public MaxStackSizeComponent(int maxStackSize) {
public int getMaxStackSize() {
return this.maxStackSize;
}

@Override
public void apply(@NotNull BuildContext context, @NotNull ItemStack itemStack, @Nullable Player player) {
ItemMeta itemMeta = itemStack.getItemMeta();
if (itemMeta != null) {
itemMeta.setMaxStackSize(this.maxStackSize);
itemStack.setItemMeta(itemMeta);
}
}
}

17 changes: 16 additions & 1 deletion API/src/main/java/fr/maxlego08/menu/api/loader/ButtonLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import org.jetbrains.annotations.Nullable;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.stream.IntStream;

Expand All @@ -31,9 +32,12 @@ public abstract class ButtonLoader {
protected final Plugin plugin;
protected final String name;

public ButtonLoader(@NotNull Plugin plugin,@NotNull String name) {
protected final List<String> aliases = new ArrayList<>();

public ButtonLoader(@NotNull Plugin plugin,@NotNull String name, String... aliases) {
this.plugin = plugin;
this.name = name;
this.aliases.addAll(List.of(aliases));
}

/**
Expand Down Expand Up @@ -78,6 +82,17 @@ public String getName() {
return this.name;
}

/**
* Gets the list of aliases for the button.
*
* @return An unmodifiable list of aliases.
*/
@Contract(pure = true)
@NotNull
public List<String> getAliases() {
return Collections.unmodifiableList(this.aliases);
}

/**
* Gets the plugin from which the button loader originates.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ public interface InventoriesPlayer extends Listener {
*/
void storeInventoryTemporary(@NonNull Player player);

void storeInventoryTemporaryOrClear(@NotNull Player player);

/**
* Allows giving the inventory back to the player
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.jetbrains.annotations.NotNull;
import org.jspecify.annotations.NonNull;

import java.util.List;
import java.util.Map;
Expand All @@ -19,6 +20,8 @@ public interface InventoryPlayer {
*/
void storeInventory(@NotNull Player player);

void clearInventory(@NonNull Player player);

/**
* Allows giving the inventory back to the player
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public abstract class Action {
*/
private int delay;
private float chance;
protected boolean debug = false;

/**
* The type of the action.
Expand Down Expand Up @@ -64,6 +65,14 @@ public void setDelay(int delay) {
this.delay = delay;
}

public boolean isDebug() {
return this.debug;
}

public void setDebug(boolean debug) {
this.debug = debug;
}

@Contract(pure= true)
public float getChance() {
return this.chance;
Expand Down
2 changes: 1 addition & 1 deletion API/src/main/java/fr/maxlego08/menu/api/utils/Message.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public enum Message implements IMessage {
DESCRIPTION_OPEN("Allows you to open an inventory"),
DESCRIPTION_SAVE("Allows you to save the item in your hand"),
DESCRIPTION_RELOAD("Allows you to reload configuration files"),
DESCRIPTION_VERSION("Show plugin version"),
DESCRIPTION_VERSION("Show plugin value"),
DESCRIPTION_LIST("Inventory list"),
DESCRIPTION_TEST_DUPE("Test dupe"),
DESCRIPTION_OPEN_ITEM("Give open item"),
Expand Down
60 changes: 60 additions & 0 deletions API/src/main/java/fr/maxlego08/menu/api/utils/PlatformType.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
package fr.maxlego08.menu.api.utils;

public enum PlatformType {
/**
* Paper server with native Adventure API support.
*/
PAPER,

/**
* Spigot server requiring Adventure Platform wrapper.
*/
SPIGOT;

private static PlatformType detectedType;

/**
* Detects the server platform type by checking for Paper-specific classes.
*
* @return The detected platform type
*/
public static PlatformType detect() {
if (detectedType == null) {
try {
Class.forName("io.papermc.paper.text.PaperComponents");
detectedType = PAPER;
} catch (ClassNotFoundException e) {
detectedType = SPIGOT;
}
}
return detectedType;
}

/**
* Gets the detected platform type.
* If detection hasn't been run yet, it will be performed.
*
* @return The platform type
*/
public static PlatformType get() {
return detect();
}

/**
* Checks if the current platform is Paper.
*
* @return true if running on Paper, false otherwise
*/
public static boolean isPaper() {
return get() == PAPER;
}

/**
* Checks if the current platform is Spigot.
*
* @return true if running on Spigot, false otherwise
*/
public static boolean isSpigot() {
return get() == SPIGOT;
}
}
Loading
Loading