Skip to content

Commit

Permalink
Update to Minecraft 1.21.3
Browse files Browse the repository at this point in the history
  • Loading branch information
YaLTeR committed Oct 26, 2024
1 parent 829c6d7 commit c45bf2c
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 29 deletions.
2 changes: 1 addition & 1 deletion build-fabric.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'fabric-loom' version '1.6-SNAPSHOT'
id 'fabric-loom' version '1.8-SNAPSHOT'
}

version = project.modVersion
Expand Down
18 changes: 9 additions & 9 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ modJavaVersion=21
modCredits=Contributors: mezz, juliand665, panoskj, FabiClawZ, ErrorMikey.
modDescription=A mod that enhances the inventory management by adding various additional functions to the usual mouse buttons.

forgeMcVersion=1.21
forgeVersion=51.0.8
forgeLoaderVersion=[51,)
forgeMcVersion=1.21.3
forgeVersion=53.0.0
forgeLoaderVersion=[53,)

neoMcVersion=1.21
neoVersion=21.0.167
neoMcVersion=1.21.3
neoVersion=21.3.3-beta
neoLoaderVersion=[4,)

fabricMcVersion=1.21
fabricLoaderVersion=0.15.11
fabricApiVersion=0.100.1+1.21
fabricModMenuVersion=11.0.0-rc.4
fabricMcVersion=1.21.3
fabricLoaderVersion=0.16.7
fabricApiVersion=0.106.1+1.21.3
fabricModMenuVersion=12.0.0-beta.1
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
7 changes: 5 additions & 2 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#

##############################################################################
#
Expand Down Expand Up @@ -55,7 +57,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
Expand Down Expand Up @@ -84,7 +86,8 @@ done
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
' "$PWD" ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down
2 changes: 2 additions & 0 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@rem SPDX-License-Identifier: Apache-2.0
@rem

@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
Expand Down
Original file line number Diff line number Diff line change
@@ -1,30 +1,25 @@
package yalter.mousetweaks.fabric.mixin;

import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
import net.minecraft.client.MouseHandler;
import net.minecraft.client.gui.screens.Screen;
import org.spongepowered.asm.mixin.Dynamic;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import yalter.mousetweaks.Main;
import yalter.mousetweaks.MouseButton;

@Mixin(MouseHandler.class)
public abstract class MixinMouseHandler {
@Shadow
private int activeButton;

@SuppressWarnings("target")
@Dynamic("Lambda that calls screen.mouseDragged()")
@Inject(method = "method_55795(Lnet/minecraft/client/gui/screens/Screen;DDDD)V", at = @At("HEAD"), cancellable = true)
private void onMouseDragged(Screen screen, double x, double y, double dx, double dy, CallbackInfo ci) {
MouseButton button = MouseButton.fromEventButton(this.activeButton);
@WrapOperation(method = "handleAccumulatedMovement", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/screens/Screen;mouseDragged(DDIDD)Z"))
private boolean onMouseDragged(Screen screen, double x, double y, int activeButton, double dx, double dy, Operation<Boolean> operation) {
MouseButton button = MouseButton.fromEventButton(activeButton);
if (button != null) {
if (Main.onMouseDrag(screen, x, y, button)) {
ci.cancel();
return true;
}
}

return operation.call(screen, x, y, activeButton, dx, dy);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public List<Slot> getSlots() {

@Override
public Slot getSlotUnderMouse(double mouseX, double mouseY) {
return screenAccessor.mousetweaks$invokeFindSlot(mouseX, mouseY);
return screenAccessor.mousetweaks$invokeGetHoveredSlot(mouseX, mouseY);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

@Mixin(AbstractContainerScreen.class)
public interface AbstractContainerScreenAccessor {
@Invoker("findSlot")
Slot mousetweaks$invokeFindSlot(double x, double y);
@Invoker("getHoveredSlot")
Slot mousetweaks$invokeGetHoveredSlot(double x, double y);

@Invoker("slotClicked")
void mousetweaks$invokeSlotClicked(Slot slot, int index, int button, ClickType clickType);
Expand Down

0 comments on commit c45bf2c

Please sign in to comment.