NPC speed should be more than zero.

Contributed by Index.
This commit is contained in:
MobiusDevelopment
2022-12-12 21:02:51 +00:00
parent 2925871d87
commit c3db23c376
58 changed files with 145 additions and 87 deletions

View File

@@ -275,14 +275,16 @@ public class NpcData implements IXmlReader
{ {
case "walk": case "walk":
{ {
set.set("baseWalkSpd", parseDouble(attrs, "ground")); final double groundWalk = parseDouble(attrs, "ground");
set.set("baseWalkSpd", groundWalk <= 0d ? 0.1 : groundWalk);
set.set("baseSwimWalkSpd", parseDouble(attrs, "swim")); set.set("baseSwimWalkSpd", parseDouble(attrs, "swim"));
set.set("baseFlyWalkSpd", parseDouble(attrs, "fly")); set.set("baseFlyWalkSpd", parseDouble(attrs, "fly"));
break; break;
} }
case "run": case "run":
{ {
set.set("baseRunSpd", parseDouble(attrs, "ground")); final double runSpeed = parseDouble(attrs, "ground");
set.set("baseRunSpd", runSpeed <= 0d ? 0.1 : runSpeed);
set.set("baseSwimRunSpd", parseDouble(attrs, "swim")); set.set("baseSwimRunSpd", parseDouble(attrs, "swim"));
set.set("baseFlyRunSpd", parseDouble(attrs, "fly")); set.set("baseFlyRunSpd", parseDouble(attrs, "fly"));
break; break;

View File

@@ -174,7 +174,7 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
_flying = set.getBoolean("flying", false); _flying = set.getBoolean("flying", false);
_fakePlayer = set.getBoolean("fakePlayer", false); _fakePlayer = set.getBoolean("fakePlayer", false);
_fakePlayerTalkable = set.getBoolean("fakePlayerTalkable", true); _fakePlayerTalkable = set.getBoolean("fakePlayerTalkable", true);
_canMove = set.getBoolean("canMove", true); _canMove = (set.getDouble("baseWalkSpd", 1d) <= 0.1) || set.getBoolean("canMove", true);
_noSleepMode = set.getBoolean("noSleepMode", false); _noSleepMode = set.getBoolean("noSleepMode", false);
_passableDoor = set.getBoolean("passableDoor", false); _passableDoor = set.getBoolean("passableDoor", false);
_hasSummoner = set.getBoolean("hasSummoner", false); _hasSummoner = set.getBoolean("hasSummoner", false);

View File

@@ -275,14 +275,16 @@ public class NpcData implements IXmlReader
{ {
case "walk": case "walk":
{ {
set.set("baseWalkSpd", parseDouble(attrs, "ground")); final double groundWalk = parseDouble(attrs, "ground");
set.set("baseWalkSpd", groundWalk <= 0d ? 0.1 : groundWalk);
set.set("baseSwimWalkSpd", parseDouble(attrs, "swim")); set.set("baseSwimWalkSpd", parseDouble(attrs, "swim"));
set.set("baseFlyWalkSpd", parseDouble(attrs, "fly")); set.set("baseFlyWalkSpd", parseDouble(attrs, "fly"));
break; break;
} }
case "run": case "run":
{ {
set.set("baseRunSpd", parseDouble(attrs, "ground")); final double runSpeed = parseDouble(attrs, "ground");
set.set("baseRunSpd", runSpeed <= 0d ? 0.1 : runSpeed);
set.set("baseSwimRunSpd", parseDouble(attrs, "swim")); set.set("baseSwimRunSpd", parseDouble(attrs, "swim"));
set.set("baseFlyRunSpd", parseDouble(attrs, "fly")); set.set("baseFlyRunSpd", parseDouble(attrs, "fly"));
break; break;

View File

@@ -174,7 +174,7 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
_flying = set.getBoolean("flying", false); _flying = set.getBoolean("flying", false);
_fakePlayer = set.getBoolean("fakePlayer", false); _fakePlayer = set.getBoolean("fakePlayer", false);
_fakePlayerTalkable = set.getBoolean("fakePlayerTalkable", true); _fakePlayerTalkable = set.getBoolean("fakePlayerTalkable", true);
_canMove = set.getBoolean("canMove", true); _canMove = (set.getDouble("baseWalkSpd", 1d) <= 0.1) || set.getBoolean("canMove", true);
_noSleepMode = set.getBoolean("noSleepMode", false); _noSleepMode = set.getBoolean("noSleepMode", false);
_passableDoor = set.getBoolean("passableDoor", false); _passableDoor = set.getBoolean("passableDoor", false);
_hasSummoner = set.getBoolean("hasSummoner", false); _hasSummoner = set.getBoolean("hasSummoner", false);

View File

@@ -275,14 +275,16 @@ public class NpcData implements IXmlReader
{ {
case "walk": case "walk":
{ {
set.set("baseWalkSpd", parseDouble(attrs, "ground")); final double groundWalk = parseDouble(attrs, "ground");
set.set("baseWalkSpd", groundWalk <= 0d ? 0.1 : groundWalk);
set.set("baseSwimWalkSpd", parseDouble(attrs, "swim")); set.set("baseSwimWalkSpd", parseDouble(attrs, "swim"));
set.set("baseFlyWalkSpd", parseDouble(attrs, "fly")); set.set("baseFlyWalkSpd", parseDouble(attrs, "fly"));
break; break;
} }
case "run": case "run":
{ {
set.set("baseRunSpd", parseDouble(attrs, "ground")); final double runSpeed = parseDouble(attrs, "ground");
set.set("baseRunSpd", runSpeed <= 0d ? 0.1 : runSpeed);
set.set("baseSwimRunSpd", parseDouble(attrs, "swim")); set.set("baseSwimRunSpd", parseDouble(attrs, "swim"));
set.set("baseFlyRunSpd", parseDouble(attrs, "fly")); set.set("baseFlyRunSpd", parseDouble(attrs, "fly"));
break; break;

View File

@@ -174,7 +174,7 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
_flying = set.getBoolean("flying", false); _flying = set.getBoolean("flying", false);
_fakePlayer = set.getBoolean("fakePlayer", false); _fakePlayer = set.getBoolean("fakePlayer", false);
_fakePlayerTalkable = set.getBoolean("fakePlayerTalkable", true); _fakePlayerTalkable = set.getBoolean("fakePlayerTalkable", true);
_canMove = set.getBoolean("canMove", true); _canMove = (set.getDouble("baseWalkSpd", 1d) <= 0.1) || set.getBoolean("canMove", true);
_noSleepMode = set.getBoolean("noSleepMode", false); _noSleepMode = set.getBoolean("noSleepMode", false);
_passableDoor = set.getBoolean("passableDoor", false); _passableDoor = set.getBoolean("passableDoor", false);
_hasSummoner = set.getBoolean("hasSummoner", false); _hasSummoner = set.getBoolean("hasSummoner", false);

View File

@@ -275,14 +275,16 @@ public class NpcData implements IXmlReader
{ {
case "walk": case "walk":
{ {
set.set("baseWalkSpd", parseDouble(attrs, "ground")); final double groundWalk = parseDouble(attrs, "ground");
set.set("baseWalkSpd", groundWalk <= 0d ? 0.1 : groundWalk);
set.set("baseSwimWalkSpd", parseDouble(attrs, "swim")); set.set("baseSwimWalkSpd", parseDouble(attrs, "swim"));
set.set("baseFlyWalkSpd", parseDouble(attrs, "fly")); set.set("baseFlyWalkSpd", parseDouble(attrs, "fly"));
break; break;
} }
case "run": case "run":
{ {
set.set("baseRunSpd", parseDouble(attrs, "ground")); final double runSpeed = parseDouble(attrs, "ground");
set.set("baseRunSpd", runSpeed <= 0d ? 0.1 : runSpeed);
set.set("baseSwimRunSpd", parseDouble(attrs, "swim")); set.set("baseSwimRunSpd", parseDouble(attrs, "swim"));
set.set("baseFlyRunSpd", parseDouble(attrs, "fly")); set.set("baseFlyRunSpd", parseDouble(attrs, "fly"));
break; break;

View File

@@ -174,7 +174,7 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
_flying = set.getBoolean("flying", false); _flying = set.getBoolean("flying", false);
_fakePlayer = set.getBoolean("fakePlayer", false); _fakePlayer = set.getBoolean("fakePlayer", false);
_fakePlayerTalkable = set.getBoolean("fakePlayerTalkable", true); _fakePlayerTalkable = set.getBoolean("fakePlayerTalkable", true);
_canMove = set.getBoolean("canMove", true); _canMove = (set.getDouble("baseWalkSpd", 1d) <= 0.1) || set.getBoolean("canMove", true);
_noSleepMode = set.getBoolean("noSleepMode", false); _noSleepMode = set.getBoolean("noSleepMode", false);
_passableDoor = set.getBoolean("passableDoor", false); _passableDoor = set.getBoolean("passableDoor", false);
_hasSummoner = set.getBoolean("hasSummoner", false); _hasSummoner = set.getBoolean("hasSummoner", false);

View File

@@ -275,14 +275,16 @@ public class NpcData implements IXmlReader
{ {
case "walk": case "walk":
{ {
set.set("baseWalkSpd", parseDouble(attrs, "ground")); final double groundWalk = parseDouble(attrs, "ground");
set.set("baseWalkSpd", groundWalk <= 0d ? 0.1 : groundWalk);
set.set("baseSwimWalkSpd", parseDouble(attrs, "swim")); set.set("baseSwimWalkSpd", parseDouble(attrs, "swim"));
set.set("baseFlyWalkSpd", parseDouble(attrs, "fly")); set.set("baseFlyWalkSpd", parseDouble(attrs, "fly"));
break; break;
} }
case "run": case "run":
{ {
set.set("baseRunSpd", parseDouble(attrs, "ground")); final double runSpeed = parseDouble(attrs, "ground");
set.set("baseRunSpd", runSpeed <= 0d ? 0.1 : runSpeed);
set.set("baseSwimRunSpd", parseDouble(attrs, "swim")); set.set("baseSwimRunSpd", parseDouble(attrs, "swim"));
set.set("baseFlyRunSpd", parseDouble(attrs, "fly")); set.set("baseFlyRunSpd", parseDouble(attrs, "fly"));
break; break;

View File

@@ -174,7 +174,7 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
_flying = set.getBoolean("flying", false); _flying = set.getBoolean("flying", false);
_fakePlayer = set.getBoolean("fakePlayer", false); _fakePlayer = set.getBoolean("fakePlayer", false);
_fakePlayerTalkable = set.getBoolean("fakePlayerTalkable", true); _fakePlayerTalkable = set.getBoolean("fakePlayerTalkable", true);
_canMove = set.getBoolean("canMove", true); _canMove = (set.getDouble("baseWalkSpd", 1d) <= 0.1) || set.getBoolean("canMove", true);
_noSleepMode = set.getBoolean("noSleepMode", false); _noSleepMode = set.getBoolean("noSleepMode", false);
_passableDoor = set.getBoolean("passableDoor", false); _passableDoor = set.getBoolean("passableDoor", false);
_hasSummoner = set.getBoolean("hasSummoner", false); _hasSummoner = set.getBoolean("hasSummoner", false);

View File

@@ -275,14 +275,16 @@ public class NpcData implements IXmlReader
{ {
case "walk": case "walk":
{ {
set.set("baseWalkSpd", parseDouble(attrs, "ground")); final double groundWalk = parseDouble(attrs, "ground");
set.set("baseWalkSpd", groundWalk <= 0d ? 0.1 : groundWalk);
set.set("baseSwimWalkSpd", parseDouble(attrs, "swim")); set.set("baseSwimWalkSpd", parseDouble(attrs, "swim"));
set.set("baseFlyWalkSpd", parseDouble(attrs, "fly")); set.set("baseFlyWalkSpd", parseDouble(attrs, "fly"));
break; break;
} }
case "run": case "run":
{ {
set.set("baseRunSpd", parseDouble(attrs, "ground")); final double runSpeed = parseDouble(attrs, "ground");
set.set("baseRunSpd", runSpeed <= 0d ? 0.1 : runSpeed);
set.set("baseSwimRunSpd", parseDouble(attrs, "swim")); set.set("baseSwimRunSpd", parseDouble(attrs, "swim"));
set.set("baseFlyRunSpd", parseDouble(attrs, "fly")); set.set("baseFlyRunSpd", parseDouble(attrs, "fly"));
break; break;

View File

@@ -174,7 +174,7 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
_flying = set.getBoolean("flying", false); _flying = set.getBoolean("flying", false);
_fakePlayer = set.getBoolean("fakePlayer", false); _fakePlayer = set.getBoolean("fakePlayer", false);
_fakePlayerTalkable = set.getBoolean("fakePlayerTalkable", true); _fakePlayerTalkable = set.getBoolean("fakePlayerTalkable", true);
_canMove = set.getBoolean("canMove", true); _canMove = (set.getDouble("baseWalkSpd", 1d) <= 0.1) || set.getBoolean("canMove", true);
_noSleepMode = set.getBoolean("noSleepMode", false); _noSleepMode = set.getBoolean("noSleepMode", false);
_passableDoor = set.getBoolean("passableDoor", false); _passableDoor = set.getBoolean("passableDoor", false);
_hasSummoner = set.getBoolean("hasSummoner", false); _hasSummoner = set.getBoolean("hasSummoner", false);

View File

@@ -275,14 +275,16 @@ public class NpcData implements IXmlReader
{ {
case "walk": case "walk":
{ {
set.set("baseWalkSpd", parseDouble(attrs, "ground")); final double groundWalk = parseDouble(attrs, "ground");
set.set("baseWalkSpd", groundWalk <= 0d ? 0.1 : groundWalk);
set.set("baseSwimWalkSpd", parseDouble(attrs, "swim")); set.set("baseSwimWalkSpd", parseDouble(attrs, "swim"));
set.set("baseFlyWalkSpd", parseDouble(attrs, "fly")); set.set("baseFlyWalkSpd", parseDouble(attrs, "fly"));
break; break;
} }
case "run": case "run":
{ {
set.set("baseRunSpd", parseDouble(attrs, "ground")); final double runSpeed = parseDouble(attrs, "ground");
set.set("baseRunSpd", runSpeed <= 0d ? 0.1 : runSpeed);
set.set("baseSwimRunSpd", parseDouble(attrs, "swim")); set.set("baseSwimRunSpd", parseDouble(attrs, "swim"));
set.set("baseFlyRunSpd", parseDouble(attrs, "fly")); set.set("baseFlyRunSpd", parseDouble(attrs, "fly"));
break; break;

View File

@@ -174,7 +174,7 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
_flying = set.getBoolean("flying", false); _flying = set.getBoolean("flying", false);
_fakePlayer = set.getBoolean("fakePlayer", false); _fakePlayer = set.getBoolean("fakePlayer", false);
_fakePlayerTalkable = set.getBoolean("fakePlayerTalkable", true); _fakePlayerTalkable = set.getBoolean("fakePlayerTalkable", true);
_canMove = set.getBoolean("canMove", true); _canMove = (set.getDouble("baseWalkSpd", 1d) <= 0.1) || set.getBoolean("canMove", true);
_noSleepMode = set.getBoolean("noSleepMode", false); _noSleepMode = set.getBoolean("noSleepMode", false);
_passableDoor = set.getBoolean("passableDoor", false); _passableDoor = set.getBoolean("passableDoor", false);
_hasSummoner = set.getBoolean("hasSummoner", false); _hasSummoner = set.getBoolean("hasSummoner", false);

View File

@@ -275,14 +275,16 @@ public class NpcData implements IXmlReader
{ {
case "walk": case "walk":
{ {
set.set("baseWalkSpd", parseDouble(attrs, "ground")); final double groundWalk = parseDouble(attrs, "ground");
set.set("baseWalkSpd", groundWalk <= 0d ? 0.1 : groundWalk);
set.set("baseSwimWalkSpd", parseDouble(attrs, "swim")); set.set("baseSwimWalkSpd", parseDouble(attrs, "swim"));
set.set("baseFlyWalkSpd", parseDouble(attrs, "fly")); set.set("baseFlyWalkSpd", parseDouble(attrs, "fly"));
break; break;
} }
case "run": case "run":
{ {
set.set("baseRunSpd", parseDouble(attrs, "ground")); final double runSpeed = parseDouble(attrs, "ground");
set.set("baseRunSpd", runSpeed <= 0d ? 0.1 : runSpeed);
set.set("baseSwimRunSpd", parseDouble(attrs, "swim")); set.set("baseSwimRunSpd", parseDouble(attrs, "swim"));
set.set("baseFlyRunSpd", parseDouble(attrs, "fly")); set.set("baseFlyRunSpd", parseDouble(attrs, "fly"));
break; break;

View File

@@ -174,7 +174,7 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
_flying = set.getBoolean("flying", false); _flying = set.getBoolean("flying", false);
_fakePlayer = set.getBoolean("fakePlayer", false); _fakePlayer = set.getBoolean("fakePlayer", false);
_fakePlayerTalkable = set.getBoolean("fakePlayerTalkable", true); _fakePlayerTalkable = set.getBoolean("fakePlayerTalkable", true);
_canMove = set.getBoolean("canMove", true); _canMove = (set.getDouble("baseWalkSpd", 1d) <= 0.1) || set.getBoolean("canMove", true);
_noSleepMode = set.getBoolean("noSleepMode", false); _noSleepMode = set.getBoolean("noSleepMode", false);
_passableDoor = set.getBoolean("passableDoor", false); _passableDoor = set.getBoolean("passableDoor", false);
_hasSummoner = set.getBoolean("hasSummoner", false); _hasSummoner = set.getBoolean("hasSummoner", false);

View File

@@ -275,14 +275,16 @@ public class NpcData implements IXmlReader
{ {
case "walk": case "walk":
{ {
set.set("baseWalkSpd", parseDouble(attrs, "ground")); final double groundWalk = parseDouble(attrs, "ground");
set.set("baseWalkSpd", groundWalk <= 0d ? 0.1 : groundWalk);
set.set("baseSwimWalkSpd", parseDouble(attrs, "swim")); set.set("baseSwimWalkSpd", parseDouble(attrs, "swim"));
set.set("baseFlyWalkSpd", parseDouble(attrs, "fly")); set.set("baseFlyWalkSpd", parseDouble(attrs, "fly"));
break; break;
} }
case "run": case "run":
{ {
set.set("baseRunSpd", parseDouble(attrs, "ground")); final double runSpeed = parseDouble(attrs, "ground");
set.set("baseRunSpd", runSpeed <= 0d ? 0.1 : runSpeed);
set.set("baseSwimRunSpd", parseDouble(attrs, "swim")); set.set("baseSwimRunSpd", parseDouble(attrs, "swim"));
set.set("baseFlyRunSpd", parseDouble(attrs, "fly")); set.set("baseFlyRunSpd", parseDouble(attrs, "fly"));
break; break;

View File

@@ -174,7 +174,7 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
_flying = set.getBoolean("flying", false); _flying = set.getBoolean("flying", false);
_fakePlayer = set.getBoolean("fakePlayer", false); _fakePlayer = set.getBoolean("fakePlayer", false);
_fakePlayerTalkable = set.getBoolean("fakePlayerTalkable", true); _fakePlayerTalkable = set.getBoolean("fakePlayerTalkable", true);
_canMove = set.getBoolean("canMove", true); _canMove = (set.getDouble("baseWalkSpd", 1d) <= 0.1) || set.getBoolean("canMove", true);
_noSleepMode = set.getBoolean("noSleepMode", false); _noSleepMode = set.getBoolean("noSleepMode", false);
_passableDoor = set.getBoolean("passableDoor", false); _passableDoor = set.getBoolean("passableDoor", false);
_hasSummoner = set.getBoolean("hasSummoner", false); _hasSummoner = set.getBoolean("hasSummoner", false);

View File

@@ -275,14 +275,16 @@ public class NpcData implements IXmlReader
{ {
case "walk": case "walk":
{ {
set.set("baseWalkSpd", parseDouble(attrs, "ground")); final double groundWalk = parseDouble(attrs, "ground");
set.set("baseWalkSpd", groundWalk <= 0d ? 0.1 : groundWalk);
set.set("baseSwimWalkSpd", parseDouble(attrs, "swim")); set.set("baseSwimWalkSpd", parseDouble(attrs, "swim"));
set.set("baseFlyWalkSpd", parseDouble(attrs, "fly")); set.set("baseFlyWalkSpd", parseDouble(attrs, "fly"));
break; break;
} }
case "run": case "run":
{ {
set.set("baseRunSpd", parseDouble(attrs, "ground")); final double runSpeed = parseDouble(attrs, "ground");
set.set("baseRunSpd", runSpeed <= 0d ? 0.1 : runSpeed);
set.set("baseSwimRunSpd", parseDouble(attrs, "swim")); set.set("baseSwimRunSpd", parseDouble(attrs, "swim"));
set.set("baseFlyRunSpd", parseDouble(attrs, "fly")); set.set("baseFlyRunSpd", parseDouble(attrs, "fly"));
break; break;

View File

@@ -174,7 +174,7 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
_flying = set.getBoolean("flying", false); _flying = set.getBoolean("flying", false);
_fakePlayer = set.getBoolean("fakePlayer", false); _fakePlayer = set.getBoolean("fakePlayer", false);
_fakePlayerTalkable = set.getBoolean("fakePlayerTalkable", true); _fakePlayerTalkable = set.getBoolean("fakePlayerTalkable", true);
_canMove = set.getBoolean("canMove", true); _canMove = (set.getDouble("baseWalkSpd", 1d) <= 0.1) || set.getBoolean("canMove", true);
_noSleepMode = set.getBoolean("noSleepMode", false); _noSleepMode = set.getBoolean("noSleepMode", false);
_passableDoor = set.getBoolean("passableDoor", false); _passableDoor = set.getBoolean("passableDoor", false);
_hasSummoner = set.getBoolean("hasSummoner", false); _hasSummoner = set.getBoolean("hasSummoner", false);

View File

@@ -275,14 +275,16 @@ public class NpcData implements IXmlReader
{ {
case "walk": case "walk":
{ {
set.set("baseWalkSpd", parseDouble(attrs, "ground")); final double groundWalk = parseDouble(attrs, "ground");
set.set("baseWalkSpd", groundWalk <= 0d ? 0.1 : groundWalk);
set.set("baseSwimWalkSpd", parseDouble(attrs, "swim")); set.set("baseSwimWalkSpd", parseDouble(attrs, "swim"));
set.set("baseFlyWalkSpd", parseDouble(attrs, "fly")); set.set("baseFlyWalkSpd", parseDouble(attrs, "fly"));
break; break;
} }
case "run": case "run":
{ {
set.set("baseRunSpd", parseDouble(attrs, "ground")); final double runSpeed = parseDouble(attrs, "ground");
set.set("baseRunSpd", runSpeed <= 0d ? 0.1 : runSpeed);
set.set("baseSwimRunSpd", parseDouble(attrs, "swim")); set.set("baseSwimRunSpd", parseDouble(attrs, "swim"));
set.set("baseFlyRunSpd", parseDouble(attrs, "fly")); set.set("baseFlyRunSpd", parseDouble(attrs, "fly"));
break; break;

View File

@@ -174,7 +174,7 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
_flying = set.getBoolean("flying", false); _flying = set.getBoolean("flying", false);
_fakePlayer = set.getBoolean("fakePlayer", false); _fakePlayer = set.getBoolean("fakePlayer", false);
_fakePlayerTalkable = set.getBoolean("fakePlayerTalkable", true); _fakePlayerTalkable = set.getBoolean("fakePlayerTalkable", true);
_canMove = set.getBoolean("canMove", true); _canMove = (set.getDouble("baseWalkSpd", 1d) <= 0.1) || set.getBoolean("canMove", true);
_noSleepMode = set.getBoolean("noSleepMode", false); _noSleepMode = set.getBoolean("noSleepMode", false);
_passableDoor = set.getBoolean("passableDoor", false); _passableDoor = set.getBoolean("passableDoor", false);
_hasSummoner = set.getBoolean("hasSummoner", false); _hasSummoner = set.getBoolean("hasSummoner", false);

View File

@@ -275,14 +275,16 @@ public class NpcData implements IXmlReader
{ {
case "walk": case "walk":
{ {
set.set("baseWalkSpd", parseDouble(attrs, "ground")); final double groundWalk = parseDouble(attrs, "ground");
set.set("baseWalkSpd", groundWalk <= 0d ? 0.1 : groundWalk);
set.set("baseSwimWalkSpd", parseDouble(attrs, "swim")); set.set("baseSwimWalkSpd", parseDouble(attrs, "swim"));
set.set("baseFlyWalkSpd", parseDouble(attrs, "fly")); set.set("baseFlyWalkSpd", parseDouble(attrs, "fly"));
break; break;
} }
case "run": case "run":
{ {
set.set("baseRunSpd", parseDouble(attrs, "ground")); final double runSpeed = parseDouble(attrs, "ground");
set.set("baseRunSpd", runSpeed <= 0d ? 0.1 : runSpeed);
set.set("baseSwimRunSpd", parseDouble(attrs, "swim")); set.set("baseSwimRunSpd", parseDouble(attrs, "swim"));
set.set("baseFlyRunSpd", parseDouble(attrs, "fly")); set.set("baseFlyRunSpd", parseDouble(attrs, "fly"));
break; break;

View File

@@ -174,7 +174,7 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
_flying = set.getBoolean("flying", false); _flying = set.getBoolean("flying", false);
_fakePlayer = set.getBoolean("fakePlayer", false); _fakePlayer = set.getBoolean("fakePlayer", false);
_fakePlayerTalkable = set.getBoolean("fakePlayerTalkable", true); _fakePlayerTalkable = set.getBoolean("fakePlayerTalkable", true);
_canMove = set.getBoolean("canMove", true); _canMove = (set.getDouble("baseWalkSpd", 1d) <= 0.1) || set.getBoolean("canMove", true);
_noSleepMode = set.getBoolean("noSleepMode", false); _noSleepMode = set.getBoolean("noSleepMode", false);
_passableDoor = set.getBoolean("passableDoor", false); _passableDoor = set.getBoolean("passableDoor", false);
_hasSummoner = set.getBoolean("hasSummoner", false); _hasSummoner = set.getBoolean("hasSummoner", false);

View File

@@ -296,14 +296,16 @@ public class NpcData implements IXmlReader
{ {
case "walk": case "walk":
{ {
set.set("baseWalkSpd", parseDouble(attrs, "ground")); final double groundWalk = parseDouble(attrs, "ground");
set.set("baseWalkSpd", groundWalk <= 0d ? 0.1 : groundWalk);
set.set("baseSwimWalkSpd", parseDouble(attrs, "swim")); set.set("baseSwimWalkSpd", parseDouble(attrs, "swim"));
set.set("baseFlyWalkSpd", parseDouble(attrs, "fly")); set.set("baseFlyWalkSpd", parseDouble(attrs, "fly"));
break; break;
} }
case "run": case "run":
{ {
set.set("baseRunSpd", parseDouble(attrs, "ground")); final double runSpeed = parseDouble(attrs, "ground");
set.set("baseRunSpd", runSpeed <= 0d ? 0.1 : runSpeed);
set.set("baseSwimRunSpd", parseDouble(attrs, "swim")); set.set("baseSwimRunSpd", parseDouble(attrs, "swim"));
set.set("baseFlyRunSpd", parseDouble(attrs, "fly")); set.set("baseFlyRunSpd", parseDouble(attrs, "fly"));
break; break;

View File

@@ -150,7 +150,7 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
_flying = set.getBoolean("flying", false); _flying = set.getBoolean("flying", false);
_fakePlayer = set.getBoolean("fakePlayer", false); _fakePlayer = set.getBoolean("fakePlayer", false);
_fakePlayerTalkable = set.getBoolean("fakePlayerTalkable", true); _fakePlayerTalkable = set.getBoolean("fakePlayerTalkable", true);
_canMove = set.getBoolean("canMove", true); _canMove = (set.getDouble("baseWalkSpd", 1d) <= 0.1) || set.getBoolean("canMove", true);
_noSleepMode = set.getBoolean("noSleepMode", false); _noSleepMode = set.getBoolean("noSleepMode", false);
_passableDoor = set.getBoolean("passableDoor", false); _passableDoor = set.getBoolean("passableDoor", false);
_hasSummoner = set.getBoolean("hasSummoner", false); _hasSummoner = set.getBoolean("hasSummoner", false);

View File

@@ -296,14 +296,16 @@ public class NpcData implements IXmlReader
{ {
case "walk": case "walk":
{ {
set.set("baseWalkSpd", parseDouble(attrs, "ground")); final double groundWalk = parseDouble(attrs, "ground");
set.set("baseWalkSpd", groundWalk <= 0d ? 0.1 : groundWalk);
set.set("baseSwimWalkSpd", parseDouble(attrs, "swim")); set.set("baseSwimWalkSpd", parseDouble(attrs, "swim"));
set.set("baseFlyWalkSpd", parseDouble(attrs, "fly")); set.set("baseFlyWalkSpd", parseDouble(attrs, "fly"));
break; break;
} }
case "run": case "run":
{ {
set.set("baseRunSpd", parseDouble(attrs, "ground")); final double runSpeed = parseDouble(attrs, "ground");
set.set("baseRunSpd", runSpeed <= 0d ? 0.1 : runSpeed);
set.set("baseSwimRunSpd", parseDouble(attrs, "swim")); set.set("baseSwimRunSpd", parseDouble(attrs, "swim"));
set.set("baseFlyRunSpd", parseDouble(attrs, "fly")); set.set("baseFlyRunSpd", parseDouble(attrs, "fly"));
break; break;

View File

@@ -150,7 +150,7 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
_flying = set.getBoolean("flying", false); _flying = set.getBoolean("flying", false);
_fakePlayer = set.getBoolean("fakePlayer", false); _fakePlayer = set.getBoolean("fakePlayer", false);
_fakePlayerTalkable = set.getBoolean("fakePlayerTalkable", true); _fakePlayerTalkable = set.getBoolean("fakePlayerTalkable", true);
_canMove = set.getBoolean("canMove", true); _canMove = (set.getDouble("baseWalkSpd", 1d) <= 0.1) || set.getBoolean("canMove", true);
_noSleepMode = set.getBoolean("noSleepMode", false); _noSleepMode = set.getBoolean("noSleepMode", false);
_passableDoor = set.getBoolean("passableDoor", false); _passableDoor = set.getBoolean("passableDoor", false);
_hasSummoner = set.getBoolean("hasSummoner", false); _hasSummoner = set.getBoolean("hasSummoner", false);

View File

@@ -296,14 +296,16 @@ public class NpcData implements IXmlReader
{ {
case "walk": case "walk":
{ {
set.set("baseWalkSpd", parseDouble(attrs, "ground")); final double groundWalk = parseDouble(attrs, "ground");
set.set("baseWalkSpd", groundWalk <= 0d ? 0.1 : groundWalk);
set.set("baseSwimWalkSpd", parseDouble(attrs, "swim")); set.set("baseSwimWalkSpd", parseDouble(attrs, "swim"));
set.set("baseFlyWalkSpd", parseDouble(attrs, "fly")); set.set("baseFlyWalkSpd", parseDouble(attrs, "fly"));
break; break;
} }
case "run": case "run":
{ {
set.set("baseRunSpd", parseDouble(attrs, "ground")); final double runSpeed = parseDouble(attrs, "ground");
set.set("baseRunSpd", runSpeed <= 0d ? 0.1 : runSpeed);
set.set("baseSwimRunSpd", parseDouble(attrs, "swim")); set.set("baseSwimRunSpd", parseDouble(attrs, "swim"));
set.set("baseFlyRunSpd", parseDouble(attrs, "fly")); set.set("baseFlyRunSpd", parseDouble(attrs, "fly"));
break; break;

View File

@@ -150,7 +150,7 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
_flying = set.getBoolean("flying", false); _flying = set.getBoolean("flying", false);
_fakePlayer = set.getBoolean("fakePlayer", false); _fakePlayer = set.getBoolean("fakePlayer", false);
_fakePlayerTalkable = set.getBoolean("fakePlayerTalkable", true); _fakePlayerTalkable = set.getBoolean("fakePlayerTalkable", true);
_canMove = set.getBoolean("canMove", true); _canMove = (set.getDouble("baseWalkSpd", 1d) <= 0.1) || set.getBoolean("canMove", true);
_noSleepMode = set.getBoolean("noSleepMode", false); _noSleepMode = set.getBoolean("noSleepMode", false);
_passableDoor = set.getBoolean("passableDoor", false); _passableDoor = set.getBoolean("passableDoor", false);
_hasSummoner = set.getBoolean("hasSummoner", false); _hasSummoner = set.getBoolean("hasSummoner", false);

View File

@@ -275,14 +275,16 @@ public class NpcData implements IXmlReader
{ {
case "walk": case "walk":
{ {
set.set("baseWalkSpd", parseDouble(attrs, "ground")); final double groundWalk = parseDouble(attrs, "ground");
set.set("baseWalkSpd", groundWalk <= 0d ? 0.1 : groundWalk);
set.set("baseSwimWalkSpd", parseDouble(attrs, "swim")); set.set("baseSwimWalkSpd", parseDouble(attrs, "swim"));
set.set("baseFlyWalkSpd", parseDouble(attrs, "fly")); set.set("baseFlyWalkSpd", parseDouble(attrs, "fly"));
break; break;
} }
case "run": case "run":
{ {
set.set("baseRunSpd", parseDouble(attrs, "ground")); final double runSpeed = parseDouble(attrs, "ground");
set.set("baseRunSpd", runSpeed <= 0d ? 0.1 : runSpeed);
set.set("baseSwimRunSpd", parseDouble(attrs, "swim")); set.set("baseSwimRunSpd", parseDouble(attrs, "swim"));
set.set("baseFlyRunSpd", parseDouble(attrs, "fly")); set.set("baseFlyRunSpd", parseDouble(attrs, "fly"));
break; break;

View File

@@ -174,7 +174,7 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
_flying = set.getBoolean("flying", false); _flying = set.getBoolean("flying", false);
_fakePlayer = set.getBoolean("fakePlayer", false); _fakePlayer = set.getBoolean("fakePlayer", false);
_fakePlayerTalkable = set.getBoolean("fakePlayerTalkable", true); _fakePlayerTalkable = set.getBoolean("fakePlayerTalkable", true);
_canMove = set.getBoolean("canMove", true); _canMove = (set.getDouble("baseWalkSpd", 1d) <= 0.1) || set.getBoolean("canMove", true);
_noSleepMode = set.getBoolean("noSleepMode", false); _noSleepMode = set.getBoolean("noSleepMode", false);
_passableDoor = set.getBoolean("passableDoor", false); _passableDoor = set.getBoolean("passableDoor", false);
_hasSummoner = set.getBoolean("hasSummoner", false); _hasSummoner = set.getBoolean("hasSummoner", false);

View File

@@ -275,14 +275,16 @@ public class NpcData implements IXmlReader
{ {
case "walk": case "walk":
{ {
set.set("baseWalkSpd", parseDouble(attrs, "ground")); final double groundWalk = parseDouble(attrs, "ground");
set.set("baseWalkSpd", groundWalk <= 0d ? 0.1 : groundWalk);
set.set("baseSwimWalkSpd", parseDouble(attrs, "swim")); set.set("baseSwimWalkSpd", parseDouble(attrs, "swim"));
set.set("baseFlyWalkSpd", parseDouble(attrs, "fly")); set.set("baseFlyWalkSpd", parseDouble(attrs, "fly"));
break; break;
} }
case "run": case "run":
{ {
set.set("baseRunSpd", parseDouble(attrs, "ground")); final double runSpeed = parseDouble(attrs, "ground");
set.set("baseRunSpd", runSpeed <= 0d ? 0.1 : runSpeed);
set.set("baseSwimRunSpd", parseDouble(attrs, "swim")); set.set("baseSwimRunSpd", parseDouble(attrs, "swim"));
set.set("baseFlyRunSpd", parseDouble(attrs, "fly")); set.set("baseFlyRunSpd", parseDouble(attrs, "fly"));
break; break;

View File

@@ -175,7 +175,7 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
_flying = set.getBoolean("flying", false); _flying = set.getBoolean("flying", false);
_fakePlayer = set.getBoolean("fakePlayer", false); _fakePlayer = set.getBoolean("fakePlayer", false);
_fakePlayerTalkable = set.getBoolean("fakePlayerTalkable", true); _fakePlayerTalkable = set.getBoolean("fakePlayerTalkable", true);
_canMove = set.getBoolean("canMove", true); _canMove = (set.getDouble("baseWalkSpd", 1d) <= 0.1) || set.getBoolean("canMove", true);
_noSleepMode = set.getBoolean("noSleepMode", false); _noSleepMode = set.getBoolean("noSleepMode", false);
_passableDoor = set.getBoolean("passableDoor", false); _passableDoor = set.getBoolean("passableDoor", false);
_hasSummoner = set.getBoolean("hasSummoner", false); _hasSummoner = set.getBoolean("hasSummoner", false);

View File

@@ -275,14 +275,16 @@ public class NpcData implements IXmlReader
{ {
case "walk": case "walk":
{ {
set.set("baseWalkSpd", parseDouble(attrs, "ground")); final double groundWalk = parseDouble(attrs, "ground");
set.set("baseWalkSpd", groundWalk <= 0d ? 0.1 : groundWalk);
set.set("baseSwimWalkSpd", parseDouble(attrs, "swim")); set.set("baseSwimWalkSpd", parseDouble(attrs, "swim"));
set.set("baseFlyWalkSpd", parseDouble(attrs, "fly")); set.set("baseFlyWalkSpd", parseDouble(attrs, "fly"));
break; break;
} }
case "run": case "run":
{ {
set.set("baseRunSpd", parseDouble(attrs, "ground")); final double runSpeed = parseDouble(attrs, "ground");
set.set("baseRunSpd", runSpeed <= 0d ? 0.1 : runSpeed);
set.set("baseSwimRunSpd", parseDouble(attrs, "swim")); set.set("baseSwimRunSpd", parseDouble(attrs, "swim"));
set.set("baseFlyRunSpd", parseDouble(attrs, "fly")); set.set("baseFlyRunSpd", parseDouble(attrs, "fly"));
break; break;

View File

@@ -175,7 +175,7 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
_flying = set.getBoolean("flying", false); _flying = set.getBoolean("flying", false);
_fakePlayer = set.getBoolean("fakePlayer", false); _fakePlayer = set.getBoolean("fakePlayer", false);
_fakePlayerTalkable = set.getBoolean("fakePlayerTalkable", true); _fakePlayerTalkable = set.getBoolean("fakePlayerTalkable", true);
_canMove = set.getBoolean("canMove", true); _canMove = (set.getDouble("baseWalkSpd", 1d) <= 0.1) || set.getBoolean("canMove", true);
_noSleepMode = set.getBoolean("noSleepMode", false); _noSleepMode = set.getBoolean("noSleepMode", false);
_passableDoor = set.getBoolean("passableDoor", false); _passableDoor = set.getBoolean("passableDoor", false);
_hasSummoner = set.getBoolean("hasSummoner", false); _hasSummoner = set.getBoolean("hasSummoner", false);

View File

@@ -275,14 +275,16 @@ public class NpcData implements IXmlReader
{ {
case "walk": case "walk":
{ {
set.set("baseWalkSpd", parseDouble(attrs, "ground")); final double groundWalk = parseDouble(attrs, "ground");
set.set("baseWalkSpd", groundWalk <= 0d ? 0.1 : groundWalk);
set.set("baseSwimWalkSpd", parseDouble(attrs, "swim")); set.set("baseSwimWalkSpd", parseDouble(attrs, "swim"));
set.set("baseFlyWalkSpd", parseDouble(attrs, "fly")); set.set("baseFlyWalkSpd", parseDouble(attrs, "fly"));
break; break;
} }
case "run": case "run":
{ {
set.set("baseRunSpd", parseDouble(attrs, "ground")); final double runSpeed = parseDouble(attrs, "ground");
set.set("baseRunSpd", runSpeed <= 0d ? 0.1 : runSpeed);
set.set("baseSwimRunSpd", parseDouble(attrs, "swim")); set.set("baseSwimRunSpd", parseDouble(attrs, "swim"));
set.set("baseFlyRunSpd", parseDouble(attrs, "fly")); set.set("baseFlyRunSpd", parseDouble(attrs, "fly"));
break; break;

View File

@@ -175,7 +175,7 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
_flying = set.getBoolean("flying", false); _flying = set.getBoolean("flying", false);
_fakePlayer = set.getBoolean("fakePlayer", false); _fakePlayer = set.getBoolean("fakePlayer", false);
_fakePlayerTalkable = set.getBoolean("fakePlayerTalkable", true); _fakePlayerTalkable = set.getBoolean("fakePlayerTalkable", true);
_canMove = set.getBoolean("canMove", true); _canMove = (set.getDouble("baseWalkSpd", 1d) <= 0.1) || set.getBoolean("canMove", true);
_noSleepMode = set.getBoolean("noSleepMode", false); _noSleepMode = set.getBoolean("noSleepMode", false);
_passableDoor = set.getBoolean("passableDoor", false); _passableDoor = set.getBoolean("passableDoor", false);
_hasSummoner = set.getBoolean("hasSummoner", false); _hasSummoner = set.getBoolean("hasSummoner", false);

View File

@@ -275,14 +275,16 @@ public class NpcData implements IXmlReader
{ {
case "walk": case "walk":
{ {
set.set("baseWalkSpd", parseDouble(attrs, "ground")); final double groundWalk = parseDouble(attrs, "ground");
set.set("baseWalkSpd", groundWalk <= 0d ? 0.1 : groundWalk);
set.set("baseSwimWalkSpd", parseDouble(attrs, "swim")); set.set("baseSwimWalkSpd", parseDouble(attrs, "swim"));
set.set("baseFlyWalkSpd", parseDouble(attrs, "fly")); set.set("baseFlyWalkSpd", parseDouble(attrs, "fly"));
break; break;
} }
case "run": case "run":
{ {
set.set("baseRunSpd", parseDouble(attrs, "ground")); final double runSpeed = parseDouble(attrs, "ground");
set.set("baseRunSpd", runSpeed <= 0d ? 0.1 : runSpeed);
set.set("baseSwimRunSpd", parseDouble(attrs, "swim")); set.set("baseSwimRunSpd", parseDouble(attrs, "swim"));
set.set("baseFlyRunSpd", parseDouble(attrs, "fly")); set.set("baseFlyRunSpd", parseDouble(attrs, "fly"));
break; break;

View File

@@ -175,7 +175,7 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
_flying = set.getBoolean("flying", false); _flying = set.getBoolean("flying", false);
_fakePlayer = set.getBoolean("fakePlayer", false); _fakePlayer = set.getBoolean("fakePlayer", false);
_fakePlayerTalkable = set.getBoolean("fakePlayerTalkable", true); _fakePlayerTalkable = set.getBoolean("fakePlayerTalkable", true);
_canMove = set.getBoolean("canMove", true); _canMove = (set.getDouble("baseWalkSpd", 1d) <= 0.1) || set.getBoolean("canMove", true);
_noSleepMode = set.getBoolean("noSleepMode", false); _noSleepMode = set.getBoolean("noSleepMode", false);
_passableDoor = set.getBoolean("passableDoor", false); _passableDoor = set.getBoolean("passableDoor", false);
_hasSummoner = set.getBoolean("hasSummoner", false); _hasSummoner = set.getBoolean("hasSummoner", false);

View File

@@ -278,14 +278,16 @@ public class NpcData implements IXmlReader
{ {
case "walk": case "walk":
{ {
set.set("baseWalkSpd", parseDouble(attrs, "ground")); final double groundWalk = parseDouble(attrs, "ground");
set.set("baseWalkSpd", groundWalk <= 0d ? 0.1 : groundWalk);
set.set("baseSwimWalkSpd", parseDouble(attrs, "swim")); set.set("baseSwimWalkSpd", parseDouble(attrs, "swim"));
set.set("baseFlyWalkSpd", parseDouble(attrs, "fly")); set.set("baseFlyWalkSpd", parseDouble(attrs, "fly"));
break; break;
} }
case "run": case "run":
{ {
set.set("baseRunSpd", parseDouble(attrs, "ground")); final double runSpeed = parseDouble(attrs, "ground");
set.set("baseRunSpd", runSpeed <= 0d ? 0.1 : runSpeed);
set.set("baseSwimRunSpd", parseDouble(attrs, "swim")); set.set("baseSwimRunSpd", parseDouble(attrs, "swim"));
set.set("baseFlyRunSpd", parseDouble(attrs, "fly")); set.set("baseFlyRunSpd", parseDouble(attrs, "fly"));
break; break;

View File

@@ -180,7 +180,7 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
_flying = set.getBoolean("flying", false); _flying = set.getBoolean("flying", false);
_fakePlayer = set.getBoolean("fakePlayer", false); _fakePlayer = set.getBoolean("fakePlayer", false);
_fakePlayerTalkable = set.getBoolean("fakePlayerTalkable", true); _fakePlayerTalkable = set.getBoolean("fakePlayerTalkable", true);
_canMove = set.getBoolean("canMove", true); _canMove = (set.getDouble("baseWalkSpd", 1d) <= 0.1) || set.getBoolean("canMove", true);
_noSleepMode = set.getBoolean("noSleepMode", false); _noSleepMode = set.getBoolean("noSleepMode", false);
_passableDoor = set.getBoolean("passableDoor", false); _passableDoor = set.getBoolean("passableDoor", false);
_hasSummoner = set.getBoolean("hasSummoner", false); _hasSummoner = set.getBoolean("hasSummoner", false);

View File

@@ -278,14 +278,16 @@ public class NpcData implements IXmlReader
{ {
case "walk": case "walk":
{ {
set.set("baseWalkSpd", parseDouble(attrs, "ground")); final double groundWalk = parseDouble(attrs, "ground");
set.set("baseWalkSpd", groundWalk <= 0d ? 0.1 : groundWalk);
set.set("baseSwimWalkSpd", parseDouble(attrs, "swim")); set.set("baseSwimWalkSpd", parseDouble(attrs, "swim"));
set.set("baseFlyWalkSpd", parseDouble(attrs, "fly")); set.set("baseFlyWalkSpd", parseDouble(attrs, "fly"));
break; break;
} }
case "run": case "run":
{ {
set.set("baseRunSpd", parseDouble(attrs, "ground")); final double runSpeed = parseDouble(attrs, "ground");
set.set("baseRunSpd", runSpeed <= 0d ? 0.1 : runSpeed);
set.set("baseSwimRunSpd", parseDouble(attrs, "swim")); set.set("baseSwimRunSpd", parseDouble(attrs, "swim"));
set.set("baseFlyRunSpd", parseDouble(attrs, "fly")); set.set("baseFlyRunSpd", parseDouble(attrs, "fly"));
break; break;

View File

@@ -180,7 +180,7 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
_flying = set.getBoolean("flying", false); _flying = set.getBoolean("flying", false);
_fakePlayer = set.getBoolean("fakePlayer", false); _fakePlayer = set.getBoolean("fakePlayer", false);
_fakePlayerTalkable = set.getBoolean("fakePlayerTalkable", true); _fakePlayerTalkable = set.getBoolean("fakePlayerTalkable", true);
_canMove = set.getBoolean("canMove", true); _canMove = (set.getDouble("baseWalkSpd", 1d) <= 0.1) || set.getBoolean("canMove", true);
_noSleepMode = set.getBoolean("noSleepMode", false); _noSleepMode = set.getBoolean("noSleepMode", false);
_passableDoor = set.getBoolean("passableDoor", false); _passableDoor = set.getBoolean("passableDoor", false);
_hasSummoner = set.getBoolean("hasSummoner", false); _hasSummoner = set.getBoolean("hasSummoner", false);

View File

@@ -278,14 +278,16 @@ public class NpcData implements IXmlReader
{ {
case "walk": case "walk":
{ {
set.set("baseWalkSpd", parseDouble(attrs, "ground")); final double groundWalk = parseDouble(attrs, "ground");
set.set("baseWalkSpd", groundWalk <= 0d ? 0.1 : groundWalk);
set.set("baseSwimWalkSpd", parseDouble(attrs, "swim")); set.set("baseSwimWalkSpd", parseDouble(attrs, "swim"));
set.set("baseFlyWalkSpd", parseDouble(attrs, "fly")); set.set("baseFlyWalkSpd", parseDouble(attrs, "fly"));
break; break;
} }
case "run": case "run":
{ {
set.set("baseRunSpd", parseDouble(attrs, "ground")); final double runSpeed = parseDouble(attrs, "ground");
set.set("baseRunSpd", runSpeed <= 0d ? 0.1 : runSpeed);
set.set("baseSwimRunSpd", parseDouble(attrs, "swim")); set.set("baseSwimRunSpd", parseDouble(attrs, "swim"));
set.set("baseFlyRunSpd", parseDouble(attrs, "fly")); set.set("baseFlyRunSpd", parseDouble(attrs, "fly"));
break; break;

View File

@@ -180,7 +180,7 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
_flying = set.getBoolean("flying", false); _flying = set.getBoolean("flying", false);
_fakePlayer = set.getBoolean("fakePlayer", false); _fakePlayer = set.getBoolean("fakePlayer", false);
_fakePlayerTalkable = set.getBoolean("fakePlayerTalkable", true); _fakePlayerTalkable = set.getBoolean("fakePlayerTalkable", true);
_canMove = set.getBoolean("canMove", true); _canMove = (set.getDouble("baseWalkSpd", 1d) <= 0.1) || set.getBoolean("canMove", true);
_noSleepMode = set.getBoolean("noSleepMode", false); _noSleepMode = set.getBoolean("noSleepMode", false);
_passableDoor = set.getBoolean("passableDoor", false); _passableDoor = set.getBoolean("passableDoor", false);
_hasSummoner = set.getBoolean("hasSummoner", false); _hasSummoner = set.getBoolean("hasSummoner", false);

View File

@@ -278,14 +278,16 @@ public class NpcData implements IXmlReader
{ {
case "walk": case "walk":
{ {
set.set("baseWalkSpd", parseDouble(attrs, "ground")); final double groundWalk = parseDouble(attrs, "ground");
set.set("baseWalkSpd", groundWalk <= 0d ? 0.1 : groundWalk);
set.set("baseSwimWalkSpd", parseDouble(attrs, "swim")); set.set("baseSwimWalkSpd", parseDouble(attrs, "swim"));
set.set("baseFlyWalkSpd", parseDouble(attrs, "fly")); set.set("baseFlyWalkSpd", parseDouble(attrs, "fly"));
break; break;
} }
case "run": case "run":
{ {
set.set("baseRunSpd", parseDouble(attrs, "ground")); final double runSpeed = parseDouble(attrs, "ground");
set.set("baseRunSpd", runSpeed <= 0d ? 0.1 : runSpeed);
set.set("baseSwimRunSpd", parseDouble(attrs, "swim")); set.set("baseSwimRunSpd", parseDouble(attrs, "swim"));
set.set("baseFlyRunSpd", parseDouble(attrs, "fly")); set.set("baseFlyRunSpd", parseDouble(attrs, "fly"));
break; break;

View File

@@ -180,7 +180,7 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
_flying = set.getBoolean("flying", false); _flying = set.getBoolean("flying", false);
_fakePlayer = set.getBoolean("fakePlayer", false); _fakePlayer = set.getBoolean("fakePlayer", false);
_fakePlayerTalkable = set.getBoolean("fakePlayerTalkable", true); _fakePlayerTalkable = set.getBoolean("fakePlayerTalkable", true);
_canMove = set.getBoolean("canMove", true); _canMove = (set.getDouble("baseWalkSpd", 1d) <= 0.1) || set.getBoolean("canMove", true);
_noSleepMode = set.getBoolean("noSleepMode", false); _noSleepMode = set.getBoolean("noSleepMode", false);
_passableDoor = set.getBoolean("passableDoor", false); _passableDoor = set.getBoolean("passableDoor", false);
_hasSummoner = set.getBoolean("hasSummoner", false); _hasSummoner = set.getBoolean("hasSummoner", false);

View File

@@ -277,14 +277,16 @@ public class NpcData implements IXmlReader
{ {
case "walk": case "walk":
{ {
set.set("baseWalkSpd", parseDouble(attrs, "ground")); final double groundWalk = parseDouble(attrs, "ground");
set.set("baseWalkSpd", groundWalk <= 0d ? 0.1 : groundWalk);
set.set("baseSwimWalkSpd", parseDouble(attrs, "swim")); set.set("baseSwimWalkSpd", parseDouble(attrs, "swim"));
set.set("baseFlyWalkSpd", parseDouble(attrs, "fly")); set.set("baseFlyWalkSpd", parseDouble(attrs, "fly"));
break; break;
} }
case "run": case "run":
{ {
set.set("baseRunSpd", parseDouble(attrs, "ground")); final double runSpeed = parseDouble(attrs, "ground");
set.set("baseRunSpd", runSpeed <= 0d ? 0.1 : runSpeed);
set.set("baseSwimRunSpd", parseDouble(attrs, "swim")); set.set("baseSwimRunSpd", parseDouble(attrs, "swim"));
set.set("baseFlyRunSpd", parseDouble(attrs, "fly")); set.set("baseFlyRunSpd", parseDouble(attrs, "fly"));
break; break;

View File

@@ -174,7 +174,7 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
_flying = set.getBoolean("flying", false); _flying = set.getBoolean("flying", false);
_fakePlayer = set.getBoolean("fakePlayer", false); _fakePlayer = set.getBoolean("fakePlayer", false);
_fakePlayerTalkable = set.getBoolean("fakePlayerTalkable", true); _fakePlayerTalkable = set.getBoolean("fakePlayerTalkable", true);
_canMove = set.getBoolean("canMove", true); _canMove = (set.getDouble("baseWalkSpd", 1d) <= 0.1) || set.getBoolean("canMove", true);
_noSleepMode = set.getBoolean("noSleepMode", false); _noSleepMode = set.getBoolean("noSleepMode", false);
_passableDoor = set.getBoolean("passableDoor", false); _passableDoor = set.getBoolean("passableDoor", false);
_hasSummoner = set.getBoolean("hasSummoner", false); _hasSummoner = set.getBoolean("hasSummoner", false);

View File

@@ -279,14 +279,16 @@ public class NpcData implements IXmlReader
{ {
case "walk": case "walk":
{ {
set.set("baseWalkSpd", parseDouble(attrs, "ground")); final double groundWalk = parseDouble(attrs, "ground");
set.set("baseWalkSpd", groundWalk <= 0d ? 0.1 : groundWalk);
set.set("baseSwimWalkSpd", parseDouble(attrs, "swim")); set.set("baseSwimWalkSpd", parseDouble(attrs, "swim"));
set.set("baseFlyWalkSpd", parseDouble(attrs, "fly")); set.set("baseFlyWalkSpd", parseDouble(attrs, "fly"));
break; break;
} }
case "run": case "run":
{ {
set.set("baseRunSpd", parseDouble(attrs, "ground")); final double runSpeed = parseDouble(attrs, "ground");
set.set("baseRunSpd", runSpeed <= 0d ? 0.1 : runSpeed);
set.set("baseSwimRunSpd", parseDouble(attrs, "swim")); set.set("baseSwimRunSpd", parseDouble(attrs, "swim"));
set.set("baseFlyRunSpd", parseDouble(attrs, "fly")); set.set("baseFlyRunSpd", parseDouble(attrs, "fly"));
break; break;

View File

@@ -179,7 +179,7 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
_flying = set.getBoolean("flying", false); _flying = set.getBoolean("flying", false);
_fakePlayer = set.getBoolean("fakePlayer", false); _fakePlayer = set.getBoolean("fakePlayer", false);
_fakePlayerTalkable = set.getBoolean("fakePlayerTalkable", true); _fakePlayerTalkable = set.getBoolean("fakePlayerTalkable", true);
_canMove = set.getBoolean("canMove", true); _canMove = (set.getDouble("baseWalkSpd", 1d) <= 0.1) || set.getBoolean("canMove", true);
_noSleepMode = set.getBoolean("noSleepMode", false); _noSleepMode = set.getBoolean("noSleepMode", false);
_passableDoor = set.getBoolean("passableDoor", false); _passableDoor = set.getBoolean("passableDoor", false);
_hasSummoner = set.getBoolean("hasSummoner", false); _hasSummoner = set.getBoolean("hasSummoner", false);

View File

@@ -279,14 +279,16 @@ public class NpcData implements IXmlReader
{ {
case "walk": case "walk":
{ {
set.set("baseWalkSpd", parseDouble(attrs, "ground")); final double groundWalk = parseDouble(attrs, "ground");
set.set("baseWalkSpd", groundWalk <= 0d ? 0.1 : groundWalk);
set.set("baseSwimWalkSpd", parseDouble(attrs, "swim")); set.set("baseSwimWalkSpd", parseDouble(attrs, "swim"));
set.set("baseFlyWalkSpd", parseDouble(attrs, "fly")); set.set("baseFlyWalkSpd", parseDouble(attrs, "fly"));
break; break;
} }
case "run": case "run":
{ {
set.set("baseRunSpd", parseDouble(attrs, "ground")); final double runSpeed = parseDouble(attrs, "ground");
set.set("baseRunSpd", runSpeed <= 0d ? 0.1 : runSpeed);
set.set("baseSwimRunSpd", parseDouble(attrs, "swim")); set.set("baseSwimRunSpd", parseDouble(attrs, "swim"));
set.set("baseFlyRunSpd", parseDouble(attrs, "fly")); set.set("baseFlyRunSpd", parseDouble(attrs, "fly"));
break; break;

View File

@@ -179,7 +179,7 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
_flying = set.getBoolean("flying", false); _flying = set.getBoolean("flying", false);
_fakePlayer = set.getBoolean("fakePlayer", false); _fakePlayer = set.getBoolean("fakePlayer", false);
_fakePlayerTalkable = set.getBoolean("fakePlayerTalkable", true); _fakePlayerTalkable = set.getBoolean("fakePlayerTalkable", true);
_canMove = set.getBoolean("canMove", true); _canMove = (set.getDouble("baseWalkSpd", 1d) <= 0.1) || set.getBoolean("canMove", true);
_noSleepMode = set.getBoolean("noSleepMode", false); _noSleepMode = set.getBoolean("noSleepMode", false);
_passableDoor = set.getBoolean("passableDoor", false); _passableDoor = set.getBoolean("passableDoor", false);
_hasSummoner = set.getBoolean("hasSummoner", false); _hasSummoner = set.getBoolean("hasSummoner", false);

View File

@@ -279,14 +279,16 @@ public class NpcData implements IXmlReader
{ {
case "walk": case "walk":
{ {
set.set("baseWalkSpd", parseDouble(attrs, "ground")); final double groundWalk = parseDouble(attrs, "ground");
set.set("baseWalkSpd", groundWalk <= 0d ? 0.1 : groundWalk);
set.set("baseSwimWalkSpd", parseDouble(attrs, "swim")); set.set("baseSwimWalkSpd", parseDouble(attrs, "swim"));
set.set("baseFlyWalkSpd", parseDouble(attrs, "fly")); set.set("baseFlyWalkSpd", parseDouble(attrs, "fly"));
break; break;
} }
case "run": case "run":
{ {
set.set("baseRunSpd", parseDouble(attrs, "ground")); final double runSpeed = parseDouble(attrs, "ground");
set.set("baseRunSpd", runSpeed <= 0d ? 0.1 : runSpeed);
set.set("baseSwimRunSpd", parseDouble(attrs, "swim")); set.set("baseSwimRunSpd", parseDouble(attrs, "swim"));
set.set("baseFlyRunSpd", parseDouble(attrs, "fly")); set.set("baseFlyRunSpd", parseDouble(attrs, "fly"));
break; break;

View File

@@ -179,7 +179,7 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
_flying = set.getBoolean("flying", false); _flying = set.getBoolean("flying", false);
_fakePlayer = set.getBoolean("fakePlayer", false); _fakePlayer = set.getBoolean("fakePlayer", false);
_fakePlayerTalkable = set.getBoolean("fakePlayerTalkable", true); _fakePlayerTalkable = set.getBoolean("fakePlayerTalkable", true);
_canMove = set.getBoolean("canMove", true); _canMove = (set.getDouble("baseWalkSpd", 1d) <= 0.1) || set.getBoolean("canMove", true);
_noSleepMode = set.getBoolean("noSleepMode", false); _noSleepMode = set.getBoolean("noSleepMode", false);
_passableDoor = set.getBoolean("passableDoor", false); _passableDoor = set.getBoolean("passableDoor", false);
_hasSummoner = set.getBoolean("hasSummoner", false); _hasSummoner = set.getBoolean("hasSummoner", false);

View File

@@ -279,14 +279,16 @@ public class NpcData implements IXmlReader
{ {
case "walk": case "walk":
{ {
set.set("baseWalkSpd", parseDouble(attrs, "ground")); final double groundWalk = parseDouble(attrs, "ground");
set.set("baseWalkSpd", groundWalk <= 0d ? 0.1 : groundWalk);
set.set("baseSwimWalkSpd", parseDouble(attrs, "swim")); set.set("baseSwimWalkSpd", parseDouble(attrs, "swim"));
set.set("baseFlyWalkSpd", parseDouble(attrs, "fly")); set.set("baseFlyWalkSpd", parseDouble(attrs, "fly"));
break; break;
} }
case "run": case "run":
{ {
set.set("baseRunSpd", parseDouble(attrs, "ground")); final double runSpeed = parseDouble(attrs, "ground");
set.set("baseRunSpd", runSpeed <= 0d ? 0.1 : runSpeed);
set.set("baseSwimRunSpd", parseDouble(attrs, "swim")); set.set("baseSwimRunSpd", parseDouble(attrs, "swim"));
set.set("baseFlyRunSpd", parseDouble(attrs, "fly")); set.set("baseFlyRunSpd", parseDouble(attrs, "fly"));
break; break;

View File

@@ -179,7 +179,7 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
_flying = set.getBoolean("flying", false); _flying = set.getBoolean("flying", false);
_fakePlayer = set.getBoolean("fakePlayer", false); _fakePlayer = set.getBoolean("fakePlayer", false);
_fakePlayerTalkable = set.getBoolean("fakePlayerTalkable", true); _fakePlayerTalkable = set.getBoolean("fakePlayerTalkable", true);
_canMove = set.getBoolean("canMove", true); _canMove = (set.getDouble("baseWalkSpd", 1d) <= 0.1) || set.getBoolean("canMove", true);
_noSleepMode = set.getBoolean("noSleepMode", false); _noSleepMode = set.getBoolean("noSleepMode", false);
_passableDoor = set.getBoolean("passableDoor", false); _passableDoor = set.getBoolean("passableDoor", false);
_hasSummoner = set.getBoolean("hasSummoner", false); _hasSummoner = set.getBoolean("hasSummoner", false);