Skip to content

Commit 9f52950

Browse files
committed
Fixed JEI double recipes and removed updating recipes after changed with In-game config, causes of changes in JEI, refresh resources now instead
1 parent 4cf092f commit 9f52950

File tree

14 files changed

+19
-97
lines changed

14 files changed

+19
-97
lines changed

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,15 @@ group = "se.gory_moon" // http://maven.apache.org/guides/mini/guide-naming-conve
3939
archivesBaseName = "HorsePower"
4040

4141
minecraft {
42-
version = "1.12-14.21.1.2443"
42+
version = "1.12.2-14.23.0.2529"
4343
runDir = "run"
4444

4545
// the mappings can be changed at any time, and must be in the following format.
4646
// snapshot_YYYYMMDD snapshot are built nightly.
4747
// stable_# stables are built at the discretion of the MCP team.
4848
// Use non-default mappings at your own risk. they may not always work.
4949
// simply re-run your setup task after changing the mappings to update your workspace.
50-
mappings = "snapshot_20170707"
50+
mappings = "snapshot_20171003"
5151
// makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
5252

5353
replaceIn "Reference.java"

build.properties

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
mod_version=2.5.7
1+
mod_version=2.5.8
22
local_build=1
33

4-
mc_version=1.12
5-
jei_version=4.7.5.83
6-
top_version=1.4.15-8
4+
mc_version=1.12.2
5+
jei_version=4.8.0.111
6+
top_version=1.4.19-11
77
waila_version=1.7.1_1.11.2
8-
hwyla_version=1.8.19-B33_1.12
8+
hwyla_version=1.8.22-B37_1.12
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Sat Jun 03 03:43:45 CEST 2017
1+
#Mon Sep 14 12:28:28 PDT 2015
22
distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14-bin.zip

src/main/java/se/gory_moon/horsepower/Configs.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public class Configs {
2222
@Config.LangKey("config.gui.general")
2323
public static General general = new General();
2424

25-
@Comment("Contains the customizable recipes")
25+
@Comment({"Contains the customizable recipes", "For the recipes to show in JEI the resources needs to be reloaded, F3+T"})
2626
@Config.LangKey("config.gui.recipes")
2727
public static Recipes recipes = new Recipes();
2828

src/main/java/se/gory_moon/horsepower/HorsePowerMod.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
import org.apache.logging.log4j.Logger;
1212
import se.gory_moon.horsepower.blocks.ModBlocks;
1313
import se.gory_moon.horsepower.items.ModItems;
14-
import se.gory_moon.horsepower.jei.DummyJeiPlugin;
15-
import se.gory_moon.horsepower.jei.IJeiPlugin;
1614
import se.gory_moon.horsepower.lib.Reference;
1715
import se.gory_moon.horsepower.network.PacketHandler;
1816
import se.gory_moon.horsepower.proxy.CommonProxy;
@@ -34,7 +32,6 @@ public class HorsePowerMod {
3432

3533
public static HorsePowerCreativeTab creativeTab = new HorsePowerCreativeTab();
3634
public static ITweakerPlugin tweakerPlugin = new DummyTweakPluginImpl();
37-
public static IJeiPlugin jeiPlugin = new DummyJeiPlugin();
3835
public static Logger logger = LogManager.getLogger("HorsePower");
3936

4037
@EventHandler

src/main/java/se/gory_moon/horsepower/blocks/BlockHPBase.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state,
143143
for (Object entity : worldIn.getEntitiesWithinAABB(clazz, new AxisAlignedBB((double) x - 7.0D, (double) y - 7.0D, (double) z - 7.0D, (double) x + 7.0D, (double) y + 7.0D, (double) z + 7.0D))) {
144144
if (entity instanceof EntityCreature) {
145145
EntityCreature tmp = (EntityCreature) entity;
146-
if ((tmp.getLeashed() && tmp.getLeashedToEntity() == playerIn)) {
146+
if ((tmp.getLeashed() && tmp.getLeashHolder() == playerIn)) {
147147
creature = tmp;
148148
break search;
149149
}

src/main/java/se/gory_moon/horsepower/blocks/ModBlocks.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,10 @@ public static void registerBlocks(RegistryEvent.Register<Block> event) {
4242
final IForgeRegistry<Block> registry = event.getRegistry();
4343

4444
BLOCK_PRESS_FILLER.setHarvestLevel("axe", 1);
45-
final Block[] blocks = {BLOCK_HAND_GRINDSTONE, BLOCK_GRINDSTONE, BLOCK_MANUAL_CHOPPER, BLOCK_CHOPPER, BLOCK_CHOPPER_FILLER, BLOCK_PRESS, BLOCK_PRESS_FILLER};
45+
final Block[] blocks = {BLOCK_HAND_GRINDSTONE, BLOCK_GRINDSTONE,
46+
BLOCK_MANUAL_CHOPPER, BLOCK_CHOPPER, BLOCK_CHOPPER_FILLER,
47+
BLOCK_PRESS, BLOCK_PRESS_FILLER,
48+
};
4649

4750
registry.registerAll(blocks);
4851
}

src/main/java/se/gory_moon/horsepower/jei/DummyJeiPlugin.java

Lines changed: 0 additions & 14 deletions
This file was deleted.

src/main/java/se/gory_moon/horsepower/jei/HorsePowerPlugin.java

Lines changed: 2 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
import net.minecraft.nbt.NBTTagCompound;
1111
import net.minecraftforge.oredict.OreDictionary;
1212
import se.gory_moon.horsepower.Configs;
13-
import se.gory_moon.horsepower.HorsePowerMod;
1413
import se.gory_moon.horsepower.blocks.ModBlocks;
1514
import se.gory_moon.horsepower.jei.chopping.ChoppingRecipeMaker;
1615
import se.gory_moon.horsepower.jei.chopping.ChoppingRecipeWrapper;
@@ -24,7 +23,7 @@
2423
import se.gory_moon.horsepower.recipes.*;
2524

2625
@JEIPlugin
27-
public class HorsePowerPlugin implements IModPlugin, IJeiPlugin {
26+
public class HorsePowerPlugin implements IModPlugin {
2827

2928
public static final String HAND_GRINDING = "horsepower.hand_grinding";
3029
public static final String GRINDING = "horsepower.grinding";
@@ -40,7 +39,7 @@ public class HorsePowerPlugin implements IModPlugin, IJeiPlugin {
4039

4140
@Override
4241
public void register(IModRegistry registry) {
43-
HorsePowerMod.jeiPlugin = this;
42+
4443
jeiHelpers = registry.getJeiHelpers();
4544
guiHelper = jeiHelpers.getGuiHelper();
4645
craftingGridHelper = guiHelper.createCraftingGridHelper(1, 0);
@@ -125,57 +124,4 @@ public void registerCategories(IRecipeCategoryRegistration registry) {
125124
registry.addRecipeCategories(new HorsePowerPressCategory(registry.getJeiHelpers().getGuiHelper()));
126125
}
127126

128-
@Override
129-
public void removeRecipe() {
130-
if (Configs.recipes.useSeperateGrindstoneRecipes) {
131-
for (GrindstoneRecipeWrapper recipe : GrindingRecipeMaker.getGrindstoneRecipes(jeiHelpers, true)) {
132-
jeiRuntime.getRecipeRegistry().removeRecipe(recipe, HAND_GRINDING);
133-
}
134-
}
135-
136-
for (GrindstoneRecipeWrapper recipe: GrindingRecipeMaker.getGrindstoneRecipes(jeiHelpers, false)) {
137-
jeiRuntime.getRecipeRegistry().removeRecipe(recipe, GRINDING);
138-
}
139-
140-
if (Configs.recipes.useSeperateChoppingRecipes && Configs.general.enableHandChoppingBlock) {
141-
for (ChoppingRecipeWrapper recipe : ChoppingRecipeMaker.getChoppingRecipes(jeiHelpers, true)) {
142-
jeiRuntime.getRecipeRegistry().removeRecipe(recipe, MANUAL_CHOPPING);
143-
}
144-
}
145-
146-
for (ChoppingRecipeWrapper recipe: ChoppingRecipeMaker.getChoppingRecipes(jeiHelpers, false)) {
147-
jeiRuntime.getRecipeRegistry().removeRecipe(recipe, CHOPPING);
148-
}
149-
150-
for (PressRecipeWrapper recipe: PressRecipeMaker.getPressRecipes(jeiHelpers)) {
151-
jeiRuntime.getRecipeRegistry().removeRecipe(recipe, PRESS);
152-
}
153-
}
154-
155-
@Override
156-
public void addRecipes() {
157-
if (Configs.recipes.useSeperateGrindstoneRecipes) {
158-
for (GrindstoneRecipeWrapper recipe : GrindingRecipeMaker.getGrindstoneRecipes(jeiHelpers, true)) {
159-
jeiRuntime.getRecipeRegistry().addRecipe(recipe, HAND_GRINDING);
160-
}
161-
}
162-
163-
for (GrindstoneRecipeWrapper recipe: GrindingRecipeMaker.getGrindstoneRecipes(jeiHelpers, false)) {
164-
jeiRuntime.getRecipeRegistry().addRecipe(recipe, GRINDING);
165-
}
166-
167-
if (Configs.recipes.useSeperateChoppingRecipes && Configs.general.enableHandChoppingBlock) {
168-
for (ChoppingRecipeWrapper recipe : ChoppingRecipeMaker.getChoppingRecipes(jeiHelpers, true)) {
169-
jeiRuntime.getRecipeRegistry().addRecipe(recipe, MANUAL_CHOPPING);
170-
}
171-
}
172-
173-
for (ChoppingRecipeWrapper recipe: ChoppingRecipeMaker.getChoppingRecipes(jeiHelpers, false)) {
174-
jeiRuntime.getRecipeRegistry().addRecipe(recipe, CHOPPING);
175-
}
176-
177-
for (PressRecipeWrapper recipe: PressRecipeMaker.getPressRecipes(jeiHelpers)) {
178-
jeiRuntime.getRecipeRegistry().addRecipe(recipe, PRESS);
179-
}
180-
}
181127
}

0 commit comments

Comments
 (0)