From 084effdadf2300bc38d45c3a1b27d9fd918dc8cf Mon Sep 17 00:00:00 2001 From: LexManos Date: Tue, 12 Sep 2023 11:11:34 -0700 Subject: [PATCH] 1.20.2-pre3 --- build.gradle | 8 +++---- fmlcore/build.gradle | 5 ++-- fmlearlydisplay/build.gradle | 5 ++-- fmlloader/build.gradle | 5 ++-- javafmllanguage/build.gradle | 5 ++-- lowcodelanguage/build.gradle | 5 ++-- mclanguage/build.gradle | 5 ++-- .../ClientPacketListener.java.patch | 16 ++++++------- .../client/multiplayer/ServerData.java.patch | 2 +- .../renderer/texture/TextureAtlas.java.patch | 10 ++++---- .../net/minecraft/nbt/CompoundTag.java.patch | 24 +------------------ .../net/minecraft/nbt/NbtAccounter.java.patch | 2 +- .../net/minecraft/nbt/NbtIo.java.patch | 6 ++--- .../net/minecraft/nbt/StringTag.java.patch | 14 +++++------ .../item/trading/MerchantOffer.java.patch | 4 ++-- .../storage/LevelStorageSource.java.patch | 6 ++--- 16 files changed, 47 insertions(+), 75 deletions(-) diff --git a/build.gradle b/build.gradle index 714be13aa5..e41dda3e92 100644 --- a/build.gradle +++ b/build.gradle @@ -28,8 +28,8 @@ plugins { id 'net.minecraftforge.gradleutils' version '2.+' id 'eclipse' id 'de.undercouch.download' version '5.4.0' - id 'net.minecraftforge.gradle.patcher' version '[6.0.11,6.2)' apply false - id 'net.minecraftforge.gradle.mcp' version '[6.0.11,6.2)' apply false + id 'net.minecraftforge.gradle.patcher' version '[6.0.13,6.2)' apply false + id 'net.minecraftforge.gradle.mcp' version '[6.0.13,6.2)' apply false } Util.init() //Init all our extension methods! @@ -44,10 +44,10 @@ ext { ] } MAPPING_CHANNEL = 'official' - MC_VERSION = '1.20.2-pre2' + MC_VERSION = '1.20.2-pre3' MAPPING_VERSION = MC_VERSION MC_NEXT_VERSION = '1.21' - MCP_VERSION = '20230911.115402' + MCP_VERSION = '20230912.103757' SNAPSHOT = false SPI_VERSION = '7.0.1' diff --git a/fmlcore/build.gradle b/fmlcore/build.gradle index ba19ceafd0..b5fa345444 100644 --- a/fmlcore/build.gradle +++ b/fmlcore/build.gradle @@ -2,10 +2,9 @@ plugins { id 'com.github.ben-manes.versions' id 'org.javamodularity.moduleplugin' version '1.8.3' apply false id 'org.cadixdev.licenser' + id 'java-library' + id 'jacoco' } -apply plugin: 'java-library' -apply plugin: 'jacoco' -apply plugin: 'org.javamodularity.moduleplugin' dependencyUpdates.rejectVersionIf { isNonStable(it.candidate.version) } diff --git a/fmlearlydisplay/build.gradle b/fmlearlydisplay/build.gradle index 2201dcffad..986f070204 100644 --- a/fmlearlydisplay/build.gradle +++ b/fmlearlydisplay/build.gradle @@ -2,10 +2,9 @@ plugins { id 'com.github.ben-manes.versions' id 'org.javamodularity.moduleplugin' version '1.8.7' apply false id 'org.cadixdev.licenser' + id 'java-library' + id 'jacoco' } -apply plugin: 'java-library' -apply plugin: 'jacoco' -apply plugin: 'org.javamodularity.moduleplugin' import org.gradle.internal.os.OperatingSystem diff --git a/fmlloader/build.gradle b/fmlloader/build.gradle index aa1949e855..7d29c81b72 100644 --- a/fmlloader/build.gradle +++ b/fmlloader/build.gradle @@ -2,10 +2,9 @@ plugins { id 'com.github.ben-manes.versions' id 'org.javamodularity.moduleplugin' version '1.8.3' apply false id 'org.cadixdev.licenser' + id 'java-library' + id 'jacoco' } -apply plugin: 'java-library' -apply plugin: 'jacoco' -apply plugin: 'org.javamodularity.moduleplugin' dependencyUpdates.rejectVersionIf { isNonStable(it.candidate.version) } configurations.forEach{ it.transitive = false } diff --git a/javafmllanguage/build.gradle b/javafmllanguage/build.gradle index f0134a14d6..d6dfcdd0c1 100644 --- a/javafmllanguage/build.gradle +++ b/javafmllanguage/build.gradle @@ -2,10 +2,9 @@ plugins { id 'com.github.ben-manes.versions' id 'org.javamodularity.moduleplugin' version '1.8.3' apply false id 'org.cadixdev.licenser' + id 'java-library' + id 'jacoco' } -apply plugin: 'java-library' -apply plugin: 'jacoco' -apply plugin: 'org.javamodularity.moduleplugin' dependencyUpdates.rejectVersionIf { isNonStable(it.candidate.version) } diff --git a/lowcodelanguage/build.gradle b/lowcodelanguage/build.gradle index 8ef4b32f19..89f5f08134 100644 --- a/lowcodelanguage/build.gradle +++ b/lowcodelanguage/build.gradle @@ -2,10 +2,9 @@ plugins { id 'com.github.ben-manes.versions' id 'org.javamodularity.moduleplugin' version '1.8.3' apply false id 'org.cadixdev.licenser' + id 'java-library' + id 'jacoco' } -apply plugin: 'java-library' -apply plugin: 'jacoco' -apply plugin: 'org.javamodularity.moduleplugin' dependencyUpdates.rejectVersionIf { isNonStable(it.candidate.version) } diff --git a/mclanguage/build.gradle b/mclanguage/build.gradle index 0df6fc7904..8c11f250be 100644 --- a/mclanguage/build.gradle +++ b/mclanguage/build.gradle @@ -2,10 +2,9 @@ plugins { id 'com.github.ben-manes.versions' id 'org.javamodularity.moduleplugin' version '1.8.3' apply false id 'org.cadixdev.licenser' + id 'java-library' + id 'jacoco' } -apply plugin: 'java-library' -apply plugin: 'jacoco' -apply plugin: 'org.javamodularity.moduleplugin' dependencyUpdates.rejectVersionIf { isNonStable(it.candidate.version) } diff --git a/patches/minecraft/net/minecraft/client/multiplayer/ClientPacketListener.java.patch b/patches/minecraft/net/minecraft/client/multiplayer/ClientPacketListener.java.patch index dc38b82d6a..f5394e8409 100644 --- a/patches/minecraft/net/minecraft/client/multiplayer/ClientPacketListener.java.patch +++ b/patches/minecraft/net/minecraft/client/multiplayer/ClientPacketListener.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/client/multiplayer/ClientPacketListener.java +++ b/net/minecraft/client/multiplayer/ClientPacketListener.java -@@ -386,6 +_,7 @@ +@@ -385,6 +_,7 @@ this.minecraft.debugRenderer.clear(); this.minecraft.player.resetPos(); @@ -8,7 +8,7 @@ this.minecraft.player.setId(p_105030_.playerId()); this.level.addEntity(this.minecraft.player); this.minecraft.player.input = new KeyboardInput(this.minecraft.options); -@@ -1017,7 +_,9 @@ +@@ -1016,7 +_,9 @@ localplayer1.getAttributes().assignValues(localplayer.getAttributes()); } @@ -18,7 +18,7 @@ this.level.addEntity(localplayer1); localplayer1.setYRot(-180.0F); localplayer1.input = new KeyboardInput(this.minecraft.options); -@@ -1126,10 +_,7 @@ +@@ -1125,10 +_,7 @@ PacketUtils.ensureRunningOnSameThread(p_104976_, this, this.minecraft); BlockPos blockpos = p_104976_.getPos(); this.minecraft.level.getBlockEntity(blockpos, p_104976_.getType()).ifPresent((p_205557_) -> { @@ -30,7 +30,7 @@ if (p_205557_ instanceof CommandBlockEntity && this.minecraft.screen instanceof CommandBlockEditScreen) { ((CommandBlockEditScreen)this.minecraft.screen).updateGui(); -@@ -1277,7 +_,9 @@ +@@ -1276,7 +_,9 @@ public void handleCommands(ClientboundCommandsPacket p_104990_) { PacketUtils.ensureRunningOnSameThread(p_104990_, this, this.minecraft); @@ -41,7 +41,7 @@ } public void handleStopSoundEvent(ClientboundStopSoundPacket p_105116_) { -@@ -1296,6 +_,7 @@ +@@ -1295,6 +_,7 @@ ClientRecipeBook clientrecipebook = this.minecraft.player.getRecipeBook(); clientrecipebook.setupCollections(this.recipeManager.getRecipes(), this.minecraft.level.registryAccess()); this.minecraft.populateSearchTree(SearchRegistry.RECIPE_COLLECTIONS, clientrecipebook.getCollections()); @@ -49,7 +49,7 @@ } public void handleLookAt(ClientboundPlayerLookAtPacket p_105054_) { -@@ -1394,7 +_,8 @@ +@@ -1393,7 +_,8 @@ Blocks.rebuildCache(); } @@ -59,7 +59,7 @@ } public void handlePlayerCombatEnd(ClientboundPlayerCombatEndPacket p_171771_) { -@@ -2087,6 +_,8 @@ +@@ -2086,6 +_,8 @@ } public void sendChat(String p_249888_) { @@ -68,7 +68,7 @@ Instant instant = Instant.now(); long i = Crypt.SaltSupplier.getLong(); LastSeenMessagesTracker.Update lastseenmessagestracker$update = this.lastSeenMessages.generateAndApplyUpdate(); -@@ -2095,6 +_,7 @@ +@@ -2094,6 +_,7 @@ } public void sendCommand(String p_250092_) { diff --git a/patches/minecraft/net/minecraft/client/multiplayer/ServerData.java.patch b/patches/minecraft/net/minecraft/client/multiplayer/ServerData.java.patch index c8610770e5..8805182f74 100644 --- a/patches/minecraft/net/minecraft/client/multiplayer/ServerData.java.patch +++ b/patches/minecraft/net/minecraft/client/multiplayer/ServerData.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/client/multiplayer/ServerData.java +++ b/net/minecraft/client/multiplayer/ServerData.java -@@ -32,6 +_,7 @@ +@@ -35,6 +_,7 @@ private byte[] iconBytes; private ServerData.Type type; private boolean enforcesSecureChat; diff --git a/patches/minecraft/net/minecraft/client/renderer/texture/TextureAtlas.java.patch b/patches/minecraft/net/minecraft/client/renderer/texture/TextureAtlas.java.patch index bcf70b34b8..c47ede24ec 100644 --- a/patches/minecraft/net/minecraft/client/renderer/texture/TextureAtlas.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/texture/TextureAtlas.java.patch @@ -1,15 +1,15 @@ --- a/net/minecraft/client/renderer/texture/TextureAtlas.java +++ b/net/minecraft/client/renderer/texture/TextureAtlas.java -@@ -80,6 +_,8 @@ - - this.sprites = List.copyOf(list); - this.animatedTextures = List.copyOf(list1); +@@ -88,6 +_,8 @@ + this.sprites = List.copyOf(list); + this.animatedTextures = List.copyOf(list1); + } + + net.minecraftforge.client.ForgeHooksClient.onTextureStitchedPost(this); } public void dumpContents(ResourceLocation p_276106_, Path p_276127_) throws IOException { -@@ -151,5 +_,12 @@ +@@ -164,5 +_,12 @@ public void updateFilter(SpriteLoader.Preparations p_251993_) { this.setFilter(false, p_251993_.mipLevel() > 0); diff --git a/patches/minecraft/net/minecraft/nbt/CompoundTag.java.patch b/patches/minecraft/net/minecraft/nbt/CompoundTag.java.patch index 20a6b9ade8..45cc62185c 100644 --- a/patches/minecraft/net/minecraft/nbt/CompoundTag.java.patch +++ b/patches/minecraft/net/minecraft/nbt/CompoundTag.java.patch @@ -1,14 +1,6 @@ --- a/net/minecraft/nbt/CompoundTag.java +++ b/net/minecraft/nbt/CompoundTag.java -@@ -41,6 +_,7 @@ - while((b0 = CompoundTag.readNamedTagType(p_128485_, p_128487_)) != 0) { - String s = CompoundTag.readNamedTagName(p_128485_, p_128487_); - p_128487_.accountBytes((long)(28 + 2 * s.length())); -+ p_128487_.accountBytes(4); //Forge: 4 extra bytes for the object allocation. - Tag tag = CompoundTag.readNamedTagData(TagTypes.getType(b0), s, p_128485_, p_128486_ + 1, p_128487_); - if (map.put(s, tag) == null) { - p_128487_.accountBytes(36L); -@@ -167,6 +_,7 @@ +@@ -210,6 +_,7 @@ @Nullable public Tag put(String p_128366_, Tag p_128367_) { @@ -16,17 +8,3 @@ return this.tags.put(p_128366_, p_128367_); } -@@ -459,11 +_,12 @@ - } - - static byte readNamedTagType(DataInput p_128421_, NbtAccounter p_128422_) throws IOException { -+ p_128422_.accountBytes(2); - return p_128421_.readByte(); - } - - static String readNamedTagName(DataInput p_128433_, NbtAccounter p_128434_) throws IOException { -- return p_128433_.readUTF(); -+ return p_128434_.readUTF(p_128433_.readUTF()); - } - - static Tag readNamedTagData(TagType p_128414_, String p_128415_, DataInput p_128416_, int p_128417_, NbtAccounter p_128418_) { diff --git a/patches/minecraft/net/minecraft/nbt/NbtAccounter.java.patch b/patches/minecraft/net/minecraft/nbt/NbtAccounter.java.patch index 4fbf443209..0bc5b28b11 100644 --- a/patches/minecraft/net/minecraft/nbt/NbtAccounter.java.patch +++ b/patches/minecraft/net/minecraft/nbt/NbtAccounter.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/nbt/NbtAccounter.java +++ b/net/minecraft/nbt/NbtAccounter.java -@@ -21,6 +_,36 @@ +@@ -43,6 +_,36 @@ } } diff --git a/patches/minecraft/net/minecraft/nbt/NbtIo.java.patch b/patches/minecraft/net/minecraft/nbt/NbtIo.java.patch index 8c9aade930..8c839fd297 100644 --- a/patches/minecraft/net/minecraft/nbt/NbtIo.java.patch +++ b/patches/minecraft/net/minecraft/nbt/NbtIo.java.patch @@ -1,8 +1,8 @@ --- a/net/minecraft/nbt/NbtIo.java +++ b/net/minecraft/nbt/NbtIo.java -@@ -154,10 +_,12 @@ +@@ -155,10 +_,12 @@ - private static Tag readUnnamedTag(DataInput p_128931_, int p_128932_, NbtAccounter p_128933_) throws IOException { + private static Tag readUnnamedTag(DataInput p_128931_, NbtAccounter p_128933_) throws IOException { byte b0 = p_128931_.readByte(); + p_128933_.accountBytes(1); // Forge: Count everything! if (b0 == 0) { @@ -11,6 +11,6 @@ - StringTag.skipString(p_128931_); + p_128933_.readUTF(p_128931_.readUTF()); //Forge: Count this string. + p_128933_.accountBytes(4); //Forge: 4 extra bytes for the object allocation. - return readTagSafe(p_128931_, p_128932_, p_128933_, b0); + return readTagSafe(p_128931_, p_128933_, b0); } } diff --git a/patches/minecraft/net/minecraft/nbt/StringTag.java.patch b/patches/minecraft/net/minecraft/nbt/StringTag.java.patch index 641218a2c9..65258fa368 100644 --- a/patches/minecraft/net/minecraft/nbt/StringTag.java.patch +++ b/patches/minecraft/net/minecraft/nbt/StringTag.java.patch @@ -1,11 +1,11 @@ --- a/net/minecraft/nbt/StringTag.java +++ b/net/minecraft/nbt/StringTag.java -@@ -13,7 +_,7 @@ - public StringTag load(DataInput p_129315_, int p_129316_, NbtAccounter p_129317_) throws IOException { - p_129317_.accountBytes(36L); - String s = p_129315_.readUTF(); -- p_129317_.accountBytes((long)(2 * s.length())); -+ p_129317_.readUTF(s); - return StringTag.valueOf(s); +@@ -21,7 +_,7 @@ + private static String readAccounted(DataInput p_301750_, NbtAccounter p_301732_) throws IOException { + p_301732_.accountBytes(36L); + String s = p_301750_.readUTF(); +- p_301732_.accountBytes(2L * (long)s.length()); ++ p_301732_.readUTF(s); + return s; } diff --git a/patches/minecraft/net/minecraft/world/item/trading/MerchantOffer.java.patch b/patches/minecraft/net/minecraft/world/item/trading/MerchantOffer.java.patch index 95062569be..d11303fc9d 100644 --- a/patches/minecraft/net/minecraft/world/item/trading/MerchantOffer.java.patch +++ b/patches/minecraft/net/minecraft/world/item/trading/MerchantOffer.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/item/trading/MerchantOffer.java +++ b/net/minecraft/world/item/trading/MerchantOffer.java -@@ -77,7 +_,7 @@ +@@ -90,7 +_,7 @@ } else { int i = this.baseCostA.getCount(); int j = Math.max(0, Mth.floor((float)(i * this.demand) * this.priceMultiplier)); @@ -9,7 +9,7 @@ } } -@@ -181,7 +_,7 @@ +@@ -194,7 +_,7 @@ return true; } else { ItemStack itemstack = p_45366_.copy(); diff --git a/patches/minecraft/net/minecraft/world/level/storage/LevelStorageSource.java.patch b/patches/minecraft/net/minecraft/world/level/storage/LevelStorageSource.java.patch index 572ea0f559..9615d0ac97 100644 --- a/patches/minecraft/net/minecraft/world/level/storage/LevelStorageSource.java.patch +++ b/patches/minecraft/net/minecraft/world/level/storage/LevelStorageSource.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/level/storage/LevelStorageSource.java +++ b/net/minecraft/world/level/storage/LevelStorageSource.java -@@ -467,6 +_,19 @@ +@@ -465,6 +_,19 @@ return LevelStorageSource.this.readLevelData(this.levelDirectory, LevelStorageSource.getLevelData(p_248747_, p_251873_, p_249187_, p_249736_)); } @@ -20,7 +20,7 @@ @Nullable public WorldDataConfiguration getDataConfiguration() { this.checkLock(); -@@ -483,6 +_,8 @@ +@@ -481,6 +_,8 @@ CompoundTag compoundtag1 = new CompoundTag(); compoundtag1.put("Data", compoundtag); @@ -29,7 +29,7 @@ try { File file2 = File.createTempFile("level", ".dat", file1); NbtIo.writeCompressed(compoundtag1, file2); -@@ -497,6 +_,10 @@ +@@ -495,6 +_,10 @@ public Optional getIconFile() { return !this.lock.isValid() ? Optional.empty() : Optional.of(this.levelDirectory.iconFile());