Compare commits

...

2 Commits

Author SHA1 Message Date
f6b403d852 Merge pull request 'feat: added support for ReFramed block entities with axiom' (#16) from dev into master
All checks were successful
deploy / deploy (push) Successful in 5m16s
Reviewed-on: #16
2024-05-23 12:34:22 +02:00
5430016be4 feat: added support for ReFramed block entities with axiom 2024-05-23 12:33:54 +02:00
5 changed files with 33 additions and 2 deletions

View File

@ -118,6 +118,9 @@ dependencies {
modRuntimeOnly "com.teamresourceful.resourcefullib:resourcefullib-fabric-${project.minecraft_version}:2.4.7" modRuntimeOnly "com.teamresourceful.resourcefullib:resourcefullib-fabric-${project.minecraft_version}:2.4.7"
modRuntimeOnly "earth.terrarium.chipped:Chipped-fabric-${project.minecraft_version}:3.1.2" modRuntimeOnly "earth.terrarium.chipped:Chipped-fabric-${project.minecraft_version}:3.1.2"
// Axiom for blueprint support
modCompileOnly "maven.modrinth:N6n5dqoA:nvx3oDkz"
// Fabric API. // Fabric API.
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}" modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
} }

View File

@ -9,7 +9,7 @@ loader_version=0.15.11
# Mod Properties # Mod Properties
modrinth_id = jCpoCBpn modrinth_id = jCpoCBpn
mod_version = 1.5.10 mod_version = 1.5.11
maven_group = fr.adrien1106 maven_group = fr.adrien1106
archives_base_name = ReFramed archives_base_name = ReFramed
mod_id = reframed mod_id = reframed

View File

@ -17,7 +17,7 @@ public class CompatMixinPlugin implements IMixinConfigPlugin {
private static final FabricLoader LOADER = FabricLoader.getInstance(); private static final FabricLoader LOADER = FabricLoader.getInstance();
private static final Logger LOGGER = LoggerFactory.getLogger("ReFramed MIXIN"); private static final Logger LOGGER = LoggerFactory.getLogger("ReFramed MIXIN");
private static final List<String> COMPAT_MOD = List.of("athena", "indium", "sodium", "special-model-loader", "continuity"); private static final List<String> COMPAT_MOD = List.of("athena", "indium", "sodium", "special-model-loader", "continuity", "axiom");
private static final Map<String, Supplier<Boolean>> CONDITIONS = new HashMap<>(); private static final Map<String, Supplier<Boolean>> CONDITIONS = new HashMap<>();
static { static {
CONDITIONS.put("fr.adrien1106.reframed.mixin.compat.AthenaBakedModelMixin", () -> LOADER.isModLoaded(COMPAT_MOD.get(0))); CONDITIONS.put("fr.adrien1106.reframed.mixin.compat.AthenaBakedModelMixin", () -> LOADER.isModLoaded(COMPAT_MOD.get(0)));
@ -33,6 +33,7 @@ public class CompatMixinPlugin implements IMixinConfigPlugin {
CONDITIONS.put("fr.adrien1106.reframed.mixin.compat.ContinuityCTMBakedModelMixin", () -> LOADER.isModLoaded(COMPAT_MOD.get(4))); CONDITIONS.put("fr.adrien1106.reframed.mixin.compat.ContinuityCTMBakedModelMixin", () -> LOADER.isModLoaded(COMPAT_MOD.get(4)));
CONDITIONS.put("fr.adrien1106.reframed.mixin.compat.ContinuityCTMQuadTransformMixin", () -> LOADER.isModLoaded(COMPAT_MOD.get(4))); CONDITIONS.put("fr.adrien1106.reframed.mixin.compat.ContinuityCTMQuadTransformMixin", () -> LOADER.isModLoaded(COMPAT_MOD.get(4)));
CONDITIONS.put("fr.adrien1106.reframed.mixin.compat.ContinuityModelWrappingHandlerMixin", () -> LOADER.isModLoaded(COMPAT_MOD.get(4))); CONDITIONS.put("fr.adrien1106.reframed.mixin.compat.ContinuityModelWrappingHandlerMixin", () -> LOADER.isModLoaded(COMPAT_MOD.get(4)));
CONDITIONS.put("fr.adrien1106.reframed.mixin.compat.AxiomClientBlockEntitySerializerMixin", () -> LOADER.isModLoaded(COMPAT_MOD.get(5)));
} }

View File

@ -0,0 +1,26 @@
package fr.adrien1106.reframed.mixin.compat;
import com.moulberry.axiom.world_modification.ClientBlockEntitySerializer;
import fr.adrien1106.reframed.util.blocks.ThemeableBlockEntity;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.nbt.NbtCompound;
import net.minecraft.registry.RegistryWrapper;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
@Mixin(ClientBlockEntitySerializer.class)
public class AxiomClientBlockEntitySerializerMixin {
@Inject(
method = "serialize",
at = @At("HEAD"),
remap = false,
cancellable = true
)
private static void serialize(BlockEntity blockEntity, RegistryWrapper.WrapperLookup provider, CallbackInfoReturnable<NbtCompound> cir) {
if (!(blockEntity instanceof ThemeableBlockEntity)) return;
cir.setReturnValue(blockEntity.createNbt());
}
}

View File

@ -15,6 +15,7 @@
"compat.AthenaBakedModelMixin", "compat.AthenaBakedModelMixin",
"compat.AthenaConnectedBlockModelMixin", "compat.AthenaConnectedBlockModelMixin",
"compat.AthenaWrappedGetterMixin", "compat.AthenaWrappedGetterMixin",
"compat.AxiomClientBlockEntitySerializerMixin",
"compat.ContinuityConnectionPredicateMixin", "compat.ContinuityConnectionPredicateMixin",
"compat.ContinuityCTMBakedModelMixin", "compat.ContinuityCTMBakedModelMixin",
"compat.ContinuityCTMQuadTransformMixin", "compat.ContinuityCTMQuadTransformMixin",