Compare commits
No commits in common. "1.14.514-1.21.4pre1" and "main" have entirely different histories.
1.14.514-1
...
main
@ -1,2 +1 @@
|
||||
Download the mod at [Modrinth](https://modrinth.com/mod/disc-jockey) or [CurseForge](https://www.curseforge.com/minecraft/mc-mods/disc-jockey)
|
||||
*该版本为非官方版本,由BRanulf二改而成,由于官方一直不更新1.21.4,所以才出现了这个版本*
|
@ -6,11 +6,12 @@ minecraft_version=1.21.4
|
||||
yarn_mappings=1.21.4+build.8
|
||||
loader_version=0.16.10
|
||||
# Mod Properties
|
||||
mod_version=1.14.514
|
||||
mod_version=1.14.514.013
|
||||
maven_group=semmiedev
|
||||
archives_base_name=disc_jockey
|
||||
# Dependencies
|
||||
# check this on https://modmuss50.me/fabric.html
|
||||
|
||||
fabric_version=0.119.2+1.21.4
|
||||
systemProp.http.sslVerify=false
|
||||
systemProp.https.sslVerify=false
|
||||
|
@ -5,12 +5,15 @@ import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.gui.DrawContext;
|
||||
import net.minecraft.client.gui.screen.narration.NarrationMessageBuilder;
|
||||
import net.minecraft.client.gui.widget.EntryListWidget;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.Identifier;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import semmiedev.disc_jockey.Main;
|
||||
import semmiedev.disc_jockey.Song;
|
||||
|
||||
public class SongListWidget extends EntryListWidget<SongListWidget.SongEntry> {
|
||||
private static final String FAVORITE_EMOJI = "收藏★";
|
||||
private static final String NOT_FAVORITE_EMOJI = "收藏☆";
|
||||
|
||||
public SongListWidget(MinecraftClient client, int width, int height, int top, int itemHeight) {
|
||||
super(client, width, height, top, itemHeight);
|
||||
@ -69,8 +72,13 @@ public class SongListWidget extends EntryListWidget<SongListWidget.SongEntry> {
|
||||
|
||||
context.drawCenteredTextWithShadow(client.textRenderer, song.displayName, x + entryWidth / 2, y + 5, selected ? 0xFFFFFF : 0x808080);
|
||||
|
||||
RenderSystem.setShaderTexture(0, ICONS);
|
||||
// context.drawTexture(ICONS, x + 2, y + 2, (favorite ? 26 : 0) + (isOverFavoriteButton(mouseX, mouseY) ? 13 : 0), 0, 13, 12, 52, 12);
|
||||
String emoji = String.valueOf(favorite ? FAVORITE_EMOJI : NOT_FAVORITE_EMOJI);
|
||||
context.drawTextWithShadow(
|
||||
client.textRenderer,
|
||||
emoji,
|
||||
x + 2, y + 2,
|
||||
favorite ? 0xFFD700 : 0x808080
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -89,7 +97,12 @@ public class SongListWidget extends EntryListWidget<SongListWidget.SongEntry> {
|
||||
}
|
||||
|
||||
private boolean isOverFavoriteButton(double mouseX, double mouseY) {
|
||||
return mouseX > x + 2 && mouseX < x + 15 && mouseY > y + 2 && mouseY < y + 14;
|
||||
int textWidth = client.textRenderer.getWidth(favorite ? FAVORITE_EMOJI : NOT_FAVORITE_EMOJI);
|
||||
int textHeight = 8;
|
||||
return mouseX > x + 2 &&
|
||||
mouseX < x + 2 + textWidth &&
|
||||
mouseY > y + 2 &&
|
||||
mouseY < y + 2 + textHeight;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -34,13 +34,12 @@ public class ClientWorldMixin {
|
||||
) {
|
||||
if (
|
||||
((Main.config.omnidirectionalNoteBlockSounds && Main.SONG_PLAYER.running) || Main.PREVIEWER.running) &&
|
||||
// 关键修改点:event.id() 替代 event.getId()
|
||||
event.id().getPath().startsWith("block.note_block")
|
||||
) {
|
||||
ci.cancel();
|
||||
client.getSoundManager().play(
|
||||
new PositionedSoundInstance(
|
||||
event.id(), // ✅ 同样需要修改此处
|
||||
event.id(),
|
||||
category,
|
||||
volume,
|
||||
pitch,
|
||||
|
@ -3,14 +3,14 @@
|
||||
"id": "disc_jockey",
|
||||
"version": "${version}",
|
||||
"name": "Disc Jockey",
|
||||
"description": "Play note block songs in Minecraft",
|
||||
"description": "在游戏中播放音符盒(打碟机)",
|
||||
"authors": [
|
||||
"SemmieDev",
|
||||
"EnderKill98",
|
||||
"BRanulf(非正式)"
|
||||
"BRanulf(仅限该版本,请支持上面两个原作者)"
|
||||
],
|
||||
"contact": {
|
||||
"repo": "https://github.com/SemmieDev/Disc-Jockey"
|
||||
"repo": "http://git.branulf.top/BRanulf/DJ_BR"
|
||||
},
|
||||
"license": "MIT",
|
||||
"icon": "assets/disc_jockey/icon.png",
|
||||
|
Loading…
x
Reference in New Issue
Block a user