Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修复了3个MC Bug,添加了Missing Purpur Config (来自Polpot) #22

Closed
wants to merge 16 commits into from
Closed
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ Thanks to these projects below. Leaf just mix some of their patches together. If
- [Parchment](https://github.com/ProjectEdenGG/Parchment)
- [Leaves](https://github.com/LeavesMC/Leaves)
- [Kaiiju](https://github.com/KaiijuMC/Kaiiju)
- [LinearPurpur](https://github.com/StupidCraft/LinearPurpur)
- [Polpot](https://github.com/HaHaWTH/Polpot)

## Special Thanks To:

Expand Down
18 changes: 9 additions & 9 deletions patches/server/0045-AddLinearSupport.patch
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Subject: [PATCH] AddLinearSupport


diff --git a/build.gradle.kts b/build.gradle.kts
index a6ac60d7d57e4b0662b0c30f7bc43ba84179d697..a4ed90ae8b704bac060409c0218543fcc9a3e15c 100644
index 0baaa2bcd05ea65c5fbb9ae646b3a9eeb12bac14..2f374fd4cb05d2c597d0dbd1a554cd6624f84863 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -22,6 +22,8 @@ dependencies {
Expand Down Expand Up @@ -121,10 +121,10 @@ index c13df3a375f416273c6a26f5f77624c1f34a918c..e2c780e7d914e2cfd322fe07951aa54a
long expectedChunks = (long)regionFiles.length * (32L * 32L);
// Gale start - instantly continue on world upgrade finish
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index fb3bbe36c7bf67be65f0978ead2d4c778c32ba82..76022824dc9de7e64009383378f8ba75f70b09f3 100644
index 1b4e0c7f23186afd88c7a71e296a5ca958f1c1d8..d6bdcb21ec79a81c31eaab24a73b55d08351e19b 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -870,7 +870,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -868,7 +868,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
// Paper start - rewrite chunk system
worldserver.save((ProgressListener) null, flush, worldserver.noSave && !force, close);
if (flush) {
Expand All @@ -133,7 +133,7 @@ index fb3bbe36c7bf67be65f0978ead2d4c778c32ba82..76022824dc9de7e64009383378f8ba75
}
// Paper end - rewrite chunk system
}
@@ -894,7 +894,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -892,7 +892,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
//MinecraftServer.LOGGER.info("ThreadedAnvilChunkStorage ({}): All chunks are saved", worldserver2.getChunkSource().chunkMap.getStorageName()); // Paper - move up
}

Expand All @@ -143,7 +143,7 @@ index fb3bbe36c7bf67be65f0978ead2d4c778c32ba82..76022824dc9de7e64009383378f8ba75

return flag3;
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index cfe179378963d1f37e95ccd86bc65638def20189..c2b06e89823bd212c14ccb5827764c0e53e60ac9 100644
index e85dcc5095e585b6c3d2db54ed3279365050551d..38ddd6684535f9a4e6e9fb432282e0b6be0ede4c 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -246,7 +246,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
Expand Down Expand Up @@ -190,7 +190,7 @@ index cfe179378963d1f37e95ccd86bc65638def20189..c2b06e89823bd212c14ccb5827764c0e
regionFile.setStatus(chunkPos.x, chunkPos.z, ChunkSerializer.getStatus(compound));
}
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 22c9353264da69591a748773e5dd0ea49229f221..d23a9bd8e3b1588a9a162c95dc12aa5e68c44563 100644
index 246537aea1e328ecd25676d68aa7061dbc80e8d0..a5c21463eec4334e8f84fa4657a503755039ffb3 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -425,8 +425,8 @@ public class ServerLevel extends Level implements WorldGenLevel {
Expand All @@ -204,7 +204,7 @@ index 22c9353264da69591a748773e5dd0ea49229f221..d23a9bd8e3b1588a9a162c95dc12aa5e
}

protected void write(ChunkPos pos, net.minecraft.nbt.CompoundTag nbt) throws IOException {
@@ -749,7 +749,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -754,7 +754,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
// CraftBukkit end
boolean flag2 = minecraftserver.forceSynchronousWrites();
DataFixer datafixer = minecraftserver.getFixerUpper();
Expand Down Expand Up @@ -358,7 +358,7 @@ index 5b91ccafbdc7582e50272953f3ab2b8c0f0bf9dd..5d554c64a7c278c12724c1ffbb45eeae
try (DataInputStream out = new DataInputStream(new java.io.BufferedInputStream(new InflaterInputStream(Files.newInputStream(file))))) {
return NbtIo.read((java.io.DataInput) out);
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
index db571f658f636cdda1dcdbaffa0c4da67fae11ad..c71446e1ae8d55a952e19ff8013a481dea1af03e 100644
index 6eaeb2db0da59611501f2b1a63b5b48816a0ba48..ba10c7ffb08f806d8d9d0291276a7321421651fc 100644
--- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
@@ -19,11 +19,17 @@ import net.minecraft.world.level.ChunkPos;
Expand Down Expand Up @@ -668,7 +668,7 @@ index b12437a7e292fbf9aefc7a41b5bc1695733a11c5..c3f095236093c436d37c4730f5537d4f
private static void disableGiveCommandDrops() {
disableGiveCommandDrops = getBoolean("settings.disable-give-dropping", disableGiveCommandDrops);
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
index 609446782958d03ae0d5bef99c1d8e5320dfa037..25e2b357633052e5296baf44beafb10aa746991a 100644
index 0a29f28cf666896f0715d40bb121017e4675b4e7..2b4408d398962fa4feab9eb248540c6d11037a94 100644
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
@@ -27,6 +27,7 @@ import java.util.Map;
Expand Down
45 changes: 45 additions & 0 deletions patches/server/0048-Fix-MC-110386-and-31819.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: lilingfengdev <lilingfengvvv@outlook.com>
Date: Tue, 16 Jan 2024 19:21:21 +0800
Subject: [PATCH] Fix MC 110386 and 31819


diff --git a/src/main/java/net/minecraft/world/entity/animal/Animal.java b/src/main/java/net/minecraft/world/entity/animal/Animal.java
index 8df8a48bd1dbbb4a6835f68bd700eac2b5acf91b..5c146f89b997b2541b37d9bd6b56a6deaa3d6b9b 100644
--- a/src/main/java/net/minecraft/world/entity/animal/Animal.java
+++ b/src/main/java/net/minecraft/world/entity/animal/Animal.java
@@ -42,6 +42,8 @@ public abstract class Animal extends AgeableMob {
@Nullable
public UUID loveCause;
public ItemStack breedItem; // CraftBukkit - Add breedItem variable
+ private Object level;
+
public abstract int getPurpurBreedTime(); // Purpur

protected Animal(EntityType<? extends Animal> type, Level world) {
@@ -73,7 +75,11 @@ public abstract class Animal extends AgeableMob {
double d1 = this.random.nextGaussian() * 0.02D;
double d2 = this.random.nextGaussian() * 0.02D;

- this.level().addParticle(ParticleTypes.HEART, this.getRandomX(1.0D), this.getRandomY() + 0.5D, this.getRandomZ(1.0D), d0, d1, d2);
+ // DivineMC start - Fix MC-93826
+ if (this.level instanceof ServerLevel serverLevel) {
+ serverLevel.sendParticles(ParticleTypes.HEART, this.getRandomX(1.0D), this.getRandomY() + 0.5D, this.getRandomZ(1.0D), 1, d0, d1, d2, 0);
+ }
+ // DivineMC end
}
}

diff --git a/src/main/java/net/minecraft/world/entity/vehicle/Boat.java b/src/main/java/net/minecraft/world/entity/vehicle/Boat.java
index 7e9c88efd2a1edea673d1ef81635c2891a04d30e..26475c2d69537053a041ec9c2f8147842848a8fc 100644
--- a/src/main/java/net/minecraft/world/entity/vehicle/Boat.java
+++ b/src/main/java/net/minecraft/world/entity/vehicle/Boat.java
@@ -862,7 +862,7 @@ public class Boat extends VehicleEntity implements VariantHolder<Boat.Type> {
if (!this.isPassenger()) {
if (onGround) {
if (this.fallDistance > 3.0F) {
- if (this.status != Boat.Status.ON_LAND) {
+ if (this.status != Boat.Status.ON_LAND && this.status != Status.IN_AIR) { // DivineMC - Fix MC-98160 and MC-105103
this.resetFallDistance();
return;
}
33 changes: 33 additions & 0 deletions patches/server/0049-Fix-MC-Bug.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: lilingfengdev <lilingfengvvv@outlook.com>
Date: Tue, 16 Jan 2024 19:37:01 +0800
Subject: [PATCH] Fix MC Bug


diff --git a/src/main/java/net/minecraft/world/entity/animal/Wolf.java b/src/main/java/net/minecraft/world/entity/animal/Wolf.java
index 5d49ed7ddf44a3d549b178ae548664194967776b..8ff325a6f8e70be3df989296044d00931814a10a 100644
--- a/src/main/java/net/minecraft/world/entity/animal/Wolf.java
+++ b/src/main/java/net/minecraft/world/entity/animal/Wolf.java
@@ -655,14 +655,17 @@ public class Wolf extends TamableAnimal implements NeutralMob {
public boolean canMate(Animal other) {
if (other == this) {
return false;
- } else if (!this.isTame()) {
- return false;
} else if (!(other instanceof Wolf)) {
return false;
} else {
- Wolf entitywolf = (Wolf) other;
-
- return !entitywolf.isTame() ? false : (entitywolf.isInSittingPose() ? false : this.isInLove() && entitywolf.isInLove());
+ // DivineMC start - Fix MC-93018
+ Wolf wolf = (Wolf) other;
+ if (wolf.isInSittingPose()) {
+ return false;
+ } else {
+ return this.isInLove() && wolf.isInLove();
+ }
+ // DivineMC end
}
}

Loading