Compare commits

...

16 commits

Author SHA1 Message Date
Stephen Seo bba99d4e6a Update README.md 2024-01-30 11:14:01 +09:00
Stephen Seo 356502f722 Action: Check if release exists before releasing 2024-01-22 18:29:29 +09:00
Stephen Seo 75976c8d9a Enable "any_archLinux" act runner for building jar 2024-01-20 20:01:54 +09:00
Stephen Seo 62774b0b0c Fix Reproducibility.md
All checks were successful
Build TurnBasedMC and create Release / build-and-create-release (push) Successful in 6m57s
2024-01-17 14:51:42 +09:00
Stephen Seo 846840c3a7 Update README.md 2024-01-17 14:48:56 +09:00
Stephen Seo 43bb0c7059 Fix version in main mod class 2024-01-17 14:48:37 +09:00
Stephen Seo 288ed1cfd6 Update Reproducibility.md
Some checks failed
Build TurnBasedMC and create Release / build-and-create-release (push) Has been cancelled
2024-01-17 14:44:12 +09:00
Stephen Seo b8a32a490e Update Changelog.md 2024-01-17 14:43:21 +09:00
Stephen Seo ae3cbfe4f6 Bump version to 1.25.2, cleanup of gradle stuff 2024-01-17 14:42:55 +09:00
Stephen Seo 9a481f95d0 Update Changelog.md 2024-01-17 14:30:19 +09:00
Stephen Seo 24a29eaba6 Update Reproducibility.md 2024-01-17 14:29:31 +09:00
Stephen Seo 9fab572800 Fix usage of throwable potions in battle
Add (experimental) "right-click" support for items when "Use" is invoked
on an item in battle.
2024-01-17 14:29:19 +09:00
Stephen Seo 6f0c223c9d Update FAQ.md 2024-01-17 13:43:24 +09:00
Stephen Seo 17c39a5329 Update README.md 2024-01-17 13:38:59 +09:00
Stephen Seo 4879aaefd1 Update README.md 2024-01-17 13:35:09 +09:00
Stephen Seo 46f8e22c8b Update Changelog.md, Reproducibility.md 2024-01-16 22:20:09 +09:00
10 changed files with 114 additions and 51 deletions

View file

@ -5,8 +5,21 @@ on:
- '*' - '*'
jobs: jobs:
check-release-exists:
runs-on: any_archLinux
outputs:
status: ${{ steps.release_exists_check.outputs.http_code }}
steps:
- name: Check if release already exists
id: release_exists_check
run: |
curl -X GET "https://git.seodisparate.com/api/v1/repos/stephenseo/TurnBasedMinecraftMod/releases/tags/${GITHUB_REF_NAME}" \
-H 'accept: application/json' -o release_check_resp.json 2>/dev/null \
-w '%{http_code}\n' | sed 's/^\([0-9]\+\)/http_code=\1/' >> "$GITHUB_OUTPUT"
build-and-create-release: build-and-create-release:
runs-on: archLinux needs: check-release-exists
if: ${{ needs.check-release-exists.outputs.status == '404' }}
runs-on: any_archLinux
steps: steps:
- run: git clone --depth=1 --no-single-branch https://git.seodisparate.com/stephenseo/TurnBasedMinecraftMod.git TurnBasedMinecraftMod - run: git clone --depth=1 --no-single-branch https://git.seodisparate.com/stephenseo/TurnBasedMinecraftMod.git TurnBasedMinecraftMod
- run: cd TurnBasedMinecraftMod && git checkout ${GITHUB_REF_NAME} - run: cd TurnBasedMinecraftMod && git checkout ${GITHUB_REF_NAME}

View file

@ -1,5 +1,30 @@
# Upcoming changes # Upcoming changes
# Version NeoForge-1.25.2
Fix invalid use of throwable potions. (Previously, the Player would "drink"
splash/lingering potions when used.) Now, if a splash/lingering potion is
"Use"d in battle, it will be thrown.
Add experimental support for "right-click" of arbitrary items on hotbar when
"Use" is used in battle.
# Version Forge-1.25.2
Fix invalid use of throwable potions. (Previously, the Player would "drink"
splash/lingering potions when used.) Now, if a splash/lingering potion is
"Use"d in battle, it will be thrown.
Add experimental support for "right-click" of arbitrary items on hotbar when
"Use" is used in battle.
# Version Forge-1.25.1
Add icon for mod in Mod list description.
Update for Forge 49.0.19.
Works on Forge Minecraft 1.20.4.
# Version NeoForge-1.25.1 # Version NeoForge-1.25.1
Add icon for mod in Mod list description. Add icon for mod in Mod list description.

4
FAQ.md
View file

@ -23,6 +23,10 @@ disabled for "passive" mobs.
**Note that while .ogg Vorbis files are supported, .ogg Opus files are NOT **Note that while .ogg Vorbis files are supported, .ogg Opus files are NOT
supported.** supported.**
One can use FFmpeg to convert music files into .ogg Vorbis:
ffmpeg -i <music_file_to_convert> -map a:0 -c:a libvorbis output.ogg
## Why can't the mod play my mp3 files? ## Why can't the mod play my mp3 files?
The third-party-library used to load mp3 files seems to have issues with The third-party-library used to load mp3 files seems to have issues with

View file

@ -8,11 +8,12 @@ Precompiled jars are available here:
https://seodisparate.com/static/tbm_releases/ https://seodisparate.com/static/tbm_releases/
https://burnedkirby.com/tbmm_downloads/ https://burnedkirby.com/tbmm_downloads/
https://www.curseforge.com/minecraft/mc-mods/turnbasedminecraft/files https://www.curseforge.com/minecraft/mc-mods/turnbasedminecraft/files
https://modrinth.com/mod/turnbasedmc https://modrinth.com/mod/turnbasedmc
https://git.seodisparate.com/stephenseo/TurnBasedMinecraftMod/releases
# Forge or NeoForge # Forge or NeoForge
The `master` branch tracks the version of the mod for Minecraft Forge. The `forge` branch tracks the version of the mod for Minecraft Forge.
The `neoforge` branch tracks the version of the mod for Minecraft NeoForge. The `neoforge` branch tracks the version of the mod for Minecraft NeoForge.
@ -71,7 +72,7 @@ configured for them.)
Simply invoke `./gradlew build` in the mod directory and after some time the Simply invoke `./gradlew build` in the mod directory and after some time the
finished jar will be saved at finished jar will be saved at
`build/libs/TurnBasedMinecraft-NeoForge-1.25.1-all.jar` `build/libs/TurnBasedMinecraft-NeoForge-1.25.2-all.jar`
# Reproducibility # Reproducibility

View file

@ -4,6 +4,45 @@ Starting with version 1.24.0 of this mod, this file will list what version of
Java was used to compile the jars. In theory, using the same version of Java Java was used to compile the jars. In theory, using the same version of Java
should result in an identical jar due to reproducible builds. should result in an identical jar due to reproducible builds.
## NeoForge 1.25.2
$ java --version
openjdk 17.0.10 2024-01-16
OpenJDK Runtime Environment (build 17.0.10+7)
OpenJDK 64-Bit Server VM (build 17.0.10+7, mixed mode)
$ javac --version
javac 17.0.10
$ sha256sum build/libs/TurnBasedMinecraft-NeoForge-1.25.2-all.jar
c59533059eb322a616f38ab40ccbc7d4d6c1667a651328a4c6eb187fe16d7a6f build/libs/TurnBasedMinecraft-NeoForge-1.25.2-all.jar
## Forge 1.25.2
$ java --version
openjdk 17.0.10 2024-01-16
OpenJDK Runtime Environment (build 17.0.10+7)
OpenJDK 64-Bit Server VM (build 17.0.10+7, mixed mode)
$ javac --version
javac 17.0.10
$ sha256sum build/libs/TurnBasedMinecraft-Forge-1.25.2-all.jar
00bc7958431e161b0a512ce32b41c1a97516b00e109195294ee18d4abf58dc26 build/libs/TurnBasedMinecraft-Forge-1.25.2-all.jar
## Forge 1.25.1
$ java --version
openjdk 17.0.9 2023-10-17
OpenJDK Runtime Environment (build 17.0.9+8)
OpenJDK 64-Bit Server VM (build 17.0.9+8, mixed mode)
$ javac --version
javac 17.0.9
$ sha256sum build/libs/TurnBasedMinecraft-Forge-1.25.1-all.jar
33711947eed8b24fa7fd65d36ecdb6ed78e144af8d7fff6e1bfa304cfe4a1d3d build/libs/TurnBasedMinecraft-Forge-1.25.1-all.jar
## NeoForge 1.25.1 ## NeoForge 1.25.1
$ java --version $ java --version

View file

@ -5,8 +5,8 @@ plugins {
id 'net.neoforged.gradle.userdev' version '7.0.80' id 'net.neoforged.gradle.userdev' version '7.0.80'
} }
version = "1.25.1" version = mod_version
group = "com.burnedkirby.TurnBasedMinecraft" group = mod_group_id
archivesBaseName = "TurnBasedMinecraft-NeoForge" archivesBaseName = "TurnBasedMinecraft-NeoForge"
java.toolchain.languageVersion = JavaLanguageVersion.of(17) java.toolchain.languageVersion = JavaLanguageVersion.of(17)
@ -96,17 +96,17 @@ dependencies {
// A missing property will result in an error. Properties are expanded using ${} Groovy notation. // A missing property will result in an error. Properties are expanded using ${} Groovy notation.
// When "copyIdeResources" is enabled, this will also run before the game launches in IDE environments. // When "copyIdeResources" is enabled, this will also run before the game launches in IDE environments.
// See https://docs.gradle.org/current/dsl/org.gradle.language.jvm.tasks.ProcessResources.html // See https://docs.gradle.org/current/dsl/org.gradle.language.jvm.tasks.ProcessResources.html
tasks.named('processResources', ProcessResources).configure { tasks.withType(ProcessResources).configureEach {
var replaceProperties = [ var replaceProperties = [
minecraft_version: minecraft_version, minecraft_version_range: minecraft_version_range, minecraft_version : minecraft_version, minecraft_version_range: minecraft_version_range,
neo_version : neo_version, neo_version_range: neo_version_range, neo_version : neo_version, neo_version_range: neo_version_range,
loader_version_range: loader_version_range, loader_version_range: loader_version_range,
mod_id: mod_id, mod_name: mod_name, mod_license: mod_license, mod_version: mod_version, mod_id : mod_id, mod_name: mod_name, mod_license: mod_license, mod_version: mod_version,
mod_authors: mod_authors, mod_description: mod_description, mod_authors : mod_authors, mod_description: mod_description,
] ]
inputs.properties replaceProperties inputs.properties replaceProperties
filesMatching(['META-INF/mods.toml', 'pack.mcmeta']) { filesMatching(['META-INF/mods.toml']) {
expand replaceProperties + [project: project] expand replaceProperties + [project: project]
} }
} }
@ -124,7 +124,6 @@ jar {
"Implementation-Vendor" :"TurnBasedMinecraftMod_BK", "Implementation-Vendor" :"TurnBasedMinecraftMod_BK",
// Do not place timestamp for the sake of reproducible builds // Do not place timestamp for the sake of reproducible builds
// "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"), // "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
// "ContainedDeps": "javamp3-1.0.3.jar"
]) ])
} }
} }
@ -138,25 +137,3 @@ tasks.withType(AbstractArchiveTask).configureEach {
tasks.withType(JavaCompile).configureEach { tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation
} }
// Example configuration to allow publishing using the maven-publish task
// we define a custom artifact that is sourced from the reobfJar output task
// and then declare that to be published
// Note you'll need to add a repository here
//def reobfFile = file("$buildDir/reobfJar/output.jar")
//def reobfArtifact = artifacts.add('default', reobfFile) {
// type 'jar'
// builtBy 'reobfJar'
//}
//publishing {
// publications {
// mavenJava(MavenPublication) {
// artifact reobfArtifact
// }
// }
// repositories {
// maven {
// url "file:///${project.projectDir}/mcmodsrepo"
// }
// }
//}

View file

@ -1,19 +1,24 @@
org.gradle.jvmargs=-Xmx4096m org.gradle.jvmargs=-Xmx4096m
org.gradle.daemon=false org.gradle.daemon=false
org.gradle.debug=false
## Environment Properties #read more on this at https://github.com/neoforged/NeoGradle/blob/NG_7.0/README.md#apply-parchment-mappings
# you can also find the latest versions at: https://parchmentmc.org/docs/getting-started
# The Minecraft version must agree with the Forge version to get a valid artifact neogradle.subsystems.parchment.minecraftVersion=1.20.3
neogradle.subsystems.parchment.mappingsVersion=2023.12.31
# Environment Properties
# You can find the latest versions here: https://projects.neoforged.net/neoforged/neoforge
# The Minecraft version must agree with the Neo version to get a valid artifact
minecraft_version=1.20.4 minecraft_version=1.20.4
# The Minecraft version range can use any release version of Minecraft as bounds. # The Minecraft version range can use any release version of Minecraft as bounds.
# Snapshots, pre-releases, and release candidates are not guaranteed to sort properly # Snapshots, pre-releases, and release candidates are not guaranteed to sort properly
# as they do not follow standard versioning conventions. # as they do not follow standard versioning conventions.
minecraft_version_range=[1.20.4,1.21) minecraft_version_range=[1.20.4,1.21)
# The Neo version must agree with the Minecraft version to get a valid artifact # The Neo version must agree with the Minecraft version to get a valid artifact
neo_version=20.4.108-beta neo_version=20.4.109-beta
# The Neo version range can use any version of Neo as bounds or match the loader version range # The Neo version range can use any version of Neo as bounds
neo_version_range=[20.4,) neo_version_range=[20.4,)
# The loader version range can only use the major version of Neo/FML as bounds # The loader version range can only use the major version of FML as bounds
loader_version_range=[2,) loader_version_range=[2,)
## Mod Properties ## Mod Properties
@ -26,14 +31,12 @@ mod_name=TurnBasedMinecraftMod
# The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default. # The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default.
mod_license=MIT mod_license=MIT
# The mod version. See https://semver.org/ # The mod version. See https://semver.org/
mod_version=1.25.1 mod_version=1.25.2
# The group ID for the mod. It is only important when publishing as an artifact to a Maven repository. # The group ID for the mod. It is only important when publishing as an artifact to a Maven repository.
# This should match the base package used for the mod sources. # This should match the base package used for the mod sources.
# See https://maven.apache.org/guides/mini/guide-naming-conventions.html # See https://maven.apache.org/guides/mini/guide-naming-conventions.html
#mod_group_id=com.example.examplemod mod_group_id=com.burnedkirby.TurnBasedMinecraft
# The authors of the mod. This is a simple text string that is used for display purposes in the mod list. # The authors of the mod. This is a simple text string that is used for display purposes in the mod list.
mod_authors=BurnedKirby a.k.a. Stephen Seo mod_authors=BurnedKirby a.k.a. Stephen Seo
# The description of the mod. This is a simple multiline text string that is used for display purposes in the mod list. # The description of the mod. This is a simple multiline text string that is used for display purposes in the mod list.
mod_description=Implements turn-based-battle in Minecraft. mod_description=Implements turn-based-battle in Minecraft.
# Pack version - this changes each minecraft release, in general.
pack_format_number=18

View file

@ -1102,7 +1102,7 @@ public class Battle {
final Entity nextEntity = next.entity; final Entity nextEntity = next.entity;
final int nextItemToUse = next.itemToUse; final int nextItemToUse = next.itemToUse;
((Player) nextEntity).getInventory().setItem(nextItemToUse, targetItem.finishUsingItem(targetItemStack, nextEntity.level(), (LivingEntity) nextEntity)); ((Player) nextEntity).getInventory().setItem(nextItemToUse, targetItem.finishUsingItem(targetItemStack, nextEntity.level(), (LivingEntity) nextEntity));
} else if (targetItem instanceof PotionItem) { } else if (targetItem instanceof PotionItem && !(targetItem instanceof ThrowablePotionItem)) {
debugLog += " potion"; debugLog += " potion";
sendMessageToAllPlayers(PacketBattleMessage.MessageType.USED_ITEM, next.entity.getId(), 0, PacketBattleMessage.UsedItemAction.USED_POTION.getValue(), targetItemStack.getDisplayName().getString()); sendMessageToAllPlayers(PacketBattleMessage.MessageType.USED_ITEM, next.entity.getId(), 0, PacketBattleMessage.UsedItemAction.USED_POTION.getValue(), targetItemStack.getDisplayName().getString());
final Entity nextEntity = next.entity; final Entity nextEntity = next.entity;
@ -1113,7 +1113,10 @@ public class Battle {
sendMessageToAllPlayers(PacketBattleMessage.MessageType.USED_ITEM, next.entity.getId(), 0, PacketBattleMessage.UsedItemAction.USED_INVALID.getValue(), targetItemStack.getDisplayName().getString()); sendMessageToAllPlayers(PacketBattleMessage.MessageType.USED_ITEM, next.entity.getId(), 0, PacketBattleMessage.UsedItemAction.USED_INVALID.getValue(), targetItemStack.getDisplayName().getString());
final Entity nextEntity = next.entity; final Entity nextEntity = next.entity;
final int nextItemToUse = next.itemToUse; final int nextItemToUse = next.itemToUse;
((Player)nextEntity).getInventory().setItem(nextItemToUse, targetItem.finishUsingItem(targetItemStack, nextEntity.level(), (LivingEntity) nextEntity)); final int prevItem = ((Player)nextEntity).getInventory().selected;
((Player)nextEntity).getInventory().selected = nextItemToUse;
((Player)nextEntity).getInventory().setItem(nextItemToUse, targetItem.use(nextEntity.level(), (Player)nextEntity, InteractionHand.MAIN_HAND).getObject());
((Player)nextEntity).getInventory().selected = prevItem;
} }
} }
break; break;

View file

@ -40,7 +40,7 @@ import org.apache.logging.log4j.Logger;
public class TurnBasedMinecraftMod { public class TurnBasedMinecraftMod {
public static final String MODID = "com_burnedkirby_turnbasedminecraft"; public static final String MODID = "com_burnedkirby_turnbasedminecraft";
public static final String NAME = "Turn Based Minecraft Mod"; public static final String NAME = "Turn Based Minecraft Mod";
public static final String VERSION = "1.25.1"; public static final String VERSION = "1.25.2";
public static final String CONFIG_FILENAME = "TBM_Config.toml"; public static final String CONFIG_FILENAME = "TBM_Config.toml";
public static final String DEFAULT_CONFIG_FILENAME = "TBM_Config_DEFAULT.toml"; public static final String DEFAULT_CONFIG_FILENAME = "TBM_Config_DEFAULT.toml";
public static final String CONFIG_DIRECTORY = "config/TurnBasedMinecraft/"; public static final String CONFIG_DIRECTORY = "config/TurnBasedMinecraft/";

View file

@ -9,7 +9,7 @@ modLoader="javafml" #mandatory
loaderVersion="${loader_version_range}" #mandatory (34 is current forge version) loaderVersion="${loader_version_range}" #mandatory (34 is current forge version)
# A URL to refer people to when problems occur with this mod # A URL to refer people to when problems occur with this mod
issueTrackerURL="https://github.com/Stephen-Seo/TurnBasedMinecraftMod/issues" #optional issueTrackerURL="https://github.com/Stephen-Seo/TurnBasedMinecraftMod/issues" #optional
license="MIT" license="${mod_license}"
# A list of mods - how many allowed here is determined by the individual mod loader # A list of mods - how many allowed here is determined by the individual mod loader
[[mods]] #mandatory [[mods]] #mandatory
# The modid of the mod # The modid of the mod
@ -29,9 +29,7 @@ credits="Thanks for this mod goes to Java" #optional
# A text field displayed in the mod UI # A text field displayed in the mod UI
authors="${mod_authors}" #optional authors="${mod_authors}" #optional
# The description text for the mod (multi line!) (#mandatory) # The description text for the mod (multi line!) (#mandatory)
description=''' description='''${mod_description}'''
Implements turn-based-battle in Minecraft.
'''
logoFile="assets/com_burnedkirby_turnbasedminecraft/tbmm_icon.png" logoFile="assets/com_burnedkirby_turnbasedminecraft/tbmm_icon.png"