1
0
mirror of https://github.com/GeyserMC/PackConverter.git synced 2025-12-19 14:59:21 +00:00

Update java and bedrock schema

This commit is contained in:
rtm516
2024-03-02 00:44:01 +00:00
parent 5919279dc1
commit 4b3cf51ba5
4 changed files with 14 additions and 12 deletions

View File

@@ -4,11 +4,11 @@ dependencies {
implementation("commons-io:commons-io:2.11.0")
implementation("com.twelvemonkeys.imageio:imageio-tga:3.9.4")
implementation("com.nukkitx.fastutil:fastutil-int-object-maps:8.5.3")
implementation("net.kyori:adventure-api:4.13.1")
implementation("net.kyori:adventure-text-serializer-gson:4.13.1")
implementation("net.kyori:adventure-text-serializer-legacy:4.13.1")
implementation("team.unnamed:creative-api:0.7.1-SNAPSHOT")
implementation("team.unnamed:creative-serializer-minecraft:0.7.1-SNAPSHOT")
implementation("net.kyori:adventure-api:4.14.0")
implementation("net.kyori:adventure-text-serializer-gson:4.14.0")
implementation("net.kyori:adventure-text-serializer-legacy:4.14.0")
implementation("team.unnamed:creative-api:1.7.0")
implementation("team.unnamed:creative-serializer-minecraft:1.7.0")
compileOnly("com.google.auto.service:auto-service:1.0.1")
annotationProcessor("com.google.auto.service:auto-service:1.0.1")

View File

@@ -36,7 +36,9 @@ import org.geysermc.pack.converter.converter.BaseConverter;
import org.geysermc.pack.converter.converter.Converter;
import org.geysermc.pack.converter.data.BaseConversionData;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Unmodifiable;
import team.unnamed.creative.sound.Sound;
import team.unnamed.creative.sound.SoundEntry;
import team.unnamed.creative.sound.SoundEvent;
import team.unnamed.creative.sound.SoundRegistry;
@@ -55,16 +57,15 @@ public class SoundConverter extends BaseConverter {
public void convert(@NotNull PackConversionContext<BaseConversionData> context) throws Exception {
Collection<SoundRegistry> registry = context.javaResourcePack().soundRegistries();
for (SoundRegistry soundRegistry : registry) {
Map<String, SoundEvent> sounds = soundRegistry.sounds();
@Unmodifiable @NotNull Collection<SoundEvent> sounds = soundRegistry.sounds();
for (Map.Entry<String, SoundEvent> entry : sounds.entrySet()) {
String key = entry.getKey();
SoundEvent value = entry.getValue();
for (SoundEvent value : sounds) {
String key = value.key().asString();
SoundDefinitions definition = new SoundDefinitions();
definition.useLegacyMaxDistance(true); // TODO: Needed?
definition.maxDistance(64); // ???
for (Sound sound : value.sounds()) {
for (SoundEntry sound : value.sounds()) {
Sounds bedrockSound = new Sounds();
bedrockSound.name(BEDROCK_SOUNDS_LOCATION + "/" + sound.key().value());
bedrockSound.stream(sound.stream());

View File

@@ -26,6 +26,7 @@
package org.geysermc.pack.converter.util;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import team.unnamed.creative.serialize.minecraft.fs.FileTreeReader;
@@ -116,7 +117,7 @@ public final class NioDirectoryFileTreeReader implements FileTreeReader {
}
@Override
public InputStream input() {
public @NotNull InputStream stream() {
return currentStream;
}