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: rename minecart EntityType enum constants #4471

Merged
merged 2 commits into from
Aug 25, 2024

Conversation

PierreSchwang
Copy link
Member

@PierreSchwang PierreSchwang commented Aug 10, 2024

Overview

Fixes #4462

Description

Adjusted the enum constant names to the new naming. Only working 1.20 onwards - though backwards compatibility doesn't seem to exist for a while now

private static final Set<Material> MINECARTS = Set.of(
Material.MINECART,
Material.TNT_MINECART,
Material.CHEST_MINECART,
Material.COMMAND_BLOCK_MINECART,
Material.FURNACE_MINECART,
Material.HOPPER_MINECART
);

Submitter Checklist

Preview Give feedback

@PierreSchwang PierreSchwang requested a review from a team as a code owner August 10, 2024 19:35
@github-actions github-actions bot added the Bugfix This PR fixes a bug label Aug 10, 2024
@SirYwell
Copy link
Member

As we're using strings there, it should be possible to just list both variants. Would that make sense?

@PierreSchwang
Copy link
Member Author

As we're using strings there, it should be possible to just list both variants. Would that make sense?

I actually did that first, but removed the "old" ones as PS does not really has backwards compatibility anymore due to the usage of the Enum constants in other classes (as linked in the initial PR comment)

@SirYwell
Copy link
Member

Does that code actually fail on older versions? Do you know when it was renamed?

@PierreSchwang
Copy link
Member Author

PierreSchwang commented Aug 13, 2024

Does that code actually fail on older versions? Do you know when it was renamed?

Can't really say - would be worth testing though. Rename happened in 1.20 iirc

@SirYwell
Copy link
Member

Ah, the names in Material are older, those weren't renamed. So I think having old and new names here makes sense.

@PierreSchwang
Copy link
Member Author

Oh yeah, I see. I'm dumb. I compared the EntityType against the Material lol. Will fix

@PierreSchwang PierreSchwang merged commit a69cd60 into main Aug 25, 2024
10 checks passed
@PierreSchwang PierreSchwang deleted the fix/killRoadMinecarts branch August 25, 2024 20:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bugfix This PR fixes a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Minecart with hopper, furnace, tnt and chest
3 participants