-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
migrated pre-hard-fork patch 0016-Fixed-spectator-counting-towards-co…
…ntainer-view.patch
- Loading branch information
1 parent
70a154c
commit c0fd455
Showing
2 changed files
with
24 additions
and
32 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
...patches/sources/net/minecraft/world/level/block/entity/ContainerOpenersCounter.java.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
--- a/net/minecraft/world/level/block/entity/ContainerOpenersCounter.java | ||
+++ b/net/minecraft/world/level/block/entity/ContainerOpenersCounter.java | ||
@@ -37,6 +_,12 @@ | ||
|
||
protected abstract boolean isOwnContainer(Player player); | ||
|
||
+ // Cheetah start - [MC-232968] Fixed spectator counting towards container view | ||
+ private boolean isValidContainerViewer(Player player) { | ||
+ return !player.isSpectator() && isOwnContainer(player); | ||
+ } | ||
+ // Cheetah end | ||
+ | ||
public void incrementOpeners(Player player, Level level, BlockPos pos, BlockState state) { | ||
int oldPower = Math.max(0, Math.min(15, this.openCount)); // CraftBukkit - Get power before new viewer is added | ||
int i = this.openCount++; | ||
@@ -88,7 +_,7 @@ | ||
private List<Player> getPlayersWithContainerOpen(Level level, BlockPos pos) { | ||
double d = this.maxInteractionRange + 4.0; | ||
AABB aabb = new AABB(pos).inflate(d); | ||
- return level.getEntities(EntityTypeTest.forClass(Player.class), aabb, this::isOwnContainer); | ||
+ return level.getEntities(EntityTypeTest.forClass(Player.class), aabb, this::isValidContainerViewer); // Cheetah - [MC-232968] Fixed spectator counting towards container view | ||
} | ||
|
||
public void recheckOpeners(Level level, BlockPos pos, BlockState state) { |
32 changes: 0 additions & 32 deletions
32
patches/server/0016-Fixed-spectator-counting-towards-container-view.patch
This file was deleted.
Oops, something went wrong.