Skip to content

Commit

Permalink
fix(#29): replace == with MutableText#equals (#30)
Browse files Browse the repository at this point in the history
replace `==` with `.equals` to check for equality by content, not by
reference. This then properly discards the entity, when rejoining the
server.
  • Loading branch information
rvbsm authored Mar 25, 2024
2 parents 63adaa8 + c155a40 commit d87c9fd
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public AreaEffectCloudEntityMixin(EntityType<?> type, World world) {

@Inject(method = "tick", at = @At("TAIL"))
private void tick$cleanSit(CallbackInfo ci) {
if (this.age > 20 && !this.hasPassengers() && this.getCustomName() == SeatEntity.CUSTOM_NAME) this.discard();
if (this.age > 20 && !this.hasPassengers() && this.getCustomName() != null && this.getCustomName().equals(SeatEntity.CUSTOM_NAME))
this.discard();
}
}

0 comments on commit d87c9fd

Please sign in to comment.