Skip to content

Commit

Permalink
1.20.2
Browse files Browse the repository at this point in the history
  • Loading branch information
gliscowo committed Oct 3, 2023
1 parent 8286f5c commit d2b3b8d
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 28 deletions.
9 changes: 6 additions & 3 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.4-SNAPSHOT'
id 'maven-publish'
id 'io.github.juuxel.loom-quiltflower' version '1.7.1'
}
Expand All @@ -9,7 +9,7 @@ group = project.maven_group

repositories {
maven { url = "https://maven.terraformersmc.com/" }
maven { url = "https://ladysnake.jfrog.io/artifactory/mods" }
maven { url = "https://maven.ladysnake.org/releases" }
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
maven { url "https://maven.wispforest.io/" }
}
Expand All @@ -24,12 +24,15 @@ dependencies {
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"

modImplementation "dev.emi:trinkets:${project.trinkets_version}"
modImplementation "dev.onyxstudios.cardinal-components-api:cardinal-components-base:${project.cca_version}"
modImplementation "dev.onyxstudios.cardinal-components-api:cardinal-components-entity:${project.cca_version}"

modImplementation "com.terraformersmc:modmenu:${project.modmenu_version}"

modImplementation annotationProcessor ("io.wispforest:owo-lib:${project.owo_version}")
include "io.wispforest:owo-sentinel:${project.owo_version}"

modCompileOnly 'me.lucko:fabric-permissions-api:0.1-SNAPSHOT'
modCompileOnly 'me.lucko:fabric-permissions-api:0.2-SNAPSHOT'
}

processResources {
Expand Down
21 changes: 11 additions & 10 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,26 @@
org.gradle.jvmargs=-Xmx1G
# Fabric Properties
# check these on https://fabricmc.net/develop
minecraft_base_version=1.20
minecraft_version=1.20
yarn_mappings=1.20+build.1
loader_version=0.14.21
minecraft_base_version=1.20.2
minecraft_version=1.20.2
yarn_mappings=1.20.2+build.2
loader_version=0.14.22
# Mod Properties
mod_version=0.3.2
maven_group=com.glisco
archives_base_name=deathlog
# Dependencies
fabric_version=0.83.0+1.20
fabric_version=0.89.3+1.20.2

# https://github.com/emilyploszaj/trinkets/releases
# while we wait for an official release
# https://maven.wispforest.io/dev/emi/trinkets/
trinkets_version=3.7.0-pre.3
trinkets_version=3.8.0

# https://maven.ladysnake.org/#/releases/dev/onyxstudios/cardinal-components-api/cardinal-components-api/cardinal-components-base
cca_version=5.4.0

# https://maven.terraformersmc.com/releases/com/terraformersmc/modmenu
modmenu_version=7.0.0-beta.2
modmenu_version=8.0.0

# https://maven.wispforest.io/io/wispforest/owo-lib/
owo_version=0.11.0+1.20
owo_version=0.11.3+1.20.2

2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,8 @@ private void buildDeathList() {
container.x() - root.padding().get().left() + mouseX,
container.y() - root.padding().get().top() + mouseY,
dropdown -> {
dropdown.surface(Surface.flat(0xBB000000).and(Surface.outline(0xA75F5F5F)));
dropdown.surface(Surface.blur(3, 5).and(Surface.flat(0xC7000000)).and(Surface.outline(0xFF121212)));
dropdown.zIndex(100);

if (this.canRestore) {
dropdown.button(Text.translatable("text.deathlog.action.restore"), dropdown_ -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,52 +4,53 @@
import com.mojang.blaze3d.systems.RenderSystem;
import net.fabricmc.loader.api.FabricLoader;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.network.ClientCommonNetworkHandler;
import net.minecraft.client.network.ClientConnectionState;
import net.minecraft.client.network.ClientPlayNetworkHandler;
import net.minecraft.client.util.ScreenshotRecorder;
import net.minecraft.network.ClientConnection;
import net.minecraft.network.packet.s2c.play.DeathMessageS2CPacket;
import net.minecraft.network.packet.s2c.play.HealthUpdateS2CPacket;
import net.minecraft.text.MutableText;
import net.minecraft.text.Text;
import net.minecraft.util.Formatting;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

@Mixin(ClientPlayNetworkHandler.class)
public class ClientPlayNetworkHandlerMixin {
public abstract class ClientPlayNetworkHandlerMixin extends ClientCommonNetworkHandler {

@Shadow
@Final
private MinecraftClient client;
protected ClientPlayNetworkHandlerMixin(MinecraftClient client, ClientConnection connection, ClientConnectionState connectionState) {
super(client, connection, connectionState);
}

@SuppressWarnings("ConstantConditions")
@Inject(method = "onDeathMessage", at = @At("HEAD"))
private void onClientDeath(DeathMessageS2CPacket packet, CallbackInfo ci) {
if (!RenderSystem.isOnRenderThread()) return;
DeathLogClient.getClientStorage().store(packet.getMessage(), client.player);
DeathLogClient.getClientStorage().store(packet.getMessage(), this.client.player);

if (DeathLogClient.CONFIG.screenshotsEnabled()) {
ScreenshotRecorder.saveScreenshot(FabricLoader.getInstance().getGameDir().toFile(), client.getFramebuffer(), text -> {
ScreenshotRecorder.saveScreenshot(FabricLoader.getInstance().getGameDir().toFile(), this.client.getFramebuffer(), text -> {
text = Text.literal("§7[§bDeathLog§7] ").append(((MutableText) text).formatted(Formatting.GRAY));
client.player.sendMessage(text, false);
this.client.player.sendMessage(text, false);
});
}
}

@Inject(method = "onHealthUpdate", at = @At("HEAD"))
private void onLegacyClientDeath(HealthUpdateS2CPacket packet, CallbackInfo ci) {
if (!DeathLogClient.CONFIG.useLegacyDeathDetection() || !RenderSystem.isOnRenderThread()) return;
if (packet.getHealth() > 0 || client.player.isDead()) return;
if (packet.getHealth() > 0 || this.client.player.isDead()) return;

DeathLogClient.getClientStorage().store(Text.empty(), client.player);
DeathLogClient.getClientStorage().store(Text.empty(), this.client.player);

if (DeathLogClient.CONFIG.screenshotsEnabled()) {
ScreenshotRecorder.saveScreenshot(FabricLoader.getInstance().getGameDir().toFile(), client.getFramebuffer(), text -> {
ScreenshotRecorder.saveScreenshot(FabricLoader.getInstance().getGameDir().toFile(), this.client.getFramebuffer(), text -> {
text = Text.literal("§7[§bDeathLog§7] ").append(((MutableText) text).formatted(Formatting.GRAY));
client.player.sendMessage(text, false);
this.client.player.sendMessage(text, false);
});
}
}
Expand Down

0 comments on commit d2b3b8d

Please sign in to comment.