repo_name
stringlengths
1
62
dataset
stringclasses
1 value
lang
stringclasses
11 values
pr_id
int64
1
20.1k
owner
stringlengths
2
34
reviewer
stringlengths
2
39
diff_hunk
stringlengths
15
262k
code_review_comment
stringlengths
1
99.6k
tokenized-strategy
github_2023
others
69
yearn
wavey0x
@@ -11,47 +11,50 @@ This makes the strategy specific contract as simple and specific to that yield g - Shares: ERC20-compliant token that tracks Asset balance in the strategy for every distributor. - Strategy: ERC4626 compliant smart contract that receives Assets from Depositors (vault or otherwise) to deposit in any...
"allocator vault"
tokenized-strategy
github_2023
others
69
yearn
wavey0x
@@ -11,47 +11,50 @@ This makes the strategy specific contract as simple and specific to that yield g - Shares: ERC20-compliant token that tracks Asset balance in the strategy for every distributor. - Strategy: ERC4626 compliant smart contract that receives Assets from Depositors (vault or otherwise) to deposit in any...
"allocator vault"
tokenized-strategy
github_2023
others
69
yearn
wavey0x
@@ -11,47 +11,50 @@ This makes the strategy specific contract as simple and specific to that yield g - Shares: ERC20-compliant token that tracks Asset balance in the strategy for every distributor. - Strategy: ERC4626 compliant smart contract that receives Assets from Depositors (vault or otherwise) to deposit in any...
no `'` needed in "delagatecalls"
tokenized-strategy
github_2023
others
69
yearn
wavey0x
@@ -11,47 +11,50 @@ This makes the strategy specific contract as simple and specific to that yield g - Shares: ERC20-compliant token that tracks Asset balance in the strategy for every distributor. - Strategy: ERC4626 compliant smart contract that receives Assets from Depositors (vault or otherwise) to deposit in any...
"strategy-specific" rather than "strategies specific"
tokenized-strategy
github_2023
others
69
yearn
wavey0x
@@ -11,47 +11,50 @@ This makes the strategy specific contract as simple and specific to that yield g - Shares: ERC20-compliant token that tracks Asset balance in the strategy for every distributor. - Strategy: ERC4626 compliant smart contract that receives Assets from Depositors (vault or otherwise) to deposit in any...
"The base strategy is a simple abstract contract designed to be inherited by the strategist. Doing this will automatically handle all communication with the TokenizedStrategy, saving a lot of effort."
tokenized-strategy
github_2023
others
69
yearn
wavey0x
@@ -137,7 +137,7 @@ abstract contract BaseStrategy { // Set instance of the implementation for internal use. TokenizedStrategy = ITokenizedStrategy(address(this)); - // Initilize the strategies storage variables. + // Initialize the strategies storage variables.
"strategy's"
tokenized-strategy
github_2023
others
69
yearn
wavey0x
@@ -7,33 +7,33 @@ This makes the strategy specific contract as simple and specific to that yield g ### Definitions -- Asset: Any ERC20-compliant token +- Asset: Any ERC20-compliant token. - Shares: ERC20-compliant token that tracks Asset balance in the strategy for every distributor. - Strategy: ERC4626 complian...
"strategies" lowercase
tokenized-strategy
github_2023
others
67
yearn
fp-crypto
@@ -115,7 +117,8 @@ abstract contract BaseTokenizedStrategy { ITokenizedStrategy internal immutable TokenizedStrategy; // Underlying asset the Strategy is earning yield on. - address public immutable asset; + // Stored here for cheap retrievals wihtin the strategy. + ERC20 internal immutable asset;
Curious why we decided to switch to ERC20 here. Do we always cast to ERC20?
tokenized-strategy
github_2023
others
67
yearn
fp-crypto
@@ -246,16 +254,30 @@ abstract contract BaseTokenizedStrategy { function _tend(uint256 _totalIdle) internal virtual {} /** - * @notice Returns weather or not tend() should be called by a keeper. * @dev Optional trigger to override if tend() will be used by the strategy. * This must be implem...
Pardon my ignorance, what's the point of returning the calldata? In case tend might be parameterized?
tokenized-strategy
github_2023
others
67
yearn
fp-crypto
@@ -412,36 +434,38 @@ abstract contract BaseTokenizedStrategy { * * @param _amount The amount of asset to attempt to free. */ - function shutdownWithdraw(uint256 _amount) external onlySelf { + function shutdownWithdraw(uint256 _amount) external virtual onlySelf { _emergencyWithdraw(_amo...
I'm not 100% sure i like the name of this function, but I could live with it.
tokenized-strategy
github_2023
others
67
yearn
fp-crypto
@@ -707,34 +713,40 @@ contract TokenizedStrategy { * the effects of their redemption at the current block, * given current on-chain conditions. * @dev This will round down. + * + * @param shares The amount of shares that would be redeemed. + * @return . The amoun of `asset` that would be r...
```suggestion * @param owner The address minting. ```
tokenized-strategy
github_2023
others
67
yearn
fp-crypto
@@ -707,34 +713,40 @@ contract TokenizedStrategy { * the effects of their redemption at the current block, * given current on-chain conditions. * @dev This will round down. + * + * @param shares The amount of shares that would be redeemed. + * @return . The amoun of `asset` that would be r...
```suggestion * @return . The amount of `asset` that would be returned. ```
tokenized-strategy
github_2023
others
67
yearn
fp-crypto
@@ -707,34 +713,40 @@ contract TokenizedStrategy { * the effects of their redemption at the current block, * given current on-chain conditions. * @dev This will round down. + * + * @param shares The amount of shares that would be redeemed. + * @return . The amoun of `asset` that would be r...
```suggestion * @param owner The address depositing. ```
tokenized-strategy
github_2023
others
67
yearn
fp-crypto
@@ -765,20 +781,20 @@ contract TokenizedStrategy { * @notice Total number of strategy shares that can be * redeemed from the strategy by `owner`, where `owner` * corresponds to the msg.sender of a {redeem} call. + * + * @param owner The owener of the shares.
```suggestion * @param owner The owner of the shares. ```
tokenized-strategy
github_2023
others
65
yearn
fp-crypto
@@ -1144,40 +1144,51 @@ contract TokenizedStrategy { * A report() call will be needed to record the profit. */ function tend() external nonReentrant onlyKeepers { + // Tend the strategy with the current totalIdle. + IBaseTokenizedStrategy(address(this)).tendThis( + _strategySto...
So a minor tradeoff here is we need to get the storage pointer twice?
tokenized-strategy
github_2023
others
65
yearn
fp-crypto
@@ -1221,40 +1221,51 @@ contract TokenizedStrategy { * A report() call will be needed to record the profit. */ function tend() external nonReentrant onlyKeepers { + // Tend the strategy with the current totalIdle. + IBaseTokenizedStrategy(address(this)).tendThis( + _strategySto...
What does this mean for the delta between `assetBalance` and `totalIdle`?
tokenized-strategy
github_2023
others
64
yearn
fp-crypto
@@ -812,8 +884,9 @@ contract TokenizedStrategy { uint256 maxLoss ) private returns (uint256) { require(receiver != address(0), "ZERO ADDRESS"); - require(shares <= maxRedeem(owner), "ERC4626: withdraw more than max"); + require(maxLoss <= MAX_BPS, "max loss");
i'm not sure this is a helpful error message
tokenized-strategy
github_2023
others
64
yearn
fp-crypto
@@ -812,8 +884,9 @@ contract TokenizedStrategy { uint256 maxLoss ) private returns (uint256) { require(receiver != address(0), "ZERO ADDRESS"); - require(shares <= maxRedeem(owner), "ERC4626: withdraw more than max");
is this check no longer required?
tokenized-strategy
github_2023
others
10
yearn
Schlagonia
@@ -46,44 +46,44 @@ abstract contract BaseStrategy is IBaseStrategy { // Keep this private with a getter function so it can be easily accessed by strategists but not updated uint8 private _decimals; - constructor(address _asset, string memory _name, string memory _symbol) { - _initialize(_asset, _...
We probably want the symbol to be smaller than the name right. So just addingthe name on at the end will always make it longer. Wondering if there is a shorter way to differentiate each strategy?
zero
github_2023
others
28
raystubbs
raystubbs
@@ -0,0 +1,53 @@ +(ns zero-to-one.client-test + (:require [cljs.test :refer [deftest async is use-fixtures]] + [zero-to-one.client :as client] + [zero.component])) + +(defn- make-incrementing-button + [] + (.createElement js/document "incrementing-button")) + +(defn- get-incrementing-button + ...
Neat, didn't know about this 😅
zero
github_2023
others
19
raystubbs
raystubbs
@@ -29,6 +29,111 @@ A toolkit for building web components in Clojure and ClojureScript. - Web components are cool, but the native API for building them isn't very convenient - Zero makes web components easy +## Reactive State +Zero gives you tools for reactive state. You can choose to stick close to the DOM, fo...
Typo `::db/path -> ::db/patch`.
Odin
github_2023
others
156
odtheking
odtheking
@@ -68,7 +70,7 @@ object ArrowAlign : Module( val frameIndex = ((entityPosition.yCoord - frameGridCorner.yCoord) + (entityPosition.zCoord - frameGridCorner.zCoord) * 5).toInt() if (entityPosition.xCoord != frameGridCorner.xCoord || currentFrameRotations?.get(frameIndex) == -1 || frameIndex !in 0..24) ...
Simplify this if statment you can reach the same result using a single condition.
Odin
github_2023
others
146
odtheking
odtheking
@@ -92,20 +93,20 @@ object ChatCommands : Module( private fun handleChatCommands(message: String, name: String, channel: ChatChannel) { val commandsMap = when (channel) { ChatChannel.PARTY -> mapOf ( - "coords" to coords, "odin" to odin, "boop" to boop, "cf" to cf, "8ball" to e...
Remove the kick from the help command of private commands
Odin
github_2023
others
142
odtheking
odtheking
@@ -44,7 +44,7 @@ object DragonPriority { if (totalPower >= easyPower) { if (soloDebuff == 1 && playerClass == DungeonClass.Tank && (spawningDragon.any { it == WitherDragonsEnum.Purple } || soloDebuffOnAll)) spawningDragon.sortByDescending { priorityList.indexOf(it) }
please merge the if statements
Odin
github_2023
others
93
odtheking
freebonsai
@@ -0,0 +1,73 @@ +package me.odinclient.features.impl.dungeon + +import me.odinmain.features.Category +import me.odinmain.features.Module +import me.odinmain.features.settings.impl.BooleanSetting +import me.odinmain.features.settings.impl.NumberSetting +import net.minecraft.client.Minecraft +import net.minecraft.client...
Use the runIn(ticks) function if you already have the settings in ticks.
Odin
github_2023
others
93
odtheking
freebonsai
@@ -0,0 +1,73 @@ +package me.odinclient.features.impl.dungeon + +import me.odinmain.features.Category +import me.odinmain.features.Module +import me.odinmain.features.settings.impl.BooleanSetting +import me.odinmain.features.settings.impl.NumberSetting +import net.minecraft.client.Minecraft +import net.minecraft.client...
do if () return and do this all in one if statement
Odin
github_2023
others
93
odtheking
freebonsai
@@ -0,0 +1,73 @@ +package me.odinclient.features.impl.dungeon + +import me.odinmain.features.Category +import me.odinmain.features.Module +import me.odinmain.features.settings.impl.BooleanSetting +import me.odinmain.features.settings.impl.NumberSetting +import net.minecraft.client.Minecraft +import net.minecraft.client...
Use ItemUtils.getItemSlot() instead of this
Odin
github_2023
others
93
odtheking
freebonsai
@@ -0,0 +1,73 @@ +package me.odinclient.features.impl.dungeon + +import me.odinmain.features.Category +import me.odinmain.features.Module +import me.odinmain.features.settings.impl.BooleanSetting +import me.odinmain.features.settings.impl.NumberSetting +import net.minecraft.client.Minecraft +import net.minecraft.client...
PlayerUtils.rightclick
Odin
github_2023
others
93
odtheking
odtheking
@@ -0,0 +1,58 @@ +package me.odinclient.features.impl.dungeon + +import me.odinmain.features.Category +import me.odinmain.features.Module +import me.odinmain.features.settings.impl.BooleanSetting +import me.odinmain.features.settings.impl.NumberSetting +import me.odinmain.utils.skyblock.* +import me.odinmain.utils.runI...
Do not declare this again there is already a global variable for this Don't copy paste random stuff into this mod
Odin
github_2023
others
93
odtheking
odtheking
@@ -0,0 +1,58 @@ +package me.odinclient.features.impl.dungeon + +import me.odinmain.features.Category +import me.odinmain.features.Module +import me.odinmain.features.settings.impl.BooleanSetting +import me.odinmain.features.settings.impl.NumberSetting +import me.odinmain.utils.skyblock.* +import me.odinmain.utils.runI...
Use Odin's method for getting a block
Odin
github_2023
others
93
odtheking
odtheking
@@ -1,22 +1,22 @@ -pluginManagement {
Don't touch this file
Odin
github_2023
others
93
odtheking
odtheking
@@ -0,0 +1,58 @@ +package me.odinclient.features.impl.dungeon + +import me.odinmain.features.Category +import me.odinmain.features.Module +import me.odinmain.features.settings.impl.BooleanSetting +import me.odinmain.features.settings.impl.NumberSetting +import me.odinmain.utils.skyblock.* +import me.odinmain.utils.runI...
Use Odin's own methods for sending a mod message Do not copy paste random stuff into this mod
Odin
github_2023
others
95
odtheking
odtheking
@@ -0,0 +1,61 @@ +package me.odinclient.features.impl.skyblock + +import me.odinclient.utils.skyblock.PlayerUtils.rightClick +import me.odinmain.features.Category +import me.odinmain.features.Module +import me.odinmain.features.settings.impl.BooleanSetting +import me.odinmain.utils.skyblock.isHolding +import net.minecr...
Use Odin's Input event
Odin
github_2023
others
95
odtheking
odtheking
@@ -0,0 +1,61 @@ +package me.odinclient.features.impl.skyblock + +import me.odinclient.utils.skyblock.PlayerUtils.rightClick +import me.odinmain.features.Category +import me.odinmain.features.Module +import me.odinmain.features.settings.impl.BooleanSetting +import me.odinmain.utils.skyblock.isHolding +import net.minecr...
Merge if statement
Odin
github_2023
others
95
odtheking
odtheking
@@ -0,0 +1,61 @@ +package me.odinclient.features.impl.skyblock + +import me.odinclient.utils.skyblock.PlayerUtils.rightClick +import me.odinmain.features.Category +import me.odinmain.features.Module +import me.odinmain.features.settings.impl.BooleanSetting +import me.odinmain.utils.skyblock.isHolding +import net.minecr...
Inline the if statement
Odin
github_2023
others
95
odtheking
odtheking
@@ -0,0 +1,61 @@ +package me.odinclient.features.impl.skyblock + +import me.odinclient.utils.skyblock.PlayerUtils.rightClick +import me.odinmain.features.Category +import me.odinmain.features.Module +import me.odinmain.features.settings.impl.BooleanSetting +import me.odinmain.utils.skyblock.isHolding +import net.minecr...
Use Odin's input events
Odin
github_2023
others
95
odtheking
odtheking
@@ -0,0 +1,61 @@ +package me.odinclient.features.impl.skyblock + +import me.odinclient.utils.skyblock.PlayerUtils.rightClick +import me.odinmain.features.Category +import me.odinmain.features.Module +import me.odinmain.features.settings.impl.BooleanSetting +import me.odinmain.utils.skyblock.isHolding +import net.minecr...
merge if statements
Odin
github_2023
others
95
odtheking
odtheking
@@ -0,0 +1,61 @@ +package me.odinclient.features.impl.skyblock + +import me.odinclient.utils.skyblock.PlayerUtils.rightClick +import me.odinmain.features.Category +import me.odinmain.features.Module +import me.odinmain.features.settings.impl.BooleanSetting +import me.odinmain.utils.skyblock.isHolding +import net.minecr...
Use Odin's runin function
Odin
github_2023
others
95
odtheking
odtheking
@@ -0,0 +1,61 @@ +package me.odinclient.features.impl.skyblock + +import me.odinclient.utils.skyblock.PlayerUtils.rightClick +import me.odinmain.features.Category +import me.odinmain.features.Module +import me.odinmain.features.settings.impl.BooleanSetting +import me.odinmain.utils.skyblock.isHolding +import net.minecr...
mc.thePlayer is nullable handle that
Odin
github_2023
others
95
odtheking
odtheking
@@ -1,22 +1,22 @@ -pluginManagement {
Don't touch this file
Odin
github_2023
others
121
odtheking
freebonsai
@@ -135,7 +136,12 @@ object DungeonWaypoints : Module( if ((DungeonUtils.inBoss || !DungeonUtils.inDungeons) && !LocationUtils.currentArea.isArea(Island.SinglePlayer)) return val room = DungeonUtils.currentFullRoom ?: return startProfile("Dungeon Waypoints") - glList = RenderUtils.draw...
Doing the color changing inside the drawboxes function makes a lot more sense.
Odin
github_2023
others
127
odtheking
freebonsai
@@ -39,14 +40,13 @@ object BeamsSolver { private var currentLanternPairs = ConcurrentHashMap<BlockPos, Pair<BlockPos, Color>>() fun enterDungeonRoom(event: RoomEnterEvent) { - val room = event.fullRoom?.room ?: return // <-- orb = orb.orb + val room = event.room ?: return if (room.dat...
Make another getRealCoords function where it takes Integers as parameters instead maybe?
Odin
github_2023
others
127
odtheking
freebonsai
@@ -31,17 +31,18 @@ object BoulderSolver { } fun onRoomEnter(event: DungeonEvents.RoomEnterEvent) { - val room = event.fullRoom?.room ?: return reset() + val room = event.room ?: return reset() if (room.data.name != "Boulder") return reset() + val roomComponent = room.roomCompo...
Use the getBlockIdAt with integer parameters.
Odin
github_2023
others
127
odtheking
freebonsai
@@ -42,10 +43,10 @@ object IceFillSolver { } fun enterDungeonRoom(event: RoomEnterEvent) { - val room = event.fullRoom?.room ?: return + val room = event.room ?: return if (room.data.name != "Ice Fill" || currentPatterns.isNotEmpty()) return - scanAllFloors(room.vec3.addRotat...
Same as earlier, integer parameters would be nicer.
Odin
github_2023
others
127
odtheking
freebonsai
@@ -54,14 +55,12 @@ object QuizSolver { } fun enterRoomQuiz(event: RoomEnterEvent) { - val room = event.fullRoom?.room ?: return + val room = event.room ?: return if (room.data.name != "Quiz") return - room.vec3.addRotationCoords(room.rotation, 0, 6).let { middleAnswerBlock -...
Not very related to your changes, but TriviaAnswer should take a blockPos instead of a Vec3.
Odin
github_2023
others
127
odtheking
freebonsai
@@ -54,14 +55,12 @@ object QuizSolver { } fun enterRoomQuiz(event: RoomEnterEvent) { - val room = event.fullRoom?.room ?: return + val room = event.room ?: return
fun enterRoomQuiz(event: RoomEnterEvent) = with(event.room) { // } Would make the val room useless, and code would be cleaner. This could be implemented very many places in the mod, so it's something to look into.
Odin
github_2023
others
127
odtheking
freebonsai
@@ -22,9 +23,10 @@ object TPMazeSolver { private var visited = CopyOnWriteArraySet<BlockPos>() fun onRoomEnter(event: DungeonEvents.RoomEnterEvent) { - val room = event.fullRoom?.room ?: return + val room = event.room ?: return if (room.data.name != "Teleport Maze") return - tp...
make the BlockPos version of getRealCoords also return a BlockPos, and you wouldn't need toBlockPos.
Odin
github_2023
others
129
odtheking
odtheking
@@ -139,13 +139,5 @@ object RenderOptimizer : Module( entity.alwaysRenderNameTag = false } - private fun getHealerFairyTextureValue(armorStand: EntityArmorStand?): String? { - return armorStand?.heldItem - ?.tagCompound - ?.getCompoundTag("SkullOwner") - ...
Doesn't need to be a function
Odin
github_2023
others
129
odtheking
odtheking
@@ -89,7 +90,17 @@ object ModuleManager { @SubscribeEvent fun onTick(event: TickEvent.ClientTickEvent) { if (event.phase != TickEvent.Phase.START) return - tickTasks.removeAll { + tickTasks.tickTaskTick() + } + + @SubscribeEvent + fun onServerTick(event: RealServerTick) { + ...
can get a better naming?
Odin
github_2023
others
129
odtheking
odtheking
@@ -212,20 +214,20 @@ object BloodCamp : Module( currentTickTime += 50 } - //Skull data gotten by DocilElm - private val watcherSkulls = setOf( - "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNGNlYzQwMDA4ZTFjMzFjMTk4NGY0ZDY1MGFiYjM0MTBmMjAzNzExOW...
does that mean u got all of them?
Odin
github_2023
others
130
odtheking
odtheking
@@ -42,7 +45,8 @@ object KuudraReminders : Module( PlayerUtils.alert("Fresh Tools", displayText = displayText, playSound = playSound) } - onMessage(Regex("Used Extreme Focus! \\((\\d+) Mana\\)"), { manaDrain && enabled }) { + onMessage(Regex("Used Extreme Focus! \\((\\d+) Mana\\)")...
Move the check to inside the lambda in the onMessage Resolve conflicts and ill merge
Odin
github_2023
others
126
odtheking
odtheking
@@ -52,8 +52,8 @@ object DungeonWaypoints : Module( tag = TagType.NEW ) { private var allowEdits by BooleanSetting("Allow Edits", false, description = "Allows you to edit waypoints.") - private var reachEdits by BooleanSetting("Reach Edits", false, description = "Extends the reach of edit mode.").withDepe...
add a dot at the end of the description
Odin
github_2023
others
126
odtheking
odtheking
@@ -181,26 +194,44 @@ object DungeonWaypoints : Module( } endProfile() - if (reachEdits && allowEdits) { - reachPos = EtherWarpHelper.getEtherPos(mc.thePlayer.renderVec, mc.thePlayer.rotationYaw, mc.thePlayer.rotationPitch) - reachPos?.pos?.let { - if (use...
use return
Odin
github_2023
others
123
odtheking
freebonsai
@@ -20,6 +26,74 @@ import net.minecraft.util.ChatComponentText val devCommand = commodore("oddev") { + literal("drags") { + runs { text: GreedyString -> + WitherDragonsEnum.entries.forEach { + if (text.string.lowercase().contains(it.name.lowercase())) { + when...
Add reset function for the enum maybe?
Odin
github_2023
others
123
odtheking
freebonsai
@@ -40,6 +54,46 @@ enum class WitherDragonsEnum ( None(Vec3(0.0, 0.0, 0.0), AxisAlignedBB(0.0, 0.0, 0.0, 0.0, 0.0, 0.0), 'f', Color.WHITE, 0.0..0.0, 0.0..0.0); + + fun setAlive(entityId: Int) { + state = WitherDragonState.ALIVE + + timeToSpawn = 100 + timesSpawned += 1 + t...
There is probably a kotlin std function to do this.
Odin
github_2023
others
123
odtheking
freebonsai
@@ -20,6 +26,54 @@ import net.minecraft.util.ChatComponentText val devCommand = commodore("oddev") { + literal("drags") { + runs { text: GreedyString -> + WitherDragonsEnum.entries.forEach { + if (text.string.lowercase().contains(it.name.lowercase())) { + when...
why not .runs
Odin
github_2023
others
123
odtheking
freebonsai
@@ -117,13 +117,23 @@ object BloodCamp : Module( fun onTick() { entityList.ifEmpty { return } watcher.removeAll {it.isDead} - entityList.forEach { (entity, data) -> - if (watcher.none { it.getDistanceToEntity(entity) < 20 }) return@forEach + } + + private fun onPacketLookM...
Use || and compact most of this to a singular if statement
Odin
github_2023
others
123
odtheking
freebonsai
@@ -14,55 +11,36 @@ import me.odinmain.features.impl.floor7.WitherDragons.sendTime import me.odinmain.features.impl.skyblock.ArrowHit.onDragonSpawn import me.odinmain.features.impl.skyblock.ArrowHit.resetOnDragons import me.odinmain.utils.isVecInXZ +import me.odinmain.utils.skyblock.PlayerUtils import me.odinmain.u...
Since there is only one loc after the if statement, it should be inverted instead of it returning.
Odin
github_2023
others
123
odtheking
freebonsai
@@ -14,55 +11,36 @@ import me.odinmain.features.impl.floor7.WitherDragons.sendTime import me.odinmain.features.impl.skyblock.ArrowHit.onDragonSpawn import me.odinmain.features.impl.skyblock.ArrowHit.resetOnDragons import me.odinmain.utils.isVecInXZ +import me.odinmain.utils.skyblock.PlayerUtils import me.odinmain.u...
Put the takeIf inside the find statement
Odin
github_2023
others
123
odtheking
freebonsai
@@ -14,55 +11,36 @@ import me.odinmain.features.impl.floor7.WitherDragons.sendTime import me.odinmain.features.impl.skyblock.ArrowHit.onDragonSpawn import me.odinmain.features.impl.skyblock.ArrowHit.resetOnDragons import me.odinmain.utils.isVecInXZ +import me.odinmain.utils.skyblock.PlayerUtils import me.odinmain.u...
Dragon does not need to be a variable since it is only used once, do the findinging of the entity and run setAlive directly on the result.
Odin
github_2023
others
120
odtheking
odtheking
@@ -40,6 +40,13 @@ val dungeonWaypointsCommand = commodore("dwp", "dungeonwaypoints") { } ?: modMessage("Invalid type!") } + literal("timer").runs { type: String ->
add color codes
Odin
github_2023
others
120
odtheking
odtheking
@@ -49,8 +56,10 @@ object SecretWaypoints { val pos = Vec3(packet.x, packet.y, packet.z) if (pos.distanceTo(etherpos) > 3) return val room = DungeonUtils.currentFullRoom ?: return - val vec = etherpos.subtractVec(x = room.clayPos.x, z = room.clayPos.z).rotateToNorth(room.room.rotation)...
don't define variables if they are only used once
Odin
github_2023
others
120
odtheking
odtheking
@@ -61,15 +70,17 @@ object SecretWaypoints { private fun clickSecret(pos: Vec3, distance: Int, block: IBlockState? = null) { val room = DungeonUtils.currentFullRoom ?: return - val vec = pos.subtractVec(x = room.clayPos.x, z = room.clayPos.z).rotateToNorth(room.room.rotation) + val vec = r...
why define it if its only used once
Odin
github_2023
others
120
odtheking
odtheking
@@ -86,4 +97,40 @@ object SecretWaypoints { DungeonUtils.currentFullRoom?.let { setWaypoints(it) } glList = -1 } + + fun onPosUpdate(pos: Vec3) { + val room = DungeonUtils.currentFullRoom ?: return + val vec = room.getRelativeCoords(pos) + + val waypoints = getWaypoints(ro...
add color codes
Odin
github_2023
others
120
odtheking
odtheking
@@ -350,7 +350,7 @@ object RenderUtils { GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA) for (box in boxes) { - if (box.clicked) continue + if (box.clicked || box.color.alpha <= 0f) continue
use isTransparent
Odin
github_2023
others
94
odtheking
odtheking
@@ -0,0 +1,73 @@ +package me.odinclient.features.impl.skyblock
Merge with the TermAC module
Odin
github_2023
others
94
odtheking
odtheking
@@ -1,22 +1,22 @@ -pluginManagement {
Don't touch this file
Odin
github_2023
others
94
odtheking
odtheking
@@ -0,0 +1,73 @@ +package me.odinclient.features.impl.skyblock + +import me.odinclient.utils.skyblock.PlayerUtils.leftClick +import me.odinclient.utils.skyblock.PlayerUtils.rightClick +import me.odinmain.features.Category +import me.odinmain.features.Module +import me.odinmain.features.settings.Setting.Companion.withDe...
Use Odin's left click and right click functions instead
Odin
github_2023
others
119
odtheking
odtheking
@@ -90,8 +92,9 @@ object MapInfo : Module( init { execute(250) { - if (DungeonUtils.score < 300 || shownTitle || !scoreTitle || !DungeonUtils.inDungeons) return@execute - PlayerUtils.alert(scoreText.replace("&", "§")) + if (DungeonUtils.score < 300 || shownTitle || (!sco...
i dont think i like these color codes
Odin
github_2023
others
105
odtheking
odtheking
@@ -56,5 +56,6 @@ "Broodfather", "Night Spider" ], - "Which of these monsters only spawns at night?": ["Zombie Villager", "Ghast"] + "Which of these monsters only spawns at night?": ["Zombie Villager", "Ghast"], + "What is the name of the vendor in the Hub who sells stained": ["Wool Weaver"]
Seems like the entry is duped just make sure to remove the redundent one
Odin
github_2023
others
103
odtheking
odtheking
@@ -117,4 +118,6 @@ fun openRandomTerminal(ping: Long = 0L, const: Long = 0L) { TerminalTypes.MELODY -> {} TerminalTypes.NONE -> {} } -} \ No newline at end of file +} + +fun isTermSimOpen() = OdinMain.mc.currentScreen is TermSimGui
Mod code style wise we don't make functions for a single check please implement the check instead of a function for it Also make sure to import me.odinmain.OdinMain.mc instead of me.odinmain.OdinMain
Odin
github_2023
others
62
odtheking
xKiian
@@ -0,0 +1,107 @@ +package me.odinmain.features.impl.dungeon + +import me.odinmain.features.Category +import me.odinmain.features.Module +import me.odinmain.events.impl.PacketSentEvent +import me.odinmain.features.settings.impl.BooleanSetting +import me.odinmain.features.settings.impl.ListSetting +import me.odinmain.ut...
Why are you checking twice?
Odin
github_2023
others
98
odtheking
odtheking
@@ -96,7 +98,10 @@ class Dungeon(val floor: Floor?) { val text = packet.prefix.plus(packet.suffix) val cleared = Regex("^Cleared: §[c6a](\\d+)% §8(?:§8)?\\(\\d+\\)$").find(text) - if (cleared != null) dungeonStats.percentCleared = cleared.groupValues[1].toInt() + if (cleared != null) {
Use ?.let instead
Odin
github_2023
others
91
odtheking
freebonsai
@@ -41,35 +43,66 @@ object TerminalSounds : Module( @SubscribeEvent fun onPacket(event: PacketReceivedEvent){ with(event.packet) { + //if (this is S29PacketSoundEffect) modMessage("$soundName, $volume, $pitch") if ( - this !is S29PacketSoundEffect || - ...
uh make the (currentTerm == TerminalTypes.MELODY && slot == 43) check here instead?
Odin
github_2023
others
85
odtheking
freebonsai
@@ -69,6 +70,22 @@ val ItemStack?.isShortbow: Boolean return this?.lore?.any { it.contains("Shortbow: Instantly shoots!") } == true } +/** + * Returns if an item is a fishing rod + */ +val ItemStack?.isFishingRod: Boolean + get() { + return this?.lore?.any { it.contains("FISHING ROD") } == tru...
use itemid
Odin
github_2023
others
85
odtheking
freebonsai
@@ -0,0 +1,191 @@ +package me.odin.features.impl.floor7.p3 + +import me.odinmain.events.impl.BlockChangeEvent +import me.odinmain.events.impl.RealServerTick +import me.odinmain.features.Category +import me.odinmain.features.Module +import me.odinmain.features.settings.Setting.Companion.withDependency +import me.odinmai...
formatting
Odin
github_2023
others
85
odtheking
freebonsai
@@ -0,0 +1,191 @@ +package me.odin.features.impl.floor7.p3 + +import me.odinmain.events.impl.BlockChangeEvent +import me.odinmain.events.impl.RealServerTick +import me.odinmain.features.Category +import me.odinmain.features.Module +import me.odinmain.features.settings.Setting.Companion.withDependency +import me.odinmai...
make both of these val getters, just cleaner
Odin
github_2023
others
85
odtheking
freebonsai
@@ -0,0 +1,417 @@ +package me.odinclient.features.impl.floor7.p3 + +import me.odinclient.utils.skyblock.PlayerUtils.rightClick +import me.odinmain.events.impl.BlockChangeEvent +import me.odinmain.events.impl.RealServerTick +import me.odinmain.features.Category +import me.odinmain.features.Module +import me.odinmain.fea...
do all the same stuff as i commented in legit version
Odin
github_2023
others
85
odtheking
freebonsai
@@ -0,0 +1,417 @@ +package me.odinclient.features.impl.floor7.p3 + +import me.odinclient.utils.skyblock.PlayerUtils.rightClick +import me.odinmain.events.impl.BlockChangeEvent +import me.odinmain.events.impl.RealServerTick +import me.odinmain.features.Category +import me.odinmain.features.Module +import me.odinmain.fea...
DungeonClass.entries?
Odin
github_2023
others
85
odtheking
freebonsai
@@ -0,0 +1,417 @@ +package me.odinclient.features.impl.floor7.p3 + +import me.odinclient.utils.skyblock.PlayerUtils.rightClick +import me.odinmain.events.impl.BlockChangeEvent +import me.odinmain.events.impl.RealServerTick +import me.odinmain.features.Category +import me.odinmain.features.Module +import me.odinmain.fea...
cant you just write § ?
Odin
github_2023
others
85
odtheking
freebonsai
@@ -0,0 +1,193 @@ +package me.odin.features.impl.floor7.p3 + +import me.odinmain.events.impl.BlockChangeEvent +import me.odinmain.events.impl.RealServerTick +import me.odinmain.features.Category +import me.odinmain.features.Module +import me.odinmain.features.settings.Setting.Companion.withDependency +import me.odinmai...
you can just filterIsInstance<EntityArmorStand>() before your find and you will not need to cast
Odin
github_2023
others
90
odtheking
odtheking
@@ -35,17 +48,29 @@ object TerminalSounds : Module( customSound == "note.pling" || soundName != "note.pling" || volume != 8f || - pitch != 4.047619f + pitch != 4.047619f || + !clickSounds ) return p...
mc.theplayer.name will never have color codes
Odin
github_2023
others
90
odtheking
odtheking
@@ -39,4 +46,59 @@ object TerminalTimes : Module( termPBs.time(event.type.ordinal, (System.currentTimeMillis() - startTimer) / 1000.0, "s§7!", "§a${event.type.guiName} §7solved in §6", addPBString = true, addOldPBString = true, sendOnlyPB = sendMessage) type = TerminalTypes.NONE } + + private ...
need to add enabled as well for onmessage if u are overriding the default
Odin
github_2023
others
90
odtheking
odtheking
@@ -39,4 +46,59 @@ object TerminalTimes : Module( termPBs.time(event.type.ordinal, (System.currentTimeMillis() - startTimer) / 1000.0, "s§7!", "§a${event.type.guiName} §7solved in §6", addPBString = true, addOldPBString = true, sendOnlyPB = sendMessage) type = TerminalTypes.NONE } + + private ...
same as one above
Odin
github_2023
others
90
odtheking
odtheking
@@ -39,4 +46,59 @@ object TerminalTimes : Module( termPBs.time(event.type.ordinal, (System.currentTimeMillis() - startTimer) / 1000.0, "s§7!", "§a${event.type.guiName} §7solved in §6", addPBString = true, addOldPBString = true, sendOnlyPB = sendMessage) type = TerminalTypes.NONE } + + private ...
use destructured to define all the groups from the matchresult
Odin
github_2023
others
90
odtheking
freebonsai
@@ -0,0 +1,106 @@ +package me.odinmain.features.impl.floor7 + +import me.odinmain.events.impl.RealServerTick +import me.odinmain.features.Category +import me.odinmain.features.Module +import me.odinmain.features.settings.Setting.Companion.withDependency +import me.odinmain.features.settings.impl.BooleanSetting +import ...
What
Odin
github_2023
others
90
odtheking
freebonsai
@@ -0,0 +1,106 @@ +package me.odinmain.features.impl.floor7 + +import me.odinmain.events.impl.RealServerTick +import me.odinmain.features.Category +import me.odinmain.features.Module +import me.odinmain.features.settings.Setting.Companion.withDependency +import me.odinmain.features.settings.impl.BooleanSetting +import ...
Do u really need the if checks here?
Odin
github_2023
others
90
odtheking
freebonsai
@@ -22,6 +27,8 @@ object TerminalTimes : Module( modMessage("§6Terminal PBs §fhave been reset.") } + private val terminalSplits: Boolean by BooleanSetting("Terminal Splits", default = true, description = "Adds the time when a term was completed to its message, and sends the total term time after term...
Doesnt this fit way better in the splits module?
Odin
github_2023
others
87
odtheking
freebonsai
@@ -103,7 +103,7 @@ object CanClip : Module( else -> return } - if (line) Renderer.draw3DLine(pos1, pos2, color = Color.RED) + if (line) Renderer.draw3DLine(pos1, pos2, color = Color.RED, depth = true)
should depth be true there? seems nicer to be able to see it through blocks
Odin
github_2023
others
81
odtheking
freebonsai
@@ -0,0 +1,68 @@ +package me.odinclient.features.impl.skyblock + +import me.odinmain.features.Category +import me.odinmain.features.Module +import me.odinmain.utils.skyblock.LocationUtils.inSkyblock +import net.minecraft.client.gui.inventory.GuiChest +import net.minecraft.init.Blocks +import net.minecraft.inventory.Con...
use PlayerUtils.windowclick (look at autoterms or something)
Odin
github_2023
others
81
odtheking
freebonsai
@@ -0,0 +1,68 @@ +package me.odinclient.features.impl.skyblock + +import me.odinmain.features.Category +import me.odinmain.features.Module +import me.odinmain.utils.skyblock.LocationUtils.inSkyblock +import net.minecraft.client.gui.inventory.GuiChest +import net.minecraft.init.Blocks +import net.minecraft.inventory.Con...
Use a tickevent instead of a renderevent
Odin
github_2023
others
81
odtheking
freebonsai
@@ -0,0 +1,68 @@ +package me.odinclient.features.impl.skyblock + +import me.odinmain.features.Category +import me.odinmain.features.Module +import me.odinmain.utils.skyblock.LocationUtils.inSkyblock +import net.minecraft.client.gui.inventory.GuiChest +import net.minecraft.init.Blocks +import net.minecraft.inventory.Con...
use ContainerChest.name extension value from Utils.kt, container.name in this case
Odin
github_2023
others
81
odtheking
freebonsai
@@ -0,0 +1,65 @@ +package me.odinclient.features.impl.skyblock + +import me.odinmain.features.Category +import me.odinmain.features.Module +import me.odinmain.utils.skyblock.LocationUtils.inSkyblock +import me.odinmain.utils.skyblock.PlayerUtils.windowClick +import net.minecraft.client.gui.inventory.GuiChest +import ne...
remove extra space
Odin
github_2023
others
81
odtheking
freebonsai
@@ -0,0 +1,65 @@ +package me.odinclient.features.impl.skyblock + +import me.odinmain.features.Category +import me.odinmain.features.Module +import me.odinmain.utils.skyblock.LocationUtils.inSkyblock +import me.odinmain.utils.skyblock.PlayerUtils.windowClick +import net.minecraft.client.gui.inventory.GuiChest +import ne...
PlayerUtils.windowClick(slot.slotNumber, PlayerUtils.ClickType.Left)
Odin
github_2023
others
83
odtheking
freebonsai
@@ -0,0 +1,49 @@ +package me.odinmain.features.impl.floor7.p3 + +import me.odinmain.events.impl.PacketReceivedEvent +import me.odinmain.features.Category +import me.odinmain.features.Module +import me.odinmain.features.impl.floor7.p3.TerminalSolver.currentTerm +import me.odinmain.features.settings.Setting.Companion.wit...
if you want to make it multiple lines then make it like the other multiline if statements in the mod
Odin
github_2023
others
83
odtheking
freebonsai
@@ -30,6 +32,12 @@ object PlayerUtils { shouldBypassVolume = false } + fun playLoudSoundAtLocation(pos: Vec3, sound: String?, volume: Float, pitch: Float) {
make the other function call this function if you are going to have both
Odin
github_2023
others
83
odtheking
freebonsai
@@ -23,6 +23,37 @@ data class DungeonPlayer( var isDead: Boolean = false ) +data class Puzzle( + val name: String, + var status: PuzzleStatus? = null +) { + companion object { + val Unknown = Puzzle("???") + val Blaze = Puzzle("Higher Or Lower") + val Beams = Puzzle("Creeper Beams"...
This should be an enum i think
Odin
github_2023
others
83
odtheking
freebonsai
@@ -23,6 +23,37 @@ data class DungeonPlayer( var isDead: Boolean = false ) +data class Puzzle( + val name: String, + var status: PuzzleStatus? = null +) { + companion object {
this could also be an enum, then you wouldnt need the list
Odin
github_2023
others
83
odtheking
freebonsai
@@ -0,0 +1,97 @@ +package me.odinmain.features.impl.dungeon + +import me.odinmain.features.Category +import me.odinmain.features.Module +import me.odinmain.features.settings.Setting.Companion.withDependency +import me.odinmain.features.settings.impl.* +import me.odinmain.ui.clickgui.util.ColorUtil.withAlpha +import me....
You dont need the if (it) statement if you initialize the variables with placeholder text anyway, then it can just show the last values in examplehud Also the executor is unnecessary and you shouldnt really need them to be variables either, just use the mcTextAndWidth function and give the values in format strings
Odin
github_2023
others
83
odtheking
freebonsai
@@ -48,4 +62,14 @@ object EtherWarpHelper : Module( Renderer.drawStyledBlock(pos, color, style, lineWidth, depthCheck) } } + + @SubscribeEvent + fun onSoundPacket(event: PacketReceivedEvent) { + with(event.packet) { + if (this !is S29PacketSoundEffect || soundName != "...
what the fuck