mirror of
https://github.com/Winds-Studio/Leaf.git
synced 2025-12-27 10:59:16 +00:00
Upstream has released updates that appear to apply and compile correctly Paper Changes: PaperMC/Paper@b0da38c2 Repository details in RuntimeException for MavenLibraryResolver#addRepository (#12939) PaperMC/Paper@1922be90 Update custom tags (#12183) PaperMC/Paper@79cf1353 Ignore HopperInventorySearchEvent when it has no listeners (#13009) PaperMC/Paper@ea014f7a feat: add stuckEntityPoiRetryDelay config (#12949) PaperMC/Paper@a9e76749 Support for showNotification in PlayerRecipeDiscoverEvent (#12992) PaperMC/Paper@5622c9dd Expose attribute sentiment (#12974) PaperMC/Paper@42b653b1 Expose more argument types (#12665) PaperMC/Paper@52d9a221 [ci/skip] Fix typo in Display javadoc (#13010) PaperMC/Paper@614e9acf Improve APIs around riptide tridents (#12996) PaperMC/Paper@51706e5a Fixed DyeItem sheep dye hunk
38 lines
2.2 KiB
Diff
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 bee67a32c63df0901b9a9b6b3f6e7a35bb87025e..191214e2c3019e9e55cc1d9658c2446557f40173 100644
|
|
--- a/net/minecraft/world/level/Level.java
|
|
+++ b/net/minecraft/world/level/Level.java
|
|
@@ -988,17 +988,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;
|