mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2025-07-02 16:05:29 +00:00
begin splitting mixins into common
This commit is contained in:
parent
37c358e3d1
commit
e1cbb29ae4
@ -28,6 +28,15 @@ object Versions {
|
||||
const val minotaur = "1.1.0"
|
||||
}
|
||||
|
||||
object Mod {
|
||||
const val minecraft = "1.19"
|
||||
const val yarn = "$minecraft+build.1"
|
||||
const val fabricLoader = "0.14.2"
|
||||
|
||||
const val architecuryLoom = "0.12.0-SNAPSHOT"
|
||||
const val architectutyPlugin = "3.4-SNAPSHOT"
|
||||
}
|
||||
|
||||
object Forge {
|
||||
const val minecraft = "1.19"
|
||||
const val forge = "$minecraft-41.0.38"
|
||||
|
@ -1,8 +1,16 @@
|
||||
plugins {
|
||||
id("fabric-loom") version Versions.Fabric.loom
|
||||
id("dev.architectury.loom") version Versions.Mod.architecuryLoom
|
||||
id("architectury-plugin") version Versions.Mod.architectutyPlugin
|
||||
id("io.github.juuxel.loom-quiltflower") version Versions.Fabric.loomQuiltflower
|
||||
}
|
||||
|
||||
configurations {
|
||||
val common by creating
|
||||
create("shadowCommon")
|
||||
compileClasspath.get().extendsFrom(common)
|
||||
runtimeClasspath.get().extendsFrom(common)
|
||||
}
|
||||
|
||||
dependencies {
|
||||
shadedApi(project(":common:implementation:base"))
|
||||
|
||||
@ -10,6 +18,9 @@ dependencies {
|
||||
"annotationProcessor"("net.fabricmc:sponge-mixin:${Versions.Fabric.mixin}")
|
||||
"annotationProcessor"("net.fabricmc:fabric-loom:${Versions.Fabric.loom}")
|
||||
|
||||
"common"(project(path = ":platforms:mod-common", configuration = "namedElements")) { isTransitive = false }
|
||||
"shadowCommon"(project(path = ":platforms:mod-common", configuration = "transformProductionFabric")) { isTransitive = false }
|
||||
|
||||
minecraft("com.mojang:minecraft:${Versions.Fabric.minecraft}")
|
||||
mappings("net.fabricmc:yarn:${Versions.Fabric.yarn}:v2")
|
||||
|
||||
@ -28,7 +39,7 @@ dependencies {
|
||||
loom {
|
||||
accessWidenerPath.set(file("src/main/resources/terra.accesswidener"))
|
||||
mixin {
|
||||
defaultRefmapName.set("terra-refmap.json")
|
||||
defaultRefmapName.set("terra-fabric-refmap.json")
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -17,6 +17,8 @@
|
||||
|
||||
package com.dfsek.terra.fabric.generation;
|
||||
|
||||
import com.dfsek.terra.mod.mixin.access.StructureAccessorAccessor;
|
||||
|
||||
import com.mojang.serialization.Codec;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.Blocks;
|
||||
@ -63,7 +65,6 @@ import com.dfsek.terra.api.world.chunk.generation.util.GeneratorWrapper;
|
||||
import com.dfsek.terra.api.world.info.WorldProperties;
|
||||
import com.dfsek.terra.fabric.config.PreLoadCompatibilityOptions;
|
||||
import com.dfsek.terra.fabric.data.Codecs;
|
||||
import com.dfsek.terra.fabric.mixin.access.StructureAccessorAccessor;
|
||||
import com.dfsek.terra.fabric.util.FabricAdapter;
|
||||
|
||||
|
||||
|
@ -1,15 +0,0 @@
|
||||
package com.dfsek.terra.fabric.mixin.access;
|
||||
|
||||
import net.minecraft.world.ChunkRegion;
|
||||
import net.minecraft.world.chunk.Chunk;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.gen.Accessor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@Mixin(ChunkRegion.class)
|
||||
public interface ChunkRegionAccessor {
|
||||
@Accessor("chunks")
|
||||
List<Chunk> getChunks();
|
||||
}
|
@ -17,6 +17,8 @@
|
||||
|
||||
package com.dfsek.terra.fabric.mixin.implementations.terra.block.entity;
|
||||
|
||||
import com.dfsek.terra.mod.mixin.access.MobSpawnerLogicAccessor;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.entity.BlockEntity;
|
||||
import net.minecraft.block.entity.BlockEntityType;
|
||||
@ -35,7 +37,6 @@ import com.dfsek.terra.api.block.entity.MobSpawner;
|
||||
import com.dfsek.terra.api.block.entity.SerialState;
|
||||
import com.dfsek.terra.api.entity.EntityType;
|
||||
import com.dfsek.terra.fabric.FabricEntryPoint;
|
||||
import com.dfsek.terra.fabric.mixin.access.MobSpawnerLogicAccessor;
|
||||
|
||||
|
||||
@Mixin(MobSpawnerBlockEntity.class)
|
||||
|
@ -1,6 +1,8 @@
|
||||
package com.dfsek.terra.fabric.mixin.implementations.terra.block.state;
|
||||
|
||||
|
||||
import com.dfsek.terra.mod.mixin.access.StateAccessor;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.mojang.serialization.MapCodec;
|
||||
import net.minecraft.block.AbstractBlock.AbstractBlockState;
|
||||
@ -18,7 +20,6 @@ import java.util.stream.Collectors;
|
||||
import com.dfsek.terra.api.block.BlockType;
|
||||
import com.dfsek.terra.api.block.state.BlockState;
|
||||
import com.dfsek.terra.api.block.state.properties.Property;
|
||||
import com.dfsek.terra.fabric.mixin.access.StateAccessor;
|
||||
|
||||
|
||||
@Mixin(AbstractBlockState.class)
|
||||
|
@ -4,10 +4,6 @@
|
||||
"package": "com.dfsek.terra.fabric.mixin",
|
||||
"compatibilityLevel": "JAVA_17",
|
||||
"mixins": [
|
||||
"access.ChunkRegionAccessor",
|
||||
"access.MobSpawnerLogicAccessor",
|
||||
"access.StateAccessor",
|
||||
"access.StructureAccessorAccessor",
|
||||
"fix.BeeMoveGoalsUnsynchronizedRandomAccessFix",
|
||||
"fix.NetherFossilOptimization",
|
||||
"implementations.compat.GenerationSettingsFloraFeaturesMixin",
|
||||
@ -49,5 +45,5 @@
|
||||
"injectors": {
|
||||
"defaultRequire": 1
|
||||
},
|
||||
"refmap": "terra-refmap.json"
|
||||
"refmap": "terra-fabric-refmap.json"
|
||||
}
|
@ -13,7 +13,7 @@ dependencies {
|
||||
|
||||
loom {
|
||||
mixin {
|
||||
defaultRefmapName.set("terra-refmap.json")
|
||||
defaultRefmapName.set("terra-forge-refmap.json")
|
||||
}
|
||||
|
||||
forge {
|
||||
|
@ -44,5 +44,5 @@
|
||||
"injectors": {
|
||||
"defaultRequire": 1
|
||||
},
|
||||
"refmap": "terra-refmap.json"
|
||||
"refmap": "terra-forge-refmap.json"
|
||||
}
|
4
platforms/mod-common/README.md
Normal file
4
platforms/mod-common/README.md
Normal file
@ -0,0 +1,4 @@
|
||||
# mixin-common
|
||||
|
||||
This project contains mixins shared between Forge & Fabric, as
|
||||
well as glue code.
|
18
platforms/mod-common/build.gradle.kts
Normal file
18
platforms/mod-common/build.gradle.kts
Normal file
@ -0,0 +1,18 @@
|
||||
plugins {
|
||||
id("dev.architectury.loom") version Versions.Mod.architecuryLoom
|
||||
id("architectury-plugin") version Versions.Mod.architectutyPlugin
|
||||
}
|
||||
|
||||
dependencies {
|
||||
shadedApi(project(":common:implementation:base"))
|
||||
|
||||
modImplementation("net.fabricmc:fabric-loader:${Versions.Mod.fabricLoader}")
|
||||
|
||||
minecraft("com.mojang:minecraft:${Versions.Mod.minecraft}")
|
||||
mappings("net.fabricmc:yarn:${Versions.Mod.yarn}:v2")
|
||||
}
|
||||
|
||||
architectury {
|
||||
common("fabric", "forge")
|
||||
minecraft = Versions.Mod.minecraft
|
||||
}
|
@ -15,7 +15,7 @@
|
||||
* along with Terra. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.dfsek.terra.fabric.mixin.access;
|
||||
package com.dfsek.terra.mod.mixin.access;
|
||||
|
||||
import net.minecraft.world.MobSpawnerEntry;
|
||||
import net.minecraft.world.MobSpawnerLogic;
|
@ -15,7 +15,7 @@
|
||||
* along with Terra. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.dfsek.terra.fabric.mixin.access;
|
||||
package com.dfsek.terra.mod.mixin.access;
|
||||
|
||||
import net.minecraft.state.State;
|
||||
import net.minecraft.state.property.Property;
|
@ -15,7 +15,7 @@
|
||||
* along with Terra. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.dfsek.terra.fabric.mixin.access;
|
||||
package com.dfsek.terra.mod.mixin.access;
|
||||
|
||||
import net.minecraft.world.WorldAccess;
|
||||
import net.minecraft.world.gen.StructureAccessor;
|
8
platforms/mod-common/src/main/resources/fabric.mod.json
Normal file
8
platforms/mod-common/src/main/resources/fabric.mod.json
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
"schemaVersion": 1,
|
||||
"id": "terra-common",
|
||||
"version": "1.0.0",
|
||||
"mixins": [
|
||||
"terra.common.mixins.json"
|
||||
]
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
{
|
||||
"required": true,
|
||||
"minVersion": "0.8",
|
||||
"package": "com.dfsek.terra.mod.mixin",
|
||||
"compatibilityLevel": "JAVA_17",
|
||||
"mixins": [
|
||||
"access.MobSpawnerLogicAccessor",
|
||||
"access.StateAccessor",
|
||||
"access.StructureAccessorAccessor"
|
||||
],
|
||||
"client": [
|
||||
],
|
||||
"server": [
|
||||
],
|
||||
"injectors": {
|
||||
"defaultRequire": 1
|
||||
},
|
||||
"refmap": "terra-common-refmap.json"
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user