Skip to content

Commit

Permalink
feat: Backport a lot of new changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Norbiros committed Aug 11, 2023
1 parent 283b487 commit 017cc83
Show file tree
Hide file tree
Showing 38 changed files with 894 additions and 559 deletions.
24 changes: 21 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,22 @@
# Emoji Type
Emoji Type is a Minecraft 1.18.1 Fabric mod that allows you to easily enter emoji into text fields by typing a specific key word (e.g. :skull:). You can send emojis on a server without the server or other players needing to have the mod installed.
# 🙂 Emoji Type
Emoji Type is a Minecraft Fabric mod that allows you to easily enter emoji into text fields by typing a specific key word (e.g. `:skull:`).

P.S. Thank you to LlamaLad7 on the Fabric discord server for helping me with some mixin stuff, very cool.
### How it works?
This mod allows you to type some emoji/symbols more easily in Minecraft.
To be clear, this mod (technically) does not add any emoji to the game, it only makes typing the ones already in the game easier.
For this reason, emoji typed will be visible to anyone else on a server and will still be there (on signs, books, etc.) if you uninstall the mod.
I can not absolutely guarantee all symbols/emoji will work on all servers, some servers have plugins that mess with chat and there is really nothing I can do about that.

### Why is this "fork"?
Original mod was originally written by CyborgCabbage, but he unfortunately decided to archive it.
Now I am trying to continue developing it.

### Special thanks
- LlamaLad7 from the Fabric Discord server: Thanks for helping CyborgCabbage with some mixin stuff!
- [CyborgCabbage](https://github.com/CyborgCabbage/): Huge shoutout to you for creating this awesome mod in the first place!
- [Juzz](https://github.com/Juuxel) from the Architectury Discord server: Thanks for helping with architectury!
- [All the contributors](https://github.com/Norbiros/emojitype/graphs/contributors): A big thank you to everyone who has contributed to the development of this mod! You rock!

### Links
- [Mod on CurseForge](https://legacy.curseforge.com/minecraft/mc-mods/emoji-type)
- [Mod on Modrinth](https://modrinth.com/mod/emoji-type)
119 changes: 37 additions & 82 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,96 +1,51 @@
plugins {
id 'fabric-loom' version '0.12-SNAPSHOT'
id 'maven-publish'
id "architectury-plugin" version "3.4-SNAPSHOT"
id "dev.architectury.loom" version "1.2-SNAPSHOT" apply false
}

sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8

archivesBaseName = project.archives_base_name
version = project.mod_version
group = project.maven_group

repositories {
// Add repositories to retrieve artifacts from in here.
// You should only use this when depending on other mods because
// Loom adds the essential maven repositories to download Minecraft and libraries from automatically.
// See https://docs.gradle.org/current/userguide/declaring_repositories.html
// for more information about repositories.
maven { url "https://maven.shedaniel.me/" }
maven { url "https://maven.terraformersmc.com/"}
architectury {
minecraft = rootProject.minecraft_version
}

dependencies {
// To change the versions see the gradle.properties file
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"

// PSA: Some older mods, compiled on Loom 0.2.1, might have outdated Maven POMs.
// You may need to force-disable transitiveness on them.
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
modApi("me.shedaniel.cloth:cloth-config-fabric:${project.cloth_config_version}") {
exclude(group: "net.fabricmc.fabric-api")
}
modImplementation "com.terraformersmc:modmenu:${project.mod_menu_version}"
}
subprojects {
apply plugin: "dev.architectury.loom"

processResources {
inputs.property "version", project.version
loom {
silentMojangMappingsLicense()
}

filesMatching("fabric.mod.json") {
expand "version": project.version
}
dependencies {
minecraft "com.mojang:minecraft:${rootProject.minecraft_version}"
// The following line declares the yarn mappings you may select this one as well.
mappings "net.fabricmc:yarn:${rootProject.yarn_mappings}:v2"
}
}

tasks.withType(JavaCompile).configureEach {
// ensure that the encoding is set to UTF-8, no matter what the system default is
// this fixes some edge cases with special characters not displaying correctly
// see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
// If Javadoc is generated, this must be specified in that task too.
it.options.encoding = "UTF-8"
allprojects {
apply plugin: "java"
apply plugin: "architectury-plugin"
apply plugin: "maven-publish"

// The Minecraft launcher currently installs Java 8 for users, so your mod probably wants to target Java 8 too
// JDK 9 introduced a new way of specifying this that will make sure no newer classes or methods are used.
// We'll use that if it's available, but otherwise we'll use the older option.
def targetVersion = 8
if (JavaVersion.current().isJava9Compatible()) {
it.options.release = targetVersion
}
}

java {
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
// if it is present.
// If you remove this line, sources will not be generated.
withSourcesJar()
}
archivesBaseName = rootProject.archives_base_name
version = rootProject.mod_version
group = rootProject.maven_group

jar {
from("LICENSE") {
rename { "${it}_${project.archivesBaseName}"}
}
}
repositories {
// Add repositories to retrieve artifacts from in here.
// You should only use this when depending on other mods because
// Loom adds the essential maven repositories to download Minecraft and libraries from automatically.
// See https://docs.gradle.org/current/userguide/declaring_repositories.html
// for more information about repositories.
maven { url "https://maven.shedaniel.me/" }
maven { url "https://maven.terraformersmc.com/"}
}

// configure the maven publication
publishing {
publications {
mavenJava(MavenPublication) {
// add all the jars that should be included when publishing to maven
artifact(remapJar) {
builtBy remapJar
}
artifact(sourcesJar) {
builtBy remapSourcesJar
}
}
}
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
options.release = 17
}

// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
repositories {
// Add repositories to publish to here.
// Notice: This block does NOT have the same function as the block in the top level.
// The repositories here will be used for publishing your artifact, not for
// retrieving dependencies.
}
java {
withSourcesJar()
}
}
24 changes: 24 additions & 0 deletions common/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
architectury {
common(project.enabled_platforms.split(","))
}

dependencies {
// We depend on fabric loader here to use the fabric @Environment annotations and get the mixin dependencies
// Do NOT use other classes from fabric loader
modImplementation "net.fabricmc:fabric-loader:${rootProject.fabric_loader_version}"
modApi "me.shedaniel.cloth:cloth-config:${project.cloth_config_version}"
}

publishing {
publications {
mavenCommon(MavenPublication) {
artifactId = rootProject.archives_base_name
from components.java
}
}

// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
repositories {
// Add repositories to publish to here.
}
}
14 changes: 14 additions & 0 deletions common/src/main/java/dev/norbiros/emojitype/ConfigDirPlatform.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package dev.norbiros.emojitype;

import dev.architectury.injectables.annotations.ExpectPlatform;

import java.nio.file.Path;

public class ConfigDirPlatform {

@ExpectPlatform
public static Path getConfigDirectory() {
// Just throw an error, the content should get replaced at runtime.
throw new AssertionError();
}
}
Loading

0 comments on commit 017cc83

Please sign in to comment.