-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added jei integration - Can now see catalysts in jei making it easier for players to know what catalysts exists Split stone and cobble generation - Seperated stone and cobble gens - Can now choose whether variants generate from a stone or a cobble gen - Can add custom catalysts seperately, letting you add mod blocks as cobble and as stone
- Loading branch information
Showing
12 changed files
with
398 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
# Sets default memory used for gradle commands. Can be overridden by user or command line properties. | ||
# This is required to provide enough memory for the Minecraft decompilation process. | ||
org.gradle.jvmargs=-Xmx3G | ||
org.gradle.daemon=false | ||
org.gradle.daemon=false | ||
|
||
minecraft_version=1.14.4 | ||
jei_version=6.0.0.27 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
87 changes: 87 additions & 0 deletions
87
src/main/java/network/pxl8/stonecatalysts/compat/jei/CobblestoneCatalystCategory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
package network.pxl8.stonecatalysts.compat.jei; | ||
|
||
import com.google.common.collect.Lists; | ||
import mezz.jei.api.constants.VanillaTypes; | ||
import mezz.jei.api.gui.IRecipeLayout; | ||
import mezz.jei.api.gui.drawable.IDrawable; | ||
import mezz.jei.api.gui.ingredient.IGuiFluidStackGroup; | ||
import mezz.jei.api.gui.ingredient.IGuiItemStackGroup; | ||
import mezz.jei.api.helpers.IGuiHelper; | ||
import mezz.jei.api.ingredients.IIngredients; | ||
import mezz.jei.api.recipe.category.IRecipeCategory; | ||
import net.minecraft.client.resources.I18n; | ||
import net.minecraft.fluid.Fluids; | ||
import net.minecraft.util.ResourceLocation; | ||
import net.minecraftforge.fluids.FluidStack; | ||
import network.pxl8.stonecatalysts.lib.LibMeta; | ||
|
||
import java.util.Collections; | ||
import java.util.List; | ||
|
||
public class CobblestoneCatalystCategory implements IRecipeCategory<StoneCatalystRecipe> { | ||
private final IDrawable background; | ||
|
||
public CobblestoneCatalystCategory(IGuiHelper guiHelper) { | ||
this.background = guiHelper.createDrawable(new ResourceLocation(LibMeta.MOD_ID, "textures/gui/jei/cobblestone_gen.png"), 0, 0, 117, 74); | ||
} | ||
|
||
@Override | ||
public ResourceLocation getUid() { | ||
return StoneCatalystsJEIPlugin.COBBLESTONE_CATALYSTS; | ||
} | ||
|
||
@Override | ||
public Class<? extends StoneCatalystRecipe> getRecipeClass() { | ||
return StoneCatalystRecipe.class; | ||
} | ||
|
||
@Override | ||
public String getTitle() { | ||
return I18n.format("jei." + StoneCatalystsJEIPlugin.COBBLESTONE_CATALYSTS); | ||
} | ||
|
||
@Override | ||
public IDrawable getBackground() { | ||
return this.background; | ||
} | ||
|
||
@Override | ||
public IDrawable getIcon() { | ||
return null; | ||
} | ||
|
||
@Override | ||
public List<String> getTooltipStrings(StoneCatalystRecipe recipe, double mouseX, double mouseY) { | ||
String output_tooltip = I18n.format("jei.stonecatalysts:tooltip_cobblestone_catalyst"); | ||
String arrow_tooltip = I18n.format("jei.stonecatalysts:tooltip_flowing_lava"); | ||
if (mouseX > 58 && mouseX < 81 && mouseY > 36 && mouseY < 52) { | ||
return Lists.newArrayList(output_tooltip.split(",")); | ||
} | ||
if (mouseX > 18 && mouseX < 35 && mouseY > 36 && mouseY < 53) { | ||
return Lists.newArrayList(arrow_tooltip.split(",")); | ||
} | ||
return Collections.emptyList(); | ||
} | ||
|
||
@Override | ||
public void setIngredients(StoneCatalystRecipe catalystRecipe, IIngredients ingredients) { | ||
ingredients.setInput(VanillaTypes.ITEM, catalystRecipe.catalyst_in); | ||
ingredients.setOutput(VanillaTypes.ITEM, catalystRecipe.catalyst_out); | ||
} | ||
|
||
@Override | ||
public void setRecipe(IRecipeLayout layout, StoneCatalystRecipe recipe, IIngredients ingredients) { | ||
IGuiItemStackGroup group = layout.getItemStacks(); | ||
IGuiFluidStackGroup fluid_group = layout.getFluidStacks(); | ||
//Catalyst input and output | ||
group.init(0, false, 18, 55); | ||
group.set(0, recipe.catalyst_in); | ||
group.init(1, false, 94, 36); | ||
group.set(1, recipe.catalyst_out); | ||
//Lava and Water | ||
fluid_group.init(0, false, 1, 37); | ||
fluid_group.set(0, new FluidStack(Fluids.LAVA, 1000)); | ||
fluid_group.init(1, false, 37,37); | ||
fluid_group.set(1, new FluidStack(Fluids.WATER, 1000)); | ||
} | ||
} |
88 changes: 88 additions & 0 deletions
88
src/main/java/network/pxl8/stonecatalysts/compat/jei/StoneCatalystCategory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
package network.pxl8.stonecatalysts.compat.jei; | ||
|
||
import com.google.common.collect.Lists; | ||
import mezz.jei.api.constants.VanillaTypes; | ||
import mezz.jei.api.gui.IRecipeLayout; | ||
import mezz.jei.api.gui.drawable.IDrawable; | ||
import mezz.jei.api.gui.ingredient.IGuiFluidStackGroup; | ||
import mezz.jei.api.gui.ingredient.IGuiItemStackGroup; | ||
import mezz.jei.api.helpers.IGuiHelper; | ||
import mezz.jei.api.ingredients.IIngredients; | ||
import mezz.jei.api.recipe.category.IRecipeCategory; | ||
import net.minecraft.client.resources.I18n; | ||
import net.minecraft.fluid.Fluids; | ||
import net.minecraft.util.ResourceLocation; | ||
import net.minecraftforge.fluids.FluidStack; | ||
import network.pxl8.stonecatalysts.lib.LibMeta; | ||
|
||
import java.util.Collections; | ||
import java.util.List; | ||
|
||
|
||
public class StoneCatalystCategory implements IRecipeCategory<StoneCatalystRecipe> { | ||
private final IDrawable background; | ||
|
||
public StoneCatalystCategory(IGuiHelper guiHelper) { | ||
this.background = guiHelper.createDrawable(new ResourceLocation(LibMeta.MOD_ID, "textures/gui/jei/stone_gen.png"), 0, 0, 117, 74); | ||
} | ||
|
||
@Override | ||
public ResourceLocation getUid() { | ||
return StoneCatalystsJEIPlugin.STONE_CATALYSTS; | ||
} | ||
|
||
@Override | ||
public Class<? extends StoneCatalystRecipe> getRecipeClass() { | ||
return StoneCatalystRecipe.class; | ||
} | ||
|
||
@Override | ||
public String getTitle() { | ||
return I18n.format("jei." + StoneCatalystsJEIPlugin.STONE_CATALYSTS); | ||
} | ||
|
||
@Override | ||
public IDrawable getBackground() { | ||
return this.background; | ||
} | ||
|
||
@Override | ||
public IDrawable getIcon() { | ||
return null; | ||
} | ||
|
||
@Override | ||
public List<String> getTooltipStrings(StoneCatalystRecipe recipe, double mouseX, double mouseY) { | ||
String output_tooltip = I18n.format("jei.stonecatalysts:tooltip_stone_catalyst"); | ||
String arrow_tooltip = I18n.format("jei.stonecatalysts:tooltip_flowing_lava"); | ||
if (mouseX > 58 && mouseX < 81 && mouseY > 36 && mouseY < 52) { | ||
return Lists.newArrayList(output_tooltip.split(",")); | ||
} | ||
if (mouseX > 18 && mouseX < 35 && mouseY > 18 && mouseY < 35) { | ||
return Lists.newArrayList(arrow_tooltip.split(",")); | ||
} | ||
return Collections.emptyList(); | ||
} | ||
|
||
@Override | ||
public void setIngredients(StoneCatalystRecipe catalystRecipe, IIngredients ingredients) { | ||
ingredients.setInput(VanillaTypes.ITEM, catalystRecipe.catalyst_in); | ||
ingredients.setOutput(VanillaTypes.ITEM, catalystRecipe.catalyst_out); | ||
} | ||
|
||
@Override | ||
public void setRecipe(IRecipeLayout layout, StoneCatalystRecipe recipe, IIngredients ingredients) { | ||
IGuiItemStackGroup group = layout.getItemStacks(); | ||
IGuiFluidStackGroup fluid_group = layout.getFluidStacks(); | ||
//Catalyst input and output | ||
group.init(0, false, 18, 55); | ||
group.set(0, recipe.catalyst_in); | ||
group.init(1, false, 94, 36); | ||
group.set(1, recipe.catalyst_out); | ||
//Lava and Water | ||
fluid_group.init(0, false, 19, 1); | ||
fluid_group.set(0, new FluidStack(Fluids.LAVA, 1000)); | ||
fluid_group.init(1, false, 19,37); | ||
fluid_group.set(1, new FluidStack(Fluids.WATER, 1000)); | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
src/main/java/network/pxl8/stonecatalysts/compat/jei/StoneCatalystRecipe.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package network.pxl8.stonecatalysts.compat.jei; | ||
|
||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.util.ResourceLocation; | ||
|
||
public class StoneCatalystRecipe { | ||
public final ResourceLocation name; | ||
public final ItemStack catalyst_in; | ||
public final ItemStack catalyst_out; | ||
|
||
public StoneCatalystRecipe(ResourceLocation name, ItemStack catalyst) { | ||
this(name, catalyst, catalyst); | ||
} | ||
|
||
public StoneCatalystRecipe(ResourceLocation name, ItemStack catalyst_in, ItemStack catalyst_out) { | ||
this.name = name; | ||
this.catalyst_in = catalyst_in; | ||
this.catalyst_out = catalyst_out; | ||
} | ||
|
||
public StoneCatalystRecipe registerStone() { | ||
StoneCatalystsJEIPlugin.STONE_CATALYST_RECIPES.put(this.name, this); | ||
return this; | ||
} | ||
|
||
public StoneCatalystRecipe registerCobblestone() { | ||
StoneCatalystsJEIPlugin.COBBLESTONE_CATALYST_RECIPES.put(this.name, this); | ||
return this; | ||
} | ||
} |
55 changes: 55 additions & 0 deletions
55
src/main/java/network/pxl8/stonecatalysts/compat/jei/StoneCatalystsJEIPlugin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
package network.pxl8.stonecatalysts.compat.jei; | ||
|
||
import mezz.jei.api.IModPlugin; | ||
import mezz.jei.api.JeiPlugin; | ||
import mezz.jei.api.constants.VanillaTypes; | ||
import mezz.jei.api.helpers.IGuiHelper; | ||
import mezz.jei.api.registration.IRecipeCatalystRegistration; | ||
import mezz.jei.api.registration.IRecipeCategoryRegistration; | ||
import mezz.jei.api.registration.IRecipeRegistration; | ||
import net.minecraft.client.resources.I18n; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.item.Items; | ||
import net.minecraft.util.ResourceLocation; | ||
import network.pxl8.stonecatalysts.lib.LibMeta; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
@JeiPlugin | ||
public class StoneCatalystsJEIPlugin implements IModPlugin { | ||
public static final ResourceLocation STONE_CATALYSTS = new ResourceLocation(LibMeta.MOD_ID, "category_stone_gen"); | ||
public static final ResourceLocation COBBLESTONE_CATALYSTS = new ResourceLocation(LibMeta.MOD_ID, "category_cobblestone_gen"); | ||
public static final Map<ResourceLocation, StoneCatalystRecipe> STONE_CATALYST_RECIPES = new HashMap<>(); | ||
public static final Map<ResourceLocation, StoneCatalystRecipe> COBBLESTONE_CATALYST_RECIPES = new HashMap<>(); | ||
|
||
@Override | ||
public ResourceLocation getPluginUid() { | ||
return new ResourceLocation(LibMeta.MOD_ID, "jei_plugin"); | ||
} | ||
|
||
@Override | ||
public void registerCategories(IRecipeCategoryRegistration registration) { | ||
IGuiHelper guiHelper = registration.getJeiHelpers().getGuiHelper(); | ||
registration.addRecipeCategories( | ||
new StoneCatalystCategory(guiHelper), | ||
new CobblestoneCatalystCategory(guiHelper) | ||
); | ||
} | ||
|
||
@Override | ||
public void registerRecipes(IRecipeRegistration registration) { | ||
registration.addRecipes(STONE_CATALYST_RECIPES.values(), STONE_CATALYSTS); | ||
registration.addRecipes(COBBLESTONE_CATALYST_RECIPES.values(), COBBLESTONE_CATALYSTS); | ||
|
||
registration.addIngredientInfo(new ItemStack(Items.LAVA_BUCKET), VanillaTypes.ITEM, I18n.format("jei.stonecatalysts:information_tab_desc")); | ||
} | ||
|
||
@Override | ||
public void registerRecipeCatalysts(IRecipeCatalystRegistration registration) { | ||
registration.addRecipeCatalyst(new ItemStack(Items.LAVA_BUCKET), STONE_CATALYSTS); | ||
registration.addRecipeCatalyst(new ItemStack(Items.WATER_BUCKET), STONE_CATALYSTS); | ||
registration.addRecipeCatalyst(new ItemStack(Items.LAVA_BUCKET), COBBLESTONE_CATALYSTS); | ||
registration.addRecipeCatalyst(new ItemStack(Items.WATER_BUCKET), COBBLESTONE_CATALYSTS); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.