0
0
mirror of https://github.com/Wurst-Imperium/Wurst7.git synced 2024-09-19 17:02:13 +02:00

Merge v7.35.2 into 1.19.2

This commit is contained in:
Alexander01998 2023-07-12 17:09:16 +02:00
parent 7901d3a212
commit 775f80f45c
15 changed files with 168 additions and 35 deletions

View File

@ -1,7 +1,7 @@
blank_issues_enabled: true
contact_links:
- name: Reddit Community
url: https://www.reddit.com/r/WurstClient/
- name: WurstForum
url: https://wurstforum.net/?utm_source=GitHub&utm_medium=Wurst7+repo
about: For general discussion, support, memes, etc.
- name: Contact Alexander
url: https://www.wurstclient.net/contact/?utm_source=GitHub&utm_medium=Wurst7&utm_campaign=Issues&utm_content=Contact+Alexander

View File

@ -1,36 +1,25 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle
name: Java CI with Gradle
on:
push:
branches: [ "master" ]
paths:
- '**.java'
- 'gradle**'
- 'build.gradle'
pull_request:
branches: [ "master" ]
paths:
- '**.java'
- 'gradle**'
- 'build.gradle'
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: gradle/wrapper-validation-action@v1
- name: Set up JDK 17
uses: actions/setup-java@v3
with:

View File

@ -2,7 +2,6 @@ name: JSON syntax
on:
push:
branches: [ "master" ]
paths:
- '**.json'
pull_request:
@ -14,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: json-syntax-check
- name: Check JSON syntax
uses: limitusus/json-syntax-check@v2
with:
pattern: "\\.json$"

View File

@ -5,7 +5,7 @@ buildscript {
}
plugins {
id 'fabric-loom' version '1.2-SNAPSHOT'
id 'fabric-loom' version '1.3-SNAPSHOT'
id 'maven-publish'
}

View File

@ -1,5 +1,6 @@
# Done to increase the memory available to gradle.
org.gradle.jvmargs=-Xmx1G
org.gradle.parallel=true
# Fabric Properties
# check these at https://fabricmc.net/develop/ and
@ -12,7 +13,7 @@ loader_version=0.14.21
fabric_version=0.76.0+1.19.2
# Mod Properties
mod_version = v7.35.1-MC1.19.2
mod_version = v7.35.2-MC1.19.2
maven_group = net.wurstclient
archives_base_name = Wurst-Client

View File

@ -58,7 +58,7 @@ public enum WurstClient
public static MinecraftClient MC;
public static IMinecraftClient IMC;
public static final String VERSION = "7.35.1";
public static final String VERSION = "7.35.2";
public static final String MC_VERSION = "1.19.2";
private WurstAnalytics analytics;

View File

@ -195,6 +195,7 @@ public final class Encryption
}
private KeyPair getRsaKeyPair(Path publicFile, Path privateFile)
throws IOException
{
if(Files.notExists(publicFile) || Files.notExists(privateFile))
return createRsaKeys(publicFile, privateFile);
@ -213,7 +214,7 @@ public final class Encryption
}
}
private SecretKey getAesKey(Path path, KeyPair pair)
private SecretKey getAesKey(Path path, KeyPair pair) throws IOException
{
if(Files.notExists(path))
return createAesKey(path, pair);
@ -232,6 +233,7 @@ public final class Encryption
}
private KeyPair createRsaKeys(Path publicFile, Path privateFile)
throws IOException
{
try
{
@ -268,14 +270,14 @@ public final class Encryption
return pair;
}catch(GeneralSecurityException | IOException e)
}catch(GeneralSecurityException e)
{
throw new CrashException(
CrashReport.create(e, "Creating RSA keypair"));
}
}
private SecretKey createAesKey(Path path, KeyPair pair)
private SecretKey createAesKey(Path path, KeyPair pair) throws IOException
{
try
{
@ -293,7 +295,7 @@ public final class Encryption
return key;
}catch(GeneralSecurityException | IOException e)
}catch(GeneralSecurityException e)
{
throw new CrashException(CrashReport.create(e, "Creating AES key"));
}

View File

@ -13,14 +13,33 @@ import net.wurstclient.Category;
import net.wurstclient.SearchTags;
import net.wurstclient.events.UpdateListener;
import net.wurstclient.hack.Hack;
import net.wurstclient.settings.CheckboxSetting;
@SearchTags({"no fall"})
public final class NoFallHack extends Hack implements UpdateListener
{
private final CheckboxSetting allowElytra = new CheckboxSetting(
"Allow elytra",
"Also tries to prevent fall damage while you are flying with an elytra.\n\n"
+ "\u00a7c\u00a7lWARNING:\u00a7r This can sometimes cause you to"
+ " stop flying unexpectedly.",
false);
public NoFallHack()
{
super("NoFall");
setCategory(Category.MOVEMENT);
addSetting(allowElytra);
}
@Override
public String getRenderName()
{
if(MC.player != null && MC.player.isFallFlying()
&& !allowElytra.isChecked())
return getName() + " (paused)";
return getName();
}
@Override
@ -39,13 +58,22 @@ public final class NoFallHack extends Hack implements UpdateListener
public void onUpdate()
{
ClientPlayerEntity player = MC.player;
if(player.fallDistance <= (player.isFallFlying() ? 1 : 2))
boolean fallFlying = player.isFallFlying();
// pause when flying with elytra, unless allowed
if(fallFlying && !allowElytra.isChecked())
return;
if(player.isFallFlying() && player.isSneaking()
// ignore small falls that can't cause damage
if(player.fallDistance <= (fallFlying ? 1 : 2))
return;
// attempt to fix elytra weirdness, if allowed
if(fallFlying && player.isSneaking()
&& !isFallingFastEnoughToCauseDamage(player))
return;
// send packet to stop fall damage
player.networkHandler.sendPacket(new OnGroundOnly(true));
}

View File

@ -0,0 +1,60 @@
/*
* Copyright (c) 2014-2023 Wurst-Imperium and contributors.
*
* This source code is subject to the terms of the GNU General Public
* License, version 3. If a copy of the GPL was not distributed with this
* file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt
*/
package net.wurstclient.mixin;
import java.util.Optional;
import org.spongepowered.asm.mixin.Final;
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.CallbackInfoReturnable;
import net.minecraft.client.network.Address;
import net.minecraft.client.network.AddressResolver;
import net.minecraft.client.network.AllowedAddressResolver;
import net.minecraft.client.network.RedirectResolver;
import net.minecraft.client.network.ServerAddress;
import net.wurstclient.WurstClient;
@Mixin(AllowedAddressResolver.class)
public class AllowedAddressResolverMixin
{
@Shadow
@Final
private AddressResolver addressResolver;
@Shadow
@Final
private RedirectResolver redirectResolver;
/**
* This mixin allows users to connect to servers that have been shadowbanned
* by Mojang, such as CS:GO and GTA clones that are apparently "too
* adult-oriented" for having pixelated guns.
*/
@Inject(at = @At("HEAD"),
method = "resolve(Lnet/minecraft/client/network/ServerAddress;)Ljava/util/Optional;",
cancellable = true)
public void resolve(ServerAddress address,
CallbackInfoReturnable<Optional<Address>> cir)
{
if(!WurstClient.INSTANCE.isEnabled())
return;
Optional<Address> optionalAddress = addressResolver.resolve(address);
Optional<ServerAddress> optionalRedirect =
redirectResolver.lookupRedirect(address);
if(optionalRedirect.isPresent())
optionalAddress = addressResolver.resolve(optionalRedirect.get());
cir.setReturnValue(optionalAddress);
}
}

View File

@ -14,7 +14,6 @@ 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.Redirect;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
@ -66,6 +65,7 @@ public class ClientPlayerEntityMixin extends AbstractClientPlayerEntity
protected MinecraftClient client;
private Screen tempCurrentScreen;
private boolean hideNextItemUse;
public ClientPlayerEntityMixin(WurstClient wurst, ClientWorld world,
GameProfile profile, PlayerPublicKey playerPublicKey)
@ -81,15 +81,46 @@ public class ClientPlayerEntityMixin extends AbstractClientPlayerEntity
EventManager.fire(UpdateEvent.INSTANCE);
}
@Redirect(at = @At(value = "INVOKE",
/**
* This mixin runs just before the tickMovement() method calls
* isUsingItem(), so that the onIsUsingItem() mixin knows which
* call to intercept.
*/
@Inject(at = @At(value = "INVOKE",
target = "Lnet/minecraft/client/network/ClientPlayerEntity;isUsingItem()Z",
ordinal = 0), method = "tickMovement()V")
private boolean wurstIsUsingItem(ClientPlayerEntity player)
private void onTickMovementItemUse(CallbackInfo ci)
{
if(WurstClient.INSTANCE.getHax().noSlowdownHack.isEnabled())
return false;
hideNextItemUse = true;
}
/**
* Pretends that the player is not using an item when instructed to do so by
* the onTickMovement() mixin.
*/
@Inject(at = @At("HEAD"), method = "isUsingItem()Z", cancellable = true)
private void onIsUsingItem(CallbackInfoReturnable<Boolean> cir)
{
if(!hideNextItemUse)
return;
return player.isUsingItem();
cir.setReturnValue(false);
hideNextItemUse = false;
}
/**
* This mixin is injected into a random field access later in the
* tickMovement() method to ensure that hideNextItemUse is always reset
* after the item use slowdown calculation.
*/
@Inject(at = @At(value = "FIELD",
target = "Lnet/minecraft/client/network/ClientPlayerEntity;ticksToNextAutojump:I",
opcode = Opcodes.GETFIELD,
ordinal = 0), method = "tickMovement()V")
private void afterIsUsingItem(CallbackInfo ci)
{
hideNextItemUse = false;
}
@Inject(at = {@At("HEAD")}, method = {"sendMovementPackets()V"})

View File

@ -37,6 +37,10 @@ public abstract class GameRendererMixin
{
private boolean cancelNextBobView;
/**
* Fires the CameraTransformViewBobbingEvent event and records whether the
* next view-bobbing call should be cancelled.
*/
@Inject(at = @At(value = "INVOKE",
target = "Lnet/minecraft/client/render/GameRenderer;bobView(Lnet/minecraft/client/util/math/MatrixStack;F)V",
ordinal = 0),
@ -53,6 +57,10 @@ public abstract class GameRendererMixin
cancelNextBobView = true;
}
/**
* Cancels the view-bobbing call if requested by the last
* CameraTransformViewBobbingEvent.
*/
@Inject(at = @At("HEAD"),
method = "bobView(Lnet/minecraft/client/util/math/MatrixStack;F)V",
cancellable = true)
@ -66,9 +74,14 @@ public abstract class GameRendererMixin
cancelNextBobView = false;
}
/**
* This mixin is injected into a random method call later in the
* renderWorld() method to ensure that cancelNextBobView is always reset
* after the view-bobbing call.
*/
@Inject(at = @At("HEAD"),
method = "renderHand(Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/Camera;F)V")
private void renderHand(MatrixStack matrices, Camera camera,
private void onRenderHand(MatrixStack matrices, Camera camera,
float tickDelta, CallbackInfo ci)
{
cancelNextBobView = false;

View File

@ -127,11 +127,12 @@ public class WurstOptionsScreen extends Screen
b -> os.open(
"https://wurst.wiki/?utm_source=Wurst+Client&utm_medium=Wurst+Options&utm_content=Wurst+Wiki"));
new WurstOptionsButton(54, 72, () -> "Twitter", "@Wurst_Imperium",
b -> os.open("https://www.wurstclient.net/twitter/"));
new WurstOptionsButton(54, 72, () -> "WurstForum", "WurstForum.net",
b -> os.open(
"https://wurstforum.net/?utm_source=Wurst+Client&utm_medium=Wurst+Options&utm_content=WurstForum"));
new WurstOptionsButton(54, 96, () -> "Reddit", "r/WurstClient",
b -> os.open("https://www.wurstclient.net/reddit/"));
new WurstOptionsButton(54, 96, () -> "Twitter", "@Wurst_Imperium",
b -> os.open("https://www.wurstclient.net/twitter/"));
new WurstOptionsButton(54, 120, () -> "Donate",
"WurstClient.net/donate", b -> os.open(

View File

@ -17,6 +17,7 @@ import net.minecraft.client.network.ClientLoginNetworkHandler;
import net.minecraft.client.network.ClientPlayNetworkHandler;
import net.minecraft.network.message.MessageSignatureData;
import net.minecraft.text.Text;
import net.wurstclient.Category;
import net.wurstclient.DontBlock;
import net.wurstclient.SearchTags;
import net.wurstclient.WurstClient;
@ -101,6 +102,12 @@ public final class NoChatReportsOtf extends OtherFeature
disableSignatures.setChecked(!disableSignatures.isChecked());
}
@Override
public Category getCategory()
{
return Category.CHAT;
}
// See ChatHudMixin, ClientPlayerEntityMixin, ClientPlayNetworkHandlerMixin,
// MessageHandlerMixin, ProfileKeysMixin
}

View File

@ -45,6 +45,7 @@
"modmenu": {
"links": {
"Wiki": "https://wurst.wiki/?utm_source=Wurst+Client&utm_medium=ModMenu&utm_content=Wiki",
"Forum": "https://wurstforum.net/?utm_source=Wurst+Client&utm_medium=ModMenu&utm_content=Forum",
"Donate": "https://www.wurstclient.net/donate/?utm_source=Wurst+Client&utm_medium=ModMenu&utm_content=Donate"
}
}

View File

@ -7,6 +7,7 @@
],
"client": [
"AbstractBlockStateMixin",
"AllowedAddressResolverMixin",
"ArmorItemMixin",
"BackgroundRendererMixin",
"BlockEntityRenderDispatcherMixin",