Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e34925a65e | |||
| 180b7045c2 | |||
| bf746ac90c | |||
|
|
58f5351193 | ||
|
|
8b87defba8 |
@@ -1,5 +1,5 @@
|
|||||||
plugins {
|
plugins {
|
||||||
id 'fabric-loom' version '1.6-SNAPSHOT'
|
id 'fabric-loom' version '1.11-SNAPSHOT'
|
||||||
id 'maven-publish'
|
id 'maven-publish'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,15 +3,15 @@ org.gradle.jvmargs=-Xmx1G
|
|||||||
|
|
||||||
# Fabric Properties
|
# Fabric Properties
|
||||||
# check these on https://modmuss50.me/fabric.html
|
# check these on https://modmuss50.me/fabric.html
|
||||||
minecraft_version=1.21
|
minecraft_version=1.21.10
|
||||||
yarn_mappings=1.21+build.9
|
yarn_mappings=1.21.10+build.2
|
||||||
loader_version=0.16.0
|
loader_version=0.17.3
|
||||||
|
|
||||||
# Mod Properties
|
# Mod Properties
|
||||||
mod_version = 1.2.5
|
mod_version = 1.6
|
||||||
maven_group = com.kasetoatz
|
maven_group = com.kasetoatz
|
||||||
archives_base_name = TridentHacks
|
archives_base_name = TridentHacks
|
||||||
|
|
||||||
# Dependencies
|
# Dependencies
|
||||||
# check this on https://modmuss50.me/fabric.html
|
# check this on https://modmuss50.me/fabric.html
|
||||||
fabric_version=0.100.6+1.21
|
fabric_version=0.135.0+1.21.10
|
||||||
|
|||||||
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,6 +1,6 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.2-bin.zip
|
||||||
networkTimeout=10000
|
networkTimeout=10000
|
||||||
validateDistributionUrl=true
|
validateDistributionUrl=true
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
|
|||||||
7
gradlew
vendored
7
gradlew
vendored
@@ -15,6 +15,8 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
#
|
||||||
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
#
|
#
|
||||||
@@ -55,7 +57,7 @@
|
|||||||
# Darwin, MinGW, and NonStop.
|
# Darwin, MinGW, and NonStop.
|
||||||
#
|
#
|
||||||
# (3) This script is generated from the Groovy template
|
# (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.
|
# within the Gradle project.
|
||||||
#
|
#
|
||||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||||
@@ -84,7 +86,8 @@ done
|
|||||||
# shellcheck disable=SC2034
|
# shellcheck disable=SC2034
|
||||||
APP_BASE_NAME=${0##*/}
|
APP_BASE_NAME=${0##*/}
|
||||||
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
# 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.
|
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||||
MAX_FD=maximum
|
MAX_FD=maximum
|
||||||
|
|||||||
2
gradlew.bat
vendored
2
gradlew.bat
vendored
@@ -13,6 +13,8 @@
|
|||||||
@rem See the License for the specific language governing permissions and
|
@rem See the License for the specific language governing permissions and
|
||||||
@rem limitations under the License.
|
@rem limitations under the License.
|
||||||
@rem
|
@rem
|
||||||
|
@rem SPDX-License-Identifier: Apache-2.0
|
||||||
|
@rem
|
||||||
|
|
||||||
@if "%DEBUG%"=="" @echo off
|
@if "%DEBUG%"=="" @echo off
|
||||||
@rem ##########################################################################
|
@rem ##########################################################################
|
||||||
|
|||||||
@@ -9,9 +9,11 @@ import net.minecraft.client.option.KeyBinding;
|
|||||||
import net.minecraft.client.util.InputUtil;
|
import net.minecraft.client.util.InputUtil;
|
||||||
import net.minecraft.item.Items;
|
import net.minecraft.item.Items;
|
||||||
import net.minecraft.text.Text;
|
import net.minecraft.text.Text;
|
||||||
|
import net.minecraft.util.Identifier;
|
||||||
import org.lwjgl.glfw.GLFW;
|
import org.lwjgl.glfw.GLFW;
|
||||||
|
|
||||||
public class TridentHacks implements ClientModInitializer {
|
public class TridentHacks implements ClientModInitializer
|
||||||
|
{
|
||||||
public static MinecraftClient client;
|
public static MinecraftClient client;
|
||||||
public static boolean onGround = true;
|
public static boolean onGround = true;
|
||||||
public static boolean riptideConditions = false;
|
public static boolean riptideConditions = false;
|
||||||
@@ -21,10 +23,11 @@ public class TridentHacks implements ClientModInitializer {
|
|||||||
public static long lastTridentUse = 0;
|
public static long lastTridentUse = 0;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onInitializeClient() {
|
public void onInitializeClient()
|
||||||
|
{
|
||||||
Config.load();
|
Config.load();
|
||||||
client = MinecraftClient.getInstance();
|
client = MinecraftClient.getInstance();
|
||||||
keyBinding = KeyBindingHelper.registerKeyBinding(new KeyBinding("Toggle Riptide", InputUtil.Type.KEYSYM, GLFW.GLFW_KEY_RIGHT_ALT, "RiptideHacks"));
|
keyBinding = KeyBindingHelper.registerKeyBinding(new KeyBinding("key.tridenthacks.toggle_riptide", InputUtil.Type.KEYSYM, GLFW.GLFW_KEY_RIGHT_ALT, KeyBinding.Category.create(Identifier.of("tridenthacks", "tridenthacks"))));
|
||||||
ClientTickEvents.END_CLIENT_TICK.register(client -> {
|
ClientTickEvents.END_CLIENT_TICK.register(client -> {
|
||||||
while (keyBinding.wasPressed()) {
|
while (keyBinding.wasPressed()) {
|
||||||
Config.toggleRiptide = !Config.toggleRiptide;
|
Config.toggleRiptide = !Config.toggleRiptide;
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ package com.kasetoatz.tridenthacks.config;
|
|||||||
import com.google.gson.GsonBuilder;
|
import com.google.gson.GsonBuilder;
|
||||||
import com.google.gson.JsonObject;
|
import com.google.gson.JsonObject;
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.kasetoatz.tridenthacks.TridentHacks;
|
|
||||||
import net.minecraft.client.MinecraftClient;
|
import net.minecraft.client.MinecraftClient;
|
||||||
import net.minecraft.util.crash.CrashException;
|
import net.minecraft.util.crash.CrashException;
|
||||||
import net.minecraft.util.crash.CrashReport;
|
import net.minecraft.util.crash.CrashReport;
|
||||||
@@ -13,7 +12,8 @@ import java.io.FileReader;
|
|||||||
import java.io.FileWriter;
|
import java.io.FileWriter;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
public class Config {
|
public class Config
|
||||||
|
{
|
||||||
public static boolean toggleRiptide = true;
|
public static boolean toggleRiptide = true;
|
||||||
public static boolean noFallDamage = true;
|
public static boolean noFallDamage = true;
|
||||||
public static boolean returnToSameSlot = true;
|
public static boolean returnToSameSlot = true;
|
||||||
|
|||||||
@@ -14,7 +14,8 @@ import org.spongepowered.asm.mixin.injection.Inject;
|
|||||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
@Mixin(ClientConnection.class)
|
@Mixin(ClientConnection.class)
|
||||||
public abstract class ClientConnectionMixin {
|
public abstract class ClientConnectionMixin
|
||||||
|
{
|
||||||
@Inject(method="send*", at=@At("HEAD"), cancellable=true)
|
@Inject(method="send*", at=@At("HEAD"), cancellable=true)
|
||||||
private void send(Packet<?> packet, CallbackInfo ci)
|
private void send(Packet<?> packet, CallbackInfo ci)
|
||||||
{
|
{
|
||||||
@@ -27,7 +28,7 @@ public abstract class ClientConnectionMixin {
|
|||||||
{
|
{
|
||||||
ci.cancel();
|
ci.cancel();
|
||||||
}
|
}
|
||||||
else if (Config.noFallDamage && packet instanceof PlayerMoveC2SPacket && !TridentHacks.onGround && !player.isFallFlying())
|
else if (Config.noFallDamage && packet instanceof PlayerMoveC2SPacket && !TridentHacks.onGround && !player.isGliding())
|
||||||
{
|
{
|
||||||
((PlayerMoveC2SPacketMixin)packet).setOnGround(true);
|
((PlayerMoveC2SPacketMixin)packet).setOnGround(true);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,8 @@ import org.spongepowered.asm.mixin.injection.Inject;
|
|||||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||||
|
|
||||||
@Mixin(EnchantmentHelper.class)
|
@Mixin(EnchantmentHelper.class)
|
||||||
public abstract class EnchantmentHelperMixin {
|
public abstract class EnchantmentHelperMixin
|
||||||
|
{
|
||||||
@Inject(method="getTridentSpinAttackStrength", at=@At("RETURN"), cancellable=true)
|
@Inject(method="getTridentSpinAttackStrength", at=@At("RETURN"), cancellable=true)
|
||||||
private static void getTridentSpinAttackStrength(CallbackInfoReturnable<Float> cir)
|
private static void getTridentSpinAttackStrength(CallbackInfoReturnable<Float> cir)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -9,7 +9,8 @@ import org.spongepowered.asm.mixin.injection.Inject;
|
|||||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||||
|
|
||||||
@Mixin(Entity.class)
|
@Mixin(Entity.class)
|
||||||
public abstract class EntityMixin {
|
public abstract class EntityMixin
|
||||||
|
{
|
||||||
@Inject(method="isTouchingWaterOrRain", at=@At("RETURN"), cancellable=true)
|
@Inject(method="isTouchingWaterOrRain", at=@At("RETURN"), cancellable=true)
|
||||||
private void isTouchingWaterOrRain(CallbackInfoReturnable<Boolean> cir)
|
private void isTouchingWaterOrRain(CallbackInfoReturnable<Boolean> cir)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -9,7 +9,8 @@ import org.spongepowered.asm.mixin.injection.Inject;
|
|||||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||||
|
|
||||||
@Mixin(LivingEntity.class)
|
@Mixin(LivingEntity.class)
|
||||||
public abstract class LivingEntityMixin {
|
public abstract class LivingEntityMixin
|
||||||
|
{
|
||||||
@Inject(method="isUsingRiptide", at=@At("HEAD"), cancellable=true)
|
@Inject(method="isUsingRiptide", at=@At("HEAD"), cancellable=true)
|
||||||
private void isUsingRiptide(CallbackInfoReturnable<Boolean> cir)
|
private void isUsingRiptide(CallbackInfoReturnable<Boolean> cir)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -14,7 +14,8 @@ import org.spongepowered.asm.mixin.injection.Inject;
|
|||||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
@Mixin(PlayerInventory.class)
|
@Mixin(PlayerInventory.class)
|
||||||
public abstract class PlayerInventoryMixin {
|
public abstract class PlayerInventoryMixin
|
||||||
|
{
|
||||||
@Inject(method="setStack", at=@At("HEAD"))
|
@Inject(method="setStack", at=@At("HEAD"))
|
||||||
public void setStack(int slot, ItemStack stack, CallbackInfo ci)
|
public void setStack(int slot, ItemStack stack, CallbackInfo ci)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -6,7 +6,8 @@ import org.spongepowered.asm.mixin.Mutable;
|
|||||||
import org.spongepowered.asm.mixin.gen.Accessor;
|
import org.spongepowered.asm.mixin.gen.Accessor;
|
||||||
|
|
||||||
@Mixin(PlayerMoveC2SPacket.class)
|
@Mixin(PlayerMoveC2SPacket.class)
|
||||||
public interface PlayerMoveC2SPacketMixin {
|
public interface PlayerMoveC2SPacketMixin
|
||||||
|
{
|
||||||
@Accessor("onGround")
|
@Accessor("onGround")
|
||||||
@Mutable
|
@Mutable
|
||||||
void setOnGround(boolean onGround);
|
void setOnGround(boolean onGround);
|
||||||
|
|||||||
@@ -2,12 +2,10 @@ package com.kasetoatz.tridenthacks.mixin;
|
|||||||
|
|
||||||
import com.kasetoatz.tridenthacks.config.Config;
|
import com.kasetoatz.tridenthacks.config.Config;
|
||||||
import com.kasetoatz.tridenthacks.TridentHacks;
|
import com.kasetoatz.tridenthacks.TridentHacks;
|
||||||
import net.minecraft.client.network.ClientPlayerEntity;
|
|
||||||
import net.minecraft.entity.LivingEntity;
|
import net.minecraft.entity.LivingEntity;
|
||||||
import net.minecraft.entity.player.PlayerEntity;
|
import net.minecraft.entity.player.PlayerEntity;
|
||||||
import net.minecraft.entity.player.PlayerInventory;
|
import net.minecraft.entity.player.PlayerInventory;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.item.Items;
|
|
||||||
import net.minecraft.item.TridentItem;
|
import net.minecraft.item.TridentItem;
|
||||||
import net.minecraft.sound.SoundCategory;
|
import net.minecraft.sound.SoundCategory;
|
||||||
import net.minecraft.sound.SoundEvents;
|
import net.minecraft.sound.SoundEvents;
|
||||||
@@ -15,12 +13,13 @@ import net.minecraft.world.World;
|
|||||||
import org.spongepowered.asm.mixin.Mixin;
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
import org.spongepowered.asm.mixin.injection.At;
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
import org.spongepowered.asm.mixin.injection.Inject;
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||||
|
|
||||||
@Mixin(TridentItem.class)
|
@Mixin(TridentItem.class)
|
||||||
public class TridentItemMixin {
|
public class TridentItemMixin
|
||||||
|
{
|
||||||
@Inject(method="onStoppedUsing", at=@At("HEAD"))
|
@Inject(method="onStoppedUsing", at=@At("HEAD"))
|
||||||
private void onStoppedUsing(ItemStack stack, World world, LivingEntity user, int remainingUseTicks, CallbackInfo ci)
|
private void onStoppedUsing(ItemStack stack, World world, LivingEntity user, int remainingUseTicks, CallbackInfoReturnable<Boolean> cir)
|
||||||
{
|
{
|
||||||
if (Config.toggleRiptide)
|
if (Config.toggleRiptide)
|
||||||
{
|
{
|
||||||
@@ -29,7 +28,7 @@ public class TridentItemMixin {
|
|||||||
{
|
{
|
||||||
if (TridentHacks.noNormalRiptide())
|
if (TridentHacks.noNormalRiptide())
|
||||||
{
|
{
|
||||||
world.playSoundFromEntity(player, SoundEvents.ITEM_TRIDENT_RIPTIDE_3.value(), SoundCategory.PLAYERS, 1.F, 1.F);
|
world.playSoundFromEntity(player, player, SoundEvents.ITEM_TRIDENT_RIPTIDE_3.value(), SoundCategory.PLAYERS, 1.F, 1.F);
|
||||||
TridentHacks.lastTridentUse = System.currentTimeMillis();
|
TridentHacks.lastTridentUse = System.currentTimeMillis();
|
||||||
}
|
}
|
||||||
TridentHacks.onGround = false;
|
TridentHacks.onGround = false;
|
||||||
@@ -40,7 +39,7 @@ public class TridentItemMixin {
|
|||||||
PlayerEntity player = TridentHacks.client.player;
|
PlayerEntity player = TridentHacks.client.player;
|
||||||
if (player != null)
|
if (player != null)
|
||||||
{
|
{
|
||||||
TridentHacks.tridentSlot = (user.getOffHandStack() == stack) ? PlayerInventory.OFF_HAND_SLOT : player.getInventory().selectedSlot;
|
TridentHacks.tridentSlot = (user.getOffHandStack() == stack) ? PlayerInventory.OFF_HAND_SLOT : player.getInventory().getSelectedSlot();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
4
src/main/resources/assets/tridenthacks/lang/en_us.json
Normal file
4
src/main/resources/assets/tridenthacks/lang/en_us.json
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"key.category.tridenthacks.tridenthacks": "TridentHacks",
|
||||||
|
"key.tridenthacks.toggle_riptide": "Toggle Riptide"
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user