9
0
mirror of https://github.com/Winds-Studio/Leaf.git synced 2025-12-22 16:39:22 +00:00

Fix patches

This commit is contained in:
Dreeam
2024-01-20 00:34:23 -05:00
parent 7e9a3883d6
commit d9fd427eb0
28 changed files with 267 additions and 265 deletions

View File

@@ -3,6 +3,8 @@ From: Dreeam <61569423+Dreeam-qwq@users.noreply.github.com>
Date: Mon, 17 Jul 2023 08:31:51 +0800 Date: Mon, 17 Jul 2023 08:31:51 +0800
Subject: [PATCH] Purpur: Configurable server mod name Subject: [PATCH] Purpur: Configurable server mod name
Original license: MIT
Original project: https://github.com/PurpurMC/Purpur
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index fe3ad5d2acec094e9f363acb418233a2756fd0c3..a58b37b576888f865259e647fb30624fa99361bd 100644 index fe3ad5d2acec094e9f363acb418233a2756fd0c3..a58b37b576888f865259e647fb30624fa99361bd 100644

View File

@@ -1,70 +1,76 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: lilingfengdev <145678359+lilingfengdev@users.noreply.github.com> From: violetc <58360096+s-yh-china@users.noreply.github.com>
Date: Wed, 17 Jan 2024 13:46:16 +0800 Date: Thu, 28 Sep 2023 20:30:46 +0800
Subject: [PATCH] Leaves Disable Moved Wrongly Threshold Subject: [PATCH] Leaves: Disable moved wrongly threshold
Original license: GPLv3
Original project: https://github.com/LeavesMC/Leaves
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java 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 index 5736cb60316da784590ef03d5808376254aae20b..6d03d8818afb81fa9b5bd92c32a0fde63a4367e9 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/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; @@ -247,7 +247,6 @@ import org.bukkit.inventory.EquipmentSlot;
import org.bukkit.inventory.InventoryView; import org.bukkit.inventory.InventoryView;
import org.bukkit.inventory.SmithingInventory; import org.bukkit.inventory.SmithingInventory;
// CraftBukkit end // CraftBukkit end
- -
+// Leaf start
+import org.dreeam.leaf.LeafConfig;
+// Leaf end
public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl implements ServerGamePacketListener, ServerPlayerConnection, TickablePacketListener { public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl implements ServerGamePacketListener, ServerPlayerConnection, TickablePacketListener {
static final Logger LOGGER = LogUtils.getLogger(); static final Logger LOGGER = LogUtils.getLogger();
@@ -583,7 +585,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -583,7 +582,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
} }
// Paper end // Paper end
- if (d10 - d9 > Math.max(100.0D, Math.pow((double) (org.spigotmc.SpigotConfig.movedTooQuicklyMultiplier * (float) i * speed), 2)) && !this.isSingleplayerOwner()) { - 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 + if (!org.dreeam.leaf.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 // CraftBukkit end
ServerGamePacketListenerImpl.LOGGER.warn("{} (vehicle of {}) moved too quickly! {},{},{}", new Object[]{entity.getName().getString(), this.player.getName().getString(), d6, d7, d8}); 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)); this.send(new ClientboundMoveVehiclePacket(entity));
@@ -619,7 +621,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -619,7 +618,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
d10 = d6 * d6 + d7 * d7 + d8 * d8; d10 = d6 * d6 + d7 * d7 + d8 * d8;
boolean flag2 = false; boolean flag2 = false;
- if (d10 > org.spigotmc.SpigotConfig.movedWronglyThreshold) { // Spigot - if (d10 > org.spigotmc.SpigotConfig.movedWronglyThreshold) { // Spigot
+ if (!LeafConfig.disableMovedWronglyThreshold && d10 > org.spigotmc.SpigotConfig.movedWronglyThreshold) { // Spigot // Leaves - disable can + if (!org.dreeam.leaf.LeafConfig.disableMovedWronglyThreshold && d10 > org.spigotmc.SpigotConfig.movedWronglyThreshold) { // Spigot // Leaves - disable can
flag2 = true; // Paper - diff on change, this should be moved wrongly 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)}); 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 @@ -1487,7 +1486,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
io.papermc.paper.event.player.PlayerFailMoveEvent event = fireFailMove(io.papermc.paper.event.player.PlayerFailMoveEvent.FailReason.MOVED_TOO_QUICKLY, io.papermc.paper.event.player.PlayerFailMoveEvent event = fireFailMove(io.papermc.paper.event.player.PlayerFailMoveEvent.FailReason.MOVED_TOO_QUICKLY,
toX, toY, toZ, toYaw, toPitch, true); toX, toY, toZ, toYaw, toPitch, true);
if (!event.isAllowed()) { if (!event.isAllowed()) {
- if (event.getLogWarning()) - if (event.getLogWarning())
+ if (!LeafConfig.disableMovedWronglyThreshold && event.getLogWarning()) // Leaves - disable can + if (!org.dreeam.leaf.LeafConfig.disableMovedWronglyThreshold && event.getLogWarning()) // Leaves - disable can
ServerGamePacketListenerImpl.LOGGER.warn("{} moved too quickly! {},{},{}", new Object[]{this.player.getName().getString(), d6, d7, d8}); 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()); this.teleport(this.player.getX(), this.player.getY(), this.player.getZ(), this.player.getYRot(), this.player.getXRot());
return; return;
@@ -1557,7 +1559,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -1557,7 +1556,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
d10 = d6 * d6 + d7 * d7 + d8 * d8; d10 = d6 * d6 + d7 * d7 + d8 * d8;
boolean flag2 = false; 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 (!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 + if (!org.dreeam.leaf.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 // Paper start - Add fail move event
io.papermc.paper.event.player.PlayerFailMoveEvent event = fireFailMove(io.papermc.paper.event.player.PlayerFailMoveEvent.FailReason.MOVED_WRONGLY, io.papermc.paper.event.player.PlayerFailMoveEvent event = fireFailMove(io.papermc.paper.event.player.PlayerFailMoveEvent.FailReason.MOVED_WRONGLY,
toX, toY, toZ, toYaw, toPitch, true); 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 diff --git a/src/main/java/org/dreeam/leaf/LeafConfig.java b/src/main/java/org/dreeam/leaf/LeafConfig.java
index c51b54bcb96d06197d6265055e2e9e44858cd224..156765eeee6ab46f18e34cf62dde1a7d878932cc 100644 index 49fc8b6e0be0e1d5bdc283cef91ab0834dc387f1..c16913bda424c060d0abd83fcfaa93f52f4f8891 100644
--- a/src/main/java/org/dreeam/leaf/LeafConfig.java --- a/src/main/java/org/dreeam/leaf/LeafConfig.java
+++ b/src/main/java/org/dreeam/leaf/LeafConfig.java +++ b/src/main/java/org/dreeam/leaf/LeafConfig.java
@@ -313,4 +313,8 @@ public class LeafConfig { @@ -176,6 +176,7 @@ public class LeafConfig {
extraHorizontal = getDouble("playerKnockback.extraHorizontal", extraHorizontal); public static boolean removeSpigotCheckBungeeConfig = true;
extraVertical = getDouble("playerKnockback.extraVertical", extraVertical); public static boolean removeUseItemOnPacketTooFar = false;
} public static double maxUseItemDistance = 1.0000001D;
+ public static boolean disableMovedWronglyThreshold = false; + public static boolean disableMovedWronglyThreshold = false;
+ private static void getDisableMovedWronglyThreshold() { private static void removal() {
+ disableMovedWronglyThreshold = getBoolean("disableMovedWronglyThreshold",disableMovedWronglyThreshold,:"Disable Moved Wrongly Threshold") removeMojangUsernameCheck = getBoolean("remove-Mojang-username-check", removeMojangUsernameCheck,
+ } "Remove username check of Mojang",
} @@ -186,6 +187,7 @@ public class LeafConfig {
removeUseItemOnPacketTooFar = getBoolean("remove-UseItemOnPacket-too-far-check", removeUseItemOnPacketTooFar,
"To enable this, players can use some packet modules with hack clients and the NoCom Exploit!!");
maxUseItemDistance = getDouble("max-UseItem-distance", maxUseItemDistance, "The max distance of UseItem for players");
+ disableMovedWronglyThreshold = getBoolean("disable-MovedWronglyThreshold", disableMovedWronglyThreshold, "Disable moved quickly/wrongly checks");
}
public static boolean enableAsyncMobSpawning = true;

View File

@@ -0,0 +1,35 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: violetc <58360096+s-yh-china@users.noreply.github.com>
Date: Tue, 15 Aug 2023 22:40:42 +0800
Subject: [PATCH] Leaves: Fix vehicle teleport by end gateway
Original license: GPLv3
Original project: https://github.com/LeavesMC/Leaves
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..9f84d53f82e430e92568aef0bb7ec5bd7ffc46a0 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
@@ -107,7 +107,7 @@ public class TheEndGatewayBlockEntity extends TheEndPortalBlockEntity {
if (!list.isEmpty()) {
// Paper start
for (Entity entity : list) {
- if (entity.canChangeDimensions()) {
+ if (org.dreeam.leaf.LeafConfig.useVanillaEndTeleport || 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 c16913bda424c060d0abd83fcfaa93f52f4f8891..41009a22116ef4a81e9e550af186f5c0d9d43fa7 100644
--- a/src/main/java/org/dreeam/leaf/LeafConfig.java
+++ b/src/main/java/org/dreeam/leaf/LeafConfig.java
@@ -280,4 +280,9 @@ public class LeafConfig {
gg.pufferfish.pufferfish.sentry.SentryManager.init();
}
}
+
+ public static boolean useVanillaEndTeleport = false;
+ private static void vanillaEndTeleport() {
+ useVanillaEndTeleport = getBoolean("use-vanilla-end-teleport", useVanillaEndTeleport, "Vanilla End Gateway Teleport");
+ }
}

View File

@@ -3,11 +3,12 @@ From: peaches94 <peachescu94@gmail.com>
Date: Sun, 26 Jun 2022 16:51:37 -0500 Date: Sun, 26 Jun 2022 16:51:37 -0500
Subject: [PATCH] Petal: Async Pathfinding Subject: [PATCH] Petal: Async Pathfinding
Fixed & Updated by KaiijuMC , licensed under GPL v3 Fixed & Updated by KaiijuMC
You can find the original code on https://github.com/KaiijuMC/Kaiiju Original license: GPLv3
Original project: https://github.com/KaiijuMC/Kaiiju
Original code by Bloom-host, licensed under GPL v3 Original license: GPLv3
You can find the original code on https://github.com/Bloom-host/Petal Original project: https://github.com/Bloom-host/Petal
This patch was ported downstream from the Petal fork. This patch was ported downstream from the Petal fork.
@@ -935,7 +936,7 @@ index 0e2b14e7dfedf209d63279c81723fd7955122d78..079b278e2e262af433bb5bd0c12b3d8d
public SwimNodeEvaluator(boolean canJumpOutOfWater) { public SwimNodeEvaluator(boolean canJumpOutOfWater) {
diff --git a/src/main/java/org/dreeam/leaf/LeafConfig.java b/src/main/java/org/dreeam/leaf/LeafConfig.java diff --git a/src/main/java/org/dreeam/leaf/LeafConfig.java b/src/main/java/org/dreeam/leaf/LeafConfig.java
index 49fc8b6e0be0e1d5bdc283cef91ab0834dc387f1..bf0a146b34b227dff392340fc0f53017d0691bdb 100644 index 41009a22116ef4a81e9e550af186f5c0d9d43fa7..d6646f4db522aa4a5404acf17fb34bfe01a5763a 100644
--- a/src/main/java/org/dreeam/leaf/LeafConfig.java --- a/src/main/java/org/dreeam/leaf/LeafConfig.java
+++ b/src/main/java/org/dreeam/leaf/LeafConfig.java +++ b/src/main/java/org/dreeam/leaf/LeafConfig.java
@@ -5,6 +5,7 @@ import net.minecraft.core.registries.BuiltInRegistries; @@ -5,6 +5,7 @@ import net.minecraft.core.registries.BuiltInRegistries;
@@ -954,7 +955,7 @@ index 49fc8b6e0be0e1d5bdc283cef91ab0834dc387f1..bf0a146b34b227dff392340fc0f53017
public class LeafConfig { public class LeafConfig {
@@ -198,6 +200,9 @@ public class LeafConfig { @@ -200,6 +202,9 @@ public class LeafConfig {
public static boolean throttleInactiveGoalSelectorTick = true; public static boolean throttleInactiveGoalSelectorTick = true;
public static Map<String, Integer> projectileTimeouts; public static Map<String, Integer> projectileTimeouts;
public static boolean useSpigotItemMergingMechanism = true; public static boolean useSpigotItemMergingMechanism = true;
@@ -964,7 +965,7 @@ index 49fc8b6e0be0e1d5bdc283cef91ab0834dc387f1..bf0a146b34b227dff392340fc0f53017
private static void performance() { private static void performance() {
boolean asyncMobSpawning = getBoolean("performance.enable-async-mob-spawning", enableAsyncMobSpawning, boolean asyncMobSpawning = getBoolean("performance.enable-async-mob-spawning", enableAsyncMobSpawning,
"Whether or not asynchronous mob spawning should be enabled.", "Whether or not asynchronous mob spawning should be enabled.",
@@ -247,6 +252,17 @@ public class LeafConfig { @@ -249,6 +254,17 @@ public class LeafConfig {
entityType.ttl = config.getInt("entity_timeouts." + type, -1); entityType.ttl = config.getInt("entity_timeouts." + type, -1);
} }
useSpigotItemMergingMechanism = getBoolean("performance.use-spigot-item-merging-mechanism", useSpigotItemMergingMechanism); useSpigotItemMergingMechanism = getBoolean("performance.use-spigot-item-merging-mechanism", useSpigotItemMergingMechanism);

View File

@@ -64,10 +64,10 @@ index c809e370ab61811c7e2fa3d6f207ae04fcb6749b..30db428ade01213ccd9956cd739747b5
while (iterator1.hasNext()) { while (iterator1.hasNext()) {
Entity entity1 = (Entity) iterator1.next(); Entity entity1 = (Entity) iterator1.next();
diff --git a/src/main/java/org/dreeam/leaf/LeafConfig.java b/src/main/java/org/dreeam/leaf/LeafConfig.java diff --git a/src/main/java/org/dreeam/leaf/LeafConfig.java b/src/main/java/org/dreeam/leaf/LeafConfig.java
index bf0a146b34b227dff392340fc0f53017d0691bdb..0d7ffc85fba9bc7586a68f09c1636f81198aa19f 100644 index d6646f4db522aa4a5404acf17fb34bfe01a5763a..475d53b5b5ef82f982f3619eb161e76db095b73f 100644
--- a/src/main/java/org/dreeam/leaf/LeafConfig.java --- a/src/main/java/org/dreeam/leaf/LeafConfig.java
+++ b/src/main/java/org/dreeam/leaf/LeafConfig.java +++ b/src/main/java/org/dreeam/leaf/LeafConfig.java
@@ -203,6 +203,7 @@ public class LeafConfig { @@ -205,6 +205,7 @@ public class LeafConfig {
public static boolean asyncPathfinding = false; public static boolean asyncPathfinding = false;
public static int asyncPathfindingMaxThreads = 0; public static int asyncPathfindingMaxThreads = 0;
public static int asyncPathfindingKeepalive = 60; public static int asyncPathfindingKeepalive = 60;
@@ -75,7 +75,7 @@ index bf0a146b34b227dff392340fc0f53017d0691bdb..0d7ffc85fba9bc7586a68f09c1636f81
private static void performance() { private static void performance() {
boolean asyncMobSpawning = getBoolean("performance.enable-async-mob-spawning", enableAsyncMobSpawning, boolean asyncMobSpawning = getBoolean("performance.enable-async-mob-spawning", enableAsyncMobSpawning,
"Whether or not asynchronous mob spawning should be enabled.", "Whether or not asynchronous mob spawning should be enabled.",
@@ -263,6 +264,9 @@ public class LeafConfig { @@ -265,6 +266,9 @@ public class LeafConfig {
asyncPathfindingMaxThreads = 0; asyncPathfindingMaxThreads = 0;
else else
Bukkit.getLogger().log(Level.INFO, "Using " + asyncPathfindingMaxThreads + " threads for Async Pathfinding"); Bukkit.getLogger().log(Level.INFO, "Using " + asyncPathfindingMaxThreads + " threads for Async Pathfinding");

View File

@@ -6,10 +6,10 @@ Subject: [PATCH] Reduce canSee work
Credit by: Martijn Muijsers <martijnmuijsers@live.nl>, MachineBreaker<machinebreaker> Credit by: Martijn Muijsers <martijnmuijsers@live.nl>, MachineBreaker<machinebreaker>
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 2c5c84c028d1298bb145fa1149752db3f83d5de2..202805185a61316c559c22be7c0d880d77abc503 100644 index 2c5c84c028d1298bb145fa1149752db3f83d5de2..86d535c704d174da9b75bd599a7b302ba5fe5e56 100644
--- a/src/main/java/net/minecraft/world/level/Level.java --- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -386,11 +386,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -386,17 +386,19 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
for (int i = 0, len = entities.size(); i < len; ++i) { for (int i = 0, len = entities.size(); i < len; ++i) {
Entity entity = entities.get(i); Entity entity = entities.get(i);
@@ -22,42 +22,27 @@ index 2c5c84c028d1298bb145fa1149752db3f83d5de2..202805185a61316c559c22be7c0d880d
// !entity1.dead && entity1.i && (entity == null || !entity1.x(entity)); // !entity1.dead && entity1.i && (entity == null || !entity1.x(entity));
// elide the last check since vanilla calls with entity = null // elide the last check since vanilla calls with entity = null
// only we care about the source for the canSee check // only we care about the source for the canSee check
@@ -398,6 +394,11 @@ public abstract class Level implements LevelAccessor, AutoCloseable { if (entity.isRemoved() || !entity.blocksBuilding) {
continue; continue;
} }
+ // Leaf end
+
+ if (checkCanSee && source instanceof net.minecraft.server.level.ServerPlayer && entity instanceof net.minecraft.server.level.ServerPlayer + if (checkCanSee && source instanceof net.minecraft.server.level.ServerPlayer && entity instanceof net.minecraft.server.level.ServerPlayer
+ && !((net.minecraft.server.level.ServerPlayer) source).getBukkitEntity().canSee(((net.minecraft.server.level.ServerPlayer) entity).getBukkitEntity())) { + && !((net.minecraft.server.level.ServerPlayer) source).getBukkitEntity().canSee(((net.minecraft.server.level.ServerPlayer) entity).getBukkitEntity())) {
+ continue; + continue;
+ } + }
+
if (net.minecraft.world.phys.shapes.Shapes.joinIsNotEmpty(voxelshape, net.minecraft.world.phys.shapes.Shapes.create(entity.getBoundingBox()), net.minecraft.world.phys.shapes.BooleanOp.AND)) { if (net.minecraft.world.phys.shapes.Shapes.joinIsNotEmpty(voxelshape, net.minecraft.world.phys.shapes.Shapes.create(entity.getBoundingBox()), net.minecraft.world.phys.shapes.BooleanOp.AND)) {
return false; return false;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 7e13ffee8e650cd5fe63fddf636321830e6ffb6d..b1442a099fa38fe20e9421f9183d66cf1ec54c2f 100644 index 7e13ffee8e650cd5fe63fddf636321830e6ffb6d..f0da7fb7b09c8a5483b5d741810ab99985df64b6 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -585,12 +585,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -591,6 +591,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
this.getHandle().connection.send(packet);
}
+ // Leaf - TODO
@Override
public boolean equals(Object obj) {
if (!(obj instanceof OfflinePlayer)) {
return false; return false;
} }
OfflinePlayer other = (OfflinePlayer) obj; OfflinePlayer other = (OfflinePlayer) obj;
+ if (this == obj) return true; // Leaf + if (this == obj) return true; // Leaf - reduce canSee work
if ((this.getUniqueId() == null) || (other.getUniqueId() == null)) { if ((this.getUniqueId() == null) || (other.getUniqueId() == null)) {
return false; return false;
} }
@@ -2160,6 +2162,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
return this.canSee((org.bukkit.entity.Entity) player);
}
+ // Leaf - TODO
@Override
public boolean canSee(org.bukkit.entity.Entity entity) {
return this.equals(entity) || entity.isVisibleByDefault() ^ this.invertedVisibilityEntities.containsKey(entity.getUniqueId()); // SPIGOT-7312: Can always see self

View File

@@ -22,7 +22,7 @@ index ff1ad1024419182f7f3de578442c1c033d4c9ebb..5e51a1c79811291a740ad4d5e79a7d67
@Deprecated @Deprecated
static RandomSource createThreadSafe() { static RandomSource createThreadSafe() {
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 202805185a61316c559c22be7c0d880d77abc503..0e33e62761b0cc12925f238226cca35c253914ae 100644 index 86d535c704d174da9b75bd599a7b302ba5fe5e56..8658ba808791901cf45b3aeb6317b3ec80387609 100644
--- a/src/main/java/net/minecraft/world/level/Level.java --- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -128,6 +128,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -128,6 +128,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {

View File

@@ -5,7 +5,7 @@ Subject: [PATCH] Faster Random for xaeroMapServerID generation
diff --git a/src/main/java/org/dreeam/leaf/LeafConfig.java b/src/main/java/org/dreeam/leaf/LeafConfig.java diff --git a/src/main/java/org/dreeam/leaf/LeafConfig.java b/src/main/java/org/dreeam/leaf/LeafConfig.java
index 0d7ffc85fba9bc7586a68f09c1636f81198aa19f..2b2b87deb9a8d7df23cc5598c975da201bc8ee48 100644 index 475d53b5b5ef82f982f3619eb161e76db095b73f..c871d3c03b384a3f7e4c8c919b9d565ebe4e8a77 100644
--- a/src/main/java/org/dreeam/leaf/LeafConfig.java --- a/src/main/java/org/dreeam/leaf/LeafConfig.java
+++ b/src/main/java/org/dreeam/leaf/LeafConfig.java +++ b/src/main/java/org/dreeam/leaf/LeafConfig.java
@@ -2,7 +2,7 @@ package org.dreeam.leaf; @@ -2,7 +2,7 @@ package org.dreeam.leaf;
@@ -17,7 +17,7 @@ index 0d7ffc85fba9bc7586a68f09c1636f81198aa19f..2b2b87deb9a8d7df23cc5598c975da20
import net.minecraft.server.MinecraftServer; import net.minecraft.server.MinecraftServer;
import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.EntityType;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
@@ -272,7 +272,7 @@ public class LeafConfig { @@ -274,7 +274,7 @@ public class LeafConfig {
public static boolean jadeProtocol = false; public static boolean jadeProtocol = false;
public static boolean appleskinProtocol = false; public static boolean appleskinProtocol = false;
public static boolean xaeroMapProtocol = false; public static boolean xaeroMapProtocol = false;

View File

@@ -5,7 +5,7 @@ Subject: [PATCH] Fix sprint glitch
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 6ca39830ead96eb18e9b5e637d1ea33c93e30198..0a8e22a7aabca12b3d6391b21d6e431398c01ba9 100644 index 6ca39830ead96eb18e9b5e637d1ea33c93e30198..0c7c73fcc5f5c2f2b5362409e185f0c38ab85b6c 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -1429,7 +1429,8 @@ public abstract class LivingEntity extends Entity implements Attackable { @@ -1429,7 +1429,8 @@ public abstract class LivingEntity extends Entity implements Attackable {

View File

@@ -3,15 +3,15 @@ From: hpfxd <me@hpfxd.com>
Date: Tue, 2 Jan 2024 01:47:36 -0500 Date: Tue, 2 Jan 2024 01:47:36 -0500
Subject: [PATCH] PandaSpigot: Configurable knockback Subject: [PATCH] PandaSpigot: Configurable knockback
Original code by hpfxd, licensed under GPL v3 Original license: GPLv3
You can find the original code on https://github.com/hpfxd/PandaSpigot Original project: https://github.com/hpfxd/PandaSpigot
This patch allows velocity applied when a player is hit to be modified in the configuration. This patch allows velocity applied when a player is hit to be modified in the configuration.
Reference: https://gist.github.com/YoungOG/e3265d98661957abece71594b70d6a01 Reference: https://gist.github.com/YoungOG/e3265d98661957abece71594b70d6a01
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 0a8e22a7aabca12b3d6391b21d6e431398c01ba9..62e4fa9b5cb4043990c6642df43c8ef5c61caa17 100644 index 0c7c73fcc5f5c2f2b5362409e185f0c38ab85b6c..424779ac48351f79e64522e954b0b20778ca8a3a 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -1965,7 +1965,13 @@ public abstract class LivingEntity extends Entity implements Attackable { @@ -1965,7 +1965,13 @@ public abstract class LivingEntity extends Entity implements Attackable {
@@ -104,7 +104,7 @@ index b0aa6482936338b5102efaaae682e8b26dc4ede6..040231a7c6388b30d9aa1e0287f34801
if (flag2) { if (flag2) {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index b1442a099fa38fe20e9421f9183d66cf1ec54c2f..468ac1525c97043b53b16440fec6bb784e1e9c25 100644 index f0da7fb7b09c8a5483b5d741810ab99985df64b6..56da11efc3be1da40dcbb7080f64bd9719517153 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -67,6 +67,7 @@ import net.minecraft.network.protocol.game.ClientboundSetBorderSizePacket; @@ -67,6 +67,7 @@ import net.minecraft.network.protocol.game.ClientboundSetBorderSizePacket;
@@ -115,7 +115,7 @@ index b1442a099fa38fe20e9421f9183d66cf1ec54c2f..468ac1525c97043b53b16440fec6bb78
import net.minecraft.network.protocol.game.ClientboundSetEquipmentPacket; import net.minecraft.network.protocol.game.ClientboundSetEquipmentPacket;
import net.minecraft.network.protocol.game.ClientboundSetExperiencePacket; import net.minecraft.network.protocol.game.ClientboundSetExperiencePacket;
import net.minecraft.network.protocol.game.ClientboundSetHealthPacket; import net.minecraft.network.protocol.game.ClientboundSetHealthPacket;
@@ -3271,6 +3272,40 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -3269,6 +3270,40 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
getHandle().resetAttackStrengthTicker(); getHandle().resetAttackStrengthTicker();
} }
// Paper end // Paper end
@@ -157,12 +157,12 @@ index b1442a099fa38fe20e9421f9183d66cf1ec54c2f..468ac1525c97043b53b16440fec6bb78
private final Player.Spigot spigot = new Player.Spigot() private final Player.Spigot spigot = new Player.Spigot()
{ {
diff --git a/src/main/java/org/dreeam/leaf/LeafConfig.java b/src/main/java/org/dreeam/leaf/LeafConfig.java diff --git a/src/main/java/org/dreeam/leaf/LeafConfig.java b/src/main/java/org/dreeam/leaf/LeafConfig.java
index 2b2b87deb9a8d7df23cc5598c975da201bc8ee48..c51b54bcb96d06197d6265055e2e9e44858cd224 100644 index c871d3c03b384a3f7e4c8c919b9d565ebe4e8a77..635f09b234c723b79d35686105c2c3335f868e6a 100644
--- a/src/main/java/org/dreeam/leaf/LeafConfig.java --- a/src/main/java/org/dreeam/leaf/LeafConfig.java
+++ b/src/main/java/org/dreeam/leaf/LeafConfig.java +++ b/src/main/java/org/dreeam/leaf/LeafConfig.java
@@ -298,4 +298,19 @@ public class LeafConfig { @@ -305,4 +305,19 @@ public class LeafConfig {
gg.pufferfish.pufferfish.sentry.SentryManager.init(); private static void vanillaEndTeleport() {
} useVanillaEndTeleport = getBoolean("use-vanilla-end-teleport", useVanillaEndTeleport, "Vanilla End Gateway Teleport");
} }
+ +
+ public static double friction = 2.0D; + public static double friction = 2.0D;

View File

@@ -1,45 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: lilingfengdev <145678359+lilingfengdev@users.noreply.github.com>
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");
}
}

View File

@@ -10,7 +10,7 @@ But still recommend to turn-off `checkForMinecartNearItemWhileActive`
Since `Reduce-hopper-item-checks.patch` will cause lag under massive dropped items Since `Reduce-hopper-item-checks.patch` will cause lag under massive dropped items
diff --git a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java diff --git a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
index 0fe02df86483809cef22fca2e2ce0af7b4a5c6d5..7fce419490b39409f876914ce306f77d11e659b7 100644 index 1f61dc925624c493ae458748e8422383104b022f..4ba2285e9d5ec3444c73419f8fab040a96a03c0e 100644
--- a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java --- a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
+++ b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java +++ b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
@@ -1,7 +1,9 @@ @@ -1,7 +1,9 @@
@@ -23,7 +23,7 @@ index 0fe02df86483809cef22fca2e2ce0af7b4a5c6d5..7fce419490b39409f876914ce306f77d
import java.util.Objects; import java.util.Objects;
import java.util.UUID; import java.util.UUID;
import javax.annotation.Nullable; import javax.annotation.Nullable;
@@ -219,7 +221,9 @@ public class ItemEntity extends Entity implements TraceableEntity { @@ -237,7 +239,9 @@ public class ItemEntity extends Entity implements TraceableEntity {
this.discard(); this.discard();
return; // Gale - EMC - reduce hopper item checks return; // Gale - EMC - reduce hopper item checks
} }
@@ -34,7 +34,7 @@ index 0fe02df86483809cef22fca2e2ce0af7b4a5c6d5..7fce419490b39409f876914ce306f77d
} }
} }
@@ -231,17 +235,53 @@ public class ItemEntity extends Entity implements TraceableEntity { @@ -249,17 +253,53 @@ public class ItemEntity extends Entity implements TraceableEntity {
if (config.interval <= 1) { if (config.interval <= 1) {
return; return;
} }

View File

@@ -1,108 +1,122 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: lilingfengdev <145678359+lilingfengdev@users.noreply.github.com> From: Warrior <50800980+Warriorrrr@users.noreply.github.com>
Date: Wed, 17 Jan 2024 19:40:17 +0800 Date: Mon, 14 Aug 2023 17:34:53 +0200
Subject: [PATCH] SparklyPaper Rewrite-framed-map-tracker-ticking Subject: [PATCH] PaperPR: Rewrite framed map tracker ticking
Original license: GPLv3
Original project:
- https://github.com/PaperMC/Paper/pull/9605
- https://github.com/SparklyPower/SparklyPaper
Rewrites the tracking code for framed maps to remove the use of the tickCarriedBy method and the HoldingPlayer class.
The tickCarriedBy method contained a lot of code that did not apply to framed maps at all, and by moving the parts
that did elsewhere, we can essentially skip it. The only logic that's ran inside the ServerEntity#sendChanges for maps
now is just updating dirty map/decoration data.
When no bukkit renderers are added to the map, we also re-use the same packet for all players who are tracking it which avoids a lot of work.
diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java
index 068dd1194016b65227ec44747b065860a48e7f1d..26a68dd4e7373291c645053990e63eb27ac41dbf 100644 index 068dd1194016b65227ec44747b065860a48e7f1d..3c0d5fe3a5b3f77fc102e4c09645c96abca4f7e9 100644
--- a/src/main/java/net/minecraft/server/level/ServerEntity.java --- a/src/main/java/net/minecraft/server/level/ServerEntity.java
+++ b/src/main/java/net/minecraft/server/level/ServerEntity.java +++ b/src/main/java/net/minecraft/server/level/ServerEntity.java
@@ -115,23 +115,35 @@ public class ServerEntity { @@ -111,29 +111,42 @@ public class ServerEntity {
Entity entity = this.entity;
- if (!this.trackedPlayers.isEmpty() && entity instanceof ItemFrame) { // Paper - Only tick item frames if players can see it
+ if (!this.trackedPlayers.isEmpty() && entity instanceof ItemFrame frame && frame.cachedMapId != null) { // Paper - Only tick item frames if players can see it // Paper
ItemFrame entityitemframe = (ItemFrame) entity; ItemFrame entityitemframe = (ItemFrame) entity;
if (true || this.tickCount % 10 == 0) { // CraftBukkit - Moved below, should always enter this block if (true || this.tickCount % 10 == 0) { // CraftBukkit - Moved below, should always enter this block
- ItemStack itemstack = entityitemframe.getItem(); - ItemStack itemstack = entityitemframe.getItem();
+ //ItemStack itemstack = entityitemframe.getItem(); // SparklyPaper + //ItemStack itemstack = entityitemframe.getItem(); // Paper - skip redundant getItem
- if (this.level.paperConfig().maps.itemFrameCursorUpdateInterval > 0 && this.tickCount % this.level.paperConfig().maps.itemFrameCursorUpdateInterval == 0 && itemstack.getItem() instanceof MapItem) { // CraftBukkit - Moved this.tickCounter % 10 logic here so item frames do not enter the other blocks // Paper - Make item frame map cursor update interval configurable - if (this.level.paperConfig().maps.itemFrameCursorUpdateInterval > 0 && this.tickCount % this.level.paperConfig().maps.itemFrameCursorUpdateInterval == 0 && itemstack.getItem() instanceof MapItem) { // CraftBukkit - Moved this.tickCounter % 10 logic here so item frames do not enter the other blocks // Paper - Make item frame map cursor update interval configurable
+ if (this.level.paperConfig().maps.itemFrameCursorUpdateInterval > 0 && this.tickCount % this.level.paperConfig().maps.itemFrameCursorUpdateInterval == 0 /*&&itemstack.getItem() instanceof MapItem*/) { // CraftBukkit - Moved this.tickCounter % 10 logic here so item frames do not enter the other blocks // SparklyPaper - Make item frame map cursor update interval configurable + if (this.level.paperConfig().maps.itemFrameCursorUpdateInterval > 0 && this.tickCount % this.level.paperConfig().maps.itemFrameCursorUpdateInterval == 0 /*&& itemstack.getItem() instanceof MapItem*/) { // CraftBukkit - Moved this.tickCounter % 10 logic here so item frames do not enter the other blocks // Paper - Make item frame map cursor update interval configurable // Paper - skip redundant getItem
Integer integer = entityitemframe.cachedMapId; // Paper Integer integer = entityitemframe.cachedMapId; // Paper
MapItemSavedData worldmap = MapItem.getSavedData(integer, this.level); MapItemSavedData worldmap = MapItem.getSavedData(integer, this.level);
if (worldmap != null) { if (worldmap != null) {
- Iterator<ServerPlayerConnection> iterator = this.trackedPlayers.iterator(); // CraftBukkit + // Paper start - re-use the same update packet when possible
+ // SparklyPaper start - re-use the same update packet when possible
+ if (!worldmap.hasContextualRenderer) { + if (!worldmap.hasContextualRenderer) {
+ // Pass in a "random" player when a non-contextual plugin renderer is added to make sure its called + // Pass in a "random" player when a non-contextual plugin renderer is added to make sure its called
+ final Packet<?> updatePacket = worldmap.framedUpdatePacket(integer, worldmap.hasPluginRenderer ? com.google.common.collect.Iterables.getFirst(this.trackedPlayers, null).getPlayer() : null); + final Packet<?> updatePacket = worldmap.framedUpdatePacket(integer, worldmap.hasPluginRenderer ? com.google.common.collect.Iterables.getFirst(this.trackedPlayers, null).getPlayer() : null);
+
+ if (updatePacket != null) { + if (updatePacket != null) {
+ for (ServerPlayerConnection connection : this.trackedPlayers) { + for (ServerPlayerConnection connection : this.trackedPlayers) {
+ connection.send(updatePacket); + connection.send(updatePacket);
+ }
+ } + }
+ }
+ } else { + } else {
+ // SparklyPaper end + // Paper end
+ Iterator<ServerPlayerConnection> iterator = this.trackedPlayers.iterator(); // CraftBukkit Iterator<ServerPlayerConnection> iterator = this.trackedPlayers.iterator(); // CraftBukkit
- while (iterator.hasNext()) { while (iterator.hasNext()) {
- ServerPlayer entityplayer = iterator.next().getPlayer(); // CraftBukkit ServerPlayer entityplayer = iterator.next().getPlayer(); // CraftBukkit
+ while (iterator.hasNext()) {
+ ServerPlayer entityplayer = iterator.next().getPlayer(); // CraftBukkit
- worldmap.tickCarriedBy(entityplayer, itemstack); - worldmap.tickCarriedBy(entityplayer, itemstack);
- Packet<?> packet = worldmap.getUpdatePacket(integer, entityplayer); - Packet<?> packet = worldmap.getUpdatePacket(integer, entityplayer);
+ //worldmap.tickCarriedBy(entityplayer, itemstack); // SparklyPaper + //worldmap.tickCarriedBy(entityplayer, itemstack); // Paper
+ Packet<?> packet = worldmap.framedUpdatePacket(integer, entityplayer); // SparklyPaper + Packet<?> packet = worldmap.framedUpdatePacket(integer, entityplayer); // Paper
- if (packet != null) { if (packet != null) {
- entityplayer.connection.send(packet); entityplayer.connection.send(packet);
+ if (packet != null) {
+ entityplayer.connection.send(packet);
+ }
} }
} }
+ } // Paper
} }
@@ -367,7 +379,19 @@ public class ServerEntity { }
sender.accept(new ClientboundSetEntityLinkPacket(entityinsentient, entityinsentient.getLeashHolder()));
@@ -368,6 +381,19 @@ public class ServerEntity {
} }
} }
+ // SparklyPaper start
+ // Paper start - send full map when tracked
+ if (this.entity instanceof ItemFrame frame && frame.cachedMapId != null) { + if (this.entity instanceof ItemFrame frame && frame.cachedMapId != null) {
+ MapItemSavedData mapData = MapItem.getSavedData(frame.cachedMapId, this.level); + MapItemSavedData mapData = MapItem.getSavedData(frame.cachedMapId, this.level);
+ +
+ if (mapData != null) { + if (mapData != null) {
+ mapData.addFrameDecoration(frame); + mapData.addFrameDecoration(frame);
+
+ final Packet<?> mapPacket = mapData.fullUpdatePacket(frame.cachedMapId, mapData.hasPluginRenderer ? player : null); + final Packet<?> mapPacket = mapData.fullUpdatePacket(frame.cachedMapId, mapData.hasPluginRenderer ? player : null);
+ if (mapPacket != null) + if (mapPacket != null)
+ sender.accept((Packet<ClientGamePacketListener>) mapPacket); + sender.accept((Packet<ClientGamePacketListener>) mapPacket);
+ } + }
+ } + }
+ // SparklyPaper end + // Paper end
} }
private void sendDirtyEntityData() { private void sendDirtyEntityData() {
diff --git a/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java b/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java diff --git a/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java b/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java
index d728dc8a9b5fa2de0a824aaf132ee15db090b02e..37d83ae140ee07dc448a18d0061fc091785da063 100644 index d728dc8a9b5fa2de0a824aaf132ee15db090b02e..61532177b24311cbc91d52fd460d818eedea66b0 100644
--- a/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java --- a/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java
+++ b/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java +++ b/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java
@@ -489,6 +489,16 @@ public class ItemFrame extends HangingEntity { @@ -489,6 +489,16 @@ public class ItemFrame extends HangingEntity {
} }
this.setItem(ItemStack.fromBukkitCopy(event.getItemStack())); this.setItem(ItemStack.fromBukkitCopy(event.getItemStack()));
// Paper end // Paper end
+ // SparklyPaper start - add decoration and mark everything dirty for other players who are already tracking this frame + // Paper start - add decoration and mark everything dirty for other players who are already tracking this frame
+ final ItemStack item = this.getItem(); + final ItemStack item = this.getItem();
+ if (item.is(Items.FILLED_MAP)) { + if (item.is(Items.FILLED_MAP)) {
+ final MapItemSavedData data = MapItem.getSavedData(item, this.level()); + final MapItemSavedData data = MapItem.getSavedData(item, this.level());
+ if (data != null) { + if (data != null) {
+ data.addFrameDecoration(this); + data.addFrameDecoration(this);
+ data.markAllDirty(); + data.markAllDirty();
+ }
+ } + }
+ // SparklyPaper end + }
+ // Paper end
this.gameEvent(GameEvent.BLOCK_CHANGE, player); this.gameEvent(GameEvent.BLOCK_CHANGE, player);
if (!player.getAbilities().instabuild) { if (!player.getAbilities().instabuild) {
itemstack.shrink(1); itemstack.shrink(1);
diff --git a/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java b/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java diff --git a/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java b/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java
index 804c342783baccdc12e8ca49a362770e31596f6a..a0b760388407469adbd9569edfccadcb1b3d37a1 100644 index 804c342783baccdc12e8ca49a362770e31596f6a..e1a251490bf18ff60e0ef9e7c7a692afa329c7f7 100644
--- a/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java --- a/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java
+++ b/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java +++ b/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java
@@ -67,6 +67,16 @@ public class MapItemSavedData extends SavedData { @@ -67,6 +67,16 @@ public class MapItemSavedData extends SavedData {
private final Map<String, MapFrame> frameMarkers = Maps.newHashMap(); private final Map<String, MapFrame> frameMarkers = Maps.newHashMap();
private int trackedDecorationCount; private int trackedDecorationCount;
private org.bukkit.craftbukkit.map.RenderData vanillaRender = new org.bukkit.craftbukkit.map.RenderData(); // Paper private org.bukkit.craftbukkit.map.RenderData vanillaRender = new org.bukkit.craftbukkit.map.RenderData(); // Paper
+ // SparklyPaper start - shared between all players tracking this map inside an item frame + // Paper start - shared between all players tracking this map inside an item frame
+ public boolean dirtyColorData; + public boolean dirtyColorData;
+ public int minDirtyX; + public int minDirtyX;
+ public int minDirtyY; + public int minDirtyY;
@@ -111,7 +125,7 @@ index 804c342783baccdc12e8ca49a362770e31596f6a..a0b760388407469adbd9569edfccadcb
+ public boolean dirtyFrameDecorations; + public boolean dirtyFrameDecorations;
+ public boolean hasPluginRenderer; + public boolean hasPluginRenderer;
+ public boolean hasContextualRenderer; + public boolean hasContextualRenderer;
+ // SparklyPaper end + // Paper end
public boolean isExplorerMap; // Purpur public boolean isExplorerMap; // Purpur
// CraftBukkit start // CraftBukkit start
@@ -119,7 +133,7 @@ index 804c342783baccdc12e8ca49a362770e31596f6a..a0b760388407469adbd9569edfccadcb
} }
this.setDecorationsDirty(); this.setDecorationsDirty();
+ if (mapicon != null && mapicon.renderOnFrame()) this.dirtyFrameDecorations = true; // SparklyPaper + if (mapicon != null && mapicon.renderOnFrame()) this.dirtyFrameDecorations = true; // Paper
} }
public static void addTargetDecoration(ItemStack stack, BlockPos pos, String id, MapDecoration.Type type) { public static void addTargetDecoration(ItemStack stack, BlockPos pos, String id, MapDecoration.Type type) {
@@ -127,7 +141,7 @@ index 804c342783baccdc12e8ca49a362770e31596f6a..a0b760388407469adbd9569edfccadcb
} }
this.setDecorationsDirty(); this.setDecorationsDirty();
+ if (type.isRenderedOnFrame() || (mapicon1 != null && mapicon.type().isRenderedOnFrame())) this.dirtyFrameDecorations = true; // SparklyPaper + if (type.isRenderedOnFrame() || (mapicon1 != null && mapicon.type().isRenderedOnFrame())) this.dirtyFrameDecorations = true; // Paper
} }
} }
@@ -135,20 +149,20 @@ index 804c342783baccdc12e8ca49a362770e31596f6a..a0b760388407469adbd9569edfccadcb
public void setColorsDirty(int x, int z) { public void setColorsDirty(int x, int z) {
this.setDirty(); this.setDirty();
+ // SparklyPaper start + // Paper start
+ if (this.dirtyColorData) { + if (this.dirtyColorData) {
+ this.minDirtyX = Math.min(this.minDirtyX, x); + this.minDirtyX = Math.min(this.minDirtyX, x);
+ this.minDirtyY = Math.min(this.minDirtyY, z); + this.minDirtyY = Math.min(this.minDirtyY, z);
+ this.maxDirtyX = Math.max(this.maxDirtyX, x); + this.maxDirtyX = Math.max(this.maxDirtyX, x);
+ this.maxDirtyY = Math.max(this.maxDirtyY, z); + this.maxDirtyY = Math.max(this.maxDirtyY, z);
+ } else { + } else {
+ this.dirtyColorData = true; + this.dirtyColorData = true;
+ this.minDirtyX = x; + this.minDirtyX = x;
+ this.minDirtyY = z; + this.minDirtyY = z;
+ this.maxDirtyX = x; + this.maxDirtyX = x;
+ this.maxDirtyY = z; + this.maxDirtyY = z;
+ } + }
+ // SparklyPaper end + // Paper end
Iterator iterator = this.carriedBy.iterator(); Iterator iterator = this.carriedBy.iterator();
while (iterator.hasNext()) { while (iterator.hasNext()) {
@@ -156,15 +170,15 @@ index 804c342783baccdc12e8ca49a362770e31596f6a..a0b760388407469adbd9569edfccadcb
public void removedFromFrame(BlockPos pos, int id) { public void removedFromFrame(BlockPos pos, int id) {
this.removeDecoration("frame-" + id); this.removeDecoration("frame-" + id);
this.frameMarkers.remove(MapFrame.frameId(pos)); this.frameMarkers.remove(MapFrame.frameId(pos));
+ this.dirtyFrameDecorations = true; // SparklyPaper + this.dirtyFrameDecorations = true; // Paper
} }
public boolean updateColor(int x, int z, byte color) { public boolean updateColor(int x, int z, byte color) {
@@ -579,7 +606,90 @@ public class MapItemSavedData extends SavedData { @@ -580,6 +607,93 @@ public class MapItemSavedData extends SavedData {
public boolean isTrackedCountOverLimit(int iconCount) {
return this.trackedDecorationCount >= iconCount; return this.trackedDecorationCount >= iconCount;
} }
+ // SparklyPaper start
+ // Paper start
+ public final @Nullable Packet<?> framedUpdatePacket(int id, @Nullable Player player) { + public final @Nullable Packet<?> framedUpdatePacket(int id, @Nullable Player player) {
+ return createUpdatePacket(id, player, false); + return createUpdatePacket(id, player, false);
+ } + }
@@ -174,9 +188,8 @@ index 804c342783baccdc12e8ca49a362770e31596f6a..a0b760388407469adbd9569edfccadcb
+ } + }
+ +
+ public final @Nullable Packet<?> createUpdatePacket(int id, @Nullable Player player, boolean full) { + public final @Nullable Packet<?> createUpdatePacket(int id, @Nullable Player player, boolean full) {
+ if (!dirtyColorData && !dirtyFrameDecorations && (player == null || server.getCurrentTick() % 5 != 0) && !full) { + if (!dirtyColorData && !dirtyFrameDecorations && (player == null || server.getCurrentTick() % 5 != 0) && !full) // Periodically send update packets if a renderer is added
+ return null; + return null;
+ }
+ +
+ final org.bukkit.craftbukkit.map.RenderData render = player != null ? this.mapView.render((org.bukkit.craftbukkit.entity.CraftPlayer) player.getBukkitEntity()) : this.vanillaRender; + final org.bukkit.craftbukkit.map.RenderData render = player != null ? this.mapView.render((org.bukkit.craftbukkit.entity.CraftPlayer) player.getBukkitEntity()) : this.vanillaRender;
+ +
@@ -191,18 +204,22 @@ index 804c342783baccdc12e8ca49a362770e31596f6a..a0b760388407469adbd9569edfccadcb
+ } + }
+ +
+ Collection<MapDecoration> decorations = null; + Collection<MapDecoration> decorations = null;
+ if (dirtyFrameDecorations || full || hasPluginRenderer) { + if (dirtyFrameDecorations || full || hasPluginRenderer) { // Always add decorations when a plugin renderer is added
+ dirtyFrameDecorations = false; + dirtyFrameDecorations = false;
+ decorations = new java.util.ArrayList<>(); + decorations = new java.util.ArrayList<>();
+ +
+ if (player == null) { + if (player == null) {
+ // We're using the vanilla renderer, add in vanilla decorations
+ for (MapDecoration decoration : this.decorations.values()) { + for (MapDecoration decoration : this.decorations.values()) {
+ // Skip sending decorations that aren't rendered, i.e. player decorations.
+ // Skipping player decorations also allows us to send the same update packet to all tracking players, the only caveat
+ // being that it causes a slight flicker of the player decoration for anyone holding & looking at the map.
+ if (decoration.renderOnFrame()) { + if (decoration.renderOnFrame()) {
+ decorations.add(decoration); + decorations.add(decoration);
+ } + }
+ } + }
+ } + }
+
+ for (final org.bukkit.map.MapCursor cursor : render.cursors) { + for (final org.bukkit.map.MapCursor cursor : render.cursors) {
+ if (cursor.isVisible()) { + if (cursor.isVisible()) {
+ decorations.add(new MapDecoration(MapDecoration.Type.byIcon(cursor.getRawType()), cursor.getX(), cursor.getY(), cursor.getDirection(), PaperAdventure.asVanilla(cursor.caption()))); // Paper - Adventure + decorations.add(new MapDecoration(MapDecoration.Type.byIcon(cursor.getRawType()), cursor.getX(), cursor.getY(), cursor.getDirection(), PaperAdventure.asVanilla(cursor.caption()))); // Paper - Adventure
@@ -230,9 +247,8 @@ index 804c342783baccdc12e8ca49a362770e31596f6a..a0b760388407469adbd9569edfccadcb
+ } + }
+ +
+ public void addFrameDecoration(net.minecraft.world.entity.decoration.ItemFrame frame) { + public void addFrameDecoration(net.minecraft.world.entity.decoration.ItemFrame frame) {
+ if (this.trackedDecorationCount >= frame.level().paperConfig().maps.itemFrameCursorLimit || this.frameMarkers.containsKey(MapFrame.frameId(frame.getPos()))) { + if (this.trackedDecorationCount >= frame.level().paperConfig().maps.itemFrameCursorLimit || this.frameMarkers.containsKey(MapFrame.frameId(frame.getPos())))
+ return; + return;
+ }
+ +
+ MapFrame mapFrame = new MapFrame(frame.getPos(), frame.getDirection().get2DDataValue() * 90, frame.getId()); + MapFrame mapFrame = new MapFrame(frame.getPos(), frame.getDirection().get2DDataValue() * 90, frame.getId());
+ this.addDecoration(MapDecoration.Type.FRAME, frame.level(), "frame-" + frame.getId(), frame.getPos().getX(), frame.getPos().getZ(), mapFrame.getRotation(), (Component) null); + this.addDecoration(MapDecoration.Type.FRAME, frame.level(), "frame-" + frame.getId(), frame.getPos().getX(), frame.getPos().getZ(), mapFrame.getRotation(), (Component) null);
@@ -247,22 +263,23 @@ index 804c342783baccdc12e8ca49a362770e31596f6a..a0b760388407469adbd9569edfccadcb
+ this.maxDirtyY = 127; + this.maxDirtyY = 127;
+ this.dirtyFrameDecorations = true; + this.dirtyFrameDecorations = true;
+ } + }
+ // SparklyPaper end + // Paper end
+
public class HoldingPlayer { public class HoldingPlayer {
// Paper start // Paper start
diff --git a/src/main/java/org/bukkit/craftbukkit/map/CraftMapView.java b/src/main/java/org/bukkit/craftbukkit/map/CraftMapView.java diff --git a/src/main/java/org/bukkit/craftbukkit/map/CraftMapView.java b/src/main/java/org/bukkit/craftbukkit/map/CraftMapView.java
index c3266c43a073cb7d7eff10d1a1b15f0a2265b859..ff3b0f8ebea13f52a1d86085e32489db86969dd1 100644 index c3266c43a073cb7d7eff10d1a1b15f0a2265b859..4d69e345117556bac2126edc5169ab01eed97377 100644
--- a/src/main/java/org/bukkit/craftbukkit/map/CraftMapView.java --- a/src/main/java/org/bukkit/craftbukkit/map/CraftMapView.java
+++ b/src/main/java/org/bukkit/craftbukkit/map/CraftMapView.java +++ b/src/main/java/org/bukkit/craftbukkit/map/CraftMapView.java
@@ -108,6 +108,10 @@ public final class CraftMapView implements MapView { @@ -108,6 +108,10 @@ public final class CraftMapView implements MapView {
this.renderers.add(renderer); this.renderers.add(renderer);
this.canvases.put(renderer, new HashMap<CraftPlayer, CraftMapCanvas>()); this.canvases.put(renderer, new HashMap<CraftPlayer, CraftMapCanvas>());
renderer.initialize(this); renderer.initialize(this);
+ // SparklyPaper start + // Paper start
+ this.worldMap.hasPluginRenderer |= !(renderer instanceof CraftMapRenderer); + this.worldMap.hasPluginRenderer |= !(renderer instanceof CraftMapRenderer);
+ this.worldMap.hasContextualRenderer |= renderer.isContextual(); + this.worldMap.hasContextualRenderer |= renderer.isContextual();
+ // SparklyPaper end + // Paper end
} }
} }
@@ -270,7 +287,7 @@ index c3266c43a073cb7d7eff10d1a1b15f0a2265b859..ff3b0f8ebea13f52a1d86085e32489db
} }
} }
this.canvases.remove(renderer); this.canvases.remove(renderer);
+ // SparklyPaper start + // Paper start
+ this.worldMap.hasPluginRenderer = !(this.renderers.size() == 1 && this.renderers.get(0) instanceof CraftMapRenderer); + this.worldMap.hasPluginRenderer = !(this.renderers.size() == 1 && this.renderers.get(0) instanceof CraftMapRenderer);
+ if (renderer.isContextual()) { + if (renderer.isContextual()) {
+ // Re-check all renderers + // Re-check all renderers
@@ -280,7 +297,7 @@ index c3266c43a073cb7d7eff10d1a1b15f0a2265b859..ff3b0f8ebea13f52a1d86085e32489db
+ } + }
+ this.worldMap.hasContextualRenderer = contextualFound; + this.worldMap.hasContextualRenderer = contextualFound;
+ } + }
+ // SparklyPaper end + // Paper end
return true; return true;
} else { } else {
return false; return false;

View File

@@ -1,51 +1,45 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: lilingfengdev <145678359+lilingfengdev@users.noreply.github.com> From: MrPowerGamerBR <git@mrpowergamerbr.com>
Date: Wed, 17 Jan 2024 19:57:53 +0800 Date: Fri, 17 Nov 2023 14:22:41 -0300
Subject: [PATCH] Subject: [PATCH] SparklyPaper: Skip "MapItem#update()" if the map does not
SparklyPaper-Skip-MapItem-update-if-the-map-does-not-have-the-Cra have the CraftMapRenderer present
Original project: https://github.com/SparklyPower/SparklyPaper
Optimizes "image in map" maps, without requiring the map to be locked, which some old map plugins may not do
This has the disadvantage that the vanilla map data will never be updated while the CraftMapRenderer is not present, but that's not a huuuge problem for u
diff --git a/src/main/java/net/minecraft/world/item/MapItem.java b/src/main/java/net/minecraft/world/item/MapItem.java diff --git a/src/main/java/net/minecraft/world/item/MapItem.java b/src/main/java/net/minecraft/world/item/MapItem.java
index 6cfd169c2c32b644d70907358c2d4a2087c00a68..62aa1717eee90032c2ddf848424e903cc952a913 100644 index 6cfd169c2c32b644d70907358c2d4a2087c00a68..c065ee1e68b5274d30f252d296b0c16a2adbf3c8 100644
--- a/src/main/java/net/minecraft/world/item/MapItem.java --- a/src/main/java/net/minecraft/world/item/MapItem.java
+++ b/src/main/java/net/minecraft/world/item/MapItem.java +++ b/src/main/java/net/minecraft/world/item/MapItem.java
@@ -32,6 +32,9 @@ import net.minecraft.world.level.levelgen.Heightmap; @@ -325,7 +325,7 @@ public class MapItem extends ComplexItem {
import net.minecraft.world.level.material.FluidState;
import net.minecraft.world.level.material.MapColor;
import net.minecraft.world.level.saveddata.maps.MapItemSavedData;
+// Leaf Start
+import org.dreeam.leaf.LeafConfig;
+// Leaf end
public class MapItem extends ComplexItem {
@@ -314,6 +317,7 @@ public class MapItem extends ComplexItem {
}
@Override
+
public void inventoryTick(ItemStack stack, Level world, Entity entity, int slot, boolean selected) {
if (!world.isClientSide) {
MapItemSavedData worldmap = MapItem.getSavedData(stack, world);
@@ -325,7 +329,7 @@ public class MapItem extends ComplexItem {
worldmap.tickCarriedBy(entityhuman, stack); worldmap.tickCarriedBy(entityhuman, stack);
} }
- if (!worldmap.locked && (selected || entity instanceof Player && ((Player) entity).getOffhandItem() == stack)) { - if (!worldmap.locked && (selected || entity instanceof Player && ((Player) entity).getOffhandItem() == stack)) {
+ if (!worldmap.locked && (!LeafConfig.skipMapItemDataUpdatesIfMapDoesNotHaveCraftMapRenderer || worldmap.mapView.getRenderers().stream().anyMatch(mapRenderer -> mapRenderer.getClass() == org.bukkit.craftbukkit.map.CraftMapRenderer.class)) && (selected || entity instanceof Player && ((Player) entity).getOffhandItem() == stack)) { // SparklyPaper - don't update maps if they don't have the CraftMapRenderer in the render list + if (!worldmap.locked && (!org.dreeam.leaf.LeafConfig.skipMapItemDataUpdatesIfMapDoesNotHaveCraftMapRenderer || worldmap.mapView.getRenderers().stream().anyMatch(mapRenderer -> mapRenderer.getClass() == org.bukkit.craftbukkit.map.CraftMapRenderer.class)) && (selected || entity instanceof Player && ((Player) entity).getOffhandItem() == stack)) { // SparklyPaper - don't update maps if they don't have the CraftMapRenderer in the render list
this.update(world, entity, worldmap); this.update(world, entity, worldmap);
} }
diff --git a/src/main/java/org/dreeam/leaf/LeafConfig.java b/src/main/java/org/dreeam/leaf/LeafConfig.java diff --git a/src/main/java/org/dreeam/leaf/LeafConfig.java b/src/main/java/org/dreeam/leaf/LeafConfig.java
index 728082120af5a7afe20078b3fa6d80605f5ff6c7..db12eb7e81307cc3fd4fe0602697e32e71289f7e 100644 index 635f09b234c723b79d35686105c2c3335f868e6a..3368e4d398132c64969b018e4fe8b7bbe8f2f364 100644
--- a/src/main/java/org/dreeam/leaf/LeafConfig.java --- a/src/main/java/org/dreeam/leaf/LeafConfig.java
+++ b/src/main/java/org/dreeam/leaf/LeafConfig.java +++ b/src/main/java/org/dreeam/leaf/LeafConfig.java
@@ -321,4 +321,8 @@ public class LeafConfig { @@ -206,6 +206,7 @@ public class LeafConfig {
private static void getVanillaTeleport() { public static int asyncPathfindingMaxThreads = 0;
vanillaEndTeleport = getBoolean("vanillaEndTeleport",vanillaEndTeleport,"Vanilla End Gateway Teleport"); public static int asyncPathfindingKeepalive = 60;
public static boolean cacheMinecartCollision = false;
+ public static boolean skipMapItemDataUpdatesIfMapDoesNotHaveCraftMapRenderer = true;
private static void performance() {
boolean asyncMobSpawning = getBoolean("performance.enable-async-mob-spawning", enableAsyncMobSpawning,
"Whether or not asynchronous mob spawning should be enabled.",
@@ -269,6 +270,7 @@ public class LeafConfig {
cacheMinecartCollision = getBoolean("performance.cache-minecart-collision", cacheMinecartCollision,
"Cache the minecart collision result to prevent massive stacked minecart lag the server.",
"The known issue: entity can't enter the minecart after enabling this!");
+ skipMapItemDataUpdatesIfMapDoesNotHaveCraftMapRenderer = getBoolean("performance.skip-map-item-data-updates-if-map-does-not-have-craftmaprenderer", skipMapItemDataUpdatesIfMapDoesNotHaveCraftMapRenderer);
} }
+ public static boolean skipMapItemDataUpdatesIfMapDoesNotHaveCraftMapRenderer=true;
+ private static void getSkipMapItemDataUpdatesIfMapDoesNotHaveCraftMapRenderer() { public static boolean jadeProtocol = false;
+ skipMapItemDataUpdatesIfMapDoesNotHaveCraftMapRenderer = getBoolean("skipMapItemDataUpdatesIfMapDoesNotHaveCraftMapRenderer",skipMapItemDataUpdatesIfMapDoesNotHaveCraftMapRenderer);
+ }
}

View File

@@ -1,42 +1,38 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: lilingfengdev <145678359+lilingfengdev@users.noreply.github.com> From: MrPowerGamerBR <git@mrpowergamerbr.com>
Date: Thu, 18 Jan 2024 13:14:57 +0800 Date: Wed, 22 Nov 2023 11:07:07 -0300
Subject: [PATCH] Polpot Cache-coordinate-key-used-for-nearby-players Subject: [PATCH] SparklyPaper: Cache coordinate key used for nearby players
when ticking chunks
Original project: https://github.com/SparklyPower/SparklyPaper
The "getChunkKey(...)" call is a bit expensive, using 0.24% of CPU time with 19k chunks loaded
So instead of paying the price on each tick, we pay the price when the chunk is loaded
Which, if you think about it, is actually better, since we tick chunks more than we load chunks
diff --git a/src/main/java/io/papermc/paper/util/player/NearbyPlayers.java b/src/main/java/io/papermc/paper/util/player/NearbyPlayers.java diff --git a/src/main/java/io/papermc/paper/util/player/NearbyPlayers.java b/src/main/java/io/papermc/paper/util/player/NearbyPlayers.java
index 17ba07cbd4792f63d88ce29d00da280f30c4abff..98ae712c78d500e8c463aa671909a931a001407e 100644 index 17ba07cbd4792f63d88ce29d00da280f30c4abff..8e8aad958c96fa1df3d906ec120a89adecae38c4 100644
--- a/src/main/java/io/papermc/paper/util/player/NearbyPlayers.java --- a/src/main/java/io/papermc/paper/util/player/NearbyPlayers.java
+++ b/src/main/java/io/papermc/paper/util/player/NearbyPlayers.java +++ b/src/main/java/io/papermc/paper/util/player/NearbyPlayers.java
@@ -106,6 +106,13 @@ public final class NearbyPlayers { @@ -106,6 +106,14 @@ public final class NearbyPlayers {
return chunk == null ? null : chunk.players[type.ordinal()]; return chunk == null ? null : chunk.players[type.ordinal()];
} }
+ // Polpot start - cache coordinate key used for nearby players + // SparklyPaper start - cache coordinate key used for nearby players
+ public ReferenceList<ServerPlayer> getPlayers(final long nearbyPlayersCoordinateKey, final NearbyMapType type) { + public ReferenceList<ServerPlayer> getPlayers(final long nearbyPlayersCoordinateKey, final NearbyMapType type) {
+ final TrackedChunk chunk = this.byChunk.get(nearbyPlayersCoordinateKey); + final TrackedChunk chunk = this.byChunk.get(nearbyPlayersCoordinateKey);
+
+ return chunk == null ? null : chunk.players[type.ordinal()]; + return chunk == null ? null : chunk.players[type.ordinal()];
+ } + }
+ // Polpot end + // SparklyPaper end
+ +
public ReferenceList<ServerPlayer> getPlayersByChunk(final int chunkX, final int chunkZ, final NearbyMapType type) { public ReferenceList<ServerPlayer> getPlayersByChunk(final int chunkX, final int chunkZ, final NearbyMapType type) {
final TrackedChunk chunk = this.byChunk.get(CoordinateUtils.getChunkKey(chunkX, chunkZ)); final TrackedChunk chunk = this.byChunk.get(CoordinateUtils.getChunkKey(chunkX, chunkZ));
diff --git a/src/main/java/net/minecraft/server/Eula.java b/src/main/java/net/minecraft/server/Eula.java
index b9403a3eafc1b30b33ac654f253d0849cacadd03..a6190f14cb9463ee75e8890f191a7ec88e59b37f 100644
--- a/src/main/java/net/minecraft/server/Eula.java
+++ b/src/main/java/net/minecraft/server/Eula.java
@@ -47,7 +47,7 @@ public class Eula {
return var3;
} catch (Exception var6) {
if (file == this.file) { // Gale - YAPFA - global EULA file
- LOGGER.warn("Failed to load {}", (Object)this.file);
+ LOGGER.warn("Failed to load {}", this.file); // Leaf - remove convert
this.saveDefaults();
} // Gale - YAPFA - global EULA file
return false;
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
index 02b517288ef0794ccfd46802bf76fa56af21c524..e7fe8e2a7f5cb0c36679142f3743467efbed9c31 100644 index 02b517288ef0794ccfd46802bf76fa56af21c524..e75ebf0bbb9da6e294d52e8c99607ed590c123a5 100644
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java --- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java +++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
@@ -602,7 +602,7 @@ public class ServerChunkCache extends ChunkSource { @@ -602,7 +602,7 @@ public class ServerChunkCache extends ChunkSource {
@@ -44,12 +40,12 @@ index 02b517288ef0794ccfd46802bf76fa56af21c524..e7fe8e2a7f5cb0c36679142f3743467e
// Paper start - optimise chunk tick iteration // Paper start - optimise chunk tick iteration
com.destroystokyo.paper.util.maplist.ReferenceList<ServerPlayer> playersNearby com.destroystokyo.paper.util.maplist.ReferenceList<ServerPlayer> playersNearby
- = nearbyPlayers.getPlayers(chunkcoordintpair, io.papermc.paper.util.player.NearbyPlayers.NearbyMapType.SPAWN_RANGE); - = nearbyPlayers.getPlayers(chunkcoordintpair, io.papermc.paper.util.player.NearbyPlayers.NearbyMapType.SPAWN_RANGE);
+ = nearbyPlayers.getPlayers(chunk1.nearbyPlayersCoordinateKey, io.papermc.paper.util.player.NearbyPlayers.NearbyMapType.SPAWN_RANGE); // nearbyPlayers.getPlayers(chunkcoordintpair, io.papermc.paper.util.player.NearbyPlayers.NearbyMapType.SPAWN_RANGE); // Polpot - cache coordinate key used for nearby players + = nearbyPlayers.getPlayers(chunk1.nearbyPlayersCoordinateKey, io.papermc.paper.util.player.NearbyPlayers.NearbyMapType.SPAWN_RANGE); // nearbyPlayers.getPlayers(chunkcoordintpair, io.papermc.paper.util.player.NearbyPlayers.NearbyMapType.SPAWN_RANGE); // SparklyPaper - cache coordinate key used for nearby players
if (playersNearby == null) { if (playersNearby == null) {
continue; continue;
} }
diff --git a/src/main/java/net/minecraft/world/level/chunk/ChunkAccess.java b/src/main/java/net/minecraft/world/level/chunk/ChunkAccess.java diff --git a/src/main/java/net/minecraft/world/level/chunk/ChunkAccess.java b/src/main/java/net/minecraft/world/level/chunk/ChunkAccess.java
index f7e5e016a7028a9196e689e950805b0d5b31fe38..29d5848dec547245a1bafc5674b62b54ff7cd287 100644 index f7e5e016a7028a9196e689e950805b0d5b31fe38..d0285843920f78e05ce07b1b0b2d8ce97ec8041e 100644
--- a/src/main/java/net/minecraft/world/level/chunk/ChunkAccess.java --- a/src/main/java/net/minecraft/world/level/chunk/ChunkAccess.java
+++ b/src/main/java/net/minecraft/world/level/chunk/ChunkAccess.java +++ b/src/main/java/net/minecraft/world/level/chunk/ChunkAccess.java
@@ -62,7 +62,7 @@ public abstract class ChunkAccess implements BlockGetter, BiomeManager.NoiseBiom @@ -62,7 +62,7 @@ public abstract class ChunkAccess implements BlockGetter, BiomeManager.NoiseBiom
@@ -57,7 +53,7 @@ index f7e5e016a7028a9196e689e950805b0d5b31fe38..29d5848dec547245a1bafc5674b62b54
protected volatile boolean unsaved; protected volatile boolean unsaved;
private volatile boolean isLightCorrect; private volatile boolean isLightCorrect;
- protected final ChunkPos chunkPos; public final long coordinateKey; public final int locX; public final int locZ; // Paper - cache coordinate key - protected final ChunkPos chunkPos; public final long coordinateKey; public final int locX; public final int locZ; // Paper - cache coordinate key
+ protected final ChunkPos chunkPos; public final long coordinateKey; public final long nearbyPlayersCoordinateKey; public final int locX; public final int locZ; // Paper - cache coordinate key // Polpot - cache coordinate key used for nearby players + protected final ChunkPos chunkPos; public final long coordinateKey; public final long nearbyPlayersCoordinateKey; public final int locX; public final int locZ; // Paper - cache coordinate key // SparklyPaper - cache coordinate key used for nearby players
private long inhabitedTime; private long inhabitedTime;
/** @deprecated */ /** @deprecated */
@Nullable @Nullable
@@ -66,7 +62,7 @@ index f7e5e016a7028a9196e689e950805b0d5b31fe38..29d5848dec547245a1bafc5674b62b54
// Paper end - rewrite light engine // Paper end - rewrite light engine
this.locX = pos.x; this.locZ = pos.z; // Paper - reduce need for field lookups this.locX = pos.x; this.locZ = pos.z; // Paper - reduce need for field lookups
- this.chunkPos = pos; this.coordinateKey = ChunkPos.asLong(locX, locZ); // Paper - cache long key - this.chunkPos = pos; this.coordinateKey = ChunkPos.asLong(locX, locZ); // Paper - cache long key
+ this.chunkPos = pos; this.coordinateKey = ChunkPos.asLong(locX, locZ); this.nearbyPlayersCoordinateKey = io.papermc.paper.util.CoordinateUtils.getChunkKey(locX, locZ); // Paper - cache long key // Polpot - cache coordinate key used for nearby players + this.chunkPos = pos; this.coordinateKey = ChunkPos.asLong(locX, locZ); this.nearbyPlayersCoordinateKey = io.papermc.paper.util.CoordinateUtils.getChunkKey(locX, locZ); // Paper - cache long key // SparklyPaper - cache coordinate key used for nearby players
this.upgradeData = upgradeData; this.upgradeData = upgradeData;
this.levelHeightAccessor = heightLimitView; this.levelHeightAccessor = heightLimitView;
this.sections = new LevelChunkSection[heightLimitView.getSectionsCount()]; this.sections = new LevelChunkSection[heightLimitView.getSectionsCount()];

View File

@@ -1,11 +1,22 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: lilingfengdev <145678359+lilingfengdev@users.noreply.github.com> From: MrPowerGamerBR <git@mrpowergamerbr.com>
Date: Wed, 17 Jan 2024 18:58:47 +0800 Date: Thu, 23 Nov 2023 14:36:47 -0300
Subject: [PATCH] Optimize canSee checks Subject: [PATCH] SparklyPaper: Optimize "canSee" checks
Original project: https://github.com/SparklyPower/SparklyPaper
The "canSee" checks is in a hot path, invoked by each entity for each player on the server if they are in tracking range, so optimizing it is pretty nice
First, we change the original "HashMap" to fastutil's "Object2ObjectOpenHashMap", because the containsKey throughput is better
Then, we add a "isEmpty()" check before attempting to check if the map contains something
This seems stupid, but it does seem that it improves the performance a bit, and it makes sense, "containsKey(...)" does not attempt to check the map size before attempting to check if the map contains the key
We also create a "canSee" method tailored for "ChunkMap#updatePlayer()", a method without the equals check (the "updatePlayer()" already checks if the entity is the same entity) because the CraftPlayer's `equals()` check is a *bit* expensive compared to only checking the object's identity, and because the identity has already been check, we don't need to check it twice.
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index 38ddd6684535f9a4e6e9fb432282e0b6be0ede4c..673f0b1f8ad35559d050cb73f6593dc466d6ac0c 100644 index 38ddd6684535f9a4e6e9fb432282e0b6be0ede4c..928d5fe7a41206d6160df4190fbaefcb516a910b 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java --- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -1409,7 +1409,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -1409,7 +1409,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@@ -13,12 +24,12 @@ index 38ddd6684535f9a4e6e9fb432282e0b6be0ede4c..673f0b1f8ad35559d050cb73f6593dc4
// CraftBukkit start - respect vanish API // CraftBukkit start - respect vanish API
- if (flag && !player.getBukkitEntity().canSee(this.entity.getBukkitEntity())) { // Paper - only consider hits - if (flag && !player.getBukkitEntity().canSee(this.entity.getBukkitEntity())) { // Paper - only consider hits
+ if (flag && !player.getBukkitEntity().canSeeChunkMapUpdatePlayer(this.entity.getBukkitEntity())) { // Paper - only consider hits // Polpot - Optimize canSee checks + if (flag && !player.getBukkitEntity().canSeeChunkMapUpdatePlayer(this.entity.getBukkitEntity())) { // Paper - only consider hits // SparklyPaper - optimize canSee checks
flag = false; flag = false;
} }
// CraftBukkit end // CraftBukkit end
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 468ac1525c97043b53b16440fec6bb784e1e9c25..86a4a62dfb9c81078e630885f43d7bd24826e58a 100644 index 56da11efc3be1da40dcbb7080f64bd9719517153..0461e04a889000402dce6084898a302f70ca6b67 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -188,7 +188,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -188,7 +188,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -26,31 +37,25 @@ index 468ac1525c97043b53b16440fec6bb784e1e9c25..86a4a62dfb9c81078e630885f43d7bd2
private final ConversationTracker conversationTracker = new ConversationTracker(); private final ConversationTracker conversationTracker = new ConversationTracker();
private final Set<String> channels = new HashSet<String>(); private final Set<String> channels = new HashSet<String>();
- private final Map<UUID, Set<WeakReference<Plugin>>> invertedVisibilityEntities = new HashMap<>(); - private final Map<UUID, Set<WeakReference<Plugin>>> invertedVisibilityEntities = new HashMap<>();
+ private final Map<UUID, Set<WeakReference<Plugin>>> invertedVisibilityEntities = new it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap<>(); // Polpot - optimize canSee checks + private final Map<UUID, Set<WeakReference<Plugin>>> invertedVisibilityEntities = new it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap<>(); // SparklyPaper - optimize canSee checks
private final Set<UUID> unlistedEntities = new HashSet<>(); // Paper private final Set<UUID> unlistedEntities = new HashSet<>(); // Paper
private static final WeakHashMap<Plugin, WeakReference<Plugin>> pluginWeakReferences = new WeakHashMap<>(); private static final WeakHashMap<Plugin, WeakReference<Plugin>> pluginWeakReferences = new WeakHashMap<>();
private int hash = 0; private int hash = 0;
@@ -2166,7 +2166,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -2164,9 +2164,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
// Leaf - TODO
@Override @Override
public boolean canSee(org.bukkit.entity.Entity entity) { public boolean canSee(org.bukkit.entity.Entity entity) {
- return this.equals(entity) || entity.isVisibleByDefault() ^ this.invertedVisibilityEntities.containsKey(entity.getUniqueId()); // SPIGOT-7312: Can always see self - return this.equals(entity) || entity.isVisibleByDefault() ^ this.invertedVisibilityEntities.containsKey(entity.getUniqueId()); // SPIGOT-7312: Can always see self
+ return this.equals(entity) || entity.isVisibleByDefault() ^ (!invertedVisibilityEntities.isEmpty() && this.invertedVisibilityEntities.containsKey(entity.getUniqueId())); // SPIGOT-7312: Can always see self // Polpot - optimize canSee checks + return this.equals(entity) || entity.isVisibleByDefault() ^ (!invertedVisibilityEntities.isEmpty() && this.invertedVisibilityEntities.containsKey(entity.getUniqueId())); // SPIGOT-7312: Can always see self // SparklyPaper - optimize canSee checks
} }
public boolean canSee(UUID uuid) { + // SparklyPaper - optimize canSee checks
@@ -2178,7 +2178,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
return (entity != null) ? this.canSee(entity) : false; // If we can't find it, we can't see it
}
+ // Polpot - optimize canSee checks
+ // The check in ChunkMap#updatePlayer already rejects if it is the same entity, so we don't need to check it twice, especially because CraftPlayer's equals check is a bit expensive + // The check in ChunkMap#updatePlayer already rejects if it is the same entity, so we don't need to check it twice, especially because CraftPlayer's equals check is a bit expensive
+ public boolean canSeeChunkMapUpdatePlayer(org.bukkit.entity.Entity entity) { + public boolean canSeeChunkMapUpdatePlayer(org.bukkit.entity.Entity entity) {
+ return entity.isVisibleByDefault() ^ (!invertedVisibilityEntities.isEmpty() && this.invertedVisibilityEntities.containsKey(entity.getUniqueId())); // SPIGOT-7312: Can always see self // SparklyPaper - optimize canSee checks + return entity.isVisibleByDefault() ^ (!invertedVisibilityEntities.isEmpty() && this.invertedVisibilityEntities.containsKey(entity.getUniqueId())); // SPIGOT-7312: Can always see self // SparklyPaper - optimize canSee checks
+ } + }
+ // Polpot end + // SparklyPaper end
// Paper start
+ +
@Override public boolean canSee(UUID uuid) {
public boolean isListed(Player other) { org.bukkit.entity.Entity entity = this.getServer().getPlayer(uuid);
return !this.unlistedEntities.contains(other.getUniqueId()); if (entity == null) {

View File

@@ -69,15 +69,21 @@ index b64ecadae45c2126b92963ac8d118dde76126ddd..8daa0d7ee597f94901948a732df5d5e9
@Override @Override
diff --git a/src/main/java/org/dreeam/leaf/LeafConfig.java b/src/main/java/org/dreeam/leaf/LeafConfig.java diff --git a/src/main/java/org/dreeam/leaf/LeafConfig.java b/src/main/java/org/dreeam/leaf/LeafConfig.java
index db12eb7e81307cc3fd4fe0602697e32e71289f7e..0439423d1c8b3a9f063595f6df542ce54aa646ab 100644 index 3368e4d398132c64969b018e4fe8b7bbe8f2f364..bc46626c826c40fa18577c78b5259f6e77f69a2a 100644
--- a/src/main/java/org/dreeam/leaf/LeafConfig.java --- a/src/main/java/org/dreeam/leaf/LeafConfig.java
+++ b/src/main/java/org/dreeam/leaf/LeafConfig.java +++ b/src/main/java/org/dreeam/leaf/LeafConfig.java
@@ -325,4 +325,8 @@ public class LeafConfig { @@ -314,6 +314,7 @@ public class LeafConfig {
private static void getSkipMapItemDataUpdatesIfMapDoesNotHaveCraftMapRenderer() { public static double verticalLimit = 0.4000000059604645D;
skipMapItemDataUpdatesIfMapDoesNotHaveCraftMapRenderer = getBoolean("skipMapItemDataUpdatesIfMapDoesNotHaveCraftMapRenderer",skipMapItemDataUpdatesIfMapDoesNotHaveCraftMapRenderer); public static double extraHorizontal = 0.5D;
} public static double extraVertical = 0.1D;
+ public static boolean snowballAndEggCanKnockback = false; + public static boolean snowballAndEggCanKnockback = false;
+ private static void SnowballAndEggCanKnockback() { private static void knockback() {
+ snowballAndEggCanKnockback = getBoolean("settings.snowball-egg-knockback-players", snowballAndEggCanKnockback,"Make snowball and egg can knock back player"); friction = getDouble("playerKnockback.friction", friction);
+ } horizontal = getDouble("playerKnockback.horizontal", horizontal);
@@ -321,5 +322,6 @@ public class LeafConfig {
verticalLimit = getDouble("playerKnockback.verticalLimit", verticalLimit);
extraHorizontal = getDouble("playerKnockback.extraHorizontal", extraHorizontal);
extraVertical = getDouble("playerKnockback.extraVertical", extraVertical);
+ snowballAndEggCanKnockback = getBoolean("playerKnockback.snowball-egg-knockback-players", snowballAndEggCanKnockback, "Make snowball and egg can knockback players");
}
} }