Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
54c5657
chore(deps): update actions/checkout action to v6.0.2 (#60)
renovate[bot] Jan 31, 2026
306a039
chore(deps): update plugin shadow to v9.3.1 (#61)
renovate[bot] Jan 31, 2026
dcb498d
fix(deps): update dependency com.github.retrooper:packetevents-spigot…
renovate[bot] Jan 31, 2026
417b1cf
fix(deps): update dependency com.velocitypowered:velocity-api to v3.4…
renovate[bot] Jan 31, 2026
0e88a43
chore(deps): update actions/setup-node action to v6.2.0 (#64)
renovate[bot] Jan 31, 2026
d125f76
chore(deps): update gradle to v9.3.1 (#65)
renovate[bot] Jan 31, 2026
339778b
fix(deps): update velocity-api to v3.5.0-SNAPSHOT and upgrade Java la…
0xSoul24 Jan 31, 2026
70b1ae9
fix(listeners): update subscription priority for disconnect and login…
0xSoul24 Jan 31, 2026
f9f39ff
refactor: optimize project property access in processResources task
0xSoul24 Jan 31, 2026
8340b6d
feat(deps): add SpotBugs annotations to dependencies
0xSoul24 Feb 1, 2026
b25f5d0
fix(skull): update method calls to use new player profile API
0xSoul24 Feb 1, 2026
7edd3c3
fix(items): update CustomModelData handling to use new API in CustomI…
0xSoul24 Feb 1, 2026
79cc304
fix(logging): replace printStackTrace with logging for error handling…
0xSoul24 Feb 1, 2026
89a666d
fix(editorconfig): update Kotlin and Java formatting settings for imp…
0xSoul24 Feb 1, 2026
2f22ba0
refactor(enchantments): remove EnchantmentTarget from VaneEnchantment…
0xSoul24 Feb 1, 2026
8e38182
feat(resourcepack): add stop methods to ResourcePackDevServer and Res…
0xSoul24 Feb 20, 2026
7c4f583
fix(deps): update bstats to v3.2.1 (#66)
renovate[bot] Feb 25, 2026
10f22c6
fix(deps): update dependency com.github.spotbugs:spotbugs-annotations…
renovate[bot] Feb 25, 2026
4e5d251
fix(deps): update dependency org.jetbrains:annotations to v26.1.0 (#68)
renovate[bot] Feb 25, 2026
2ff4c9e
Update editorconfig file
0xSoul24 Feb 28, 2026
9df70d4
chore(deps): update plugin shadow to v9.3.2 (#69)
renovate[bot] Mar 6, 2026
76e936d
chore(deps): update actions/setup-node action to v6.3.0 (#70)
renovate[bot] Mar 6, 2026
7ff531a
chore(deps): update actions/upload-artifact action to v7 (#71)
renovate[bot] Mar 6, 2026
0342497
chore(deps): update gradle to v9.4.0 (#72)
renovate[bot] Mar 6, 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
476 changes: 261 additions & 215 deletions .editorconfig

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:

- name: Upload JAR
if: ${{ github.event_name != 'pull_request'}}
uses: actions/upload-artifact@v6
uses: actions/upload-artifact@v7
with:
name: vane-${{ matrix.project }}-${{ env.git_hash }}.jar
path: target/vane-${{ matrix.project }}-*.jar
4 changes: 2 additions & 2 deletions .github/workflows/lint-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ jobs:
if: always() && github.repository == 'oddlama/vane'

steps:
- uses: actions/checkout@v6.0.1
- uses: actions/checkout@v6.0.2
with:
fetch-depth: 0
persist-credentials: false
ref: ${{ github.event.pull_request.head.sha }}

- uses: actions/setup-node@v6.1.0
- uses: actions/setup-node@v6.3.0
with:
node-version: 24
- run: |
Expand Down
15 changes: 9 additions & 6 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[versions]
paper = "1.21.11-R0.1-SNAPSHOT"
bstats = "3.1.0"
bstats = "3.2.1"

[libraries]
annotations = {group = "org.jetbrains", name = "annotations", version = "26.0.2-1"}
annotations = {group = "org.jetbrains", name = "annotations", version = "26.1.0"}
reflections = {group = "org.reflections", name = "reflections", version = "0.10.2"}
commonsLang = {group = "org.apache.commons", name = "commons-lang3", version = "3.20.0"}
commonsText = {group = "org.apache.commons", name = "commons-text", version = "1.15.0"}
Expand All @@ -16,8 +16,11 @@ bstatsBase = {group = "org.bstats", name = "bstats-base", version.ref = "bstats"
bstatsBukkit = {group = "org.bstats", name = "bstats-bukkit", version.ref = "bstats"}
bstatsVelocity = {group = "org.bstats", name = "bstats-velocity", version.ref = "bstats"}
vault = {group = "com.github.MilkBowl", name = "VaultAPI", version = "1.7.1"}
velocity = {group = "com.velocitypowered", name = "velocity-api", version = "3.4.0-SNAPSHOT"}
packetEvents = {group = "com.github.retrooper", name = "packetevents-spigot", version = "2.11.1"}
velocity = {group = "com.velocitypowered", name = "velocity-api", version = "3.5.0-SNAPSHOT"}
packetEvents = {group = "com.github.retrooper", name = "packetevents-spigot", version = "2.11.2"}

# spotbugs / findbugs annotations (avoids missing annotation warnings)
spotbugsAnnotations = {group = "com.github.spotbugs", name = "spotbugs-annotations", version = "4.9.8"}

# maps
dynmap = {group = "us.dynmap", name = "DynmapCoreAPI", version = "3.7-beta-6"}
Expand All @@ -26,5 +29,5 @@ bluemap = {group = "de.bluecolored", name = "bluemap-api", version = "2.7.7"}
[plugins]
paperweightUserdev = {id = "io.papermc.paperweight.userdev", version = "2.0.0-beta.19"}
runPaper = {id = "xyz.jpenilla.run-paper", version = "3.0.2"}
shadow = {id = "com.gradleup.shadow", version = "9.3.0"}
blossom = {id = "net.kyori.blossom", version = "2.2.0"}
shadow = {id = "com.gradleup.shadow", version = "9.3.2"}
blossom = {id = "net.kyori.blossom", version = "2.2.0"}
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.0-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
2 changes: 1 addition & 1 deletion gradlew

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import org.bukkit.enchantments.EnchantmentTarget;

@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
Expand All @@ -23,7 +22,6 @@

boolean generate_in_treasure() default false;

EnchantmentTarget target() default EnchantmentTarget.BREAKABLE;

boolean allow_custom() default false;
}
4 changes: 3 additions & 1 deletion vane-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ val resource_pack_sha1 by lazy {
sha1_hash_string
}

val projectProperties = project.properties

tasks {
shadowJar {
dependencies {
Expand All @@ -58,7 +60,7 @@ tasks {

processResources {
filesMatching("vane-core.properties") {
expand(project.properties + mapOf("resource_pack_sha1" to resource_pack_sha1))
expand(projectProperties + mapOf("resource_pack_sha1" to resource_pack_sha1))
}
}
}
2 changes: 1 addition & 1 deletion vane-core/src/main/java/org/oddlama/vane/core/Core.java
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ public void unfreeze_registries() {
);
// Since 1.20.2 this is also needed for enchantments:
} catch (NoSuchFieldException | SecurityException | IllegalArgumentException | IllegalAccessException e) {
e.printStackTrace();
log.log(Level.SEVERE, "Failed to unfreeze registries", e);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import net.kyori.adventure.text.format.TextDecoration;
import org.bukkit.NamespacedKey;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.enchantments.EnchantmentTarget;
import org.bukkit.inventory.ItemStack;
import org.jetbrains.annotations.NotNull;
import org.oddlama.vane.annotation.enchantment.Rarity;
Expand Down Expand Up @@ -176,15 +175,6 @@ public final boolean generate_in_treasure() {
return annotation.generate_in_treasure();
}

/**
* Determines which item types this enchantment can be applied to. {@link
* #can_enchant(ItemStack)} can be used to further limit the applicable items. Always reflects
* the annotation value {@link VaneEnchantment#target()}.
*/
public final EnchantmentTarget target() {
return annotation.target();
}

/**
* Determines the enchantment rarity. Always reflects the annotation value {@link
* VaneEnchantment#rarity()}.
Expand All @@ -208,13 +198,11 @@ public boolean is_compatible(@NotNull Enchantment other) {

/**
* Determines if this enchantment can be applied to the given item. By default, this returns
* true if the {@link #target()} category includes the given itemstack. Unfortunately, this
* method cannot be used to widen the allowed items, just to narrow it (limitation due to
* minecraft server internals). So for best results, always check super.can_enchant first when
* overriding.
* true for all items. Item compatibility is now primarily managed by tags in the registry system.
* This method can still be used for additional custom validation if needed.
*/
public boolean can_enchant(@NotNull ItemStack item_stack) {
return annotation.target().includes(item_stack);
return true;
}

public RecipeList default_recipes() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import org.oddlama.vane.core.Core;
import org.oddlama.vane.core.item.api.CustomItem;
import org.oddlama.vane.util.StorageUtil;
import java.util.List;

public class CustomItemHelper {

Expand All @@ -22,16 +23,20 @@ public class CustomItemHelper {
public static final NamespacedKey CUSTOM_ITEM_VERSION = StorageUtil.namespaced_key("vane", "custom_item_version");

/**
* Internal function. Used as a dispatcher to update internal information and then call {@link
* #updateItemStack(ItemStack)} to let the user update information. This prevents problems with
* information de-sync in case the user would forget to call super.
* Internal function. Acts as a dispatcher that updates internal metadata on the provided
* ItemStack (persistent-data tags, model data, durability) and then calls the
* CustomItem-specific update method so subclasses can apply any additional changes.
* This prevents information de-sync in case a subclass forgets to call super.
*/
public static ItemStack updateItemStack(final CustomItem customItem, @NotNull final ItemStack itemStack) {
itemStack.editMeta(meta -> {
final var data = meta.getPersistentDataContainer();
data.set(CUSTOM_ITEM_IDENTIFIER, PersistentDataType.STRING, customItem.key().toString());
data.set(CUSTOM_ITEM_VERSION, PersistentDataType.INTEGER, customItem.version());
meta.setCustomModelData(customItem.customModelData());
// Use the new CustomModelDataComponent API instead of the deprecated setCustomModelData(Integer).
final var customModelDataComponent = meta.getCustomModelDataComponent();
customModelDataComponent.setFloats(List.of((float) customItem.customModelData()));
meta.setCustomModelDataComponent(customModelDataComponent);
});

DurabilityManager.initialize_or_update_max(customItem, itemStack);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,14 @@ private void process_inventory(@NotNull Inventory inventory) {
// Update custom items to a new version, or if another detectable property changed.
final var key_and_version = CustomItemHelper.customItemTagsFromItemStack(is);
final var meta = is.getItemMeta();
final var modelDataList = meta.getCustomModelDataComponent().getFloats();
final Integer modelDataInt = (!modelDataList.isEmpty() && modelDataList.getFirst() != null)
? modelDataList.getFirst().intValue()
: null;

if (
meta.getCustomModelData() != custom_item.customModelData() ||
modelDataInt == null ||
modelDataInt != custom_item.customModelData() ||
is.getType() != custom_item.baseMaterial() ||
key_and_version.getRight() != custom_item.version()) {
// Also includes durability max update.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,37 @@ public class ResourcePackDevServer implements HttpHandler {

private final ResourcePackDistributor resource_pack_distributor;
private final File file;
private HttpServer httpServer;

public ResourcePackDevServer(ResourcePackDistributor resource_pack_distributor, File file) {
this.resource_pack_distributor = resource_pack_distributor;
this.file = file;
}

public void stop() {
if (httpServer != null) {
httpServer.stop(0);
httpServer = null;
}
}

@SuppressWarnings({ "deprecation", "UnstableApiUsage" })
public void serve() {
try {
final HttpServer httpServer = HttpServer.create(new InetSocketAddress(9000), 0);
httpServer = HttpServer.create(new InetSocketAddress(9000), 0);
var hash = com.google.common.io.Files.asByteSource(this.file).hash(Hashing.sha1());
resource_pack_distributor.pack_sha1 = hash.toString();
resource_pack_distributor.pack_url = "http://localhost:9000/vane-resource-pack.zip";

httpServer.createContext("/", this);
httpServer.setExecutor(null);
httpServer.start();
this.httpServer.createContext("/", this);
this.httpServer.setExecutor(null);
this.httpServer.start();
} catch (IOException e) {
e.printStackTrace();
resource_pack_distributor.get_module().log.log(
java.util.logging.Level.SEVERE,
"Failed to start resource pack dev server",
e
);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,12 @@ public void on_enable() {
dev_server = new ResourcePackDevServer(this, pack_output);
dev_server.serve();
file_watcher.watch_for_changes();
} catch (IOException | InterruptedException ignored) {
ignored.printStackTrace();
} catch (IOException | InterruptedException e) {
get_module().log.log(
java.util.logging.Level.SEVERE,
"Failed to initialize resource pack dev server or file watcher",
e
);
}

get_module().log.info("Setting up dev lazy server");
Expand Down Expand Up @@ -146,6 +150,26 @@ public void on_enable() {
}
}

@Override
public void on_disable() {
// Release all pending configuration latches so blocked threads can exit
for (var latch : latches.values()) {
latch.countDown();
}
latches.clear();

if (file_watcher != null) {
file_watcher.stop();
file_watcher = null;
}
if (dev_server != null) {
dev_server.stop();
dev_server = null;
}

super.on_disable();
}

@EventHandler
public void on_player_async_connection_configure(AsyncPlayerConnectionConfigureEvent event) {
var profile_uuid = event.getConnection().getProfile().getId();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ public class ResourcePackFileWatcher {

private final ResourcePackDistributor resource_pack_distributor;
private final File file;
private WatchService eyes;
private org.bukkit.scheduler.BukkitTask watchTask;

public ResourcePackFileWatcher(ResourcePackDistributor resource_pack_distributor, File file)
throws IOException, InterruptedException {
Expand All @@ -27,11 +29,24 @@ public void watch_for_changes() throws IOException {
var lang_file_match = FileSystems.getDefault().getPathMatcher("glob:**/lang-*.yml");
register_directories(Paths.get("plugins"), eyes, this::is_vane_module_folder);

watch_async(eyes, lang_file_match, this::update_and_send_resource_pack).runTaskAsynchronously(
watchTask = watch_async(eyes, lang_file_match, this::update_and_send_resource_pack).runTaskAsynchronously(
resource_pack_distributor.get_module()
);
}

public void stop() {
if (watchTask != null) {
watchTask.cancel();
watchTask = null;
}
if (eyes != null) {
try {
eyes.close();
} catch (IOException ignored) {}
eyes = null;
}
}

private void update_and_send_resource_pack() {
resource_pack_distributor.counter++;
resource_pack_distributor.get_module().generate_resource_pack();
Expand Down Expand Up @@ -73,8 +88,11 @@ public void run() {
final WatchKey key;
try {
key = eyes.take();
} catch (java.nio.file.ClosedWatchServiceException e) {
return;
} catch (InterruptedException e) {
throw new RuntimeException(e);
Thread.currentThread().interrupt();
return;
}
// process events
for (WatchEvent<?> event : key.pollEvents()) {
Expand Down
4 changes: 2 additions & 2 deletions vane-core/src/main/java/org/oddlama/vane/util/BlockUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -345,12 +345,12 @@ public static RaytraceDominantFaceResult raytrace_dominant_face(final LivingEnti
}

public static String texture_from_skull(final Skull skull) {
final var profile = skull.getPlayerProfile();
final var profile = skull.getProfile();
if (profile == null) {
return null;
}

for (final var property : profile.getProperties()) {
for (final var property : profile.properties()) {
if ("textures".equals(property.getName())) {
return property.getValue();
}
Expand Down
Loading