File tree 1 file changed +5
-5
lines changed
1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -2630,17 +2630,17 @@ func (p *Player) checkEntityInsiders(entityBBox cube.BBox) {
2630
2630
2631
2631
// checkOnGround checks if the player is currently considered to be on the ground.
2632
2632
func (p * Player ) checkOnGround () bool {
2633
- box := Type .BBox (p ).Translate (p .Position ())
2633
+ box := Type .BBox (p ).Translate (p .Position ()). Extend (mgl64. Vec3 { 0 , - 0.05 })
2634
2634
b := box .Grow (1 )
2635
2635
2636
- low , high := cube .PosFromVec3 (b .Min ()), cube .PosFromVec3 (b .Max ())
2636
+ epsilon := mgl64.Vec3 {mgl64 .Epsilon , mgl64 .Epsilon , mgl64 .Epsilon }
2637
+ low , high := cube .PosFromVec3 (b .Min ().Add (epsilon )), cube .PosFromVec3 (b .Max ().Sub (epsilon ))
2637
2638
for x := low [0 ]; x <= high [0 ]; x ++ {
2638
2639
for z := low [2 ]; z <= high [2 ]; z ++ {
2639
2640
for y := low [1 ]; y < high [1 ]; y ++ {
2640
2641
pos := cube.Pos {x , y , z }
2641
- boxList := p .tx .Block (pos ).Model ().BBox (pos , p .tx )
2642
- for _ , bb := range boxList {
2643
- if bb .GrowVec3 (mgl64.Vec3 {0 , 0.05 }).Translate (pos .Vec3 ()).IntersectsWith (box ) {
2642
+ for _ , bb := range p .tx .Block (pos ).Model ().BBox (pos , p .tx ) {
2643
+ if bb .Translate (pos .Vec3 ()).IntersectsWith (box ) {
2644
2644
return true
2645
2645
}
2646
2646
}
You can’t perform that action at this time.
0 commit comments