Git Product home page Git Product logo

emojitab's Introduction

EmojiTab

EmojiTab banner

A Paper plugin for tab completion of emojis 👍

Here's a demo of the plugin in action:
Demo

Table of Contents

Background

Larger Minecraft servers that employ resource packs have been using these tab-completable emojis for ages. Origin Realms, Mineclub, and some upcoming servers come to mind. However, no plugin to replicate this was available to the public. Thus, EmojiTab was born.

How does it work?

EmojiTab creates a fake "player" in the player list for each emoji shortcode. This adds them to the list of usernames you can tab-complete in any chat message.

The players all appear to have no name, and have a gray skin to blend in with the player list's background (this can be configured.) This is how the big networks do it too, but you might not notice it because the player lists are usually quite full.

To keep these fake players from appearing above real players they are added to a fake scoreboard team called zzzzzzzzz_emoji_tab.

Player list full of gray blank players

Compatibility

EmojiTab should be compatible with all other chat/player list plugins. This is because everything is sent via packets, so none of the players/teams exist on the server. You'll notice that if you run /team list, the team for sorting does not show up. On the backend, this means even if a player is looking at a custom plugin scoreboard, the team's sorting will still be in effect. If you run into any compatibility issues with other plugins, let me know!

Installation

Note: Spigot and Bukkit are NOT supported. This plugin uses several of Paper's API features. Paper is the most popular server software, but if there is enough demand for a Spigot version I could consider adding Spigot support.

Dependencies

This plugin depends on ProtocolLib for creating packets.

Usage

Commands

/emoji reload - Reloads the configs and player lists.

/emoji toggle [player] - Toggles tab completion of emojis for player, or yourself if no player is specified. This does NOT toggle the ability to use emojis in chat.

/emoji list - List all emojis in chat. Hover over them to see names, and click to enter it in chat.

/emoji - Shortcut for /emoji list

Screenshot showing /emoji

Config

EmojiTab has two config files. config.yml is for plugin-wide configuration settings. emojis.yml is where you define your own emojis.

config.yml

# EmojiTab by Legitimoose

# Character to put around emojis, can be left blank if desired.
# Defaults to semicolon ":"
emoji-wrapping: ":"

# Require permission emoji.use to be able to use emojis.
use-permissions: false

# Require permission emoji.use.<emoji name> to be able to use emojis.
# All emojis will still be visible in tab-completion to players without permission.
individual-permissions: false

# Whether to spam the server log with every emoji's data on startup
verbose: false

# CUSTOM PLAYER LIST SKIN
#
# Go to https://mineskin.org and choose a skin.
# Copy and paste "Texture Data" and "Texture Signature" into here.
custom-texture-data:
custom-texture-signature:

emojis.yml

By default, emojis.yml is populated with many of the characters included in Minecraft's default font.

An emoji can be one character or multiple (ノಠ益ಠ)ノ彡┻━┻. Custom characters can be added using a resource pack with a custom font.

name is what you type in chat to make the emoji appear. aliases is any number of alternate names for the same emoji.

NOTE: The combined length of name and emoji-wrapping (found in config.yml) cannot exceed 16 characters. This is a hard limit in Minecraft, and any emoji shortcodes longer than 16 characters will be truncated (you'll get a warning in the console, too.)

emojis:
  :
    name: swords
    aliases: crossed_swords
  :
    name: skull
  ©:
    name: copyright
  ®:
    name: registered
  :
    name: tm
    aliases: trademark
  :
    name: '!!'
  :
    name: interrobang
    aliases: [ '!?' ]
  :
    name: sun
  :
    name: cloud
  :
    name: female_sign
  :
    name: male_sign
  :
    name: spades
  :
    name: clubs
  :
    name: hearts
  :
    name: diamonds
  :
    name: lightning
    aliases: zap
  :
    name: pickaxe
  :
    name: check_mark
  :
    name: snowflake
  :
    name: x
  :
    name: heart
  :
    name: star
  :
    name: eject
  :
    name: fast_forward
  :
    name: fast_reverse
    aliases: rewind
  :
    name: next_track
  :
    name: last_track
  :
    name: play_or_pause
  :
    name: pause
  :
    name: stop
    aliases: square
  :
    name: record
    aliases: circle
  :
    name: play
    aliases: arrow_forward
  :
    name: reverse
    aliases: arrow_backward
  :
    name: anchor
  :
    name: smile
  :
    name: frown
    aliases: sad
  :
    name: envelope
    aliases: email
  :
    name: umbrella
  :
    name: umbrella_rain
  :
    name: comet
  :
    name: snowman2
  :
    name: snowman
  :
    name: hourglass
  :
    name: watch
  :
    name: heart_exclamation
  :
    name: lightning_rain
  :
    name: left_right
  :
    name: warning
  :
    name: circled_M
    aliases: m
  :
    name: yin_yang
  :
    name: check_box
  (ノಠ益ಠ)ノ彡┻━┻:
    name: table_flip

Contributing

PRs welcome! The source code is pretty well documented. If you have any questions, you can usually find me in my Discord server.

emojitab's People

Contributors

remynfv avatar

Stargazers

azazeldev avatar Andrej Bartulin avatar Dannyx avatar  avatar s avatar Quinten avatar Miah avatar Rhythmic avatar Adrián Fúnez avatar Vierdant avatar  avatar Nhan Le avatar Zuuki avatar Poundcake avatar Zac avatar

Watchers

 avatar s avatar

emojitab's Issues

Error and disabling on startup

Not entirely sure if this is an issue with the plugin or protocolLib but it seems that there's an issue on startup on 1.19.3

Stack Trace
[20:52:01 INFO]: [EmojiTab] Enabling EmojiTab v1.0-SNAPSHOT
[20:52:01 INFO]: [EmojiTab] > Loaded!
[20:52:01 INFO]: [EmojiTab] > WARN: Emoji name ':heart_exclamation:' is over 16 characters and will be trimmed!
[20:52:01 ERROR]: Error occurred while enabling EmojiTab v1.0-SNAPSHOT (Is it up to date?)
com.comphenix.protocol.reflect.FieldAccessException: Field index 0 is out of bounds for length 0
	at com.comphenix.protocol.reflect.FieldAccessException.fromFormat(FieldAccessException.java:49) ~[ProtocolLib.jar:?]
	at com.comphenix.protocol.reflect.StructureModifier.write(StructureModifier.java:316) ~[ProtocolLib.jar:?]
	at com.comphenix.packetwrapper.WrapperPlayServerPlayerInfo.setAction(WrapperPlayServerPlayerInfo.java:45) ~[EmojiTab.jar:?]
	at com.github.remynfv.emojitab.EmojiTab.generateEmojiPackets(EmojiTab.kt:130) ~[EmojiTab.jar:?]
	at com.github.remynfv.emojitab.EmojiTab.reloadConfigs(EmojiTab.kt:209) ~[EmojiTab.jar:?]
	at com.github.remynfv.emojitab.EmojiTab.onEnable(EmojiTab.kt:114) ~[EmojiTab.jar:?]
	at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264) ~[purpur-api-1.19.3-R0.1-SNAPSHOT.jar:?]
	at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:372) ~[purpur-api-1.19.3-R0.1-SNAPSHOT.jar:?]
	at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:550) ~[purpur-api-1.19.3-R0.1-SNAPSHOT.jar:?]
	at org.bukkit.craftbukkit.v1_19_R2.CraftServer.enablePlugin(CraftServer.java:631) ~[purpur-1.19.3.jar:git-Purpur-1916]
	at org.bukkit.craftbukkit.v1_19_R2.CraftServer.enablePlugins(CraftServer.java:544) ~[purpur-1.19.3.jar:git-Purpur-1916]
	at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:640) ~[purpur-1.19.3.jar:git-Purpur-1916]
	at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:439) ~[purpur-1.19.3.jar:git-Purpur-1916]
	at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:344) ~[purpur-1.19.3.jar:git-Purpur-1916]
	at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1117) ~[purpur-1.19.3.jar:git-Purpur-1916]
	at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:321) ~[purpur-1.19.3.jar:git-Purpur-1916]
	at java.lang.Thread.run(Thread.java:833) ~[?:?]
[20:52:01 INFO]: [EmojiTab] Disabling EmojiTab v1.0-SNAPSHOT
Startup Log
[20:51:51] [ServerMain/INFO]: Building unoptimized datafixer
[20:51:52] [ServerMain/INFO]: Environment: authHost='https://authserver.mojang.com', accountsHost='https://api.mojang.com', sessionHost='https://sessionserver.mojang.com', servicesHost='https://api.minecraftservices.com', name='PROD'
[20:51:53] [ServerMain/INFO]: Loaded 7 recipes
[20:51:54] [Server thread/INFO]: Starting minecraft server version 1.19.3
[20:51:54] [Server thread/INFO]: Loading properties
[20:51:54] [Server thread/INFO]: This server is running Purpur version git-Purpur-1916 (MC: 1.19.3) (Implementing API version 1.19.3-R0.1-SNAPSHOT) (Git: 41593ba on HEAD)
[20:51:55] [Server thread/INFO]: Server Ping Player Sample Count: 12
[20:51:55] [Server thread/INFO]: Using 4 threads for Netty based IO
[20:51:55] [Server thread/INFO]: [ChunkTaskScheduler] Chunk system is using 1 I/O threads, 3 worker threads, and gen parallelism of 3 threads
[20:51:55] [Server thread/INFO]: [Pufferfish] Max SIMD vector size on this system is 256 bits (int)
[20:51:55] [Server thread/INFO]: [Pufferfish] Max SIMD vector size on this system is 256 bits (float)
[20:51:55] [Server thread/INFO]: [Pufferfish] SIMD operations detected as functional. Will replace some operations with faster versions.
[20:51:55] [Server thread/INFO]: Default game type: SURVIVAL
[20:51:55] [Server thread/INFO]: Generating keypair
[20:51:56] [Server thread/INFO]: Starting Minecraft server on *:25565
[20:51:56] [Server thread/INFO]: Using epoll channel type
[20:51:56] [Server thread/INFO]: Paper: Using libdeflate (Linux x86_64) compression from Velocity.
[20:51:56] [Server thread/INFO]: Paper: Using OpenSSL 3.0.x (Linux x86_64) cipher from Velocity.
[20:51:57] [Server thread/INFO]: [LuckPerms] Loading LuckPerms v5.4.62
[20:51:57] [Server thread/INFO]: [SimpleBucketMobs] Loading SimpleBucketMobs vdev
[20:51:57] [Server thread/INFO]: [spark] Loading spark v1.10.30
[20:51:57] [Server thread/INFO]: [AdvancedGift] Loading AdvancedGift v1.11.1
[20:51:57] [Server thread/INFO]: [ProtocolLib] Loading ProtocolLib v5.0.0-SNAPSHOT-b614
[20:51:58] [Server thread/INFO]: [EmojiTab] Loading EmojiTab v1.0-SNAPSHOT
[20:51:58] [Server thread/INFO]: Server permissions file permissions.yml is empty, ignoring it
[20:51:58] [Server thread/INFO]: [LuckPerms] Enabling LuckPerms v5.4.62
[20:51:58] [Server thread/INFO]:         __    
[20:51:58] [Server thread/INFO]:   |    |__)   LuckPerms v5.4.62
[20:51:58] [Server thread/INFO]:   |___ |      Running on Bukkit - Purpur
[20:51:58] [Server thread/INFO]: 
[20:51:58] [Server thread/INFO]: [LuckPerms] Loading configuration...
[20:51:59] [Server thread/INFO]: [LuckPerms] Loading storage provider... [H2]
[20:51:59] [Server thread/INFO]: [LuckPerms] Loading internal permission managers...
[20:51:59] [Server thread/INFO]: [LuckPerms] Performing initial data load...
[20:51:59] [Server thread/INFO]: [LuckPerms] Successfully enabled. (took 1104ms)
[20:51:59] [Server thread/INFO]: [ProtocolLib] Enabling ProtocolLib v5.0.0-SNAPSHOT-b614
[20:51:59] [Server thread/INFO]: Preparing level "world"
[20:52:00] [Server thread/INFO]: Preparing start region for dimension minecraft:overworld
[20:52:00] [Server thread/INFO]: Time elapsed: 131 ms
[20:52:00] [Server thread/INFO]: Preparing start region for dimension minecraft:the_nether
[20:52:00] [Server thread/INFO]: Time elapsed: 57 ms
[20:52:00] [Server thread/INFO]: Preparing start region for dimension minecraft:the_end
[20:52:00] [Server thread/INFO]: Time elapsed: 64 ms
[20:52:00] [Server thread/INFO]: [SimpleBucketMobs] Enabling SimpleBucketMobs vdev
[20:52:00] [Server thread/WARN]: [SimpleBucketMobs] Invalid Mob Type in config.yml: CAVESPIDER
[20:52:00] [Server thread/WARN]: [SimpleBucketMobs] Invalid Mob Type in config.yml: FISH
[20:52:00] [Server thread/WARN]: [SimpleBucketMobs] Invalid Mob Type in config.yml: GOLEM
[20:52:00] [Server thread/WARN]: [SimpleBucketMobs] Invalid Mob Type in config.yml: ILLAGER
[20:52:00] [Server thread/WARN]: [SimpleBucketMobs] Invalid Mob Type in config.yml: STEERABLE
[20:52:00] [Server thread/INFO]: [spark] Enabling spark v1.10.30
[20:52:01] [Server thread/INFO]: [spark] Using Paper ServerTickStartEvent for tick monitoring
[20:52:01] [Server thread/INFO]: [spark] Starting background profiler...
[20:52:01] [Server thread/INFO]: [AdvancedGift] Enabling AdvancedGift v1.11.1
[20:52:01] [Server thread/INFO]: [AdvancedGift] ===================================================
[20:52:01] [Server thread/INFO]: [AdvancedGift] Checking server version  ------------------
[20:52:01] [Server thread/INFO]: [AdvancedGift] NMS Version used: v1_19_R2
[20:52:01] [Server thread/INFO]: [AdvancedGift] 
[20:52:01] [Server thread/INFO]: [AdvancedGift] This version is supported!
[20:52:01] [Server thread/INFO]: [AdvancedGift] 
[20:52:01] [Server thread/INFO]: [AdvancedGift] Loading files  --------------------
[20:52:01] [Server thread/INFO]: [AdvancedGift] Config loaded.
[20:52:01] [Server thread/INFO]: [AdvancedGift] Player info loaded.
[20:52:01] [Server thread/INFO]: [AdvancedGift] 
[20:52:01] [Server thread/INFO]: [AdvancedGift] Searching for a material library  -----------------
[20:52:01] [Server thread/INFO]: [AdvancedGift] No supported material library found.
[20:52:01] [Server thread/INFO]: [AdvancedGift] Spigot's material enum will be used instead.
[20:52:01] [Server thread/INFO]: [AdvancedGift] ===================================================
[20:52:01] [Server thread/INFO]: [EmojiTab] Enabling EmojiTab v1.0-SNAPSHOT
[20:52:01] [Server thread/INFO]: [EmojiTab] > Loaded!
[20:52:01] [Server thread/INFO]: [EmojiTab] > WARN: Emoji name ':heart_exclamation:' is over 16 characters and will be trimmed!
[20:52:01] [Server thread/ERROR]: Error occurred while enabling EmojiTab v1.0-SNAPSHOT (Is it up to date?)
com.comphenix.protocol.reflect.FieldAccessException: Field index 0 is out of bounds for length 0
	at com.comphenix.protocol.reflect.FieldAccessException.fromFormat(FieldAccessException.java:49) ~[ProtocolLib.jar:?]
	at com.comphenix.protocol.reflect.StructureModifier.write(StructureModifier.java:316) ~[ProtocolLib.jar:?]
	at com.comphenix.packetwrapper.WrapperPlayServerPlayerInfo.setAction(WrapperPlayServerPlayerInfo.java:45) ~[EmojiTab.jar:?]
	at com.github.remynfv.emojitab.EmojiTab.generateEmojiPackets(EmojiTab.kt:130) ~[EmojiTab.jar:?]
	at com.github.remynfv.emojitab.EmojiTab.reloadConfigs(EmojiTab.kt:209) ~[EmojiTab.jar:?]
	at com.github.remynfv.emojitab.EmojiTab.onEnable(EmojiTab.kt:114) ~[EmojiTab.jar:?]
	at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264) ~[purpur-api-1.19.3-R0.1-SNAPSHOT.jar:?]
	at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:372) ~[purpur-api-1.19.3-R0.1-SNAPSHOT.jar:?]
	at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:550) ~[purpur-api-1.19.3-R0.1-SNAPSHOT.jar:?]
	at org.bukkit.craftbukkit.v1_19_R2.CraftServer.enablePlugin(CraftServer.java:631) ~[purpur-1.19.3.jar:git-Purpur-1916]
	at org.bukkit.craftbukkit.v1_19_R2.CraftServer.enablePlugins(CraftServer.java:544) ~[purpur-1.19.3.jar:git-Purpur-1916]
	at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:640) ~[purpur-1.19.3.jar:git-Purpur-1916]
	at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:439) ~[purpur-1.19.3.jar:git-Purpur-1916]
	at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:344) ~[purpur-1.19.3.jar:git-Purpur-1916]
	at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1117) ~[purpur-1.19.3.jar:git-Purpur-1916]
	at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:321) ~[purpur-1.19.3.jar:git-Purpur-1916]
	at java.lang.Thread.run(Thread.java:833) ~[?:?]
[20:52:01] [Server thread/INFO]: [EmojiTab] Disabling EmojiTab v1.0-SNAPSHOT
[20:52:01] [Server thread/WARN]: Could not register alias sp because it contains commands that do not exist: simpleprefixes:simpleprefix $1-
[20:52:02] [Server thread/INFO]: Running delayed init tasks
[20:52:02] [Server thread/INFO]: Done (7.363s)! For help, type "help"
[20:52:57] [Server thread/INFO]: Stopping the server
[20:52:57] [Server thread/INFO]: Stopping server
[20:52:57] [Server thread/INFO]: [ProtocolLib] Disabling ProtocolLib v5.0.0-SNAPSHOT-b614
[20:52:57] [Server thread/INFO]: [AdvancedGift] Disabling AdvancedGift v1.11.1
[20:52:57] [Server thread/INFO]: [AdvancedGift] Saving playerinfo.json.
[20:52:57] [Server thread/INFO]: [spark] Disabling spark v1.10.30
[20:52:57] [Server thread/INFO]: [SimpleBucketMobs] Disabling SimpleBucketMobs vdev
[20:52:57] [Server thread/INFO]: [LuckPerms] Disabling LuckPerms v5.4.62
[20:52:57] [Server thread/INFO]: [LuckPerms] Starting shutdown process...
[20:52:57] [Server thread/INFO]: [LuckPerms] Closing storage...
[20:52:57] [Server thread/INFO]: [LuckPerms] Goodbye!
[20:52:57] [Server thread/INFO]: Saving players
[20:52:57] [Server thread/INFO]: Saving worlds
[20:52:57] [Server thread/INFO]: Saving chunks for level 'ServerLevel[world]'/minecraft:overworld
[20:52:57] [Server thread/INFO]: [ChunkHolderManager] Waiting 60s for chunk system to halt for world 'world'
[20:52:57] [Server thread/INFO]: [ChunkHolderManager] Halted chunk system for world 'world'
[20:52:57] [Server thread/INFO]: [ChunkHolderManager] Saving all chunkholders for world 'world'
[20:52:58] [Server thread/INFO]: [ChunkHolderManager] Saved 529 block chunks, 529 entity chunks, 0 poi chunks in world 'world' in 1.50s
[20:52:59] [Server thread/INFO]: ThreadedAnvilChunkStorage (world): All chunks are saved
[20:52:59] [Server thread/INFO]: Saving chunks for level 'ServerLevel[world_nether]'/minecraft:the_nether
[20:52:59] [Server thread/INFO]: [ChunkHolderManager] Waiting 60s for chunk system to halt for world 'world_nether'
[20:52:59] [Server thread/INFO]: [ChunkHolderManager] Halted chunk system for world 'world_nether'
[20:52:59] [Server thread/INFO]: [ChunkHolderManager] Saving all chunkholders for world 'world_nether'
[20:52:59] [Server thread/INFO]: [ChunkHolderManager] Saved 529 block chunks, 529 entity chunks, 0 poi chunks in world 'world_nether' in 0.47s
[20:53:00] [Server thread/INFO]: ThreadedAnvilChunkStorage (DIM-1): All chunks are saved
[20:53:00] [Server thread/INFO]: Saving chunks for level 'ServerLevel[world_the_end]'/minecraft:the_end
[20:53:00] [Server thread/INFO]: [ChunkHolderManager] Waiting 60s for chunk system to halt for world 'world_the_end'
[20:53:00] [Server thread/INFO]: [ChunkHolderManager] Halted chunk system for world 'world_the_end'
[20:53:00] [Server thread/INFO]: [ChunkHolderManager] Saving all chunkholders for world 'world_the_end'
[20:53:00] [Server thread/INFO]: [ChunkHolderManager] Saved 529 block chunks, 529 entity chunks, 0 poi chunks in world 'world_the_end' in 0.08s
[20:53:00] [Server thread/INFO]: ThreadedAnvilChunkStorage (DIM1): All chunks are saved
[20:53:00] [Server thread/INFO]: ThreadedAnvilChunkStorage: All dimensions are saved
[20:53:00] [Server thread/INFO]: Flushing Chunk IO
[20:53:00] [Server thread/INFO]: Closing Thread Pool
[20:53:00] [Server thread/INFO]: Closing Server

Server Version: git-Purpur-1916 (MC: 1.19.3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.