summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2014-03-10 19:35:02 +0100
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2014-03-10 19:35:02 +0100
commit462829e23d8d3404e58ffc64fd19cf39e9be218f (patch)
tree03967c04656bef031d5640a53163a72f236898bf
parentAdded extra awesomeness to TNT (diff)
downloadcuberite-462829e23d8d3404e58ffc64fd19cf39e9be218f.tar
cuberite-462829e23d8d3404e58ffc64fd19cf39e9be218f.tar.gz
cuberite-462829e23d8d3404e58ffc64fd19cf39e9be218f.tar.bz2
cuberite-462829e23d8d3404e58ffc64fd19cf39e9be218f.tar.lz
cuberite-462829e23d8d3404e58ffc64fd19cf39e9be218f.tar.xz
cuberite-462829e23d8d3404e58ffc64fd19cf39e9be218f.tar.zst
cuberite-462829e23d8d3404e58ffc64fd19cf39e9be218f.zip
Diffstat (limited to '')
-rw-r--r--src/ChunkMap.cpp2
-rw-r--r--src/World.cpp3
-rw-r--r--src/World.h6
3 files changed, 8 insertions, 3 deletions
diff --git a/src/ChunkMap.cpp b/src/ChunkMap.cpp
index b13337b44..e750ad731 100644
--- a/src/ChunkMap.cpp
+++ b/src/ChunkMap.cpp
@@ -1832,7 +1832,7 @@ void cChunkMap::DoExplosionAt(double a_ExplosionSize, double a_BlockX, double a_
Handler->ConvertToPickups(Drops, area.GetBlockMeta(bx + x, by + y, bz + z)); // Stone becomes cobblestone, coal ore becomes coal, etc.
m_World->SpawnItemPickups(Drops, bx + x, by + y, bz + z);
}
- else if (m_World->GetTickRandomNumber(100) < 20) // 20% chance of flinging stuff around
+ else if (m_World->IsTNTShrapnelEnabled() && (m_World->GetTickRandomNumber(100) < 20)) // 20% chance of flinging stuff around
{
if (!cBlockInfo::FullyOccupiesVoxel(area.GetBlockType(bx + x, by + y, bz + z)))
{
diff --git a/src/World.cpp b/src/World.cpp
index d6b88f187..89d0cf454 100644
--- a/src/World.cpp
+++ b/src/World.cpp
@@ -250,8 +250,6 @@ cWorld::cWorld(const AString & a_WorldName) :
m_SkyDarkness(0),
m_Weather(eWeather_Sunny),
m_WeatherInterval(24000), // Guaranteed 1 day of sunshine at server start :)
- m_bCommandBlocksEnabled(false),
- m_bUseChatPrefixes(true),
m_Scoreboard(this),
m_MapManager(this),
m_GeneratorCallbacks(*this),
@@ -554,6 +552,7 @@ void cWorld::Start(void)
m_IsSugarcaneBonemealable = IniFile.GetValueSetB("Plants", "IsSugarcaneBonemealable", false);
m_IsDeepSnowEnabled = IniFile.GetValueSetB("Physics", "DeepSnow", true);
m_ShouldLavaSpawnFire = IniFile.GetValueSetB("Physics", "ShouldLavaSpawnFire", true);
+ m_bTNTSpawnsShrapnel = IniFile.GetValueSetB("Physics", "IsTNTShrapnelEnabled", true);
m_bCommandBlocksEnabled = IniFile.GetValueSetB("Mechanics", "CommandBlocksEnabled", false);
m_bEnabledPVP = IniFile.GetValueSetB("Mechanics", "PVPEnabled", true);
m_bUseChatPrefixes = IniFile.GetValueSetB("Mechanics", "UseChatPrefixes", true);
diff --git a/src/World.h b/src/World.h
index 4b74f7aba..d7d5b5059 100644
--- a/src/World.h
+++ b/src/World.h
@@ -590,6 +590,9 @@ public:
bool AreCommandBlocksEnabled(void) const { return m_bCommandBlocksEnabled; }
void SetCommandBlocksEnabled(bool a_Flag) { m_bCommandBlocksEnabled = a_Flag; }
+ bool IsTNTShrapnelEnabled(void) const { return m_bTNTSpawnsShrapnel; }
+ void SetTNTShrapnelEnabled(bool a_Flag) { m_bTNTSpawnsShrapnel = a_Flag; }
+
bool ShouldUseChatPrefixes(void) const { return m_bUseChatPrefixes; }
void SetShouldUseChatPrefixes(bool a_Flag) { m_bUseChatPrefixes = a_Flag; }
@@ -847,6 +850,9 @@ private:
/** Whether prefixes such as [INFO] are prepended to SendMessageXXX() / BroadcastChatXXX() functions */
bool m_bUseChatPrefixes;
+
+ /** Whether TNT explosions, done via cWorld::DoExplosionAt(), should project random affected blocks as FallingBlock entities */
+ bool m_bTNTSpawnsShrapnel;
cChunkGenerator m_Generator;