Skip to content

Commit

Permalink
stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
Zepalesque committed May 29, 2024
1 parent 26c378d commit 780f135
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
32 changes: 32 additions & 0 deletions src/main/java/net/zepalesque/redux/Redux.java
Original file line number Diff line number Diff line change
@@ -1,29 +1,38 @@
package net.zepalesque.redux;

import com.aetherteam.aether.Aether;
import com.aetherteam.aether.data.AetherData;
import com.aetherteam.aether.data.generators.AetherRegistrySets;
import com.mojang.logging.LogUtils;
import net.minecraft.DetectedVersion;
import net.minecraft.SharedConstants;
import net.minecraft.core.HolderLookup;
import net.minecraft.data.DataGenerator;
import net.minecraft.data.PackOutput;
import net.minecraft.data.metadata.PackMetadataGenerator;
import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.server.packs.PackType;
import net.minecraft.server.packs.PathPackResources;
import net.minecraft.server.packs.metadata.pack.PackMetadataSection;
import net.minecraft.server.packs.repository.Pack;
import net.minecraft.server.packs.repository.PackCompatibility;
import net.minecraft.server.packs.repository.PackSource;
import net.minecraft.util.InclusiveRange;
import net.minecraft.world.flag.FeatureFlagSet;
import net.neoforged.api.distmarker.Dist;
import net.neoforged.bus.api.EventPriority;
import net.neoforged.bus.api.IEventBus;
import net.neoforged.fml.DistExecutor;
import net.neoforged.fml.ModList;
import net.neoforged.fml.ModLoadingContext;
import net.neoforged.fml.common.Mod;
import net.neoforged.fml.config.ModConfig;
import net.neoforged.fml.event.lifecycle.FMLCommonSetupEvent;
import net.neoforged.neoforge.common.data.DatapackBuiltinEntriesProvider;
import net.neoforged.neoforge.common.data.ExistingFileHelper;
import net.neoforged.neoforge.data.event.GatherDataEvent;
import net.neoforged.neoforge.event.AddPackFindersEvent;
import net.neoforged.neoforge.registries.datamaps.RegisterDataMapTypesEvent;
import net.zepalesque.redux.block.ReduxBlocks;
import net.zepalesque.redux.blockset.stone.ReduxStoneSets;
Expand Down Expand Up @@ -52,8 +61,10 @@
import net.zepalesque.zenith.api.condition.config.ConfigSerializer;
import org.slf4j.Logger;

import java.nio.file.Path;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Optional;
import java.util.concurrent.CompletableFuture;

Expand Down Expand Up @@ -132,6 +143,27 @@ private void dataSetup(GatherDataEvent event) {
Optional.of(new InclusiveRange<>(0, Integer.MAX_VALUE)))));
}

// TODO: probably fairly obvious what is TODO (pack config)
public void packSetup(AddPackFindersEvent event) {

if (event.getPackType() == PackType.CLIENT_RESOURCES) {
Path resourcePath = ModList.get().getModFileById(Aether.MODID).getFile().findResource("packs/resource/tintable_grass");
PackMetadataSection metadata = new PackMetadataSection(Component.translatable("pack.aether_redux.tintable_grass.description"), SharedConstants.getCurrentVersion().getPackVersion(PackType.CLIENT_RESOURCES));
event.addRepositorySource((source) ->
source.accept(Pack.create(
"builtin/redux/tintable_grass",
Component.translatable("pack.aether_redux.tintable_grass"),
false,
new PathPackResources.PathResourcesSupplier(resourcePath, true),
new Pack.Info(metadata.description(), PackCompatibility.COMPATIBLE, FeatureFlagSet.of(), List.of(), false),
Pack.Position.TOP,
false,
PackSource.BUILT_IN)
)
);
}
}

public static ResourceLocation loc(String path) {
return new ResourceLocation(MODID, path);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,7 @@ protected void addTranslations() {
this.add(ReduxBlocks.SHORT_AETHER_GRASS);

this.addPackDescription("mod", "The Aether: Redux Resources");
this.addPackTitle("tintable_grass", "Redux - Tintable Grass");
this.addPackDescription("tintable_grass", "Grass tint textures for the Aether: Redux");
}
}

0 comments on commit 780f135

Please sign in to comment.