Compare commits

..

No commits in common. "288ed1cfd62b014cb34d88dfddd338ce076d5c43" and "6f0c223c9dd9a151be848397b9af6c15453dd876" have entirely different histories.

6 changed files with 46 additions and 71 deletions

View file

@ -1,23 +1,5 @@
# 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.

View file

@ -4,32 +4,6 @@ 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
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
241da01582400f73a1c0bab292b2e5c11e92b431d89eb9b8c08728616211f194 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

View file

@ -5,8 +5,8 @@ plugins {
id 'net.neoforged.gradle.userdev' version '7.0.80'
}
version = mod_version
group = mod_group_id
version = "1.25.1"
group = "com.burnedkirby.TurnBasedMinecraft"
archivesBaseName = "TurnBasedMinecraft-NeoForge"
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.
// 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
tasks.withType(ProcessResources).configureEach {
tasks.named('processResources', ProcessResources).configure {
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,
loader_version_range: loader_version_range,
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_id: mod_id, mod_name: mod_name, mod_license: mod_license, mod_version: mod_version,
mod_authors: mod_authors, mod_description: mod_description,
]
inputs.properties replaceProperties
filesMatching(['META-INF/mods.toml']) {
filesMatching(['META-INF/mods.toml', 'pack.mcmeta']) {
expand replaceProperties + [project: project]
}
}
@ -124,6 +124,7 @@ jar {
"Implementation-Vendor" :"TurnBasedMinecraftMod_BK",
// Do not place timestamp for the sake of reproducible builds
// "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
// "ContainedDeps": "javamp3-1.0.3.jar"
])
}
}
@ -137,3 +138,25 @@ tasks.withType(AbstractArchiveTask).configureEach {
tasks.withType(JavaCompile).configureEach {
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,24 +1,19 @@
org.gradle.jvmargs=-Xmx4096m
org.gradle.daemon=false
org.gradle.debug=false
#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
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
## Environment Properties
# The Minecraft version must agree with the Forge version to get a valid artifact
minecraft_version=1.20.4
# 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
# as they do not follow standard versioning conventions.
minecraft_version_range=[1.20.4,1.21)
# The Neo version must agree with the Minecraft version to get a valid artifact
neo_version=20.4.109-beta
# The Neo version range can use any version of Neo as bounds
neo_version=20.4.108-beta
# The Neo version range can use any version of Neo as bounds or match the loader version range
neo_version_range=[20.4,)
# The loader version range can only use the major version of FML as bounds
# The loader version range can only use the major version of Neo/FML as bounds
loader_version_range=[2,)
## Mod Properties
@ -31,12 +26,14 @@ mod_name=TurnBasedMinecraftMod
# The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default.
mod_license=MIT
# The mod version. See https://semver.org/
mod_version=1.25.2
mod_version=1.25.1
# 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.
# See https://maven.apache.org/guides/mini/guide-naming-conventions.html
mod_group_id=com.burnedkirby.TurnBasedMinecraft
#mod_group_id=com.example.examplemod
# 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
# 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.
# 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 int nextItemToUse = next.itemToUse;
((Player) nextEntity).getInventory().setItem(nextItemToUse, targetItem.finishUsingItem(targetItemStack, nextEntity.level(), (LivingEntity) nextEntity));
} else if (targetItem instanceof PotionItem && !(targetItem instanceof ThrowablePotionItem)) {
} else if (targetItem instanceof PotionItem) {
debugLog += " potion";
sendMessageToAllPlayers(PacketBattleMessage.MessageType.USED_ITEM, next.entity.getId(), 0, PacketBattleMessage.UsedItemAction.USED_POTION.getValue(), targetItemStack.getDisplayName().getString());
final Entity nextEntity = next.entity;
@ -1113,10 +1113,7 @@ public class Battle {
sendMessageToAllPlayers(PacketBattleMessage.MessageType.USED_ITEM, next.entity.getId(), 0, PacketBattleMessage.UsedItemAction.USED_INVALID.getValue(), targetItemStack.getDisplayName().getString());
final Entity nextEntity = next.entity;
final int nextItemToUse = next.itemToUse;
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;
((Player)nextEntity).getInventory().setItem(nextItemToUse, targetItem.finishUsingItem(targetItemStack, nextEntity.level(), (LivingEntity) nextEntity));
}
}
break;

View file

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