Version 1.21.4, bug fix

Fix bug where client may not be able to attack entities for which an entry did
not exist on the client-side config.
This commit is contained in:
Stephen Seo 2022-09-02 19:46:26 +09:00
parent c6b0cd9d26
commit c8add16c86
7 changed files with 13 additions and 7 deletions

View file

@ -1,7 +1,13 @@
# Upcoming changes
# Version 1.21.4
More refactoring of check-if-in-battle lookup code.
Fix potential bug where clients cannot attack entities if their config didn't
exist client-side. They should now always be available to attack regardless of
whether or not the client has the config entry for an entity.
# Version 1.21.3
Implemented "player-only" battles, which can be enabled in the server-side

View file

@ -58,7 +58,7 @@ configured for them.)
# Building
Simply invoke `./gradlew build` in the mod directory and after some time the
finished jar will be saved at "build/libs/TurnBasedMinecraft-1.21.3.jar"
finished jar will be saved at "build/libs/TurnBasedMinecraft-1.21.4.jar"
# Other notes

View file

@ -14,7 +14,7 @@ apply plugin: 'net.minecraftforge.gradle'
//apply plugin: 'eclipse'
//apply plugin: 'maven-publish'
version = "1.21.3"
version = "1.21.4"
group = "com.burnedkirby.TurnBasedMinecraft"
archivesBaseName = "TurnBasedMinecraft"

View file

@ -266,7 +266,7 @@ public class Battle {
entityInfo = TurnBasedMinecraftMod.proxy.getConfig().getMatchingEntityInfo(e);
}
if (entityInfo == null && !(e instanceof Player) && TurnBasedMinecraftMod.proxy.isServerRunning()) {
if (isServer && entityInfo == null && !(e instanceof Player) && TurnBasedMinecraftMod.proxy.isServerRunning()) {
return;
}
Combatant newCombatant = new Combatant(e, entityInfo);
@ -314,7 +314,7 @@ public class Battle {
entityInfo = TurnBasedMinecraftMod.proxy.getConfig().getMatchingEntityInfo(e);
}
if (entityInfo == null && !(e instanceof Player) && TurnBasedMinecraftMod.proxy.isServerRunning()) {
if (isServer && entityInfo == null && !(e instanceof Player) && TurnBasedMinecraftMod.proxy.isServerRunning()) {
return;
}
Combatant newCombatant = new Combatant(e, entityInfo);

View file

@ -39,7 +39,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.21.3";
public static final String VERSION = "1.21.4";
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/";

View file

@ -15,7 +15,7 @@ license="MIT"
# The modid of the mod
modId="com_burnedkirby_turnbasedminecraft" #mandatory
# The version number of the mod - there's a few well known ${} variables useable here or just hardcode it
version="1.21.3" #mandatory
version="1.21.4" #mandatory
# A display name for the mod
displayName="TurnBasedMinecraftMod" #mandatory
# A URL to query for updates for this mod. See the JSON update specification <here>

View file

@ -3,7 +3,7 @@
"modid": "com_burnedkirby_turnbasedminecraft",
"name": "Turn Based Minecraft",
"description": "Changes battles to be turn-based.",
"version": "1.21.3",
"version": "1.21.4",
"mcversion": "1.18.2",
"url": "",
"updateUrl": "",