Slimefun4 icon indicating copy to clipboard operation
Slimefun4 copied to clipboard

Fix Miner Android

Open Seggan opened this issue 4 years ago • 5 comments

Description

While trying to automate Osmium and Segganesson, @Boomer-1 and I found that Miner Androids completely ignore allowAndroids in BlockBreakHandler and just not mine regardless of whether the flag is set. I fixed this too.

Proposed changes

  • Miner Androids respect allowAndroids in BlockBreakHandler now
  • Added a drops field in AndroidMineEvent

Related Issues (if applicable)

N/A

Checklist

  • [x] I have fully tested the proposed changes and promise that they will not break everything into chaos.
  • [x] I have also tested the proposed changes in combination with various popular addons and can confirm my changes do not break them.
  • [x] I followed the existing code standards and didn't mess up the formatting.
  • [x] I did my best to add documentation to any public classes or methods I added.
  • [ ] I added sufficient Unit Tests to cover my code.

Seggan avatar Nov 26 '21 17:11 Seggan

That is definitely not the build 👀

Seggan avatar Nov 27 '21 01:11 Seggan

No, but seriously speaking: This PR is far from a "fix", it changes a mechanic quite substantially with huge implications for performance. I wouldn't advise merging this without any proper testing and proofing that this won't hurt performance...

Since the BlockStorage isn't exactly performance-friendly...

TheBusyBiscuit avatar Nov 30 '21 19:11 TheBusyBiscuit

Also, this should 100% have been two seperate PRs...

TheBusyBiscuit avatar Nov 30 '21 19:11 TheBusyBiscuit

Okie so I unded the indus miner changes, and then I noticed that in MiningAndroidListener we already do the BlockStorage check. So I just stuck the code under there. I did not test it but I think the performance is much lower then it would have been earlier in my PR.

Seggan avatar Nov 30 '21 23:11 Seggan

Ah, I thought it was in MinerAndroid

Seggan avatar Jan 19 '22 16:01 Seggan

Generally looks fine to me, but before approving merging would like a test undertaken to be sure, given the time it’s been since it was first raised - sorry it’s taken so long here.

Sefiraat avatar Jul 03 '23 22:07 Sefiraat

Marking this as stale. Would be a nice fix to have :D

J3fftw1 avatar Jul 29 '23 17:07 J3fftw1

Marking this as stale. Would be a nice fix to have :D

Time to actually work on it then :D

Seggan avatar Jul 29 '23 21:07 Seggan

Slimefun preview build

A Slimefun preview build is available for testing! Commit: 51a8c173

https://preview-builds.walshy.dev/download/Slimefun/3356/51a8c173

Note: This is not a supported build and is only here for the purposes of testing. Do not run this on a live server and do not report bugs anywhere but this PR!

github-actions[bot] avatar Jul 29 '23 22:07 github-actions[bot]

I sadly can't test it for a while, life is in the way

Seggan avatar Jul 29 '23 22:07 Seggan

i'll test it shortly

Boomer-1 avatar Jul 29 '23 22:07 Boomer-1

in testing it did mine ores, while leaving slimefun items made from ores and did not break them.

Boomer-1 avatar Jul 29 '23 23:07 Boomer-1

except for imports lgtrm

@J3fftw1 What's wrong with the imports?

in testing it did mine ores, while leaving slimefun items made from ores and did not break them.

@Boomer-1 have you tried mining SFW meteors? it should mine them

Seggan avatar Jul 30 '23 01:07 Seggan

@Seggan referring to import order

JustAHuman-xD avatar Jul 30 '23 01:07 JustAHuman-xD

@JustAHuman-xD what wrong with it? Which order should they be in?

Seggan avatar Jul 30 '23 14:07 Seggan

@JustAHuman-xD what wrong with it? Which order should they be in?

@Seggan in top to bottom order Java, javax, bukkit, slimefun, deprecated slimefun

With an empty line between each of the different categories, look at the second class you changed for an example

JustAHuman-xD avatar Jul 30 '23 14:07 JustAHuman-xD

sorry, i tested wrong machine. the android did mine the blocks of segganesson and osmium, but did not have any ores in its inventory. they disappeared, were not dropped or stored.

Boomer-1 avatar Nov 25 '23 02:11 Boomer-1

Marking this as stale.

J3fftw1 avatar Dec 31 '23 09:12 J3fftw1

Closing this since its stale

J3fftw1 avatar Feb 25 '24 17:02 J3fftw1