Use updated jdk features
This commit is contained in:
parent
4eb5892517
commit
96d519f84a
@ -1,7 +1,6 @@
|
|||||||
package dev.w1zzrd.invtweaks.command;
|
package dev.w1zzrd.invtweaks.command;
|
||||||
|
|
||||||
import dev.w1zzrd.invtweaks.InvTweaksPlugin;
|
import dev.w1zzrd.invtweaks.InvTweaksPlugin;
|
||||||
import dev.w1zzrd.invtweaks.listener.TabCompletionListener;
|
|
||||||
import dev.w1zzrd.invtweaks.serialization.SearchConfig;
|
import dev.w1zzrd.invtweaks.serialization.SearchConfig;
|
||||||
import org.bukkit.*;
|
import org.bukkit.*;
|
||||||
import org.bukkit.block.*;
|
import org.bukkit.block.*;
|
||||||
@ -18,7 +17,7 @@ import java.util.*;
|
|||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
import static dev.w1zzrd.invtweaks.command.CommandUtils.assertTrue;
|
import static dev.w1zzrd.invtweaks.command.CommandUtils.assertTrue;
|
||||||
import static dev.w1zzrd.invtweaks.listener.TabCompletionListener.*;
|
import static dev.w1zzrd.invtweaks.listener.TabCompletionListener.getMaterialMatching;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handler for executions of /search command
|
* Handler for executions of /search command
|
||||||
@ -99,8 +98,7 @@ public class SearchCommandExecutor extends ConfigurableCommandExecutor<SearchCon
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (result instanceof DoubleChest) {
|
if (result instanceof final DoubleChest dChest) {
|
||||||
final DoubleChest dChest = (DoubleChest) result;
|
|
||||||
|
|
||||||
// Black magic to make chest lid animation behave for double chests
|
// Black magic to make chest lid animation behave for double chests
|
||||||
try {
|
try {
|
||||||
@ -174,9 +172,4 @@ public class SearchCommandExecutor extends ConfigurableCommandExecutor<SearchCon
|
|||||||
|
|
||||||
return matches;
|
return matches;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Material materialFromKey(final NamespacedKey key) {
|
|
||||||
final String stringKey = key.toString();
|
|
||||||
return Arrays.stream(Material.values()).filter(it -> it.getKey().toString().equals(stringKey)).findFirst().orElse(null);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user