Skip to content

Commit

Permalink
Small Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
FirstMegaGame4 committed Dec 7, 2024
1 parent e497210 commit b4c20a3
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 5 deletions.
5 changes: 5 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@ mmodding {
}
}

project.configurations.configureEach {
exclude(group: "net.fabricmc", module: "fabric-loader")
exclude(group: "net.fabricmc.fabric-api")
}

tasks.withType(JavaCompile).configureEach {
it.options.encoding = "UTF-8"
// Minecraft 1.18 (1.18-pre2) upwards uses Java 17.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,7 @@
@InjectedInterface(State.class)
public interface ReverseCycleState<S> {

<T extends Comparable<T>> S reverseCycle(Property<T> property);
default <T extends Comparable<T>> S reverseCycle(Property<T> property) {
throw new IllegalArgumentException();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,27 @@ default void play(Soundtrack soundtrack) {
this.play(soundtrack, 0);
}

void play(Soundtrack soundtrack, int part);
default void play(Soundtrack soundtrack, int part) {
throw new IllegalArgumentException();
}

void skip();
default void playOnce(Soundtrack soundtrack) {
this.play(soundtrack, 0);
}

void skip(int part);
default void playOnce(Soundtrack soundtrack, int part) {
throw new IllegalArgumentException();
}

void stop();
default void skip() {
throw new IllegalArgumentException();
}

default void skip(int part) {
throw new IllegalArgumentException();
}

default void stop() {
throw new IllegalArgumentException();
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.mmodding.mmodding_lib.mixin.injectors.client;

import com.mmodding.mmodding_lib.library.portals.squared.CustomSquaredPortal;
import com.mmodding.mmodding_lib.library.soundtracks.SoundtrackPlayer;
import com.mmodding.mmodding_lib.library.soundtracks.client.ClientSoundtrackPlayer;
import com.mmodding.mmodding_lib.library.utils.WorldUtils;
import com.mmodding.mmodding_lib.mixin.injectors.PlayerEntityMixin;
Expand Down Expand Up @@ -94,4 +95,9 @@ private void updateNausea(CallbackInfo ci) {
WorldUtils.doTaskAfter(clientWorld, 40, () -> this.customPortalCache = null);
}
}

@Override
public SoundtrackPlayer getSoundtrackPlayer() {
return (ClientSoundtrackPlayer) this.tickables.stream().filter(t -> t instanceof ClientSoundtrackPlayer).findFirst().orElseThrow();
}
}

0 comments on commit b4c20a3

Please sign in to comment.