mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-04 18:12:09 +01:00
89528bff42
* Update patches to handle vineflower decompiler * update patches again to handle inlined simple lambdas * update vf again and re-apply/rebuild patches * update patches after removal of verify-merges flag * fix compile issue * remove maven local * fix some issues * address more issues * fix collision patch * use paperweight release * more fixes * update fineflower and fix patches again * add missing comment descriptor --------- Co-authored-by: Jason Penilla <11360596+jpenilla@users.noreply.github.com>
121 lines
7.8 KiB
Diff
121 lines
7.8 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Aikar <aikar@aikar.co>
|
|
Date: Wed, 30 Mar 2016 19:36:20 -0400
|
|
Subject: [PATCH] MC Dev fixes
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/core/BlockPos.java b/src/main/java/net/minecraft/core/BlockPos.java
|
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
--- a/src/main/java/net/minecraft/core/BlockPos.java
|
|
+++ b/src/main/java/net/minecraft/core/BlockPos.java
|
|
@@ -0,0 +0,0 @@ public class BlockPos extends Vec3i {
|
|
if (this.index == l) {
|
|
return this.endOfData();
|
|
} else {
|
|
- int i = this.index % i;
|
|
- int j = this.index / i;
|
|
- int k = j % j;
|
|
- int l = j / j;
|
|
+ int offsetX = this.index % i; // Paper - decomp fix
|
|
+ int u = this.index / i; // Paper - decomp fix
|
|
+ int offsetY = u % j; // Paper - decomp fix
|
|
+ int offsetZ = u / j; // Paper - decomp fix
|
|
this.index++;
|
|
- return this.cursor.set(startX + i, startY + k, startZ + l);
|
|
+ return this.cursor.set(startX + offsetX, startY + offsetY, startZ + offsetZ); // Paper - decomp fix
|
|
}
|
|
}
|
|
};
|
|
diff --git a/src/main/java/net/minecraft/core/registries/BuiltInRegistries.java b/src/main/java/net/minecraft/core/registries/BuiltInRegistries.java
|
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
--- a/src/main/java/net/minecraft/core/registries/BuiltInRegistries.java
|
|
+++ b/src/main/java/net/minecraft/core/registries/BuiltInRegistries.java
|
|
@@ -0,0 +0,0 @@ public class BuiltInRegistries {
|
|
Bootstrap.checkBootstrapCalled(() -> "registry " + key);
|
|
ResourceLocation resourceLocation = key.location();
|
|
LOADERS.put(resourceLocation, () -> initializer.run(registry));
|
|
- WRITABLE_REGISTRY.register((ResourceKey<WritableRegistry<?>>)key, registry, lifecycle);
|
|
+ WRITABLE_REGISTRY.register((ResourceKey)key, registry, lifecycle); // Paper - decompile fix
|
|
return registry;
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/nbt/TagParser.java b/src/main/java/net/minecraft/nbt/TagParser.java
|
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
--- a/src/main/java/net/minecraft/nbt/TagParser.java
|
|
+++ b/src/main/java/net/minecraft/nbt/TagParser.java
|
|
@@ -0,0 +0,0 @@ public class TagParser {
|
|
}
|
|
|
|
if (typeReader == ByteTag.TYPE) {
|
|
- list.add((T)((NumericTag)tag).getAsByte());
|
|
+ list.add((T)(Byte)((NumericTag)tag).getAsByte()); // Paper - decompile fix
|
|
} else if (typeReader == LongTag.TYPE) {
|
|
- list.add((T)((NumericTag)tag).getAsLong());
|
|
+ list.add((T)(Long)((NumericTag)tag).getAsLong()); // Paper - decompile fix
|
|
} else {
|
|
- list.add((T)((NumericTag)tag).getAsInt());
|
|
+ list.add((T)(Integer)((NumericTag)tag).getAsInt()); // Paper - decompile fix
|
|
}
|
|
|
|
if (!this.hasElementSeparator()) {
|
|
diff --git a/src/main/java/net/minecraft/network/ConnectionProtocol.java b/src/main/java/net/minecraft/network/ConnectionProtocol.java
|
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
--- a/src/main/java/net/minecraft/network/ConnectionProtocol.java
|
|
+++ b/src/main/java/net/minecraft/network/ConnectionProtocol.java
|
|
@@ -0,0 +0,0 @@ public enum ConnectionProtocol {
|
|
protocol()
|
|
.addFlow(
|
|
PacketFlow.CLIENTBOUND,
|
|
- new ConnectionProtocol.PacketSet<ClientCommonPacketListener>()
|
|
+ new ConnectionProtocol.PacketSet<net.minecraft.network.protocol.configuration.ClientConfigurationPacketListener>() // Paper - decompile fix
|
|
.addPacket(ClientboundCustomPayloadPacket.class, ClientboundCustomPayloadPacket::new)
|
|
.addPacket(ClientboundDisconnectPacket.class, ClientboundDisconnectPacket::new)
|
|
.addPacket(ClientboundFinishConfigurationPacket.class, ClientboundFinishConfigurationPacket::new)
|
|
@@ -0,0 +0,0 @@ public enum ConnectionProtocol {
|
|
)
|
|
.addFlow(
|
|
PacketFlow.SERVERBOUND,
|
|
- new ConnectionProtocol.PacketSet<ServerCommonPacketListener>()
|
|
+ new ConnectionProtocol.PacketSet<net.minecraft.network.protocol.configuration.ServerConfigurationPacketListener>() // Paper - decompile fix
|
|
.addPacket(ServerboundClientInformationPacket.class, ServerboundClientInformationPacket::new)
|
|
.addPacket(ServerboundCustomPayloadPacket.class, ServerboundCustomPayloadPacket::new)
|
|
.addPacket(ServerboundFinishConfigurationPacket.class, ServerboundFinishConfigurationPacket::new)
|
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
@@ -0,0 +0,0 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
PackRepository resourcepackrepository = this.packRepository;
|
|
|
|
Objects.requireNonNull(this.packRepository);
|
|
- return stream.map(resourcepackrepository::getPack).filter(Objects::nonNull).map(Pack::open).collect(ImmutableList.toImmutableList()); // CraftBukkit - decompile error
|
|
+ return stream.<Pack>map(resourcepackrepository::getPack).filter(Objects::nonNull).map(Pack::open).collect(ImmutableList.toImmutableList()); // CraftBukkit - decompile error // Paper - decompile error // todo: is this needed anymore?
|
|
}, this).thenCompose((immutablelist) -> {
|
|
MultiPackResourceManager resourcemanager = new MultiPackResourceManager(PackType.SERVER_DATA, immutablelist);
|
|
|
|
diff --git a/src/main/java/net/minecraft/util/SortedArraySet.java b/src/main/java/net/minecraft/util/SortedArraySet.java
|
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
--- a/src/main/java/net/minecraft/util/SortedArraySet.java
|
|
+++ b/src/main/java/net/minecraft/util/SortedArraySet.java
|
|
@@ -0,0 +0,0 @@ public class SortedArraySet<T> extends AbstractSet<T> {
|
|
}
|
|
|
|
public static <T extends Comparable<T>> SortedArraySet<T> create(int initialCapacity) {
|
|
- return new SortedArraySet<>(initialCapacity, Comparator.naturalOrder());
|
|
+ return new SortedArraySet<>(initialCapacity, Comparator.<T>naturalOrder()); // Paper - decompile fix
|
|
}
|
|
|
|
public static <T> SortedArraySet<T> create(Comparator<T> comparator) {
|
|
diff --git a/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java b/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java
|
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
--- a/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java
|
|
+++ b/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java
|
|
@@ -0,0 +0,0 @@ public class RecipeManager extends SimpleJsonResourceReloadListener {
|
|
}
|
|
|
|
this.recipes = (Map) map1.entrySet().stream().collect(ImmutableMap.toImmutableMap(Entry::getKey, (entry1) -> {
|
|
- return (entry1.getValue()); // CraftBukkit
|
|
+ return entry1.getValue(); // CraftBukkit // Paper - decompile fix - *shrugs internally* // todo: is this needed anymore?
|
|
}));
|
|
this.byName = Maps.newHashMap(builder.build()); // CraftBukkit
|
|
RecipeManager.LOGGER.info("Loaded {} recipes", map1.size());
|