Bug fixing #17

Merged
MineTec merged 3 commits from bugFixing into develop 2026-10-28 21:13:04 +00:00
2 changed files with 14 additions and 11 deletions

No files matched your search

@@ -9,6 +9,7 @@ import io.github.togar2.pvp.events.FinalAttackEvent;
import io.github.togar2.pvp.events.PrepareAttackEvent;
import io.github.togar2.pvp.feature.CombatFeatures;
import io.github.togar2.pvp.feature.knockback.KnockbackSettings;
import net.minestom.server.ServerFlag;
import net.minestom.server.coordinate.Pos;
import net.minestom.server.entity.Player;
import net.minestom.server.event.instance.InstanceTickEvent;
@@ -51,15 +52,18 @@ class HighGround extends StatelessGame {
this.eventNode().addListener(
EntityKnockbackEvent.class,
entityKnockbackEvent -> entityKnockbackEvent.setSettings(
KnockbackSettings.builder()
.horizontal(1.1)
.vertical(KnockbackSettings.DEFAULT.vertical())
.verticalLimit(KnockbackSettings.DEFAULT.verticalLimit())
.extraHorizontal(KnockbackSettings.DEFAULT.extraHorizontal())
.extraVertical(KnockbackSettings.DEFAULT.extraVertical())
.build()
)
entityKnockbackEvent -> {
MineTec marked this conversation as resolved
Review

der check behandelt das Symptom, nicht die Ursache
Der check sollte nicht nötig sein.

der check behandelt das Symptom, nicht die Ursache Der check sollte nicht nötig sein.
double tps = ServerFlag.SERVER_TICKS_PER_SECOND;
entityKnockbackEvent.setSettings(
KnockbackSettings.builder()
.horizontal(1.1)
.vertical(KnockbackSettings.DEFAULT.vertical() / tps)
.verticalLimit(KnockbackSettings.DEFAULT.verticalLimit() / tps)
.extraHorizontal(KnockbackSettings.DEFAULT.extraHorizontal() / tps)
.extraVertical(KnockbackSettings.DEFAULT.extraVertical() / tps)
.build()
);
}
);
this.eventNode().addListener(InstanceTickEvent.class, instanceTickEvent -> {
@@ -147,10 +147,10 @@ class Tetris extends StatelessGame {
TetrisGame tetrisGame = this.tetrisGames.get(p);
p.teleport(tetrisGame.getPlayerSpawnPosition());
tetrisGame.sidebar.addViewer(p);
MinecraftServer.getSchedulerManager().scheduleTask(() -> {
p.teleport(tetrisGame.getPlayerSpawnPosition());
Entity ghostBlock = new Entity(EntityType.BLOCK_DISPLAY);
((BlockDisplayMeta) ghostBlock.getEntityMeta()).setBlockState(Block.AIR);
ghostBlock.setNoGravity(true);
@@ -159,7 +159,6 @@ class Tetris extends StatelessGame {
return TaskSchedule.stop();
}, TaskSchedule.nextTick());
return super.onPlayerJoin(p);
}