Skip to content

Commit

Permalink
Update to 1.19.4
Browse files Browse the repository at this point in the history
  • Loading branch information
TangyKiwi committed Apr 7, 2023
1 parent 4bb94fc commit 4a95aec
Show file tree
Hide file tree
Showing 58 changed files with 3,052 additions and 317 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<div align="center">
<img src="https://img.shields.io/github/last-commit/TangyKiwi/KiwiClient" alt="GitHub last commit"/>
<img src="https://img.shields.io/github/actions/workflow/status/TangyKiwi/KiwiClient/build.yml?branch=master" alt="Build status"/>
<img src="https://img.shields.io/badge/MC-1.19.3-brightgreen.svg" alt="Minecraft"/>
<img src="https://img.shields.io/badge/MC-1.19.4-brightgreen.svg" alt="Minecraft"/>
<br>
<img src="https://img.shields.io/github/v/release/TangyKiwi/KiwiClient.svg" alt="Release"/>
<img src="https://img.shields.io/github/languages/code-size/TangyKiwi/KiwiClient" alt="GitHub code size in bytes"/>
Expand Down
10 changes: 5 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ org.gradle.parallel=true

# Fabric Properties
# check these on https://fabricmc.net/develop
minecraft_version=1.19.3
yarn_mappings=1.19.3+build.1
loader_version=0.14.11
minecraft_version=1.19.4
yarn_mappings=1.19.4+build.1
loader_version=0.14.17

# Mod Properties
mod_version = 7.13.49
mod_version = 7.14.49
maven_group = com.tangykiwi.kiwiclient
archives_base_name = kiwiclient

# Dependencies
fabric_version=0.68.1+1.19.3
fabric_version=0.76.0+1.19.4
2 changes: 1 addition & 1 deletion src/main/java/com/tangykiwi/kiwiclient/KiwiClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public class KiwiClient implements ModInitializer {

private MinecraftClient mc;

public static String name = "KiwiClient " + SharedConstants.getGameVersion().getName(), version = "7.13.49";
public static String name = "KiwiClient " + SharedConstants.getGameVersion().getName(), version = "7.14.49";

public static DiscordRP discordRPC;
public static ModuleManager moduleManager;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.tangykiwi.kiwiclient.event;

import net.minecraft.network.Packet;
import net.minecraft.network.packet.Packet;

public class ReceivePacketEvent extends Event {
public Packet<?> packet;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.tangykiwi.kiwiclient.event;

import net.minecraft.network.Packet;
import net.minecraft.network.packet.Packet;

public class SendPacketEvent extends Event {
public Packet<?> packet;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public void render(MatrixStack matrixStack, int mouseX, int mouseY, float delta)
int height = this.height - 7;
int playerX = 20;
RenderSystem.setShaderTexture(0, player.getSkinTexture());
InventoryScreen.drawEntity(playerX, height, 30, -mouseX + playerX, -mouseY + height - 30, player);
InventoryScreen.drawEntity(matrixStack, playerX, height, 30, -mouseX + playerX, -mouseY + height - 30, player);
IFont.CONSOLAS.drawString(matrixStack, this.client.getSession().getUsername(), 35, this.height - IFont.CONSOLAS.getFontHeight() - 4, ColorUtil.getRainbow(4, 0.8f, 1), 1);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public void render(MatrixStack matrices, int mouseX, int mouseY) {
RenderSystem.getModelViewStack().scale(0.6f, 0.6f, 1f);

DiffuseLighting.enableGuiDepthLighting();
MinecraftClient.getInstance().getItemRenderer().renderInGui(icon, 0, 0);
MinecraftClient.getInstance().getItemRenderer().renderInGuiWithOverrides(matrices, icon, 0, 0);
DiffuseLighting.disableGuiDepthLighting();

RenderSystem.getModelViewStack().pop();
Expand Down Expand Up @@ -216,7 +216,6 @@ public static void horizontalGradient(MatrixStack matrices, int x1, int y1, int
float red2 = (color2 >> 16 & 255) / 255.0F;
float green2 = (color2 >> 8 & 255) / 255.0F;
float blue2 = (color2 & 255) / 255.0F;
RenderSystem.disableTexture();
RenderSystem.enableBlend();
RenderSystem.defaultBlendFunc();
RenderSystem.setShader(GameRenderer::getPositionColorProgram);
Expand All @@ -229,6 +228,5 @@ public static void horizontalGradient(MatrixStack matrices, int x1, int y1, int
bufferBuilder.vertex(x2, y1, 0).color(red2, green2, blue2, alpha2).next();
tessellator.draw();
RenderSystem.disableBlend();
RenderSystem.enableTexture();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,6 @@ public void renderBackgroundTexture(int vOffset) {
// smooth
colorOffset = (int) (-(Math.cos(Math.PI * (colorOffset / 50d)) - 1) / 2 * 50);

RenderSystem.disableTexture();
RenderSystem.enableBlend();
RenderSystem.defaultBlendFunc();
RenderSystem.setShader(GameRenderer::getPositionColorProgram);
Expand All @@ -243,6 +242,5 @@ public void renderBackgroundTexture(int vOffset) {
tessellator.draw();

RenderSystem.disableBlend();
RenderSystem.enableTexture();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ public WindowPassTextFieldWidget(int x, int y, int width, int height, String tex
private TextRenderer createTextRenderer() {
return new TextRenderer(mc.textRenderer.fontStorageAccessor, false) {
@Override
public int draw(String text, float x, float y, int color, boolean shadow, Matrix4f matrix, VertexConsumerProvider vertexConsumers, boolean seeThrough, int backgroundColor, int light, boolean rightToLeft) {
return super.draw(hide(text), x, y, color, shadow, matrix, vertexConsumers, seeThrough, backgroundColor, light, rightToLeft);
public int draw(String text, float x, float y, int color, boolean shadow, Matrix4f matrix, VertexConsumerProvider vertexConsumers, TextLayerType textLayerType, int backgroundColor, int light, boolean rightToLeft) {
return super.draw(hide(text), x, y, color, shadow, matrix, vertexConsumers, textLayerType, backgroundColor, light, rightToLeft);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import com.tangykiwi.kiwiclient.event.ReceivePacketEvent;
import com.tangykiwi.kiwiclient.event.SendPacketEvent;
import net.minecraft.network.ClientConnection;
import net.minecraft.network.Packet;
import net.minecraft.network.packet.Packet;
import net.minecraft.network.PacketCallbacks;
import net.minecraft.network.listener.PacketListener;
import org.spongepowered.asm.mixin.Mixin;
Expand All @@ -16,7 +16,7 @@
@Mixin(ClientConnection.class)
public class ClientConnectionMixin {

@Inject(at = @At("HEAD"), method = "send(Lnet/minecraft/network/Packet;)V", cancellable = true)
@Inject(at = @At("HEAD"), method = "send(Lnet/minecraft/network/packet/Packet;)V", cancellable = true)
private void onSendPacketHead(Packet<?> packet, CallbackInfo info) {
SendPacketEvent event = new SendPacketEvent(packet);
KiwiClient.eventBus.post(event);
Expand Down
34 changes: 34 additions & 0 deletions src/main/java/com/tangykiwi/kiwiclient/mixin/FrustumAccessor.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package com.tangykiwi.kiwiclient.mixin;

import net.minecraft.client.render.Frustum;
import org.joml.FrustumIntersection;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Accessor;

@Mixin(Frustum.class)
public interface FrustumAccessor {
@Accessor
public abstract FrustumIntersection getFrustumIntersection();

@Accessor
public abstract void setFrustumIntersection(FrustumIntersection vector4f);

@Accessor
public abstract double getX();

@Accessor
public abstract void setX(double x);

@Accessor
public abstract double getY();

@Accessor
public abstract void setY(double y);

@Accessor
public abstract double getZ();

@Accessor
public abstract void setZ(double z);
}

Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,13 @@ private void renderDurationOverlay(MatrixStack matrices, CallbackInfo c) {

String duration = getDurationAsString(statusEffectInstance);
int durationLength = client.textRenderer.getWidth(duration);
DrawableHelper.drawStringWithShadow(matrices, client.textRenderer, duration, x + 13 - (durationLength / 2), y + 14, 0x99FFFFFF);
client.textRenderer.drawWithShadow(matrices, duration, x + 13 - (durationLength / 2), y + 14, 0x99FFFFFF);

int amplifier = statusEffectInstance.getAmplifier();
if (amplifier > 0) {
String amplifierString = (amplifier < 6) ? I18n.translate("potion.potency." + amplifier) : "**";
int amplifierLength = client.textRenderer.getWidth(amplifierString);
DrawableHelper.drawStringWithShadow(matrices, client.textRenderer, amplifierString, x + 22 - amplifierLength, y + 3, 0x99FFFFFF);
client.textRenderer.drawWithShadow(matrices, amplifierString, x + 22 - amplifierLength, y + 3, 0x99FFFFFF);
}
}
}
Expand Down
36 changes: 11 additions & 25 deletions src/main/java/com/tangykiwi/kiwiclient/mixin/PlayerEntityMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import com.tangykiwi.kiwiclient.KiwiClient;
import com.tangykiwi.kiwiclient.command.commands.Enchant;
import com.tangykiwi.kiwiclient.command.commands.SetTarget;
import com.tangykiwi.kiwiclient.modules.movement.Fly;
import com.tangykiwi.kiwiclient.util.Utils;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.network.AbstractClientPlayerEntity;
import net.minecraft.client.option.*;
Expand All @@ -17,6 +19,7 @@
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.Iterator;
import java.util.List;
Expand All @@ -30,31 +33,6 @@ public class PlayerEntityMixin {
public void onTick(CallbackInfo ci) {
MinecraftClient MC = MinecraftClient.getInstance();
if (MC.player != null) {
// GameOptions options = MC.options;
// options.tutorialStep = TutorialStep.PUNCH_TREE;
// options.advancedItemTooltips = false;
// options.debugEnabled = false;
// options.joinedFirstServer = false;
// options.smoothCameraEnabled = true;
// options.getGamma().setValue(0.5);
// options.getAutoJump().setValue(true);
// options.getAttackIndicator().setValue(AttackIndicator.OFF);
// options.getBobView().setValue(true);
// options.getChatLineSpacing().setValue(0.0);
// options.getChatScale().setValue(0.2);
// options.getViewDistance().setValue(6);
// options.getCloudRenderMode().setValue(CloudRenderMode.FANCY);
// options.getMaxFps().setValue(60);
// options.getMainArm().setValue(Arm.LEFT);
// options.getGraphicsMode().setValue(GraphicsMode.FABULOUS);
// options.getNarrator().setValue(NarratorMode.ALL);
// options.getInvertYMouse().setValue(true);
// options.getSprintToggled().setValue(false);
// options.setSoundVolume(SoundCategory.MUSIC, 100.0F);
// options.getGuiScale().setValue(3);



if(KiwiClient.commandManager.get(SetTarget.class).target != "") {
for(Entity player : MC.world.getEntities()) {
if(player.getDisplayName().contains(Text.of("TheDumbDude"))) {
Expand Down Expand Up @@ -93,4 +71,12 @@ public void onTick(CallbackInfo ci) {
}

}

@Inject(method = "getOffGroundSpeed", at = @At("HEAD"), cancellable = true)
private void onGetOffGroundSpeed(CallbackInfoReturnable<Float> info) {
if (!Utils.mc.world.isClient) return;

float speed = ((Fly) KiwiClient.moduleManager.getModule(Fly.class)).getOffGroundSpeed();
if (speed != -1) info.setReturnValue(speed);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

@Mixin(PlayerListHud.class)
public class PlayerListHudMixin {
@ModifyConstant(constant = @Constant(longValue = 80L), method = "render")
@ModifyConstant(constant = @Constant(longValue = 80L), method = "collectPlayerEntries")
private long modifyCount(long count) {
BetterTab module = (BetterTab) KiwiClient.moduleManager.getModule(BetterTab.class);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ private static void onComponentConstruct(List<TooltipComponent> list, TooltipDat
}

@Inject(method = "renderBackgroundTexture", at = @At("HEAD"), cancellable = true)
public void renderBackgroundTexture(int vOffset, CallbackInfo ci) {
public void renderBackgroundTexture(CallbackInfo ci) {
if(!(this.client.currentScreen instanceof PackScreen) && KiwiClient.moduleManager.getModule(Background.class).isEnabled()) {
ci.cancel();
RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ private void onRenderWeather(LightmapTextureManager manager, float f, double d,
if (KiwiClient.moduleManager.getModule(NoRender.class).isEnabled() && KiwiClient.moduleManager.getModule(NoRender.class).getSetting(1).asToggle().state) info.cancel();
}

@Inject(method = "method_43788(Lnet/minecraft/client/render/Camera;)Z", at = @At("HEAD"), cancellable = true)
private void method_43788(Camera camera, CallbackInfoReturnable<Boolean> info) {
@Inject(method = "hasBlindnessOrDarkness(Lnet/minecraft/client/render/Camera;)Z", at = @At("HEAD"), cancellable = true)
private void hasBlindnessOrDarkness(Camera camera, CallbackInfoReturnable<Boolean> info) {
if (KiwiClient.moduleManager.getModule(AntiBlind.class).isEnabled()) info.setReturnValue(null);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,11 @@ public void onDrawOverlay(DrawOverlayEvent e) {
int x = x1 - 90 + (9 - count) * 20 + 2;

RenderSystem.enableDepthTest();
mc.getItemRenderer().zOffset = 200F;
mc.getItemRenderer().renderGuiItemIcon(is, x, y);
mc.getItemRenderer().renderGuiItemOverlay(mc.textRenderer, is, x, y);
// mc.getItemRenderer().zOffset = 200F;
mc.getItemRenderer().renderGuiItemIcon(e.getMatrix(), is, x, y);
mc.getItemRenderer().renderGuiItemOverlay(e.getMatrix(), mc.textRenderer, is, x, y);

mc.getItemRenderer().zOffset = 0F;
// mc.getItemRenderer().zOffset = 0F;

e.getMatrix().push();
e.getMatrix().scale(0.75F, 0.75F, 0.75F);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ public void onDrawOverlay(DrawOverlayEvent e) {
if(!isEmpty) {
int x = scaledWidth - 164 + j * 18 + 2;
int y = scaledHeight - 56 + i * 18 + 2;
itemRenderer.renderGuiItemIcon(itemStack, x, y);
itemRenderer.renderGuiItemOverlay(mc.textRenderer, itemStack, x, y);
itemRenderer.renderGuiItemIcon(e.getMatrix(), itemStack, x, y);
itemRenderer.renderGuiItemOverlay(e.getMatrix(), mc.textRenderer, itemStack, x, y);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,9 @@ else if (event.itemStack.getItem() == Items.SHIELD && getSetting(6).asToggle().s
private MutableText getStatusText(StatusEffectInstance effect) {
MutableText text = Text.translatable(effect.getTranslationKey());
if (effect.getAmplifier() != 0) {
text.append(String.format(" %d (%s)", effect.getAmplifier() + 1, StatusEffectUtil.durationToString(effect, 1)));
text.append(String.format(" %d (%s)", effect.getAmplifier() + 1, StatusEffectUtil.durationToString(effect, 1).getString()));
} else {
text.append(String.format(" (%s)", StatusEffectUtil.durationToString(effect, 1)));
text.append(String.format(" (%s)", StatusEffectUtil.durationToString(effect, 1).getString()));
}
if (effect.getEffectType().isBeneficial()) {
return text.formatted(Formatting.BLUE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public void onDrawOverlay(DrawOverlayEvent e) {

playerEntity = getNearestPlayer();
if(playerEntity == null) return;
InventoryScreen.drawEntity(x + 26, y + 70, 30 , -MathHelper.wrapDegrees(playerEntity.prevYaw + (playerEntity.getYaw() - playerEntity.prevYaw) * mc.getTickDelta()), -playerEntity.getPitch(), playerEntity);
InventoryScreen.drawEntity(e.getMatrix(), x + 26, y + 70, 30 , -MathHelper.wrapDegrees(playerEntity.prevYaw + (playerEntity.getYaw() - playerEntity.prevYaw) * mc.getTickDelta()), -playerEntity.getPitch(), playerEntity);

// Health bar
x = scaledWidth - 164;
Expand Down Expand Up @@ -160,8 +160,8 @@ public void onDrawOverlay(DrawOverlayEvent e) {

ItemStack itemStack = getItem(slot);

mc.getItemRenderer().renderGuiItemIcon(itemStack, armorX, (int) armorY);
mc.getItemRenderer().renderGuiItemOverlay(mc.textRenderer, itemStack, armorX, (int) armorY);
mc.getItemRenderer().renderGuiItemIcon(e.getMatrix(), itemStack, armorX, (int) armorY);
mc.getItemRenderer().renderGuiItemOverlay(e.getMatrix(), mc.textRenderer, itemStack, armorX, (int) armorY);

armorY += 18;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public FastBridge() {
@Subscribe
public void onTick(TickEvent e) {
Vec3d pos = mc.player.getPos();
mc.options.sneakKey.setPressed(mc.world.getBlockState(new BlockPos(pos.getX(), pos.getY() - 1, pos.getZ())).isAir());
mc.options.sneakKey.setPressed(mc.world.getBlockState(new BlockPos((int) pos.getX(), (int) pos.getY() - 1, (int) pos.getZ())).isAir());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ public void onPostTick(TickEvent.Post event) {

if (getSetting(0).asMode().mode == 1) {
mc.player.getAbilities().flying = false;
mc.player.airStrafingSpeed = speed * (mc.player.isSprinting() ? 15f : 10f) / 10;
mc.player.setVelocity(0, 0, 0);
Vec3d initialVelocity = mc.player.getVelocity();
if (mc.options.jumpKey.isPressed())
Expand Down Expand Up @@ -171,6 +170,13 @@ private boolean isEntityOnAir(Entity entity) {
return entity.world.getStatesInBox(entity.getBoundingBox().expand(0.0625).stretch(0.0, -0.55, 0.0)).allMatch(AbstractBlock.AbstractBlockState::isAir);
}

public float getOffGroundSpeed() {
// All the multiplication below is to get the speed to roughly match the speed you get when using vanilla fly

if (!isEnabled() || getSetting(0).asMode().mode != 1) return -1;
return getSetting(2).asSlider().getValueFloat();
}

public void abilitiesOff() {
mc.player.getAbilities().flying = false;
if (mc.player.getAbilities().creativeMode) return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,10 @@
import com.tangykiwi.kiwiclient.modules.settings.SliderSetting;
import com.tangykiwi.kiwiclient.util.Utils;
import net.minecraft.client.render.model.BakedModel;
import net.minecraft.client.render.model.json.ModelTransformation;
import net.minecraft.client.render.model.json.ModelTransformationMode;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.entity.ItemEntity;
import net.minecraft.util.math.*;
import org.joml.Quaterniond;
import org.joml.Quaternionf;
import org.joml.Vector3f;

import java.util.HashMap;
Expand Down Expand Up @@ -70,7 +68,7 @@ public void onRenderItemEntity(RenderItemEntityEvent event) {

matrixStack.multiply(RotationAxis.NEGATIVE_Y.rotation(n));
float l = MathHelper.sin(((float)itemEntity.getItemAge() + g) / 10.0F + itemEntity.uniqueOffset) * 0.1F + 0.1F;
float m = bakedModel.getTransformation().getTransformation(ModelTransformation.Mode.GROUND).scale.y();
float m = bakedModel.getTransformation().getTransformation(ModelTransformationMode.GROUND).scale.y();
matrixStack.translate(0.0D, -(l + 0.25F * m), 0.0D);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ private void renderChunk(int x, int z, MatrixStack ms) {
}

for (Vec3d pos : chunkRenderers.get(chunkKey).get(ore)) {
Box box = new Box(new BlockPos(pos));
Box box = new Box(new BlockPos(new Vec3i((int) pos.x, (int) pos.y, (int) pos.z)));
Color color = ore.color;
RenderUtils.drawBoxOutline(box, QuadColor.single(color.getRed(), color.getGreen(), color.getBlue(), color.getAlpha()), 1);
}
Expand Down
Loading

0 comments on commit 4a95aec

Please sign in to comment.