Skip to content

Commit

Permalink
Update to 1.0.6
Browse files Browse the repository at this point in the history
The water display for thirst has been completed, and the linkage can now be normal. Thank you for the help provided by @mlus-asuka

Fix the issue of error reporting in a dead state.

It can now be launched in version 1.20.

Co-Authored-By: mlus <[email protected]>
  • Loading branch information
Xing-C and mlus-asuka committed Sep 15, 2023
1 parent 6379253 commit 6506448
Show file tree
Hide file tree
Showing 8 changed files with 70 additions and 36 deletions.
15 changes: 13 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,12 @@ minecraft {
client {
// Comma-separated list of namespaces to load gametests from. Empty = all namespaces.
property 'forge.enabledGameTestNamespaces', mod_id
arg "-mixin.config=classicandsimplestatusbars.mixin.json"
}

server {
property 'forge.enabledGameTestNamespaces', mod_id
arg "-mixin.config=classicandsimplestatusbars.mixin.json"
args '--nogui'
}

Expand Down Expand Up @@ -154,8 +156,16 @@ dependencies {
compileOnly fg.deobf("squeek.appleskin:appleskin-forge:mc1.20.1-2.5.0:api")
runtimeOnly fg.deobf("squeek.appleskin:appleskin-forge:mc1.20.1-2.5.0")
implementation fg.deobf("curse.maven:jade-324717:4711195")
}

// Apply Mixin AP
annotationProcessor 'org.spongepowered:mixin:0.8.5:processor'

}
mixin {
add sourceSets.main, "classicandsimplestatusbars.refmap.json"
config 'classicandsimplestatusbars.mixin.json'
//mixin.env.remapRefMap=false
}
// This block of code expands all declared replace properties in the specified resource targets.
// A missing property will result in an error. Properties are expanded using ${} Groovy notation.
// When "copyIdeResources" is enabled, this will also run before the game launches in IDE environments.
Expand Down Expand Up @@ -185,7 +195,8 @@ tasks.named('jar', Jar).configure {
'Implementation-Title' : project.name,
'Implementation-Version' : project.jar.archiveVersion,
'Implementation-Vendor' : mod_authors,
'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" : "classicandsimplestatusbars.mixin.json"
])
}

Expand Down
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ minecraft_version_range=[1.20,1.21)
# The Neo version must agree with the Minecraft version to get a valid artifact
neo_version=47.1.76
# The Neo version range can use any version of Neo as bounds or match the loader version range
neo_version_range=[47.1,)
neo_version_range=[46.0,)
# The loader version range can only use the major version of Neo/FML as bounds
loader_version_range=[47,)
loader_version_range=[46,)
# The mapping channel to use for mappings.
# The default set of supported mapping channels are ["official", "snapshot", "snapshot_nodoc", "stable", "stable_nodoc"].
# Additional mapping channels can be registered through the "channelProviders" extension in a Gradle plugin.
Expand Down Expand Up @@ -48,7 +48,7 @@ mod_name=Classic and simple status bars
# The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default.
mod_license=GPL-3.0-only
# The mod version. See https://semver.org/
mod_version=1.0.5
mod_version=1.0.6
# The group ID for the mod. It is only important when publishing as an artifact to a Maven repository.
# This should match the base package used for the mod sources.
# See https://maven.apache.org/guides/mini/guide-naming-conventions.html
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package cn.mcxkly.classicandsimplestatusbars;

import cn.mcxkly.classicandsimplestatusbars.overlays.FoodLevel;
import cn.mcxkly.classicandsimplestatusbars.overlays.ThirstWasTaken;
import cn.mcxkly.classicandsimplestatusbars.overlays.ThirstWasTakenUse;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fml.ModList;
Expand All @@ -17,7 +16,8 @@ public ClassicAndSimpleStatusBars() {
MinecraftForge.EVENT_BUS.register(this);

if (ModList.get().isLoaded("thirst")) {
//MinecraftForge.EVENT_BUS.register(new ThirstWasTaken());
// new ThirstWasTakenMixin();
//MinecraftForge.EVENT_BUS.register(new ThirstHUDOverlayHandlerMixin());
ThirstWasTakenUse.StopConflictRenderingIDEA(false);
FoodLevel.StopConflictRenderingIDEA(false);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package cn.mcxkly.classicandsimplestatusbars.mixin;

import dev.ghen.thirst.foundation.gui.ThirstBarRenderer;
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(value = ThirstBarRenderer.class,remap = false)
abstract class ThirstBarRendererMixin {
@Inject(method = "registerThirstOverlay", at = @At("HEAD"), cancellable = true)
private static void registerThirstOverlay(CallbackInfo ci) {
ci.cancel();
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package cn.mcxkly.classicandsimplestatusbars.mixin;

import dev.ghen.thirst.foundation.gui.appleskin.HUDOverlayHandler;
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(value = HUDOverlayHandler.class,remap = false)
public class ThirstHUDOverlayHandlerMixin {


@Inject(method = "onRenderGuiOverlayPre", at = @At("HEAD"), cancellable = true)
private void onRenderExhaustion(CallbackInfo ci) {
ci.cancel();
}
@Inject(method = "renderThirstOverlay", at = @At("HEAD"), cancellable = true)
private static void onRenderGuiOverlay(CallbackInfo ci) {
ci.cancel();
}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@

import dev.ghen.thirst.Thirst;
import dev.ghen.thirst.foundation.common.capability.IThirst;
import dev.ghen.thirst.foundation.gui.appleskin.HUDOverlayHandler;
import dev.ghen.thirst.foundation.common.capability.ModCapabilities;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.Font;
import net.minecraft.client.gui.GuiGraphics;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.entity.player.Player;
import net.minecraftforge.client.event.RenderGuiOverlayEvent;
import net.minecraftforge.client.gui.overlay.ForgeGui;
import net.minecraftforge.client.gui.overlay.IGuiOverlay;

Expand Down Expand Up @@ -43,6 +41,7 @@ private void renderThirstLevelBar(Font font, GuiGraphics guiGraphics, float part
// 80, 5);

PLAYER_THIRST = player.getCapability(ModCapabilities.PLAYER_THIRST).orElse(null);
if (PLAYER_THIRST == null) return;
int Thirst = PLAYER_THIRST.getThirst();
int Quenched = PLAYER_THIRST.getQuenched();

Expand Down
13 changes: 13 additions & 0 deletions src/main/resources/classicandsimplestatusbars.mixin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"required": true,
"package": "cn.mcxkly.classicandsimplestatusbars.mixin",
"compatibilityLevel": "JAVA_17",
"refmap": "classicandsimplestatusbars.refmap.json",
"mixins": [
"ThirstHUDOverlayHandlerMixin",
"ThirstBarRendererMixin"
],
"client": [
],
"minVersion": "0.8"
}

0 comments on commit 6506448

Please sign in to comment.