Skip to content

Commit

Permalink
Merge branch '1.16' into 1.17
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/main/java/de/siphalor/mousewheelie/client/mixin/MixinClientPlayNetworkHandler.java
#	src/main/java/de/siphalor/mousewheelie/client/mixin/MixinContainer.java
#	src/main/java/de/siphalor/mousewheelie/client/mixin/entity/MixinLivingEntity.java
#	src/main/resources/assets/mousewheelie/lang/en_us.json
  • Loading branch information
Siphalor committed May 22, 2023
2 parents 6d634f2 + 64b9e7e commit c1e329d
Show file tree
Hide file tree
Showing 13 changed files with 227 additions and 123 deletions.
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,22 @@

# Mouse Wheelie

![supported Minecraft versions: 1.14 | 1.15 | 1.16 | 1.17 | 1.18 | 1.19](https://img.shields.io/badge/support%20for%20MC-1.14%20%7C%201.15%20%7C%201.16%20%7C%201.17%20%7C%201.18%20%7C%201.19-%2356AD56?style=for-the-badge)
![supported Minecraft versions: 1.14 | 1.15 | 1.16 | 1.17 | 1.18 | 1.19 | 1.20](https://img.shields.io/badge/support%20for%20MC-1.14%20%7C%201.15%20%7C%201.16%20%7C%201.17%20%7C%201.18%20%7C%201.19%20%7C%201.20-%2356AD56?style=for-the-badge)

[![curseforge downloads](http://cf.way2muchnoise.eu/full_mouse-wheelie_downloads.svg?badge_style=flat)](https://minecraft.curseforge.com/projects/mouse-wheelie)
[![modrinth downloads](https://img.shields.io/modrinth/dt/mouse-wheelie?color=30b27b&style=flat-square&logo=data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAACXBIWXMAAAAAAAAAAQCEeRdzAAAFjElEQVR4nO2aaYhWVRjH3WpcinS0tHIMW0gM7CmXsLQFCnOBFq0PmS2klpZmSraYYFNEC7SZBYqipfWhSAyKVo0RTC1JCwn6kJW0ueWSWuOo%2Ff%2Bc5zLnPe%2B595773vvOfKgXfjBw733Oc855tvOcadPm%2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6SSeBZOzGntpvA62Cs76UrwH1iTmI8GfWOEUY7vkNKDzxxHBW%2Fs9uw1gnOFzp%2BeVYXkzFtwdM873QGjySsZlboD6NClU%2Bb2SVSWnOwz9PFek6bf1nS24dZeFECckboBNji%2BMwSzow6Qp%2BdBd5OMIeol9MQqDidnFVlXSHKW5OY6ijJXWAE%2BDzFznkCo5P11r99ZQYnuQ28AAZ57biACVAB%2B0jZKMl9UD5noVVryeimSkamxqp0i5hGGM%2FJ1W2rS%2FmhPg52DeptP7FksB35IPgETAKnZ9SBp8N7xITqbKW4%2BNsqLnt0orHnZTHhrnOmwZu%2Fe1hM8cZFYrKc4VuoJCFuY8uG7XI2n9pnVS5QefrhfmdMNgyytd2lvLV4XO16ctGK63jMMeyCuzmmoaJoJfHNXW7p1UXugJj7tSVSnmMYUC7KI5hF2NMewexdspvcL09UUX%2BbLKZQc001X3vdGoQRZbaUZuloN37UkDkcnCIBNbqYk1h%2Fdcz14i%2FJmXckt%2FLWoLxVYS2%2FJcax96ky83VFeZ3EayZ2OgaKSYa3gCfABxogfFmd9wO8vSzuismZCHufrF%2BSktsxNTlOipd7LNgOxigc0aQLME6qccnnTKLoa1beTrbMNatnIheIKcNpFts9zu6rm7gjbHixBGn5i%2B6YydAxeZ06SkyGflZK%2F9WAvvGYmATIViGjT%2Bv%2Bq0HILyQq%2Fed%2F%2FwIQ1cNLieDSBgAAAABJRU5ErkJggg%3D%3D)](https://modrinth.com/mod/mouse-wheelie)
[![Translation status](https://img.shields.io/weblate/progress/mouse-wheelie?server=https%3A%2F%2Fweblate.siphalor.de&style=flat-square)](https://weblate.siphalor.de/engage/mouse-wheelie/)

"Small" Minecraft Fabric mod featuring inventory utilities like scrolling, sorting and auto refilling of items

</div>

## Translation status

[![Translation status](https://weblate.siphalor.de/widgets/mouse-wheelie/-/lang/multi-auto.svg)](https://weblate.siphalor.de/engage/mouse-wheelie/)

Contribute or improve translations [here](https://weblate.siphalor.de/engage/mouse-wheelie).

## License

This mod is available under [the Apache 2.0 License](./LICENSE.md). Terms and conditions apply.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ yarn_build=64:v2
loader_version=0.14.11
# Mod Properties
mod_id=mousewheelie
mod_version=1.11.0
mod_version=1.11.1
mod_release=release
mod_mc_version_specifier=1.17.1
mod_mc_versions=1.17.1
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/de/siphalor/mousewheelie/MWConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,14 @@ public static class Sort {

@AConfigBackground("textures/block/horn_coral_block.png")
public static class Refill {
public boolean enable = true;

public boolean offHand = true;
public boolean restoreSelectedSlot = false;

public boolean eat = true;
public boolean drop = true;

public boolean use = true;

public boolean other = true;

public Rules rules = new Rules();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public void onGuiSlotUpdateBegin(ScreenHandlerSlotUpdateS2CPacket packet, Callba

@Inject(method = "onScreenHandlerSlotUpdate", at = @At(value = "INVOKE", target = "Lnet/minecraft/screen/PlayerScreenHandler;setStackInSlot(IILnet/minecraft/item/ItemStack;)V", shift = At.Shift.BEFORE))
public void onGuiSlotUpdateHotbar(ScreenHandlerSlotUpdateS2CPacket packet, CallbackInfo callbackInfo) {
if (MWConfig.refill.other) {
if (MWConfig.refill.enable && MWConfig.refill.other) {
//noinspection ConstantConditions
PlayerInventory inventory = client.player.getInventory();
if (packet.getItemStack().isEmpty() && MinecraftClient.getInstance().currentScreen == null) {
Expand All @@ -82,7 +82,7 @@ public void onGuiSlotUpdateHotbar(ScreenHandlerSlotUpdateS2CPacket packet, Callb
@Inject(method = "onScreenHandlerSlotUpdate", at = @At(value = "INVOKE", target = "Lnet/minecraft/screen/ScreenHandler;setStackInSlot(IILnet/minecraft/item/ItemStack;)V", shift = At.Shift.BEFORE))
public void onGuiSlotUpdateOther(ScreenHandlerSlotUpdateS2CPacket packet, CallbackInfo callbackInfo) {
//noinspection ConstantConditions
if (MWConfig.refill.other && client.player.currentScreenHandler == client.player.playerScreenHandler && packet.getSlot() == 45) {
if (MWConfig.refill.enable && MWConfig.refill.other && client.player.currentScreenHandler == client.player.playerScreenHandler && packet.getSlot() == 45) {
PlayerInventory inventory = client.player.getInventory();
if (packet.getItemStack().isEmpty() && MinecraftClient.getInstance().currentScreen == null) {
if (packet.getSlot() == 45) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public abstract class MixinContainer {
@Inject(method = "updateSlotStacks", at = @At(value = "INVOKE", target = "Lnet/minecraft/screen/slot/Slot;setStack(Lnet/minecraft/item/ItemStack;)V", shift = At.Shift.BEFORE), locals = LocalCapture.CAPTURE_FAILSOFT)
public void onSlotUpdate(int i, List<ItemStack> itemStacks, ItemStack cursorStack, CallbackInfo callbackInfo, int index) {
//noinspection ConstantConditions
if ((Object) this instanceof PlayerScreenHandler && MWConfig.refill.other) {
if ((Object) this instanceof PlayerScreenHandler && MWConfig.refill.enable && MWConfig.refill.other) {
PlayerInventory inventory = MinecraftClient.getInstance().player.getInventory();
if (inventory.selectedSlot == ((ISlot) getSlot(index)).mouseWheelie_getInvSlot()) {
ItemStack stack = inventory.getMainHandStack();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public class MixinMinecraftClient {

@Inject(method = "doItemUse", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/Hand;values()[Lnet/minecraft/util/Hand;"))
public void onItemUse(CallbackInfo callbackInfo) {
if (MWConfig.refill.use) {
if (MWConfig.refill.enable && MWConfig.refill.use) {
mouseWheelie_mainHandStack = player.getMainHandStack();
mouseWheelie_mainHandStack = mouseWheelie_mainHandStack.isEmpty() ? null : mouseWheelie_mainHandStack.copy();
mouseWheelie_offHandStack = player.getOffHandStack();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public void onScreenClosed(CallbackInfo callbackInfo) {

@Inject(method = "dropSelectedItem", at = @At("HEAD"))
public void onDropSelectedItem(boolean all, CallbackInfoReturnable<ItemEntity> callbackInfoReturnable) {
if (MWConfig.refill.drop) {
if (MWConfig.refill.enable && MWConfig.refill.drop) {
if (!getMainHandStack().isEmpty()) {
MWClient.scheduleRefill(Hand.MAIN_HAND, getInventory(), getMainHandStack().copy());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public abstract class MixinLivingEntity {
@Inject(method = "consumeItem", at = @At(value = "INVOKE_ASSIGN", target = "Lnet/minecraft/item/ItemStack;finishUsing(Lnet/minecraft/world/World;Lnet/minecraft/entity/LivingEntity;)Lnet/minecraft/item/ItemStack;"))
protected void onItemUseFinish(CallbackInfo callbackInfo) {
//noinspection ConstantConditions
if ((Object) this instanceof PlayerEntity && MWConfig.refill.eat && activeItemStack.isEmpty()) {
if ((Object) this instanceof PlayerEntity && MWConfig.refill.enable && MWConfig.refill.eat && activeItemStack.isEmpty()) {
PlayerInventory playerInventory = ((PlayerEntity) (Object) this).getInventory();
activeItemStack.setCount(1);
MWClient.scheduleRefill(getActiveHand(), playerInventory, activeItemStack.copy());
Expand Down
2 changes: 0 additions & 2 deletions src/main/resources/assets/mousewheelie/lang/de_de.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
"tweed4_tailor_screen.screen.mousewheelie.general.enable-quick-craft.description": "Beim Rechtsklicken von Einträgen im Rezeptbuch diese Herstellen und in die Hand nehmen.\nShift drücken, um ganze Stacks zu produzieren.",
"tweed4_tailor_screen.screen.mousewheelie.scrolling": "Scrollen",
"tweed4_tailor_screen.screen.mousewheelie.scrolling.enable": "Scrollen zum Bewegen von Gegenständen",
"tweed4_tailor_screen.screen.mousewheelie.scrolling.enable.description": "Scrollen um Gegenstände einzeln in Inventarbereiche zu bewegen",
"tweed4_tailor_screen.screen.mousewheelie.scrolling.invert": "Scroll-Richtung umkehren",
"tweed4_tailor_screen.screen.mousewheelie.scrolling.invert.description": "Betrifft nur das Scrollen von Gegenständen",
"tweed4_tailor_screen.screen.mousewheelie.scrolling.directional-scrolling": "Richtungsgesteuertes Scrollen",
Expand Down Expand Up @@ -79,7 +78,6 @@
"tweed4_tailor_screen.screen.mousewheelie.general.enable-drop-modifier.description": "Aktiviert das Fallenlassen von Gegenständen im Inventar durch Klicken, wenn der entsprechende Modifikator gedrückt wird (standardmäßig Alt).\nDer Modifikator kann in den Vanilla-Einstellungen angepasst werden.",
"tweed4_tailor_screen.screen.mousewheelie.general.item-kinds-nbt-match-mode": "Gegenstandstypen nach NBT einteilen",
"tweed4_tailor_screen.screen.mousewheelie.general.better-fast-dragging": "Besseres schnelles Maus-Ziehen",
"tweed4_tailor_screen.screen.mousewheelie.general.description": "Allgemeine Einstellungen",
"tweed4_tailor_screen.screen.mousewheelie.general.item-kinds-nbt-match-mode.description": "Ob, Gegenstandstypen die Einteilung nach NBT-Daten vornehmen.\nDies hat beispielsweise Einfluss auf Scrollen oder das Fallenlassen von Gegenständen aus dem Inventar.\nNONE deaktiviert die NBT-Prüfung, ALL prüft auf den exakt gleichen Gegenstand und SOME erlaubt Abweichungen im Gegenstandsschaden und in Verzauberungen.",
"tweed4_tailor_screen.screen.mousewheelie.general.better-fast-dragging.description": "Dies hilft, wenn du häufig die Maus schneller bewegst als das Spiel dies registrieren kann.\nDiese Option kann allerdings die Leistung beeinflussen.",
"tweed4_tailor_screen.screen.mousewheelie.sort.description": "Ändert die Sortiermodi. Existierende Modi sind ALPHABET (alphabetisch), RAW_ID (wie Kreativinventar) und QUANTITY (nach Menge der Stapel)",
Expand Down
Loading

0 comments on commit c1e329d

Please sign in to comment.