Skip to content

Commit

Permalink
feat(legacy): ported nextgen spigotspam disabler & fixed custom backg…
Browse files Browse the repository at this point in the history
…round (#3965)
  • Loading branch information
EclipsesDev authored Sep 21, 2024
1 parent 4e19b7d commit a1da5c4
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import net.ccbluex.liquidbounce.value.BoolValue
import net.ccbluex.liquidbounce.value.IntegerValue
import net.ccbluex.liquidbounce.utils.ClientUtils.displayChatMessage
import net.ccbluex.liquidbounce.utils.PacketUtils.sendPacket
import net.ccbluex.liquidbounce.value.TextValue
import net.minecraft.init.Items
import net.minecraft.item.ItemStack
import net.minecraft.network.play.client.C0BPacketEntityAction
Expand All @@ -37,6 +38,9 @@ object Disabler : Module("Disabler", Category.EXPLOIT, hideModule = false) {
private val verusCombat by BoolValue("VerusCombat", false)
private val onlyCombat by BoolValue("OnlyCombat", true) { verusCombat }

val spigotSpam by BoolValue("SpigotSpam", false)
val message by TextValue("Message", "/skill") { spigotSpam }

private var transaction = false
var isOnCombat = false

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.ModifyVariable;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;

Expand Down Expand Up @@ -220,6 +221,14 @@ private void onUpdateWalkingPlayer(CallbackInfo ci) {
ci.cancel();
}

@ModifyVariable(method = "sendChatMessage", at = @At("HEAD"), ordinal = 0, argsOnly = true)
private String handleSendMessage(String content) {
if (Disabler.INSTANCE.handleEvents() && Disabler.INSTANCE.getSpigotSpam()) {
return Disabler.INSTANCE.getMessage() + " " + content;
}
return content;
}

@Inject(method = "swingItem", at = @At("HEAD"), cancellable = true)
private void swingItem(CallbackInfo callbackInfo) {
final NoSwing noSwing = NoSwing.INSTANCE;
Expand Down
10 changes: 8 additions & 2 deletions src/main/java/net/ccbluex/liquidbounce/utils/Background.kt
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,14 @@ class ImageBackground(backgroundFile: File) : Background(backgroundFile) {
private val resourceLocation = ResourceLocation("${CLIENT_NAME.lowercase()}/background.png")

override fun initBackground() {
val image = ImageIO.read(backgroundFile.inputStream())
mc.textureManager.loadTexture(resourceLocation, DynamicTexture(image))
mc.addScheduledTask {
runCatching {
val image = ImageIO.read(backgroundFile.inputStream())
mc.textureManager.loadTexture(resourceLocation, DynamicTexture(image))
}.onFailure {
it.printStackTrace()
}
}
}

override fun drawBackground(width: Int, height: Int) {
Expand Down

0 comments on commit a1da5c4

Please sign in to comment.