-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ab7a59e
commit 37e32aa
Showing
18 changed files
with
300 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
microdurability-1.20/src/main/java/com/github/reviversmc/microdurability/Renderer120.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,31 @@ | ||
package com.github.reviversmc.microdurability; | ||
|
||
import net.minecraft.client.font.TextRenderer; | ||
import net.minecraft.client.gui.DrawContext; | ||
import net.minecraft.client.render.RenderLayer; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.util.Identifier; | ||
import net.minecraft.util.math.ColorHelper; | ||
|
||
/** | ||
* See {@link DrawContext#drawItemInSlot(TextRenderer, ItemStack, int, int, String)}. | ||
*/ | ||
public class Renderer120 extends Renderer1194 { | ||
@Override | ||
protected void drawWarningTexture(Identifier texture, Object context, int x, int y, int u, int v, int width, int height) { | ||
((DrawContext) context).drawTexture(texture, x, y, u, v, width, height); | ||
} | ||
|
||
@Override | ||
protected void preRenderGuiQuads() { | ||
} | ||
|
||
@Override | ||
protected void postRenderGuiQuads() { | ||
} | ||
|
||
@Override | ||
protected void renderGuiQuad(Object context, int x, int y, int width, int height, int red, int green, int blue, int alpha) { | ||
((DrawContext) context).fill(RenderLayer.getGuiOverlay(), x, y, x + width, y + height, ColorHelper.Argb.getArgb(alpha, red, green, blue)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
base { | ||
archivesName = archivesName.get() + '-compat-1.21' | ||
} | ||
|
||
dependencies { | ||
api project(path: ':microdurability-1.20.5', configuration: 'namedElements') | ||
|
||
minecraft "com.mojang:minecraft:${project.minecraft_version_1_21}" | ||
mappings "net.fabricmc:yarn:${project.yarn_mappings_1_21}:v2" | ||
|
||
// Other mods | ||
modRuntimeOnly "com.terraformersmc:modmenu:${project.modmenu_version_1_21}" | ||
modRuntimeOnly("me.shedaniel.cloth:cloth-config-fabric:${project.cloth_config_version_1_21}") { | ||
exclude(group: 'net.fabricmc.fabric-api') | ||
} | ||
|
||
|
||
if (project.use_third_party_mods == 'true') { | ||
// Use full Fabric API bundle while debugging, since transitive deps aren't always declared correctly | ||
modRuntimeOnly "net.fabricmc.fabric-api:fabric-api:${project.fabric_api_version_1_21}" | ||
|
||
modRuntimeOnly "maven.modrinth:sodium:${project.sodium_version_1_21}" | ||
modRuntimeOnly "maven.modrinth:lithium:${project.lithium_version_1_21}" | ||
modRuntimeOnly "maven.modrinth:ferrite-core:${project.ferritecore_version_1_21}" | ||
// modRuntimeOnly "maven.modrinth:threadtweak:${project.threadtweak_version_1_21}" | ||
modRuntimeOnly "maven.modrinth:fadeless:${project.fadeless_version_1_21}" | ||
|
||
// Comment out the following dependencies to check vanilla compatibility | ||
// modRuntimeOnly "maven.modrinth:raised:${project.raised_version_1_21}" | ||
// modRuntimeOnly "maven.modrinth:double-hotbar:${project.double_hotbar_version_1_21}" | ||
} | ||
} | ||
|
||
java { | ||
sourceCompatibility = JavaVersion.VERSION_21 | ||
targetCompatibility = JavaVersion.VERSION_21 | ||
} | ||
|
||
tasks.withType(JavaCompile).configureEach { | ||
it.options.release = 21 | ||
} |
20 changes: 20 additions & 0 deletions
20
...rability-1.21/src/main/java/com/github/reviversmc/microdurability/MicroDurability121.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package com.github.reviversmc.microdurability; | ||
|
||
import java.util.function.Supplier; | ||
|
||
import com.github.reviversmc.microdurability.mccompat.McVersionCompatInitializer; | ||
import com.github.reviversmc.microdurability.mccompat.McVersionHelper; | ||
|
||
public class MicroDurability121 extends McVersionCompatInitializer { | ||
static final Supplier<Boolean> IS_COMPATIBLE = () -> McVersionHelper.isWithin("1.21", McVersionHelper.INFINITY); | ||
|
||
@Override | ||
public boolean isCompatible() { | ||
return IS_COMPATIBLE.get(); | ||
} | ||
|
||
@Override | ||
protected void initialize() { | ||
MicroDurability.renderer = new Renderer121(); | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
...durability-1.21/src/main/java/com/github/reviversmc/microdurability/MixinProvider121.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package com.github.reviversmc.microdurability; | ||
|
||
import java.util.List; | ||
|
||
import com.github.reviversmc.microdurability.mccompat.McVersionMixinProvider; | ||
|
||
public class MixinProvider121 extends McVersionMixinProvider { | ||
@Override | ||
public List<String> getMixins() { | ||
if (MicroDurability121.IS_COMPATIBLE.get()) { | ||
return List.of("InGameHudMixin121"); | ||
} | ||
|
||
return null; | ||
} | ||
} |
Oops, something went wrong.