diff options
author | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2013-08-18 01:33:14 +0200 |
---|---|---|
committer | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2013-08-18 01:33:14 +0200 |
commit | 679085b520f32e898a88823b1c2d23a12a1764f1 (patch) | |
tree | 2d5b67b26e5fff7f27e40734ebc368f0e07088d0 /source | |
parent | Another compile fix (diff) | |
download | cuberite-679085b520f32e898a88823b1c2d23a12a1764f1.tar cuberite-679085b520f32e898a88823b1c2d23a12a1764f1.tar.gz cuberite-679085b520f32e898a88823b1c2d23a12a1764f1.tar.bz2 cuberite-679085b520f32e898a88823b1c2d23a12a1764f1.tar.lz cuberite-679085b520f32e898a88823b1c2d23a12a1764f1.tar.xz cuberite-679085b520f32e898a88823b1c2d23a12a1764f1.tar.zst cuberite-679085b520f32e898a88823b1c2d23a12a1764f1.zip |
Diffstat (limited to 'source')
-rw-r--r-- | source/BlockID.h | 44 | ||||
-rw-r--r-- | source/Piston.cpp | 1 | ||||
-rw-r--r-- | source/World.cpp | 15 |
3 files changed, 53 insertions, 7 deletions
diff --git a/source/BlockID.h b/source/BlockID.h index b1c952857..8a60c16ce 100644 --- a/source/BlockID.h +++ b/source/BlockID.h @@ -169,8 +169,11 @@ enum ENUM_BLOCK_ID E_BLOCK_ACTIVATOR_RAIL = 157, E_BLOCK_DROPPER = 158, - - E_BLOCK_CARPET = 171, + E_BLOCK_STAINED_CLAY = 159, + E_BLOCK_HAY_BALE = 170 + E_BLOCK_CARPET = 171, + E_BLOCK_HARDENED_CLAY = 172, + E_BLOCK_BLOCK_OF_COAL = 173, // Keep these two as the last values, without a number - they will get their correct number assigned automagically by C++ // IsValidBlock() depends on this @@ -507,7 +510,42 @@ enum E_META_WOOL_RED = 14, E_META_WOOL_BLACK = 15, - + // E_BLOCK_CARPET metas: + E_META_CARPET_WHITE = 0, + E_META_CARPET_ORANGE = 1, + E_META_CARPET_MAGENTA = 2, + E_META_CARPET_LIGHTBLUE = 3, + E_META_CARPET_YELLOW = 4, + E_META_CARPET_LIGHTGREEN = 5, + E_META_CARPET_PINK = 6, + E_META_CARPET_GRAY = 7, + E_META_CARPET_LIGHTGRAY = 8, + E_META_CARPET_CYAN = 9, + E_META_CARPET_PURPLE = 10, + E_META_CARPET_BLUE = 11, + E_META_CARPET_BROWN = 12, + E_META_CARPET_GREEN = 13, + E_META_CARPET_RED = 14, + E_META_CARPET_BLACK = 15, + + // E_BLOCK_STAINED_CLAY metas + E_META_STAINED_CLAY_WHITE = 0, + E_META_STAINED_CLAY_ORANGE = 1, + E_META_STAINED_CLAY_MAGENTA = 2, + E_META_STAINED_CLAY_LIGHTBLUE = 3, + E_META_STAINED_CLAY_YELLOW = 4, + E_META_STAINED_CLAY_LIGHTGREEN = 5, + E_META_STAINED_CLAY_PINK = 6, + E_META_STAINED_CLAY_GRAY = 7, + E_META_STAINED_CLAY_LIGHTGRAY = 8, + E_META_STAINED_CLAY_CYAN = 9, + E_META_STAINED_CLAY_PURPLE = 10, + E_META_STAINED_CLAY_BLUE = 11, + E_META_STAINED_CLAY_BROWN = 12, + E_META_STAINED_CLAY_GREEN = 13, + E_META_STAINED_CLAY_RED = 14, + E_META_STAINED_CLAY_BLACK = 15, + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Item metas: diff --git a/source/Piston.cpp b/source/Piston.cpp index 7ffa9febd..058f92a0e 100644 --- a/source/Piston.cpp +++ b/source/Piston.cpp @@ -173,6 +173,7 @@ void cPiston::RetractPiston( int pistx, int pisty, int pistz ) ) { // These cannot be moved by the sticky piston, bail out + m_World->SetBlock(pistx, pisty, pistz, E_BLOCK_AIR, 0); return; } diff --git a/source/World.cpp b/source/World.cpp index 702e94b56..5c15a3965 100644 --- a/source/World.cpp +++ b/source/World.cpp @@ -2635,12 +2635,19 @@ void cWorld::TabCompleteUserName(const AString & a_Text, AStringVector & a_Resul cCSLock Lock(m_CSPlayers); for (cPlayerList::iterator itr = m_Players.begin(), end = m_Players.end(); itr != end; ++itr) { - if (NoCaseCompare((*itr)->GetName().substr(0, a_Text.length()), a_Text) != 0) + for (unsigned int selected = 0; selected < a_Text.length(); selected++ ) { - // Player name doesn't match - continue; + std::string playername ((*itr)->GetName()); + std::string cut (a_Text.substr(selected, a_Text.length())); + std::size_t found = playername.find(cut); + if (found!=0) + { + //Player name doesn't match + continue; + } + a_Results.push_back((*itr)->GetName()); + break; } - a_Results.push_back((*itr)->GetName()); } } |