Skip to content

Commit e390977

Browse files
committed
removed sens (it was dumb)
1 parent 22c49f8 commit e390977

File tree

3 files changed

+4
-19
lines changed

3 files changed

+4
-19
lines changed

src/main/kotlin/com/github/subat0m1c/rawinput/RawInputMain.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import com.github.subat0m1c.rawinput.commands.ToggleCommand.Companion.enabled
77
import com.github.subat0m1c.rawinput.config.ConfigManager
88
import kotlinx.coroutines.*
99
import net.minecraft.client.Minecraft
10-
import net.minecraft.util.ChatComponentText
1110
import net.minecraftforge.client.ClientCommandHandler
1211
import net.minecraftforge.common.MinecraftForge
1312
import net.minecraftforge.fml.common.Mod

src/main/kotlin/com/github/subat0m1c/rawinput/RawMouseHelper.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package com.github.subat0m1c.rawinput
33
import com.github.subat0m1c.rawinput.RawInput.findMouse
44
import com.github.subat0m1c.rawinput.RawInput.mouse
55
import com.github.subat0m1c.rawinput.commands.ConfigCommand.Companion.maxChange
6-
import com.github.subat0m1c.rawinput.commands.ConfigCommand.Companion.sens
76
import com.github.subat0m1c.rawinput.commands.ToggleCommand.Companion.enabled
87
import net.minecraft.util.MouseHelper
98
import kotlin.math.abs
@@ -21,7 +20,7 @@ class RawMouseHelper : MouseHelper() {
2120

2221
mouse?.apply {
2322
poll()
24-
val (x, y) = (x.pollData * sens).toInt() to -(y.pollData * sens).toInt()
23+
val (x, y) = x.pollData.toInt() to -y.pollData.toInt()
2524
if (maxChange > 0 && (abs(x) > maxChange || abs(y) > maxChange)) {
2625
deltaX = 0
2726
deltaY = 0

src/main/kotlin/com/github/subat0m1c/rawinput/commands/ConfigCommand.kt

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ import net.minecraft.util.ChatComponentText
99
class ConfigCommand : CommandBase() {
1010
override fun getCommandName(): String = "rawconfig"
1111

12-
override fun getCommandUsage(sender: ICommandSender?): String = "Usage: /rawconfig <sens|maxchange|view> <float?|int?>"
12+
override fun getCommandUsage(sender: ICommandSender?): String = "Usage: /rawconfig <maxchange|view> <int?>"
1313

1414
override fun processCommand(sender: ICommandSender?, args: Array<out String>?) {
1515
if (args == null || args.isEmpty()) {
16-
sender?.addChatMessage(ChatComponentText("Usage: /rawconfig <sens|maxchange|view> <float?|int?>")) // waittime|
16+
sender?.addChatMessage(ChatComponentText("Usage: /rawconfig <maxchange|view> <int?>")) // waittime|
1717
return
1818
}
1919

@@ -29,23 +29,11 @@ class ConfigCommand : CommandBase() {
2929
sender?.addChatMessage(ChatComponentText("Max change set to $maxChange"))
3030
}
3131
}
32-
"sens" -> {
33-
if (args.size < 2) {
34-
sender?.addChatMessage(ChatComponentText("Usage: /rawconfig sense <float>"))
35-
return
36-
}
37-
args[1].toFloatOrNull()?.let {
38-
sens = it
39-
ConfigManager.save()
40-
sender?.addChatMessage(ChatComponentText("Sensitivity set to $sens"))
41-
}
42-
}
4332
"view" -> {
44-
sender?.addChatMessage(ChatComponentText("Current sensitivity: $sens"))
4533
sender?.addChatMessage(ChatComponentText("Current max change: $maxChange"))
4634
}
4735
else -> {
48-
sender?.addChatMessage(ChatComponentText("Unknown command: ${args[0]}. Usage: /rawconfig <sens|maxchange|view> <float?|int?>"))
36+
sender?.addChatMessage(ChatComponentText("Unknown command: ${args[0]}. Usage: /rawconfig <maxchange|view> <int?>"))
4937
return
5038
}
5139
}
@@ -54,7 +42,6 @@ class ConfigCommand : CommandBase() {
5442
override fun getRequiredPermissionLevel(): Int = 0
5543

5644
companion object {
57-
var sens by Config("sens", Config.floatSetting(1f))
5845
var maxChange by Config("maxChange", Config.intSetting(-1))
5946
}
6047
}

0 commit comments

Comments
 (0)