mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-11-09 20:41:23 +01:00
Fix recipe layout for small shapes
This commit is contained in:
parent
a8a8b52977
commit
13a847e0ab
@ -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());
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user