Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some warnings #4259

Draft
wants to merge 15 commits into
base: master
Choose a base branch
from
Draft

Conversation

moritz-t-w
Copy link
Contributor

@moritz-t-w moritz-t-w commented Dec 7, 2023

Type of change

  • Bug fix
  • New feature

Description

Just going through the warnings, fixing as much as I can.

Related issues

Mention any issues that this pr relates to.

How Has This Been Tested?

Videos or screenshots of the changes if applicable.

Checklist:

  • My code follows the style guidelines of this project.
  • I have added comments to my code in more complex areas.
  • I have tested the code in both development and production environments.

Progress

Deprecated
  • URL constructor -> 665044d: replace with new URI(url).toURL()
  • lang3-WordUtils -> 77de6c6: use StringUtils instead
  • blocksMovement -> 28589b9: re-implement without using deprecated isSolid()
  • NativeImage.makePixelArray(): haven't found any info on alternatives and idk what it does.
Unchecked
Resource Leak
  • BeaconScreenMixin getInstance() -> 1ae70cd: declare variable
  • BlockCollisionSpliteratorMixin getInstance() -> 1ae70cd: declare variable
  • BlockItemMixin getWorld() -> 1ae70cd: declare variable
  • PlayerEntityMixin:56 getWorld() -> 1ae70cd: declare variable
  • PlayerEntityMixin:63 getWorld() -> 1ae70cd: declare variable
  • PlayerEntityMixin:84 getWorld() -> 1ae70cd: declare variable
  • PlayerEntityMixin:92 getWorld() -> 1ae70cd: declare variable
  • PlayerEntityMixin:107 getWorld() -> 1ae70cd: declare variable
  • ChunkAwareBlockCollisionSweeperMixin getInstances() -> 1ae70cd: declare variable
  • Utils readBytes() -> 1ae70cd: close stream
Unused Import
  • BaritoneUtils
  • BaritoneAPI
  • FlowableFluid
  • MatrixStack
  • Perspective
  • TextRenderer
  • BufferBuilder
  • VertexConsumerProvider
  • RenderUtils
  • Rotation
  • TextRenderer
  • BufferBuilder
  • VertexConsumerProvider
  • AbstractTeam
  • AuthenticationException
Unused Variable/Field
  • EasyMCAccount.AuthResponse.message should remain, for completeness
  • Hud.keybind* -> 1448187
  • local var item -> 2fcaed3
  • Blink.cancelBlink* -> 1448187
  • ElytraBoost.keybind* -> 1448187
  • LightOverlay.bp -> c2231b3: suppress
  • CuboidMarker.mode -> 1448187
  • Sphere2dMarker.nextLayerKey -> 1448187
  • Sphere2dMarker.prevLayerKey -> 1448187
  • local var layer -> 2fcaed3

* Used, but in a hacky way

@Big-Iron-Cheems
Copy link
Collaborator

To be brief:

  • All of the null warnings are not actually triggerable at the moment the code is called.
  • The stream related warnings about missing close calls should be handled via try-with-resources.

@moritz-t-w
Copy link
Contributor Author

All of the null warnings are not actually triggerable at the moment the code is called.

Yeah I just kinda added the null warnings and I was gonna see what's actually necesary.

The stream related warnings about missing close calls should be handled via try-with-resources.

The only one that I used .close() had another stream closed that way in the same method, so I did the same. The others I thought making a variable out of them should take care of it, but if not, I'll look into that.

@moritz-t-w
Copy link
Contributor Author

There's a few unused fields that are keybinds, what's up with that?

@Big-Iron-Cheems
Copy link
Collaborator

There's a few unused fields that are keybinds, what's up with that?

If you're referring to the HUD keybind, it is actually used, but in a hacky way.
HUD is not an implementation of the Module class, but it still requires a Keybind for it to be rendered and used.

moritz-t-w and others added 4 commits December 8, 2023 01:12
Co-Authored-By: Big Iron <52252627+Big-Iron-Cheems@users.noreply.github.com>
This partly reverts commit 2fcaed3.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants