Skip to content

Provismet/CombatPlus-Core

Repository files navigation

Combat+ Core

This is the core API and library mod for the Combat+ mod series, allowing inter-mod compatibility without requiring each mod to know of the others' existence.

This mod makes no changes to the vanilla game, it only provides hooks, interfaces, and implementations for other mods to add their content.

API

  • Adds two interfaces for weapons:
    • MeleeWeapon
    • DualWeapon
  • Adds two item tags for item types:
    • combat-plus:melee_weapon
    • combat-plus:dual_weapon
  • Adds one item tag for mechanics:
    • combat-plus:breaks_shields
  • Added eight item tags for enchantments
    • combat-plus:enchantable/aspect
    • combat-plus:enchantable/aspect_primary
    • combat-plus:enchantable/damage
    • combat-plus:enchantable/damage_primary
    • combat-plus:enchantable/weapon_utility
    • combat-plus:enchantable/weapon_utility_primary
    • combat-plus:enchantable/offhand
    • combat-plus:enchantable/offhand_primary
  • Adds an entrypoint initialiser for easier mod compatibility.
  • Adds utility methods for checking if an item is a Melee or Dual.
  • Adds new types of enchantment for better inter-mod compatibility checking:
    • Additional Damage
    • Aspect
    • Weapon Utility
    • Offhand

Implementation Summary

  • The vanilla call to EnchantmentHelper.getAttackDamage has been redirected to the CPCEnchantmentHelper.getAttackDamage for Players and mobs. This is necessary due to how limited the vanilla enchantment system is.
    • This should not cause incompatibilities with most mods because the redirected method acts as a wrapper for the vanilla equivalent. The vanilla version is still called.
  • For both the interfaces and the item tags, Dual Weapons are a subset of Melee Weapons.
  • 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.
  • Swords implement DualWeapon.
  • Axes implement MeleeWeapon.
  • Items in the combat-plus:breaks_shields tag will obviously break shields.
  • Smite and Bane of Arthropods have their item tags modified:
    • They support combat-plus:enchantable/damage instead of just weapons.
    • They have primary (enchantment table) support for combat-plus:enchantable/damage_primary instead of just Swords.
  • Sharpness now has primary support for combat-plus:enchantable/damage_primary instead of just Swords.
  • Fire Aspect now has support for combat-plus:enchantable/aspect instead of the original tag.

The vanilla tags are included within the Combat+ tags where appropriate. Vanilla behaviour has been maintained, check the tags for specifics.

Dependency

This mod is available as a dependency on Jitpack.

To add this to your mod, add the following to your build.gradle:

repositories {
  maven { url "https://jitpack.io" }
}
dependencies {
  modImplementation "com.github.Provismet:combatplus-core:${project.combatplus_version}"
}

Add combatplus_version to your gradle.properties file for easier version management. Check the jitpack for the most recent build.