9
0
mirror of https://github.com/Samsuik/Sakura.git synced 2025-12-21 07:49:29 +00:00
Files
SakuraMC/patches/server/0003-MC-Dev-Fixes.patch

55 lines
2.9 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
}
}
diff --git a/src/main/java/net/minecraft/world/level/block/Blocks.java b/src/main/java/net/minecraft/world/level/block/Blocks.java
index 9a2de546dc2af2ad4bf5d32ca6583f0e1f3f70d8..1e97f781c8cf1bc182bd802bbed1c19077d23bcd 100644
--- a/src/main/java/net/minecraft/world/level/block/Blocks.java
+++ b/src/main/java/net/minecraft/world/level/block/Blocks.java
@@ -1215,7 +1215,7 @@ public class Blocks {
}
private static Boolean ocelotOrParrot(BlockState state, BlockGetter world, BlockPos pos, EntityType<?> type) {
- return (boolean)type == EntityType.OCELOT || type == EntityType.PARROT;
+ return type == EntityType.OCELOT || type == EntityType.PARROT; // Sakura - decompile fix
}
private static Block bed(DyeColor color) {