Skip to content

Commit 0729f97

Browse files
authored
Merge pull request #32 from RappyLabyAddons/development
Release `v1.1.1`
2 parents 40b4a8d + 66ca382 commit 0729f97

File tree

65 files changed

+1315
-577
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+1315
-577
lines changed

.github/workflows/accent.yml

Lines changed: 0 additions & 33 deletions
This file was deleted.

.github/workflows/build.yml

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,41 @@ name: LabyAddon Build
22

33
on:
44
push:
5-
branches: [ "master", "main" ]
5+
branches: [ "master" ]
66
pull_request:
7-
branches: [ "master", "main" ]
7+
branches: [ "master" ]
88
workflow_dispatch:
99

1010
jobs:
1111
build:
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/checkout@v3
14+
- uses: actions/checkout@v4
1515
- name: Set up JDK 21
16-
uses: actions/setup-java@v3
16+
uses: actions/setup-java@v4
1717
with:
1818
distribution: 'corretto'
1919
java-version: '21'
20+
- name: Cache Gradle dependencies
21+
uses: actions/cache@v4
22+
with:
23+
path: ~/.gradle/caches
24+
key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
25+
restore-keys: |
26+
gradle-${{ runner.os }}-
27+
- name: Cache Gradle wrapper
28+
uses: actions/cache@v4
29+
with:
30+
path: ~/.gradle/wrapper
31+
key: gradle-wrapper-${{ runner.os }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}
32+
restore-keys: |
33+
gradle-wrapper-${{ runner.os }}-
2034
- name: Grant execute permission for gradlew
2135
run: chmod +x gradlew
2236
- name: Build with Gradle
2337
run: ./gradlew build --full-stacktrace
2438
- name: Upload Artifact
25-
uses: actions/upload-artifact@v3
39+
uses: actions/upload-artifact@v4
2640
with:
2741
name: Artifacts
2842
path: build/libs/*-release.jar

accent.json

Lines changed: 0 additions & 11 deletions
This file was deleted.
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
package com.rappytv.deathfinder.api.event;
2+
3+
import com.rappytv.deathfinder.api.util.DeathLocation;
4+
import net.labymod.addons.waypoints.Waypoints;
5+
import net.labymod.api.Laby;
6+
import net.labymod.api.client.entity.player.ClientPlayer;
7+
import net.labymod.api.event.Event;
8+
import org.jetbrains.annotations.NotNull;
9+
import java.util.Objects;
10+
11+
public class DeathEvent implements Event {
12+
13+
private final DeathLocation location;
14+
private final boolean hardcore;
15+
16+
public DeathEvent(boolean hardcore) {
17+
this.hardcore = hardcore;
18+
ClientPlayer player = Laby.labyAPI().minecraft().getClientPlayer();
19+
if(player == null) throw new NullPointerException("Player cannot be null");
20+
21+
this.location = new DeathLocation(
22+
player.position(),
23+
player.getRotationYaw(),
24+
player.getRotationPitch(),
25+
Objects.requireNonNullElse(
26+
Waypoints.references().waypointService().getDimension(),
27+
"labymod:unknown"
28+
)
29+
);
30+
}
31+
32+
@NotNull
33+
public DeathLocation location() {
34+
return this.location;
35+
}
36+
37+
public boolean isHardcore() {
38+
return this.hardcore;
39+
}
40+
}
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
package com.rappytv.deathfinder.api.util;
2+
3+
import net.labymod.api.util.math.position.Position;
4+
import net.labymod.api.util.math.vector.DoubleVector3;
5+
import org.jetbrains.annotations.NotNull;
6+
import java.util.Objects;
7+
8+
@SuppressWarnings("unused")
9+
public class DeathLocation {
10+
11+
private final double x;
12+
private final double y;
13+
private final double z;
14+
private final float yaw;
15+
private final float pitch;
16+
private final String dimension;
17+
private final long diedAt;
18+
19+
public DeathLocation(double x, double y, double z, @NotNull String dimension) {
20+
this(x, y, z, 0f, 0f, dimension);
21+
}
22+
23+
public DeathLocation(@NotNull Position position, float yaw, float pitch, @NotNull String dimension) {
24+
this(position.getX(), position.getY(), position.getZ(), yaw, pitch, dimension);
25+
}
26+
27+
public DeathLocation(double x, double y, double z, float yaw, float pitch, @NotNull String dimension) {
28+
Objects.requireNonNull(dimension, "Dimension cannot be null");
29+
this.x = x;
30+
this.y = y;
31+
this.z = z;
32+
this.yaw = yaw;
33+
this.pitch = pitch;
34+
this.dimension = dimension;
35+
this.diedAt = System.currentTimeMillis();
36+
}
37+
38+
public double getX() {
39+
return this.x;
40+
}
41+
42+
public double getY() {
43+
return this.y;
44+
}
45+
46+
public double getZ() {
47+
return this.z;
48+
}
49+
50+
public double getYaw() {
51+
return this.yaw;
52+
}
53+
54+
public double getPitch() {
55+
return this.pitch;
56+
}
57+
58+
@NotNull
59+
public String getDimension() {
60+
return this.dimension;
61+
}
62+
63+
public long getTimestamp() {
64+
return this.diedAt;
65+
}
66+
67+
public DoubleVector3 toDoubleVector3() {
68+
return new DoubleVector3(this.x, this.y, this.z);
69+
}
70+
71+
public boolean equals(DeathLocation location) {
72+
if(location == null) return false;
73+
return this.x == location.x
74+
&& this.y == location.y
75+
&& this.z == location.z
76+
&& this.pitch == location.pitch
77+
&& this.yaw == location.yaw
78+
&& this.dimension.equals(location.dimension);
79+
}
80+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package com.rappytv.deathfinder.api.util;
2+
3+
import net.labymod.api.reference.annotation.Referenceable;
4+
5+
@Referenceable
6+
public abstract class DeathManager {
7+
8+
private DeathLocation location;
9+
10+
public abstract void respawn();
11+
12+
public DeathLocation getLocation() {
13+
return this.location;
14+
}
15+
16+
public void setLocation(DeathLocation location) {
17+
this.location = location;
18+
}
19+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package com.rappytv.deathfinder.api.util;
2+
3+
/**
4+
* From <a href="https://github.com/labymod-addons/waypoints/blob/master/api/src/main/java/net/labymod/addons/waypoints/waypoint/WaypointType.java">WaypointType.java</a> because it's accessed without being able to check if Waypoint addon is installed
5+
*/
6+
public enum WaypointType {
7+
8+
/**
9+
* A permanent waypoint.
10+
*/
11+
PERMANENT,
12+
13+
/**
14+
* A waypoint that will be deleted after the player leaves the server.
15+
*/
16+
SERVER_SESSION,
17+
18+
/**
19+
* A waypoint that will not be saved to the configuration and thus only be available during the
20+
* current game session.
21+
*/
22+
ADDON_MANAGED
23+
}

build.gradle.kts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,20 @@ plugins {
66
val versions = providers.gradleProperty("net.labymod.minecraft-versions").get().split(";")
77

88
group = "org.example"
9-
version = providers.environmentVariable("VERSION").getOrElse("1.1.0")
9+
version = providers.environmentVariable("VERSION").getOrElse("1.1.1")
1010

1111
labyMod {
12-
defaultPackageName = "com.rappytv.deathfinder" //change this to your main package name (used by all modules)
12+
defaultPackageName = "com.rappytv.deathfinder"
1313
addonInfo {
1414
namespace = "deathfinder"
1515
displayName = "Death Finder"
1616
author = "RappyTV"
1717
description = "This addon saves your last death point, so you can find your items again."
18-
minecraftVersion = "1.8<1.21.1"
18+
minecraftVersion = "1.8<1.21.8"
1919
version = rootProject.version.toString()
2020

2121
addon("labyswaypoints", true)
22+
addon("smartchat", true)
2223
}
2324

2425
minecraft {

core/src/main/java/com/rappytv/deathfinder/DeathFinderAddon.java

Lines changed: 0 additions & 40 deletions
This file was deleted.

core/src/main/java/com/rappytv/deathfinder/DeathFinderConfig.java

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)