Skip to content

Commit

Permalink
Fix setting passengers performs mount logic (#3565)
Browse files Browse the repository at this point in the history
Fixes #3492
Fixes #3493
  • Loading branch information
aromaa authored Nov 30, 2021
1 parent 37b8f5a commit c03c957
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,6 @@ public interface EntityAccessor {

@Accessor("portalEntrancePos") void accessor$portalEntrancePos(final BlockPos portalEntrancePos);

@Accessor("passengers") List<Entity> accessor$passengers();

@Invoker("setRot") void invoker$setRot(final float yRot, final float xRot);

@Invoker("getEncodeId") @Nullable String invoker$getEncodeId();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,8 @@ public static void register(final DataProviderRegistrator registrator) {
.create(Keys.PASSENGERS)
.get(h -> h.getPassengers().stream().map(org.spongepowered.api.entity.Entity.class::cast).collect(Collectors.toList()))
.set((h, v) -> {
((EntityAccessor) h).accessor$passengers().clear();
v.forEach(v1 -> ((EntityAccessor) h).accessor$passengers().add((Entity) v1));
h.ejectPassengers();
v.forEach(v1 -> ((Entity) v1).startRiding(h, true));
})
.create(Keys.REMAINING_AIR)
.get(h -> Math.max(0, h.getAirSupply()))
Expand Down

0 comments on commit c03c957

Please sign in to comment.