Skip to content

Commit

Permalink
do not fire mount hooks when the vehicle is null
Browse files Browse the repository at this point in the history
  • Loading branch information
LCLPYT committed Jun 21, 2023
1 parent 68409d7 commit e510aee
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ fabric_version=0.83.0+1.20.1

# subproject versions
kibu-fabric-hooks-version=0.3.0
kibu-hooks-version=0.15.1
kibu-hooks-version=0.15.2
kibu-command-api-version=0.6.0
kibu-scheduler-api-version=0.4.0
kibu-hook-api-version=1.2.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class ServerPlayerEntityMixin {
at = @At("RETURN")
)
public void kibu$onStartedRiding(Entity vehicle, boolean force, CallbackInfoReturnable<Boolean> cir) {
if (!cir.getReturnValue()) return;
if (vehicle == null || !cir.getReturnValue()) return;

@SuppressWarnings("DataFlowIssue")
ServerPlayerEntity self = (ServerPlayerEntity) (Object) this;
Expand All @@ -32,6 +32,8 @@ public class ServerPlayerEntityMixin {
locals = LocalCapture.CAPTURE_FAILSOFT
)
public void kibu$onStoppedRiding(CallbackInfo ci, Entity vehicle) {
if (vehicle == null) return;

@SuppressWarnings("DataFlowIssue")
ServerPlayerEntity self = (ServerPlayerEntity) (Object) this;

Expand Down

0 comments on commit e510aee

Please sign in to comment.