Use the var keyword in KeyMappings.java

This commit is contained in:
Username404-59 2021-05-14 12:31:01 +02:00
parent a65f536304
commit d342c020b8
Signed by: Username404-59
GPG Key ID: 7AB361FBB257A5D1

View File

@ -15,8 +15,6 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import java.io.File; import java.io.File;
import java.util.Collection; import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Optional; import java.util.Optional;
@Mixin(Options.class) @Mixin(Options.class)
@ -27,8 +25,8 @@ abstract class KeyMappings {
@Inject(method = "<init>*", at = @At("RETURN")) @Inject(method = "<init>*", at = @At("RETURN"))
private void onSettingsConstructed(Minecraft minecraft, File file, CallbackInfo ci) { private void onSettingsConstructed(Minecraft minecraft, File file, CallbackInfo ci) {
Map<String, Integer> categoryMap = KeysAccessor.getSortedCategoryMap(); var categoryMap = KeysAccessor.getSortedCategoryMap();
List<KeyMapping> newKeys = Lists.newArrayList(keyMappings); var newKeys = Lists.newArrayList(keyMappings);
for (KeyMapping key : keysToAdd) { for (KeyMapping key : keysToAdd) {
if (!categoryMap.containsKey(key.getCategory())) { if (!categoryMap.containsKey(key.getCategory())) {
Optional<Integer> biggest = categoryMap.values().stream().max(Integer::compareTo); Optional<Integer> biggest = categoryMap.values().stream().max(Integer::compareTo);