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:
@@ -4,11 +4,11 @@ dependencies {
|
|||||||
implementation("commons-io:commons-io:2.11.0")
|
implementation("commons-io:commons-io:2.11.0")
|
||||||
implementation("com.twelvemonkeys.imageio:imageio-tga:3.9.4")
|
implementation("com.twelvemonkeys.imageio:imageio-tga:3.9.4")
|
||||||
implementation("com.nukkitx.fastutil:fastutil-int-object-maps:8.5.3")
|
implementation("com.nukkitx.fastutil:fastutil-int-object-maps:8.5.3")
|
||||||
implementation("net.kyori:adventure-api:4.13.1")
|
implementation("net.kyori:adventure-api:4.14.0")
|
||||||
implementation("net.kyori:adventure-text-serializer-gson:4.13.1")
|
implementation("net.kyori:adventure-text-serializer-gson:4.14.0")
|
||||||
implementation("net.kyori:adventure-text-serializer-legacy:4.13.1")
|
implementation("net.kyori:adventure-text-serializer-legacy:4.14.0")
|
||||||
implementation("team.unnamed:creative-api:0.7.1-SNAPSHOT")
|
implementation("team.unnamed:creative-api:1.7.0")
|
||||||
implementation("team.unnamed:creative-serializer-minecraft:0.7.1-SNAPSHOT")
|
implementation("team.unnamed:creative-serializer-minecraft:1.7.0")
|
||||||
|
|
||||||
compileOnly("com.google.auto.service:auto-service:1.0.1")
|
compileOnly("com.google.auto.service:auto-service:1.0.1")
|
||||||
annotationProcessor("com.google.auto.service:auto-service:1.0.1")
|
annotationProcessor("com.google.auto.service:auto-service:1.0.1")
|
||||||
|
|||||||
@@ -36,7 +36,9 @@ import org.geysermc.pack.converter.converter.BaseConverter;
|
|||||||
import org.geysermc.pack.converter.converter.Converter;
|
import org.geysermc.pack.converter.converter.Converter;
|
||||||
import org.geysermc.pack.converter.data.BaseConversionData;
|
import org.geysermc.pack.converter.data.BaseConversionData;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
import org.jetbrains.annotations.Unmodifiable;
|
||||||
import team.unnamed.creative.sound.Sound;
|
import team.unnamed.creative.sound.Sound;
|
||||||
|
import team.unnamed.creative.sound.SoundEntry;
|
||||||
import team.unnamed.creative.sound.SoundEvent;
|
import team.unnamed.creative.sound.SoundEvent;
|
||||||
import team.unnamed.creative.sound.SoundRegistry;
|
import team.unnamed.creative.sound.SoundRegistry;
|
||||||
|
|
||||||
@@ -55,16 +57,15 @@ public class SoundConverter extends BaseConverter {
|
|||||||
public void convert(@NotNull PackConversionContext<BaseConversionData> context) throws Exception {
|
public void convert(@NotNull PackConversionContext<BaseConversionData> context) throws Exception {
|
||||||
Collection<SoundRegistry> registry = context.javaResourcePack().soundRegistries();
|
Collection<SoundRegistry> registry = context.javaResourcePack().soundRegistries();
|
||||||
for (SoundRegistry soundRegistry : registry) {
|
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()) {
|
for (SoundEvent value : sounds) {
|
||||||
String key = entry.getKey();
|
String key = value.key().asString();
|
||||||
SoundEvent value = entry.getValue();
|
|
||||||
|
|
||||||
SoundDefinitions definition = new SoundDefinitions();
|
SoundDefinitions definition = new SoundDefinitions();
|
||||||
definition.useLegacyMaxDistance(true); // TODO: Needed?
|
definition.useLegacyMaxDistance(true); // TODO: Needed?
|
||||||
definition.maxDistance(64); // ???
|
definition.maxDistance(64); // ???
|
||||||
for (Sound sound : value.sounds()) {
|
for (SoundEntry sound : value.sounds()) {
|
||||||
Sounds bedrockSound = new Sounds();
|
Sounds bedrockSound = new Sounds();
|
||||||
bedrockSound.name(BEDROCK_SOUNDS_LOCATION + "/" + sound.key().value());
|
bedrockSound.name(BEDROCK_SOUNDS_LOCATION + "/" + sound.key().value());
|
||||||
bedrockSound.stream(sound.stream());
|
bedrockSound.stream(sound.stream());
|
||||||
|
|||||||
@@ -26,6 +26,7 @@
|
|||||||
|
|
||||||
package org.geysermc.pack.converter.util;
|
package org.geysermc.pack.converter.util;
|
||||||
|
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
import team.unnamed.creative.serialize.minecraft.fs.FileTreeReader;
|
import team.unnamed.creative.serialize.minecraft.fs.FileTreeReader;
|
||||||
|
|
||||||
@@ -116,7 +117,7 @@ public final class NioDirectoryFileTreeReader implements FileTreeReader {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public InputStream input() {
|
public @NotNull InputStream stream() {
|
||||||
return currentStream;
|
return currentStream;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user