Bug fixing #17
+6
-5
@@ -9,6 +9,7 @@ import io.github.togar2.pvp.events.FinalAttackEvent;
|
|||||||
import io.github.togar2.pvp.events.PrepareAttackEvent;
|
import io.github.togar2.pvp.events.PrepareAttackEvent;
|
||||||
import io.github.togar2.pvp.feature.CombatFeatures;
|
import io.github.togar2.pvp.feature.CombatFeatures;
|
||||||
import io.github.togar2.pvp.feature.knockback.KnockbackSettings;
|
import io.github.togar2.pvp.feature.knockback.KnockbackSettings;
|
||||||
|
import net.minestom.server.ServerFlag;
|
||||||
import net.minestom.server.coordinate.Pos;
|
import net.minestom.server.coordinate.Pos;
|
||||||
import net.minestom.server.entity.Player;
|
import net.minestom.server.entity.Player;
|
||||||
import net.minestom.server.event.instance.InstanceTickEvent;
|
import net.minestom.server.event.instance.InstanceTickEvent;
|
||||||
@@ -52,14 +53,14 @@ class HighGround extends StatelessGame {
|
|||||||
this.eventNode().addListener(
|
this.eventNode().addListener(
|
||||||
EntityKnockbackEvent.class,
|
EntityKnockbackEvent.class,
|
||||||
entityKnockbackEvent -> {
|
entityKnockbackEvent -> {
|
||||||
|
MineTec marked this conversation as resolved
|
|||||||
if(entityKnockbackEvent.getEntity().getVelocity().y() > 4) { entityKnockbackEvent.setCancelled(true); return; }
|
double tps = ServerFlag.SERVER_TICKS_PER_SECOND;
|
||||||
entityKnockbackEvent.setSettings(
|
entityKnockbackEvent.setSettings(
|
||||||
KnockbackSettings.builder()
|
KnockbackSettings.builder()
|
||||||
.horizontal(1.1)
|
.horizontal(1.1)
|
||||||
.vertical(0)
|
.vertical(KnockbackSettings.DEFAULT.vertical() / tps)
|
||||||
.verticalLimit(0)
|
.verticalLimit(KnockbackSettings.DEFAULT.verticalLimit() / tps)
|
||||||
.extraHorizontal(0.5)
|
.extraHorizontal(KnockbackSettings.DEFAULT.extraHorizontal() / tps)
|
||||||
.extraVertical(0)
|
.extraVertical(KnockbackSettings.DEFAULT.extraVertical() / tps)
|
||||||
.build()
|
.build()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user
der check behandelt das Symptom, nicht die Ursache
Der check sollte nicht nötig sein.