1
0

Merge branch 'master' into saplingsandleaves

Conflicts:
	src/Bindings/DeprecatedBindings.cpp
	src/Blocks/BlockSapling.h
This commit is contained in:
Tiger Wang 2014-07-20 12:02:23 +01:00
commit d0e7b2f18b
345 changed files with 3501 additions and 2334 deletions

View File

@ -28,5 +28,6 @@ UltraCoderRU
worktycho
xoft
Yeeeeezus (Donated AlchemistVillage prefabs)
Howaner
Please add yourself to this list if you contribute to MCServer.

View File

@ -1155,6 +1155,7 @@ These ItemGrids are available in the API and can be manipulated by the plugins,
HasItems = { Params = "{{cItem|cItem}}", Return = "bool", Notes = "Returns true if there are at least as many items of the specified type as in the parameter" },
HowManyCanFit = { Params = "{{cItem|cItem}}", Return = "number", Notes = "Returns the number of the specified items that can fit in the storage, including empty slots" },
HowManyItems = { Params = "{{cItem|cItem}}", Return = "number", Notes = "Returns the number of the specified items that are currently stored" },
RemoveItem = { Params = "{{cItem}}", Return = "number", Notes = "Removes the specified item from the inventory, as many as possible, up to the item's m_ItemCount. Returns the number of items that were removed." },
RemoveOneEquippedItem = { Params = "", Return = "", Notes = "Removes one item from the hotbar's currently selected slot" },
SetArmorSlot = { Params = "ArmorSlotNum, {{cItem|cItem}}", Return = "", Notes = "Sets the specified armor slot contents" },
SetEquippedSlotNum = { Params = "EquippedSlotNum", Return = "", Notes = "Sets the currently selected hotbar slot number" },
@ -1384,6 +1385,7 @@ local Item5 = cItem(E_ITEM_DIAMOND_CHESTPLATE, 1, 0, "thorns=1;unbreaking=3");
{ Params = "SlotNum", Return = "bool", Notes = "Returns true if the specified slot is empty, or an invalid slot is specified" },
{ Params = "X, Y", Return = "bool", Notes = "Returns true if the specified slot is empty, or an invalid slot is specified" },
},
RemoveItem = { Params = "{{cItem}}", Return = "number", Notes = "Removes the specified item from the grid, as many as possible, up to the item's m_ItemCount. Returns the number of items that were removed." },
RemoveOneItem =
{
{ Params = "SlotNum", Return = "{{cItem|cItem}}", Notes = "Removes one item from the stack in the specified slot and returns it as a single cItem. Empty slots are skipped and an empty item is returned" },

View File

@ -2,7 +2,7 @@ return
{
HOOK_PLAYER_USED_BLOCK =
{
CalledWhen = "A player has just used a block (chest, furnace). Notification only.",
CalledWhen = "A player has just used a block (chest, furnace...). Notification only.",
DefaultFnName = "OnPlayerUsedBlock", -- also used as pagename
Desc = [[
This hook is called after a {{cPlayer|player}} has right-clicked a block that can be used, such as a

View File

@ -60,9 +60,10 @@ function Initialize(Plugin)
PM:BindCommand("/ff", "debuggers", HandleFurnaceFuel, "- Shows how long the currently held item would burn in a furnace");
PM:BindCommand("/sched", "debuggers", HandleSched, "- Schedules a simple countdown using cWorld:ScheduleTask()");
PM:BindCommand("/cs", "debuggers", HandleChunkStay, "- Tests the ChunkStay Lua integration for the specified chunk coords");
PM:BindCommand("/compo", "debuggers", HandleCompo, "- Tests the cCompositeChat bindings")
PM:BindCommand("/sb", "debuggers", HandleSetBiome, "- Sets the biome around you to the specified one")
PM:BindCommand("/wesel", "debuggers", HandleWESel, "- Expands the current WE selection by 1 block in X/Z")
PM:BindCommand("/compo", "debuggers", HandleCompo, "- Tests the cCompositeChat bindings");
PM:BindCommand("/sb", "debuggers", HandleSetBiome, "- Sets the biome around you to the specified one");
PM:BindCommand("/wesel", "debuggers", HandleWESel, "- Expands the current WE selection by 1 block in X/Z");
PM:BindCommand("/rmitem", "debuggers", HandleRMItem, "- Remove the specified item from the inventory.");
Plugin:AddWebTab("Debuggers", HandleRequest_Debuggers)
Plugin:AddWebTab("StressTest", HandleRequest_StressTest)
@ -533,7 +534,7 @@ function OnTakeDamage(Receiver, TDI)
-- Receiver is cPawn
-- TDI is TakeDamageInfo
LOG(Receiver:GetClass() .. " was dealt " .. DamageTypeToString(TDI.DamageType) .. " damage: Raw " .. TDI.RawDamage .. ", Final " .. TDI.FinalDamage .. " (" .. (TDI.RawDamage - TDI.FinalDamage) .. " covered by armor)");
-- LOG(Receiver:GetClass() .. " was dealt " .. DamageTypeToString(TDI.DamageType) .. " damage: Raw " .. TDI.RawDamage .. ", Final " .. TDI.FinalDamage .. " (" .. (TDI.RawDamage - TDI.FinalDamage) .. " covered by armor)");
return false;
end
@ -1105,6 +1106,41 @@ end
function HandleRMItem(a_Split, a_Player)
-- Check params:
if (a_Split[2] == nil) then
a_Player:SendMessage("Usage: /rmitem <Item> [Count]")
return true
end
-- Parse the item type:
local Item = cItem()
if (not StringToItem(a_Split[2], Item)) then
a_Player:SendMessageFailure(a_Split[2] .. " isn't a valid item")
return true
end
-- Parse the optional item count
if (a_Split[3] ~= nil) then
local Count = tonumber(a_Split[3])
if (Count == nil) then
a_Player:SendMessageFailure(a_Split[3] .. " isn't a valid number")
return true
end
Item.m_ItemCount = Count
end
-- Remove the item:
local NumRemovedItems = a_Player:GetInventory():RemoveItem(Item)
a_Player:SendMessageSuccess("Removed " .. NumRemovedItems .. " Items!")
return true
end
function HandleRequest_Debuggers(a_Request)
local FolderContents = cFile:GetFolderContents("./");
return "<p>The following objects have been returned by cFile:GetFolderContents():<ul><li>" .. table.concat(FolderContents, "</li><li>") .. "</li></ul></p>";

View File

@ -5,7 +5,7 @@ MCServer is a Minecraft server that is written in C++ and designed to be efficie
MCServer can run on PCs, Macs, and *nix. This includes android phones and tablets as well as Raspberry Pis.
We currently support the protocol from Minecraft 1.2 all the way up to Minecraft 1.7.9.
We currently support the protocol from Minecraft 1.2 all the way up to Minecraft 1.7.10.
Installation
------------

@ -1 +1 @@
Subproject commit 784b04ff9afd5faeaeb15c3fa159ff98adf55182
Subproject commit 1ed82759c68f92c4acc7e3f33b850cf9f01c8aba

View File

@ -107,3 +107,7 @@ class cListAllocationPool : public cAllocationPool<T>
std::list<void *> m_FreeList;
std::auto_ptr<typename cAllocationPool<T>::cStarvationCallbacks> m_Callbacks;
};

135
src/Bindings/CMakeLists.txt Normal file
View File

@ -0,0 +1,135 @@
cmake_minimum_required (VERSION 2.6)
project (MCServer)
include_directories ("${PROJECT_SOURCE_DIR}/../")
include_directories (".")
SET (SRCS
Bindings.cpp
DeprecatedBindings.cpp
LuaChunkStay.cpp
LuaState.cpp
LuaWindow.cpp
ManualBindings.cpp
Plugin.cpp
PluginLua.cpp
PluginManager.cpp
WebPlugin.cpp
)
SET (HDRS
Bindings.h
DeprecatedBindings.h
LuaChunkStay.h
LuaFunctions.h
LuaState.h
LuaWindow.h
ManualBindings.h
Plugin.h
PluginLua.h
PluginManager.h
WebPlugin.h
tolua++.h
)
# List all the files that are generated as part of the Bindings build process
set (BINDING_OUTPUTS
${CMAKE_CURRENT_SOURCE_DIR}/Bindings.cpp
${CMAKE_CURRENT_SOURCE_DIR}/Bindings.h
${CMAKE_CURRENT_SOURCE_DIR}/LuaState_Call.inc
)
set(BINDING_DEPENDECIES
tolua
../Bindings/virtual_method_hooks.lua
../Bindings/AllToLua.pkg
../Bindings/gen_LuaState_Call.lua
../Bindings/LuaFunctions.h
../Bindings/LuaState_Call.inc
../Bindings/LuaWindow.h
../Bindings/Plugin.h
../Bindings/PluginLua.h
../Bindings/PluginManager.h
../Bindings/WebPlugin.h
../BiomeDef.h
../BlockArea.h
../BlockEntities/BlockEntity.h
../BlockEntities/BlockEntityWithItems.h
../BlockEntities/ChestEntity.h
../BlockEntities/DispenserEntity.h
../BlockEntities/DropSpenserEntity.h
../BlockEntities/DropperEntity.h
../BlockEntities/FurnaceEntity.h
../BlockEntities/HopperEntity.h
../BlockEntities/JukeboxEntity.h
../BlockEntities/NoteEntity.h
../BlockEntities/SignEntity.h
../BlockEntities/MobHeadEntity.h
../BlockEntities/FlowerPotEntity.h
../BlockID.h
../BoundingBox.h
../ChatColor.h
../ChunkDef.h
../ClientHandle.h
../CraftingRecipes.h
../Cuboid.h
../Defines.h
../Enchantments.h
../Entities/EntityEffect.h
../Entities/Entity.h
../Entities/Floater.h
../Entities/Pawn.h
../Entities/Painting.h
../Entities/Pickup.h
../Entities/Player.h
../Entities/ProjectileEntity.h
../Entities/ArrowEntity.h
../Entities/ThrownEggEntity.h
../Entities/ThrownEnderPearlEntity.h
../Entities/ExpBottleEntity.h
../Entities/ThrownSnowballEntity.h
../Entities/FireChargeEntity.h
../Entities/FireworkEntity.h
../Entities/GhastFireballEntity.h
../Entities/TNTEntity.h
../Entities/ExpOrb.h
../Entities/HangingEntity.h
../Entities/ItemFrame.h
../Generating/ChunkDesc.h
../Group.h
../Inventory.h
../Item.h
../ItemGrid.h
../Mobs/Monster.h
../OSSupport/File.h
../Root.h
../Server.h
../StringUtils.h
../Tracer.h
../UI/Window.h
../Vector3.h
../WebAdmin.h
../World.h
)
if (NOT MSVC)
ADD_CUSTOM_COMMAND(
# add any new generated bindings here
OUTPUT ${BINDING_OUTPUTS}
# Regenerate bindings:
COMMAND tolua -L virtual_method_hooks.lua -o Bindings.cpp -H Bindings.h AllToLua.pkg
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
# add any new generation dependencies here
DEPENDS ${BINDING_DEPENDECIES}
)
endif ()
set_source_files_properties(Bindings/Bindings.cpp PROPERTIES GENERATED TRUE)
set_source_files_properties(Bindings/Bindings.h PROPERTIES GENERATED TRUE)
if(NOT MSVC)
add_library(Bindings ${SRCS} ${HDRS})
target_link_libraries(Bindings lua sqlite tolualib polarssl)
endif()

View File

@ -40,7 +40,7 @@ const cLuaState::cRet cLuaState::Return = {};
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cLuaState:
cLuaState::cLuaState(const AString & a_SubsystemName) :
@ -1336,7 +1336,6 @@ void cLuaState::LogStack(lua_State * a_LuaState, const char * a_Header)
{
UNUSED(a_Header); // The param seems unused when compiling for release, so the compiler warns
// Format string consisting only of %s is used to appease the compiler
LOGD("%s", (a_Header != NULL) ? a_Header : "Lua C API Stack contents:");
for (int i = lua_gettop(a_LuaState); i > 0; i--)
@ -1371,7 +1370,7 @@ int cLuaState::ReportFnCallErrors(lua_State * a_LuaState)
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cLuaState::cRef:
cLuaState::cRef::cRef(void) :

View File

@ -13,7 +13,7 @@
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cLuaWindow:
cLuaWindow::cLuaWindow(cWindow::WindowType a_WindowType, int a_SlotsX, int a_SlotsY, const AString & a_Title) :

View File

@ -33,9 +33,7 @@
/****************************
* Better error reporting for Lua
**/
// Better error reporting for Lua
static int tolua_do_error(lua_State* L, const char * a_pMsg, tolua_Error * a_pToLuaError)
{
// Retrieve current function name
@ -81,10 +79,7 @@ static int lua_do_error(lua_State* L, const char * a_pFormat, ...)
/****************************
* Lua bound functions with special return types
**/
// Lua bound functions with special return types
static int tolua_StringSplit(lua_State * tolua_S)
{
cLuaState LuaState(tolua_S);
@ -557,9 +552,11 @@ static int tolua_DoWithXYZ(lua_State* tolua_S)
template< class Ty1,
template<
class Ty1,
class Ty2,
bool (Ty1::*Func1)(int, int, cItemCallback<Ty2> &) >
bool (Ty1::*Func1)(int, int, cItemCallback<Ty2> &)
>
static int tolua_ForEachInChunk(lua_State * tolua_S)
{
int NumArgs = lua_gettop(tolua_S) - 1; /* This includes 'self' */
@ -651,9 +648,11 @@ static int tolua_ForEachInChunk(lua_State* tolua_S)
template< class Ty1,
template<
class Ty1,
class Ty2,
bool (Ty1::*Func1)(cItemCallback<Ty2> &) >
bool (Ty1::*Func1)(cItemCallback<Ty2> &)
>
static int tolua_ForEach(lua_State * tolua_S)
{
int NumArgs = lua_gettop(tolua_S) - 1; /* This includes 'self' */
@ -959,7 +958,7 @@ tolua_lerror:
static int tolua_cWorld_TryGetHeight(lua_State * tolua_S)
{
// Exported manually, because tolua would require the out-only param a_Height to be used when calling
// Takes (a_World,) a_BlockX, a_BlockZ
// Takes a_World, a_BlockX, a_BlockZ
// Returns Height, IsValid
#ifndef TOLUA_RELEASE
tolua_Error tolua_err;

View File

@ -42,10 +42,7 @@ public:
// Called each tick
virtual void Tick(float a_Dt) = 0;
/**
* On all these functions, return true if you want to override default behavior and not call other plugins on that callback.
* You can also return false, so default behavior is used.
**/
/** Calls the specified hook with the params given. Returns the bool that the hook callback returns.*/
virtual bool OnBlockSpread (cWorld * a_World, int a_BlockX, int a_BlockY, int a_BlockZ, eSpreadSource a_Source) = 0;
virtual bool OnBlockToPickups (cWorld * a_World, cEntity * a_Digger, int a_BlockX, int a_BlockY, int a_BlockZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, cItems & a_Pickups) = 0;
virtual bool OnChat (cPlayer * a_Player, AString & a_Message) = 0;

View File

@ -25,7 +25,7 @@ extern "C"
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cPluginLua:
cPluginLua::cPluginLua(const AString & a_PluginDirectory) :

View File

@ -51,9 +51,11 @@ class cBlockEntityWithItems;
class cPluginManager // tolua_export
{ // tolua_export
public: // tolua_export
// tolua_begin
class cPluginManager
{
public:
// tolua_end
// Called each tick
virtual void Tick(float a_Dt);
@ -164,8 +166,10 @@ public: // tolua_export
cPlugin * GetPlugin( const AString & a_Plugin ) const; // tolua_export
const PluginMap & GetAllPlugins() const; // >> EXPORTED IN MANUALBINDINGS <<
void FindPlugins(); // tolua_export
void ReloadPlugins(); // tolua_export
// tolua_begin
void FindPlugins();
void ReloadPlugins();
// tolua_end
/** Adds the plugin to the list of plugins called for the specified hook type. Handles multiple adds as a single add */
void AddHook(cPlugin * a_Plugin, int a_HookType);

View File

@ -66,12 +66,12 @@ std::pair< AString, AString > cWebPlugin::GetTabNameForRequest(const HTTPRequest
if (Split.size() > 1)
{
sWebPluginTab* Tab = 0;
sWebPluginTab * Tab = NULL;
if (Split.size() > 2) // If we got the tab name, show that page
{
for( TabList::iterator itr = GetTabs().begin(); itr != GetTabs().end(); ++itr )
{
if( (*itr)->SafeTitle.compare( Split[2] ) == 0 ) // This is the one! Rawr
if ((*itr)->SafeTitle.compare(Split[2]) == 0) // This is the one!
{
Tab = *itr;
break;
@ -84,7 +84,7 @@ std::pair< AString, AString > cWebPlugin::GetTabNameForRequest(const HTTPRequest
Tab = *GetTabs().begin();
}
if( Tab )
if (Tab != NULL)
{
Names.first = Tab->Title;
Names.second = Tab->SafeTitle;
@ -111,3 +111,7 @@ AString cWebPlugin::SafeString( const AString & a_String )
}
return RetVal;
}

View File

@ -10,7 +10,8 @@
// The "map" used for biome <-> string conversions:
static struct {
static struct
{
EMCSBiome m_Biome;
const char * m_String;
} g_BiomeMap[] =

View File

@ -269,7 +269,7 @@ void MergeCombinatorMask(BLOCKTYPE & a_DstType, BLOCKTYPE a_SrcType, NIBBLETYPE
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cBlockArea:
cBlockArea::cBlockArea(void) :
@ -1759,7 +1759,7 @@ NIBBLETYPE cBlockArea::GetNibble(int a_BlockX, int a_BlockY, int a_BlockZ, NIBBL
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cBlockArea::cChunkReader:
cBlockArea::cChunkReader::cChunkReader(cBlockArea & a_Area) :

View File

@ -4,9 +4,41 @@ project (MCServer)
include_directories ("${PROJECT_SOURCE_DIR}/../")
file(GLOB SOURCE
"*.cpp"
"*.h"
)
SET (SRCS
BeaconEntity.cpp
BlockEntity.cpp
ChestEntity.cpp
CommandBlockEntity.cpp
DispenserEntity.cpp
DropSpenserEntity.cpp
DropperEntity.cpp
EnderChestEntity.cpp
FlowerPotEntity.cpp
FurnaceEntity.cpp
HopperEntity.cpp
JukeboxEntity.cpp
MobHeadEntity.cpp
NoteEntity.cpp
SignEntity.cpp)
add_library(BlockEntities ${SOURCE})
SET (HDRS
BeaconEntity.h
BlockEntity.h
BlockEntityWithItems.h
ChestEntity.h
CommandBlockEntity.h
DispenserEntity.h
DropSpenserEntity.h
DropperEntity.h
EnderChestEntity.h
FlowerPotEntity.h
FurnaceEntity.h
HopperEntity.h
JukeboxEntity.h
MobHeadEntity.h
NoteEntity.h
SignEntity.h)
if(NOT MSVC)
add_library(BlockEntities ${SRCS} ${HDRS})
endif()

View File

@ -27,7 +27,8 @@ class cChestEntity :
typedef cBlockEntityWithItems super;
public:
enum {
enum
{
ContentsHeight = 3,
ContentsWidth = 9,
} ;

View File

@ -35,7 +35,8 @@ class cDropSpenserEntity :
typedef cBlockEntityWithItems super;
public:
enum {
enum
{
ContentsHeight = 3,
ContentsWidth = 3,
} ;

View File

@ -22,7 +22,8 @@ class cHopperEntity :
typedef cBlockEntityWithItems super;
public:
enum {
enum
{
ContentsHeight = 1,
ContentsWidth = 5,
TICKS_PER_TRANSFER = 8, ///< How many ticks at minimum between two item transfers to or from the hopper

View File

@ -255,7 +255,8 @@ AString ItemToFullString(const cItem & a_Item)
int StringToMobType(const AString & a_MobString)
{
static struct {
static struct
{
int m_MobType;
const char * m_String;
} MobMap [] =

View File

@ -399,7 +399,7 @@ enum
// Please keep this list alpha-sorted by the blocktype / itemtype part
// then number-sorted for the same block / item
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// Block metas:
// E_BLOCK_BIG_FLOWER metas
@ -678,7 +678,7 @@ enum
E_META_WOOL_RED = 14,
E_META_WOOL_BLACK = 15,
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// Item metas:
// E_ITEM_COAL metas:

View File

@ -450,9 +450,6 @@ void cBlockInfo::Initialize(cBlockInfoArray & a_Info)
a_Info[E_BLOCK_CROPS ].m_IsSolid = false;
a_Info[E_BLOCK_DANDELION ].m_IsSolid = false;
a_Info[E_BLOCK_DETECTOR_RAIL ].m_IsSolid = false;
a_Info[E_BLOCK_END_PORTAL ].m_IsSolid = false;
a_Info[E_BLOCK_FENCE ].m_IsSolid = false;
a_Info[E_BLOCK_FENCE_GATE ].m_IsSolid = false;
a_Info[E_BLOCK_FIRE ].m_IsSolid = false;
a_Info[E_BLOCK_FLOWER ].m_IsSolid = false;
a_Info[E_BLOCK_HEAVY_WEIGHTED_PRESSURE_PLATE].m_IsSolid = false;
@ -484,7 +481,6 @@ void cBlockInfo::Initialize(cBlockInfoArray & a_Info)
a_Info[E_BLOCK_WATER ].m_IsSolid = false;
a_Info[E_BLOCK_WOODEN_BUTTON ].m_IsSolid = false;
a_Info[E_BLOCK_WOODEN_PRESSURE_PLATE].m_IsSolid = false;
a_Info[E_BLOCK_WOODEN_SLAB ].m_IsSolid = false;
// Blocks that fully occupy their voxel - used as a guide for torch placeable blocks, amongst other things:

View File

@ -70,7 +70,7 @@
#include "BlockSand.h"
#include "BlockSapling.h"
#include "BlockSideways.h"
#include "BlockSign.h"
#include "BlockSignPost.h"
#include "BlockSlab.h"
#include "BlockSnow.h"
#include "BlockStairs.h"
@ -81,6 +81,7 @@
#include "BlockTorch.h"
#include "BlockTrapdoor.h"
#include "BlockVine.h"
#include "BlockWallSign.h"
#include "BlockWorkbench.h"
@ -275,7 +276,7 @@ cBlockHandler * cBlockHandler::CreateBlockHandler(BLOCKTYPE a_BlockType)
case E_BLOCK_SAND: return new cBlockSandHandler (a_BlockType);
case E_BLOCK_SANDSTONE_STAIRS: return new cBlockStairsHandler (a_BlockType);
case E_BLOCK_SAPLING: return new cBlockSaplingHandler (a_BlockType);
case E_BLOCK_SIGN_POST: return new cBlockSignHandler (a_BlockType);
case E_BLOCK_SIGN_POST: return new cBlockSignPostHandler (a_BlockType);
case E_BLOCK_SNOW: return new cBlockSnowHandler (a_BlockType);
case E_BLOCK_SPRUCE_WOOD_STAIRS: return new cBlockStairsHandler (a_BlockType);
case E_BLOCK_STAINED_GLASS: return new cBlockGlassHandler (a_BlockType);
@ -297,7 +298,7 @@ cBlockHandler * cBlockHandler::CreateBlockHandler(BLOCKTYPE a_BlockType)
case E_BLOCK_TRIPWIRE: return new cBlockTripwireHandler (a_BlockType);
case E_BLOCK_TRIPWIRE_HOOK: return new cBlockTripwireHookHandler (a_BlockType);
case E_BLOCK_VINES: return new cBlockVineHandler (a_BlockType);
case E_BLOCK_WALLSIGN: return new cBlockSignHandler (a_BlockType); // TODO: This needs a special handler
case E_BLOCK_WALLSIGN: return new cBlockWallSignHandler (a_BlockType);
case E_BLOCK_WATER: return new cBlockFluidHandler (a_BlockType);
case E_BLOCK_WOODEN_BUTTON: return new cBlockButtonHandler (a_BlockType);
case E_BLOCK_WOODEN_DOOR: return new cBlockDoorHandler (a_BlockType);

View File

@ -235,7 +235,7 @@ void cBlockPistonHandler::RetractPiston(int a_BlockX, int a_BlockY, int a_BlockZ
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cBlockPistonHeadHandler:
cBlockPistonHeadHandler::cBlockPistonHeadHandler(void) :

View File

@ -9,12 +9,14 @@
class cBlockSignHandler :
class cBlockSignPostHandler :
public cBlockHandler
{
typedef cBlockHandler super;
public:
cBlockSignHandler(BLOCKTYPE a_BlockType)
: cBlockHandler(a_BlockType)
cBlockSignPostHandler(BLOCKTYPE a_BlockType) :
super(a_BlockType)
{
}
@ -31,6 +33,17 @@ public:
}
virtual bool CanBeAt(cChunkInterface & a_ChunkInterface, int a_RelX, int a_RelY, int a_RelZ, const cChunk & a_Chunk) override
{
if (a_RelY <= 0)
{
return false;
}
return (cBlockInfo::IsSolid(a_Chunk.GetBlock(a_RelX, a_RelY - 1, a_RelZ)));
}
static NIBBLETYPE RotationToMetaData(double a_Rotation)
{
a_Rotation += 180 + (180 / 16); // So it's not aligned with axis
@ -45,23 +58,6 @@ public:
}
static NIBBLETYPE DirectionToMetaData(eBlockFace a_Direction)
{
switch (a_Direction)
{
case 0x2: return 0x2;
case 0x3: return 0x3;
case 0x4: return 0x4;
case 0x5: return 0x5;
default:
{
break;
}
}
return 0x2;
}
virtual void OnPlacedByPlayer(
cChunkInterface & a_ChunkInterface, cWorldInterface & a_WorldInterface, cPlayer * a_Player,
int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace,
@ -84,6 +80,7 @@ public:
return (a_Meta + 12) & 0x0f;
}
virtual NIBBLETYPE MetaMirrorXY(NIBBLETYPE a_Meta) override
{
// Mirrors signs over the XY plane (North-South Mirroring)

View File

@ -33,8 +33,8 @@ public:
if ((BlockBeforePlacement == E_BLOCK_SNOW) && (MetaBeforePlacement < 7))
{
// Only increment if:
// A snow block was already there (not first time placement) AND
// Height is smaller than 7, the maximum possible height
// - A snow block was already there (not first time placement) AND
// - Height is smaller than 7, the maximum possible height
MetaBeforePlacement++;
}

View File

@ -0,0 +1,89 @@
#pragma once
#include "BlockHandler.h"
#include "../Entities/Player.h"
#include "Chunk.h"
class cBlockWallSignHandler :
public cBlockHandler
{
typedef cBlockHandler super;
public:
cBlockWallSignHandler(BLOCKTYPE a_BlockType) :
super(a_BlockType)
{
}
virtual void ConvertToPickups(cItems & a_Pickups, NIBBLETYPE a_BlockMeta) override
{
a_Pickups.push_back(cItem(E_ITEM_SIGN, 1, 0));
}
virtual const char * GetStepSound(void) override
{
return "step.wood";
}
virtual void OnPlacedByPlayer(
cChunkInterface & a_ChunkInterface, cWorldInterface & a_WorldInterface, cPlayer * a_Player,
int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace,
int a_CursorX, int a_CursorY, int a_CursorZ,
BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta
) override
{
a_Player->GetClientHandle()->SendEditSign(a_BlockX, a_BlockY, a_BlockZ);
}
virtual bool CanBeAt(cChunkInterface & a_ChunkInterface, int a_RelX, int a_RelY, int a_RelZ, const cChunk & a_Chunk) override
{
int BlockX = (a_Chunk.GetPosX() * cChunkDef::Width) + a_RelX;
int BlockZ = (a_Chunk.GetPosZ() * cChunkDef::Width) + a_RelZ;
GetBlockCoordsBehindTheSign(a_Chunk.GetMeta(a_RelX, a_RelY, a_RelZ), BlockX, BlockZ);
return (cBlockInfo::IsSolid(a_ChunkInterface.GetBlock(BlockX, a_RelY, BlockZ)));
}
static void GetBlockCoordsBehindTheSign(NIBBLETYPE a_BlockMeta, int & a_BlockX, int & a_BlockZ)
{
switch (a_BlockMeta)
{
case 2: a_BlockZ++; break;
case 3: a_BlockZ--; break;
case 4: a_BlockX++; break;
case 5: a_BlockX--; break;
default: break;
}
}
static NIBBLETYPE DirectionToMetaData(eBlockFace a_Direction)
{
switch (a_Direction)
{
case 0x2: return 0x2;
case 0x3: return 0x3;
case 0x4: return 0x4;
case 0x5: return 0x5;
default:
{
break;
}
}
return 0x2;
}
} ;

View File

@ -4,9 +4,99 @@ project (MCServer)
include_directories ("${PROJECT_SOURCE_DIR}/../")
file(GLOB SOURCE
"*.cpp"
"*.h"
)
SET (SRCS
BlockBed.cpp
BlockDoor.cpp
BlockHandler.cpp
BlockPiston.cpp
ChunkInterface.cpp)
add_library(Blocks ${SOURCE})
SET (HDRS
BlockAnvil.h
BlockBed.h
BlockBigFlower.h
BlockBrewingStand.h
BlockButton.h
BlockCactus.h
BlockCake.h
BlockCarpet.h
BlockCauldron.h
BlockChest.h
BlockCloth.h
BlockCobWeb.h
BlockCommandBlock.h
BlockComparator.h
BlockCrops.h
BlockDeadBush.h
BlockDirt.h
BlockDoor.h
BlockDropSpenser.h
BlockEnchantmentTable.h
BlockEnderchest.h
BlockEntity.h
BlockFarmland.h
BlockFenceGate.h
BlockFire.h
BlockFlower.h
BlockFlowerPot.h
BlockFluid.h
BlockFurnace.h
BlockGlass.h
BlockGlowstone.h
BlockGravel.h
BlockHandler.h
BlockHayBale.h
BlockHopper.h
BlockIce.h
BlockLadder.h
BlockLeaves.h
BlockLever.h
BlockLilypad.h
BlockMelon.h
BlockMobHead.h
BlockMushroom.h
BlockMycelium.h
BlockNetherWart.h
BlockNewLeaves.h
BlockNote.h
BlockOre.h
BlockPiston.h
BlockPlanks.h
BlockPluginInterface.h
BlockPortal.h
BlockPressurePlate.h
BlockPumpkin.h
BlockQuartz.h
BlockRail.h
BlockRedstone.h
BlockRedstoneLamp.h
BlockRedstoneRepeater.h
BlockRedstoneTorch.h
BlockSand.h
BlockSapling.h
BlockSideways.h
BlockSignPost.h
BlockSlab.h
BlockSnow.h
BlockStairs.h
BlockStems.h
BlockStone.h
BlockSugarcane.h
BlockTNT.h
BlockTallGrass.h
BlockTorch.h
BlockTrapdoor.h
BlockTripwire.h
BlockTripwireHook.h
BlockVine.h
BlockWallSign.h
BlockWorkbench.h
BroadcastInterface.h
ChunkInterface.h
ClearMetaOnDrop.h
MetaRotator.h
WorldInterface.h)
if(NOT MSVC)
add_library(Blocks ${SRCS} ${HDRS})
endif()

View File

@ -140,7 +140,7 @@ protected:
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cByteBuffer:
cByteBuffer::cByteBuffer(size_t a_BufferSize) :

View File

@ -5,144 +5,148 @@ include_directories (SYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/../lib/")
include_directories (SYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/../lib/jsoncpp/include")
include_directories (SYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/../lib/polarssl/include")
set(FOLDERS OSSupport HTTPServer Items Blocks Protocol Generating PolarSSL++)
set(FOLDERS ${FOLDERS} WorldStorage Mobs Entities Simulator UI BlockEntities Generating/Prefabs)
set(FOLDERS
OSSupport HTTPServer Items Blocks Protocol Generating PolarSSL++ Bindings
WorldStorage Mobs Entities Simulator UI BlockEntities Generating/Prefabs
)
set(BINDING_DEPENDECIES
tolua
${CMAKE_CURRENT_SOURCE_DIR}/Bindings/virtual_method_hooks.lua
${CMAKE_CURRENT_SOURCE_DIR}/Bindings/AllToLua.pkg
Bindings/gen_LuaState_Call.lua
Bindings/LuaFunctions.h
Bindings/LuaWindow.h
Bindings/Plugin.h
Bindings/PluginLua.h
Bindings/PluginManager.h
Bindings/WebPlugin.h
SET (SRCS
BiomeDef.cpp
BlockArea.cpp
BlockID.cpp
BlockInfo.cpp
BoundingBox.cpp
ByteBuffer.cpp
ChatColor.cpp
Chunk.cpp
ChunkData.cpp
ChunkMap.cpp
ChunkSender.cpp
ChunkStay.cpp
ClientHandle.cpp
CommandOutput.cpp
CompositeChat.cpp
CraftingRecipes.cpp
Cuboid.cpp
DeadlockDetect.cpp
Enchantments.cpp
FastRandom.cpp
FurnaceRecipe.cpp
Globals.cpp
Group.cpp
GroupManager.cpp
Inventory.cpp
Item.cpp
ItemGrid.cpp
LightingThread.cpp
LineBlockTracer.cpp
LinearInterpolation.cpp
Log.cpp
MCLogger.cpp
Map.cpp
MapManager.cpp
MobCensus.cpp
MobFamilyCollecter.cpp
MobProximityCounter.cpp
MobSpawner.cpp
MonsterConfig.cpp
Noise.cpp
ProbabDistrib.cpp
RCONServer.cpp
Root.cpp
Scoreboard.cpp
Server.cpp
Statistics.cpp
StringCompression.cpp
StringUtils.cpp
Tracer.cpp
VoronoiMap.cpp
WebAdmin.cpp
World.cpp
main.cpp)
SET (HDRS
AllocationPool.h
BiomeDef.h
BlockArea.h
BlockEntities/BlockEntity.h
BlockEntities/BlockEntityWithItems.h
BlockEntities/ChestEntity.h
BlockEntities/DispenserEntity.h
BlockEntities/DropSpenserEntity.h
BlockEntities/DropperEntity.h
BlockEntities/FurnaceEntity.h
BlockEntities/HopperEntity.h
BlockEntities/JukeboxEntity.h
BlockEntities/NoteEntity.h
BlockEntities/SignEntity.h
BlockEntities/MobHeadEntity.h
BlockEntities/FlowerPotEntity.h
BlockID.h
BlockInServerPluginInterface.h
BlockInfo.h
BlockTracer.h
BoundingBox.h
ByteBuffer.h
ChatColor.h
Chunk.h
ChunkData.h
ChunkDataCallback.h
ChunkDef.h
ChunkMap.h
ChunkSender.h
ChunkStay.h
ClientHandle.h
CommandOutput.h
CompositeChat.h
CraftingRecipes.h
Cuboid.h
DeadlockDetect.h
Defines.h
Enchantments.h
Entities/EntityEffect.h
Entities/Entity.h
Entities/Floater.h
Entities/Pawn.h
Entities/Painting.h
Entities/Pickup.h
Entities/Player.h
Entities/ProjectileEntity.h
Entities/ArrowEntity.h
Entities/ThrownEggEntity.h
Entities/ThrownEnderPearlEntity.h
Entities/ExpBottleEntity.h
Entities/ThrownSnowballEntity.h
Entities/FireChargeEntity.h
Entities/FireworkEntity.h
Entities/GhastFireballEntity.h
Entities/TNTEntity.h
Entities/ExpOrb.h
Entities/HangingEntity.h
Entities/ItemFrame.h
Generating/ChunkDesc.h
Endianness.h
FastRandom.h
ForEachChunkProvider.h
FurnaceRecipe.h
Globals.h
Group.h
GroupManager.h
Inventory.h
Item.h
ItemGrid.h
Mobs/Monster.h
OSSupport/File.h
LeakFinder.h
LightingThread.h
LineBlockTracer.h
LinearInterpolation.h
LinearUpscale.h
Log.h
MCLogger.h
Map.h
MapManager.h
Matrix4.h
MemoryLeak.h
MersenneTwister.h
MobCensus.h
MobFamilyCollecter.h
MobProximityCounter.h
MobSpawner.h
MonsterConfig.h
Noise.h
ProbabDistrib.h
RCONServer.h
Root.h
Scoreboard.h
Server.h
StackWalker.h
Statistics.h
StringCompression.h
StringUtils.h
Tracer.h
UI/Window.h
Vector3.h
VoronoiMap.h
WebAdmin.h
World.h
)
XMLParser.h)
# List all the files that are generated as part of the Bindings build process
set (BINDING_OUTPUTS
${CMAKE_CURRENT_SOURCE_DIR}/Bindings/Bindings.cpp
${CMAKE_CURRENT_SOURCE_DIR}/Bindings/Bindings.h
${CMAKE_CURRENT_SOURCE_DIR}/Bindings/LuaState_Call.inc
)
include_directories(Bindings)
include_directories(.)
if (WIN32)
ADD_CUSTOM_COMMAND(
OUTPUT ${BINDING_OUTPUTS}
# Copy the Lua DLL into the Bindings folder, so that tolua can run from there:
COMMAND ${CMAKE_COMMAND} -E copy_if_different ../../MCServer/lua51.dll ./lua51.dll
# Regenerate bindings:
COMMAND tolua -L virtual_method_hooks.lua -o Bindings.cpp -H Bindings.h AllToLua.pkg
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/Bindings/
# add any new generation dependencies here
DEPENDS ${BINDING_DEPENDECIES}
)
else ()
ADD_CUSTOM_COMMAND(
# add any new generated bindings here
OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/Bindings/Bindings.cpp ${CMAKE_CURRENT_SOURCE_DIR}/Bindings/Bindings.h
# Regenerate bindings:
COMMAND tolua -L virtual_method_hooks.lua -o Bindings.cpp -H Bindings.h AllToLua.pkg
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/Bindings/
# add any new generation dependencies here
DEPENDS ${BINDING_DEPENDECIES}
)
endif ()
set_source_files_properties(Bindings/Bindings.cpp PROPERTIES GENERATED TRUE)
set_source_files_properties(Bindings/Bindings.h PROPERTIES GENERATED TRUE)
include_directories(".")
if (NOT MSVC)
# Bindings need to reference other folders, so they are done here instead
# lib dependencies are not included
include_directories ("${CMAKE_CURRENT_SOURCE_DIR}/../lib/polarssl/include")
#add cpp files here
add_library(Bindings
Bindings/Bindings
Bindings/DeprecatedBindings
Bindings/LuaChunkStay
Bindings/LuaState
Bindings/LuaWindow
Bindings/ManualBindings
Bindings/Plugin
Bindings/PluginLua
Bindings/PluginManager
Bindings/WebPlugin
)
foreach(folder ${FOLDERS})
add_subdirectory(${folder})
endforeach(folder)
target_link_libraries(Bindings lua sqlite tolualib polarssl)
get_directory_property(BINDING_DEPENDENCIES DIRECTORY "Bindings" DEFINITION BINDING_DEPENDENCIES)
#clear file
file(WRITE ${CMAKE_CURRENT_SOURCE_DIR}/Bindings/BindingDependecies.txt)
@ -153,43 +157,19 @@ if (NOT MSVC)
set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "Bindings.cpp Bindings.h")
foreach(folder ${FOLDERS})
add_subdirectory(${folder})
endforeach(folder)
file(GLOB SOURCE
"*.cpp"
"*.h"
)
list(REMOVE_ITEM SOURCE "${PROJECT_SOURCE_DIR}/StackWalker.cpp" "${PROJECT_SOURCE_DIR}/LeakFinder.cpp")
list(APPEND SOURCE "${SRCS}")
list(APPEND SOURCE "${HDRS}")
# If building a windows version, but not using MSVC, add the resources directly to the makefile:
if (WIN32)
FILE(GLOB ResourceFiles
"Resources/*.rc"
)
list(APPEND SOURCE "${ResourceFiles}")
list(APPEND SOURCE "Resources/MCServer.rc")
endif()
else ()
# MSVC-specific handling: Put all files into one project, separate by the folders:
# Get all files in this folder:
file(GLOB_RECURSE SOURCE
"*.cpp"
"*.h"
"*.pkg"
)
source_group("" FILES ${SOURCE})
LIST(APPEND SOURCE "Bindings/Bindings.cpp" "Bindings/Bindings.h")
source_group(Bindings FILES "Bindings/Bindings.cpp" "Bindings/Bindings.h")
# Add all subfolders as solution-folders:
list(APPEND FOLDERS "Resources")
list(APPEND FOLDERS "Bindings")
function(includefolder PATH)
FILE(GLOB FOLDER_FILES
"${PATH}/*.cpp"
@ -202,9 +182,29 @@ else ()
endfunction(includefolder)
foreach(folder ${FOLDERS})
add_subdirectory(${folder})
includefolder(${folder})
# Get all source files in this folder:
get_directory_property(FOLDER_SRCS DIRECTORY ${folder} DEFINITION SRCS)
foreach (src ${FOLDER_SRCS})
list(APPEND SOURCE "${folder}/${src}")
endforeach(src)
# Get all headers in this folder:
get_directory_property(FOLDER_HDRS DIRECTORY ${folder} DEFINITION HDRS)
foreach (hdr ${FOLDER_HDRS})
list(APPEND SOURCE "${folder}/${hdr}")
endforeach(hdr)
endforeach(folder)
list(APPEND SOURCE "${SRCS}")
list(APPEND SOURCE "${HDRS}")
list(APPEND SOURCE "Bindings/AllToLua.pkg")
includefolder("Resources")
source_group("" FILES ${SOURCE})
include_directories("${PROJECT_SOURCE_DIR}")
# Precompiled headers (1st part)
@ -230,6 +230,25 @@ endif()
set(EXECUTABLE MCServer)
if (MSVC)
get_directory_property(BINDING_OUTPUTS DIRECTORY "Bindings" DEFINITION BINDING_OUTPUTS)
get_directory_property(BINDING_DEPENDENCIES DIRECTORY "Bindings" DEFINITION BINDING_DEPENDENCIES)
ADD_CUSTOM_COMMAND(
OUTPUT ${BINDING_OUTPUTS}
# Copy the Lua DLL into the Bindings folder, so that tolua can run from there:
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_SOURCE_DIR}/MCServer/lua51.dll ./lua51.dll
# Regenerate bindings:
COMMAND tolua -L virtual_method_hooks.lua -o Bindings.cpp -H Bindings.h AllToLua.pkg
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/Bindings/
# add any new generation dependencies here
DEPENDS ${BINDING_DEPENDECIES}
)
endif()
add_executable(${EXECUTABLE} ${SOURCE})
@ -261,9 +280,11 @@ endif ()
if (NOT MSVC)
target_link_libraries(${EXECUTABLE} OSSupport HTTPServer Bindings Items Blocks)
target_link_libraries(${EXECUTABLE} Protocol Generating Generating_Prefabs WorldStorage)
target_link_libraries(${EXECUTABLE} Mobs Entities Simulator UI BlockEntities PolarSSL++)
target_link_libraries(${EXECUTABLE}
OSSupport HTTPServer Bindings Items Blocks
Protocol Generating Generating_Prefabs WorldStorage
Mobs Entities Simulator UI BlockEntities PolarSSL++
)
endif ()
if (WIN32)
target_link_libraries(${EXECUTABLE} expat tolualib ws2_32.lib Psapi.lib)

219
src/CheckBasicStyle.lua Normal file
View File

@ -0,0 +1,219 @@
-- CheckBasicStyle.lua
--[[
Checks that all source files (*.cpp, *.h) use the basic style requirements of the project:
- Tabs for indentation, spaces for alignment
- Trailing whitespace on non-empty lines
- 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
- (TODO) Spaces before *, /, &
- (TODO) Hex numbers with even digit length
- (TODO) Hex numbers in lowercase
- (TODO) Line dividers (////...) exactly 80 slashes
- (TODO) Not using "* "-style doxy comment continuation lines
Violations that cannot be checked easily:
- Spaces around "+" (there are things like "a++", "++a", "a += 1", "X+", "stack +1" and ascii-drawn tables)
Reports all violations on stdout in a form that is readable by Visual Studio's parser, so that dblclicking
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 =
{
["h"] = true,
["cpp"] = true,
}
--- 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",
}
--- The list of files not to be processed, as a dictionary (filename => true), built from g_IgnoredFiles
local g_ShouldIgnoreFile = {}
-- Initialize the g_ShouldIgnoreFile map:
for _, fnam in ipairs(g_IgnoredFiles) do
g_ShouldIgnoreFile[fnam] = true
end
--- Keeps track of the number of violations for this folder
local g_NumViolations = 0
--- Reports one violation
-- Pretty-prints the message
-- Also increments g_NumViolations
local function ReportViolation(a_FileName, a_LineNumber, a_PatStart, a_PatEnd, a_Message)
print(a_FileName .. "(" .. a_LineNumber .. "): " .. a_PatStart .. " .. " .. a_PatEnd .. ": " .. a_Message)
g_NumViolations = g_NumViolations + 1
end
--- Searches for the specified pattern, if found, reports it as a violation with the given message
local function ReportViolationIfFound(a_Line, a_FileName, a_LineNum, a_Pattern, a_Message)
local patStart, patEnd = a_Line:find(a_Pattern)
if not(patStart) then
return
end
ReportViolation(a_FileName, a_LineNum, patStart, patEnd, a_Message)
end
local g_ViolationPatterns =
{
-- Check against indenting using spaces:
{"^\t* +", "Indenting with a space"},
-- Check against alignment using tabs:
{"[^%s]\t+[^%s]", "Aligning with a tab"},
-- Check against trailing whitespace:
{"[^%s]%s+\n", "Trailing whitespace"},
-- Check that all "//"-style comments have at least two spaces in front (unless alone on line):
{"[^%s] //", "Needs at least two spaces in front of a \"//\"-style comment"},
-- Check that all "//"-style comments have at least one spaces after:
{"%s//[^%s/*<]", "Needs a space after a \"//\"-style comment"},
-- Check that all commas have spaces after them and not in front of them:
{" ,", "Extra space before a \",\""},
{",[^%s\"%%]", "Needs a space after a \",\""}, -- Report all except >> "," << needed for splitting and >>,%s<< needed for formatting
-- Check that opening braces are not at the end of a code line:
{"[^%s].-{\n?$", "Brace should be on a separate line"},
}
--- Processes one file
local function ProcessFile(a_FileName)
assert(type(a_FileName) == "string")
-- Read the whole file:
local f, err = io.open(a_FileName, "r")
if (f == nil) then
print("Cannot open file \"" .. a_FileName .. "\": " .. err)
print("Aborting")
os.exit(1)
end
local all = f:read("*all")
-- Check that the last line is empty - otherwise processing won't work properly:
local lastChar = string.byte(all, string.len(all))
if ((lastChar ~= 13) and (lastChar ~= 10)) then
local numLines = 1
string.gsub(all, "\n", function() numLines = numLines + 1 end) -- Count the number of line-ends
ReportViolation(a_FileName, numLines, 1, 1, "Missing empty line at file end")
return
end
-- Process each line separately:
-- Ref.: http://stackoverflow.com/questions/10416869/iterate-over-possibly-empty-lines-in-a-way-that-matches-the-expectations-of-exis
local lineCounter = 1
all:gsub("\r\n", "\n") -- normalize CRLF into LF-only
string.gsub(all .. "\n", "[^\n]*\n", -- Iterate over each line, while preserving empty lines
function(a_Line)
-- Check against each violation pattern:
for _, pat in ipairs(g_ViolationPatterns) do
ReportViolationIfFound(a_Line, a_FileName, lineCounter, pat[1], pat[2])
end
lineCounter = lineCounter + 1
end
)
end
--- Processes one item - a file or a folder
local function ProcessItem(a_ItemName)
assert(type(a_ItemName) == "string")
-- Skip files / folders that should be ignored
if (g_ShouldIgnoreFile[a_ItemName]) then
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)
end
end
-- Process the entire current folder:
ProcessItem(".")
-- Report final verdict:
print("Number of violations found: " .. g_NumViolations)
if (g_NumViolations > 0) then
os.exit(2)
else
os.exit(0)
end

View File

@ -41,7 +41,7 @@
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// sSetBlock:
sSetBlock::sSetBlock( int a_BlockX, int a_BlockY, int a_BlockZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta ) // absolute block position
@ -58,7 +58,7 @@ sSetBlock::sSetBlock( int a_BlockX, int a_BlockY, int a_BlockZ, BLOCKTYPE a_Bloc
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cChunk:
cChunk::cChunk(
@ -1727,7 +1727,7 @@ void cChunk::CollectPickupsByPlayer(cPlayer * a_Player)
{
if ((!(*itr)->IsPickup()) && (!(*itr)->IsProjectile()))
{
continue; // Only pickups and projectiles
continue; // Only pickups and projectiles can be picked up
}
float DiffX = (float)((*itr)->GetPosX() - PosX );
float DiffY = (float)((*itr)->GetPosY() - PosY );
@ -2326,7 +2326,7 @@ bool cChunk::DoWithNoteBlockAt(int a_BlockX, int a_BlockY, int a_BlockZ, cNoteBl
return false;
}
// The correct block entity is here,
// The correct block entity is here
if (a_Callback.Item((cNoteEntity *)*itr))
{
return false;
@ -2422,7 +2422,7 @@ bool cChunk::DoWithFlowerPotAt(int a_BlockX, int a_BlockY, int a_BlockZ, cFlower
return false;
}
// The correct block entity is here,
// The correct block entity is here
if (a_Callback.Item((cFlowerPotEntity *)*itr))
{
return false;

View File

@ -274,7 +274,6 @@ public:
void UseBlockEntity(cPlayer * a_Player, int a_X, int a_Y, int a_Z); // [x, y, z] in world block coords
void CalculateLighting(); // Recalculate right now
void CalculateHeightmap(const BLOCKTYPE * a_BlockTypes);
// Broadcast various packets to all clients of this chunk:

View File

@ -138,9 +138,9 @@ public:
{
#if AXIS_ORDER == AXIS_ORDER_XZY
// For some reason, NOT using the Horner schema is faster. Weird.
return x + (z * cChunkDef::Width) + (y * cChunkDef::Width * cChunkDef::Width); // 1.2 is XZY
return x + (z * cChunkDef::Width) + (y * cChunkDef::Width * cChunkDef::Width); // 1.2 uses XZY
#elif AXIS_ORDER == AXIS_ORDER_YZX
return y + (z * cChunkDef::Width) + (x * cChunkDef::Height * cChunkDef::Width); // 1.1 is YZX
return y + (z * cChunkDef::Width) + (x * cChunkDef::Height * cChunkDef::Width); // 1.1 uses YZX
#endif
}

View File

@ -33,12 +33,13 @@
////////////////////////////////////////////////////////////////////////////////
// cChunkMap:
cChunkMap::cChunkMap(cWorld * a_World )
: m_World( a_World ),
cChunkMap::cChunkMap(cWorld * a_World) :
m_World(a_World),
m_Pool(
new cListAllocationPool<cChunkData::sChunkSection, 1600>(
std::auto_ptr<cAllocationPool<cChunkData::sChunkSection>::cStarvationCallbacks>(
new cStarvationCallbacks())
new cStarvationCallbacks()
)
)
)
{
@ -1950,10 +1951,7 @@ void cChunkMap::DoExplosionAt(double a_ExplosionSize, double a_BlockX, double a_
double FinalDamage = (((1 / AbsoluteEntityPos.x) + (1 / AbsoluteEntityPos.y) + (1 / AbsoluteEntityPos.z)) * 2) * m_ExplosionSize;
// Clip damage values
if (FinalDamage > a_Entity->GetMaxHealth())
FinalDamage = a_Entity->GetMaxHealth();
else if (FinalDamage < 0)
FinalDamage = 0;
FinalDamage = Clamp(FinalDamage, 0.0, (double)a_Entity->GetMaxHealth());
if (!a_Entity->IsTNT() && !a_Entity->IsFallingBlock()) // Don't apply damage to other TNT entities and falling blocks, they should be invincible
{
@ -2735,7 +2733,7 @@ cChunkMap::cChunkLayer::~cChunkLayer()
for (size_t i = 0; i < ARRAYCOUNT(m_Chunks); ++i)
{
delete m_Chunks[i];
m_Chunks[i] = NULL; // // Must zero out, because further chunk deletions query the chunkmap for entities and that would touch deleted data
m_Chunks[i] = NULL; // Must zero out, because further chunk deletions query the chunkmap for entities and that would touch deleted data
} // for i - m_Chunks[]
}

View File

@ -17,7 +17,7 @@
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cNotifyChunkSender:
void cNotifyChunkSender::Call(int a_ChunkX, int a_ChunkZ)
@ -29,7 +29,7 @@ void cNotifyChunkSender::Call(int a_ChunkX, int a_ChunkZ)
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cChunkSender:
cChunkSender::cChunkSender(void) :

View File

@ -60,7 +60,7 @@ int cClientHandle::s_ClientCount = 0;
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cClientHandle:
cClientHandle::cClientHandle(const cSocket * a_Socket, int a_ViewDistance) :
@ -1209,11 +1209,12 @@ void cClientHandle::HandleRightClick(int a_BlockX, int a_BlockY, int a_BlockZ, e
{
HandlePlaceBlock(a_BlockX, a_BlockY, a_BlockZ, a_BlockFace, a_CursorX, a_CursorY, a_CursorZ, *ItemHandler);
}
else if ((ItemHandler->IsFood() || ItemHandler->IsDrinkable(EquippedDamage)) && !m_Player->IsGameModeCreative())
else if ((ItemHandler->IsFood() || ItemHandler->IsDrinkable(EquippedDamage)))
{
if (m_Player->IsSatiated() && !ItemHandler->IsDrinkable(EquippedDamage))
if ((m_Player->IsSatiated() || m_Player->IsGameModeCreative()) &&
ItemHandler->IsFood())
{
// The player is satiated, they cannot eat
// The player is satiated or in creative, and trying to eat
return;
}
m_Player->StartEating();
@ -1457,8 +1458,10 @@ void cClientHandle::HandleAnimation(char a_Animation)
break;
}
default: // Anything else is the same
{
break;
}
}
m_Player->GetWorld()->BroadcastEntityAnimation(*m_Player, a_Animation, this);
}

View File

@ -271,15 +271,14 @@ public:
private:
/** Handles the block placing packet when it is a real block placement (not block-using, item-using or eating) */
void HandlePlaceBlock(int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace, int a_CursorX, int a_CursorY, int a_CursorZ, cItemHandler & a_ItemHandler);
/** The type used for storing the names of registered plugin channels. */
typedef std::set<AString> cChannels;
int m_ViewDistance; // 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; 4 is the minimum ( http://wiki.vg/Protocol_FAQ#.E2.80.A6all_connecting_clients_spasm_and_jerk_uncontrollably.21 ) */
int m_ViewDistance;
static const int GENERATEDISTANCE = 2; // Server generates this many chunks AHEAD of player sight. 2 is the minimum, since foliage is generated 1 step behind chunk terrain generation
/** Server generates this many chunks AHEAD of player sight. */
static const int GENERATEDISTANCE = 2;
AString m_IPString;
@ -317,7 +316,7 @@ private:
int m_PingID;
long long m_PingStartTime;
long long m_LastPingTime;
static const unsigned short PING_TIME_MS = 1000; //minecraft sends 1 per 20 ticks (1 second or every 1000 ms)
static const unsigned short PING_TIME_MS = 1000; // Vanilla sends 1 per 20 ticks (1 second or every 1000 ms)
// Values required for block dig animation
int m_BlockDigAnimStage; // Current stage of the animation; -1 if not digging
@ -374,6 +373,9 @@ private:
cChannels m_PluginChannels;
/** Handles the block placing packet when it is a real block placement (not block-using, item-using or eating) */
void HandlePlaceBlock(int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace, int a_CursorX, int a_CursorY, int a_CursorZ, cItemHandler & a_ItemHandler);
/** Returns true if the rate block interactions is within a reasonable limit (bot protection) */
bool CheckBlockInteractionsRate(void);

View File

@ -10,7 +10,7 @@
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cCommandOutputCallback:
void cCommandOutputCallback::Out(const char * a_Fmt, ...)
@ -28,7 +28,7 @@ void cCommandOutputCallback::Out(const char * a_Fmt, ...)
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cLogCommandOutputCallback:
void cLogCommandOutputCallback::Out(const AString & a_Text)

View File

@ -100,7 +100,7 @@ public:
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cCompositeChat:
cCompositeChat::cCompositeChat(void) :
@ -399,7 +399,7 @@ void cCompositeChat::AddStyle(AString & a_Style, const AString & a_AddStyle)
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cCompositeChat::cBasePart:
cCompositeChat::cBasePart::cBasePart(cCompositeChat::ePartType a_PartType, const AString & a_Text, const AString & a_Style) :
@ -413,7 +413,7 @@ cCompositeChat::cBasePart::cBasePart(cCompositeChat::ePartType a_PartType, const
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cCompositeChat::cTextPart:
cCompositeChat::cTextPart::cTextPart(const AString & a_Text, const AString &a_Style) :
@ -425,7 +425,7 @@ cCompositeChat::cTextPart::cTextPart(const AString & a_Text, const AString &a_St
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cCompositeChat::cClientTranslatedPart:
cCompositeChat::cClientTranslatedPart::cClientTranslatedPart(const AString & a_TranslationID, const AStringVector & a_Parameters, const AString & a_Style) :
@ -438,7 +438,7 @@ cCompositeChat::cClientTranslatedPart::cClientTranslatedPart(const AString & a_T
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cCompositeChat::cUrlPart:
cCompositeChat::cUrlPart::cUrlPart(const AString & a_Text, const AString & a_Url, const AString & a_Style) :
@ -451,7 +451,7 @@ cCompositeChat::cUrlPart::cUrlPart(const AString & a_Text, const AString & a_Url
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cCompositeChat::cCommandPart:
cCompositeChat::cCommandPart::cCommandPart(ePartType a_PartType, const AString & a_Text, const AString & a_Command, const AString & a_Style) :
@ -464,7 +464,7 @@ cCompositeChat::cCommandPart::cCommandPart(ePartType a_PartType, const AString &
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cCompositeChat::cRunCommandPart:
cCompositeChat::cRunCommandPart::cRunCommandPart(const AString & a_Text, const AString & a_Command, const AString & a_Style) :
@ -475,7 +475,7 @@ cCompositeChat::cRunCommandPart::cRunCommandPart(const AString & a_Text, const A
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cCompositeChat::cSuggestCommandPart:
cCompositeChat::cSuggestCommandPart::cSuggestCommandPart(const AString & a_Text, const AString & a_Command, const AString & a_Style) :
@ -487,7 +487,7 @@ cCompositeChat::cSuggestCommandPart::cSuggestCommandPart(const AString & a_Text,
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cCompositeChat::cShowAchievementPart:
cCompositeChat::cShowAchievementPart::cShowAchievementPart(const AString & a_PlayerName, const AString & a_Achievement, const AString & a_Style) :

View File

@ -12,7 +12,7 @@
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cCraftingGrid:
cCraftingGrid::cCraftingGrid(int a_Width, int a_Height) :
@ -206,7 +206,7 @@ void cCraftingGrid::Dump(void)
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cCraftingRecipe:
cCraftingRecipe::cCraftingRecipe(const cCraftingGrid & a_CraftingGrid) :
@ -259,7 +259,7 @@ void cCraftingRecipe::Dump(void)
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cCraftingRecipes:
cCraftingRecipes::cCraftingRecipes(void)

View File

@ -21,7 +21,7 @@ static bool DoIntervalsIntersect(int a_Min1, int a_Max1, int a_Min2, int a_Max2)
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cCuboid:
void cCuboid::Assign(int a_X1, int a_Y1, int a_Z1, int a_X2, int a_Y2, int a_Z2)

View File

@ -1,7 +1,6 @@
#pragma once
#include "ChatColor.h"
#include <limits>
#include <cmath>
@ -22,7 +21,7 @@ typedef std::vector<int> cSlotNums;
/// Experience Orb setup
enum
{
//open to suggestion on naming convention here :)
// Open to suggestion on naming convention here :)
MAX_EXPERIENCE_ORB_SIZE = 2000
} ;
@ -471,18 +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);
if (Y < 0)
{
a_BlockY = 0;
}
else if (Y > 255)
{
a_BlockY = 255;
}
else
{
a_BlockY = (unsigned char)Y;
}
a_BlockY = Clamp<unsigned char>(Y, 0, 255);
}

View File

@ -4,11 +4,64 @@ project (MCServer)
include_directories ("${PROJECT_SOURCE_DIR}/../")
file(GLOB SOURCE
"*.cpp"
"*.h"
)
SET (SRCS
ArrowEntity.cpp
Boat.cpp
EnderCrystal.cpp
Entity.cpp
EntityEffect.cpp
ExpBottleEntity.cpp
ExpOrb.cpp
FallingBlock.cpp
FireChargeEntity.cpp
FireworkEntity.cpp
Floater.cpp
GhastFireballEntity.cpp
HangingEntity.cpp
ItemFrame.cpp
Minecart.cpp
Painting.cpp
Pawn.cpp
Pickup.cpp
Player.cpp
ProjectileEntity.cpp
SplashPotionEntity.cpp
TNTEntity.cpp
ThrownEggEntity.cpp
ThrownEnderPearlEntity.cpp
ThrownSnowballEntity.cpp
WitherSkullEntity.cpp)
add_library(Entities ${SOURCE})
SET (HDRS
ArrowEntity.h
Boat.h
EnderCrystal.h
Entity.h
EntityEffect.h
ExpBottleEntity.h
ExpOrb.h
FallingBlock.h
FireChargeEntity.h
FireworkEntity.h
Floater.h
GhastFireballEntity.h
HangingEntity.h
ItemFrame.h
Minecart.h
Painting.h
Pawn.h
Pickup.h
Player.h
ProjectileEntity.h
SplashPotionEntity.h
TNTEntity.h
ThrownEggEntity.h
ThrownEnderPearlEntity.h
ThrownSnowballEntity.h
WitherSkullEntity.h)
if(NOT MSVC)
add_library(Entities ${SRCS} ${HDRS})
target_link_libraries(Entities WorldStorage)
endif()

View File

@ -49,6 +49,7 @@ cEntity::cEntity(eEntityType a_EntityType, double a_X, double a_Y, double a_Z, d
, m_IsSubmerged(false)
, m_AirLevel(0)
, m_AirTickTimer(0)
, m_TicksAlive(0)
, m_HeadYaw(0.0)
, m_Rot(0.0, 0.0, 0.0)
, m_Pos(a_X, a_Y, a_Z)
@ -327,10 +328,7 @@ bool cEntity::DoTakeDamage(TakeDamageInfo & a_TDI)
// TODO: Apply damage to armor
if (m_Health < 0)
{
m_Health = 0;
}
m_Health = std::max(m_Health, 0);
if ((IsMob() || IsPlayer()) && (a_TDI.Attacker != NULL)) // Knockback for only players and mobs
{
@ -562,6 +560,8 @@ void cEntity::SetHealth(int a_Health)
void cEntity::Tick(float a_Dt, cChunk & a_Chunk)
{
m_TicksAlive++;
if (m_InvulnerableTicks > 0)
{
m_InvulnerableTicks--;
@ -1146,10 +1146,7 @@ void cEntity::SetMaxHealth(int a_MaxHealth)
m_MaxHealth = a_MaxHealth;
// Reset health, if too high:
if (m_Health > a_MaxHealth)
{
m_Health = a_MaxHealth;
}
m_Health = std::min(m_Health, a_MaxHealth);
}
@ -1572,7 +1569,7 @@ void cEntity::SteerVehicle(float a_Forward, float a_Sideways)
//////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// Get look vector (this is NOT a rotation!)
Vector3d cEntity::GetLookVector(void) const
{
@ -1586,7 +1583,7 @@ Vector3d cEntity::GetLookVector(void) const
//////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// Set position
void cEntity::SetPosition(double a_PosX, double a_PosY, double a_PosZ)
{

View File

@ -416,6 +416,9 @@ public:
/** Gets remaining air of a monster */
int GetAirLevel(void) const { return m_AirLevel; }
/** Gets number of ticks this entity has existed for */
long int GetTicksAlive(void) const { return m_TicksAlive; }
/** Gets the invulnerable ticks from the entity */
int GetInvulnerableTicks(void) const { return m_InvulnerableTicks; }
@ -521,6 +524,9 @@ protected:
int m_AirLevel;
int m_AirTickTimer;
/** The number of ticks this entity has been alive for */
long int m_TicksAlive;
private:
/** Measured in degrees, [-180, +180) */
double m_HeadYaw;

View File

@ -108,7 +108,7 @@ void cEntityEffect::OnTick(cPawn & a_Target)
/////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cEntityEffectInstantHealth:
void cEntityEffectInstantHealth::OnActivate(cPawn & a_Target)
@ -128,7 +128,7 @@ void cEntityEffectInstantHealth::OnActivate(cPawn & a_Target)
/////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cEntityEffectInstantDamage:
void cEntityEffectInstantDamage::OnActivate(cPawn & a_Target)
@ -148,7 +148,7 @@ void cEntityEffectInstantDamage::OnActivate(cPawn & a_Target)
/////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cEntityEffectRegeneration:
void cEntityEffectRegeneration::OnTick(cPawn & a_Target)
@ -175,7 +175,7 @@ void cEntityEffectRegeneration::OnTick(cPawn & a_Target)
/////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cEntityEffectHunger:
void cEntityEffectHunger::OnTick(cPawn & a_Target)
@ -193,7 +193,7 @@ void cEntityEffectHunger::OnTick(cPawn & a_Target)
/////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cEntityEffectWeakness:
void cEntityEffectWeakness::OnTick(cPawn & a_Target)
@ -211,7 +211,7 @@ void cEntityEffectWeakness::OnTick(cPawn & a_Target)
/////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cEntityEffectPoison:
void cEntityEffectPoison::OnTick(cPawn & a_Target)
@ -250,7 +250,7 @@ void cEntityEffectPoison::OnTick(cPawn & a_Target)
/////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cEntityEffectWither:
void cEntityEffectWither::OnTick(cPawn & a_Target)
@ -270,7 +270,7 @@ void cEntityEffectWither::OnTick(cPawn & a_Target)
/////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cEntityEffectSaturation:
void cEntityEffectSaturation::OnTick(cPawn & a_Target)

View File

@ -11,7 +11,7 @@
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cFloaterEntityCollisionCallback
class cFloaterEntityCollisionCallback :
public cEntityCallback
@ -75,7 +75,7 @@ protected:
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cFloaterCheckEntityExist
class cFloaterCheckEntityExist :
public cEntityCallback

View File

@ -103,21 +103,7 @@ cMinecart::cMinecart(ePayload a_Payload, double a_X, double a_Y, double a_Z) :
void cMinecart::SpawnOn(cClientHandle & a_ClientHandle)
{
char SubType = 0;
switch (m_Payload)
{
case mpNone: SubType = 0; break;
case mpChest: SubType = 1; break;
case mpFurnace: SubType = 2; break;
case mpTNT: SubType = 3; break;
case mpHopper: SubType = 5; break;
default:
{
ASSERT(!"Unknown payload, cannot spawn on client");
return;
}
}
a_ClientHandle.SendSpawnVehicle(*this, 10, SubType); // 10 = Minecarts, SubType = What type of Minecart
a_ClientHandle.SendSpawnVehicle(*this, 10, (char)m_Payload); // 10 = Minecarts
a_ClientHandle.SendEntityMetadata(*this);
}
@ -980,7 +966,7 @@ void cMinecart::Destroyed()
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cRideableMinecart:
cRideableMinecart::cRideableMinecart(double a_X, double a_Y, double a_Z, const cItem & a_Content, int a_Height) :
@ -1023,7 +1009,7 @@ void cRideableMinecart::OnRightClicked(cPlayer & a_Player)
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cMinecartWithChest:
cMinecartWithChest::cMinecartWithChest(double a_X, double a_Y, double a_Z) :
@ -1056,7 +1042,7 @@ void cMinecartWithChest::OnRightClicked(cPlayer & a_Player)
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cMinecartWithFurnace:
cMinecartWithFurnace::cMinecartWithFurnace(double a_X, double a_Y, double a_Z) :
@ -1118,7 +1104,7 @@ void cMinecartWithFurnace::Tick(float a_Dt, cChunk & a_Chunk)
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cMinecartWithTNT:
cMinecartWithTNT::cMinecartWithTNT(double a_X, double a_Y, double a_Z) :
@ -1132,7 +1118,7 @@ cMinecartWithTNT::cMinecartWithTNT(double a_X, double a_Y, double a_Z) :
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cMinecartWithHopper:
cMinecartWithHopper::cMinecartWithHopper(double a_X, double a_Y, double a_Z) :

View File

@ -23,13 +23,14 @@ class cMinecart :
public:
CLASS_PROTODEF(cMinecart);
/** Minecart payload, values correspond to packet subtype */
enum ePayload
{
mpNone, // Empty minecart, ridable by player or mobs
mpChest, // Minecart-with-chest, can store a grid of 3*8 items
mpFurnace, // Minecart-with-furnace, can be powered
mpTNT, // Minecart-with-TNT, can be blown up with activator rail
mpHopper, // Minecart-with-hopper, can be hopper
mpNone = 0, // Empty minecart, ridable by player or mobs
mpChest = 1, // Minecart-with-chest, can store a grid of 3*8 items
mpFurnace = 2, // Minecart-with-furnace, can be powered
mpTNT = 3, // Minecart-with-TNT, can be blown up with activator rail
mpHopper = 5, // Minecart-with-hopper, can be hopper
// TODO: Spawner minecarts, (and possibly any block in a minecart with NBT editing)
} ;

View File

@ -2,6 +2,7 @@
#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules
#include "Player.h"
#include "../ChatColor.h"
#include "../Server.h"
#include "../UI/Window.h"
#include "../UI/WindowOwner.h"
@ -381,10 +382,7 @@ short cPlayer::DeltaExperience(short a_Xp_delta)
m_CurrentXp += a_Xp_delta;
// Make sure they didn't subtract too much
if (m_CurrentXp < 0)
{
m_CurrentXp = 0;
}
m_CurrentXp = std::max<short int>(m_CurrentXp, 0);
// Update total for score calculation
if (a_Xp_delta > 0)
@ -580,7 +578,7 @@ bool cPlayer::Feed(int a_Food, double a_Saturation)
void cPlayer::FoodPoison(int a_NumTicks)
{
AddEntityEffect(cEntityEffect::effHunger, a_NumTicks, 0, NULL);
AddEntityEffect(cEntityEffect::effHunger, a_NumTicks, 0, 1);
}
@ -624,7 +622,8 @@ void cPlayer::FinishEating(void)
GetInventory().RemoveOneEquippedItem();
// if the food is mushroom soup, return a bowl to the inventory
if( Item.m_ItemType == E_ITEM_MUSHROOM_SOUP ) {
if (Item.m_ItemType == E_ITEM_MUSHROOM_SOUP)
{
cItem emptyBowl(E_ITEM_BOWL, 1, 0, "");
GetInventory().AddItem(emptyBowl, true, true);
}
@ -905,6 +904,7 @@ void cPlayer::KilledBy(TakeDamageInfo & a_TDI)
case dtCactusContact: DamageText = "was impaled on a cactus"; break;
case dtLavaContact: DamageText = "was melted by lava"; break;
case dtPoisoning: DamageText = "died from septicaemia"; break;
case dtWithering: DamageText = "is a husk of their former selves"; break;
case dtOnFire: DamageText = "forgot to stop, drop, and roll"; break;
case dtFireContact: DamageText = "burnt themselves to death"; break;
case dtInVoid: DamageText = "somehow fell out of the world"; break;
@ -1454,7 +1454,7 @@ bool cPlayer::IsInGroup( const AString & a_Group )
void cPlayer::ResolvePermissions()
{
m_ResolvedPermissions.clear(); // Start with an empty map yo~
m_ResolvedPermissions.clear(); // Start with an empty map
// Copy all player specific permissions into the resolved permissions map
for( PermissionMap::iterator itr = m_Permissions.begin(); itr != m_Permissions.end(); ++itr )

View File

@ -35,7 +35,7 @@
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cProjectileTracerCallback:
class cProjectileTracerCallback :
@ -122,7 +122,7 @@ protected:
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cProjectileEntityCollisionCallback:
class cProjectileEntityCollisionCallback :
@ -146,10 +146,12 @@ public:
(a_Entity->GetUniqueID() == m_Projectile->GetCreatorUniqueID()) // Do not check whoever shot the projectile
)
{
// TODO: Don't check creator only for the first 5 ticks
// so that arrows stuck in ground and dug up can hurt the player
// Don't check creator only for the first 5 ticks so that projectiles can collide with the creator
if (m_Projectile->GetTicksAlive() <= 5)
{
return false;
}
}
cBoundingBox EntBox(a_Entity->GetPosition(), a_Entity->GetWidth() / 2, a_Entity->GetHeight());
@ -211,7 +213,7 @@ protected:
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cProjectileEntity:
cProjectileEntity::cProjectileEntity(eKind a_Kind, cEntity * a_Creator, double a_X, double a_Y, double a_Z, double a_Width, double a_Height) :

View File

@ -2,12 +2,16 @@
#include "SplashPotionEntity.h"
#include "Pawn.h"
#include "../ClientHandle.h"
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Converts an angle in radians into a byte representation used by the network protocol
#define ANGLE_TO_PROTO(X) (Byte)(X * 255 / 360)
////////////////////////////////////////////////////////////////////////////////
// cSplashPotionEntityCallback:
/** Used to distribute the splashed potion effect among nearby entities */
@ -44,10 +48,7 @@ public:
// y = -0.25x + 1, where x is the distance from the player. Approximation for potion splash.
// TODO: better equation
double Reduction = -0.25 * SplashDistance + 1.0;
if (Reduction < 0)
{
Reduction = 0;
}
Reduction = std::max(Reduction, 0.0);
((cPawn *) a_Entity)->AddEntityEffect(m_EntityEffectType, m_EntityEffect.GetDuration(), m_EntityEffect.GetIntensity(), Reduction);
return false;
@ -63,7 +64,7 @@ private:
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cSplashPotionEntity:
cSplashPotionEntity::cSplashPotionEntity(
@ -72,12 +73,13 @@ cSplashPotionEntity::cSplashPotionEntity(
const Vector3d & a_Speed,
cEntityEffect::eType a_EntityEffectType,
cEntityEffect a_EntityEffect,
int a_PotionParticleType
int a_PotionColor
) :
super(pkSplashPotion, a_Creator, a_X, a_Y, a_Z, 0.25, 0.25),
m_EntityEffectType(a_EntityEffectType),
m_EntityEffect(a_EntityEffect),
m_PotionParticleType(a_PotionParticleType)
m_PotionColor(a_PotionColor),
m_DestroyTimer(-1)
{
SetSpeed(a_Speed);
}
@ -89,7 +91,7 @@ cSplashPotionEntity::cSplashPotionEntity(
void cSplashPotionEntity::OnHitSolidBlock(const Vector3d & a_HitPos, eBlockFace a_HitFace)
{
Splash(a_HitPos);
Destroy();
m_DestroyTimer = 2;
}
@ -100,7 +102,7 @@ void cSplashPotionEntity::OnHitEntity(cEntity & a_EntityHit, const Vector3d & a_
{
a_EntityHit.TakeDamage(dtRangedAttack, this, 0, 1);
Splash(a_HitPos);
Destroy(true);
m_DestroyTimer = 5;
}
@ -112,7 +114,17 @@ 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_PotionParticleType);
m_World->BroadcastSoundParticleEffect(2002, (int)a_HitPos.x, (int)a_HitPos.y, (int)a_HitPos.z, m_PotionColor);
}
void cSplashPotionEntity::SpawnOn(cClientHandle & a_Client)
{
a_Client.SendSpawnObject(*this, 73, m_PotionColor, ANGLE_TO_PROTO(GetYaw()), ANGLE_TO_PROTO(GetPitch()));
a_Client.SendEntityMetadata(*this);
}

View File

@ -31,29 +31,51 @@ public:
const Vector3d & a_Speed,
cEntityEffect::eType a_EntityEffectType,
cEntityEffect a_EntityEffect,
int a_PotionParticleType
int a_PotionColor
);
cEntityEffect::eType GetEntityEffectType(void) const { return m_EntityEffectType; }
cEntityEffect GetEntityEffect(void) const { return m_EntityEffect; }
int GetPotionParticleType(void) const { return m_PotionParticleType; }
int GetPotionColor(void) const { return m_PotionColor; }
void SetEntityEffectType(cEntityEffect::eType a_EntityEffectType) { m_EntityEffectType = a_EntityEffectType; }
void SetEntityEffect(cEntityEffect a_EntityEffect) { m_EntityEffect = a_EntityEffect; }
void SetPotionParticleType(int a_PotionParticleType) { m_PotionParticleType = a_PotionParticleType; }
void SetPotionColor(int a_PotionColor) { m_PotionColor = a_PotionColor; }
protected:
cEntityEffect::eType m_EntityEffectType;
cEntityEffect m_EntityEffect;
int m_PotionParticleType;
int m_PotionColor;
// cProjectileEntity overrides:
virtual void OnHitSolidBlock(const Vector3d & a_HitPos, eBlockFace a_HitFace) override;
virtual void OnHitEntity (cEntity & a_EntityHit, const Vector3d & a_HitPos) override;
virtual void Tick (float a_Dt, cChunk & a_Chunk) override
{
if (m_DestroyTimer > 0)
{
m_DestroyTimer--;
if (m_DestroyTimer == 0)
{
Destroy();
return;
}
}
else
{
super::Tick(a_Dt, a_Chunk);
}
}
/** Splashes the potion, fires its particle effects and sounds
@param a_HitPos The position where the potion will splash */
void Splash(const Vector3d & a_HitPos);
virtual void SpawnOn(cClientHandle & a_Client) override;
private:
/** Time in ticks to wait for the hit animation to begin before destroying */
int m_DestroyTimer;
} ; // tolua_export

View File

@ -12,7 +12,7 @@
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cBiomeGen:
cBiomeGen * cBiomeGen::CreateBiomeGen(cIniFile & a_IniFile, int a_Seed, bool & a_CacheOffByDefault)
@ -78,7 +78,7 @@ cBiomeGen * cBiomeGen::CreateBiomeGen(cIniFile & a_IniFile, int a_Seed, bool & a
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cBioGenConstant:
void cBioGenConstant::GenBiomes(int a_ChunkX, int a_ChunkZ, cChunkDef::BiomeMap & a_BiomeMap)
@ -108,7 +108,7 @@ void cBioGenConstant::InitializeBiomeGen(cIniFile & a_IniFile)
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cBioGenCache:
cBioGenCache::cBioGenCache(cBiomeGen * a_BioGenToCache, int a_CacheSize) :
@ -209,7 +209,7 @@ void cBioGenCache::InitializeBiomeGen(cIniFile & a_IniFile)
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cBiomeGenList:
void cBiomeGenList::InitializeBiomes(const AString & a_Biomes)
@ -290,7 +290,7 @@ void cBiomeGenList::InitializeBiomes(const AString & a_Biomes)
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cBioGenCheckerboard:
void cBioGenCheckerboard::GenBiomes(int a_ChunkX, int a_ChunkZ, cChunkDef::BiomeMap & a_BiomeMap)
@ -324,7 +324,7 @@ void cBioGenCheckerboard::InitializeBiomeGen(cIniFile & a_IniFile)
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cBioGenVoronoi :
void cBioGenVoronoi::GenBiomes(int a_ChunkX, int a_ChunkZ, cChunkDef::BiomeMap & a_BiomeMap)
@ -357,7 +357,7 @@ void cBioGenVoronoi::InitializeBiomeGen(cIniFile & a_IniFile)
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cBioGenDistortedVoronoi:
void cBioGenDistortedVoronoi::GenBiomes(int a_ChunkX, int a_ChunkZ, cChunkDef::BiomeMap & a_BiomeMap)
@ -418,7 +418,7 @@ void cBioGenDistortedVoronoi::Distort(int a_BlockX, int a_BlockZ, int & a_Distor
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cBioGenMultiStepMap :
cBioGenMultiStepMap::cBioGenMultiStepMap(int a_Seed) :
@ -739,7 +739,7 @@ void cBioGenMultiStepMap::FreezeWaterBiomes(cChunkDef::BiomeMap & a_BiomeMap, co
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cBioGenTwoLevel:
cBioGenTwoLevel::cBioGenTwoLevel(int a_Seed) :

View File

@ -4,11 +4,62 @@ project (MCServer)
include_directories ("${PROJECT_SOURCE_DIR}/../")
file(GLOB SOURCE
"*.cpp"
"*.h"
)
SET (SRCS
BioGen.cpp
Caves.cpp
ChunkDesc.cpp
ChunkGenerator.cpp
CompoGen.cpp
ComposableGenerator.cpp
DistortedHeightmap.cpp
EndGen.cpp
FinishGen.cpp
GridStructGen.cpp
HeiGen.cpp
MineShafts.cpp
NetherFortGen.cpp
Noise3DGenerator.cpp
POCPieceGenerator.cpp
PieceGenerator.cpp
Prefab.cpp
PrefabPiecePool.cpp
RainbowRoadsGen.cpp
Ravines.cpp
StructGen.cpp
TestRailsGen.cpp
Trees.cpp
UnderwaterBaseGen.cpp
VillageGen.cpp)
add_library(Generating ${SOURCE})
SET (HDRS
BioGen.h
Caves.h
ChunkDesc.h
ChunkGenerator.h
CompoGen.h
ComposableGenerator.h
DistortedHeightmap.h
EndGen.h
FinishGen.h
GridStructGen.h
HeiGen.h
MineShafts.h
NetherFortGen.h
Noise3DGenerator.h
POCPieceGenerator.h
PieceGenerator.h
Prefab.h
PrefabPiecePool.h
RainbowRoadsGen.h
Ravines.h
StructGen.h
TestRailsGen.h
Trees.h
UnderwaterBaseGen.h
VillageGen.h)
if(NOT MSVC)
add_library(Generating ${SRCS} ${HDRS})
target_link_libraries(Generating OSSupport iniFile Blocks)
endif()

View File

@ -151,7 +151,7 @@ protected:
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cCaveTunnel:
cCaveTunnel::cCaveTunnel(
@ -571,7 +571,7 @@ AString cCaveTunnel::ExportAsSVG(int a_Color, int a_OffsetX, int a_OffsetZ) cons
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cStructGenWormNestCaves::cCaveSystem:
cStructGenWormNestCaves::cCaveSystem::cCaveSystem(int a_GridX, int a_GridZ, int a_OriginX, int a_OriginZ, int a_MaxOffset, int a_Size, cNoise & a_Noise) :
@ -687,7 +687,7 @@ int cStructGenWormNestCaves::cCaveSystem::GetRadius(cNoise & a_Noise, int a_Orig
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cStructGenWormNestCaves:
cGridStructGen::cStructurePtr cStructGenWormNestCaves::CreateStructure(int a_GridX, int a_GridZ, int a_OriginX, int a_OriginZ)
@ -700,7 +700,7 @@ cGridStructGen::cStructurePtr cStructGenWormNestCaves::CreateStructure(int a_Gri
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cStructGenMarbleCaves:
static float GetMarbleNoise( float x, float y, float z, cNoise & a_Noise )
@ -752,7 +752,7 @@ void cStructGenMarbleCaves::GenFinish(cChunkDesc & a_ChunkDesc)
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cStructGenDualRidgeCaves:
void cStructGenDualRidgeCaves::GenFinish(cChunkDesc & a_ChunkDesc)

View File

@ -22,7 +22,7 @@ const unsigned int QUEUE_SKIP_LIMIT = 500;
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cChunkGenerator:
cChunkGenerator::cChunkGenerator(void) :
@ -290,7 +290,7 @@ void cChunkGenerator::DoGenerate(int a_ChunkX, int a_ChunkY, int a_ChunkZ)
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cChunkGenerator::cGenerator:
cChunkGenerator::cGenerator::cGenerator(cChunkGenerator & a_ChunkGenerator) :

View File

@ -18,7 +18,7 @@
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cCompoGenSameBlock:
void cCompoGenSameBlock::ComposeTerrain(cChunkDesc & a_ChunkDesc)
@ -60,7 +60,7 @@ void cCompoGenSameBlock::InitializeCompoGen(cIniFile & a_IniFile)
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cCompoGenDebugBiomes:
void cCompoGenDebugBiomes::ComposeTerrain(cChunkDesc & a_ChunkDesc)
@ -111,7 +111,7 @@ void cCompoGenDebugBiomes::ComposeTerrain(cChunkDesc & a_ChunkDesc)
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cCompoGenClassic:
cCompoGenClassic::cCompoGenClassic(void) :
@ -209,7 +209,7 @@ void cCompoGenClassic::InitializeCompoGen(cIniFile & a_IniFile)
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cCompoGenBiomal:
void cCompoGenBiomal::ComposeTerrain(cChunkDesc & a_ChunkDesc)
@ -526,7 +526,7 @@ void cCompoGenBiomal::FillColumnPattern(int a_RelX, int a_RelZ, int a_Height, cC
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cCompoGenNether:
cCompoGenNether::cCompoGenNether(int a_Seed) :
@ -645,7 +645,7 @@ void cCompoGenNether::InitializeCompoGen(cIniFile & a_IniFile)
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cCompoGenCache:
cCompoGenCache::cCompoGenCache(cTerrainCompositionGen & a_Underlying, int a_CacheSize) :

View File

@ -34,7 +34,7 @@
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cTerrainCompositionGen:
cTerrainCompositionGen * cTerrainCompositionGen::CreateCompositionGen(cIniFile & a_IniFile, cBiomeGen & a_BiomeGen, cTerrainHeightGen & a_HeightGen, int a_Seed)
@ -114,7 +114,7 @@ cTerrainCompositionGen * cTerrainCompositionGen::CreateCompositionGen(cIniFile &
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cComposableGenerator:
cComposableGenerator::cComposableGenerator(cChunkGenerator & a_ChunkGenerator) :

View File

@ -14,7 +14,7 @@
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cPattern:
/// This class is used to store a column pattern initialized at runtime,
@ -50,7 +50,7 @@ protected:
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// The arrays to use for the top block pattern definitions:
static cDistortedHeightmap::sBlockInfo tbGrass[] =
@ -119,7 +119,7 @@ static cDistortedHeightmap::sBlockInfo tbStone[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// Ocean floor pattern top-block definitions:
static cDistortedHeightmap::sBlockInfo tbOFSand[] =
@ -151,7 +151,7 @@ static cDistortedHeightmap::sBlockInfo tbOFRedSand[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// Individual patterns to use:
static cPattern patGrass (tbGrass, ARRAYCOUNT(tbGrass));
@ -171,7 +171,7 @@ static cPattern patOFRedSand(tbOFRedSand, ARRAYCOUNT(tbOFRedSand));
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cDistortedHeightmap:
/** This table assigns a relative maximum overhang size in each direction to biomes.

View File

@ -29,7 +29,7 @@ enum
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cEndGen:
cEndGen::cEndGen(int a_Seed) :

View File

@ -40,7 +40,7 @@ static inline bool IsWater(BLOCKTYPE a_BlockType)
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cFinishGenNetherClumpFoliage:
void cFinishGenNetherClumpFoliage::GenFinish(cChunkDesc & a_ChunkDesc)
@ -159,7 +159,7 @@ void cFinishGenNetherClumpFoliage::TryPlaceClump(cChunkDesc & a_ChunkDesc, int a
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cFinishGenSprinkleFoliage:
bool cFinishGenSprinkleFoliage::TryAddSugarcane(cChunkDesc & a_ChunkDesc, int a_RelX, int a_RelY, int a_RelZ)
@ -309,7 +309,7 @@ void cFinishGenSprinkleFoliage::GenFinish(cChunkDesc & a_ChunkDesc)
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cFinishGenSnow:
void cFinishGenSnow::GenFinish(cChunkDesc & a_ChunkDesc)
@ -345,7 +345,7 @@ void cFinishGenSnow::GenFinish(cChunkDesc & a_ChunkDesc)
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cFinishGenIce:
void cFinishGenIce::GenFinish(cChunkDesc & a_ChunkDesc)
@ -385,7 +385,7 @@ void cFinishGenIce::GenFinish(cChunkDesc & a_ChunkDesc)
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cFinishGenLilypads:
int cFinishGenSingleBiomeSingleTopBlock::GetNumToGen(const cChunkDef::BiomeMap & a_BiomeMap)
@ -447,7 +447,7 @@ void cFinishGenSingleBiomeSingleTopBlock::GenFinish(cChunkDesc & a_ChunkDesc)
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cFinishGenBottomLava:
void cFinishGenBottomLava::GenFinish(cChunkDesc & a_ChunkDesc)
@ -470,7 +470,7 @@ void cFinishGenBottomLava::GenFinish(cChunkDesc & a_ChunkDesc)
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cFinishGenPreSimulator:
cFinishGenPreSimulator::cFinishGenPreSimulator(void)
@ -637,7 +637,7 @@ void cFinishGenPreSimulator::StationarizeFluid(
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cFinishGenFluidSprings:
cFinishGenFluidSprings::cFinishGenFluidSprings(int a_Seed, BLOCKTYPE a_Fluid, cIniFile & a_IniFile, eDimension a_Dimension) :

View File

@ -9,7 +9,7 @@
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cEmptyStructure:
/** A cStructure descendant representing an empty structure.

View File

@ -16,7 +16,7 @@
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cTerrainHeightGen:
cTerrainHeightGen * cTerrainHeightGen::CreateHeightGen(cIniFile &a_IniFile, cBiomeGen & a_BiomeGen, int a_Seed, bool & a_CacheOffByDefault)
@ -91,7 +91,7 @@ cTerrainHeightGen * cTerrainHeightGen::CreateHeightGen(cIniFile &a_IniFile, cBio
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cHeiGenFlat:
void cHeiGenFlat::GenHeightMap(int a_ChunkX, int a_ChunkZ, cChunkDef::HeightMap & a_HeightMap)
@ -115,7 +115,7 @@ void cHeiGenFlat::InitializeHeightGen(cIniFile & a_IniFile)
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cHeiGenCache:
cHeiGenCache::cHeiGenCache(cTerrainHeightGen & a_HeiGenToCache, int a_CacheSize) :
@ -234,7 +234,7 @@ bool cHeiGenCache::GetHeightAt(int a_ChunkX, int a_ChunkZ, int a_RelX, int a_Rel
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cHeiGenClassic:
cHeiGenClassic::cHeiGenClassic(int a_Seed) :
@ -306,7 +306,7 @@ void cHeiGenClassic::InitializeHeightGen(cIniFile & a_IniFile)
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cHeiGenMountains:
cHeiGenMountains::cHeiGenMountains(int a_Seed) :
@ -368,7 +368,7 @@ void cHeiGenMountains::InitializeHeightGen(cIniFile & a_IniFile)
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cHeiGenBiomal:
const cHeiGenBiomal::sGenParam cHeiGenBiomal::m_GenParam[256] =

View File

@ -275,7 +275,7 @@ public:
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cStructGenMineShafts::cMineShaftSystem:
cStructGenMineShafts::cMineShaftSystem::cMineShaftSystem(
@ -400,7 +400,7 @@ bool cStructGenMineShafts::cMineShaftSystem::CanAppend(const cCuboid & a_Boundin
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cMineShaftDirtRoom:
cMineShaftDirtRoom::cMineShaftDirtRoom(cStructGenMineShafts::cMineShaftSystem & a_Parent, cNoise & a_Noise) :
@ -492,7 +492,7 @@ void cMineShaftDirtRoom::ProcessChunk(cChunkDesc & a_ChunkDesc)
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cMineShaftCorridor:
cMineShaftCorridor::cMineShaftCorridor(
@ -964,7 +964,7 @@ void cMineShaftCorridor::PlaceTorches(cChunkDesc & a_ChunkDesc)
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cMineShaftCrossing:
cMineShaftCrossing::cMineShaftCrossing(cStructGenMineShafts::cMineShaftSystem & a_ParentSystem, const cCuboid & a_BoundingBox) :
@ -997,7 +997,6 @@ cMineShaft * cMineShaftCrossing::CreateAndFit(
BoundingBox.p2.y -= 4;
}
}
rnd >>= 2;
switch (a_Direction)
{
case dirXP: BoundingBox.p2.x += 4; BoundingBox.p1.z -= 2; BoundingBox.p2.z += 2; break;
@ -1100,7 +1099,7 @@ void cMineShaftCrossing::ProcessChunk(cChunkDesc & a_ChunkDesc)
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cMineShaftStaircase:
cMineShaftStaircase::cMineShaftStaircase(
@ -1278,7 +1277,7 @@ void cMineShaftStaircase::ProcessChunk(cChunkDesc & a_ChunkDesc)
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cStructGenMineShafts:
cStructGenMineShafts::cStructGenMineShafts(

View File

@ -11,7 +11,7 @@
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cNetherFortGen::cNetherFort:
class cNetherFortGen::cNetherFort :
@ -65,7 +65,7 @@ public:
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// Performance test of the NetherFort generator:
/*
@ -99,7 +99,7 @@ public:
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cNetherFortGen:
cPrefabPiecePool cNetherFortGen::m_PiecePool(g_NetherFortPrefabs, g_NetherFortPrefabsCount, g_NetherFortStartingPrefabs, g_NetherFortStartingPrefabsCount);

View File

@ -61,7 +61,7 @@ public:
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cNoise3DGenerator:
cNoise3DGenerator::cNoise3DGenerator(cChunkGenerator & a_ChunkGenerator) :
@ -342,7 +342,7 @@ void cNoise3DGenerator::ComposeTerrain(cChunkDesc & a_ChunkDesc)
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cNoise3DComposable:
cNoise3DComposable::cNoise3DComposable(int a_Seed) :

View File

@ -150,7 +150,7 @@ static void DebugPieces(const cPlacedPieces & a_Pieces)
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cPOCPieceGenerator:
cPOCPieceGenerator::cPOCPieceGenerator(int a_Seed) :

View File

@ -13,7 +13,7 @@
#ifdef SELF_TEST
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// Self-test:
static class cPieceGeneratorSelfTest :
@ -140,7 +140,7 @@ protected:
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cPiece:
@ -254,7 +254,7 @@ cCuboid cPiece::RotateMoveHitBox(int a_NumCCWRotations, int a_MoveX, int a_MoveY
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cPiece::cConnector:
cPiece::cConnector::cConnector(int a_X, int a_Y, int a_Z, int a_Type, eBlockFace a_Direction) :
@ -279,7 +279,7 @@ cPiece::cConnector::cConnector(const Vector3i & a_Pos, int a_Type, eBlockFace a_
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cPlacedPiece:
cPlacedPiece::cPlacedPiece(const cPlacedPiece * a_Parent, const cPiece & a_Piece, const Vector3i & a_Coords, int a_NumCCWRotations) :
@ -328,7 +328,7 @@ void cPlacedPiece::MoveToGroundBy(int a_OffsetY)
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cPieceGenerator:
cPieceGenerator::cPieceGenerator(cPiecePool & a_PiecePool, int a_Seed) :
@ -578,7 +578,7 @@ void cPieceGenerator::DebugConnectorPool(const cPieceGenerator::cFreeConnectors
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cPieceGenerator::cConnection:
cPieceGenerator::cConnection::cConnection(cPiece & a_Piece, cPiece::cConnector & a_Connector, int a_NumCCWRotations, int a_Weight) :
@ -593,7 +593,7 @@ cPieceGenerator::cConnection::cConnection(cPiece & a_Piece, cPiece::cConnector &
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cPieceGenerator::cFreeConnector:
cPieceGenerator::cFreeConnector::cFreeConnector(cPlacedPiece * a_Piece, const cPiece::cConnector & a_Connector) :
@ -606,7 +606,7 @@ cPieceGenerator::cFreeConnector::cFreeConnector(cPlacedPiece * a_Piece, const cP
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cBFSPieceGenerator:
cBFSPieceGenerator::cBFSPieceGenerator(cPiecePool & a_PiecePool, int a_Seed) :

View File

@ -15,7 +15,7 @@
const cPrefab::sDef g_AlchemistVillagePrefabs[] =
{
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// BarWithBasement:
// The data has been exported from the gallery Desert, area index 82, ID 598, created by STR_Warrior
{
@ -264,7 +264,7 @@ const cPrefab::sDef g_AlchemistVillagePrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// BarWithoutBasement:
// The data has been exported from the gallery Desert, area index 81, ID 597, created by STR_Warrior
{
@ -463,7 +463,7 @@ const cPrefab::sDef g_AlchemistVillagePrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// BlackSmith:
// The data has been exported from the gallery Desert, area index 97, ID 642, created by STR_Warrior
{
@ -633,7 +633,7 @@ const cPrefab::sDef g_AlchemistVillagePrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// LargeHouse1:
// The data has been exported from the gallery Desert, area index 77, ID 577, created by STR_Warrior
{
@ -922,7 +922,7 @@ const cPrefab::sDef g_AlchemistVillagePrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// LargeTower:
// The data has been exported from the gallery Desert, area index 80, ID 596, created by STR_Warrior
{
@ -1108,7 +1108,7 @@ const cPrefab::sDef g_AlchemistVillagePrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// LittleHouse:
// The data has been exported from the gallery Desert, area index 65, ID 551, created by STR_Warrior
{
@ -1229,7 +1229,7 @@ const cPrefab::sDef g_AlchemistVillagePrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// LittleHouse2:
// The data has been exported from the gallery Desert, area index 72, ID 562, created by STR_Warrior
{
@ -1376,7 +1376,7 @@ const cPrefab::sDef g_AlchemistVillagePrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// LittleHouse3:
// The data has been exported from the gallery Desert, area index 66, ID 553, created by STR_Warrior
{
@ -1496,7 +1496,7 @@ const cPrefab::sDef g_AlchemistVillagePrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// LittleHouse4:
// The data has been exported from the gallery Desert, area index 70, ID 560, created by STR_Warrior
{
@ -1647,7 +1647,7 @@ const cPrefab::sDef g_AlchemistVillagePrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// LittleHouse5:
// The data has been exported from the gallery Desert, area index 68, ID 558, created by STR_Warrior
{
@ -1781,7 +1781,7 @@ const cPrefab::sDef g_AlchemistVillagePrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// LittleHouse6:
// The data has been exported from the gallery Desert, area index 69, ID 559, created by STR_Warrior
{
@ -1922,7 +1922,7 @@ const cPrefab::sDef g_AlchemistVillagePrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// LittleHouse7:
// The data has been exported from the gallery Desert, area index 73, ID 563, created by xoft
{
@ -2068,7 +2068,7 @@ const cPrefab::sDef g_AlchemistVillagePrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// LittleHouse8:
// The data has been exported from the gallery Desert, area index 99, ID 739, created by STR_Warrior
{
@ -2200,7 +2200,7 @@ const cPrefab::sDef g_AlchemistVillagePrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// LittleTower:
// The data has been exported from the gallery Desert, area index 79, ID 595, created by STR_Warrior
{
@ -2351,7 +2351,7 @@ const cPrefab::sDef g_AlchemistVillagePrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// MediumHouse1:
// The data has been exported from the gallery Desert, area index 71, ID 561, created by STR_Warrior
{
@ -2531,7 +2531,7 @@ const cPrefab::sDef g_AlchemistVillagePrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// MediumHouse2:
// The data has been exported from the gallery Desert, area index 74, ID 573, created by STR_Warrior
{
@ -2740,7 +2740,7 @@ const cPrefab::sDef g_AlchemistVillagePrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// MediumHouse3:
// The data has been exported from the gallery Desert, area index 76, ID 575, created by STR_Warrior
{
@ -2958,7 +2958,7 @@ const cPrefab::sDef g_AlchemistVillagePrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// SmallHouse9:
// The data has been exported from the gallery Desert, area index 67, ID 556, created by STR_Warrior
{
@ -3104,7 +3104,7 @@ const cPrefab::sDef g_AlchemistVillagePrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// Temple:
// The data has been exported from the gallery Desert, area index 83, ID 599, created by STR_Warrior
{
@ -3310,7 +3310,7 @@ const cPrefab::sDef g_AlchemistVillagePrefabs[] =
const cPrefab::sDef g_AlchemistVillageStartingPrefabs[] =
{
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// Well:
// The data has been exported from the gallery Desert, area index 90, ID 631, created by STR_Warrior
{

View File

@ -4,11 +4,30 @@ project (MCServer)
include_directories ("${PROJECT_SOURCE_DIR}/../../")
file(GLOB SOURCE
"*.cpp"
"*.h"
)
SET (SRCS
AlchemistVillagePrefabs.cpp
JapaneseVillagePrefabs.cpp
NetherFortPrefabs.cpp
PlainsVillagePrefabs.cpp
RainbowRoadPrefabs.cpp
SandFlatRoofVillagePrefabs.cpp
SandVillagePrefabs.cpp
TestRailsPrefabs.cpp
UnderwaterBasePrefabs.cpp)
add_library(Generating_Prefabs ${SOURCE})
SET (HDRS
AlchemistVillagePrefabs.h
JapaneseVillagePrefabs.h
NetherFortPrefabs.h
PlainsVillagePrefabs.h
RainbowRoadPrefabs.h
SandFlatRoofVillagePrefabs.h
SandVillagePrefabs.h
TestRailsPrefabs.h
UnderwaterBasePrefabs.h)
if(NOT MSVC)
add_library(Generating_Prefabs ${SRCS} ${HDRS})
target_link_libraries(Generating_Prefabs OSSupport iniFile Blocks)
endif()

View File

@ -15,7 +15,7 @@
const cPrefab::sDef g_JapaneseVillagePrefabs[] =
{
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// Arch:
// The data has been exported from the gallery Plains, area index 144, ID 488, created by Aloe_vera
{
@ -129,7 +129,7 @@ const cPrefab::sDef g_JapaneseVillagePrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// Farm:
// The data has been exported from the gallery Plains, area index 166, ID 554, created by Aloe_vera
{
@ -299,7 +299,7 @@ const cPrefab::sDef g_JapaneseVillagePrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// Forge:
// The data has been exported from the gallery Plains, area index 79, ID 145, created by Aloe_vera
{
@ -565,7 +565,7 @@ const cPrefab::sDef g_JapaneseVillagePrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// Garden2:
// The data has been exported from the gallery Plains, area index 147, ID 491, created by Aloe_vera
{
@ -717,7 +717,7 @@ const cPrefab::sDef g_JapaneseVillagePrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// HouseMid:
// The data has been exported from the gallery Plains, area index 62, ID 119, created by Aloe_vera
{
@ -893,7 +893,7 @@ const cPrefab::sDef g_JapaneseVillagePrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// HouseSmall:
// The data has been exported from the gallery Plains, area index 68, ID 131, created by Aloe_vera
{
@ -1004,7 +1004,7 @@ const cPrefab::sDef g_JapaneseVillagePrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// HouseSmallDblWithDoor:
// The data has been exported from the gallery Plains, area index 113, ID 265, created by Aloe_vera
{
@ -1128,7 +1128,7 @@ const cPrefab::sDef g_JapaneseVillagePrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// HouseSmallDouble:
// The data has been exported from the gallery Plains, area index 72, ID 135, created by Aloe_vera
{
@ -1249,7 +1249,7 @@ const cPrefab::sDef g_JapaneseVillagePrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// HouseSmallWithDoor:
// The data has been exported from the gallery Plains, area index 112, ID 264, created by Aloe_vera
{
@ -1362,7 +1362,7 @@ const cPrefab::sDef g_JapaneseVillagePrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// HouseWide:
// The data has been exported from the gallery Plains, area index 64, ID 121, created by STR_Warrior
{
@ -1510,7 +1510,7 @@ const cPrefab::sDef g_JapaneseVillagePrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// HouseWithGarden:
// The data has been exported from the gallery Plains, area index 67, ID 130, created by Aloe_vera
{
@ -1756,7 +1756,7 @@ const cPrefab::sDef g_JapaneseVillagePrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// HouseWithSakura1:
// The data has been exported from the gallery Plains, area index 75, ID 141, created by Aloe_vera
{
@ -1950,7 +1950,7 @@ const cPrefab::sDef g_JapaneseVillagePrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// HouseWithSpa:
// The data has been exported from the gallery Plains, area index 73, ID 139, created by Aloe_vera
{
@ -2158,7 +2158,7 @@ const cPrefab::sDef g_JapaneseVillagePrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// MediumSakuraTree:
// The data has been exported from the gallery Plains, area index 146, ID 490, created by STR_Warrior
{
@ -2312,7 +2312,7 @@ const cPrefab::sDef g_JapaneseVillagePrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// Restaurant:
// The data has been exported from the gallery Plains, area index 61, ID 117, created by Aloe_vera
{
@ -2566,7 +2566,7 @@ const cPrefab::sDef g_JapaneseVillagePrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// SakuraDouble:
// The data has been exported from the gallery Plains, area index 76, ID 142, created by Aloe_vera
{
@ -2697,7 +2697,7 @@ const cPrefab::sDef g_JapaneseVillagePrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// SakuraSmall:
// The data has been exported from the gallery Plains, area index 145, ID 489, created by Aloe_vera
{
@ -2808,7 +2808,7 @@ const cPrefab::sDef g_JapaneseVillagePrefabs[] =
const cPrefab::sDef g_JapaneseVillageStartingPrefabs[] =
{
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// HighTemple:
// The data has been exported from the gallery Plains, area index 70, ID 133, created by Aloe_vera
{
@ -3159,7 +3159,7 @@ const cPrefab::sDef g_JapaneseVillageStartingPrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// Well:
// The data has been exported from the gallery Plains, area index 143, ID 487, created by STR_Warrior
{

View File

@ -15,7 +15,7 @@
const cPrefab::sDef g_NetherFortPrefabs[] =
{
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// BalconyCorridor:
// The data has been exported from the gallery Nether, area index 37, ID 288, created by Aloe_vera
{
@ -162,7 +162,7 @@ const cPrefab::sDef g_NetherFortPrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// BalconyTee2:
// The data has been exported from the gallery Nether, area index 38, ID 289, created by Aloe_vera
{
@ -325,7 +325,7 @@ const cPrefab::sDef g_NetherFortPrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// BlazePlatform:
// The data has been exported from the gallery Nether, area index 26, ID 276, created by tonibm1999
{
@ -448,7 +448,7 @@ const cPrefab::sDef g_NetherFortPrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// BlazePlatformOverhang:
// The data has been exported from the gallery Nether, area index 20, ID 162, created by STR_Warrior
{
@ -621,7 +621,7 @@ const cPrefab::sDef g_NetherFortPrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// BridgeCircleCrossing:
// The data has been exported from the gallery Nether, area index 49, ID 308, created by Aloe_vera
{
@ -824,7 +824,7 @@ const cPrefab::sDef g_NetherFortPrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// BridgeCrossing:
// The data has been exported from the gallery Nether, area index 17, ID 159, created by Aloe_vera
{
@ -1028,7 +1028,7 @@ const cPrefab::sDef g_NetherFortPrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// BridgeCrumble1:
// The data has been exported from the gallery Nether, area index 19, ID 161, created by Aloe_vera
{
@ -1125,7 +1125,7 @@ const cPrefab::sDef g_NetherFortPrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// BridgeCrumble2:
// The data has been exported from the gallery Nether, area index 18, ID 160, created by Aloe_vera
{
@ -1228,7 +1228,7 @@ const cPrefab::sDef g_NetherFortPrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// BridgeDoubleCrumble:
// The data has been exported from the gallery Nether, area index 46, ID 305, created by STR_Warrior
{
@ -1410,7 +1410,7 @@ const cPrefab::sDef g_NetherFortPrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// BridgeFunnelDown:
// The data has been exported from the gallery Nether, area index 0, ID 2, created by Aloe_vera
{
@ -1653,7 +1653,7 @@ const cPrefab::sDef g_NetherFortPrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// BridgeLevelCrossing:
// The data has been exported from the gallery Nether, area index 61, ID 321, created by Aloe_vera
{
@ -1985,7 +1985,7 @@ const cPrefab::sDef g_NetherFortPrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// BridgeSegment:
// The data has been exported from the gallery Nether, area index 16, ID 158, created by Aloe_vera
{
@ -2107,7 +2107,7 @@ const cPrefab::sDef g_NetherFortPrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// BridgeTee:
// The data has been exported from the gallery Nether, area index 39, ID 290, created by STR_Warrior
{
@ -2270,7 +2270,7 @@ const cPrefab::sDef g_NetherFortPrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// Corridor11:
// The data has been exported from the gallery Nether, area index 36, ID 287, created by Aloe_vera
{
@ -2374,7 +2374,7 @@ const cPrefab::sDef g_NetherFortPrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// Corridor13:
// The data has been exported from the gallery Nether, area index 35, ID 286, created by Aloe_vera
{
@ -2478,7 +2478,7 @@ const cPrefab::sDef g_NetherFortPrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// Corridor5:
// The data has been exported from the gallery Nether, area index 65, ID 330, created by xoft
{
@ -2576,7 +2576,7 @@ const cPrefab::sDef g_NetherFortPrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// CorridorCorner5:
// The data has been exported from the gallery Nether, area index 10, ID 40, created by xoft
{
@ -2718,7 +2718,7 @@ const cPrefab::sDef g_NetherFortPrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// CorridorCornerChest5:
// The data has been exported from the gallery Nether, area index 42, ID 293, created by STR_Warrior
{
@ -2861,7 +2861,7 @@ const cPrefab::sDef g_NetherFortPrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// CorridorCrossing:
// The data has been exported from the gallery Nether, area index 63, ID 328, created by xoft
{
@ -2989,7 +2989,7 @@ const cPrefab::sDef g_NetherFortPrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// CorridorStairs:
// The data has been exported from the gallery Nether, area index 12, ID 42, created by xoft
{
@ -3144,7 +3144,7 @@ const cPrefab::sDef g_NetherFortPrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// DarkCorridor:
// The data has been exported from the gallery Nether, area index 3, ID 30, created by STR_Warrior
{
@ -3248,7 +3248,7 @@ const cPrefab::sDef g_NetherFortPrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// LavaStaircase:
// The data has been exported from the gallery Nether, area index 28, ID 278, created by Aloe_vera
{
@ -3508,7 +3508,7 @@ const cPrefab::sDef g_NetherFortPrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// LavaStaircaseBig:
// The data has been exported from the gallery Nether, area index 31, ID 282, created by STR_Warrior
{
@ -3842,7 +3842,7 @@ const cPrefab::sDef g_NetherFortPrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// LavaStairsBridge:
// The data has been exported from the gallery Nether, area index 30, ID 281, created by STR_Warrior
{
@ -4123,7 +4123,7 @@ const cPrefab::sDef g_NetherFortPrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// MidStaircase:
// The data has been exported from the gallery Nether, area index 23, ID 165, created by Aloe_vera
{
@ -4314,7 +4314,7 @@ const cPrefab::sDef g_NetherFortPrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// StairsToOpen1:
// The data has been exported from the gallery Nether, area index 27, ID 277, created by Aloe_vera
{
@ -4460,7 +4460,7 @@ const cPrefab::sDef g_NetherFortPrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// StairsToOpen2:
// The data has been exported from the gallery Nether, area index 8, ID 35, created by xoft
{
@ -4606,7 +4606,7 @@ const cPrefab::sDef g_NetherFortPrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// Tee2x4:
// The data has been exported from the gallery Nether, area index 40, ID 291, created by Aloe_vera
{
@ -4726,7 +4726,7 @@ const cPrefab::sDef g_NetherFortPrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// Tee4x4:
// The data has been exported from the gallery Nether, area index 41, ID 292, created by Aloe_vera
{
@ -4858,7 +4858,7 @@ const cPrefab::sDef g_NetherFortPrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// TinyCorridorCorner:
// The data has been exported from the gallery Nether, area index 66, ID 331, created by xoft
{
@ -4957,7 +4957,7 @@ const cPrefab::sDef g_NetherFortPrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// TinyCorridorCornerChest:
// The data has been exported from the gallery Nether, area index 67, ID 332, created by Aloe_vera
{
@ -5057,7 +5057,7 @@ const cPrefab::sDef g_NetherFortPrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// TinyCorridorCrossing:
// The data has been exported from the gallery Nether, area index 64, ID 329, created by xoft
{
@ -5159,7 +5159,7 @@ const cPrefab::sDef g_NetherFortPrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// Turret:
// The data has been exported from the gallery Nether, area index 7, ID 34, created by xoft
{
@ -5283,7 +5283,7 @@ const cPrefab::sDef g_NetherFortPrefabs[] =
const cPrefab::sDef g_NetherFortStartingPrefabs[] =
{
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// CentralRoom:
// The data has been exported from the gallery Nether, area index 22, ID 164, created by Aloe_vera
{

View File

@ -15,7 +15,7 @@
const cPrefab::sDef g_PlainsVillagePrefabs[] =
{
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// BigPlantBed:
// The data has been exported from the gallery Plains, area index 26, ID 70, created by Taugrammaton
{
@ -195,7 +195,7 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// CobbleHouse10x5Library:
// The data has been exported from the gallery Plains, area index 23, ID 66, created by xoft
{
@ -336,7 +336,7 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// DoublePlantBed:
// The data has been exported from the gallery Plains, area index 5, ID 20, created by tonibm1999
{
@ -492,7 +492,7 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// Forge:
// The data has been exported from the gallery Plains, area index 51, ID 102, created by Aloe_vera
{
@ -692,7 +692,7 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// LampPost:
// The data has been exported from the gallery Plains, area index 28, ID 73, created by STR_Warrior
{
@ -784,7 +784,7 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// MineshaftCorridor:
// The data has been exported from the gallery Plains, area index 139, ID 447, created by STR_Warrior
{
@ -861,7 +861,7 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// MineshaftCrossing:
// The data has been exported from the gallery Plains, area index 171, ID 578, created by Aloe_vera
{
@ -946,7 +946,7 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// MineshaftCrossing:
// The data has been exported from the gallery Plains, area index 193, ID 657, created by Aloe_vera
{
@ -1064,7 +1064,7 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// MineshaftDoubleCrossing:
// The data has been exported from the gallery Plains, area index 172, ID 579, created by Aloe_vera
{
@ -1189,7 +1189,7 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// MineshaftSpiral:
// The data has been exported from the gallery Plains, area index 198, ID 662, created by Aloe_vera
{
@ -1370,7 +1370,7 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// MineshaftStairs:
// The data has been exported from the gallery Plains, area index 195, ID 659, created by Aloe_vera
{
@ -1469,7 +1469,7 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// MineshaftStairsCrossing:
// The data has been exported from the gallery Plains, area index 199, ID 663, created by Aloe_vera
{
@ -1719,7 +1719,7 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// MineshaftTee:
// The data has been exported from the gallery Plains, area index 194, ID 658, created by Aloe_vera
{
@ -1819,7 +1819,7 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// MineshaftsCorridor5:
// The data has been exported from the gallery Plains, area index 200, ID 664, created by Aloe_vera
{
@ -1898,7 +1898,7 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// Scarecrow:
// The data has been exported from the gallery Plains, area index 150, ID 494, created by STR_Warrior
{
@ -1983,7 +1983,7 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// SinglePlantBed:
// The data has been exported from the gallery Plains, area index 17, ID 60, created by Aloe_vera
{
@ -2108,7 +2108,7 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// WoodenChurchMid:
// The data has been exported from the gallery Plains, area index 58, ID 109, created by Aloe_vera
{
@ -2418,7 +2418,7 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// WoodenGranary:
// The data has been exported from the gallery Plains, area index 54, ID 105, created by Aloe_vera
{
@ -2560,7 +2560,7 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// WoodenHouse10x7Library:
// The data has been exported from the gallery Plains, area index 47, ID 98, created by Aloe_vera
{
@ -2729,7 +2729,7 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// WoodenHouse5x5:
// The data has been exported from the gallery Plains, area index 49, ID 100, created by Aloe_vera
{
@ -2856,7 +2856,7 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// WoodenHouse7x5:
// The data has been exported from the gallery Plains, area index 40, ID 91, created by xoft
{
@ -2983,7 +2983,7 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// WoodenHouse9x5:
// The data has been exported from the gallery Plains, area index 41, ID 92, created by xoft
{
@ -3117,7 +3117,7 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// WoodenHouse9x5Fence:
// The data has been exported from the gallery Plains, area index 9, ID 26, created by Aloe_vera
{
@ -3287,7 +3287,7 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// WoodenHouse9x5Library:
// The data has been exported from the gallery Plains, area index 46, ID 97, created by Aloe_vera
{
@ -3428,7 +3428,7 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// WoodenHouse9x7:
// The data has been exported from the gallery Plains, area index 52, ID 103, created by Aloe_vera
{
@ -3590,7 +3590,7 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// WoodenHouse9x7Butcher:
// The data has been exported from the gallery Plains, area index 48, ID 99, created by Aloe_vera
{
@ -3806,7 +3806,7 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// WoodenHouse9x7DoubleDoor:
// The data has been exported from the gallery Plains, area index 38, ID 87, created by Aloe_vera
{
@ -3971,7 +3971,7 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// WoodenHouseL13x14:
// The data has been exported from the gallery Plains, area index 39, ID 90, created by STR_Warrior
{
@ -4223,7 +4223,7 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// WoodenHouseL14x14:
// The data has been exported from the gallery Plains, area index 0, ID 4, created by Aloe_vera
{
@ -4450,7 +4450,7 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// WoodenHouseL9x9:
// The data has been exported from the gallery Plains, area index 42, ID 93, created by xoft
{
@ -4619,7 +4619,7 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// WoodenHouseU13x9:
// The data has been exported from the gallery Plains, area index 43, ID 94, created by xoft
{
@ -4786,7 +4786,7 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// WoodenMill5x5:
// The data has been exported from the gallery Plains, area index 60, ID 111, created by Aloe_vera
{
@ -5121,7 +5121,7 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// WoodenStables:
// The data has been exported from the gallery Plains, area index 55, ID 106, created by Aloe_vera
{
@ -5307,7 +5307,7 @@ const cPrefab::sDef g_PlainsVillagePrefabs[] =
const cPrefab::sDef g_PlainsVillageStartingPrefabs[] =
{
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// CobbleWell4x4:
// The data has been exported from the gallery Plains, area index 1, ID 5, created by Aloe_vera
{
@ -5448,7 +5448,7 @@ const cPrefab::sDef g_PlainsVillageStartingPrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// MineEntrance:
// The data has been exported from the gallery Plains, area index 138, ID 446, created by STR_Warrior
{
@ -5897,7 +5897,7 @@ const cPrefab::sDef g_PlainsVillageStartingPrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// RoofedWell:
// The data has been exported from the gallery Plains, area index 119, ID 271, created by STR_Warrior
{

View File

@ -15,7 +15,7 @@
const cPrefab::sDef g_RainbowRoadPrefabs[] =
{
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// CurveDouble:
// The data has been exported from the gallery Cube, area index 89, ID 467, created by Aloe_vera
{
@ -85,7 +85,7 @@ const cPrefab::sDef g_RainbowRoadPrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// CurveDownFromTopSingle:
// The data has been exported from the gallery Cube, area index 100, ID 478, created by Aloe_vera
{
@ -255,7 +255,7 @@ const cPrefab::sDef g_RainbowRoadPrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// CurveSingle:
// The data has been exported from the gallery Cube, area index 84, ID 462, created by Aloe_vera
{
@ -320,7 +320,7 @@ const cPrefab::sDef g_RainbowRoadPrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// CurveSingleLeft:
// The data has been exported from the gallery Cube, area index 97, ID 475, created by Aloe_vera
{
@ -385,7 +385,7 @@ const cPrefab::sDef g_RainbowRoadPrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// CurveUpDouble:
// The data has been exported from the gallery Cube, area index 92, ID 470, created by Aloe_vera
{
@ -581,7 +581,7 @@ const cPrefab::sDef g_RainbowRoadPrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// CurveUpSingle:
// The data has been exported from the gallery Cube, area index 87, ID 465, created by Aloe_vera
{
@ -751,7 +751,7 @@ const cPrefab::sDef g_RainbowRoadPrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// SlopeDownFromTopSingle:
// The data has been exported from the gallery Cube, area index 98, ID 476, created by Aloe_vera
{
@ -881,7 +881,7 @@ const cPrefab::sDef g_RainbowRoadPrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// SlopeUpDouble:
// The data has been exported from the gallery Cube, area index 90, ID 468, created by Aloe_vera
{
@ -1061,7 +1061,7 @@ const cPrefab::sDef g_RainbowRoadPrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// SlopeUpSingle:
// The data has been exported from the gallery Cube, area index 85, ID 463, created by Aloe_vera
{
@ -1191,7 +1191,7 @@ const cPrefab::sDef g_RainbowRoadPrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// SplitTee:
// The data has been exported from the gallery Cube, area index 93, ID 471, created by Aloe_vera
{
@ -1261,7 +1261,7 @@ const cPrefab::sDef g_RainbowRoadPrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// StraightDouble:
// The data has been exported from the gallery Cube, area index 88, ID 466, created by Aloe_vera
{
@ -1335,7 +1335,7 @@ const cPrefab::sDef g_RainbowRoadPrefabs[] =
const cPrefab::sDef g_RainbowRoadStartingPrefabs[] =
{
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// StraightSingle:
// The data has been exported from the gallery Cube, area index 83, ID 461, created by Aloe_vera
{

View File

@ -15,7 +15,7 @@
const cPrefab::sDef g_SandFlatRoofVillagePrefabs[] =
{
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// Forge:
// The data has been exported from the gallery Desert, area index 32, ID 173, created by Aloe_vera
{
@ -162,7 +162,7 @@ const cPrefab::sDef g_SandFlatRoofVillagePrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// House11x7:
// The data has been exported from the gallery Desert, area index 31, ID 172, created by Aloe_vera
{
@ -301,7 +301,7 @@ const cPrefab::sDef g_SandFlatRoofVillagePrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// House5x4:
// The data has been exported from the gallery Desert, area index 25, ID 166, created by Aloe_vera
{
@ -412,7 +412,7 @@ const cPrefab::sDef g_SandFlatRoofVillagePrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// House5x5:
// The data has been exported from the gallery Desert, area index 26, ID 167, created by Aloe_vera
{
@ -530,7 +530,7 @@ const cPrefab::sDef g_SandFlatRoofVillagePrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// House7x5:
// The data has been exported from the gallery Desert, area index 27, ID 168, created by Aloe_vera
{
@ -648,7 +648,7 @@ const cPrefab::sDef g_SandFlatRoofVillagePrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// House8x5:
// The data has been exported from the gallery Desert, area index 28, ID 169, created by Aloe_vera
{
@ -772,7 +772,7 @@ const cPrefab::sDef g_SandFlatRoofVillagePrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// House8x7:
// The data has been exported from the gallery Desert, area index 29, ID 170, created by Aloe_vera
{
@ -910,7 +910,7 @@ const cPrefab::sDef g_SandFlatRoofVillagePrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// House9x7:
// The data has been exported from the gallery Desert, area index 30, ID 171, created by Aloe_vera
{
@ -1049,7 +1049,7 @@ const cPrefab::sDef g_SandFlatRoofVillagePrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// HouseL13x12:
// The data has been exported from the gallery Desert, area index 53, ID 345, created by jakibaki
{
@ -1220,7 +1220,7 @@ const cPrefab::sDef g_SandFlatRoofVillagePrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// MarketStall:
// The data has been exported from the gallery Desert, area index 34, ID 175, created by Aloe_vera
{
@ -1330,7 +1330,7 @@ const cPrefab::sDef g_SandFlatRoofVillagePrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// Marketplace:
// The data has been exported from the gallery Desert, area index 38, ID 261, created by Aloe_vera
{
@ -1472,7 +1472,7 @@ const cPrefab::sDef g_SandFlatRoofVillagePrefabs[] =
const cPrefab::sDef g_SandFlatRoofVillageStartingPrefabs[] =
{
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// Well:
// The data has been exported from the gallery Desert, area index 44, ID 275, created by Aloe_vera
{

View File

@ -15,7 +15,7 @@
const cPrefab::sDef g_SandVillagePrefabs[] =
{
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// DoubleField:
// The data has been exported from the gallery Desert, area index 5, ID 75, created by tonibm1999
{
@ -102,7 +102,7 @@ const cPrefab::sDef g_SandVillagePrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// House11x7:
// The data has been exported from the gallery Desert, area index 6, ID 81, created by Aloe_vera
{
@ -236,7 +236,7 @@ const cPrefab::sDef g_SandVillagePrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// House11x9:
// The data has been exported from the gallery Desert, area index 11, ID 115, created by xoft
{
@ -395,7 +395,7 @@ const cPrefab::sDef g_SandVillagePrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// House13x7:
// The data has been exported from the gallery Desert, area index 15, ID 125, created by Aloe_vera
{
@ -527,7 +527,7 @@ const cPrefab::sDef g_SandVillagePrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// House13x9:
// The data has been exported from the gallery Desert, area index 12, ID 116, created by xoft
{
@ -686,7 +686,7 @@ const cPrefab::sDef g_SandVillagePrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// House15x9:
// The data has been exported from the gallery Desert, area index 13, ID 118, created by xoft
{
@ -845,7 +845,7 @@ const cPrefab::sDef g_SandVillagePrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// House16x9:
// The data has been exported from the gallery Desert, area index 16, ID 126, created by Aloe_vera
{
@ -1004,7 +1004,7 @@ const cPrefab::sDef g_SandVillagePrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// House7x7:
// The data has been exported from the gallery Desert, area index 8, ID 112, created by Aloe_vera
{
@ -1128,7 +1128,7 @@ const cPrefab::sDef g_SandVillagePrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// House9x7:
// The data has been exported from the gallery Desert, area index 9, ID 113, created by xoft
{
@ -1253,7 +1253,7 @@ const cPrefab::sDef g_SandVillagePrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// House9x9:
// The data has been exported from the gallery Desert, area index 10, ID 114, created by xoft
{
@ -1404,7 +1404,7 @@ const cPrefab::sDef g_SandVillagePrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// HouseL14x12:
// The data has been exported from the gallery Desert, area index 14, ID 124, created by Aloe_vera
{
@ -1592,7 +1592,7 @@ const cPrefab::sDef g_SandVillagePrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// HouseL14x12:
// The data has been exported from the gallery Desert, area index 7, ID 82, created by Aloe_vera
{
@ -1763,7 +1763,7 @@ const cPrefab::sDef g_SandVillagePrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// SingleField:
// The data has been exported from the gallery Desert, area index 17, ID 127, created by Aloe_vera
{
@ -1844,7 +1844,7 @@ const cPrefab::sDef g_SandVillagePrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// SmallHut:
// The data has been exported from the gallery Desert, area index 4, ID 68, created by tonibm1999
{
@ -1955,7 +1955,7 @@ const cPrefab::sDef g_SandVillagePrefabs[] =
const cPrefab::sDef g_SandVillageStartingPrefabs[] =
{
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// RoofedWell:
// The data has been exported from the gallery Desert, area index 43, ID 274, created by Aloe_vera
{
@ -2155,7 +2155,7 @@ const cPrefab::sDef g_SandVillageStartingPrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// Well:
// The data has been exported from the gallery Desert, area index 0, ID 1, created by Aloe_vera
{

View File

@ -15,7 +15,7 @@
const cPrefab::sDef g_TestRailsPrefabs[] =
{
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// ActivatorRail:
// The data has been exported from the gallery Plains, area index 251, ID 746, created by Aloe_vera
{
@ -104,7 +104,7 @@ const cPrefab::sDef g_TestRailsPrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// DetectorRail:
// The data has been exported from the gallery Plains, area index 250, ID 745, created by Aloe_vera
{
@ -193,7 +193,7 @@ const cPrefab::sDef g_TestRailsPrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// PowerRail:
// The data has been exported from the gallery Plains, area index 248, ID 743, created by Aloe_vera
{
@ -284,7 +284,7 @@ const cPrefab::sDef g_TestRailsPrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// RegularRail:
// The data has been exported from the gallery Plains, area index 247, ID 742, created by Aloe_vera
{
@ -383,7 +383,7 @@ const cPrefab::sDef g_TestRailsPrefabs[] =
const cPrefab::sDef g_TestRailsStartingPrefabs[] =
{
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// CentralPiece:
// The data has been exported from the gallery Plains, area index 249, ID 744, created by Aloe_vera
{

View File

@ -15,7 +15,7 @@
const cPrefab::sDef g_UnderwaterBasePrefabs[] =
{
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// BrokenRoom:
// The data has been exported from the gallery Water, area index 49, ID 680, created by STR_Warrior
{
@ -178,7 +178,7 @@ const cPrefab::sDef g_UnderwaterBasePrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// Corridor16:
// The data has been exported from the gallery Water, area index 25, ID 566, created by xoft
{
@ -265,7 +265,7 @@ const cPrefab::sDef g_UnderwaterBasePrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// CorridorCorner:
// The data has been exported from the gallery Water, area index 26, ID 569, created by xoft
{
@ -380,7 +380,7 @@ const cPrefab::sDef g_UnderwaterBasePrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// CorridorCrossing:
// The data has been exported from the gallery Water, area index 31, ID 581, created by LO1ZB
{
@ -526,7 +526,7 @@ const cPrefab::sDef g_UnderwaterBasePrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// CorridorStairs:
// The data has been exported from the gallery Water, area index 32, ID 582, created by LO1ZB
{
@ -656,7 +656,7 @@ const cPrefab::sDef g_UnderwaterBasePrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// CorridorTee:
// The data has been exported from the gallery Water, area index 29, ID 576, created by LO1ZB
{
@ -775,7 +775,7 @@ const cPrefab::sDef g_UnderwaterBasePrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// ViewingCorner:
// The data has been exported from the gallery Water, area index 40, ID 613, created by LO1ZB
{
@ -958,7 +958,7 @@ const cPrefab::sDef g_UnderwaterBasePrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// ViewingCorridor:
// The data has been exported from the gallery Water, area index 27, ID 571, created by LO1ZB
{
@ -1065,7 +1065,7 @@ const cPrefab::sDef g_UnderwaterBasePrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// ViewingCorridorBulge:
// The data has been exported from the gallery Water, area index 42, ID 615, created by LO1ZB
{
@ -1280,7 +1280,7 @@ const cPrefab::sDef g_UnderwaterBasePrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// ViewingCrossing:
// The data has been exported from the gallery Water, area index 38, ID 611, created by LO1ZB
{
@ -1483,7 +1483,7 @@ const cPrefab::sDef g_UnderwaterBasePrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// ViewingEnd:
// The data has been exported from the gallery Water, area index 41, ID 614, created by LO1ZB
{
@ -1648,7 +1648,7 @@ const cPrefab::sDef g_UnderwaterBasePrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// ViewingTee:
// The data has been exported from the gallery Water, area index 39, ID 612, created by LO1ZB
{
@ -1850,7 +1850,7 @@ const cPrefab::sDef g_UnderwaterBasePrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// WaterfallRoom:
// The data has been exported from the gallery Water, area index 50, ID 681, created by Aloe_vera
{
@ -2059,7 +2059,7 @@ const cPrefab::sDef g_UnderwaterBasePrefabs[] =
const cPrefab::sDef g_UnderwaterBaseStartingPrefabs[] =
{
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// CentralRoom:
// The data has been exported from the gallery Water, area index 24, ID 564, created by xoft
{

View File

@ -18,7 +18,7 @@ static cPrefabPiecePool g_RainbowRoads(g_RainbowRoadPrefabs, g_RainbowRoadPrefab
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cRainbowRoadsGen::cRainbowRoads:
class cRainbowRoadsGen::cRainbowRoads :
@ -86,7 +86,7 @@ protected:
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cRainbowRoadsGen:

View File

@ -77,7 +77,7 @@ protected:
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cStructGenRavines:
cStructGenRavines::cStructGenRavines(int a_Seed, int a_Size) :
@ -101,7 +101,7 @@ cGridStructGen::cStructurePtr cStructGenRavines::CreateStructure(int a_GridX, in
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cStructGenRavines::cRavine
cStructGenRavines::cRavine::cRavine(int a_GridX, int a_GridZ, int a_OriginX, int a_OriginZ, int a_Size, cNoise & a_Noise) :

View File

@ -12,7 +12,7 @@
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cStructGenOreNests configuration:
const int MAX_HEIGHT_COAL = 127;
@ -51,7 +51,7 @@ const int NEST_SIZE_GRAVEL = 32;
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cStructGenTrees:
void cStructGenTrees::GenFinish(cChunkDesc & a_ChunkDesc)
@ -303,7 +303,7 @@ int cStructGenTrees::GetNumTrees(
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cStructGenOreNests:
void cStructGenOreNests::GenFinish(cChunkDesc & a_ChunkDesc)
@ -410,7 +410,7 @@ void cStructGenOreNests::GenerateOre(int a_ChunkX, int a_ChunkZ, BLOCKTYPE a_Ore
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cStructGenLakes:
void cStructGenLakes::GenFinish(cChunkDesc & a_ChunkDesc)
@ -484,7 +484,6 @@ void cStructGenLakes::CreateLakeImage(int a_ChunkX, int a_ChunkZ, cBlockArea & a
const int BubbleY = 4 + (Rnd & 0x01); // 4 .. 5
Rnd >>= 1;
const int BubbleZ = BubbleR + (Rnd % Range);
Rnd >>= 4;
const int HalfR = BubbleR / 2; // 1 .. 2
const int RSquared = BubbleR * BubbleR;
for (int y = -HalfR; y <= HalfR; y++)
@ -532,7 +531,7 @@ void cStructGenLakes::CreateLakeImage(int a_ChunkX, int a_ChunkZ, cBlockArea & a
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cStructGenDirectOverhangs:
cStructGenDirectOverhangs::cStructGenDirectOverhangs(int a_Seed) :
@ -648,7 +647,7 @@ bool cStructGenDirectOverhangs::HasWantedBiome(cChunkDesc & a_ChunkDesc) const
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cStructGenDistortedMembraneOverhangs:
cStructGenDistortedMembraneOverhangs::cStructGenDistortedMembraneOverhangs(int a_Seed) :

View File

@ -18,7 +18,7 @@ static cPrefabPiecePool g_TestRails(g_TestRailsPrefabs, g_TestRailsPrefabsCount,
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cTestRailsGen::cTestRails:
class cTestRailsGen::cTestRails :
@ -86,7 +86,7 @@ protected:
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cTestRailsGen:

View File

@ -10,13 +10,6 @@
// DEBUG:
int gTotalLargeJungleTrees = 0;
int gOversizeLargeJungleTrees = 0;
typedef struct
{
@ -41,42 +34,42 @@ static const sCoords Corners[] =
static const sCoords BigO1[] =
{
{0, -1},
{-1, 0}, {1, 0},
{0, 1},
/* -1 */ {0, -1},
/* 0 */ {-1, 0}, {1, 0},
/* 1 */ {0, 1},
} ;
static const sCoords BigO2[] =
{
{-1, -2}, {0, -2}, {1, -2},
{-2, -1}, {-1, -1}, {0, -1}, {1, -1}, {2, -1},
{-2, 0}, {-1, 0}, {1, 0}, {2, 0},
{-2, 1}, {-1, 1}, {0, 1}, {1, 1}, {2, 1},
{-1, 2}, {0, 2}, {1, 2},
/* -2 */ {-1, -2}, {0, -2}, {1, -2},
/* -1 */ {-2, -1}, {-1, -1}, {0, -1}, {1, -1}, {2, -1},
/* 0 */ {-2, 0}, {-1, 0}, {1, 0}, {2, 0},
/* 1 */ {-2, 1}, {-1, 1}, {0, 1}, {1, 1}, {2, 1},
/* 2 */ {-1, 2}, {0, 2}, {1, 2},
} ;
static const sCoords BigO3[] =
{
{-2, -3}, {-1, -3}, {0, -3}, {1, -3}, {2, -3},
{-3, -2}, {-2, -2}, {-1, -2}, {0, -2}, {1, -2}, {2, -2}, {3, -2},
{-3, -1}, {-2, -1}, {-1, -1}, {0, -1}, {1, -1}, {2, -1}, {3, -1},
{-3, 0}, {-2, 0}, {-1, 0}, {1, 0}, {2, 0}, {3, 0},
{-3, 1}, {-2, 1}, {-1, 1}, {0, 1}, {1, 1}, {2, 1}, {3, 1},
{-3, 2}, {-2, 2}, {-1, 2}, {0, 2}, {1, 2}, {2, 2}, {3, 2},
{-2, 3}, {-1, 3}, {0, 3}, {1, 3}, {2, 3},
/* -3 */ {-2, -3}, {-1, -3}, {0, -3}, {1, -3}, {2, -3},
/* -2 */ {-3, -2}, {-2, -2}, {-1, -2}, {0, -2}, {1, -2}, {2, -2}, {3, -2},
/* -1 */ {-3, -1}, {-2, -1}, {-1, -1}, {0, -1}, {1, -1}, {2, -1}, {3, -1},
/* 0 */ {-3, 0}, {-2, 0}, {-1, 0}, {1, 0}, {2, 0}, {3, 0},
/* 1 */ {-3, 1}, {-2, 1}, {-1, 1}, {0, 1}, {1, 1}, {2, 1}, {3, 1},
/* 2 */ {-3, 2}, {-2, 2}, {-1, 2}, {0, 2}, {1, 2}, {2, 2}, {3, 2},
/* 3 */ {-2, 3}, {-1, 3}, {0, 3}, {1, 3}, {2, 3},
} ;
static const sCoords BigO4[] = // Part of Big Jungle tree
{
{-2, -4}, {-1, -4}, {0, -4}, {1, -4}, {2, -4},
{-3, -3}, {-2, -3}, {-1, -3}, {0, -3}, {1, -3}, {2, -3}, {3, -3},
{-4, -2}, {-3, -2}, {-2, -2}, {-1, -2}, {0, -2}, {1, -2}, {2, -2}, {3, -2}, {4, -2},
{-4, -1}, {-3, -1}, {-2, -1}, {-1, -1}, {0, -1}, {1, -1}, {2, -1}, {3, -1}, {4, -1},
{-4, 0}, {-3, 0}, {-2, 0}, {-1, 0}, {1, 0}, {2, 0}, {3, 0}, {4, 0},
{-4, 1}, {-3, 1}, {-2, 1}, {-1, 1}, {0, 1}, {1, 1}, {2, 1}, {3, 1}, {4, 1},
{-4, 2}, {-3, 2}, {-2, 2}, {-1, 2}, {0, 2}, {1, 2}, {2, 2}, {3, 2}, {4, 2},
{-3, 3}, {-2, 3}, {-1, 3}, {0, 3}, {1, 3}, {2, 3}, {3, 3},
{-2, 4}, {-1, 4}, {0, 4}, {1, 4}, {2, 4},
/* -4 */ {-2, -4}, {-1, -4}, {0, -4}, {1, -4}, {2, -4},
/* -3 */ {-3, -3}, {-2, -3}, {-1, -3}, {0, -3}, {1, -3}, {2, -3}, {3, -3},
/* -2 */ {-4, -2}, {-3, -2}, {-2, -2}, {-1, -2}, {0, -2}, {1, -2}, {2, -2}, {3, -2}, {4, -2},
/* -1 */ {-4, -1}, {-3, -1}, {-2, -1}, {-1, -1}, {0, -1}, {1, -1}, {2, -1}, {3, -1}, {4, -1},
/* 0 */ {-4, 0}, {-3, 0}, {-2, 0}, {-1, 0}, {1, 0}, {2, 0}, {3, 0}, {4, 0},
/* 1 */ {-4, 1}, {-3, 1}, {-2, 1}, {-1, 1}, {0, 1}, {1, 1}, {2, 1}, {3, 1}, {4, 1},
/* 2 */ {-4, 2}, {-3, 2}, {-2, 2}, {-1, 2}, {0, 2}, {1, 2}, {2, 2}, {3, 2}, {4, 2},
/* 3 */ {-3, 3}, {-2, 3}, {-1, 3}, {0, 3}, {1, 3}, {2, 3}, {3, 3},
/* 4 */ {-2, 4}, {-1, 4}, {0, 4}, {1, 4}, {2, 4},
} ;
@ -113,6 +106,7 @@ inline void PushCoordBlocks(int a_BlockX, int a_Height, int a_BlockZ, sSetBlockV
inline void PushCornerBlocks(int a_BlockX, int a_Height, int a_BlockZ, int a_Seq, cNoise & a_Noise, int a_Chance, sSetBlockVector & a_Blocks, int a_CornersDist, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta)
{
for (size_t i = 0; i < ARRAYCOUNT(Corners); i++)

View File

@ -18,7 +18,7 @@ static cPrefabPiecePool g_UnderwaterBase(g_UnderwaterBasePrefabs, g_UnderwaterBa
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cUnderwaterBaseGen::cUnderwaterBase:
class cUnderwaterBaseGen::cUnderwaterBase :
@ -86,7 +86,7 @@ protected:
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cUnderwaterBaseGen:

View File

@ -333,7 +333,7 @@ protected:
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cVillageGen:
static cVillagePiecePool g_SandVillage(g_SandVillagePrefabs, g_SandVillagePrefabsCount, g_SandVillageStartingPrefabs, g_SandVillageStartingPrefabsCount);

View File

@ -5,18 +5,22 @@
class cGroup // tolua_export
{ // tolua_export
public: // tolua_export
// tolua_begin
class cGroup
{
public:
// tolua_end
cGroup() {}
~cGroup() {}
void SetName( const AString & a_Name ) { m_Name = a_Name; } // tolua_export
const AString & GetName() const { return m_Name; } // tolua_export
void SetColor( const AString & a_Color ) { m_Color = a_Color; } // tolua_export
void AddCommand( const AString & a_Command ); // tolua_export
void AddPermission( const AString & a_Permission ); // tolua_export
void InheritFrom( cGroup* a_Group ); // tolua_export
// tolua_begin
void SetName( const AString & a_Name ) { m_Name = a_Name; }
const AString & GetName() const { return m_Name; }
void SetColor( const AString & a_Color ) { m_Color = a_Color; }
void AddCommand( const AString & a_Command );
void AddPermission( const AString & a_Permission );
void InheritFrom( cGroup* a_Group );
// tolua_end
typedef std::map< AString, bool > PermissionMap;
const PermissionMap & GetPermissions() const { return m_Permissions; }

View File

@ -4,9 +4,26 @@ project (MCServer)
include_directories ("${PROJECT_SOURCE_DIR}/../")
file(GLOB SOURCE
"*.cpp"
"*.h"
)
SET (SRCS
EnvelopeParser.cpp
HTTPConnection.cpp
HTTPFormParser.cpp
HTTPMessage.cpp
HTTPServer.cpp
MultipartParser.cpp
NameValueParser.cpp
SslHTTPConnection.cpp)
add_library(HTTPServer ${SOURCE})
SET (HDRS
EnvelopeParser.h
HTTPConnection.h
HTTPFormParser.h
HTTPMessage.h
HTTPServer.h
MultipartParser.h
NameValueParser.h
SslHTTPConnection.h)
if(NOT MSVC)
add_library(HTTPServer ${SRCS} ${HDRS})
endif()

View File

@ -20,7 +20,7 @@
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cHTTPMessage:
cHTTPMessage::cHTTPMessage(eKind a_Kind) :
@ -64,7 +64,7 @@ void cHTTPMessage::AddHeader(const AString & a_Key, const AString & a_Value)
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cHTTPRequest:
cHTTPRequest::cHTTPRequest(void) :
@ -248,7 +248,7 @@ void cHTTPRequest::OnHeaderLine(const AString & a_Key, const AString & a_Value)
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cHTTPResponse:
cHTTPResponse::cHTTPResponse(void) :

View File

@ -118,12 +118,12 @@ class cDebugCallbacks :
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cHTTPServer:
cHTTPServer::cHTTPServer(void) :
m_ListenThreadIPv4(*this, cSocket::IPv4, "WebServer IPv4"),
m_ListenThreadIPv6(*this, cSocket::IPv6, "WebServer IPv6"),
m_ListenThreadIPv4(*this, cSocket::IPv4, "WebServer"),
m_ListenThreadIPv6(*this, cSocket::IPv6, "WebServer"),
m_Callbacks(NULL)
{
}

View File

@ -21,7 +21,7 @@
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// self-test:
#if 0
@ -87,7 +87,7 @@ ThisIsIgnoredEpilogue";
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cMultipartParser:

View File

@ -69,7 +69,7 @@ public:
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cNameValueParser:
cNameValueParser::cNameValueParser(bool a_AllowsKeyOnly) :

View File

@ -151,6 +151,24 @@ int cInventory::AddItems(cItems & a_ItemStackList, bool a_AllowNewStacks, bool a
int cInventory::RemoveItem(const cItem & a_ItemStack)
{
int RemovedItems = m_HotbarSlots.RemoveItem(a_ItemStack);
if (RemovedItems < a_ItemStack.m_ItemCount)
{
cItem Temp(a_ItemStack);
Temp.m_ItemCount -= RemovedItems;
RemovedItems += m_InventorySlots.RemoveItem(Temp);
}
return RemovedItems;
}
bool cInventory::RemoveOneEquippedItem(void)
{
if (m_HotbarSlots.GetSlot(m_EquippedSlotNum).IsEmpty())

View File

@ -86,6 +86,10 @@ public:
*/
int AddItems(cItems & a_ItemStackList, bool a_AllowNewStacks, bool a_tryToFillEquippedFirst);
/** Removes the specified item from the inventory, as many as possible, up to a_ItemStack.m_ItemCount.
Returns the number of items that were removed. */
int RemoveItem(const cItem & a_ItemStack);
/** Removes one item out of the currently equipped item stack, returns true if successful, false if empty-handed */
bool RemoveOneEquippedItem(void);

View File

@ -193,17 +193,29 @@ void cItem::FromJson(const Json::Value & a_Value)
bool cItem::IsEnchantable(short item)
{
if ((item >= 256) && (item <= 259))
{
return true;
}
if ((item >= 267) && (item <= 279))
{
return true;
}
if ((item >= 283) && (item <= 286))
{
return true;
}
if ((item >= 290) && (item <= 294))
{
return true;
}
if ((item >= 298) && (item <= 317))
{
return true;
}
if ((item == 346) || (item == 359) || (item == 261))
{
return true;
}
return false;
}
@ -363,7 +375,7 @@ bool cItem::EnchantByXPLevels(int a_NumXPLevels)
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// cItems:
cItem * cItems::Get(int a_Idx)

View File

@ -345,6 +345,39 @@ int cItemGrid::AddItems(cItems & a_ItemStackList, bool a_AllowNewStacks, int a_P
int cItemGrid::RemoveItem(const cItem & a_ItemStack)
{
int NumLeft = a_ItemStack.m_ItemCount;
for (int i = 0; i < m_NumSlots; i++)
{
if (NumLeft <= 0)
{
break;
}
if (m_Slots[i].IsEqual(a_ItemStack))
{
int NumToRemove = std::min(NumLeft, (int)m_Slots[i].m_ItemCount);
NumLeft -= NumToRemove;
m_Slots[i].m_ItemCount -= NumToRemove;
if (m_Slots[i].m_ItemCount <= 0)
{
m_Slots[i].Empty();
}
TriggerListeners(i);
}
}
return (a_ItemStack.m_ItemCount - NumLeft);
}
int cItemGrid::ChangeSlotCount(int a_SlotNum, int a_AddToCount)
{
if ((a_SlotNum < 0) || (a_SlotNum >= m_NumSlots))

Some files were not shown because too many files have changed in this diff Show More