Skip to content

Commit

Permalink
1.12.2-1.3b: Possibly a fix for #48
Browse files Browse the repository at this point in the history
  • Loading branch information
WanionCane committed Nov 27, 2017
1 parent bec1fa1 commit ca6a3fd
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 12 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ apply plugin: 'net.minecraftforge.gradle.forge'
//Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.


version = "1.12.2-1.3"
version = "1.12.2-1.3b"
group = "wanion.unidict" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "UniDict"

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/wanion/unidict/common/Reference.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public final class Reference
{
public static final String MOD_ID = "unidict";
public static final String MOD_NAME = "UniDict";
public static final String MOD_VERSION = "1.12.2-1.3";
public static final String MOD_VERSION = "1.12.2-1.3b";
public static final String DEPENDENCIES = "required-after:wanionlib@[1.12.2-1.2,);after:*";
public static final char SLASH = separatorChar;
public static final String MC_VERSION = "[1.12,]";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
final class ForestryIntegration extends AbstractIntegrationThread
{
private Set<ICarpenterRecipe> carpenterRecipes = Util.getField(CarpenterRecipeManager.class, "recipes", null, Set.class);
private static final RegistryNamespaced<ResourceLocation, Item> itemRegistry = Item.REGISTRY;

ForestryIntegration()
{
Expand All @@ -49,8 +48,8 @@ private void removeBadCarpenterOutputs(@Nonnull final Set<ICarpenterRecipe> carp
private void bronzeThings()
{
UniResourceContainer ingotBronze = resourceHandler.getContainer("ingotBronze");
final Item brokenBronzePickaxe = itemRegistry.getObject(new ResourceLocation("forestry", "brokenBronzePickaxe"));
final Item brokenBronzeShovel = itemRegistry.getObject(new ResourceLocation("forestry", "brokenBronzeShovel"));
final Item brokenBronzePickaxe = Item.REGISTRY.getObject(new ResourceLocation("forestry", "brokenBronzePickaxe"));
final Item brokenBronzeShovel = Item.REGISTRY.getObject(new ResourceLocation("forestry", "brokenBronzeShovel"));
if (brokenBronzePickaxe != null)
carpenterRecipes.add(new CarpenterRecipe(5, null, ItemStack.EMPTY, new ShapedRecipeCustom(ingotBronze.getMainEntry(2), "X ", " ", " ", 'X', new ItemStack(brokenBronzePickaxe))));
if (brokenBronzeShovel != null)
Expand Down
15 changes: 11 additions & 4 deletions src/main/java/wanion/unidict/recipe/IC2RecipeResearcher.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import ic2.core.recipe.AdvRecipe;
import ic2.core.recipe.AdvShapelessRecipe;
import ic2.core.recipe.RecipeInputOreDict;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.oredict.ShapedOreRecipe;
Expand All @@ -31,6 +32,8 @@

public class IC2RecipeResearcher extends AbstractRecipeResearcher<AdvRecipe, AdvShapelessRecipe>
{
private final Item ic2ForgeHammer = Item.REGISTRY.getObject(new ResourceLocation("ic2", "forge_hammer"));

@Override
public int getShapedRecipeKey(@Nonnull AdvRecipe recipe)
{
Expand Down Expand Up @@ -155,7 +158,7 @@ else if (notEmpty)
public ShapelessOreRecipe getNewShapelessRecipe(@Nonnull final AdvShapelessRecipe recipe)
{
final List<Object> newInputs = new ArrayList<>();
if (itemStacksOnly){
if (itemStacksOnly) {
for (final IRecipeInput recipeInput : recipe.input) {
final List<ItemStack> inputs = recipeInput.getInputs();
if (!inputs.isEmpty())
Expand All @@ -171,8 +174,12 @@ public ShapelessOreRecipe getNewShapelessRecipe(@Nonnull final AdvShapelessRecip
newInputs.add(oreName);
else if (notEmpty)
newInputs.add(recipeInput.getInputs().get(0));
} else
newInputs.add(oreName);
} else {
if (oreName.equals("craftingToolForgeHammer") && ic2ForgeHammer != null)
newInputs.add(new ItemStack(ic2ForgeHammer, 1, 32767));
else
newInputs.add(oreName);
}
}
}
final UniResourceContainer outputContainer = resourceHandler.getContainer(recipe.getRecipeOutput());
Expand All @@ -187,7 +194,7 @@ else if (notEmpty)
public ShapelessOreRecipe getNewShapelessFromShapedRecipe(@Nonnull final AdvRecipe recipe)
{
final List<Object> newInputs = new ArrayList<>();
if (itemStacksOnly){
if (itemStacksOnly) {
for (final IRecipeInput recipeInput : recipe.input) {
final List<ItemStack> inputs = recipeInput.getInputs();
if (!inputs.isEmpty())
Expand Down
6 changes: 3 additions & 3 deletions src/main/resources/mcmod.info
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[
{
"modId": "unidict",
"modid": "unidict",
"name": "UniDict",
"description": "a mod about unifying all the things.",
"version": "1.12.2-1.3",
"version": "1.12.2-1.3b",
"mcversion": "${mcversion}",
"url": "http://minecraft.curseforge.com/projects/unidict",
"updateUrl": "",
Expand All @@ -13,4 +13,4 @@
"screenshots": [],
"dependencies": []
}
]
]
6 changes: 6 additions & 0 deletions src/main/resources/pack.mcmeta
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"pack": {
"pack_format": 3,
"description": "UniDict Resources"
}
}

0 comments on commit ca6a3fd

Please sign in to comment.