Skip to content

Commit

Permalink
Update 1.7
Browse files Browse the repository at this point in the history
  • Loading branch information
RMCQAZ committed Nov 25, 2021
1 parent 05facb8 commit 8647f3b
Show file tree
Hide file tree
Showing 125 changed files with 2,815 additions and 934 deletions.
Binary file added run/libraries/ViaBackwards-4.0.1.jar
Binary file not shown.
Binary file added run/libraries/ViaVersion-4.0.1.jar
Binary file not shown.
Binary file added run/libraries/snakeyaml-1.29.jar
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion src/minecraft/kevin/command/CommandManager.kt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class CommandManager {
commands[arrayOf("binds")] = BindsCommand()

val modulesCommand = arrayListOf<String>()
for (m in KevinClient.moduleManager.getModules()) modulesCommand.add(m.getName())
for (m in KevinClient.moduleManager.getModules()) modulesCommand.add(m.name)
commands[modulesCommand.toTypedArray()] = ValueCommand()

commands[arrayOf("say")] = SayCommand()
Expand Down
4 changes: 2 additions & 2 deletions src/minecraft/kevin/command/commands/BindCommand.kt
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ class BindCommand : ICommand {
return
}
val key = Keyboard.getKeyIndex(args[1].toUpperCase())
module.setKeyBind(key)
ChatUtils.messageWithStart("§9Bound module §b§l${module.getName()}§9 to key §a§l${Keyboard.getKeyName(key)}§3.")
module.keyBind = key
ChatUtils.messageWithStart("§9Bound module §b§l${module.name}§9 to key §a§l${Keyboard.getKeyName(key)}§3.")
Minecraft.getMinecraft().soundHandler.playSound(
PositionedSoundRecord.create(
ResourceLocation("random.anvil_use"),
Expand Down
6 changes: 3 additions & 3 deletions src/minecraft/kevin/command/commands/BindsCommand.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ class BindsCommand : ICommand {
override fun run(args: Array<out String>?) {
if (args != null && args.isNotEmpty()){
if (args[0].equals("clear",true)){
for (module in KevinClient.moduleManager.getModules()) module.setKeyBind(Keyboard.KEY_NONE)
for (module in KevinClient.moduleManager.getModules()) module.keyBind = Keyboard.KEY_NONE
ChatUtils.messageWithStart("§9Removed All Binds!")
return
}
}
ChatUtils.messageWithStart("§9Binds:")
KevinClient.moduleManager.getModules().filter { it.getKeyBind() != Keyboard.KEY_NONE }.forEach {
ChatUtils.messageWithStart("§b> §9${it.getName()}: §a§l${Keyboard.getKeyName(it.getKeyBind())}")
KevinClient.moduleManager.getModules().filter { it.keyBind != Keyboard.KEY_NONE }.forEach {
ChatUtils.messageWithStart("§b> §9${it.name}: §a§l${Keyboard.getKeyName(it.keyBind)}")
}
}
}
6 changes: 3 additions & 3 deletions src/minecraft/kevin/command/commands/HideCommand.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ class HideCommand : ICommand {
ChatUtils.messageWithStart("§cUsage: .hide <ModuleName>")
return
}
KevinClient.moduleManager.getModules().filter { it.getName().equals(args[0],true) }.forEach {
KevinClient.moduleManager.getModules().filter { it.name.equals(args[0],true) }.forEach {
it.array = !it.array
if (it.array)
ChatUtils.messageWithStart("§aModule ${it.getName()} is unhidden.")
ChatUtils.messageWithStart("§aModule ${it.name} is unhidden.")
else
ChatUtils.messageWithStart("§aModule ${it.getName()} is hidden.")
ChatUtils.messageWithStart("§aModule ${it.name} is hidden.")
KevinClient.fileManager.saveConfig(KevinClient.fileManager.modulesConfig)
return
}
Expand Down
2 changes: 1 addition & 1 deletion src/minecraft/kevin/command/commands/StateCommand.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class StateCommand : ICommand {
override fun run(args: Array<out String>?) {
ChatUtils.messageWithStart("§9Modules State")
KevinClient.moduleManager.getModules().forEach {
if (it.getName()!="Targets") ChatUtils.messageWithStart("§6${it.getName()} §9State: ${if (it.getToggle()) "§aOn" else "§cOff"}")
if (it.name!="Targets") ChatUtils.messageWithStart("§6${it.name} §9State: ${if (it.state) "§aOn" else "§cOff"}")
}
}
}
29 changes: 7 additions & 22 deletions src/minecraft/kevin/command/commands/ToggleCommand.kt
Original file line number Diff line number Diff line change
Expand Up @@ -15,39 +15,24 @@ class ToggleCommand : ICommand {
return
}
for (module in KevinClient.moduleManager.getModules()){
if (module.getName().equals(args[0],ignoreCase = true)){
if (module.name.equals(args[0],ignoreCase = true)){
if (args.size > 1){
val hud = KevinClient.hud
if (args[1].equals("on",ignoreCase = true)){
module.toggle(true)
hud.addNotification(Notification("Enabled ${module.getName()}"))
Minecraft.getMinecraft().soundHandler.playSound(
PositionedSoundRecord.create(
ResourceLocation("gui.button.press"),
1f
)
)
ChatUtils.message("${KevinClient.cStart} §aEnable §e${module.getName()} §9Module")
module.state = true
ChatUtils.message("${KevinClient.cStart} §aEnable §e${module.name} §9Module")
return
}else if (args[1].equals("off",ignoreCase = true)){
module.toggle(false)
hud.addNotification(Notification("Disabled ${module.getName()}"))
Minecraft.getMinecraft().soundHandler.playSound(
PositionedSoundRecord.create(
ResourceLocation("gui.button.press"),
0.6114514191981f
)
)
ChatUtils.message("${KevinClient.cStart} §cDisable §e${module.getName()} §9Module")
module.state = false
ChatUtils.message("${KevinClient.cStart} §cDisable §e${module.name} §9Module")
return
}else {
module.toggle()
ChatUtils.message("${KevinClient.cStart} §9${if (module.getToggle()) "§aEnable" else "§cDisable"} §e${module.getName()} §9Module")
ChatUtils.message("${KevinClient.cStart} §9${if (module.state) "§aEnable" else "§cDisable"} §e${module.name} §9Module")
return
}
}else{
module.toggle()
ChatUtils.message("${KevinClient.cStart} §9${if (module.getToggle()) "§aEnable" else "§cDisable"} §e${module.getName()} §9Module")
ChatUtils.message("${KevinClient.cStart} §9${if (module.state) "§aEnable" else "§cDisable"} §e${module.name} §9Module")
return
}
}
Expand Down
24 changes: 12 additions & 12 deletions src/minecraft/kevin/command/commands/ValueCommand.kt
Original file line number Diff line number Diff line change
Expand Up @@ -17,53 +17,53 @@ class ValueCommand : ICommand {
return
}
for (m in KevinClient.moduleManager.getModules()){
if (m.getName().equals(args[0],true)){
if (m.name.equals(args[0],true)){
if (args.size == 1){
var values = ""
for (v in m.values){
if (v != m.values.last()) values += v.name +"/"
else values += v.name
}
ChatUtils.messageWithStart("§6${m.getName()} §c<$values>")
ChatUtils.messageWithStart("§6${m.name} §c<$values>")
return
}
val value = m.getValue(args[1])
if (value == null) {
ChatUtils.messageWithStart("§cModule '${m.getName()}' has no '${args[1]}' option!")
ChatUtils.messageWithStart("§cModule '${m.name}' has no '${args[1]}' option!")
return
}
if (value is BooleanValue) {
if (args.size == 2) {
val newValue = !value.get()
value.set(newValue)
ChatUtils.messageWithStart("§6${m.getName()} §b${args[1]}§9 was toggled ${if (newValue) "§aOn§9" else "§cOff§9"}.")
ChatUtils.messageWithStart("§6${m.name} §b${args[1]}§9 was toggled ${if (newValue) "§aOn§9" else "§cOff§9"}.")
playSound()
return
}else if (args[2].equals("On",true)){
val newValue = true
value.set(newValue)
ChatUtils.messageWithStart("§6${m.getName()} §b${args[1]}§9 was toggled §aOn§9.")
ChatUtils.messageWithStart("§6${m.name} §b${args[1]}§9 was toggled §aOn§9.")
playSound()
return
}else if (args[2].equals("Off",true)){
val newValue = false
value.set(newValue)
ChatUtils.messageWithStart("§6${m.getName()} §b${args[1]}§9 was toggled §cOff§9.")
ChatUtils.messageWithStart("§6${m.name} §b${args[1]}§9 was toggled §cOff§9.")
playSound()
return
}else{
val newValue = !value.get()
value.set(newValue)
ChatUtils.messageWithStart("§6${m.getName()} §b${args[1]}§9 was toggled ${if (newValue) "§aOn§9" else "§cOff§9"}.")
ChatUtils.messageWithStart("§6${m.name} §b${args[1]}§9 was toggled ${if (newValue) "§aOn§9" else "§cOff§9"}.")
playSound()
return
}
} else {
if (args.size < 3) {
if (value is IntegerValue || value is FloatValue || value is TextValue)
ChatUtils.messageWithStart("§cUsage: §9.§6${m.getName()} §b${args[1].toLowerCase()} §c<value>")
ChatUtils.messageWithStart("§cUsage: §9.§6${m.name} §b${args[1].toLowerCase()} §c<value>")
else if (value is ListValue)
ChatUtils.messageWithStart("§6${m.getName()} §b${args[1].toLowerCase()} §c<${value.values.joinToString(separator = "/").toLowerCase()}>")
ChatUtils.messageWithStart("§6${m.name} §b${args[1].toLowerCase()} §c<${value.values.joinToString(separator = "/").toLowerCase()}>")
return
}

Expand All @@ -85,23 +85,23 @@ class ValueCommand : ICommand {
}

value.set(id)
ChatUtils.messageWithStart("§6${m.getName()} §b${args[1].toLowerCase()}§9 was set to §b${Block.getBlockById(id).localizedName}§9.")
ChatUtils.messageWithStart("§6${m.name} §b${args[1].toLowerCase()}§9 was set to §b${Block.getBlockById(id).localizedName}§9.")
playSound()
return
}
is IntegerValue -> value.set(args[2].toInt())
is FloatValue -> value.set(args[2].toFloat())
is ListValue -> {
if (!value.contains(args[2])) {
ChatUtils.messageWithStart("§6${m.getName()} §b${args[1].toLowerCase()} §c<${value.values.joinToString(separator = "/").toLowerCase()}>")
ChatUtils.messageWithStart("§6${m.name} §b${args[1].toLowerCase()} §c<${value.values.joinToString(separator = "/").toLowerCase()}>")
return
}

value.set(args[2])
}
is TextValue -> value.set(toCompleteString(args, 2))
}
ChatUtils.messageWithStart("§6${m.getName()} §b${args[1]}§9 was set to §b${value.get()}§9.")
ChatUtils.messageWithStart("§6${m.name} §b${args[1]}§9 was set to §b${value.get()}§9.")
playSound()
return
} catch (e: NumberFormatException) {
Expand Down
10 changes: 5 additions & 5 deletions src/minecraft/kevin/file/ConfigManager.kt
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ object ConfigManager {
val modulesConfig = JsonObject()
KevinClient.moduleManager.getModules().forEach {
val jsonMod = JsonObject()
jsonMod.addProperty("State", it.getToggle())
jsonMod.addProperty("KeyBind", it.getKeyBind())
jsonMod.addProperty("State", it.state)
jsonMod.addProperty("KeyBind", it.keyBind)
it.values.forEach(Consumer { value: Value<*> -> jsonMod.add(value.name, value.toJson())})
modulesConfig.add(it.getName(), jsonMod)
modulesConfig.add(it.name, jsonMod)
}
val printWriter = PrintWriter(FileWriter(file))
printWriter.println(FileManager.PRETTY_GSON.toJson(modulesConfig))
Expand Down Expand Up @@ -63,8 +63,8 @@ object ConfigManager {
val module = KevinClient.moduleManager.getModule(key)
if (module != null) {
val jsonModule = value as JsonObject
module.toggle(jsonModule["State"].asBoolean)
module.setKeyBind(jsonModule["KeyBind"].asInt)
module.state = jsonModule["State"].asBoolean
module.keyBind = jsonModule["KeyBind"].asInt
for (moduleValue in module.values) {
val element = jsonModule[moduleValue.name]
if (element != null) moduleValue.fromJson(element)
Expand Down
4 changes: 3 additions & 1 deletion src/minecraft/kevin/file/FileManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public class FileManager extends MinecraftInstance {
public final File killMessages = new File(dir,"KillMessages");
public final File playerModels = new File(dir,"PlayerModels");
public final File scripts = new File(dir,"Scripts");
public final File via = new File(dir,"Via");
public final FileConfig modulesConfig = new ModulesConfig(new File(dir, "modules.json"));
public final FileConfig hudConfig = new HudConfig(new File(dir, "hud.json"));
public final File altsFile = new File(dir,"accounts.json");
Expand All @@ -38,13 +39,14 @@ public void load(){
if (!killMessages.exists()) killMessages.mkdir();
if (!playerModels.exists()) playerModels.mkdir();
if (!scripts.exists()) scripts.mkdir();
if (!via.exists()) via.mkdir();
}

public void saveConfig(final FileConfig config) {
saveConfig(config, false);
}
private void saveConfig(final FileConfig config, final boolean ignoreStarting) {
if (!ignoreStarting && KevinClient.fileManager == null)
if (!ignoreStarting && KevinClient.INSTANCE.isStarting())
return;

try {
Expand Down
4 changes: 2 additions & 2 deletions src/minecraft/kevin/file/ModulesConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ protected void loadConfig() throws IOException {
if (module != null) {
final JsonObject jsonModule = (JsonObject) entry.getValue();

module.toggle(jsonModule.get("State").getAsBoolean());
module.setState(jsonModule.get("State").getAsBoolean());
module.setKeyBind(jsonModule.get("KeyBind").getAsInt());
if (jsonModule.get("Hide")!=null) module.setArray(!jsonModule.get("Hide").getAsBoolean());
if (jsonModule.get("AutoDisable")!=null) module.setAutoDisable(new Pair<>(!Objects.equals(jsonModule.get("AutoDisable").getAsString(), "Disable"), Objects.equals(jsonModule.get("AutoDisable").getAsString(), "Disable") ? "" : jsonModule.get("AutoDisable").getAsString()));
Expand All @@ -52,7 +52,7 @@ protected void saveConfig() throws IOException {

for (final Module module : KevinClient.moduleManager.getModules()) {
final JsonObject jsonMod = new JsonObject();
jsonMod.addProperty("State", module.getToggle());
jsonMod.addProperty("State", module.getState());
jsonMod.addProperty("KeyBind", module.getKeyBind());
jsonMod.addProperty("Hide", !module.getArray());
jsonMod.addProperty("AutoDisable", module.getAutoDisable().getFirst() ? module.getAutoDisable().getSecond() : "Disable");
Expand Down
10 changes: 5 additions & 5 deletions src/minecraft/kevin/hud/element/elements/Arraylist.kt
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ class Arraylist(x: Double = 1.0, y: Double = 2.0, scale: Float = 1F,
val delta = RenderUtils.deltaTime

for (module in KevinClient.moduleManager.getModules()) {
if (!module.array || (!module.getToggle() && module.slide == 0F)) continue
if (!module.array || (!module.state && module.slide == 0F)) continue

var displayString = if (!tags.get())
module.getName()
module.name
else if (tagsArrayColor.get())
module.getColorlessTagName(tagLeft,tagRight)
else module.getTagName(tagLeft,tagRight)
Expand All @@ -82,7 +82,7 @@ class Arraylist(x: Double = 1.0, y: Double = 2.0, scale: Float = 1F,

val width = fontRenderer.getStringWidth(displayString)

if (module.getToggle()) {
if (module.state) {
if (module.slide < width) {
module.slide = AnimationUtils.easeOut(module.slideStep, width.toFloat()) * width
module.slideStep += delta / 4F
Expand Down Expand Up @@ -116,7 +116,7 @@ class Arraylist(x: Double = 1.0, y: Double = 2.0, scale: Float = 1F,

modules.forEachIndexed { index, module ->
var displayString = if (!tags.get())
module.getName()
module.name
else if (tagsArrayColor.get())
module.getColorlessTagName(tagLeft,tagRight)
else module.getTagName(tagLeft,tagRight)
Expand Down Expand Up @@ -231,6 +231,6 @@ class Arraylist(x: Double = 1.0, y: Double = 2.0, scale: Float = 1F,
val tagsArrayColor = arrayListTagsArrayColor
modules = KevinClient.moduleManager.getModules()
.filter { it.array && it.slide > 0 }
.sortedBy { -fontValue.getStringWidth(if (upperCaseValue.get()) (if (!tags.get()) it.getName() else if (tagsArrayColor.get()) it.getColorlessTagName(tagLeft,tagRight) else it.getTagName(tagLeft,tagRight)).toUpperCase() else if (!tags.get()) it.getName() else if (tagsArrayColor.get()) it.getColorlessTagName(tagLeft,tagRight) else it.getTagName(tagLeft,tagRight)) }
.sortedBy { -fontValue.getStringWidth(if (upperCaseValue.get()) (if (!tags.get()) it.name else if (tagsArrayColor.get()) it.getColorlessTagName(tagLeft,tagRight) else it.getTagName(tagLeft,tagRight)).toUpperCase() else if (!tags.get()) it.name else if (tagsArrayColor.get()) it.getColorlessTagName(tagLeft,tagRight) else it.getTagName(tagLeft,tagRight)) }
}
}
Loading

0 comments on commit 8647f3b

Please sign in to comment.