Compare commits

..

3 commits

Author SHA1 Message Date
f18cd91560 Update Reproducibility.md
All checks were successful
Build TurnBasedMC and create Release / build-and-create-release (push) Successful in 27s
2024-01-17 14:18:20 +09:00
d57a75d3b2 Bump version to 1.25.2 2024-01-17 14:17:03 +09:00
fb7d4e39de 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:11:11 +09:00
6 changed files with 30 additions and 5 deletions

View file

@ -1,5 +1,14 @@
# Upcoming changes
# 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

@ -72,7 +72,7 @@ configured for them.)
Simply invoke `./gradlew build` in the mod directory and after some time the
finished jar will be saved at
`build/libs/TurnBasedMinecraft-Forge-1.25.1-all.jar`
`build/libs/TurnBasedMinecraft-Forge-1.25.2-all.jar`
# Reproducibility

View file

@ -4,6 +4,19 @@ 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.
## 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

@ -44,7 +44,7 @@ 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.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.
# This should match the base package used for the mod sources.
# See https://maven.apache.org/guides/mini/guide-naming-conventions.html

View file

@ -1103,7 +1103,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) {
} else if (targetItem instanceof PotionItem && !(targetItem instanceof ThrowablePotionItem)) {
debugLog += " potion";
sendMessageToAllPlayers(PacketBattleMessage.MessageType.USED_ITEM, next.entity.getId(), 0, PacketBattleMessage.UsedItemAction.USED_POTION.getValue(), targetItemStack.getDisplayName().getString());
final Entity nextEntity = next.entity;
@ -1114,7 +1114,10 @@ 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;
((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;

View file

@ -37,7 +37,7 @@ import org.apache.logging.log4j.Logger;
public class TurnBasedMinecraftMod {
public static final String MODID = "com_burnedkirby_turnbasedminecraft";
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 DEFAULT_CONFIG_FILENAME = "TBM_Config_DEFAULT.toml";
public static final String CONFIG_DIRECTORY = "config/TurnBasedMinecraft/";