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

Fix tick issue and two mc-old features #239

Merged
merged 11 commits into from
Jun 26, 2024
7 changes: 4 additions & 3 deletions patches/server/0050-Fix-update-suppression-crash.patch
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,24 @@ index f7197f1347251a37dd0f6d9ffa2f09bc3a4e1233..8909f4f65864935f86608b0e00149c57
if (exception instanceof ReportedException) {
ReportedException reportedexception = (ReportedException) exception;
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 25e4fd107eefdd3c1420d6a1af541de9b6aa8b2c..7b6df49f1eb9e05a512d582db9ea49316f53314a 100644
index 25e4fd107eefdd3c1420d6a1af541de9b6aa8b2c..906542486e8e5d1242137a654bd102edb774adb8 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1715,6 +1715,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1715,7 +1715,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.profiler.push("tick");

try {
- worldserver.tick(shouldKeepTicking);
+ // Leaves start
+ try {
+ worldserver.tick(shouldKeepTicking);
+ } catch (org.leavesmc.leaves.util.UpdateSuppressionException e) {
+ org.leavesmc.leaves.LeavesLogger.LOGGER.info(e.getMessage());
+ }
+ // Leaves end
worldserver.tick(shouldKeepTicking);
} catch (Throwable throwable) {
CrashReport crashreport = CrashReport.forThrowable(throwable, "Exception ticking world");

diff --git a/src/main/java/net/minecraft/world/level/block/ShulkerBoxBlock.java b/src/main/java/net/minecraft/world/level/block/ShulkerBoxBlock.java
index 40518b1a58494525223e47845b4cb57c92a22d5e..4a0617f7b5f528421620ad504467212b7042716f 100644
--- a/src/main/java/net/minecraft/world/level/block/ShulkerBoxBlock.java
Expand Down
4 changes: 2 additions & 2 deletions patches/server/0051-Bedrock-break-list.patch
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ Subject: [PATCH] Bedrock break list


diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 7b6df49f1eb9e05a512d582db9ea49316f53314a..6dbc31ef1e5b8716e200a64835cf12f9c8232d25 100644
index 906542486e8e5d1242137a654bd102edb774adb8..5206abff6edc9e56d4671b8b36c409c71cf12eb0 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1748,6 +1748,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1747,6 +1747,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa

org.leavesmc.leaves.protocol.core.LeavesProtocolManager.handleTick(); // Leaves - protocol

Expand Down
42 changes: 42 additions & 0 deletions patches/server/0126-MCOld-allow-grindstone-overstacking.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Lumine1909 <133463833+Lumine1909@users.noreply.github.com>
Date: Wed, 26 Jun 2024 17:59:56 +0800
Subject: [PATCH] MCOld-allow-grindstone-overstacking


diff --git a/src/main/java/net/minecraft/world/inventory/GrindstoneMenu.java b/src/main/java/net/minecraft/world/inventory/GrindstoneMenu.java
index 1678f6c8b2c7db761783e53043169bf12bc2cb29..4bfea8b5139a10a3dd76d56159a1914a5ddc7c8f 100644
--- a/src/main/java/net/minecraft/world/inventory/GrindstoneMenu.java
+++ b/src/main/java/net/minecraft/world/inventory/GrindstoneMenu.java
@@ -202,7 +202,7 @@ public class GrindstoneMenu extends AbstractContainerMenu {
byte b0 = 1;

if (!firstInput.isDamageableItem()) {
- if (firstInput.getMaxStackSize() < 2 || !ItemStack.matches(firstInput, secondInput)) {
+ if (!org.leavesmc.leaves.LeavesConfig.allowGrindstoneOverstacking && firstInput.getMaxStackSize() < 2 || !ItemStack.matches(firstInput, secondInput)) { // Leaves - allowGrindstoneOverstaking
return ItemStack.EMPTY;
}

@@ -286,7 +286,7 @@ public class GrindstoneMenu extends AbstractContainerMenu {
ItemStack itemstack3 = this.repairSlots.getItem(1);

if (slot == 2) {
- if (!this.moveItemStackTo(itemstack1, 3, 39, true)) {
+ if (!this.moveItemStackTo(itemstack1, 3, 39, true, true)) { // Leaves - allowGrindstoneOverstacking: Disable stack check
return ItemStack.EMPTY;
}

diff --git a/src/main/java/org/leavesmc/leaves/LeavesConfig.java b/src/main/java/org/leavesmc/leaves/LeavesConfig.java
index 2a7f9d9fdb72786b08b3cb216f5aa5e5eac3c967..6ad969d47898199bfa2d73ecda3d26d3c4719520 100644
--- a/src/main/java/org/leavesmc/leaves/LeavesConfig.java
+++ b/src/main/java/org/leavesmc/leaves/LeavesConfig.java
@@ -918,5 +918,8 @@ public final class LeavesConfig {
@GlobalConfig(name = "vanilla-hopper", category = "fix")
public static boolean vanillaHopper = false;

- // Leaves end - region
+ @GlobalConfig(name = "allow-grindstone-overstacking", category = "fix")
+ public static boolean allowGrindstoneOverstacking = false;
+
+ // Leaves end - fix
}
31 changes: 31 additions & 0 deletions patches/server/0127-MCOld-MC-67.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Lumine1909 <133463833+Lumine1909@users.noreply.github.com>
Date: Wed, 26 Jun 2024 18:15:57 +0800
Subject: [PATCH] MCOld-MC-67


diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index b450c19fbb6cc7266db4ddc4bc86546ca2054d5a..69d2ee3bd4e89968da219f27231af241c88b3600 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -3753,7 +3753,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
}

public boolean canChangeDimensions(Level from, Level to) {
- return this.isAlive() && this.valid; // Paper - Fix item duplication and teleport issues
+ return !(this.isPassenger() || this.isVehicle() && !org.leavesmc.leaves.LeavesConfig.allowEntityPortalWithPassenger) && this.isAlive() && this.valid; // Paper - Fix item duplication and teleport issues // Leaves - allowEntityPortalWithPassenger
}

public float getBlockExplosionResistance(Explosion explosion, BlockGetter world, BlockPos pos, BlockState blockState, FluidState fluidState, float max) {
diff --git a/src/main/java/org/leavesmc/leaves/LeavesConfig.java b/src/main/java/org/leavesmc/leaves/LeavesConfig.java
index 6ad969d47898199bfa2d73ecda3d26d3c4719520..799fa0e780431cd690b86f3340850dd85a2e4884 100644
--- a/src/main/java/org/leavesmc/leaves/LeavesConfig.java
+++ b/src/main/java/org/leavesmc/leaves/LeavesConfig.java
@@ -921,5 +921,7 @@ public final class LeavesConfig {
@GlobalConfig(name = "allow-grindstone-overstacking", category = "fix")
public static boolean allowGrindstoneOverstacking = false;

+ @GlobalConfig(name = "allow-entity-portal-with-passenger", category = "fix")
+ public static boolean allowEntityPortalWithPassenger = true;
// Leaves end - fix
}