Skip to content

Conversation

@FabiPunktExe
Copy link

@FabiPunktExe FabiPunktExe commented Mar 12, 2025

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)

@FabiPunktExe
Copy link
Author

  1. Soll wall climb permanent aktiv sein (weil nicht stark), oder eine richtige Fähigkeit?
  2. Sonst noch Wünsche?

"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.",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
}
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use early returns, they help with code readablity and maintainability

        if (player.world !is ServerWorld) {
            return
        }
        // Continue with your code

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use early returns please

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code is fine, just again early returns needed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants