Skip to content

Commit

Permalink
slight cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
sakura-ryoko committed Jul 22, 2024
1 parent 6812e2a commit dc9648b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;

@Mixin(ItemStack.class)
public class MixinItemStak
public class MixinItemStack
{
@Inject(method = "capCount", at = @At("HEAD"), cancellable = true)
private void dontCap(int maxCount, CallbackInfo ci) {
private void dontCap(int maxCount, CallbackInfo ci)
{
// Client-side fx for empty shulker box stacking
if (MinecraftClient.getInstance().isOnThread() && Configs.Generic.SORT_ASSUME_EMPTY_BOX_STACKS.getBooleanValue())
{
Expand All @@ -23,7 +24,8 @@ private void dontCap(int maxCount, CallbackInfo ci) {
}

@Inject(method = "getMaxCount", at = @At("HEAD"), cancellable = true)
private void getMaxCount(CallbackInfoReturnable<Integer> cir) {
private void getMaxCount(CallbackInfoReturnable<Integer> cir)
{
// Client-side fx for empty shulker box stacking
if (MinecraftClient.getInstance().isOnThread() && Configs.Generic.SORT_ASSUME_EMPTY_BOX_STACKS.getBooleanValue() && InventoryUtils.assumeEmptyShulkerStacking)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2790,8 +2790,10 @@ private static boolean isEmptyShulkerBox(ItemStack stack)
return isShulkerBox(stack) && stack.getOrDefault(DataComponentTypes.CONTAINER, ContainerComponent.DEFAULT).streamNonEmpty().findAny().isEmpty();
}

public static int stackMaxSize(ItemStack stack, boolean assumeShulkerStacking) {
if (stack.isEmpty()) {
public static int stackMaxSize(ItemStack stack, boolean assumeShulkerStacking)
{
if (stack.isEmpty())
{
return 64;
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/mixins.itemscroller.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"MixinMerchantScreenHandler",
"MixinRecipeBookWidget",
"MixinScreen",
"MixinItemStak"
"MixinItemStack"
],
"injectors": {
"defaultRequire": 1
Expand Down

0 comments on commit dc9648b

Please sign in to comment.