Skip to content

Commit

Permalink
Update to Minecraft 1.18.1
Browse files Browse the repository at this point in the history
I had to update gradle, modmenu, and pircbotx (it used a field that had a name change in Java 1.17, and crashed when I tried to start the bot with this new Java version).
  • Loading branch information
pblop committed Dec 15, 2021
1 parent a6cb789 commit d6d7cdd
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 32 deletions.
30 changes: 11 additions & 19 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
plugins {
id 'fabric-loom' version '0.8-SNAPSHOT'
id 'fabric-loom' version '0.10-SNAPSHOT'
id 'maven-publish'
}

sourceCompatibility = JavaVersion.VERSION_16
targetCompatibility = JavaVersion.VERSION_16
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17

archivesBaseName = project.archives_base_name
version = project.mod_version
Expand All @@ -14,10 +14,8 @@ repositories {
maven { url = 'https://minecraft.curseforge.com/api/maven' }
maven { url = 'https://maven.shedaniel.me/' }
maven { url = 'https://maven.terraformersmc.com/'}
maven {
name = 'CottonMC'
url = 'https://server.bbkr.space/artifactory/libs-release'
}
maven { url 'https://jitpack.io' }

}

dependencies {
Expand All @@ -44,8 +42,8 @@ dependencies {
modImplementation "com.terraformersmc:modmenu:${project.mod_menu_version}"

// irc
implementation 'org.pircbotx:pircbotx:2.1'
include 'org.pircbotx:pircbotx:2.1'
implementation 'com.github.pircbotx:pircbotx:12f5639c5d'
include 'com.github.pircbotx:pircbotx:12f5639c5d'

// pircbotx needs this 🤷‍
include group: 'org.slf4j', name: 'slf4j-api', version: '1.7.13'
Expand All @@ -71,8 +69,8 @@ tasks.withType(JavaCompile).configureEach {
// If Javadoc is generated, this must be specified in that task too.
it.options.encoding = "UTF-8"

// Minecraft 1.17 (21w19a) upwards uses Java 16.
it.options.release = 16
// Minecraft 1.18 (1.18-pre2) upwards uses Java 17.
it.options.release = 17
}

java {
Expand All @@ -92,13 +90,7 @@ jar {
publishing {
publications {
mavenJava(MavenPublication) {
// add all the jars that should be included when publishing to maven
artifact(remapJar) {
builtBy remapJar
}
artifact(sourcesJar) {
builtBy remapSourcesJar
}
from components.java
}
}

Expand All @@ -109,4 +101,4 @@ publishing {
// The repositories here will be used for publishing your artifact, not for
// retrieving dependencies.
}
}
}
13 changes: 6 additions & 7 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,17 @@ org.gradle.jvmargs=-Xmx1G

# Fabric Properties
# check these on https://fabricmc.net/use
minecraft_version=1.17
yarn_mappings=1.17+build.7
loader_version=0.11.3
minecraft_version=1.18.1
yarn_mappings=1.18.1+build.5
loader_version=0.12.12

# Mod Properties
mod_version=0.11.2b
mod_version=0.12.0b
maven_group=to.pabli
archives_base_name=twitchchat

# Dependencies
# currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api
fabric_version=0.35.0+1.17
fabric_version=0.44.0+1.18
cloth_config_version=5.0.34
mod_menu_version=2.0.2
cotton_client_commands_version=1.0.1+1.16-rc1
mod_menu_version=3.0.0
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
zipStorePath=wrapper/dists
6 changes: 2 additions & 4 deletions src/main/java/to/pabli/twitchchat/config/ModConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ public class ModConfig {
public ModConfig() {
this.configFile = FabricLoader
.getInstance()
.getConfigDirectory()
.toPath()
.getConfigDir()
.resolve("twitchchat.json")
.toFile();
this.channel = DEFAULT_CHANNEL;
Expand All @@ -70,8 +69,7 @@ public void load() {
try {
String jsonStr = new String(Files.readAllBytes(this.configFile.toPath()));
if (!jsonStr. equals("")) {
JsonParser jsonParser = new JsonParser();
JsonObject jsonObject = (JsonObject) jsonParser.parse(jsonStr);
JsonObject jsonObject = (JsonObject) JsonParser.parseString(jsonStr);
this.channel = jsonObject.has("channel")
? jsonObject.getAsJsonPrimitive("channel").getAsString()
: DEFAULT_CHANNEL;
Expand Down

0 comments on commit d6d7cdd

Please sign in to comment.