mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-23 21:49:46 +00:00
Properly move `ServerStatusPing` to codec Reimplement custom display contexts Co-authored-by: Matyrobbrt <[email protected]> Co-authored-by: coehlrich <[email protected]> Signed-off-by: SizableShrimp <[email protected]>
97 lines
5.0 KiB
Diff
97 lines
5.0 KiB
Diff
--- a/net/minecraft/client/MouseHandler.java
|
|
+++ b/net/minecraft/client/MouseHandler.java
|
|
@@ -73,6 +_,7 @@
|
|
this.f_91510_ = -1;
|
|
}
|
|
|
|
+ if (net.minecraftforge.client.ForgeHooksClient.onMouseButtonPre(p_91532_, p_91533_, p_91534_)) return;
|
|
boolean[] aboolean = new boolean[]{false};
|
|
if (this.f_91503_.m_91265_() == null) {
|
|
if (this.f_91503_.f_91080_ == null) {
|
|
@@ -86,11 +_,19 @@
|
|
if (flag) {
|
|
screen.m_169415_();
|
|
Screen.m_96579_(() -> {
|
|
- aboolean[0] = screen.m_6375_(d0, d1, i);
|
|
+ aboolean[0] = net.minecraftforge.client.ForgeHooksClient.onScreenMouseClickedPre(screen, d0, d1, i);
|
|
+ if (!aboolean[0]) {
|
|
+ aboolean[0] = this.f_91503_.f_91080_.m_6375_(d0, d1, i);
|
|
+ aboolean[0] = net.minecraftforge.client.ForgeHooksClient.onScreenMouseClickedPost(screen, d0, d1, i, aboolean[0]);
|
|
+ }
|
|
}, "mouseClicked event handler", screen.getClass().getCanonicalName());
|
|
} else {
|
|
Screen.m_96579_(() -> {
|
|
- aboolean[0] = screen.m_6348_(d0, d1, i);
|
|
+ aboolean[0] = net.minecraftforge.client.ForgeHooksClient.onScreenMouseReleasedPre(screen, d0, d1, i);
|
|
+ if (!aboolean[0]) {
|
|
+ aboolean[0] = this.f_91503_.f_91080_.m_6348_(d0, d1, i);
|
|
+ aboolean[0] = net.minecraftforge.client.ForgeHooksClient.onScreenMouseReleasedPost(screen, d0, d1, i, aboolean[0]);
|
|
+ }
|
|
}, "mouseReleased event handler", screen.getClass().getCanonicalName());
|
|
}
|
|
}
|
|
@@ -114,19 +_,26 @@
|
|
}
|
|
}
|
|
}
|
|
-
|
|
+ net.minecraftforge.client.ForgeHooksClient.onMouseButtonPost(p_91532_, p_91533_, p_91534_);
|
|
}
|
|
}
|
|
|
|
private void m_91526_(long p_91527_, double p_91528_, double p_91529_) {
|
|
if (p_91527_ == Minecraft.m_91087_().m_91268_().m_85439_()) {
|
|
- double d0 = (this.f_91503_.f_91066_.m_231821_().m_231551_() ? Math.signum(p_91529_) : p_91529_) * this.f_91503_.f_91066_.m_232122_().m_231551_();
|
|
+ // FORGE: Allows for Horizontal Scroll to be recognized as Vertical Scroll - Fixes MC-121772
|
|
+ double offset = p_91529_;
|
|
+ if (Minecraft.f_91002_ && p_91529_ == 0) {
|
|
+ offset = p_91528_;
|
|
+ }
|
|
+ double d0 = (this.f_91503_.f_91066_.m_231821_().m_231551_() ? Math.signum(offset) : offset) * this.f_91503_.f_91066_.m_232122_().m_231551_();
|
|
if (this.f_91503_.m_91265_() == null) {
|
|
if (this.f_91503_.f_91080_ != null) {
|
|
double d1 = this.f_91507_ * (double)this.f_91503_.m_91268_().m_85445_() / (double)this.f_91503_.m_91268_().m_85443_();
|
|
double d2 = this.f_91508_ * (double)this.f_91503_.m_91268_().m_85446_() / (double)this.f_91503_.m_91268_().m_85444_();
|
|
- this.f_91503_.f_91080_.m_6050_(d1, d2, d0);
|
|
this.f_91503_.f_91080_.m_169415_();
|
|
+ if (net.minecraftforge.client.ForgeHooksClient.onScreenMouseScrollPre(this, this.f_91503_.f_91080_, d0)) return;
|
|
+ if (this.f_91503_.f_91080_.m_6050_(d1, d2, d0)) return;
|
|
+ net.minecraftforge.client.ForgeHooksClient.onScreenMouseScrollPost(this, this.f_91503_.f_91080_, d0);
|
|
} else if (this.f_91503_.f_91074_ != null) {
|
|
if (this.f_91518_ != 0.0D && Math.signum(d0) != Math.signum(this.f_91518_)) {
|
|
this.f_91518_ = 0.0D;
|
|
@@ -139,6 +_,7 @@
|
|
}
|
|
|
|
this.f_91518_ -= (double)i;
|
|
+ if (net.minecraftforge.client.ForgeHooksClient.onMouseScroll(this, d0)) return;
|
|
if (this.f_91503_.f_91074_.m_5833_()) {
|
|
if (this.f_91503_.f_91065_.m_93085_().m_94768_()) {
|
|
this.f_91503_.f_91065_.m_93085_().m_205380_(-i);
|
|
@@ -207,7 +_,9 @@
|
|
double d2 = (p_91563_ - this.f_91507_) * (double)this.f_91503_.m_91268_().m_85445_() / (double)this.f_91503_.m_91268_().m_85443_();
|
|
double d3 = (p_91564_ - this.f_91508_) * (double)this.f_91503_.m_91268_().m_85446_() / (double)this.f_91503_.m_91268_().m_85444_();
|
|
Screen.m_96579_(() -> {
|
|
- screen.m_7979_(d0, d1, this.f_91510_, d2, d3);
|
|
+ if (net.minecraftforge.client.ForgeHooksClient.onScreenMouseDragPre(screen, d0, d1, this.f_91510_, d2, d3)) return;
|
|
+ if (screen.m_7979_(d0, d1, this.f_91510_, d2, d3)) return;
|
|
+ net.minecraftforge.client.ForgeHooksClient.onScreenMouseDragPost(screen, d0, d1, this.f_91510_, d2, d3);
|
|
}, "mouseDragged event handler", screen.getClass().getCanonicalName());
|
|
}
|
|
|
|
@@ -290,6 +_,14 @@
|
|
|
|
public double m_91594_() {
|
|
return this.f_91508_;
|
|
+ }
|
|
+
|
|
+ public double getXVelocity() {
|
|
+ return this.f_91516_;
|
|
+ }
|
|
+
|
|
+ public double getYVelocity() {
|
|
+ return this.f_91517_;
|
|
}
|
|
|
|
public void m_91599_() {
|