Skip to content

Commit

Permalink
Redo Architecture Craft 3.108 Compat
Browse files Browse the repository at this point in the history
This reverts commit 06300fb.

But This Time:
- Fixes Top Erroring on Shapes
- Fixes Sawbench Particle Textures
  • Loading branch information
IntegerLimit committed Apr 27, 2024
1 parent 57e1b08 commit 1c2abfc
Show file tree
Hide file tree
Showing 15 changed files with 220 additions and 123 deletions.
11 changes: 9 additions & 2 deletions dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ dependencies {
compileOnly rfg.deobf("curse.maven:advanced-rocketry-236542:3015079") // Version 1.7.0-232 (Newer Versions need Newer Lib Vulpes)

// Architecture Craft (from CurseForge)
compileOnly rfg.deobf("curse.maven:architecture-craft-277631:2750633") // Version 3.98
compileOnly rfg.deobf("curse.maven:architecture-craft-277631:4344128") // Version 3.108

// Effortless Building (from CurseForge)
compileOnly rfg.deobf("curse.maven:effortless-building-302113:2847346") // Version 2.16
Expand All @@ -134,6 +134,9 @@ dependencies {
// Default World Generator Port (from CurseForge)
compileOnly rfg.deobf("curse.maven:default-world-generator-port-241140:2499252") // Version 2.3

// Top Addons (from CurseForge)
compileOnly rfg.deobf("curse.maven:top-addons-247111:2887479") // Version 1.13.0

/* -------------------------------- Soft Deps, Multiple Runtime Declaration -------------------------------- */
if (project.enable_draconic.toBoolean() || project.enable_thermal.toBoolean()) {
runtimeOnly "curse.maven:redstone-flux-270789:2920436" // Version 2.1.1.1
Expand Down Expand Up @@ -202,7 +205,7 @@ dependencies {
}

if (project.enable_architecture_craft.toBoolean()) {
runtimeOnly "curse.maven:architecture-craft-277631:2750633" // Version 3.98
runtimeOnly "curse.maven:architecture-craft-277631:4344128" // Version 3.108
}

if (project.enable_effortless_building.toBoolean()) {
Expand All @@ -226,6 +229,10 @@ dependencies {
runtimeOnly "curse.maven:default-world-generator-port-241140:2499252" // Version 2.3
}

if (project.enable_top_addons.toBoolean()) {
runtimeOnly "curse.maven:top-addons-247111:2887479" // Version 1.13.0
}

if (project.enable_ender_storage.toBoolean()) {
// Ender Storage, runtime only, integrated in remappers (from CurseForge)
runtimeOnly "curse.maven:ender-storage-245174:2755787" // Version 2.4.6.137
Expand Down
12 changes: 8 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,8 @@ curseForgeRelations = requiredDependency:codechicken-lib-1-8;\
optionalDependency:default-world-generator-port;\
optionalDependency:dme;\
optionalDependency:ftb-library-legacy-forge;\
optionalDependency:ftb-utilities-forge;
optionalDependency:ftb-utilities-forge;\
optionalDependency:top-addons;

# This project's release type on CurseForge and/or Modrinth
# Alternatively this can be set with the 'RELEASE_TYPE' environment variable.
Expand Down Expand Up @@ -253,17 +254,17 @@ enable_xu2 = false
# If this is set to false, the mixin will not apply.
enable_rocketry = false

# Whether to enable Architecture Craft in runtime. Enables the mixin which adds more Architecture Craft Slopes.
# Whether to enable Architecture Craft in runtime. Enables the mixin which adds more Architecture Craft Slopes, improves the Sawbench UI, and fixes the Sawbench Particle Texture.
# If this is set to false, the mixin will not apply.
enable_architecture_craft = false

# Whether to enable Effortless Building in runtime. Enables the mixin which improves clarity of Reach Upgrades.
# If this is set to false, the mixin will not apply.
enable_effortless_building = true
enable_effortless_building = false

# Whether to enable FTB Utilities in runtime. Enables mixins which provide fixes relating to Ghost Items, and Effortless + FTB Utils Compat.
# If this is set to false, Effortless + FTB Utils Compat will not be applied, and the mixin will not apply.
enable_ftb_utils = true
enable_ftb_utils = false

# Whether to enable BQu in runtime. Enables Labs Tier Helper.
enable_bqu = false
Expand All @@ -274,6 +275,9 @@ enable_controlling = false
# Whether to enable Default World Generator Port in runtime. Fixes GUI Rescaling Issues, adds a Cancel Button.
enable_default_world_gen_port = false

# Whether to enable TOP Addons in runtime. Fixes Error Messages with Architecture Craft 3.108
enable_top_addons = false

# Whether to enable Ender Storage in runtime. Enables remappers to remap items in ender storage.
# If this is set to false, the remappers will not apply there.
enable_ender_storage = false
Expand Down
1 change: 1 addition & 0 deletions src/main/java/com/nomiceu/nomilabs/LabsValues.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,5 @@ public class LabsValues {
public static final String DEFAULT_WORLD_GEN_MODID = "defaultworldgenerator-port";
public static final String DME_MODID = "deepmoblearning";
public static final String FTB_UTILS_MODID = "ftbutilities";
public static final String TOP_ADDONS_MODID = "topaddons";
}
3 changes: 2 additions & 1 deletion src/main/java/com/nomiceu/nomilabs/NomiLabs.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
"required-after:jei@[4.15.0,);" + "required-after:theoneprobe;" + "after:advancedrocketry;" +
"after:libvulpes;" + "after:crafttweaker@[4.1.20,);" + "after:appliedenergistics2;" +
"after:architecturecraft;" + "after:effortlessbuilding;" + "after:betterquesting;" +
"after:defaultworldgenerator-port;" + "after:deepmoblearning;" + "after:ftbutilities;")
"after:defaultworldgenerator-port;" + "after:deepmoblearning;" + "after:ftbutilities;" +
"after:topaddons;")
@SuppressWarnings("unused")
public class NomiLabs {

Expand Down
9 changes: 8 additions & 1 deletion src/main/java/com/nomiceu/nomilabs/config/LabsConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ public static class ModIntegration {
public boolean enableAdvancedRocketryIntegration = true;

@Config.Comment({
"Whether to enable ArchitectureCraft Integration, which adds new slope variants, and improves the GUI of the Sawbench.",
"Whether to enable ArchitectureCraft Integration, which adds new slope variants, improves the GUI of the Sawbench, and fixes the Sawbench Particle Texture.",
"[default: true]" })
@Config.LangKey("config.nomilabs.mod_integration.architecture_craft")
@Config.RequiresMcRestart
Expand All @@ -231,6 +231,13 @@ public static class ModIntegration {
@Config.RequiresMcRestart
public boolean enableFTBUtilsIntegration = true;

@Config.Comment({
"Whether to enable TOP Addons Integration. Fixes Error Messages with ArchitectureCraft 3.108.",
"[default: true]" })
@Config.LangKey("config.nomilabs.mod_integration.top_addons")
@Config.RequiresMcRestart
public boolean enableTopAddonsIntegration = true;

public static class EffortlessBuildingIntegration {

@Config.Comment({ "Whether to enable Effortless Building Integration, which splits the parts of reach.",
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/com/nomiceu/nomilabs/core/LabsLateMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ public class LabsLateMixin implements ILateMixinLoader {
LabsConfig.modIntegration.enableDefaultWorldGenIntegration),
new AbstractMap.SimpleImmutableEntry<>(LabsValues.DME_MODID, true),
new AbstractMap.SimpleImmutableEntry<>(LabsValues.FTB_UTILS_MODID,
LabsConfig.modIntegration.enableFTBUtilsIntegration))
LabsConfig.modIntegration.enableFTBUtilsIntegration),
new AbstractMap.SimpleImmutableEntry<>(LabsValues.TOP_ADDONS_MODID,
LabsConfig.modIntegration.enableTopAddonsIntegration))
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,31 @@

import net.minecraftforge.common.util.EnumHelper;

import com.elytradev.architecture.common.shape.Shape;
import com.elytradev.architecture.common.shape.EnumShape;
import com.elytradev.architecture.common.shape.EnumShapeSymmetry;
import com.elytradev.architecture.common.shape.ShapeKind;
import com.elytradev.architecture.common.shape.ShapeSymmetry;
import com.nomiceu.nomilabs.mixin.architecturecraft.ShapeAccessor;

public class LabsShapes {

public static final Shape SLOPE_TILE_A1 = addShape("SLOPE_TILE_A1", 94, "Slope A Start", ShapeKind.Roof,
ShapeSymmetry.BILATERAL, 1, 1, 0xcf);
public static final Shape SLOPE_TILE_A2 = addShape("SLOPE_TILE_A2", 95, "Slope A End", ShapeKind.Roof,
ShapeSymmetry.BILATERAL, 1, 3, 0x0f);
public static final Shape SLOPE_TILE_B1 = addShape("SLOPE_TILE_B1", 96, "Slope B Start", ShapeKind.Roof,
ShapeSymmetry.BILATERAL, 1, 1, 0xff);
public static final Shape SLOPE_TILE_B2 = addShape("SLOPE_TILE_B2", 97, "Slope B Middle", ShapeKind.Roof,
ShapeSymmetry.BILATERAL, 1, 2, 0xcf);
public static final Shape SLOPE_TILE_B3 = addShape("SLOPE_TILE_B3", 98, "Slope B End", ShapeKind.Roof,
ShapeSymmetry.BILATERAL, 1, 3, 0x0f);
public static final Shape SLOPE_TILE_C1 = addShape("SLOPE_TILE_C1", 99, "Slope C 1", ShapeKind.Roof,
ShapeSymmetry.BILATERAL, 1, 1, 0xff);
public static final Shape SLOPE_TILE_C2 = addShape("SLOPE_TILE_C2", 100, "Slope C 2", ShapeKind.Roof,
ShapeSymmetry.BILATERAL, 1, 2, 0xcf);
public static final Shape SLOPE_TILE_C3 = addShape("SLOPE_TILE_C3", 101, "Slope C 3", ShapeKind.Roof,
ShapeSymmetry.BILATERAL, 1, 3, 0x0f);
public static final Shape SLOPE_TILE_C4 = addShape("SLOPE_TILE_C4", 102, "Slope C 4", ShapeKind.Roof,
ShapeSymmetry.BILATERAL, 1, 4, 0x0f);
public static final EnumShape SLOPE_TILE_A1 = addShape("SLOPE_TILE_A1", 94, "Slope A Start", ShapeKind.Roof,
EnumShapeSymmetry.BILATERAL, 1, 1, 0xcf);
public static final EnumShape SLOPE_TILE_A2 = addShape("SLOPE_TILE_A2", 95, "Slope A End", ShapeKind.Roof,
EnumShapeSymmetry.BILATERAL, 1, 3, 0x0f);
public static final EnumShape SLOPE_TILE_B1 = addShape("SLOPE_TILE_B1", 96, "Slope B Start", ShapeKind.Roof,
EnumShapeSymmetry.BILATERAL, 1, 1, 0xff);
public static final EnumShape SLOPE_TILE_B2 = addShape("SLOPE_TILE_B2", 97, "Slope B Middle", ShapeKind.Roof,
EnumShapeSymmetry.BILATERAL, 1, 2, 0xcf);
public static final EnumShape SLOPE_TILE_B3 = addShape("SLOPE_TILE_B3", 98, "Slope B End", ShapeKind.Roof,
EnumShapeSymmetry.BILATERAL, 1, 3, 0x0f);
public static final EnumShape SLOPE_TILE_C1 = addShape("SLOPE_TILE_C1", 99, "Slope C 1", ShapeKind.Roof,
EnumShapeSymmetry.BILATERAL, 1, 1, 0xff);
public static final EnumShape SLOPE_TILE_C2 = addShape("SLOPE_TILE_C2", 100, "Slope C 2", ShapeKind.Roof,
EnumShapeSymmetry.BILATERAL, 1, 2, 0xcf);
public static final EnumShape SLOPE_TILE_C3 = addShape("SLOPE_TILE_C3", 101, "Slope C 3", ShapeKind.Roof,
EnumShapeSymmetry.BILATERAL, 1, 3, 0x0f);
public static final EnumShape SLOPE_TILE_C4 = addShape("SLOPE_TILE_C4", 102, "Slope C 4", ShapeKind.Roof,
EnumShapeSymmetry.BILATERAL, 1, 4, 0x0f);

/**
* Essentially, this loads the class, allowing the above values to be added.
Expand All @@ -37,11 +37,11 @@ public class LabsShapes {
public static void preInit() {}

@SuppressWarnings("SameParameterValue")
private static Shape addShape(String name, int id, String title, ShapeKind kind, ShapeSymmetry sym, int used,
int made, int occ) {
var shape = EnumHelper.addEnum(Shape.class, name,
new Class<?>[] { int.class, String.class, ShapeKind.class, ShapeSymmetry.class, int.class, int.class,
int.class },
private static EnumShape addShape(String name, int id, String title, ShapeKind kind, EnumShapeSymmetry sym,
int used, int made, int occ) {
var shape = EnumHelper.addEnum(EnumShape.class, name,
new Class<?>[] { int.class, String.class, ShapeKind.class, EnumShapeSymmetry.class, int.class,
int.class, int.class },
id, title, kind, sym, used, made, occ);
ShapeAccessor.getIDMap().put(id, shape);
return shape;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import nl.requios.effortlessbuilding.BuildConfig;
import nl.requios.effortlessbuilding.EffortlessBuilding;
import nl.requios.effortlessbuilding.buildmodifier.ModifierSettingsManager;
import scala.Int;

public class GenericReachUpgrade {

Expand Down Expand Up @@ -91,6 +90,7 @@ public static void addInformation(List<String> tooltip, int level) {
}

public static class ReachInfo {

// Uses Suppliers so that we can change configs on the fly
private final Supplier<Integer> distance;
private final Supplier<Integer> axis;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package com.nomiceu.nomilabs.mixin.architecturecraft;

import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.init.Blocks;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;

import org.spongepowered.asm.mixin.Mixin;

import com.elytradev.architecture.common.block.BlockArchitecture;
import com.elytradev.architecture.common.block.BlockSawbench;
import com.elytradev.architecture.common.tile.TileSawbench;

/**
* Fixes the Particle Texture of the Sawbench.
*/
@Mixin(value = BlockSawbench.class, remap = false)
public class BlockSawbenchMixin extends BlockArchitecture<TileSawbench> {

/**
* Default Ignored Constructor
*/
public BlockSawbenchMixin(Material material) {
super(material);
}

@Override
public IBlockState getParticleState(IBlockAccess world, BlockPos pos) {
return Blocks.IRON_BLOCK.getDefaultState();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Accessor;

import com.elytradev.architecture.common.shape.Shape;
import com.elytradev.architecture.common.shape.EnumShape;

/**
* Allows accessing the protected static ID Map, which is used by Architecture Craft.
*/
@Mixin(value = Shape.class, remap = false)
@Mixin(value = EnumShape.class, remap = false)
public interface ShapeAccessor {

@Accessor(value = "idMap")
static Map<Integer, Shape> getIDMap() {
static Map<Integer, EnumShape> getIDMap() {
throw new NotImplementedException("ShapeAccessorMixin Failed to Apply!");
}
}
Loading

0 comments on commit 1c2abfc

Please sign in to comment.