Compare commits
7 Commits
Author | SHA1 | Date | |
---|---|---|---|
58f5351193 | |||
8b87defba8 | |||
f5e9479079 | |||
d9e2b00679 | |||
677a82142f | |||
4a84587f71 | |||
f8dabec863 |
@ -1,5 +1,5 @@
|
||||
plugins {
|
||||
id 'fabric-loom' version '1.6-SNAPSHOT'
|
||||
id 'fabric-loom' version '1.9-SNAPSHOT'
|
||||
id 'maven-publish'
|
||||
}
|
||||
|
||||
|
@ -2,16 +2,16 @@
|
||||
org.gradle.jvmargs=-Xmx1G
|
||||
|
||||
# Fabric Properties
|
||||
# check these on https://modmuss50.me/fabric.html
|
||||
minecraft_version=1.21
|
||||
yarn_mappings=1.21+build.9
|
||||
loader_version=0.16.0
|
||||
# check these on https://modmuss50.me/fabric.html
|
||||
minecraft_version=1.21.4
|
||||
yarn_mappings=1.21.4+build.8
|
||||
loader_version=0.16.10
|
||||
|
||||
# Mod Properties
|
||||
mod_version = 1.2
|
||||
maven_group = com.kasetoatz
|
||||
archives_base_name = TridentHacks
|
||||
mod_version = 1.4
|
||||
maven_group = com.kasetoatz
|
||||
archives_base_name = TridentHacks
|
||||
|
||||
# Dependencies
|
||||
# check this on https://modmuss50.me/fabric.html
|
||||
fabric_version=0.100.6+1.21
|
||||
# check this on https://modmuss50.me/fabric.html
|
||||
fabric_version=0.114.3+1.21.4
|
||||
|
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
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
|
7
gradlew
vendored
7
gradlew
vendored
@ -15,6 +15,8 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
##############################################################################
|
||||
#
|
||||
@ -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/.
|
||||
@ -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
|
||||
|
2
gradlew.bat
vendored
2
gradlew.bat
vendored
@ -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 ##########################################################################
|
||||
|
@ -7,13 +7,10 @@ import net.fabricmc.fabric.api.client.keybinding.v1.KeyBindingHelper;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.option.KeyBinding;
|
||||
import net.minecraft.client.util.InputUtil;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.item.Items;
|
||||
import net.minecraft.text.Text;
|
||||
import org.lwjgl.glfw.GLFW;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
public class TridentHacks implements ClientModInitializer {
|
||||
public static MinecraftClient client;
|
||||
public static boolean onGround = true;
|
||||
@ -25,8 +22,8 @@ public class TridentHacks implements ClientModInitializer {
|
||||
|
||||
@Override
|
||||
public void onInitializeClient() {
|
||||
client = MinecraftClient.getInstance();
|
||||
Config.load();
|
||||
client = MinecraftClient.getInstance();
|
||||
keyBinding = KeyBindingHelper.registerKeyBinding(new KeyBinding("Toggle Riptide", InputUtil.Type.KEYSYM, GLFW.GLFW_KEY_RIGHT_ALT, "RiptideHacks"));
|
||||
ClientTickEvents.END_CLIENT_TICK.register(client -> {
|
||||
while (keyBinding.wasPressed()) {
|
||||
|
@ -4,6 +4,7 @@ import com.google.gson.GsonBuilder;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.Gson;
|
||||
import com.kasetoatz.tridenthacks.TridentHacks;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.util.crash.CrashException;
|
||||
import net.minecraft.util.crash.CrashReport;
|
||||
|
||||
@ -19,8 +20,10 @@ public class Config {
|
||||
public static String riptideOnMessage = "Riptide §aON";
|
||||
public static String riptideOffMessage = "Riptide §cOFF";
|
||||
|
||||
private static final File file = new File(MinecraftClient.getInstance().runDirectory, "config/tridenthacks.json");
|
||||
private static final Gson gson = new GsonBuilder().setPrettyPrinting().create();
|
||||
|
||||
public static void load() {
|
||||
File file = new File(TridentHacks.client.runDirectory, "config/tridenthacks.json");
|
||||
if (!file.exists())
|
||||
{
|
||||
save();
|
||||
@ -28,7 +31,6 @@ public class Config {
|
||||
}
|
||||
try (FileReader reader = new FileReader(file))
|
||||
{
|
||||
Gson gson = new GsonBuilder().setPrettyPrinting().create();
|
||||
JsonObject json = gson.fromJson(reader, JsonObject.class);
|
||||
if (json.has("toggleRiptide"))
|
||||
{
|
||||
@ -50,6 +52,7 @@ public class Config {
|
||||
{
|
||||
riptideOffMessage = json.get("riptideOffMessage").getAsString();
|
||||
}
|
||||
save();
|
||||
}
|
||||
catch (IOException exc)
|
||||
{
|
||||
@ -65,9 +68,9 @@ public class Config {
|
||||
json.addProperty("returnToSameSlot", returnToSameSlot);
|
||||
json.addProperty("riptideOnMessage", riptideOnMessage);
|
||||
json.addProperty("riptideOffMessage", riptideOffMessage);
|
||||
try (FileWriter writer = new FileWriter(new File(TridentHacks.client.runDirectory, "config/tridenthacks.json")))
|
||||
try (FileWriter writer = new FileWriter(file))
|
||||
{
|
||||
new GsonBuilder().setPrettyPrinting().create().toJson(json, writer);
|
||||
gson.toJson(json, writer);
|
||||
}
|
||||
catch (IOException exc)
|
||||
{
|
||||
|
@ -3,9 +3,10 @@ package com.kasetoatz.tridenthacks.mixin;
|
||||
import com.kasetoatz.tridenthacks.config.Config;
|
||||
import com.kasetoatz.tridenthacks.TridentHacks;
|
||||
import net.minecraft.client.network.ClientPlayerEntity;
|
||||
import net.minecraft.item.Items;
|
||||
import net.minecraft.network.ClientConnection;
|
||||
import net.minecraft.network.packet.Packet;
|
||||
import net.minecraft.network.packet.c2s.play.PlayerActionC2SPacket;
|
||||
import net.minecraft.network.packet.c2s.play.PlayerInteractItemC2SPacket;
|
||||
import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
@ -22,11 +23,11 @@ public abstract class ClientConnectionMixin {
|
||||
ClientPlayerEntity player = TridentHacks.client.player;
|
||||
if (player != null)
|
||||
{
|
||||
if (packet instanceof PlayerActionC2SPacket && TridentHacks.noNormalRiptide() && ((PlayerActionC2SPacket)packet).getAction() == PlayerActionC2SPacket.Action.RELEASE_USE_ITEM)
|
||||
if (packet instanceof PlayerInteractItemC2SPacket && player.getStackInHand(((PlayerInteractItemC2SPacket)packet).getHand()).getItem() == Items.TRIDENT && TridentHacks.noNormalRiptide())
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
@ -16,22 +16,26 @@ 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(TridentItem.class)
|
||||
public class TridentItemMixin {
|
||||
@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)
|
||||
{
|
||||
PlayerEntity player = TridentHacks.client.player;
|
||||
if (TridentHacks.noNormalRiptide() && user == player && user.getItemUseTime() > 10)
|
||||
if (user == player && user.getItemUseTime() > 10)
|
||||
{
|
||||
if (TridentHacks.noNormalRiptide())
|
||||
{
|
||||
world.playSoundFromEntity(player, SoundEvents.ITEM_TRIDENT_RIPTIDE_3.value(), SoundCategory.PLAYERS, 1.F, 1.F);
|
||||
}
|
||||
TridentHacks.lastTridentUse = System.currentTimeMillis();
|
||||
}
|
||||
TridentHacks.onGround = false;
|
||||
}
|
||||
}
|
||||
else if (Config.returnToSameSlot && !TridentHacks.hasRiptide)
|
||||
{
|
||||
PlayerEntity player = TridentHacks.client.player;
|
||||
|
@ -2,7 +2,7 @@
|
||||
"schemaVersion": 1,
|
||||
"id": "tridenthacks",
|
||||
"version": "${version}",
|
||||
"name": "RiptideHacks",
|
||||
"name": "TridentHacks",
|
||||
"description": "",
|
||||
"authors": [],
|
||||
"contact": {
|
||||
|
Reference in New Issue
Block a user