Skip to content

Commit

Permalink
Replaced unnecessary @overwrite mixin with cancellable Inject at HEAD
Browse files Browse the repository at this point in the history
  • Loading branch information
briansemrau committed Jul 30, 2019
1 parent cc1cae3 commit e788ce9
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,16 +93,13 @@ public void onDeserialize(ListTag listTag_1, CallbackInfo ci) {
}
}

/**
* @author brian_flakes
*/
@Overwrite
public int getInvSize() {
@Inject(method = "getInvSize", at = @At("HEAD"), cancellable = true)
public void onGetInvSize(CallbackInfoReturnable<Integer> cir) {
int size = 0;
for (DefaultedList list : combinedInventory) {
size += list.size();
}
return size;
cir.setReturnValue(size);
}

@Inject(method = "isInvEmpty", at = @At("HEAD"), cancellable = true)
Expand Down

0 comments on commit e788ce9

Please sign in to comment.