Skip to content

Commit 7f9e111

Browse files
committed
Add additional constructors for enchantments.
This will help avoid dev environment crashes from FabricASM weirdness.
1 parent cf7795e commit 7f9e111

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

gradle.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ yarn_mappings=1.20.1+build.10
99
loader_version=0.15.2
1010

1111
# Mod Properties
12-
mod_version=0.4.1
12+
mod_version=0.4.2
1313
maven_group=com.provismet
1414
archives_base_name=combatplus-core
1515

src/main/java/com/provismet/CombatPlusCore/enchantments/OffHandEnchantment.java

+5-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
import net.minecraft.enchantment.DamageEnchantment;
77
import net.minecraft.enchantment.Enchantment;
8+
import net.minecraft.enchantment.EnchantmentTarget;
89
import net.minecraft.enchantment.FireAspectEnchantment;
910
import net.minecraft.enchantment.LuckEnchantment;
1011
import net.minecraft.enchantment.SweepingEnchantment;
@@ -14,9 +15,12 @@
1415
* Enchantments that are applied to offhanded dual weapons.
1516
*/
1617
public abstract class OffHandEnchantment extends Enchantment implements CPCEnchantment {
18+
protected OffHandEnchantment (Rarity weight, EnchantmentTarget target) {
19+
super(weight, target, new EquipmentSlot[] {EquipmentSlot.OFFHAND});
20+
}
1721

1822
protected OffHandEnchantment (Rarity weight) {
19-
super(weight, CPCEnchantmentTargets.DUAL_WEAPON, new EquipmentSlot[] {EquipmentSlot.OFFHAND});
23+
this(weight, CPCEnchantmentTargets.DUAL_WEAPON);
2024
}
2125

2226
@Override

src/main/java/com/provismet/CombatPlusCore/enchantments/WeaponUtilityEnchantment.java

+6-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import com.provismet.CombatPlusCore.utility.CPCEnchantmentTargets;
55

66
import net.minecraft.enchantment.Enchantment;
7+
import net.minecraft.enchantment.EnchantmentTarget;
78
import net.minecraft.enchantment.SweepingEnchantment;
89
import net.minecraft.entity.EquipmentSlot;
910

@@ -17,8 +18,12 @@
1718
* to an opponent.
1819
*/
1920
public abstract class WeaponUtilityEnchantment extends Enchantment implements CPCEnchantment {
21+
protected WeaponUtilityEnchantment (Rarity weight, EnchantmentTarget target, EquipmentSlot... slotTypes) {
22+
super(weight, target, slotTypes);
23+
}
24+
2025
protected WeaponUtilityEnchantment (Rarity weight, EquipmentSlot... slotTypes) {
21-
super(weight, CPCEnchantmentTargets.MELEE_WEAPON, slotTypes);
26+
this(weight, CPCEnchantmentTargets.MELEE_WEAPON, slotTypes);
2227
}
2328

2429
@Override

0 commit comments

Comments
 (0)