summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--MCServer/Plugins/TestLuaRocks/TestLuaRocks.lua49
m---------MCServer/Plugins/TransAPI6
-rw-r--r--src/Simulator/FireSimulator.cpp16
-rw-r--r--src/Simulator/FireSimulator.h4
4 files changed, 21 insertions, 54 deletions
diff --git a/MCServer/Plugins/TestLuaRocks/TestLuaRocks.lua b/MCServer/Plugins/TestLuaRocks/TestLuaRocks.lua
deleted file mode 100644
index 6e90b1ae9..000000000
--- a/MCServer/Plugins/TestLuaRocks/TestLuaRocks.lua
+++ /dev/null
@@ -1,49 +0,0 @@
-
--- TestLuaRocks.lua
-
--- This is a mockup plugin that does a quick test of LuaRocks capability in MCServer
-
--- "Success" is when the plugin loads, downloads the forum webpage and displays the headers and length and then displays both libs as loaded.
--- "Failure" usually manifests as one of the "require" lines failing, although you have the luarock installed.
--- Note that the plugin deliberately never fully loads, so that it can be reloaded fast by pressing its Enable button in the webadmin's plugin list.
-
-
-
-
-
-
-local log30 = require("30log");
-local socket = require("socket");
-local http = require("socket.http");
-
-
-
-
-
-LOGINFO("Trying to download a webpage...");
-local body, code, headers = http.request('http://forum.mc-server.org/index.php');
-LOG("code: " .. tostring(code));
-LOG("headers: ");
-for k, v in pairs(headers or {}) do
- LOG(" " .. k .. ": " .. v);
-end
-LOG("body length: " .. string.length(body));
-
-
-
-
-
-function Initialize(a_Plugin)
- if (socket == nil) then
- LOG("LuaSocket not found");
- else
- LOG("LuaSocket loaded");
- end
- if (log30 == nil) then
- LOG("30log not found");
- else
- LOG("30log loaded");
- end
- LOGINFO("Preventing plugin load so that it may be requested again from the webadmin.");
- return false;
-end \ No newline at end of file
diff --git a/MCServer/Plugins/TransAPI b/MCServer/Plugins/TransAPI
-Subproject da272372406e0990235b008dba73b7bfbda040e
+Subproject 52e1de4332a026e58fda843aae98c1f51e57199
diff --git a/src/Simulator/FireSimulator.cpp b/src/Simulator/FireSimulator.cpp
index ac3fb9695..8e46ed320 100644
--- a/src/Simulator/FireSimulator.cpp
+++ b/src/Simulator/FireSimulator.cpp
@@ -135,7 +135,17 @@ void cFireSimulator::SimulateChunk(float a_Dt, int a_ChunkX, int a_ChunkZ, cChun
itr = Data.erase(itr);
continue;
}
- a_Chunk->SetMeta(idx, BlockMeta + 1);
+
+ BLOCKTYPE Burnee = E_BLOCK_AIR;
+ if (itr->y > 0)
+ {
+ Burnee = a_Chunk->GetBlock(itr->x, itr->y - 1, itr->z);
+ }
+
+ if(!DoesBurnForever(Burnee))
+ {
+ a_Chunk->SetMeta(idx, BlockMeta + 1);
+ }
itr->Data = GetBurnStepTime(a_Chunk, itr->x, itr->y, itr->z); // TODO: Add some randomness into this
} // for itr - Data[]
}
@@ -176,7 +186,7 @@ bool cFireSimulator::IsFuel(BLOCKTYPE a_BlockType)
-bool cFireSimulator::IsForever(BLOCKTYPE a_BlockType)
+bool cFireSimulator::DoesBurnForever(BLOCKTYPE a_BlockType)
{
return (a_BlockType == E_BLOCK_NETHERRACK);
}
@@ -225,7 +235,7 @@ int cFireSimulator::GetBurnStepTime(cChunk * a_Chunk, int a_RelX, int a_RelY, in
if (a_RelY > 0)
{
BLOCKTYPE BlockBelow = a_Chunk->GetBlock(a_RelX, a_RelY - 1, a_RelZ);
- if (IsForever(BlockBelow))
+ if (DoesBurnForever(BlockBelow))
{
// Is burning atop of netherrack, burn forever (re-check in 10 sec)
return 10000;
diff --git a/src/Simulator/FireSimulator.h b/src/Simulator/FireSimulator.h
index a788ed327..59cc62540 100644
--- a/src/Simulator/FireSimulator.h
+++ b/src/Simulator/FireSimulator.h
@@ -27,8 +27,8 @@ public:
virtual bool IsAllowedBlock(BLOCKTYPE a_BlockType) override;
- static bool IsFuel (BLOCKTYPE a_BlockType);
- static bool IsForever(BLOCKTYPE a_BlockType);
+ bool IsFuel (BLOCKTYPE a_BlockType);
+ bool DoesBurnForever(BLOCKTYPE a_BlockType);
protected:
/// Time (in msec) that a fire block takes to burn with a fuel block into the next step