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

Upload #23

Merged
merged 19 commits into from
Jan 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
70 changes: 70 additions & 0 deletions patches/server/0048-Leaves-Disable-Moved-Wrongly-Threshold.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: lilingfengdev <[email protected]>
Date: Wed, 17 Jan 2024 13:46:16 +0800
Subject: [PATCH] Leaves Disable Moved Wrongly Threshold


diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 5736cb60316da784590ef03d5808376254aae20b..06c716715b29fa4d2481bb8716ac25e8ba3c4209 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -247,7 +247,9 @@ import org.bukkit.inventory.EquipmentSlot;
import org.bukkit.inventory.InventoryView;
import org.bukkit.inventory.SmithingInventory;
// CraftBukkit end
-
+// Leaf start
+import org.dreeam.leaf.LeafConfig;
+// Leaf end
public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl implements ServerGamePacketListener, ServerPlayerConnection, TickablePacketListener {

static final Logger LOGGER = LogUtils.getLogger();
@@ -583,7 +585,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
}
// Paper end

- if (d10 - d9 > Math.max(100.0D, Math.pow((double) (org.spigotmc.SpigotConfig.movedTooQuicklyMultiplier * (float) i * speed), 2)) && !this.isSingleplayerOwner()) {
+ if (!LeafConfig.disableMovedWronglyThreshold && d10 - d9 > Math.max(100.0D, Math.pow((double) (org.spigotmc.SpigotConfig.movedTooQuicklyMultiplier * (float) i * speed), 2)) && !this.isSingleplayerOwner()) { // Leaves - disable can
// CraftBukkit end
ServerGamePacketListenerImpl.LOGGER.warn("{} (vehicle of {}) moved too quickly! {},{},{}", new Object[]{entity.getName().getString(), this.player.getName().getString(), d6, d7, d8});
this.send(new ClientboundMoveVehiclePacket(entity));
@@ -619,7 +621,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
d10 = d6 * d6 + d7 * d7 + d8 * d8;
boolean flag2 = false;

- if (d10 > org.spigotmc.SpigotConfig.movedWronglyThreshold) { // Spigot
+ if (!LeafConfig.disableMovedWronglyThreshold && d10 > org.spigotmc.SpigotConfig.movedWronglyThreshold) { // Spigot // Leaves - disable can
flag2 = true; // Paper - diff on change, this should be moved wrongly
ServerGamePacketListenerImpl.LOGGER.warn("{} (vehicle of {}) moved wrongly! {}", new Object[]{entity.getName().getString(), this.player.getName().getString(), Math.sqrt(d10)});
}
@@ -1487,7 +1489,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
io.papermc.paper.event.player.PlayerFailMoveEvent event = fireFailMove(io.papermc.paper.event.player.PlayerFailMoveEvent.FailReason.MOVED_TOO_QUICKLY,
toX, toY, toZ, toYaw, toPitch, true);
if (!event.isAllowed()) {
- if (event.getLogWarning())
+ if (!LeafConfig.disableMovedWronglyThreshold && event.getLogWarning()) // Leaves - disable can
ServerGamePacketListenerImpl.LOGGER.warn("{} moved too quickly! {},{},{}", new Object[]{this.player.getName().getString(), d6, d7, d8});
this.teleport(this.player.getX(), this.player.getY(), this.player.getZ(), this.player.getYRot(), this.player.getXRot());
return;
@@ -1557,7 +1559,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
d10 = d6 * d6 + d7 * d7 + d8 * d8;
boolean flag2 = false;

- if (!this.player.isChangingDimension() && d10 > org.spigotmc.SpigotConfig.movedWronglyThreshold && !this.player.isSleeping() && !this.player.gameMode.isCreative() && this.player.gameMode.getGameModeForPlayer() != GameType.SPECTATOR) { // Spigot
+ if (!LeafConfig.disableMovedWronglyThreshold && !this.player.isChangingDimension() && d10 > org.spigotmc.SpigotConfig.movedWronglyThreshold && !this.player.isSleeping() && !this.player.gameMode.isCreative() && this.player.gameMode.getGameModeForPlayer() != GameType.SPECTATOR) { // Spigot // Leaves - disable can
// Paper start - Add fail move event
io.papermc.paper.event.player.PlayerFailMoveEvent event = fireFailMove(io.papermc.paper.event.player.PlayerFailMoveEvent.FailReason.MOVED_WRONGLY,
toX, toY, toZ, toYaw, toPitch, true);
diff --git a/src/main/java/org/dreeam/leaf/LeafConfig.java b/src/main/java/org/dreeam/leaf/LeafConfig.java
index c51b54bcb96d06197d6265055e2e9e44858cd224..156765eeee6ab46f18e34cf62dde1a7d878932cc 100644
--- a/src/main/java/org/dreeam/leaf/LeafConfig.java
+++ b/src/main/java/org/dreeam/leaf/LeafConfig.java
@@ -313,4 +313,8 @@ public class LeafConfig {
extraHorizontal = getDouble("playerKnockback.extraHorizontal", extraHorizontal);
extraVertical = getDouble("playerKnockback.extraVertical", extraVertical);
}
+ public static boolean disableMovedWronglyThreshold = false;
+ private static void getDisableMovedWronglyThreshold() {
+ disableMovedWronglyThreshold = getBoolean("disableMovedWronglyThreshold",disableMovedWronglyThreshold,:"Disable Moved Wrongly Threshold")
+ }
}
45 changes: 45 additions & 0 deletions patches/server/0049-Leaves-be-vanilla-end-gateway.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 <[email protected]>
Date: Wed, 17 Jan 2024 14:29:37 +0800
Subject: [PATCH] Leaves be vanilla end gateway


diff --git a/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java
index 5d9f25da1bd502b0047abc64ef7602968ee3cb20..2ca123ecd7cac2c7fdaafcc2c58c8c126adcf94a 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java
@@ -38,6 +38,9 @@ import org.bukkit.craftbukkit.entity.CraftPlayer;
import org.bukkit.craftbukkit.util.CraftLocation;
import org.bukkit.event.player.PlayerTeleportEvent;
// CraftBukkit end
+// Leaf start
+import org.dreeam.leaf.LeafConfig;
+// Leaf end

public class TheEndGatewayBlockEntity extends TheEndPortalBlockEntity {

@@ -107,7 +110,7 @@ public class TheEndGatewayBlockEntity extends TheEndPortalBlockEntity {
if (!list.isEmpty()) {
// Paper start
for (Entity entity : list) {
- if (entity.canChangeDimensions()) {
+ if (LeafConfig.vanillaEndTeleport || entity.canChangeDimensions()) { // Leaf - be vanilla
TheEndGatewayBlockEntity.teleportEntity(world, pos, state, entity, blockEntity);
break;
}
diff --git a/src/main/java/org/dreeam/leaf/LeafConfig.java b/src/main/java/org/dreeam/leaf/LeafConfig.java
index 156765eeee6ab46f18e34cf62dde1a7d878932cc..728082120af5a7afe20078b3fa6d80605f5ff6c7 100644
--- a/src/main/java/org/dreeam/leaf/LeafConfig.java
+++ b/src/main/java/org/dreeam/leaf/LeafConfig.java
@@ -315,6 +315,10 @@ public class LeafConfig {
}
public static boolean disableMovedWronglyThreshold = false;
private static void getDisableMovedWronglyThreshold() {
- disableMovedWronglyThreshold = getBoolean("disableMovedWronglyThreshold",disableMovedWronglyThreshold,:"Disable Moved Wrongly Threshold")
+ disableMovedWronglyThreshold = getBoolean("disableMovedWronglyThreshold",disableMovedWronglyThreshold,"Disable Moved Wrongly Threshold");
+ }
+ public static boolean vanillaEndTeleport = false;
+ private static void getVanillaTeleport() {
+ vanillaEndTeleport = getBoolean("vanillaEndTeleport",vanillaEndTeleport,"Vanilla End Gateway Teleport");
}
}
Loading