This commit is contained in:
bluepanee
2023-06-20 21:08:47 +05:00
committed by GitHub
parent b5a8fb0493
commit 9760dc2968
14 changed files with 68 additions and 64 deletions

View File

@@ -2,13 +2,13 @@
org.gradle.jvmargs=-Xmx2G
# Fabric Properties
minecraft_version=1.19.4
yarn_version=1.19.4+build.1
loader_version=0.14.17
minecraft_version=1.20
yarn_version=1.20+build.1
loader_version=0.14.21
# Mod Properties
mod_version = 0.2
mod_version = 0.3
maven_group = anticope.rejects
archives_base_name = meteor-rejects-addon
meteor_version=0.5.3
meteor_version=0.5.4

View File

@@ -24,7 +24,7 @@ public class ReconnectCommand extends Command {
if (info != null) {
mc.world.disconnect();
ConnectScreen.connect(new MultiplayerScreen(new TitleScreen()), mc,
ServerAddress.parse(info.address), info);
ServerAddress.parse(info.address), info, false);
}
return SINGLE_SUCCESS;
});

View File

@@ -15,6 +15,7 @@ import meteordevelopment.starscript.compiler.Parser;
import meteordevelopment.starscript.utils.Error;
import meteordevelopment.starscript.utils.StarscriptError;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.gui.screen.ChatScreen;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.gui.screen.ingame.InventoryScreen;
@@ -34,6 +35,7 @@ import net.minecraft.network.packet.c2s.play.PlayerInputC2SPacket;
import net.minecraft.network.packet.c2s.play.PlayerInteractEntityC2SPacket;
import net.minecraft.text.Text;
import net.minecraft.util.Hand;
import net.minecraft.util.Identifier;
import net.minecraft.util.math.MathHelper;
import org.lwjgl.glfw.GLFW;
@@ -57,6 +59,8 @@ public class InteractionScreen extends Screen {
private final Map<String, Consumer<Entity>> functions;
private final Map<String, String> msgs;
private final Identifier GUI_ICONS_TEXTURE = new Identifier("textures/gui/icons.png");
private final StaticListener shiftListener = new StaticListener();
// Style
@@ -238,27 +242,26 @@ public class InteractionScreen extends Screen {
return false;
}
public void render(MatrixStack matrix, int mouseX, int mouseY, float delta) {
public void render(DrawContext context, int mouseX, int mouseY, float delta) {
MatrixStack matrix = context.getMatrices();
// Fake crosshair stuff
RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F);
RenderSystem.setShader(GameRenderer::getPositionTexProgram);
RenderSystem.setShaderTexture(0, GUI_ICONS_TEXTURE);
RenderSystem.enableBlend();
RenderSystem.blendFuncSeparate(GlStateManager.SrcFactor.ONE_MINUS_DST_COLOR,
GlStateManager.DstFactor.ONE_MINUS_SRC_COLOR, GlStateManager.SrcFactor.ONE,
GlStateManager.DstFactor.ZERO);
drawTexture(matrix, crosshairX - 8, crosshairY - 8, 0, 0, 15, 15);
context.drawTexture(GUI_ICONS_TEXTURE, crosshairX - 8, crosshairY - 8, 0, 0, 15, 15);
drawDots(matrix, (int) (Math.min(height, width) / 2 * 0.75), mouseX, mouseY);
drawDots(context, (int) (Math.min(height, width) / 2 * 0.75), mouseX, mouseY);
matrix.scale(2f, 2f, 1f);
drawCenteredTextWithShadow(matrix, textRenderer, entity.getName(), width / 4, 6, 0xFFFFFFFF);
context.drawCenteredTextWithShadow(textRenderer, entity.getName(), width / 4, 6, 0xFFFFFFFF);
int scale = client.options.getGuiScale().getValue();
Vector2 mouse = new Vector2(mouseX, mouseY);
Vector2 center = new Vector2(width / 2, height / 2);
mouse.subtract(center);
mouse.normalize();
Vector2 cross = mouse;
if (scale == 0)
scale = 4;
@@ -272,13 +275,13 @@ public class InteractionScreen extends Screen {
this.crosshairX = (int) mouse.x + width / 2;
this.crosshairY = (int) mouse.y + height / 2;
client.player.setYaw(yaw + cross.x / 3);
client.player.setPitch(MathHelper.clamp(pitch + cross.y / 3, -90f, 90f));
super.render(matrix, mouseX, mouseY, delta);
client.player.setYaw(yaw + mouse.x / 3);
client.player.setPitch(MathHelper.clamp(pitch + mouse.y / 3, -90f, 90f));
super.render(context, mouseX, mouseY, delta);
}
private void drawDots(MatrixStack matrix, int radius, int mouseX, int mouseY) {
private void drawDots(DrawContext context, int radius, int mouseX, int mouseY) {
ArrayList<Point> pointList = new ArrayList<Point>();
String cache[] = new String[functions.size()];
double lowestDistance = Double.MAX_VALUE;
@@ -289,7 +292,7 @@ public class InteractionScreen extends Screen {
double s = (double) i / functions.size() * 2 * Math.PI;
int x = (int) Math.round(radius * Math.cos(s) + width / 2);
int y = (int) Math.round(radius * Math.sin(s) + height / 2);
drawTextField(matrix, x, y, string);
drawTextField(context, x, y, string);
// Calculate lowest distance between mouse and dot
if (Math.hypot(x - mouseX, y - mouseY) < lowestDistance) {
@@ -306,46 +309,46 @@ public class InteractionScreen extends Screen {
for (int j = 0; j < functions.size(); j++) {
Point point = pointList.get(j);
if (pointList.get(focusedDot) == point) {
drawDot(matrix, point.x - 4, point.y - 4, selectedDotColor);
drawDot(context, point.x - 4, point.y - 4, selectedDotColor);
this.focusedString = cache[focusedDot];
} else
drawDot(matrix, point.x - 4, point.y - 4, dotColor);
drawDot(context, point.x - 4, point.y - 4, dotColor);
}
}
private void drawRect(MatrixStack matrix, int startX, int startY, int width, int height, int colorInner, int colorOuter) {
drawHorizontalLine(matrix, startX, startX + width, startY, colorOuter);
drawHorizontalLine(matrix, startX, startX + width, startY + height, colorOuter);
drawVerticalLine(matrix, startX, startY, startY + height, colorOuter);
drawVerticalLine(matrix, startX + width, startY, startY + height, colorOuter);
fill(matrix, startX + 1, startY + 1, startX + width, startY + height, colorInner);
private void drawRect(DrawContext context, int startX, int startY, int width, int height, int colorInner, int colorOuter) {
context.drawHorizontalLine(startX, startX + width, startY, colorOuter);
context.drawHorizontalLine(startX, startX + width, startY + height, colorOuter);
context.drawVerticalLine(startX, startY, startY + height, colorOuter);
context.drawVerticalLine(startX + width, startY, startY + height, colorOuter);
context.fill(startX + 1, startY + 1, startX + width, startY + height, colorInner);
}
private void drawTextField(MatrixStack matrix, int x, int y, String key) {
private void drawTextField(DrawContext context, int x, int y, String key) {
if (x >= width / 2) {
drawRect(matrix, x + 10, y - 8, textRenderer.getWidth(key) + 3, 15, backgroundColor, borderColor);
drawTextWithShadow(matrix, textRenderer, key, x + 12, y - 4, textColor);
drawRect(context,x + 10, y - 8, textRenderer.getWidth(key) + 3, 15, backgroundColor, borderColor);
context.drawTextWithShadow(textRenderer, key, x + 12, y - 4, textColor);
} else {
drawRect(matrix, x - 14 - textRenderer.getWidth(key), y - 8, textRenderer.getWidth(key) + 3, 15, backgroundColor, borderColor);
drawTextWithShadow(matrix, textRenderer, key, x - 12 - textRenderer.getWidth(key), y - 4, textColor);
drawRect(context, x - 14 - textRenderer.getWidth(key), y - 8, textRenderer.getWidth(key) + 3, 15, backgroundColor, borderColor);
context.drawTextWithShadow(textRenderer, key, x - 12 - textRenderer.getWidth(key), y - 4, textColor);
}
}
// Literally drawing it in code
private void drawDot(MatrixStack matrix, int startX, int startY, int colorInner) {
private void drawDot(DrawContext context, int startX, int startY, int colorInner) {
// Draw dot itself
drawHorizontalLine(matrix, startX + 2, startX + 5, startY, borderColor);
drawHorizontalLine(matrix, startX + 1, startX + 6, startY + 1, borderColor);
drawHorizontalLine(matrix, startX + 2, startX + 5, startY + 1, colorInner);
fill(matrix, startX, startY + 2, startX + 8, startY + 6, borderColor);
fill(matrix, startX + 1, startY + 2, startX + 7, startY + 6, colorInner);
drawHorizontalLine(matrix, startX + 1, startX + 6, startY + 6, borderColor);
drawHorizontalLine(matrix, startX + 2, startX + 5, startY + 6, colorInner);
drawHorizontalLine(matrix, startX + 2, startX + 5, startY + 7, borderColor);
context.drawHorizontalLine(startX + 2, startX + 5, startY, borderColor);
context.drawHorizontalLine(startX + 1, startX + 6, startY + 1, borderColor);
context.drawHorizontalLine(startX + 2, startX + 5, startY + 1, colorInner);
context.fill(startX, startY + 2, startX + 8, startY + 6, borderColor);
context.fill(startX + 1, startY + 2, startX + 7, startY + 6, colorInner);
context.drawHorizontalLine(startX + 1, startX + 6, startY + 6, borderColor);
context.drawHorizontalLine(startX + 2, startX + 5, startY + 6, colorInner);
context.drawHorizontalLine(startX + 2, startX + 5, startY + 7, borderColor);
// Draw light overlay
drawHorizontalLine(matrix, startX + 2, startX + 3, startY + 1, 0x80FFFFFF);
drawHorizontalLine(matrix, startX + 1, startX + 1, startY + 2, 0x80FFFFFF);
context.drawHorizontalLine(startX + 2, startX + 3, startY + 1, 0x80FFFFFF);
context.drawHorizontalLine(startX + 1, startX + 1, startY + 2, 0x80FFFFFF);
}
private class StaticListener {

View File

@@ -49,9 +49,9 @@ public class StatsScreen extends WindowScreen {
liv.getActiveStatusEffects().forEach((effect, instance) -> {
String status = lang.get(effect.getTranslationKey());
if (instance.getAmplifier() != 0) {
status += (String.format(" %d (%s)", instance.getAmplifier()+1, StatusEffectUtil.durationToString(instance, 1)));
status += (String.format(" %d (%s)", instance.getAmplifier()+1, StatusEffectUtil.getDurationText(instance, 1)));
} else {
status += (String.format(" (%s)", StatusEffectUtil.durationToString(instance, 1)));
status += (String.format(" (%s)", StatusEffectUtil.getDurationText(instance, 1)));
}
effectList.add(theme.label(status)).expandX();
});

View File

@@ -66,10 +66,10 @@ public class WMeteorModule extends WPressable implements MeteorWidget {
double pad = pad();
animationProgress1 += delta * 4 * ((module.isActive() || mouseOver) ? 1 : -1);
animationProgress1 = Utils.clamp(animationProgress1, 0, 1);
animationProgress1 = Math.max(0, Math.min(1, animationProgress1));
animationProgress2 += delta * 6 * (module.isActive() ? 1 : -1);
animationProgress2 = Utils.clamp(animationProgress2, 0, 1);
animationProgress2 = Math.max(0, Math.min(1, animationProgress2));
if (animationProgress1 > 0) {
renderer.quad(x, y, width * animationProgress1, height, theme.moduleBackground.get());

View File

@@ -68,7 +68,7 @@ public class WMeteorTextBox extends WTextBox implements MeteorWidget {
// Cursor
animProgress += delta * 10 * (focused && cursorVisible ? 1 : -1);
animProgress = Utils.clamp(animProgress, 0, 1);
animProgress = Math.max(0, Math.min(1, animProgress));
if ((focused && cursorVisible) || animProgress > 0) {
renderer.setAlpha(animProgress);

View File

@@ -25,7 +25,7 @@ public class WMeteorCheckbox extends WCheckbox implements MeteorWidget {
MeteorRoundedGuiTheme theme = theme();
animProgress += (checked ? 1 : -1) * delta * 14;
animProgress = Utils.clamp(animProgress, 0, 1);
animProgress = Math.max(0, Math.min(1, animProgress));
renderBackground(renderer, this, pressed, mouseOver);

View File

@@ -3,6 +3,7 @@ package anticope.rejects.mixin;
import anticope.rejects.mixininterface.INoRender;
import meteordevelopment.meteorclient.systems.modules.Modules;
import meteordevelopment.meteorclient.systems.modules.render.NoRender;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.gui.screen.ChatInputSuggestor;
import net.minecraft.client.util.math.MatrixStack;
import org.spongepowered.asm.mixin.Mixin;
@@ -13,7 +14,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(ChatInputSuggestor.class)
public class CommandSuggestorMixin {
@Inject(method = "render", at = @At(value = "HEAD"), cancellable = true)
public void onRenderCommandSuggestion(MatrixStack matrices, int mouseX, int mouseY, CallbackInfo info) {
public void onRenderCommandSuggestion(DrawContext context, int mouseX, int mouseY, CallbackInfo info) {
if (((INoRender) Modules.get().get(NoRender.class)).noCommandSuggestions()) info.cancel();
}
}

View File

@@ -301,7 +301,7 @@ public class AutoWither extends Module {
for (int z = blockPos.getZ() - widthZ; z <= blockPos.getZ(); z++) {
for (int y = blockPos.getY(); y <= blockPos.getY() + 2; y++) {
bp.set(x, y, z);
if (!mc.world.getBlockState(bp).getMaterial().isReplaceable()) return false;
if (!mc.world.getBlockState(bp).isReplaceable()) return false;
if (!mc.world.canPlace(Blocks.STONE.getDefaultState(), bp, ShapeContext.absent())) return false;
}
}

View File

@@ -155,7 +155,7 @@ public class Confuse extends Module {
case Switch:
Vec3d diff = entityPos.subtract(playerPos);
Vec3d diff1 = new Vec3d(Utils.clamp(diff.x, -halfRange, halfRange), Utils.clamp(diff.y, -halfRange, halfRange), Utils.clamp(diff.z, -halfRange, halfRange));
Vec3d diff1 = new Vec3d(Math.max(-halfRange, Math.min(halfRange, diff.x)), Math.max(-halfRange, Math.min(halfRange, diff.y)), Math.max(-halfRange, Math.min(halfRange, diff.z)));
Vec3d goal2 = entityPos.add(diff1);
hit = mc.world.raycast(new RaycastContext(mc.player.getPos(), goal2, RaycastContext.ShapeType.COLLIDER, RaycastContext.FluidHandling.ANY, mc.player));
if (!moveThroughBlocks.get() && hit.isInsideBlock()) {

View File

@@ -121,12 +121,12 @@ public class Painter extends Module {
private boolean shouldPlace(BlockPos blockPos, Block useBlock) {
// Self
if (!mc.world.getBlockState(blockPos).getMaterial().isReplaceable()) return false;
if (!mc.world.getBlockState(blockPos).isReplaceable()) return false;
// One block height
if (!oneBlockHeight.get() &&
!mc.world.getBlockState(blockPos.up()).getMaterial().isReplaceable() &&
!mc.world.getBlockState(blockPos.down()).getMaterial().isReplaceable()) return false;
!mc.world.getBlockState(blockPos.up()).isReplaceable() &&
!mc.world.getBlockState(blockPos.down()).isReplaceable()) return false;
boolean north = true;
@@ -144,21 +144,21 @@ public class Painter extends Module {
// Top surface
if (topSurfaces.get()) {
if (upState.getMaterial().isReplaceable() || upState.getBlock() == useBlock) up = false;
if (upState.isReplaceable() || upState.getBlock() == useBlock) up = false;
}
// Side surfaces
if (sideSurfaces.get()) {
if (northState.getMaterial().isReplaceable() || northState.getBlock() == useBlock) north = false;
if (southState.getMaterial().isReplaceable() || southState.getBlock() == useBlock) south = false;
if (eastState.getMaterial().isReplaceable() || eastState.getBlock() == useBlock) east = false;
if (westState.getMaterial().isReplaceable() || westState.getBlock() == useBlock) west = false;
if (northState.isReplaceable() || northState.getBlock() == useBlock) north = false;
if (southState.isReplaceable() || southState.getBlock() == useBlock) south = false;
if (eastState.isReplaceable() || eastState.getBlock() == useBlock) east = false;
if (westState.isReplaceable() || westState.getBlock() == useBlock) west = false;
}
// Bottom surface
if (bottomSurfaces.get()) {
if (bottomState.getMaterial().isReplaceable() || bottomState.getBlock() == useBlock) bottom = false;
if (bottomState.isReplaceable() || bottomState.getBlock() == useBlock) bottom = false;
}
return north || south || east || west || up || bottom;

View File

@@ -65,7 +65,7 @@ public class ShieldBypass extends Module {
Vec3d newPos = tp.add(e.getPos());
BlockPos pos = BlockPos.ofFloored(newPos);
for (int i = -2; i <= 2; i++) {
if (mc.player.world.getBlockState(pos.up(i)).isAir() && mc.player.world.getBlockState(pos).isAir()) {
if (mc.player.getWorld().getBlockState(pos.up(i)).isAir() && mc.player.getWorld().getBlockState(pos).isAir()) {
this.originalPos = originalPos;
if (rotate.get()) Rotations.rotate(-mc.player.getYaw(), mc.player.getPitch(), -10);
target = e;

View File

@@ -7,7 +7,7 @@ import com.google.gson.*;
import com.mojang.authlib.Environment;
import com.mojang.authlib.GameProfile;
import com.mojang.authlib.exceptions.AuthenticationException;
import com.mojang.authlib.minecraft.InsecureTextureException;
import com.mojang.authlib.minecraft.InsecurePublicKeyException;
import com.mojang.authlib.minecraft.MinecraftProfileTexture;
import com.mojang.authlib.properties.Property;
import com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService;
@@ -134,11 +134,11 @@ public class CustomYggdrasilLogin {
if (requireSecure) {
if (!textureProperty.hasSignature()) {
LOGGER.error("Signature is missing from textures payload");
throw new InsecureTextureException("Signature is missing from textures payload");
throw new InsecurePublicKeyException("Signature is missing from textures payload");
}
if (!textureProperty.isSignatureValid(publicKey)) {
LOGGER.error("Textures payload has been tampered with (signature invalid)");
throw new InsecureTextureException("Textures payload has been tampered with (signature invalid)");
throw new InsecurePublicKeyException("Textures payload has been tampered with (signature invalid)");
}
}

View File

@@ -70,4 +70,4 @@ accessible class net/minecraft/client/resource/ResourceReloadLogger$ReloadSt
accessible field net/minecraft/block/AbstractBlock collidable Z
accessible field net/minecraft/util/math/Direction HORIZONTAL [Lnet/minecraft/util/math/Direction;
accessible field net/minecraft/item/ItemGroups INVENTORY Lnet/minecraft/item/ItemGroup;
accessible field net/minecraft/item/ItemGroups INVENTORY Lnet/minecraft/registry/RegistryKey;