diff --git a/build.gradle b/build.gradle index b8cf8d5e0..ebb0b18ad 100644 --- a/build.gradle +++ b/build.gradle @@ -3,9 +3,11 @@ buildscript { maven { url = 'https://files.minecraftforge.net/maven' } jcenter() mavenCentral() + maven { url='https://dist.creeper.host/Sponge/maven' } } dependencies { classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '3.+', changing: true + classpath group: 'org.spongepowered', name: 'mixingradle', version: '0.7-SNAPSHOT' } } plugins { @@ -35,6 +37,8 @@ minecraft { runs { client { workingDirectory project.file('run') + property 'mixin.env.disableRefMap', 'true' + arg '-mixin.config=create.mixins.json' property 'forge.logging.console.level', 'info' property 'fml.earlyprogresswindow', 'false' mods { @@ -46,6 +50,8 @@ minecraft { server { workingDirectory project.file('run/server') + property 'mixin.env.disableRefMap', 'true' + arg '-mixin.config=create.mixins.json' property 'forge.logging.console.level', 'info' mods { create { @@ -131,7 +137,8 @@ jar { "Implementation-Title": project.name, "Implementation-Version": "${version}", "Implementation-Vendor" :"simibubi", - "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ") + "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"), + "MixinConfigs": "create.mixins.json" ]) } } @@ -200,3 +207,9 @@ curseforge { } } } + +apply plugin: 'org.spongepowered.mixin' + +mixin { + add sourceSets.main, "create.refmap.json" +} \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 1c23e4f1c..89ef1a512 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,7 +6,7 @@ org.gradle.daemon=false # mod version info mod_version=0.3c minecraft_version=1.15.2 -forge_version=31.2.31 +forge_version=31.2.47 # dependency versions registrate_version=0.0.4.18 diff --git a/src/main/java/com/simibubi/create/foundation/mixin/LightUpdateMixin.java b/src/main/java/com/simibubi/create/foundation/mixin/LightUpdateMixin.java new file mode 100644 index 000000000..0db373baa --- /dev/null +++ b/src/main/java/com/simibubi/create/foundation/mixin/LightUpdateMixin.java @@ -0,0 +1,18 @@ +package com.simibubi.create.foundation.mixin; + +import net.minecraft.client.multiplayer.ClientChunkProvider; +import net.minecraft.util.math.SectionPos; +import net.minecraft.world.LightType; +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.CallbackInfo; + +@Mixin(ClientChunkProvider.class) +public class LightUpdateMixin { + + @Inject(at = @At("HEAD"), method = "markLightChanged(Lnet/minecraft/world/LightType;Lnet/minecraft/util/math/SectionPos;)V") + private void onLightUpdate(LightType type, SectionPos pos, CallbackInfo ci) { + + } +} diff --git a/src/main/java/com/simibubi/create/foundation/mixin/RenderInLayerMixin.java b/src/main/java/com/simibubi/create/foundation/mixin/RenderInLayerMixin.java new file mode 100644 index 000000000..9c5a2292a --- /dev/null +++ b/src/main/java/com/simibubi/create/foundation/mixin/RenderInLayerMixin.java @@ -0,0 +1,21 @@ +package com.simibubi.create.foundation.mixin; + +import com.mojang.blaze3d.matrix.MatrixStack; +import net.minecraft.client.multiplayer.ClientChunkProvider; +import net.minecraft.client.renderer.RenderType; +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.util.math.SectionPos; +import net.minecraft.world.LightType; +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.CallbackInfo; + +@Mixin(WorldRenderer.class) +public class RenderInLayerMixin { + + @Inject(at = @At("HEAD"), method = "renderLayer") + private void renderLayer(RenderType type, MatrixStack stack, double cameraX, double cameraY, double cameraZ, CallbackInfo ci) { + + } +} diff --git a/src/main/resources/create.mixins.json b/src/main/resources/create.mixins.json new file mode 100644 index 000000000..c4bf6f100 --- /dev/null +++ b/src/main/resources/create.mixins.json @@ -0,0 +1,14 @@ +{ + "required": true, + "package": "com.simibubi.create.foundation.mixin", + "compatibilityLevel": "JAVA_8", + "refmap": "create.refmap.json", + "client": [ + "LightUpdateMixin", + "RenderInLayerMixin" + ], + "injectors": { + "defaultRequire": 1 + }, + "minVersion": "0.8" +} \ No newline at end of file