Skip to content

Commit

Permalink
Working Build 1.21.3
Browse files Browse the repository at this point in the history
Had to revert gradle to 8.10 due to unforseen issues.
  • Loading branch information
Xtendera committed Dec 22, 2024
1 parent b0a0f2b commit d62a0d7
Show file tree
Hide file tree
Showing 17 changed files with 69 additions and 48 deletions.
11 changes: 6 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ repositories {
maven { url 'https://jitpack.io' }
maven { url 'https://maven.duti.dev/releases' }
}

loom {
accessWidenerPath = file("src/main/resources/meteor-rejects.accesswidener")
}

configurations {
// configuration that holds jars to include in the jar
extraLibs
Expand Down Expand Up @@ -53,10 +58,6 @@ dependencies {
configurations.implementation.extendsFrom(configurations.extraLibs)
}

loom {
accessWidenerPath = file("src/main/resources/meteor-rejects.accesswidener")
}

processResources {
inputs.property "version", project.version

Expand All @@ -70,7 +71,7 @@ processResources {

jar {
from("LICENSE") {
rename { "${it}_${project.archivesBaseName}"}
rename { "${it}_${project.archivesBaseName}" }
}
from {
configurations.extraLibs.collect { it.isDirectory() ? it : zipTree(it) }
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
4 changes: 3 additions & 1 deletion gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#

##############################################################################
#
Expand Down Expand Up @@ -84,7 +86,7 @@ done
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down
2 changes: 2 additions & 0 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@rem SPDX-License-Identifier: Apache-2.0
@rem

@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.gui.screen.ingame.InventoryScreen;
import net.minecraft.client.option.KeyBinding;
import net.minecraft.client.render.GameRenderer;
import net.minecraft.client.render.RenderLayer;
import net.minecraft.client.util.InputUtil;
import net.minecraft.client.util.math.MatrixStack;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.client.render.entity.LivingEntityRenderer;
import net.minecraft.client.render.entity.model.EntityModel;
import net.minecraft.client.render.entity.state.LivingEntityRenderState;
import net.minecraft.client.render.entity.state.PlayerEntityRenderState;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.player.PlayerEntity;
Expand All @@ -16,14 +19,14 @@

@Environment(EnvType.CLIENT)
@Mixin(LivingEntityRenderer.class)
public class LivingEntityRendererMixin<T extends LivingEntity> {
public class LivingEntityRendererMixin<T extends LivingEntity, S extends LivingEntityRenderState, M extends EntityModel<? super S>> {

@Inject(method = "setupTransforms", at = @At(value = "TAIL"))
private void dinnerboneEntities(T entity, MatrixStack matrices, float animationProgress, float bodyYaw, float tickDelta, float scale, CallbackInfo ci) {
private void dinnerboneEntities(S state, MatrixStack matrices, float animationProgress, float bodyYaw, CallbackInfo ci) {
Rendering renderingModule = Modules.get().get(Rendering.class);
if (renderingModule == null) return;
if ((!(entity instanceof PlayerEntity)) && renderingModule.dinnerboneEnabled()) {
matrices.translate(0.0D, entity.getHeight() + 0.1F, 0.0D);
if ((!(state instanceof PlayerEntityRenderState)) && renderingModule.dinnerboneEnabled()) {
matrices.translate(0.0D, state.height + 0.1F, 0.0D);
matrices.multiply(RotationAxis.POSITIVE_Z.rotationDegrees(180.0F));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class ModuleMixin {

@Mutable @Shadow public String title;

@Inject(method = "<init>", at = @At("TAIL"))
@Inject(method = "<init>*", at = @At("TAIL"))
private void onInit(Category category, String name, String description, CallbackInfo info) {
if (RejectsConfig.get().duplicateModuleNames) {
this.name = RejectsUtils.getModuleName(name);
Expand Down
14 changes: 8 additions & 6 deletions src/main/java/anticope/rejects/modules/Rendering.java
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,14 @@ public void onChanged(Shader s) {
else if (s == Shader.Scanline) name = "scan_pincushion";
else name = s.toString().toLowerCase();
Identifier shaderID = Identifier.of(String.format("shaders/post/%s.json", name));
try {
PostEffectProcessor shader = new PostEffectProcessor(mc.getTextureManager(), mc.getResourceManager(), mc.getFramebuffer(), shaderID);
this.shader = shader;
} catch (IOException e) {
this.shader = null;
}
// TODO: How do I fix this? I don't know. - xtendera
// It might be helpful to check out https://github.com/Ladysnake/Satin/blob/7da140228c1946ffa707da905c497fd6bc2e950c/1_21_2_model.md
// try {
// PostEffectProcessor shader = new PostEffectProcessor(mc.getTextureManager(), mc.getResourceManager(), mc.getFramebuffer(), shaderID);
// this.shader = shader;
// } catch (IOException e) {
// this.shader = null;
// }
}

public boolean renderStructureVoid() {
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/anticope/rejects/modules/ShieldBypass.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,13 @@ public void bypass(Entity target, Cancellable event) {

event.cancel();

mc.getNetworkHandler().sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(newPos.getX(), newPos.getY(), newPos.getZ(), true));
mc.getNetworkHandler().sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(newPos.getX(), newPos.getY(), newPos.getZ(), true, false));

mc.getNetworkHandler().sendPacket(PlayerInteractEntityC2SPacket.attack(e, mc.player.isSneaking()));
mc.getNetworkHandler().sendPacket(new HandSwingC2SPacket(mc.player.getActiveHand()));
mc.player.resetLastAttackedTicks();

mc.getNetworkHandler().sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(mc.player.getX(), mc.player.getY(), mc.player.getZ(), true));
mc.getNetworkHandler().sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(mc.player.getX(), mc.player.getY(), mc.player.getZ(), true, mc.player.horizontalCollision));
}
}
}
26 changes: 18 additions & 8 deletions src/main/java/anticope/rejects/modules/SkeletonESP.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,16 @@
import meteordevelopment.meteorclient.utils.render.color.SettingColor;
import meteordevelopment.orbit.EventHandler;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gl.ShaderProgramKeys;
import net.minecraft.client.model.ModelPart;
import net.minecraft.client.option.Perspective;
import net.minecraft.client.render.*;
import net.minecraft.client.render.entity.EnderDragonEntityRenderer;
import net.minecraft.client.render.entity.LivingEntityRenderer;
import net.minecraft.client.render.entity.PlayerEntityRenderer;
import net.minecraft.client.render.entity.model.ParrotEntityModel;
import net.minecraft.client.render.entity.model.PlayerEntityModel;
import net.minecraft.client.render.entity.state.PlayerEntityRenderState;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.PlayerEntity;
Expand Down Expand Up @@ -61,7 +65,7 @@ private void onRender(Render3DEvent event) {
MatrixStack matrixStack = event.matrices;
float g = event.tickDelta;

RenderSystem.setShader(GameRenderer::getPositionColorProgram);
RenderSystem.setShader(ShaderProgramKeys.POSITION_COLOR);
RenderSystem.enableBlend();
RenderSystem.defaultBlendFunc();
RenderSystem.disableDepthTest();
Expand All @@ -79,8 +83,8 @@ private void onRender(Render3DEvent event) {
PlayerEntity playerEntity = (PlayerEntity) entity;

Vec3d footPos = getEntityRenderPosition(playerEntity, g);
PlayerEntityRenderer livingEntityRenderer = (PlayerEntityRenderer) (LivingEntityRenderer<?, ?>) mc.getEntityRenderDispatcher().getRenderer(playerEntity);
PlayerEntityModel<PlayerEntity> playerEntityModel = (PlayerEntityModel) livingEntityRenderer.getModel();
PlayerEntityRenderer livingEntityRenderer = (PlayerEntityRenderer) (LivingEntityRenderer<?, ?, ?>) mc.getEntityRenderDispatcher().getRenderer(playerEntity);
PlayerEntityModel playerEntityModel = livingEntityRenderer.getModel();

float h = MathHelper.lerpAngleDegrees(g, playerEntity.prevBodyYaw, playerEntity.bodyYaw);
if (mc.player == entity && Rotations.rotationTimer < rotationHoldTicks) h = Rotations.serverYaw;
Expand All @@ -93,13 +97,19 @@ private void onRender(Render3DEvent event) {
float k = j - h;
float m = playerEntity.getPitch(g);
if (mc.player == entity && Rotations.rotationTimer < rotationHoldTicks) m = Rotations.serverPitch;

playerEntityModel.animateModel(playerEntity, q, p, g);
playerEntityModel.setAngles(playerEntity, q, p, o, k, m);
// TODO: Fix this as well. Not only do I not know what it does, I also cannot figure out how to update this. - xtendera
// playerEntityModel.animateModel(playerEntity, q, p, g);
PlayerEntityRenderState renderState = new PlayerEntityRenderState();
renderState.limbFrequency = q;
renderState.limbAmplitudeMultiplier = p;
renderState.age = o;
renderState.yawDegrees = k;
renderState.pitch = m;
playerEntityModel.setAngles(renderState);

boolean swimming = playerEntity.isInSwimmingPose();
boolean sneaking = playerEntity.isSneaking();
boolean flying = playerEntity.isFallFlying();
boolean flying = playerEntity.isGliding();

ModelPart head = playerEntityModel.head;
ModelPart leftArm = playerEntityModel.leftArm;
Expand Down Expand Up @@ -189,7 +199,7 @@ private void onRender(Render3DEvent event) {
RenderSystem.disableBlend();
RenderSystem.enableDepthTest();
RenderSystem.depthMask(true);
RenderSystem.setShader(GameRenderer::getPositionColorProgram);
RenderSystem.setShader(ShaderProgramKeys.POSITION_COLOR);
}

private void rotate(MatrixStack matrix, ModelPart modelPart) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/anticope/rejects/modules/SoundLocator.java
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ private void onPlaySound(PlaySoundEvent event) {
if(whitelist.get()) {
// Whitelist ON
for (SoundEvent sound : sounds.get()) {
if (sound.getId().equals(event.sound.getId())) {
if (sound.id().equals(event.sound.getId())) {
printSound(event.sound);
break;
}
Expand Down
20 changes: 10 additions & 10 deletions src/main/java/anticope/rejects/utils/GiveUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -132,27 +132,27 @@ public static void giveItem(ItemStack item) throws CommandSyntaxException {
}

stack.set(DataComponentTypes.POTION_CONTENTS, new PotionContentsComponent(Optional.empty(), Optional.empty(),
effects));
effects, Optional.empty()));
stack.set(DataComponentTypes.CUSTOM_NAME, Text.literal("Lingering Potion of Trolling"));
return stack;
});

PRESETS.put("32k", (preview) -> {
enchantmentRegistry = mc.world.getRegistryManager().get(RegistryKeys.ENCHANTMENT);
enchantmentRegistry = mc.world.getRegistryManager().getOrThrow(RegistryKeys.ENCHANTMENT);

if (preview || enchantmentRegistry == null) return Items.DIAMOND_SWORD.getDefaultStack();
ItemStack stack = Items.DIAMOND_SWORD.getDefaultStack();

stack.apply(DataComponentTypes.ENCHANTMENTS, ItemEnchantmentsComponent.DEFAULT, component -> {
ItemEnchantmentsComponent.Builder builder = new ItemEnchantmentsComponent.Builder(component);
builder.add(enchantmentRegistry.entryOf(Enchantments.SHARPNESS), 255);
builder.add(enchantmentRegistry.entryOf(Enchantments.KNOCKBACK), 255);
builder.add(enchantmentRegistry.entryOf(Enchantments.FIRE_ASPECT), 255);
builder.add(enchantmentRegistry.entryOf(Enchantments.LOOTING), 10);
builder.add(enchantmentRegistry.entryOf(Enchantments.SWEEPING_EDGE), 3);
builder.add(enchantmentRegistry.entryOf(Enchantments.UNBREAKING), 255);
builder.add(enchantmentRegistry.entryOf(Enchantments.MENDING), 1);
builder.add(enchantmentRegistry.entryOf(Enchantments.VANISHING_CURSE), 1);
builder.add(enchantmentRegistry.getOrThrow(Enchantments.SHARPNESS), 255);
builder.add(enchantmentRegistry.getOrThrow(Enchantments.KNOCKBACK), 255);
builder.add(enchantmentRegistry.getOrThrow(Enchantments.FIRE_ASPECT), 255);
builder.add(enchantmentRegistry.getOrThrow(Enchantments.LOOTING), 10);
builder.add(enchantmentRegistry.getOrThrow(Enchantments.SWEEPING_EDGE), 3);
builder.add(enchantmentRegistry.getOrThrow(Enchantments.UNBREAKING), 255);
builder.add(enchantmentRegistry.getOrThrow(Enchantments.MENDING), 1);
builder.add(enchantmentRegistry.getOrThrow(Enchantments.VANISHING_CURSE), 1);
return builder.build();
});

Expand Down
6 changes: 3 additions & 3 deletions src/main/java/anticope/rejects/utils/RejectsUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ public static float fullFlightMove(PlayerMoveEvent event, double speed, boolean
double xDir = Math.cos(Math.toRadians(dir + 90));
double zDir = Math.sin(Math.toRadians(dir + 90));

((IVec3d) event.movement).setXZ(xDir * speed, zDir * speed);
((IVec3d) event.movement).meteor$setXZ(xDir * speed, zDir * speed);
} else {
((IVec3d) event.movement).setXZ(0, 0);
((IVec3d) event.movement).meteor$setXZ(0, 0);
}

float ySpeed = 0;
Expand All @@ -81,7 +81,7 @@ public static float fullFlightMove(PlayerMoveEvent event, double speed, boolean
ySpeed += speed;
if (mc.options.sneakKey.isPressed())
ySpeed -= speed;
((IVec3d) event.movement).setY(verticalSpeedMatch ? ySpeed : ySpeed / 2);
((IVec3d) event.movement).meteor$setY(verticalSpeedMatch ? ySpeed : ySpeed / 2);

return ySpeed;
}
Expand Down
8 changes: 5 additions & 3 deletions src/main/java/anticope/rejects/utils/WorldUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
import meteordevelopment.meteorclient.utils.player.FindItemResult;
import meteordevelopment.meteorclient.utils.player.InvUtils;
import meteordevelopment.meteorclient.utils.player.Rotations;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.util.Hand;
import net.minecraft.util.PlayerInput;
import net.minecraft.util.hit.BlockHitResult;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
Expand Down Expand Up @@ -41,13 +43,13 @@ public static double distanceBetween(BlockPos pos1, BlockPos pos2) {
public static boolean interact(BlockPos pos, FindItemResult findItemResult, boolean rotate) {
if (!findItemResult.found()) return false;
Runnable action = () -> {
boolean wasSneaking = mc.player.input.sneaking;
mc.player.input.sneaking = false;
PlayerInput oldInput = mc.player.input.playerInput;
mc.player.input.playerInput = new PlayerInput(oldInput.forward(), oldInput.backward(), oldInput.left(), oldInput.right(), oldInput.jump(), false, oldInput.sprint());
InvUtils.swap(findItemResult.slot(), true);
mc.interactionManager.interactBlock(mc.player, Hand.MAIN_HAND, new BlockHitResult(Vec3d.ofCenter(pos), Direction.UP, pos, false));
mc.player.swingHand(Hand.MAIN_HAND);
InvUtils.swapBack();
mc.player.input.sneaking = wasSneaking;
mc.player.input.playerInput = oldInput;
};
if (rotate) Rotations.rotate(Rotations.getYaw(pos), Rotations.getPitch(pos), -100, action);
else action.run();
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"github:sha": "${gh_hash}"
},
"depends": {
"java": ">=16",
"java": ">=21",
"minecraft": "~${mc_version}",
"meteor-client": "*"
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/meteor-rejects.accesswidener
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
accessWidener v1 named
accessWidener v2 named

accessible class net/minecraft/network/packet/c2s/play/PlayerInteractEntityC2SPacket$InteractType

0 comments on commit d62a0d7

Please sign in to comment.