diff --git a/build.gradle b/build.gradle index db9a8152..1b44e449 100644 --- a/build.gradle +++ b/build.gradle @@ -59,14 +59,6 @@ dependencies { exclude module: "slf4j-api" } - include "com.viaversion:viaversion:${project.viaversion_version}" - include "com.viaversion:viabackwards:${project.viabackwards_version}" - include "com.viaversion:viarewind:${project.viarewind_version}" - include ("net.raphimc:ViaLegacy:${project.vialegacy_version}") { - exclude group: "com.google.code.gson", module: "gson" - } - include "net.raphimc:ViaLoader:${project.vialoader_version}" - include "org.slf4j:slf4j-api:${project.slf4j_version}" include "org.yaml:snakeyaml:${project.snake_yml_version}" diff --git a/gradle.properties b/gradle.properties index e6a94794..5c59376b 100644 --- a/gradle.properties +++ b/gradle.properties @@ -17,10 +17,4 @@ mixingradle_version = ae2a80e okhttp_version=4.9.1 snake_yml_version=2.2 -slf4j_version=2.0.12 - -viaversion_version=4.10.1-SNAPSHOT -viabackwards_version=4.10.0 -viarewind_version=3.1.0 -vialoader_version=2.2.14-SNAPSHOT -vialegacy_version=2.2.23-SNAPSHOT \ No newline at end of file +slf4j_version=2.0.12 \ No newline at end of file diff --git a/src/main/java/net/aspw/client/Launch.kt b/src/main/java/net/aspw/client/Launch.kt index faec37b6..ee97c35c 100644 --- a/src/main/java/net/aspw/client/Launch.kt +++ b/src/main/java/net/aspw/client/Launch.kt @@ -5,7 +5,6 @@ import net.aspw.client.event.ClientShutdownEvent import net.aspw.client.event.EventManager import net.aspw.client.features.api.DiscordRPC import net.aspw.client.features.api.MacroManager -import net.aspw.client.features.api.McUpdatesHandler import net.aspw.client.features.api.PacketManager import net.aspw.client.features.api.inventory.EnchantItems import net.aspw.client.features.api.inventory.ModItems @@ -17,8 +16,6 @@ import net.aspw.client.features.module.impl.other.ThunderNotifier import net.aspw.client.features.module.impl.visual.Interface import net.aspw.client.features.module.impl.visual.SilentRotations import net.aspw.client.features.module.impl.visual.Trajectories -import net.aspw.client.protocol.ProtocolBase -import net.aspw.client.protocol.ProtocolMod import net.aspw.client.utils.* import net.aspw.client.utils.ClassUtils.hasForge import net.aspw.client.utils.misc.sound.TipSoundManager @@ -30,7 +27,7 @@ object Launch { // Client information const val CLIENT_BEST = "NightX" const val CLIENT_FOLDER = "NightX-Client" - const val CLIENT_VERSION = "B109" + const val CLIENT_VERSION = "B110" const val CLIENT_CHAT = "§c[$CLIENT_BEST] §r" const val CLIENT_PROTOCOL_RANGE = "1.7.2 to 1.20.6" @@ -65,8 +62,6 @@ object Launch { lastTick = System.currentTimeMillis() - ProtocolBase.init(ProtocolMod.PLATFORM) - // Check update APIConnecter.checkStatus() APIConnecter.checkChangelogs() @@ -82,7 +77,6 @@ object Launch { // Register listeners eventManager.registerListener(RotationUtils()) eventManager.registerListener(PacketManager()) - eventManager.registerListener(McUpdatesHandler()) eventManager.registerListener(InventoryUtils()) eventManager.registerListener(InventoryHelper) eventManager.registerListener(PacketUtils()) diff --git a/src/main/java/net/aspw/client/features/api/McUpdatesHandler.java b/src/main/java/net/aspw/client/features/api/McUpdatesHandler.java deleted file mode 100644 index f4c320e7..00000000 --- a/src/main/java/net/aspw/client/features/api/McUpdatesHandler.java +++ /dev/null @@ -1,175 +0,0 @@ -package net.aspw.client.features.api; - -import net.aspw.client.event.*; -import net.aspw.client.protocol.api.ProtocolFixer; -import net.aspw.client.utils.AnimationUtils; -import net.aspw.client.utils.MinecraftInstance; -import net.minecraft.block.material.Material; -import net.minecraft.client.settings.GameSettings; -import net.minecraft.entity.item.EntityBoat; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.BlockPos; -import net.minecraft.world.World; - -public class McUpdatesHandler extends MinecraftInstance implements Listenable { - - public static boolean isSwimmingOrCrawling = false; - public static boolean doingEyeRot = false; - public static float eyeHeight; - public static float lastEyeHeight; - - private static boolean underWater() { - final World world = mc.thePlayer.getEntityWorld(); - double eyeBlock = mc.thePlayer.posY + (double) mc.thePlayer.getEyeHeight() - 0.25; - BlockPos blockPos = new BlockPos(mc.thePlayer.posX, eyeBlock, mc.thePlayer.posZ); - - return world.getBlockState(blockPos).getBlock().getMaterial() == Material.water && !(mc.thePlayer.ridingEntity instanceof EntityBoat); - } - - private static boolean isSwimming() { - return !mc.thePlayer.noClip && mc.thePlayer.isInWater() && mc.thePlayer.isSprinting(); - } - - public static boolean shouldAnimation() { - AxisAlignedBB box = mc.thePlayer.getEntityBoundingBox(); - AxisAlignedBB crawl = new AxisAlignedBB(box.minX, box.minY + 0.9, box.minZ, box.minX + 0.6, box.minY + 1.5, box.minZ + 0.6); - - return !mc.thePlayer.noClip && (isSwimmingOrCrawling && mc.thePlayer.isSprinting() && mc.thePlayer.isInWater() || isSwimmingOrCrawling && !mc.theWorld.getCollisionBoxes(crawl).isEmpty()); - } - - private static void resetAll() { - if (isSwimmingOrCrawling) isSwimmingOrCrawling = false; - if (doingEyeRot) doingEyeRot = false; - } - - @EventTarget - public void onPushOut(PushOutEvent event) { - if (ProtocolFixer.newerThanOrEqualsTo1_13() && (shouldAnimation() || mc.thePlayer.isSneaking())) - event.cancelEvent(); - } - - @EventTarget - public void onWorld(WorldEvent event) { - resetAll(); - } - - @EventTarget - public void onMotion(MotionEvent event) { - if (ProtocolFixer.newerThanOrEqualsTo1_13()) { - float START_HEIGHT = 1.62f; - float END_HEIGHT; - - lastEyeHeight = eyeHeight; - - END_HEIGHT = 0.45f; - - float delta; - delta = 0.085f; - - if (shouldAnimation()) { - eyeHeight = AnimationUtils.animate(END_HEIGHT, eyeHeight, 2 * delta); - doingEyeRot = true; - } else if (eyeHeight < START_HEIGHT) - eyeHeight = AnimationUtils.animate(START_HEIGHT, eyeHeight, 2 * delta); - - if (eyeHeight >= START_HEIGHT && doingEyeRot) - doingEyeRot = false; - } - } - - @EventTarget - public void onUpdate(UpdateEvent event) { - if (ProtocolFixer.newerThanOrEqualsTo1_13()) { - if (isSwimming()) { - if (mc.thePlayer.motionX < -0.4D) { - mc.thePlayer.motionX = -0.39F; - } - if (mc.thePlayer.motionX > 0.4D) { - mc.thePlayer.motionX = 0.39F; - } - if (mc.thePlayer.motionY < -0.4D) { - mc.thePlayer.motionY = -0.39F; - } - if (mc.thePlayer.motionY > 0.4D) { - mc.thePlayer.motionY = 0.39F; - } - if (mc.thePlayer.motionZ < -0.4D) { - mc.thePlayer.motionZ = -0.39F; - } - if (mc.thePlayer.motionZ > 0.4D) { - mc.thePlayer.motionZ = 0.39F; - } - - double d3 = mc.thePlayer.getLookVec().yCoord; - double d4 = 0.025D; - - if (d3 <= 0.0D || mc.thePlayer.worldObj.getBlockState(new BlockPos(mc.thePlayer.posX, mc.thePlayer.posY + 1.0D - 0.64D, mc.thePlayer.posZ)).getBlock().getMaterial() == Material.water) { - mc.thePlayer.motionY += (d3 - mc.thePlayer.motionY) * d4; - } - - mc.thePlayer.motionY += 0.018d; - - if (shouldAnimation()) { - mc.thePlayer.motionX *= 1.11F; - mc.thePlayer.motionZ *= 1.11F; - } - } - } - - float sneakLength; - - if (ProtocolFixer.newerThanOrEqualsTo1_9() && ProtocolFixer.olderThanOrEqualsTo1_13_2()) - sneakLength = 1.65f; - else if (ProtocolFixer.newerThanOrEqualsTo1_14()) - sneakLength = 1.5f; - else sneakLength = 1.8f; - - double d0 = mc.thePlayer.width / 2.0; - AxisAlignedBB box = mc.thePlayer.getEntityBoundingBox(); - AxisAlignedBB setThrough = new AxisAlignedBB(mc.thePlayer.posX - d0, box.minY, mc.thePlayer.posZ - d0, mc.thePlayer.posX + d0, box.minY + mc.thePlayer.height, mc.thePlayer.posZ + d0); - AxisAlignedBB sneak = new AxisAlignedBB(box.minX, box.minY + 0.9, box.minZ, box.minX + 0.6, box.minY + 1.8, box.minZ + 0.6); - AxisAlignedBB crawl = new AxisAlignedBB(box.minX, box.minY + 0.9, box.minZ, box.minX + 0.6, box.minY + 1.5, box.minZ + 0.6); - - float newHeight; - float newWidth; - - if (ProtocolFixer.newerThanOrEqualsTo1_13() && isSwimmingOrCrawling && underWater() && mc.thePlayer.rotationPitch >= 0.0) { - newHeight = 0.6f; - newWidth = 0.6f; - isSwimmingOrCrawling = true; - mc.thePlayer.setEntityBoundingBox(setThrough); - } else if (ProtocolFixer.newerThanOrEqualsTo1_13() && (isSwimming() && underWater() || !mc.theWorld.getCollisionBoxes(crawl).isEmpty())) { - newHeight = 0.6f; - newWidth = 0.6f; - isSwimmingOrCrawling = true; - mc.thePlayer.setEntityBoundingBox(setThrough); - } else if (mc.thePlayer.isSneaking() && !underWater()) { - newHeight = sneakLength; - newWidth = 0.6f; - mc.thePlayer.setEntityBoundingBox(setThrough); - } else { - if (isSwimmingOrCrawling) - isSwimmingOrCrawling = false; - newHeight = 1.8f; - newWidth = 0.6f; - mc.thePlayer.setEntityBoundingBox(setThrough); - } - - if (ProtocolFixer.newerThanOrEqualsTo1_9() && mc.thePlayer.onGround && !mc.thePlayer.isSneaking() && !underWater() && (mc.thePlayer.height == sneakLength || mc.thePlayer.height == 0.6F) && !mc.theWorld.getCollisionBoxes(sneak).isEmpty()) { - mc.gameSettings.keyBindSneak.pressed = true; - } else if (!GameSettings.isKeyDown(mc.gameSettings.keyBindSneak) && mc.theWorld.getCollisionBoxes(sneak).isEmpty()) { - mc.gameSettings.keyBindSneak.pressed = false; - } - - try { - mc.thePlayer.height = newHeight; - mc.thePlayer.width = newWidth; - } catch (IllegalArgumentException ignored) { - } - } - - @Override - public boolean handleEvents() { - return true; - } -} \ No newline at end of file diff --git a/src/main/java/net/aspw/client/features/api/PacketManager.java b/src/main/java/net/aspw/client/features/api/PacketManager.java index 3ff03127..a80c30d4 100644 --- a/src/main/java/net/aspw/client/features/api/PacketManager.java +++ b/src/main/java/net/aspw/client/features/api/PacketManager.java @@ -8,13 +8,10 @@ import net.aspw.client.features.module.impl.other.BrandSpoofer; import net.aspw.client.features.module.impl.visual.Animations; import net.aspw.client.features.module.impl.visual.SilentRotations; -import net.aspw.client.protocol.api.ProtocolFixer; -import net.aspw.client.utils.AnimationUtils; import net.aspw.client.utils.MinecraftInstance; import net.aspw.client.utils.RotationUtils; import net.aspw.client.utils.timer.MSTimer; import net.minecraft.network.Packet; -import net.minecraft.network.play.client.C08PacketPlayerBlockPlacement; import java.util.Objects; @@ -23,8 +20,6 @@ public class PacketManager extends MinecraftInstance implements Listenable { private static final MSTimer packetCountTimer = new MSTimer(); public static int swing; public static boolean isVisualBlocking = false; - public static float eyeHeight; - public static float lastEyeHeight; public static int sendPacketCounts; public static int receivePacketCounts; private int preSend = 0; @@ -53,29 +48,6 @@ public void onRender3D(Render3DEvent event) { public void onMotion(MotionEvent event) { mc.leftClickCounter = 0; - float START_HEIGHT = 1.62f; - float END_HEIGHT; - - lastEyeHeight = eyeHeight; - - if (ProtocolFixer.newerThanOrEqualsTo1_9() && ProtocolFixer.olderThanOrEqualsTo1_13_2()) - END_HEIGHT = 1.47f; - else if (ProtocolFixer.newerThanOrEqualsTo1_14()) - END_HEIGHT = 1.32f; - else END_HEIGHT = 1.54f; - - float delta; - if (ProtocolFixer.newerThanOrEqualsTo1_9() && ProtocolFixer.olderThanOrEqualsTo1_13_2()) - delta = 0.147f; - else if (ProtocolFixer.newerThanOrEqualsTo1_14()) - delta = 0.132f; - else delta = 0.154f; - - if (mc.thePlayer.isSneaking()) - eyeHeight = AnimationUtils.animate(END_HEIGHT, eyeHeight, 2 * delta); - else if (eyeHeight < START_HEIGHT) - eyeHeight = AnimationUtils.animate(START_HEIGHT, eyeHeight, 2 * delta); - if (!Objects.requireNonNull(Launch.moduleManager.getModule(SilentRotations.class)).getState()) Objects.requireNonNull(Launch.moduleManager.getModule(SilentRotations.class)).setState(true); if (!Objects.requireNonNull(Launch.moduleManager.getModule(BrandSpoofer.class)).getState()) @@ -133,14 +105,6 @@ public void onPacket(PacketEvent event) { preReceive = 0; packetCountTimer.reset(); } - - if (ProtocolFixer.newerThanOrEqualsTo1_10()) { - if (packet instanceof C08PacketPlayerBlockPlacement) { - ((C08PacketPlayerBlockPlacement) packet).facingX = 0.5F; - ((C08PacketPlayerBlockPlacement) packet).facingY = 0.5F; - ((C08PacketPlayerBlockPlacement) packet).facingZ = 0.5F; - } - } } @Override diff --git a/src/main/java/net/aspw/client/features/module/impl/combat/KillAura.kt b/src/main/java/net/aspw/client/features/module/impl/combat/KillAura.kt index b40a2bec..469b465e 100644 --- a/src/main/java/net/aspw/client/features/module/impl/combat/KillAura.kt +++ b/src/main/java/net/aspw/client/features/module/impl/combat/KillAura.kt @@ -13,7 +13,6 @@ import net.aspw.client.features.module.impl.player.LegitScaffold import net.aspw.client.features.module.impl.player.Scaffold import net.aspw.client.features.module.impl.targets.AntiBots import net.aspw.client.features.module.impl.targets.AntiTeams -import net.aspw.client.protocol.api.ProtocolFixer import net.aspw.client.utils.* import net.aspw.client.utils.extensions.getDistanceToEntityBox import net.aspw.client.utils.extensions.getNearestPointBB @@ -31,6 +30,7 @@ import net.minecraft.entity.EntityLivingBase import net.minecraft.entity.item.EntityArmorStand import net.minecraft.entity.player.EntityPlayer import net.minecraft.item.ItemSword +import net.minecraft.network.Packet import net.minecraft.network.play.client.* import net.minecraft.potion.Potion import net.minecraft.util.BlockPos @@ -38,6 +38,7 @@ import net.minecraft.util.EnumFacing import net.minecraft.util.EnumParticleTypes import net.minecraft.util.Vec3 import java.util.* +import java.util.concurrent.LinkedBlockingQueue import kotlin.math.cos import kotlin.math.max import kotlin.math.min @@ -142,12 +143,11 @@ class KillAura : Module() { 40 ) { !rotations.get().equals("none", true) } + private val newAttackValue = BoolValue("1.9+Attack", false) private val noInventoryAttackValue = BoolValue("NoInvAttack", false) private val wallCheckValue = BoolValue("WallCheck", false) private val checkSprintValue = BoolValue("StopSprint", false) private val antiBlinkValue = BoolValue("AntiBlink", false) - private val multiCombo = BoolValue("MultiCombo", false) - private val amountValue = IntegerValue("Multi-Packet", 5, 0, 20, "x") { multiCombo.get() } private val noHitCheck = BoolValue( "NoHitCheck", @@ -159,17 +159,18 @@ class KillAura : Module() { arrayOf( "Health", "Distance", - "Direction", - "LivingTime", - "Armor", - "HurtResistance", - "HurtTime", - "HealthAbsorption", - "RegenAmplifier" + "Adaptive", + "Switch" ), "Distance" ) - private val targetModeValue = ListValue("TargetMode", arrayOf("Single", "Switch", "Multi"), "Single") + + private val switchDelay = IntegerValue( + "Switch-Delay", + 400, + 0, + 1000 + ) { priorityValue.get().equals("Adaptive", true) || priorityValue.get().equals("Switch", true) } // Bypasses private val swingValue = ListValue("Swing", arrayOf("Full", "Smart", "Packet", "None"), "Full") @@ -189,6 +190,7 @@ class KillAura : Module() { arrayOf( "Vanilla", "ReBlock", + "Blink", "Perfect", "Fake", "None" @@ -199,19 +201,24 @@ class KillAura : Module() { private val reBlockDelayValue = IntegerValue("ReBlock-Delay", 10, 1, 100) { autoBlockModeValue.get().equals("reblock", true) } - private val interactAutoBlockValue = BoolValue( - "InteractAutoBlock", - false - ) { - !autoBlockModeValue.get().equals("Fake", true) && !autoBlockModeValue.get() - .equals("None", true) + private val blinkDelay = IntegerValue( + "Blink-Delay", + 5, + 2, + 10 + ) { autoBlockModeValue.get().equals("Blink", true) } + + private val interactAutoBlockValue = BoolValue("InteractAutoBlock", false) { + !autoBlockModeValue.get().equals("Fake", true) && !autoBlockModeValue.get().equals("None", true) + } + + private val swapUnblockValue = BoolValue("SwapUnblock", false) { + autoBlockModeValue.get().equals("Blink", true) } private val fovValue = FloatValue("Fov", 180f, 0f, 180f) private val failRateValue = FloatValue("FailRate", 0f, 0f, 100f) - private val limitedMultiTargetsValue = - IntegerValue("LimitedMultiTargets", 6, 1, 20) { targetModeValue.get().equals("multi", true) } /** * MODULE @@ -227,14 +234,22 @@ class KillAura : Module() { private val reBlockTimer = TickTimer() private val attackTimer = MSTimer() private val endTimer = TickTimer() + private val switchTimer = MSTimer() + private val fakeTimer = MSTimer() private var failedHit = false private var attackDelay = 0L private var clicks = 0 + private var allowedClicks = 0 // Fake Block var blockingStatus = false var fakeBlock = false + /** + * BlinkAB + */ + private var blinkABPackets = LinkedBlockingQueue>() + /** * Enable kill aura module */ @@ -243,6 +258,8 @@ class KillAura : Module() { mc.theWorld ?: return updateTarget() + + allowedClicks = maxCPS.get() } /** @@ -264,10 +281,26 @@ class KillAura : Module() { */ @EventTarget fun onMotion(event: MotionEvent) { - if (event.eventState == EventState.POST) { - target ?: return - currentTarget ?: return + target ?: return + currentTarget ?: return + + if (event.eventState == EventState.PRE) { + if (autoBlockModeValue.get().equals("Blink", true)) { + // ClientUtils.displayChatMessage(reblockInstant.toString()) + if (mc.thePlayer.ticksExisted % blinkDelay.get() == 0) { + // ClientUtils.displayChatMessage(mc.thePlayer.ticksExisted.toString()) + if (blockingStatus) { + stopBlocking() + currentTarget = target + allowedClicks = maxCPS.get() + } + } else { + startBlocking(target!!, interactAutoBlockValue.get()) + } + } + } + if (event.eventState == EventState.POST) { // Update hitable updateHitable() @@ -312,13 +345,45 @@ class KillAura : Module() { // Target currentTarget = target - if (!targetModeValue.get().equals("Switch", ignoreCase = true) && isEnemy(currentTarget)) + if (!(priorityValue.get().equals("Switch", ignoreCase = true) || priorityValue.get() + .equals("Adaptive", true)) && isEnemy(currentTarget) + ) target = currentTarget } @EventTarget fun onPacket(event: PacketEvent) { val packet = event.packet + if (packet is C09PacketHeldItemChange && autoBlockModeValue.get().equals("Blink", true) && blockingStatus) { + fakeBlock = false + blockingStatus = false + currentTarget = null + + event.cancelEvent() + mc.netHandler.addToSendQueue( + C07PacketPlayerDigging( + C07PacketPlayerDigging.Action.RELEASE_USE_ITEM, + BlockPos.ORIGIN, + EnumFacing.DOWN + ) + ) + mc.netHandler.addToSendQueue(packet) + mc.netHandler.addToSendQueue( + C0BPacketEntityAction( + mc.thePlayer, + C0BPacketEntityAction.Action.START_SPRINTING + ) + ) + if (!mc.thePlayer.isSprinting) blinkABPackets.add( + C0BPacketEntityAction( + mc.thePlayer, + C0BPacketEntityAction.Action.STOP_SPRINTING + ) + ) + releasePackets() + return + } + if (autoBlockModeValue.get().equals("perfect", true)) { if (blockingStatus && ((packet is C07PacketPlayerDigging @@ -330,6 +395,13 @@ class KillAura : Module() { if (packet is C09PacketHeldItemChange) blockingStatus = false } + + if (!event.isCancelled && autoBlockModeValue.get() + .equals("blink", true) && blockingStatus && packet.javaClass.simpleName.startsWith("c", true) + ) { + event.cancelEvent() + blinkABPackets.add(packet) + } } /** @@ -408,7 +480,10 @@ class KillAura : Module() { if (currentTarget != null && attackTimer.hasTimePassed(attackDelay) && currentTarget!!.hurtTime <= 10 ) { + if (autoBlockModeValue.get().equals("Blink", true) && allowedClicks <= 0) return + clicks++ + allowedClicks-- attackTimer.reset() attackDelay = if (coolDownCheck.get()) TimeUtils.randomClickDelay(20, 20) @@ -416,32 +491,6 @@ class KillAura : Module() { } } - @EventTarget - fun onAttack(event: AttackEvent) { - if (multiCombo.get()) { - event.targetEntity ?: return - repeat(amountValue.get()) { - if (ProtocolFixer.newerThan1_8()) - mc.netHandler.addToSendQueue( - C02PacketUseEntity( - event.targetEntity, - C02PacketUseEntity.Action.ATTACK - ) - ) - - mc.netHandler.addToSendQueue(C0APacketAnimation()) - - if (!ProtocolFixer.newerThan1_8()) - mc.netHandler.addToSendQueue( - C02PacketUseEntity( - event.targetEntity, - C02PacketUseEntity.Action.ATTACK - ) - ) - } - } - } - /** * Handle entity move */ @@ -464,7 +513,6 @@ class KillAura : Module() { // Settings val failRate = failRateValue.get() - val multi = targetModeValue.get().equals("Multi", ignoreCase = true) val failHit = failRate > 0 && Random().nextInt(100) <= failRate // Check is not hitable or check failrate @@ -472,48 +520,33 @@ class KillAura : Module() { if (failHit) failedHit = true } else { - if (!multi) { - attackEntity(currentTarget!!) - } else { - var targets = 0 - - for (entity in mc.theWorld.loadedEntityList) { - val distance = mc.thePlayer.getDistanceToEntityBox(entity) - - if (entity is EntityLivingBase && isEnemy(entity) && distance <= rangeValue.get()) { - attackEntity(entity) - - targets += 1 - - if (limitedMultiTargetsValue.get() != 0 && limitedMultiTargetsValue.get() <= targets) - break - } - } - } - - prevTargetEntities.add(currentTarget!!.entityId) + attackEntity(currentTarget!!) if (target == currentTarget) target = null + + if (switchTimer.hasTimePassed(switchDelay.get().toLong())) { + prevTargetEntities.add(currentTarget!!.entityId) + switchTimer.reset() + } } } /** * Update current target */ - private fun updateTarget() { + private fun updateTarget(switchMode: Boolean = priorityValue.get().equals("Switch", true)) { // Reset fixed target to null // Settings val hurtTime = 10 val fov = fovValue.get() - val switchMode = targetModeValue.get().equals("Switch", ignoreCase = true) // Find possible targets val targets = mutableListOf() for (entity in mc.theWorld.loadedEntityList) { - if (entity !is EntityLivingBase || !isEnemy(entity) || (switchMode && prevTargetEntities.contains(entity.entityId))/* || (!focusEntityName.isEmpty() && !focusEntityName.contains(entity.name.toLowerCase()))*/) + if (entity !is EntityLivingBase || !isEnemy(entity)/* || (!focusEntityName.isEmpty() && !focusEntityName.contains(entity.name.toLowerCase()))*/) continue val distance = mc.thePlayer.getDistanceToEntityBox(entity) @@ -523,20 +556,24 @@ class KillAura : Module() { targets.add(entity) } + if (targets.isNotEmpty() && targets.any { mc.thePlayer.getDistanceToEntityBox(it) <= attackRangeValue.get() }) { + targets.retainAll { mc.thePlayer.getDistanceToEntityBox(it) <= attackRangeValue.get() } + } + + if (switchMode) targets.retainAll { !prevTargetEntities.contains(it.entityId) } + // Sort targets by priority when (priorityValue.get().lowercase(Locale.getDefault())) { - "distance" -> targets.sortBy { mc.thePlayer.getDistanceToEntityBox(it) } // Sort by distance + "distance", "switch" -> { + targets.sortBy { mc.thePlayer.getDistanceToEntityBox(it) } + } // Sort by distance "health" -> targets.sortBy { it.health } // Sort by health - "direction" -> targets.sortBy { RotationUtils.getRotationDifference(it) } // Sort by FOV - "livingtime" -> targets.sortBy { -it.ticksExisted } // Sort by existence - "hurtresistance" -> targets.sortBy { it.hurtResistantTime } // Sort by armor hurt time - "hurttime" -> targets.sortBy { it.hurtTime } // Sort by hurt time - "healthabsorption" -> targets.sortBy { it.health + it.absorptionAmount } // Sort by full health with absorption effect - "regenamplifier" -> targets.sortBy { - if (it.isPotionActive(Potion.regeneration)) it.getActivePotionEffect( - Potion.regeneration - ).amplifier else -1 - } + "adaptive" -> { + targets.sortBy { it.health } + if (targets.isNotEmpty() && targets[0].health > 5 && !switchMode) { + return updateTarget(true) + } + } // Sort by health } var found = false @@ -558,7 +595,7 @@ class KillAura : Module() { if (prevTargetEntities.isNotEmpty()) { prevTargetEntities.clear() - updateTarget() + updateTarget(switchMode) } } @@ -617,7 +654,7 @@ class KillAura : Module() { } // Attack target - if (ProtocolFixer.newerThan1_8()) + if (newAttackValue.get()) mc.netHandler.addToSendQueue(C02PacketUseEntity(entity, C02PacketUseEntity.Action.ATTACK)) when (swingValue.get().lowercase(Locale.getDefault())) { @@ -631,7 +668,7 @@ class KillAura : Module() { "packet" -> mc.netHandler.addToSendQueue(C0APacketAnimation()) } - if (!ProtocolFixer.newerThan1_8()) + if (!newAttackValue.get()) mc.netHandler.addToSendQueue(C02PacketUseEntity(entity, C02PacketUseEntity.Action.ATTACK)) when (particleValue.get().lowercase()) { @@ -694,9 +731,9 @@ class KillAura : Module() { RotationUtils.OtherRotation( boundingBox, RotationUtils.getCenter(entity.entityBoundingBox), - false, - true, - maxRange + predict = false, + throughWalls = true, + distance = maxRange ), (Math.random() * (maxTurnSpeed.get() - minTurnSpeed.get()) + minTurnSpeed.get()).toFloat() ) } @@ -787,6 +824,11 @@ class KillAura : Module() { blockingStatus = true } + "blink" -> { + mc.netHandler.addToSendQueue(C08PacketPlayerBlockPlacement(mc.thePlayer.inventory.getCurrentItem())) + blockingStatus = true + } + "fake" -> { fakeBlock = true } @@ -801,15 +843,45 @@ class KillAura : Module() { * Stop blocking */ private fun stopBlocking() { +// if (autoBlockModeValue.get().equals("Blink", true) && !blinkABPackets.any { it is C03PacketPlayer } && currentTarget != null) { +// return +// } fakeBlock = false blockingStatus = false currentTarget = null if (endTimer.hasTimePassed(1)) { if (canBlock || mc.thePlayer.isBlocking) { - if (!autoBlockModeValue.get().equals("fake", true) && !autoBlockModeValue.get() + if (autoBlockModeValue.get().equals("Blink", true)) { + if (swapUnblockValue.get()) { + mc.netHandler.addToSendQueue(C09PacketHeldItemChange(mc.thePlayer.inventory.currentItem % 8 + 1)) + mc.netHandler.addToSendQueue(C09PacketHeldItemChange(mc.thePlayer.inventory.currentItem)) + } else { + mc.netHandler.addToSendQueue( + C07PacketPlayerDigging( + C07PacketPlayerDigging.Action.RELEASE_USE_ITEM, + BlockPos.ORIGIN, + EnumFacing.DOWN + ) + ) + } + mc.netHandler.addToSendQueue( + C0BPacketEntityAction( + mc.thePlayer, + C0BPacketEntityAction.Action.START_SPRINTING + ) + ) + if (!mc.thePlayer.isSprinting) blinkABPackets.add( + C0BPacketEntityAction( + mc.thePlayer, + C0BPacketEntityAction.Action.STOP_SPRINTING + ) + ) + releasePackets() + // ClientUtils.displayChatMessage("tard " + mc.thePlayer.ticksExisted) + } else if (!autoBlockModeValue.get().equals("fake", true) && !autoBlockModeValue.get() .equals("none", true) ) { - PacketUtils.sendPacketNoEvent( + mc.netHandler.addToSendQueue( C07PacketPlayerDigging( C07PacketPlayerDigging.Action.RELEASE_USE_ITEM, BlockPos.ORIGIN, @@ -822,6 +894,12 @@ class KillAura : Module() { } } + private fun releasePackets() { + while (blinkABPackets.isNotEmpty()) { + mc.netHandler.networkManager.sendPacket(blinkABPackets.take()) + } + } + /** * Check if run should be cancelled */ @@ -857,5 +935,5 @@ class KillAura : Module() { * HUD Tag */ override val tag: String - get() = targetModeValue.get() + get() = priorityValue.get() } \ No newline at end of file diff --git a/src/main/java/net/aspw/client/features/module/impl/combat/TPAura.kt b/src/main/java/net/aspw/client/features/module/impl/combat/TPAura.kt index ffc0e91b..c90ada80 100644 --- a/src/main/java/net/aspw/client/features/module/impl/combat/TPAura.kt +++ b/src/main/java/net/aspw/client/features/module/impl/combat/TPAura.kt @@ -6,7 +6,6 @@ import net.aspw.client.event.WorldEvent import net.aspw.client.features.module.Module import net.aspw.client.features.module.ModuleCategory import net.aspw.client.features.module.ModuleInfo -import net.aspw.client.protocol.api.ProtocolFixer import net.aspw.client.utils.EntityUtils import net.aspw.client.utils.PacketUtils import net.aspw.client.utils.RotationUtils @@ -37,6 +36,7 @@ class TPAura : Module() { private val rangeValue = IntegerValue("Range", 30, 10, 70, "m") private val fovValue = FloatValue("Fov", 180F, 0F, 180F, "°") private val swingValue = ListValue("Swing", arrayOf("Normal", "Packet", "None"), "Normal") + private val newAttackValue = BoolValue("1.9+Attack", false) private val rotationValue = BoolValue("Rotations", true) private val autoBlock = BoolValue("AutoBlock", true) @@ -133,7 +133,7 @@ class TPAura : Module() { lastTarget = it - if (ProtocolFixer.newerThan1_8()) + if (newAttackValue.get()) mc.netHandler.addToSendQueue(C02PacketUseEntity(it, C02PacketUseEntity.Action.ATTACK)) when (swingValue.get().lowercase(Locale.getDefault())) { @@ -141,7 +141,7 @@ class TPAura : Module() { "packet" -> mc.netHandler.addToSendQueue(C0APacketAnimation()) } - if (!ProtocolFixer.newerThan1_8()) + if (!newAttackValue.get()) mc.netHandler.addToSendQueue(C02PacketUseEntity(it, C02PacketUseEntity.Action.ATTACK)) path.reverse() diff --git a/src/main/java/net/aspw/client/features/module/impl/movement/Flight.kt b/src/main/java/net/aspw/client/features/module/impl/movement/Flight.kt index 538f3d1d..dfd84223 100644 --- a/src/main/java/net/aspw/client/features/module/impl/movement/Flight.kt +++ b/src/main/java/net/aspw/client/features/module/impl/movement/Flight.kt @@ -223,7 +223,6 @@ class Flight : Module() { private val lagCheck = BoolValue("LagCheck", false) private val worldCheck = BoolValue("WorldCheck", true) private val fakeDmgValue = BoolValue("FakeDamage", false) - val fakeYValue = BoolValue("FakeY", false) private val viewBobbingValue = BoolValue("ViewBobbing", false) private val bobbingAmountValue = FloatValue("BobbingAmount", 0.1f, 0f, 0.1f) { viewBobbingValue.get() } private val sprintTimerBoostValue = BoolValue("SprintKey-TimerBoost", false) @@ -1323,8 +1322,6 @@ class Flight : Module() { if (mc.thePlayer == null) return if (MovementUtils.isMoving() && viewBobbingValue.get()) mc.thePlayer.cameraYaw = bobbingAmountValue.get() - if (fakeYValue.get()) - mc.thePlayer.cameraPitch = 0f when (modeValue.get().lowercase()) { "verussmooth" -> { mc.thePlayer.cameraPitch = 0f diff --git a/src/main/java/net/aspw/client/features/module/impl/movement/LongJump.kt b/src/main/java/net/aspw/client/features/module/impl/movement/LongJump.kt index 108588f2..d62c3f68 100644 --- a/src/main/java/net/aspw/client/features/module/impl/movement/LongJump.kt +++ b/src/main/java/net/aspw/client/features/module/impl/movement/LongJump.kt @@ -93,7 +93,6 @@ class LongJump : Module() { private val worldCheck = BoolValue("WorldCheck", true) private val autoDisableValue = BoolValue("AutoDisable", true) private val fakeDmgValue = BoolValue("FakeDamage", false) - val fakeYValue = BoolValue("FakeY", false) private val viewBobbingValue = BoolValue("ViewBobbing", false) private val bobbingAmountValue = FloatValue("BobbingAmount", 0.1f, 0f, 0.1f) { viewBobbingValue.get() } private val dmgTimer = MSTimer() @@ -126,8 +125,6 @@ class LongJump : Module() { } if (MovementUtils.isMoving() && viewBobbingValue.get()) mc.thePlayer.cameraYaw = bobbingAmountValue.get() - if (fakeYValue.get()) - mc.thePlayer.cameraPitch = 0f } override fun onEnable() { diff --git a/src/main/java/net/aspw/client/features/module/impl/movement/Speed.kt b/src/main/java/net/aspw/client/features/module/impl/movement/Speed.kt index e625cbb1..e562796e 100644 --- a/src/main/java/net/aspw/client/features/module/impl/movement/Speed.kt +++ b/src/main/java/net/aspw/client/features/module/impl/movement/Speed.kt @@ -139,8 +139,6 @@ class Speed : Module() { mc.thePlayer.cameraPitch = 0f mc.thePlayer.cameraYaw = 0f } - if (fakeYValue.get()) - mc.thePlayer.cameraPitch = 0f if (mc.thePlayer.isSneaking || event.eventState !== EventState.PRE) return val speedMode = mode if (speedMode != null) { @@ -438,5 +436,4 @@ class Speed : Module() { @JvmField val noBob = BoolValue("NoBob", false) - val fakeYValue = BoolValue("FakeY", false) } \ No newline at end of file diff --git a/src/main/java/net/aspw/client/features/module/impl/player/BowJump.kt b/src/main/java/net/aspw/client/features/module/impl/player/BowJump.kt index 49941ed0..135075d8 100644 --- a/src/main/java/net/aspw/client/features/module/impl/player/BowJump.kt +++ b/src/main/java/net/aspw/client/features/module/impl/player/BowJump.kt @@ -30,7 +30,6 @@ class BowJump : Module() { private val timerValue = FloatValue("Timer", 1f, 0.1f, 10f, "x") private val delayBeforeLaunch = IntegerValue("DelayBeforeArrowLaunch", 1, 1, 20, " tick") private val autoDisable = BoolValue("AutoDisable", true) - val fakeYValue = BoolValue("FakeY", false) private val viewBobbingValue = BoolValue("ViewBobbing", false) private val bobbingAmountValue = FloatValue("BobbingAmount", 0.1f, 0f, 0.1f) { viewBobbingValue.get() } private val renderValue = BoolValue("RenderStatus", false) @@ -51,8 +50,6 @@ class BowJump : Module() { fun onMotion(event: MotionEvent?) { if (MovementUtils.isMoving() && viewBobbingValue.get()) mc.thePlayer.cameraYaw = bobbingAmountValue.get() - if (fakeYValue.get()) - mc.thePlayer.cameraPitch = 0f } @EventTarget diff --git a/src/main/java/net/aspw/client/features/module/impl/visual/Cape.kt b/src/main/java/net/aspw/client/features/module/impl/visual/Cape.kt index 9be3ecb5..a4f762f3 100644 --- a/src/main/java/net/aspw/client/features/module/impl/visual/Cape.kt +++ b/src/main/java/net/aspw/client/features/module/impl/visual/Cape.kt @@ -29,10 +29,10 @@ class Cape : Module() { val animationModeValue = ListValue( "Animation-Mode", arrayOf( - "Vanilla", + "Normal", "Smooth" ), - "Vanilla" + "Smooth" ) private val capeCache = hashMapOf() diff --git a/src/main/java/net/aspw/client/features/module/impl/visual/Interface.kt b/src/main/java/net/aspw/client/features/module/impl/visual/Interface.kt index d2d2a603..7585e55b 100644 --- a/src/main/java/net/aspw/client/features/module/impl/visual/Interface.kt +++ b/src/main/java/net/aspw/client/features/module/impl/visual/Interface.kt @@ -11,7 +11,6 @@ import net.aspw.client.features.module.ModuleInfo import net.aspw.client.features.module.impl.combat.KillAura import net.aspw.client.features.module.impl.combat.KillAuraRecode import net.aspw.client.features.module.impl.combat.TPAura -import net.aspw.client.protocol.ProtocolBase import net.aspw.client.utils.APIConnecter import net.aspw.client.utils.AnimationUtils import net.aspw.client.utils.render.RenderUtils @@ -49,7 +48,6 @@ class Interface : Module() { private val watermarkValue = BoolValue("WaterMark", true) private val clientNameValue = TextValue("ClientName", "NightX") { watermarkValue.get() } private val watermarkFpsValue = BoolValue("WaterMark-ShowFPS", true) { watermarkValue.get() } - private val watermarkProtocolValue = BoolValue("WaterMark-ShowProtocol", true) { watermarkValue.get() } private val arrayListValue = BoolValue("ArrayList", true) private val arrayListSpeedValue = FloatValue("ArrayList-AnimationSpeed", 0.3F, 0F, 0.6F) { arrayListValue.get() } private val targetHudValue = BoolValue("TargetHud", true) @@ -89,15 +87,13 @@ class Interface : Module() { val inputString = clientNameValue.get() val connectChecks = if (!APIConnecter.canConnect) " - Disconnected" else "" val fpsChecks = if (watermarkFpsValue.get()) " [" + Minecraft.getDebugFPS() + " FPS]" else "" - val protocolChecks = - if (watermarkProtocolValue.get()) " [version: " + (if (!mc.isIntegratedServerRunning) ProtocolBase.getManager().targetVersion.getName() else "1.8.x") + "]" else "" var firstChar = "" var restOfString = "" if (inputString != "") { firstChar = inputString[0].toString() restOfString = inputString.substring(1) } - val showName = "$firstChar§r§f$restOfString$fpsChecks$protocolChecks$connectChecks" + val showName = "$firstChar§r§f$restOfString$fpsChecks$connectChecks" fontRenderer.drawStringWithShadow( showName, 2.0, diff --git a/src/main/java/net/aspw/client/features/module/impl/visual/SilentRotations.kt b/src/main/java/net/aspw/client/features/module/impl/visual/SilentRotations.kt index 4622a78c..755686f0 100644 --- a/src/main/java/net/aspw/client/features/module/impl/visual/SilentRotations.kt +++ b/src/main/java/net/aspw/client/features/module/impl/visual/SilentRotations.kt @@ -84,6 +84,8 @@ class SilentRotations : Module() { RotationUtils.enableLook() mc.thePlayer.rotationYaw = RotationUtils.targetRotation?.yaw!! + mc.thePlayer.rotationYawHead = mc.thePlayer.rotationYaw + mc.thePlayer.renderYawOffset = mc.thePlayer.rotationYaw mc.thePlayer.rotationPitch = RotationUtils.targetRotation?.pitch!! } } \ No newline at end of file diff --git a/src/main/java/net/aspw/client/injection/access/IItemStack.java b/src/main/java/net/aspw/client/injection/access/IItemStack.java index 938d5fd6..1902e521 100644 --- a/src/main/java/net/aspw/client/injection/access/IItemStack.java +++ b/src/main/java/net/aspw/client/injection/access/IItemStack.java @@ -1,13 +1,5 @@ package net.aspw.client.injection.access; -/** - * The interface Item stack. - */ public interface IItemStack { - /** - * Gets item delay. - * - * @return the item delay - */ long getItemDelay(); } \ No newline at end of file diff --git a/src/main/java/net/aspw/client/injection/access/IMixinGuiSlot.java b/src/main/java/net/aspw/client/injection/access/IMixinGuiSlot.java index 1c900bcd..5927c45f 100644 --- a/src/main/java/net/aspw/client/injection/access/IMixinGuiSlot.java +++ b/src/main/java/net/aspw/client/injection/access/IMixinGuiSlot.java @@ -1,22 +1,5 @@ package net.aspw.client.injection.access; -/** - * The interface Mixin gui slot. - */ public interface IMixinGuiSlot { - - /** - * Sets list width. - * - * @param listWidth the list width - */ void setListWidth(int listWidth); - - /** - * Sets enable scissor. - * - * @param b the b - */ - void setEnableScissor(boolean b); - } \ No newline at end of file diff --git a/src/main/java/net/aspw/client/injection/forge/mixins/accessors/MinecraftForgeClientAccessor.java b/src/main/java/net/aspw/client/injection/forge/mixins/accessors/MinecraftForgeClientAccessor.java index 731a3b81..443d2ed5 100644 --- a/src/main/java/net/aspw/client/injection/forge/mixins/accessors/MinecraftForgeClientAccessor.java +++ b/src/main/java/net/aspw/client/injection/forge/mixins/accessors/MinecraftForgeClientAccessor.java @@ -9,19 +9,11 @@ import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.gen.Accessor; -/** - * The interface Minecraft forge client accessor. - */ @Mixin(MinecraftForgeClient.class) public interface MinecraftForgeClientAccessor { - /** - * Gets region cache. - * - * @return the region cache - */ @SuppressWarnings("UnstableApiUsage") @Accessor(remap = false) static LoadingCache, RegionRenderCache> getRegionCache() { throw new AssertionError(); } -} +} \ No newline at end of file diff --git a/src/main/java/net/aspw/client/injection/forge/mixins/block/MixinBlock.java b/src/main/java/net/aspw/client/injection/forge/mixins/block/MixinBlock.java index a0bd1b4c..ead156ed 100644 --- a/src/main/java/net/aspw/client/injection/forge/mixins/block/MixinBlock.java +++ b/src/main/java/net/aspw/client/injection/forge/mixins/block/MixinBlock.java @@ -27,76 +27,24 @@ import java.util.List; import java.util.Objects; -/** - * The type Mixin block. - */ @Mixin(Block.class) public abstract class MixinBlock { - /** - * The Block state. - */ @Shadow @Final protected BlockState blockState; - /** - * Gets collision bounding box. - * - * @param worldIn the world in - * @param pos the pos - * @param state the state - * @return the collision bounding box - */ @Shadow public abstract AxisAlignedBB getCollisionBoundingBox(World worldIn, BlockPos pos, IBlockState state); - /** - * Sets block bounds. - * - * @param minX the min x - * @param minY the min y - * @param minZ the min z - * @param maxX the max x - * @param maxY the max y - * @param maxZ the max z - */ - @Shadow - public abstract void setBlockBounds(float minX, float minY, float minZ, float maxX, float maxY, float maxZ); - - /** - * On block placed block state. - * - * @param worldIn the world in - * @param pos the pos - * @param facing the facing - * @param hitX the hit x - * @param hitY the hit y - * @param hitZ the hit z - * @param meta the meta - * @param placer the placer - * @return the block state - */ -// Has to be implemented since a non-virtual call on an abstract method is illegal @Shadow public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) { return null; } - @Shadow - private IBlockState defaultBlockState; - /** - * Add collision boxes to list. - * - * @param worldIn the world in - * @param pos the pos - * @param state the state - * @param mask the mask - * @param list the list - * @param collidingEntity the colliding entity * @author As_pw - * @reason XRay + * @reason Modified Break Speed */ @Overwrite public void addCollisionBoxesToList(World worldIn, BlockPos pos, IBlockState state, AxisAlignedBB mask, List list, Entity collidingEntity) { @@ -132,14 +80,6 @@ private void getAmbientOcclusionLightValue(final CallbackInfoReturnable f floatCallbackInfoReturnable.setReturnValue(1F); } - /** - * Modify break speed. - * - * @param playerIn the player in - * @param worldIn the world in - * @param pos the pos - * @param callbackInfo the callback info - */ @Inject(method = "getPlayerRelativeBlockHardness", at = @At("RETURN"), cancellable = true) public void modifyBreakSpeed(EntityPlayer playerIn, World worldIn, BlockPos pos, final CallbackInfoReturnable callbackInfo) { float f = callbackInfo.getReturnValue(); diff --git a/src/main/java/net/aspw/client/injection/forge/mixins/block/MixinBlockLadder.java b/src/main/java/net/aspw/client/injection/forge/mixins/block/MixinBlockLadder.java deleted file mode 100644 index a6db2ac9..00000000 --- a/src/main/java/net/aspw/client/injection/forge/mixins/block/MixinBlockLadder.java +++ /dev/null @@ -1,21 +0,0 @@ -package net.aspw.client.injection.forge.mixins.block; - -import net.aspw.client.protocol.api.ProtocolFixer; -import net.minecraft.block.BlockLadder; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.Constant; -import org.spongepowered.asm.mixin.injection.ModifyConstant; - -/** - * The type Mixin block ladder. - */ -@Mixin(BlockLadder.class) -public abstract class MixinBlockLadder extends MixinBlock { - - @ModifyConstant(method = "setBlockBoundsBasedOnState", constant = @Constant(floatValue = 0.125F)) - private float ViaVersion_LadderBB(float constant) { - if (ProtocolFixer.newerThan1_8()) - return 0.1875F; - return 0.125F; - } -} \ No newline at end of file diff --git a/src/main/java/net/aspw/client/injection/forge/mixins/block/MixinBlockLilyPad.java b/src/main/java/net/aspw/client/injection/forge/mixins/block/MixinBlockLilyPad.java deleted file mode 100644 index a3f70c01..00000000 --- a/src/main/java/net/aspw/client/injection/forge/mixins/block/MixinBlockLilyPad.java +++ /dev/null @@ -1,29 +0,0 @@ -package net.aspw.client.injection.forge.mixins.block; - -import net.aspw.client.protocol.api.ProtocolFixer; -import net.minecraft.block.BlockBush; -import net.minecraft.block.BlockLilyPad; -import net.minecraft.block.state.IBlockState; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.BlockPos; -import net.minecraft.world.World; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Overwrite; - -/** - * The type Mixin block lily pad. - */ -@Mixin(BlockLilyPad.class) -public abstract class MixinBlockLilyPad extends BlockBush { - - /** - * @author As_pw - * @reason Via Fixer - */ - @Overwrite - public AxisAlignedBB getCollisionBoundingBox(World worldIn, BlockPos pos, IBlockState state) { - if (ProtocolFixer.newerThan1_8()) - return new AxisAlignedBB((double) pos.getX() + 0.0625D, (double) pos.getY() + 0.0D, (double) pos.getZ() + 0.0625D, (double) pos.getX() + 0.9375D, (double) pos.getY() + 0.09375D, (double) pos.getZ() + 0.9375D); - return new AxisAlignedBB((double) pos.getX() + 0.0D, (double) pos.getY() + 0.0D, (double) pos.getZ() + 0.0D, (double) pos.getX() + 1.0D, (double) pos.getY() + 0.015625D, (double) pos.getZ() + 1.0D); - } -} \ No newline at end of file diff --git a/src/main/java/net/aspw/client/injection/forge/mixins/block/MixinBlockLiquid.java b/src/main/java/net/aspw/client/injection/forge/mixins/block/MixinBlockLiquid.java index 0d7d935c..e2995bb5 100644 --- a/src/main/java/net/aspw/client/injection/forge/mixins/block/MixinBlockLiquid.java +++ b/src/main/java/net/aspw/client/injection/forge/mixins/block/MixinBlockLiquid.java @@ -12,9 +12,6 @@ import java.util.Objects; -/** - * The type Mixin block liquid. - */ @Mixin(BlockLiquid.class) public class MixinBlockLiquid { diff --git a/src/main/java/net/aspw/client/injection/forge/mixins/block/MixinBlockModelRenderer.java b/src/main/java/net/aspw/client/injection/forge/mixins/block/MixinBlockModelRenderer.java index 42332b2f..dcd830b1 100644 --- a/src/main/java/net/aspw/client/injection/forge/mixins/block/MixinBlockModelRenderer.java +++ b/src/main/java/net/aspw/client/injection/forge/mixins/block/MixinBlockModelRenderer.java @@ -15,9 +15,6 @@ import java.util.Objects; -/** - * The type Mixin block model renderer. - */ @Mixin(BlockModelRenderer.class) public class MixinBlockModelRenderer { diff --git a/src/main/java/net/aspw/client/injection/forge/mixins/block/MixinBlockSoulSand.java b/src/main/java/net/aspw/client/injection/forge/mixins/block/MixinBlockSoulSand.java index de8e652a..a3bbe936 100644 --- a/src/main/java/net/aspw/client/injection/forge/mixins/block/MixinBlockSoulSand.java +++ b/src/main/java/net/aspw/client/injection/forge/mixins/block/MixinBlockSoulSand.java @@ -10,9 +10,6 @@ import java.util.Objects; -/** - * The type Mixin block soul sand. - */ @Mixin(BlockSoulSand.class) public class MixinBlockSoulSand { diff --git a/src/main/java/net/aspw/client/injection/forge/mixins/block/MixinWorld.java b/src/main/java/net/aspw/client/injection/forge/mixins/block/MixinWorld.java deleted file mode 100644 index 82eed8ba..00000000 --- a/src/main/java/net/aspw/client/injection/forge/mixins/block/MixinWorld.java +++ /dev/null @@ -1,38 +0,0 @@ -package net.aspw.client.injection.forge.mixins.block; - -import net.aspw.client.utils.MinecraftInstance; -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.block.state.IBlockState; -import net.minecraft.init.Blocks; -import net.minecraft.util.BlockPos; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Overwrite; - -@Mixin(World.class) -public abstract class MixinWorld implements IBlockAccess { - - /** - * @author As_pw - * @reason Fix Destroy Sounds - */ - @Overwrite - public boolean destroyBlock(BlockPos pos, boolean dropBlock) { - IBlockState iblockstate = MinecraftInstance.mc.theWorld.getBlockState(pos); - Block block = iblockstate.getBlock(); - - MinecraftInstance.mc.theWorld.playAuxSFX(2001, pos, Block.getStateId(iblockstate)); - - if (block.getMaterial() == Material.air) { - return false; - } else { - if (dropBlock) { - block.dropBlockAsItem(MinecraftInstance.mc.theWorld, pos, iblockstate, 0); - } - - return MinecraftInstance.mc.theWorld.setBlockState(pos, Blocks.air.getDefaultState(), 3); - } - } -} \ No newline at end of file diff --git a/src/main/java/net/aspw/client/injection/forge/mixins/client/MixinGameSettings.java b/src/main/java/net/aspw/client/injection/forge/mixins/client/MixinGameSettings.java index 253118a4..f74873f9 100644 --- a/src/main/java/net/aspw/client/injection/forge/mixins/client/MixinGameSettings.java +++ b/src/main/java/net/aspw/client/injection/forge/mixins/client/MixinGameSettings.java @@ -7,18 +7,12 @@ import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Overwrite; -/** - * The type Mixin game settings. - */ @Mixin(GameSettings.class) public class MixinGameSettings { + /** - * Is key down boolean. - * - * @param key the key - * @return the boolean * @author As_pw - * @reason Game Settings + * @reason Get Keybinding */ @Overwrite public static boolean isKeyDown(KeyBinding key) { @@ -29,4 +23,4 @@ public static boolean isKeyDown(KeyBinding key) { return false; } } -} +} \ No newline at end of file diff --git a/src/main/java/net/aspw/client/injection/forge/mixins/client/MixinMinecraft.java b/src/main/java/net/aspw/client/injection/forge/mixins/client/MixinMinecraft.java index 2b34043e..23a0d016 100644 --- a/src/main/java/net/aspw/client/injection/forge/mixins/client/MixinMinecraft.java +++ b/src/main/java/net/aspw/client/injection/forge/mixins/client/MixinMinecraft.java @@ -4,7 +4,6 @@ import net.aspw.client.event.*; import net.aspw.client.features.module.impl.other.FastPlace; import net.aspw.client.injection.forge.mixins.accessors.MinecraftForgeClientAccessor; -import net.aspw.client.protocol.api.ProtocolFixer; import net.aspw.client.utils.CPSCounter; import net.aspw.client.utils.MinecraftInstance; import net.aspw.client.utils.render.RenderUtils; @@ -23,7 +22,6 @@ import net.minecraft.client.settings.GameSettings; import net.minecraft.client.stream.IStream; import net.minecraft.entity.Entity; -import net.minecraft.util.BlockPos; import net.minecraft.util.MovingObjectPosition; import net.minecraftforge.client.MinecraftForgeClient; import org.apache.commons.lang3.SystemUtils; @@ -31,9 +29,11 @@ import org.lwjgl.opengl.Display; import org.objectweb.asm.Opcodes; import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Overwrite; import org.spongepowered.asm.mixin.Shadow; -import org.spongepowered.asm.mixin.injection.*; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.ModifyArg; +import org.spongepowered.asm.mixin.injection.Redirect; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import java.util.Objects; @@ -52,8 +52,6 @@ public abstract class MixinMinecraft { @Shadow public EntityPlayerSP thePlayer; @Shadow - public EffectRenderer effectRenderer; - @Shadow public EntityRenderer entityRenderer; @Shadow public PlayerControllerMP playerController; @@ -66,19 +64,11 @@ public abstract class MixinMinecraft { @Shadow public GameSettings gameSettings; @Shadow - private Entity renderViewEntity; - @Shadow private boolean fullscreen; @Shadow public int leftClickCounter; private long lastFrame = Minecraft.getSystemTime(); - @Shadow - public abstract IResourceManager getResourceManager(); - - @Shadow - public abstract RenderManager getRenderManager(); - @Inject(method = "run", at = @At("HEAD")) private void init(CallbackInfo callbackInfo) { if (displayWidth < 1067) @@ -117,22 +107,6 @@ private void clearRenderCache(CallbackInfo ci) { MinecraftForgeClientAccessor.getRegionCache().cleanUp(); } - @Redirect( - method = "runGameLoop", - at = @At(value = "INVOKE", target = "Lnet/minecraft/client/stream/IStream;func_152935_j()V") - ) - private void skipTwitchCode1(IStream instance) { - // No-op - } - - @Redirect( - method = "runGameLoop", - at = @At(value = "INVOKE", target = "Lnet/minecraft/client/stream/IStream;func_152922_k()V") - ) - private void skipTwitchCode2(IStream instance) { - // No-op - } - @Inject(method = "displayGuiScreen", at = @At(value = "FIELD", target = "Lnet/minecraft/client/Minecraft;currentScreen:Lnet/minecraft/client/gui/GuiScreen;", shift = At.Shift.AFTER)) private void displayGuiScreen(CallbackInfo callbackInfo) { if (currentScreen instanceof net.minecraft.client.gui.GuiMainMenu || (currentScreen != null && currentScreen.getClass().getSimpleName().equals("ModGuiMainMenu"))) { @@ -178,50 +152,6 @@ private void shutdown(CallbackInfo callbackInfo) { Launch.INSTANCE.stopClient(); } - /** - * @author As_pw - * @reason Fix Attack Order - */ - @Overwrite - public void clickMouse() { - CPSCounter.registerClick(CPSCounter.MouseButton.LEFT); - if (this.leftClickCounter <= 0) { - if (this.objectMouseOver != null && Objects.requireNonNull(this.objectMouseOver.typeOfHit) != MovingObjectPosition.MovingObjectType.ENTITY) { - this.thePlayer.swingItem(); - } - - if (this.objectMouseOver != null) { - switch (this.objectMouseOver.typeOfHit) { - case ENTITY: - ProtocolFixer.sendFixedAttack(this.thePlayer, this.objectMouseOver.entityHit); - break; - - case BLOCK: - BlockPos blockpos = this.objectMouseOver.getBlockPos(); - - if (this.theWorld.getBlockState(blockpos).getBlock().getMaterial() != Material.air) { - this.playerController.clickBlock(blockpos, this.objectMouseOver.sideHit); - break; - } - - case MISS: - default: - if (this.playerController.isNotCreative()) { - this.leftClickCounter = 10; - } - } - } - } - } - - @Redirect( - method = "clickMouse", - at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/EntityLivingBase;swingItem()V") - ) - private void fixAttackOrder_VanillaSwing() { - ProtocolFixer.sendConditionalSwing(this.objectMouseOver); - } - @Inject(method = "middleClickMouse", at = @At("HEAD")) private void middleClickMouse(CallbackInfo ci) { CPSCounter.registerClick(CPSCounter.MouseButton.MIDDLE); @@ -254,38 +184,4 @@ private void resolveScreenState(CallbackInfo ci) { private char resolveForeignKeyboards() { return (char) (Keyboard.getEventCharacter() + 256); } - - /** - * @author As_pw - * @reason Fix ClickDelay - */ - @Overwrite - private void sendClickBlockToController(boolean leftClick) { - if (!leftClick) - this.leftClickCounter = 0; - - if (this.leftClickCounter <= 0) { - if (leftClick && this.objectMouseOver != null && this.objectMouseOver.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { - BlockPos blockPos = this.objectMouseOver.getBlockPos(); - - if (this.thePlayer.isUsingItem() && ProtocolFixer.newerThanOrEqualsTo1_8()) - return; - - if (this.leftClickCounter == 0) - Launch.eventManager.callEvent(new ClickBlockEvent(blockPos, this.objectMouseOver.sideHit)); - - if (this.theWorld.getBlockState(blockPos).getBlock().getMaterial() != Material.air && this.playerController.onPlayerDamageBlock(blockPos, this.objectMouseOver.sideHit)) { - this.effectRenderer.addBlockHitEffects(blockPos, this.objectMouseOver.sideHit); - this.thePlayer.swingItem(); - } - } else { - this.playerController.resetBlockRemoving(); - } - } - } - - @ModifyConstant(method = "getLimitFramerate", constant = @Constant(intValue = 30)) - public int getLimitFramerate(int constant) { - return 60; - } } \ No newline at end of file diff --git a/src/main/java/net/aspw/client/injection/forge/mixins/entity/MixinAbstractClientPlayer.java b/src/main/java/net/aspw/client/injection/forge/mixins/entity/MixinAbstractClientPlayer.java index 3d2ecbb7..ce02d230 100644 --- a/src/main/java/net/aspw/client/injection/forge/mixins/entity/MixinAbstractClientPlayer.java +++ b/src/main/java/net/aspw/client/injection/forge/mixins/entity/MixinAbstractClientPlayer.java @@ -14,15 +14,9 @@ import java.util.Objects; -/** - * The type Mixin abstract client player. - */ @Mixin(AbstractClientPlayer.class) public abstract class MixinAbstractClientPlayer extends MixinEntityPlayer { - @Shadow - public abstract ResourceLocation getLocationCape(); - @Inject(method = "getLocationCape", at = @At("HEAD"), cancellable = true) private void getCape(CallbackInfoReturnable callbackInfoReturnable) { final Cape cape = Objects.requireNonNull(Launch.moduleManager.getModule(Cape.class)); diff --git a/src/main/java/net/aspw/client/injection/forge/mixins/entity/MixinEntity.java b/src/main/java/net/aspw/client/injection/forge/mixins/entity/MixinEntity.java index 687b5ad6..8c399886 100644 --- a/src/main/java/net/aspw/client/injection/forge/mixins/entity/MixinEntity.java +++ b/src/main/java/net/aspw/client/injection/forge/mixins/entity/MixinEntity.java @@ -2,10 +2,7 @@ import net.aspw.client.Launch; import net.aspw.client.event.StrafeEvent; -import net.aspw.client.features.module.impl.combat.HitBox; import net.aspw.client.features.module.impl.movement.Flight; -import net.aspw.client.protocol.api.ProtocolFixer; -import net.aspw.client.utils.EntityUtils; import net.aspw.client.utils.MinecraftInstance; import net.minecraft.block.Block; import net.minecraft.block.material.Material; @@ -29,147 +26,57 @@ import java.util.Random; import java.util.UUID; -/** - * The type Mixin entity. - */ @Mixin(Entity.class) public abstract class MixinEntity implements ICommandSender { - /** - * The Pos x. - */ @Shadow public double posX; - - /** - * The Pos y. - */ @Shadow public double posY; - - /** - * The Pos z. - */ @Shadow public double posZ; - /** - * The Rotation pitch. - */ @Shadow public float rotationPitch; - /** - * The Rotation yaw. - */ @Shadow public float rotationYaw; - /** - * The Riding entity. - */ @Shadow public Entity ridingEntity; - /** - * The Motion x. - */ @Shadow public double motionX; - /** - * The Motion y. - */ @Shadow public double motionY; - /** - * The Motion z. - */ @Shadow public double motionZ; - /** - * The On ground. - */ @Shadow public boolean onGround; - /** - * The Is air borne. - */ @Shadow public boolean isAirBorne; - /** - * The No clip. - */ @Shadow public boolean noClip; - /** - * The World obj. - */ @Shadow public World worldObj; - /** - * The Is in web. - */ @Shadow public boolean isInWeb; - /** - * The Step height. - */ @Shadow public float stepHeight; - /** - * The Is collided horizontally. - */ @Shadow public boolean isCollidedHorizontally; - /** - * The Is collided vertically. - */ @Shadow public boolean isCollidedVertically; - /** - * The Is collided. - */ @Shadow public boolean isCollided; - /** - * The Distance walked modified. - */ @Shadow public float distanceWalkedModified; - /** - * The Distance walked on step modified. - */ @Shadow public float distanceWalkedOnStepModified; - /** - * The Fire resistance. - */ @Shadow public int fireResistance; - /** - * The Time until portal. - */ @Shadow public int timeUntilPortal; - /** - * The Width. - */ @Shadow public float width; - /** - * The Prev rotation pitch. - */ - @Shadow - public float prevRotationPitch; - /** - * The Prev rotation yaw. - */ - @Shadow - public float prevRotationYaw; - /** - * The Rand. - */ @Shadow protected Random rand; - /** - * The In portal. - */ @Shadow protected boolean inPortal; @Shadow @@ -179,203 +86,73 @@ public abstract class MixinEntity implements ICommandSender { @Shadow(remap = false) private CapabilityDispatcher capabilities; - /** - * Is sprinting boolean. - * - * @return the boolean - */ @Shadow public abstract boolean isSprinting(); - /** - * Gets entity bounding box. - * - * @return the entity bounding box - */ @Shadow public abstract AxisAlignedBB getEntityBoundingBox(); - /** - * Sets entity bounding box. - * - * @param bb the bb - */ @Shadow public abstract void setEntityBoundingBox(AxisAlignedBB bb); - /** - * Gets distance to entity. - * - * @param entityIn the entity in - * @return the distance to entity - */ @Shadow public abstract float getDistanceToEntity(Entity entityIn); - /** - * Move entity. - * - * @param x the x - * @param y the y - * @param z the z - */ - @Shadow - public void moveEntity(double x, double y, double z) { - } - - /** - * Is in water boolean. - * - * @return the boolean - */ @Shadow public abstract boolean isInWater(); - /** - * Is riding boolean. - * - * @return the boolean - */ @Shadow public abstract boolean isRiding(); - /** - * Deal fire damage. - * - * @param amount the amount - */ @Shadow protected abstract void dealFireDamage(int amount); - /** - * Is wet boolean. - * - * @return the boolean - */ @Shadow public abstract boolean isWet(); - /** - * Add entity crash info. - * - * @param category the category - */ @Shadow public abstract void addEntityCrashInfo(CrashReportCategory category); - /** - * Do block collisions. - */ @Shadow protected abstract void doBlockCollisions(); - /** - * Play step sound. - * - * @param pos the pos - * @param blockIn the block in - */ @Shadow protected abstract void playStepSound(BlockPos pos, Block blockIn); - /** - * Gets vector for rotation. - * - * @param pitch the pitch - * @param yaw the yaw - * @return the vector for rotation - */ - @Shadow - protected abstract Vec3 getVectorForRotation(float pitch, float yaw); - - /** - * Gets unique id. - * - * @return the unique id - */ - @Shadow - public abstract UUID getUniqueID(); - - /** - * Is inside of material boolean. - * - * @param materialIn the material in - * @return the boolean - */ - @Shadow - public abstract boolean isInsideOfMaterial(Material materialIn); - - /** - * Gets next step distance. - * - * @return the next step distance - */ public int getNextStepDistance() { return nextStepDistance; } - /** - * Sets next step distance. - * - * @param nextStepDistance the next step distance - */ public void setNextStepDistance(int nextStepDistance) { this.nextStepDistance = nextStepDistance; } - /** - * Gets fire. - * - * @return the fire - */ public int getFire() { return fire; } - /** - * Sets fire. - * - * @param seconds the seconds - */ @Shadow public abstract void setFire(int seconds); - @Shadow - public abstract float getEyeHeight(); - - @Shadow - public abstract Vec3 getLook(float p_getLook_1_); - @Shadow protected abstract boolean getFlag(int p_getFlag_1_); - @Inject(method = "getCollisionBorderSize", at = @At("HEAD"), cancellable = true) - private void getCollisionBorderSize(final CallbackInfoReturnable callbackInfoReturnable) { - final HitBox hitBoxes = Objects.requireNonNull(Launch.moduleManager.getModule(HitBox.class)); - - if (hitBoxes.getState() && EntityUtils.isSelected(((Entity) ((Object) this)), true)) { - if (ProtocolFixer.newerThan1_8()) { - callbackInfoReturnable.setReturnValue(hitBoxes.getSizeValue().get()); - } else { - callbackInfoReturnable.setReturnValue(0.1F + hitBoxes.getSizeValue().get()); - } - } else if (ProtocolFixer.newerThan1_8()) { - callbackInfoReturnable.setReturnValue(0.0F); - } - } - /** * @author As_pw - * @reason Sneak + * @reason Sneaking Fix */ @Overwrite public boolean isSneaking() { return this.getFlag(1); } + @Shadow + public void moveEntity(double x, double y, double z) { + } + /** * @author As_pw - * @reason Event + * @reason Strafe Event */ @Overwrite public void moveFlying(float strafe, float forward, float friction) { @@ -421,13 +198,6 @@ private void isInWater(final CallbackInfoReturnable cir) { cir.setReturnValue(true); } - /** - * Always return true boolean. - * - * @param world the world - * @param pos the pos - * @return the boolean - */ @Redirect(method = "getBrightnessForRender", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/World;isBlockLoaded(Lnet/minecraft/util/BlockPos;)Z")) public boolean alwaysReturnTrue(World world, BlockPos pos) { return true; @@ -439,13 +209,8 @@ private void checkGroundState(CallbackInfo ci) { } /** - * Has capability boolean. - * - * @param capability the capability - * @param direction the direction - * @return the boolean * @author As_pw - * @reason Fix Capability + * @reason Fix Capabilities */ @Overwrite(remap = false) public boolean hasCapability(Capability capability, EnumFacing direction) { diff --git a/src/main/java/net/aspw/client/injection/forge/mixins/entity/MixinEntityLivingBase.java b/src/main/java/net/aspw/client/injection/forge/mixins/entity/MixinEntityLivingBase.java index a3eb48c8..23ae107b 100644 --- a/src/main/java/net/aspw/client/injection/forge/mixins/entity/MixinEntityLivingBase.java +++ b/src/main/java/net/aspw/client/injection/forge/mixins/entity/MixinEntityLivingBase.java @@ -6,7 +6,6 @@ import net.aspw.client.features.module.impl.movement.NoJumpDelay; import net.aspw.client.features.module.impl.visual.Animations; import net.aspw.client.features.module.impl.visual.VisualAbilities; -import net.aspw.client.protocol.api.ProtocolFixer; import net.minecraft.block.Block; import net.minecraft.client.entity.EntityPlayerSP; import net.minecraft.entity.EntityLivingBase; @@ -19,112 +18,47 @@ import org.spongepowered.asm.mixin.Overwrite; import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Constant; import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.ModifyConstant; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; import java.util.Objects; -/** - * The type Mixin entity living base. - */ @Mixin(EntityLivingBase.class) public abstract class MixinEntityLivingBase extends MixinEntity { - /** - * The Is jumping. - */ @Shadow protected boolean isJumping; - /** - * The Jump ticks. - */ @Shadow public int jumpTicks; - @Shadow public float moveStrafing; - @Shadow public float moveForward; - - /** - * Gets jump upwards motion. - * - * @return the jump upwards motion - */ @Shadow protected abstract float getJumpUpwardsMotion(); - - /** - * Gets active potion effect. - * - * @param potionIn the potion in - * @return the active potion effect - */ @Shadow public abstract PotionEffect getActivePotionEffect(Potion potionIn); - - /** - * Is potion active boolean. - * - * @param potionIn the potion in - * @return the boolean - */ @Shadow public abstract boolean isPotionActive(Potion potionIn); - - /** - * On living update. - */ @Shadow public void onLivingUpdate() { } - - /** - * Update fall state. - * - * @param y the y - * @param onGroundIn the on ground in - * @param blockIn the block in - * @param pos the pos - */ @Shadow protected abstract void updateFallState(double y, boolean onGroundIn, Block blockIn, BlockPos pos); - - /** - * Gets health. - * - * @return the health - */ @Shadow public abstract float getHealth(); - - /** - * Gets held item. - * - * @return the held item - */ @Shadow public abstract ItemStack getHeldItem(); - - /** - * Update ai tick. - */ @Shadow protected abstract void updateAITick(); - @Shadow protected void updateEntityActionState() { } /** - * Jump. - * * @author As_pw - * @reason Jump + * @reason Jump Event */ @Overwrite protected void jump() { @@ -172,13 +106,6 @@ private void isPotionActive(Potion p_isPotionActive_1_, final CallbackInfoReturn callbackInfoReturnable.setReturnValue(false); } - @ModifyConstant(method = "onLivingUpdate", constant = @Constant(doubleValue = 0.005D)) - private double ViaVersion_MovementThreshold(double constant) { - if (ProtocolFixer.newerThan1_8()) - return 0.003D; - return 0.005D; - } - /** * @author As_pw * @reason VisionFX diff --git a/src/main/java/net/aspw/client/injection/forge/mixins/entity/MixinEntityPlayer.java b/src/main/java/net/aspw/client/injection/forge/mixins/entity/MixinEntityPlayer.java index 4bef6939..08b5b6f0 100644 --- a/src/main/java/net/aspw/client/injection/forge/mixins/entity/MixinEntityPlayer.java +++ b/src/main/java/net/aspw/client/injection/forge/mixins/entity/MixinEntityPlayer.java @@ -2,55 +2,30 @@ import com.mojang.authlib.GameProfile; import net.aspw.client.Launch; -import net.aspw.client.features.api.McUpdatesHandler; -import net.aspw.client.features.api.PacketManager; import net.aspw.client.features.module.impl.combat.KeepSprint; -import net.aspw.client.features.module.impl.movement.Flight; -import net.aspw.client.features.module.impl.movement.LongJump; -import net.aspw.client.features.module.impl.movement.Speed; -import net.aspw.client.features.module.impl.player.BowJump; -import net.aspw.client.protocol.api.ProtocolFixer; import net.aspw.client.utils.CooldownHelper; import net.aspw.client.utils.MinecraftInstance; -import net.aspw.client.utils.PacketUtils; -import net.minecraft.client.Minecraft; -import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.entity.player.PlayerCapabilities; import net.minecraft.item.ItemStack; -import net.minecraft.network.play.client.C0APacketAnimation; import net.minecraft.util.FoodStats; import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Overwrite; import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.Unique; 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; import java.util.Objects; -/** - * The type Mixin entity player. - */ @Mixin(EntityPlayer.class) public abstract class MixinEntityPlayer extends MixinEntityLivingBase { - /** - * The Capabilities. - */ @Shadow public PlayerCapabilities capabilities; - /** - * The Inventory. - */ @Shadow public InventoryPlayer inventory; - /** - * The Fly toggle timer. - */ @Shadow protected int flyToggleTimer; @Unique @@ -62,103 +37,21 @@ public abstract class MixinEntityPlayer extends MixinEntityLivingBase { @Shadow public abstract ItemStack getHeldItem(); - /** - * Gets game profile. - * - * @return the game profile - */ @Shadow public abstract GameProfile getGameProfile(); - /** - * Can trigger walking boolean. - * - * @return the boolean - */ @Shadow protected abstract boolean canTriggerWalking(); - /** - * Gets swim sound. - * - * @return the swim sound - */ @Shadow protected abstract String getSwimSound(); - /** - * Gets food stats. - * - * @return the food stats - */ @Shadow public abstract FoodStats getFoodStats(); - /** - * Gets item in use duration. - * - * @return the item in use duration - */ - @Shadow - public abstract int getItemInUseDuration(); - - /** - * Gets item in use. - * - * @return the item in use - */ - @Shadow - public abstract ItemStack getItemInUse(); - - /** - * Is using item boolean. - * - * @return the boolean - */ @Shadow public abstract boolean isUsingItem(); - /** - * Is player sleeping boolean. - * - * @return the boolean - */ - @Shadow - public abstract boolean isPlayerSleeping(); - - @Shadow(remap = false) - public abstract float getDefaultEyeHeight(); - - private final ItemStack[] mainInventory = new ItemStack[36]; - private final ItemStack[] armorInventory = new ItemStack[4]; - - /** - * @author As_pw - * @reason FakeY - */ - @Override - @Overwrite - public float getEyeHeight() { - final Minecraft mc = MinecraftInstance.mc; - final LongJump longJump = Objects.requireNonNull(Launch.moduleManager.getModule(LongJump.class)); - final Flight flight = Objects.requireNonNull(Launch.moduleManager.getModule(Flight.class)); - final Speed speed = Objects.requireNonNull(Launch.moduleManager.getModule(Speed.class)); - final BowJump bowJump = Objects.requireNonNull(Launch.moduleManager.getModule(BowJump.class)); - if (ProtocolFixer.newerThanOrEqualsTo1_13() && McUpdatesHandler.doingEyeRot) - return McUpdatesHandler.lastEyeHeight + (McUpdatesHandler.eyeHeight - McUpdatesHandler.lastEyeHeight) * mc.timer.renderPartialTicks; - if (this.isPlayerSleeping()) - return 0.2F; - if (flight.getState() && flight.getFakeYValue().get()) - return (float) (1.62F - (mc.thePlayer.lastTickPosY + (((mc.thePlayer.posY - mc.thePlayer.lastTickPosY) * mc.timer.renderPartialTicks)) - flight.getY())); - if (speed.getState() && speed.getFakeYValue().get()) - return (float) (1.62F - (mc.thePlayer.lastTickPosY + (((mc.thePlayer.posY - mc.thePlayer.lastTickPosY) * mc.timer.renderPartialTicks)) - speed.getY())); - if (longJump.getState() && longJump.getFakeYValue().get()) - return (float) (1.62F - (mc.thePlayer.lastTickPosY + (((mc.thePlayer.posY - mc.thePlayer.lastTickPosY) * mc.timer.renderPartialTicks)) - longJump.getY())); - if (bowJump.getState() && bowJump.getFakeYValue().get()) - return (float) (1.62F - (mc.thePlayer.lastTickPosY + (((mc.thePlayer.posY - mc.thePlayer.lastTickPosY) * mc.timer.renderPartialTicks)) - bowJump.getY())); - return PacketManager.lastEyeHeight + (PacketManager.eyeHeight - PacketManager.lastEyeHeight) * mc.timer.renderPartialTicks; - } - @Inject(method = "onUpdate", at = @At("RETURN")) private void injectCooldown(final CallbackInfo callbackInfo) { if (getGameProfile() == MinecraftInstance.mc.thePlayer.getGameProfile()) { @@ -173,29 +66,6 @@ private void injectCooldown(final CallbackInfo callbackInfo) { } } - /** - * @author As_pw - * @reason ViaVersion Tweaks - */ - @Inject(method = "dropItem", at = @At("HEAD")) - private void dropItem(ItemStack p_dropItem_1_, boolean p_dropItem_2_, boolean p_dropItem_3_, CallbackInfoReturnable cir) { - for (int i = 0; i < this.mainInventory.length; ++i) { - if (ProtocolFixer.newerThanOrEqualsTo1_16()) - PacketUtils.sendPacketNoEvent(new C0APacketAnimation()); - if (this.mainInventory[i] != null) { - this.mainInventory[i] = null; - } - } - - for (int j = 0; j < this.armorInventory.length; ++j) { - if (ProtocolFixer.newerThanOrEqualsTo1_16()) - PacketUtils.sendPacketNoEvent(new C0APacketAnimation()); - if (this.armorInventory[j] != null) { - this.armorInventory[j] = null; - } - } - } - @Inject(method = "attackTargetEntityWithCurrentItem", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/player/EntityPlayer;setSprinting(Z)V", shift = At.Shift.AFTER)) public void onAttackTargetEntityWithCurrentItem(CallbackInfo callbackInfo) { final KeepSprint keepSprint = Objects.requireNonNull(Launch.moduleManager.getModule(KeepSprint.class)); diff --git a/src/main/java/net/aspw/client/injection/forge/mixins/entity/MixinEntityPlayerSP.java b/src/main/java/net/aspw/client/injection/forge/mixins/entity/MixinEntityPlayerSP.java index a4f4292c..ddfecc1d 100644 --- a/src/main/java/net/aspw/client/injection/forge/mixins/entity/MixinEntityPlayerSP.java +++ b/src/main/java/net/aspw/client/injection/forge/mixins/entity/MixinEntityPlayerSP.java @@ -7,7 +7,6 @@ import net.aspw.client.features.module.impl.movement.SilentSneak; import net.aspw.client.features.module.impl.player.Scaffold; import net.aspw.client.features.module.impl.visual.Interface; -import net.aspw.client.protocol.api.ProtocolFixer; import net.aspw.client.utils.CooldownHelper; import net.aspw.client.utils.MovementUtils; import net.aspw.client.utils.Rotation; @@ -30,7 +29,6 @@ import net.minecraft.entity.Entity; import net.minecraft.init.Blocks; import net.minecraft.item.ItemSword; -import net.minecraft.network.Packet; import net.minecraft.network.play.client.C03PacketPlayer; import net.minecraft.network.play.client.C0BPacketEntityAction; import net.minecraft.potion.Potion; @@ -38,57 +36,29 @@ import org.spongepowered.asm.mixin.*; 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; import java.util.List; import java.util.Objects; -/** - * The type Mixin entity player sp. - */ @Mixin(EntityPlayerSP.class) public abstract class MixinEntityPlayerSP extends MixinAbstractClientPlayer { - /** - * The Server sprint state. - */ @Shadow public boolean serverSprintState; - /** - * The Sprinting ticks left. - */ @Shadow public int sprintingTicksLeft; - /** - * The Time in portal. - */ @Shadow public float timeInPortal; - /** - * The Prev time in portal. - */ @Shadow public float prevTimeInPortal; - /** - * The Movement input. - */ @Shadow public MovementInput movementInput; - /** - * The Horse jump power. - */ @Shadow public float horseJumpPower; - /** - * The Horse jump power counter. - */ @Shadow public int horseJumpPowerCounter; - /** - * The Send queue. - */ @Shadow @Final public NetHandlerPlayClient sendQueue; @@ -102,18 +72,10 @@ public abstract class MixinEntityPlayerSP extends MixinAbstractClientPlayer { public float prevRenderArmYaw; @Shadow public float prevRenderArmPitch; - /** - * The Sprint toggle timer. - */ @Shadow protected int sprintToggleTimer; - /** - * The Mc. - */ @Shadow protected Minecraft mc; - @Unique - private boolean viaForge$prevOnGround; @Shadow private boolean serverSneakState; @Shadow @@ -129,52 +91,21 @@ public abstract class MixinEntityPlayerSP extends MixinAbstractClientPlayer { @Unique private boolean lastOnGround; - /** - * Play sound. - * - * @param name the name - * @param volume the volume - * @param pitch the pitch - */ @Shadow public abstract void playSound(String name, float volume, float pitch); - /** - * Sets sprinting. - * - * @param sprinting the sprinting - */ @Shadow public abstract void setSprinting(boolean sprinting); - /** - * Push out of blocks boolean. - * - * @param x the x - * @param y the y - * @param z the z - * @return the boolean - */ @Shadow protected abstract boolean pushOutOfBlocks(double x, double y, double z); - /** - * Send player abilities. - */ @Shadow public abstract void sendPlayerAbilities(); - /** - * Send horse jump. - */ @Shadow protected abstract void sendHorseJump(); - /** - * Is riding horse boolean. - * - * @return the boolean - */ @Shadow public abstract boolean isRidingHorse(); @@ -183,11 +114,8 @@ public abstract class MixinEntityPlayerSP extends MixinAbstractClientPlayer { public abstract boolean isSneaking(); /** - * Is current view entity boolean. - * - * @return the boolean * @author As_pw - * @reason Fix Video + * @reason RemoteView Fix */ @Overwrite protected boolean isCurrentViewEntity() { @@ -196,7 +124,7 @@ protected boolean isCurrentViewEntity() { /** * @author As_pw - * @reason Fix Arm + * @reason ArmPos Fix */ @Override @Overwrite @@ -214,26 +142,9 @@ public void updateEntityActionState() { } } - @Redirect(method = "onUpdateWalkingPlayer", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/network/NetHandlerPlayClient;addToSendQueue(Lnet/minecraft/network/Packet;)V", ordinal = 7)) - public void emulateIdlePacket(final NetHandlerPlayClient instance, final Packet p_addToSendQueue_1_) { - if (ProtocolFixer.newerThan1_8()) { - if (this.viaForge$prevOnGround == this.onGround) { - return; - } - } - instance.addToSendQueue(p_addToSendQueue_1_); - } - - @Inject(method = "onUpdateWalkingPlayer", at = @At("RETURN")) - public void saveGroundState(final CallbackInfo ci) { - this.viaForge$prevOnGround = this.onGround; - } - /** - * On update walking player. - * * @author As_pw - * @reason Update Event + * @reason Motion Event */ @Overwrite public void onUpdateWalkingPlayer() { @@ -346,7 +257,7 @@ private void onPushOutOfBlocks(final CallbackInfoReturnable callbackInf /** * @author As_pw - * @reason Fix Gui + * @reason Update Event */ @Override @Overwrite diff --git a/src/main/java/net/aspw/client/injection/forge/mixins/entity/MixinPlayerControllerMP.java b/src/main/java/net/aspw/client/injection/forge/mixins/entity/MixinPlayerControllerMP.java index 54cbb916..bb7beda4 100644 --- a/src/main/java/net/aspw/client/injection/forge/mixins/entity/MixinPlayerControllerMP.java +++ b/src/main/java/net/aspw/client/injection/forge/mixins/entity/MixinPlayerControllerMP.java @@ -13,9 +13,6 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; -/** - * The type Mixin player controller mp. - */ @Mixin(PlayerControllerMP.class) public class MixinPlayerControllerMP { diff --git a/src/main/java/net/aspw/client/injection/forge/mixins/gui/MixinGuiButton.java b/src/main/java/net/aspw/client/injection/forge/mixins/gui/MixinGuiButton.java index 5f5d83fd..ffbc38ed 100644 --- a/src/main/java/net/aspw/client/injection/forge/mixins/gui/MixinGuiButton.java +++ b/src/main/java/net/aspw/client/injection/forge/mixins/gui/MixinGuiButton.java @@ -20,88 +20,36 @@ import java.awt.*; - -/** - * The type Mixin gui button. - */ @Mixin(GuiButton.class) public abstract class MixinGuiButton extends Gui { - /** - * The constant buttonTextures. - */ @Shadow @Final protected static ResourceLocation buttonTextures; - /** - * The Visible. - */ @Shadow public boolean visible; - /** - * The X position. - */ @Shadow public int xPosition; - /** - * The Y position. - */ @Shadow public int yPosition; - /** - * The Width. - */ @Shadow public int width; - /** - * The Height. - */ @Shadow public int height; - /** - * The Enabled. - */ @Shadow public boolean enabled; - /** - * The Display string. - */ @Shadow public String displayString; - /** - * The Hovered. - */ @Shadow protected boolean hovered; private float alpha; - /** - * Mouse dragged. - * - * @param mc the mc - * @param mouseX the mouse x - * @param mouseY the mouse y - */ @Shadow protected abstract void mouseDragged(Minecraft mc, int mouseX, int mouseY); /** - * Gets hover state. - * - * @param mouseOver the mouse over - * @return the hover state - */ - @Shadow - protected abstract int getHoverState(boolean mouseOver); - - /** - * Draw button. - * - * @param mc the mc - * @param mouseX the mouse x - * @param mouseY the mouse y * @author As_pw - * @reason Font Render + * @reason Button Renderer */ @Overwrite public void drawButton(Minecraft mc, int mouseX, int mouseY) { diff --git a/src/main/java/net/aspw/client/injection/forge/mixins/gui/MixinGuiButtonExt.java b/src/main/java/net/aspw/client/injection/forge/mixins/gui/MixinGuiButtonExt.java index 8d3a1aa3..ef870fd1 100644 --- a/src/main/java/net/aspw/client/injection/forge/mixins/gui/MixinGuiButtonExt.java +++ b/src/main/java/net/aspw/client/injection/forge/mixins/gui/MixinGuiButtonExt.java @@ -17,25 +17,12 @@ import java.awt.*; -/** - * The type Mixin gui button ext. - */ @Mixin(GuiButtonExt.class) public abstract class MixinGuiButtonExt extends GuiButton { @Unique private float alpha; - /** - * Instantiates a new Mixin gui button ext. - * - * @param p_i46323_1_ the p i 46323 1 - * @param p_i46323_2_ the p i 46323 2 - * @param p_i46323_3_ the p i 46323 3 - * @param p_i46323_4_ the p i 46323 4 - * @param p_i46323_5_ the p i 46323 5 - * @param p_i46323_6_ the p i 46323 6 - */ public MixinGuiButtonExt(final int p_i46323_1_, final int p_i46323_2_, final int p_i46323_3_, final int p_i46323_4_, final int p_i46323_5_, final String p_i46323_6_) { super(p_i46323_1_, p_i46323_2_, p_i46323_3_, p_i46323_4_, p_i46323_5_, p_i46323_6_); @@ -43,7 +30,7 @@ public MixinGuiButtonExt(final int p_i46323_1_, final int p_i46323_2_, final int /** * @author As_pw - * @reason Button + * @reason Button Renderer */ @Override @Overwrite @@ -97,4 +84,4 @@ public void drawButton(final Minecraft mc, final int mouseX, final int mouseY) { } } } -} +} \ No newline at end of file diff --git a/src/main/java/net/aspw/client/injection/forge/mixins/gui/MixinGuiChat.java b/src/main/java/net/aspw/client/injection/forge/mixins/gui/MixinGuiChat.java index f37c9dfa..30fe043f 100644 --- a/src/main/java/net/aspw/client/injection/forge/mixins/gui/MixinGuiChat.java +++ b/src/main/java/net/aspw/client/injection/forge/mixins/gui/MixinGuiChat.java @@ -18,16 +18,11 @@ import java.util.Comparator; import java.util.List; -/** - * The type Mixin gui chat. - */ @Mixin(GuiChat.class) public abstract class MixinGuiChat extends MixinGuiScreen { + @Unique private final float fade = 14; - /** - * The Input field. - */ @Shadow protected GuiTextField inputField; @Shadow @@ -37,11 +32,6 @@ public abstract class MixinGuiChat extends MixinGuiScreen { @Unique private float yPosOfInputField; - /** - * On autocomplete response. - * - * @param p_onAutocompleteResponse_1_ the p on autocomplete response 1 - */ @Shadow public abstract void onAutocompleteResponse(String[] p_onAutocompleteResponse_1_); @@ -87,13 +77,8 @@ private void handleClientCommandCompletion(final String full, final String ignor } /** - * Draw screen. - * - * @param mouseX the mouse x - * @param mouseY the mouse y - * @param partialTicks the partial ticks * @author As_pw - * @reason Draw + * @reason Draw Chat */ @Overwrite public void drawScreen(final int mouseX, final int mouseY, final float partialTicks) { @@ -114,4 +99,4 @@ public void drawScreen(final int mouseX, final int mouseY, final float partialTi if (ichatcomponent != null) this.handleComponentHover(ichatcomponent, mouseX, mouseY); } -} +} \ No newline at end of file diff --git a/src/main/java/net/aspw/client/injection/forge/mixins/gui/MixinGuiConnecting.java b/src/main/java/net/aspw/client/injection/forge/mixins/gui/MixinGuiConnecting.java index ef8b480f..1f07eaf4 100644 --- a/src/main/java/net/aspw/client/injection/forge/mixins/gui/MixinGuiConnecting.java +++ b/src/main/java/net/aspw/client/injection/forge/mixins/gui/MixinGuiConnecting.java @@ -53,7 +53,7 @@ private void headConnect(final String ip, final int port, CallbackInfo callbackI /** * @author As_pw - * @reason Fix Connect + * @reason Connection Fix */ @Overwrite private void connect(final String ip, final int port) { diff --git a/src/main/java/net/aspw/client/injection/forge/mixins/gui/MixinGuiContainer.java b/src/main/java/net/aspw/client/injection/forge/mixins/gui/MixinGuiContainer.java index a8dab5de..cfac2a4d 100644 --- a/src/main/java/net/aspw/client/injection/forge/mixins/gui/MixinGuiContainer.java +++ b/src/main/java/net/aspw/client/injection/forge/mixins/gui/MixinGuiContainer.java @@ -21,53 +21,24 @@ import java.util.Objects; -/** - * The type Mixin gui container. - */ @Mixin(GuiContainer.class) public abstract class MixinGuiContainer extends MixinGuiScreen { - /** - * The X size. - */ + @Shadow protected int xSize; - /** - * The Y size. - */ - @Shadow - protected int ySize; - /** - * The Gui left. - */ @Shadow protected int guiLeft; - /** - * The Gui top. - */ - @Shadow - protected int guiTop; @Shadow private int dragSplittingButton; @Shadow private int dragSplittingRemnant; - private GuiButton stealButton, chestStealerButton, invManagerButton, killAuraButton; + private GuiButton chestStealerButton, invManagerButton, killAuraButton; private float progress = 0F; private long lastMS = 0L; - /** - * Check hotbar keys boolean. - * - * @param keyCode the key code - * @return the boolean - */ @Shadow protected abstract boolean checkHotbarKeys(int keyCode); - /** - * Inject init gui. - * - * @param callbackInfo the callback info - */ @Inject(method = "initGui", at = @At("HEAD")) public void injectInitGui(final CallbackInfo callbackInfo) { final GuiScreen guiScreen = MinecraftInstance.mc.currentScreen; @@ -114,7 +85,6 @@ private void drawScreenHead(final CallbackInfo callbackInfo) { try { final GuiScreen guiScreen = mc.currentScreen; - if (stealButton != null) stealButton.enabled = !stealer.getState(); if (killAuraButton != null) killAuraButton.enabled = killAura.getState(); if (chestStealerButton != null) chestStealerButton.enabled = stealer.getState(); @@ -149,8 +119,7 @@ private void drawScreenHead(final CallbackInfo callbackInfo) { if (!stealer.getOnce() && !stealer.getStillDisplayValue().get()) callbackInfo.cancel(); } - } catch (final Exception e) { - //e.printStackTrace(); + } catch (final Exception ignored) { } } @@ -159,11 +128,6 @@ protected boolean shouldRenderBackground() { return false; } - /** - * Draw screen return. - * - * @param callbackInfo the callback info - */ @Inject(method = "drawScreen", at = @At("RETURN")) public void drawScreenReturn(final CallbackInfo callbackInfo) { final Animations animMod = Objects.requireNonNull(Launch.moduleManager.getModule(Animations.class)); diff --git a/src/main/java/net/aspw/client/injection/forge/mixins/gui/MixinGuiDisconnected.java b/src/main/java/net/aspw/client/injection/forge/mixins/gui/MixinGuiDisconnected.java index 7d11846f..b3657e6c 100644 --- a/src/main/java/net/aspw/client/injection/forge/mixins/gui/MixinGuiDisconnected.java +++ b/src/main/java/net/aspw/client/injection/forge/mixins/gui/MixinGuiDisconnected.java @@ -1,14 +1,11 @@ package net.aspw.client.injection.forge.mixins.gui; import com.google.gson.JsonObject; -import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import net.aspw.client.Launch; import net.aspw.client.auth.account.CrackedAccount; import net.aspw.client.auth.account.MinecraftAccount; import net.aspw.client.event.SessionEvent; import net.aspw.client.features.module.impl.visual.Interface; -import net.aspw.client.protocol.ProtocolBase; -import net.aspw.client.protocol.api.ProtocolSelector; import net.aspw.client.utils.ServerUtils; import net.aspw.client.utils.SessionUtils; import net.aspw.client.utils.misc.RandomUtils; @@ -32,9 +29,6 @@ import java.util.Objects; import java.util.Random; -/** - * The type Mixin gui disconnected. - */ @Mixin(GuiDisconnected.class) public abstract class MixinGuiDisconnected extends MixinGuiScreen { @@ -49,7 +43,6 @@ private void initGui(CallbackInfo callbackInfo) { buttonList.add(new GuiButton(3, this.width / 2 - 100, this.height / 2 + field_175353_i / 2 + this.fontRendererObj.FONT_HEIGHT + 44, 100, 20, "Reconnect with Alt")); buttonList.add(new GuiButton(4, this.width / 2 + 2, this.height / 2 + field_175353_i / 2 + this.fontRendererObj.FONT_HEIGHT + 44, 98, 20, "Random Cracked")); buttonList.add(new GuiButton(998, width - 94, 5, 88, 20, "Alt Manager")); - buttonList.add(new GuiButton(1151, 4, height - 24, 68, 20, "Protocol")); } @Inject(method = "actionPerformed", at = @At("HEAD")) @@ -96,22 +89,15 @@ private void actionPerformed(GuiButton button, CallbackInfo callbackInfo) { case 998: mc.displayGuiScreen(new GuiAltManager((GuiScreen) (Object) this)); break; - case 1151: - mc.displayGuiScreen(new ProtocolSelector((GuiScreen) (Object) this)); - break; } } @Inject(method = "drawScreen", at = @At("RETURN")) private void drawScreen(CallbackInfo callbackInfo) { - final ProtocolVersion version = ProtocolBase.getManager().getTargetVersion(); - Fonts.minecraftFont.drawStringWithShadow( "§7Username: §d" + mc.getSession().getUsername(), 6f, 6f, 0xffffff); - - Fonts.minecraftFont.drawStringWithShadow("§7Protocol: §d" + version.getName(), 6f, 16f, 0xffffff); } } \ No newline at end of file diff --git a/src/main/java/net/aspw/client/injection/forge/mixins/gui/MixinGuiDownloadTerrain.java b/src/main/java/net/aspw/client/injection/forge/mixins/gui/MixinGuiDownloadTerrain.java index 8aacf191..40680a15 100644 --- a/src/main/java/net/aspw/client/injection/forge/mixins/gui/MixinGuiDownloadTerrain.java +++ b/src/main/java/net/aspw/client/injection/forge/mixins/gui/MixinGuiDownloadTerrain.java @@ -38,6 +38,5 @@ protected void injectedActionPerformed(GuiButton button) { this.mc.displayGuiScreen(new GuiMultiplayer(new GuiMainMenu())); } } - } } \ No newline at end of file diff --git a/src/main/java/net/aspw/client/injection/forge/mixins/gui/MixinGuiGameOver.java b/src/main/java/net/aspw/client/injection/forge/mixins/gui/MixinGuiGameOver.java index 75d9aa67..1f9b2714 100644 --- a/src/main/java/net/aspw/client/injection/forge/mixins/gui/MixinGuiGameOver.java +++ b/src/main/java/net/aspw/client/injection/forge/mixins/gui/MixinGuiGameOver.java @@ -8,11 +8,9 @@ import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; -/** - * The type Mixin gui game over. - */ @Mixin(GuiGameOver.class) public abstract class MixinGuiGameOver extends MixinGuiScreen implements GuiYesNoCallback { + @Shadow public int enableButtonsTimer; @@ -49,4 +47,4 @@ public void confirmClicked(boolean p_confirmClicked_1_, int p_confirmClicked_2_, this.mc.displayGuiScreen(null); } } -} +} \ No newline at end of file diff --git a/src/main/java/net/aspw/client/injection/forge/mixins/gui/MixinGuiInGame.java b/src/main/java/net/aspw/client/injection/forge/mixins/gui/MixinGuiInGame.java index 26bdd916..cc0a6d3d 100644 --- a/src/main/java/net/aspw/client/injection/forge/mixins/gui/MixinGuiInGame.java +++ b/src/main/java/net/aspw/client/injection/forge/mixins/gui/MixinGuiInGame.java @@ -31,34 +31,17 @@ import java.util.Objects; -/** - * The type Mixin gui in game. - */ @Mixin(GuiIngame.class) public abstract class MixinGuiInGame extends Gui { - /** - * The constant widgetsTexPath. - */ @Shadow @Final protected static ResourceLocation widgetsTexPath; - /** - * The Overlay player list. - */ + @Final @Shadow public GuiPlayerTabOverlay overlayPlayerList; - /** - * Render hotbar item. - * - * @param index the index - * @param xPos the x pos - * @param yPos the y pos - * @param partialTicks the partial ticks - * @param player the player - */ @Shadow protected abstract void renderHotbarItem(int index, int xPos, int yPos, float partialTicks, EntityPlayer player); @@ -92,7 +75,7 @@ private void renderBossHealth(CallbackInfo callbackInfo) { /** * @author As_pw - * @reason Hotbar Spoof + * @reason Hotbar Renderer */ @Overwrite protected void renderTooltip(ScaledResolution sr, float partialTicks) { diff --git a/src/main/java/net/aspw/client/injection/forge/mixins/gui/MixinGuiIngameForge.java b/src/main/java/net/aspw/client/injection/forge/mixins/gui/MixinGuiIngameForge.java index dfa1d612..d4467b69 100644 --- a/src/main/java/net/aspw/client/injection/forge/mixins/gui/MixinGuiIngameForge.java +++ b/src/main/java/net/aspw/client/injection/forge/mixins/gui/MixinGuiIngameForge.java @@ -20,31 +20,14 @@ import static net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType.PLAYER_LIST; -/** - * The type Mixin gui ingame forge. - */ @Mixin(GuiIngameForge.class) public abstract class MixinGuiIngameForge extends MixinGuiInGame { - /** - * The X scale. - */ public float xScale = 0F; - /** - * Pre boolean. - * - * @param type the type - * @return the boolean - */ @Shadow(remap = false) protected abstract boolean pre(ElementType type); - /** - * Post. - * - * @param type the type - */ @Shadow(remap = false) protected abstract void post(ElementType type); @@ -71,12 +54,8 @@ private void disableExperienceAlpha(int filled, int top, CallbackInfo ci) { } /** - * Render player list. - * - * @param width the width - * @param height the height * @author As_pw - * @reason PlayerList + * @reason Player List Renderer */ @Overwrite(remap = false) protected void renderPlayerList(int width, int height) { diff --git a/src/main/java/net/aspw/client/injection/forge/mixins/gui/MixinGuiIngameMenu.java b/src/main/java/net/aspw/client/injection/forge/mixins/gui/MixinGuiIngameMenu.java index 345e725f..416feef2 100644 --- a/src/main/java/net/aspw/client/injection/forge/mixins/gui/MixinGuiIngameMenu.java +++ b/src/main/java/net/aspw/client/injection/forge/mixins/gui/MixinGuiIngameMenu.java @@ -1,9 +1,6 @@ package net.aspw.client.injection.forge.mixins.gui; -import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import net.aspw.client.features.api.PacketManager; -import net.aspw.client.protocol.ProtocolBase; -import net.aspw.client.utils.MinecraftInstance; import net.aspw.client.utils.ServerUtils; import net.aspw.client.visual.font.semi.Fonts; import net.minecraft.client.gui.GuiButton; @@ -15,6 +12,7 @@ @Mixin(GuiIngameMenu.class) public abstract class MixinGuiIngameMenu extends MixinGuiScreen { + @Inject(method = "initGui", at = @At("RETURN")) private void initGui(CallbackInfo callbackInfo) { this.buttonList.add(new GuiButton(1337, this.width / 2 - 100, this.height / 4 + 128, "Reconnect")); @@ -31,20 +29,14 @@ private void actionPerformed(GuiButton button, CallbackInfo callbackInfo) { @Inject(method = "drawScreen", at = @At("RETURN")) private void drawScreen(CallbackInfo callbackInfo) { try { - final ProtocolVersion version = ProtocolBase.getManager().getTargetVersion(); - Fonts.minecraftFont.drawStringWithShadow("§7Username: §d" + mc.getSession().getUsername(), 6f, 6f, 0xffffff); - if (!MinecraftInstance.mc.isIntegratedServerRunning()) - Fonts.minecraftFont.drawStringWithShadow("§7Protocol: §d" + version.getName(), 6f, 16f, 0xffffff); - else Fonts.minecraftFont.drawStringWithShadow("§7Protocol: §d1.8.x", 6f, 16f, 0xffffff); - - Fonts.minecraftFont.drawStringWithShadow("§7Ping: §d" + mc.getNetHandler().getPlayerInfo(mc.thePlayer.getUniqueID()).getResponseTime() + "ms", 6f, 26f, 0xffffff); + Fonts.minecraftFont.drawStringWithShadow("§7Ping: §d" + mc.getNetHandler().getPlayerInfo(mc.thePlayer.getUniqueID()).getResponseTime() + "ms", 6f, 16f, 0xffffff); - Fonts.minecraftFont.drawStringWithShadow("§7Packets Sent: §d" + PacketManager.sendPacketCounts, 6f, 36f, 0xffffff); - Fonts.minecraftFont.drawStringWithShadow("§7Packets Received: §d" + PacketManager.receivePacketCounts, 6f, 46f, 0xffffff); + Fonts.minecraftFont.drawStringWithShadow("§7Packets Sent: §d" + PacketManager.sendPacketCounts, 6f, 26f, 0xffffff); + Fonts.minecraftFont.drawStringWithShadow("§7Packets Received: §d" + PacketManager.receivePacketCounts, 6f, 36f, 0xffffff); - Fonts.minecraftFont.drawStringWithShadow("§7LastTPPos: §dX: " + PacketManager.lastTpX + ", Y: " + PacketManager.lastTpY + ", Z: " + PacketManager.lastTpZ, 6f, 56f, 0xffffff); + Fonts.minecraftFont.drawStringWithShadow("§7LastTPPos: §dX: " + PacketManager.lastTpX + ", Y: " + PacketManager.lastTpY + ", Z: " + PacketManager.lastTpZ, 6f, 46f, 0xffffff); } catch (final Exception ignored) { } } diff --git a/src/main/java/net/aspw/client/injection/forge/mixins/gui/MixinGuiKeyBindingList.java b/src/main/java/net/aspw/client/injection/forge/mixins/gui/MixinGuiKeyBindingList.java index 6fe55fc5..5eb0c350 100644 --- a/src/main/java/net/aspw/client/injection/forge/mixins/gui/MixinGuiKeyBindingList.java +++ b/src/main/java/net/aspw/client/injection/forge/mixins/gui/MixinGuiKeyBindingList.java @@ -6,22 +6,9 @@ import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Overwrite; -/** - * The type Mixin gui key binding list. - */ @Mixin(GuiKeyBindingList.class) public abstract class MixinGuiKeyBindingList extends GuiSlot { - /** - * Instantiates a new Mixin gui key binding list. - * - * @param mcIn the mc in - * @param width the width - * @param height the height - * @param topIn the top in - * @param bottomIn the bottom in - * @param slotHeightIn the slot height in - */ public MixinGuiKeyBindingList(Minecraft mcIn, int width, int height, int topIn, int bottomIn, int slotHeightIn) { super(mcIn, width, height, topIn, bottomIn, slotHeightIn); } diff --git a/src/main/java/net/aspw/client/injection/forge/mixins/gui/MixinGuiLanguage.java b/src/main/java/net/aspw/client/injection/forge/mixins/gui/MixinGuiLanguage.java index 245b459f..431981b4 100644 --- a/src/main/java/net/aspw/client/injection/forge/mixins/gui/MixinGuiLanguage.java +++ b/src/main/java/net/aspw/client/injection/forge/mixins/gui/MixinGuiLanguage.java @@ -4,9 +4,6 @@ import net.minecraft.client.gui.GuiScreen; import org.spongepowered.asm.mixin.Mixin; -/** - * The type Mixin gui language. - */ @Mixin(GuiLanguage.class) public class MixinGuiLanguage extends GuiScreen { diff --git a/src/main/java/net/aspw/client/injection/forge/mixins/gui/MixinGuiMultiplayer.java b/src/main/java/net/aspw/client/injection/forge/mixins/gui/MixinGuiMultiplayer.java index e10413b5..21a745b2 100644 --- a/src/main/java/net/aspw/client/injection/forge/mixins/gui/MixinGuiMultiplayer.java +++ b/src/main/java/net/aspw/client/injection/forge/mixins/gui/MixinGuiMultiplayer.java @@ -1,8 +1,5 @@ package net.aspw.client.injection.forge.mixins.gui; -import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; -import net.aspw.client.protocol.ProtocolBase; -import net.aspw.client.protocol.api.ProtocolSelector; import net.aspw.client.visual.client.altmanager.GuiAltManager; import net.aspw.client.visual.font.semi.Fonts; import net.minecraft.client.gui.GuiButton; @@ -13,25 +10,17 @@ import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; -/** - * The type Mixin gui multiplayer. - */ @Mixin(GuiMultiplayer.class) public abstract class MixinGuiMultiplayer extends MixinGuiScreen { @Inject(method = "initGui", at = @At("RETURN")) private void initGui(CallbackInfo callbackInfo) { buttonList.add(new GuiButton(998, width - 94, 5, 88, 20, "Alt Manager")); - buttonList.add(new GuiButton(1151, 4, height - 24, 68, 20, "Protocol")); } @Inject(method = "drawScreen", at = @At("RETURN")) private void drawScreen(CallbackInfo callbackInfo) { - final ProtocolVersion version = ProtocolBase.getManager().getTargetVersion(); - Fonts.minecraftFont.drawStringWithShadow("§7Username: §d" + mc.getSession().getUsername(), 6f, 6f, 0xffffff); - - Fonts.minecraftFont.drawStringWithShadow("§7Protocol: §d" + version.getName(), 6f, 16f, 0xffffff); } @Inject(method = "actionPerformed", at = @At("HEAD")) @@ -39,8 +28,5 @@ private void actionPerformed(GuiButton button, CallbackInfo callbackInfo) { if (button.id == 998) { mc.displayGuiScreen(new GuiAltManager((GuiScreen) (Object) this)); } - if (button.id == 1151) { - mc.displayGuiScreen(new ProtocolSelector((GuiScreen) (Object) this)); - } } } \ No newline at end of file diff --git a/src/main/java/net/aspw/client/injection/forge/mixins/gui/MixinGuiNewChat.java b/src/main/java/net/aspw/client/injection/forge/mixins/gui/MixinGuiNewChat.java index 1133312b..69c0dedf 100644 --- a/src/main/java/net/aspw/client/injection/forge/mixins/gui/MixinGuiNewChat.java +++ b/src/main/java/net/aspw/client/injection/forge/mixins/gui/MixinGuiNewChat.java @@ -27,9 +27,6 @@ import java.util.HashMap; import java.util.List; -/** - * The type Mixin gui new chat. - */ @Mixin(GuiNewChat.class) public abstract class MixinGuiNewChat { @@ -46,66 +43,21 @@ public abstract class MixinGuiNewChat { private int scrollPos; @Shadow private boolean isScrolled; - @Shadow - @Final - private List chatLines; private int line; private Interface anInterface; - /** - * Gets line count. - * - * @return the line count - */ @Shadow public abstract int getLineCount(); - /** - * Gets chat open. - * - * @return the chat open - */ @Shadow public abstract boolean getChatOpen(); - /** - * Gets chat scale. - * - * @return the chat scale - */ @Shadow public abstract float getChatScale(); - /** - * Gets chat width. - * - * @return the chat width - */ @Shadow public abstract int getChatWidth(); - /** - * Delete chat line. - * - * @param p_deleteChatLine_1_ the p delete chat line 1 - */ - @Shadow - public abstract void deleteChatLine(int p_deleteChatLine_1_); - - /** - * Scroll. - * - * @param p_scroll_1_ the p scroll 1 - */ - @Shadow - public abstract void scroll(int p_scroll_1_); - - /** - * Print chat message with optional deletion. - * - * @param chatComponent the chat component - * @param chatLineId the chat line id - */ @Shadow public abstract void printChatMessageWithOptionalDeletion(IChatComponent chatComponent, int chatLineId); @@ -121,11 +73,8 @@ private int checkIfChatLineIsNull(ChatLine instance) { } /** - * Print chat message. - * - * @param chatComponent the chat component * @author As_pw - * @reason Print + * @reason Print Chat */ @Overwrite public void printChatMessage(IChatComponent chatComponent) { @@ -139,11 +88,8 @@ private void resetPercentage(CallbackInfo ci) { } /** - * Draw chat. - * - * @param updateCounter the update counter * @author As_pw - * @reason Draw + * @reason Draw Chat */ @Overwrite public void drawChat(int updateCounter) { @@ -282,13 +228,8 @@ private List setNewLines(List original) { } /** - * Gets chat component. - * - * @param p_146236_1_ the p 146236 1 - * @param p_146236_2_ the p 146236 2 - * @return the chat component * @author As_pw - * @reason ChatComponent + * @reason Chat Component */ @Overwrite public IChatComponent getChatComponent(int p_146236_1_, int p_146236_2_) { diff --git a/src/main/java/net/aspw/client/injection/forge/mixins/gui/MixinGuiOptions.java b/src/main/java/net/aspw/client/injection/forge/mixins/gui/MixinGuiOptions.java index a860e14b..f6ea1f59 100644 --- a/src/main/java/net/aspw/client/injection/forge/mixins/gui/MixinGuiOptions.java +++ b/src/main/java/net/aspw/client/injection/forge/mixins/gui/MixinGuiOptions.java @@ -4,9 +4,6 @@ import net.minecraft.client.gui.GuiScreen; import org.spongepowered.asm.mixin.Mixin; -/** - * The type Mixin gui options. - */ @Mixin(GuiOptions.class) public class MixinGuiOptions extends GuiScreen { diff --git a/src/main/java/net/aspw/client/injection/forge/mixins/gui/MixinGuiOverlayDebug.java b/src/main/java/net/aspw/client/injection/forge/mixins/gui/MixinGuiOverlayDebug.java index b981ceb0..78e7aa91 100644 --- a/src/main/java/net/aspw/client/injection/forge/mixins/gui/MixinGuiOverlayDebug.java +++ b/src/main/java/net/aspw/client/injection/forge/mixins/gui/MixinGuiOverlayDebug.java @@ -1,9 +1,6 @@ package net.aspw.client.injection.forge.mixins.gui; -import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import net.aspw.client.Launch; -import net.aspw.client.protocol.ProtocolBase; -import net.aspw.client.utils.MinecraftInstance; import net.minecraft.client.gui.GuiOverlayDebug; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; @@ -16,17 +13,9 @@ public class MixinGuiOverlayDebug { @Inject(method = "getDebugInfoRight", at = @At(value = "TAIL")) - public void addProtocolVersion(CallbackInfoReturnable> cir) { - final ProtocolVersion version = ProtocolBase.getManager().getTargetVersion(); - - cir.getReturnValue().add(""); - - if (!MinecraftInstance.mc.isIntegratedServerRunning()) - cir.getReturnValue().add("Protocol: " + version.getName()); - else cir.getReturnValue().add("Protocol: 1.8.x"); - + public void addInformation(CallbackInfoReturnable> cir) { cir.getReturnValue().add(""); cir.getReturnValue().add(Launch.CLIENT_BEST + " Client " + Launch.CLIENT_VERSION); } -} +} \ No newline at end of file diff --git a/src/main/java/net/aspw/client/injection/forge/mixins/gui/MixinGuiScreen.java b/src/main/java/net/aspw/client/injection/forge/mixins/gui/MixinGuiScreen.java index a9bce0ef..907f8b59 100644 --- a/src/main/java/net/aspw/client/injection/forge/mixins/gui/MixinGuiScreen.java +++ b/src/main/java/net/aspw/client/injection/forge/mixins/gui/MixinGuiScreen.java @@ -23,61 +23,27 @@ import java.util.Collections; import java.util.List; -/** - * The type Mixin gui screen. - */ @Mixin(GuiScreen.class) public abstract class MixinGuiScreen { - /** - * The Mc. - */ + @Shadow public Minecraft mc; - /** - * The Width. - */ @Shadow public int width; - /** - * The Height. - */ @Shadow public int height; - /** - * The Button list. - */ @Shadow protected List buttonList; - /** - * The Font renderer obj. - */ @Shadow protected FontRenderer fontRendererObj; - /** - * Update screen. - */ @Shadow public void updateScreen() { } - /** - * Handle component hover. - * - * @param component the component - * @param x the x - * @param y the y - */ @Shadow public abstract void handleComponentHover(IChatComponent component, int x, int y); - /** - * Draw hovering text. - * - * @param textLines the text lines - * @param x the x - * @param y the y - */ @Shadow protected abstract void drawHoveringText(List textLines, int x, int y); @@ -99,7 +65,6 @@ private void drawWorldBackground(final CallbackInfo callbackInfo) { } } - @Inject(method = "drawBackground", at = @At("HEAD"), cancellable = true) private void drawClientBackground(final CallbackInfo callbackInfo) { GlStateManager.disableLighting(); @@ -136,31 +101,15 @@ private void handleHoverOverComponent(IChatComponent component, int x, int y, fi drawHoveringText(Collections.singletonList("§c§l" + clickEvent.getAction().getCanonicalName().toUpperCase() + ": §a" + clickEvent.getValue()), x, y - (hoverEvent != null ? 17 : 0)); } - /** - * Inject action performed. - * - * @param button the button - * @param callbackInfo the callback info - */ @Inject(method = "actionPerformed", at = @At("RETURN")) protected void injectActionPerformed(GuiButton button, CallbackInfo callbackInfo) { this.injectedActionPerformed(button); } - /** - * Should render background boolean. - * - * @return the boolean - */ protected boolean shouldRenderBackground() { return true; } - /** - * Injected action performed. - * - * @param button the button - */ protected void injectedActionPerformed(GuiButton button) { } diff --git a/src/main/java/net/aspw/client/injection/forge/mixins/gui/MixinGuiScreenOptionsSounds.java b/src/main/java/net/aspw/client/injection/forge/mixins/gui/MixinGuiScreenOptionsSounds.java index 800c50be..665695cb 100644 --- a/src/main/java/net/aspw/client/injection/forge/mixins/gui/MixinGuiScreenOptionsSounds.java +++ b/src/main/java/net/aspw/client/injection/forge/mixins/gui/MixinGuiScreenOptionsSounds.java @@ -8,13 +8,9 @@ import org.spongepowered.asm.mixin.injection.Redirect; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; -/** - * The type Mixin gui screen options sounds. - */ @Mixin(targets = "net.minecraft.client.gui.GuiScreenOptionsSounds$Button") public class MixinGuiScreenOptionsSounds { - // don't send a packet for every frame the slider is dragged, instead save that for when the slider is released @Redirect(method = "mouseDragged(Lnet/minecraft/client/Minecraft;II)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/settings/GameSettings;saveOptions()V")) private void cancelSaving(GameSettings instance) { // no-op @@ -24,4 +20,4 @@ private void cancelSaving(GameSettings instance) { private void save(int mouseX, int mouseY, CallbackInfo ci) { MinecraftInstance.mc.gameSettings.saveOptions(); } -} +} \ No newline at end of file diff --git a/src/main/java/net/aspw/client/injection/forge/mixins/gui/MixinGuiSlot.java b/src/main/java/net/aspw/client/injection/forge/mixins/gui/MixinGuiSlot.java index f7d4587e..650b11e9 100644 --- a/src/main/java/net/aspw/client/injection/forge/mixins/gui/MixinGuiSlot.java +++ b/src/main/java/net/aspw/client/injection/forge/mixins/gui/MixinGuiSlot.java @@ -17,140 +17,62 @@ import org.spongepowered.asm.mixin.Overwrite; import org.spongepowered.asm.mixin.Shadow; -/** - * The type Mixin gui slot. - */ @Mixin(GuiSlot.class) public abstract class MixinGuiSlot implements IMixinGuiSlot { - /** - * The Left. - */ + @Shadow public int left; - /** - * The Top. - */ @Shadow public int top; - /** - * The Width. - */ @Shadow public int width; - /** - * The Right. - */ @Shadow public int right; - /** - * The Bottom. - */ @Shadow public int bottom; - /** - * The Height. - */ @Shadow public int height; - /** - * The Field 178041 q. - */ @Shadow protected boolean field_178041_q; - /** - * The Mouse x. - */ @Shadow protected int mouseX; - /** - * The Mouse y. - */ @Shadow protected int mouseY; - /** - * The Amount scrolled. - */ @Shadow protected float amountScrolled; - /** - * The Has list header. - */ @Shadow protected boolean hasListHeader; - /** - * The Mc. - */ + @Shadow @Final protected Minecraft mc; + private int listWidth = 220; - /** - * Draw background. - */ @Shadow protected abstract void drawBackground(); - /** - * Bind amount scrolled. - */ @Shadow protected abstract void bindAmountScrolled(); - /** - * Draw list header. - * - * @param p_148129_1_ the p 148129 1 - * @param p_148129_2_ the p 148129 2 - * @param p_148129_3_ the p 148129 3 - */ @Shadow protected abstract void drawListHeader(int p_148129_1_, int p_148129_2_, Tessellator p_148129_3_); - /** - * Draw selection box. - * - * @param p_148120_1_ the p 148120 1 - * @param p_148120_2_ the p 148120 2 - * @param mouseXIn the mouse x in - * @param mouseYIn the mouse y in - */ @Shadow protected abstract void drawSelectionBox(int p_148120_1_, int p_148120_2_, int mouseXIn, int mouseYIn); - /** - * Gets content height. - * - * @return the content height - */ @Shadow protected abstract int getContentHeight(); - /** - * Func 148135 f int. - * - * @return the int - */ @Shadow public abstract int func_148135_f(); - /** - * Func 148142 b. - * - * @param p_148142_1_ the p 148142 1 - * @param p_148142_2_ the p 148142 2 - */ @Shadow protected abstract void func_148142_b(int p_148142_1_, int p_148142_2_); /** - * Draw screen. - * - * @param mouseXIn the mouse x in - * @param mouseYIn the mouse y in - * @param p_148128_3_ the p 148128 3 * @author As_pw - * @reason Draw + * @reason Draw Screen */ @Overwrite public void drawScreen(int mouseXIn, int mouseYIn, float p_148128_3_) { @@ -242,27 +164,17 @@ public void drawScreen(int mouseXIn, int mouseYIn, float p_148128_3_) { } /** - * Gets scroll bar x. - * - * @return the scroll bar x * @author As_pw - * @reason ScrollBar + * @reason Scroll Bar */ @Overwrite protected int getScrollBarX() { return this.width - 5; } - @Override - public void setEnableScissor(boolean enableScissor) { - } - /** - * Gets list width. - * - * @return the list width * @author As_pw - * @reason Width + * @reason Line Width */ @Overwrite public int getListWidth() { @@ -273,5 +185,4 @@ public int getListWidth() { public void setListWidth(int listWidth) { this.listWidth = listWidth; } - } \ No newline at end of file diff --git a/src/main/java/net/aspw/client/injection/forge/mixins/gui/MixinGuiSpectator.java b/src/main/java/net/aspw/client/injection/forge/mixins/gui/MixinGuiSpectator.java index 7323f2ed..10b3f842 100644 --- a/src/main/java/net/aspw/client/injection/forge/mixins/gui/MixinGuiSpectator.java +++ b/src/main/java/net/aspw/client/injection/forge/mixins/gui/MixinGuiSpectator.java @@ -10,9 +10,6 @@ import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; -/** - * The type Mixin gui spectator. - */ @Mixin(GuiSpectator.class) public class MixinGuiSpectator { diff --git a/src/main/java/net/aspw/client/injection/forge/mixins/gui/MixinServerSelectionList.java b/src/main/java/net/aspw/client/injection/forge/mixins/gui/MixinServerSelectionList.java index 3f585e2b..91aff0e9 100644 --- a/src/main/java/net/aspw/client/injection/forge/mixins/gui/MixinServerSelectionList.java +++ b/src/main/java/net/aspw/client/injection/forge/mixins/gui/MixinServerSelectionList.java @@ -15,36 +15,24 @@ import java.util.List; -/** - * The type Mixin server selection list. - */ @Mixin(ServerSelectionList.class) public abstract class MixinServerSelectionList extends GuiSlot { @Shadow @Final private List serverListLan; + @Shadow @Final private GuiListExtended.IGuiListEntry lanScanEntry; - /** - * Instantiates a new Mixin server selection list. - * - * @param mcIn the mc in - * @param width the width - * @param height the height - * @param topIn the top in - * @param bottomIn the bottom in - * @param slotHeightIn the slot height in - */ public MixinServerSelectionList(Minecraft mcIn, int width, int height, int topIn, int bottomIn, int slotHeightIn) { super(mcIn, width, height, topIn, bottomIn, slotHeightIn); } /** * @author As_pw - * @reason ScrollBar + * @reason Scroll Bar */ @Overwrite protected int getScrollBarX() { @@ -60,4 +48,4 @@ private void resolveIndexError(int index, CallbackInfoReturnable= this.serverListLan.size()) cir.setReturnValue(this.lanScanEntry); } -} +} \ No newline at end of file diff --git a/src/main/java/net/aspw/client/injection/forge/mixins/item/MixinItemBlock.java b/src/main/java/net/aspw/client/injection/forge/mixins/item/MixinItemBlock.java deleted file mode 100644 index 52b69dc3..00000000 --- a/src/main/java/net/aspw/client/injection/forge/mixins/item/MixinItemBlock.java +++ /dev/null @@ -1,69 +0,0 @@ -package net.aspw.client.injection.forge.mixins.item; - -import net.aspw.client.protocol.api.ProtocolFixer; -import net.aspw.client.utils.MinecraftInstance; -import net.minecraft.block.Block; -import net.minecraft.block.state.IBlockState; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; -import net.minecraft.util.BlockPos; -import net.minecraft.util.EnumFacing; -import net.minecraft.world.World; -import org.spongepowered.asm.mixin.Final; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Overwrite; -import org.spongepowered.asm.mixin.Shadow; - -@Mixin(ItemBlock.class) -public class MixinItemBlock extends Item { - - @Shadow - @Final - public Block block; - - /** - * @author As_pw - * @reason Fix Block Sounds - */ - @Overwrite - public boolean onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ) { - IBlockState iblockstate = worldIn.getBlockState(pos); - Block block = iblockstate.getBlock(); - - if (!block.isReplaceable(worldIn, pos)) { - pos = pos.offset(side); - } - - if (stack.stackSize == 0) { - return false; - } else if (!playerIn.canPlayerEdit(pos, side, stack)) { - return false; - } else if (worldIn.canBlockBePlaced(this.block, pos, false, side, null, stack)) { - int i = this.getMetadata(stack.getMetadata()); - IBlockState iblockstate1 = this.block.onBlockPlaced(worldIn, pos, side, hitX, hitY, hitZ, i, playerIn); - - if (worldIn.setBlockState(pos, iblockstate1, 3)) { - iblockstate1 = worldIn.getBlockState(pos); - - if (iblockstate1.getBlock() == this.block) { - ItemBlock.setTileEntityNBT(worldIn, playerIn, pos, stack); - this.block.onBlockPlacedBy(worldIn, pos, iblockstate1, playerIn, stack); - } - - if (ProtocolFixer.newerThan1_8()) { - MinecraftInstance.mc.theWorld.playSoundAtPos(pos.add(0.5, 0.5, 0.5), this.block.stepSound.getPlaceSound(), (this.block.stepSound.getVolume() + 1.0F) / 2.0F, this.block.stepSound.getFrequency() * 0.8F, false); - } else { - worldIn.playSoundEffect((float) pos.getX() + 0.5F, (float) pos.getY() + 0.5F, (float) pos.getZ() + 0.5F, this.block.stepSound.getPlaceSound(), (this.block.stepSound.getVolume() + 1.0F) / 2.0F, this.block.stepSound.getFrequency() * 0.8F); - } - - --stack.stackSize; - } - - return true; - } else { - return false; - } - } -} \ No newline at end of file diff --git a/src/main/java/net/aspw/client/injection/forge/mixins/item/MixinItemRenderer.java b/src/main/java/net/aspw/client/injection/forge/mixins/item/MixinItemRenderer.java index f67a9cca..0c6170dd 100644 --- a/src/main/java/net/aspw/client/injection/forge/mixins/item/MixinItemRenderer.java +++ b/src/main/java/net/aspw/client/injection/forge/mixins/item/MixinItemRenderer.java @@ -28,9 +28,6 @@ import java.util.Objects; -/** - * The type Mixin item renderer. - */ @Mixin(ItemRenderer.class) public abstract class MixinItemRenderer { @@ -45,85 +42,31 @@ public abstract class MixinItemRenderer { @Shadow private ItemStack itemToRender; private float delay = 0; - @Shadow - private int equippedItemSlot; - /** - * Rotate arround x and y. - * - * @param angle the angle - * @param angleY the angle y - */ @Shadow protected abstract void rotateArroundXAndY(float angle, float angleY); - /** - * Sets light map from player. - * - * @param clientPlayer the client player - */ @Shadow protected abstract void setLightMapFromPlayer(AbstractClientPlayer clientPlayer); - /** - * Rotate with player rotations. - * - * @param entityplayerspIn the entityplayersp in - * @param partialTicks the partial ticks - */ @Shadow protected abstract void rotateWithPlayerRotations(EntityPlayerSP entityplayerspIn, float partialTicks); - /** - * Render item map. - * - * @param clientPlayer the client player - * @param pitch the pitch - * @param equipmentProgress the equipment progress - * @param swingProgress the swing progress - */ @Shadow protected abstract void renderItemMap(AbstractClientPlayer clientPlayer, float pitch, float equipmentProgress, float swingProgress); - /** - * Perform drinking. - * - * @param clientPlayer the client player - * @param partialTicks the partial ticks - */ @Shadow protected abstract void performDrinking(AbstractClientPlayer clientPlayer, float partialTicks); - /** - * Do block transformations. - */ @Shadow protected abstract void doBlockTransformations(); - /** - * Do bow transformations. - * - * @param partialTicks the partial ticks - * @param clientPlayer the client player - */ @Shadow protected abstract void doBowTransformations(float partialTicks, AbstractClientPlayer clientPlayer); - /** - * Do item used transformations. - * - * @param swingProgress the swing progress - */ @Shadow protected abstract void doItemUsedTransformations(float swingProgress); - /** - * Render item. - * - * @param entityIn the entity in - * @param heldStack the held stack - * @param transform the transform - */ @Shadow public abstract void renderItem(EntityLivingBase entityIn, ItemStack heldStack, ItemCameraTransforms.TransformType transform); @@ -213,11 +156,8 @@ private void smallPush(float equipProgress, float swingProgress) { } /** - * Render item in first person. - * - * @param partialTicks the partial ticks * @author As_pw - * @reason RenderItem + * @reason Render Item in First Person */ @Overwrite public void renderItemInFirstPerson(final float partialTicks) { @@ -846,10 +786,9 @@ public void renderItemInFirstPerson(final float partialTicks) { @Inject(method = "renderFireInFirstPerson", at = @At("HEAD"), cancellable = true) private void renderFireInFirstPerson(final CallbackInfo callbackInfo) { - final VisualAbilities visualAbilities = Launch.moduleManager.getModule(VisualAbilities.class); + final VisualAbilities visualAbilities = Objects.requireNonNull(Launch.moduleManager.getModule(VisualAbilities.class)); if (visualAbilities.getState() && visualAbilities.getFireEffect().get()) { - //vanilla's method GlStateManager.color(1.0F, 1.0F, 1.0F, 0.9F); GlStateManager.depthFunc(519); GlStateManager.depthMask(false); diff --git a/src/main/java/net/aspw/client/injection/forge/mixins/item/MixinItemStack.java b/src/main/java/net/aspw/client/injection/forge/mixins/item/MixinItemStack.java index 24cb5446..82ca09ce 100644 --- a/src/main/java/net/aspw/client/injection/forge/mixins/item/MixinItemStack.java +++ b/src/main/java/net/aspw/client/injection/forge/mixins/item/MixinItemStack.java @@ -9,11 +9,9 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; -/** - * The type Mixin item stack. - */ @Mixin(ItemStack.class) public class MixinItemStack implements IItemStack { + private long itemDelay; private String cachedDisplayName; diff --git a/src/main/java/net/aspw/client/injection/forge/mixins/item/MixinNBTTagCompound.java b/src/main/java/net/aspw/client/injection/forge/mixins/item/MixinNBTTagCompound.java index a5f78264..c6fb913f 100644 --- a/src/main/java/net/aspw/client/injection/forge/mixins/item/MixinNBTTagCompound.java +++ b/src/main/java/net/aspw/client/injection/forge/mixins/item/MixinNBTTagCompound.java @@ -7,9 +7,6 @@ import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; -/** - * The type Mixin nbt tag compound. - */ @Mixin(NBTTagCompound.class) public class MixinNBTTagCompound { @@ -17,4 +14,4 @@ public class MixinNBTTagCompound { private void failFast(String key, NBTBase value, CallbackInfo ci) { if (value == null) throw new IllegalArgumentException("Invalid null NBT value with key " + key); } -} +} \ No newline at end of file diff --git a/src/main/java/net/aspw/client/injection/forge/mixins/network/MixinGuiConnecting_1.java b/src/main/java/net/aspw/client/injection/forge/mixins/network/MixinGuiConnecting_1.java deleted file mode 100644 index fcce7135..00000000 --- a/src/main/java/net/aspw/client/injection/forge/mixins/network/MixinGuiConnecting_1.java +++ /dev/null @@ -1,29 +0,0 @@ -package net.aspw.client.injection.forge.mixins.network; - -import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; -import net.aspw.client.protocol.ProtocolBase; -import net.aspw.client.protocol.api.ExtendedServerData; -import net.aspw.client.utils.MinecraftInstance; -import net.minecraft.network.NetworkManager; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Redirect; - -import java.net.InetAddress; - -@Mixin(targets = "net.minecraft.client.multiplayer.GuiConnecting$1") -public class MixinGuiConnecting_1 { - - @Redirect(method = "run", at = @At(value = "INVOKE", target = "Lnet/minecraft/network/NetworkManager;func_181124_a(Ljava/net/InetAddress;IZ)Lnet/minecraft/network/NetworkManager;"), remap = false) - public NetworkManager trackVersion(InetAddress address, int i, boolean b) { - if (MinecraftInstance.mc.getCurrentServerData() instanceof ExtendedServerData) { - final ProtocolVersion version = ((ExtendedServerData) MinecraftInstance.mc.getCurrentServerData()).viaForge$getVersion(); - if (version != null) { - ProtocolBase.getManager().setTargetVersionSilent(version); - } - } - - return NetworkManager.createNetworkManagerAndConnect(address, i, b); - } - -} diff --git a/src/main/java/net/aspw/client/injection/forge/mixins/network/MixinNetHandlerPlayClient.java b/src/main/java/net/aspw/client/injection/forge/mixins/network/MixinNetHandlerPlayClient.java index be47bee9..93d97e44 100644 --- a/src/main/java/net/aspw/client/injection/forge/mixins/network/MixinNetHandlerPlayClient.java +++ b/src/main/java/net/aspw/client/injection/forge/mixins/network/MixinNetHandlerPlayClient.java @@ -43,15 +43,9 @@ import java.util.List; import java.util.UUID; -/** - * The type Mixin net handler play client. - */ @Mixin(NetHandlerPlayClient.class) public abstract class MixinNetHandlerPlayClient implements INetHandlerPlayClient { - /** - * The Current server max players. - */ @Shadow public int currentServerMaxPlayers; @Shadow @@ -64,12 +58,6 @@ public abstract class MixinNetHandlerPlayClient implements INetHandlerPlayClient @Shadow private WorldClient clientWorldController; - /** - * Gets player info. - * - * @param p_175102_1_ the p 175102 1 - * @return the player info - */ @Shadow public abstract NetworkPlayerInfo getPlayerInfo(UUID p_175102_1_); @@ -101,8 +89,7 @@ private void handleSpawnPlayer(S0CPacketSpawnPlayer packetIn, CallbackInfo callb if (list != null) { entityotherplayermp.getDataWatcher().updateWatchedObjectsFromList(list); } - } catch (Exception e) { - // ignore + } catch (Exception ignored) { } callbackInfo.cancel(); } @@ -142,7 +129,6 @@ private void handleEntityMovementEvent(S14PacketEntity packetIn, final CallbackI at = @At(value = "INVOKE", target = "Lnet/minecraft/client/entity/EntityPlayerSP;addChatMessage(Lnet/minecraft/util/IChatComponent;)V", ordinal = 0) ) private void removeDebugMessage(EntityPlayerSP instance, IChatComponent component) { - } @Inject(method = {"handleAnimation"}, at = {@At(value = "INVOKE", target = "Lnet/minecraft/network/PacketThreadUtil;checkThreadAndEnqueue(Lnet/minecraft/network/Packet;Lnet/minecraft/network/INetHandler;Lnet/minecraft/util/IThreadListener;)V", shift = At.Shift.AFTER)}, cancellable = true) @@ -282,4 +268,4 @@ private void cancelIfNull(T t, CallbackInfo callbackInfo) { callbackInfo.cancel(); } } -} +} \ No newline at end of file diff --git a/src/main/java/net/aspw/client/injection/forge/mixins/network/MixinNetworkManager$5.java b/src/main/java/net/aspw/client/injection/forge/mixins/network/MixinNetworkManager$5.java deleted file mode 100644 index 3286a82f..00000000 --- a/src/main/java/net/aspw/client/injection/forge/mixins/network/MixinNetworkManager$5.java +++ /dev/null @@ -1,25 +0,0 @@ -package net.aspw.client.injection.forge.mixins.network; - -import io.netty.channel.Channel; -import net.aspw.client.protocol.ProtocolBase; -import net.aspw.client.protocol.api.VFNetworkManager; -import net.minecraft.network.NetworkManager; -import org.spongepowered.asm.mixin.Final; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Mutable; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; - -@Mixin(targets = "net.minecraft.network.NetworkManager$5") -public class MixinNetworkManager$5 { - - @Final - @Mutable - NetworkManager val$networkmanager; - - @Inject(method = "initChannel", at = @At(value = "TAIL"), remap = false) - private void onInitChannel(Channel channel, CallbackInfo ci) { - ProtocolBase.getManager().inject(channel, (VFNetworkManager) val$networkmanager); - } -} \ No newline at end of file diff --git a/src/main/java/net/aspw/client/injection/forge/mixins/network/MixinNetworkManager.java b/src/main/java/net/aspw/client/injection/forge/mixins/network/MixinNetworkManager.java index 36a6d9cc..35194139 100644 --- a/src/main/java/net/aspw/client/injection/forge/mixins/network/MixinNetworkManager.java +++ b/src/main/java/net/aspw/client/injection/forge/mixins/network/MixinNetworkManager.java @@ -1,36 +1,24 @@ package net.aspw.client.injection.forge.mixins.network; -import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import io.netty.channel.Channel; import io.netty.channel.ChannelHandlerContext; import net.aspw.client.Launch; import net.aspw.client.event.PacketEvent; import net.aspw.client.features.module.impl.combat.BackTrack; -import net.aspw.client.protocol.ProtocolBase; -import net.aspw.client.protocol.api.VFNetworkManager; import net.aspw.client.utils.PacketUtils; import net.minecraft.network.INetHandler; import net.minecraft.network.NetworkManager; import net.minecraft.network.Packet; import net.minecraft.network.ThreadQuickExitException; -import net.minecraft.util.LazyLoadBase; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Overwrite; import org.spongepowered.asm.mixin.Shadow; -import org.spongepowered.asm.mixin.Unique; 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; -import org.spongepowered.asm.mixin.injection.callback.LocalCapture; -import java.net.InetAddress; - -/** - * The type Mixin network manager. - */ @Mixin(NetworkManager.class) -public class MixinNetworkManager implements VFNetworkManager { +public class MixinNetworkManager { @Shadow private Channel channel; @@ -38,29 +26,6 @@ public class MixinNetworkManager implements VFNetworkManager { @Shadow private INetHandler packetListener; - @Unique - private ProtocolVersion viaForge$targetVersion; - - @Inject(method = "func_181124_a", at = @At(value = "INVOKE", target = "Lio/netty/bootstrap/Bootstrap;group(Lio/netty/channel/EventLoopGroup;)Lio/netty/bootstrap/AbstractBootstrap;"), locals = LocalCapture.CAPTURE_FAILHARD, remap = false) - private static void trackSelfTarget(final InetAddress address, final int serverPort, final boolean useNativeTransport, final CallbackInfoReturnable cir, final NetworkManager networkmanager, final Class oclass, final LazyLoadBase lazyloadbase) { - ((VFNetworkManager) networkmanager).viaForge$setTrackedVersion(ProtocolBase.getManager().getTargetVersion()); - } - - @Inject(method = "setCompressionTreshold", at = @At("RETURN")) - public void reorderPipeline(final int p_setCompressionTreshold_1_, final CallbackInfo ci) { - ProtocolBase.getManager().reorderCompression(channel); - } - - @Override - public ProtocolVersion viaForge$getTrackedVersion() { - return viaForge$targetVersion; - } - - @Override - public void viaForge$setTrackedVersion(final ProtocolVersion version) { - viaForge$targetVersion = version; - } - /** * @author As_pw * @reason Packet Tracking diff --git a/src/main/java/net/aspw/client/injection/forge/mixins/network/MixinNetworkPlayerInfo.java b/src/main/java/net/aspw/client/injection/forge/mixins/network/MixinNetworkPlayerInfo.java index caf85268..1a0e42fd 100644 --- a/src/main/java/net/aspw/client/injection/forge/mixins/network/MixinNetworkPlayerInfo.java +++ b/src/main/java/net/aspw/client/injection/forge/mixins/network/MixinNetworkPlayerInfo.java @@ -10,14 +10,8 @@ import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; -/** - * The type Mixin network player info. - */ @Mixin(NetworkPlayerInfo.class) public class MixinNetworkPlayerInfo { - @Shadow - @Final - private GameProfile gameProfile; @Inject(method = "getLocationSkin", at = @At("HEAD")) private void injectSkinProtect(CallbackInfoReturnable cir) { diff --git a/src/main/java/net/aspw/client/injection/forge/mixins/network/MixinServerData.java b/src/main/java/net/aspw/client/injection/forge/mixins/network/MixinServerData.java deleted file mode 100644 index 092e89ec..00000000 --- a/src/main/java/net/aspw/client/injection/forge/mixins/network/MixinServerData.java +++ /dev/null @@ -1,58 +0,0 @@ -package net.aspw.client.injection.forge.mixins.network; - -import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; -import net.aspw.client.protocol.api.ExtendedServerData; -import net.minecraft.client.multiplayer.ServerData; -import net.minecraft.nbt.NBTTagCompound; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Unique; -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; -import org.spongepowered.asm.mixin.injection.callback.LocalCapture; - -@Mixin(ServerData.class) -public class MixinServerData implements ExtendedServerData { - - @Unique - private ProtocolVersion viaForge$version; - - @Inject(method = "getNBTCompound", at = @At(value = "INVOKE", target = "Lnet/minecraft/nbt/NBTTagCompound;setString(Ljava/lang/String;Ljava/lang/String;)V", ordinal = 0), locals = LocalCapture.CAPTURE_FAILHARD) - public void saveVersion(CallbackInfoReturnable cir, NBTTagCompound nbttagcompound) { - if (viaForge$version != null) { - nbttagcompound.setString("viaForge$version", viaForge$version.getName()); - } - } - - @Inject(method = "getServerDataFromNBTCompound", at = @At(value = "TAIL")) - private static void getVersion(NBTTagCompound nbtCompound, CallbackInfoReturnable cir) { - if (nbtCompound.hasKey("viaForge$version")) { - ProtocolVersion version; - if (nbtCompound.getInteger("viaForge$version") != 0) { - version = ProtocolVersion.getProtocol(nbtCompound.getInteger("viaForge$version")); - } else { - version = ProtocolVersion.getClosest(nbtCompound.getString("viaForge$version")); - } - ((ExtendedServerData) cir.getReturnValue()).viaForge$setVersion(version); - } - } - - @Inject(method = "copyFrom", at = @At("HEAD")) - public void track(ServerData serverDataIn, CallbackInfo ci) { - if (serverDataIn instanceof ExtendedServerData) { - viaForge$version = ((ExtendedServerData) serverDataIn).viaForge$getVersion(); - } - } - - @Override - public ProtocolVersion viaForge$getVersion() { - return viaForge$version; - } - - @Override - public void viaForge$setVersion(ProtocolVersion version) { - viaForge$version = version; - } - -} \ No newline at end of file diff --git a/src/main/java/net/aspw/client/injection/forge/mixins/packets/MixinC00Handshake.java b/src/main/java/net/aspw/client/injection/forge/mixins/packets/MixinC00Handshake.java index ec79bd9d..617925d3 100644 --- a/src/main/java/net/aspw/client/injection/forge/mixins/packets/MixinC00Handshake.java +++ b/src/main/java/net/aspw/client/injection/forge/mixins/packets/MixinC00Handshake.java @@ -3,7 +3,6 @@ import net.aspw.client.Launch; import net.aspw.client.features.module.impl.other.BrandSpoofer; import net.aspw.client.utils.MinecraftInstance; -import net.minecraft.network.EnumConnectionState; import net.minecraft.network.handshake.client.C00Handshake; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; @@ -17,12 +16,6 @@ public class MixinC00Handshake { @Shadow public int port; - @Shadow - public String ip; - @Shadow - private int protocolVersion; - @Shadow - private EnumConnectionState requestedState; @ModifyConstant(method = "writePacketData", constant = @Constant(stringValue = "\u0000FML\u0000")) private String injectAntiForge(String constant) { diff --git a/src/main/java/net/aspw/client/injection/forge/mixins/render/MixinEntityRenderer.java b/src/main/java/net/aspw/client/injection/forge/mixins/render/MixinEntityRenderer.java index 1963517a..f4665f07 100644 --- a/src/main/java/net/aspw/client/injection/forge/mixins/render/MixinEntityRenderer.java +++ b/src/main/java/net/aspw/client/injection/forge/mixins/render/MixinEntityRenderer.java @@ -33,11 +33,9 @@ import static org.objectweb.asm.Opcodes.GETFIELD; -/** - * The type Mixin entity renderer. - */ @Mixin(EntityRenderer.class) public abstract class MixinEntityRenderer { + @Mutable @Final @Shadow @@ -63,18 +61,6 @@ public abstract class MixinEntityRenderer { @Shadow private boolean lightmapUpdateNeeded; - /** - * Instantiates a new Mixin entity renderer. - * - * @param lightmapColors the lightmap colors - * @param lightmapTexture the lightmap texture - * @param torchFlickerX the torch flicker x - * @param bossColorModifier the boss color modifier - * @param bossColorModifierPrev the boss color modifier prev - * @param mc the mc - * @param thirdPersonDistanceTemp the third person distance temp - * @param thirdPersonDistance the third person distance - */ protected MixinEntityRenderer(int[] lightmapColors, DynamicTexture lightmapTexture, float torchFlickerX, float bossColorModifier, float bossColorModifierPrev, Minecraft mc, float thirdPersonDistanceTemp, float thirdPersonDistance) { this.lightmapColors = lightmapColors; this.lightmapTexture = lightmapTexture; @@ -241,12 +227,6 @@ private void getMouseOver(float p_getMouseOver_1_, CallbackInfo ci) { ci.cancel(); } - /** - * Update camera and render boolean. - * - * @param minecraft the minecraft - * @return the boolean - */ @Redirect(method = "updateCameraAndRender", at = @At(value = "FIELD", target = "Lnet/minecraft/client/Minecraft;inGameHasFocus:Z", opcode = GETFIELD)) public boolean updateCameraAndRender(Minecraft minecraft) { if (RotationUtils.perspectiveToggled) { @@ -254,45 +234,21 @@ public boolean updateCameraAndRender(Minecraft minecraft) { } else return mc.inGameHasFocus && Display.isActive(); } - /** - * Gets rotation yaw. - * - * @param entity the entity - * @return the rotation yaw - */ @Redirect(method = "orientCamera", at = @At(value = "FIELD", target = "Lnet/minecraft/entity/Entity;rotationYaw:F", opcode = GETFIELD)) public float getRotationYaw(Entity entity) { return RotationUtils.perspectiveToggled ? RotationUtils.cameraYaw : entity.rotationYaw; } - /** - * Gets prev rotation yaw. - * - * @param entity the entity - * @return the prev rotation yaw - */ @Redirect(method = "orientCamera", at = @At(value = "FIELD", target = "Lnet/minecraft/entity/Entity;prevRotationYaw:F", opcode = GETFIELD)) public float getPrevRotationYaw(Entity entity) { return RotationUtils.perspectiveToggled ? RotationUtils.cameraYaw : entity.prevRotationYaw; } - /** - * Gets rotation pitch. - * - * @param entity the entity - * @return the rotation pitch - */ @Redirect(method = "orientCamera", at = @At(value = "FIELD", target = "Lnet/minecraft/entity/Entity;rotationPitch:F", opcode = GETFIELD)) public float getRotationPitch(Entity entity) { return RotationUtils.perspectiveToggled ? RotationUtils.cameraPitch : entity.rotationPitch; } - /** - * Gets prev rotation pitch. - * - * @param entity the entity - * @return the prev rotation pitch - */ @Redirect(method = "orientCamera", at = @At(value = "FIELD", target = "Lnet/minecraft/entity/Entity;prevRotationPitch:F")) public float getPrevRotationPitch(Entity entity) { return RotationUtils.perspectiveToggled ? RotationUtils.cameraPitch : entity.prevRotationPitch; @@ -300,7 +256,7 @@ public float getPrevRotationPitch(Entity entity) { /** * @author As_pw - * @reason LightMap + * @reason Light Map Renderer */ @Overwrite private void updateLightmap(float f2) { diff --git a/src/main/java/net/aspw/client/injection/forge/mixins/render/MixinFontRenderer.java b/src/main/java/net/aspw/client/injection/forge/mixins/render/MixinFontRenderer.java index ff382026..c598f354 100644 --- a/src/main/java/net/aspw/client/injection/forge/mixins/render/MixinFontRenderer.java +++ b/src/main/java/net/aspw/client/injection/forge/mixins/render/MixinFontRenderer.java @@ -10,15 +10,9 @@ import org.spongepowered.asm.mixin.injection.ModifyVariable; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; -/** - * The type Mixin font renderer. - */ @Mixin(FontRenderer.class) public abstract class MixinFontRenderer { - /** - * Reset styles. - */ @Shadow protected abstract void resetStyles(); @@ -56,5 +50,4 @@ private String getStringWidth(final String string) { Launch.eventManager.callEvent(textEvent); return textEvent.getText(); } - -} +} \ No newline at end of file diff --git a/src/main/java/net/aspw/client/injection/forge/mixins/render/MixinInventoryEffectRenderer.java b/src/main/java/net/aspw/client/injection/forge/mixins/render/MixinInventoryEffectRenderer.java index 07efddb1..d48c7d09 100644 --- a/src/main/java/net/aspw/client/injection/forge/mixins/render/MixinInventoryEffectRenderer.java +++ b/src/main/java/net/aspw/client/injection/forge/mixins/render/MixinInventoryEffectRenderer.java @@ -6,9 +6,6 @@ import org.spongepowered.asm.mixin.Overwrite; import org.spongepowered.asm.mixin.Shadow; -/** - * The type Mixin inventory effect renderer. - */ @Mixin(InventoryEffectRenderer.class) public abstract class MixinInventoryEffectRenderer extends MixinGuiContainer { @@ -16,8 +13,6 @@ public abstract class MixinInventoryEffectRenderer extends MixinGuiContainer { private boolean hasActivePotionEffects; /** - * Update active potion effects. - * * @author As_pw * @reason Effects */ diff --git a/src/main/java/net/aspw/client/injection/forge/mixins/render/MixinLayerArmorBase.java b/src/main/java/net/aspw/client/injection/forge/mixins/render/MixinLayerArmorBase.java index 952da5bf..933e972c 100644 --- a/src/main/java/net/aspw/client/injection/forge/mixins/render/MixinLayerArmorBase.java +++ b/src/main/java/net/aspw/client/injection/forge/mixins/render/MixinLayerArmorBase.java @@ -1,9 +1,7 @@ package net.aspw.client.injection.forge.mixins.render; import net.aspw.client.Launch; -import net.aspw.client.features.api.McUpdatesHandler; import net.aspw.client.features.module.impl.visual.CustomModel; -import net.aspw.client.protocol.api.ProtocolFixer; import net.aspw.client.utils.MinecraftInstance; import net.minecraft.client.renderer.entity.layers.LayerArmorBase; import net.minecraft.entity.EntityLivingBase; @@ -14,31 +12,13 @@ import java.util.Objects; -/** - * The type Mixin layer armor base. - */ @Mixin({LayerArmorBase.class}) public class MixinLayerArmorBase { - /** - * Do render layer. - * - * @param entitylivingbaseIn the entitylivingbase in - * @param limbSwing the limb swing - * @param limbSwingAmount the limb swing amount - * @param partialTicks the partial ticks - * @param ageInTicks the age in ticks - * @param netHeadYaw the net head yaw - * @param headPitch the head pitch - * @param scale the scale - * @param ci the ci - */ + @Inject(method = {"doRenderLayer"}, at = {@At("HEAD")}, cancellable = true) public void doRenderLayer(final EntityLivingBase entitylivingbaseIn, final float limbSwing, final float limbSwingAmount, final float partialTicks, final float ageInTicks, final float netHeadYaw, final float headPitch, final float scale, final CallbackInfo ci) { final CustomModel customModel = Objects.requireNonNull(Launch.moduleManager.getModule(CustomModel.class)); - if (ProtocolFixer.newerThanOrEqualsTo1_13() && McUpdatesHandler.shouldAnimation() && entitylivingbaseIn == MinecraftInstance.mc.thePlayer) - ci.cancel(); - if (customModel.getState() && customModel.getOnlySelf().get() && entitylivingbaseIn == MinecraftInstance.mc.thePlayer) { ci.cancel(); } else if (customModel.getState() && !customModel.getOnlySelf().get()) { diff --git a/src/main/java/net/aspw/client/injection/forge/mixins/render/MixinLayerCape.java b/src/main/java/net/aspw/client/injection/forge/mixins/render/MixinLayerCape.java index 1e14ded1..2c6377c1 100644 --- a/src/main/java/net/aspw/client/injection/forge/mixins/render/MixinLayerCape.java +++ b/src/main/java/net/aspw/client/injection/forge/mixins/render/MixinLayerCape.java @@ -15,9 +15,6 @@ import java.util.Objects; -/** - * The type Mixin layer arrow. - */ @Mixin(LayerCape.class) public class MixinLayerCape { @@ -32,7 +29,7 @@ public MixinLayerCape(RenderPlayer playerRenderer) { /** * @author As_pw - * @reason Improve Cape Renderer + * @reason Cape Renderer */ @Overwrite public void doRenderLayer(final AbstractClientPlayer entitylivingbaseIn, final float p_177141_2_, final float p_177141_3_, final float partialTicks, final float p_177141_5_, final float p_177141_6_, final float p_177141_7_, final float scale) { @@ -46,7 +43,7 @@ public void doRenderLayer(final AbstractClientPlayer entitylivingbaseIn, final f double d2 = entitylivingbaseIn.prevChasingPosZ + (entitylivingbaseIn.chasingPosZ - entitylivingbaseIn.prevChasingPosZ) * (double) partialTicks - (entitylivingbaseIn.prevPosZ + (entitylivingbaseIn.posZ - entitylivingbaseIn.prevPosZ) * (double) partialTicks); float f = entitylivingbaseIn.prevRenderYawOffset + (entitylivingbaseIn.renderYawOffset - entitylivingbaseIn.prevRenderYawOffset) * partialTicks; switch (Objects.requireNonNull(Launch.moduleManager.getModule(Cape.class)).getAnimationModeValue().get()) { - case "Vanilla": + case "Normal": f = entitylivingbaseIn.prevRenderYawOffset + (entitylivingbaseIn.renderYawOffset - entitylivingbaseIn.prevRenderYawOffset) * partialTicks; break; case "Smooth": @@ -91,4 +88,4 @@ public void doRenderLayer(final AbstractClientPlayer entitylivingbaseIn, final f GL11.glPopMatrix(); } } -} +} \ No newline at end of file diff --git a/src/main/java/net/aspw/client/injection/forge/mixins/render/MixinLayerHeldItem.java b/src/main/java/net/aspw/client/injection/forge/mixins/render/MixinLayerHeldItem.java index 49c40ca8..76992255 100644 --- a/src/main/java/net/aspw/client/injection/forge/mixins/render/MixinLayerHeldItem.java +++ b/src/main/java/net/aspw/client/injection/forge/mixins/render/MixinLayerHeldItem.java @@ -23,9 +23,6 @@ import java.util.UUID; -/** - * The type Mixin layer held item. - */ @Mixin(LayerHeldItem.class) public class MixinLayerHeldItem { @@ -34,18 +31,8 @@ public class MixinLayerHeldItem { private RendererLivingEntity livingEntityRenderer; /** - * Do render layer. - * - * @param entitylivingbaseIn the entitylivingbase in - * @param p_177141_2_ the p 177141 2 - * @param p_177141_3_ the p 177141 3 - * @param partialTicks the partial ticks - * @param p_177141_5_ the p 177141 5 - * @param p_177141_6_ the p 177141 6 - * @param p_177141_7_ the p 177141 7 - * @param scale the scale * @author As_pw - * @reason doLayer + * @reason Render Layer */ @Overwrite public void doRenderLayer(EntityLivingBase entitylivingbaseIn, float p_177141_2_, float p_177141_3_, float partialTicks, float p_177141_5_, float p_177141_6_, float p_177141_7_, float scale) { diff --git a/src/main/java/net/aspw/client/injection/forge/mixins/render/MixinLayerSpiderEyes.java b/src/main/java/net/aspw/client/injection/forge/mixins/render/MixinLayerSpiderEyes.java index 5ec702ff..731c8e8b 100644 --- a/src/main/java/net/aspw/client/injection/forge/mixins/render/MixinLayerSpiderEyes.java +++ b/src/main/java/net/aspw/client/injection/forge/mixins/render/MixinLayerSpiderEyes.java @@ -7,11 +7,9 @@ import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; -/** - * The type Mixin layer spider eyes. - */ @Mixin(LayerSpiderEyes.class) public class MixinLayerSpiderEyes { + @Inject(method = "doRenderLayer(Lnet/minecraft/entity/monster/EntitySpider;FFFFFFF)V", at = @At("TAIL")) private void fixDepth(CallbackInfo ci) { GlStateManager.depthMask(true); diff --git a/src/main/java/net/aspw/client/injection/forge/mixins/render/MixinLayerWitherAura.java b/src/main/java/net/aspw/client/injection/forge/mixins/render/MixinLayerWitherAura.java index c21b154f..160d8d1b 100644 --- a/src/main/java/net/aspw/client/injection/forge/mixins/render/MixinLayerWitherAura.java +++ b/src/main/java/net/aspw/client/injection/forge/mixins/render/MixinLayerWitherAura.java @@ -7,11 +7,9 @@ import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; -/** - * The type Mixin layer wither aura. - */ @Mixin(LayerWitherAura.class) public class MixinLayerWitherAura { + @Inject(method = "doRenderLayer(Lnet/minecraft/entity/boss/EntityWither;FFFFFFF)V", at = @At("TAIL")) private void fixDepth(CallbackInfo ci) { GlStateManager.depthMask(true); diff --git a/src/main/java/net/aspw/client/injection/forge/mixins/render/MixinModelBiped.java b/src/main/java/net/aspw/client/injection/forge/mixins/render/MixinModelBiped.java index 4e40b17b..bb9fb86f 100644 --- a/src/main/java/net/aspw/client/injection/forge/mixins/render/MixinModelBiped.java +++ b/src/main/java/net/aspw/client/injection/forge/mixins/render/MixinModelBiped.java @@ -1,18 +1,15 @@ package net.aspw.client.injection.forge.mixins.render; import net.aspw.client.Launch; -import net.aspw.client.features.api.McUpdatesHandler; import net.aspw.client.features.api.PacketManager; import net.aspw.client.features.module.impl.combat.KillAura; import net.aspw.client.features.module.impl.combat.KillAuraRecode; import net.aspw.client.features.module.impl.combat.TPAura; import net.aspw.client.features.module.impl.movement.SilentSneak; import net.aspw.client.features.module.impl.visual.Animations; -import net.aspw.client.protocol.api.ProtocolFixer; import net.aspw.client.utils.MinecraftInstance; import net.minecraft.client.model.ModelBiped; import net.minecraft.client.model.ModelRenderer; -import net.minecraft.client.renderer.GlStateManager; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemSword; @@ -24,30 +21,18 @@ import java.util.Objects; -/** - * The type Mixin model biped. - */ @Mixin(ModelBiped.class) public abstract class MixinModelBiped { @Shadow public ModelRenderer bipedRightArm; - @Shadow - public ModelRenderer bipedLeftArm; - @Shadow public int heldItemRight; @Shadow public boolean isSneak; - @Shadow - public ModelRenderer bipedHead; - - @Shadow - public ModelRenderer bipedHeadwear; - @Inject(method = "setRotationAngles", at = @At(value = "FIELD", target = "Lnet/minecraft/client/model/ModelBiped;swingProgress:F")) private void revertSwordAnimation(float p_setRotationAngles1, float p_setRotationAngles2, float p_setRotationAngles3, float p_setRotationAngles4, float p_setRotationAngles5, float p_setRotationAngles6, Entity p_setRotationAngles7, CallbackInfo callbackInfo) { final KillAura killAura = Objects.requireNonNull(Launch.moduleManager.getModule(KillAura.class)); @@ -55,21 +40,6 @@ private void revertSwordAnimation(float p_setRotationAngles1, float p_setRotatio final KillAuraRecode killAuraRecode = Objects.requireNonNull(Launch.moduleManager.getModule(KillAuraRecode.class)); final SilentSneak silentSneak = Objects.requireNonNull(Launch.moduleManager.getModule(SilentSneak.class)); - if (ProtocolFixer.newerThanOrEqualsTo1_13() && McUpdatesHandler.shouldAnimation() && p_setRotationAngles7 instanceof EntityPlayer && p_setRotationAngles7.equals(MinecraftInstance.mc.thePlayer)) { - GlStateManager.rotate(45.0F, 1F, 0.0F, 0.0F); - GlStateManager.translate(0.0F, 0.0F, -0.7F); - - float swing = MinecraftInstance.mc.thePlayer.limbSwing / 3; - - this.bipedHead.rotateAngleX = -0.95f; - this.bipedHeadwear.rotateAngleX = -0.95f; - this.bipedLeftArm.rotateAngleX = swing; - this.bipedRightArm.rotateAngleX = swing; - this.bipedLeftArm.rotateAngleY = swing; - this.bipedRightArm.rotateAngleY = -swing; - this.isSneak = false; - } - if (silentSneak.getState() && silentSneak.modeValue.get().equals("Normal") && p_setRotationAngles7.equals(MinecraftInstance.mc.thePlayer)) this.isSneak = true; diff --git a/src/main/java/net/aspw/client/injection/forge/mixins/render/MixinModelPlayer.java b/src/main/java/net/aspw/client/injection/forge/mixins/render/MixinModelPlayer.java index 0ef28b70..15478840 100644 --- a/src/main/java/net/aspw/client/injection/forge/mixins/render/MixinModelPlayer.java +++ b/src/main/java/net/aspw/client/injection/forge/mixins/render/MixinModelPlayer.java @@ -20,25 +20,17 @@ import java.awt.*; import java.util.Objects; -/** - * The type Mixin model player. - */ @Mixin(RenderItem.class) - public abstract class MixinModelPlayer { + @Final @Shadow private static ResourceLocation RES_ITEM_GLINT; + @Final @Shadow private TextureManager textureManager; - /** - * Render model. - * - * @param model the model - * @param color the color - */ @Shadow protected abstract void renderModel(IBakedModel model, int color); @@ -98,4 +90,4 @@ private void renderEffect(IBakedModel model, CallbackInfo callbackInfo) { callbackInfo.cancel(); } } -} +} \ No newline at end of file diff --git a/src/main/java/net/aspw/client/injection/forge/mixins/render/MixinModelPlayerFix.java b/src/main/java/net/aspw/client/injection/forge/mixins/render/MixinModelPlayerFix.java index 454c1558..224c1b75 100644 --- a/src/main/java/net/aspw/client/injection/forge/mixins/render/MixinModelPlayerFix.java +++ b/src/main/java/net/aspw/client/injection/forge/mixins/render/MixinModelPlayerFix.java @@ -25,205 +25,67 @@ import java.awt.*; import java.util.Objects; -/** - * The type Mixin model player fix. - */ @Mixin(ModelPlayer.class) public class MixinModelPlayerFix extends ModelBiped { - /** - * The Left leg. - */ public ModelRenderer left_leg; - /** - * The Right leg. - */ public ModelRenderer right_leg; - /** - * The Body. - */ public ModelRenderer body; - /** - * The Eye. - */ public ModelRenderer eye; - /** - * The Rabbit bone. - */ public ModelRenderer rabbitBone; - /** - * The Rabbit rleg. - */ public ModelRenderer rabbitRleg; - /** - * The Rabbit larm. - */ public ModelRenderer rabbitLarm; - /** - * The Rabbit rarm. - */ public ModelRenderer rabbitRarm; - /** - * The Rabbit lleg. - */ public ModelRenderer rabbitLleg; - /** - * The Rabbit head. - */ public ModelRenderer rabbitHead; - /** - * The Fredhead. - */ public ModelRenderer fredhead; - /** - * The Arm left. - */ public ModelRenderer armLeft; - /** - * The Leg right. - */ public ModelRenderer legRight; - /** - * The Leg left. - */ public ModelRenderer legLeft; - /** - * The Arm right. - */ public ModelRenderer armRight; - /** - * The Fredbody. - */ public ModelRenderer fredbody; - /** - * The Arm leftpad 2. - */ public ModelRenderer armLeftpad2; - /** - * The Torso. - */ public ModelRenderer torso; - /** - * The Ear rightpad 1. - */ public ModelRenderer earRightpad_1; - /** - * The Arm rightpad 2. - */ public ModelRenderer armRightpad2; - /** - * The Leg leftpad. - */ public ModelRenderer legLeftpad; - /** - * The Hat. - */ public ModelRenderer hat; - /** - * The Leg leftpad 2. - */ public ModelRenderer legLeftpad2; - /** - * The Arm right 2. - */ public ModelRenderer armRight2; - /** - * The Leg right 2. - */ public ModelRenderer legRight2; - /** - * The Ear rightpad. - */ public ModelRenderer earRightpad; - /** - * The Arm left 2. - */ public ModelRenderer armLeft2; - /** - * The Frednose. - */ public ModelRenderer frednose; - /** - * The Ear left. - */ public ModelRenderer earLeft; - /** - * The Foot right. - */ public ModelRenderer footRight; - /** - * The Leg rightpad 2. - */ public ModelRenderer legRightpad2; - /** - * The Leg rightpad. - */ public ModelRenderer legRightpad; - /** - * The Arm leftpad. - */ public ModelRenderer armLeftpad; - /** - * The Leg left 2. - */ public ModelRenderer legLeft2; - /** - * The Foot left. - */ public ModelRenderer footLeft; - /** - * The Hat 2. - */ public ModelRenderer hat2; - /** - * The Arm rightpad. - */ public ModelRenderer armRightpad; - /** - * The Ear right. - */ public ModelRenderer earRight; - /** - * The Crotch. - */ public ModelRenderer crotch; - /** - * The Jaw. - */ public ModelRenderer jaw; - /** - * The Hand right. - */ public ModelRenderer handRight; - /** - * The Hand left. - */ public ModelRenderer handLeft; - /** - * The Biped left armwear. - */ + @Shadow public ModelRenderer bipedLeftArmwear; - /** - * The Biped right armwear. - */ + @Shadow public ModelRenderer bipedRightArmwear; - /** - * The Biped left legwear. - */ + @Shadow public ModelRenderer bipedLeftLegwear; - /** - * The Biped right legwear. - */ + @Shadow public ModelRenderer bipedRightLegwear; - /** - * The Biped body wear. - */ + @Shadow public ModelRenderer bipedBodyWear; + @Shadow private boolean smallArms; @@ -234,7 +96,7 @@ private float fixAlexArmHeight(final float original) { /** * @author As_pw - * @reason PostRender + * @reason Post Arm Renderer */ @Override @Overwrite @@ -248,18 +110,6 @@ public void postRenderArm(final float scale) { } } - /** - * Render hook. - * - * @param entityIn the entity in - * @param limbSwing the limb swing - * @param limbSwingAmount the limb swing amount - * @param ageInTicks the age in ticks - * @param netHeadYaw the net head yaw - * @param headPitch the head pitch - * @param scale the scale - * @param ci the ci - */ @Inject(method = {"render"}, at = {@At("HEAD")}, cancellable = true) public void renderHook(final Entity entityIn, final float limbSwing, final float limbSwingAmount, final float ageInTicks, final float netHeadYaw, final float headPitch, final float scale, final CallbackInfo ci) { final CustomModel customModel = Objects.requireNonNull(Launch.moduleManager.getModule(CustomModel.class)); @@ -269,23 +119,12 @@ public void renderHook(final Entity entityIn, final float limbSwing, final float } } - /** - * Sets rotation angle. - * - * @param modelRenderer the model renderer - * @param x the x - * @param y the y - * @param z the z - */ public void setRotationAngle(final ModelRenderer modelRenderer, final float x, final float y, final float z) { modelRenderer.rotateAngleX = x; modelRenderer.rotateAngleY = y; modelRenderer.rotateAngleZ = z; } - /** - * Generatemodel. - */ public void generatemodel() { body = new ModelRenderer(this); body.setRotationPoint(0.0F, 0.0F, 0.0F); @@ -503,23 +342,11 @@ public void generatemodel() { this.fredhead.addChild(this.earLeft); } - /** - * Render custom. - * - * @param entityIn the entity in - * @param limbSwing the limb swing - * @param limbSwingAmount the limb swing amount - * @param ageInTicks the age in ticks - * @param netHeadYaw the net head yaw - * @param headPitch the head pitch - * @param scale the scale - */ public void renderCustom(final Entity entityIn, final float limbSwing, final float limbSwingAmount, final float ageInTicks, final float netHeadYaw, final float headPitch, final float scale) { if (left_leg == null) { generatemodel(); } - final CustomModel customModel = Objects.requireNonNull(Launch.moduleManager.getModule(CustomModel.class)); GlStateManager.pushMatrix(); if ((!customModel.getOnlySelf().getValue() || entityIn == (MinecraftInstance.mc).thePlayer)) { diff --git a/src/main/java/net/aspw/client/injection/forge/mixins/render/MixinRender.java b/src/main/java/net/aspw/client/injection/forge/mixins/render/MixinRender.java index cd9fc546..8a8990ab 100644 --- a/src/main/java/net/aspw/client/injection/forge/mixins/render/MixinRender.java +++ b/src/main/java/net/aspw/client/injection/forge/mixins/render/MixinRender.java @@ -10,18 +10,9 @@ import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; -/** - * The type Mixin render. - */ @Mixin(Render.class) public abstract class MixinRender { - /** - * Bind entity texture boolean. - * - * @param the type parameter - * @param entity the entity - * @return the boolean - */ + @Shadow protected abstract boolean bindEntityTexture(T entity); diff --git a/src/main/java/net/aspw/client/injection/forge/mixins/render/MixinRenderEntityItem.java b/src/main/java/net/aspw/client/injection/forge/mixins/render/MixinRenderEntityItem.java index b69d5413..367e9335 100644 --- a/src/main/java/net/aspw/client/injection/forge/mixins/render/MixinRenderEntityItem.java +++ b/src/main/java/net/aspw/client/injection/forge/mixins/render/MixinRenderEntityItem.java @@ -17,32 +17,19 @@ import org.spongepowered.asm.mixin.Overwrite; import org.spongepowered.asm.mixin.Shadow; -/** - * The type Mixin render entity item. - */ @Mixin(RenderEntityItem.class) public abstract class MixinRenderEntityItem extends Render { - /** - * Instantiates a new Mixin render entity item. - * - * @param p_i46179_1_ the p i 46179 1 - */ + protected MixinRenderEntityItem(final RenderManager p_i46179_1_) { super(p_i46179_1_); } - /** - * Func 177078 a int. - * - * @param p0 the p 0 - * @return the int - */ @Shadow protected abstract int func_177078_a(final ItemStack p0); /** * @author As_pw - * @reason ItemPhysics + * @reason Item Physics */ @Overwrite private int func_177077_a(EntityItem itemIn, double p_177077_2_, double p_177077_4_, double p_177077_6_, float p_177077_8_, IBakedModel p_177077_9_) { diff --git a/src/main/java/net/aspw/client/injection/forge/mixins/render/MixinRenderItem.java b/src/main/java/net/aspw/client/injection/forge/mixins/render/MixinRenderItem.java index 7b131750..96f2980c 100644 --- a/src/main/java/net/aspw/client/injection/forge/mixins/render/MixinRenderItem.java +++ b/src/main/java/net/aspw/client/injection/forge/mixins/render/MixinRenderItem.java @@ -20,25 +20,18 @@ import java.awt.*; import java.util.Objects; -/** - * The type Mixin render item. - */ @Mixin(RenderItem.class) public abstract class MixinRenderItem { + @Final @Shadow private static ResourceLocation RES_ITEM_GLINT; + @Final @Shadow private TextureManager textureManager; - /** - * Render model. - * - * @param model the model - * @param color the color - */ @Shadow protected abstract void renderModel(IBakedModel model, int color); @@ -98,4 +91,4 @@ private void renderEffect(IBakedModel model, CallbackInfo callbackInfo) { callbackInfo.cancel(); } } -} +} \ No newline at end of file diff --git a/src/main/java/net/aspw/client/injection/forge/mixins/render/MixinRenderPlayer.java b/src/main/java/net/aspw/client/injection/forge/mixins/render/MixinRenderPlayer.java index 22cfd924..a159069f 100644 --- a/src/main/java/net/aspw/client/injection/forge/mixins/render/MixinRenderPlayer.java +++ b/src/main/java/net/aspw/client/injection/forge/mixins/render/MixinRenderPlayer.java @@ -13,21 +13,13 @@ import java.util.Objects; -/** - * The type Mixin render player. - */ @Mixin(RenderPlayer.class) public class MixinRenderPlayer { + private final ResourceLocation rabbit = new ResourceLocation("client/models/rabbit.png"); private final ResourceLocation fred = new ResourceLocation("client/models/freddy.png"); private final ResourceLocation imposter = new ResourceLocation("client/models/imposter.png"); - /** - * Gets entity texture. - * - * @param entity the entity - * @param ci the ci - */ @Inject(method = {"getEntityTexture"}, at = {@At("HEAD")}, cancellable = true) public void getEntityTexture(AbstractClientPlayer entity, CallbackInfoReturnable ci) { final CustomModel customModel = Objects.requireNonNull(Launch.moduleManager.getModule(CustomModel.class)); diff --git a/src/main/java/net/aspw/client/injection/forge/mixins/render/MixinRendererLivingEntity.java b/src/main/java/net/aspw/client/injection/forge/mixins/render/MixinRendererLivingEntity.java index 03b9239b..6000758b 100644 --- a/src/main/java/net/aspw/client/injection/forge/mixins/render/MixinRendererLivingEntity.java +++ b/src/main/java/net/aspw/client/injection/forge/mixins/render/MixinRendererLivingEntity.java @@ -16,141 +16,21 @@ import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; -/** - * The type Mixin renderer living entity. - */ @Mixin(RendererLivingEntity.class) public abstract class MixinRendererLivingEntity extends MixinRender { + @Final @Shadow private static final Logger logger = LogManager.getLogger(); - /** - * The Main model. - */ + @Shadow protected ModelBase mainModel; - /** - * The Render outlines. - */ - @Shadow - protected boolean renderOutlines = false; - /** - * Gets death max rotation. - * - * @param the type parameter - * @param p_getDeathMaxRotation_1_ the p get death max rotation 1 - * @return the death max rotation - */ @Shadow protected float getDeathMaxRotation(T p_getDeathMaxRotation_1_) { return 90.0F; } - /** - * Interpolate rotation float. - * - * @param par1 the par 1 - * @param par2 the par 2 - * @param par3 the par 3 - * @return the float - */ - @Shadow - protected abstract float interpolateRotation(float par1, float par2, float par3); - - /** - * Sets do render brightness. - * - * @param the type parameter - * @param entityLivingBaseIn the entity living base in - * @param partialTicks the partial ticks - * @return the do render brightness - */ - @Shadow - protected abstract boolean setDoRenderBrightness(T entityLivingBaseIn, float partialTicks); - - /** - * Sets score team color. - * - * @param the type parameter - * @param entityLivingBaseIn the entity living base in - * @return the score team color - */ - @Shadow - protected abstract boolean setScoreTeamColor(T entityLivingBaseIn); - - /** - * Gets swing progress. - * - * @param the type parameter - * @param livingBase the living base - * @param partialTickTime the partial tick time - * @return the swing progress - */ - @Shadow - protected abstract float getSwingProgress(T livingBase, float partialTickTime); - - /** - * Unset score team color. - */ - @Shadow - protected abstract void unsetScoreTeamColor(); - - /** - * Pre render callback. - * - * @param the type parameter - * @param entitylivingbaseIn the entitylivingbase in - * @param partialTickTime the partial tick time - */ - @Shadow - protected abstract void preRenderCallback(T entitylivingbaseIn, float partialTickTime); - - /** - * Unset brightness. - */ - @Shadow - protected abstract void unsetBrightness(); - - /** - * Render living at. - * - * @param the type parameter - * @param entityLivingBaseIn the entity living base in - * @param x the x - * @param y the y - * @param z the z - */ - @Shadow - protected abstract void renderLivingAt(T entityLivingBaseIn, double x, double y, double z); - - /** - * Handle rotation float float. - * - * @param the type parameter - * @param livingBase the living base - * @param partialTicks the partial ticks - * @return the float - */ - @Shadow - protected abstract float handleRotationFloat(T livingBase, float partialTicks); - - /** - * Render layers. - * - * @param the type parameter - * @param entitylivingbaseIn the entitylivingbase in - * @param p_177093_2_ the p 177093 2 - * @param p_177093_3_ the p 177093 3 - * @param partialTicks the partial ticks - * @param p_177093_5_ the p 177093 5 - * @param p_177093_6_ the p 177093 6 - * @param p_177093_7_ the p 177093 7 - * @param p_177093_8_ the p 177093 8 - */ - @Shadow - protected abstract void renderLayers(T entitylivingbaseIn, float p_177093_2_, float p_177093_3_, float partialTicks, float p_177093_5_, float p_177093_6_, float p_177093_7_, float p_177093_8_); - @Inject(method = "canRenderName(Lnet/minecraft/entity/EntityLivingBase;)Z", at = @At("HEAD"), cancellable = true) private void canRenderName(T entity, CallbackInfoReturnable callbackInfoReturnable) { if (ESP.shouldCancelNameTag(entity)) @@ -159,7 +39,7 @@ private void canRenderName(T entity, CallbackInfoRe /** * @author As_pw - * @reason Fix Renderer + * @reason Visible Renderer Fix */ @Overwrite protected void renderModel(T entitylivingbaseIn, float p_77036_2_, float p_77036_3_, float p_77036_4_, float p_77036_5_, float p_77036_6_, float scaleFactor) { diff --git a/src/main/java/net/aspw/client/injection/forge/mixins/render/MixinVisGraph.java b/src/main/java/net/aspw/client/injection/forge/mixins/render/MixinVisGraph.java index 84cddef9..57b753fe 100644 --- a/src/main/java/net/aspw/client/injection/forge/mixins/render/MixinVisGraph.java +++ b/src/main/java/net/aspw/client/injection/forge/mixins/render/MixinVisGraph.java @@ -10,9 +10,6 @@ import java.util.Objects; -/** - * The type Mixin vis graph. - */ @Mixin(VisGraph.class) public class MixinVisGraph { diff --git a/src/main/java/net/aspw/client/injection/forge/mixins/tweaks/MixinAnvilChunkLoader.java b/src/main/java/net/aspw/client/injection/forge/mixins/tweaks/MixinAnvilChunkLoader.java index e3dbdcd1..62f10fef 100644 --- a/src/main/java/net/aspw/client/injection/forge/mixins/tweaks/MixinAnvilChunkLoader.java +++ b/src/main/java/net/aspw/client/injection/forge/mixins/tweaks/MixinAnvilChunkLoader.java @@ -20,7 +20,6 @@ public class MixinAnvilChunkLoader { target = "Lnet/minecraft/nbt/CompressedStreamTools;read(Ljava/io/DataInputStream;)Lnet/minecraft/nbt/NBTTagCompound;" ) ) - private NBTTagCompound redirectReadChunkData(DataInputStream inputStream) throws IOException { try (DataInputStream stream = inputStream) { return CompressedStreamTools.read(stream); diff --git a/src/main/java/net/aspw/client/injection/forge/mixins/tweaks/MixinRegionRenderCache.java b/src/main/java/net/aspw/client/injection/forge/mixins/tweaks/MixinRegionRenderCache.java index 764dc9f7..a27228df 100644 --- a/src/main/java/net/aspw/client/injection/forge/mixins/tweaks/MixinRegionRenderCache.java +++ b/src/main/java/net/aspw/client/injection/forge/mixins/tweaks/MixinRegionRenderCache.java @@ -13,6 +13,7 @@ @Mixin(RegionRenderCache.class) public class MixinRegionRenderCache { + @Shadow @Final private static IBlockState DEFAULT_STATE; diff --git a/src/main/java/net/aspw/client/protocol/ProtocolBase.java b/src/main/java/net/aspw/client/protocol/ProtocolBase.java deleted file mode 100644 index d102e102..00000000 --- a/src/main/java/net/aspw/client/protocol/ProtocolBase.java +++ /dev/null @@ -1,85 +0,0 @@ -package net.aspw.client.protocol; - -import com.viaversion.viaversion.api.connection.UserConnection; -import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; -import com.viaversion.viaversion.connection.UserConnectionImpl; -import com.viaversion.viaversion.protocol.ProtocolPipelineImpl; -import io.netty.channel.Channel; -import io.netty.channel.socket.SocketChannel; -import io.netty.util.AttributeKey; -import net.aspw.client.protocol.api.*; -import net.aspw.client.utils.ClientUtils; -import net.raphimc.vialoader.ViaLoader; -import net.raphimc.vialoader.impl.platform.ViaBackwardsPlatformImpl; -import net.raphimc.vialoader.impl.platform.ViaLegacyPlatformImpl; -import net.raphimc.vialoader.impl.platform.ViaRewindPlatformImpl; -import net.raphimc.vialoader.impl.platform.ViaVersionPlatformImpl; -import net.raphimc.vialoader.netty.CompressionReorderEvent; - -import java.util.ArrayList; -import java.util.List; - -public class ProtocolBase { - - private ProtocolVersion targetVersion = ProtocolVersion.v1_8; - public static final AttributeKey LOCAL_VIA_USER = AttributeKey.valueOf("local_via_user"); - public static final AttributeKey VF_NETWORK_MANAGER = AttributeKey.valueOf("encryption_setup"); - private static ProtocolBase manager; - public static List versions = new ArrayList<>(); - - public ProtocolBase() { - } - - public static void init(final VFPlatform platform) { - if (manager != null) { - return; - } - - final ProtocolVersion version = ProtocolVersion.getProtocol(platform.getGameVersion()); - - if (version == ProtocolVersion.unknown) - throw new IllegalArgumentException("Unknown Protocol Found (" + platform.getGameVersion() + ")"); - - manager = new ProtocolBase(); - - ViaLoader.init(new ViaVersionPlatformImpl(null), new ProtocolVLLoader(platform), new ProtocolVLInjector(), null, ViaBackwardsPlatformImpl::new, ViaRewindPlatformImpl::new, ViaLegacyPlatformImpl::new, null); - - versions.addAll(ProtocolVersion.getProtocols()); - - versions.removeIf(i -> i == ProtocolVersion.unknown || i.olderThan(ProtocolVersion.v1_7_2)); - - ClientUtils.getLogger().info("ViaVersion Injected"); - } - - public void inject(final Channel channel, final VFNetworkManager networkManager) { - if (channel instanceof SocketChannel) { - final UserConnection user = new UserConnectionImpl(channel, true); - new ProtocolPipelineImpl(user); - - channel.attr(LOCAL_VIA_USER).set(user); - channel.attr(VF_NETWORK_MANAGER).set(networkManager); - - channel.pipeline().addLast(new ProtocolVLLegacyPipeline(user, targetVersion)); - } - } - - public ProtocolVersion getTargetVersion() { - return targetVersion; - } - - public void setTargetVersionSilent(final ProtocolVersion targetVersion) { - this.targetVersion = targetVersion; - } - - public void setTargetVersion(final ProtocolVersion targetVersion) { - this.targetVersion = targetVersion; - } - - public void reorderCompression(final Channel channel) { - channel.pipeline().fireUserEventTriggered(CompressionReorderEvent.INSTANCE); - } - - public static ProtocolBase getManager() { - return manager; - } -} diff --git a/src/main/java/net/aspw/client/protocol/ProtocolMod.java b/src/main/java/net/aspw/client/protocol/ProtocolMod.java deleted file mode 100644 index cb29356b..00000000 --- a/src/main/java/net/aspw/client/protocol/ProtocolMod.java +++ /dev/null @@ -1,16 +0,0 @@ -package net.aspw.client.protocol; - -import net.aspw.client.protocol.api.VFPlatform; -import net.minecraft.realms.RealmsSharedConstants; -import net.minecraftforge.fml.common.Mod; - -@Mod(modid = "NightX", version = "Release") -public class ProtocolMod implements VFPlatform { - - public static final ProtocolMod PLATFORM = new ProtocolMod(); - - @Override - public int getGameVersion() { - return RealmsSharedConstants.NETWORK_PROTOCOL_VERSION; - } -} \ No newline at end of file diff --git a/src/main/java/net/aspw/client/protocol/api/ExtendedServerData.java b/src/main/java/net/aspw/client/protocol/api/ExtendedServerData.java deleted file mode 100644 index 271e6705..00000000 --- a/src/main/java/net/aspw/client/protocol/api/ExtendedServerData.java +++ /dev/null @@ -1,11 +0,0 @@ -package net.aspw.client.protocol.api; - -import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; - -public interface ExtendedServerData { - - ProtocolVersion viaForge$getVersion(); - - void viaForge$setVersion(final ProtocolVersion version); - -} \ No newline at end of file diff --git a/src/main/java/net/aspw/client/protocol/api/ProtocolFixer.java b/src/main/java/net/aspw/client/protocol/api/ProtocolFixer.java deleted file mode 100644 index 999035f8..00000000 --- a/src/main/java/net/aspw/client/protocol/api/ProtocolFixer.java +++ /dev/null @@ -1,61 +0,0 @@ -package net.aspw.client.protocol.api; - -import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; -import net.aspw.client.protocol.ProtocolBase; -import net.aspw.client.utils.MinecraftInstance; -import net.minecraft.client.Minecraft; -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.MovingObjectPosition; - -public class ProtocolFixer { - private static final Minecraft mc = MinecraftInstance.mc; - - public static void sendConditionalSwing(final MovingObjectPosition mop) { - if (mop != null && mop.typeOfHit != MovingObjectPosition.MovingObjectType.ENTITY) { - mc.thePlayer.swingItem(); - } - } - - public static void sendFixedAttack(final EntityPlayer entityIn, final Entity target) { - if (newerThan1_8()) { - mc.playerController.attackEntity(entityIn, target); - mc.thePlayer.swingItem(); - } else { - mc.thePlayer.swingItem(); - mc.playerController.attackEntity(entityIn, target); - } - } - - public static boolean newerThanOrEqualsTo1_8() { - return ProtocolBase.getManager().getTargetVersion().newerThanOrEqualTo(ProtocolVersion.v1_8) && !MinecraftInstance.mc.isIntegratedServerRunning() || MinecraftInstance.mc.isIntegratedServerRunning(); - } - - public static boolean newerThan1_8() { - return ProtocolBase.getManager().getTargetVersion().newerThan(ProtocolVersion.v1_8) && !MinecraftInstance.mc.isIntegratedServerRunning(); - } - - public static boolean newerThanOrEqualsTo1_9() { - return ProtocolBase.getManager().getTargetVersion().newerThanOrEqualTo(ProtocolVersion.v1_9) && !MinecraftInstance.mc.isIntegratedServerRunning(); - } - - public static boolean newerThanOrEqualsTo1_10() { - return ProtocolBase.getManager().getTargetVersion().newerThanOrEqualTo(ProtocolVersion.v1_10) && !MinecraftInstance.mc.isIntegratedServerRunning(); - } - - public static boolean newerThanOrEqualsTo1_13() { - return ProtocolBase.getManager().getTargetVersion().newerThanOrEqualTo(ProtocolVersion.v1_13) && !MinecraftInstance.mc.isIntegratedServerRunning(); - } - - public static boolean olderThanOrEqualsTo1_13_2() { - return ProtocolBase.getManager().getTargetVersion().olderThanOrEqualTo(ProtocolVersion.v1_13_2) && !MinecraftInstance.mc.isIntegratedServerRunning(); - } - - public static boolean newerThanOrEqualsTo1_14() { - return ProtocolBase.getManager().getTargetVersion().newerThanOrEqualTo(ProtocolVersion.v1_14) && !MinecraftInstance.mc.isIntegratedServerRunning(); - } - - public static boolean newerThanOrEqualsTo1_16() { - return ProtocolBase.getManager().getTargetVersion().newerThanOrEqualTo(ProtocolVersion.v1_14) && !MinecraftInstance.mc.isIntegratedServerRunning(); - } -} \ No newline at end of file diff --git a/src/main/java/net/aspw/client/protocol/api/ProtocolSelector.java b/src/main/java/net/aspw/client/protocol/api/ProtocolSelector.java deleted file mode 100644 index a14d2596..00000000 --- a/src/main/java/net/aspw/client/protocol/api/ProtocolSelector.java +++ /dev/null @@ -1,117 +0,0 @@ -package net.aspw.client.protocol.api; - -import com.mojang.realmsclient.gui.ChatFormatting; -import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; -import net.aspw.client.protocol.ProtocolBase; -import net.aspw.client.visual.font.smooth.FontLoaders; -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.client.gui.GuiSlot; -import org.lwjgl.input.Keyboard; - -import java.io.IOException; - -public class ProtocolSelector extends GuiScreen { - - private final GuiScreen parent; - private final boolean simple; - private final FinishedCallback finishedCallback; - - private SlotList list; - - public ProtocolSelector(final GuiScreen parent) { - this(parent, false, (version, unused) -> ProtocolBase.getManager().setTargetVersion(version)); - } - - public ProtocolSelector(final GuiScreen parent, final boolean simple, final FinishedCallback finishedCallback) { - this.parent = parent; - this.simple = simple; - this.finishedCallback = finishedCallback; - } - - @Override - public void initGui() { - super.initGui(); - buttonList.add(new GuiButton(1, 5, height - 25, 60, 20, "Done")); - - list = new SlotList(mc, width, height, -26 + (FontLoaders.SF21.getHeight()) * 3, height, FontLoaders.SF21.getHeight()); - } - - @Override - protected void actionPerformed(GuiButton button) { - list.actionPerformed(button); - - if (button.id == 1) { - mc.displayGuiScreen(parent); - } - } - - @Override - protected void keyTyped(char typedChar, int keyCode) { - if (keyCode == Keyboard.KEY_ESCAPE) { - mc.displayGuiScreen(parent); - } - } - - @Override - public void handleMouseInput() throws IOException { - list.handleMouseInput(); - super.handleMouseInput(); - } - - @Override - public void drawScreen(int mouseX, int mouseY, float partialTicks) { - list.drawScreen(mouseX, mouseY, partialTicks); - super.drawScreen(mouseX, mouseY, partialTicks); - } - - class SlotList extends GuiSlot { - - public SlotList(Minecraft client, int width, int height, int top, int bottom, int slotHeight) { - super(client, width, height, top, bottom, slotHeight); - } - - @Override - protected int getSize() { - return ProtocolBase.versions.size(); - } - - @Override - protected void elementClicked(int index, boolean b, int i1, int i2) { - finishedCallback.finished(ProtocolBase.versions.get(index), parent); - } - - @Override - protected boolean isSelected(int index) { - return false; - } - - @Override - protected void drawBackground() { - drawDefaultBackground(); - } - - @Override - protected void drawSlot(int index, int x, int y, int slotHeight, int mouseX, int mouseY) { - final ProtocolVersion targetVersion = ProtocolBase.getManager().getTargetVersion(); - final ProtocolVersion version = ProtocolBase.versions.get(index); - - String color; - if (targetVersion == version) { - color = ProtocolSelector.this.simple ? ChatFormatting.GOLD.toString() : ChatFormatting.GREEN.toString(); - } else { - color = ProtocolSelector.this.simple ? ChatFormatting.WHITE.toString() : ChatFormatting.DARK_RED.toString(); - } - - FontLoaders.SF21.drawCenteredStringWithShadow((color) + version.getName(), width / 2F, y - 2.5f, -1); - } - } - - public interface FinishedCallback { - - void finished(final ProtocolVersion version, final GuiScreen parent); - - } - -} \ No newline at end of file diff --git a/src/main/java/net/aspw/client/protocol/api/ProtocolVLInjector.java b/src/main/java/net/aspw/client/protocol/api/ProtocolVLInjector.java deleted file mode 100644 index 67c1c1e8..00000000 --- a/src/main/java/net/aspw/client/protocol/api/ProtocolVLInjector.java +++ /dev/null @@ -1,18 +0,0 @@ -package net.aspw.client.protocol.api; - -import net.raphimc.vialoader.impl.viaversion.VLInjector; -import net.raphimc.vialoader.netty.VLLegacyPipeline; - -public class ProtocolVLInjector extends VLInjector { - - @Override - public String getDecoderName() { - return VLLegacyPipeline.VIA_DECODER_NAME; - } - - @Override - public String getEncoderName() { - return VLLegacyPipeline.VIA_ENCODER_NAME; - } - -} \ No newline at end of file diff --git a/src/main/java/net/aspw/client/protocol/api/ProtocolVLLegacyPipeline.java b/src/main/java/net/aspw/client/protocol/api/ProtocolVLLegacyPipeline.java deleted file mode 100644 index 5573dd4e..00000000 --- a/src/main/java/net/aspw/client/protocol/api/ProtocolVLLegacyPipeline.java +++ /dev/null @@ -1,43 +0,0 @@ -package net.aspw.client.protocol.api; - -import com.viaversion.viaversion.api.connection.UserConnection; -import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; -import net.raphimc.vialoader.netty.VLLegacyPipeline; - -public class ProtocolVLLegacyPipeline extends VLLegacyPipeline { - - public ProtocolVLLegacyPipeline(UserConnection user, ProtocolVersion version) { - super(user, version); - } - - @Override - protected String decompressName() { - return "decompress"; - } - - @Override - protected String compressName() { - return "compress"; - } - - @Override - protected String packetDecoderName() { - return "decoder"; - } - - @Override - protected String packetEncoderName() { - return "encoder"; - } - - @Override - protected String lengthSplitterName() { - return "splitter"; - } - - @Override - protected String lengthPrependerName() { - return "prepender"; - } - -} \ No newline at end of file diff --git a/src/main/java/net/aspw/client/protocol/api/ProtocolVLLoader.java b/src/main/java/net/aspw/client/protocol/api/ProtocolVLLoader.java deleted file mode 100644 index 98ab26ef..00000000 --- a/src/main/java/net/aspw/client/protocol/api/ProtocolVLLoader.java +++ /dev/null @@ -1,25 +0,0 @@ -package net.aspw.client.protocol.api; - -import com.viaversion.viaversion.api.Via; -import com.viaversion.viaversion.api.platform.providers.ViaProviders; -import com.viaversion.viaversion.api.protocol.version.VersionProvider; -import net.raphimc.vialoader.impl.viaversion.VLLoader; - -public class ProtocolVLLoader extends VLLoader { - - private final VFPlatform platform; - - public ProtocolVLLoader(VFPlatform platform) { - this.platform = platform; - } - - @Override - public void load() { - super.load(); - - final ViaProviders providers = Via.getManager().getProviders(); - - providers.use(VersionProvider.class, new ProtocolVersionProvider()); - } - -} \ No newline at end of file diff --git a/src/main/java/net/aspw/client/protocol/api/ProtocolVersionProvider.java b/src/main/java/net/aspw/client/protocol/api/ProtocolVersionProvider.java deleted file mode 100644 index c27b5cf9..00000000 --- a/src/main/java/net/aspw/client/protocol/api/ProtocolVersionProvider.java +++ /dev/null @@ -1,21 +0,0 @@ -package net.aspw.client.protocol.api; - -import com.viaversion.viaversion.api.connection.UserConnection; -import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; -import com.viaversion.viaversion.protocols.base.BaseVersionProvider; -import net.aspw.client.protocol.ProtocolBase; -import net.aspw.client.utils.MinecraftInstance; - -import java.util.Objects; - -public class ProtocolVersionProvider extends BaseVersionProvider { - - @Override - public ProtocolVersion getClosestServerProtocol(UserConnection connection) throws Exception { - if (connection.isClientSide() && !MinecraftInstance.mc.isIntegratedServerRunning()) { - return Objects.requireNonNull(connection.getChannel()).attr(ProtocolBase.VF_NETWORK_MANAGER).get().viaForge$getTrackedVersion(); - } - return super.getClosestServerProtocol(connection); - } - -} \ No newline at end of file diff --git a/src/main/java/net/aspw/client/protocol/api/VFNetworkManager.java b/src/main/java/net/aspw/client/protocol/api/VFNetworkManager.java deleted file mode 100644 index 1a870ba5..00000000 --- a/src/main/java/net/aspw/client/protocol/api/VFNetworkManager.java +++ /dev/null @@ -1,11 +0,0 @@ -package net.aspw.client.protocol.api; - -import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; - -public interface VFNetworkManager { - - ProtocolVersion viaForge$getTrackedVersion(); - - void viaForge$setTrackedVersion(final ProtocolVersion version); - -} \ No newline at end of file diff --git a/src/main/java/net/aspw/client/protocol/api/VFPlatform.java b/src/main/java/net/aspw/client/protocol/api/VFPlatform.java deleted file mode 100644 index 307dec6b..00000000 --- a/src/main/java/net/aspw/client/protocol/api/VFPlatform.java +++ /dev/null @@ -1,6 +0,0 @@ -package net.aspw.client.protocol.api; - -public interface VFPlatform { - - int getGameVersion(); -} \ No newline at end of file diff --git a/src/main/resources/client.forge.mixins.json b/src/main/resources/client.forge.mixins.json index 9cd2712f..dc2977d8 100644 --- a/src/main/resources/client.forge.mixins.json +++ b/src/main/resources/client.forge.mixins.json @@ -8,12 +8,9 @@ "accessors.MinecraftForgeClientAccessor", "block.MixinBlock", "block.MixinBlockAnvil", - "block.MixinBlockLadder", - "block.MixinBlockLilyPad", "block.MixinBlockLiquid", "block.MixinBlockModelRenderer", "block.MixinBlockSoulSand", - "block.MixinWorld", "client.MixinGameSettings", "client.MixinMinecraft", "entity.MixinAbstractClientPlayer", @@ -47,16 +44,12 @@ "gui.MixinGuiSlot", "gui.MixinGuiSpectator", "gui.MixinServerSelectionList", - "item.MixinItemBlock", "item.MixinItemRenderer", "item.MixinItemStack", "item.MixinNBTTagCompound", - "network.MixinGuiConnecting_1", "network.MixinNetHandlerPlayClient", "network.MixinNetworkManager", - "network.MixinNetworkManager$5", "network.MixinNetworkPlayerInfo", - "network.MixinServerData", "packets.MixinC00Handshake", "render.MixinEntityRenderer", "render.MixinFontRenderer", diff --git a/src/main/resources/mcmod.info b/src/main/resources/mcmod.info index 5370d89a..6c0221a9 100644 --- a/src/main/resources/mcmod.info +++ b/src/main/resources/mcmod.info @@ -1,13 +1,13 @@ [ { - "modid": "NightX", + "modid": "nightx", "name": "NightX Client", - "description": "A Minecraft Forge Mixin-Based Hacked Client. Equipped with ViaForge.", + "description": "A Minecraft Forge Mixin-Based Hacked Client.", "version": "Release", "mcversion": "1.8.9", "url": "https://aspw-w.github.io/NightX", "authorList": [ - "As_pw (NightX), FlorianMichael/EnZaXD (ViaForge)" + "As_pw" ], "screenshots": [], "dependencies": []