begin splitting mixins into common

This commit is contained in:
dfsek
2022-06-21 14:46:50 -07:00
parent 37c358e3d1
commit e1cbb29ae4
16 changed files with 83 additions and 30 deletions

View File

@@ -0,0 +1,4 @@
# mixin-common
This project contains mixins shared between Forge & Fabric, as
well as glue code.

View 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
}

View File

@@ -0,0 +1,30 @@
/*
* This file is part of Terra.
*
* Terra is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Terra is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Terra. If not, see <https://www.gnu.org/licenses/>.
*/
package com.dfsek.terra.mod.mixin.access;
import net.minecraft.world.MobSpawnerEntry;
import net.minecraft.world.MobSpawnerLogic;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Accessor;
@Mixin(MobSpawnerLogic.class)
public interface MobSpawnerLogicAccessor {
@Accessor("spawnEntry")
MobSpawnerEntry getSpawnEntry();
}

View File

@@ -0,0 +1,35 @@
/*
* This file is part of Terra.
*
* Terra is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Terra is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Terra. If not, see <https://www.gnu.org/licenses/>.
*/
package com.dfsek.terra.mod.mixin.access;
import net.minecraft.state.State;
import net.minecraft.state.property.Property;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Accessor;
import java.util.Map;
import java.util.function.Function;
@Mixin(State.class)
public interface StateAccessor {
@Accessor("PROPERTY_MAP_PRINTER")
static Function<Map.Entry<Property<?>, Comparable<?>>, String> getPropertyMapPrinter() {
throw new UnsupportedOperationException();
}
}

View File

@@ -0,0 +1,30 @@
/*
* This file is part of Terra.
*
* Terra is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Terra is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Terra. If not, see <https://www.gnu.org/licenses/>.
*/
package com.dfsek.terra.mod.mixin.access;
import net.minecraft.world.WorldAccess;
import net.minecraft.world.gen.StructureAccessor;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Accessor;
@Mixin(StructureAccessor.class)
public interface StructureAccessorAccessor {
@Accessor
WorldAccess getWorld();
}

View File

@@ -0,0 +1,8 @@
{
"schemaVersion": 1,
"id": "terra-common",
"version": "1.0.0",
"mixins": [
"terra.common.mixins.json"
]
}

View File

@@ -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"
}