Skip to content

Commit caaac45

Browse files
authored
Merge pull request #10 from EndlessCodeGroup/version/0.3
Version 0.3
2 parents 953e6f2 + fed50ef commit caaac45

File tree

57 files changed

+595
-289
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+595
-289
lines changed

README.md

Lines changed: 40 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# MimicAPI [![Build Status](https://img.shields.io/github/workflow/status/EndlessCodeGroup/MimicAPI/CI?style=flat-square)](https://travis-ci.org/EndlessCodeGroup/MimicAPI) [![Test Coverage](https://img.shields.io/codacy/coverage/cfb98bfdf2b44b9d97f719f051e943a9.svg?style=flat-square)](https://www.codacy.com/app/EndlessCode-Group/MimicAPI?utm_source=github.com&utm_medium=referral&utm_content=EndlessCodeGroup/MimicAPI&utm_campaign=Badge_Coverage) [![Code Quality](https://img.shields.io/codacy/grade/cfb98bfdf2b44b9d97f719f051e943a9.svg?style=flat-square)](https://www.codacy.com/app/EndlessCode-Group/MimicAPI?utm_source%3Dgithub.com%26amp;utm_medium%3Dreferral%26amp;utm_content%3DEndlessCodeGroup/MimicAPI%26amp;utm_campaign%3DBadge_Grade)
2-
1+
# MimicAPI
2+
[![Download](https://img.shields.io/bintray/v/endlesscode/repo/mimic?style=flat-square)](https://bintray.com/endlesscode/repo/mimic/_latestVersion) [![Build Status](https://img.shields.io/github/workflow/status/EndlessCodeGroup/MimicAPI/CI?style=flat-square)](https://travis-ci.org/EndlessCodeGroup/MimicAPI) [![Code Quality](https://img.shields.io/codacy/grade/cfb98bfdf2b44b9d97f719f051e943a9.svg?style=flat-square)](https://www.codacy.com/app/EndlessCode-Group/MimicAPI?utm_source%3Dgithub.com%26amp;utm_medium%3Dreferral%26amp;utm_content%3DEndlessCodeGroup/MimicAPI%26amp;utm_campaign%3DBadge_Grade)
33
[![license](https://img.shields.io/github/license/EndlessCodeGroup/MimicAPI.svg?style=flat-square)](LICENSE)
44

5-
[![Logo](images/logo.png)]()
5+
[![Logo](images/logo.png)](#)
66

77
Abstraction API for RPG plugins.
88

@@ -24,6 +24,38 @@ With Mimic you don't need to download all RPG plugins and write specified code f
2424
It also provides commands to test your API implementation.
2525
Use it as example of Mimic APIs usage and implementation.
2626

27+
## Installation
28+
29+
If you are server owner, just get needed plugin from [Implementations](#implementations) section.
30+
If you are developer you can use [Gradle] or [Maven] to plug MimicAPI to your plugin.
31+
32+
### Gradle
33+
34+
```groovy
35+
repositories {
36+
maven { url "https://dl.bintray.com/endlesscode/repo" }
37+
}
38+
39+
dependencies {
40+
compileOnly("ru.endlesscode.mimic:mimic-bukkit-api:0.3")
41+
}
42+
```
43+
44+
### Maven
45+
```xml
46+
<repository>
47+
<id>bintray-endlesscode-repo</id>
48+
<url>https://dl.bintray.com/endlesscode/repo</url>
49+
</repository>
50+
51+
<dependency>
52+
<groupId>ru.endlesscode.mimic</groupId>
53+
<artifactId>mimic-bukkit-api</artifactId>
54+
<version>0.3</version>
55+
<scope>provided</scope>
56+
</dependency>
57+
```
58+
2759
## Usage
2860

2961
> Look [Implementations](#implementations) pages for API usage examples for your platform.
@@ -35,7 +67,9 @@ For major changes, please open an issue first to discuss what you would like to
3567
Please make sure to update tests as appropriate.
3668

3769
[Vault]: https://github.com/MilkBowl/Vault
70+
[Gradle]: https://gradle.org/
71+
[Maven]: https://maven.apache.org/
3872

39-
[LevelSystem]: mimic-api/src/main/kotlin/LevelSystem.kt
40-
[ClassSystem]: mimic-api/src/main/kotlin/ClassSystem.kt
41-
[ItemsRegistry]: mimic-api/src/main/kotlin/ItemsRegistry.kt
73+
[LevelSystem]: mimic-api/src/main/kotlin/level/LevelSystem.kt
74+
[ClassSystem]: mimic-api/src/main/kotlin/classes/ClassSystem.kt
75+
[ItemsRegistry]: mimic-api/src/main/kotlin/items/ItemsRegistry.kt

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ plugins {
66

77
// Common configurations for all Mimic projects
88
subprojects {
9-
version = "0.2"
9+
version = "0.3"
1010
group = "ru.endlesscode.mimic"
1111

1212
configureProject()

buildSrc/src/main/kotlin/dependencies.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,12 @@
1818

1919
object Dependencies {
2020
// RPG Plugins
21-
const val skillApi = "com.sucy:SkillAPI:3.102"
22-
const val battleLevelsApi = "me.robin.battlelevels:battlelevels-api:6.9.1"
21+
const val skillapi = "com.sucy:SkillAPI:3.102"
22+
const val battlelevels = "me.robin.battlelevels:battlelevels-api:6.9.1"
2323

2424
// Libs
2525
const val acf = "co.aikar:acf-paper:0.5.0-SNAPSHOT"
26+
const val bstats_bukkit = "org.bstats:bstats-bukkit:1.7"
2627

2728
// Testing
2829
private const val jupiter_version = "5.6.2"

mimic-api/src/main/kotlin/ClassSystem.kt renamed to mimic-api/src/main/kotlin/classes/ClassSystem.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* along with MimicAPI. If not, see <http://www.gnu.org/licenses/>.
1818
*/
1919

20-
package ru.endlesscode.mimic
20+
package ru.endlesscode.mimic.classes
2121

2222
/**
2323
* System that provides methods to work with player's class.

mimic-api/src/main/kotlin/ItemsRegistry.kt renamed to mimic-api/src/main/kotlin/items/ItemsRegistry.kt

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,27 @@
11
/*
2-
* This file is part of MimicAPI.
2+
* This file is part of Mimic.
33
* Copyright (C) 2020 Osip Fatkullin
44
* Copyright (C) 2020 EndlessCode Group and contributors
55
*
6-
* MimicAPI is free software: you can redistribute it and/or modify
6+
* Mimic is free software: you can redistribute it and/or modify
77
* it under the terms of the GNU Lesser General Public License as published by
88
* the Free Software Foundation, either version 3 of the License, or
99
* (at your option) any later version.
1010
*
11-
* MimicAPI is distributed in the hope that it will be useful,
11+
* Mimic is distributed in the hope that it will be useful,
1212
* but WITHOUT ANY WARRANTY; without even the implied warranty of
1313
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1414
* GNU Lesser General Public License for more details.
1515
*
1616
* You should have received a copy of the GNU Lesser General Public License
17-
* along with MimicAPI. If not, see <http://www.gnu.org/licenses/>.
17+
* along with Mimic. If not, see <http://www.gnu.org/licenses/>.
1818
*/
1919

20-
package ru.endlesscode.mimic
20+
package ru.endlesscode.mimic.items
2121

22-
/** Service for getting items by theirs ID. Also can be used to match id with item. */
22+
import ru.endlesscode.mimic.MimicService
23+
24+
/** Service for getting items by theirs ID. Also can be used to match ID with item. */
2325
interface ItemsRegistry<ItemStackT : Any> : MimicService {
2426

2527
/** Returns all known item IDs. */
@@ -32,15 +34,15 @@ interface ItemsRegistry<ItemStackT : Any> : MimicService {
3234
/** Returns `true` if item with given [itemId] exists. */
3335
fun isItemExists(itemId: String): Boolean
3436

35-
/** Returns id that represents given [item], or `null` if the id not found. */
37+
/** Returns ID representing given [item], or `null` if the ID not found in this registry. */
3638
fun getItemId(item: ItemStackT): String?
3739

38-
/** Returns item by given [itemId], or `null` if id not found. */
40+
/** Returns item by given [itemId], or `null` if the ID not found in this registry. */
3941
@JvmDefault
4042
fun getItem(itemId: String): ItemStackT? = getItem(itemId, amount = 1)
4143

4244
/**
43-
* Returns specified item stack with specified [amount] by given [itemId], or `null` if id not found.
45+
* Returns item stack with specified [amount] by given [itemId], or `null` if ID not found in this registry.
4446
*
4547
* If given [amount] is greater than maximum possible, will use maximum possible amount.
4648
* Amount shouldn't be less than `1`.

mimic-api/src/main/kotlin/ExpLevelConverter.kt renamed to mimic-api/src/main/kotlin/level/ExpLevelConverter.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* along with MimicAPI. If not, see <http://www.gnu.org/licenses/>.
1818
*/
1919

20-
package ru.endlesscode.mimic
20+
package ru.endlesscode.mimic.level
2121

2222
/** Entity that contains all methods needed to convert levels to exp and vice versa. */
2323
interface ExpLevelConverter {

mimic-api/src/main/kotlin/LevelSystem.kt renamed to mimic-api/src/main/kotlin/level/LevelSystem.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
/*
2-
* This file is part of MimicAPI.
2+
* This file is part of Mimic.
33
* Copyright (C) 2020 Osip Fatkullin
44
* Copyright (C) 2020 EndlessCode Group and contributors
55
*
6-
* MimicAPI is free software: you can redistribute it and/or modify
6+
* Mimic is free software: you can redistribute it and/or modify
77
* it under the terms of the GNU Lesser General Public License as published by
88
* the Free Software Foundation, either version 3 of the License, or
99
* (at your option) any later version.
1010
*
11-
* MimicAPI is distributed in the hope that it will be useful,
11+
* Mimic is distributed in the hope that it will be useful,
1212
* but WITHOUT ANY WARRANTY; without even the implied warranty of
1313
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1414
* GNU Lesser General Public License for more details.
1515
*
1616
* You should have received a copy of the GNU Lesser General Public License
17-
* along with MimicAPI. If not, see <http://www.gnu.org/licenses/>.
17+
* along with Mimic. If not, see <http://www.gnu.org/licenses/>.
1818
*/
1919

20-
package ru.endlesscode.mimic
20+
package ru.endlesscode.mimic.level
2121

2222
/**
2323
* System that provides methods to work with player's level and experience points.

mimic-api/src/main/kotlin/util/Requirements.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
package ru.endlesscode.mimic.util
2323

2424
/** Checks that classes are exist. */
25-
fun checkClassesExist(vararg classes: String): Boolean {
25+
fun checkClassesLoaded(vararg classes: String): Boolean {
2626
return try {
2727
classes.forEach { Class.forName(it) }
2828
true

mimic-api/src/test/kotlin/ClassSystemTest.kt renamed to mimic-api/src/test/kotlin/classes/ClassSystemTest.kt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
/*
2-
* This file is part of MimicAPI.
3-
* Copyright (C) 2018 Osip Fatkullin
4-
* Copyright (C) 2018 EndlessCode Group and contributors
2+
* This file is part of Mimic.
3+
* Copyright (C) 2020 Osip Fatkullin
4+
* Copyright (C) 2020 EndlessCode Group and contributors
55
*
6-
* MimicAPI is free software: you can redistribute it and/or modify
6+
* Mimic is free software: you can redistribute it and/or modify
77
* it under the terms of the GNU Lesser General Public License as published by
88
* the Free Software Foundation, either version 3 of the License, or
99
* (at your option) any later version.
1010
*
11-
* MimicAPI is distributed in the hope that it will be useful,
11+
* Mimic is distributed in the hope that it will be useful,
1212
* but WITHOUT ANY WARRANTY; without even the implied warranty of
1313
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1414
* GNU Lesser General Public License for more details.
1515
*
1616
* You should have received a copy of the GNU Lesser General Public License
17-
* along with MimicAPI. If not, see <http://www.gnu.org/licenses/>.
17+
* along with Mimic. If not, see <http://www.gnu.org/licenses/>.
1818
*/
1919

20-
package ru.endlesscode.mimic
20+
package ru.endlesscode.mimic.classes
2121

2222
import com.nhaarman.mockitokotlin2.mock
2323
import com.nhaarman.mockitokotlin2.whenever

mimic-api/src/test/kotlin/exp/ExpLevelConverterTest.kt renamed to mimic-api/src/test/kotlin/level/ExpLevelConverterTest.kt

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,28 @@
1-
package ru.endlesscode.mimic.exp
1+
/*
2+
* This file is part of Mimic.
3+
* Copyright (C) 2020 Osip Fatkullin
4+
* Copyright (C) 2020 EndlessCode Group and contributors
5+
*
6+
* Mimic is free software: you can redistribute it and/or modify
7+
* it under the terms of the GNU Lesser General Public License as published by
8+
* the Free Software Foundation, either version 3 of the License, or
9+
* (at your option) any later version.
10+
*
11+
* Mimic is distributed in the hope that it will be useful,
12+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
* GNU Lesser General Public License for more details.
15+
*
16+
* You should have received a copy of the GNU Lesser General Public License
17+
* along with Mimic. If not, see <http://www.gnu.org/licenses/>.
18+
*/
19+
20+
package ru.endlesscode.mimic.level
221

322
import org.junit.jupiter.params.ParameterizedTest
423
import org.junit.jupiter.params.provider.Arguments
524
import org.junit.jupiter.params.provider.Arguments.arguments
625
import org.junit.jupiter.params.provider.MethodSource
7-
import ru.endlesscode.mimic.ExpLevelConverter
8-
import ru.endlesscode.mimic.mockExpLevelConverter
926
import java.util.stream.Stream
1027
import kotlin.test.BeforeTest
1128
import kotlin.test.assertEquals

0 commit comments

Comments
 (0)