Skip to content

Commit a8c9523

Browse files
committed
Update to 1.20.6
This is a large update to work with the 1.20.6 codebase and includes multiple breaking changes. - Item tags now interact with enchantability item tags. - FabricASM has been removed. - Added abstract class for melee weapons. - Combat+ enchants can no longer use the vanilla damage function. - Added datagen.
1 parent 5658fab commit a8c9523

File tree

61 files changed

+454
-338
lines changed

Some content is hidden

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

61 files changed

+454
-338
lines changed

.github/workflows/build.yml

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ jobs:
1212
matrix:
1313
# Use these Java versions
1414
java: [
15-
17, # Current Java LTS & minimum supported by Minecraft
1615
21, # Current Java LTS
1716
]
1817
# and run on both Linux and Windows

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
# Combat+ Core
44
[![](https://img.shields.io/jitpack/version/com.github.Provismet/combatplus-core?style=flat-square&logo=jitpack&color=F6F6F6)](https://jitpack.io/#Provismet/combatplus-core)
5+
[![](https://img.shields.io/modrinth/dt/NbKFMiE7?style=flat-square&logo=modrinth&color=F6F6F6)](https://modrinth.com/mod/combatplus-core)
6+
[![](https://img.shields.io/curseforge/dt/973671?style=flat-square&logo=curseforge&color=F6F6F6)](https://www.curseforge.com/minecraft/mc-mods/combat-plus-core)
57

68
<img src="https://github.com/Provismet/CombatPlus-Core/assets/17149901/d7ee8c04-1769-4873-b5a4-8fa23ed26a30" width=250px>
79

@@ -15,13 +17,12 @@ This mod makes no changes to the vanilla game, it only provides hooks, interface
1517
- Adds two interfaces for weapons:
1618
- `MeleeWeapon`
1719
- `DualWeapon`
18-
- Adds three interfaces for items:
20+
- Adds four item tags for items:
1921
- `combat-plus:melee_weapon`
2022
- `combat-plus:dual_weapon`
2123
- `combat-plus:breaks_shields`
24+
- `combat-plus:enchantable/aspect`
2225
- Adds an entrypoint initialiser for easier mod compatibility.
23-
- Adds two enchantment targets.
24-
- Do not use these in dev environments due to FabricASM weirdness.
2526
- Adds utility methods for checking if an item is a Melee or Dual.
2627
- Adds new types of enchantment for better inter-mod compatibility checking:
2728
- Additional Damage
@@ -36,7 +37,6 @@ This mod makes no changes to the vanilla game, it only provides hooks, interface
3637
- Using the interfaces is best for mod support as they allow callbacks and keep data consistent. Using the tags allows for an item to be an "honorary" melee/dual weapon, these will still be applicable for enchantments.
3738
- Swords implement `DualWeapon`.
3839
- Axes implement `MeleeWeapon`.
39-
- `DamageEnchantment` accepts melee weapons in anvils. (This mirrors the vanilla functionality of Sharpness working on Axes on anvils.)
4040
- Items in the `combat-plus:breaks_shields` tag will _obviously_ break shields.
4141

4242
## Dependency

build.gradle

+29-11
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
plugins {
2-
id 'fabric-loom' version '1.5-SNAPSHOT'
2+
id 'fabric-loom' version '1.6-SNAPSHOT'
33
id 'maven-publish'
44
}
55

@@ -10,6 +10,31 @@ base {
1010
archivesName = project.archives_base_name
1111
}
1212

13+
sourceSets {
14+
main {
15+
resources {
16+
srcDirs += [
17+
'src/main/generated'
18+
]
19+
}
20+
}
21+
}
22+
23+
loom {
24+
runs {
25+
// This adds a new gradle task that runs the datagen API: "gradlew runDatagen"
26+
datagen {
27+
inherit server
28+
name "Data Generation"
29+
vmArg "-Dfabric-api.datagen"
30+
vmArg "-Dfabric-api.datagen.output-dir=${file("src/main/generated")}"
31+
vmArg "-Dfabric-api.datagen.modid=${modid}"
32+
33+
runDir "build/datagen"
34+
}
35+
}
36+
}
37+
1338
repositories {
1439
maven { url "https://jitpack.io" }
1540
}
@@ -22,18 +47,11 @@ dependencies {
2247

2348
// Fabric API. This is technically optional, but you probably want it anyway.
2449
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
25-
26-
modImplementation "com.github.Chocohead:Fabric-ASM:${project.fabric_asm_version}"
27-
include "com.github.Chocohead:Fabric-ASM:${project.fabric_asm_version}"
2850

2951
modImplementation "com.github.provismet:lilylib:${project.lilylib_version}"
3052
include "com.github.provismet:lilylib:${project.lilylib_version}"
3153
}
3254

33-
loom {
34-
accessWidenerPath = file("src/main/resources/combat-plus.accesswidener")
35-
}
36-
3755
processResources {
3856
inputs.property "version", project.version
3957

@@ -43,7 +61,7 @@ processResources {
4361
}
4462

4563
tasks.withType(JavaCompile).configureEach {
46-
it.options.release = 17
64+
it.options.release = 21
4765
}
4866

4967
java {
@@ -52,8 +70,8 @@ java {
5270
// If you remove this line, sources will not be generated.
5371
withSourcesJar()
5472

55-
sourceCompatibility = JavaVersion.VERSION_17
56-
targetCompatibility = JavaVersion.VERSION_17
73+
sourceCompatibility = JavaVersion.VERSION_21
74+
targetCompatibility = JavaVersion.VERSION_21
5775
}
5876

5977
jar {

gradle.properties

+7-7
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@ org.gradle.parallel=true
44

55
# Fabric Properties
66
# check these on https://fabricmc.net/develop
7-
minecraft_version=1.20.4
8-
yarn_mappings=1.20.4+build.3
9-
loader_version=0.15.6
7+
minecraft_version=1.20.6
8+
yarn_mappings=1.20.6+build.1
9+
loader_version=0.15.11
1010

1111
# Mod Properties
12-
mod_version=1.0.0
12+
mod_version=2.0.0
1313
maven_group=com.provismet
1414
archives_base_name=combatplus-core
15+
modid=combat-plus-core
1516

1617
# Dependencies
17-
fabric_version=0.96.0+1.20.4
18-
fabric_asm_version=v2.3
19-
lilylib_version=1.1.3-mc1.20.4
18+
fabric_version=0.98.0+1.20.6
19+
lilylib_version=1.1.3-mc1.20.6

gradle/wrapper/gradle-wrapper.jar

-19.4 KB
Binary file not shown.

gradle/wrapper/gradle-wrapper.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

jitpack.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
jdk:
2-
- openjdk17
2+
- openjdk21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// 1.20.6 2024-05-15T01:28:26.8659637 Combat+ Core/Tags for minecraft:enchantment
2+
723caf0652fda96b2e02f330996f7f4690b860d4 data\c\tags\enchantment\weapon_damage_enhancements.json
3+
35133e95f1c8fdd7a1c21afcc231fc0bffefb9a8 data\combat-plus\tags\enchantment\offhand.json
4+
a4a4fea514a3bc248d542fc7988b85b8e1c09207 data\combat-plus\tags\enchantment\aspect.json
5+
32ad7058629a25acd671315cab8dcc9ad1853c3b data\combat-plus\tags\enchantment\weapon_utility.json
6+
35133e95f1c8fdd7a1c21afcc231fc0bffefb9a8 data\combat-plus\tags\enchantment\additional_damage.json
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// 1.20.6 2024-05-15T01:28:26.8619956 Combat+ Core/Language (en_us)
2+
650e462336f2d71ce51db893397f331107f74116 assets\combat-plus-core\lang\en_us.json
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// 1.20.6 2024-05-15T01:28:26.8639799 Combat+ Core/Tags for minecraft:item
2+
c24c428fecbb780a42e9666ad2e7ebd512a64aed data\combat-plus\tags\items\enchantable\aspect.json
3+
4a6b87559e48177ab068e19ad80790cb3835e13b data\c\tags\items\tools\melee_weapons.json
4+
a35a935ea60dfb4ae467bf89749d763f7a378b05 data\combat-plus\tags\items\melee_weapon.json
5+
4a6b87559e48177ab068e19ad80790cb3835e13b data\minecraft\tags\items\enchantable\weapon.json
6+
0920b44962def81502667a666d3ded82d176c3fe data\combat-plus\tags\items\dual_weapon.json
7+
58b92ae412db10a7041d5ae649a445f3ac2e4a13 data\combat-plus\tags\items\breaks_shields.json
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"gamerule.category.combat-plus": "Combat+",
3+
"gamerule.keepLoyaltyTridents": "Keep Loyalty Tridents",
4+
"gamerule.sweepingRequiresEnchantment": "Sweeping Requires Enchantment",
5+
"tag.enchantment.combat-plus.additional_damage": "Additional Damage Enchantments",
6+
"tag.enchantment.combat-plus.aspect": "Aspect Enchantments",
7+
"tag.enchantment.combat-plus.offhand": "Offhand Enchantments",
8+
"tag.enchantment.combat-plus.weapon_utility": "Weapon Utility Enchantments",
9+
"tag.item.combat-plus.breaks_shields": "Breaks Shields",
10+
"tag.item.combat-plus.dual_weapon": "Dual Weapons",
11+
"tag.item.combat-plus.enchantable.aspect": "Aspect Enchantable",
12+
"tag.item.combat-plus.melee_weapon": "Melee Weapons"
13+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"values": [
3+
{
4+
"id": "#combat-plus:additional_damage",
5+
"required": false
6+
}
7+
]
8+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"values": [
3+
{
4+
"id": "#combat-plus:melee_weapon",
5+
"required": false
6+
}
7+
]
8+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"values": []
3+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"values": [
3+
"minecraft:fire_aspect"
4+
]
5+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"values": []
3+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"values": [
3+
"minecraft:sweeping_edge"
4+
]
5+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"values": [
3+
{
4+
"id": "#minecraft:axes",
5+
"required": false
6+
}
7+
]
8+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"values": [
3+
{
4+
"id": "#minecraft:swords",
5+
"required": false
6+
}
7+
]
8+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"values": [
3+
{
4+
"id": "#minecraft:enchantable/fire_aspect",
5+
"required": false
6+
}
7+
]
8+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"values": [
3+
{
4+
"id": "#combat-plus:dual_weapon",
5+
"required": false
6+
},
7+
{
8+
"id": "#minecraft:axes",
9+
"required": false
10+
}
11+
]
12+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"values": [
3+
{
4+
"id": "#combat-plus:melee_weapon",
5+
"required": false
6+
}
7+
]
8+
}

src/main/java/com/provismet/CombatPlusCore/CPCMain.java

-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import com.provismet.CombatPlusCore.api.CombatPlusEntrypoint;
77
import com.provismet.CombatPlusCore.interfaces.mixin.IMixinItemStack;
88
import com.provismet.CombatPlusCore.utility.CPCEnchantmentHelper;
9-
import com.provismet.CombatPlusCore.utility.CPCEnchantmentTargets;
109
import com.provismet.CombatPlusCore.utility.CombatGameRules;
1110

1211
import net.fabricmc.api.ModInitializer;
@@ -26,7 +25,6 @@ public static Identifier identifier (String path) {
2625

2726
@Override
2827
public void onInitialize () {
29-
CPCEnchantmentTargets.init();
3028
CombatGameRules.register();
3129

3230
ServerEntityCombatEvents.AFTER_KILLED_OTHER_ENTITY.register((world, entity, target) -> {

src/main/java/com/provismet/CombatPlusCore/asm/DualEnchantmentTarget.java

-24
This file was deleted.

src/main/java/com/provismet/CombatPlusCore/asm/EarlyRiser.java

-19
This file was deleted.

src/main/java/com/provismet/CombatPlusCore/asm/MeleeEnchantmentTarget.java

-24
This file was deleted.

0 commit comments

Comments
 (0)