Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion build-mod.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ dependencies {
runtimeOnly("com.github.boopwdn:EnchAddons:main-SNAPSHOT:dev") {
isChanging = true
}
shade("com.github.Water-OR:llvg-utils:1.6")
shade("com.github.Water-OR:llvg-utils:1.8")

if (platform.isLegacyForge) {
compileOnly("org.spongepowered:mixin:0.7.11-SNAPSHOT")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,11 @@ private void isCurrentViewEntityInject(CallbackInfoReturnable<Boolean> cir) {
cir.setReturnValue(true);
}
}

@Inject(method = "isUser", at = @At("HEAD"), cancellable = true)
private void isUserInject(CallbackInfoReturnable<Boolean> cir) {
if (FreeCam.isEnabled()) {
cir.setReturnValue(isEntityEqual(FreeCam.getCamera()));
}
}
}
11 changes: 0 additions & 11 deletions src/main/java/net/llvg/exec/mixin/mixin/MixinRenderPlayer.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,14 @@

package net.llvg.exec.mixin.mixin;

import net.llvg.exec.feature.freecam.FreeCam;
import net.minecraft.client.entity.AbstractClientPlayer;
import net.minecraft.client.renderer.entity.RenderPlayer;
import net.minecraft.client.renderer.entity.RendererLivingEntity;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;

@Mixin (RenderPlayer.class)
public abstract class MixinRenderPlayer extends RendererLivingEntity<AbstractClientPlayer> {
private MixinRenderPlayer() {
super(null, null, 0);
}

@Redirect (method = "doRender(Lnet/minecraft/client/entity/AbstractClientPlayer;DDDFF)V", at = @At (value = "INVOKE", target = "Lnet/minecraft/client/entity/AbstractClientPlayer;isUser()Z"))
private boolean doRenderRedirect(AbstractClientPlayer instance) {
if (FreeCam.isEnabled()) {
return instance == FreeCam.getCamera();
}
return instance.isUser();
}
}
36 changes: 20 additions & 16 deletions src/main/kotlin/net/llvg/exec/ExeClient.kt
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,13 @@ package net.llvg.exec

import net.llvg.exec.api.command.ExeCCommandManager
import net.llvg.exec.api.config.ExeClientConfig
import net.llvg.exec.api.event.ExeCEventManager
import net.llvg.exec.api.feature.ExeCFeatureManager
import net.llvg.exec.utils.classNameLogger
import net.llvg.exec.vanilla.utils.chat_component.ChatColor
import net.llvg.exec.vanilla.utils.chat_component.ChatComponentBuildScope
import net.llvg.exec.vanilla.utils.chat_component.buildChat
import net.llvg.exec.vanilla.utils.player
import net.minecraft.util.EnumChatFormatting
import net.minecraft.util.IChatComponent

object ExeClient {
Expand All @@ -35,6 +36,7 @@ object ExeClient {

@JvmStatic
fun initialize() {
ExeCEventManager
ExeClientConfig
ExeCFeatureManager
ExeCCommandManager
Expand All @@ -44,9 +46,11 @@ object ExeClient {
message: IChatComponent
) {
buildChat {
empty +
execPrefix +
message
of(
empty()
..execPrefix
..message
)
}.run(player::addChatMessage)
}

Expand All @@ -58,16 +62,16 @@ object ExeClient {
}

private val execPrefix = buildChat {
empty +
buildChat {
empty {
bold = true
color = EnumChatFormatting.WHITE
} +
"[" +
"Exe Client" {
color = EnumChatFormatting.AQUA
} +
"] "
}
of(
empty()
..of(
empty()
.`--color`(ChatColor.WHITE)
.`--bold`(true)
.."["
.."Exe Client"()
.`--color`(ChatColor.AQUA)
.."] "
)
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,34 +19,36 @@

package net.llvg.exec.api.command

import net.minecraft.util.ChatStyle
import net.minecraft.util.EnumChatFormatting
import net.llvg.exec.vanilla.utils.chat_component.ChatColor
import net.llvg.exec.vanilla.utils.chat_component.ChatComponentBuildScope.`--color`
import net.llvg.exec.vanilla.utils.chat_component.style
import net.minecraft.util.IChatComponent

@Suppress("ObjectPropertyName")
object ExeCCommandChatComponentScope {
val ChatStyle.styleCommandName: Unit
get() {
color = EnumChatFormatting.GOLD
val IChatComponent.`--style command-name`: IChatComponent
get() = style {
`--color`(ChatColor.GOLD)
bold = true
}

val ChatStyle.styleCommandText: Unit
get() {
color = EnumChatFormatting.YELLOW
val IChatComponent.`--style command-text`: IChatComponent
get() = style {
`--color`(ChatColor.YELLOW)
}

val ChatStyle.styleParameter: Unit
get() {
color = EnumChatFormatting.LIGHT_PURPLE
val IChatComponent.`--style parameter`: IChatComponent
get() = style {
`--color`(ChatColor.LIGHT_PURPLE)
}

val ChatStyle.styleSplitMark: Unit
get() {
color = EnumChatFormatting.GRAY
val IChatComponent.`--style split-mark`: IChatComponent
get() = style {
`--color`(ChatColor.GRAY)
}

val ChatStyle.styleWarn: Unit
get() {
color = EnumChatFormatting.RED
val IChatComponent.`--style warn`: IChatComponent
get() = style {
`--color`(ChatColor.RED)
}

}
Loading