9
0
mirror of https://github.com/Winds-Studio/Leaf.git synced 2026-01-04 15:41:40 +00:00
Files
Leaf/leaf-server/minecraft-patches/features/0109-Reduce-canSee-work.patch
Dreeam 8b8cc98e30 Updated Upstream (Paper)
Upstream has released updates that appear to apply and compile correctly

Paper Changes:
PaperMC/Paper@cdad49b7 Do not mark plugin tickets as forced; keep correct ticket types
PaperMC/Paper@a1c4fc96 Add generic ticket identifier
PaperMC/Paper@745881bb Update Moonrise common for 1.21.5
PaperMC/Paper@e9d00eb6 Apply Moonrise patch
PaperMC/Paper@ef0f0d10 Copy Moonrise 1.21.5 update over
PaperMC/Paper@cc0f25cb Apply more feature patches
PaperMC/Paper@e7b684ed fix
PaperMC/Paper@71ccae07 Revert "move block data/state impl"
2025-04-02 16:27:31 -04:00

38 lines
2.2 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Dreeam <61569423+Dreeam-qwq@users.noreply.github.com>
Date: Mon, 11 Sep 2023 15:47:19 -0400
Subject: [PATCH] Reduce canSee work
Co-authored by: Martijn Muijsers <martijnmuijsers@live.nl>
Co-authored by: MachineBreaker <machinebreaker>
diff --git a/net/minecraft/world/level/Level.java b/net/minecraft/world/level/Level.java
index fb213dc889abafaaf35a69b06b1c35041ac65b46..4e9a050517cdbcdd08a970d8c163e8dbcb818944 100644
--- a/net/minecraft/world/level/Level.java
+++ b/net/minecraft/world/level/Level.java
@@ -943,17 +943,19 @@ public abstract class Level implements LevelAccessor, UUIDLookup<Entity>, AutoCl
for (int i = 0, len = entities.size(); i < len; ++i) {
Entity entity = entities.get(i);
- 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())) {
- continue;
- }
-
+ // Leaf start - Reduce canSee work - move up
// !entity1.isRemoved() && entity1.blocksBuilding && (entity == null || !entity1.isPassengerOfSameVehicle(entity))
// elide the last check since vanilla calls with entity = null
// only we care about the source for the canSee check
if (entity.isRemoved() || !entity.blocksBuilding) {
continue;
}
+ // Leaf end - Reduce canSee work - move up
+
+ 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())) {
+ continue;
+ }
if (net.minecraft.world.phys.shapes.Shapes.joinIsNotEmpty(collisionShape, net.minecraft.world.phys.shapes.Shapes.create(entity.getBoundingBox()), net.minecraft.world.phys.shapes.BooleanOp.AND)) {
return false;