1
0
mirror of https://github.com/essentials/Essentials.git synced 2025-08-26 07:54:41 +02:00

Fix recipe layout for small shapes

This commit is contained in:
KHobbits
2012-12-21 03:35:48 +00:00
parent 3aff740c62
commit b39ed95844

View File

@@ -84,14 +84,17 @@ public class Commandrecipe extends EssentialsCommand
public void shapedRecipe(CommandSender sender, ShapedRecipe recipe)
{
Map<Character, ItemStack> recipeMap = recipe.getIngredientMap();
if (sender instanceof Player)
{
User user = ess.getUser(sender);
user.setRecipeSee(true);
InventoryView view = user.openWorkbench(null, true);
String shapeMap = recipe.getShape().length == 2 ? " abecdfghi" : " abcdefghi";
for (Entry<Character, ItemStack> e : ((ShapedRecipe)recipe).getIngredientMap().entrySet())
{
view.setItem(" abcdefghi".indexOf(e.getKey()), e.getValue());
e.getValue().setAmount(0);
view.setItem(shapeMap.indexOf(e.getKey()), e.getValue());
}
}