Skip to content

Commit 62c0646

Browse files
committed
rewrite switch case to java 8
1 parent d43c396 commit 62c0646

1 file changed

Lines changed: 8 additions & 10 deletions

File tree

src/Oneblock/ConfigManager.java

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
import Oneblock.gui.GUI;
2525
import dev.lone.itemsadder.api.CustomBlock;
2626
import io.th0rgal.oraxen.api.OraxenItems;
27-
import net.momirealms.craftengine.bukkit.api.CraftEngineBlocks;
2827
import net.momirealms.craftengine.core.util.Key;
2928

3029
public class ConfigManager {
@@ -186,16 +185,15 @@ else if (xmt == XMaterial.CHEST)
186185
}
187186

188187
private Object getCustomBlock(String text) {
189-
return switch (plugin.placetype) {
190-
case ItemsAdder -> CustomBlock.getInstance(text);
191-
case Oraxen -> OraxenItems.exists(text) ? text : null;
192-
case Nexo -> NexoBlocks.isCustomBlock(text) ? text : null;
193-
case CraftEngine -> {
188+
switch (plugin.placetype) {
189+
case ItemsAdder: return CustomBlock.getInstance(text);
190+
case Oraxen: return OraxenItems.exists(text) ? text : null;
191+
case Nexo: return NexoBlocks.isCustomBlock(text) ? text : null;
192+
case CraftEngine:
194193
String[] pcid = text.split(":", 2);
195-
yield pcid.length == 2 ? Key.of(pcid) : null;
196-
}
197-
default -> null;
198-
};
194+
return pcid.length == 2 ? Key.of(pcid) : null;
195+
default: return null;
196+
}
199197
}
200198

201199
public void SetupProgressBar() {

0 commit comments

Comments
 (0)