Skip to content

Commit 412f52e

Browse files
committed
Done. Just adding YACL
1 parent e9630ed commit 412f52e

File tree

8 files changed

+23
-6
lines changed

8 files changed

+23
-6
lines changed

build.gradle

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ repositories {
1818
// for more information about repositories.
1919
maven { url = "https://maven.enjarai.nl/mirrors" }
2020
maven { url = "https://maven.enjarai.nl/releases" }
21+
maven {
22+
name 'Xander Maven'
23+
url 'https://maven.isxander.dev/releases'
24+
}
2125
}
2226

2327
loom {
@@ -48,6 +52,8 @@ dependencies {
4852
include modImplementation("nl.enjarai:cicada-lib:${project.cicada_version}") {
4953
exclude group: "net.fabricmc.fabric-api"
5054
}
55+
56+
modImplementation 'dev.isxander.yacl:yet-another-config-lib-fabric:3.1.0'
5157
}
5258

5359
processResources {

src/client/java/com/carsoncoder/gpws/gpwsConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ public class gpwsConfig {
44
int PullUpRange = 50;
55
int BankAngleAngle = -50;
66
int Volume = 100;
7-
int SoundDelay = 60;
7+
int SoundDelay = 30;
88
}

src/client/java/com/carsoncoder/gpws/gpwsHud.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,12 @@ public void onHudRender(DrawContext drawContext, float tickDelta) {
127127
if (state == "Bank Angle" && lastPlayedSoundTime > repeatTime) {
128128
PlaySound(gpwsSounds.SOUNDS.BANK_ANGLE);
129129
lastPlayedSoundTime = 0;
130-
} else if (state == "Pull Up" && lastPlayedSoundTime > repeatTime) {
130+
} else if (state == "Pull Up" && lastPlayedSoundTime > repeatTime + 20) {
131131
PlaySound(gpwsSounds.SOUNDS.PULL_UP);
132132
lastPlayedSoundTime = 0;
133+
} else if (gpwsElytraClient.SOUNDS_MANAGER.YSounds.get(state) != null && lastPlayedSoundTime > 10) {
134+
PlaySound(gpwsElytraClient.SOUNDS_MANAGER.YSounds.get(state));
135+
lastPlayedSoundTime = 0;
133136
}
134137
// LOGGER.info(String.valueOf(lastPlayedSoundTime));
135138

src/client/java/com/carsoncoder/gpws/gpwsRaycast.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public static HitResult raycastInDirection(MinecraftClient client, float tickDel
4141
return null;
4242
}
4343

44-
double reachDistance = gpwsElytraClient.config.PullUpRange;//Change this to extend the reach
44+
double reachDistance = gpwsElytraClient.config.PullUpRange; //Change this to extend the reach
4545
HitResult target = raycast(entity, reachDistance, tickDelta, false, direction);
4646
boolean tooFar = false;
4747
double extendedReach = reachDistance;

src/client/java/com/carsoncoder/gpws/gpwsSounds.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ public static enum SOUNDS {
2222
private static final Identifier PULL_UP_ID = new Identifier("gpws-elytra:pull-up");
2323
private static SoundEvent PULL_UP = SoundEvent.of(PULL_UP_ID);
2424

25-
private SOUNDS[] Sounds = {SOUNDS.Y2500, SOUNDS.Y500, SOUNDS.Y400, SOUNDS.Y300, SOUNDS.Y200, SOUNDS.Y100, SOUNDS.Y70, SOUNDS.Y60, SOUNDS.Y50, SOUNDS.Y40, SOUNDS.Y30, SOUNDS.Y20};
25+
private SOUNDS[] Sounds = {SOUNDS.Y2500, SOUNDS.Y500, SOUNDS.Y400, SOUNDS.Y300, SOUNDS.Y200, SOUNDS.Y100, SOUNDS.Y70, SOUNDS.Y60, SOUNDS.Y50, SOUNDS.Y40, SOUNDS.Y30, SOUNDS.Y20};
26+
public HashMap<String, SOUNDS> YSounds = new HashMap<String, SOUNDS>();
2627

2728
private HashMap<SOUNDS, SoundEvent> SoundsDict = new HashMap<SOUNDS, SoundEvent>();
2829

@@ -44,6 +45,8 @@ void init() {
4445
SoundEvent event = SoundEvent.of(id);
4546
SoundsDict.put(currentSound, event);
4647
Registry.register(Registries.SOUND_EVENT, id, event);
48+
49+
YSounds.put(currentSound.name().substring(1), currentSound);
4750
}
4851
}
4952

src/client/resources/assets/gpws-elytra/sounds.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,5 +68,10 @@
6868
"sounds": [
6969
"gpws-elytra:20"
7070
]
71+
},
72+
"pull-up": {
73+
"sounds": [
74+
"gpws-elytra:pull-up"
75+
]
7176
}
7277
}

src/main/resources/fabric.mod.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
"id": "gpws-elytra",
44
"version": "${version}",
55
"name": "GPWS-elytra",
6-
"description": "This is an example description! Tell everyone what your mod is about!",
6+
"description": "Adds GPWS Callouts to Minecraft",
77
"authors": [
8-
"Me!"
8+
"Carson Coder"
99
],
1010
"contact": {
1111
"homepage": "https://fabricmc.net/",

0 commit comments

Comments
 (0)