9
0
mirror of https://github.com/Winds-Studio/Leaf.git synced 2025-12-19 15:09:25 +00:00
Files
Leaf/leaf-archived-patches/unapplied/server/minecraft-patches/features/0028-Reduce-canSee-work.patch
Dreeam 236010caba Cooking Tutorial
1. Wet the drys
2. Dry the wets
3. Wet the drys
4. Dry the wets
5. Wet the drys
6. Now dust the wets
2025-03-28 03:11:27 -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 98cb62d4b79c0918abe139f198c5be118b9133c4..b39d67ab9ed446885111a5387d3332c36b4f3cc9 100644
--- a/net/minecraft/world/level/Level.java
+++ b/net/minecraft/world/level/Level.java
@@ -1006,17 +1006,19 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
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 - Reduce canSee work - move up
// !entity1.dead && entity1.i && (entity == null || !entity1.x(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(voxelshape, net.minecraft.world.phys.shapes.Shapes.create(entity.getBoundingBox()), net.minecraft.world.phys.shapes.BooleanOp.AND)) {
return false;