From 56404bce3a771d6c23e41795fa2e268c511b798f Mon Sep 17 00:00:00 2001 From: bconlon Date: Sun, 17 Mar 2024 22:20:31 -0700 Subject: [PATCH] feat: 1.20.4 initial commit --- build.gradle | 10 +- gradle.properties | 22 +- .../rei/AetherREIClientPlugin.java | 252 ++++++------- .../rei/AetherREIServerPlugin.java | 90 ++--- .../aether/integration/rei/FuelRecipe.java | 12 +- .../rei/categories/BiomeTooltip.java | 56 +-- .../AbstractPlacementBanRecipeCategory.java | 122 +++---- .../ban/BlockBanRecipeCategory.java | 80 ++--- .../categories/ban/ItemBanRecipeCategory.java | 74 ++-- .../ban/PlacementBanRecipeDisplay.java | 156 ++++---- .../block/AetherBlockStateRecipeCategory.java | 72 ++-- .../block/BiomeParameterRecipeCategory.java | 64 ++-- .../item/AetherCookingRecipeCategory.java | 340 +++++++++--------- .../item/AetherCookingRecipeDisplay.java | 184 +++++----- 14 files changed, 767 insertions(+), 767 deletions(-) diff --git a/build.gradle b/build.gradle index f082993a92..f84a489e4c 100644 --- a/build.gradle +++ b/build.gradle @@ -53,7 +53,7 @@ sourceSets.main.resources { subsystems { parchment { - minecraftVersion = project.mc_version + minecraftVersion = "1.20.3" //todo mappingsVersion = project.mappings } } @@ -109,10 +109,10 @@ dependencies { // runtimeOnly "me.shedaniel.cloth:cloth-config-neoforge:$cloth_config_version" // runtimeOnly "dev.architectury:architectury-neoforge:$architectury_version" - compileOnly "me.shedaniel:RoughlyEnoughItems-api-neoforge:$rei_version" - compileOnly "me.shedaniel:RoughlyEnoughItems-default-plugin-neoforge:$rei_version" - compileOnly "me.shedaniel.cloth:cloth-config-neoforge:$cloth_config_version" - compileOnly "dev.architectury:architectury-neoforge:$architectury_version" +// compileOnly "me.shedaniel:RoughlyEnoughItems-api-neoforge:$rei_version" +// compileOnly "me.shedaniel:RoughlyEnoughItems-default-plugin-neoforge:$rei_version" +// compileOnly "me.shedaniel.cloth:cloth-config-neoforge:$cloth_config_version" +// compileOnly "dev.architectury:architectury-neoforge:$architectury_version" } repositories { diff --git a/gradle.properties b/gradle.properties index 9e74abd791..eb7c47ac23 100644 --- a/gradle.properties +++ b/gradle.properties @@ -7,18 +7,18 @@ org.gradle.daemon=false mod_id=aether mod_name=The Aether mod_version=1.3.0 -mc_version=1.20.2 -neoforge_version=20.2.88 -mappings=2023.12.10 +mc_version=1.20.4 +neoforge_version=20.4.200 +mappings=2023.12.31 # Dependencies nitrogen_version=1.20.2-1.0.23-neoforge -cumulus_version=1.20.2-1.0.0-neoforge -curios_version=6.1.0 -caelus_version=4.0.0+1.20.2 +cumulus_version=1.20.4-1.0.0-neoforge +curios_version=7.3.4 +caelus_version=5.0.1+1.20.4 #jei_version=15.2.0.27 -crafttweaker_version=1.20.2:15.0.6 -jade_version=4979237 +crafttweaker_version=1.20.4:17.0.12 +jade_version=5109393 #lootr_version=4608503 #debugutils_version=1.0.2 #smoothboot_version=1.16.4-1.2.1 @@ -26,9 +26,9 @@ jade_version=4979237 #colytra_version=3310142 #https://www.curseforge.com/minecraft/mc-mods/curious-elytra/files/3601975 #curiouselytra_version=3601975 -rei_version=13.0.685 -cloth_config_version=12.0.119 -architectury_version=10.0.17 +#rei_version=13.0.685 +#cloth_config_version=12.0.119 +#architectury_version=10.0.17 # Publishing curseforge_id=255308 diff --git a/src/main/java/com/aetherteam/aether/integration/rei/AetherREIClientPlugin.java b/src/main/java/com/aetherteam/aether/integration/rei/AetherREIClientPlugin.java index cc33cf941e..0e6c477924 100644 --- a/src/main/java/com/aetherteam/aether/integration/rei/AetherREIClientPlugin.java +++ b/src/main/java/com/aetherteam/aether/integration/rei/AetherREIClientPlugin.java @@ -1,128 +1,128 @@ package com.aetherteam.aether.integration.rei; -import com.aetherteam.aether.Aether; -import com.aetherteam.aether.block.AetherBlocks; -import com.aetherteam.aether.blockentity.AltarBlockEntity; -import com.aetherteam.aether.blockentity.FreezerBlockEntity; -import com.aetherteam.aether.blockentity.IncubatorBlockEntity; -import com.aetherteam.aether.integration.rei.categories.ban.BlockBanRecipeCategory; -import com.aetherteam.aether.integration.rei.categories.ban.ItemBanRecipeCategory; -import com.aetherteam.aether.integration.rei.categories.ban.PlacementBanRecipeDisplay; -import com.aetherteam.aether.integration.rei.categories.block.AetherBlockStateRecipeCategory; -import com.aetherteam.aether.integration.rei.categories.block.BiomeParameterRecipeCategory; -import com.aetherteam.aether.integration.rei.categories.item.AetherCookingRecipeCategory; -import com.aetherteam.aether.integration.rei.categories.item.AetherCookingRecipeDisplay; -import com.aetherteam.aether.inventory.menu.AltarMenu; -import com.aetherteam.aether.inventory.menu.FreezerMenu; -import com.aetherteam.aether.inventory.menu.IncubatorMenu; -import com.aetherteam.aether.recipe.AetherRecipeTypes; -import com.aetherteam.aether.recipe.recipes.ban.BlockBanRecipe; -import com.aetherteam.aether.recipe.recipes.ban.ItemBanRecipe; -import com.aetherteam.aether.recipe.recipes.block.*; -import com.aetherteam.aether.recipe.recipes.item.AltarRepairRecipe; -import com.aetherteam.aether.recipe.recipes.item.EnchantingRecipe; -import com.aetherteam.aether.recipe.recipes.item.FreezingRecipe; -import com.aetherteam.aether.recipe.recipes.item.IncubationRecipe; -import com.aetherteam.nitrogen.integration.rei.categories.fuel.AbstractFuelCategory; -import com.aetherteam.nitrogen.integration.rei.displays.BlockStateRecipeDisplay; -import com.aetherteam.nitrogen.integration.rei.displays.FuelDisplay; -import me.shedaniel.rei.api.client.plugins.REIClientPlugin; -import me.shedaniel.rei.api.client.registry.category.CategoryRegistry; -import me.shedaniel.rei.api.client.registry.display.DisplayRegistry; -import me.shedaniel.rei.api.client.registry.transfer.TransferHandlerRegistry; -import me.shedaniel.rei.api.client.registry.transfer.simple.SimpleTransferHandler; -import me.shedaniel.rei.api.common.util.EntryStacks; -import me.shedaniel.rei.forge.REIPluginClient; -import net.minecraft.network.chat.Component; -import net.minecraft.resources.ResourceLocation; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.item.crafting.Recipe; -import net.minecraft.world.item.crafting.RecipeHolder; - -import java.util.ArrayList; -import java.util.List; - -@REIPluginClient -public class AetherREIClientPlugin implements REIClientPlugin { - private static final ResourceLocation LIT_PROGRESS_TRANSPARENT_TEXTURE = new ResourceLocation(Aether.MODID, "menu/lit_progress_transparent"); - private static final ResourceLocation LIT_PROGRESS_BACKGROUND_TEXTURE = new ResourceLocation(Aether.MODID, "menu/lit_progress_background"); - - public static List getFuelRecipes() { - List fuelRecipes = new ArrayList<>(); - AltarBlockEntity.getEnchantingMap().forEach((item, burnTime) -> fuelRecipes.add(new FuelRecipe(List.of(new ItemStack(item)), burnTime, AetherBlocks.ALTAR.get()))); - FreezerBlockEntity.getFreezingMap().forEach((item, burnTime) -> fuelRecipes.add(new FuelRecipe(List.of(new ItemStack(item)), burnTime, AetherBlocks.FREEZER.get()))); - IncubatorBlockEntity.getIncubatingMap().forEach((item, burnTime) -> fuelRecipes.add(new FuelRecipe(List.of(new ItemStack(item)), burnTime, AetherBlocks.INCUBATOR.get()))); - return fuelRecipes; - } - - @Override - public void registerDisplays(DisplayRegistry registry) { - registry.registerRecipeFiller(ItemBanRecipe.class, AetherRecipeTypes.ITEM_PLACEMENT_BAN.get(), recipe -> PlacementBanRecipeDisplay.ofItem(recipe.value())); - registry.registerRecipeFiller(BlockBanRecipe.class, AetherRecipeTypes.BLOCK_PLACEMENT_BAN.get(), recipe -> PlacementBanRecipeDisplay.ofBlock(recipe.value())); - - registry.registerRecipeFiller(AccessoryFreezableRecipe.class, AetherRecipeTypes.ACCESSORY_FREEZABLE.get(), recipe -> new BlockStateRecipeDisplay<>(AetherREIServerPlugin.ACCESSORY_FREEZABLE, recipe.value())); - registry.registerRecipeFiller(AmbrosiumRecipe.class, AetherRecipeTypes.AMBROSIUM_ENCHANTING.get(), recipe -> new BlockStateRecipeDisplay<>(AetherREIServerPlugin.AMBROSIUM_ENCHANTING, recipe.value())); - registry.registerRecipeFiller(IcestoneFreezableRecipe.class, AetherRecipeTypes.ICESTONE_FREEZABLE.get(), recipe -> new BlockStateRecipeDisplay<>(AetherREIServerPlugin.ICESTONE_FREEZABLE, recipe.value())); - - registry.registerRecipeFiller(PlacementConversionRecipe.class, AetherRecipeTypes.PLACEMENT_CONVERSION.get(), recipe -> new BlockStateRecipeDisplay<>(AetherREIServerPlugin.PLACEMENT_CONVERSION, recipe.value())); - registry.registerRecipeFiller(SwetBallRecipe.class, AetherRecipeTypes.SWET_BALL_CONVERSION.get(), recipe -> new BlockStateRecipeDisplay<>(AetherREIServerPlugin.SWET_BALL_CONVERSION, recipe.value())); - - // Fuel - for (var fuelRecipe : getFuelRecipes()) { - registry.add(new FuelDisplay(AetherREIServerPlugin.AETHER_FUEL, fuelRecipe.inputItems(), fuelRecipe.burnTime(), fuelRecipe.usageBlock())); - } - - for (var recipe : (List) registry.getRecipeManager().getAllRecipesFor(AetherRecipeTypes.ENCHANTING.get())) { - if(recipe instanceof EnchantingRecipe enchanting){ - registry.add(AetherCookingRecipeDisplay.of(AetherREIServerPlugin.ALTAR_ENCHANTING, enchanting)); - } else if(recipe instanceof AltarRepairRecipe repair){ - registry.add(AetherCookingRecipeDisplay.of(AetherREIServerPlugin.ALTAR_REPAIR, repair)); - } - } - - registry.registerFiller((o) -> o instanceof RecipeHolder> holder && holder.value() instanceof EnchantingRecipe, recipe -> AetherCookingRecipeDisplay.of(AetherREIServerPlugin.ALTAR_ENCHANTING, ((RecipeHolder) recipe).value())); - registry.registerFiller((o) -> o instanceof RecipeHolder> holder && holder.value() instanceof AltarRepairRecipe, recipe -> AetherCookingRecipeDisplay.of(AetherREIServerPlugin.ALTAR_REPAIR, ((RecipeHolder) recipe).value())); - registry.registerRecipeFiller(FreezingRecipe.class, AetherRecipeTypes.FREEZING.get(), recipe -> AetherCookingRecipeDisplay.of(AetherREIServerPlugin.FREEZING, recipe.value())); - registry.registerRecipeFiller(IncubationRecipe.class, AetherRecipeTypes.INCUBATION.get(), recipe -> AetherCookingRecipeDisplay.of(AetherREIServerPlugin.INCUBATING, recipe.value())); - } - - @Override - public void registerCategories(CategoryRegistry registry) { - registry.add(new BlockBanRecipeCategory()); - registry.add(new ItemBanRecipeCategory()); - - registry.add(AetherBlockStateRecipeCategory.accessoryFreezable()); - registry.add(AetherBlockStateRecipeCategory.ambrosium()); - registry.add(AetherBlockStateRecipeCategory.icestoneFreezable()); - - registry.add(BiomeParameterRecipeCategory.placementConversion()); - registry.add(BiomeParameterRecipeCategory.swetBall()); - - registry.add(new AbstractFuelCategory(AetherREIServerPlugin.AETHER_FUEL, LIT_PROGRESS_TRANSPARENT_TEXTURE, LIT_PROGRESS_BACKGROUND_TEXTURE) { - @Override - public Component getTitle() { - return Component.translatable("gui." + Aether.MODID + ".jei.fuel"); - } - }); - - registry.add(AetherCookingRecipeCategory.altarRepair()); - registry.add(AetherCookingRecipeCategory.altarEnchanting()); - registry.add(AetherCookingRecipeCategory.freezing()); - registry.add(AetherCookingRecipeCategory.incubating()); - - registry.addWorkstations(AetherREIServerPlugin.AETHER_FUEL, EntryStacks.of(AetherBlocks.FREEZER.get()), EntryStacks.of(AetherBlocks.ALTAR.get()), EntryStacks.of(AetherBlocks.INCUBATOR.get())); - - registry.addWorkstations(AetherREIServerPlugin.FREEZING, EntryStacks.of(AetherBlocks.FREEZER.get())); - registry.addWorkstations(AetherREIServerPlugin.ALTAR_REPAIR, EntryStacks.of(AetherBlocks.ALTAR.get())); - registry.addWorkstations(AetherREIServerPlugin.ALTAR_ENCHANTING, EntryStacks.of(AetherBlocks.ALTAR.get())); - registry.addWorkstations(AetherREIServerPlugin.INCUBATING, EntryStacks.of(AetherBlocks.INCUBATOR.get())); - } - - @Override - public void registerTransferHandlers(TransferHandlerRegistry registry) { - registry.register(SimpleTransferHandler.create(AltarMenu.class, AetherREIServerPlugin.ALTAR_ENCHANTING, new SimpleTransferHandler.IntRange(0, 1))); - registry.register(SimpleTransferHandler.create(AltarMenu.class, AetherREIServerPlugin.ALTAR_REPAIR, new SimpleTransferHandler.IntRange(0, 1))); - registry.register(SimpleTransferHandler.create(FreezerMenu.class, AetherREIServerPlugin.FREEZING, new SimpleTransferHandler.IntRange(0, 1))); - registry.register(SimpleTransferHandler.create(IncubatorMenu.class, AetherREIServerPlugin.INCUBATING, new SimpleTransferHandler.IntRange(0, 1))); - } -} +//import com.aetherteam.aether.Aether; +//import com.aetherteam.aether.block.AetherBlocks; +//import com.aetherteam.aether.blockentity.AltarBlockEntity; +//import com.aetherteam.aether.blockentity.FreezerBlockEntity; +//import com.aetherteam.aether.blockentity.IncubatorBlockEntity; +//import com.aetherteam.aether.integration.rei.categories.ban.BlockBanRecipeCategory; +//import com.aetherteam.aether.integration.rei.categories.ban.ItemBanRecipeCategory; +//import com.aetherteam.aether.integration.rei.categories.ban.PlacementBanRecipeDisplay; +//import com.aetherteam.aether.integration.rei.categories.block.AetherBlockStateRecipeCategory; +//import com.aetherteam.aether.integration.rei.categories.block.BiomeParameterRecipeCategory; +//import com.aetherteam.aether.integration.rei.categories.item.AetherCookingRecipeCategory; +//import com.aetherteam.aether.integration.rei.categories.item.AetherCookingRecipeDisplay; +//import com.aetherteam.aether.inventory.menu.AltarMenu; +//import com.aetherteam.aether.inventory.menu.FreezerMenu; +//import com.aetherteam.aether.inventory.menu.IncubatorMenu; +//import com.aetherteam.aether.recipe.AetherRecipeTypes; +//import com.aetherteam.aether.recipe.recipes.ban.BlockBanRecipe; +//import com.aetherteam.aether.recipe.recipes.ban.ItemBanRecipe; +//import com.aetherteam.aether.recipe.recipes.block.*; +//import com.aetherteam.aether.recipe.recipes.item.AltarRepairRecipe; +//import com.aetherteam.aether.recipe.recipes.item.EnchantingRecipe; +//import com.aetherteam.aether.recipe.recipes.item.FreezingRecipe; +//import com.aetherteam.aether.recipe.recipes.item.IncubationRecipe; +//import com.aetherteam.nitrogen.integration.rei.categories.fuel.AbstractFuelCategory; +//import com.aetherteam.nitrogen.integration.rei.displays.BlockStateRecipeDisplay; +//import com.aetherteam.nitrogen.integration.rei.displays.FuelDisplay; +//import me.shedaniel.rei.api.client.plugins.REIClientPlugin; +//import me.shedaniel.rei.api.client.registry.category.CategoryRegistry; +//import me.shedaniel.rei.api.client.registry.display.DisplayRegistry; +//import me.shedaniel.rei.api.client.registry.transfer.TransferHandlerRegistry; +//import me.shedaniel.rei.api.client.registry.transfer.simple.SimpleTransferHandler; +//import me.shedaniel.rei.api.common.util.EntryStacks; +//import me.shedaniel.rei.forge.REIPluginClient; +//import net.minecraft.network.chat.Component; +//import net.minecraft.resources.ResourceLocation; +//import net.minecraft.world.item.ItemStack; +//import net.minecraft.world.item.crafting.Recipe; +//import net.minecraft.world.item.crafting.RecipeHolder; +// +//import java.util.ArrayList; +//import java.util.List; +// +//@REIPluginClient +//public class AetherREIClientPlugin implements REIClientPlugin { +// private static final ResourceLocation LIT_PROGRESS_TRANSPARENT_TEXTURE = new ResourceLocation(Aether.MODID, "menu/lit_progress_transparent"); +// private static final ResourceLocation LIT_PROGRESS_BACKGROUND_TEXTURE = new ResourceLocation(Aether.MODID, "menu/lit_progress_background"); +// +// public static List getFuelRecipes() { +// List fuelRecipes = new ArrayList<>(); +// AltarBlockEntity.getEnchantingMap().forEach((item, burnTime) -> fuelRecipes.add(new FuelRecipe(List.of(new ItemStack(item)), burnTime, AetherBlocks.ALTAR.get()))); +// FreezerBlockEntity.getFreezingMap().forEach((item, burnTime) -> fuelRecipes.add(new FuelRecipe(List.of(new ItemStack(item)), burnTime, AetherBlocks.FREEZER.get()))); +// IncubatorBlockEntity.getIncubatingMap().forEach((item, burnTime) -> fuelRecipes.add(new FuelRecipe(List.of(new ItemStack(item)), burnTime, AetherBlocks.INCUBATOR.get()))); +// return fuelRecipes; +// } +// +// @Override +// public void registerDisplays(DisplayRegistry registry) { +// registry.registerRecipeFiller(ItemBanRecipe.class, AetherRecipeTypes.ITEM_PLACEMENT_BAN.get(), recipe -> PlacementBanRecipeDisplay.ofItem(recipe.value())); +// registry.registerRecipeFiller(BlockBanRecipe.class, AetherRecipeTypes.BLOCK_PLACEMENT_BAN.get(), recipe -> PlacementBanRecipeDisplay.ofBlock(recipe.value())); +// +// registry.registerRecipeFiller(AccessoryFreezableRecipe.class, AetherRecipeTypes.ACCESSORY_FREEZABLE.get(), recipe -> new BlockStateRecipeDisplay<>(AetherREIServerPlugin.ACCESSORY_FREEZABLE, recipe.value())); +// registry.registerRecipeFiller(AmbrosiumRecipe.class, AetherRecipeTypes.AMBROSIUM_ENCHANTING.get(), recipe -> new BlockStateRecipeDisplay<>(AetherREIServerPlugin.AMBROSIUM_ENCHANTING, recipe.value())); +// registry.registerRecipeFiller(IcestoneFreezableRecipe.class, AetherRecipeTypes.ICESTONE_FREEZABLE.get(), recipe -> new BlockStateRecipeDisplay<>(AetherREIServerPlugin.ICESTONE_FREEZABLE, recipe.value())); +// +// registry.registerRecipeFiller(PlacementConversionRecipe.class, AetherRecipeTypes.PLACEMENT_CONVERSION.get(), recipe -> new BlockStateRecipeDisplay<>(AetherREIServerPlugin.PLACEMENT_CONVERSION, recipe.value())); +// registry.registerRecipeFiller(SwetBallRecipe.class, AetherRecipeTypes.SWET_BALL_CONVERSION.get(), recipe -> new BlockStateRecipeDisplay<>(AetherREIServerPlugin.SWET_BALL_CONVERSION, recipe.value())); +// +// // Fuel +// for (var fuelRecipe : getFuelRecipes()) { +// registry.add(new FuelDisplay(AetherREIServerPlugin.AETHER_FUEL, fuelRecipe.inputItems(), fuelRecipe.burnTime(), fuelRecipe.usageBlock())); +// } +// +// for (var recipe : (List) registry.getRecipeManager().getAllRecipesFor(AetherRecipeTypes.ENCHANTING.get())) { +// if(recipe instanceof EnchantingRecipe enchanting){ +// registry.add(AetherCookingRecipeDisplay.of(AetherREIServerPlugin.ALTAR_ENCHANTING, enchanting)); +// } else if(recipe instanceof AltarRepairRecipe repair){ +// registry.add(AetherCookingRecipeDisplay.of(AetherREIServerPlugin.ALTAR_REPAIR, repair)); +// } +// } +// +// registry.registerFiller((o) -> o instanceof RecipeHolder> holder && holder.value() instanceof EnchantingRecipe, recipe -> AetherCookingRecipeDisplay.of(AetherREIServerPlugin.ALTAR_ENCHANTING, ((RecipeHolder) recipe).value())); +// registry.registerFiller((o) -> o instanceof RecipeHolder> holder && holder.value() instanceof AltarRepairRecipe, recipe -> AetherCookingRecipeDisplay.of(AetherREIServerPlugin.ALTAR_REPAIR, ((RecipeHolder) recipe).value())); +// registry.registerRecipeFiller(FreezingRecipe.class, AetherRecipeTypes.FREEZING.get(), recipe -> AetherCookingRecipeDisplay.of(AetherREIServerPlugin.FREEZING, recipe.value())); +// registry.registerRecipeFiller(IncubationRecipe.class, AetherRecipeTypes.INCUBATION.get(), recipe -> AetherCookingRecipeDisplay.of(AetherREIServerPlugin.INCUBATING, recipe.value())); +// } +// +// @Override +// public void registerCategories(CategoryRegistry registry) { +// registry.add(new BlockBanRecipeCategory()); +// registry.add(new ItemBanRecipeCategory()); +// +// registry.add(AetherBlockStateRecipeCategory.accessoryFreezable()); +// registry.add(AetherBlockStateRecipeCategory.ambrosium()); +// registry.add(AetherBlockStateRecipeCategory.icestoneFreezable()); +// +// registry.add(BiomeParameterRecipeCategory.placementConversion()); +// registry.add(BiomeParameterRecipeCategory.swetBall()); +// +// registry.add(new AbstractFuelCategory(AetherREIServerPlugin.AETHER_FUEL, LIT_PROGRESS_TRANSPARENT_TEXTURE, LIT_PROGRESS_BACKGROUND_TEXTURE) { +// @Override +// public Component getTitle() { +// return Component.translatable("gui." + Aether.MODID + ".jei.fuel"); +// } +// }); +// +// registry.add(AetherCookingRecipeCategory.altarRepair()); +// registry.add(AetherCookingRecipeCategory.altarEnchanting()); +// registry.add(AetherCookingRecipeCategory.freezing()); +// registry.add(AetherCookingRecipeCategory.incubating()); +// +// registry.addWorkstations(AetherREIServerPlugin.AETHER_FUEL, EntryStacks.of(AetherBlocks.FREEZER.get()), EntryStacks.of(AetherBlocks.ALTAR.get()), EntryStacks.of(AetherBlocks.INCUBATOR.get())); +// +// registry.addWorkstations(AetherREIServerPlugin.FREEZING, EntryStacks.of(AetherBlocks.FREEZER.get())); +// registry.addWorkstations(AetherREIServerPlugin.ALTAR_REPAIR, EntryStacks.of(AetherBlocks.ALTAR.get())); +// registry.addWorkstations(AetherREIServerPlugin.ALTAR_ENCHANTING, EntryStacks.of(AetherBlocks.ALTAR.get())); +// registry.addWorkstations(AetherREIServerPlugin.INCUBATING, EntryStacks.of(AetherBlocks.INCUBATOR.get())); +// } +// +// @Override +// public void registerTransferHandlers(TransferHandlerRegistry registry) { +// registry.register(SimpleTransferHandler.create(AltarMenu.class, AetherREIServerPlugin.ALTAR_ENCHANTING, new SimpleTransferHandler.IntRange(0, 1))); +// registry.register(SimpleTransferHandler.create(AltarMenu.class, AetherREIServerPlugin.ALTAR_REPAIR, new SimpleTransferHandler.IntRange(0, 1))); +// registry.register(SimpleTransferHandler.create(FreezerMenu.class, AetherREIServerPlugin.FREEZING, new SimpleTransferHandler.IntRange(0, 1))); +// registry.register(SimpleTransferHandler.create(IncubatorMenu.class, AetherREIServerPlugin.INCUBATING, new SimpleTransferHandler.IntRange(0, 1))); +// } +//} diff --git a/src/main/java/com/aetherteam/aether/integration/rei/AetherREIServerPlugin.java b/src/main/java/com/aetherteam/aether/integration/rei/AetherREIServerPlugin.java index 985abad8da..056f5861f0 100644 --- a/src/main/java/com/aetherteam/aether/integration/rei/AetherREIServerPlugin.java +++ b/src/main/java/com/aetherteam/aether/integration/rei/AetherREIServerPlugin.java @@ -1,47 +1,47 @@ package com.aetherteam.aether.integration.rei; -import com.aetherteam.aether.Aether; -import com.aetherteam.aether.integration.rei.categories.ban.PlacementBanRecipeDisplay; -import com.aetherteam.aether.integration.rei.categories.item.AetherCookingRecipeDisplay; -import com.aetherteam.aether.recipe.recipes.ban.BlockBanRecipe; -import com.aetherteam.aether.recipe.recipes.ban.ItemBanRecipe; -import com.aetherteam.aether.recipe.recipes.block.*; -import com.aetherteam.aether.recipe.recipes.item.AltarRepairRecipe; -import com.aetherteam.aether.recipe.recipes.item.EnchantingRecipe; -import com.aetherteam.aether.recipe.recipes.item.FreezingRecipe; -import com.aetherteam.aether.recipe.recipes.item.IncubationRecipe; -import com.aetherteam.nitrogen.integration.rei.displays.BlockStateRecipeDisplay; -import com.aetherteam.nitrogen.integration.rei.displays.FuelDisplay; -import me.shedaniel.rei.api.common.category.CategoryIdentifier; -import me.shedaniel.rei.api.common.display.DisplaySerializerRegistry; -import me.shedaniel.rei.api.common.plugins.REIServerPlugin; -import me.shedaniel.rei.forge.REIPluginCommon; -import net.minecraft.resources.ResourceLocation; - -@REIPluginCommon -public class AetherREIServerPlugin implements REIServerPlugin { - public static final CategoryIdentifier> BLOCK_PLACEMENT_BAN = CategoryIdentifier.of(new ResourceLocation(Aether.MODID, "block_placement_ban")); - public static final CategoryIdentifier> ITEM_PLACEMENT_BAN = CategoryIdentifier.of(new ResourceLocation(Aether.MODID, "item_placement_ban")); - - public static final CategoryIdentifier> ACCESSORY_FREEZABLE = CategoryIdentifier.of(new ResourceLocation(Aether.MODID, "accessory_freezable")); - public static final CategoryIdentifier> AMBROSIUM_ENCHANTING = CategoryIdentifier.of(new ResourceLocation(Aether.MODID, "ambrosium_enchanting")); - public static final CategoryIdentifier> ICESTONE_FREEZABLE = CategoryIdentifier.of(new ResourceLocation(Aether.MODID, "icestone_freezable")); - - public static final CategoryIdentifier> PLACEMENT_CONVERSION = CategoryIdentifier.of(new ResourceLocation(Aether.MODID, "placement_conversion")); - public static final CategoryIdentifier> SWET_BALL_CONVERSION = CategoryIdentifier.of(new ResourceLocation(Aether.MODID, "swet_ball_conversion")); - - public static final CategoryIdentifier AETHER_FUEL = CategoryIdentifier.of(new ResourceLocation(Aether.MODID, "fuel")); - - public static final CategoryIdentifier> ALTAR_REPAIR = CategoryIdentifier.of(new ResourceLocation(Aether.MODID, "repairing")); - public static final CategoryIdentifier> ALTAR_ENCHANTING = CategoryIdentifier.of(new ResourceLocation(Aether.MODID, "enchanting")); - public static final CategoryIdentifier> FREEZING = CategoryIdentifier.of(new ResourceLocation(Aether.MODID, "freezing")); - public static final CategoryIdentifier> INCUBATING = CategoryIdentifier.of(new ResourceLocation(Aether.MODID, "incubating")); - - @Override - public void registerDisplaySerializer(DisplaySerializerRegistry registry) { - registry.register(ALTAR_REPAIR, AetherCookingRecipeDisplay.serializer(ALTAR_REPAIR)); - registry.register(ALTAR_ENCHANTING, AetherCookingRecipeDisplay.serializer(ALTAR_ENCHANTING)); - registry.register(FREEZING, AetherCookingRecipeDisplay.serializer(FREEZING)); - registry.register(INCUBATING, AetherCookingRecipeDisplay.serializer(INCUBATING)); - } -} +//import com.aetherteam.aether.Aether; +//import com.aetherteam.aether.integration.rei.categories.ban.PlacementBanRecipeDisplay; +//import com.aetherteam.aether.integration.rei.categories.item.AetherCookingRecipeDisplay; +//import com.aetherteam.aether.recipe.recipes.ban.BlockBanRecipe; +//import com.aetherteam.aether.recipe.recipes.ban.ItemBanRecipe; +//import com.aetherteam.aether.recipe.recipes.block.*; +//import com.aetherteam.aether.recipe.recipes.item.AltarRepairRecipe; +//import com.aetherteam.aether.recipe.recipes.item.EnchantingRecipe; +//import com.aetherteam.aether.recipe.recipes.item.FreezingRecipe; +//import com.aetherteam.aether.recipe.recipes.item.IncubationRecipe; +//import com.aetherteam.nitrogen.integration.rei.displays.BlockStateRecipeDisplay; +//import com.aetherteam.nitrogen.integration.rei.displays.FuelDisplay; +//import me.shedaniel.rei.api.common.category.CategoryIdentifier; +//import me.shedaniel.rei.api.common.display.DisplaySerializerRegistry; +//import me.shedaniel.rei.api.common.plugins.REIServerPlugin; +//import me.shedaniel.rei.forge.REIPluginCommon; +//import net.minecraft.resources.ResourceLocation; +// +//@REIPluginCommon +//public class AetherREIServerPlugin implements REIServerPlugin { +// public static final CategoryIdentifier> BLOCK_PLACEMENT_BAN = CategoryIdentifier.of(new ResourceLocation(Aether.MODID, "block_placement_ban")); +// public static final CategoryIdentifier> ITEM_PLACEMENT_BAN = CategoryIdentifier.of(new ResourceLocation(Aether.MODID, "item_placement_ban")); +// +// public static final CategoryIdentifier> ACCESSORY_FREEZABLE = CategoryIdentifier.of(new ResourceLocation(Aether.MODID, "accessory_freezable")); +// public static final CategoryIdentifier> AMBROSIUM_ENCHANTING = CategoryIdentifier.of(new ResourceLocation(Aether.MODID, "ambrosium_enchanting")); +// public static final CategoryIdentifier> ICESTONE_FREEZABLE = CategoryIdentifier.of(new ResourceLocation(Aether.MODID, "icestone_freezable")); +// +// public static final CategoryIdentifier> PLACEMENT_CONVERSION = CategoryIdentifier.of(new ResourceLocation(Aether.MODID, "placement_conversion")); +// public static final CategoryIdentifier> SWET_BALL_CONVERSION = CategoryIdentifier.of(new ResourceLocation(Aether.MODID, "swet_ball_conversion")); +// +// public static final CategoryIdentifier AETHER_FUEL = CategoryIdentifier.of(new ResourceLocation(Aether.MODID, "fuel")); +// +// public static final CategoryIdentifier> ALTAR_REPAIR = CategoryIdentifier.of(new ResourceLocation(Aether.MODID, "repairing")); +// public static final CategoryIdentifier> ALTAR_ENCHANTING = CategoryIdentifier.of(new ResourceLocation(Aether.MODID, "enchanting")); +// public static final CategoryIdentifier> FREEZING = CategoryIdentifier.of(new ResourceLocation(Aether.MODID, "freezing")); +// public static final CategoryIdentifier> INCUBATING = CategoryIdentifier.of(new ResourceLocation(Aether.MODID, "incubating")); +// +// @Override +// public void registerDisplaySerializer(DisplaySerializerRegistry registry) { +// registry.register(ALTAR_REPAIR, AetherCookingRecipeDisplay.serializer(ALTAR_REPAIR)); +// registry.register(ALTAR_ENCHANTING, AetherCookingRecipeDisplay.serializer(ALTAR_ENCHANTING)); +// registry.register(FREEZING, AetherCookingRecipeDisplay.serializer(FREEZING)); +// registry.register(INCUBATING, AetherCookingRecipeDisplay.serializer(INCUBATING)); +// } +//} diff --git a/src/main/java/com/aetherteam/aether/integration/rei/FuelRecipe.java b/src/main/java/com/aetherteam/aether/integration/rei/FuelRecipe.java index feff6613b4..cafe785a1d 100644 --- a/src/main/java/com/aetherteam/aether/integration/rei/FuelRecipe.java +++ b/src/main/java/com/aetherteam/aether/integration/rei/FuelRecipe.java @@ -1,8 +1,8 @@ package com.aetherteam.aether.integration.rei; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.level.block.Block; - -import java.util.List; - -public record FuelRecipe(List inputItems, int burnTime, Block usageBlock) { } +//import net.minecraft.world.item.ItemStack; +//import net.minecraft.world.level.block.Block; +// +//import java.util.List; +// +//public record FuelRecipe(List inputItems, int burnTime, Block usageBlock) { } diff --git a/src/main/java/com/aetherteam/aether/integration/rei/categories/BiomeTooltip.java b/src/main/java/com/aetherteam/aether/integration/rei/categories/BiomeTooltip.java index 0327cdca82..396808489c 100644 --- a/src/main/java/com/aetherteam/aether/integration/rei/categories/BiomeTooltip.java +++ b/src/main/java/com/aetherteam/aether/integration/rei/categories/BiomeTooltip.java @@ -1,30 +1,30 @@ package com.aetherteam.aether.integration.rei.categories; -import me.shedaniel.rei.api.client.gui.widgets.Tooltip; -import net.minecraft.ChatFormatting; -import net.minecraft.client.Minecraft; -import net.minecraft.core.registries.Registries; -import net.minecraft.network.chat.Component; -import net.minecraft.resources.ResourceKey; -import net.minecraft.tags.TagKey; -import net.minecraft.world.level.biome.Biome; - -import java.util.Optional; - -public interface BiomeTooltip { - default void populateBiomeInformation(Optional> biomeKey, Optional> biomeTag, Tooltip tooltip) { - if (Minecraft.getInstance().level != null && (biomeKey.isPresent() || biomeTag.isPresent())) { - tooltip.add(Component.translatable("gui.aether.jei.biome.tooltip").withStyle(ChatFormatting.GRAY)); - if (biomeKey.isPresent()) { - tooltip.add(Component.translatable("gui.aether.jei.biome.tooltip.biome").withStyle(ChatFormatting.DARK_GRAY)); - tooltip.add(Component.literal(biomeKey.get().location().toString()).withStyle(ChatFormatting.DARK_GRAY)); - } else { - tooltip.add(Component.translatable("gui.aether.jei.biome.tooltip.tag").withStyle(ChatFormatting.DARK_GRAY)); - tooltip.add(Component.literal("#" + biomeTag.get().location()).withStyle(ChatFormatting.DARK_GRAY)); - - tooltip.add(Component.translatable("gui.aether.jei.biome.tooltip.biomes").withStyle(ChatFormatting.DARK_GRAY)); - Minecraft.getInstance().level.registryAccess().registryOrThrow(Registries.BIOME).getTagOrEmpty(biomeTag.get()).forEach((biomeHolder) -> biomeHolder.unwrapKey().ifPresent((key) -> tooltip.add(Component.literal(key.location().toString()).withStyle(ChatFormatting.DARK_GRAY)))); - } - } - } -} +//import me.shedaniel.rei.api.client.gui.widgets.Tooltip; +//import net.minecraft.ChatFormatting; +//import net.minecraft.client.Minecraft; +//import net.minecraft.core.registries.Registries; +//import net.minecraft.network.chat.Component; +//import net.minecraft.resources.ResourceKey; +//import net.minecraft.tags.TagKey; +//import net.minecraft.world.level.biome.Biome; +// +//import java.util.Optional; +// +//public interface BiomeTooltip { +// default void populateBiomeInformation(Optional> biomeKey, Optional> biomeTag, Tooltip tooltip) { +// if (Minecraft.getInstance().level != null && (biomeKey.isPresent() || biomeTag.isPresent())) { +// tooltip.add(Component.translatable("gui.aether.jei.biome.tooltip").withStyle(ChatFormatting.GRAY)); +// if (biomeKey.isPresent()) { +// tooltip.add(Component.translatable("gui.aether.jei.biome.tooltip.biome").withStyle(ChatFormatting.DARK_GRAY)); +// tooltip.add(Component.literal(biomeKey.get().location().toString()).withStyle(ChatFormatting.DARK_GRAY)); +// } else { +// tooltip.add(Component.translatable("gui.aether.jei.biome.tooltip.tag").withStyle(ChatFormatting.DARK_GRAY)); +// tooltip.add(Component.literal("#" + biomeTag.get().location()).withStyle(ChatFormatting.DARK_GRAY)); +// +// tooltip.add(Component.translatable("gui.aether.jei.biome.tooltip.biomes").withStyle(ChatFormatting.DARK_GRAY)); +// Minecraft.getInstance().level.registryAccess().registryOrThrow(Registries.BIOME).getTagOrEmpty(biomeTag.get()).forEach((biomeHolder) -> biomeHolder.unwrapKey().ifPresent((key) -> tooltip.add(Component.literal(key.location().toString()).withStyle(ChatFormatting.DARK_GRAY)))); +// } +// } +// } +//} diff --git a/src/main/java/com/aetherteam/aether/integration/rei/categories/ban/AbstractPlacementBanRecipeCategory.java b/src/main/java/com/aetherteam/aether/integration/rei/categories/ban/AbstractPlacementBanRecipeCategory.java index d81fd108ec..be4dca8791 100644 --- a/src/main/java/com/aetherteam/aether/integration/rei/categories/ban/AbstractPlacementBanRecipeCategory.java +++ b/src/main/java/com/aetherteam/aether/integration/rei/categories/ban/AbstractPlacementBanRecipeCategory.java @@ -1,63 +1,63 @@ package com.aetherteam.aether.integration.rei.categories.ban; -import com.aetherteam.aether.integration.rei.categories.BiomeTooltip; -import com.aetherteam.aether.recipe.recipes.ban.AbstractPlacementBanRecipe; -import com.aetherteam.nitrogen.integration.rei.REIClientUtils; -import com.aetherteam.nitrogen.integration.rei.categories.AbstractRecipeCategory; -import com.aetherteam.nitrogen.recipe.BlockStateIngredient; -import me.shedaniel.math.Point; -import me.shedaniel.math.Rectangle; -import me.shedaniel.rei.api.client.gui.Renderer; -import me.shedaniel.rei.api.client.gui.widgets.Slot; -import me.shedaniel.rei.api.client.gui.widgets.Tooltip; -import me.shedaniel.rei.api.client.gui.widgets.Widget; -import me.shedaniel.rei.api.client.gui.widgets.Widgets; -import me.shedaniel.rei.api.common.category.CategoryIdentifier; -import net.minecraft.client.Minecraft; -import net.minecraft.network.chat.Component; -import net.minecraft.network.chat.MutableComponent; - -import java.util.List; -import java.util.Optional; -import java.util.function.Predicate; - -public abstract class AbstractPlacementBanRecipeCategory, R extends AbstractPlacementBanRecipe> extends AbstractRecipeCategory> implements BiomeTooltip { - public AbstractPlacementBanRecipeCategory(String id, CategoryIdentifier> uid, Renderer icon) { - super(id, uid, 116, 18, icon); - } - - @Override - public Component getTitle() { - return Component.translatable("gui.aether.jei." + this.id); - } - - @Override - public List setupDisplay(PlacementBanRecipeDisplay display, Rectangle bounds) { - List widgets = super.setupDisplay(display, bounds); - Optional bypassBlock = display.getBypassBlock(); - - if (bypassBlock.isPresent() && !bypassBlock.get().isEmpty()) { - Point bypassPoint = startingOffset(bounds); - bypassPoint.translate(99, 1); - - Slot bypassSlot = Widgets.createSlot(bypassPoint).entries(REIClientUtils.setupRendering(display.getInputEntries().get(0), bypassBlock.get().getPairs(), (tooltip) -> this.populateTooltip(display, tooltip))); - widgets.add(bypassSlot); - - MutableComponent text = Component.translatable("gui.aether.jei.bypass"); - Point labelPoint = new Point(bounds.getCenterX(), bounds.getCenterY() - (Minecraft.getInstance().font.lineHeight / 2)); - widgets.add(Widgets.createLabel(labelPoint, text).color(0xFF808080, 0xFFBBBBBB)); - } - return widgets; - } - - @Override - public int getDisplayWidth(PlacementBanRecipeDisplay display) { - return super.getDisplayWidth(display); - } - - protected void populateTooltip(PlacementBanRecipeDisplay display, Tooltip tooltip) { - if (Minecraft.getInstance().level != null) { - this.populateBiomeInformation(display.getBiome().left(), display.getBiome().right(), tooltip); - } - } -} +//import com.aetherteam.aether.integration.rei.categories.BiomeTooltip; +//import com.aetherteam.aether.recipe.recipes.ban.AbstractPlacementBanRecipe; +//import com.aetherteam.nitrogen.integration.rei.REIClientUtils; +//import com.aetherteam.nitrogen.integration.rei.categories.AbstractRecipeCategory; +//import com.aetherteam.nitrogen.recipe.BlockStateIngredient; +//import me.shedaniel.math.Point; +//import me.shedaniel.math.Rectangle; +//import me.shedaniel.rei.api.client.gui.Renderer; +//import me.shedaniel.rei.api.client.gui.widgets.Slot; +//import me.shedaniel.rei.api.client.gui.widgets.Tooltip; +//import me.shedaniel.rei.api.client.gui.widgets.Widget; +//import me.shedaniel.rei.api.client.gui.widgets.Widgets; +//import me.shedaniel.rei.api.common.category.CategoryIdentifier; +//import net.minecraft.client.Minecraft; +//import net.minecraft.network.chat.Component; +//import net.minecraft.network.chat.MutableComponent; +// +//import java.util.List; +//import java.util.Optional; +//import java.util.function.Predicate; +// +//public abstract class AbstractPlacementBanRecipeCategory, R extends AbstractPlacementBanRecipe> extends AbstractRecipeCategory> implements BiomeTooltip { +// public AbstractPlacementBanRecipeCategory(String id, CategoryIdentifier> uid, Renderer icon) { +// super(id, uid, 116, 18, icon); +// } +// +// @Override +// public Component getTitle() { +// return Component.translatable("gui.aether.jei." + this.id); +// } +// +// @Override +// public List setupDisplay(PlacementBanRecipeDisplay display, Rectangle bounds) { +// List widgets = super.setupDisplay(display, bounds); +// Optional bypassBlock = display.getBypassBlock(); +// +// if (bypassBlock.isPresent() && !bypassBlock.get().isEmpty()) { +// Point bypassPoint = startingOffset(bounds); +// bypassPoint.translate(99, 1); +// +// Slot bypassSlot = Widgets.createSlot(bypassPoint).entries(REIClientUtils.setupRendering(display.getInputEntries().get(0), bypassBlock.get().getPairs(), (tooltip) -> this.populateTooltip(display, tooltip))); +// widgets.add(bypassSlot); +// +// MutableComponent text = Component.translatable("gui.aether.jei.bypass"); +// Point labelPoint = new Point(bounds.getCenterX(), bounds.getCenterY() - (Minecraft.getInstance().font.lineHeight / 2)); +// widgets.add(Widgets.createLabel(labelPoint, text).color(0xFF808080, 0xFFBBBBBB)); +// } +// return widgets; +// } +// +// @Override +// public int getDisplayWidth(PlacementBanRecipeDisplay display) { +// return super.getDisplayWidth(display); +// } +// +// protected void populateTooltip(PlacementBanRecipeDisplay display, Tooltip tooltip) { +// if (Minecraft.getInstance().level != null) { +// this.populateBiomeInformation(display.getBiome().left(), display.getBiome().right(), tooltip); +// } +// } +//} diff --git a/src/main/java/com/aetherteam/aether/integration/rei/categories/ban/BlockBanRecipeCategory.java b/src/main/java/com/aetherteam/aether/integration/rei/categories/ban/BlockBanRecipeCategory.java index edd0087db2..a919b92a22 100644 --- a/src/main/java/com/aetherteam/aether/integration/rei/categories/ban/BlockBanRecipeCategory.java +++ b/src/main/java/com/aetherteam/aether/integration/rei/categories/ban/BlockBanRecipeCategory.java @@ -1,42 +1,42 @@ package com.aetherteam.aether.integration.rei.categories.ban; -import com.aetherteam.aether.integration.rei.AetherREIServerPlugin; -import com.aetherteam.aether.recipe.recipes.ban.BlockBanRecipe; -import com.aetherteam.nitrogen.integration.rei.REIClientUtils; -import com.aetherteam.nitrogen.recipe.BlockStateIngredient; -import me.shedaniel.math.Point; -import me.shedaniel.math.Rectangle; -import me.shedaniel.rei.api.client.gui.widgets.Widget; -import me.shedaniel.rei.api.client.gui.widgets.Widgets; -import me.shedaniel.rei.api.common.entry.EntryStack; -import me.shedaniel.rei.api.common.entry.type.VanillaEntryTypes; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.level.block.Blocks; -import net.minecraft.world.level.block.state.BlockState; - -import java.util.List; - -public class BlockBanRecipeCategory extends AbstractPlacementBanRecipeCategory { - public BlockBanRecipeCategory() { - super("block_placement_ban", AetherREIServerPlugin.BLOCK_PLACEMENT_BAN, EntryStack.of(VanillaEntryTypes.ITEM, new ItemStack(Blocks.TORCH))); - } - - @Override - public List setupDisplay(PlacementBanRecipeDisplay display, Rectangle bounds) { - List widgets = super.setupDisplay(display, bounds); - - Point startingPoint; - if (display.getBypassBlock().isEmpty()) { - startingPoint = new Point(bounds.getCenterX() - 8, bounds.getCenterY() - 8); - } else { - startingPoint = startingOffset(bounds); - startingPoint.translate(1, 1); - } - - if (display.getBlockStateIngredient() != null) { - widgets.add(Widgets.createSlot(startingPoint).entries(REIClientUtils.setupRendering(display.getInputEntries().get(1), display.getBlockStateIngredient().getPairs(), (tooltip) -> this.populateTooltip(display, tooltip)))); - } - - return widgets; - } -} +//import com.aetherteam.aether.integration.rei.AetherREIServerPlugin; +//import com.aetherteam.aether.recipe.recipes.ban.BlockBanRecipe; +//import com.aetherteam.nitrogen.integration.rei.REIClientUtils; +//import com.aetherteam.nitrogen.recipe.BlockStateIngredient; +//import me.shedaniel.math.Point; +//import me.shedaniel.math.Rectangle; +//import me.shedaniel.rei.api.client.gui.widgets.Widget; +//import me.shedaniel.rei.api.client.gui.widgets.Widgets; +//import me.shedaniel.rei.api.common.entry.EntryStack; +//import me.shedaniel.rei.api.common.entry.type.VanillaEntryTypes; +//import net.minecraft.world.item.ItemStack; +//import net.minecraft.world.level.block.Blocks; +//import net.minecraft.world.level.block.state.BlockState; +// +//import java.util.List; +// +//public class BlockBanRecipeCategory extends AbstractPlacementBanRecipeCategory { +// public BlockBanRecipeCategory() { +// super("block_placement_ban", AetherREIServerPlugin.BLOCK_PLACEMENT_BAN, EntryStack.of(VanillaEntryTypes.ITEM, new ItemStack(Blocks.TORCH))); +// } +// +// @Override +// public List setupDisplay(PlacementBanRecipeDisplay display, Rectangle bounds) { +// List widgets = super.setupDisplay(display, bounds); +// +// Point startingPoint; +// if (display.getBypassBlock().isEmpty()) { +// startingPoint = new Point(bounds.getCenterX() - 8, bounds.getCenterY() - 8); +// } else { +// startingPoint = startingOffset(bounds); +// startingPoint.translate(1, 1); +// } +// +// if (display.getBlockStateIngredient() != null) { +// widgets.add(Widgets.createSlot(startingPoint).entries(REIClientUtils.setupRendering(display.getInputEntries().get(1), display.getBlockStateIngredient().getPairs(), (tooltip) -> this.populateTooltip(display, tooltip)))); +// } +// +// return widgets; +// } +//} diff --git a/src/main/java/com/aetherteam/aether/integration/rei/categories/ban/ItemBanRecipeCategory.java b/src/main/java/com/aetherteam/aether/integration/rei/categories/ban/ItemBanRecipeCategory.java index b45bffaae9..2950400a8a 100644 --- a/src/main/java/com/aetherteam/aether/integration/rei/categories/ban/ItemBanRecipeCategory.java +++ b/src/main/java/com/aetherteam/aether/integration/rei/categories/ban/ItemBanRecipeCategory.java @@ -1,39 +1,39 @@ package com.aetherteam.aether.integration.rei.categories.ban; -import com.aetherteam.aether.integration.rei.AetherREIServerPlugin; -import com.aetherteam.aether.recipe.recipes.ban.ItemBanRecipe; -import com.aetherteam.nitrogen.integration.rei.REIClientUtils; -import me.shedaniel.math.Point; -import me.shedaniel.math.Rectangle; -import me.shedaniel.rei.api.client.gui.widgets.Widget; -import me.shedaniel.rei.api.client.gui.widgets.Widgets; -import me.shedaniel.rei.api.common.entry.EntryStack; -import me.shedaniel.rei.api.common.entry.type.VanillaEntryTypes; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.item.Items; -import net.minecraft.world.item.crafting.Ingredient; - -import java.util.List; - -public class ItemBanRecipeCategory extends AbstractPlacementBanRecipeCategory { - public ItemBanRecipeCategory() { - super("item_placement_ban", AetherREIServerPlugin.ITEM_PLACEMENT_BAN, EntryStack.of(VanillaEntryTypes.ITEM, new ItemStack(Items.FLINT_AND_STEEL))); - } - - @Override - public List setupDisplay(PlacementBanRecipeDisplay display, Rectangle bounds) { - List widgets = super.setupDisplay(display, bounds); - - Point startingPoint; - if (display.getBypassBlock().isEmpty()) { - startingPoint = new Point(bounds.getCenterX() - 8, bounds.getCenterY() - 8); - } else { - startingPoint = startingOffset(bounds); - startingPoint.translate(1, 1); - } - - widgets.add(Widgets.createSlot(startingPoint).entries(REIClientUtils.setupRendering(display.getInputEntries().get(1), (tooltip) -> this.populateTooltip(display, tooltip)))); - - return widgets; - } -} +//import com.aetherteam.aether.integration.rei.AetherREIServerPlugin; +//import com.aetherteam.aether.recipe.recipes.ban.ItemBanRecipe; +//import com.aetherteam.nitrogen.integration.rei.REIClientUtils; +//import me.shedaniel.math.Point; +//import me.shedaniel.math.Rectangle; +//import me.shedaniel.rei.api.client.gui.widgets.Widget; +//import me.shedaniel.rei.api.client.gui.widgets.Widgets; +//import me.shedaniel.rei.api.common.entry.EntryStack; +//import me.shedaniel.rei.api.common.entry.type.VanillaEntryTypes; +//import net.minecraft.world.item.ItemStack; +//import net.minecraft.world.item.Items; +//import net.minecraft.world.item.crafting.Ingredient; +// +//import java.util.List; +// +//public class ItemBanRecipeCategory extends AbstractPlacementBanRecipeCategory { +// public ItemBanRecipeCategory() { +// super("item_placement_ban", AetherREIServerPlugin.ITEM_PLACEMENT_BAN, EntryStack.of(VanillaEntryTypes.ITEM, new ItemStack(Items.FLINT_AND_STEEL))); +// } +// +// @Override +// public List setupDisplay(PlacementBanRecipeDisplay display, Rectangle bounds) { +// List widgets = super.setupDisplay(display, bounds); +// +// Point startingPoint; +// if (display.getBypassBlock().isEmpty()) { +// startingPoint = new Point(bounds.getCenterX() - 8, bounds.getCenterY() - 8); +// } else { +// startingPoint = startingOffset(bounds); +// startingPoint.translate(1, 1); +// } +// +// widgets.add(Widgets.createSlot(startingPoint).entries(REIClientUtils.setupRendering(display.getInputEntries().get(1), (tooltip) -> this.populateTooltip(display, tooltip)))); +// +// return widgets; +// } +//} diff --git a/src/main/java/com/aetherteam/aether/integration/rei/categories/ban/PlacementBanRecipeDisplay.java b/src/main/java/com/aetherteam/aether/integration/rei/categories/ban/PlacementBanRecipeDisplay.java index 5a595a509a..a4180eb13c 100644 --- a/src/main/java/com/aetherteam/aether/integration/rei/categories/ban/PlacementBanRecipeDisplay.java +++ b/src/main/java/com/aetherteam/aether/integration/rei/categories/ban/PlacementBanRecipeDisplay.java @@ -1,80 +1,80 @@ package com.aetherteam.aether.integration.rei.categories.ban; -import com.aetherteam.aether.integration.rei.AetherREIServerPlugin; -import com.aetherteam.aether.recipe.recipes.ban.AbstractPlacementBanRecipe; -import com.aetherteam.aether.recipe.recipes.ban.BlockBanRecipe; -import com.aetherteam.aether.recipe.recipes.ban.ItemBanRecipe; -import com.aetherteam.nitrogen.integration.rei.REIUtils; -import com.aetherteam.nitrogen.recipe.BlockStateIngredient; -import com.mojang.datafixers.util.Either; -import me.shedaniel.rei.api.common.category.CategoryIdentifier; -import me.shedaniel.rei.api.common.display.basic.BasicDisplay; -import me.shedaniel.rei.api.common.entry.EntryIngredient; -import me.shedaniel.rei.api.common.util.EntryIngredients; -import net.minecraft.resources.ResourceKey; -import net.minecraft.resources.ResourceLocation; -import net.minecraft.tags.TagKey; -import net.minecraft.world.level.biome.Biome; - -import javax.annotation.Nullable; -import java.util.ArrayList; -import java.util.List; -import java.util.Optional; - -public class PlacementBanRecipeDisplay> extends BasicDisplay { - private final CategoryIdentifier categoryIdentifier; - - private final Either, TagKey> biome; - private final Optional bypassBlock; - private final Optional blockStateIngredient; - - protected PlacementBanRecipeDisplay(CategoryIdentifier> categoryIdentifier, List inputs, Either, TagKey> biome, Optional bypassBlock, Optional blockStateIngredient, Optional location) { - super(inputs, List.of(), location); - this.categoryIdentifier = categoryIdentifier; - this.biome = biome; - this.bypassBlock = bypassBlock; - this.blockStateIngredient = blockStateIngredient; - } - - protected PlacementBanRecipeDisplay(R recipe, CategoryIdentifier> categoryIdentifier, List inputs) { - this(categoryIdentifier, inputs, recipe.getBiome(), recipe.getBypassBlock(), Optional.ofNullable((recipe.getIngredient() instanceof BlockStateIngredient ingredient) ? ingredient : null), Optional.empty()); - } - - public static PlacementBanRecipeDisplay ofItem(ItemBanRecipe recipe){ - List list = new ArrayList<>(); - if (recipe.getBypassBlock().isPresent()) { - list.addAll(REIUtils.toIngredientList(recipe.getBypassBlock().get().getPairs())); - } - list.add(EntryIngredients.ofIngredient(recipe.getIngredient())); - - return new PlacementBanRecipeDisplay<>(recipe, AetherREIServerPlugin.ITEM_PLACEMENT_BAN, list); - } - - public static PlacementBanRecipeDisplay ofBlock(BlockBanRecipe recipe) { - List list = new ArrayList<>(); - if (recipe.getBypassBlock().isPresent()) { - list.addAll(REIUtils.toIngredientList(recipe.getBypassBlock().get().getPairs())); - } - list.addAll(REIUtils.toIngredientList(recipe.getIngredient().getPairs())); - - return new PlacementBanRecipeDisplay<>(recipe, AetherREIServerPlugin.BLOCK_PLACEMENT_BAN, list); - } - - @Override - public CategoryIdentifier getCategoryIdentifier() { - return this.categoryIdentifier; - } - - public Either, TagKey> getBiome() { - return this.biome; - } - - public Optional getBypassBlock() { - return this.bypassBlock; - } - - @Nullable - public BlockStateIngredient getBlockStateIngredient() { - return this.blockStateIngredient.orElse(null); - } -} +//import com.aetherteam.aether.integration.rei.AetherREIServerPlugin; +//import com.aetherteam.aether.recipe.recipes.ban.AbstractPlacementBanRecipe; +//import com.aetherteam.aether.recipe.recipes.ban.BlockBanRecipe; +//import com.aetherteam.aether.recipe.recipes.ban.ItemBanRecipe; +//import com.aetherteam.nitrogen.integration.rei.REIUtils; +//import com.aetherteam.nitrogen.recipe.BlockStateIngredient; +//import com.mojang.datafixers.util.Either; +//import me.shedaniel.rei.api.common.category.CategoryIdentifier; +//import me.shedaniel.rei.api.common.display.basic.BasicDisplay; +//import me.shedaniel.rei.api.common.entry.EntryIngredient; +//import me.shedaniel.rei.api.common.util.EntryIngredients; +//import net.minecraft.resources.ResourceKey; +//import net.minecraft.resources.ResourceLocation; +//import net.minecraft.tags.TagKey; +//import net.minecraft.world.level.biome.Biome; +// +//import javax.annotation.Nullable; +//import java.util.ArrayList; +//import java.util.List; +//import java.util.Optional; +// +//public class PlacementBanRecipeDisplay> extends BasicDisplay { +// private final CategoryIdentifier categoryIdentifier; +// +// private final Either, TagKey> biome; +// private final Optional bypassBlock; +// private final Optional blockStateIngredient; +// +// protected PlacementBanRecipeDisplay(CategoryIdentifier> categoryIdentifier, List inputs, Either, TagKey> biome, Optional bypassBlock, Optional blockStateIngredient, Optional location) { +// super(inputs, List.of(), location); +// this.categoryIdentifier = categoryIdentifier; +// this.biome = biome; +// this.bypassBlock = bypassBlock; +// this.blockStateIngredient = blockStateIngredient; +// } +// +// protected PlacementBanRecipeDisplay(R recipe, CategoryIdentifier> categoryIdentifier, List inputs) { +// this(categoryIdentifier, inputs, recipe.getBiome(), recipe.getBypassBlock(), Optional.ofNullable((recipe.getIngredient() instanceof BlockStateIngredient ingredient) ? ingredient : null), Optional.empty()); +// } +// +// public static PlacementBanRecipeDisplay ofItem(ItemBanRecipe recipe){ +// List list = new ArrayList<>(); +// if (recipe.getBypassBlock().isPresent()) { +// list.addAll(REIUtils.toIngredientList(recipe.getBypassBlock().get().getPairs())); +// } +// list.add(EntryIngredients.ofIngredient(recipe.getIngredient())); +// +// return new PlacementBanRecipeDisplay<>(recipe, AetherREIServerPlugin.ITEM_PLACEMENT_BAN, list); +// } +// +// public static PlacementBanRecipeDisplay ofBlock(BlockBanRecipe recipe) { +// List list = new ArrayList<>(); +// if (recipe.getBypassBlock().isPresent()) { +// list.addAll(REIUtils.toIngredientList(recipe.getBypassBlock().get().getPairs())); +// } +// list.addAll(REIUtils.toIngredientList(recipe.getIngredient().getPairs())); +// +// return new PlacementBanRecipeDisplay<>(recipe, AetherREIServerPlugin.BLOCK_PLACEMENT_BAN, list); +// } +// +// @Override +// public CategoryIdentifier getCategoryIdentifier() { +// return this.categoryIdentifier; +// } +// +// public Either, TagKey> getBiome() { +// return this.biome; +// } +// +// public Optional getBypassBlock() { +// return this.bypassBlock; +// } +// +// @Nullable +// public BlockStateIngredient getBlockStateIngredient() { +// return this.blockStateIngredient.orElse(null); +// } +//} diff --git a/src/main/java/com/aetherteam/aether/integration/rei/categories/block/AetherBlockStateRecipeCategory.java b/src/main/java/com/aetherteam/aether/integration/rei/categories/block/AetherBlockStateRecipeCategory.java index 8f48faa79a..dc32516744 100644 --- a/src/main/java/com/aetherteam/aether/integration/rei/categories/block/AetherBlockStateRecipeCategory.java +++ b/src/main/java/com/aetherteam/aether/integration/rei/categories/block/AetherBlockStateRecipeCategory.java @@ -1,38 +1,38 @@ package com.aetherteam.aether.integration.rei.categories.block; -import com.aetherteam.aether.block.AetherBlocks; -import com.aetherteam.aether.integration.rei.AetherREIServerPlugin; -import com.aetherteam.aether.item.AetherItems; -import com.aetherteam.aether.recipe.recipes.block.AccessoryFreezableRecipe; -import com.aetherteam.aether.recipe.recipes.block.AmbrosiumRecipe; -import com.aetherteam.aether.recipe.recipes.block.IcestoneFreezableRecipe; -import com.aetherteam.nitrogen.integration.rei.categories.block.AbstractBlockStateRecipeCategory; -import com.aetherteam.nitrogen.integration.rei.displays.BlockStateRecipeDisplay; -import com.aetherteam.nitrogen.recipe.recipes.AbstractBlockStateRecipe; -import me.shedaniel.rei.api.client.gui.Renderer; -import me.shedaniel.rei.api.common.category.CategoryIdentifier; -import me.shedaniel.rei.api.common.util.EntryStacks; -import net.minecraft.network.chat.Component; - -public class AetherBlockStateRecipeCategory extends AbstractBlockStateRecipeCategory { - protected AetherBlockStateRecipeCategory(String id, CategoryIdentifier> uid, int width, int height, Renderer icon) { - super(id, uid, width, height, icon); - } - - @Override - public Component getTitle() { - return Component.translatable("gui.aether.jei." + this.id); - } - - public static AetherBlockStateRecipeCategory accessoryFreezable() { - return new AetherBlockStateRecipeCategory<>("accessory_freezable", AetherREIServerPlugin.ACCESSORY_FREEZABLE,84, 28, EntryStacks.of(AetherItems.ICE_RING.get())); - } - - public static AetherBlockStateRecipeCategory icestoneFreezable() { - return new AetherBlockStateRecipeCategory<>("icestone_freezable", AetherREIServerPlugin.ICESTONE_FREEZABLE,84, 28, EntryStacks.of(AetherBlocks.ICESTONE.get())); - } - - public static AetherBlockStateRecipeCategory ambrosium() { - return new AetherBlockStateRecipeCategory<>("ambrosium_enchanting", AetherREIServerPlugin.AMBROSIUM_ENCHANTING,84, 28, EntryStacks.of(AetherItems.AMBROSIUM_SHARD.get())); - } -} +//import com.aetherteam.aether.block.AetherBlocks; +//import com.aetherteam.aether.integration.rei.AetherREIServerPlugin; +//import com.aetherteam.aether.item.AetherItems; +//import com.aetherteam.aether.recipe.recipes.block.AccessoryFreezableRecipe; +//import com.aetherteam.aether.recipe.recipes.block.AmbrosiumRecipe; +//import com.aetherteam.aether.recipe.recipes.block.IcestoneFreezableRecipe; +//import com.aetherteam.nitrogen.integration.rei.categories.block.AbstractBlockStateRecipeCategory; +//import com.aetherteam.nitrogen.integration.rei.displays.BlockStateRecipeDisplay; +//import com.aetherteam.nitrogen.recipe.recipes.AbstractBlockStateRecipe; +//import me.shedaniel.rei.api.client.gui.Renderer; +//import me.shedaniel.rei.api.common.category.CategoryIdentifier; +//import me.shedaniel.rei.api.common.util.EntryStacks; +//import net.minecraft.network.chat.Component; +// +//public class AetherBlockStateRecipeCategory extends AbstractBlockStateRecipeCategory { +// protected AetherBlockStateRecipeCategory(String id, CategoryIdentifier> uid, int width, int height, Renderer icon) { +// super(id, uid, width, height, icon); +// } +// +// @Override +// public Component getTitle() { +// return Component.translatable("gui.aether.jei." + this.id); +// } +// +// public static AetherBlockStateRecipeCategory accessoryFreezable() { +// return new AetherBlockStateRecipeCategory<>("accessory_freezable", AetherREIServerPlugin.ACCESSORY_FREEZABLE,84, 28, EntryStacks.of(AetherItems.ICE_RING.get())); +// } +// +// public static AetherBlockStateRecipeCategory icestoneFreezable() { +// return new AetherBlockStateRecipeCategory<>("icestone_freezable", AetherREIServerPlugin.ICESTONE_FREEZABLE,84, 28, EntryStacks.of(AetherBlocks.ICESTONE.get())); +// } +// +// public static AetherBlockStateRecipeCategory ambrosium() { +// return new AetherBlockStateRecipeCategory<>("ambrosium_enchanting", AetherREIServerPlugin.AMBROSIUM_ENCHANTING,84, 28, EntryStacks.of(AetherItems.AMBROSIUM_SHARD.get())); +// } +//} diff --git a/src/main/java/com/aetherteam/aether/integration/rei/categories/block/BiomeParameterRecipeCategory.java b/src/main/java/com/aetherteam/aether/integration/rei/categories/block/BiomeParameterRecipeCategory.java index c975d88136..319cbd8306 100644 --- a/src/main/java/com/aetherteam/aether/integration/rei/categories/block/BiomeParameterRecipeCategory.java +++ b/src/main/java/com/aetherteam/aether/integration/rei/categories/block/BiomeParameterRecipeCategory.java @@ -1,34 +1,34 @@ package com.aetherteam.aether.integration.rei.categories.block; -import com.aetherteam.aether.integration.rei.AetherREIServerPlugin; -import com.aetherteam.aether.integration.rei.categories.BiomeTooltip; -import com.aetherteam.aether.item.AetherItems; -import com.aetherteam.aether.recipe.recipes.block.AbstractBiomeParameterRecipe; -import com.aetherteam.aether.recipe.recipes.block.PlacementConversionRecipe; -import com.aetherteam.aether.recipe.recipes.block.SwetBallRecipe; -import com.aetherteam.nitrogen.integration.rei.displays.BlockStateRecipeDisplay; -import me.shedaniel.rei.api.client.gui.Renderer; -import me.shedaniel.rei.api.client.gui.widgets.Tooltip; -import me.shedaniel.rei.api.common.category.CategoryIdentifier; -import me.shedaniel.rei.api.common.util.EntryStacks; - -public class BiomeParameterRecipeCategory extends AetherBlockStateRecipeCategory implements BiomeTooltip { - protected BiomeParameterRecipeCategory(String id, CategoryIdentifier> uid, int width, int height, Renderer icon) { - super(id, uid, width, height, icon); - } - - @Override - protected void populateTooltip(BlockStateRecipeDisplay display, Tooltip tooltip) { - if (display.getRecipe().getBiome().isPresent()) { - this.populateBiomeInformation(display.getRecipe().getBiome().get().left(), display.getRecipe().getBiome().get().right(), tooltip); - } - } - - public static BiomeParameterRecipeCategory placementConversion() { - return new BiomeParameterRecipeCategory<>("placement_conversion", AetherREIServerPlugin.PLACEMENT_CONVERSION, 84, 28, EntryStacks.of(AetherItems.AETHER_PORTAL_FRAME.get())); - } - - public static BiomeParameterRecipeCategory swetBall() { - return new BiomeParameterRecipeCategory<>("swet_ball_conversion", AetherREIServerPlugin.SWET_BALL_CONVERSION, 84, 28, EntryStacks.of(AetherItems.SWET_BALL.get())); - } -} +//import com.aetherteam.aether.integration.rei.AetherREIServerPlugin; +//import com.aetherteam.aether.integration.rei.categories.BiomeTooltip; +//import com.aetherteam.aether.item.AetherItems; +//import com.aetherteam.aether.recipe.recipes.block.AbstractBiomeParameterRecipe; +//import com.aetherteam.aether.recipe.recipes.block.PlacementConversionRecipe; +//import com.aetherteam.aether.recipe.recipes.block.SwetBallRecipe; +//import com.aetherteam.nitrogen.integration.rei.displays.BlockStateRecipeDisplay; +//import me.shedaniel.rei.api.client.gui.Renderer; +//import me.shedaniel.rei.api.client.gui.widgets.Tooltip; +//import me.shedaniel.rei.api.common.category.CategoryIdentifier; +//import me.shedaniel.rei.api.common.util.EntryStacks; +// +//public class BiomeParameterRecipeCategory extends AetherBlockStateRecipeCategory implements BiomeTooltip { +// protected BiomeParameterRecipeCategory(String id, CategoryIdentifier> uid, int width, int height, Renderer icon) { +// super(id, uid, width, height, icon); +// } +// +// @Override +// protected void populateTooltip(BlockStateRecipeDisplay display, Tooltip tooltip) { +// if (display.getRecipe().getBiome().isPresent()) { +// this.populateBiomeInformation(display.getRecipe().getBiome().get().left(), display.getRecipe().getBiome().get().right(), tooltip); +// } +// } +// +// public static BiomeParameterRecipeCategory placementConversion() { +// return new BiomeParameterRecipeCategory<>("placement_conversion", AetherREIServerPlugin.PLACEMENT_CONVERSION, 84, 28, EntryStacks.of(AetherItems.AETHER_PORTAL_FRAME.get())); +// } +// +// public static BiomeParameterRecipeCategory swetBall() { +// return new BiomeParameterRecipeCategory<>("swet_ball_conversion", AetherREIServerPlugin.SWET_BALL_CONVERSION, 84, 28, EntryStacks.of(AetherItems.SWET_BALL.get())); +// } +//} diff --git a/src/main/java/com/aetherteam/aether/integration/rei/categories/item/AetherCookingRecipeCategory.java b/src/main/java/com/aetherteam/aether/integration/rei/categories/item/AetherCookingRecipeCategory.java index 6c2795d2fb..8b80598266 100644 --- a/src/main/java/com/aetherteam/aether/integration/rei/categories/item/AetherCookingRecipeCategory.java +++ b/src/main/java/com/aetherteam/aether/integration/rei/categories/item/AetherCookingRecipeCategory.java @@ -1,172 +1,172 @@ package com.aetherteam.aether.integration.rei.categories.item; -import com.aetherteam.aether.Aether; -import com.aetherteam.aether.block.AetherBlocks; -import com.aetherteam.aether.integration.rei.AetherREIServerPlugin; -import com.aetherteam.aether.recipe.recipes.item.AltarRepairRecipe; -import com.aetherteam.aether.recipe.recipes.item.EnchantingRecipe; -import com.aetherteam.aether.recipe.recipes.item.FreezingRecipe; -import com.aetherteam.aether.recipe.recipes.item.IncubationRecipe; -import com.aetherteam.nitrogen.integration.rei.categories.AbstractRecipeCategory; -import me.shedaniel.math.Point; -import me.shedaniel.math.Rectangle; -import me.shedaniel.rei.api.client.REIRuntime; -import me.shedaniel.rei.api.client.gui.Renderer; -import me.shedaniel.rei.api.client.gui.widgets.Widget; -import me.shedaniel.rei.api.client.gui.widgets.WidgetWithBounds; -import me.shedaniel.rei.api.client.gui.widgets.Widgets; -import me.shedaniel.rei.api.common.category.CategoryIdentifier; -import me.shedaniel.rei.api.common.entry.EntryIngredient; -import me.shedaniel.rei.api.common.util.EntryStacks; -import net.minecraft.client.Minecraft; -import net.minecraft.network.chat.Component; -import net.minecraft.resources.ResourceLocation; -import net.minecraft.world.item.crafting.Recipe; -import org.apache.commons.lang3.mutable.MutableDouble; - -import java.text.DecimalFormat; -import java.util.List; -import java.util.function.Supplier; - -public class AetherCookingRecipeCategory> extends AbstractRecipeCategory> { - private static final ResourceLocation LIT_PROGRESS_TEXTURE = new ResourceLocation(Aether.MODID, "menu/lit_progress"); - private static final ResourceLocation BURN_PROGRESS_TEXTURE = new ResourceLocation(Aether.MODID, "menu/burn_progress"); - private static final ResourceLocation INCUBATION_PROGRESS_TEXTURE = new ResourceLocation(Aether.MODID, "menu/incubation_progress"); - private static final ResourceLocation INCUBATION_PROGRESS_BACKGROUND_TEXTURE = new ResourceLocation(Aether.MODID, "menu/incubation_progress_background"); - - protected final Supplier fuelIndicator; - protected final Supplier animatedProgressArrow; - - public AetherCookingRecipeCategory(String id, CategoryIdentifier> categoryIdentifier, int width, int height, Renderer icon, ResourceLocation litTexture, ResourceLocation progressTexture) { - this(id, categoryIdentifier, width, height, icon, litTexture, () -> animatedArrow(progressTexture, 100)); - } - - public AetherCookingRecipeCategory(String id, CategoryIdentifier> categoryIdentifier, int width, int height, Renderer icon, ResourceLocation litTexture, Supplier progressWidget) { - super(id, categoryIdentifier, width, height, icon); - - this.fuelIndicator = () -> fuelIndicator(litTexture); - this.animatedProgressArrow = progressWidget; - } - - public static AetherCookingRecipeCategory altarRepair() { - return new AetherCookingRecipeCategory<>("altar.repairing", AetherREIServerPlugin.ALTAR_REPAIR, 140, 39, EntryStacks.of(AetherBlocks.ALTAR.get()), LIT_PROGRESS_TEXTURE, BURN_PROGRESS_TEXTURE); - } - - public static AetherCookingRecipeCategory altarEnchanting() { - return new AetherCookingRecipeCategory<>("altar.enchanting", AetherREIServerPlugin.ALTAR_ENCHANTING, 140, 39, EntryStacks.of(AetherBlocks.ALTAR.get()), LIT_PROGRESS_TEXTURE, BURN_PROGRESS_TEXTURE); - } - - public static AetherCookingRecipeCategory freezing() { - return new AetherCookingRecipeCategory<>("freezing", AetherREIServerPlugin.FREEZING, 140, 39, EntryStacks.of(AetherBlocks.FREEZER.get()), LIT_PROGRESS_TEXTURE, BURN_PROGRESS_TEXTURE); - } - - public static AetherCookingRecipeCategory incubating() { - return new AetherCookingRecipeCategory<>("incubating", AetherREIServerPlugin.INCUBATING, 88, 54, EntryStacks.of(AetherBlocks.INCUBATOR.get()), LIT_PROGRESS_TEXTURE, () -> { - MutableDouble lastTick = new MutableDouble(0); - - Rectangle widgetBound = new Rectangle(8, -13, 10, 54); - - return Widgets.wrapRenderer(widgetBound, (graphics, bound, mouseX, mouseY, delta) -> { - lastTick.getAndAdd(delta); - - if (lastTick.getValue() > 5700) { - lastTick.setValue(0); - } - - int textureLength = 54; - int scissorOffset = (int) Math.round(textureLength * (lastTick.getValue() / 5700)); - - graphics.blitSprite(INCUBATION_PROGRESS_BACKGROUND_TEXTURE, bound.x, bound.y, 10, 54); - graphics.enableScissor(bound.x + 1, bound.y + textureLength - scissorOffset, bound.x + 10 + 1, bound.y + (textureLength * 2) - scissorOffset); - graphics.blitSprite(INCUBATION_PROGRESS_TEXTURE, bound.x + 1, bound.y, 10, 54); - graphics.disableScissor(); - }); - }); - } - - private static WidgetWithBounds fuelIndicator(ResourceLocation texture) { - return Widgets.wrapRenderer(new Rectangle(14, 13), (graphics, bounds, mouseX, mouseY, delta) -> graphics.blitSprite(texture, bounds.x, bounds.y, 14, 13)); - } - - private static WidgetWithBounds animatedArrow(ResourceLocation texture, int burnTime) { - var lastTick = new MutableDouble(0); - - return Widgets.wrapRenderer(new Rectangle(23, 16), (graphics, bound, mouseX, mouseY, delta) -> { - lastTick.getAndAdd(delta); - - if (lastTick.getValue() > burnTime) { - lastTick.setValue(0); - } - - int xOffset = 23 - (int) Math.round(23 * (lastTick.getValue() / burnTime)); - - ResourceLocation blankArrow = REIRuntime.getInstance().getDefaultDisplayTexture(false); - graphics.blit(blankArrow, bound.x, bound.y, 106, 91, 24, 17); - - graphics.enableScissor(bound.x - xOffset, bound.y, bound.x + 23 - xOffset, bound.y + 16); - graphics.blitSprite(texture, bound.x, bound.y, 24, 16); - graphics.disableScissor(); - }); - } - - @Override - public List setupDisplay(AetherCookingRecipeDisplay display, Rectangle bounds) { - List widgets = super.setupDisplay(display, bounds); - Point startPoint = new Point(bounds.getCenterX() - 41, bounds.y + 10); - - DecimalFormat df = new DecimalFormat("###.##"); - - float experience = display.getExperience(); - int cookingTime = display.getCookingTime(); - - Component cookInfo; - if (experience > 0) { - cookInfo = Component.translatable("category.rei.cooking.time&xp", df.format(experience), df.format(cookingTime / 20d)); - } else { - cookInfo = Component.translatable("category.rei.campfire.time", df.format(cookingTime / 20d)); - } - - Point labelPoint = new Point(bounds.x + bounds.width - 5, bounds.y + 5); - - if (display.isIncubation()) { - labelPoint.move(labelPoint.x, bounds.getCenterY() - Minecraft.getInstance().font.lineHeight / 2); - } - - widgets.add(Widgets.createLabel(labelPoint, cookInfo).noShadow().rightAligned().color(0xFF404040, 0xFFBBBBBB)); - - Point arrowPoint = new Point(startPoint.x + 24, startPoint.y + 8); - - WidgetWithBounds arrowWidget = this.animatedProgressArrow.get(); - arrowWidget.getBounds().translate(arrowPoint.x, arrowPoint.y); - widgets.add(arrowWidget); - - if (display.isIncubation()) { - startPoint.translate(6, 5); - } - - WidgetWithBounds fuelWidget = this.fuelIndicator.get(); - fuelWidget.getBounds().move(startPoint.x + 2, startPoint.y + 20); - widgets.add(fuelWidget); - - widgets.add(Widgets.createSlot(new Point(startPoint.x + 1, startPoint.y + 1)) - .entries(display.getInputEntries().get(0)) - .markInput()); - - List outputEntries = display.getOutputEntries(); - - if (outputEntries.size() > 0) { - widgets.add(Widgets.createResultSlotBackground(new Point(startPoint.x + 61, startPoint.y + 9))); - widgets.add(Widgets.createSlot(new Point(startPoint.x + 61, startPoint.y + 9)) - .entries(outputEntries.get(0)) - .disableBackground() - .markOutput()); - } - - return widgets; - } - - @Override - public Component getTitle() { - return Component.translatable("gui.aether.jei." + this.id); - } -} +//import com.aetherteam.aether.Aether; +//import com.aetherteam.aether.block.AetherBlocks; +//import com.aetherteam.aether.integration.rei.AetherREIServerPlugin; +//import com.aetherteam.aether.recipe.recipes.item.AltarRepairRecipe; +//import com.aetherteam.aether.recipe.recipes.item.EnchantingRecipe; +//import com.aetherteam.aether.recipe.recipes.item.FreezingRecipe; +//import com.aetherteam.aether.recipe.recipes.item.IncubationRecipe; +//import com.aetherteam.nitrogen.integration.rei.categories.AbstractRecipeCategory; +//import me.shedaniel.math.Point; +//import me.shedaniel.math.Rectangle; +//import me.shedaniel.rei.api.client.REIRuntime; +//import me.shedaniel.rei.api.client.gui.Renderer; +//import me.shedaniel.rei.api.client.gui.widgets.Widget; +//import me.shedaniel.rei.api.client.gui.widgets.WidgetWithBounds; +//import me.shedaniel.rei.api.client.gui.widgets.Widgets; +//import me.shedaniel.rei.api.common.category.CategoryIdentifier; +//import me.shedaniel.rei.api.common.entry.EntryIngredient; +//import me.shedaniel.rei.api.common.util.EntryStacks; +//import net.minecraft.client.Minecraft; +//import net.minecraft.network.chat.Component; +//import net.minecraft.resources.ResourceLocation; +//import net.minecraft.world.item.crafting.Recipe; +//import org.apache.commons.lang3.mutable.MutableDouble; +// +//import java.text.DecimalFormat; +//import java.util.List; +//import java.util.function.Supplier; +// +//public class AetherCookingRecipeCategory> extends AbstractRecipeCategory> { +// private static final ResourceLocation LIT_PROGRESS_TEXTURE = new ResourceLocation(Aether.MODID, "menu/lit_progress"); +// private static final ResourceLocation BURN_PROGRESS_TEXTURE = new ResourceLocation(Aether.MODID, "menu/burn_progress"); +// private static final ResourceLocation INCUBATION_PROGRESS_TEXTURE = new ResourceLocation(Aether.MODID, "menu/incubation_progress"); +// private static final ResourceLocation INCUBATION_PROGRESS_BACKGROUND_TEXTURE = new ResourceLocation(Aether.MODID, "menu/incubation_progress_background"); +// +// protected final Supplier fuelIndicator; +// protected final Supplier animatedProgressArrow; +// +// public AetherCookingRecipeCategory(String id, CategoryIdentifier> categoryIdentifier, int width, int height, Renderer icon, ResourceLocation litTexture, ResourceLocation progressTexture) { +// this(id, categoryIdentifier, width, height, icon, litTexture, () -> animatedArrow(progressTexture, 100)); +// } +// +// public AetherCookingRecipeCategory(String id, CategoryIdentifier> categoryIdentifier, int width, int height, Renderer icon, ResourceLocation litTexture, Supplier progressWidget) { +// super(id, categoryIdentifier, width, height, icon); +// +// this.fuelIndicator = () -> fuelIndicator(litTexture); +// this.animatedProgressArrow = progressWidget; +// } +// +// public static AetherCookingRecipeCategory altarRepair() { +// return new AetherCookingRecipeCategory<>("altar.repairing", AetherREIServerPlugin.ALTAR_REPAIR, 140, 39, EntryStacks.of(AetherBlocks.ALTAR.get()), LIT_PROGRESS_TEXTURE, BURN_PROGRESS_TEXTURE); +// } +// +// public static AetherCookingRecipeCategory altarEnchanting() { +// return new AetherCookingRecipeCategory<>("altar.enchanting", AetherREIServerPlugin.ALTAR_ENCHANTING, 140, 39, EntryStacks.of(AetherBlocks.ALTAR.get()), LIT_PROGRESS_TEXTURE, BURN_PROGRESS_TEXTURE); +// } +// +// public static AetherCookingRecipeCategory freezing() { +// return new AetherCookingRecipeCategory<>("freezing", AetherREIServerPlugin.FREEZING, 140, 39, EntryStacks.of(AetherBlocks.FREEZER.get()), LIT_PROGRESS_TEXTURE, BURN_PROGRESS_TEXTURE); +// } +// +// public static AetherCookingRecipeCategory incubating() { +// return new AetherCookingRecipeCategory<>("incubating", AetherREIServerPlugin.INCUBATING, 88, 54, EntryStacks.of(AetherBlocks.INCUBATOR.get()), LIT_PROGRESS_TEXTURE, () -> { +// MutableDouble lastTick = new MutableDouble(0); +// +// Rectangle widgetBound = new Rectangle(8, -13, 10, 54); +// +// return Widgets.wrapRenderer(widgetBound, (graphics, bound, mouseX, mouseY, delta) -> { +// lastTick.getAndAdd(delta); +// +// if (lastTick.getValue() > 5700) { +// lastTick.setValue(0); +// } +// +// int textureLength = 54; +// int scissorOffset = (int) Math.round(textureLength * (lastTick.getValue() / 5700)); +// +// graphics.blitSprite(INCUBATION_PROGRESS_BACKGROUND_TEXTURE, bound.x, bound.y, 10, 54); +// graphics.enableScissor(bound.x + 1, bound.y + textureLength - scissorOffset, bound.x + 10 + 1, bound.y + (textureLength * 2) - scissorOffset); +// graphics.blitSprite(INCUBATION_PROGRESS_TEXTURE, bound.x + 1, bound.y, 10, 54); +// graphics.disableScissor(); +// }); +// }); +// } +// +// private static WidgetWithBounds fuelIndicator(ResourceLocation texture) { +// return Widgets.wrapRenderer(new Rectangle(14, 13), (graphics, bounds, mouseX, mouseY, delta) -> graphics.blitSprite(texture, bounds.x, bounds.y, 14, 13)); +// } +// +// private static WidgetWithBounds animatedArrow(ResourceLocation texture, int burnTime) { +// var lastTick = new MutableDouble(0); +// +// return Widgets.wrapRenderer(new Rectangle(23, 16), (graphics, bound, mouseX, mouseY, delta) -> { +// lastTick.getAndAdd(delta); +// +// if (lastTick.getValue() > burnTime) { +// lastTick.setValue(0); +// } +// +// int xOffset = 23 - (int) Math.round(23 * (lastTick.getValue() / burnTime)); +// +// ResourceLocation blankArrow = REIRuntime.getInstance().getDefaultDisplayTexture(false); +// graphics.blit(blankArrow, bound.x, bound.y, 106, 91, 24, 17); +// +// graphics.enableScissor(bound.x - xOffset, bound.y, bound.x + 23 - xOffset, bound.y + 16); +// graphics.blitSprite(texture, bound.x, bound.y, 24, 16); +// graphics.disableScissor(); +// }); +// } +// +// @Override +// public List setupDisplay(AetherCookingRecipeDisplay display, Rectangle bounds) { +// List widgets = super.setupDisplay(display, bounds); +// Point startPoint = new Point(bounds.getCenterX() - 41, bounds.y + 10); +// +// DecimalFormat df = new DecimalFormat("###.##"); +// +// float experience = display.getExperience(); +// int cookingTime = display.getCookingTime(); +// +// Component cookInfo; +// if (experience > 0) { +// cookInfo = Component.translatable("category.rei.cooking.time&xp", df.format(experience), df.format(cookingTime / 20d)); +// } else { +// cookInfo = Component.translatable("category.rei.campfire.time", df.format(cookingTime / 20d)); +// } +// +// Point labelPoint = new Point(bounds.x + bounds.width - 5, bounds.y + 5); +// +// if (display.isIncubation()) { +// labelPoint.move(labelPoint.x, bounds.getCenterY() - Minecraft.getInstance().font.lineHeight / 2); +// } +// +// widgets.add(Widgets.createLabel(labelPoint, cookInfo).noShadow().rightAligned().color(0xFF404040, 0xFFBBBBBB)); +// +// Point arrowPoint = new Point(startPoint.x + 24, startPoint.y + 8); +// +// WidgetWithBounds arrowWidget = this.animatedProgressArrow.get(); +// arrowWidget.getBounds().translate(arrowPoint.x, arrowPoint.y); +// widgets.add(arrowWidget); +// +// if (display.isIncubation()) { +// startPoint.translate(6, 5); +// } +// +// WidgetWithBounds fuelWidget = this.fuelIndicator.get(); +// fuelWidget.getBounds().move(startPoint.x + 2, startPoint.y + 20); +// widgets.add(fuelWidget); +// +// widgets.add(Widgets.createSlot(new Point(startPoint.x + 1, startPoint.y + 1)) +// .entries(display.getInputEntries().get(0)) +// .markInput()); +// +// List outputEntries = display.getOutputEntries(); +// +// if (outputEntries.size() > 0) { +// widgets.add(Widgets.createResultSlotBackground(new Point(startPoint.x + 61, startPoint.y + 9))); +// widgets.add(Widgets.createSlot(new Point(startPoint.x + 61, startPoint.y + 9)) +// .entries(outputEntries.get(0)) +// .disableBackground() +// .markOutput()); +// } +// +// return widgets; +// } +// +// @Override +// public Component getTitle() { +// return Component.translatable("gui.aether.jei." + this.id); +// } +//} diff --git a/src/main/java/com/aetherteam/aether/integration/rei/categories/item/AetherCookingRecipeDisplay.java b/src/main/java/com/aetherteam/aether/integration/rei/categories/item/AetherCookingRecipeDisplay.java index 8386ad702f..b8914c1438 100644 --- a/src/main/java/com/aetherteam/aether/integration/rei/categories/item/AetherCookingRecipeDisplay.java +++ b/src/main/java/com/aetherteam/aether/integration/rei/categories/item/AetherCookingRecipeDisplay.java @@ -1,94 +1,94 @@ package com.aetherteam.aether.integration.rei.categories.item; -import com.aetherteam.aether.recipe.recipes.item.AbstractAetherCookingRecipe; -import com.aetherteam.aether.recipe.recipes.item.AltarRepairRecipe; -import com.aetherteam.aether.recipe.recipes.item.IncubationRecipe; -import me.shedaniel.rei.api.common.category.CategoryIdentifier; -import me.shedaniel.rei.api.common.display.DisplaySerializer; -import me.shedaniel.rei.api.common.display.basic.BasicDisplay; -import me.shedaniel.rei.api.common.entry.EntryIngredient; -import me.shedaniel.rei.api.common.util.EntryIngredients; -import net.minecraft.resources.ResourceLocation; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.item.crafting.AbstractCookingRecipe; -import net.minecraft.world.item.crafting.Recipe; - -import java.util.List; -import java.util.Optional; - -public class AetherCookingRecipeDisplay> extends BasicDisplay { - private final CategoryIdentifier identifier; - - private final float experience; - private final int cookingTime; - - private final boolean isIncubation; - - public AetherCookingRecipeDisplay(CategoryIdentifier> identifier, List inputs, List outputs, float experience, int cookingTime, boolean isIncubation, Optional location) { - super(inputs, outputs, location); - this.identifier = identifier; - this.experience = experience; - this.cookingTime = cookingTime; - this.isIncubation = isIncubation; - } - - public static > AetherCookingRecipeDisplay of(CategoryIdentifier> categoryIdentifier, T recipe) { - var cookingTime = 0; - var experience = 0f; - - if (recipe instanceof AbstractCookingRecipe cookingRecipe){ - cookingTime = cookingRecipe.getCookingTime(); - experience = cookingRecipe.getExperience(); - } else if (recipe instanceof IncubationRecipe incubationRecipe){ - cookingTime = incubationRecipe.getIncubationTime(); - } - - return new AetherCookingRecipeDisplay<>(categoryIdentifier, getInput(recipe), getOutput(recipe), experience, cookingTime, (recipe instanceof IncubationRecipe), Optional.empty()); - } - - private static List getInput(Recipe recipe) { - if (recipe instanceof AltarRepairRecipe) { - ItemStack damagedItem = recipe.getIngredients().get(0).getItems()[0].copy(); - damagedItem.setDamageValue(damagedItem.getMaxDamage() * 3 / 4); - - return List.of(EntryIngredients.of(damagedItem)); - } else { - return List.of(EntryIngredients.ofIngredient(recipe.getIngredients().get(0))); - } - } - - private static List getOutput(Recipe recipe) { - return (recipe instanceof AbstractAetherCookingRecipe cookingRecipe) ? List.of(EntryIngredients.of(cookingRecipe.getResult())) : List.of(); - } - - @Override - public CategoryIdentifier getCategoryIdentifier() { - return this.identifier; - } - - public float getExperience() { - return this.experience; - } - - public int getCookingTime() { - return this.cookingTime; - } - - public boolean isIncubation() { - return this.isIncubation; - } - - public static > DisplaySerializer> serializer(CategoryIdentifier> identifier) { - return BasicDisplay.Serializer.of((input, output, location1, tag) -> { - var experience = tag.getFloat("experience"); - var cookingTime = tag.getInt("cookingTime"); - var isIncubation = tag.getBoolean("isIncubation"); - - return new AetherCookingRecipeDisplay<>(identifier, input, output, experience, cookingTime, isIncubation, location1); - }, (display, tag) -> { - tag.putFloat("experience", display.experience); - tag.putInt("cookingTime", display.cookingTime); - tag.putBoolean("isIncubation", display.isIncubation); - }); - } -} +//import com.aetherteam.aether.recipe.recipes.item.AbstractAetherCookingRecipe; +//import com.aetherteam.aether.recipe.recipes.item.AltarRepairRecipe; +//import com.aetherteam.aether.recipe.recipes.item.IncubationRecipe; +//import me.shedaniel.rei.api.common.category.CategoryIdentifier; +//import me.shedaniel.rei.api.common.display.DisplaySerializer; +//import me.shedaniel.rei.api.common.display.basic.BasicDisplay; +//import me.shedaniel.rei.api.common.entry.EntryIngredient; +//import me.shedaniel.rei.api.common.util.EntryIngredients; +//import net.minecraft.resources.ResourceLocation; +//import net.minecraft.world.item.ItemStack; +//import net.minecraft.world.item.crafting.AbstractCookingRecipe; +//import net.minecraft.world.item.crafting.Recipe; +// +//import java.util.List; +//import java.util.Optional; +// +//public class AetherCookingRecipeDisplay> extends BasicDisplay { +// private final CategoryIdentifier identifier; +// +// private final float experience; +// private final int cookingTime; +// +// private final boolean isIncubation; +// +// public AetherCookingRecipeDisplay(CategoryIdentifier> identifier, List inputs, List outputs, float experience, int cookingTime, boolean isIncubation, Optional location) { +// super(inputs, outputs, location); +// this.identifier = identifier; +// this.experience = experience; +// this.cookingTime = cookingTime; +// this.isIncubation = isIncubation; +// } +// +// public static > AetherCookingRecipeDisplay of(CategoryIdentifier> categoryIdentifier, T recipe) { +// var cookingTime = 0; +// var experience = 0f; +// +// if (recipe instanceof AbstractCookingRecipe cookingRecipe){ +// cookingTime = cookingRecipe.getCookingTime(); +// experience = cookingRecipe.getExperience(); +// } else if (recipe instanceof IncubationRecipe incubationRecipe){ +// cookingTime = incubationRecipe.getIncubationTime(); +// } +// +// return new AetherCookingRecipeDisplay<>(categoryIdentifier, getInput(recipe), getOutput(recipe), experience, cookingTime, (recipe instanceof IncubationRecipe), Optional.empty()); +// } +// +// private static List getInput(Recipe recipe) { +// if (recipe instanceof AltarRepairRecipe) { +// ItemStack damagedItem = recipe.getIngredients().get(0).getItems()[0].copy(); +// damagedItem.setDamageValue(damagedItem.getMaxDamage() * 3 / 4); +// +// return List.of(EntryIngredients.of(damagedItem)); +// } else { +// return List.of(EntryIngredients.ofIngredient(recipe.getIngredients().get(0))); +// } +// } +// +// private static List getOutput(Recipe recipe) { +// return (recipe instanceof AbstractAetherCookingRecipe cookingRecipe) ? List.of(EntryIngredients.of(cookingRecipe.getResult())) : List.of(); +// } +// +// @Override +// public CategoryIdentifier getCategoryIdentifier() { +// return this.identifier; +// } +// +// public float getExperience() { +// return this.experience; +// } +// +// public int getCookingTime() { +// return this.cookingTime; +// } +// +// public boolean isIncubation() { +// return this.isIncubation; +// } +// +// public static > DisplaySerializer> serializer(CategoryIdentifier> identifier) { +// return BasicDisplay.Serializer.of((input, output, location1, tag) -> { +// var experience = tag.getFloat("experience"); +// var cookingTime = tag.getInt("cookingTime"); +// var isIncubation = tag.getBoolean("isIncubation"); +// +// return new AetherCookingRecipeDisplay<>(identifier, input, output, experience, cookingTime, isIncubation, location1); +// }, (display, tag) -> { +// tag.putFloat("experience", display.experience); +// tag.putInt("cookingTime", display.cookingTime); +// tag.putBoolean("isIncubation", display.isIncubation); +// }); +// } +//}