forked from maruohon/itemscroller
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: Sort inventory * feat: Sort inventory * refactor: make ItemType a record class * feat: MASS_CRAFT_RECIPE_BOOK, craft by clicking on vanilla recipe book * fix * fix * fix: MASS_CRAFT_RECIPE_BOOK * fix: translations * fix * fix * fix * fix: drop CraftFailedResponseS2CPacket * fix: Sort inventory * nothing, have no idea about incorrect crafting results * fix: creative mode dead loop * revert: revert changes to `MASS_CRAFT_RECIPE_BOOK`; code cleanup * style * style * chore * chore
- Loading branch information
Showing
13 changed files
with
448 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
src/main/java/fi/dy/masa/itemscroller/mixin/MixinClientPlayNetworkHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package fi.dy.masa.itemscroller.mixin; | ||
|
||
import fi.dy.masa.itemscroller.util.InventoryUtils; | ||
import net.minecraft.client.network.ClientPlayNetworkHandler; | ||
import net.minecraft.network.packet.s2c.play.StatisticsS2CPacket; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
|
||
@Mixin(ClientPlayNetworkHandler.class) | ||
public class MixinClientPlayNetworkHandler | ||
{ | ||
@Inject(method = "onStatistics", at = @At("RETURN"), cancellable = true) | ||
private void onPong(StatisticsS2CPacket packet, CallbackInfo ci) | ||
{ | ||
if (InventoryUtils.onPong(packet)) | ||
{ | ||
ci.cancel(); | ||
} | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
src/main/java/fi/dy/masa/itemscroller/mixin/MixinItemStak.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package fi.dy.masa.itemscroller.mixin; | ||
|
||
import fi.dy.masa.itemscroller.config.Configs; | ||
import fi.dy.masa.itemscroller.util.InventoryUtils; | ||
import net.minecraft.client.MinecraftClient; | ||
import net.minecraft.item.ItemStack; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; | ||
|
||
@Mixin(ItemStack.class) | ||
public class MixinItemStak | ||
{ | ||
@Inject(method = "capCount", at = @At("HEAD"), cancellable = true) | ||
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()) | ||
{ | ||
ci.cancel(); | ||
} | ||
} | ||
|
||
@Inject(method = "getMaxCount", at = @At("HEAD"), cancellable = true) | ||
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) | ||
{ | ||
cir.setReturnValue(InventoryUtils.stackMaxSize((ItemStack) (Object) this, true)); | ||
} | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
src/main/java/fi/dy/masa/itemscroller/mixin/MixinRecipeBookWidget.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package fi.dy.masa.itemscroller.mixin; | ||
|
||
import net.minecraft.client.gui.screen.recipebook.RecipeBookWidget; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
|
||
@Mixin(RecipeBookWidget.class) | ||
public class MixinRecipeBookWidget | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.