|
1 | 1 | --- a/net/minecraft/client/Minecraft.java |
2 | 2 | +++ b/net/minecraft/client/Minecraft.java |
3 | | -@@ -243,7 +_,7 @@ |
| 3 | +@@ -244,7 +_,7 @@ |
4 | 4 | import org.slf4j.Logger; |
5 | 5 |
|
6 | 6 | @OnlyIn(Dist.CLIENT) |
|
9 | 9 | static Minecraft f_90981_; |
10 | 10 | private static final Logger f_90982_ = LogUtils.getLogger(); |
11 | 11 | public static final boolean f_91002_ = Util.m_137581_() == Util.OS.OSX; |
12 | | -@@ -397,7 +_,7 @@ |
| 12 | +@@ -398,7 +_,7 @@ |
13 | 13 | this.f_91029_ = p_91084_.f_101908_.f_101928_; |
14 | 14 | this.f_90986_ = p_91084_.f_101905_.f_101944_; |
15 | 15 | this.f_91037_ = new ClientPackSource(new File(this.f_91069_, "server-resource-packs"), p_91084_.f_101907_.m_101925_()); |
|
18 | 18 | this.f_91030_ = p_91084_.f_101905_.f_101945_; |
19 | 19 | this.f_231338_ = new YggdrasilAuthenticationService(this.f_91030_); |
20 | 20 | this.f_91048_ = this.f_231338_.createMinecraftSessionService(); |
21 | | -@@ -405,7 +_,6 @@ |
| 21 | +@@ -406,7 +_,6 @@ |
22 | 22 | this.f_231339_ = SignatureValidator.m_216358_(this.f_231338_.getServicesKey()); |
23 | 23 | this.f_90998_ = p_91084_.f_101905_.f_101942_; |
24 | 24 | f_90982_.info("Setting user: {}", (Object)this.f_90998_.m_92546_()); |
25 | 25 | - f_90982_.debug("(Session ID is {})", (Object)this.f_90998_.m_92544_()); |
26 | 26 | this.f_91033_ = p_91084_.f_101908_.f_101926_; |
27 | 27 | this.f_91034_ = !p_91084_.f_101908_.f_101929_; |
28 | 28 | this.f_91035_ = !p_91084_.f_101908_.f_101930_; |
29 | | -@@ -457,7 +_,7 @@ |
| 29 | +@@ -458,7 +_,7 @@ |
30 | 30 |
|
31 | 31 | this.f_90990_.m_85380_(this.f_91066_.m_232035_().m_231551_()); |
32 | 32 | this.f_91067_ = new MouseHandler(this); |
|
35 | 35 | this.f_91068_ = new KeyboardHandler(this); |
36 | 36 | this.f_91068_.m_90887_(this.f_90990_.m_85439_()); |
37 | 37 | RenderSystem.m_69580_(this.f_91066_.f_92035_, false); |
38 | | -@@ -465,6 +_,7 @@ |
| 38 | +@@ -466,6 +_,7 @@ |
39 | 39 | this.f_91042_.m_83931_(0.0F, 0.0F, 0.0F, 0.0F); |
40 | 40 | this.f_91042_.m_83954_(f_91002_); |
41 | 41 | this.f_91036_ = new ReloadableResourceManager(PackType.CLIENT_RESOURCES); |
42 | 42 | + net.minecraftforge.client.loading.ClientModLoader.begin(this, this.f_91038_, this.f_91036_, this.f_91037_); |
43 | 43 | this.f_91038_.m_10506_(); |
44 | 44 | this.f_91066_.m_92145_(this.f_91038_); |
45 | 45 | this.f_91039_ = new LanguageManager(this.f_91066_.f_92075_); |
46 | | -@@ -509,10 +_,12 @@ |
| 46 | +@@ -510,10 +_,12 @@ |
47 | 47 | this.f_91063_ = new GameRenderer(this, this.f_90994_.m_234586_(), this.f_91036_, this.f_90993_); |
48 | 48 | this.f_91036_.m_7217_(this.f_91063_); |
49 | 49 | this.f_91060_ = new LevelRenderer(this, this.f_90994_, this.f_167845_, this.f_90993_); |
|
56 | 56 | this.f_91036_.m_7217_(this.f_91061_); |
57 | 57 | this.f_91053_ = new PaintingTextureManager(this.f_90987_); |
58 | 58 | this.f_91036_.m_7217_(this.f_91053_); |
59 | | -@@ -521,7 +_,9 @@ |
| 59 | +@@ -522,7 +_,9 @@ |
60 | 60 | this.f_91047_ = new GpuWarnlistManager(); |
61 | 61 | this.f_91036_.m_7217_(this.f_91047_); |
62 | 62 | this.f_91036_.m_7217_(this.f_205120_); |
|
67 | 67 | this.f_91064_ = new DebugRenderer(this); |
68 | 68 | this.f_238717_ = new RealmsDataFetcher(RealmsClient.m_239151_(this)); |
69 | 69 | RenderSystem.m_69900_(this::m_91113_); |
70 | | -@@ -540,6 +_,19 @@ |
| 70 | +@@ -541,6 +_,19 @@ |
71 | 71 | TinyFileDialogs.tinyfd_messageBox("Minecraft", stringbuilder.toString(), "ok", "error", false); |
72 | 72 | } |
73 | 73 |
|
|
87 | 87 | this.f_90990_.m_85409_(this.f_91066_.m_231817_().m_231551_()); |
88 | 88 | this.f_90990_.m_85424_(this.f_91066_.m_232123_().m_231551_()); |
89 | 89 | this.f_90990_.m_85426_(); |
90 | | -@@ -562,23 +_,23 @@ |
| 90 | +@@ -563,23 +_,23 @@ |
91 | 91 | } |
92 | 92 |
|
93 | 93 | this.f_167847_.m_168556_(); |
|
126 | 126 |
|
127 | 127 | } |
128 | 128 |
|
129 | | -@@ -621,6 +_,8 @@ |
| 129 | +@@ -622,6 +_,8 @@ |
130 | 130 |
|
131 | 131 | private UserApiService m_193585_(YggdrasilAuthenticationService p_193586_, GameConfig p_193587_) { |
132 | 132 | try { |
|
135 | 135 | return p_193586_.createUserApiService(p_193587_.f_101905_.f_101942_.m_92547_()); |
136 | 136 | } catch (AuthenticationException authenticationexception) { |
137 | 137 | f_90982_.error("Failed to verify authentication", (Throwable)authenticationexception); |
138 | | -@@ -633,7 +_,7 @@ |
| 138 | +@@ -634,7 +_,7 @@ |
139 | 139 | } |
140 | 140 |
|
141 | 141 | private void m_91239_(Throwable p_91240_) { |
|
144 | 144 | this.m_91241_(p_91240_, (Component)null); |
145 | 145 | } else { |
146 | 146 | Util.m_137559_(p_91240_); |
147 | | -@@ -791,13 +_,13 @@ |
| 147 | +@@ -792,13 +_,13 @@ |
148 | 148 | Bootstrap.m_135875_(p_91333_.m_127526_()); |
149 | 149 | if (p_91333_.m_127527_() != null) { |
150 | 150 | Bootstrap.m_135875_("#@!@# Game crashed! Crash report saved to: #@!@# " + p_91333_.m_127527_()); |
|
161 | 161 | } |
162 | 162 |
|
163 | 163 | } |
164 | | -@@ -921,10 +_,6 @@ |
| 164 | +@@ -922,10 +_,6 @@ |
165 | 165 | f_90982_.error("setScreen called from non-game thread"); |
166 | 166 | } |
167 | 167 |
|
|
172 | 172 | if (p_91153_ == null && this.f_91073_ == null) { |
173 | 173 | p_91153_ = new TitleScreen(); |
174 | 174 | } else if (p_91153_ == null && this.f_91074_.m_21224_()) { |
175 | | -@@ -935,6 +_,19 @@ |
| 175 | +@@ -936,6 +_,19 @@ |
176 | 176 | } |
177 | 177 | } |
178 | 178 |
|
|
192 | 192 | this.f_91080_ = p_91153_; |
193 | 193 | BufferUploader.m_166835_(); |
194 | 194 | if (p_91153_ != null) { |
195 | | -@@ -1078,11 +_,14 @@ |
| 195 | +@@ -1079,11 +_,14 @@ |
196 | 196 | RenderSystem.m_69481_(); |
197 | 197 | this.f_91026_.m_7238_(); |
198 | 198 | if (!this.f_91079_) { |
|
207 | 207 | } |
208 | 208 |
|
209 | 209 | if (this.f_91056_ != null) { |
210 | | -@@ -1209,10 +_,12 @@ |
| 210 | +@@ -1210,10 +_,12 @@ |
211 | 211 | this.f_90990_.m_85378_((double)i); |
212 | 212 | if (this.f_91080_ != null) { |
213 | 213 | this.f_91080_.m_6574_(this, this.f_90990_.m_85445_(), this.f_90990_.m_85446_()); |
|
220 | 220 | this.f_91063_.m_109097_(this.f_90990_.m_85441_(), this.f_90990_.m_85442_()); |
221 | 221 | this.f_91067_.m_91599_(); |
222 | 222 | } |
223 | | -@@ -1490,6 +_,7 @@ |
| 223 | +@@ -1491,6 +_,7 @@ |
224 | 224 | } |
225 | 225 |
|
226 | 226 | public void m_91395_() { |
227 | 227 | + if (this.m_91396_()) net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.GameShuttingDownEvent()); |
228 | 228 | this.f_91019_ = false; |
229 | 229 | } |
230 | 230 |
|
231 | | -@@ -1519,10 +_,18 @@ |
| 231 | +@@ -1520,10 +_,18 @@ |
232 | 232 | if (p_91387_ && this.f_91077_ != null && this.f_91077_.m_6662_() == HitResult.Type.BLOCK) { |
233 | 233 | BlockHitResult blockhitresult = (BlockHitResult)this.f_91077_; |
234 | 234 | BlockPos blockpos = blockhitresult.m_82425_(); |
|
250 | 250 | this.f_91074_.m_6674_(InteractionHand.MAIN_HAND); |
251 | 251 | } |
252 | 252 | } |
253 | | -@@ -1547,14 +_,20 @@ |
| 253 | +@@ -1548,14 +_,20 @@ |
254 | 254 | return false; |
255 | 255 | } else { |
256 | 256 | boolean flag = false; |
|
269 | 269 | BlockHitResult blockhitresult = (BlockHitResult)this.f_91077_; |
270 | 270 | BlockPos blockpos = blockhitresult.m_82425_(); |
271 | 271 | - if (!this.f_91073_.m_8055_(blockpos).m_60795_()) { |
272 | | -+ if (!this.f_91073_.m_46859_(blockpos)) { |
| 272 | ++ if (!this.f_91073_.m_46859_(blockpos)) { |
273 | 273 | this.f_91072_.m_105269_(blockpos, blockhitresult.m_82434_()); |
274 | 274 | if (this.f_91073_.m_8055_(blockpos).m_60795_()) { |
275 | 275 | flag = true; |
276 | | -@@ -1567,8 +_,10 @@ |
| 276 | +@@ -1568,8 +_,10 @@ |
277 | 277 | } |
278 | 278 |
|
279 | 279 | this.f_91074_.m_36334_(); |
280 | | -+ net.minecraftforge.common.ForgeHooks.onEmptyLeftClick(this.f_91074_); |
| 280 | ++ net.minecraftforge.common.ForgeHooks.onEmptyLeftClick(this.f_91074_); |
281 | 281 | } |
282 | 282 |
|
283 | 283 | + if (inputEvent.shouldSwingHand()) |
284 | 284 | this.f_91074_.m_6674_(InteractionHand.MAIN_HAND); |
285 | 285 | return flag; |
286 | 286 | } |
287 | | -@@ -1583,6 +_,11 @@ |
| 287 | +@@ -1584,6 +_,11 @@ |
288 | 288 | } |
289 | 289 |
|
290 | 290 | for(InteractionHand interactionhand : InteractionHand.values()) { |
|
296 | 296 | ItemStack itemstack = this.f_91074_.m_21120_(interactionhand); |
297 | 297 | if (this.f_91077_ != null) { |
298 | 298 | switch (this.f_91077_.m_6662_()) { |
299 | | -@@ -1593,6 +_,7 @@ |
| 299 | +@@ -1594,13 +_,14 @@ |
300 | 300 | return; |
301 | 301 | } |
302 | 302 |
|
303 | | -+ if(!this.f_91074_.canInteractWith(entityhitresult.m_82443_(), 0)) return; //Forge: Entity may be traced via attack range, but the player may not have sufficient reach. No padding in client code. |
| 303 | ++ if(!this.f_91074_.canInteractWith(entityhitresult.m_82443_(), 0)) return; //Forge: Entity may be traced via attack range, but the player may not have sufficient reach. No padding in client code. |
304 | 304 | InteractionResult interactionresult = this.f_91072_.m_105230_(this.f_91074_, entity, entityhitresult, interactionhand); |
305 | 305 | if (!interactionresult.m_19077_()) { |
306 | 306 | interactionresult = this.f_91072_.m_105226_(this.f_91074_, entity, interactionhand); |
307 | | -@@ -1600,6 +_,7 @@ |
| 307 | + } |
308 | 308 |
|
309 | 309 | if (interactionresult.m_19077_()) { |
310 | | - if (interactionresult.m_19080_()) { |
311 | | -+ if (inputEvent.shouldSwingHand()) |
| 310 | +- if (interactionresult.m_19080_()) { |
| 311 | ++ if (interactionresult.m_19080_() && inputEvent.shouldSwingHand()) { |
312 | 312 | this.f_91074_.m_6674_(interactionhand); |
313 | 313 | } |
314 | 314 |
|
315 | | -@@ -1612,6 +_,7 @@ |
| 315 | +@@ -1612,7 +_,7 @@ |
| 316 | + int i = itemstack.m_41613_(); |
316 | 317 | InteractionResult interactionresult1 = this.f_91072_.m_233732_(this.f_91074_, interactionhand, blockhitresult); |
317 | 318 | if (interactionresult1.m_19077_()) { |
318 | | - if (interactionresult1.m_19080_()) { |
319 | | -+ if (inputEvent.shouldSwingHand()) |
| 319 | +- if (interactionresult1.m_19080_()) { |
| 320 | ++ if (interactionresult1.m_19080_() && inputEvent.shouldSwingHand()) { |
320 | 321 | this.f_91074_.m_6674_(interactionhand); |
321 | 322 | if (!itemstack.m_41619_() && (itemstack.m_41613_() != i || this.f_91072_.m_105290_())) { |
322 | 323 | this.f_91063_.f_109055_.m_109320_(interactionhand); |
323 | | -@@ -1627,6 +_,9 @@ |
| 324 | +@@ -1628,6 +_,9 @@ |
324 | 325 | } |
325 | 326 | } |
326 | 327 |
|
|
330 | 331 | if (!itemstack.m_41619_()) { |
331 | 332 | InteractionResult interactionresult2 = this.f_91072_.m_233721_(this.f_91074_, interactionhand); |
332 | 333 | if (interactionresult2.m_19077_()) { |
333 | | -@@ -1653,6 +_,8 @@ |
| 334 | +@@ -1654,6 +_,8 @@ |
334 | 335 | --this.f_91011_; |
335 | 336 | } |
336 | 337 |
|
|
339 | 340 | this.f_91026_.m_6180_("gui"); |
340 | 341 | this.f_240378_.m_240688_(); |
341 | 342 | this.f_91065_.m_193832_(this.f_91012_); |
342 | | -@@ -1782,6 +_,8 @@ |
| 343 | +@@ -1783,6 +_,8 @@ |
343 | 344 | this.f_91026_.m_6182_("keyboard"); |
344 | 345 | this.f_91068_.m_90931_(); |
345 | 346 | this.f_91026_.m_7238_(); |
|
348 | 349 | } |
349 | 350 |
|
350 | 351 | private boolean m_91278_() { |
351 | | -@@ -1976,6 +_,7 @@ |
| 352 | +@@ -1978,6 +_,7 @@ |
352 | 353 | } |
353 | 354 |
|
354 | 355 | public void m_91156_(ClientLevel p_91157_) { |
355 | 356 | + if (f_91073_ != null) net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.level.LevelEvent.Unload(f_91073_)); |
356 | 357 | ProgressScreen progressscreen = new ProgressScreen(true); |
357 | 358 | progressscreen.m_6309_(Component.m_237115_("connect.joining")); |
358 | 359 | this.m_91362_(progressscreen); |
359 | | -@@ -2009,10 +_,12 @@ |
| 360 | +@@ -2011,10 +_,12 @@ |
360 | 361 | IntegratedServer integratedserver = this.f_91007_; |
361 | 362 | this.f_91007_ = null; |
362 | 363 | this.f_91063_.m_109150_(); |
|
369 | 370 | if (integratedserver != null) { |
370 | 371 | this.f_91026_.m_6180_("waitForServer"); |
371 | 372 |
|
372 | | -@@ -2027,6 +_,7 @@ |
| 373 | +@@ -2029,6 +_,7 @@ |
373 | 374 | this.f_91065_.m_93089_(); |
374 | 375 | this.f_91008_ = null; |
375 | 376 | this.f_91010_ = false; |
376 | 377 | + net.minecraftforge.client.ForgeHooksClient.handleClientLevelClosing(f_91073_); |
377 | 378 | this.f_91004_.m_90740_(); |
378 | 379 | } |
379 | 380 |
|
380 | | -@@ -2122,6 +_,7 @@ |
| 381 | +@@ -2124,6 +_,7 @@ |
381 | 382 |
|
382 | 383 | private void m_91280_() { |
383 | 384 | if (this.f_91077_ != null && this.f_91077_.m_6662_() != HitResult.Type.MISS) { |
384 | 385 | + if (net.minecraftforge.client.ForgeHooksClient.onClickInput(2, this.f_91066_.f_92097_, InteractionHand.MAIN_HAND).isCanceled()) return; |
385 | 386 | boolean flag = this.f_91074_.m_150110_().f_35937_; |
386 | 387 | BlockEntity blockentity = null; |
387 | 388 | HitResult.Type hitresult$type = this.f_91077_.m_6662_(); |
388 | | -@@ -2134,10 +_,7 @@ |
| 389 | +@@ -2136,10 +_,7 @@ |
389 | 390 | } |
390 | 391 |
|
391 | 392 | Block block = blockstate.m_60734_(); |
|
397 | 398 |
|
398 | 399 | if (flag && Screen.m_96637_() && blockstate.m_155947_()) { |
399 | 400 | blockentity = this.f_91073_.m_7702_(blockpos); |
400 | | -@@ -2148,7 +_,7 @@ |
| 401 | +@@ -2150,7 +_,7 @@ |
401 | 402 | } |
402 | 403 |
|
403 | 404 | Entity entity = ((EntityHitResult)this.f_91077_).m_82443_(); |
|
406 | 407 | if (itemstack == null) { |
407 | 408 | return; |
408 | 409 | } |
409 | | -@@ -2686,8 +_,8 @@ |
| 410 | +@@ -2688,8 +_,8 @@ |
410 | 411 | return this.f_90993_; |
411 | 412 | } |
412 | 413 |
|
|
417 | 418 | Supplier<PackResources> supplier = p_167937_; |
418 | 419 | if (i <= 3) { |
419 | 420 | supplier = m_91330_(p_167937_); |
420 | | -@@ -2697,7 +_,7 @@ |
| 421 | +@@ -2699,7 +_,7 @@ |
421 | 422 | supplier = m_91352_(supplier); |
422 | 423 | } |
423 | 424 |
|
|
426 | 427 | } |
427 | 428 |
|
428 | 429 | private static Supplier<PackResources> m_91330_(Supplier<PackResources> p_91331_) { |
429 | | -@@ -2716,6 +_,14 @@ |
430 | | - this.f_91051_.m_119410_(p_91313_); |
431 | | - } |
| 430 | +@@ -2716,6 +_,19 @@ |
432 | 431 |
|
| 432 | + public void m_91312_(int p_91313_) { |
| 433 | + this.f_91051_.m_119410_(p_91313_); |
| 434 | ++ } |
| 435 | ++ |
433 | 436 | + public ItemColors getItemColors() { |
434 | 437 | + return this.f_91041_; |
435 | 438 | + } |
|
438 | 441 | + return this.f_90997_; |
439 | 442 | + } |
440 | 443 | + |
441 | | - public EntityModelSet m_167973_() { |
442 | | - return this.f_167844_; |
443 | | - } |
444 | | -@@ -2789,4 +_,11 @@ |
445 | | - |
446 | | - public abstract boolean m_142594_(boolean p_168035_); |
447 | | - } |
448 | | -+ |
449 | | -+ // FORGE START |
450 | 444 | + private float realPartialTick; |
451 | 445 | + public float getPartialTick() { |
452 | 446 | + return realPartialTick; |
453 | | -+ } |
454 | | -+ // FORGE END |
455 | | - } |
| 447 | + } |
| 448 | + |
| 449 | + public EntityModelSet m_167973_() { |
0 commit comments