Skip to content

NewChunks modifications. Vanish without killing the entity. ChestStealer module modifications. #536

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
package com.lambda.client.command.commands

import com.lambda.client.command.ClientCommand
import com.lambda.client.module.modules.player.ChestStealer
import com.lambda.client.util.text.MessageSendHelper

// TODO: Remove once GUI has List
object BlackListCommand : ClientCommand(
name = "blackList",
description = "Modify blackList items for ChestStealer module"
) {
init {
literal("add", "+") {
item("item") { itemArg ->
execute("Add an item to the BlackList") {
val itemName = itemArg.value.registryName!!.toString()

if (ChestStealer.blackList.contains(itemName)) {
MessageSendHelper.sendErrorMessage("&c$itemName is already added to the BlackList")
} else {
ChestStealer.blackList.add(itemName)
MessageSendHelper.sendChatMessage("$itemName has been added to the BlackList")
}
}
}
}

literal("del", "remove", "-") {
item("item") { itemArg ->
execute("Remove an item from the BlackList") {
val itemName = itemArg.value.registryName!!.toString()

if (!ChestStealer.blackList.contains(itemName)) {
MessageSendHelper.sendErrorMessage("&c$itemName is not in the BlackList")
} else {
ChestStealer.blackList.remove(itemName)
MessageSendHelper.sendChatMessage("$itemName has been removed from the BlackList")
}
}
}
}

literal("list") {
execute("List items in the BlackList") {
var list = ChestStealer.blackList.joinToString()
if (list.isEmpty()) list = "&cNo items!"
MessageSendHelper.sendChatMessage("BlackList:\n$list")
}
}

literal("reset", "default") {
execute("Reset the BlackList to defaults") {
ChestStealer.blackList.resetValue()
MessageSendHelper.sendChatMessage("BlackList to defaults")
}
}

literal("clear") {
execute("Set the BlackList to nothing") {
ChestStealer.blackList.clear()
MessageSendHelper.sendChatMessage("BlackList was cleared")
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@ object VanishCommand : ClientCommand(
vehicle = player.ridingEntity?.also {
player.dismountRidingEntity()
world.removeEntityFromWorld(it.entityId)
sendChatMessage("Vehicle " + formatValue(it.name) + " removed")
sendChatMessage("Vehicle " + formatValue(it.name) + " ID: " + formatValue(it.entityId) + " dismounted and removed.")
}
} else {
vehicle?.let {
it.isDead = false
world.addEntityToWorld(it.entityId, it)
player.startRiding(it, true)
sendChatMessage("Vehicle " + formatValue(it.name) + " created")
vehicle = null
} ?: sendChatMessage("Not riding any vehicles")
sendChatMessage("Vehicle " + formatValue(it.name) + " ID: " + formatValue(it.entityId) + " created and mounted.")
} ?: sendChatMessage("Not riding any vehicles.")
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package com.lambda.client.command.commands

import com.lambda.client.command.ClientCommand
import com.lambda.client.util.text.MessageSendHelper.sendChatMessage
import com.lambda.client.util.text.formatValue
import net.minecraft.entity.Entity

object VanishNoKillCommand : ClientCommand(
name = "vanishNoKill",
description = "Allows you to vanish using an entity, without killing the entity off."
) {
private var vehicle: Entity? = null

init {
executeSafe {
if (player.ridingEntity != null && vehicle == null) {
vehicle = player.ridingEntity?.also {
player.dismountRidingEntity()
sendChatMessage("Vehicle " + formatValue(it.name) + " ID: " + formatValue(it.entityId) + " dismounted.")
}
} else {
vehicle?.let {
it.isDead = false
player.startRiding(it, true)
sendChatMessage("Vehicle " + formatValue(it.name) + " ID: " + formatValue(it.entityId) + " mounted.")
vehicle = null
} ?: sendChatMessage("Not riding any vehicles.")
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
package com.lambda.client.command.commands

import com.lambda.client.command.ClientCommand
import com.lambda.client.module.modules.player.ChestStealer
import com.lambda.client.util.text.MessageSendHelper

// TODO: Remove once GUI has List
object WhiteListCommand : ClientCommand(
name = "whiteList",
description = "Modify whiteList items for ChestStealer module"
) {
init {
literal("add", "+") {
item("item") { itemArg ->
execute("Add an item to the WhiteList") {
val itemName = itemArg.value.registryName!!.toString()

if (ChestStealer.whiteList.contains(itemName)) {
MessageSendHelper.sendErrorMessage("&c$itemName is already added to the WhiteList")
} else {
ChestStealer.whiteList.add(itemName)
MessageSendHelper.sendChatMessage("$itemName has been added to the WhiteList")
}
}
}
}

literal("del", "remove", "-") {
item("item") { itemArg ->
execute("Remove an item from the WhiteList") {
val itemName = itemArg.value.registryName!!.toString()

if (!ChestStealer.whiteList.contains(itemName)) {
MessageSendHelper.sendErrorMessage("&c$itemName is not in the WhiteList")
} else {
ChestStealer.whiteList.remove(itemName)
MessageSendHelper.sendChatMessage("$itemName has been removed from the WhiteList")
}
}
}
}

literal("list") {
execute("List items in the WhiteList") {
var list = ChestStealer.whiteList.joinToString()
if (list.isEmpty()) list = "&cNo items!"
MessageSendHelper.sendChatMessage("WhiteList:\n$list")
}
}

literal("reset", "default") {
execute("Reset the WhiteList to defaults") {
ChestStealer.whiteList.resetValue()
MessageSendHelper.sendChatMessage("WhiteList to defaults")
}
}

literal("clear") {
execute("Set the WhiteList to nothing") {
ChestStealer.whiteList.clear()
MessageSendHelper.sendChatMessage("WhiteList was cleared")
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import com.lambda.client.event.SafeClientEvent
import com.lambda.client.event.events.RenderRadarEvent
import com.lambda.client.gui.hudgui.HudElement
import com.lambda.client.manager.managers.FriendManager
import com.lambda.client.module.modules.client.GuiColors
import com.lambda.client.util.EntityUtils
import com.lambda.client.util.EntityUtils.isNeutral
import com.lambda.client.util.EntityUtils.isPassive
Expand All @@ -28,7 +27,8 @@ internal object Radar : HudElement(
description = "Shows entities and new chunks"
) {
private val zoom by setting("Zoom", 3f, 1f..10f, 0.1f)
private val chunkLines by setting("Chunk Lines", true)
private val chunkLines by setting("Chunk Lines", true, description = "Causes performance loss on high zoom.")
private val radarBackground by setting("Radar Background Color", ColorHolder(31, 10, 18, 235))

private val players = setting("Players", true)
private val passive = setting("Passive Mobs", false)
Expand All @@ -54,7 +54,7 @@ internal object Radar : HudElement(

private fun SafeClientEvent.drawBorder(vertexHelper: VertexHelper) {
glTranslated(radius.toDouble(), radius.toDouble(), 0.0)
drawCircleFilled(vertexHelper, radius = radius.toDouble(), color = GuiColors.backGround)
drawCircleFilled(vertexHelper, radius = radius.toDouble(), color = radarBackground)
drawCircleOutline(vertexHelper, radius = radius.toDouble(), lineWidth = 1.8f, color = primaryColor)
glRotatef(player.rotationYaw + 180, 0f, 0f, -1f)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package com.lambda.client.module.modules.player
import com.lambda.client.event.SafeClientEvent
import com.lambda.client.module.Category
import com.lambda.client.module.Module
import com.lambda.client.setting.settings.impl.collection.CollectionSetting
import com.lambda.client.util.TickTimer
import com.lambda.client.util.TimeUnit
import com.lambda.client.util.items.*
Expand All @@ -23,11 +24,20 @@ object ChestStealer : Module(
description = "Automatically steal or store items from containers",
category = Category.PLAYER
) {

private val defaultWhiteList = linkedSetOf(
"minecraft:cobblestone"
)
private val defaultBlackList = linkedSetOf(
"minecraft:cobblestone"
)

val mode by setting("Mode", Mode.TOGGLE)
private val movingMode by setting("Moving Mode", MovingMode.QUICK_MOVE)
private val ignoreEjectItem by setting("Ignores Eject Item", false, description = "Ignore AutoEject items in InventoryManager")
private val delay by setting("Delay", 5, 0..20, 1, description = "Move stack delay", unit = " ticks")
private val onlyShulkers by setting("Only Shulkers", false, description = "Only move shulker boxes")
private val selectionMode by setting("Item Selection Mode", SelectionMode.ANY, description = "Items to move.")
val whiteList = setting(CollectionSetting("WhiteList", defaultWhiteList))
val blackList = setting(CollectionSetting("BlackList", defaultBlackList))

enum class Mode {
ALWAYS, TOGGLE, MANUAL
Expand All @@ -37,6 +47,10 @@ object ChestStealer : Module(
QUICK_MOVE, PICKUP, THROW
}

private enum class SelectionMode {
ANY, SHULKERS, WHITELIST, BLACKLIST, EJECT_IGNORE
}

private enum class ContainerMode(val offset: Int) {
STEAL(36), STORE(0)
}
Expand Down Expand Up @@ -137,12 +151,14 @@ object ChestStealer : Module(
for (slot in 0 until getContainerSlotSize()) {
val item = container[slot].item
if (item == Items.AIR) continue
if (ignoreEjectItem && InventoryManager.ejectList.contains(item.registryName.toString())) continue
if (!onlyShulkers || item is ItemShulkerBox) {
return slot
when (selectionMode){
SelectionMode.ANY -> return slot
SelectionMode.SHULKERS -> if (item is ItemShulkerBox) return slot
SelectionMode.WHITELIST -> if (whiteList.contains(item.registryName.toString())) return slot
SelectionMode.BLACKLIST -> if (blackList.contains(item.registryName.toString())) return slot
SelectionMode.EJECT_IGNORE -> if (!InventoryManager.ejectList.contains(item.registryName.toString())) return slot
}
}

return null
}

Expand All @@ -154,11 +170,14 @@ object ChestStealer : Module(
val item = container[slot].item
if (item == Items.AIR) continue
if (player.openContainer is ContainerShulkerBox && item is ItemShulkerBox) continue
if (!onlyShulkers || item is ItemShulkerBox) {
return slot
when (selectionMode){
SelectionMode.ANY -> return slot
SelectionMode.SHULKERS -> if (item is ItemShulkerBox) return slot
SelectionMode.WHITELIST -> if (whiteList.contains(item.registryName.toString())) return slot
SelectionMode.BLACKLIST -> if (blackList.contains(item.registryName.toString())) return slot
SelectionMode.EJECT_IGNORE -> if (!InventoryManager.ejectList.contains(item.registryName.toString())) return slot
}
}

return null
}

Expand Down
Loading