Add compatibility for Additional Additions and Create Deep Dark

- Introduced tool material enums for Additional Additions and Create Deep Dark mods.
- Updated `CompatRegistry` to register new compatibility records.
- Adjusted dependencies and configuration to load mods of the new integrations.
This commit is contained in:
Chris Toph 2025-02-25 02:19:07 -05:00
parent 3978aa15a3
commit 0e0d70a2e6
7 changed files with 332 additions and 19 deletions

View file

@ -29,11 +29,8 @@ dependencies {
modCompileOnly "com.jozufozu.flywheel:flywheel-forge-$rootProject.minecraft_version:$rootProject.flywheel_version"
modCompileOnly "com.tterrag.registrate:Registrate:$rootProject.registrate_version"
modCompileOnly "curse.maven:create-industry-693815:5811638"
// runtimeOnly "curse.maven:better-combat-by-daedelus-639842:5625757"
// runtimeOnly "curse.maven:playeranimator-658587:4587214"
// implementation "curse.maven:additional-additions-forge-582387:5155724"
// implementation "curse.maven:create-328085:5838779"
modCompileOnly "curse.maven:create-deep-dark-1020173:5868515"
modCompileOnly "curse.maven:additional-additions-forge-582387:5155724"
}
sourceSets {

View file

@ -0,0 +1,127 @@
package cc.toph.simplycompat.compat;
import cc.toph.simplycompat.registry.ConfigRegistry;
import cc.toph.simplycompat.util.ToolMaterials;
import dqu.additionaladditions.AdditionalAdditions;
import dqu.additionaladditions.material.GildedNetheriteToolMaterial;
import dqu.additionaladditions.material.RoseGoldToolMaterial;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.Items;
import net.minecraft.world.item.crafting.Ingredient;
import org.jetbrains.annotations.NotNull;
public enum AdditionalAdditionsToolMaterials implements ToolMaterials<AdditionalAdditionsToolMaterials> {
/**
* See {@link RoseGoldToolMaterial}
*/
ROSE_GOLD(
2,
900,
9.0f,
2.0F,
ConfigRegistry.WEAPON_ATTRIBUTES.ROSE_GOLD,
17,
ConfigRegistry.WEAPON_ATTRIBUTES.ROSE_GOLD_ENABLED,
new ResourceLocation(AdditionalAdditions.namespace, "rose_gold_alloy")
),
/**
* See {@link GildedNetheriteToolMaterial}
*/
GILDED_NETHERITE(
4,
2031,
10.0F,
2.0F,
ConfigRegistry.WEAPON_ATTRIBUTES.ROSE_GOLD,
20,
ConfigRegistry.WEAPON_ATTRIBUTES.ROSE_GOLD_ENABLED,
Items.NETHERITE_INGOT.arch$registryName()
);
private final int level;
private final int uses;
private final float speed;
private final float attackDamageBonus;
private final float damageModifier;
private final int enchantmentValue;
private final boolean enabled;
private final ResourceLocation repairIngredient;
AdditionalAdditionsToolMaterials(
int level,
int uses,
float speed,
float attackDamageBonus,
float damageModifier,
int enchantmentValue,
boolean enabled,
ResourceLocation repairIngredient
) {
this.level = level;
this.uses = uses;
this.speed = speed;
this.attackDamageBonus = attackDamageBonus;
this.enchantmentValue = enchantmentValue;
this.damageModifier = damageModifier;
this.enabled = enabled;
this.repairIngredient = repairIngredient;
}
@Override
public String getName() {
return this.name().toLowerCase();
}
@Override
public String getIdentifier() {
return repairIngredient.toString();
}
@Override
public int getUses() {
return uses;
}
@Override
public float getSpeed() {
return speed;
}
@Override
public float getAttackDamageBonus() {
return attackDamageBonus;
}
@Override
public float getDamageModifier() {
return damageModifier;
}
@Override
public int getLevel() {
return level;
}
@Override
public int getEnchantmentValue() {
return enchantmentValue;
}
@Override
public boolean isEnabled() {
return enabled;
}
@Override
public @NotNull Ingredient getRepairIngredient() {
return Ingredient.of(BuiltInRegistries.ITEM.get(repairIngredient));
}
@Override
public AdditionalAdditionsToolMaterials[] getValues() {
return values();
}
}

View file

@ -0,0 +1,111 @@
package cc.toph.simplycompat.compat;
import cc.toph.simplycompat.registry.ConfigRegistry;
import cc.toph.simplycompat.util.ToolMaterials;
import create_deep_dark.CreateDeepDarkMod;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.crafting.Ingredient;
import org.jetbrains.annotations.NotNull;
public enum CreateDeepDarkToolMaterials implements ToolMaterials<CreateDeepDarkToolMaterials> {
/**
* See {@link create_deep_dark.item.EchoSwordItem}
*/
ECHO(
4,
2124,
9.0f,
6.0f,
ConfigRegistry.WEAPON_ATTRIBUTES.ECHO,
16,
ConfigRegistry.WEAPON_ATTRIBUTES.ECHO_ENABLED,
new ResourceLocation(CreateDeepDarkMod.MODID, "echo_ingot")
);
private final int level;
private final int uses;
private final float speed;
private final float attackDamageBonus;
private final float damageModifier;
private final int enchantmentValue;
private final boolean enabled;
private final ResourceLocation repairIngredient;
CreateDeepDarkToolMaterials(
int level,
int uses,
float speed,
float attackDamageBonus,
float damageModifier,
int enchantmentValue,
boolean enabled,
ResourceLocation repairIngredient
) {
this.level = level;
this.uses = uses;
this.speed = speed;
this.attackDamageBonus = attackDamageBonus;
this.enchantmentValue = enchantmentValue;
this.damageModifier = damageModifier;
this.enabled = enabled;
this.repairIngredient = repairIngredient;
}
@Override
public String getName() {
return this.name().toLowerCase();
}
@Override
public String getIdentifier() {
return repairIngredient.toString();
}
@Override
public int getUses() {
return uses;
}
@Override
public float getSpeed() {
return speed;
}
@Override
public float getAttackDamageBonus() {
return attackDamageBonus;
}
@Override
public float getDamageModifier() {
return damageModifier;
}
@Override
public int getLevel() {
return level;
}
@Override
public int getEnchantmentValue() {
return enchantmentValue;
}
@Override
public boolean isEnabled() {
return enabled;
}
@Override
public @NotNull Ingredient getRepairIngredient() {
return Ingredient.of(BuiltInRegistries.ITEM.get(repairIngredient));
}
@Override
public CreateDeepDarkToolMaterials[] getValues() {
return values();
}
}

View file

@ -1,10 +1,14 @@
package cc.toph.simplycompat.registry;
import cc.toph.simplycompat.compat.AdditionalAdditionsToolMaterials;
import cc.toph.simplycompat.compat.CreateDeepDarkToolMaterials;
import cc.toph.simplycompat.compat.CreateToolMaterials;
import cc.toph.simplycompat.compat.TFMGToolMaterials;
import cc.toph.simplycompat.util.CompatRecord;
import com.drmangotea.tfmg.CreateTFMG;
import com.simibubi.create.Create;
import create_deep_dark.CreateDeepDarkMod;
import dqu.additionaladditions.AdditionalAdditions;
/**
@ -16,6 +20,15 @@ import com.simibubi.create.Create;
public final class CompatRegistry {
/**
* Compatibility setup for the Create mod.
*/
public static final CompatRecord<AdditionalAdditionsToolMaterials> ADDITIONAL_ADDITIONS = new CompatRecord<>(
AdditionalAdditions.namespace,
"6.0.1",
AdditionalAdditionsToolMaterials.class
);
/**
* Compatibility setup for the Create mod.
*/
@ -34,12 +47,23 @@ public final class CompatRegistry {
TFMGToolMaterials.class
);
/**
* Compatibility setup for the Create Deep Dark mod.
*/
public static final CompatRecord<CreateDeepDarkToolMaterials> CREATE_DEEP_DARK = new CompatRecord<>(
CreateDeepDarkMod.MODID,
"1.7.0",
CreateDeepDarkToolMaterials.class
);
/**
* Initializes all declared compat records.
*/
public static void registerAll() {
// CompatRegistry.CREATE.register();
CompatRegistry.ADDITIONAL_ADDITIONS.register();
CompatRegistry.CREATE.register();
CompatRegistry.TFMG.register();
CompatRegistry.CREATE_DEEP_DARK.register();
}
}

View file

@ -6,12 +6,18 @@ import cc.toph.simplycompat.config.ConfigProvider;
public final class ConfigRegistry {
public static final class WEAPON_ATTRIBUTES {
public static float COPPER;
public static boolean COPPER_ENABLED;
public static float ALUMINUM;
public static boolean ALUMINUM_ENABLED;
public static float COPPER;
public static boolean COPPER_ENABLED;
public static float ECHO;
public static boolean ECHO_ENABLED;
public static float GILDED_NETHERITE;
public static boolean GILDED_NETHERITE_ENABLED;
public static float LEAD;
public static boolean LEAD_ENABLED;
public static float ROSE_GOLD;
public static boolean ROSE_GOLD_ENABLED;
public static float STEEL;
public static boolean STEEL_ENABLED;
public static float STURDY;
@ -34,6 +40,32 @@ public final class ConfigRegistry {
"Enable Copper Swords"
);
if (CompatRegistry.ADDITIONAL_ADDITIONS.passCheck()) {
ROSE_GOLD = common.registerProp(
"rose_gold_damageModifier",
4.0f,
"Rose Gold Damage Modifier"
);
ROSE_GOLD_ENABLED = common.registerProp(
"rose_gold_enabled",
true,
"Enable Rose Gold Swords"
);
GILDED_NETHERITE = common.registerProp(
"gilded_netherite_damageModifier",
4.0f,
"Gilded Netherite Damage Modifier"
);
GILDED_NETHERITE_ENABLED = common.registerProp(
"gilded_netherite_enabled",
true,
"Enable Gilded Netherite Swords"
);
}
if (CompatRegistry.CREATE.passCheck()) {
STURDY = common.registerProp(
"sturdy_damageModifier",
@ -85,6 +117,20 @@ public final class ConfigRegistry {
);
}
if (CompatRegistry.CREATE_DEEP_DARK.passCheck()) {
ECHO = common.registerProp(
"echo_damageModifier",
6.0f,
"Steel Echo Modifier"
);
ECHO_ENABLED = common.registerProp(
"echo_enabled",
true,
"Enable Echo Swords"
);
}
common.register();
}

View file

@ -78,22 +78,17 @@ dependencies {
modImplementation "curse.maven:simplyswords-659887:5639538"
modLocalRuntime "me.shedaniel.cloth:cloth-config-forge:$rootProject.cloth_config_version"
localRuntime(include("io.github.llamalad7:mixinextras-forge:0.4.1"))
modLocalRuntime "curse.maven:better-combat-by-daedelus-639842:5625757"
modLocalRuntime "curse.maven:playeranimator-658587:4587214"
modLocalRuntime "curse.maven:create-industry-693815:5811638"
modLocalRuntime("com.simibubi.create:create-$rootProject.minecraft_version:$rootProject.create_version:slim") { transitive = false }
modLocalRuntime "com.jozufozu.flywheel:flywheel-forge-$rootProject.minecraft_version:$rootProject.flywheel_version"
modLocalRuntime "com.tterrag.registrate:Registrate:$rootProject.registrate_version"
localRuntime(include("io.github.llamalad7:mixinextras-forge:0.4.1"))
modLocalRuntime "curse.maven:create-industry-693815:5811638"
modLocalRuntime "curse.maven:create-deep-dark-1020173:5868515"
modLocalRuntime "curse.maven:additional-additions-forge-582387:5155724"
// modLocalRuntime "dev.engine-room.flywheel:flywheel-forge-$rootProject.minecraft_version}:$rootProject.flywheel_version}"
//// modLocalRuntime "com.jozufozu.flywheel:flywheel-forge-$rootProject.minecraft_version:$rootProject.flywheel_version"
// modLocalRuntime "com.simibubi.create:create-$rootProject.minecraft_version-$rootProject.create_version:all"
// modImplementation "com.teamresourceful.resourcefulconfig:resourcefulconfig-forge-$minecraft_version:$rconfig_version"
// implementation "curse.maven:additional-additions-forge-582387:ID"
modLocalRuntime "curse.maven:emi-580555:6205514"
common(project(path: ':common', configuration: 'namedElements')) { transitive false }
shadowBundle project(path: ':common', configuration: 'transformProductionForge')

View file

@ -42,6 +42,13 @@ versionRange = "[1.56.0-1.20.1,)"
ordering = "AFTER"
side = "BOTH"
[[dependencies.simplycompat]]
modId = "additionaladditions"
mandatory = false
versionRange = "[6.0.1,)"
ordering = "AFTER"
side = "BOTH"
[[dependencies.simplycompat]]
modId = "create"
mandatory = false
@ -49,10 +56,16 @@ versionRange = "[0.5.1.j-55,)"
ordering = "AFTER"
side = "BOTH"
[[dependencies.simplycompat]]
modId = "tfmg"
mandatory = false
versionRange = "[0.9.3-1.20.1,)"
ordering = "AFTER"
side = "BOTH"
[[dependencies.simplycompat]]
modId = "create-deep-dark"
mandatory = false
versionRange = "[1.7.0,)"
ordering = "AFTER"
side = "BOTH"