mirror of
https://github.com/Samsuik/Sakura.git
synced 2025-12-19 14:59:30 +00:00
42 lines
2.2 KiB
Diff
42 lines
2.2 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Samsuik <kfian294ma4@gmail.com>
|
|
Date: Fri, 15 Oct 2021 18:32:13 +0100
|
|
Subject: [PATCH] MC-Dev-Fixes
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/tags/TagKey.java b/src/main/java/net/minecraft/tags/TagKey.java
|
|
index 3899e39ef9c602cbe33c71e85af76e72d8938219..b385f7cf774a81d90319e7eb5838a52929c330fb 100644
|
|
--- a/src/main/java/net/minecraft/tags/TagKey.java
|
|
+++ b/src/main/java/net/minecraft/tags/TagKey.java
|
|
@@ -31,7 +31,7 @@ public record TagKey<T>(ResourceKey<? extends Registry<T>> registry, ResourceLoc
|
|
}
|
|
|
|
public static <T> TagKey<T> create(ResourceKey<? extends Registry<T>> registry, ResourceLocation id) {
|
|
- return VALUES.intern(new TagKey<>(registry, id));
|
|
+ return (TagKey<T>) VALUES.intern(new TagKey<>(registry, id)); // Sakura - compile error
|
|
}
|
|
|
|
public boolean isFor(ResourceKey<? extends Registry<?>> registryRef) {
|
|
@@ -39,7 +39,7 @@ public record TagKey<T>(ResourceKey<? extends Registry<T>> registry, ResourceLoc
|
|
}
|
|
|
|
public <E> Optional<TagKey<E>> cast(ResourceKey<? extends Registry<E>> registryRef) {
|
|
- return this.isFor(registryRef) ? Optional.of(this) : Optional.empty();
|
|
+ return this.isFor(registryRef) ? Optional.of((TagKey<E>) this) : Optional.empty(); // Sakura - compile error
|
|
}
|
|
|
|
@Override
|
|
diff --git a/src/main/java/net/minecraft/util/ClassInstanceMultiMap.java b/src/main/java/net/minecraft/util/ClassInstanceMultiMap.java
|
|
index 50a9f33aa31e9273c7c52d4bb2b02f0f884f7ba5..5fb7573022c5af775b2e737dcd05c53cd9ae39ec 100644
|
|
--- a/src/main/java/net/minecraft/util/ClassInstanceMultiMap.java
|
|
+++ b/src/main/java/net/minecraft/util/ClassInstanceMultiMap.java
|
|
@@ -61,7 +61,7 @@ public class ClassInstanceMultiMap<T> extends AbstractCollection<T> {
|
|
List<? extends T> list = this.byClass.computeIfAbsent(type, (typeClass) -> {
|
|
return this.allInstances.stream().filter(typeClass::isInstance).collect(Collectors.toList());
|
|
});
|
|
- return Collections.unmodifiableCollection(list);
|
|
+ return (Collection<S>) Collections.unmodifiableCollection(list); // Sakura - decompile fix
|
|
}
|
|
}
|
|
|