Skip to content

Commit

Permalink
Create Support + Loom Update
Browse files Browse the repository at this point in the history
  • Loading branch information
yurisuika committed Oct 20, 2022
1 parent c152c9e commit 0b388d2
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 12 deletions.
11 changes: 6 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'fabric-loom' version '0.12-SNAPSHOT'
id 'fabric-loom' version '1.0-SNAPSHOT'
id 'maven-publish'
}

Expand All @@ -23,10 +23,11 @@ dependencies {

modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"

modCompileOnly ("squeek.appleskin:appleskin-fabric:mc1.19-2.4.0") {transitive = false}
modCompileOnly ("com.github.Lizard-Of-Oz.Inventorio:inventorio-1.18-fabric:1.18-SNAPSHOT") {transitive = false}
modCompileOnly ("com.github.RedLime:DetailArmorBar:2.6.1") {transitive = false}
modCompileOnly ("curse.maven:health-overlay-fabric-313219:3837279") {transitive = false}
modCompileOnly ("curse.maven:appleskin-248787:3872808") {transitive = false}
modCompileOnly ("curse.maven:create-fabric-624165:4011240") {transitive = false}
modCompileOnly ("curse.maven:detail-armor-bar-506898:3823985") {transitive = false}
modCompileOnly ("curse.maven:health-overlay-fabric-313219:3932265") {transitive = false}
modCompileOnly ("curse.maven:inventorio-491073:3963530") {transitive = false}
}

processResources {
Expand Down
10 changes: 5 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ org.gradle.jvmargs=-Xmx1G

# Fabric Properties
# check these on https://fabricmc.net/use
minecraft_version=1.19
yarn_mappings=1.19+build.4
loader_version=0.14.8
minecraft_version=1.19.2
yarn_mappings=1.19.2+build.28
loader_version=0.14.9

# Mod Properties
mod_version = 1.1.2
mod_version = 1.1.3
maven_group = com.yurisuika.raised
archives_base_name = raised

# Dependencies
# currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api
fabric_version=0.56.0+1.19
fabric_version=0.64.0+1.19.2
1 change: 1 addition & 0 deletions src/main/java/com/yurisuika/raised/RaisedMixinPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public final class RaisedMixinPlugin implements IMixinConfigPlugin {

private static final Map<String, Supplier<Boolean>> CONDITIONS = ImmutableMap.of(
"com.yurisuika.raised.mixin.mods.AppleskinMixin", () -> FabricLoader.getInstance().isModLoaded("appleskin"),
"com.yurisuika.raised.mixin.mods.CreateMixin", () -> FabricLoader.getInstance().isModLoaded("create"),
"com.yurisuika.raised.mixin.mods.DetailArmorBarMixin", () -> FabricLoader.getInstance().isModLoaded("detailab"),
"com.yurisuika.raised.mixin.mods.HealthOverlayMixin", () -> FabricLoader.getInstance().isModLoaded("healthoverlay"),
"com.yurisuika.raised.mixin.mods.InventorioMixin", () -> FabricLoader.getInstance().isModLoaded("inventorio")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
public class AppleskinMixin {

@Redirect(method = "onPreRender", at = @At(value = "INVOKE", target = "net/minecraft/client/util/Window.getScaledHeight()I"))
private int modifyScaledHeightA(Window instance) {
private int modifyScaledHeight(Window instance) {
return instance.getScaledHeight() - Raised.getDistance();
}

@Redirect(method = "onRender", at = @At(value = "INVOKE", target = "net/minecraft/client/util/Window.getScaledHeight()I"))
private int modifyScaledHeightB(Window instance) {
private int modifyScaledHeight2(Window instance) {
return instance.getScaledHeight() - Raised.getDistance();
}

Expand Down
33 changes: 33 additions & 0 deletions src/main/java/com/yurisuika/raised/mixin/mods/CreateMixin.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package com.yurisuika.raised.mixin.mods;

import com.simibubi.create.content.contraptions.components.structureMovement.interaction.controls.TrainHUD;
import com.simibubi.create.content.curiosities.toolbox.ToolboxHandlerClient;
import com.yurisuika.raised.Raised;
import net.minecraft.client.util.Window;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;

public class CreateMixin {

@Mixin(ToolboxHandlerClient.class)
public static class TrainHUDMixin {

@Redirect(method = "renderOverlay", at = @At(value = "INVOKE", target = "net/minecraft/client/util/Window.getScaledHeight()I"))
private static int modifyScaledHeight(Window instance) {
return instance.getScaledHeight() - Raised.getDistance();
}

}

@Mixin(TrainHUD.class)
public static class ToolboxHandlerClientMixin {

@Redirect(method = "renderOverlay", at = @At(value = "INVOKE", target = "net/minecraft/client/util/Window.getScaledHeight()I"))
private static int modifyScaledHeight(Window instance) {
return instance.getScaledHeight() - Raised.getDistance();
}

}

}
2 changes: 2 additions & 0 deletions src/main/resources/raised.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
"client.gui.hud.ChatHudMixin",
"client.gui.hud.InGameHudMixin",
"mods.AppleskinMixin",
"mods.CreateMixin$ToolboxHandlerClientMixin",
"mods.CreateMixin$TrainHUDMixin",
"mods.DetailArmorBarMixin",
"mods.HealthOverlayMixin",
"mods.InventorioMixin"
Expand Down

0 comments on commit 0b388d2

Please sign in to comment.