Open
Conversation
Author
|
togarAragot
reviewed
Apr 22, 2025
| "text.hero.spiderman.description": "Spiderman Beschreibung???", | ||
| "hero.spiderman.ability.swing.description": "Scheiße ein Netz und schwinge.", | ||
| "heroes.property.web_shoot_power": "Schusskraft", | ||
| "heroes.property.web_shoot_power.description": "Die Kraft, mit der zu das Netz schießt.", |
There was a problem hiding this comment.
Typo? Should be "du" instead of "zu"?
|
|
||
| fun handleCobwebClimbCheck(player: PlayerEntity, cir: CallbackInfoReturnable<Boolean>) { | ||
| if (player.getHero() == SpidermanManager.Spiderman && !player.isSpectator && player.blockStateAtPos.block == Blocks.COBWEB) { | ||
| cir.returnValue = true |
There was a problem hiding this comment.
I believe this if is unnecessary, just do
cir.returnValue = player.getHero() == SpidermanManager.Spiderman && !player.isSpectator && player.blockStateAtPos.block == Blocks.COBWEB
Comment on lines
+9
to
+10
| if (player.getHero() == SpidermanManager.Spiderman && !player.isSpectator && player.horizontalCollision) { | ||
| cir.returnValue = true |
There was a problem hiding this comment.
This as well can be shortened
cir.returnValue = player.getHero() == SpidermanManager.Spiderman && !player.isSpectator && player.horizontalCollision
Comment on lines
+45
to
+51
| if (player.world is ServerWorld) { | ||
| repeat(webAmount.getValue(player.uuid).toInt()) { | ||
| val web = FallingCobwebEntity(player) | ||
| web.velocity = player.directionVector.multiply(0.6).addRandom(player.world.random, 0.3f) | ||
| player.world.spawnEntity(web) | ||
| } | ||
| } |
There was a problem hiding this comment.
Use early returns, they help with code readablity and maintainability
if (player.world !is ServerWorld) {
return
}
// Continue with your codeThere was a problem hiding this comment.
Please reformat the code, indentations are not consistent and make the code hard to read (CTRL + ALT + L)
Comment on lines
+22
to
+39
| if (!world.isClient && isAlive) { | ||
| if (!isOnGround) { | ||
| Direction.entries.forEach { | ||
| val pos = this.pos.add(0.5, 0.5, 0.5).add(it.doubleVector).toBlockPos() | ||
| if (!world.getBlockState(pos).isAir) { | ||
| if (world.setBlockState(blockPos, blockState, 3)) { | ||
| discard() | ||
| } | ||
| return | ||
| } | ||
| } | ||
| val y = blockPos.y | ||
| if ((timeFalling > 100 && (y <= world.bottomY || y > world.topYInclusive)) || timeFalling > 600) { | ||
| discard() | ||
| } | ||
| } | ||
| velocity = velocity.multiply(0.98) | ||
| } |
There was a problem hiding this comment.
Code is fine, just again early returns needed
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fähigkeiten
Swing ✅
Netz schießen, Netz bleibt kleben, schwingen
Throw webs ✅
Netze werfen (werden zu Blöcken, wenn sie auf dem Boden landen)
Wall climb ✅
An wänden klettern (Permanente Fähigkeit)
Cobweb climb ✅
In Spinnennetzen klettern (Permanente Fähigkeit)