Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Avanatiker committed Aug 8, 2023
2 parents a769992 + e1b54c4 commit 204a936
Show file tree
Hide file tree
Showing 68 changed files with 3,698 additions and 1,077 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/nightly_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,4 @@ jobs:
if: steps.branch-name.outputs.is_default == 'true'
run: |
COMMITMESSAGE=`git log --pretty=format:'- \`%h\` %s' -5 --reverse` &&
(curl "$WEBHOOK" -sS -H "Content-Type:application/json" -X POST -d "{\"content\":null,\"embeds\":[{\"title\":\"Build $BUILD\",\"description\":\"**Branch:** ${{steps.branch-name.outputs.current_branch}}\\n**Changes:**\\n$COMMITMESSAGE\",\"url\":\"https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID\",\"color\":1487872,\"fields\":[{\"name\":\"Artifacts:\",\"value\":\"- [lambda-$BUILD.zip](https://nightly.link/$GITHUB_REPOSITORY/workflows/nightly_build.yml/$BRANCH_NAME/lambda-$BUILD.zip)\"}],\"footer\":{\"text\":\"$GITHUB_REPOSITORY\"},\"thumbnail\":{\"url\":\"https://raw.githubusercontent.com/lambda-client/lambda/master/src/main/resources/assets/minecraft/lambda/lambda_map.png\"}}],\"username\":\"Github Actions\",\"avatar_url\":\"https://www.2b2t.com.au/assets/github.jpeg\"}")
(curl "$WEBHOOK" -sS -H "Content-Type:application/json" -X POST -d "{\"content\":null,\"embeds\":[{\"title\":\"Build $BUILD\",\"description\":\"**Branch:** ${{ steps.branch-name.outputs.current_branch }}\\n**Changes:**\\n$COMMITMESSAGE\",\"url\":\"https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID\",\"color\":1487872,\"fields\":[{\"name\":\"Artifacts:\",\"value\":\"- [lambda-$BUILD.zip](https://nightly.link/$GITHUB_REPOSITORY/workflows/nightly_build.yml/${{ steps.branch-name.outputs.current_branch }}/lambda-$BUILD.zip)\"}],\"footer\":{\"text\":\"$GITHUB_REPOSITORY\"},\"thumbnail\":{\"url\":\"https://raw.githubusercontent.com/lambda-client/lambda/master/src/main/resources/assets/minecraft/lambda/lambda_map.png\"}}],\"username\":\"Github Actions\",\"avatar_url\":\"https://www.2b2t.com.au/assets/github.jpeg\"}")
4 changes: 4 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,10 @@ shadowJar {
'kotlin/**/*.kotlin_metadata',
'kotlin/**/*.kotlin_builtins',
'META-INF/*.version'
minimize {
exclude(dependency('cabaletta:baritone-api:.*'))
exclude(dependency('org.spongepowered:mixin:.*'))
}
configurations = [project.configurations.jarLibs, project.configurations.onlyJarLibs]
relocate 'kotlin', 'com.lambda.shadow.kotlin'
relocate 'kotlinx', 'com.lambda.shadow.kotlinx'
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ forgeVersion=14.23.5.2860
mappingsChannel=stable
mappingsVersion=39-1.12

kotlinVersion=1.8.21
kotlinxCoroutinesVersion=1.7.1
kotlinVersion=1.9.0
kotlinxCoroutinesVersion=1.7.2
3 changes: 3 additions & 0 deletions src/main/java/com/lambda/mixin/accessor/AccessorEntity.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@
import net.minecraft.entity.Entity;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Accessor;
import org.spongepowered.asm.mixin.gen.Invoker;

@Mixin(Entity.class)
public interface AccessorEntity {

@Accessor("isInWeb")
boolean getIsInWeb();

@Invoker("setFlag")
void invokeSetFlag(int flag, boolean set);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package com.lambda.mixin.accessor.network;

import net.minecraft.network.play.client.CPacketClientSettings;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Accessor;

@Mixin(value = CPacketClientSettings.class)
public interface AccessorCPacketClientSettings {
@Accessor(value = "view")
int getView();

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package com.lambda.mixin.accessor.network;

import net.minecraft.network.play.client.CPacketConfirmTransaction;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Accessor;

@Mixin(value = CPacketConfirmTransaction.class)
public interface AccessorCPacketConfirmTransaction {
@Accessor(value = "accepted")
boolean getAccepted();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.lambda.mixin.accessor.network;

import net.minecraft.network.play.client.CPacketPlayerAbilities;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Accessor;

@Mixin(value = CPacketPlayerAbilities.class)
public interface AccessorCPacketPlayerAbilities {
@Accessor(value = "flySpeed")
float getFlySpeed();
@Accessor(value = "walkSpeed")
float getWalkSpeed();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package com.lambda.mixin.accessor.network;

import net.minecraft.network.play.client.CPacketResourcePackStatus;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Accessor;

@Mixin(value = CPacketResourcePackStatus.class)
public interface AccessorCPacketResourcePackStatus {
@Accessor(value = "action")
CPacketResourcePackStatus.Action getAction();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.lambda.mixin.accessor.network;

import net.minecraft.network.play.client.CPacketSpectate;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Accessor;

import java.util.UUID;

@Mixin(value = CPacketSpectate.class)
public interface AccessorCPacketSpectate {
@Accessor(value = "id")
UUID getId();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package com.lambda.mixin.accessor.network;

import net.minecraft.network.play.client.CPacketVehicleMove;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Accessor;

@Mixin(value = CPacketVehicleMove.class)
public interface AccessorCPacketVehicleMove {
@Accessor(value = "x")
void setX(double x);

@Accessor(value = "y")
void setY(double y);

@Accessor(value = "z")
void setZ(double z);

@Accessor(value = "yaw")
void setYaw(float yaw);

@Accessor(value = "pitch")
void setPitch(float pitch);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.lambda.mixin.accessor.network;

import net.minecraft.client.network.NetHandlerPlayClient;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Accessor;

@Mixin(value = NetHandlerPlayClient.class)
public interface AccessorNetHandlerPlayClient {

@Accessor(value = "doneLoadingTerrain")
boolean isDoneLoadingTerrain();

@Accessor(value = "doneLoadingTerrain")
void setDoneLoadingTerrain(boolean loaded);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package com.lambda.mixin.accessor.network;

import net.minecraft.network.play.server.SPacketCloseWindow;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Accessor;

@Mixin(value = SPacketCloseWindow.class)
public interface AccessorSPacketCloseWindow {
@Accessor(value = "windowId")
int getWindowId();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package com.lambda.mixin.accessor.network;

import net.minecraft.network.play.server.SPacketMaps;
import net.minecraft.world.storage.MapDecoration;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Accessor;

@Mixin(value = SPacketMaps.class)
public interface AccessorSPacketMaps {
@Accessor(value = "mapScale")
byte getMapScale();
@Accessor(value = "trackingPosition")
boolean getTrackingPosition();
@Accessor(value = "icons")
MapDecoration[] getIcons();
@Accessor(value = "minX")
int getMinX();
@Accessor(value = "minZ")
int getMinZ();
@Accessor(value = "columns")
int getColumns();
@Accessor(value = "rows")
int getRows();
@Accessor(value = "mapDataBytes")
byte[] getMapDataBytes();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package com.lambda.mixin.accessor.network;

import net.minecraft.network.play.server.SPacketWorldBorder;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Accessor;

@Mixin(value = SPacketWorldBorder.class)
public interface AccessorSPacketWorldBorder {
@Accessor(value = "action")
SPacketWorldBorder.Action getAction();
@Accessor(value = "size")
int getSize();
@Accessor(value = "centerX")
double getCenterX();
@Accessor(value = "centerZ")
double getCenterZ();
@Accessor(value = "targetSize")
double getTargetSize();
@Accessor(value = "diameter")
double getDiameter();
@Accessor(value = "timeUntilTarget")
long getTimeUntilTarget();
@Accessor(value = "warningTime")
int getWarningTime();
@Accessor(value = "warningDistance")
int getWarningDistance();
}
20 changes: 0 additions & 20 deletions src/main/java/com/lambda/mixin/gui/MixinGuiChest.java

This file was deleted.

3 changes: 0 additions & 3 deletions src/main/java/com/lambda/mixin/gui/MixinGuiScreen.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.lambda.mixin.gui;

import com.lambda.client.module.modules.render.ContainerPreview;
import com.lambda.client.module.modules.render.MapPreview;
import com.lambda.client.module.modules.render.NoRender;
import com.lambda.client.util.Wrapper;
Expand All @@ -25,8 +24,6 @@ public void renderToolTip(ItemStack stack, int x, int y, CallbackInfo ci) {
ci.cancel();
MapPreview.drawMap(stack, mapData, x, y);
}
} else if (ContainerPreview.INSTANCE.isEnabled()) {
ContainerPreview.INSTANCE.renderTooltips(stack, x, y, ci);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@

import com.lambda.client.event.LambdaEventBus;
import com.lambda.client.event.events.ChunkDataEvent;
import com.lambda.client.manager.managers.CachedContainerManager;
import net.minecraft.client.multiplayer.WorldClient;
import net.minecraft.client.network.NetHandlerPlayClient;
import net.minecraft.network.play.server.SPacketChunkData;
import net.minecraft.network.play.server.SPacketWindowItems;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
Expand All @@ -20,4 +22,11 @@ public class MixinNetHandlerPlayClient {
public void handleChunkData(SPacketChunkData packetIn, CallbackInfo ci) {
LambdaEventBus.INSTANCE.post(new ChunkDataEvent(packetIn.isFullChunk(), this.world.getChunk(packetIn.getChunkX(), packetIn.getChunkZ())));
}

@Inject(method = "handleWindowItems", at = @At(value = "RETURN"))
public void handleItems(SPacketWindowItems packetIn, CallbackInfo ci) {
if (packetIn.getWindowId() != 0) {
CachedContainerManager.updateContainerInventory(packetIn.getWindowId());
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import com.lambda.client.event.events.PlayerMoveEvent;
import com.lambda.client.event.events.PushOutOfBlocksEvent;
import com.lambda.client.gui.mc.LambdaGuiBeacon;
import com.lambda.client.manager.managers.CachedContainerManager;
import com.lambda.client.manager.managers.MessageManager;
import com.lambda.client.manager.managers.PlayerPacketManager;
import com.lambda.client.module.modules.chat.PortalChat;
Expand All @@ -18,6 +19,7 @@
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.EntityPlayerSP;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.gui.inventory.GuiChest;
import net.minecraft.client.network.NetHandlerPlayClient;
import net.minecraft.entity.MoverType;
import net.minecraft.entity.player.EntityPlayer;
Expand Down Expand Up @@ -68,6 +70,13 @@ public MixinEntityPlayerSP(World worldIn, GameProfile gameProfileIn) {
@Shadow
protected abstract void updateAutoJump(float p_189810_1_, float p_189810_2_);

@Inject(method = "closeScreen", at = @At("HEAD"))
public void onCloseScreen(CallbackInfo ci) {
if (mc.currentScreen instanceof GuiChest) {
CachedContainerManager.onGuiChestClosed();
}
}

@Redirect(method = "onLivingUpdate", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/entity/EntityPlayerSP;closeScreen()V"))
public void closeScreen(EntityPlayerSP player) {
if (PortalChat.INSTANCE.isDisabled()) player.closeScreen();
Expand Down
10 changes: 5 additions & 5 deletions src/main/kotlin/com/lambda/client/LambdaMod.kt
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package com.lambda.client

import com.lambda.client.event.ForgeEventProcessor
import com.lambda.client.event.LambdaEventBus
import com.lambda.client.event.events.RealWorldTickEvent
import com.lambda.client.gui.clickgui.LambdaClickGui
import com.lambda.client.util.ConfigUtils
import com.lambda.client.util.KamiCheck
Expand Down Expand Up @@ -65,6 +63,11 @@ class LambdaMod {
fun init(event: FMLInitializationEvent) {
LOG.info("Initializing $NAME $VERSION")

// load this class so that baritone doesn't crash
// see https://github.com/cabaletta/baritone/issues/3859
@Suppress("UNUSED_VARIABLE")
val baritoneTroll = baritone.api.utils.BetterBlockPos::class.java

LoaderWrapper.loadAll()

MinecraftForge.EVENT_BUS.register(ForgeEventProcessor)
Expand All @@ -83,9 +86,6 @@ class LambdaMod {
@Mod.EventHandler
fun postInit(event: FMLPostInitializationEvent) {
ready = true
BackgroundScope.launchLooping("RealWorldTick", 50L) {
LambdaEventBus.post(RealWorldTickEvent())
}
BackgroundScope.start()
}
}
Loading

0 comments on commit 204a936

Please sign in to comment.