Compare commits

...

5 Commits

Author SHA1 Message Date
81908d4548 a 2025-08-27 17:07:16 +08:00
2b390f8908 8 2025-07-21 16:36:48 +08:00
645bec3987 8 2025-07-21 14:57:02 +08:00
BRanulf
3eabe96e6f weeeeee 2025-07-17 09:40:22 +08:00
BRanulf
7bed25b441 eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee 2025-07-16 12:59:07 +08:00
20 changed files with 125 additions and 115 deletions

View File

@ -1,14 +1,75 @@
# 源README
Download the mod at [Modrinth](https://modrinth.com/mod/disc-jockey) or [CurseForge](https://www.curseforge.com/minecraft/mc-mods/disc-jockey)
# 该版本附加
## 关于此项目
此 Mod 是基于 [Disc-Jockey](https://github.com/SemmieDev/Disc-Jockey)(由 [SemmieDev](https://github.com/SemmieDev/) 开发)的修改版本,适配了 Minecraft 1.21.4。
原始代码版权归原作者所有,修改部分版权归 BRanulf 所有。
___
# Disc Jockey Revive
同时,该二改版本我本人并没有上传至任何其他网站(包括 Modrinth 、CurseForge 、Github 等),请勿用于商业用途及其他非法用途
一个 Minecraft Fabric 模组,旨在为音符盒音乐爱好者提供强大的播放和即兴演奏功能
目前[Modrinth](https://modrinth.com/mod/disc_jockey_revive)上的这个版本非本人上传就当允许上传了罢毕竟我比较懒XD
<!-- ## 模组特性
[最新版本下载Release](https://git.branulf.top/Branulf/DIsc_Jockey_revive/releases)
### 🎵 歌曲播放
- **播放 `.nbs` 歌曲文件**:支持标准的 Note Block Studio (`.nbs`) 歌曲文件(暂不支持带变速的)。
- **文件夹管理**:支持歌曲文件夹,方便组织和浏览您的音乐库。
- **多种播放模式**
- **单曲循环**:重复播放当前歌曲。
- **列表循环**:按顺序循环播放当前文件夹或列表中的歌曲。
- **随机播放**:随机播放当前文件夹或列表中的歌曲。
- **播完停止**:歌曲播放完毕后自动停止。
- **播放进度条**:在 HUD 上显示歌曲播放进度和时间。
- **实时调速**在播放界面通过滑块实时调整歌曲播放速度0.25x - 4.0x)。
- **播放失败处理**:当附近音符盒配置不正确时,可选择停止播放或自动播放下一首。
- **音符盒材料清单**:显示播放当前歌曲所需的所有音符盒材料及数量。
- **自动调音**:模组会自动识别并调音附近的音符盒以匹配歌曲音高。
- **全向音符盒音效 (客户端)**
- **常规模式**:在播放歌曲或预览时,使音符盒音效全向传播,提供更沉浸的听觉体验。
- **强制模式**:强制所有音符盒音效(包括手动触发的)始终全向传播。
~~这边建议去给原作者点个Star~~
### 🎹 即兴演奏 (Live DJ)
- **独立界面**:通过专用快捷键打开一个独立界面,用于即兴演奏。
- **键盘弹奏**:利用键盘按键直接弹奏音符盒,就像在 FL Studio 中一样。
- **自定义键位映射**
- 独立的键位映射配置界面,允许您为每个键盘按键设置特定的音符(乐器和音高)。
- 默认提供类似于 FL Studio 的键盘布局预设。
- **即兴演奏调音**:在即兴演奏界面中,可以一键对周围的音符盒进行调音,以确保弹奏的音符准确无误。
- **独立于歌曲播放**:即兴演奏功能与歌曲播放功能完全独立,互不干扰。
### ⚙️ 配置与调试
- **Mod Menu 集成**:通过 Mod Menu 轻松访问模组配置。
- **快捷键**
- 打开歌曲选择界面 (默认 `J`)。
- 打开即兴演奏界面 (默认 `UNKNOW未指定`)。
- **调试模式**:可配置的调试模式,开启后会在日志中输出详细的调试信息,方便排查问题。
## 如何使用
1. **安装**:将 `Disc Jockey Revive` 模组文件和 Fabric API 放入您的 Minecraft `mods` 文件夹。
2. **添加歌曲**
* 在游戏中打开歌曲选择界面 (默认 `J` 键)。
* 点击“打开文件夹”按钮,将 `.nbs` 歌曲文件放入弹出的 `disc_jockey/songs` 文件夹中。
* 您也可以直接将 `.nbs` 文件拖放到歌曲选择界面中。
* 点击“重新加载”按钮以加载新添加的歌曲。
3. **播放歌曲**
* 在歌曲选择界面中选择一首歌曲。
* 点击“播放”按钮。模组将自动寻找并调音附近的音符盒。
* 确保您处于生存模式或创造模式,并且附近有足够的音符盒。
* 您可以通过滑块调整播放速度,并通过播放模式按钮切换循环方式。
4. **即兴演奏**
* 在游戏中打开即兴演奏界面 (默认 `UNKNOW` 键)。
* 点击“开始调音”按钮,模组将自动调音附近的音符盒。
* 调音完成后,您可以使用键盘按键直接弹奏音符盒。
* 点击“编辑键位映射”按钮可以自定义每个按键对应的音符。 -->
## 注意事项
* **服务器兼容性**:此模组通过发送玩家交互数据包来控制音符盒。在某些服务器上,这可能被反作弊插件误判为作弊行为。**强烈建议在使用前联系服务器管理员。**
* **音符盒数量**:为了获得最佳播放效果,请确保您周围有足够数量且种类齐全的音符盒。
* **非官方版本**:此版本为非官方修订版,仅供学习和参考。请支持原版模组作者。
## 贡献与支持
如果您有任何问题、建议或发现 Bug请联系[BRanulf](https://space.bilibili.com/479966868)(仅限于改二改版本,原版本请前往[原作者GitHub](https://github.com/SemmieDev/Disc-Jockey))。
不回复是正常现象因为我也只是随便做做并没有打算正经地维护真要搞的化我估计会去GitHub创建分支而不是只在自己仓库中修改。
---

View File

@ -17,7 +17,9 @@ preprocess {
def mc12105 = createNode("1.21.5", 1_21_05, "")
def mc12106 = createNode("1.21.6", 1_21_06, "")
def mc12107 = createNode("1.21.7", 1_21_07, "")
def mc12108 = createNode("1.21.8", 1_21_08, "")
mc12108.link(mc12107, file("versions/mapping_12108_12107.txt"))
mc12107.link(mc12106, file("versions/mapping_12107_12106.txt"))
mc12106.link(mc12105, file("versions/mapping_12106_12105.txt"))
mc12105.link(mc12104, file("versions/mapping_12105_12104.txt"))

View File

@ -10,7 +10,7 @@ repositories {
url 'https://maven.fabricmc.net/' // loom
}
maven {
url 'https://masa.dy.fi/maven' // mama便
url 'https://masa.dy.fi/maven' // masa便
}
maven {
url 'https://maven.fallenbreath.me/releases' // preprocessor

View File

@ -1,5 +1,5 @@
# Done to increase the memory available to gradle.
org.gradle.jvmargs=-Xmx1G
org.gradle.jvmargs=-Xmx2G
# Fabric Properties
# check these on https://modmuss50.me/fabric.html
minecraft_version=1.21.4
@ -8,7 +8,7 @@ loader_version=0.16.10
mod_name=Disc Jockey Revive
mod_id=disc_jockey_revive
# Mod Properties
mod_version=1.14.514.046
mod_version=1.14.514.050
maven_group=semmiedev
archives_base_name=disc_jockey_revive
# Dependencies

View File

@ -1,78 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<!-- This module was also published with a richer model, Gradle metadata, -->
<!-- which should be used instead. Do not delete the following line which -->
<!-- is to indicate to Gradle or any Gradle module metadata file consumer -->
<!-- that they should prefer consuming it instead. -->
<!-- do_not_remove: published-with-gradle-metadata -->
<modelVersion>4.0.0</modelVersion>
<groupId>io.github.cottonmc</groupId>
<artifactId>LibGui</artifactId>
<version>12.0.1+1.21.2</version>
<name>LibGui</name>
<description>Minecraft GUI Library</description>
<url>https://github.com/CottonMC/LibGui</url>
<licenses>
<license>
<name>MIT</name>
<url>https://github.com/CottonMC/LibGui/blob/HEAD/LICENSE</url>
</license>
</licenses>
<developers>
<developer>
<name>CottonMC</name>
<url>https://github.com/CottonMC</url>
</developer>
</developers>
<dependencies>
<dependency>
<groupId>io.github.juuxel</groupId>
<artifactId>libninepatch</artifactId>
<version>1.2.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>net.fabricmc.fabric-api</groupId>
<artifactId>fabric-api-base</artifactId>
<version>0.4.48+c47b9d4373</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>net.fabricmc.fabric-api</groupId>
<artifactId>fabric-networking-api-v1</artifactId>
<version>4.3.3+56ec7ac673</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>net.fabricmc</groupId>
<artifactId>fabric-loader</artifactId>
<version>0.16.7</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>net.fabricmc.fabric-api</groupId>
<artifactId>fabric-lifecycle-events-v1</artifactId>
<version>2.3.22+c47b9d4373</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>net.fabricmc.fabric-api</groupId>
<artifactId>fabric-rendering-v1</artifactId>
<version>8.0.5+c47b9d4373</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>net.fabricmc.fabric-api</groupId>
<artifactId>fabric-resource-loader-v0</artifactId>
<version>3.0.5+c47b9d4373</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>io.github.cottonmc</groupId>
<artifactId>Jankson-Fabric</artifactId>
<version>9.0.0+j1.2.3</version>
<scope>runtime</scope>
</dependency>
</dependencies>
</project>

View File

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>com.terraformersmc</groupId>
<artifactId>modmenu</artifactId>
<version>13.0.3</version>
</project>

View File

@ -3,6 +3,7 @@
"1.21.4",
"1.21.5",
"1.21.6",
"1.21.7"
"1.21.7",
"1.21.8"
]
}

View File

@ -36,7 +36,7 @@ public class DebugLogger {
if (client != null && client.inGameHud != null && client.inGameHud.getChatHud() != null) {
MinecraftClient.getInstance().inGameHud.getChatHud().addMessage(Text.of("[DiscJockeyRevive-调试]"+message.formatted(Formatting.GRAY)));
} else {
Main.LOGGER.error("[DiscJockeyRevive-调试] 聊天窗口未初始化,{}",message);
// Main.LOGGER.error("[DiscJockeyRevive-调试] 聊天窗口未初始化,{}",message);
}
}
}

View File

@ -14,9 +14,13 @@ import net.minecraft.client.MinecraftClient;
import net.minecraft.client.option.KeyBinding;
import net.minecraft.client.util.InputUtil;
import net.minecraft.client.world.ClientWorld;
import net.minecraft.registry.Registries;
import net.minecraft.registry.Registry;
import net.minecraft.sound.SoundEvent;
import net.minecraft.text.MutableText;
import net.minecraft.text.Text;
import net.minecraft.util.Formatting;
import net.minecraft.util.Identifier;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.lwjgl.glfw.GLFW;

View File

@ -31,6 +31,14 @@ public record Note(NoteBlockInstrument instrument, byte note) {
NoteBlockInstrument.BANJO,
NoteBlockInstrument.PLING,
NoteBlockInstrument.ZOMBIE,
NoteBlockInstrument.SKELETON,
NoteBlockInstrument.CREEPER,
NoteBlockInstrument.DRAGON,
NoteBlockInstrument.WITHER_SKELETON,
NoteBlockInstrument.PIGLIN,
NoteBlockInstrument.CUSTOM_HEAD
};
static {
@ -50,5 +58,13 @@ public record Note(NoteBlockInstrument instrument, byte note) {
INSTRUMENT_BLOCKS.put(NoteBlockInstrument.BIT, Blocks.EMERALD_BLOCK);
INSTRUMENT_BLOCKS.put(NoteBlockInstrument.BANJO, Blocks.HAY_BLOCK);
INSTRUMENT_BLOCKS.put(NoteBlockInstrument.PLING, Blocks.GLOWSTONE);
INSTRUMENT_BLOCKS.put(NoteBlockInstrument.ZOMBIE, Blocks.ZOMBIE_HEAD);
INSTRUMENT_BLOCKS.put(NoteBlockInstrument.SKELETON, Blocks.SKELETON_SKULL);
INSTRUMENT_BLOCKS.put(NoteBlockInstrument.CREEPER, Blocks.CREEPER_HEAD);
INSTRUMENT_BLOCKS.put(NoteBlockInstrument.DRAGON, Blocks.DRAGON_HEAD);
INSTRUMENT_BLOCKS.put(NoteBlockInstrument.WITHER_SKELETON, Blocks.WITHER_SKELETON_SKULL);
INSTRUMENT_BLOCKS.put(NoteBlockInstrument.PIGLIN, Blocks.PIGLIN_HEAD);
INSTRUMENT_BLOCKS.put(NoteBlockInstrument.CUSTOM_HEAD, Blocks.PLAYER_HEAD);
}
}

View File

@ -89,9 +89,9 @@ public class KeyMappingListWidget extends EntryListWidget<KeyMappingListWidget.K
MinecraftClient client = MinecraftClient.getInstance();
int textY = y + (entryHeight - client.textRenderer.fontHeight) / 2;
Text keyText = Text.translatable(key.getTranslationKey());
context.drawTextWithShadow(client.textRenderer, keyText, x + 5, textY, 0xFFFFFF);
context.drawTextWithShadow(client.textRenderer, keyText, x + 5, textY, 0xFFFFFFFF);
String noteDisplayName = KeyMappingManager.getNoteDisplayName(note);
context.drawTextWithShadow(client.textRenderer, noteDisplayName, x + 100, textY, 0xAAAAAA);
context.drawTextWithShadow(client.textRenderer, noteDisplayName, x + 100, textY, 0xFFAAAAAA);
int buttonWidth = 50;
int buttonHeight = 18;
int buttonY = y + (entryHeight - buttonHeight) / 2;

View File

@ -6,7 +6,7 @@ import net.minecraft.client.gui.DrawContext;
public class ProgressBarRenderer {
private static final int BACKGROUND_COLOR = 0x80808080;
// private static final int PROGRESS_COLOR = 0x8000FF00;
private static final int TEXT_COLOR = 0xFFFFFF;
private static final int TEXT_COLOR = 0xEEFFFFFF;
public void renderProgressBar(DrawContext context, int x, int y, int width, int height, float progress, String timeText, int PROGRESS_COLOR) {
context.fill(x, y, x + width, y + height, BACKGROUND_COLOR);

View File

@ -70,7 +70,7 @@ public class SongListWidget extends EntryListWidget<SongListWidget.Entry> {
client.textRenderer,
emoji,
x + 4, y + 6,
favorite ? 0xFFD700 : 0x808080
favorite ? 0xFFFFD700 : 0xFF808080
);
// 歌曲名称靠左显示从收藏图标右侧开始
@ -81,7 +81,7 @@ public class SongListWidget extends EntryListWidget<SongListWidget.Entry> {
client.textRenderer,
displayText,
textX, y + 6,
selected ? 0xFFFFFF : 0x808080
selected ? 0xFFFFFFFF : 0xFF808080
);
}
@ -159,7 +159,7 @@ public class SongListWidget extends EntryListWidget<SongListWidget.Entry> {
client.textRenderer,
displayText,
x + 6, y + 6,
selected ? 0xFFFFFF : 0x808080
selected ? 0xFFFFFFFF : 0xFF808080
);
}

View File

@ -315,17 +315,18 @@ public class DiscJockeyScreen extends Screen {
public void render(DrawContext context, int mouseX, int mouseY, float delta) {
super.render(context, mouseX, mouseY, delta);
context.drawCenteredTextWithShadow(textRenderer, DROP_HINT, width / 2, 5, 0xFFFFFF);
context.drawCenteredTextWithShadow(textRenderer, SELECT_SONG, width / 2, 20, 0xFFFFFF);
context.drawCenteredTextWithShadow(textRenderer, DROP_HINT, width / 2, 5, 0xFFFFFFFF);
context.drawCenteredTextWithShadow(textRenderer, SELECT_SONG, width / 2, 20, 0xFFFFFFFF);
// 显示当前文件夹和播放模式
String folderName = currentFolder == null ? "/" : currentFolder.name;
context.drawTextWithShadow(textRenderer, CURRENT_FOLDER.getString() + ": " + folderName, 35, 15, 0xFFFFFF);
context.drawTextWithShadow(textRenderer, CURRENT_FOLDER.getString() + ": " + folderName, 35, 15, 0xFFFFFFFF);
// context.drawTextWithShadow(textRenderer, PLAY_MODE.getString() + ":", width - 220, 15, 0xFFFFFF);
int screenWidth = context.getScaledWindowWidth();
// 进度条
// 播放进度条
// TODO 关于可拖动什么的以后再加这里放个TODO防止以后忘了
if (Main.SONG_PLAYER.running && Main.SONG_PLAYER.song != null) {
int progressBarX = 10;
int progressBarY = height - 52; // 按钮上方
@ -343,7 +344,7 @@ public class DiscJockeyScreen extends Screen {
);
}
// 进度条
// 预览进度条
if (Main.PREVIEWER.running && Main.PREVIEWER.song != null) {
int progressBarX = 10;
int progressBarY = height - 37; // 比上一个低一点

View File

@ -135,11 +135,11 @@ public class EditKeyMappingsScreen extends Screen {
@Override
public void render(DrawContext context, int mouseX, int mouseY, float delta) {
super.render(context, mouseX, mouseY, delta);
context.drawCenteredTextWithShadow(textRenderer, TITLE, this.width / 2, 10, 0xFFFFFF);
context.drawCenteredTextWithShadow(textRenderer, TITLE, this.width / 2, 10, 0xFFFFFFFF);
if (waitingForKeyPress) {
context.fill(0, 0, this.width, this.height, 0x80000000);
context.drawCenteredTextWithShadow(textRenderer, PRESS_KEY_INSTRUCTION, this.width / 2, this.height / 2 - 10, 0xFFFFFF);
context.drawCenteredTextWithShadow(textRenderer, PRESS_KEY_INSTRUCTION, this.width / 2, this.height / 2 - 10, 0xFFFFFFFF);
}
mappingListWidget.render(context, mouseX, mouseY, delta);
}

View File

@ -58,8 +58,8 @@ public class LiveDjScreen extends Screen {
@Override
public void render(DrawContext context, int mouseX, int mouseY, float delta) {
super.render(context, mouseX, mouseY, delta);
context.drawCenteredTextWithShadow(textRenderer, TITLE, this.width / 2, 10, 0xFFFFFF);
context.drawCenteredTextWithShadow(textRenderer, INSTRUCTIONS, this.width / 2, 30, 0xFFFFFF);
context.drawCenteredTextWithShadow(textRenderer, TITLE, this.width / 2, 10, 0xFFFFFFFF);
context.drawCenteredTextWithShadow(textRenderer, INSTRUCTIONS, this.width / 2, 30, 0xFFFFFFFF);
Text tuningStatusText;
if (Main.LIVE_DJ_PLAYER.getNoteBlocks() == null) {
@ -112,7 +112,7 @@ public class LiveDjScreen extends Screen {
startTuningButton.active = false;
startTuningButton.visible = false;
}
context.drawCenteredTextWithShadow(textRenderer, tuningStatusText, this.width / 2, 50, 0xFFFFFF);
context.drawCenteredTextWithShadow(textRenderer, tuningStatusText, this.width / 2, 50, 0xFFFFFFFF);
if (!Main.LIVE_DJ_PLAYER.missingInstrumentBlocks.isEmpty()) {

View File

@ -147,7 +147,7 @@ public class SelectNoteScreen extends Screen {
super.render(context, mouseX, mouseY, delta);
context.drawCenteredTextWithShadow(textRenderer, TITLE, this.width / 2, 10, 0xFFFFFF);
context.drawCenteredTextWithShadow(textRenderer, TITLE, this.width / 2, 10, 0xFFFFFFFF);
context.drawCenteredTextWithShadow(textRenderer, Text.translatable(Main.MOD_ID + ".screen.select_note.mapping_key", Text.translatable(keyToMap.getTranslationKey())), this.width / 2, 30, 0xFFFFFF);
}

View File

@ -0,0 +1,11 @@
minecraft_version=1.21.8
yarn_mappings=1.21.8+build.1
minecraft_dependency=1.21.8
game_versions=1.21.8
fabric_api_version=0.129.0+1.21.8
modmenu_version=15.0.0-beta.3
cloth_config_version=19.0.147

View File