diff options
author | Howaner <franzi.moos@googlemail.com> | 2014-03-08 12:29:45 +0100 |
---|---|---|
committer | Howaner <franzi.moos@googlemail.com> | 2014-03-08 12:29:45 +0100 |
commit | 527f3585108111d915c2982b6be6a6adbb5ff4d9 (patch) | |
tree | 63b622d8d4840bed7c08d9afc279733d8b7e1c56 /src/World.cpp | |
parent | Change TNT Fuse to ticks (diff) | |
parent | Merge pull request #764 from xdot/master (diff) | |
download | cuberite-527f3585108111d915c2982b6be6a6adbb5ff4d9.tar cuberite-527f3585108111d915c2982b6be6a6adbb5ff4d9.tar.gz cuberite-527f3585108111d915c2982b6be6a6adbb5ff4d9.tar.bz2 cuberite-527f3585108111d915c2982b6be6a6adbb5ff4d9.tar.lz cuberite-527f3585108111d915c2982b6be6a6adbb5ff4d9.tar.xz cuberite-527f3585108111d915c2982b6be6a6adbb5ff4d9.tar.zst cuberite-527f3585108111d915c2982b6be6a6adbb5ff4d9.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 ebc37f7b2..e208cfe91 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: @@ -3062,8 +3063,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; @@ -3087,15 +3088,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); |