-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
30 changed files
with
187 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/main/java/com/cstav/genshinstrument/criteria/InstrumentPlayedTrigger.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/main/java/com/cstav/genshinstrument/event/InstrumentPlayedEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
...va/com/cstav/genshinstrument/networking/buttonidentifier/DefaultNoteButtonIdentifier.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package com.cstav.genshinstrument.networking.buttonidentifier; | ||
|
||
import com.cstav.genshinstrument.client.gui.screens.instrument.partial.note.NoteButton; | ||
import com.cstav.genshinstrument.sound.NoteSound; | ||
|
||
import net.minecraft.network.FriendlyByteBuf; | ||
import net.minecraftforge.api.distmarker.Dist; | ||
import net.minecraftforge.api.distmarker.OnlyIn; | ||
|
||
/** | ||
* The default note button identifier. Uses a button's {@link NoteSound} as an identifier. | ||
*/ | ||
public class DefaultNoteButtonIdentifier extends NoteButtonIdentifier { | ||
|
||
private NoteSound sound; | ||
|
||
public DefaultNoteButtonIdentifier(final NoteSound sound) { | ||
this.sound = sound; | ||
} | ||
@OnlyIn(Dist.CLIENT) | ||
public DefaultNoteButtonIdentifier(final NoteButton note) { | ||
this(note.getSound()); | ||
} | ||
|
||
public void setSound(NoteSound sound) { | ||
this.sound = sound; | ||
} | ||
|
||
|
||
public DefaultNoteButtonIdentifier(final FriendlyByteBuf buf) { | ||
sound = NoteSound.readFromNetwork(buf); | ||
} | ||
|
||
@Override | ||
public void writeToNetwork(FriendlyByteBuf buf) { | ||
super.writeToNetwork(buf); | ||
sound.writeToNetwork(buf); | ||
} | ||
|
||
|
||
public boolean matches(NoteButtonIdentifier other) { | ||
return MatchType.forceMatch(other, this::matchSound); | ||
} | ||
private boolean matchSound(final DefaultNoteButtonIdentifier other) { | ||
return other.sound.equals(sound); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.