From 8f32281cc06aa933507965db2d07605b9f245a27 Mon Sep 17 00:00:00 2001 From: jani270 <69345714+jani270@users.noreply.github.com> Date: Mon, 26 Feb 2024 20:01:25 +0100 Subject: Added option to open the skyblock recipe menu with a keybind (#1029) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Added option to open the skyblock recipe menu with a keybind * Use streams to find crafting recipe --------- Co-authored-by: Linnea Gräf --- .../notenoughupdates/util/StreamExtL.java | 28 ++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 src/main/java/io/github/moulberry/notenoughupdates/util/StreamExtL.java (limited to 'src/main/java/io/github/moulberry/notenoughupdates/util/StreamExtL.java') diff --git a/src/main/java/io/github/moulberry/notenoughupdates/util/StreamExtL.java b/src/main/java/io/github/moulberry/notenoughupdates/util/StreamExtL.java new file mode 100644 index 00000000..2fbdbf7d --- /dev/null +++ b/src/main/java/io/github/moulberry/notenoughupdates/util/StreamExtL.java @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2024 NotEnoughUpdates contributors + * + * This file is part of NotEnoughUpdates. + * + * NotEnoughUpdates 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, either + * version 3 of the License, or (at your option) any later version. + * + * NotEnoughUpdates 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 NotEnoughUpdates. If not, see . + */ + +package io.github.moulberry.notenoughupdates.util; + +import java.util.stream.Stream; + +public class StreamExtL { + public static Stream filterIsInstance(Stream self, Class uClass) { + return self.filter(uClass::isInstance).map(uClass::cast); + } +} -- cgit