diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4788b4b --- /dev/null +++ b/.gitignore @@ -0,0 +1,113 @@ +# User-specific stuff +.idea/ + +*.iml +*.ipr +*.iws + +# IntelliJ +out/ + +# Compiled class file +*.class + +# Log file +*.log + +# BlueJ files +*.ctxt + +# Package Files # +*.jar +*.war +*.nar +*.ear +*.zip +*.tar.gz +*.rar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + +*~ + +# temporary files which can be created if a process still has a handle open of a deleted file +.fuse_hidden* + +# KDE directory preferences +.directory + +# Linux trash folder which might appear on any partition or disk +.Trash-* + +# .nfs files are created when an open file is removed but is still being accessed +.nfs* + +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +# Windows thumbnail cache files +Thumbs.db +Thumbs.db:encryptable +ehthumbs.db +ehthumbs_vista.db + +# Dump file +*.stackdump + +# Folder config file +[Dd]esktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msix +*.msm +*.msp + +# Windows shortcuts +*.lnk + +target/ + +pom.xml.tag +pom.xml.releaseBackup +pom.xml.versionsBackup +pom.xml.next + +release.properties +dependency-reduced-pom.xml +buildNumber.properties +.mvn/timing.properties +.mvn/wrapper/maven-wrapper.jar +.flattened-pom.xml + +# Common working directory +run/ diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..cb60bc1 --- /dev/null +++ b/pom.xml @@ -0,0 +1,82 @@ + + + 4.0.0 + + me.lucyy + ProNouns + 1.0-SNAPSHOT + jar + + ProNouns + + Putting the "pro" in "pronouns". + + 1.8 + UTF-8 + + https://lucyy.me + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + ${java.version} + ${java.version} + + + + org.apache.maven.plugins + maven-shade-plugin + 3.2.4 + + + package + + shade + + + false + + + + + + + + src/main/resources + true + + + + + + + spigotmc-repo + https://hub.spigotmc.org/nexus/content/repositories/snapshots/ + + + placeholderapi + https://repo.extendedclip.com/content/repositories/placeholderapi/ + + + + + + org.bukkit + bukkit + 1.15.2-R0.1-SNAPSHOT + provided + + + me.clip + placeholderapi + 2.10.9 + provided + + + diff --git a/src/main/java/me/lucyy/pronouns/ProNouns.java b/src/main/java/me/lucyy/pronouns/ProNouns.java new file mode 100644 index 0000000..e99fa26 --- /dev/null +++ b/src/main/java/me/lucyy/pronouns/ProNouns.java @@ -0,0 +1,17 @@ +package me.lucyy.pronouns; + +import org.bukkit.plugin.java.JavaPlugin; + +public final class ProNouns extends JavaPlugin { + + @Override + public void onEnable() { + // Plugin startup logic + + } + + @Override + public void onDisable() { + // Plugin shutdown logic + } +} \ No newline at end of file diff --git a/src/main/java/me/lucyy/pronouns/PronounHandler.java b/src/main/java/me/lucyy/pronouns/PronounHandler.java new file mode 100644 index 0000000..bdee624 --- /dev/null +++ b/src/main/java/me/lucyy/pronouns/PronounHandler.java @@ -0,0 +1,46 @@ +package me.lucyy.pronouns; + +import me.lucyy.pronouns.storage.Storage; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; + +public class PronounHandler { + + private static Storage storage; + + private static HashMap SetIndex = new HashMap<>(); + + static { + SetIndex.put("he/him", new PronounSet("he", "him", + "he's", "his", "his", "himself")); + SetIndex.put("she/her", new PronounSet("she", "her", + "she's", "her", "hers", "herself")); + SetIndex.put("they/them", new PronounSet("they", "them", + "they're", "their", "theirs", "themself")); + } + + public void SetStorage(Storage storage) { + this.storage = storage; + } + + public static List GetAllPronouns() { + List pronouns = new ArrayList<>(); + SetIndex.values().forEach(set -> pronouns.add(set.toString())); + return pronouns; + } + + public static PronounSet fromString(String set) { + String[] pronouns = set.split("/"); + if ( pronouns.length < 2 ) throw new IllegalArgumentException(set); + if ( SetIndex.containsKey(pronouns[0] + "/" + pronouns[1]) ) return SetIndex.get(set); + + if ( pronouns.length != 6 ) throw new IllegalArgumentException(set); + + PronounSet newSet = new PronounSet(pronouns[0], pronouns[1], pronouns[2], pronouns[3], pronouns[4], pronouns[5]); + SetIndex.putIfAbsent(newSet.getName(), newSet); + return SetIndex.get(set); + } +} \ No newline at end of file diff --git a/src/main/java/me/lucyy/pronouns/PronounSet.java b/src/main/java/me/lucyy/pronouns/PronounSet.java new file mode 100644 index 0000000..84f2ecb --- /dev/null +++ b/src/main/java/me/lucyy/pronouns/PronounSet.java @@ -0,0 +1,32 @@ +package me.lucyy.pronouns; + +public class PronounSet { + public String Subjective; + public String Objective; + public String Progressive; + public String PossessiveAdjectival; + public String PossessivePronoun; + public String Reflexive; + + public static String Capitalise(String input) { + return input.substring(0,1).toUpperCase() + input.substring(1).toLowerCase(); + } + + public PronounSet(String subjective, String objective, String progressive, String possessiveAdjectival, String possessivePronoun, String reflexive) { + Subjective = subjective; + Objective = objective; + Progressive = progressive; + PossessiveAdjectival = possessiveAdjectival; + PossessivePronoun = possessivePronoun; + Reflexive = reflexive; + } + + public String getName() { + return Capitalise(Subjective) + "/" + Capitalise(Objective); + } + + @Override + public String toString() { + return Subjective + "/" + Objective + "/" + Progressive + "/" + PossessiveAdjectival + "/" + PossessivePronoun + "/" + Reflexive; + } +} \ No newline at end of file diff --git a/src/main/java/me/lucyy/pronouns/storage/Storage.java b/src/main/java/me/lucyy/pronouns/storage/Storage.java new file mode 100644 index 0000000..11701bf --- /dev/null +++ b/src/main/java/me/lucyy/pronouns/storage/Storage.java @@ -0,0 +1,5 @@ +package me.lucyy.pronouns.storage; + +public interface Storage { + public PronounS +} diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml new file mode 100644 index 0000000..558fdfe --- /dev/null +++ b/src/main/resources/plugin.yml @@ -0,0 +1,8 @@ +name: ProNouns +version: ${project.version} +main: me.lucyy.pronouns.ProNouns +api-version: 1.15 +depend: [ PlaceholderAPI ] +authors: [ __lucyy ] +description: Putting the "pro" in "pronouns". +website: https://lucyy.me