Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
12 changes: 8 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@ See [Blocks](https://github.com/EndlessCodeGroup/Mimic/blob/develop/mimic-bukkit
- Config option `disabled-block-registries` is renamed to `disabled-block-providers`, the old value is moved automatically.
- `/mimic blocks` requires block IDs with a namespace, `payload` argument of `/mimic blocks set` is renamed to `state`.

### Integrations

- New item and block providers: [ItemsAdder](https://www.spigotmc.org/resources/73355/) ([#49](https://github.com/EndlessCodeGroup/Mimic/issues/49)),
[Oraxen](https://github.com/oraxen/oraxen) ([#51](https://github.com/EndlessCodeGroup/Mimic/issues/51)).
- **Changed:** The `ia` items registry provided by ItemsAdder itself is not available via Items API, Mimic warns about it.
Use `itemsadder:ruby_sword` instead of `ia:itemsadder:ruby_sword`.


## [v0.10.0] (2026-11-15)

### Levels API
Expand Down Expand Up @@ -93,10 +101,6 @@ See [Resources](https://github.com/EndlessCodeGroup/Mimic/blob/develop/mimic-buk
- Added [Jobs Reborn](https://www.spigotmc.org/resources/4216/) levels provider ([#57](https://github.com/EndlessCodeGroup/Mimic/issues/57)).
- Added [Fabled](https://www.spigotmc.org/resources/91913/) levels and classes providers ([#48](https://github.com/EndlessCodeGroup/Mimic/issues/48)): class groups are slots and level tracks.
- Added [ValhallaMMO](https://modrinth.com/plugin/valhallammo) levels provider ([#99](https://github.com/EndlessCodeGroup/Mimic/issues/99)).
- Added [ItemsAdder](https://www.spigotmc.org/resources/73355/) items and blocks providers ([#49](https://github.com/EndlessCodeGroup/Mimic/issues/49)).
IDs are `itemsadder:ruby_sword` for the default `itemsadder` namespace and `itemsadder:my_items/ruby_sword` for others.
**Changed:** The `ia` items registry provided by ItemsAdder itself is not available via Items API, Mimic warns about it.
Use `itemsadder:ruby_sword` instead of `ia:itemsadder:ruby_sword`.
- MMOCore and Heroes support Levels and Classes API natively: class and profession levels, class slots and subclasses.
This fixes class IDs in MMOCore ([#78](https://github.com/EndlessCodeGroup/Mimic/issues/78)) and reporting class history as classes in Heroes ([#79](https://github.com/EndlessCodeGroup/Mimic/issues/79)).
- Fixed MMOCore experience to reach a level in the deprecated `LevelSystem` API ([#76](https://github.com/EndlessCodeGroup/Mimic/issues/76)).
Expand Down
4 changes: 2 additions & 2 deletions MODRINTH.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ That's it. Mimic detects installed RPG plugins automatically.
| **Levels** | Vanilla experience, AuraSkills, mcMMO, ValhallaMMO, Jobs Reborn, MMOCore, Heroes, Fabled |
| **Classes** | MMOCore, Heroes, Fabled |
| **Resources** | Vanilla health, food and air, MMOCore, Heroes, AuraSkills, Fabled |
| **Items** | Vanilla items, CraftEngine, MMOItems, CustomItems, ItemsAdder, RPGInventory¹ |
| **Blocks** | Vanilla blocks, CraftEngine, ItemsAdder |
| **Items** | Vanilla items, CraftEngine, Oraxen, MMOItems, CustomItems, ItemsAdder, RPGInventory¹ |
| **Blocks** | Vanilla blocks, CraftEngine, ItemsAdder, Oraxen |
| **Inventory** | Vanilla inventory, RPGInventory¹ |

¹ Support is provided by the plugin itself.
Expand Down
3 changes: 3 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ mmoitems = "6.10.1-SNAPSHOT"
mythiclib = "1.7.1-SNAPSHOT"
heroes = "1.9.30-RELEASE"
craftengine = "26.9.1"
oraxen = "1.220.1"
auraskills = "2.4.0"
mcmmo = "2.3.002"
jobs = "5.2.6.3"
Expand Down Expand Up @@ -50,6 +51,7 @@ rpgplugins-mythiclib = { module = "io.lumine:MythicLib-dist", version.ref = "myt
rpgplugins-heroes = { module = "com.herocraftonline.heroes:Heroes", version.ref = "heroes" }
rpgplugins-craftengine-core = { module = "net.momirealms:craft-engine-core", version.ref = "craftengine" }
rpgplugins-craftengine-bukkit = { module = "net.momirealms:craft-engine-bukkit", version.ref = "craftengine" }
rpgplugins-oraxen = { module = "io.th0rgal:oraxen", version.ref = "oraxen" }
rpgplugins-auraskills = { module = "dev.aurelium:auraskills-api", version.ref = "auraskills" }
rpgplugins-mcmmo = { module = "com.gmail.nossr50.mcMMO:mcMMO", version.ref = "mcmmo" }
rpgplugins-jobs = { module = "com.github.Zrips:Jobs", version.ref = "jobs" }
Expand Down Expand Up @@ -88,6 +90,7 @@ rpgplugins = [
"rpgplugins-heroes",
"rpgplugins-craftengine-core",
"rpgplugins-craftengine-bukkit",
"rpgplugins-oraxen",
"rpgplugins-auraskills",
"rpgplugins-mcmmo",
"rpgplugins-jobs",
Expand Down
11 changes: 11 additions & 0 deletions mimic-bukkit/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,11 @@ Providers marked with _(deprecated API)_ are provided by the plugin itself via t
**ID Format:** `craftengine:[namespace]/[id]`\
**Payload:** *Not supported*

#### [Oraxen]

**ID Format:** `oraxen:[id]`\
**Payload:** *Not supported*

#### [CustomItems]

**ID Format:** `customitems:[id]`\
Expand Down Expand Up @@ -143,6 +148,11 @@ A block belongs to the provider with the highest priority that recognizes it, va
**ID Format:** `itemsadder:[id]` for the default `itemsadder` namespace, `itemsadder:[namespace]/[id]` for others\
**State:** *Not supported*

#### [Oraxen]

**ID Format:** `oraxen:[id]`, where ID is the ID of the item placing the block\
**State:** *Not supported*

[minecraft-exp]: https://minecraft.fandom.com/wiki/Experience
[minecraft-inv]: https://minecraft.fandom.com/wiki/Inventory
[item-components]: https://minecraft.wiki/w/Data_component_format
Expand All @@ -155,6 +165,7 @@ A block belongs to the provider with the highest priority that recognizes it, va
[rpginventory]: https://www.spigotmc.org/resources/12498/
[itemsadder]: https://www.spigotmc.org/resources/73355/
[craftengine]: https://modrinth.com/plugin/craftengine
[oraxen]: https://github.com/oraxen/oraxen
[auraskills]: https://modrinth.com/plugin/auraskills
[mcmmo]: https://www.spigotmc.org/resources/64348/
[jobs reborn]: https://www.spigotmc.org/resources/4216/
Expand Down
18 changes: 7 additions & 11 deletions mimic-bukkit/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ bukkit {
"MMOItems",
"Heroes",
"CraftEngine",
"Oraxen",
"AuraSkills",
"mcMMO",
"Jobs",
Expand Down Expand Up @@ -57,6 +58,11 @@ repositories {
includeGroup("net.momirealms")
}
}
maven(url = "https://repo.oraxen.com/releases/") {
content {
includeGroup("io.th0rgal")
}
}
maven(url = "https://nexus.neetgames.com/repository/maven-releases/") {
content {
includeGroup("com.gmail.nossr50.mcMMO")
Expand Down Expand Up @@ -99,18 +105,8 @@ dependencies {
compileOnly(":CustomItemsAPI")

testImplementation(libs.paperApi)
testImplementation(libs.rpgplugins.auraskills)
testImplementation(libs.rpgplugins.mcmmo) { isTransitive = false }
testImplementation(libs.rpgplugins.jobs) { isTransitive = false }
testImplementation(libs.bundles.rpgplugins) { isTransitive = false }
testImplementation(libs.rpgplugins.cmilib) { isTransitive = false }
testImplementation(libs.rpgplugins.valhallammo) { isTransitive = false }
testImplementation(libs.rpgplugins.heroes) { isTransitive = false }
testImplementation(libs.rpgplugins.mmocore) { isTransitive = false }
testImplementation(libs.rpgplugins.mmoitems) { isTransitive = false }
testImplementation(libs.rpgplugins.mythiclib) { isTransitive = false }
testImplementation(libs.rpgplugins.fabled) { isTransitive = false }
testImplementation(libs.rpgplugins.codex) { isTransitive = false }
testImplementation(libs.rpgplugins.itemsadder)
}

kotlin {
Expand Down
7 changes: 7 additions & 0 deletions mimic-bukkit/src/main/kotlin/MimicPlugin.kt
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ import ru.endlesscode.mimic.impl.mmocore.MmoCoreLevelSystem
import ru.endlesscode.mimic.impl.mmocore.MmoCoreResourceProvider
import ru.endlesscode.mimic.impl.mmoitems.MmoItemsItemProvider
import ru.endlesscode.mimic.impl.mmoitems.MmoItemsRegistry
import ru.endlesscode.mimic.impl.oraxen.OraxenBlockProvider
import ru.endlesscode.mimic.impl.oraxen.OraxenItemProvider
import ru.endlesscode.mimic.impl.valhallammo.ValhallaMmoLevelProvider
import ru.endlesscode.mimic.impl.vanilla.*
import ru.endlesscode.mimic.internal.Log
Expand Down Expand Up @@ -128,6 +130,11 @@ public class MimicPlugin : JavaPlugin() {
hookBlocks(::CraftEngineBlockProvider)
}

pluginHooks("Oraxen", "io.th0rgal.oraxen.api.OraxenBlocks") {
hookItems(::OraxenItemProvider)
hookBlocks(::OraxenBlockProvider)
}

pluginHooks("AuraSkills", "dev.aurelium.auraskills.api.AuraSkillsApi") {
hookLevels(::AuraSkillsLevelProvider)
hookResources(::AuraSkillsResourceProvider)
Expand Down
80 changes: 80 additions & 0 deletions mimic-bukkit/src/main/kotlin/impl/oraxen/OraxenBlockProvider.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
// Copyright (c) 2026 Osip Fatkullin, EndlessCode Group and contributors
// SPDX-License-Identifier: MIT

package ru.endlesscode.mimic.impl.oraxen

import org.bukkit.block.Block
import org.bukkit.inventory.ItemStack
import ru.endlesscode.mimic.blocks.BlockProvider
import ru.endlesscode.mimic.blocks.DropsConsumer
import ru.endlesscode.mimic.internal.Log
import java.util.concurrent.ConcurrentHashMap

/**
* Block provider for Oraxen custom blocks. Furniture is not a block.
* ID of a block is the ID of the Oraxen item placing it, converted in the same way as in [OraxenItemProvider].
* Variants of a directional block have the ID of their parent block.
* Block states are not supported in [setBlock], every state is invalid.
*
* Drops in [breakBlock] are rolled from the Oraxen drop configured for the tool.
* Without a tool, requirements of the drop are treated as satisfied,
* but the drop is the one configured for an empty hand:
* Oraxen has no API to select a breaking rule requiring a tool without this tool.
*
* Contents of Oraxen storage blocks are dropped on the ground by Oraxen when the block is removed,
* so [breakBlock] doesn't pass them to the drops consumer.
* Oraxen has no API to take these items before removal.
*/
internal class OraxenBlockProvider(
private val oraxen: OraxenWrapper = OraxenWrapper(),
) : BlockProvider {

private val skippedIds = ConcurrentHashMap.newKeySet<String>()

override val id: String = ID
override val isEnabled: Boolean get() = oraxen.isEnabled

override val allBlocks: Collection<String>
get() = blocksByMimicId().keys

override fun hasBlock(blockId: String): Boolean = findBlock(blockId) != null

override fun getBlockId(block: Block): String? = oraxen.getBlockId(block)?.toMimicId()

override fun getBlockIdFromItem(item: ItemStack): String? =
oraxen.getItemId(item)?.takeIf(oraxen::isBlock)?.toMimicId()

override fun createBlockItem(blockId: String, amount: Int): ItemStack? {
val oraxenId = findBlock(blockId) ?: return null
return oraxen.createItem(oraxenId)?.also { it.amount = amount }
}

override fun setBlock(block: Block, blockId: String, state: String?): Boolean {
val oraxenId = findBlock(blockId) ?: return false
if (state != null) {
Log.w("[$TAG] Invalid state for block $blockId: $state")
return false
}
return oraxen.placeBlock(block, oraxenId)
}

override fun breakBlock(block: Block, tool: ItemStack?, dropsConsumer: DropsConsumer): Boolean {
val drops = oraxen.getDrops(block, tool) ?: return false
if (!oraxen.removeBlock(block)) return false

for (item in dropsConsumer.consume(drops)) {
block.world.dropItemNaturally(block.location, item)
}
return true
}

private fun findBlock(blockId: String): String? =
if (oraxen.isBlock(blockId)) blockId else blocksByMimicId()[blockId]

private fun blocksByMimicId(): Map<String, String> = mimicIdsMap(oraxen.blockIds, skippedIds, TAG)

companion object {
const val ID: String = "oraxen"
private const val TAG = "OraxenBlockProvider"
}
}
46 changes: 46 additions & 0 deletions mimic-bukkit/src/main/kotlin/impl/oraxen/OraxenItemProvider.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
// Copyright (c) 2026 Osip Fatkullin, EndlessCode Group and contributors
// SPDX-License-Identifier: MIT

package ru.endlesscode.mimic.impl.oraxen

import org.bukkit.entity.Player
import org.bukkit.inventory.ItemStack
import ru.endlesscode.mimic.items.ItemProvider
import java.util.concurrent.ConcurrentHashMap

/**
* Item provider for Oraxen custom items.
* Oraxen IDs are lowercased, characters not allowed in item ID are replaced with `_`: `Ruby Sword` -> `ruby_sword`.
* If two IDs become the same, only one of the items is available.
* Takes no payload, items don't depend on a player.
*/
internal class OraxenItemProvider(
private val oraxen: OraxenWrapper = OraxenWrapper(),
) : ItemProvider {

private val skippedIds = ConcurrentHashMap.newKeySet<String>()

override val id: String = ID
override val isEnabled: Boolean get() = oraxen.isEnabled

override val allItems: Collection<String>
get() = itemsByMimicId().keys

override fun hasItem(itemId: String): Boolean = findItem(itemId) != null

override fun getItemId(item: ItemStack): String? = oraxen.getItemId(item)?.toMimicId()

override fun createItem(itemId: String, amount: Int, player: Player?, payload: String?): ItemStack? {
val oraxenId = findItem(itemId) ?: return null
return oraxen.createItem(oraxenId)?.also { it.amount = amount }
}

private fun findItem(itemId: String): String? = if (oraxen.hasItem(itemId)) itemId else itemsByMimicId()[itemId]

private fun itemsByMimicId(): Map<String, String> = mimicIdsMap(oraxen.itemIds, skippedIds, TAG)

companion object {
const val ID: String = "oraxen"
private const val TAG = "OraxenItemProvider"
}
}
Loading
Loading