-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
331 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package breadmod.client.gui | ||
|
||
object WarTickerClient { | ||
var timer = 30 | ||
var isIncreasing = false | ||
var increasingTimer = 0 | ||
var active = false | ||
|
||
var scroll = -110f | ||
var lastScroll = -110f | ||
|
||
fun tick() { | ||
if (increasingTimer > 0) { // Increase timer | ||
increasingTimer-- | ||
timer++ | ||
} else isIncreasing = false | ||
|
||
lastScroll = scroll // hell code until I figure out proper smooth like anims from minecraft's code | ||
if (scroll > -110.0 && !active) { | ||
scroll -= (1f * 0.5f) * 4.0f | ||
} else if (scroll < 0.0 && active) { | ||
scroll += (1f * 0.5f) * 4.0f | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package breadmod.commands | ||
|
||
import com.mojang.brigadier.StringReader | ||
import com.mojang.brigadier.arguments.ArgumentType | ||
|
||
object CommandArguments { | ||
class IntArgument : ArgumentType<Int> { | ||
override fun parse(reader: StringReader): Int = reader.readInt() | ||
} | ||
class BooleanArgument : ArgumentType<Boolean> { | ||
override fun parse(reader: StringReader): Boolean = reader.readBoolean() | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
src/main/kotlin/breadmod/commands/client/AltToolGunModelCommand.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package breadmod.commands.client | ||
|
||
import breadmod.commands.CommandArguments.BooleanArgument | ||
import breadmod.registry.ModConfiguration | ||
import com.mojang.brigadier.Command | ||
import com.mojang.brigadier.builder.ArgumentBuilder | ||
import net.minecraft.commands.CommandSourceStack | ||
import net.minecraft.commands.Commands | ||
|
||
internal object AltToolGunModelCommand { | ||
fun register(): ArgumentBuilder<CommandSourceStack, *> = | ||
Commands.literal("altToolgunModel") | ||
.then(Commands.argument("value", BooleanArgument()) | ||
.executes { value -> | ||
val arg = value.getArgument("value", Boolean::class.java) | ||
ModConfiguration.CLIENT.ALT_TOOLGUN_MODEL.set(arg) | ||
return@executes Command.SINGLE_SUCCESS | ||
} | ||
) | ||
} |
Oops, something went wrong.