feat: added support for ReFramed block entities with axiom
This commit is contained in:
parent
15a8f80210
commit
5430016be4
@ -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}"
|
||||||
}
|
}
|
||||||
|
@ -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
|
||||||
|
@ -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)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -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());
|
||||||
|
}
|
||||||
|
}
|
@ -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",
|
||||||
|
Loading…
Reference in New Issue
Block a user