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

Make stone types always show in TOP #1664

Merged
merged 4 commits into from
Apr 4, 2023
Merged

Make stone types always show in TOP #1664

merged 4 commits into from
Apr 4, 2023

Conversation

bruberu
Copy link
Member

@bruberu bruberu commented Apr 1, 2023

What

Previously, when TOP tried to get the item for an ore block with a stone type that was meant to drop as the default stone type when mined, it would use the default getPickBlock method which called the getItem method, which prevented it from seeing its true stonetype. This was fixed by simply overriding getPickBlock.

Implementation Details

I just use the method that getItem() used, which was its superclass's implementation, which I hope makes sense. Also, do I need the comment?

Outcome

Always makes the correct stone type appear in TOP.

Additional Information

image

Potential Compatibility Issues

For any mods that add new stone types that are supposed to show the default stone type in TOP, this would prevent that, although I don't see why that would be intended.

@ALongStringOfNumbers ALongStringOfNumbers added the type: feature New feature or request label Apr 2, 2023
Copy link
Contributor

@LAGIdiot LAGIdiot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implementation looks reasonable and changes makes sense. Ingame test was not performed.

Copy link
Contributor

@LAGIdiot LAGIdiot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I looked through last changes and it still looks good.

Though as I mentioned on Discord it could be cool to know as what it will drop (in case it is not same as block itself). For example if you have Diorite Iron Ore, it could have tooltip which mentions it will drop as Iron Ore.

return super.getSilkTouchDrop(state);
}
return super.getSilkTouchDrop(this.getDefaultState());
public ItemStack getPickBlock(IBlockState state, RayTraceResult target, World world, BlockPos pos, EntityPlayer player) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optional: Add annotations

@TechLord22 TechLord22 merged commit 09e3d19 into master Apr 4, 2023
@TechLord22 TechLord22 deleted the bru-ore-pick-rework branch April 4, 2023 02:47
MrKono added a commit to MrKono/GregTech that referenced this pull request Apr 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants