Skip to content

Commit

Permalink
Update for MC 1.21
Browse files Browse the repository at this point in the history
  • Loading branch information
ojaha065 committed Jun 17, 2024
1 parent 0858626 commit 98bc92d
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 20 deletions.
24 changes: 18 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,16 @@ the intensity of which can be configured and will scale up based on the amount o
If you have updated your PiShock firmware to V3 (beta), you must use version 1.1.2.0 or later of the mod.

## Supported Minecraft/Minecraft Forge versions
* 1.19.x (Minecraft Forge 44.x, 45.x)
* 1.20.x (Minecraft Forge 46.x, 47.x, 48.x, 49.x)
### Fully supported (Use the latest version)
* 1.21 (Minecraft Forge 51.x)

### Deprecated support
* 1.19.x (Minecraft Forge 44.x, 45.x) (Use version [1.1.2.1](https://github.com/ojaha065/PiShockForMC/releases/download/1.20-1.1.2.1/pishockmc-1.20-1.1.2.1.jar))
* 1.20.x (Minecraft Forge 46.x, 47.x, 48.x, 49.x) (Use version [1.1.2.1](https://github.com/ojaha065/PiShockForMC/releases/download/1.20-1.1.2.1/pishockmc-1.20-1.1.2.1.jar))

### Untested (might or might not work)
* Minecraft Forge 50.x
* Any **newer** Minecraft or Minecraft Forge version not mentioned

## Needed hardware
* [A PiShock](https://pishock.com) device
Expand All @@ -28,13 +36,13 @@ If you have updated your PiShock firmware to V3 (beta), you must use version 1.1
1. Have a working Minecraft and Forge installation. See [How to install Forge](https://www.wikihow.com/Install-Minecraft-Forge) if you're unsure.
* Make sure you've launched the game at least once with Forge installed so the required folder structure is generated.
2. Download the latest release jar from [here](https://github.com/ojaha065/PiShockForMC/releases).
3. Drop the downloaded .jar file into `mods` folder inside Minecraft game directory. See [Where are Minecraft files stored?](https://help.minecraft.net/hc/en-us/articles/4409159214605-Managing-Data-and-Game-Storage-in-Minecraft-Java-Edition-) if you're unsure how to find the correct game directory.
3. Drop the downloaded .jar file into `mods` folder inside Minecraft game directory. See [Mojang documentation](https://help.minecraft.net/hc/en-us/articles/4409159214605) if you're unsure how to find the correct game directory.
4. Run the game once so a configuration file for the mod gets generated.
5. See the _Mod configuration_ section below. The configuration file can be found inside `config` folder inside Minecraft game directory.
6. Launch the game again. If everything is set correctly, the shocker will vibrate once for one second during the Minecraft startup process.

## Modpacks and compatability with other mods
The mod is licensed under a MIT license, so feel free to include it in any modpack. No permission or attribution is required.
The mod is licensed under a MIT license. Feel free to include it in any modpack, no permission or attribution required.

This mod should be compatible with almost everything.
If you're using other mods that alter the player health (e.g., changes the maxium health),
Expand Down Expand Up @@ -122,10 +130,14 @@ This usually means that the provided share code has too restrictive limitations
Please take a look in Minecraft logs and search for `pishockmc`.
The actual issue and some helpful advice should be printed there.

### I have some other issue(s) with the mod
### Minecraft fails to start after installing the mod
Double-check your Minecraft and Forge versions and the beginning of this readme
and make sure you're using a compatible version of the mod.

### I'm still having issues
Please open [an issue](https://github.com/ojaha065/PiShockForMC/issues) here on GitHub.

## TODO
## TODO (PRs welcome)
* **Support for multiple shockers**
* I currently only own one, so testing and debugging would be kinda hard.
* In-game configuration GUI
Expand Down
16 changes: 9 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
plugins {
id 'eclipse'
id 'idea'
id 'net.minecraftforge.gradle' version '[6.0.16,6.2)'
id 'net.minecraftforge.gradle' version '[6.0.24,6.2)'
}

version = '1.20-1.1.2.2'
version = '1.21-2.0.0.0'
group = 'fi.kissakala'
base.archivesName = 'pishockmc'

java.toolchain.languageVersion = JavaLanguageVersion.of(17)
java.toolchain.languageVersion = JavaLanguageVersion.of(21)

minecraft {
mappings channel: 'official', version: '1.20.4'
mappings channel: 'official', version: '1.21'
copyIdeResources = true
reobf = false

runs {
client {
Expand All @@ -32,7 +33,10 @@ repositories {
}

dependencies {
minecraft 'net.minecraftforge:forge:1.20.4-49.0.30'
minecraft "net.minecraftforge:forge:1.21-51.0.8"

// Hack fix for now, force jopt-simple to be exactly 5.0.4 because Mojang ships that version, but some transitive dependencies request 6.0+
implementation('net.sf.jopt-simple:jopt-simple:5.0.4') { version { strictly '5.0.4' } }
}

jar {
Expand All @@ -49,8 +53,6 @@ jar {
}
}

jar.finalizedBy('reobfJar')

tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation
}
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 2 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
2 changes: 1 addition & 1 deletion gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ fi


# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"'
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
Expand Down
2 changes: 1 addition & 1 deletion gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ set APP_HOME=%DIRNAME%
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi

@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"

@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
Expand Down
8 changes: 4 additions & 4 deletions src/main/resources/META-INF/mods.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
modLoader="javafml"
loaderVersion="[44,)"
loaderVersion="[0,)"
license="MIT"
issueTrackerURL="https://github.com/ojaha065/PiShockForMC/issues"

[[mods]]
modId="pishockmc"
version="1.20-1.1.2.2"
version="1.21-2.0.0.0"
displayName="PiShock for Minecraft"

#updateJSONURL="https://change.me.example.invalid/updates.json" # TODO
Expand All @@ -32,12 +32,12 @@ displayTest="IGNORE_ALL_VERSION" # This is a client-only mod
[[dependencies.pishockmc]]
modId="forge"
mandatory=true
versionRange="[44,)"
versionRange="[0,)"
ordering="AFTER"
side="BOTH"
[[dependencies.pishockmc]]
modId="minecraft"
mandatory=true
versionRange="[1.19,1.21)"
versionRange="[1.19,1.22)"
ordering="AFTER"
side="BOTH"

0 comments on commit 98bc92d

Please sign in to comment.