From 3e44bc3e0e59d062b2334547e247f935ea2fc388 Mon Sep 17 00:00:00 2001 From: Jason Taylor Date: Thu, 26 Apr 2018 09:39:15 -0700 Subject: [PATCH 1/4] Update .gitignore to exclude idea files --- .gitignore | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 2e6d260..52f922f 100644 --- a/.gitignore +++ b/.gitignore @@ -38,6 +38,7 @@ $RECYCLE.BIN/ .TemporaryItems .Trashes .VolumeIcon.icns +*.iml # Directories potentially created on remote AFP share .AppleDB @@ -47,4 +48,5 @@ Temporary Items .apdisk build/ bin/ -.gradle/ \ No newline at end of file +.gradle/ +.idea \ No newline at end of file From 7d0d6ed11f84056f4ea11d832856413206fc3c29 Mon Sep 17 00:00:00 2001 From: Jason Taylor Date: Thu, 26 Apr 2018 09:41:36 -0700 Subject: [PATCH 2/4] Update JEI version to 4.9.1.169 --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 5fe6a22..639d38c 100644 --- a/build.gradle +++ b/build.gradle @@ -69,7 +69,7 @@ repositories { } dependencies { - deobfCompile "mezz.jei:jei_1.12.2:4.8.5.133" + deobfCompile "mezz.jei:jei_1.12.2:4.9.1.169" deobfCompile "CraftTweaker2:CraftTweaker2-MC1120-Main:1.12-4.0.9.289" } From 88adef216d9b90270a930d7da81079eb3a8dbb3d Mon Sep 17 00:00:00 2001 From: Jason Taylor Date: Thu, 26 Apr 2018 10:24:48 -0700 Subject: [PATCH 3/4] Add JEI support for workstump --- .gitignore | 4 +- .../primal_tech/jei/JEIPluginWorkstump.java | 58 +++++++++++++++++++ .../jei/workstump/WorkStumpCategory.java | 48 +++++++++++++++ .../jei/workstump/WorkStumpIICategory.java | 48 +++++++++++++++ 4 files changed, 157 insertions(+), 1 deletion(-) create mode 100644 src/main/java/primal_tech/jei/JEIPluginWorkstump.java create mode 100644 src/main/java/primal_tech/jei/workstump/WorkStumpCategory.java create mode 100644 src/main/java/primal_tech/jei/workstump/WorkStumpIICategory.java diff --git a/.gitignore b/.gitignore index 52f922f..452a89c 100644 --- a/.gitignore +++ b/.gitignore @@ -49,4 +49,6 @@ Temporary Items build/ bin/ .gradle/ -.idea \ No newline at end of file +.idea +run/ +out/ \ No newline at end of file diff --git a/src/main/java/primal_tech/jei/JEIPluginWorkstump.java b/src/main/java/primal_tech/jei/JEIPluginWorkstump.java new file mode 100644 index 0000000..1f5ea27 --- /dev/null +++ b/src/main/java/primal_tech/jei/JEIPluginWorkstump.java @@ -0,0 +1,58 @@ +package primal_tech.jei; + +import mezz.jei.api.*; +import mezz.jei.api.recipe.IRecipeCategoryRegistration; +import mezz.jei.plugins.vanilla.crafting.CraftingRecipeChecker; +import mezz.jei.plugins.vanilla.crafting.ShapedOreRecipeWrapper; +import mezz.jei.plugins.vanilla.crafting.ShapedRecipesWrapper; +import mezz.jei.plugins.vanilla.crafting.ShapelessRecipeWrapper; +import net.minecraft.client.gui.inventory.GuiCrafting; +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.ShapedRecipes; +import net.minecraft.item.crafting.ShapelessRecipes; +import net.minecraftforge.oredict.ShapedOreRecipe; +import net.minecraftforge.oredict.ShapelessOreRecipe; +import primal_tech.ModBlocks; +import primal_tech.jei.workstump.WorkStumpCategory; +import primal_tech.jei.workstump.WorkStumpIICategory; + +@JEIPlugin +public class JEIPluginWorkstump + implements IModPlugin { + + @Override + public void registerCategories(IRecipeCategoryRegistration registry) { + + IJeiHelpers jeiHelpers = registry.getJeiHelpers(); + IGuiHelper guiHelper = jeiHelpers.getGuiHelper(); + + registry.addRecipeCategories( + new WorkStumpCategory(guiHelper), + new WorkStumpIICategory(guiHelper) + ); + } + + @Override + public void register(IModRegistry registry) { + + IJeiHelpers jeiHelpers = registry.getJeiHelpers(); + + this.create(registry, jeiHelpers, WorkStumpCategory.UID); + registry.addRecipeCatalyst(new ItemStack(ModBlocks.WORK_STUMP), WorkStumpCategory.UID); + + this.create(registry, jeiHelpers, WorkStumpIICategory.UID); + registry.addRecipeCatalyst(new ItemStack(ModBlocks.WORK_STUMP_II), WorkStumpIICategory.UID); + } + + private void create(IModRegistry registry, IJeiHelpers jeiHelpers, String uid) { + + registry.addRecipes(CraftingRecipeChecker.getValidRecipes(jeiHelpers), uid); + + registry.handleRecipes(ShapedOreRecipe.class, recipe -> new ShapedOreRecipeWrapper(jeiHelpers, recipe), uid); + registry.handleRecipes(ShapedRecipes.class, recipe -> new ShapedRecipesWrapper(jeiHelpers, recipe), uid); + registry.handleRecipes(ShapelessOreRecipe.class, recipe -> new ShapelessRecipeWrapper<>(jeiHelpers, recipe), uid); + registry.handleRecipes(ShapelessRecipes.class, recipe -> new ShapelessRecipeWrapper<>(jeiHelpers, recipe), uid); + + registry.addRecipeClickArea(GuiCrafting.class, 88, 32, 28, 23, uid); + } +} diff --git a/src/main/java/primal_tech/jei/workstump/WorkStumpCategory.java b/src/main/java/primal_tech/jei/workstump/WorkStumpCategory.java new file mode 100644 index 0000000..9e335b0 --- /dev/null +++ b/src/main/java/primal_tech/jei/workstump/WorkStumpCategory.java @@ -0,0 +1,48 @@ +package primal_tech.jei.workstump; + +import mezz.jei.api.IGuiHelper; +import mezz.jei.api.gui.IDrawable; +import mezz.jei.plugins.vanilla.crafting.CraftingRecipeCategory; +import mezz.jei.util.Translator; +import net.minecraft.item.ItemStack; +import primal_tech.ModBlocks; + +public class WorkStumpCategory + extends CraftingRecipeCategory { + + public static final String UID = "primal_tech.workstump"; + + private final String localizedName; + private final IDrawable icon; + + public WorkStumpCategory(IGuiHelper guiHelper) { + + super(guiHelper); + this.localizedName = Translator.translateToLocal("tile.primal_tech.work_stump.name"); + this.icon = guiHelper.createDrawableIngredient(new ItemStack(ModBlocks.WORK_STUMP)); + } + + @Override + public String getModName() { + + return "Primal Tech"; + } + + @Override + public String getTitle() { + + return this.localizedName; + } + + @Override + public String getUid() { + + return UID; + } + + @Override + public IDrawable getIcon() { + + return this.icon; + } +} diff --git a/src/main/java/primal_tech/jei/workstump/WorkStumpIICategory.java b/src/main/java/primal_tech/jei/workstump/WorkStumpIICategory.java new file mode 100644 index 0000000..c0c6b92 --- /dev/null +++ b/src/main/java/primal_tech/jei/workstump/WorkStumpIICategory.java @@ -0,0 +1,48 @@ +package primal_tech.jei.workstump; + +import mezz.jei.api.IGuiHelper; +import mezz.jei.api.gui.IDrawable; +import mezz.jei.plugins.vanilla.crafting.CraftingRecipeCategory; +import mezz.jei.util.Translator; +import net.minecraft.item.ItemStack; +import primal_tech.ModBlocks; + +public class WorkStumpIICategory + extends CraftingRecipeCategory { + + public static final String UID = "primal_tech.workstump.upgraded"; + + private final String localizedName; + private final IDrawable icon; + + public WorkStumpIICategory(IGuiHelper guiHelper) { + + super(guiHelper); + this.localizedName = Translator.translateToLocal("tile.primal_tech.work_stump_upgraded.name"); + this.icon = guiHelper.createDrawableIngredient(new ItemStack(ModBlocks.WORK_STUMP_II)); + } + + @Override + public String getModName() { + + return "Primal Tech"; + } + + @Override + public String getTitle() { + + return this.localizedName; + } + + @Override + public String getUid() { + + return UID; + } + + @Override + public IDrawable getIcon() { + + return this.icon; + } +} From fc1dceeb0fd4d26d7ad81ed666f19a14c8185f2d Mon Sep 17 00:00:00 2001 From: Jason Taylor Date: Thu, 26 Apr 2018 11:43:01 -0700 Subject: [PATCH 4/4] Simplify and fix JEI support for workstump --- .../primal_tech/jei/JEIPluginWorkStump.java | 20 +++++++ .../primal_tech/jei/JEIPluginWorkstump.java | 58 ------------------- .../jei/workstump/WorkStumpCategory.java | 48 --------------- .../jei/workstump/WorkStumpIICategory.java | 48 --------------- 4 files changed, 20 insertions(+), 154 deletions(-) create mode 100644 src/main/java/primal_tech/jei/JEIPluginWorkStump.java delete mode 100644 src/main/java/primal_tech/jei/JEIPluginWorkstump.java delete mode 100644 src/main/java/primal_tech/jei/workstump/WorkStumpCategory.java delete mode 100644 src/main/java/primal_tech/jei/workstump/WorkStumpIICategory.java diff --git a/src/main/java/primal_tech/jei/JEIPluginWorkStump.java b/src/main/java/primal_tech/jei/JEIPluginWorkStump.java new file mode 100644 index 0000000..ba677cf --- /dev/null +++ b/src/main/java/primal_tech/jei/JEIPluginWorkStump.java @@ -0,0 +1,20 @@ +package primal_tech.jei; + +import mezz.jei.api.IModPlugin; +import mezz.jei.api.IModRegistry; +import mezz.jei.api.JEIPlugin; +import mezz.jei.api.recipe.VanillaRecipeCategoryUid; +import net.minecraft.item.ItemStack; +import primal_tech.ModBlocks; + +@JEIPlugin +public class JEIPluginWorkStump + implements IModPlugin { + + @Override + public void register(IModRegistry registry) { + + registry.addRecipeCatalyst(new ItemStack(ModBlocks.WORK_STUMP), VanillaRecipeCategoryUid.CRAFTING); + registry.addRecipeCatalyst(new ItemStack(ModBlocks.WORK_STUMP_II), VanillaRecipeCategoryUid.CRAFTING); + } +} diff --git a/src/main/java/primal_tech/jei/JEIPluginWorkstump.java b/src/main/java/primal_tech/jei/JEIPluginWorkstump.java deleted file mode 100644 index 1f5ea27..0000000 --- a/src/main/java/primal_tech/jei/JEIPluginWorkstump.java +++ /dev/null @@ -1,58 +0,0 @@ -package primal_tech.jei; - -import mezz.jei.api.*; -import mezz.jei.api.recipe.IRecipeCategoryRegistration; -import mezz.jei.plugins.vanilla.crafting.CraftingRecipeChecker; -import mezz.jei.plugins.vanilla.crafting.ShapedOreRecipeWrapper; -import mezz.jei.plugins.vanilla.crafting.ShapedRecipesWrapper; -import mezz.jei.plugins.vanilla.crafting.ShapelessRecipeWrapper; -import net.minecraft.client.gui.inventory.GuiCrafting; -import net.minecraft.item.ItemStack; -import net.minecraft.item.crafting.ShapedRecipes; -import net.minecraft.item.crafting.ShapelessRecipes; -import net.minecraftforge.oredict.ShapedOreRecipe; -import net.minecraftforge.oredict.ShapelessOreRecipe; -import primal_tech.ModBlocks; -import primal_tech.jei.workstump.WorkStumpCategory; -import primal_tech.jei.workstump.WorkStumpIICategory; - -@JEIPlugin -public class JEIPluginWorkstump - implements IModPlugin { - - @Override - public void registerCategories(IRecipeCategoryRegistration registry) { - - IJeiHelpers jeiHelpers = registry.getJeiHelpers(); - IGuiHelper guiHelper = jeiHelpers.getGuiHelper(); - - registry.addRecipeCategories( - new WorkStumpCategory(guiHelper), - new WorkStumpIICategory(guiHelper) - ); - } - - @Override - public void register(IModRegistry registry) { - - IJeiHelpers jeiHelpers = registry.getJeiHelpers(); - - this.create(registry, jeiHelpers, WorkStumpCategory.UID); - registry.addRecipeCatalyst(new ItemStack(ModBlocks.WORK_STUMP), WorkStumpCategory.UID); - - this.create(registry, jeiHelpers, WorkStumpIICategory.UID); - registry.addRecipeCatalyst(new ItemStack(ModBlocks.WORK_STUMP_II), WorkStumpIICategory.UID); - } - - private void create(IModRegistry registry, IJeiHelpers jeiHelpers, String uid) { - - registry.addRecipes(CraftingRecipeChecker.getValidRecipes(jeiHelpers), uid); - - registry.handleRecipes(ShapedOreRecipe.class, recipe -> new ShapedOreRecipeWrapper(jeiHelpers, recipe), uid); - registry.handleRecipes(ShapedRecipes.class, recipe -> new ShapedRecipesWrapper(jeiHelpers, recipe), uid); - registry.handleRecipes(ShapelessOreRecipe.class, recipe -> new ShapelessRecipeWrapper<>(jeiHelpers, recipe), uid); - registry.handleRecipes(ShapelessRecipes.class, recipe -> new ShapelessRecipeWrapper<>(jeiHelpers, recipe), uid); - - registry.addRecipeClickArea(GuiCrafting.class, 88, 32, 28, 23, uid); - } -} diff --git a/src/main/java/primal_tech/jei/workstump/WorkStumpCategory.java b/src/main/java/primal_tech/jei/workstump/WorkStumpCategory.java deleted file mode 100644 index 9e335b0..0000000 --- a/src/main/java/primal_tech/jei/workstump/WorkStumpCategory.java +++ /dev/null @@ -1,48 +0,0 @@ -package primal_tech.jei.workstump; - -import mezz.jei.api.IGuiHelper; -import mezz.jei.api.gui.IDrawable; -import mezz.jei.plugins.vanilla.crafting.CraftingRecipeCategory; -import mezz.jei.util.Translator; -import net.minecraft.item.ItemStack; -import primal_tech.ModBlocks; - -public class WorkStumpCategory - extends CraftingRecipeCategory { - - public static final String UID = "primal_tech.workstump"; - - private final String localizedName; - private final IDrawable icon; - - public WorkStumpCategory(IGuiHelper guiHelper) { - - super(guiHelper); - this.localizedName = Translator.translateToLocal("tile.primal_tech.work_stump.name"); - this.icon = guiHelper.createDrawableIngredient(new ItemStack(ModBlocks.WORK_STUMP)); - } - - @Override - public String getModName() { - - return "Primal Tech"; - } - - @Override - public String getTitle() { - - return this.localizedName; - } - - @Override - public String getUid() { - - return UID; - } - - @Override - public IDrawable getIcon() { - - return this.icon; - } -} diff --git a/src/main/java/primal_tech/jei/workstump/WorkStumpIICategory.java b/src/main/java/primal_tech/jei/workstump/WorkStumpIICategory.java deleted file mode 100644 index c0c6b92..0000000 --- a/src/main/java/primal_tech/jei/workstump/WorkStumpIICategory.java +++ /dev/null @@ -1,48 +0,0 @@ -package primal_tech.jei.workstump; - -import mezz.jei.api.IGuiHelper; -import mezz.jei.api.gui.IDrawable; -import mezz.jei.plugins.vanilla.crafting.CraftingRecipeCategory; -import mezz.jei.util.Translator; -import net.minecraft.item.ItemStack; -import primal_tech.ModBlocks; - -public class WorkStumpIICategory - extends CraftingRecipeCategory { - - public static final String UID = "primal_tech.workstump.upgraded"; - - private final String localizedName; - private final IDrawable icon; - - public WorkStumpIICategory(IGuiHelper guiHelper) { - - super(guiHelper); - this.localizedName = Translator.translateToLocal("tile.primal_tech.work_stump_upgraded.name"); - this.icon = guiHelper.createDrawableIngredient(new ItemStack(ModBlocks.WORK_STUMP_II)); - } - - @Override - public String getModName() { - - return "Primal Tech"; - } - - @Override - public String getTitle() { - - return this.localizedName; - } - - @Override - public String getUid() { - - return UID; - } - - @Override - public IDrawable getIcon() { - - return this.icon; - } -}