From 101631d55fef8c857d2e88ce7bd139f40d67695a Mon Sep 17 00:00:00 2001 From: darkrose Date: Sat, 22 Jun 2013 14:40:21 +1000 Subject: [PATCH] borderstone, part 1 --- data/textures/borderstone.png | Bin 0 -> 933 bytes src/content_craft.cpp | 15 +++++++ src/content_mapnode.cpp | 12 +++++- src/content_mapnode.h | 4 +- src/environment.cpp | 78 +--------------------------------- 5 files changed, 30 insertions(+), 79 deletions(-) create mode 100644 data/textures/borderstone.png diff --git a/data/textures/borderstone.png b/data/textures/borderstone.png new file mode 100644 index 0000000000000000000000000000000000000000..9904d248bedba1cf440b2c5e5dbc822ddd5c49e8 GIT binary patch literal 933 zcmV;W16urvP)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2i*o1 z1SAvc8Bi7g00SjSL_t(I%O#S_N-JjofWOSu8I#GxAu%S#pawA^6+}TexN{-2&|RT) z)t$?}!g+`D0NoS{-F4GN5nB)hEv=AEM2!%MiP6MdCX-~wN&YT;gzpmh^5u)D)oM77 zgKgUwhQY$Z0*yw4UayA`0?V>cRh7wPLZ{Qg_kE_*DYk8+RI62Xc6NAueMOQa>h(G| zH#e-TtYBFdLI`eeZ_zXj*LB(3+vDo$icBVhrfEp?`J866NhA`X+wC%$Oh~0tY;A2J zNfN14iej;duIsF>t^$xwr+IsOBNmIHn5K#6c{Cag(&;pw=aEPxI4b{)EX#~WBL;&3 zzqh|*Hk+ZUDw~^|1VKQhQb96J6IE4NUtcE@iC|e4KYo3RBun^#kD@48mc0q8&1QLiex_Edad2=zHv1p$&;>x(bmn4C zzt@Kd7^Z>ix{O96T-PNC0+cWeaU2K3FsM{29DSt_&O#RS1>VDVq{v6k*=&X)D=3P> zWHKQL0!-6Haa|W71itT6C=~eR&m{eRpK`g()6)||23agZblUDr83KPR8hb8&Hj<2a<#X)Z4>$>nm$#bWVurBcDRZOY{` ztyYWc>uYS=W;h%&9*^1B*ueLFwzs!gTwEj!Lt?QQmSyoj>z87uHJV&t00000NkvXX Hu0mjfj9r`r literal 0 HcmV?d00001 diff --git a/src/content_craft.cpp b/src/content_craft.cpp index e1dcdf2..cbbdda0 100644 --- a/src/content_craft.cpp +++ b/src/content_craft.cpp @@ -334,6 +334,21 @@ InventoryItem *craft_get_result(InventoryItem **items) defs_init++; } + // Border Stone + { + defs[defs_init].specs[0] = ItemSpec(ITEM_MATERIAL, CONTENT_STONE); + defs[defs_init].specs[1] = ItemSpec(ITEM_MATERIAL, CONTENT_STONE); + defs[defs_init].specs[2] = ItemSpec(ITEM_MATERIAL, CONTENT_STONE); + defs[defs_init].specs[3] = ItemSpec(ITEM_MATERIAL, CONTENT_STONE); + defs[defs_init].specs[4] = ItemSpec(ITEM_MATERIAL, CONTENT_MESE); + defs[defs_init].specs[5] = ItemSpec(ITEM_MATERIAL, CONTENT_STONE); + defs[defs_init].specs[6] = ItemSpec(ITEM_MATERIAL, CONTENT_STONE); + defs[defs_init].specs[7] = ItemSpec(ITEM_MATERIAL, CONTENT_STONE); + defs[defs_init].specs[8] = ItemSpec(ITEM_MATERIAL, CONTENT_STONE); + defs[defs_init].item = new MaterialItem(CONTENT_BORDERSTONE, 1); + defs_init++; + } + // Furnace { defs[defs_init].specs[0] = ItemSpec(ITEM_MATERIAL, CONTENT_COBBLE); diff --git a/src/content_mapnode.cpp b/src/content_mapnode.cpp index 7dbf1e2..8d777ee 100644 --- a/src/content_mapnode.cpp +++ b/src/content_mapnode.cpp @@ -42,7 +42,7 @@ void setWoodLikeDiggingProperties(DiggingPropertiesList &list, float toughness); Maps <=v19 content types to current ones. Should never be touched. */ -content_t trans_table_19[20][2] = { +content_t trans_table_19[21][2] = { {CONTENT_GRASS, 1}, {CONTENT_TREE, 4}, {CONTENT_LEAVES, 5}, @@ -50,6 +50,7 @@ content_t trans_table_19[20][2] = { {CONTENT_MESE, 7}, {CONTENT_MUD, 8}, {CONTENT_COTTON, 10}, + {CONTENT_BORDERSTONE, 11}, {CONTENT_WOOD, 12}, {CONTENT_SAND, 13}, {CONTENT_COBBLE, 18}, @@ -340,6 +341,15 @@ void content_mapnode_init() f->climbable = true; setWoodLikeDiggingProperties(f->digging_properties, 0.5); + + i = CONTENT_BORDERSTONE; + f = &content_features(i); + f->setAllTextures("borderstone.png"); + f->setInventoryTextureCube("morderstone.png", "borderstone.png", "borderstone.png"); + f->is_ground_content = true; + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + setStoneLikeDiggingProperties(f->digging_properties, 2.0); + i = CONTENT_WOOD; f = &content_features(i); f->setAllTextures("wood.png"); diff --git a/src/content_mapnode.h b/src/content_mapnode.h index c942fe8..b615819 100644 --- a/src/content_mapnode.h +++ b/src/content_mapnode.h @@ -24,7 +24,7 @@ with this program; if not, write to the Free Software Foundation, Inc., void content_mapnode_init(); -extern content_t trans_table_19[20][2]; +extern content_t trans_table_19[21][2]; MapNode mapnode_translate_from_internal(MapNode n_from, u8 version); MapNode mapnode_translate_to_internal(MapNode n_from, u8 version); @@ -66,7 +66,7 @@ MapNode mapnode_translate_to_internal(MapNode n_from, u8 version); #define CONTENT_MUD 0x805 //8 // used to be cloud #define CONTENT_COTTON 0x806 //10 - +#define CONTENT_BORDERSTONE 0x807 //11 #define CONTENT_WOOD 0x808 //12 #define CONTENT_SAND 0x809 //13 #define CONTENT_COBBLE 0x80a //18 diff --git a/src/environment.cpp b/src/environment.cpp index 7600b03..bde36a4 100644 --- a/src/environment.cpp +++ b/src/environment.cpp @@ -906,7 +906,6 @@ void ServerEnvironment::step(float dtime) if(m_active_blocks_test_interval.step(dtime, 10.0)) { ScopeProfiler sp(g_profiler, "SEnv: modify in blocks avg /10s", SPT_AVG); - //float dtime = 10.0; for(core::map::Iterator i = m_active_blocks.m_list.getIterator(); @@ -914,9 +913,6 @@ void ServerEnvironment::step(float dtime) { v3s16 p = i.getNode()->getKey(); - /*infostream<<"Server: Block ("<getBlockNoCreateNoEx(p); if(block==NULL) continue; @@ -936,11 +932,6 @@ void ServerEnvironment::step(float dtime) Everything should bind to inside this single content searching loop to keep things fast. */ - // TODO: Implement usage of ActiveBlockModifier - - // Find out how many objects the block contains - //u32 active_object_count = block->m_static_objects.m_active.size(); - // Find out how many objects this and all the neighbors contain u32 active_object_count_wider = 0; for(s16 x=-1; x<=1; x++) for(s16 y=-1; y<=1; y++) @@ -952,16 +943,6 @@ void ServerEnvironment::step(float dtime) active_object_count_wider += block->m_static_objects.m_active.size() + block->m_static_objects.m_stored.size(); - - /*if(block->m_static_objects.m_stored.size() != 0){ - errorstream<<"ServerEnvironment::step(): " - <getPos())<<" contains " - <m_static_objects.m_stored.size() - <<" stored objects; " - <<"when spawning objects, when counting active " - <<"objects in wide area. relative position: " - <<"("<getNodeNoEx(p+v3s16(0,1,0)); MapNode n_top2 = m_map->getNodeNoEx(p+v3s16(0,2,0)); @@ -1456,60 +1436,6 @@ void ServerEnvironment::step(float dtime) */ removeRemovedObjects(); } - - if(g_settings->getBool("enable_experimental")) - { - - /* - TEST CODE - */ -#if 0 - m_random_spawn_timer -= dtime; - if(m_random_spawn_timer < 0) - { - //m_random_spawn_timer += myrand_range(2.0, 20.0); - //m_random_spawn_timer += 2.0; - m_random_spawn_timer += 200.0; - - /* - Find some position - */ - - /*v2s16 p2d(myrand_range(-5,5), myrand_range(-5,5)); - s16 y = 1 + getServerMap().findGroundLevel(p2d); - v3f pos(p2d.X*BS,y*BS,p2d.Y*BS);*/ - - Player *player = getRandomConnectedPlayer(); - v3f pos(0,0,0); - if(player) - pos = player->getPosition(); - pos += v3f( - myrand_range(-3,3)*BS, - 5, - myrand_range(-3,3)*BS - ); - - /* - Create a ServerActiveObject - */ - - //TestSAO *obj = new TestSAO(this, 0, pos); - //ServerActiveObject *obj = new ItemSAO(this, 0, pos, "CraftItem Stick 1"); - //ServerActiveObject *obj = new RatSAO(this, 0, pos); - //ServerActiveObject *obj = new Oerkki1SAO(this, 0, pos); - //ServerActiveObject *obj = new FireflySAO(this, 0, pos); - - infostream<<"Server: Spawning MobV2SAO at " - <<"("<