Skip to content

Commit

Permalink
Fix AttackPAcher
Browse files Browse the repository at this point in the history
  • Loading branch information
Aspw-w committed Aug 21, 2023
1 parent e1e1b16 commit b9fb73f
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 39 deletions.
8 changes: 7 additions & 1 deletion NightX.iws
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,14 @@
</component>
<component name="ChangeListManager">
<list default="true" id="af093b99-5942-419c-869b-8b2d7cb4dd2a" name="変更" comment="">
<change afterPath="$PROJECT_DIR$/src/main/java/net/aspw/client/injection/forge/mixins/network/MixinBlockedServers.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/NightX.iws" beforeDir="false" afterPath="$PROJECT_DIR$/NightX.iws" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/net/aspw/client/injection/forge/mixins/gui/MixinGuiDisconnected.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/net/aspw/client/injection/forge/mixins/gui/MixinGuiDisconnected.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/net/aspw/client/injection/forge/mixins/client/MixinMinecraft.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/net/aspw/client/injection/forge/mixins/client/MixinMinecraft.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/net/aspw/client/injection/forge/mixins/network/MixinNetworkManager_5.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/net/aspw/client/injection/forge/mixins/network/MixinNetworkManager_5.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/net/aspw/client/protocol/AttackFix.java" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/net/aspw/client/protocol/Protocol.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/net/aspw/client/protocol/Protocol.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/resources/client.forge.mixins.json" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/resources/client.forge.mixins.json" afterDir="false" />
<change beforePath="$PROJECT_DIR$/web/beta.txt" beforeDir="false" afterPath="$PROJECT_DIR$/web/beta.txt" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import net.aspw.client.features.module.impl.visual.Animations;
import net.aspw.client.features.module.impl.visual.OptiFinePlus;
import net.aspw.client.injection.forge.mixins.accessors.MinecraftForgeClientAccessor;
import net.aspw.client.protocol.AttackFix;
import net.aspw.client.protocol.Protocol;
import net.aspw.client.util.CPSCounter;
import net.aspw.client.util.render.RenderUtils;
Expand All @@ -26,7 +25,6 @@
import net.minecraft.client.settings.GameSettings;
import net.minecraft.client.stream.IStream;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.BlockPos;
import net.minecraft.util.MovingObjectPosition;
import net.minecraftforge.client.MinecraftForgeClient;
Expand Down Expand Up @@ -201,14 +199,6 @@ private void clickMouse(CallbackInfo callbackInfo) {
else if (this.leftClickCounter <= 10 && this.objectMouseOver == null) leftClickCounter = 10;
}

@Redirect(
method = "clickMouse",
at = @At(value = "INVOKE", target = "Lnet/minecraft/client/multiplayer/PlayerControllerMP;attackEntity(Lnet/minecraft/entity/player/EntityPlayer;Lnet/minecraft/entity/Entity;)V")
)
private void fixAttackOrder_VanillaAttack(PlayerControllerMP instance, EntityPlayer p_attackEntity_1_, Entity p_attackEntity_2_) {
AttackFix.sendFixedAttack(this.thePlayer, this.objectMouseOver.entityHit);
}

@Inject(method = "middleClickMouse", at = @At("HEAD"))
private void middleClickMouse(CallbackInfo ci) {
CPSCounter.registerClick(CPSCounter.MouseButton.MIDDLE);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package net.aspw.client.injection.forge.mixins.network;

import com.mojang.patchy.BlockedServers;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;

@Mixin(BlockedServers.class)
public abstract class MixinBlockedServers {
/**
* @author As_pw
* @reason PATCH
*/
@Overwrite
public static boolean isBlockedServer(String server) {
return false;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import com.viaversion.viaversion.connection.UserConnectionImpl;
import com.viaversion.viaversion.protocol.ProtocolPipelineImpl;
import io.netty.channel.Channel;
import io.netty.channel.socket.SocketChannel;
import net.aspw.client.protocol.Protocol;
import net.aspw.client.protocol.ProtocolPipeline;
import org.spongepowered.asm.mixin.Mixin;
Expand All @@ -17,11 +16,9 @@ public class MixinNetworkManager_5 {

@Inject(method = "initChannel", at = @At(value = "TAIL"), remap = false)
private void onInitChannel(Channel channel, CallbackInfo ci) {
if (channel instanceof SocketChannel && Protocol.targetVersion != Protocol.NATIVE_VERSION) {
final UserConnection user = new UserConnectionImpl(channel, true);
new ProtocolPipelineImpl(user);
final UserConnection user = new UserConnectionImpl(channel, true);
new ProtocolPipelineImpl(user);

channel.pipeline().addLast(new ProtocolPipeline(user, Protocol.targetVersion));
}
channel.pipeline().addLast(new ProtocolPipeline(user, Protocol.targetVersion));
}
}
19 changes: 0 additions & 19 deletions src/main/java/net/aspw/client/protocol/AttackFix.java

This file was deleted.

2 changes: 0 additions & 2 deletions src/main/java/net/aspw/client/protocol/Protocol.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
import net.raphimc.vialoader.util.VersionEnum;

public class Protocol {
public final static VersionEnum NATIVE_VERSION = VersionEnum.r1_8;

public static VersionEnum targetVersion = VersionEnum.r1_8;

public static void start() {
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/client.forge.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
"item.MixinItemRenderer",
"item.MixinItemStack",
"item.MixinNBTTagCompound",
"network.MixinBlockedServers",
"network.MixinNetHandlerPlayClient",
"network.MixinNetworkManager",
"network.MixinNetworkManager_5",
Expand Down
2 changes: 1 addition & 1 deletion web/beta.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
True~Beta B63~NoApiIsHere~https://discord.gg/SGBccUXFK~It's Beta Build!~ - Removed ProtocolFixer (always on)--- * Fixed BlockSounds when using Protocol 1.9+--- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
True~Beta B63~NoApiIsHere~https://discord.gg/SGBccUXFK~It's Beta Build!~ - Removed ProtocolFixer (always on)--- * Fixed Block Sounds & Attack Packet when using Protocol 1.9+--- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---

0 comments on commit b9fb73f

Please sign in to comment.