Add back magic number to make mixin happy.

This commit is contained in:
LexManos 2025-06-28 22:30:12 -07:00
parent 064e2fed48
commit d1071fd0f8
No known key found for this signature in database
GPG key ID: 6E90061A7AE1F652

View file

@ -1,10 +1,12 @@
--- a/net/minecraft/world/inventory/HorseInventoryMenu.java
+++ b/net/minecraft/world/inventory/HorseInventoryMenu.java
@@ -62,7 +_,9 @@
@@ -62,7 +_,11 @@
}
public boolean m_6875_(Player p_39661_) {
- return !this.f_39654_.m_149511_(this.f_39653_) && this.f_39653_.m_6542_(p_39661_) && this.f_39654_.m_6084_() && this.f_39654_.m_20270_(p_39661_) < 8.0F;
+ // Make pehkui's mixin happy so we stop getting crash reports. It requires the magic float 8.0F
+ float magic_number = 8.0F;
+ // Default reach is 3 vanilla uses 8 here so add 5 padding
+ double reach = p_39661_.m_21133_(net.minecraftforge.common.ForgeMod.ENTITY_REACH.get()) + 5;
+ return !this.f_39654_.m_149511_(this.f_39653_) && this.f_39653_.m_6542_(p_39661_) && this.f_39654_.m_6084_() && this.f_39654_.m_20270_(p_39661_) < reach;