Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
4dcb5e5
do not use mojang gl
emyfops May 31, 2024
4aa06d7
Performance enhancement on texture utils
emyfops Jun 1, 2024
d421016
More comments
emyfops Jun 1, 2024
b38439d
Test: Emoji glyphs
emyfops Jun 1, 2024
cbe6de2
Take the dimension of the first emoji
emyfops Jun 1, 2024
cb610b5
Parse emojis from strings
emyfops Jun 1, 2024
1dab763
Test: Font renderer
emyfops Jun 2, 2024
951fde8
Font texture fix
bladekt Jun 2, 2024
48b27e8
Fix: Emoji parsing
emyfops Jun 2, 2024
a5a99e7
Loader message
emyfops Jun 2, 2024
1908d4b
Better emoji loading
emyfops Jun 2, 2024
7b4e22c
Feature: Emoji renderer
emyfops Jun 2, 2024
c9b1863
Public emoji parsing
emyfops Jun 2, 2024
944a9bc
Refactor: Code readability
emyfops Jun 2, 2024
8921bf7
Emoji artifact & space fixes
bladekt Jun 6, 2024
3309595
Kotlinize yourself
bladekt Jun 6, 2024
7c179d1
Renderer cleanup
bladekt Jun 7, 2024
631ad18
ESP (pushing but needs to be refactored)
bladekt Jun 7, 2024
04b8a1d
Fixed comment
emyfops Jun 7, 2024
46b9eab
EntityESP refactor
bladekt Jun 8, 2024
78b157f
Camera Noclip: Added module state check
bladekt Jun 8, 2024
4d4ec6a
Timer refactor
bladekt Jun 8, 2024
5d74559
HUD & many cgui refactorings
bladekt Jun 9, 2024
11237ca
Clamped position
bladekt Jun 9, 2024
6378864
todo
emyfops Jun 9, 2024
ff99934
Fuck it, HUD docking
bladekt Jun 9, 2024
f074faf
Merge remote-tracking branch 'origin/feature/renderer' into feature/r…
bladekt Jun 9, 2024
69023d6
Fix: Gson type token
emyfops Jun 9, 2024
b26725d
Merge branch 'feature/renderer' of https://github.com/Avanatiker/NeoL…
emyfops Jun 9, 2024
44f30d9
Crashfix when gui gets closed by kicking from the server
bladekt Jun 9, 2024
9cf8616
Update AbstractSetting.kt
emyfops Jun 9, 2024
267a502
Merge remote-tracking branch 'origin/feature/renderer' into feature/r…
bladekt Jun 9, 2024
a1577f4
Merge branch 'master' into feature/renderer
Avanatiker Jun 9, 2024
ce946f2
Shader optimization
bladekt Jun 10, 2024
4f0d713
Changed matrices list size
emyfops Jun 12, 2024
50f2496
Merge remote-tracking branch 'origin/feature/renderer' into feature/r…
bladekt Jun 12, 2024
968de6a
ESP
bladekt Jun 12, 2024
9d46ccb
Vertex Mapping and misc
bladekt Jun 13, 2024
87cb9b7
Merge remote-tracking branch 'origin/master' into feature/renderer
Avanatiker Jun 13, 2024
d75461c
Better emoji parsing
emyfops Jun 14, 2024
20e4777
Smol refactors
Avanatiker Jun 14, 2024
0e8fe57
ChunkStorage
bladekt Jun 14, 2024
4931fa2
ChillyWeelly
bladekt Jun 14, 2024
974d9cd
ChillyWeelly
bladekt Jun 14, 2024
5212a3b
Update scheduler
Avanatiker Jun 14, 2024
bc9aa54
Todo: Emoji chat renderer
emyfops Jun 14, 2024
405ff12
Fix rendering lines twice and more settings
Avanatiker Jun 15, 2024
16d51be
Shape mesh prototype
Avanatiker Jun 15, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ private void injectQuickPerspectiveSwap(BlockView area, Entity focusedEntity, bo

@Inject(method = "clipToSpace", at = @At("HEAD"), cancellable = true)
private void onClipToSpace(double desiredCameraDistance, CallbackInfoReturnable<Double> info) {
if (CameraTweaks.getNoClipCam()) {
if (CameraTweaks.INSTANCE.isEnabled() && CameraTweaks.getNoClipCam()) {
info.setReturnValue(desiredCameraDistance);
}
}
Expand Down
30 changes: 30 additions & 0 deletions common/src/main/java/com/lambda/mixin/render/ChatScreenMixin.java
Original file line number Diff line number Diff line change
@@ -1,14 +1,44 @@
package com.lambda.mixin.render;

import com.lambda.command.CommandManager;
import com.lambda.graphics.renderer.gui.font.FontRenderer;
import com.lambda.graphics.renderer.gui.font.LambdaEmoji;
import com.lambda.graphics.renderer.gui.font.glyph.GlyphInfo;
import kotlin.Pair;
import kotlin.ranges.IntRange;
import net.minecraft.client.gui.screen.ChatScreen;
import org.spongepowered.asm.mixin.Mixin;
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.callback.CallbackInfoReturnable;

import java.util.Collections;
import java.util.List;

@Mixin(ChatScreen.class)
public abstract class ChatScreenMixin {
@ModifyArg(method = "sendMessage", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/network/ClientPlayNetworkHandler;sendChatMessage(Ljava/lang/String;)V"), index = 0)
private String modifyChatText(String chatText) {
List<Pair<GlyphInfo, IntRange>> emojis = FontRenderer.Companion.parseEmojis(chatText, LambdaEmoji.Twemoji);
Collections.reverse(emojis);

for (Pair<GlyphInfo, IntRange> emoji : emojis) {
String emojiString = chatText.substring(emoji.getSecond().getStart() + 1, emoji.getSecond().getEndInclusive());
if (LambdaEmoji.Twemoji.get(emojiString) == null)
continue;

// Because the width of a char is bigger than an emoji
// we can simply replace the matches string by a space
// and render it after the text
chatText = chatText.substring(0, emoji.getSecond().getStart()) + " " + chatText.substring(emoji.getSecond().getEndInclusive() + 1);

// TODO: Build a renderer for the emojis
// TODO: Render the emojis at their correct position
}

return chatText;
}

@Inject(method = "sendMessage", at = @At("HEAD"), cancellable = true)
void sendMessageInject(String chatText, boolean addToHistory, CallbackInfoReturnable<Boolean> cir) {
Expand Down
2 changes: 2 additions & 0 deletions common/src/main/kotlin/com/lambda/Lambda.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ import com.lambda.core.Loader
import com.lambda.gui.impl.clickgui.windows.tag.CustomModuleWindow
import com.lambda.gui.impl.clickgui.windows.tag.TagWindow
import com.lambda.module.tag.ModuleTag
import com.lambda.threading.runGameScheduled
import com.lambda.util.KeyCode
import com.mojang.authlib.GameProfile
import com.mojang.blaze3d.systems.RenderSystem.recordRenderCall
import net.minecraft.block.Block
import net.minecraft.client.MinecraftClient
import net.minecraft.util.math.BlockPos
Expand Down
9 changes: 6 additions & 3 deletions common/src/main/kotlin/com/lambda/config/AbstractSetting.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import com.lambda.Lambda.gson
import com.lambda.context.SafeContext
import com.lambda.threading.runSafe
import com.lambda.util.Nameable
import java.lang.reflect.Type
import kotlin.properties.Delegates
import kotlin.reflect.KProperty

Expand Down Expand Up @@ -49,10 +50,12 @@ import kotlin.reflect.KProperty
*
* @property defaultValue The default value of the setting.
* @property description A description of the setting.
* @property type The type reflection of the setting.
* @property visibility A function that determines whether the setting is visible.
*/
abstract class AbstractSetting<T : Any>(
private val defaultValue: T,
private val type: Type,
val description: String,
val visibility: () -> Boolean,
) : Jsonable, Nameable {
Expand All @@ -74,10 +77,10 @@ abstract class AbstractSetting<T : Any>(
}

override fun toJson(): JsonElement =
gson.toJsonTree(value)
gson.toJsonTree(value, type)

override fun loadFromJson(serialized: JsonElement) {
value = gson.fromJson(serialized, value::class.java)
value = gson.fromJson(serialized, type)
}

fun onValueChange(block: SafeContext.(from: T, to: T) -> Unit) {
Expand All @@ -101,4 +104,4 @@ abstract class AbstractSetting<T : Any>(
}

class ValueListener<T>(val requiresValueChange: Boolean, val execute: (from: T, to: T) -> Unit)
}
}
1 change: 1 addition & 0 deletions common/src/main/kotlin/com/lambda/config/Configuration.kt
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ abstract class Configuration : Jsonable {
}
.onFailure {
val message = "Failed to save ${configName.capitalize()} config"
LOG.error(message, it)
logError(message)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package com.lambda.config.serializer.gui
import com.google.gson.*
import com.lambda.gui.impl.clickgui.LambdaClickGui
import com.lambda.gui.impl.clickgui.windows.tag.TagWindow
import com.lambda.gui.impl.hudgui.LambdaHudGui
import com.lambda.module.tag.ModuleTag
import com.lambda.util.math.Vec2d
import java.lang.reflect.Type
Expand All @@ -29,8 +30,16 @@ object TagWindowSerializer : JsonSerializer<TagWindow>, JsonDeserializer<TagWind
json: JsonElement?,
typeOfT: Type?,
context: JsonDeserializationContext?,
) = json?.asJsonObject?.let {
TagWindow(ModuleTag(it["tag"].asString), LambdaClickGui).apply {
) = json?.asJsonObject?.let {
val tag = ModuleTag(it["tag"].asString)

val gui = when (tag) {
in ModuleTag.defaults -> LambdaClickGui
in ModuleTag.hudDefaults -> LambdaHudGui
else -> return@let null
}

TagWindow(tag, gui).apply {
width = it["width"].asDouble
height = it["height"].asDouble
isOpen = it["isOpen"].asBoolean
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.lambda.config.settings

import com.google.gson.reflect.TypeToken
import com.lambda.config.AbstractSetting

/**
Expand All @@ -17,6 +18,7 @@ class CharSetting(
visibility: () -> Boolean,
) : AbstractSetting<Char>(
defaultValue,
TypeToken.get(Char::class.java).type,
description,
visibility
)
)
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.lambda.config.settings

import com.google.gson.reflect.TypeToken
import com.lambda.config.AbstractSetting
import java.text.NumberFormat
import java.util.*
Expand All @@ -26,6 +27,7 @@ abstract class NumericSetting<T>(
val unit: String,
) : AbstractSetting<T>(
value,
TypeToken.get(value::class.java).type,
description,
visibility
) where T : Number, T : Comparable<T> {
Expand All @@ -36,4 +38,4 @@ abstract class NumericSetting<T>(
override operator fun setValue(thisRef: Any?, property: KProperty<*>, valueIn: T) {
value = valueIn.coerceIn(range)
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.lambda.config.settings

import com.google.gson.reflect.TypeToken
import com.lambda.config.AbstractSetting

/**
Expand All @@ -17,6 +18,7 @@ class StringSetting(
visibility: () -> Boolean,
) : AbstractSetting<String>(
defaultValue,
TypeToken.get(String::class.java).type,
description,
visibility
)
)
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.lambda.config.settings.collections

import com.google.gson.JsonElement
import com.google.gson.reflect.TypeToken
import com.lambda.Lambda.gson
import com.lambda.config.AbstractSetting
import java.lang.reflect.Type
Expand All @@ -13,6 +14,7 @@ class ListSetting<T : Any>(
visibility: () -> Boolean,
) : AbstractSetting<MutableList<T>>(
defaultValue,
type,
description,
visibility
) {
Expand All @@ -21,7 +23,6 @@ class ListSetting<T : Any>(
}

override fun toJson(): JsonElement {
value = defaultValue // Hack the Delegates.observable
return gson.toJsonTree(value)
}
}
Original file line number Diff line number Diff line change
@@ -1,27 +1,17 @@
package com.lambda.config.settings.collections

import com.google.gson.JsonElement
import com.lambda.Lambda.gson
import com.lambda.config.AbstractSetting
import java.lang.reflect.Type

class MapSetting<K, V>(
override val name: String,
private val defaultValue: MutableMap<K, V>,
private val type: Type,
defaultValue: MutableMap<K, V>,
type: Type,
description: String,
visibility: () -> Boolean,
) : AbstractSetting<MutableMap<K, V>>(
defaultValue,
type,
description,
visibility
) {
override fun loadFromJson(serialized: JsonElement) {
value = gson.fromJson(serialized, type)
}

override fun toJson(): JsonElement {
value = defaultValue // Hack the Delegates.observable
return gson.toJsonTree(value)
}
}
)
Original file line number Diff line number Diff line change
@@ -1,27 +1,17 @@
package com.lambda.config.settings.collections

import com.google.gson.JsonElement
import com.lambda.Lambda.gson
import com.lambda.config.AbstractSetting
import java.lang.reflect.Type

class SetSetting<T : Any>(
override val name: String,
private val defaultValue: MutableSet<T>,
private val type: Type,
defaultValue: MutableSet<T>,
type: Type,
description: String,
visibility: () -> Boolean,
) : AbstractSetting<MutableSet<T>>(
defaultValue,
type,
description,
visibility
) {
override fun loadFromJson(serialized: JsonElement) {
value = gson.fromJson(serialized, type)
}

override fun toJson(): JsonElement {
value = defaultValue // Hack the Delegates.observable
return gson.toJsonTree(value)
}
}
)
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.lambda.config.settings.comparable

import com.google.gson.reflect.TypeToken
import com.lambda.config.AbstractSetting

class BooleanSetting(
Expand All @@ -9,6 +10,7 @@ class BooleanSetting(
visibility: () -> Boolean,
) : AbstractSetting<Boolean>(
defaultValue,
TypeToken.get(Boolean::class.java).type,
description,
visibility
)
)
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.lambda.config.settings.comparable

import com.google.gson.reflect.TypeToken
import com.lambda.config.AbstractSetting

class EnumSetting<T : Enum<T>>(
Expand All @@ -9,6 +10,7 @@ class EnumSetting<T : Enum<T>>(
visibility: () -> Boolean,
) : AbstractSetting<T>(
defaultValue,
TypeToken.get(defaultValue.declaringJavaClass).type,
description,
visibility,
) {
Expand All @@ -17,4 +19,4 @@ class EnumSetting<T : Enum<T>>(
fun next() {
value = enumValues[((value.ordinal + 1) % enumValues.size)]
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.lambda.config.settings.complex

import com.google.gson.reflect.TypeToken
import com.lambda.config.AbstractSetting
import net.minecraft.util.math.BlockPos

Expand All @@ -10,6 +11,7 @@ class BlockPosSetting(
visibility: () -> Boolean,
) : AbstractSetting<BlockPos>(
defaultValue,
TypeToken.get(BlockPos::class.java).type,
description,
visibility
)
)
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.lambda.config.settings.complex

import com.google.gson.reflect.TypeToken
import com.lambda.config.AbstractSetting
import net.minecraft.block.Block

Expand All @@ -10,6 +11,7 @@ class BlockSetting(
visibility: () -> Boolean,
) : AbstractSetting<Block>(
defaultValue,
TypeToken.get(Block::class.java).type,
description,
visibility
)
)
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.lambda.config.settings.complex

import com.google.gson.reflect.TypeToken
import com.lambda.config.AbstractSetting
import java.awt.Color

Expand All @@ -10,6 +11,7 @@ class ColorSetting(
visibility: () -> Boolean,
) : AbstractSetting<Color>(
defaultValue,
TypeToken.get(Color::class.java).type,
description,
visibility
)
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.lambda.config.settings.complex

import com.google.gson.reflect.TypeToken
import com.lambda.config.AbstractSetting
import com.lambda.util.KeyCode

Expand All @@ -10,6 +11,7 @@ class KeyBindSetting(
visibility: () -> Boolean,
) : AbstractSetting<KeyCode>(
defaultValue,
TypeToken.get(KeyCode::class.java).type,
description,
visibility
)
)
Loading