Skip to content

Commit

Permalink
chore: merge upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
AlphaMode committed Mar 18, 2024
1 parent 55b3d07 commit ce56c34
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 24 deletions.
14 changes: 7 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -72,17 +72,17 @@ dependencies {
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_api_version}"

for (String module in project.porting_lib_modules.split(",")) {
modApi("io.github.fabricators_of_create.Porting-Lib:$module:${project.porting_lib_version}")
modApi "io.github.fabricators_of_create.Porting-Lib:$module:${project.porting_lib_version}"
}

compileOnly "mezz.jei:jei-${project.mc_version}-common:${project.jei_version}"
compileOnly "mezz.jei:jei-${project.mc_version}-forge:${project.jei_version}"
modCompileOnly "mezz.jei:jei-${project.mc_version}-common:${project.jei_version}"
modCompileOnly "mezz.jei:jei-${project.mc_version}-forge:${project.jei_version}"

compileOnly fg.deobf("me.shedaniel:RoughlyEnoughItems-api-forge:$rei_version")
compileOnly fg.deobf("me.shedaniel:RoughlyEnoughItems-default-plugin-forge:$rei_version")
modCompileOnly "me.shedaniel:RoughlyEnoughItems-api-fabric:$rei_version"
modCompileOnly "me.shedaniel:RoughlyEnoughItems-default-plugin-fabric:$rei_version"

compileOnly fg.deobf("me.shedaniel.cloth:cloth-config-forge:$cloth_config_version")
compileOnly fg.deobf("dev.architectury:architectury-forge:$architectury_version")
modCompileOnly "me.shedaniel.cloth:cloth-config-fabric:$cloth_config_version"
modCompileOnly "dev.architectury:architectury-fabric:$architectury_version"
}

repositories {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,29 +1,27 @@
package com.aetherteam.nitrogen.data;

import com.aetherteam.nitrogen.data.generators.NitrogenLanguageData;
import net.fabricmc.fabric.api.datagen.v1.DataGeneratorEntrypoint;
import net.fabricmc.fabric.api.datagen.v1.FabricDataGenerator;
import net.minecraft.SharedConstants;
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.server.packs.PackType;
import net.minecraft.server.packs.metadata.pack.PackMetadataSection;
import net.minecraftforge.data.event.GatherDataEvent;

import java.util.Map;

public class NitrogenDataGenerators {
public static void onInitializeDataGenerator(GatherDataEvent event) {
DataGenerator generator = event.getGenerator();
PackOutput packOutput = generator.getPackOutput();
public class NitrogenDataGenerators implements DataGeneratorEntrypoint {
@Override
public void onInitializeDataGenerator(FabricDataGenerator generator) {
FabricDataGenerator.Pack pack = generator.createPack();

// Client Data
generator.addProvider(event.includeClient(), new NitrogenLanguageData(packOutput));
pack.addProvider(NitrogenLanguageData::new);

// pack.mcmeta
PackMetadataGenerator packMeta = new PackMetadataGenerator(packOutput);
Map<PackType, Integer> packTypes = Map.of(PackType.SERVER_DATA, SharedConstants.getCurrentVersion().getPackVersion(PackType.SERVER_DATA));
packMeta.add(PackMetadataSection.TYPE, new PackMetadataSection(Component.translatable("pack.nitrogen_internals.mod.description"), SharedConstants.getCurrentVersion().getPackVersion(PackType.CLIENT_RESOURCES), packTypes));
generator.addProvider(true, packMeta);
PackMetadataGenerator packMeta = pack.addProvider((output, r) -> new PackMetadataGenerator(output));
// Map<PackType, Integer> packTypes = Map.of(PackType.SERVER_DATA, SharedConstants.getCurrentVersion().getPackVersion(PackType.SERVER_DATA)); TODO: needed?
packMeta.add(PackMetadataSection.TYPE, new PackMetadataSection(Component.translatable("pack.nitrogen_internals.mod.description"), SharedConstants.getCurrentVersion().getPackVersion(PackType.CLIENT_RESOURCES)/*, packTypes*/));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@

import com.aetherteam.nitrogen.Nitrogen;
import com.aetherteam.nitrogen.data.providers.NitrogenLanguageProvider;
import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput;
import net.minecraft.data.PackOutput;

public class NitrogenLanguageData extends NitrogenLanguageProvider {
public NitrogenLanguageData(PackOutput output) {
public NitrogenLanguageData(FabricDataOutput output) {
super(output, Nitrogen.MODID);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.aetherteam.nitrogen.integration.rei;

import com.aetherteam.nitrogen.Nitrogen;
import com.aetherteam.nitrogen.integration.jei.FakeLevel;
import com.aetherteam.nitrogen.integration.recipeviewer.FakeLevel;
import com.aetherteam.nitrogen.recipe.BlockPropertyPair;
import com.aetherteam.nitrogen.recipe.BlockStateRecipeUtil;
import com.mojang.blaze3d.platform.Lighting;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.aetherteam.nitrogen.integration.rei;

import com.aetherteam.nitrogen.Nitrogen;
import com.aetherteam.nitrogen.integration.jei.FakeLevel;
import com.aetherteam.nitrogen.integration.recipeviewer.FakeLevel;
import com.mojang.blaze3d.systems.RenderSystem;
import com.mojang.blaze3d.vertex.BufferBuilder;
import com.mojang.blaze3d.vertex.PoseStack;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import me.shedaniel.rei.api.common.entry.EntryIngredient;
import me.shedaniel.rei.api.common.entry.EntryStack;
import me.shedaniel.rei.api.common.util.EntryStacks;
import net.fabricmc.fabric.api.transfer.v1.fluid.FluidConstants;
import net.minecraft.client.Minecraft;
import net.minecraft.core.BlockPos;
import net.minecraft.world.item.ItemStack;
Expand All @@ -13,7 +14,6 @@
import net.minecraft.world.level.block.LiquidBlock;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.properties.Property;
import net.minecraftforge.fluids.FluidType;

import java.util.ArrayList;
import java.util.List;
Expand All @@ -26,7 +26,7 @@ public static List<EntryIngredient> toIngredientList(BlockPropertyPair ...pairs)
List<EntryStack<?>> inputIngredients = new ArrayList<>();
for (BlockPropertyPair pair : pairs) {
if (pair.block() instanceof LiquidBlock liquidBlock) {
inputIngredients.add(EntryStacks.of(liquidBlock.getFluidState(liquidBlock.defaultBlockState()).getType(), FluidType.BUCKET_VOLUME));
inputIngredients.add(EntryStacks.of(liquidBlock.getFluidState(liquidBlock.defaultBlockState()).getType(), FluidConstants.BUCKET));
} else {
inputIngredients.add(EntryStacks.of(setupIngredient(pair)));
}
Expand Down

0 comments on commit ce56c34

Please sign in to comment.