Skip to content

Fixes and update Minecarts #8064

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

Open
wants to merge 4 commits into
base: dev/patch
Choose a base branch
from

Conversation

TheLimeGlass
Copy link
Contributor

@TheLimeGlass TheLimeGlass commented Jul 21, 2025

Problem

minecart maps to the Minecart.class which is an interface... You can't spawn an interface.

Solution

Update the MinecartData class with proper handling of the different Minecart classes.

I also moved the WORLD_1_17_CONSUMER outside the try catch, because it doesn't need to be doing a try catch every time an entity is spawned.

All of these would fail prior to this pull request aside from the spawning of a storage minecart:

spawn a minecart at player # spawns RidableMinecart
if last spawned minecart is a storage minecart: #false
if last spawned minecart is a minecart: #true
if last spawned minecart is a regular minecart: #true
spawn a storage minecart at player # spawns StorageMinecart
if last spawned minecart is a storage minecart: #true
if last spawned minecart is a minecart: #true
if last spawned minecart is a regular minecart: #false

Completes: #7663

@TheLimeGlass TheLimeGlass requested a review from a team as a code owner July 21, 2025 07:40
@TheLimeGlass TheLimeGlass requested review from cheeezburga and erenkarakal and removed request for a team July 21, 2025 07:40
@skriptlang-automation skriptlang-automation bot added the needs reviews A PR that needs additional reviews label Jul 21, 2025
Copy link
Contributor

@Pesekjak Pesekjak left a comment

Choose a reason for hiding this comment

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

good job

@Pesekjak Pesekjak added the bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. label Jul 21, 2025
@skriptlang-automation skriptlang-automation bot removed the needs reviews A PR that needs additional reviews label Jul 21, 2025
@skriptlang-automation skriptlang-automation bot added the needs reviews A PR that needs additional reviews label Jul 22, 2025
TheLimeGlass and others added 2 commits July 22, 2025 11:02
Co-authored-by: SirSmurfy2 <82696841+Absolutionism@users.noreply.github.com>
Co-authored-by: SirSmurfy2 <82696841+Absolutionism@users.noreply.github.com>
@APickledWalrus APickledWalrus linked an issue Jul 24, 2025 that may be closed by this pull request
1 task
Copy link
Member

@APickledWalrus APickledWalrus left a comment

Choose a reason for hiding this comment

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

Just about ready

return false;
}
protected boolean equals_i(EntityData<?> obj) {
return obj instanceof MinecartData minecartData && type == minecartData.type;
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
return obj instanceof MinecartData minecartData && type == minecartData.type;
return obj instanceof MinecartData minecartData &&
isSupertype == minecartData.isSupertype &&
type == minecartData.type;

Ah, perhaps this why the earlier confusion. Need to check superType here to differentiate between minecart and regular minecart

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It doesn't matter, the class types of Minecarts don't have any defining fields. The getSuperType method takes priority in basically all the equals checks.

Copy link
Member

Choose a reason for hiding this comment

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

Right, but this method should still be correct. regular minecart and minecart should not be considered equal by this method (hence the recommendation of an isSuperType check)

@APickledWalrus APickledWalrus moved this to In Review in 2.12 Releases Jul 24, 2025
@skriptlang-automation skriptlang-automation bot removed the needs reviews A PR that needs additional reviews label Jul 29, 2025
@skriptlang-automation skriptlang-automation bot added the needs reviews A PR that needs additional reviews label Jul 30, 2025
Copy link
Member

@APickledWalrus APickledWalrus left a comment

Choose a reason for hiding this comment

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

Left new reply above on previous review comment

@skriptlang-automation skriptlang-automation bot removed the needs reviews A PR that needs additional reviews label Jul 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An issue that needs to be fixed. Alternatively, a PR fixing an issue.
Projects
Status: In Review
Development

Successfully merging this pull request may close these issues.

4 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy