This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Ported from Exerosis' kotlin example | |
| public class KnockbackUtil { | |
| private static final double FRICTION = 1.0; | |
| private static final double HORIZONTAL = 0.40; | |
| private static final double VERTICAL = 0.36075; | |
| private static final double EXTRA_VERTICAL = 0.1; | |
| private static final double EXTRA_HORIZONTAL = 1.5; | |
| public static Vector getKnockback(Location entityLoc, Entity attacker) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import com.mojang.authlib.GameProfile; | |
| import com.mojang.authlib.properties.Property; | |
| import com.mojang.datafixers.util.Pair; | |
| import io.netty.buffer.Unpooled; | |
| import net.minecraft.core.BlockPosition; | |
| import net.minecraft.nbt.NBTTagCompound; | |
| import net.minecraft.network.PacketDataSerializer; | |
| import net.minecraft.network.chat.IChatBaseComponent; | |
| import net.minecraft.network.protocol.Packet; | |
| import net.minecraft.network.protocol.game.*; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package yourpackage; | |
| import org.bukkit.inventory.ItemStack; | |
| import org.bukkit.util.io.BukkitObjectInputStream; | |
| import org.bukkit.util.io.BukkitObjectOutputStream; | |
| import org.yaml.snakeyaml.external.biz.base64Coder.Base64Coder; | |
| import java.io.ByteArrayInputStream; | |
| import java.io.ByteArrayOutputStream; |