Fixed ShapedOre recipes not laying out correctly with the guidebook.

This commit is contained in:
LexManos committed 2017-09-14 14:32:03 -07:00
1 parent 883109182d
commit 036191cd52
8 files changed
+134 -3

No files matched your search

@@ -0,0 +1,32 @@
/*
* Minecraft Forge
* Copyright (c) 2016.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation version 2.1
* of the License.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
package net.minecraftforge.common.crafting;
import net.minecraft.item.crafting.IRecipe;
/**
* Used to mark a recipe that shape matters so that the recipe
* book and auto crafting picks the correct shape.
* Note: These methods can't be named 'getHeight' or 'getWidth' due to obfusication issues.
*/
public interface IShapedRecipe extends IRecipe
{
public int getRecipeWidth();
public int getRecipeHeight();
}
@@ -32,6 +32,7 @@ import net.minecraft.world.World;
import net.minecraftforge.common.ForgeHooks;
import net.minecraftforge.common.crafting.CraftingHelper;
import net.minecraftforge.common.crafting.CraftingHelper.ShapedPrimer;
import net.minecraftforge.common.crafting.IShapedRecipe;
import net.minecraftforge.registries.IForgeRegistryEntry;
import net.minecraftforge.common.crafting.JsonContext;
@@ -49,7 +50,7 @@ import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonSyntaxException;
public class ShapedOreRecipe extends IForgeRegistryEntry.Impl<IRecipe> implements IRecipe
public class ShapedOreRecipe extends IForgeRegistryEntry.Impl<IRecipe> implements IShapedRecipe
{
//Added in for future ease of change, but hard coded for now.
public static final int MAX_CRAFT_GRID_WIDTH = 3;
@@ -154,16 +155,30 @@ public class ShapedOreRecipe extends IForgeRegistryEntry.Impl<IRecipe> implement
return this.input;
}
@Deprecated //Use IShapedRecipe.getRecipeWidth
public int getWidth()
{
return width;
}
@Override
public int getRecipeWidth()
{
return this.getWidth();
}
@Deprecated //Use IShapedRecipe.getRecipeHeight
public int getHeight()
{
return height;
}
@Override
public int getRecipeHeight()
{
return this.getHeight();
}
@Override
@Nonnull
public String getGroup()
-1
View File
@@ -1,2 +1 @@
MD: net/minecraft/server/management/ServerConfigurationManager/initializeConnectionToPlayer (Lnet/minecraft/network/NetworkManager;Lnet/minecraft/entity/player/EntityPlayerMP;Lnet/minecraft/network/NetHandlerPlayServer;)V net/minecraft/server/management/ServerConfigurationManager/func_72355_a (Lnet/minecraft/network/NetworkManager;Lnet/minecraft/entity/player/EntityPlayerMP;Lnet/minecraft/network/NetHandlerPlayServer;)V
MD: net/minecraftforge/fml/common/registry/FMLControlledNamespacedRegistry/getKeys ()Ljava/util/Set; net/minecraftforge/fml/common/registry/FMLControlledNamespacedRegistry/getKeys ()Ljava/util/Set;
@@ -0,0 +1,21 @@
{
"type": "forge:ore_shaped",
"pattern": [
"X",
"X",
"#"
],
"key": {
"#": {
"type": "forge:ore_dict",
"ore": "stickWood"
},
"X": {
"item": "minecraft:beetroot"
}
},
"result": {
"item": "minecraft:dirt",
"data": 0
}
}