# Upcoming changes
+# Version 1.15
+
+Add server-side config option that determines on what turn a Creeper will
+explode in battle.
+
# Version 1.14
Implemented support for Creepers in battle.
//apply plugin: 'maven-publish'\r
apply plugin: 'com.github.johnrengelman.shadow'\r
\r
-version = "1.14"\r
+version = "1.15"\r
group = "com.burnedkirby.TurnBasedMinecraft"\r
archivesBaseName = "TurnBasedMinecraft"\r
\r
if(!(c.entity instanceof PlayerEntity) && c.decision == Decision.UNDECIDED && c.entityInfo != null)
{
if(c.entity instanceof CreeperEntity) {
- if(c.creeperTurns++ < 2) {
+ if(c.creeperTurns++ < TurnBasedMinecraftMod.proxy.getConfig().getCreeperExplodeTurn()) {
c.decision = Decision.CREEPER_WAIT;
} else {
c.decision = Decision.CREEPER_EXPLODE;
if(!(c.entity instanceof PlayerEntity) && c.decision == Decision.UNDECIDED && c.entityInfo != null)
{
if(c.entity instanceof CreeperEntity) {
- if(c.creeperTurns++ < 2) {
+ if(c.creeperTurns++ < TurnBasedMinecraftMod.proxy.getConfig().getCreeperExplodeTurn()) {
c.decision = Decision.CREEPER_WAIT;
} else {
c.decision = Decision.CREEPER_EXPLODE;
break;
case CREEPER_WAIT:
debugLog += " creeper wait";
- if(next.creeperTurns < 2) {
+ if(next.creeperTurns < TurnBasedMinecraftMod.proxy.getConfig().getCreeperExplodeTurn()) {
sendMessageToAllPlayers(PacketBattleMessage.MessageType.CREEPER_WAIT, next.entity.getEntityId(), 0, 0);
} else {
sendMessageToAllPlayers(PacketBattleMessage.MessageType.CREEPER_WAIT_FINAL, next.entity.getEntityId(), 0, 0);
private void defuseCreepers() {
for(Combatant c : sideA.values()) {
if(c.entity instanceof CreeperEntity) {
- if(c.creeperTurns <= 2) {
+ if(c.creeperTurns <= TurnBasedMinecraftMod.proxy.getConfig().getCreeperExplodeTurn()) {
((CreeperEntity)c.entity).setCreeperState(-10);
} else {
((CreeperEntity)c.entity).setCreeperState(1000000);
}
for(Combatant c : sideB.values()) {
if(c.entity instanceof CreeperEntity) {
- if(c.creeperTurns <= 2) {
+ if(c.creeperTurns <= TurnBasedMinecraftMod.proxy.getConfig().getCreeperExplodeTurn()) {
((CreeperEntity)c.entity).setCreeperState(-10);
} else {
((CreeperEntity) c.entity).setCreeperState(1000000);
decision = Battle.Decision.UNDECIDED;
recalcSpeedOnCompare = false;
remainingDefenses = 0;
- creeperTurns = 0;
+ creeperTurns = 1;
}
public Combatant(Entity e, EntityInfo entityInfo)
this.entityInfo = entityInfo;
recalcSpeedOnCompare = false;
remainingDefenses = 0;
- creeperTurns = 0;
+ creeperTurns = 1;
}
/**
private boolean oldBattleBehaviorEnabled = false;
private int leaveBattleCooldownSeconds = 5;
private int aggroStartBattleDistance = 8;
+ private int creeperExplodeTurn = 5;
public Config(Logger logger)
{
logTOMLInvalidValue("server_config.aggro_start_battle_max_distance", "8");
}
+ try {
+ OptionalInt creeper_explode_turn = conf.getOptionalInt("server_config.creeper_explode_turn");
+ if(creeper_explode_turn.isPresent()) {
+ this.creeperExplodeTurn = creeper_explode_turn.getAsInt();
+ if(this.creeperExplodeTurn < 1) {
+ logClampedValue("server_config.creeper_explode_turn", Integer.toString(this.creeperExplodeTurn), "1");
+ this.creeperExplodeTurn = 1;
+ }
+ } else {
+ this.creeperExplodeTurn = 5;
+ logNotFound("server_config.creeper_explode_turn", "5");
+ }
+ } catch(ClassCastException e) {
+ this.creeperExplodeTurn = 5;
+ logTOMLInvalidValue("server_config.creeper_explode_turn", "5");
+ }
+
try {
Boolean old_battle_behavior = conf.get("server_config.old_battle_behavior");
if(old_battle_behavior != null) {
{
return aggroStartBattleDistance;
}
+
+ public int getCreeperExplodeTurn() { return creeperExplodeTurn; }
}
{
public static final String MODID = "com_burnedkirby_turnbasedminecraft";
public static final String NAME = "Turn Based Minecraft Mod";
- public static final String VERSION = "1.14";
+ public static final String VERSION = "1.15";
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.14" #mandatory
+version="1.15" #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 = 4
+version = 5
do_not_overwrite = false
[client_config]
# Minimum 5, maximum 60.
battle_turn_time_seconds = 15
+# On what turn a Creeper will explode in battle
+creeper_explode_turn = 5
+
# 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.14",
+ "version": "1.15",
"mcversion": "1.16.3",
"url": "",
"updateUrl": "",