4 Commits
Author SHA1 Message Date
MineTec 70be6418e0 Merge pull request 'Bug fixing' (#17) from bugFixing into develop
Reviewed-on: #17
Reviewed-by: Elias Müller <elias@elias-mueller.com>
2026-10-28 21:13:04 +00:00
jannis 9d779a4879 fixed root cause of knockback issue in high ground 2026-10-28 22:07:45 +01:00
jannis f23495ecdd fixed knockback issue in high ground 2026-10-25 17:01:20 +01:00
jannis 89b81a3288 fixed spawning issues in tetris 2026-10-25 16:35:48 +01: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 -> {
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);
}