Skip to content

Instantly share code, notes, and snippets.

@sathonay
sathonay / .java
Created June 16, 2019 13:23 — forked from iamnoksio/.java
Here's the god damn "magic" kohi knockback, maybe people can stop believing in magic some day and just play the fucking game. Credit to OCN's SportBukkit for the relog fix (Better fix by Noksio)
knockbackSprintForce = 0.435D;
knockbackSprintHeight = 0.077D;
knockbackFriction = 2.0D;
knockbackForceHeight = 0.38D;
knockbackHeightLimit = 0.4D;
@sathonay
sathonay / PlayerConnection.java
Created June 16, 2019 13:23 — forked from iamnoksio/PlayerMoveEvent.patch
PlayerMoveEvent Optimization
if (this.checkMovement && !this.player.dead) {
// Prevent 40 event-calls for less than a single pixel of movement >.>
double delta = Math.pow(this.lastPosX - to.getX(), 2) + Math.pow(this.lastPosY - to.getY(), 2) + Math.pow(this.lastPosZ - to.getZ(), 2);
float deltaAngle = Math.abs(this.lastYaw - to.getYaw()) + Math.abs(this.lastPitch - to.getPitch());
// Dont execute move event on head rotation
if (deltaAngle > 10f) {
this.lastYaw = to.getYaw();
this.lastPitch = to.getPitch();
// TODO: PlayerHeadRotationEvent
@sathonay
sathonay / EntityEnderPearl.java
Last active October 9, 2020 17:42 — forked from iamnoksio/EntityEnderPearl.java
Antipearl glitch in spigot
package net.minecraft.server;
// CraftBukkit start
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.craftbukkit.entity.CraftEnderPearl;
import org.bukkit.craftbukkit.entity.CraftEntity;
import org.bukkit.craftbukkit.entity.CraftPlayer;
import org.bukkit.craftbukkit.event.CraftEventFactory;
import org.bukkit.event.entity.EnderpearlLandEvent;