Skip to content

Commit

Permalink
there we go, all expect worlgen
Browse files Browse the repository at this point in the history
  • Loading branch information
mrsterner committed Oct 27, 2023
1 parent 711bee2 commit 9ddf881
Show file tree
Hide file tree
Showing 11 changed files with 28 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import net.minecraft.world.item.crafting.*;
import net.minecraft.world.level.Level;
import net.minecraftforge.common.crafting.CraftingHelper;
import net.minecraftforge.registries.ForgeRegistryEntry;
import team.lodestar.lodestone.systems.recipe.ILodestoneRecipe;
import team.lodestar.lodestone.systems.recipe.IngredientWithCount;

Expand Down Expand Up @@ -73,10 +72,10 @@ public static FavorOfTheVoidRecipe getRecipe(Level level, Predicate<FavorOfTheVo
}

public static List<FavorOfTheVoidRecipe> getRecipes(Level level) {
return level().getRecipeManager().getAllRecipesFor(RecipeTypeRegistry.VOID_FAVOR.get());
return level.getRecipeManager().getAllRecipesFor(RecipeTypeRegistry.VOID_FAVOR.get());
}

public static class Serializer extends ForgeRegistryEntry<RecipeSerializer<?>> implements RecipeSerializer<FavorOfTheVoidRecipe> {
public static class Serializer implements RecipeSerializer<FavorOfTheVoidRecipe> {
@Override
public FavorOfTheVoidRecipe fromJson(ResourceLocation recipeId, JsonObject json) {
JsonObject inputObject = json.getAsJsonObject("input");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,10 @@ public static SpiritFocusingRecipe getRecipe(Level level, Predicate<SpiritFocusi
}

public static List<SpiritFocusingRecipe> getRecipes(Level level) {
return level().getRecipeManager().getAllRecipesFor(RecipeTypeRegistry.SPIRIT_FOCUSING.get());
return level.getRecipeManager().getAllRecipesFor(RecipeTypeRegistry.SPIRIT_FOCUSING.get());
}

public static class Serializer extends ForgeRegistryEntry<RecipeSerializer<?>> implements RecipeSerializer<SpiritFocusingRecipe> {
public static class Serializer implements RecipeSerializer<SpiritFocusingRecipe> {

@Override
public SpiritFocusingRecipe fromJson(ResourceLocation recipeId, JsonObject json) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import net.minecraft.world.item.crafting.RecipeType;
import net.minecraft.world.level.Level;
import net.minecraftforge.common.crafting.CraftingHelper;
import net.minecraftforge.registries.ForgeRegistryEntry;
import team.lodestar.lodestone.systems.recipe.ILodestoneRecipe;
import team.lodestar.lodestone.systems.recipe.IngredientWithCount;

Expand Down Expand Up @@ -115,10 +114,10 @@ public static SpiritInfusionRecipe getRecipe(Level level, Predicate<SpiritInfusi
}

public static List<SpiritInfusionRecipe> getRecipes(Level level) {
return level().getRecipeManager().getAllRecipesFor(RecipeTypeRegistry.SPIRIT_INFUSION.get());
return level.getRecipeManager().getAllRecipesFor(RecipeTypeRegistry.SPIRIT_INFUSION.get());
}

public static class Serializer extends ForgeRegistryEntry<RecipeSerializer<?>> implements RecipeSerializer<SpiritInfusionRecipe> {
public static class Serializer implements RecipeSerializer<SpiritInfusionRecipe> {
@Override
public SpiritInfusionRecipe fromJson(ResourceLocation recipeId, JsonObject json) {
JsonObject inputObject = json.getAsJsonObject("input");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import net.minecraft.world.item.crafting.RecipeType;
import net.minecraft.world.level.Level;
import net.minecraftforge.registries.ForgeRegistries;
import net.minecraftforge.registries.ForgeRegistryEntry;
import team.lodestar.lodestone.systems.recipe.ILodestoneRecipe;
import team.lodestar.lodestone.systems.recipe.IngredientWithCount;

Expand Down Expand Up @@ -119,7 +118,7 @@ public static SpiritRepairRecipe getRecipe(Level level, Predicate<SpiritRepairRe
}

public static List<SpiritRepairRecipe> getRecipes(Level level) {
return level().getRecipeManager().getAllRecipesFor(RecipeTypeRegistry.SPIRIT_REPAIR.get());
return level.getRecipeManager().getAllRecipesFor(RecipeTypeRegistry.SPIRIT_REPAIR.get());
}

public static ItemStack getRepairRecipeOutput(ItemStack input) {
Expand All @@ -136,7 +135,7 @@ default boolean ignoreDuringLookup() {
}
}

public static class Serializer extends ForgeRegistryEntry<RecipeSerializer<?>> implements RecipeSerializer<SpiritRepairRecipe> {
public static class Serializer implements RecipeSerializer<SpiritRepairRecipe> {

public static List<Item> REPAIRABLE;

Expand All @@ -158,8 +157,8 @@ public SpiritRepairRecipe fromJson(ResourceLocation recipeId, JsonObject json) {
inputs.add(input);
}
for (Item item : REPAIRABLE) {
if (item.getRegistryName().getPath().matches(itemIdRegex)) {
if (!modIdRegex.equals("") && !item.getRegistryName().getNamespace().matches(modIdRegex)) {
if (ForgeRegistries.ITEMS.getKey(item).getPath().matches(itemIdRegex)) {
if (!modIdRegex.equals("") && !ForgeRegistries.ITEMS.getKey(item).getNamespace().matches(modIdRegex)) {
continue;
}
if (item instanceof IRepairOutputOverride repairOutputOverride && repairOutputOverride.ignoreDuringLookup()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import net.minecraft.world.item.crafting.RecipeType;
import net.minecraft.world.level.Level;
import net.minecraftforge.common.crafting.CraftingHelper;
import net.minecraftforge.registries.ForgeRegistryEntry;
import team.lodestar.lodestone.systems.recipe.ILodestoneRecipe;

import javax.annotation.Nullable;
Expand Down Expand Up @@ -71,10 +70,10 @@ public static SpiritTransmutationRecipe getRecipe(Level level, Predicate<SpiritT
}

public static List<SpiritTransmutationRecipe> getRecipes(Level level) {
return level().getRecipeManager().getAllRecipesFor(RecipeTypeRegistry.SPIRIT_TRANSMUTATION.get());
return level.getRecipeManager().getAllRecipesFor(RecipeTypeRegistry.SPIRIT_TRANSMUTATION.get());
}

public static class Serializer extends ForgeRegistryEntry<RecipeSerializer<?>> implements RecipeSerializer<SpiritTransmutationRecipe> {
public static class Serializer implements RecipeSerializer<SpiritTransmutationRecipe> {

@Override
public SpiritTransmutationRecipe fromJson(ResourceLocation recipeId, JsonObject json) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import net.minecraft.world.Container;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.crafting.BlastingRecipe;
import net.minecraft.world.item.crafting.CookingBookCategory;
import net.minecraft.world.item.crafting.Ingredient;
import net.minecraft.world.item.crafting.RecipeSerializer;
import team.lodestar.lodestone.systems.recipe.IngredientWithCount;
Expand All @@ -15,7 +16,7 @@ public class MetalNodeBlastingRecipe extends BlastingRecipe implements INodeSmel
public final IngredientWithCount output;

public MetalNodeBlastingRecipe(ResourceLocation pId, String pGroup, Ingredient pIngredient, IngredientWithCount output, float pExperience, int pCookingTime) {
super(pId, pGroup, pIngredient, ItemStack.EMPTY, pExperience, pCookingTime);
super(pId, pGroup, CookingBookCategory.MISC, pIngredient, ItemStack.EMPTY, pExperience, pCookingTime);
this.output = output;
}

Expand All @@ -29,16 +30,6 @@ public RecipeSerializer<?> getSerializer() {
return RecipeSerializerRegistry.METAL_NODE_BLASTING_SERIALIZER.get();
}

@Override
public ItemStack getResultItem() {
return output.getStack();
}

@Override
public ItemStack assemble(Container pInv) {
return output.getStack();
}

@Override
public IngredientWithCount getOutput() {
return output;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.Container;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.crafting.CookingBookCategory;
import net.minecraft.world.item.crafting.Ingredient;
import net.minecraft.world.item.crafting.RecipeSerializer;
import net.minecraft.world.item.crafting.SmeltingRecipe;
Expand All @@ -15,7 +16,7 @@ public class MetalNodeSmeltingRecipe extends SmeltingRecipe implements INodeSmel
public final IngredientWithCount output;

public MetalNodeSmeltingRecipe(ResourceLocation pId, String pGroup, Ingredient pIngredient, IngredientWithCount output, float pExperience, int pCookingTime) {
super(pId, pGroup, pIngredient, ItemStack.EMPTY, pExperience, pCookingTime);
super(pId, pGroup, CookingBookCategory.MISC, pIngredient, ItemStack.EMPTY, pExperience, pCookingTime);
this.output = output;
}

Expand All @@ -30,17 +31,6 @@ public RecipeSerializer<?> getSerializer() {
return RecipeSerializerRegistry.METAL_NODE_SMELTING_SERIALIZER.get();
}

@Override
public ItemStack getResultItem() {
return output.getStack();
}

@Override
public ItemStack assemble(Container pInv) {
return output.getStack();
}


@Override
public IngredientWithCount getOutput() {
return output;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import net.minecraft.world.item.crafting.RecipeSerializer;
import team.lodestar.lodestone.systems.recipe.IngredientWithCount;

public class NodeCookingSerializer<T extends AbstractCookingRecipe> extends net.minecraftforge.registries.ForgeRegistryEntry<RecipeSerializer<?>> implements RecipeSerializer<T> {
public class NodeCookingSerializer<T extends AbstractCookingRecipe> implements RecipeSerializer<T> {
public final int defaultCookingTime;
public final NodeBaker<T> factory;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import mezz.jei.api.recipe.category.IRecipeCategory;
import net.minecraft.client.gui.GuiGraphics;
import net.minecraft.network.chat.Component;
import net.minecraft.network.chat.TranslatableComponent;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.ItemStack;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public SpiritRiteRecipeCategory(IGuiHelper guiHelper) {
public void draw(MalumRiteType rite, IRecipeSlotsView recipeSlotsView, GuiGraphics guiGraphics, double mouseX, double mouseY) {
overlay.draw(guiGraphics);
String translated = I18n.get(rite.translationIdentifier(false));
ArcanaCodexHelper.renderText(guiGraphics.pose(), Component.literal(translated), 71 - font.width(translated) / 2, 160);
ArcanaCodexHelper.renderText(guiGraphics, Component.literal(translated), 71 - font.width(translated) / 2, 160);
}

@Override
Expand Down
10 changes: 10 additions & 0 deletions src/main/java/com/sammy/malum/registry/client/ShaderRegistry.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package com.sammy.malum.registry.client;

import com.mojang.blaze3d.vertex.DefaultVertexFormat;
import com.sammy.malum.MalumMod;
import team.lodestar.lodestone.systems.rendering.shader.ShaderHolder;

public class ShaderRegistry {
public static ShaderHolder TOUCH_OF_DARKNESS = new ShaderHolder(MalumMod.malumPath("touch_of_darkness"), DefaultVertexFormat.POSITION_COLOR_TEX, "Speed", "Zoom", "Distortion", "Intensity", "Wibble");

}

0 comments on commit 9ddf881

Please sign in to comment.