Merge remote-tracking branch 'origin/master' into saplingsandleaves
Conflicts: src/Defines.h
This commit is contained in:
commit
18a0b60c12
1
.gitignore
vendored
1
.gitignore
vendored
@ -65,6 +65,7 @@ lib/tolua++/tolua
|
||||
src/Bindings/Bindings.*
|
||||
src/Bindings/BindingDependecies.txt
|
||||
MCServer.dir/
|
||||
src/AllFiles.lst
|
||||
|
||||
#win32 cmake stuff
|
||||
*.vcxproj
|
||||
|
@ -656,7 +656,7 @@ template<
|
||||
static int tolua_ForEach(lua_State * tolua_S)
|
||||
{
|
||||
int NumArgs = lua_gettop(tolua_S) - 1; /* This includes 'self' */
|
||||
if( NumArgs != 1 && NumArgs != 2)
|
||||
if ((NumArgs != 1) && (NumArgs != 2))
|
||||
{
|
||||
return lua_do_error(tolua_S, "Error in function call '#funcname#': Requires 1 or 2 arguments, got %i", NumArgs);
|
||||
}
|
||||
@ -1947,7 +1947,7 @@ static int tolua_cPluginLua_AddWebTab(lua_State * tolua_S)
|
||||
}
|
||||
else
|
||||
{
|
||||
LOGERROR("ERROR: cPluginLua:AddWebTab invalid function reference in 2nd argument (Title: \"%s\")", Title.c_str() );
|
||||
LOGWARNING("cPluginLua:AddWebTab: invalid function reference in 2nd argument (Title: \"%s\")", Title.c_str());
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -254,7 +254,7 @@ cBlockHandler * cBlockHandler::CreateBlockHandler(BLOCKTYPE a_BlockType)
|
||||
case E_BLOCK_NEW_LOG: return new cBlockSidewaysHandler (a_BlockType);
|
||||
case E_BLOCK_NOTE_BLOCK: return new cBlockNoteHandler (a_BlockType);
|
||||
case E_BLOCK_PISTON: return new cBlockPistonHandler (a_BlockType);
|
||||
case E_BLOCK_PISTON_EXTENSION: return new cBlockPistonHeadHandler ( );
|
||||
case E_BLOCK_PISTON_EXTENSION: return new cBlockPistonHeadHandler;
|
||||
case E_BLOCK_PLANKS: return new cBlockPlanksHandler (a_BlockType);
|
||||
case E_BLOCK_POTATOES: return new cBlockCropsHandler (a_BlockType);
|
||||
case E_BLOCK_POWERED_RAIL: return new cBlockRailHandler (a_BlockType);
|
||||
|
@ -119,7 +119,8 @@ public:
|
||||
AddFaceDirection(a_BlockX, a_BlockY, a_BlockZ, Face, true);
|
||||
BLOCKTYPE BlockInQuestion = a_ChunkInterface.GetBlock(a_BlockX, a_BlockY, a_BlockZ);
|
||||
|
||||
if ( // If on a block that can only hold a torch if torch is standing on it, return that face
|
||||
// If on a block that can only hold a torch if torch is standing on it, return that face
|
||||
if (
|
||||
((BlockInQuestion == E_BLOCK_GLASS) ||
|
||||
(BlockInQuestion == E_BLOCK_FENCE) ||
|
||||
(BlockInQuestion == E_BLOCK_NETHER_BRICK_FENCE) ||
|
||||
|
@ -228,6 +228,26 @@ else ()
|
||||
set(CMAKE_MODULE_LINKER_FLAGS_RELEASE "${CMAKE_MODULE_LINKER_FLAGS_RELEASE} /DEBUG")
|
||||
endif()
|
||||
|
||||
|
||||
# Generate a list of all source files:
|
||||
set(ALLFILES "")
|
||||
foreach(folder ${FOLDERS})
|
||||
get_directory_property(FOLDER_SRCS DIRECTORY ${folder} DEFINITION SRCS)
|
||||
foreach (src ${FOLDER_SRCS})
|
||||
list(APPEND ALLFILES "${folder}/${src}")
|
||||
endforeach(src)
|
||||
|
||||
get_directory_property(FOLDER_HDRS DIRECTORY ${folder} DEFINITION HDRS)
|
||||
foreach (hdr ${FOLDER_HDRS})
|
||||
list(APPEND ALLFILES "${folder}/${hdr}")
|
||||
endforeach(hdr)
|
||||
endforeach(folder)
|
||||
foreach(arg ${ALLFILES})
|
||||
set(ALLFILESLINES "${ALLFILESLINES}${arg}\n")
|
||||
endforeach()
|
||||
FILE(WRITE "AllFiles.lst" "${ALLFILESLINES}")
|
||||
|
||||
|
||||
set(EXECUTABLE MCServer)
|
||||
|
||||
if (MSVC)
|
||||
|
@ -2,31 +2,31 @@
|
||||
|
||||
#include "ChatColor.h"
|
||||
|
||||
const std::string cChatColor::Color = "\xc2\xa7"; // or in other words: "§" in UTF-8
|
||||
const std::string cChatColor::Delimiter = "\xc2\xa7"; // or in other words: "§" in UTF-8
|
||||
const std::string cChatColor::Black = cChatColor::Color + "0";
|
||||
const std::string cChatColor::Navy = cChatColor::Color + "1";
|
||||
const std::string cChatColor::Green = cChatColor::Color + "2";
|
||||
const std::string cChatColor::Blue = cChatColor::Color + "3";
|
||||
const std::string cChatColor::Red = cChatColor::Color + "4";
|
||||
const std::string cChatColor::Purple = cChatColor::Color + "5";
|
||||
const std::string cChatColor::Gold = cChatColor::Color + "6";
|
||||
const std::string cChatColor::LightGray = cChatColor::Color + "7";
|
||||
const std::string cChatColor::Gray = cChatColor::Color + "8";
|
||||
const std::string cChatColor::DarkPurple = cChatColor::Color + "9";
|
||||
const std::string cChatColor::LightGreen = cChatColor::Color + "a";
|
||||
const std::string cChatColor::LightBlue = cChatColor::Color + "b";
|
||||
const std::string cChatColor::Rose = cChatColor::Color + "c";
|
||||
const std::string cChatColor::LightPurple = cChatColor::Color + "d";
|
||||
const std::string cChatColor::Yellow = cChatColor::Color + "e";
|
||||
const std::string cChatColor::White = cChatColor::Color + "f";
|
||||
const char * cChatColor::Color = "\xc2\xa7"; // or in other words: "§" in UTF-8
|
||||
const char * cChatColor::Delimiter = "\xc2\xa7"; // or in other words: "§" in UTF-8
|
||||
const char * cChatColor::Black = "\xc2\xa7""0";
|
||||
const char * cChatColor::Navy = "\xc2\xa7""1";
|
||||
const char * cChatColor::Green = "\xc2\xa7""2";
|
||||
const char * cChatColor::Blue = "\xc2\xa7""3";
|
||||
const char * cChatColor::Red = "\xc2\xa7""4";
|
||||
const char * cChatColor::Purple = "\xc2\xa7""5";
|
||||
const char * cChatColor::Gold = "\xc2\xa7""6";
|
||||
const char * cChatColor::LightGray = "\xc2\xa7""7";
|
||||
const char * cChatColor::Gray = "\xc2\xa7""8";
|
||||
const char * cChatColor::DarkPurple = "\xc2\xa7""9";
|
||||
const char * cChatColor::LightGreen = "\xc2\xa7""a";
|
||||
const char * cChatColor::LightBlue = "\xc2\xa7""b";
|
||||
const char * cChatColor::Rose = "\xc2\xa7""c";
|
||||
const char * cChatColor::LightPurple = "\xc2\xa7""d";
|
||||
const char * cChatColor::Yellow = "\xc2\xa7""e";
|
||||
const char * cChatColor::White = "\xc2\xa7""f";
|
||||
|
||||
const std::string cChatColor::Random = cChatColor::Color + "k";
|
||||
const std::string cChatColor::Bold = cChatColor::Color + "l";
|
||||
const std::string cChatColor::Strikethrough = cChatColor::Color + "m";
|
||||
const std::string cChatColor::Underlined = cChatColor::Color + "n";
|
||||
const std::string cChatColor::Italic = cChatColor::Color + "o";
|
||||
const std::string cChatColor::Plain = cChatColor::Color + "r";
|
||||
const char * cChatColor::Random = "\xc2\xa7""k";
|
||||
const char * cChatColor::Bold = "\xc2\xa7""l";
|
||||
const char * cChatColor::Strikethrough = "\xc2\xa7""m";
|
||||
const char * cChatColor::Underlined = "\xc2\xa7""n";
|
||||
const char * cChatColor::Italic = "\xc2\xa7""o";
|
||||
const char * cChatColor::Plain = "\xc2\xa7""r";
|
||||
|
||||
|
||||
|
||||
|
@ -9,34 +9,36 @@
|
||||
class cChatColor
|
||||
{
|
||||
public:
|
||||
static const std::string Color;
|
||||
static const std::string Delimiter;
|
||||
static const char * Delimiter;
|
||||
|
||||
static const std::string Black;
|
||||
static const std::string Navy;
|
||||
static const std::string Green;
|
||||
static const std::string Blue;
|
||||
static const std::string Red;
|
||||
static const std::string Purple;
|
||||
static const std::string Gold;
|
||||
static const std::string LightGray;
|
||||
static const std::string Gray;
|
||||
static const std::string DarkPurple;
|
||||
static const std::string LightGreen;
|
||||
static const std::string LightBlue;
|
||||
static const std::string Rose;
|
||||
static const std::string LightPurple;
|
||||
static const std::string Yellow;
|
||||
static const std::string White;
|
||||
/** @deprecated use ChatColor::Delimiter instead */
|
||||
static const char * Color;
|
||||
|
||||
// Styles ( source: http://wiki.vg/Chat )
|
||||
static const std::string Random;
|
||||
static const std::string Bold;
|
||||
static const std::string Strikethrough;
|
||||
static const std::string Underlined;
|
||||
static const std::string Italic;
|
||||
static const std::string Plain;
|
||||
static const char * Black;
|
||||
static const char * Navy;
|
||||
static const char * Green;
|
||||
static const char * Blue;
|
||||
static const char * Red;
|
||||
static const char * Purple;
|
||||
static const char * Gold;
|
||||
static const char * LightGray;
|
||||
static const char * Gray;
|
||||
static const char * DarkPurple;
|
||||
static const char * LightGreen;
|
||||
static const char * LightBlue;
|
||||
static const char * Rose;
|
||||
static const char * LightPurple;
|
||||
static const char * Yellow;
|
||||
static const char * White;
|
||||
|
||||
// Styles
|
||||
// source: http://wiki.vg/Chat
|
||||
static const char * Random;
|
||||
static const char * Bold;
|
||||
static const char * Strikethrough;
|
||||
static const char * Underlined;
|
||||
static const char * Italic;
|
||||
static const char * Plain;
|
||||
};
|
||||
|
||||
// tolua_end
|
||||
|
@ -1,3 +1,4 @@
|
||||
#!/usr/bin/env lua
|
||||
|
||||
-- CheckBasicStyle.lua
|
||||
|
||||
@ -8,7 +9,7 @@ Checks that all source files (*.cpp, *.h) use the basic style requirements of th
|
||||
- Two spaces between code and line-end comment ("//")
|
||||
- Spaces after comma, not before
|
||||
- Opening braces not at the end of a code line
|
||||
- (TODO) Spaces after if, for, while
|
||||
- Spaces after if, for, while
|
||||
- (TODO) Spaces before *, /, &
|
||||
- (TODO) Hex numbers with even digit length
|
||||
- (TODO) Hex numbers in lowercase
|
||||
@ -23,26 +24,12 @@ the line brings the editor directly to the violation.
|
||||
|
||||
Returns 0 on success, 1 on internal failure, 2 if any violations found
|
||||
|
||||
This script requires LuaFileSystem to be available in the current Lua interpreter.
|
||||
--]]
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
-- Check that LFS is installed:
|
||||
local hasLfs = pcall(require, "lfs")
|
||||
if not(hasLfs) then
|
||||
print("This script requires LuaFileSystem to be installed")
|
||||
os.exit(1)
|
||||
end
|
||||
local lfs = require("lfs")
|
||||
assert(lfs ~= nil)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
-- The list of file extensions that are processed:
|
||||
local g_ShouldProcessExt =
|
||||
{
|
||||
@ -53,13 +40,12 @@ local g_ShouldProcessExt =
|
||||
--- The list of files not to be processed:
|
||||
local g_IgnoredFiles =
|
||||
{
|
||||
"./Bindings/Bindings.cpp",
|
||||
"./Bindings/DeprecatedBindings.cpp",
|
||||
"./LeakFinder.cpp",
|
||||
"./LeakFinder.h",
|
||||
"./MersenneTwister.h",
|
||||
"./StackWalker.cpp",
|
||||
"./StackWalker.h",
|
||||
"Bindings/Bindings.cpp",
|
||||
"LeakFinder.cpp",
|
||||
"LeakFinder.h",
|
||||
"MersenneTwister.h",
|
||||
"StackWalker.cpp",
|
||||
"StackWalker.h",
|
||||
}
|
||||
|
||||
--- The list of files not to be processed, as a dictionary (filename => true), built from g_IgnoredFiles
|
||||
@ -125,6 +111,22 @@ local g_ViolationPatterns =
|
||||
|
||||
-- Check that opening braces are not at the end of a code line:
|
||||
{"[^%s].-{\n?$", "Brace should be on a separate line"},
|
||||
|
||||
-- Space after keywords:
|
||||
{"[^_]if%(", "Needs a space after \"if\""},
|
||||
{"for%(", "Needs a space after \"for\""},
|
||||
{"while%(", "Needs a space after \"while\""},
|
||||
{"switch%(", "Needs a space after \"switch\""},
|
||||
{"catch%(", "Needs a space after \"catch\""},
|
||||
|
||||
-- No space after keyword's parenthesis:
|
||||
{"[^%a#]if %( ", "Remove the space after \"(\""},
|
||||
{"for %( ", "Remove the space after \"(\""},
|
||||
{"while %( ", "Remove the space after \"(\""},
|
||||
{"catch %( ", "Remove the space after \"(\""},
|
||||
|
||||
-- No space before a closing parenthesis:
|
||||
{" %)", "Remove the space before \")\""},
|
||||
}
|
||||
|
||||
|
||||
@ -182,17 +184,6 @@ local function ProcessItem(a_ItemName)
|
||||
return
|
||||
end
|
||||
|
||||
-- If the item is a folder, recurse:
|
||||
local attrs = lfs.attributes(a_ItemName)
|
||||
if (attrs and (attrs.mode == "directory")) then
|
||||
for fnam in lfs.dir(a_ItemName) do
|
||||
if ((fnam ~= ".") and (fnam ~= "..")) then
|
||||
ProcessItem(a_ItemName .. "/" .. fnam)
|
||||
end
|
||||
end
|
||||
return
|
||||
end
|
||||
|
||||
local ext = a_ItemName:match("%.([^/%.]-)$")
|
||||
if (g_ShouldProcessExt[ext]) then
|
||||
ProcessFile(a_ItemName)
|
||||
@ -203,8 +194,10 @@ end
|
||||
|
||||
|
||||
|
||||
-- Process the entire current folder:
|
||||
ProcessItem(".")
|
||||
-- Process all files in the AllFiles.lst file (generated by cmake):
|
||||
for fnam in io.lines("AllFiles.lst") do
|
||||
ProcessItem(fnam)
|
||||
end
|
||||
|
||||
-- Report final verdict:
|
||||
print("Number of violations found: " .. g_NumViolations)
|
||||
|
@ -781,7 +781,7 @@ void cChunk::CheckBlocks()
|
||||
void cChunk::TickBlocks(void)
|
||||
{
|
||||
// Tick dem blocks
|
||||
// _X: We must limit the random number or else we get a nasty int overflow bug ( http://forum.mc-server.org/showthread.php?tid=457 )
|
||||
// _X: We must limit the random number or else we get a nasty int overflow bug - http://forum.mc-server.org/showthread.php?tid=457
|
||||
int RandomX = m_World->GetTickRandomNumber(0x00ffffff);
|
||||
int RandomY = m_World->GetTickRandomNumber(0x00ffffff);
|
||||
int RandomZ = m_World->GetTickRandomNumber(0x00ffffff);
|
||||
@ -1530,11 +1530,12 @@ void cChunk::FastSetBlock(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_BlockT
|
||||
|
||||
m_ChunkData.SetBlock(a_RelX, a_RelY, a_RelZ, a_BlockType);
|
||||
|
||||
if ( // Queue block to be sent only if ...
|
||||
// Queue block to be sent only if ...
|
||||
if (
|
||||
a_SendToClients && // ... we are told to do so AND ...
|
||||
(
|
||||
(OldBlockMeta != a_BlockMeta) || // ... the meta value is different OR ...
|
||||
!( // ... the old and new blocktypes AREN'T liquids (because client doesn't need to distinguish betwixt them); see below for specifics:
|
||||
!( // ... the old and new blocktypes AREN'T liquids (because client doesn't need to distinguish betwixt them):
|
||||
((OldBlockType == E_BLOCK_STATIONARY_WATER) && (a_BlockType == E_BLOCK_WATER)) || // Replacing stationary water with water
|
||||
((OldBlockType == E_BLOCK_WATER) && (a_BlockType == E_BLOCK_STATIONARY_WATER)) || // Replacing water with stationary water
|
||||
((OldBlockType == E_BLOCK_STATIONARY_LAVA) && (a_BlockType == E_BLOCK_LAVA)) || // Replacing stationary water with water
|
||||
|
@ -210,11 +210,11 @@ AString cClientHandle::FormatMessageType(bool ShouldAppendChatPrefixes, eMessage
|
||||
{
|
||||
if (ShouldAppendChatPrefixes)
|
||||
{
|
||||
return Printf("%s[MSG: %s] %s%s", cChatColor::LightBlue.c_str(), a_AdditionalData.c_str(), cChatColor::White.c_str(), cChatColor::Italic.c_str());
|
||||
return Printf("%s[MSG: %s] %s%s", cChatColor::LightBlue, a_AdditionalData.c_str(), cChatColor::White, cChatColor::Italic);
|
||||
}
|
||||
else
|
||||
{
|
||||
return Printf("%s: %s", a_AdditionalData.c_str(), cChatColor::LightBlue.c_str());
|
||||
return Printf("%s: %s", a_AdditionalData.c_str(), cChatColor::LightBlue);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -533,9 +533,9 @@ void cClientHandle::HandlePing(void)
|
||||
|
||||
Printf(Reply, "%s%s%i%s%i",
|
||||
Server.GetDescription().c_str(),
|
||||
cChatColor::Delimiter.c_str(),
|
||||
cChatColor::Delimiter,
|
||||
Server.GetNumPlayers(),
|
||||
cChatColor::Delimiter.c_str(),
|
||||
cChatColor::Delimiter,
|
||||
Server.GetMaxPlayers()
|
||||
);
|
||||
Kick(Reply);
|
||||
@ -1170,7 +1170,7 @@ void cClientHandle::HandleRightClick(int a_BlockX, int a_BlockY, int a_BlockZ, e
|
||||
{
|
||||
// Only compare ItemType, not meta (torches have different metas)
|
||||
// The -1 check is there because sometimes the client sends -1 instead of the held item
|
||||
// ( http://forum.mc-server.org/showthread.php?tid=549&pid=4502#pid4502 )
|
||||
// Ref.: http://forum.mc-server.org/showthread.php?tid=549&pid=4502#pid4502
|
||||
LOGWARN("Player %s tried to place a block that was not equipped (exp %d, got %d)",
|
||||
m_Username.c_str(), Equipped.m_ItemType, a_HeldItem.m_ItemType
|
||||
);
|
||||
|
@ -274,7 +274,7 @@ private:
|
||||
/** The type used for storing the names of registered plugin channels. */
|
||||
typedef std::set<AString> cChannels;
|
||||
|
||||
/** Number of chunks the player can see in each direction; 4 is the minimum ( http://wiki.vg/Protocol_FAQ#.E2.80.A6all_connecting_clients_spasm_and_jerk_uncontrollably.21 ) */
|
||||
/** Number of chunks the player can see in each direction */
|
||||
int m_ViewDistance;
|
||||
|
||||
/** Server generates this many chunks AHEAD of player sight. */
|
||||
|
@ -24,6 +24,17 @@ static bool DoIntervalsIntersect(int a_Min1, int a_Max1, int a_Min2, int a_Max2)
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// cCuboid:
|
||||
|
||||
cCuboid & cCuboid::operator=(cCuboid a_Other)
|
||||
{
|
||||
std::swap(p1, a_Other.p1);
|
||||
std::swap(p2, a_Other.p2);
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void cCuboid::Assign(int a_X1, int a_Y1, int a_Z1, int a_X2, int a_Y2, int a_Z2)
|
||||
{
|
||||
p1.x = a_X1;
|
||||
|
@ -20,6 +20,8 @@ public:
|
||||
cCuboid(int a_X1, int a_Y1, int a_Z1) : p1(a_X1, a_Y1, a_Z1), p2(a_X1, a_Y1, a_Z1) {}
|
||||
cCuboid(int a_X1, int a_Y1, int a_Z1, int a_X2, int a_Y2, int a_Z2) : p1(a_X1, a_Y1, a_Z1), p2(a_X2, a_Y2, a_Z2) {}
|
||||
|
||||
cCuboid & operator=(cCuboid a_Other);
|
||||
|
||||
void Assign(int a_X1, int a_Y1, int a_Z1, int a_X2, int a_Y2, int a_Z2);
|
||||
void Assign(const cCuboid & a_SrcCuboid);
|
||||
|
||||
|
@ -470,7 +470,7 @@ inline void AddFaceDirection(int & a_BlockX, unsigned char & a_BlockY, int & a_B
|
||||
{
|
||||
int Y = a_BlockY;
|
||||
AddFaceDirection(a_BlockX, Y, a_BlockZ, a_BlockFace, a_bInverse);
|
||||
a_BlockY = Clamp<unsigned char>(Y, 0, 255);
|
||||
a_BlockY = Clamp<unsigned char>((unsigned char)Y, 0, 255);
|
||||
}
|
||||
|
||||
|
||||
|
@ -40,7 +40,7 @@ Serialization will never put zero-level enchantments into the stringspec and wil
|
||||
class cEnchantments
|
||||
{
|
||||
public:
|
||||
/** Individual enchantment IDs, corresponding to their NBT IDs ( http://www.minecraftwiki.net/wiki/Data_Values#Enchantment_IDs )
|
||||
/** Individual enchantment IDs, corresponding to their NBT IDs: http://www.minecraftwiki.net/wiki/Data_Values#Enchantment_IDs
|
||||
*/
|
||||
|
||||
enum
|
||||
|
@ -1524,7 +1524,7 @@ AString cPlayer::GetColor(void) const
|
||||
{
|
||||
if (m_Color != '-')
|
||||
{
|
||||
return cChatColor::Color + m_Color;
|
||||
return cChatColor::Delimiter + m_Color;
|
||||
}
|
||||
|
||||
if (m_Groups.size() < 1)
|
||||
|
@ -33,17 +33,18 @@ public:
|
||||
/** Called by cWorld::ForEachEntity(), adds the stored entity effect to the entity, if it is close enough. */
|
||||
virtual bool Item(cEntity * a_Entity) override
|
||||
{
|
||||
if (!a_Entity->IsPawn())
|
||||
{
|
||||
// Not an entity that can take effects
|
||||
return false;
|
||||
}
|
||||
|
||||
double SplashDistance = (a_Entity->GetPosition() - m_HitPos).Length();
|
||||
if (SplashDistance >= 20)
|
||||
{
|
||||
// Too far away
|
||||
return false;
|
||||
}
|
||||
if (!a_Entity->IsPawn())
|
||||
{
|
||||
// Not an entity that can take effects
|
||||
return false;
|
||||
}
|
||||
|
||||
// y = -0.25x + 1, where x is the distance from the player. Approximation for potion splash.
|
||||
// TODO: better equation
|
||||
@ -114,7 +115,7 @@ void cSplashPotionEntity::Splash(const Vector3d & a_HitPos)
|
||||
cSplashPotionCallback Callback(a_HitPos, m_EntityEffectType, m_EntityEffect);
|
||||
m_World->ForEachEntity(Callback);
|
||||
|
||||
m_World->BroadcastSoundParticleEffect(2002, (int)a_HitPos.x, (int)a_HitPos.y, (int)a_HitPos.z, m_PotionColor);
|
||||
m_World->BroadcastSoundParticleEffect(2002, (int)floor(a_HitPos.x), (int)floor(a_HitPos.y), (int)floor(a_HitPos.z), m_PotionColor);
|
||||
}
|
||||
|
||||
|
||||
|
@ -415,6 +415,10 @@ void cComposableGenerator::InitFinishGens(cIniFile & a_IniFile)
|
||||
{
|
||||
m_FinishGens.push_back(new cFinishGenSprinkleFoliage(Seed));
|
||||
}
|
||||
else if (NoCaseCompare(*itr, "TallGrass") == 0)
|
||||
{
|
||||
m_FinishGens.push_back(new cFinishGenTallGrass(Seed));
|
||||
}
|
||||
else if (NoCaseCompare(*itr, "TestRails") == 0)
|
||||
{
|
||||
m_FinishGens.push_back(new cTestRailsGen(Seed, 100, 1, 7, 50));
|
||||
|
@ -159,6 +159,65 @@ void cFinishGenNetherClumpFoliage::TryPlaceClump(cChunkDesc & a_ChunkDesc, int a
|
||||
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// cFinishGenTallGrass:
|
||||
|
||||
void cFinishGenTallGrass::GenFinish(cChunkDesc & a_ChunkDesc)
|
||||
{
|
||||
for (int x = 0; x < cChunkDef::Width; x++)
|
||||
{
|
||||
int xx = x + a_ChunkDesc.GetChunkX() * cChunkDef::Width;
|
||||
for (int z = 0; z < cChunkDef::Width; z++)
|
||||
{
|
||||
int zz = z + a_ChunkDesc.GetChunkZ() * cChunkDef::Width;
|
||||
int BiomeDensity = GetBiomeDensity(a_ChunkDesc.GetBiome(x, z));
|
||||
|
||||
// Choose if we want to place long grass here. If not then bail out:
|
||||
if ((m_Noise.IntNoise2DInt(xx + m_Noise.IntNoise1DInt(xx), zz + m_Noise.IntNoise1DInt(zz)) / 7 % 100) > BiomeDensity)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// Get the top block + 1. This is the place where the grass would finaly be placed:
|
||||
int y = a_ChunkDesc.GetHeight(x, z) + 1;
|
||||
|
||||
// Check if long grass can be placed:
|
||||
if (
|
||||
(a_ChunkDesc.GetBlockType(x, y, z) != E_BLOCK_AIR) ||
|
||||
((a_ChunkDesc.GetBlockType(x, y - 1, z) != E_BLOCK_GRASS) && (a_ChunkDesc.GetBlockType(x, y - 1, z) != E_BLOCK_DIRT))
|
||||
)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// Choose what long grass meta we should use:
|
||||
int GrassType = m_Noise.IntNoise2DInt(xx * 50, zz * 50) / 7 % 100;
|
||||
if (GrassType < 60)
|
||||
{
|
||||
a_ChunkDesc.SetBlockTypeMeta(x, y, z, E_BLOCK_TALL_GRASS, 1);
|
||||
}
|
||||
else if (GrassType < 90)
|
||||
{
|
||||
a_ChunkDesc.SetBlockTypeMeta(x, y, z, E_BLOCK_TALL_GRASS, 2);
|
||||
}
|
||||
else
|
||||
{
|
||||
// If double long grass we have to choose what type we should use:
|
||||
if (a_ChunkDesc.GetBlockType(x, y + 1, z) == E_BLOCK_AIR)
|
||||
{
|
||||
NIBBLETYPE Meta = (m_Noise.IntNoise2DInt(xx * 100, zz * 100) / 7 % 100) > 25 ? 2 : 3;
|
||||
a_ChunkDesc.SetBlockTypeMeta(x, y, z, E_BLOCK_BIG_FLOWER, Meta);
|
||||
a_ChunkDesc.SetBlockTypeMeta(x, y + 1, z, E_BLOCK_BIG_FLOWER, 8);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// cFinishGenSprinkleFoliage:
|
||||
|
||||
|
@ -69,6 +69,43 @@ protected:
|
||||
|
||||
|
||||
|
||||
class cFinishGenTallGrass :
|
||||
public cFinishGen
|
||||
{
|
||||
public:
|
||||
cFinishGenTallGrass(int a_Seed) : m_Noise(a_Seed), m_Seed(a_Seed) {}
|
||||
|
||||
protected:
|
||||
cNoise m_Noise;
|
||||
int m_Seed;
|
||||
|
||||
// cFinishGen override:
|
||||
virtual void GenFinish(cChunkDesc & a_ChunkDesc) override;
|
||||
|
||||
int GetBiomeDensity(EMCSBiome a_Biome)
|
||||
{
|
||||
switch (a_Biome)
|
||||
{
|
||||
case biSavanna:
|
||||
case biSavannaM:
|
||||
case biSavannaPlateau:
|
||||
case biSavannaPlateauM:
|
||||
case biPlains:
|
||||
{
|
||||
return 70;
|
||||
}
|
||||
default:
|
||||
{
|
||||
return 20;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
class cFinishGenSprinkleFoliage :
|
||||
public cFinishGen
|
||||
{
|
||||
|
@ -2367,9 +2367,9 @@ const cPrefab::sDef g_AlchemistVillagePrefabs[] =
|
||||
"a: 24: 2\n" /* sandstone */
|
||||
"b: 4: 0\n" /* cobblestone */
|
||||
"c: 24: 0\n" /* sandstone */
|
||||
"d: 12: 0\n" /* sand */
|
||||
"e: 13: 0\n" /* gravel */
|
||||
"f: 5: 0\n" /* wood */
|
||||
"d: 13: 0\n" /* gravel */
|
||||
"e: 5: 0\n" /* wood */
|
||||
"f: 12: 0\n" /* sand */
|
||||
"g: 64: 3\n" /* wooddoorblock */
|
||||
"h: 85: 0\n" /* fence */
|
||||
"i: 64: 0\n" /* wooddoorblock */
|
||||
@ -2392,26 +2392,26 @@ const cPrefab::sDef g_AlchemistVillagePrefabs[] =
|
||||
/* * 012345678901234 */
|
||||
/* 0 */ "mmmabbbammmmmmm"
|
||||
/* 1 */ "mmmmbbbmmmmmmmm"
|
||||
/* 2 */ "acccccccccadddd"
|
||||
/* 3 */ "cccccccccccdddd"
|
||||
/* 4 */ "cccccccccccdddd"
|
||||
/* 5 */ "cccccccccccdddd"
|
||||
/* 6 */ "cccccccccccdddd"
|
||||
/* 7 */ "cccccccccccdddd"
|
||||
/* 8 */ "acccccccccadddd"
|
||||
/* 2 */ "acccccccccacccc"
|
||||
/* 3 */ "ccccccccccccccc"
|
||||
/* 4 */ "ccccccccccccccc"
|
||||
/* 5 */ "ccccccccccccccc"
|
||||
/* 6 */ "ccccccccccccccc"
|
||||
/* 7 */ "ccccccccccccccc"
|
||||
/* 8 */ "acccccccccacccc"
|
||||
|
||||
// Level 1
|
||||
/* z\x* 11111 */
|
||||
/* * 012345678901234 */
|
||||
/* 0 */ "mmmaeeeammmmmmm"
|
||||
/* 1 */ "mmmmeeemmmmmmmm"
|
||||
/* 2 */ "accccfccccadddd"
|
||||
/* 3 */ "cfffffffffcdddd"
|
||||
/* 4 */ "cfffffffffcdddd"
|
||||
/* 5 */ "cffffffffffdddd"
|
||||
/* 6 */ "cfffffffffcdddd"
|
||||
/* 7 */ "cfffffffffcdddd"
|
||||
/* 8 */ "acccccccccadddd"
|
||||
/* 0 */ "mmmadddammmmmmm"
|
||||
/* 1 */ "mmmmdddmmmmmmmm"
|
||||
/* 2 */ "acccceccccaffff"
|
||||
/* 3 */ "ceeeeeeeeecffff"
|
||||
/* 4 */ "ceeeeeeeeecffff"
|
||||
/* 5 */ "ceeeeeeeeeeffff"
|
||||
/* 6 */ "ceeeeeeeeecffff"
|
||||
/* 7 */ "ceeeeeeeeecffff"
|
||||
/* 8 */ "acccccccccaffff"
|
||||
|
||||
// Level 2
|
||||
/* z\x* 11111 */
|
||||
|
@ -134,11 +134,11 @@ const cPrefab::sDef g_JapaneseVillagePrefabs[] =
|
||||
// The data has been exported from the gallery Plains, area index 166, ID 554, created by Aloe_vera
|
||||
{
|
||||
// Size:
|
||||
11, 7, 13, // SizeX = 11, SizeY = 7, SizeZ = 13
|
||||
11, 8, 13, // SizeX = 11, SizeY = 8, SizeZ = 13
|
||||
|
||||
// Hitbox (relative to bounding box):
|
||||
0, 0, 0, // MinX, MinY, MinZ
|
||||
10, 6, 12, // MaxX, MaxY, MaxZ
|
||||
10, 7, 12, // MaxX, MaxY, MaxZ
|
||||
|
||||
// Block definitions:
|
||||
".: 0: 0\n" /* air */
|
||||
@ -150,6 +150,7 @@ const cPrefab::sDef g_JapaneseVillagePrefabs[] =
|
||||
"f: 59: 7\n" /* crops */
|
||||
"g: 83: 0\n" /* reedblock */
|
||||
"h:113: 0\n" /* netherbrickfence */
|
||||
"i: 50: 5\n" /* torch */
|
||||
"m: 19: 0\n" /* sponge */,
|
||||
|
||||
// Block data:
|
||||
@ -270,7 +271,24 @@ const cPrefab::sDef g_JapaneseVillagePrefabs[] =
|
||||
/* 9 */ "..........."
|
||||
/* 10 */ ".h.......h."
|
||||
/* 11 */ "hhh.....hhh"
|
||||
/* 12 */ ".h.......h.",
|
||||
/* 12 */ ".h.......h."
|
||||
|
||||
// Level 7
|
||||
/* z\x* 1 */
|
||||
/* * 01234567890 */
|
||||
/* 0 */ ".i.......i."
|
||||
/* 1 */ "i.i.....i.i"
|
||||
/* 2 */ ".i.......i."
|
||||
/* 3 */ "..........."
|
||||
/* 4 */ "..........."
|
||||
/* 5 */ "..........."
|
||||
/* 6 */ "..........."
|
||||
/* 7 */ "..........."
|
||||
/* 8 */ "..........."
|
||||
/* 9 */ "..........."
|
||||
/* 10 */ ".i.......i."
|
||||
/* 11 */ "i.i.....i.i"
|
||||
/* 12 */ ".i.......i.",
|
||||
|
||||
// Connectors:
|
||||
"-1: 10, 2, 6: 5\n" /* Type -1, direction X+ */,
|
||||
@ -2195,33 +2213,33 @@ const cPrefab::sDef g_JapaneseVillagePrefabs[] =
|
||||
|
||||
// Level 1
|
||||
/* z\x* 0123456 */
|
||||
/* 0 */ "bmmmmmm"
|
||||
/* 1 */ "bmmmmmm"
|
||||
/* 2 */ "bmmmmmm"
|
||||
/* 3 */ "bmmmmmm"
|
||||
/* 4 */ "bmmmmmm"
|
||||
/* 5 */ "bmmmmmm"
|
||||
/* 0 */ "bbbbbbb"
|
||||
/* 1 */ "bbbbbbb"
|
||||
/* 2 */ "bbbbbbb"
|
||||
/* 3 */ "bbbabbb"
|
||||
/* 4 */ "bbbbbbb"
|
||||
/* 5 */ "bbbbbbb"
|
||||
/* 6 */ "bbbbbbb"
|
||||
|
||||
// Level 2
|
||||
/* z\x* 0123456 */
|
||||
/* 0 */ "......."
|
||||
/* 1 */ "..c.c.."
|
||||
/* 0 */ "mm...mm"
|
||||
/* 1 */ "m.c...m"
|
||||
/* 2 */ ".dccdc."
|
||||
/* 3 */ "..cefc."
|
||||
/* 4 */ ".ccfgh."
|
||||
/* 5 */ "..ccc.."
|
||||
/* 6 */ "......."
|
||||
/* 5 */ "m.ccc.m"
|
||||
/* 6 */ "mm...mm"
|
||||
|
||||
// Level 3
|
||||
/* z\x* 0123456 */
|
||||
/* 0 */ "......."
|
||||
/* 0 */ "m.....m"
|
||||
/* 1 */ "......."
|
||||
/* 2 */ "......."
|
||||
/* 3 */ "...e..."
|
||||
/* 4 */ "......."
|
||||
/* 5 */ "......."
|
||||
/* 6 */ "......."
|
||||
/* 6 */ "m.....m"
|
||||
|
||||
// Level 4
|
||||
/* z\x* 0123456 */
|
||||
|
@ -356,8 +356,8 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] =
|
||||
"e: 8: 0\n" /* water */
|
||||
"f: 50: 5\n" /* torch */
|
||||
"g: 59: 7\n" /* crops */
|
||||
"h: 59: 0\n" /* crops */
|
||||
"i: 59: 1\n" /* crops */
|
||||
"h: 59: 3\n" /* crops */
|
||||
"i: 59: 5\n" /* crops */
|
||||
"m: 19: 0\n" /* sponge */,
|
||||
|
||||
// Block data:
|
||||
@ -368,7 +368,7 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] =
|
||||
/* 1 */ "aaaaaaaaaaaaaaa"
|
||||
/* 2 */ "aaaaaaaaaaaaaaa"
|
||||
/* 3 */ "aaaaaaaaaaaaaaa"
|
||||
/* 4 */ "aaaaaaaaaaaaaaa"
|
||||
/* 4 */ "aaaaaaabaaaaaaa"
|
||||
/* 5 */ "aaaaaaabaaaaaaa"
|
||||
/* 6 */ "aaaaaaabaaaaaaa"
|
||||
/* 7 */ "aaaaaaabaaaaaaa"
|
||||
@ -405,12 +405,12 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] =
|
||||
/* * 012345678901234 */
|
||||
/* 0 */ "f.....f.f.....f"
|
||||
/* 1 */ ".gg.gg...gg.gg."
|
||||
/* 2 */ ".gh.hg...gg.gg."
|
||||
/* 3 */ ".gh.ih...gg.gg."
|
||||
/* 4 */ ".gg.hg...gg.gg."
|
||||
/* 5 */ ".gg.hg...gg.gg."
|
||||
/* 6 */ ".ig.hg...gg.gg."
|
||||
/* 7 */ ".hg.gh...gg.gg."
|
||||
/* 2 */ ".gg.hg...gg.gg."
|
||||
/* 3 */ ".gg.gi...gg.gg."
|
||||
/* 4 */ ".gg.gg...gg.gg."
|
||||
/* 5 */ ".gg.gg...gg.gg."
|
||||
/* 6 */ ".gg.gg...gg.gg."
|
||||
/* 7 */ ".gg.gg...gg.gg."
|
||||
/* 8 */ "f.....f.f.....f"
|
||||
|
||||
// Level 4
|
||||
@ -3603,8 +3603,8 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] =
|
||||
|
||||
// Block definitions:
|
||||
".: 0: 0\n" /* air */
|
||||
"a: 2: 0\n" /* grass */
|
||||
"b: 3: 0\n" /* dirt */
|
||||
"a: 3: 0\n" /* dirt */
|
||||
"b: 2: 0\n" /* grass */
|
||||
"c: 4: 0\n" /* cobblestone */
|
||||
"d: 67: 0\n" /* stairs */
|
||||
"e: 67: 2\n" /* stairs */
|
||||
@ -3629,19 +3629,19 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] =
|
||||
// Level 0
|
||||
/* z\x* 1 */
|
||||
/* * 01234567890 */
|
||||
/* 0 */ "aaaabbbaaaa"
|
||||
/* 1 */ "abbbbbbbbba"
|
||||
/* 2 */ "abbbbbbbbba"
|
||||
/* 3 */ "abbbbbbbbba"
|
||||
/* 4 */ "abbbbbbbbba"
|
||||
/* 5 */ "abbbbbbbbba"
|
||||
/* 6 */ "abbbbbbbbba"
|
||||
/* 7 */ "abbbbbbbbba"
|
||||
/* 8 */ "aabbbbbbbaa"
|
||||
/* 9 */ "aabbbbbbbaa"
|
||||
/* 10 */ "aabbbbbbbaa"
|
||||
/* 11 */ "aabbbbbbbaa"
|
||||
/* 12 */ "aabbbbbbbaa"
|
||||
/* 0 */ "aaaaaaaaaaa"
|
||||
/* 1 */ "aaaaaaaaaaa"
|
||||
/* 2 */ "aaaaaaaaaaa"
|
||||
/* 3 */ "aaaaaaaaaaa"
|
||||
/* 4 */ "aaaaaaaaaab"
|
||||
/* 5 */ "baaaaaaaaab"
|
||||
/* 6 */ "aaaaaaaaaaa"
|
||||
/* 7 */ "baaaaaaaaaa"
|
||||
/* 8 */ "baaaaaaaaaa"
|
||||
/* 9 */ "baaaaaaaaab"
|
||||
/* 10 */ "aaaaaaaaaaa"
|
||||
/* 11 */ "aaaaaaaaaba"
|
||||
/* 12 */ "aaaaaaaaaba"
|
||||
|
||||
// Level 1
|
||||
/* z\x* 1 */
|
||||
@ -3654,11 +3654,11 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] =
|
||||
/* 5 */ "mcccccccccm"
|
||||
/* 6 */ "mcccccccccm"
|
||||
/* 7 */ "mcccccccccm"
|
||||
/* 8 */ "mmbbbbbbbmm"
|
||||
/* 9 */ "mmbbbbbbbmm"
|
||||
/* 10 */ "mmbbbbbbbmm"
|
||||
/* 11 */ "mmbbbbbbbmm"
|
||||
/* 12 */ "mmbbbbbbbmm"
|
||||
/* 8 */ "mmaaaaaaamm"
|
||||
/* 9 */ "mmaaaaaaamm"
|
||||
/* 10 */ "mmaaaaaaamm"
|
||||
/* 11 */ "mmaaaaaaamm"
|
||||
/* 12 */ "mmaaaaaaamm"
|
||||
|
||||
// Level 2
|
||||
/* z\x* 1 */
|
||||
@ -3671,11 +3671,11 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] =
|
||||
/* 5 */ ".cggggcccc."
|
||||
/* 6 */ ".cggggcccc."
|
||||
/* 7 */ ".ccccccccc."
|
||||
/* 8 */ "..aaaaaaa.."
|
||||
/* 9 */ "..aaaaaaa.."
|
||||
/* 10 */ "..aaaaaaa.."
|
||||
/* 11 */ "..aaaaaaa.."
|
||||
/* 12 */ "..aaaaaaa.."
|
||||
/* 8 */ "..bbbbbbb.."
|
||||
/* 9 */ "mmbbbbbbbmm"
|
||||
/* 10 */ "mmbbbbbbbmm"
|
||||
/* 11 */ "mmbbbbbbbmm"
|
||||
/* 12 */ "mmbbbbbbbmm"
|
||||
|
||||
// Level 3
|
||||
/* z\x* 1 */
|
||||
@ -3689,10 +3689,10 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] =
|
||||
/* 6 */ ".i.......i."
|
||||
/* 7 */ ".hiiijiiih."
|
||||
/* 8 */ "..l.....l.."
|
||||
/* 9 */ "..l.....l.."
|
||||
/* 10 */ "..l.....l.."
|
||||
/* 11 */ "..l.....l.."
|
||||
/* 12 */ "..lllllll.."
|
||||
/* 9 */ "mml.....lmm"
|
||||
/* 10 */ "mml.....lmm"
|
||||
/* 11 */ "mml.....lmm"
|
||||
/* 12 */ "mmlllllllmm"
|
||||
|
||||
// Level 4
|
||||
/* z\x* 1 */
|
||||
@ -3706,10 +3706,10 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] =
|
||||
/* 6 */ ".o.......o."
|
||||
/* 7 */ ".hooipiooh."
|
||||
/* 8 */ "..........."
|
||||
/* 9 */ "..........."
|
||||
/* 10 */ "..........."
|
||||
/* 11 */ "..........."
|
||||
/* 12 */ "..........."
|
||||
/* 9 */ "mm.......mm"
|
||||
/* 10 */ "mm.......mm"
|
||||
/* 11 */ "mm.......mm"
|
||||
/* 12 */ "mm.......mm"
|
||||
|
||||
// Level 5
|
||||
/* z\x* 1 */
|
||||
@ -3723,10 +3723,10 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] =
|
||||
/* 6 */ ".i.......i."
|
||||
/* 7 */ "uiiiiiiiiiu"
|
||||
/* 8 */ "kkkkkkkkkkk"
|
||||
/* 9 */ "..........."
|
||||
/* 10 */ "..........."
|
||||
/* 11 */ "..........."
|
||||
/* 12 */ "..........."
|
||||
/* 9 */ "mm.......mm"
|
||||
/* 10 */ "mm.......mm"
|
||||
/* 11 */ "mm.......mm"
|
||||
/* 12 */ "mm.......mm"
|
||||
|
||||
// Level 6
|
||||
/* z\x* 1 */
|
||||
@ -3740,10 +3740,10 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] =
|
||||
/* 6 */ "uiiiiiiiiiu"
|
||||
/* 7 */ "kkkkkkkkkkk"
|
||||
/* 8 */ "..........."
|
||||
/* 9 */ "..........."
|
||||
/* 10 */ "..........."
|
||||
/* 11 */ "..........."
|
||||
/* 12 */ "..........."
|
||||
/* 9 */ "mm.......mm"
|
||||
/* 10 */ "mm.......mm"
|
||||
/* 11 */ "mm.......mm"
|
||||
/* 12 */ "mm.......mm"
|
||||
|
||||
// Level 7
|
||||
/* z\x* 1 */
|
||||
@ -3757,10 +3757,10 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] =
|
||||
/* 6 */ "kkkkkkkkkkk"
|
||||
/* 7 */ "..........."
|
||||
/* 8 */ "..........."
|
||||
/* 9 */ "..........."
|
||||
/* 10 */ "..........."
|
||||
/* 11 */ "..........."
|
||||
/* 12 */ "..........."
|
||||
/* 9 */ "mm.......mm"
|
||||
/* 10 */ "mm.......mm"
|
||||
/* 11 */ "mm.......mm"
|
||||
/* 12 */ "mm.......mm"
|
||||
|
||||
// Level 8
|
||||
/* z\x* 1 */
|
||||
@ -3774,10 +3774,10 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] =
|
||||
/* 6 */ "..........."
|
||||
/* 7 */ "..........."
|
||||
/* 8 */ "..........."
|
||||
/* 9 */ "..........."
|
||||
/* 10 */ "..........."
|
||||
/* 11 */ "..........."
|
||||
/* 12 */ "...........",
|
||||
/* 9 */ "mm.......mm"
|
||||
/* 10 */ "mm.......mm"
|
||||
/* 11 */ "mm.......mm"
|
||||
/* 12 */ "mm.......mm",
|
||||
|
||||
// Connectors:
|
||||
"-1: 5, 2, 0: 2\n" /* Type -1, direction Z- */,
|
||||
@ -4237,30 +4237,29 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] =
|
||||
// Block definitions:
|
||||
".: 0: 0\n" /* air */
|
||||
"a: 4: 0\n" /* cobblestone */
|
||||
"b: 2: 0\n" /* grass */
|
||||
"c: 67: 0\n" /* stairs */
|
||||
"d: 67: 2\n" /* stairs */
|
||||
"e: 67: 1\n" /* stairs */
|
||||
"f: 5: 0\n" /* wood */
|
||||
"g: 67: 3\n" /* stairs */
|
||||
"h: 17: 0\n" /* tree */
|
||||
"i: 64: 7\n" /* wooddoorblock */
|
||||
"j: 64: 5\n" /* wooddoorblock */
|
||||
"k:102: 0\n" /* glasspane */
|
||||
"l: 64:12\n" /* wooddoorblock */
|
||||
"b: 67: 0\n" /* stairs */
|
||||
"c: 67: 2\n" /* stairs */
|
||||
"d: 67: 1\n" /* stairs */
|
||||
"e: 5: 0\n" /* wood */
|
||||
"f: 67: 3\n" /* stairs */
|
||||
"g: 17: 0\n" /* tree */
|
||||
"h: 64: 7\n" /* wooddoorblock */
|
||||
"i: 64: 5\n" /* wooddoorblock */
|
||||
"j:102: 0\n" /* glasspane */
|
||||
"k: 64:12\n" /* wooddoorblock */
|
||||
"l: 53: 2\n" /* woodstairs */
|
||||
"m: 19: 0\n" /* sponge */
|
||||
"n: 53: 2\n" /* woodstairs */
|
||||
"o: 53: 1\n" /* woodstairs */
|
||||
"p: 53: 7\n" /* woodstairs */
|
||||
"q: 53: 6\n" /* woodstairs */
|
||||
"r: 53: 3\n" /* woodstairs */
|
||||
"s: 53: 0\n" /* woodstairs */
|
||||
"t: 53: 5\n" /* woodstairs */
|
||||
"u: 53: 4\n" /* woodstairs */
|
||||
"v: 50: 3\n" /* torch */
|
||||
"w: 50: 2\n" /* torch */
|
||||
"x: 50: 4\n" /* torch */
|
||||
"y: 50: 1\n" /* torch */,
|
||||
"n: 53: 1\n" /* woodstairs */
|
||||
"o: 53: 7\n" /* woodstairs */
|
||||
"p: 53: 6\n" /* woodstairs */
|
||||
"q: 53: 3\n" /* woodstairs */
|
||||
"r: 53: 0\n" /* woodstairs */
|
||||
"s: 53: 5\n" /* woodstairs */
|
||||
"t: 53: 4\n" /* woodstairs */
|
||||
"u: 50: 3\n" /* torch */
|
||||
"v: 50: 2\n" /* torch */
|
||||
"w: 50: 4\n" /* torch */
|
||||
"x: 50: 1\n" /* torch */,
|
||||
|
||||
// Block data:
|
||||
// Level 0
|
||||
@ -4274,134 +4273,134 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] =
|
||||
/* 5 */ "maaaaaaaaaaaaaam"
|
||||
/* 6 */ "maaaaaaaaaaaaaam"
|
||||
/* 7 */ "maaaaaaaaaaaaaam"
|
||||
/* 8 */ "bbbbbaaaaaaaaaam"
|
||||
/* 9 */ "bbbbbbbbaaaaaaam"
|
||||
/* 10 */ "bbbbbbbbaaaaaaam"
|
||||
/* 11 */ "bbbbbbbbaaaaaaam"
|
||||
/* 12 */ "bbbbbbbbaaaaaaam"
|
||||
/* 13 */ "bbbbbbbbaaaaaaam"
|
||||
/* 14 */ "bbbbbbbbaaaaaaam"
|
||||
/* 15 */ "bbbbbbbbmmmmmmmm"
|
||||
/* 8 */ "mmmmmaaaaaaaaaam"
|
||||
/* 9 */ "mmmmmmmmaaaaaaam"
|
||||
/* 10 */ "mmmmmmmmaaaaaaam"
|
||||
/* 11 */ "mmmmmmmmaaaaaaam"
|
||||
/* 12 */ "mmmmmmmmaaaaaaam"
|
||||
/* 13 */ "mmmmmmmmaaaaaaam"
|
||||
/* 14 */ "mmmmmmmmaaaaaaam"
|
||||
/* 15 */ "mmmmmmmmmmmmmmmm"
|
||||
|
||||
// Level 1
|
||||
/* z\x* 111111 */
|
||||
/* * 0123456789012345 */
|
||||
/* 0 */ "........cde....."
|
||||
/* 0 */ "........bcd....."
|
||||
/* 1 */ ".aaaaaaaaaaaaaa."
|
||||
/* 2 */ ".affffffffffffa."
|
||||
/* 3 */ ".affffffffffffa."
|
||||
/* 4 */ ".affffffffffffa."
|
||||
/* 5 */ ".affffffffffffa."
|
||||
/* 6 */ ".affffffffffffa."
|
||||
/* 7 */ ".aaaaaaaafffffa."
|
||||
/* 8 */ ".....cgeafffffa."
|
||||
/* 9 */ "........afffffa."
|
||||
/* 10 */ "........afffffa."
|
||||
/* 11 */ "........afffffa."
|
||||
/* 12 */ "........afffffa."
|
||||
/* 13 */ "........afffffa."
|
||||
/* 14 */ "........aaaaaaa."
|
||||
/* 15 */ "................"
|
||||
/* 2 */ ".aeeeeeeeeeeeea."
|
||||
/* 3 */ ".aeeeeeeeeeeeea."
|
||||
/* 4 */ ".aeeeeeeeeeeeea."
|
||||
/* 5 */ ".aeeeeeeeeeeeea."
|
||||
/* 6 */ ".aeeeeeeeeeeeea."
|
||||
/* 7 */ ".aaaaaaaaeeeeea."
|
||||
/* 8 */ ".....bfdaeeeeea."
|
||||
/* 9 */ "mmmm....aeeeeea."
|
||||
/* 10 */ "mmmmmmm.aeeeeea."
|
||||
/* 11 */ "mmmmmmm.aeeeeea."
|
||||
/* 12 */ "mmmmmmm.aeeeeea."
|
||||
/* 13 */ "mmmmmmm.aeeeeea."
|
||||
/* 14 */ "mmmmmmm.aaaaaaa."
|
||||
/* 15 */ "mmmmmmm........."
|
||||
|
||||
// Level 2
|
||||
/* z\x* 111111 */
|
||||
/* * 0123456789012345 */
|
||||
/* 0 */ "................"
|
||||
/* 1 */ ".hffffffhihfffh."
|
||||
/* 2 */ ".f............f."
|
||||
/* 3 */ ".f............f."
|
||||
/* 4 */ ".f............f."
|
||||
/* 5 */ ".f............f."
|
||||
/* 6 */ ".f............f."
|
||||
/* 7 */ ".hffffjfh.....f."
|
||||
/* 8 */ "........f.....f."
|
||||
/* 9 */ "........f.....f."
|
||||
/* 10 */ "........f.....f."
|
||||
/* 11 */ "........f.....f."
|
||||
/* 12 */ "........f.....f."
|
||||
/* 13 */ "........f.....f."
|
||||
/* 14 */ "........hfffffh."
|
||||
/* 15 */ "................"
|
||||
/* 1 */ ".geeeeeeghgeeeg."
|
||||
/* 2 */ ".e............e."
|
||||
/* 3 */ ".e............e."
|
||||
/* 4 */ ".e............e."
|
||||
/* 5 */ ".e............e."
|
||||
/* 6 */ ".e............e."
|
||||
/* 7 */ ".geeeeieg.....e."
|
||||
/* 8 */ "........e.....e."
|
||||
/* 9 */ "mmmm....e.....e."
|
||||
/* 10 */ "mmmmmmm.e.....e."
|
||||
/* 11 */ "mmmmmmm.e.....e."
|
||||
/* 12 */ "mmmmmmm.e.....e."
|
||||
/* 13 */ "mmmmmmm.e.....e."
|
||||
/* 14 */ "mmmmmmm.geeeeeg."
|
||||
/* 15 */ "mmmmmmm........."
|
||||
|
||||
// Level 3
|
||||
/* z\x* 111111 */
|
||||
/* * 0123456789012345 */
|
||||
/* 0 */ "................"
|
||||
/* 1 */ ".hfkkfkkhlhkkfh."
|
||||
/* 2 */ ".k............f."
|
||||
/* 3 */ ".k............k."
|
||||
/* 4 */ ".k............k."
|
||||
/* 5 */ ".k............f."
|
||||
/* 6 */ ".k............k."
|
||||
/* 7 */ ".hfkkflfh.....k."
|
||||
/* 8 */ "........f.....f."
|
||||
/* 9 */ "........k.....k."
|
||||
/* 10 */ "........k.....k."
|
||||
/* 11 */ "........f.....f."
|
||||
/* 12 */ "........k.....k."
|
||||
/* 13 */ "........k.....k."
|
||||
/* 14 */ "........hkkkkkh."
|
||||
/* 15 */ "................"
|
||||
/* 1 */ ".gejjejjgkgjjeg."
|
||||
/* 2 */ ".j............e."
|
||||
/* 3 */ ".j............j."
|
||||
/* 4 */ ".j............j."
|
||||
/* 5 */ ".j............e."
|
||||
/* 6 */ ".j............j."
|
||||
/* 7 */ ".gejjekeg.....j."
|
||||
/* 8 */ "........e.....e."
|
||||
/* 9 */ "mmmm....j.....j."
|
||||
/* 10 */ "mmmmmmm.j.....j."
|
||||
/* 11 */ "mmmmmmm.e.....e."
|
||||
/* 12 */ "mmmmmmm.j.....j."
|
||||
/* 13 */ "mmmmmmm.j.....j."
|
||||
/* 14 */ "mmmmmmm.gjjjjjg."
|
||||
/* 15 */ "mmmmmmm........."
|
||||
|
||||
// Level 4
|
||||
/* z\x* 111111 */
|
||||
/* * 0123456789012345 */
|
||||
/* 0 */ "nnnnnnnnnnnnnnno"
|
||||
/* 1 */ "phffffffhfhfffho"
|
||||
/* 2 */ ".f............fo"
|
||||
/* 3 */ ".f............fo"
|
||||
/* 4 */ ".f............fo"
|
||||
/* 5 */ ".f............fo"
|
||||
/* 6 */ ".f............fo"
|
||||
/* 7 */ "qhffffffh.....fo"
|
||||
/* 8 */ "rrrrrrrsf.....fo"
|
||||
/* 9 */ ".......sf.....fo"
|
||||
/* 10 */ ".......sf.....fo"
|
||||
/* 11 */ ".......sf.....fo"
|
||||
/* 12 */ ".......sf.....fo"
|
||||
/* 13 */ ".......sf.....fo"
|
||||
/* 14 */ ".......shfffffho"
|
||||
/* 15 */ ".......st.....uo"
|
||||
/* 0 */ "llllllllllllllln"
|
||||
/* 1 */ "ogeeeeeegegeeegn"
|
||||
/* 2 */ ".e............en"
|
||||
/* 3 */ ".e............en"
|
||||
/* 4 */ ".e............en"
|
||||
/* 5 */ ".e............en"
|
||||
/* 6 */ ".e............en"
|
||||
/* 7 */ "pgeeeeeeg.....en"
|
||||
/* 8 */ "qqqqqqqre.....en"
|
||||
/* 9 */ "mmmm...re.....en"
|
||||
/* 10 */ "mmmmmmmre.....en"
|
||||
/* 11 */ "mmmmmmmre.....en"
|
||||
/* 12 */ "mmmmmmmre.....en"
|
||||
/* 13 */ "mmmmmmmre.....en"
|
||||
/* 14 */ "mmmmmmmrgeeeeegn"
|
||||
/* 15 */ "mmmmmmmrs.....tn"
|
||||
|
||||
// Level 5
|
||||
/* z\x* 111111 */
|
||||
/* * 0123456789012345 */
|
||||
/* 0 */ "................"
|
||||
/* 1 */ "nnnnnnnnnnnnnnn."
|
||||
/* 2 */ "pfffffffffffffo."
|
||||
/* 3 */ ".f.........v.fo."
|
||||
/* 4 */ ".f..........wfo."
|
||||
/* 5 */ ".f......x....fo."
|
||||
/* 6 */ "qfffffffff...fo."
|
||||
/* 7 */ "rrrrrrrrsfy..fo."
|
||||
/* 8 */ "........sf...fo."
|
||||
/* 9 */ "........sf...fo."
|
||||
/* 10 */ "........sf...fo."
|
||||
/* 11 */ "........sf...fo."
|
||||
/* 12 */ "........sf...fo."
|
||||
/* 13 */ "........sf...fo."
|
||||
/* 14 */ "........sfffffo."
|
||||
/* 15 */ "........st...uo."
|
||||
/* 1 */ "lllllllllllllll."
|
||||
/* 2 */ "oeeeeeeeeeeeeen."
|
||||
/* 3 */ ".e.........u.en."
|
||||
/* 4 */ ".e..........ven."
|
||||
/* 5 */ ".e......w....en."
|
||||
/* 6 */ "peeeeeeeee...en."
|
||||
/* 7 */ "qqqqqqqqrex..en."
|
||||
/* 8 */ "........re...en."
|
||||
/* 9 */ "mmmm....re...en."
|
||||
/* 10 */ "mmmmmmm.re...en."
|
||||
/* 11 */ "mmmmmmm.re...en."
|
||||
/* 12 */ "mmmmmmm.re...en."
|
||||
/* 13 */ "mmmmmmm.re...en."
|
||||
/* 14 */ "mmmmmmm.reeeeen."
|
||||
/* 15 */ "mmmmmmm.rs...tn."
|
||||
|
||||
// Level 6
|
||||
/* z\x* 111111 */
|
||||
/* * 0123456789012345 */
|
||||
/* 0 */ "................"
|
||||
/* 1 */ "................"
|
||||
/* 2 */ "nnnnnnnnnnnnno.."
|
||||
/* 3 */ "pffffffffffffo.."
|
||||
/* 4 */ ".fy.........fo.."
|
||||
/* 5 */ "qffffffffff.fo.."
|
||||
/* 6 */ "rrrrrrrrrsf.fo.."
|
||||
/* 7 */ ".........sf.fo.."
|
||||
/* 8 */ ".........sf.fo.."
|
||||
/* 9 */ ".........sf.fo.."
|
||||
/* 10 */ ".........sf.fo.."
|
||||
/* 11 */ ".........sf.fo.."
|
||||
/* 12 */ ".........sf.fo.."
|
||||
/* 13 */ ".........sfxfo.."
|
||||
/* 14 */ ".........sfffo.."
|
||||
/* 15 */ ".........st.uo.."
|
||||
/* 2 */ "llllllllllllln.."
|
||||
/* 3 */ "oeeeeeeeeeeeen.."
|
||||
/* 4 */ ".ex.........en.."
|
||||
/* 5 */ "peeeeeeeeee.en.."
|
||||
/* 6 */ "qqqqqqqqqre.en.."
|
||||
/* 7 */ ".........re.en.."
|
||||
/* 8 */ ".........re.en.."
|
||||
/* 9 */ "mmmm.....re.en.."
|
||||
/* 10 */ "mmmmmmm..re.en.."
|
||||
/* 11 */ "mmmmmmm..re.en.."
|
||||
/* 12 */ "mmmmmmm..re.en.."
|
||||
/* 13 */ "mmmmmmm..rewen.."
|
||||
/* 14 */ "mmmmmmm..reeen.."
|
||||
/* 15 */ "mmmmmmm..rs.tn.."
|
||||
|
||||
// Level 7
|
||||
/* z\x* 111111 */
|
||||
@ -4409,19 +4408,19 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] =
|
||||
/* 0 */ "................"
|
||||
/* 1 */ "................"
|
||||
/* 2 */ "................"
|
||||
/* 3 */ "nnnnnnnnnnnnn..."
|
||||
/* 4 */ "ffffffffffffo..."
|
||||
/* 5 */ "rrrrrrrrrrsfo..."
|
||||
/* 6 */ "..........sfo..."
|
||||
/* 7 */ "..........sfo..."
|
||||
/* 8 */ "..........sfo..."
|
||||
/* 9 */ "..........sfo..."
|
||||
/* 10 */ "..........sfo..."
|
||||
/* 11 */ "..........sfo..."
|
||||
/* 12 */ "..........sfo..."
|
||||
/* 13 */ "..........sfo..."
|
||||
/* 14 */ "..........sfo..."
|
||||
/* 15 */ "..........sfo...",
|
||||
/* 3 */ "lllllllllllll..."
|
||||
/* 4 */ "eeeeeeeeeeeen..."
|
||||
/* 5 */ "qqqqqqqqqqren..."
|
||||
/* 6 */ "..........ren..."
|
||||
/* 7 */ "..........ren..."
|
||||
/* 8 */ "..........ren..."
|
||||
/* 9 */ "mmmm......ren..."
|
||||
/* 10 */ "mmmmmmm...ren..."
|
||||
/* 11 */ "mmmmmmm...ren..."
|
||||
/* 12 */ "mmmmmmm...ren..."
|
||||
/* 13 */ "mmmmmmm...ren..."
|
||||
/* 14 */ "mmmmmmm...ren..."
|
||||
/* 15 */ "mmmmmmm...ren...",
|
||||
|
||||
// Connectors:
|
||||
"-1: 9, 1, 0: 2\n" /* Type -1, direction Z- */,
|
||||
|
@ -153,7 +153,7 @@ bool cGroupManager::LoadGroups()
|
||||
AString Color = IniFile.GetValue(KeyName, "Color", "-");
|
||||
if ((Color != "-") && (Color.length() >= 1))
|
||||
{
|
||||
Group->SetColor(cChatColor::Color + Color[0]);
|
||||
Group->SetColor(cChatColor::Delimiter + Color[0]);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -212,6 +212,26 @@ bool cLineBlockTracer::Item(cChunk * a_Chunk)
|
||||
return true;
|
||||
}
|
||||
|
||||
if ((m_CurrentY < 0) || (m_CurrentY >= cChunkDef::Height))
|
||||
{
|
||||
// We've gone out of the world, that's the end of this trace
|
||||
double IntersectX, IntersectZ;
|
||||
CalcXZIntersection(m_CurrentY, IntersectX, IntersectZ);
|
||||
if (m_Callbacks->OnOutOfWorld(IntersectX, m_CurrentY, IntersectZ))
|
||||
{
|
||||
// The callback terminated the trace
|
||||
return false;
|
||||
}
|
||||
m_Callbacks->OnNoMoreHits();
|
||||
return true;
|
||||
}
|
||||
|
||||
// Update the current chunk
|
||||
if (a_Chunk != NULL)
|
||||
{
|
||||
a_Chunk = a_Chunk->GetNeighborChunk(m_CurrentX, m_CurrentZ);
|
||||
}
|
||||
|
||||
if (a_Chunk->IsValid())
|
||||
{
|
||||
BLOCKTYPE BlockType;
|
||||
@ -233,26 +253,6 @@ bool cLineBlockTracer::Item(cChunk * a_Chunk)
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Update the current chunk
|
||||
if (a_Chunk != NULL)
|
||||
{
|
||||
a_Chunk = a_Chunk->GetNeighborChunk(m_CurrentX, m_CurrentZ);
|
||||
}
|
||||
|
||||
if ((m_CurrentY < 0) || (m_CurrentY >= cChunkDef::Height))
|
||||
{
|
||||
// We've gone out of the world, that's the end of this trace
|
||||
double IntersectX, IntersectZ;
|
||||
CalcXZIntersection(m_CurrentY, IntersectX, IntersectZ);
|
||||
if (m_Callbacks->OnOutOfWorld(IntersectX, m_CurrentY, IntersectZ))
|
||||
{
|
||||
// The callback terminated the trace
|
||||
return false;
|
||||
}
|
||||
m_Callbacks->OnNoMoreHits();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1021,9 +1021,9 @@ void cProtocolRecognizer::SendLengthlessServerPing(void)
|
||||
// http://wiki.vg/wiki/index.php?title=Protocol&oldid=3099#Server_List_Ping_.280xFE.29
|
||||
Printf(Reply, "%s%s%i%s%i",
|
||||
Server->GetDescription().c_str(),
|
||||
cChatColor::Delimiter.c_str(),
|
||||
cChatColor::Delimiter,
|
||||
Server->GetNumPlayers(),
|
||||
cChatColor::Delimiter.c_str(),
|
||||
cChatColor::Delimiter,
|
||||
Server->GetMaxPlayers()
|
||||
);
|
||||
break;
|
||||
|
@ -222,12 +222,14 @@ bool cServer::InitServer(cIniFile & a_SettingsIni)
|
||||
|
||||
bool HasAnyPorts = false;
|
||||
AString Ports = a_SettingsIni.GetValueSet("Server", "Port", "25565");
|
||||
m_ListenThreadIPv4.SetReuseAddr(true);
|
||||
if (m_ListenThreadIPv4.Initialize(Ports))
|
||||
{
|
||||
HasAnyPorts = true;
|
||||
}
|
||||
|
||||
Ports = a_SettingsIni.GetValueSet("Server", "PortsIPv6", "25565");
|
||||
m_ListenThreadIPv6.SetReuseAddr(true);
|
||||
if (m_ListenThreadIPv6.Initialize(Ports))
|
||||
{
|
||||
HasAnyPorts = true;
|
||||
@ -396,7 +398,7 @@ void cServer::TickClients(float a_Dt)
|
||||
{
|
||||
if ((*itr)->IsDestroyed())
|
||||
{
|
||||
// Remove the client later, when CS is not held, to avoid deadlock ( http://forum.mc-server.org/showthread.php?tid=374 )
|
||||
// Remove the client later, when CS is not held, to avoid deadlock: http://forum.mc-server.org/showthread.php?tid=374
|
||||
RemoveClients.push_back(*itr);
|
||||
itr = m_Clients.erase(itr);
|
||||
continue;
|
||||
|
@ -448,15 +448,21 @@ cWSSCompact::cPAKFile::cPAKFile(const AString & a_FileName, int a_LayerX, int a_
|
||||
switch (m_ChunkVersion)
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
m_ChunkSize.Set(16, 128, 16);
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
case 3:
|
||||
{
|
||||
m_ChunkSize.Set(16, 256, 16);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
LOGERROR("File \"%s\" is in an unknown chunk format (%d)", m_FileName.c_str(), m_ChunkVersion);
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
||||
short NumChunks = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user