Skip to content

Commit

Permalink
Start Construct's Armory compat
Browse files Browse the repository at this point in the history
  • Loading branch information
IcarussOne committed May 27, 2024
1 parent 920632c commit 37ce0b6
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 6 deletions.
22 changes: 22 additions & 0 deletions src/main/java/twilightforest/compat/ConstructsArmory.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package twilightforest.compat;

import c4.conarm.common.armor.traits.ArmorTraits;
import c4.conarm.lib.materials.ArmorMaterials;
import c4.conarm.lib.materials.CoreMaterialStats;
import c4.conarm.lib.materials.PlatesMaterialStats;
import c4.conarm.lib.materials.TrimMaterialStats;
import slimeknights.tconstruct.library.TinkerRegistry;

public class ConstructsArmory {
static void preInit() {
TinkerRegistry.addMaterialStats(TConstruct.ironwood,
new CoreMaterialStats(2.5F, 3),
new PlatesMaterialStats(1, 1, 0),
new TrimMaterialStats(0.5F)
);
}

static void init() {
ArmorMaterials.addArmorTrait(TConstruct.ironwood, ArmorTraits.ecological);
}
}
30 changes: 24 additions & 6 deletions src/main/java/twilightforest/compat/TFCompat.java
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ private void addToCarvingGroup(String group, ItemStack stack) {
},
FORESTRY("Forestry"),
IMMERSIVEENGINEERING("Immersive Engineering") {

@Override
protected void initItems(RegisterItemEvent.ItemRegistryHelper items) {
items.register("shader", ItemTFShader.shader.setTranslationKey("tfEngineeringShader"));
Expand All @@ -105,7 +104,7 @@ protected void initItems(RegisterItemEvent.ItemRegistryHelper items) {
@Override
protected void init() {
// Yeah, it's a thing! https://twitter.com/AtomicBlom/status/1004931868012056583
blusunrize.immersiveengineering.api.tool.RailgunHandler.projectilePropertyMap.add(Pair.of(blusunrize.immersiveengineering.api.ApiUtils.createIngredientStack(TFBlocks.cicada), new blusunrize.immersiveengineering.api.tool.RailgunHandler.RailgunProjectileProperties(2, 0.25){
blusunrize.immersiveengineering.api.tool.RailgunHandler.projectilePropertyMap.add(Pair.of(blusunrize.immersiveengineering.api.ApiUtils.createIngredientStack(TFBlocks.cicada), new blusunrize.immersiveengineering.api.tool.RailgunHandler.RailgunProjectileProperties(2, 0.25) {
@Override
public boolean overrideHitEntity(Entity entityHit, Entity shooter) {
World world = entityHit.getEntityWorld();
Expand Down Expand Up @@ -154,6 +153,18 @@ protected void postInit() {
TConstruct.postInit();
}
},
CONSTRUCTSARMORY("Construct's Armory") {
@Override
protected boolean preInit() {
ConstructsArmory.preInit();
return true;
}

@Override
protected void init() {
ConstructsArmory.init();
}
},
THAUMCRAFT("Thaumcraft") {
@Override
protected boolean preInit() {
Expand All @@ -164,11 +175,18 @@ protected boolean preInit() {

private static final TFCompat[] VALUES = values();

protected boolean preInit() { return true; }
protected void init() {}
protected void postInit() {}
protected boolean preInit() {
return true;
}

protected void init() {
}

protected void postInit() {
}

protected void initItems(RegisterItemEvent.ItemRegistryHelper items) {}
protected void initItems(RegisterItemEvent.ItemRegistryHelper items) {
}

private final String modName;

Expand Down

0 comments on commit 37ce0b6

Please sign in to comment.