Skip to content

Commit

Permalink
Merge branch 'refs/heads/1.20.1' into l10n_1.20.1
Browse files Browse the repository at this point in the history
# Conflicts:
#	common/src/main/resources/assets/mca/lang/cs_cz.json
#	common/src/main/resources/assets/mca/lang/de_de.json
#	common/src/main/resources/assets/mca/lang/el_gr.json
#	common/src/main/resources/assets/mca/lang/es_es.json
#	common/src/main/resources/assets/mca/lang/it_it.json
#	common/src/main/resources/assets/mca/lang/ja_jp.json
#	common/src/main/resources/assets/mca/lang/pt_pt.json
#	common/src/main/resources/assets/mca/lang/zh_tw.json
#	common/src/main/resources/assets/mca_books/lang/tr_tr.json
#	common/src/main/resources/assets/mca_books/lang/zh_tw.json
#	common/src/main/resources/assets/mca_dialogue/lang/zh_tw.json
  • Loading branch information
Luke100000 committed Oct 4, 2024
2 parents a22a53e + 80b1dc1 commit 5239946
Show file tree
Hide file tree
Showing 131 changed files with 5,921 additions and 8,223 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ jobs:
env:
MODRINTH_TOKEN: ${{ secrets.MR_API_TOKEN }}
CURSEFORGE_TOKEN: ${{ secrets.CF_API_TOKEN }}
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_TOKEN: ${{ secrets.MAVEN_TOKEN }}
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Checkout Commit
Expand All @@ -21,6 +23,8 @@ jobs:
run: chmod +x gradlew
- name: Build Artifacts with Gradle
run: ./gradlew build
- name: Publish to Maven
run: ./gradlew publish
- name: Upload Artifacts
uses: actions/upload-artifact@v2
with:
Expand Down
43 changes: 26 additions & 17 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,22 @@ architectury {
}

def getAppVersion = { ->
def stdout = new ByteArrayOutputStream()
exec {
commandLine 'git', 'rev-parse', '--short', 'HEAD'
standardOutput = stdout
try {
def stdout = new ByteArrayOutputStream()
exec {
commandLine 'git', 'describe', '--tags', '--abbrev=0'
standardOutput = stdout
}
return stdout.toString().trim()
} catch (Exception e) {
println "Warning: ${e.message}, is git installed?"
return "dev"
}
def commitId = stdout.toString().replace("\n", "").replace("\r", "").trim()
stdout = new ByteArrayOutputStream()
exec {
commandLine 'git', 'tag', '--points-at', commitId
standardOutput = stdout
}
def tagName = stdout.toString().replace("\n", "").replace("\r", "").trim()
def versionName = '0-git-' + commitId
if (tagName != null && "" != tagName) {
versionName = tagName
}
return versionName
} as Object

allprojects {
apply plugin: "maven-publish"

group = rootProject.group
description = rootProject.displayname
archivesBaseName = rootProject.name
Expand Down Expand Up @@ -60,10 +56,23 @@ subprojects {
tasks.withType(JavaCompile).configureEach {
it.options.release = 17
}

publishing {
repositories {
maven {
name = "reposiliteRepository"
url = uri("https://maven.conczin.net/Artifacts")
credentials {
username = System.getenv("MAVEN_USERNAME")
password = System.getenv("MAVEN_TOKEN")
}
}
}
}
}

forgix {
group = rootProject.group
group = rootProject.groupId
mergedJarName = "${rootProject.name}-${rootProject.version}-universal.jar"
outputDir = "build/libs"

Expand Down
50 changes: 50 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,53 @@
# 7.5.19

* Fixed trait shaders
* Rose gold dust is no longer part of the gold dust group to remove conflicts
* Fixed incompatibility with Productive Bees
* Added experimental long term memory to ChatAI
* Hopefully fixed crashes
* Villagers no longer grieve at single graves
* Villager can now glow while invisible
* You can now whistle villagers when they sit in vehicles
* Height now affects Hemoglobin levels
* Villagers no longer jump in front of gates

# 7.5.18

* Updated contributor book
* Fixed ReaperSpawner eating all your CPU

# 7.5.17

* Now its compatible with Cobblemon!
* Fixed TTS again!

# 7.5.16

* Fixed issues with building jars

# 7.5.15

* Merged [Inworld integration](https://github.com/Luke100000/minecraft-comes-alive/wiki/GPT3-based-conversations) branch (thanks CSCMe!)
* Fixed incompatibility with Cobblemon (thanks Apion!)
* Fixed AI issues with Grim Reapers, causing him to go much higher than intended
* Fixed issues when using Arabic numerals
* Fixed crashes when using TTS
* Fixed Inn spamming adventurers
* Probably fixed deadlocks related to SpawnQueue and ReaperSpawner
* Fixed incompatibility with AutoTranslation and related mods

# 7.5.14

* TTS language is now detected automatically

# 7.5.13

* Updated chatAI to v2
* See https://github.com/Luke100000/minecraft-comes-alive/wiki/GPT3-based-conversations
* Older versions will no longer work, technical reasons
* Added TTS v2
* See https://github.com/Luke100000/minecraft-comes-alive/wiki/TTS

# 7.5.12

* Fixed various smaller issues
Expand Down
12 changes: 12 additions & 0 deletions common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,15 @@ dependencies {
// Architectury API. This is optional, and you can comment it out if you don't need it.
modImplementation "dev.architectury:architectury:$rootProject.architectury_version"
}


publishing {
publications {
mavenCommon(MavenPublication) {
artifactId = rootProject.artifactId
groupId = rootProject.groupId
version = version + "+common"
from components.java
}
}
}
21 changes: 18 additions & 3 deletions common/src/main/java/net/mca/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;

public final class Config implements Serializable {
@Serial
Expand Down Expand Up @@ -103,9 +104,23 @@ public static Config getInstance() {
public int trackVillagerPositionEveryNTicks = 200;

//AI
public String _read_this_before_using_villager_ai = "https://github.com/Luke100000/minecraft-comes-alive/wiki/GPT3-based-conversations";
public boolean enableVillagerChatAI = false;
public int villagerChatAIIntelligence = 4;
public String villagerChatAIServer = "http://snoweagle.tk/";
public String villagerChatAIEndpoint = "https://api.conczin.net/v1/mca/chat";
public String villagerChatAIToken = "";
public String villagerChatAIModel = "default";
public String villagerChatAISystemPrompt = "";
public boolean villagerChatAIUseLongTermMemory = false;
public boolean villagerChatAIUseSharedLongTermMemory = false;
public boolean villagerChatAIIncludeSessionInformation = false;

public String inworldAIToken = "";
public Map<UUID, String> inworldAIResourceNames = new HashMap<>();

// TTS
public boolean enableOnlineTTS = false;
public String villagerTTSServer = "http://api.rk.conczin.net/";

//village behavior
public float guardSpawnFraction = 0.175f;
Expand Down Expand Up @@ -287,7 +302,7 @@ public void save() {
Gson gson = new GsonBuilder().setPrettyPrinting().create();
gson.toJson(this, writer);
} catch (IOException e) {
e.printStackTrace();
MCA.LOGGER.error(e);
}
}

Expand All @@ -297,7 +312,7 @@ public static Config loadOrCreate() {
try (FileReader reader = new FileReader(file)) {
Gson gson = new GsonBuilder().setPrettyPrinting().create();
Config config = gson.fromJson(reader, Config.class);
if (config.version != VERSION) {
if (config == null || config.version != VERSION) {
config = new Config();
}
config.save();
Expand Down
1 change: 1 addition & 0 deletions common/src/main/java/net/mca/MCA.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public final class MCA {
private static final Map<String, Boolean> MOD_CACHE = new HashMap<>();

public static final ExecutorService executorService = Executors.newSingleThreadExecutor();
public static Map<String, String> translations = new HashMap<>();

private static MinecraftServer server;

Expand Down
7 changes: 7 additions & 0 deletions common/src/main/java/net/mca/MCAClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ public static Optional<VillagerLike<?>> getPlayerData(UUID uuid) {
return Optional.empty();
}

public static boolean useExpandedPersonalityTranslations() {
boolean isTTSPackActive = MinecraftClient.getInstance().getResourceManager().streamResourcePacks().anyMatch(pack -> {
return pack.getName().contains("MCAVoices");
});
return !isTTSPackActive && MinecraftClient.getInstance().options.language.equals("en_us") && !Config.getInstance().enableOnlineTTS;
}

public static boolean useGeneticsRenderer(UUID uuid) {
return getPlayerData(uuid).filter(f -> f.getPlayerModel() != VillagerLike.PlayerModel.VANILLA).isPresent();
}
Expand Down
124 changes: 124 additions & 0 deletions common/src/main/java/net/mca/client/LanguageMap.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
package net.mca.client;

import java.util.HashMap;
import java.util.Map;

public class LanguageMap {
public static final Map<String, String> LANGUAGE_MAP = new HashMap<>();

static {
LANGUAGE_MAP.put("af_za", "");
LANGUAGE_MAP.put("ar_sa", "ar");
LANGUAGE_MAP.put("ast_es", "es");
LANGUAGE_MAP.put("az_az", "");
LANGUAGE_MAP.put("be_by", "ru");
LANGUAGE_MAP.put("bg_bg", "");
LANGUAGE_MAP.put("br_fr", "fr");
LANGUAGE_MAP.put("brb", "nl");
LANGUAGE_MAP.put("bs_BA", "");
LANGUAGE_MAP.put("ca_es", "");
LANGUAGE_MAP.put("cs_cz", "cs");
LANGUAGE_MAP.put("cy_gb", "");
LANGUAGE_MAP.put("da_dk", "");
LANGUAGE_MAP.put("de_at", "");
LANGUAGE_MAP.put("de_ch", "");
LANGUAGE_MAP.put("de_de", "de");
LANGUAGE_MAP.put("el_gr", "");
LANGUAGE_MAP.put("en_au", "en");
LANGUAGE_MAP.put("en_ca", "en");
LANGUAGE_MAP.put("en_za", "en");
LANGUAGE_MAP.put("en_gb", "en");
LANGUAGE_MAP.put("en_nz", "en");
LANGUAGE_MAP.put("en_7s", "en");
LANGUAGE_MAP.put("en_ud", "en");
LANGUAGE_MAP.put("en_us", "en");
LANGUAGE_MAP.put("eo_uy", "");
LANGUAGE_MAP.put("es_ar", "es");
LANGUAGE_MAP.put("es_es", "es");
LANGUAGE_MAP.put("es_cl", "es");
LANGUAGE_MAP.put("es_mx", "es");
LANGUAGE_MAP.put("es_uy", "es");
LANGUAGE_MAP.put("es_ve", "es");
LANGUAGE_MAP.put("et_ee", "");
LANGUAGE_MAP.put("eu_es", "");
LANGUAGE_MAP.put("fa_ir", "");
LANGUAGE_MAP.put("fi_fi", "");
LANGUAGE_MAP.put("fil_ph", "");
LANGUAGE_MAP.put("fo_fo", "");
LANGUAGE_MAP.put("fr_ca", "fr");
LANGUAGE_MAP.put("fr_fr", "fr");
LANGUAGE_MAP.put("fy_nl", "");
LANGUAGE_MAP.put("ga_ie", "");
LANGUAGE_MAP.put("gd_gb", "");
LANGUAGE_MAP.put("gl_es", "");
LANGUAGE_MAP.put("gv_im", "");
LANGUAGE_MAP.put("haw", "");
LANGUAGE_MAP.put("he_il", "");
LANGUAGE_MAP.put("hi_in", "hi");
LANGUAGE_MAP.put("hr_hr", "");
LANGUAGE_MAP.put("hu_hu", "hu");
LANGUAGE_MAP.put("hy_am", "");
LANGUAGE_MAP.put("id_id", "");
LANGUAGE_MAP.put("isv", "");
LANGUAGE_MAP.put("ig_ng", "");
LANGUAGE_MAP.put("io_en", "");
LANGUAGE_MAP.put("is_is", "");
LANGUAGE_MAP.put("it_it", "it");
LANGUAGE_MAP.put("ja_jp", "ja");
LANGUAGE_MAP.put("jbo", "");
LANGUAGE_MAP.put("ka_ge", "");
LANGUAGE_MAP.put("ko_kr", "ko");
LANGUAGE_MAP.put("ksh_de", "");
LANGUAGE_MAP.put("kw_gb", "");
LANGUAGE_MAP.put("la_va", "");
LANGUAGE_MAP.put("lb_lu", "");
LANGUAGE_MAP.put("li_li", "");
LANGUAGE_MAP.put("lol_aa", "");
LANGUAGE_MAP.put("lt_lt", "");
LANGUAGE_MAP.put("lv_lv", "");
LANGUAGE_MAP.put("mi_nz", "");
LANGUAGE_MAP.put("mk_mk", "");
LANGUAGE_MAP.put("mn_mn", "");
LANGUAGE_MAP.put("moh_us", "");
LANGUAGE_MAP.put("ms_my", "");
LANGUAGE_MAP.put("mt_mt", "");
LANGUAGE_MAP.put("nds_de", "de");
LANGUAGE_MAP.put("nl_be", "nl");
LANGUAGE_MAP.put("nl_nl", "nl");
LANGUAGE_MAP.put("nn_no", "");
LANGUAGE_MAP.put("no_no", "");
LANGUAGE_MAP.put("nb_no", "");
LANGUAGE_MAP.put("nuk", "");
LANGUAGE_MAP.put("oc_fr", "");
LANGUAGE_MAP.put("oj_ca", "");
LANGUAGE_MAP.put("ovd_se", "");
LANGUAGE_MAP.put("pl_pl", "pl");
LANGUAGE_MAP.put("pt_br", "pt");
LANGUAGE_MAP.put("pt_pt", "pt");
LANGUAGE_MAP.put("qya_aa", "");
LANGUAGE_MAP.put("ro_ro", "");
LANGUAGE_MAP.put("ru_ru", "ru");
LANGUAGE_MAP.put("sme", "");
LANGUAGE_MAP.put("sk_sk", "");
LANGUAGE_MAP.put("sl_si", "");
LANGUAGE_MAP.put("so_so", "");
LANGUAGE_MAP.put("sq_al", "");
LANGUAGE_MAP.put("sr_sp", "");
LANGUAGE_MAP.put("sv_se", "");
LANGUAGE_MAP.put("swg", "");
LANGUAGE_MAP.put("sxu", "");
LANGUAGE_MAP.put("szl", "");
LANGUAGE_MAP.put("ta_IN", "");
LANGUAGE_MAP.put("th_th", "");
LANGUAGE_MAP.put("tlh_aa", "");
LANGUAGE_MAP.put("tr_tr", "tr");
LANGUAGE_MAP.put("tt_ru", "");
LANGUAGE_MAP.put("tzl_tzl", "");
LANGUAGE_MAP.put("uk_ua", "");
LANGUAGE_MAP.put("vi_vn", "");
LANGUAGE_MAP.put("vmf_de", "");
LANGUAGE_MAP.put("yo_ng", "");
LANGUAGE_MAP.put("zh_cn", "zh-cn");
LANGUAGE_MAP.put("zh_tw", "");
}
}
Loading

0 comments on commit 5239946

Please sign in to comment.