diff options
author | madmaxoft <github@xoft.cz> | 2014-03-06 13:24:28 +0100 |
---|---|---|
committer | madmaxoft <github@xoft.cz> | 2014-03-06 13:24:28 +0100 |
commit | 3e80e636653274d138c1c5c6551e81a267b4d467 (patch) | |
tree | 821b710200bdccbd68386a34b83a425f15ee9b7d /src/World.cpp | |
parent | Merge pull request #747 from mc-server/InfoDump_Github (diff) | |
parent | Implemented vanilla-like fluid simulator (diff) | |
download | cuberite-3e80e636653274d138c1c5c6551e81a267b4d467.tar cuberite-3e80e636653274d138c1c5c6551e81a267b4d467.tar.gz cuberite-3e80e636653274d138c1c5c6551e81a267b4d467.tar.bz2 cuberite-3e80e636653274d138c1c5c6551e81a267b4d467.tar.lz cuberite-3e80e636653274d138c1c5c6551e81a267b4d467.tar.xz cuberite-3e80e636653274d138c1c5c6551e81a267b4d467.tar.zst cuberite-3e80e636653274d138c1c5c6551e81a267b4d467.zip |
Diffstat (limited to 'src/World.cpp')
-rw-r--r-- | src/World.cpp | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/src/World.cpp b/src/World.cpp index 37c07b398..73157b5bf 100644 --- a/src/World.cpp +++ b/src/World.cpp @@ -34,6 +34,7 @@ #include "Simulator/NoopRedstoneSimulator.h" #include "Simulator/SandSimulator.h" #include "Simulator/IncrementalRedstoneSimulator.h" +#include "Simulator/VanillaFluidSimulator.h" #include "Simulator/VaporizeFluidSimulator.h" // Mobs: @@ -3053,8 +3054,8 @@ cFluidSimulator * cWorld::InitializeFluidSimulator(cIniFile & a_IniFile, const c AString SimulatorName = a_IniFile.GetValueSet("Physics", SimulatorNameKey, ""); if (SimulatorName.empty()) { - LOGWARNING("[Physics] %s not present or empty in %s, using the default of \"Floody\".", SimulatorNameKey.c_str(), GetIniFileName().c_str()); - SimulatorName = "Floody"; + LOGWARNING("[Physics] %s not present or empty in %s, using the default of \"Vanilla\".", SimulatorNameKey.c_str(), GetIniFileName().c_str()); + SimulatorName = "Vanilla"; } cFluidSimulator * res = NULL; @@ -3078,15 +3079,24 @@ cFluidSimulator * cWorld::InitializeFluidSimulator(cIniFile & a_IniFile, const c } else { - if (NoCaseCompare(SimulatorName, "floody") != 0) - { - // The simulator name doesn't match anything we have, issue a warning: - LOGWARNING("%s [Physics]:%s specifies an unknown simulator, using the default \"Floody\".", GetIniFileName().c_str(), SimulatorNameKey.c_str()); - } int Falloff = a_IniFile.GetValueSetI(SimulatorSectionName, "Falloff", IsWater ? 1 : 2); int TickDelay = a_IniFile.GetValueSetI(SimulatorSectionName, "TickDelay", IsWater ? 5 : 30); int NumNeighborsForSource = a_IniFile.GetValueSetI(SimulatorSectionName, "NumNeighborsForSource", IsWater ? 2 : -1); - res = new cFloodyFluidSimulator(*this, a_SimulateBlock, a_StationaryBlock, Falloff, TickDelay, NumNeighborsForSource); + + if (NoCaseCompare(SimulatorName, "floody") == 0) + { + res = new cFloodyFluidSimulator(*this, a_SimulateBlock, a_StationaryBlock, Falloff, TickDelay, NumNeighborsForSource); + } + else if (NoCaseCompare(SimulatorName, "vanilla") == 0) + { + res = new cVanillaFluidSimulator(*this, a_SimulateBlock, a_StationaryBlock, Falloff, TickDelay, NumNeighborsForSource); + } + else + { + // The simulator name doesn't match anything we have, issue a warning: + LOGWARNING("%s [Physics]:%s specifies an unknown simulator, using the default \"Vanilla\".", GetIniFileName().c_str(), SimulatorNameKey.c_str()); + res = new cVanillaFluidSimulator(*this, a_SimulateBlock, a_StationaryBlock, Falloff, TickDelay, NumNeighborsForSource); + } } m_SimulatorManager->RegisterSimulator(res, Rate); |