Update to Minecraft 1.18-pre8

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2021-11-25 08:00:00 +11:00
parent 0d839e926c
commit 799bfc92e2
30 changed files with 206 additions and 758 deletions

View File

@@ -1,75 +0,0 @@
--- a/net/minecraft/core/IRegistryCustom.java
+++ b/net/minecraft/core/IRegistryCustom.java
@@ -80,7 +80,7 @@
public <E> Optional<? extends IRegistry<E>> registry(ResourceKey<? extends IRegistry<? extends E>> resourcekey) {
Optional<? extends IRegistry<E>> optional = this.ownedRegistry(resourcekey);
- return optional.isPresent() ? optional : IRegistry.REGISTRY.getOptional(resourcekey.location());
+ return optional.isPresent() ? optional : (Optional<? extends IRegistry<E>>) IRegistry.REGISTRY.getOptional(resourcekey.location()); // CraftBukkit - decompile error
}
public <E> IRegistry<E> registryOrThrow(ResourceKey<? extends IRegistry<? extends E>> resourcekey) {
@@ -138,7 +138,7 @@
}
private static <R extends IRegistry<?>> void copyBuiltin(IRegistryCustom.Dimension iregistrycustom_dimension, ResourceKey<R> resourcekey) {
- IRegistry<R> iregistry = RegistryGeneration.REGISTRY;
+ IRegistry<R> iregistry = (IRegistry<R>) RegistryGeneration.REGISTRY; // CraftBukkit - decompile error
IRegistry<?> iregistry1 = (IRegistry) iregistry.getOrThrow(resourcekey);
copy(iregistrycustom_dimension, iregistry1);
@@ -178,8 +178,10 @@
});
}
- public static final class RegistryData extends Record {
+ // CraftBukkit start
+ public static final record RegistryData<E>(ResourceKey<? extends IRegistry<E>> key, Codec<E> codec, @Nullable Codec<E> networkCodec) {
+ /*
private final ResourceKey<? extends IRegistry<E>> key;
private final Codec<E> codec;
@Nullable
@@ -190,11 +192,15 @@
this.codec = codec;
this.networkCodec = codec1;
}
+ */
+ // CraftBukkit end
public boolean sendToClient() {
return this.networkCodec != null;
}
+ // CraftBukkit start
+ /*
public final String toString() {
return this.toString < invokedynamic > (this);
}
@@ -219,6 +225,8 @@
public Codec<E> networkCodec() {
return this.networkCodec;
}
+ */
+ // CraftBukkit end
}
public static final class Dimension extends IRegistryCustom {
@@ -267,7 +275,7 @@
}
private static <E> RegistryMaterials<?> parseRegistry(ResourceKey<? extends IRegistry<?>> resourcekey, Dynamic<?> dynamic) {
- DataResult dataresult = RegistryLookupCodec.create(resourcekey).codec().parse(dynamic);
+ DataResult<?> dataresult = RegistryLookupCodec.create((ResourceKey) resourcekey).codec().parse(dynamic); // CraftBukkit - decompile error
String s = resourcekey + " registry: ";
Logger logger = IRegistryCustom.LOGGER;
@@ -282,7 +290,7 @@
}
private static <E> RegistryMaterials<?> createRegistry(ResourceKey<? extends IRegistry<?>> resourcekey) {
- return new RegistryMaterials<>(resourcekey, Lifecycle.stable());
+ return new RegistryMaterials(resourcekey, Lifecycle.stable()); // CraftBukkit - decompile error
}
@Override

View File

@@ -1,40 +0,0 @@
--- a/net/minecraft/core/RegistryMaterials.java
+++ b/net/minecraft/core/RegistryMaterials.java
@@ -201,7 +201,7 @@
});
}
- return SystemUtils.getRandom(this.randomCache, random);
+ return (T) SystemUtils.getRandom(this.randomCache, random); // CraftBukkit - decompile error
}
@Override
@@ -228,7 +228,7 @@
return registrymaterials;
}, (registrymaterials) -> {
Builder<RegistryMaterials.a<T>> builder = ImmutableList.builder();
- Iterator iterator = registrymaterials.iterator();
+ Iterator<T> iterator = registrymaterials.iterator(); // CraftBukkit - decompile error
while (iterator.hasNext()) {
T t0 = iterator.next();
@@ -257,8 +257,10 @@
});
}
- private static final class a extends Record {
+ // CraftBukkit start
+ private static final record a<T>(ResourceKey<T> key, int id, T value) {
+ /*
private final ResourceKey<T> key;
private final int id;
private final T value;
@@ -292,5 +294,7 @@
public T value() {
return this.value;
}
+ */
+ // CraftBukkit end
}
}