Skip to content

Commit a8387cf

Browse files
committed
Configure player poses shrinking collision box
1 parent 8fe48d3 commit a8387cf

File tree

2 files changed

+30
-2
lines changed

2 files changed

+30
-2
lines changed

patches/server/0004-Sakura-Configuration-Files.patch

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -645,10 +645,10 @@ index 0000000000000000000000000000000000000000..04dc81634277d05894076a2cafde60ca
645645
+}
646646
diff --git a/src/main/java/me/samsuik/sakura/configuration/WorldConfiguration.java b/src/main/java/me/samsuik/sakura/configuration/WorldConfiguration.java
647647
new file mode 100644
648-
index 0000000000000000000000000000000000000000..b842875145a5a7659309256cfb8b275dee82d532
648+
index 0000000000000000000000000000000000000000..f2b89b76f487b98b79fbd33e7564e210504a8e10
649649
--- /dev/null
650650
+++ b/src/main/java/me/samsuik/sakura/configuration/WorldConfiguration.java
651-
@@ -0,0 +1,189 @@
651+
@@ -0,0 +1,192 @@
652652
+package me.samsuik.sakura.configuration;
653653
+
654654
+import com.mojang.logging.LogUtils;
@@ -793,6 +793,9 @@ index 0000000000000000000000000000000000000000..b842875145a5a7659309256cfb8b275d
793793
+ @Comment("Received by attacking a shielded enemy")
794794
+ public double shieldHitKnockback = 0.5;
795795
+ }
796+
+
797+
+ @Comment("Prevents players swimming using elytra or riptide to enter holes")
798+
+ public boolean posesShrinkCollisionBox = true;
796799
+ }
797800
+
798801
+ public Entity entity;
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2+
From: Samsuik <[email protected]>
3+
Date: Thu, 14 Mar 2024 19:51:20 +0000
4+
Subject: [PATCH] Disable player poses shrinking collision box
5+
6+
7+
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
8+
index 127b83d92719fb5149d936125423a509779e577d..b0dd1e699e743ed9fa7bd7499d81d813be89d3f2 100644
9+
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
10+
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
11+
@@ -2243,7 +2243,13 @@ public abstract class Player extends LivingEntity {
12+
13+
@Override
14+
public EntityDimensions getDimensions(Pose pose) {
15+
- return (EntityDimensions) Player.POSES.getOrDefault(pose, Player.STANDING_DIMENSIONS);
16+
+ // Sakura start - player poses shrink collision box
17+
+ EntityDimensions dimensions = (EntityDimensions) Player.POSES.getOrDefault(pose, Player.STANDING_DIMENSIONS);
18+
+ if (!level().sakuraConfig().players.posesShrinkCollisionBox && dimensions.height == 0.6f) {
19+
+ dimensions = Player.STANDING_DIMENSIONS;
20+
+ }
21+
+ return dimensions;
22+
+ // Sakura end - player poses shrink collision box
23+
}
24+
25+
@Override

0 commit comments

Comments
 (0)