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

When converting, mobs switch positions in boats #101

Open
Ghoulboy78 opened this issue Aug 6, 2022 · 2 comments
Open

When converting, mobs switch positions in boats #101

Ghoulboy78 opened this issue Aug 6, 2022 · 2 comments
Assignees
Labels
bug fix suggestion Suggestion for a vanilla bug to be fixed

Comments

@Ghoulboy78
Copy link
Contributor

It's in the code for Mob#convertTo. I might even fix it myself tbh, cos I've looked at the code recently, so I kinda know how where to begin.
https://discord.com/channels/882822986795716608/882826588348092457/1005362908085108897
This is probably relevant too

@Ghoulboy78 Ghoulboy78 added the bug fix suggestion Suggestion for a vanilla bug to be fixed label Aug 6, 2022
@Ghoulboy78
Copy link
Contributor Author

Ghoulboy78 commented Aug 6, 2022

@Inject(
    method = "convertTo",
    at = @At(value = "INVOKE", target = "Lnet/minecraft/world/entity/Mob;stopRiding()V")
)
public <T extends Mob> void isControllingBoat(EntityType<T> entityType, boolean bl, CallbackInfoReturnable<T> cir){
    Mob mob = null; //gotta figure out how to get this
    Entity vehicle = mob.getVehicle();
    boolean isController = false, needsAction = false;
    if(vehicle instanceof Boat boat) {
        isController = boat.hasPassenger(mob) && boat.hasControllingPassenger() && boat.getControllingPassenger().is(mob);
        needsAction = isController && boat.getPassengers().size()==2; // cos then back passenger will get shoved forward
    }
}

I think this code may be useful, not too sure tho ngl. This would be mixing into Mob.class

@fooeyround
Copy link
Contributor

((Mob)(Object)this)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug fix suggestion Suggestion for a vanilla bug to be fixed
Projects
None yet
Development

No branches or pull requests

3 participants