Fixes #117 "a way to clear patterns"

This commit is contained in:
Raoul Van den Berge
2016-06-17 22:59:17 +02:00
parent 9ddbc64f20
commit c073de5cd3
2 changed files with 15 additions and 0 deletions

View File

@@ -8,6 +8,7 @@
**Features**
- Added shift clicking support to every inventory (for upgrades etc)
- Added grid filtering options: @ for searching on mod items, # for searching on tooltips
- Added a way to clear patterns (shift + right click in inventory)
- Tweaked some recipes
- Tweaked energy usage in some machines

View File

@@ -6,8 +6,13 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.util.ActionResult;
import net.minecraft.util.EnumActionResult;
import net.minecraft.util.EnumHand;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.world.World;
import net.minecraftforge.common.util.Constants;
import refinedstorage.RefinedStorageItems;
import refinedstorage.RefinedStorageUtils;
import java.util.List;
@@ -37,6 +42,15 @@ public class ItemPattern extends ItemBase {
}
}
@Override
public ActionResult<ItemStack> onItemRightClick(ItemStack stack, World world, EntityPlayer player, EnumHand hand) {
if (!world.isRemote && player.isSneaking()) {
return new ActionResult(EnumActionResult.SUCCESS, new ItemStack(RefinedStorageItems.PATTERN));
}
return new ActionResult(EnumActionResult.PASS, stack);
}
public static void addInput(ItemStack pattern, ItemStack stack) {
add(pattern, stack, NBT_INPUTS);
}