Skip to content

Commit 3c27e05

Browse files
JobsonMarinhoclaude
andcommitted
Merge upstream v2.1.1 with local fixes
- Sync with byteful/LevelTools upstream (v2.1.1) - Re-apply EventPriority.HIGH fix on new TriggerListener, AnvilListener, LegacyAnvilListener - Update Java target to 21 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2 parents f40ad66 + 1e8982e commit 3c27e05

84 files changed

Lines changed: 7132 additions & 2366 deletions

File tree

Some content is hidden

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

.run/Build.run.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
</option>
1111
<option name="taskNames">
1212
<list>
13+
<option value="clean" />
1314
<option value="shadowJar" />
14-
<option value="publishMavenPublicationToMavenLocal" />
1515
</list>
1616
</option>
1717
<option name="vmOptions" />

README.md

Lines changed: 64 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -6,74 +6,92 @@
66
<h5 align="center">Support/Help Server: https://discord.gg/G8BDgqsuyw</h5>
77
<h5 align="center">WIKI: https://github.com/byteful/LevelTools/wiki</h5>
88

9-
![Logo](https://github.com/byteful/LevelTools/blob/master/LevelTools%20Large%20Logo.png?raw=true)
9+
![Logo](https://github.com/byteful/LevelTools/blob/main/LevelTools%20Large%20Logo.png?raw=true)
1010

11-
<h3 align="center">A plugin that adds a leveling system to tools, swords, and bows.</h3>
11+
<h3 align="center">A plugin that adds a leveling system to any item.</h3>
1212

1313
## Features
1414

1515
- Supports versions 1.8 - 1.21.
16-
- Supports Folia
16+
- Supports Folia.
1717
- No dependencies.
1818
- Super efficient, no lag.
1919
- Simple developer API.
20+
- Profile-based configuration system.
21+
- Any item can level up with custom triggers.
2022
- Commands & enchants on level up.
21-
- Supports blacklisting for blocks and items for XP.
23+
- Supports blacklisting/whitelisting for blocks, entities, and items.
2224
- ActionBar notifications.
2325
- Item lore modification.
2426

25-
## Developer API
27+
## v2.0.0 - Profile System
28+
29+
LevelTools v2.0 introduces a modular profile-based configuration system. Instead of hardcoded tool types, you can now configure any item to level up.
30+
31+
### Profile Types
32+
33+
| Profile Type | Purpose | File |
34+
|-------------|---------|------|
35+
| **Trigger Profiles** | Define how XP is gained | `trigger_profiles.yml` |
36+
| **Reward Profiles** | Define rewards per level | `reward_profiles.yml` |
37+
| **Display Profiles** | Define name, lore, action bar | `display_profiles.yml` |
38+
| **Item Profiles** | Tie everything together | `item_profiles.yml` |
2639

27-
### Gradle:
40+
### Trigger Types
2841

29-
```groovy
30-
repositories {
31-
maven { url 'https://jitpack.io' }
32-
}
42+
- `BLOCK_BREAK` - XP when breaking blocks
43+
- `ENTITY_KILL` - XP when killing entities
44+
- `FISHING` - XP when catching items
45+
- `RIGHT_CLICK` / `LEFT_CLICK` - XP on click
46+
- `CONSUME` - XP when consuming items
47+
- `FARMING` - XP when tilling soil and breaking plants
3348

34-
dependencies {
35-
compileOnly 'com.github.byteful:LevelTools:Tag' // Replace Tag with the version. (Ex: v1.4.0)
36-
}
37-
```
49+
### Default Supported Items
3850

39-
### Maven:
51+
Out of the box, LevelTools supports:
52+
- Pickaxes, Axes, Shovels (block mining)
53+
- Swords, Bows, Crossbows (combat)
54+
- Fishing Rods (fishing)
55+
- Hoes (farming)
4056

41-
```xml
57+
Add any item by creating custom profiles. See the [Wiki](https://github.com/byteful/LevelTools/wiki) for details.
4258

43-
<repositories>
44-
<repository>
45-
<id>jitpack.io</id>
46-
<url>https://jitpack.io</url>
47-
</repository>
48-
</repositories>
59+
### Migration from v1.x
4960

50-
<dependency>
51-
<groupId>com.github.byteful</groupId>
52-
<artifactId>LevelTools</artifactId>
53-
<version>Tag</version> <!-- Replace Tag with the version. (Ex: v1.4.0) -->
54-
</dependency>
55-
```
61+
Your old config will be automatically backed up to `old_config.yml` and migrated to the new profile system.
62+
63+
## Commands
64+
65+
| Command | Description | Permission |
66+
|---------|-------------|------------|
67+
| `/leveltools help` | Shows command help | None |
68+
| `/leveltools reload` | Reloads configuration | `leveltools.admin` |
69+
| `/leveltools reset <player>` | Reset hand item for player | `leveltools.admin` |
70+
| `/leveltools reset <player> --all` | Reset all items for player | `leveltools.admin` |
71+
| `/leveltools xp <amount>` | Set hand item XP | `leveltools.admin` |
72+
| `/leveltools level <level>` | Set hand item level | `leveltools.admin` |
73+
| `/leveltools levelup` | Increase hand item level by 1 | `leveltools.admin` |
74+
| `/leveltools debug` | Show debug information | `leveltools.admin` |
75+
76+
## Developer API
5677

57-
### Example Usage:
78+
**View detailed API usage [here](https://github.com/byteful/LevelTools/wiki/Developer-API).**
5879

59-
```java
60-
// Items
80+
## PlaceholderAPI
6181

62-
ItemStack hand = player.getInventory().getItemInMainHand();
63-
LevelToolsItem tool = LevelToolsUtil.createLevelToolsItem(hand);
64-
tool.setLevel(69);
65-
tool.setXp(420);
66-
player.getInventory().setItemInMainHand(tool.getItemStack());
82+
| Placeholder | Description |
83+
|-------------|-------------|
84+
| `%leveltools_level%` | Item level (main hand) |
85+
| `%leveltools_xp%` | Current XP (main hand) |
86+
| `%leveltools_max_xp%` | XP needed for next level |
87+
| `%leveltools_progress%` | Progress percentage |
6788

68-
// Events
89+
## Wiki
6990

70-
@EventHandler
71-
public void onLevelEvent(LevelToolsLevelIncreaseEvent event) {
72-
event.setNewLevel(69);
73-
}
91+
Full documentation available at: https://github.com/byteful/LevelTools/wiki
7492

75-
@EventHandler
76-
public void onXPEvent(LevelToolsXPIncreaseEvent event) {
77-
event.setNewXp(420);
78-
}
79-
```
93+
- [Configuration](https://github.com/byteful/LevelTools/wiki/Configuration)
94+
- [Trigger Profiles](https://github.com/byteful/LevelTools/wiki/Trigger-Profiles)
95+
- [Reward Profiles](https://github.com/byteful/LevelTools/wiki/Reward-Profiles)
96+
- [Display Profiles](https://github.com/byteful/LevelTools/wiki/Display-Profiles)
97+
- [Item Profiles](https://github.com/byteful/LevelTools/wiki/Item-Profiles)

build.gradle

Lines changed: 19 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ plugins {
22
id 'java'
33
id 'idea'
44
id 'maven-publish'
5-
id "com.github.johnrengelman.shadow" version "7.1.2"
5+
id("com.gradleup.shadow") version "9.0.0-beta13"
66
}
77

88
repositories {
@@ -37,27 +37,26 @@ repositories {
3737
}
3838

3939
dependencies {
40-
implementation 'de.tr7zw:item-nbt-api:2.13.1'
41-
implementation 'com.github.Redempt:RedLib:6.6.1'
40+
implementation 'de.tr7zw:item-nbt-api:2.15.5'
4241
implementation 'com.github.Redempt:Crunch:2.0.3'
43-
implementation 'com.github.cryptomorin:XSeries:11.2.0'
44-
implementation 'com.github.Revxrsal.Lamp:common:3.2.1'
45-
implementation 'com.github.Revxrsal.Lamp:bukkit:3.2.1'
46-
implementation 'com.github.Sven65:Item-Names:1.0.2'
47-
implementation 'org.bstats:bstats-bukkit:3.0.2'
48-
implementation 'com.jeff_media:MorePersistentDataTypes:2.4.0'
42+
implementation 'com.github.cryptomorin:XSeries:13.6.0'
43+
implementation 'com.github.Revxrsal.Lamp:common:3.3.6'
44+
implementation 'com.github.Revxrsal.Lamp:bukkit:3.3.6'
45+
implementation 'org.bstats:bstats-bukkit:3.2.1'
46+
implementation 'com.jeff-media:MorePersistentDataTypes:2.4.0'
4947

5048
compileOnly files('libs/folia-api-1.20.4-R0.1-SNAPSHOT.jar') // Modified API jar with Java 8 support
51-
compileOnly 'net.kyori:adventure-api:4.17.0' // Not used but needed for Folia compilation
49+
compileOnly 'net.kyori:adventure-api:4.26.1'
50+
compileOnly 'net.kyori:adventure-platform-bukkit:4.4.1'
5251
compileOnly 'org.spigotmc:spigot-api:1.14.4-R0.1-SNAPSHOT'
53-
compileOnly 'org.jetbrains:annotations:24.1.0'
52+
compileOnly 'org.jetbrains:annotations:26.1.0'
5453
compileOnly 'me.clip:placeholderapi:2.11.6'
5554
}
5655

5756
group = 'me.byteful.plugin'
58-
version = '1.4.0.2'
57+
version = '2.1.1'
5958
description = 'LevelTools'
60-
java.sourceCompatibility = JavaVersion.VERSION_17
59+
java.sourceCompatibility = JavaVersion.VERSION_21
6160

6261
publishing {
6362
publications {
@@ -74,36 +73,31 @@ shadowJar {
7473

7574
relocate "de.tr7zw.changeme.nbtapi", "me.byteful.plugin.leveltools.libs.nbtapi"
7675
relocate "com.cryptomorin.xseries", "me.byteful.plugin.leveltools.libs.xseries"
77-
relocate "redempt.redlib", "me.byteful.plugin.leveltools.libs.redlib"
76+
relocate "redempt.crunch", "me.byteful.plugin.leveltools.libs.crunch"
7877
relocate 'revxrsal.commands', 'me.byteful.plugin.leveltools.libs.lamp'
7978
relocate 'org.bstats', 'me.byteful.plugin.leveltools.libs.bstats'
80-
relocate 'com.jeff_media.morepersistentdatatypes', 'me.byteful.plugin.leveltools.libs.morepersistentdatatypes'
79+
relocate 'com.jeff-media.morepersistentdatatypes', 'me.byteful.plugin.leveltools.libs.morepersistentdatatypes'
8180
}
8281

83-
def targetJavaVersion = 17
82+
def targetJavaVersion = 21
8483
java {
85-
def javaVersion = JavaVersion.toVersion(targetJavaVersion)
86-
sourceCompatibility = 17
87-
targetCompatibility = 17
84+
sourceCompatibility = 21
85+
targetCompatibility = 21
8886
}
8987

9088
tasks.withType(JavaCompile).configureEach {
91-
if (targetJavaVersion >= 10 || JavaVersion.current().isJava10Compatible()) {
92-
options.release.set(targetJavaVersion)
93-
}
89+
options.release.set(targetJavaVersion)
9490
}
9591

9692
processResources {
9793
def props = [version: version]
9894
inputs.properties props
9995
filteringCharset 'UTF-8'
100-
filesMatching('*.yml') {
96+
filesMatching('plugin.yml') {
10197
expand props
10298
}
10399
}
104100

105101
compileJava { // Preserve parameter names in the bytecode
106102
options.compilerArgs += ["-parameters"]
107-
options.fork = true
108-
options.forkOptions.executable = "javac"
109103
}

gradle/wrapper/gradle-wrapper.jar

-15.7 KB
Binary file not shown.
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
4+
networkTimeout=10000
5+
validateDistributionUrl=true
46
zipStoreBase=GRADLE_USER_HOME
57
zipStorePath=wrapper/dists

gradlew

Lines changed: 33 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)