Merge 1.16 into 1.18

This commit is contained in:
embeddedt 2024-01-12 15:49:00 -05:00
commit 5d6abe46f5
4 changed files with 12 additions and 8 deletions

View File

@ -2,8 +2,11 @@ package org.embeddedt.modernfix.util;
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
import it.unimi.dsi.fastutil.ints.IntSet;
import it.unimi.dsi.fastutil.ints.IntSets;
import it.unimi.dsi.fastutil.objects.ObjectCollection;
import it.unimi.dsi.fastutil.objects.ObjectLists;
import it.unimi.dsi.fastutil.objects.ObjectSet;
import it.unimi.dsi.fastutil.objects.ObjectSets;
import java.util.Map;
import java.util.function.Function;
@ -15,17 +18,17 @@ public class DynamicInt2ObjectMap<V> extends DynamicMap<Integer, V> implements I
@Override
public IntSet keySet() {
throw new UnsupportedOperationException();
return IntSets.EMPTY_SET;
}
@Override
public ObjectCollection<V> values() {
throw new UnsupportedOperationException();
return ObjectLists.emptyList();
}
@Override
public ObjectSet<Map.Entry<Integer, V>> entrySet() {
throw new UnsupportedOperationException();
return ObjectSets.emptySet();
}
@Override

View File

@ -4,6 +4,7 @@ import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.Collection;
import java.util.Collections;
import java.util.Map;
import java.util.Set;
import java.util.function.Function;
@ -64,18 +65,18 @@ public class DynamicMap<K, V> implements Map<K, V> {
@NotNull
@Override
public Set<K> keySet() {
throw new UnsupportedOperationException();
return Collections.emptySet();
}
@NotNull
@Override
public Collection<V> values() {
throw new UnsupportedOperationException();
return Collections.emptyList();
}
@NotNull
@Override
public Set<Entry<K, V>> entrySet() {
throw new UnsupportedOperationException();
return Collections.emptySet();
}
}

View File

@ -6,7 +6,7 @@ import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;
@Mixin(LootTables.class)
@Mixin(value = LootTables.class, priority = 2000)
public class LootTableManagerMixin {
@Redirect(method = "*(Lnet/minecraft/server/packs/resources/ResourceManager;Lcom/google/common/collect/ImmutableMap$Builder;Lnet/minecraft/resources/ResourceLocation;Lcom/google/gson/JsonElement;)V",
at = @At(value = "INVOKE", target = "Lorg/slf4j/Logger;error(Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;)V", remap = false), require = 0)

View File

@ -6,7 +6,7 @@ import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;
@Mixin(RecipeManager.class)
@Mixin(value = RecipeManager.class, priority = 2000)
public class RecipeManagerMixin {
@Redirect(method = "apply(Ljava/util/Map;Lnet/minecraft/server/packs/resources/ResourceManager;Lnet/minecraft/util/profiling/ProfilerFiller;)V", at = @At(value = "INVOKE", target = "Lorg/slf4j/Logger;error(Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;)V", remap = false), require = 0)
private void silenceException(Logger instance, String s, Object location, Object exc) {