# Upcoming changes
+# Version 1.23.1
+
+More robust handling of disallowed Damage Sources in battle (via config).
+Basically, the mod will load all possible damage sources. Damage sources to be
+ignored in battle can be modified with "/tbm-server-edit" and clicking on
+"ignore\_damage\_sources". It can also be manually modified in the server
+config's "ignore\_damage\_sources" array.
+
# Version 1.23.0
Support reproducible builds. This means that if this mod is compiled, then it
# Building
Simply invoke `./gradlew build` in the mod directory and after some time the
-finished jar will be saved at "build/libs/TurnBasedMinecraft-1.23.0.jar"
+finished jar will be saved at "build/libs/TurnBasedMinecraft-1.23.1.jar"
# Other notes
id 'com.github.johnrengelman.shadow' version '8.1.1'
}
-version = "1.23.0"
+version = "1.23.1"
group = "com.burnedkirby.TurnBasedMinecraft"
archivesBaseName = "TurnBasedMinecraft"
# 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.23.0
+mod_version=1.23.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
import com.electronwill.nightconfig.core.file.CommentedFileConfig;
import com.electronwill.nightconfig.toml.TomlFormat;
+import net.minecraft.core.registries.Registries;
+import net.minecraft.data.registries.VanillaRegistries;
import org.apache.logging.log4j.Logger;
import com.electronwill.nightconfig.core.file.FileConfig;
possibleIgnoreHurtDamageSources = new HashSet<String>();
ignoreHurtDamageSources = new HashSet<String>();
- possibleIgnoreHurtDamageSources.add("inFire");
- possibleIgnoreHurtDamageSources.add("lightningBolt");
- possibleIgnoreHurtDamageSources.add("onFire");
- possibleIgnoreHurtDamageSources.add("lava");
- possibleIgnoreHurtDamageSources.add("hotFloor");
- possibleIgnoreHurtDamageSources.add("inWall");
- possibleIgnoreHurtDamageSources.add("cramming");
- possibleIgnoreHurtDamageSources.add("drown");
- possibleIgnoreHurtDamageSources.add("starve");
- possibleIgnoreHurtDamageSources.add("cactus");
- possibleIgnoreHurtDamageSources.add("fall");
- possibleIgnoreHurtDamageSources.add("flyIntoWall");
- possibleIgnoreHurtDamageSources.add("outOfWorld");
- possibleIgnoreHurtDamageSources.add("magic");
- possibleIgnoreHurtDamageSources.add("wither");
- possibleIgnoreHurtDamageSources.add("anvil");
- possibleIgnoreHurtDamageSources.add("fallingBlock");
- possibleIgnoreHurtDamageSources.add("dragonBreath");
- possibleIgnoreHurtDamageSources.add("dryout");
- possibleIgnoreHurtDamageSources.add("sweetBerryBush");
- possibleIgnoreHurtDamageSources.add("freeze");
- possibleIgnoreHurtDamageSources.add("fallingStalactite");
- possibleIgnoreHurtDamageSources.add("stalagmite");
+ loadDamageSources();
{
File confPath = new File(TurnBasedMinecraftMod.CONFIG_DIRECTORY);
public void setIsPlayerOnlyBattles(boolean enabled) {
playerOnlyBattles = enabled;
}
-}
\ No newline at end of file
+
+ private void loadDamageSources() {
+ possibleIgnoreHurtDamageSources.clear();
+
+ try {
+ VanillaRegistries.createLookup().lookupOrThrow(Registries.DAMAGE_TYPE).listElements().forEach(dt -> possibleIgnoreHurtDamageSources.add(dt.get().msgId()));
+ } catch (Exception e) {
+ logger.warn("Config failed to load possible DamageSources! Undesired things may happen, like Zombies dying from Fire during battle!");
+ logger.warn(e);
+ }
+ }
+}
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.23.0";
+ public static final String VERSION = "1.23.1";
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/";
# This array lists damage sources that are ignored for an entity in battle.
# To allow damage from all sources during battle, make this array empty.
-# Valid values:
-# "inFire", "lightningBolt", "onFire", "lava", "hotFloor", "inWall", "cramming", "drown", "starve",
-# "cactus", "fall", "flyIntoWall", "outOfWorld", "magic", "wither", "anvil", "fallingBlock",
-# "dragonBreath", "dryout", "sweetBerryBush", "freeze", "fallingStalactite", "stalagmite"
+# Check the output of "/tbm-server-edit" and clicking on "ignore_damage_sources" for possible values.
ignore_damage_sources = [
"inFire",
"onFire",
"modid": "com_burnedkirby_turnbasedminecraft",
"name": "Turn Based Minecraft",
"description": "Changes battles to be turn-based.",
- "version": "1.23.0",
+ "version": "1.23.1",
"mcversion": "1.20.1",
"url": "",
"updateUrl": "",