Skip to content

Instantly share code, notes, and snippets.

View nathanfranke's full-sized avatar
💻

nathanfranke nathanfranke

💻
View GitHub Profile
@nathanfranke
nathanfranke / SidebarPlugin.kt
Last active March 1, 2022 14:32
All Zeros Sidebar in Paper 1.18.2 (1.8 Compatible)
package me.nathanfranke.sidebarplugin
import net.kyori.adventure.text.Component
import net.kyori.adventure.text.format.NamedTextColor
import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer
import org.bukkit.ChatColor
import org.bukkit.entity.Player
import org.bukkit.event.EventHandler
import org.bukkit.event.Listener
import org.bukkit.event.player.PlayerJoinEvent
@nathanfranke
nathanfranke / NickPlugin.kt
Created February 27, 2022 09:37
Seamless Name, UUID, and Skin Disguise on Paper 1.18 (ProtocolLib)
package me.nathanfranke.nickplugin
import com.comphenix.protocol.PacketType
import com.comphenix.protocol.ProtocolLibrary
import com.comphenix.protocol.events.PacketAdapter
import com.comphenix.protocol.events.PacketContainer
import com.comphenix.protocol.events.PacketEvent
import com.comphenix.protocol.wrappers.EnumWrappers
import com.comphenix.protocol.wrappers.PlayerInfoData
import com.comphenix.protocol.wrappers.WrappedChatComponent
@nathanfranke
nathanfranke / Example.kt
Last active February 17, 2022 20:15
Kyori Adventure complex localization with arguments (e.g. plural, grammar)
@Suppress("UNUSED")
class MyPlugin : JavaPlugin(), Listener {
override fun onEnable() {
super.onEnable()
server.pluginManager.registerEvents(this, this)
}
@EventHandler
fun onPlayerJoin(event: PlayerJoinEvent) {
for (i in 1..5) {