minecraft-src/net/minecraft/world/level/DataPackConfig.java
2025-07-04 01:41:11 +03:00

35 lines
1.2 KiB
Java

package net.minecraft.world.level;
import com.google.common.collect.ImmutableList;
import com.mojang.serialization.Codec;
import com.mojang.serialization.codecs.RecordCodecBuilder;
import java.util.List;
public class DataPackConfig {
/**
* This is the default "Vanilla and nothing else" codec. Should have a more distinct name compared to field_234881_b_
*/
public static final DataPackConfig DEFAULT = new DataPackConfig(ImmutableList.of("vanilla"), ImmutableList.of());
public static final Codec<DataPackConfig> CODEC = RecordCodecBuilder.create(
instance -> instance.group(
Codec.STRING.listOf().fieldOf("Enabled").forGetter(dataPackConfig -> dataPackConfig.enabled),
Codec.STRING.listOf().fieldOf("Disabled").forGetter(dataPackConfig -> dataPackConfig.disabled)
)
.apply(instance, DataPackConfig::new)
);
private final List<String> enabled;
private final List<String> disabled;
public DataPackConfig(List<String> enabled, List<String> disabled) {
this.enabled = ImmutableList.copyOf(enabled);
this.disabled = ImmutableList.copyOf(disabled);
}
public List<String> getEnabled() {
return this.enabled;
}
public List<String> getDisabled() {
return this.disabled;
}
}