Unofficial site, not affiliated with modrinth.com.What is this?
Плагины/Better Veinminer
Все версииBetter Veinminer 1.5.0

Better Veinminer 1.5.0

Release3 нед. назад

Список изменений

[1.5.0] — 2026-05-22

Fixed

  • [HIGH] Daily-limit counter not persisted — restart bypassdailyUsageTracker existed only in RAM. A server restart mid-day cleared the map to zero, allowing players who had already reached their daily cap to veinmine freely after any restart or plugin reload. The map is now saved to data.yml via the serialised BVM-StatsIO executor on shutdown and on every daily reset. It is restored during onEnable() before the reset check, so the data is properly cleared (not silently discarded) when a day boundary is crossed while the server was offline.

  • [HIGH] Blocking file I/O from async timer threadsaveLastResetDate() called YamlConfiguration.save() directly on the runTaskTimerAsynchronously thread, bypassing the BVM-StatsIO executor that serialises every other write in the plugin. This could race with onDisable() flushing the same file. The method is replaced by saveDataYmlAsync(), which snapshots both the reset date and usage counters on the calling thread and submits the actual I/O to the existing BVM-StatsIO executor.

  • [MEDIUM] Cooldown message with {remaining} placeholder never sent — When a player triggered veinmine while still on cooldown, the listener silently returned without feedback. The config already declared a cooldown message key with a {remaining} placeholder; it was simply never used. The remaining milliseconds are now calculated and the formatted message is sent to the player's action bar, matching the UX pattern of the success message.

  • [MEDIUM] Permission priority non-deterministic — VIP+Premium received random limitsgetEffectiveCooldown() and getEffectiveMaxBlocks() iterated HashMap whose entry order is not defined by Java. A player holding both betterveinminer.vip and betterveinminer.premium could receive either tier's limits depending on hash collisions that vary between JVM instances and restarts. The permissionMaxBlocks and permissionCooldowns maps are now LinkedHashMap instances whose entries are inserted during PluginConfig.reload() sorted by max-blocks descending. Iteration therefore always encounters the highest-privilege permission first.

  • [MEDIUM] Daily counter incremented before veinmine task confirmed successdailyUsageTracker was incremented in onBlockBreak() before VeinmineTask ran. If the BetterVeinmineEvent was cancelled by another plugin, or all extra blocks were denied by protection plugins (extraCount == 0), the player lost one daily use without breaking anything. The increment is now deferred to inside VeinmineTask.run(), executed only after extraCount > 0 is confirmed.

  • [MEDIUM] Cooldown cleanup evicted active entries for long per-ore cooldowns — The cleanup timer removed cooldowns entries older than config.getCooldownMs() (default 200 ms). If a per-ore cooldown (e.g. EMERALD_ORE: 1500) or a permission cooldown was longer than the base, an entry could be evicted while still within its own active window. The player's next break would find null in the map and bypass the cooldown. The timer now calls config.getMaxConfiguredCooldown(), which returns the maximum of the base, all per-ore, and all permission cooldown values.

  • [SMALL] breakNaturally(tool) used stale 1-tick-old tool snapshotVeinmineTask captured the held ItemStack at BlockBreakEvent time and used it for every breakNaturally() call one tick later. If a player legitimately swapped to a higher-Fortune pickaxe during that tick, all drops were calculated with the old tool's enchantments. The task now reads the item currently in the recorded slot at break time and falls back to the snapshot only if the slot is empty.

  • [SMALL] instance static field not cleared on disableonDisable() did not set instance = null. If a third-party plugin cached the return value of BetterVeinminer.getInstance() and called it after the plugin was disabled (e.g. during /reload), it received a fully torn-down instance whose statsManager and config fields had already been discarded, potentially causing NPEs. instance is now set to null as the last action in onDisable().

  • [SMALL] BFS visited set unbounded on abnormally large ore clusters — The BFS loop stopped adding to toBreak at maxBlocks, but continued enqueuing and visiting neighbours until the queue drained. On a world-gen-modded server with a massive ore deposit, visited could accumulate tens of thousands of entries in a single tick. A hard cap of maxBlocks × 4 entries is now enforced on the visited set; the loop breaks immediately when the cap is reached.

Changed

  • BetterVeinminer.onDisable() now flushes data.yml (daily usage + reset date) via saveDataYmlAsync() before calling statsManager.shutdown(), ensuring all data is written to the serialised executor queue before the 5-second drain begins.
  • StatsManager.getIoExecutor() added to expose the single-threaded executor to other components within the plugin.
  • PluginConfig.getMaxConfiguredCooldown() added to return the longest cooldown value across all configuration sources.
  • BetterVeinminer.getDailyUsageTracker() added to allow VeinmineTask (inner class) to increment the map after confirmed success, without requiring a public field.

Метаданные

Канал релиза

Release

Номер версии

1.5.0

Загрузчики

Bukkit
Paper
Purpur
Spigot

Версии игры

1.21–1.21.11

Загрузок

79

Дата публикации

3 нед. назад

Загрузил

ID версии

Главная