Skip to content

Commit

Permalink
Merge pull request #12 from chrrs/next
Browse files Browse the repository at this point in the history
2.0.0
  • Loading branch information
chrrs authored Jan 31, 2024
2 parents c8b1702 + 464485e commit d0c8617
Show file tree
Hide file tree
Showing 194 changed files with 1,500 additions and 934 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ bin/
*.jar
.vscode
*.ps1
*.lnk
*.py
*.lnk
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2022 Algid
Copyright (c) 2022 chrrs

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
17 changes: 0 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,3 @@ For setup instructions please see the [fabric wiki page](https://fabricmc.net/wi
## Usage

Simply type the emote into chat using the format you would in a Twitch chat E.G. `HACKERMANS` and `modCheck`.

## Adding emotes

To add emotes, you'll probably first want to setup the mod to load emotes from your local environment.
The easiest way to do this is to change the emote repository URL in the `pegs-emotes.json` config file to a file url,
for example `file:///D:\Dev\Java\PegsEmotes\content\`. It should point to the `content` directory in this repository.

After this, add new lines to the `content/emotes.json` file to add new emotes. Most emotes are stored in either the
`static` or `animated` subdirectories in the `content` folder.

Adding animated emotes is a bit different:

1. Use [this site](https://sheeptester.github.io/words-go-here/misc/animated-painting-maker.html) to convert a gif into
an image with all the frames.
2. Get the frame time from [this site](https://ezgif.com/maker) by multiplying the delay by 10
(e.g. peepoLeave: delay = 2, frame_time = 20)
3. Add an entry to `emotes.json` pointing to the above image and including the calculated frame time.
40 changes: 40 additions & 0 deletions add_bttv_emote.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import datetime
import hashlib
import json
import requests
import sys

file = "content/v2/emotes.json"

emotes = {}
with open(file) as f:
emotes = json.load(f)

if "emotes" not in emotes:
emotes["emotes"] = []

for id in sys.argv[1:]:
res = requests.get(f"https://api.betterttv.net/3/emotes/{id}").json()

if "message" in res:
print(f"could not add {id}: " + res["message"])
continue

url = f"https://cdn.betterttv.net/emote/{res['id']}/2x.{res['imageType']}"
image_res = requests.get(url)
sha1 = hashlib.sha1(image_res.content).digest().hex()

emotes["emotes"].append({
"name": res["code"],
"format": res["imageType"],
"url": url,
"sha1": sha1,
})

print(f"added {res['code']} ({id}, {res['imageType']})")

emotes["emotes"].sort(key=lambda emote: emote["name"].lower())

with open(file, "w") as f:
emotes["lastUpdated"] = datetime.datetime.now().isoformat()
json.dump(emotes, f, indent=4)
6 changes: 6 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ dependencies {

modImplementation("net.fabricmc.fabric-api:fabric-api:${property("fabric_version")}")
modImplementation("com.terraformersmc:modmenu:${property("mod_menu_version")}")

include(implementation(annotationProcessor("io.github.llamalad7:mixinextras-fabric:0.2.2")!!)!!)
}

tasks {
Expand All @@ -37,3 +39,7 @@ java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

loom {
accessWidenerPath.set(file("src/main/resources/pegsemotes.accesswidener"))
}
Binary file removed content/animated/AINTNOWAY.png
Binary file not shown.
Binary file removed content/animated/AYOOO.png
Binary file not shown.
Binary file removed content/animated/Aware.png
Binary file not shown.
Binary file removed content/animated/Awkward.png
Binary file not shown.
Binary file removed content/animated/BONK.png
Binary file not shown.
Binary file removed content/animated/BlanketJam.png
Binary file not shown.
Binary file removed content/animated/BoneZone.png
Binary file not shown.
Binary file removed content/animated/COPIUM.png
Binary file not shown.
Binary file removed content/animated/Chatting.png
Binary file not shown.
Binary file removed content/animated/Clap.png
Binary file not shown.
Binary file removed content/animated/CuteDog.png
Binary file not shown.
Binary file removed content/animated/DinkDonk.png
Binary file not shown.
Binary file removed content/animated/DonoWall.png
Binary file not shown.
Binary file removed content/animated/Drake.png
Binary file not shown.
Binary file removed content/animated/Ermm.png
Binary file not shown.
Binary file removed content/animated/FLUSHED.png
Binary file not shown.
Binary file removed content/animated/FeelsLagMan.png
Binary file not shown.
Binary file removed content/animated/FeelsWeakMan.png
Binary file not shown.
Binary file removed content/animated/GIGACHAD.png
Binary file not shown.
Binary file removed content/animated/GuitarTime.png
Binary file not shown.
Binary file removed content/animated/HACKERMANS.png
Binary file not shown.
Binary file removed content/animated/HYPERCLAP.png
Binary file not shown.
Binary file removed content/animated/HYPERS.png
Binary file not shown.
Binary file removed content/animated/HYPERpeepoSitti.png
Binary file not shown.
Binary file removed content/animated/Haiii.png
Binary file not shown.
Binary file removed content/animated/Happi.png
Diff not rendered.
Binary file removed content/animated/LETSGO.png
Diff not rendered.
Binary file removed content/animated/MEGALUL.png
Diff not rendered.
Binary file removed content/animated/MEOW.png
Diff not rendered.
Binary file removed content/animated/MmmHmm.png
Diff not rendered.
Binary file removed content/animated/NODDERS.png
Diff not rendered.
Binary file removed content/animated/NOOO.png
Diff not rendered.
Binary file removed content/animated/NOPERS.png
Diff not rendered.
Binary file removed content/animated/NOTED.png
Diff not rendered.
Binary file removed content/animated/PeepoGiggles.png
Diff not rendered.
Binary file removed content/animated/PeepoYeet.png
Diff not rendered.
Binary file removed content/animated/PepeLaugh.png
Diff not rendered.
Binary file removed content/animated/RAGEY.png
Diff not rendered.
Binary file removed content/animated/RIPBOZO.png
Diff not rendered.
Binary file removed content/animated/SMHing.png
Diff not rendered.
Binary file removed content/animated/SNIFFA.png
Diff not rendered.
Binary file removed content/animated/SourPls.png
Diff not rendered.
Binary file removed content/animated/TeaTime.png
Diff not rendered.
Binary file removed content/animated/ThisIsFine.png
Diff not rendered.
Binary file removed content/animated/TriSad.png
Diff not rendered.
Binary file removed content/animated/VIBE.png
Diff not rendered.
Binary file removed content/animated/WAYTOODANK.png
Diff not rendered.
Binary file removed content/animated/YEOP.png
Diff not rendered.
Binary file removed content/animated/YIPPEE.png
Diff not rendered.
Binary file removed content/animated/YesYes.png
Diff not rendered.
Binary file removed content/animated/catJAM.png
Diff not rendered.
Binary file removed content/animated/catJAMJAM.png
Diff not rendered.
Binary file removed content/animated/catKISS.png
Diff not rendered.
Binary file removed content/animated/catNOM.png
Diff not rendered.
Binary file removed content/animated/catPUNCH.png
Diff not rendered.
Binary file removed content/animated/flutedCrawl.png
Diff not rendered.
Binary file removed content/animated/hypeE.png
Diff not rendered.
Binary file removed content/animated/modCheck.png
Diff not rendered.
Binary file removed content/animated/monkaGIGAftRobertDowneyJr.png
Diff not rendered.
Binary file removed content/animated/nikoPls.png
Diff not rendered.
Binary file removed content/animated/nikoQuake.png
Diff not rendered.
Binary file removed content/animated/peepoArrive.png
Diff not rendered.
Binary file removed content/animated/peepoBye.png
Diff not rendered.
Binary file removed content/animated/peepoComfy.png
Diff not rendered.
Binary file removed content/animated/peepoHey.png
Diff not rendered.
Binary file removed content/animated/peepoRiot.png
Diff not rendered.
Binary file removed content/animated/peepoRun.png
Diff not rendered.
Binary file removed content/animated/peepoShy.png
Diff not rendered.
Binary file removed content/animated/peepoTalk.png
Diff not rendered.
Binary file removed content/animated/peepoTrip.png
Diff not rendered.
Binary file removed content/animated/peepoWow.png
Diff not rendered.
Binary file removed content/animated/peepoleave.png
Diff not rendered.
Binary file removed content/animated/pepeBASS.png
Diff not rendered.
Binary file removed content/animated/pepeMeltdown.png
Diff not rendered.
Binary file removed content/animated/pepeSadJam.png
Diff not rendered.
Binary file removed content/animated/plinK.png
Diff not rendered.
Binary file removed content/animated/plonK.png
Diff not rendered.
Binary file removed content/animated/ppOverheat.png
Diff not rendered.
Binary file removed content/animated/ppPoof.png
Diff not rendered.
Binary file removed content/animated/ranbooLMAOO.png
Diff not rendered.
Binary file removed content/animated/trevorHug.png
Diff not rendered.
Binary file removed content/animated/tubboSpin.png
Diff not rendered.
Binary file removed content/animated/wilburPls.png
Diff not rendered.
Binary file removed content/animated/wormPls.png
Diff not rendered.
156 changes: 0 additions & 156 deletions content/emotes.json

This file was deleted.

Binary file removed content/static/5Head.png
Diff not rendered.
Binary file removed content/static/Bedge.png
Diff not rendered.
Binary file removed content/static/CatPat.png
Diff not rendered.
Binary file removed content/static/Clueless.png
Diff not rendered.
Binary file removed content/static/DColon.png
Diff not rendered.
Binary file removed content/static/Danki.png
Diff not rendered.
Binary file removed content/static/EZ.png
Diff not rendered.
Binary file removed content/static/FeelsDankMan.png
Diff not rendered.
Binary file removed content/static/FeelsOkayMan.png
Diff not rendered.
Binary file removed content/static/Gayge.png
Diff not rendered.
Binary file removed content/static/HOLD.png
Diff not rendered.
Binary file removed content/static/HUHH.png
Diff not rendered.
Binary file removed content/static/HYPERS.png
Diff not rendered.
Binary file removed content/static/Hmm.png
Diff not rendered.
Binary file removed content/static/KEKW.png
Diff not rendered.
Binary file removed content/static/KKona.png
Diff not rendered.
Binary file removed content/static/Kapp.png
Diff not rendered.
Binary file removed content/static/LETHIMCOOK.png
Diff not rendered.
Binary file removed content/static/Madge.png
Diff not rendered.
Binary file removed content/static/NotLikeThis.png
Diff not rendered.
Binary file removed content/static/OMEGALUL.png
Diff not rendered.
Binary file removed content/static/OMEGALUL_Admir.png
Diff not rendered.
Binary file removed content/static/Okayge.png
Diff not rendered.
Binary file removed content/static/PAUSERS.png
Diff not rendered.
Binary file removed content/static/PHIDDIES.png
Diff not rendered.
Binary file removed content/static/POGGIES.png
Diff not rendered.
Binary file removed content/static/PauseChamp.png
Diff not rendered.
Binary file removed content/static/Peepi.png
Diff not rendered.
Binary file removed content/static/PeepoFlowerGUN.png
Diff not rendered.
Binary file removed content/static/PepeHands.png
Diff not rendered.
Binary file removed content/static/PogU.png
Diff not rendered.
Binary file removed content/static/Prayge.png
Diff not rendered.
Binary file removed content/static/Sadge.png
Diff not rendered.
Binary file removed content/static/SealTheDeal.png
Diff not rendered.
Binary file removed content/static/Shruge.png
Diff not rendered.
Binary file removed content/static/Stare.png
Diff not rendered.
Binary file removed content/static/Susge.png
Diff not rendered.
Binary file removed content/static/TrollDespair.png
Diff not rendered.
Binary file removed content/static/TrollDespairPoba.png
Diff not rendered.
Binary file removed content/static/TrollFace.png
Diff not rendered.
Binary file removed content/static/WHOLETHIMCOOK.png
Diff not rendered.
Binary file removed content/static/WICKED.png
Diff not rendered.
Binary file removed content/static/Wokege.png
Diff not rendered.
Binary file removed content/static/YEP.png
Diff not rendered.
Binary file removed content/static/catLurk.png
Diff not rendered.
Binary file removed content/static/chrrzSit.png
Diff not rendered.
Binary file removed content/static/miccThicc.png
Diff not rendered.
Binary file removed content/static/mivvArson.png
Diff not rendered.
Binary file removed content/static/monkaHmm.png
Diff not rendered.
Binary file removed content/static/monkaS.png
Diff not rendered.
Binary file removed content/static/monkaW.png
Diff not rendered.
Binary file removed content/static/peepoChrist.png
Diff not rendered.
Binary file removed content/static/peepoFlower.png
Diff not rendered.
Binary file removed content/static/peepoHappy.png
Diff not rendered.
Binary file removed content/static/peepoKiss.png
Diff not rendered.
Binary file removed content/static/peepoNoMoney.png
Diff not rendered.
Binary file removed content/static/peepoShi.png
Diff not rendered.
Binary file removed content/static/peepoSit.png
Diff not rendered.
Binary file removed content/static/peepoSitti.png
Diff not rendered.
Binary file removed content/static/peepoSmile.png
Diff not rendered.
Binary file removed content/static/peepoSmileStare.png
Diff not rendered.
Binary file removed content/static/pepeW.png
Diff not rendered.
Binary file removed content/static/ppL.png
Diff not rendered.
Binary file removed content/static/ppLDespair.png
Diff not rendered.
Binary file removed content/static/seal.png
Diff not rendered.
Binary file removed content/static/skull.png
Diff not rendered.
Binary file removed content/static/sob.png
Diff not rendered.
Binary file removed content/static/standing_person.png
Diff not rendered.
Binary file removed content/static/widepeepoHappy.png
Diff not rendered.
89 changes: 89 additions & 0 deletions content/v2/emotes.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
{
"lastUpdated": "2024-01-23T17:30:42.687594",
"emotes": [
{
"name": "catJAM",
"format": "gif",
"url": "https://cdn.betterttv.net/emote/5f1b0186cf6d2144653d2970/2x.gif",
"sha1": "ae77a087be038664058745bd61b937c67462fe7b"
},
{
"name": "Clap",
"format": "gif",
"url": "https://cdn.betterttv.net/emote/55b6f480e66682f576dd94f5/2x.gif",
"sha1": "2cc907cdb3c0a328170958d9b51ac5530180a3ef"
},
{
"name": "HYPERCLAP",
"format": "gif",
"url": "https://cdn.betterttv.net/emote/5b35ca08392c604c5fd81874/2x.gif",
"sha1": "c65c85eefcfb72b13d1e99af78b03d9a1d1a4fde"
},
{
"name": "KEKW",
"format": "png",
"url": "https://cdn.betterttv.net/emote/5e9c6c187e090362f8b0b9e8/2x.png",
"sha1": "808948e0d8c5c63e2e52aab10616a46b2ac5e054"
},
{
"name": "modCheck",
"format": "gif",
"url": "https://cdn.betterttv.net/emote/5d7eefb7c0652668c9e4d394/2x.gif",
"sha1": "4c2ab908c67bb56144ab30f08b10202a38b25058"
},
{
"name": "monkaS",
"format": "png",
"url": "https://cdn.betterttv.net/emote/56e9f494fff3cc5c35e5287e/2x.png",
"sha1": "ceeb99991635e7def03e481de3e85cb69429b241"
},
{
"name": "OMEGALUL",
"format": "png",
"url": "https://cdn.betterttv.net/emote/583089f4737a8e61abb0186b/2x.png",
"sha1": "92ef18d037dac4f4d7193f741d44e82dffcbd2db"
},
{
"name": "PepeLaugh",
"format": "gif",
"url": "https://cdn.betterttv.net/emote/5c548025009a2e73916b3a37/2x.gif",
"sha1": "a358ec49f0580b0c4046e6a646f26459140e83a0"
},
{
"name": "plinK",
"format": "gif",
"url": "https://cdn.betterttv.net/emote/63b37945d3c04b5c451257e4/2x.gif",
"sha1": "4bcc95b74ff23b85e39aa90691bf7581108921ca"
},
{
"name": "plonK",
"format": "gif",
"url": "https://cdn.betterttv.net/emote/63dd8467dc781fe9bd168d4c/2x.gif",
"sha1": "36a0101577a99005bd2c6f20806382d49910ae04"
},
{
"name": "Sadge",
"format": "png",
"url": "https://cdn.betterttv.net/emote/5e0fa9d40550d42106b8a489/2x.png",
"sha1": "b5d5ecaba72b61363b37590ab90211b91667ac9e"
},
{
"name": "widepeepoHappy",
"format": "png",
"url": "https://cdn.betterttv.net/emote/634efdf93c8b9c0ff60b3571/2x.png",
"sha1": "757263e5d55931d18ad6c3763182b3a34b75e358"
},
{
"name": "widepeepoPhilza",
"format": "png",
"url": "https://cdn.betterttv.net/emote/6351c366141a1a2048b5545a/2x.png",
"sha1": "66d1920676772c9d468917d6f8f2bc35d09a9450"
},
{
"name": "YEP",
"format": "png",
"url": "https://cdn.betterttv.net/emote/5e978e20d023b362f638339d/2x.png",
"sha1": "1daf354f4d98bed24c0d578ad8f75c512aa75709"
}
]
}
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ minecraft_version=1.20.1
yarn_mappings=1.20.1+build.9
loader_version=0.14.21

mod_version=1.6.2
mod_version=2.0.0
maven_group=me.chrr.pegsemotes
archives_base_name=pegs-emotes

Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
43 changes: 43 additions & 0 deletions src/main/java/me/chrr/pegsemotes/Config.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
package me.chrr.pegsemotes;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;

import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;

public class Config {
private static final Gson GSON = new GsonBuilder().setPrettyPrinting().create();

public int version = 1;
public String[] repositories = new String[]{};

public static Config load(Path configPath) throws IOException {
Config config;

if (configPath.toFile().isFile()) {
String source = Files.readString(configPath);
config = GSON.fromJson(source, Config.class);
} else {
config = new Config();
}

upgrade(config);
config.save(configPath);

return config;
}

private static void upgrade(Config config) {
if (config.version == 1) {
config.version = 2;
config.repositories = new String[]{"https://chrrs.github.io/pegs-emotes/v2/"};
}
}

public void save(Path configPath) throws IOException {
String json = GSON.toJson(this);
Files.writeString(configPath, json);
}
}
Loading

0 comments on commit d0c8617

Please sign in to comment.