# Upcoming changes
+# Version 1.16
+
+Add config options regarding creeper behavior.
+
+By default, creepers will not explode if they leave battle (maybe due to a
+player fleeing), until the cooldown time ends.
+
+By default, creepers that explode will damage anyone, even if they weren't in
+turn-based battle.
+
# Version 1.15
Add server-side config option that determines on what turn a Creeper will
//apply plugin: 'maven-publish'\r
apply plugin: 'com.github.johnrengelman.shadow'\r
\r
-version = "1.15"\r
+version = "1.16"\r
group = "com.burnedkirby.TurnBasedMinecraft"\r
archivesBaseName = "TurnBasedMinecraft"\r
\r
import com.burnedkirby.TurnBasedMinecraft.common.networking.PacketEditingMessage;
import com.burnedkirby.TurnBasedMinecraft.common.networking.PacketGeneralMessage;
+import net.minecraft.entity.monster.CreeperEntity;
import net.minecraft.entity.player.ServerPlayerEntity;
import net.minecraftforge.event.entity.living.LivingAttackEvent;
import net.minecraftforge.event.entity.living.LivingSetAttackTargetEvent;
}
if(event.getEntity() != null && event.getSource().getTrueSource() != null && (battleManager.isRecentlyLeftBattle(event.getEntity().getEntityId()) || battleManager.isRecentlyLeftBattle(event.getSource().getTrueSource().getEntityId())))
{
+ if(event.getSource().getTrueSource().getEntity() instanceof CreeperEntity && TurnBasedMinecraftMod.proxy.getConfig().getCreeperAlwaysAllowDamage()) {
+ event.setCanceled(false);
+ } else {
// TurnBasedMinecraftMod.logger.debug("Canceled attack");
- event.setCanceled(true);
+ event.setCanceled(true);
+ }
return;
}
else if(!isAttackerValid(event)
import java.util.Iterator;
import java.util.Map;
+import net.minecraft.entity.monster.CreeperEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.ServerPlayerEntity;
import net.minecraft.util.RegistryKey;
for(Iterator<Map.Entry<Integer, Combatant>> iter = recentlyLeftBattle.entrySet().iterator(); iter.hasNext();)
{
Map.Entry<Integer, Combatant> entry = iter.next();
+ if(entry.getValue().entity instanceof CreeperEntity && TurnBasedMinecraftMod.proxy.getConfig().getCreeperStopExplodeOnLeaveBattle()) {
+ ((CreeperEntity)entry.getValue().entity).setCreeperState(-10);
+ }
if(current - entry.getValue().time > TurnBasedMinecraftMod.proxy.getConfig().getLeaveBattleCooldownNanos())
{
iter.remove();
private int leaveBattleCooldownSeconds = 5;
private int aggroStartBattleDistance = 8;
private int creeperExplodeTurn = 5;
+ private boolean creeperStopExplodeOnLeaveBattle = true;
+ private boolean creeperAlwaysAllowDamage = true;
public Config(Logger logger)
{
logTOMLInvalidValue("server_config.creeper_explode_turn", "5");
}
+ try {
+ Boolean creeper_stop_explode_on_leave_battle = conf.get("server_config.creeper_stop_explode_on_leave_battle");
+ if(creeper_stop_explode_on_leave_battle != null) {
+ this.creeperStopExplodeOnLeaveBattle = creeper_stop_explode_on_leave_battle;
+ } else {
+ this.creeperStopExplodeOnLeaveBattle = true;
+ logNotFound("server_config.creeper_stop_explode_on_leave_battle", "true");
+ }
+ } catch (ClassCastException e) {
+ this.creeperStopExplodeOnLeaveBattle = true;
+ logTOMLInvalidValue("server_config.creeper_stop_explode_on_leave_battle", "true");
+ }
+
+ try {
+ Boolean creeper_always_allow_damage = conf.get("server_config.creeper_always_allow_damage");
+ if(creeper_always_allow_damage != null) {
+ this.creeperAlwaysAllowDamage = creeper_always_allow_damage;
+ } else {
+ this.creeperAlwaysAllowDamage = true;
+ logNotFound("server_config.creeper_always_allow_damage", "true");
+ }
+ } catch (ClassCastException e) {
+ this.creeperAlwaysAllowDamage = true;
+ logTOMLInvalidValue("server_config.creeper_always_allow_damage", "true");
+ }
+
try {
Boolean old_battle_behavior = conf.get("server_config.old_battle_behavior");
if(old_battle_behavior != null) {
}
public int getCreeperExplodeTurn() { return creeperExplodeTurn; }
+
+ public boolean getCreeperStopExplodeOnLeaveBattle() { return creeperStopExplodeOnLeaveBattle; }
+
+ public boolean getCreeperAlwaysAllowDamage() { return creeperAlwaysAllowDamage; }
}
{
public static final String MODID = "com_burnedkirby_turnbasedminecraft";
public static final String NAME = "Turn Based Minecraft Mod";
- public static final String VERSION = "1.15";
+ public static final String VERSION = "1.16";
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/";
# 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.15" #mandatory
+version="1.16" #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>
# Please do not change this option, the mod uses this to keep track of what new
# changes to add to the config.
-version = 5
+version = 6
do_not_overwrite = false
[client_config]
# On what turn a Creeper will explode in battle
creeper_explode_turn = 5
+# Keep creepers from exploding when they leave a battle (for leave_battle_cooldown duration)
+creeper_stop_explode_on_leave_battle = true
+
+# If false, creepers may not damage others outside of turn-based battle
+creeper_always_allow_damage = true
+
# Each "server_config.entity" entry uses the following options:
# name: full class name of the entity, cannot also have option "custom_name"
"modid": "com_burnedkirby_turnbasedminecraft",
"name": "Turn Based Minecraft",
"description": "Changes battles to be turn-based.",
- "version": "1.15",
+ "version": "1.16",
"mcversion": "1.16.3",
"url": "",
"updateUrl": "",