more fixes, it compiles

This commit is contained in:
Flanks255 2024-03-04 15:37:11 -06:00
parent 0b4c9838e9
commit 32d4b5a052
10 changed files with 100 additions and 175 deletions

View file

@ -3,12 +3,9 @@ package de.ellpeck.actuallyadditions.data;
import de.ellpeck.actuallyadditions.api.ActuallyTags;
import de.ellpeck.actuallyadditions.mod.blocks.ActuallyBlocks;
import de.ellpeck.actuallyadditions.mod.items.ActuallyItems;
import de.ellpeck.actuallyadditions.mod.util.NoAdvRecipeOutput;
import net.minecraft.data.PackOutput;
import net.minecraft.data.recipes.RecipeCategory;
import net.minecraft.data.recipes.RecipeOutput;
import net.minecraft.data.recipes.RecipeProvider;
import net.minecraft.data.recipes.ShapedRecipeBuilder;
import net.minecraft.data.recipes.ShapelessRecipeBuilder;
import net.minecraft.data.recipes.*;
import net.minecraft.tags.ItemTags;
import net.minecraft.world.item.Items;
import net.minecraft.world.level.ItemLike;
@ -23,9 +20,11 @@ public class BlockRecipeGenerator extends RecipeProvider {
}
@Override
protected void buildRecipes(@Nonnull RecipeOutput consumer) {
protected void buildRecipes(@Nonnull RecipeOutput output) {
var recipeOutput = new NoAdvRecipeOutput(output);
//Battery Box
Recipe.shapeless(ActuallyBlocks.BATTERY_BOX.getItem()).ingredients(ActuallyBlocks.ENERGIZER.get(), ActuallyBlocks.ENERVATOR.get(), ActuallyItems.BASIC_COIL.get()).save(consumer);
Recipe.shapeless(ActuallyBlocks.BATTERY_BOX.getItem()).ingredients(ActuallyBlocks.ENERGIZER.get(), ActuallyBlocks.ENERVATOR.get(), ActuallyItems.BASIC_COIL.get()).save(recipeOutput);
//Farmer
Recipe.shaped(ActuallyBlocks.FARMER.getItem())
@ -33,7 +32,7 @@ public class BlockRecipeGenerator extends RecipeProvider {
.define('I', ActuallyBlocks.ENORI_CRYSTAL.getItem())
.define('C', ActuallyBlocks.IRON_CASING.get())
.define('S', Tags.Items.SEEDS)
.save(consumer);
.save(recipeOutput);
//Empowerer
Recipe.shaped(ActuallyBlocks.EMPOWERER.getItem())
@ -42,14 +41,14 @@ public class BlockRecipeGenerator extends RecipeProvider {
.define('B', ActuallyItems.DOUBLE_BATTERY.get())
.define('C', ActuallyBlocks.IRON_CASING.get())
.define('D', ActuallyBlocks.DISPLAY_STAND.get())
.save(consumer);
.save(recipeOutput);
//Tiny Torch
Recipe.shaped(ActuallyBlocks.TINY_TORCH.getItem(), 2)
.pattern("C", "S")
.define('C', ActuallyTags.Items.TINY_COALS)
.define('S', Tags.Items.RODS_WOODEN)
.save(consumer);
.save(recipeOutput);
//Fireworks Box
Recipe.shaped(ActuallyBlocks.FIREWORK_BOX.getItem())
@ -59,7 +58,7 @@ public class BlockRecipeGenerator extends RecipeProvider {
.define('A', ActuallyBlocks.IRON_CASING.get())
.define('F', Items.FIREWORK_ROCKET)
.define('C', ActuallyItems.ENORI_CRYSTAL.get())
.save(consumer);
.save(recipeOutput);
//Shock Suppressor
Recipe.shaped(ActuallyBlocks.SHOCK_SUPPRESSOR.getItem())
@ -67,7 +66,7 @@ public class BlockRecipeGenerator extends RecipeProvider {
.define('A', ActuallyItems.EMPOWERED_VOID_CRYSTAL.get())
.define('O', Tags.Items.OBSIDIAN)
.define('C', ActuallyItems.ADVANCED_COIL.get())
.save(consumer);
.save(recipeOutput);
//Display Stand
Recipe.shaped(ActuallyBlocks.DISPLAY_STAND.getItem())
@ -75,7 +74,7 @@ public class BlockRecipeGenerator extends RecipeProvider {
.define('R', ActuallyItems.ADVANCED_COIL.get())
.define('E', ActuallyBlocks.ETHETIC_GREEN_BLOCK.get())
.define('G', ActuallyBlocks.ETHETIC_WHITE_BLOCK.get())
.save(consumer);
.save(recipeOutput);
//Vertical Digger
Recipe.shaped(ActuallyBlocks.VERTICAL_DIGGER.getItem())
@ -84,70 +83,70 @@ public class BlockRecipeGenerator extends RecipeProvider {
.define('I', ActuallyBlocks.IRON_CASING.get())
.define('C', ActuallyItems.EMPOWERED_VOID_CRYSTAL.get())
.define('D', ActuallyTags.Items.DRILLS)
.save(consumer);
.save(recipeOutput);
//Black Quartz Wall
Recipe.wall(ActuallyBlocks.BLACK_QUARTZ_WALL.getItem(), ActuallyBlocks.BLACK_QUARTZ_PILLAR.get(), consumer);
Recipe.wall(ActuallyBlocks.BLACK_QUARTZ_WALL.getItem(), ActuallyBlocks.BLACK_QUARTZ_PILLAR.get(), recipeOutput);
//Black Quartz Slab
Recipe.slab(ActuallyBlocks.BLACK_QUARTZ_SLAB.getItem(), ActuallyBlocks.BLACK_QUARTZ_PILLAR.get(), consumer);
Recipe.slab(ActuallyBlocks.BLACK_QUARTZ_SLAB.getItem(), ActuallyBlocks.BLACK_QUARTZ_PILLAR.get(), recipeOutput);
//Black Quartz Stairs
Recipe.stairs(ActuallyBlocks.BLACK_QUARTZ_STAIR.getItem(), ActuallyBlocks.BLACK_QUARTZ_PILLAR.get(), consumer);
Recipe.stairs(ActuallyBlocks.BLACK_QUARTZ_STAIR.getItem(), ActuallyBlocks.BLACK_QUARTZ_PILLAR.get(), recipeOutput);
//Smooth Black Quartz Wall
Recipe.wall(ActuallyBlocks.SMOOTH_BLACK_QUARTZ_WALL.getItem(), ActuallyBlocks.SMOOTH_BLACK_QUARTZ.get(), consumer);
Recipe.wall(ActuallyBlocks.SMOOTH_BLACK_QUARTZ_WALL.getItem(), ActuallyBlocks.SMOOTH_BLACK_QUARTZ.get(), recipeOutput);
//Smooth Black Quartz Slab
Recipe.slab(ActuallyBlocks.SMOOTH_BLACK_QUARTZ_SLAB.getItem(), ActuallyBlocks.SMOOTH_BLACK_QUARTZ.get(), consumer);
Recipe.slab(ActuallyBlocks.SMOOTH_BLACK_QUARTZ_SLAB.getItem(), ActuallyBlocks.SMOOTH_BLACK_QUARTZ.get(), recipeOutput);
//Smooth Black Quartz Stairs
Recipe.stairs(ActuallyBlocks.SMOOTH_BLACK_QUARTZ_STAIR.getItem(), ActuallyBlocks.SMOOTH_BLACK_QUARTZ.get(), consumer);
Recipe.stairs(ActuallyBlocks.SMOOTH_BLACK_QUARTZ_STAIR.getItem(), ActuallyBlocks.SMOOTH_BLACK_QUARTZ.get(), recipeOutput);
//Black Quartz Brick Wall
Recipe.wall(ActuallyBlocks.BLACK_QUARTZ_BRICK_WALL.getItem(), ActuallyBlocks.BLACK_QUARTZ_BRICK.get(), consumer);
Recipe.wall(ActuallyBlocks.BLACK_QUARTZ_BRICK_WALL.getItem(), ActuallyBlocks.BLACK_QUARTZ_BRICK.get(), recipeOutput);
//Black Quartz Brick Slab
Recipe.slab(ActuallyBlocks.BLACK_QUARTZ_BRICK_SLAB.getItem(), ActuallyBlocks.BLACK_QUARTZ_BRICK.get(), consumer);
Recipe.slab(ActuallyBlocks.BLACK_QUARTZ_BRICK_SLAB.getItem(), ActuallyBlocks.BLACK_QUARTZ_BRICK.get(), recipeOutput);
//Black Quartz Brick Stairs
Recipe.stairs(ActuallyBlocks.BLACK_QUARTZ_BRICK_STAIR.getItem(), ActuallyBlocks.BLACK_QUARTZ_BRICK.get(), consumer);
Recipe.stairs(ActuallyBlocks.BLACK_QUARTZ_BRICK_STAIR.getItem(), ActuallyBlocks.BLACK_QUARTZ_BRICK.get(), recipeOutput);
//Pillar Black Quartz Wall
Recipe.wall(ActuallyBlocks.BLACK_QUARTZ_PILLAR_WALL.getItem(), ActuallyBlocks.BLACK_QUARTZ_PILLAR.get(), consumer);
Recipe.wall(ActuallyBlocks.BLACK_QUARTZ_PILLAR_WALL.getItem(), ActuallyBlocks.BLACK_QUARTZ_PILLAR.get(), recipeOutput);
//Pillar Black Quartz Slab
Recipe.slab(ActuallyBlocks.BLACK_QUARTZ_PILLAR_SLAB.getItem(), ActuallyBlocks.BLACK_QUARTZ_PILLAR.get(), consumer);
Recipe.slab(ActuallyBlocks.BLACK_QUARTZ_PILLAR_SLAB.getItem(), ActuallyBlocks.BLACK_QUARTZ_PILLAR.get(), recipeOutput);
//Pillar Black Quartz Stairs
Recipe.stairs(ActuallyBlocks.BLACK_QUARTZ_PILLAR_STAIR.getItem(), ActuallyBlocks.BLACK_QUARTZ_PILLAR.get(), consumer);
Recipe.stairs(ActuallyBlocks.BLACK_QUARTZ_PILLAR_STAIR.getItem(), ActuallyBlocks.BLACK_QUARTZ_PILLAR.get(), recipeOutput);
//Chiseled Black Quartz Wall
Recipe.wall(ActuallyBlocks.CHISELED_BLACK_QUARTZ_WALL.getItem(), ActuallyBlocks.CHISELED_BLACK_QUARTZ.get(), consumer);
Recipe.wall(ActuallyBlocks.CHISELED_BLACK_QUARTZ_WALL.getItem(), ActuallyBlocks.CHISELED_BLACK_QUARTZ.get(), recipeOutput);
//Chiseled Black Quartz Slab
Recipe.slab(ActuallyBlocks.CHISELED_BLACK_QUARTZ_SLAB.getItem(), ActuallyBlocks.CHISELED_BLACK_QUARTZ.get(), consumer);
Recipe.slab(ActuallyBlocks.CHISELED_BLACK_QUARTZ_SLAB.getItem(), ActuallyBlocks.CHISELED_BLACK_QUARTZ.get(), recipeOutput);
//Chiseled Black Quartz Stairs
Recipe.stairs(ActuallyBlocks.CHISELED_BLACK_QUARTZ_STAIR.getItem(), ActuallyBlocks.CHISELED_BLACK_QUARTZ.get(), consumer);
Recipe.stairs(ActuallyBlocks.CHISELED_BLACK_QUARTZ_STAIR.getItem(), ActuallyBlocks.CHISELED_BLACK_QUARTZ.get(), recipeOutput);
//Ethetic White Wall
Recipe.wall(ActuallyBlocks.ETHETIC_WHITE_WALL.getItem(), ActuallyBlocks.ETHETIC_WHITE_BLOCK.get(), consumer);
Recipe.wall(ActuallyBlocks.ETHETIC_WHITE_WALL.getItem(), ActuallyBlocks.ETHETIC_WHITE_BLOCK.get(), recipeOutput);
//Ethetic White Slab
Recipe.slab(ActuallyBlocks.ETHETIC_WHITE_SLAB.getItem(), ActuallyBlocks.ETHETIC_WHITE_BLOCK.get(), consumer);
Recipe.slab(ActuallyBlocks.ETHETIC_WHITE_SLAB.getItem(), ActuallyBlocks.ETHETIC_WHITE_BLOCK.get(), recipeOutput);
//Ethetic White Stairs
Recipe.stairs(ActuallyBlocks.ETHETIC_WHITE_STAIRS.getItem(), ActuallyBlocks.ETHETIC_WHITE_BLOCK.get(), consumer);
Recipe.stairs(ActuallyBlocks.ETHETIC_WHITE_STAIRS.getItem(), ActuallyBlocks.ETHETIC_WHITE_BLOCK.get(), recipeOutput);
// Ethetic Green Wall
Recipe.wall(ActuallyBlocks.ETHETIC_GREEN_WALL.getItem(), ActuallyBlocks.ETHETIC_GREEN_BLOCK.get(), consumer);
Recipe.wall(ActuallyBlocks.ETHETIC_GREEN_WALL.getItem(), ActuallyBlocks.ETHETIC_GREEN_BLOCK.get(), recipeOutput);
// Ethetic Green Slab
Recipe.slab(ActuallyBlocks.ETHETIC_GREEN_SLAB.getItem(), ActuallyBlocks.ETHETIC_GREEN_BLOCK.get(), consumer);
Recipe.slab(ActuallyBlocks.ETHETIC_GREEN_SLAB.getItem(), ActuallyBlocks.ETHETIC_GREEN_BLOCK.get(), recipeOutput);
// Ethetic Green Stairs
Recipe.stairs(ActuallyBlocks.ETHETIC_GREEN_STAIRS.getItem(), ActuallyBlocks.ETHETIC_GREEN_BLOCK.get(), consumer);
Recipe.stairs(ActuallyBlocks.ETHETIC_GREEN_STAIRS.getItem(), ActuallyBlocks.ETHETIC_GREEN_BLOCK.get(), recipeOutput);
// Atomic Reconstructor
Recipe.shaped(ActuallyBlocks.ATOMIC_RECONSTRUCTOR.getItem())
@ -155,7 +154,7 @@ public class BlockRecipeGenerator extends RecipeProvider {
.define('R', Tags.Items.DUSTS_REDSTONE)
.define('I', Tags.Items.INGOTS_IRON)
.define('C', ActuallyBlocks.IRON_CASING.get())
.save(consumer);
.save(recipeOutput);
// Laser Relay
Recipe.shaped(ActuallyBlocks.LASER_RELAY.getItem(), 4)
@ -164,7 +163,7 @@ public class BlockRecipeGenerator extends RecipeProvider {
.define('O', Tags.Items.OBSIDIAN)
.define('R', ActuallyItems.RESTONIA_CRYSTAL.get())
.define('C', ActuallyItems.ADVANCED_COIL.get())
.save(consumer);
.save(recipeOutput);
// Advanced Laser Relay
Recipe.shaped(ActuallyBlocks.LASER_RELAY_ADVANCED.getItem())
@ -172,7 +171,7 @@ public class BlockRecipeGenerator extends RecipeProvider {
.define('I', ActuallyItems.ENORI_CRYSTAL.get())
.define('R', ActuallyBlocks.LASER_RELAY.get())
.define('X', ActuallyItems.RESTONIA_CRYSTAL.get())
.save(consumer);
.save(recipeOutput);
// Extreme Laser Relay
Recipe.shaped(ActuallyBlocks.LASER_RELAY_EXTREME.getItem())
@ -180,12 +179,12 @@ public class BlockRecipeGenerator extends RecipeProvider {
.define('I', ActuallyItems.EMPOWERED_DIAMATINE_CRYSTAL.get())
.define('R', ActuallyBlocks.LASER_RELAY_ADVANCED.get())
.define('X', ActuallyItems.RESTONIA_CRYSTAL.get())
.save(consumer);
.save(recipeOutput);
// Whitelist Item Laser Relay
Recipe.shapeless(ActuallyBlocks.LASER_RELAY_ITEM_ADVANCED.getItem())
.ingredients(ActuallyBlocks.LASER_RELAY_ITEM.get(), ActuallyItems.ADVANCED_COIL.get(), ActuallyItems.BLACK_QUARTZ.get())
.save(consumer);
.save(recipeOutput);
// Item Interface
Recipe.shaped(ActuallyBlocks.ITEM_INTERFACE.getItem())
@ -194,10 +193,10 @@ public class BlockRecipeGenerator extends RecipeProvider {
.define('O', ActuallyItems.BASIC_COIL.get())
.define('R', ActuallyItems.RESTONIA_CRYSTAL.get())
.define('C', Tags.Items.CHESTS_WOODEN)
.save(consumer);
.save(recipeOutput);
// Hopping Item Interface
Recipe.shapeless(ActuallyBlocks.ITEM_INTERFACE_HOPPING.get()).ingredients(ActuallyBlocks.ITEM_INTERFACE.get()).save(consumer);
Recipe.shapeless(ActuallyBlocks.ITEM_INTERFACE_HOPPING.get()).ingredients(ActuallyBlocks.ITEM_INTERFACE.get()).save(recipeOutput);
//Wood Casing
Recipe.shaped(ActuallyBlocks.WOOD_CASING.getItem())
@ -205,7 +204,7 @@ public class BlockRecipeGenerator extends RecipeProvider {
.define('S', Tags.Items.RODS_WOODEN)
.define('W', ItemTags.PLANKS)
.define('R', ItemTags.LOGS)
.save(consumer);
.save(recipeOutput);
//Iron Casing
Recipe.shaped(ActuallyBlocks.IRON_CASING.getItem())
@ -213,7 +212,7 @@ public class BlockRecipeGenerator extends RecipeProvider {
.define('Q', ActuallyItems.BLACK_QUARTZ.get())
.define('W', Tags.Items.INGOTS_IRON)
.define('S', Tags.Items.RODS_WOODEN)
.save(consumer);
.save(recipeOutput);
//Ender Casing
Recipe.shaped(ActuallyBlocks.ENDER_CASING.getItem())
@ -221,18 +220,12 @@ public class BlockRecipeGenerator extends RecipeProvider {
.define('W', Tags.Items.ENDER_PEARLS)
.define('R', ActuallyBlocks.BLACK_QUARTZ.getItem())
.define('S', ActuallyItems.EMPOWERED_DIAMATINE_CRYSTAL.get())
.save(consumer);
.save(recipeOutput);
}
// @Override //TODO: Flanks do your RecipeOutput wrapper thingy ;)
// protected @Nullable CompletableFuture<?> saveAdvancement(CachedOutput stack, FinishedRecipe finishedRecipe, JsonObject advancementJson) {
// return null;
// //Nope... maybe later...
// }
public static class Recipe {
public static Shapeless shapeless(ItemLike result) {
return new Shapeless(result);

View file

@ -3,8 +3,11 @@ package de.ellpeck.actuallyadditions.data;
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
import de.ellpeck.actuallyadditions.mod.blocks.ActuallyBlocks;
import de.ellpeck.actuallyadditions.mod.config.conditions.BoolConfigCondition;
import de.ellpeck.actuallyadditions.mod.crafting.RecipeKeepDataShaped;
import de.ellpeck.actuallyadditions.mod.crafting.TargetNBTIngredient;
import de.ellpeck.actuallyadditions.mod.items.ActuallyItems;
import de.ellpeck.actuallyadditions.mod.util.NoAdvRecipeOutput;
import de.ellpeck.actuallyadditions.mod.util.RecipeInjector;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.data.PackOutput;
import net.minecraft.data.recipes.*;
@ -13,6 +16,7 @@ import net.minecraft.tags.ItemTags;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Items;
import net.minecraft.world.item.crafting.ShapedRecipe;
import net.minecraft.world.item.enchantment.Enchantments;
import net.minecraft.world.level.ItemLike;
import net.neoforged.neoforge.common.Tags;
@ -364,45 +368,45 @@ public class ItemRecipeGenerator extends RecipeProvider {
.define('C', ActuallyItems.ADVANCED_COIL.get())
.save(recipeOutput);
// //Double Battery TODO: Flanks please fix these :)
// Recipe.shaped(ActuallyItems.DOUBLE_BATTERY.get())
// .pattern(" R ")
// .pattern("ICI")
// .pattern("III")
// .define('R', TargetNBTIngredient.of(ActuallyItems.SINGLE_BATTERY.get()))
// .define('I', ActuallyItems.ENORI_CRYSTAL.get())
// .define('C', ActuallyItems.ADVANCED_COIL.get())
// .save(WrappedRecipe.Inject(consumer, ActuallyRecipes.KEEP_DATA_SHAPED_RECIPE.get()));
//
// //Triple Battery
// Recipe.shaped(ActuallyItems.TRIPLE_BATTERY.get())
// .pattern(" R ")
// .pattern("ICI")
// .pattern("III")
// .define('R', TargetNBTIngredient.of(ActuallyItems.DOUBLE_BATTERY.get()))
// .define('I', ActuallyItems.EMPOWERED_ENORI_CRYSTAL.get())
// .define('C', ActuallyItems.ADVANCED_COIL.get())
// .save(WrappedRecipe.Inject(consumer, ActuallyRecipes.KEEP_DATA_SHAPED_RECIPE.get()));
//
// //Quad Battery
// Recipe.shaped(ActuallyItems.QUADRUPLE_BATTERY.get())
// .pattern(" R ")
// .pattern("ICI")
// .pattern("III")
// .define('R', TargetNBTIngredient.of(ActuallyItems.TRIPLE_BATTERY.get()))
// .define('I', ActuallyItems.EMPOWERED_ENORI_CRYSTAL.get())
// .define('C', ActuallyItems.ADVANCED_COIL.get())
// .save(WrappedRecipe.Inject(consumer, ActuallyRecipes.KEEP_DATA_SHAPED_RECIPE.get()));
//
// //Quintuple Battery
// Recipe.shaped(ActuallyItems.QUINTUPLE_BATTERY.get())
// .pattern(" R ")
// .pattern("ICI")
// .pattern("III")
// .define('R', TargetNBTIngredient.of(ActuallyItems.QUADRUPLE_BATTERY.get()))
// .define('I', ActuallyItems.EMPOWERED_DIAMATINE_CRYSTAL.get())
// .define('C', ActuallyItems.ADVANCED_COIL.get())
// .save(WrappedRecipe.Inject(consumer, ActuallyRecipes.KEEP_DATA_SHAPED_RECIPE.get()));
//Double Battery
Recipe.shaped(ActuallyItems.DOUBLE_BATTERY.get())
.pattern(" R ")
.pattern("ICI")
.pattern("III")
.define('R', TargetNBTIngredient.of(ActuallyItems.SINGLE_BATTERY.get()))
.define('I', ActuallyItems.ENORI_CRYSTAL.get())
.define('C', ActuallyItems.ADVANCED_COIL.get())
.save(new RecipeInjector<ShapedRecipe>(recipeOutput, RecipeKeepDataShaped::new));
//Triple Battery
Recipe.shaped(ActuallyItems.TRIPLE_BATTERY.get())
.pattern(" R ")
.pattern("ICI")
.pattern("III")
.define('R', TargetNBTIngredient.of(ActuallyItems.DOUBLE_BATTERY.get()))
.define('I', ActuallyItems.EMPOWERED_ENORI_CRYSTAL.get())
.define('C', ActuallyItems.ADVANCED_COIL.get())
.save(new RecipeInjector<ShapedRecipe>(recipeOutput, RecipeKeepDataShaped::new));
//Quad Battery
Recipe.shaped(ActuallyItems.QUADRUPLE_BATTERY.get())
.pattern(" R ")
.pattern("ICI")
.pattern("III")
.define('R', TargetNBTIngredient.of(ActuallyItems.TRIPLE_BATTERY.get()))
.define('I', ActuallyItems.EMPOWERED_ENORI_CRYSTAL.get())
.define('C', ActuallyItems.ADVANCED_COIL.get())
.save(new RecipeInjector<ShapedRecipe>(recipeOutput, RecipeKeepDataShaped::new));
//Quintuple Battery
Recipe.shaped(ActuallyItems.QUINTUPLE_BATTERY.get())
.pattern(" R ")
.pattern("ICI")
.pattern("III")
.define('R', TargetNBTIngredient.of(ActuallyItems.QUADRUPLE_BATTERY.get()))
.define('I', ActuallyItems.EMPOWERED_DIAMATINE_CRYSTAL.get())
.define('C', ActuallyItems.ADVANCED_COIL.get())
.save(new RecipeInjector<ShapedRecipe>(recipeOutput, RecipeKeepDataShaped::new));
//Magnet Ring
Recipe.shaped(ActuallyItems.RING_OF_MAGNETIZING.get())
@ -536,12 +540,6 @@ public class ItemRecipeGenerator extends RecipeProvider {
decompress(consumer, shard, crystal);
}
// @Override //TODO: Flanks do your RecipeOutput wrapper thingy ;)
// protected @Nullable CompletableFuture<?> saveAdvancement(CachedOutput stack, FinishedRecipe finishedRecipe, JsonObject advancementJson) {
// return null;
// //Nope... maybe later...
// }
public static void addToolAndArmorRecipes(RecipeOutput consumer, DeferredItem<Item> base, DeferredItem<Item> pickaxe, DeferredItem<Item> sword, DeferredItem<Item> axe, DeferredItem<Item> shovel, DeferredItem<Item> hoe, DeferredItem<Item> helm, DeferredItem<Item> chest, DeferredItem<Item> pants, DeferredItem<Item> boots) {
//Pickaxe
Recipe.shaped(pickaxe.get())

View file

@ -131,7 +131,6 @@ public class ActuallyAdditions {
ActuallyAdditionsAPI.connectionHandler = new LaserRelayConnectionHandler();
//Lenses.init();
// CompatUtil.registerCraftingTweaks();
// event.enqueueWork(() -> CraftingHelper.register(TargetNBTIngredient.Serializer.NAME, TargetNBTIngredient.SERIALIZER)); TODO: Flanks fix the Target NBT ingredient!
commonCapsLoaded = false; // Loader.isModLoaded("commoncapabilities");

View file

@ -1,67 +0,0 @@
package de.ellpeck.actuallyadditions.mod.crafting;
import com.google.gson.JsonObject;
import net.minecraft.data.recipes.FinishedRecipe;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.crafting.RecipeSerializer;
import net.neoforged.neoforge.registries.BuiltInRegistries;
import javax.annotation.Nullable;
import java.util.function.Consumer;
public class WrappedRecipe implements FinishedRecipe {
FinishedRecipe inner;
RecipeSerializer<?> serializerOverride;
public WrappedRecipe(FinishedRecipe innerIn) {
inner = innerIn;
}
public WrappedRecipe(FinishedRecipe innerIn, RecipeSerializer<?> serializerOverrideIn) {
inner = innerIn;
serializerOverride = serializerOverrideIn;
}
public static Consumer<FinishedRecipe> Inject(Consumer<FinishedRecipe> consumer, RecipeSerializer<?> serializer) {
return iFinishedRecipe -> consumer.accept(new WrappedRecipe(iFinishedRecipe, serializer));
}
@Override
public void serializeRecipeData(JsonObject json) {
inner.serializeRecipeData(json);
}
@Override
public JsonObject serializeRecipe() {
JsonObject jsonObject = new JsonObject();
if (serializerOverride != null)
jsonObject.addProperty("type", BuiltInRegistries.RECIPE_SERIALIZERS.getKey(serializerOverride).toString());
else
jsonObject.addProperty("type", BuiltInRegistries.RECIPE_SERIALIZERS.getKey(inner.getType()).toString());
serializeRecipeData(jsonObject);
return jsonObject;
}
@Override
public ResourceLocation getId() {
return inner.getId();
}
@Override
public RecipeSerializer<?> getType () {
return serializerOverride != null? serializerOverride:inner.getType();
}
@Nullable
@Override
public JsonObject serializeAdvancement() {
return inner.serializeAdvancement();
}
@Nullable
@Override
public ResourceLocation getAdvancementId() {
return inner.getAdvancementId();
}
}

View file

@ -26,7 +26,7 @@ public abstract class AAScreen<T extends AbstractContainerMenu> extends Abstract
@Override
public void render(@Nonnull GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTicks) {
this.renderBackground(guiGraphics);
this.renderBackground(guiGraphics, mouseX, mouseY, partialTicks);
super.render(guiGraphics, mouseX, mouseY, partialTicks);
this.renderTooltip(guiGraphics, mouseX, mouseY);
}

View file

@ -11,6 +11,8 @@ import net.minecraft.resources.ResourceLocation;
import net.neoforged.api.distmarker.Dist;
import net.neoforged.api.distmarker.OnlyIn;
import javax.annotation.Nonnull;
public class Buttons {
@OnlyIn(Dist.CLIENT)
public static class SmallerButton extends Button {
@ -30,7 +32,7 @@ public class Buttons {
}
@Override
public void render(GuiGraphics guiGraphics, int mouseX, int mouseY, float f) {
public void renderWidget(@Nonnull GuiGraphics guiGraphics, int mouseX, int mouseY, float f) {
if (this.visible) {
RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F);
RenderSystem.setShaderTexture(0, this.resLoc);
@ -69,7 +71,7 @@ public class Buttons {
}
@Override
public void render(GuiGraphics guiGraphics, int mouseX, int mouseY, float f) {
public void renderWidget(GuiGraphics guiGraphics, int mouseX, int mouseY, float f) {
if (this.visible) {
RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F);
RenderSystem.setShaderTexture(0, this.resLoc);

View file

@ -44,11 +44,11 @@ public class GuiCoalGenerator extends AAScreen<ContainerCoalGenerator> {
}
@Override
public void render(@Nonnull GuiGraphics guiGraphics, int x, int y, float f) {
renderBackground(guiGraphics);
super.render(guiGraphics, x, y, f);
this.energy.render(guiGraphics, x, y);
renderTooltip(guiGraphics, x, y);
public void render(@Nonnull GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTicks) {
renderBackground(guiGraphics, mouseX, mouseY, partialTicks);
super.render(guiGraphics, mouseX, mouseY, partialTicks);
this.energy.render(guiGraphics, mouseX, mouseY);
renderTooltip(guiGraphics, mouseX, mouseY);
}
@Override

View file

@ -41,7 +41,7 @@ public class SlotFilter extends SlotItemHandlerUnconditioned {
}
public static boolean isFilter(ItemStack stack) {
return StackUtil.isValid(stack) && stack.getItem() instanceof ItemFilter;
return !stack.isEmpty() && stack.getItem() instanceof ItemFilter;
}
private void slotClick(Player player) {

View file

@ -82,7 +82,7 @@ public class LensColor extends Lens {
}
private ItemStack tryConvert(ItemStack stack, RegistryAccess registryAccess) {
return ColorChangeRecipe.getRecipeForStack(stack).map(recipe -> recipe.getResultItem(registryAccess)).orElse(ItemStack.EMPTY);
return ColorChangeRecipe.getRecipeForStack(stack).map(recipe -> recipe.value().getResultItem(registryAccess)).orElse(ItemStack.EMPTY);
}
@Override

View file

@ -232,7 +232,7 @@ public final class AssetUtil {
data.putFloat("Size", size);
data.putInt("MaxAge", maxAge);
data.putFloat("Alpha", alpha);
PacketDistributor.NEAR.with(() -> new PacketDistributor.TargetPoint(startX, startY, startZ, 96, world.dimension())).send(new PacketServerToClient(data, PacketHandler.LASER_HANDLER));
PacketDistributor.NEAR.with(new PacketDistributor.TargetPoint(startX, startY, startZ, 96, world.dimension())).send(new PacketServerToClient(data, PacketHandler.LASER_HANDLER));
}
}