Skip to content

Commit

Permalink
Merge pull request #15 from RappyLabyAddons/feat/update
Browse files Browse the repository at this point in the history
Add `1.20.3` support
RappyTV authored Dec 6, 2023
2 parents 6dd305b + 26efba9 commit 20d3f2d
Showing 3 changed files with 43 additions and 4 deletions.
7 changes: 4 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -20,8 +20,8 @@ labyMod {
displayName = "Death Finder"
author = "RappyTV"
description = "This addon saves your last death point, so you can find your items again."
minecraftVersion = "1.8<1.20.2"
version = System.getenv().getOrDefault("VERSION", "1.0.4")
minecraftVersion = "1.8<1.20.3"
version = System.getenv().getOrDefault("VERSION", "1.0.5")
}

minecraft {
@@ -35,7 +35,8 @@ labyMod {
"1.19.3",
"1.19.4",
"1.20.1",
"1.20.2"
"1.20.2",
"1.20.3"
) { version, provider ->
configureRun(provider, version)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package com.rappytv.deathfinder.v1_20_3.mixins;

import com.rappytv.deathfinder.DeathFinderAddon;
import com.rappytv.deathfinder.events.DeathEvent;
import com.rappytv.deathfinder.util.Location;
import net.labymod.api.Laby;
import net.minecraft.client.gui.screens.DeathScreen;
import net.minecraft.client.gui.screens.Screen;
import net.minecraft.client.player.LocalPlayer;
import net.minecraft.network.chat.Component;
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(DeathScreen.class)
public class DeathScreenMixin extends Screen {

protected DeathScreenMixin(Component title) {
super(title);
}

@Inject(method = "init", at = @At("TAIL"))
public void onDeathScreen(CallbackInfo ci) {
if(this.minecraft == null || this.minecraft.player == null) return;

LocalPlayer player = this.minecraft.player;
Location deathLocation = new Location(player.getX(), player.getY(), player.getZ());

if(DeathFinderAddon.get().configuration().saveRotation().get()) {
deathLocation.setYaw(player.getYRot());
deathLocation.setPitch(player.getXRot());
}
if(deathLocation.equals(DeathFinderAddon.getDeathLocation())) return;

Laby.fireEvent(new DeathEvent(deathLocation));
}
}
2 changes: 1 addition & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
rootProject.name = "deathfinder"

pluginManagement {
val labyGradlePluginVersion = "0.3.30"
val labyGradlePluginVersion = "0.3.38"
plugins {
id("net.labymod.gradle") version (labyGradlePluginVersion)
}

0 comments on commit 20d3f2d

Please sign in to comment.