Stopped circutry devices from propogating power (allow more reliable "Jebdoors")

master
Sebastian Joseph 2016-02-03 23:35:58 +01:00
parent a5b6ff5e3d
commit 69496bc0e5
5 changed files with 43 additions and 38 deletions

View File

@ -374,7 +374,7 @@ void content_mapnode_circuit(bool repeat)
f->draw_type = CDT_CUBELIKE;
f->light_propagates = true;
f->sunlight_propagates = true;
f->energy_type = CET_CONDUCTIVE;
f->energy_type = CET_DEVICE;
f->light_source = LIGHT_MAX-1;
f->unpowered_node = CONTENT_CIRCUIT_LAMP_OFF;
f->dug_item = std::string("MaterialItem2 ")+itos(CONTENT_CIRCUIT_LAMP_OFF)+" 1";
@ -395,7 +395,7 @@ void content_mapnode_circuit(bool repeat)
f->draw_type = CDT_GLASSLIKE;
f->light_propagates = true;
f->sunlight_propagates = true;
f->energy_type = CET_CONDUCTIVE;
f->energy_type = CET_DEVICE;
f->powered_node = CONTENT_CIRCUIT_LAMP;
f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
f->setAllTextures("circuit_lamp.png");
@ -426,7 +426,7 @@ void content_mapnode_circuit(bool repeat)
f->visual_solidness = 1;
f->param_type = CPT_FACEDIR_SIMPLE;
f->draw_type = CDT_CUBELIKE;
f->energy_type = CET_CONDUCTIVE;
f->energy_type = CET_DEVICE;
f->floormount_alternate_node = CONTENT_CIRCUIT_PISTON_UP_OFF;
f->roofmount_alternate_node = CONTENT_CIRCUIT_PISTON_DOWN_OFF;
f->special_alternate_node = CONTENT_CIRCUIT_PISTON_ARM;
@ -462,7 +462,7 @@ void content_mapnode_circuit(bool repeat)
f->visual_solidness = 1;
f->param_type = CPT_FACEDIR_SIMPLE;
f->draw_type = CDT_NODEBOX;
f->energy_type = CET_CONDUCTIVE;
f->energy_type = CET_DEVICE;
f->special_alternate_node = CONTENT_CIRCUIT_PISTON_ARM;
f->rotate_tile_with_nodebox = true;
f->dug_item = std::string("MaterialItem2 ")+itos(CONTENT_CIRCUIT_PISTON_OFF)+" 1";
@ -514,7 +514,7 @@ void content_mapnode_circuit(bool repeat)
f->is_ground_content = true;
f->visual_solidness = 1;
f->draw_type = CDT_CUBELIKE;
f->energy_type = CET_CONDUCTIVE;
f->energy_type = CET_DEVICE;
f->wallmount_alternate_node = CONTENT_CIRCUIT_PISTON_OFF;
f->roofmount_alternate_node = CONTENT_CIRCUIT_PISTON_DOWN_OFF;
f->special_alternate_node = CONTENT_CIRCUIT_PISTON_UP_ARM;
@ -536,7 +536,7 @@ void content_mapnode_circuit(bool repeat)
f->solidness = 0; // drawn separately, makes no faces
f->visual_solidness = 1;
f->draw_type = CDT_NODEBOX;
f->energy_type = CET_CONDUCTIVE;
f->energy_type = CET_DEVICE;
f->special_alternate_node = CONTENT_CIRCUIT_PISTON_UP_ARM;
f->rotate_tile_with_nodebox = true;
f->dug_item = std::string("MaterialItem2 ")+itos(CONTENT_CIRCUIT_PISTON_OFF)+" 1";
@ -580,7 +580,7 @@ void content_mapnode_circuit(bool repeat)
f->is_ground_content = true;
f->visual_solidness = 1;
f->draw_type = CDT_CUBELIKE;
f->energy_type = CET_CONDUCTIVE;
f->energy_type = CET_DEVICE;
f->floormount_alternate_node = CONTENT_CIRCUIT_PISTON_UP_OFF;
f->wallmount_alternate_node = CONTENT_CIRCUIT_PISTON_OFF;
f->special_alternate_node = CONTENT_CIRCUIT_PISTON_DOWN_ARM;
@ -602,7 +602,7 @@ void content_mapnode_circuit(bool repeat)
f->solidness = 0; // drawn separately, makes no faces
f->visual_solidness = 1;
f->draw_type = CDT_NODEBOX;
f->energy_type = CET_CONDUCTIVE;
f->energy_type = CET_DEVICE;
f->special_alternate_node = CONTENT_CIRCUIT_PISTON_DOWN_ARM;
f->rotate_tile_with_nodebox = true;
f->dug_item = std::string("MaterialItem2 ")+itos(CONTENT_CIRCUIT_PISTON_OFF)+" 1";
@ -647,7 +647,7 @@ void content_mapnode_circuit(bool repeat)
f->visual_solidness = 1;
f->param_type = CPT_FACEDIR_SIMPLE;
f->draw_type = CDT_CUBELIKE;
f->energy_type = CET_CONDUCTIVE;
f->energy_type = CET_DEVICE;
f->floormount_alternate_node = CONTENT_CIRCUIT_STICKYPISTON_UP_OFF;
f->roofmount_alternate_node = CONTENT_CIRCUIT_STICKYPISTON_DOWN_OFF;
f->special_alternate_node = CONTENT_CIRCUIT_STICKYPISTON_ARM;
@ -676,7 +676,7 @@ void content_mapnode_circuit(bool repeat)
f->visual_solidness = 1;
f->param_type = CPT_FACEDIR_SIMPLE;
f->draw_type = CDT_NODEBOX;
f->energy_type = CET_CONDUCTIVE;
f->energy_type = CET_DEVICE;
f->special_alternate_node = CONTENT_CIRCUIT_STICKYPISTON_ARM;
f->rotate_tile_with_nodebox = true;
f->dug_item = std::string("MaterialItem2 ")+itos(CONTENT_CIRCUIT_STICKYPISTON_OFF)+" 1";
@ -728,7 +728,7 @@ void content_mapnode_circuit(bool repeat)
f->is_ground_content = true;
f->visual_solidness = 1;
f->draw_type = CDT_CUBELIKE;
f->energy_type = CET_CONDUCTIVE;
f->energy_type = CET_DEVICE;
f->wallmount_alternate_node = CONTENT_CIRCUIT_STICKYPISTON_OFF;
f->roofmount_alternate_node = CONTENT_CIRCUIT_STICKYPISTON_DOWN_OFF;
f->special_alternate_node = CONTENT_CIRCUIT_STICKYPISTON_UP_ARM;
@ -750,7 +750,7 @@ void content_mapnode_circuit(bool repeat)
f->solidness = 0; // drawn separately, makes no faces
f->visual_solidness = 1;
f->draw_type = CDT_NODEBOX;
f->energy_type = CET_CONDUCTIVE;
f->energy_type = CET_DEVICE;
f->special_alternate_node = CONTENT_CIRCUIT_STICKYPISTON_UP_ARM;
f->rotate_tile_with_nodebox = true;
f->dug_item = std::string("MaterialItem2 ")+itos(CONTENT_CIRCUIT_STICKYPISTON_OFF)+" 1";
@ -794,7 +794,7 @@ void content_mapnode_circuit(bool repeat)
f->is_ground_content = true;
f->visual_solidness = 1;
f->draw_type = CDT_CUBELIKE;
f->energy_type = CET_CONDUCTIVE;
f->energy_type = CET_DEVICE;
f->floormount_alternate_node = CONTENT_CIRCUIT_STICKYPISTON_UP_OFF;
f->wallmount_alternate_node = CONTENT_CIRCUIT_STICKYPISTON_OFF;
f->special_alternate_node = CONTENT_CIRCUIT_STICKYPISTON_DOWN_ARM;
@ -816,7 +816,7 @@ void content_mapnode_circuit(bool repeat)
f->solidness = 0; // drawn separately, makes no faces
f->visual_solidness = 1;
f->draw_type = CDT_NODEBOX;
f->energy_type = CET_CONDUCTIVE;
f->energy_type = CET_DEVICE;
f->special_alternate_node = CONTENT_CIRCUIT_STICKYPISTON_DOWN_ARM;
f->rotate_tile_with_nodebox = true;
f->dug_item = std::string("MaterialItem2 ")+itos(CONTENT_CIRCUIT_STICKYPISTON_OFF)+" 1";

View File

@ -116,7 +116,7 @@ void content_mapnode_door(bool repeat)
f->hardness = 5.0;
f->pressure_type = CST_SOLID;
f->suffocation_per_second = 0;
f->energy_type = CET_CONDUCTIVE;
f->energy_type = CET_DEVICE;
if (f->initial_metadata == NULL)
f->initial_metadata = new DoorNodeMetadata();
i = CONTENT_STEEL_DOOR_LT;
@ -145,7 +145,7 @@ void content_mapnode_door(bool repeat)
f->hardness = 5.0;
f->pressure_type = CST_SOLID;
f->suffocation_per_second = 0;
f->energy_type = CET_CONDUCTIVE;
f->energy_type = CET_DEVICE;
if (f->initial_metadata == NULL)
f->initial_metadata = new DoorNodeMetadata();
crafting::set1over1Recipe(CONTENT_STEEL_HATCH,CONTENT_STEEL_HATCH,CONTENT_STEEL_DOOR_LT);
@ -297,7 +297,7 @@ void content_mapnode_door(bool repeat)
f->hardness = 5.0;
f->pressure_type = CST_SOLID;
f->suffocation_per_second = 0;
f->energy_type = CET_CONDUCTIVE;
f->energy_type = CET_DEVICE;
if (f->initial_metadata == NULL)
f->initial_metadata = new DoorNodeMetadata();
i = CONTENT_STEEL_W_DOOR_LT;
@ -327,7 +327,7 @@ void content_mapnode_door(bool repeat)
f->hardness = 5.0;
f->pressure_type = CST_SOLID;
f->suffocation_per_second = 0;
f->energy_type = CET_CONDUCTIVE;
f->energy_type = CET_DEVICE;
if (f->initial_metadata == NULL)
f->initial_metadata = new DoorNodeMetadata();
crafting::set1over1Recipe(CONTENT_STEEL_W_HATCH,CONTENT_STEEL_HATCH,CONTENT_STEEL_W_DOOR_LT);
@ -475,7 +475,7 @@ void content_mapnode_door(bool repeat)
f->hardness = 5.0;
f->pressure_type = CST_SOLID;
f->suffocation_per_second = 0;
f->energy_type = CET_CONDUCTIVE;
f->energy_type = CET_DEVICE;
if (f->initial_metadata == NULL)
f->initial_metadata = new DoorNodeMetadata();
i = CONTENT_STEEL_DOOR_RT;
@ -504,7 +504,7 @@ void content_mapnode_door(bool repeat)
f->hardness = 5.0;
f->pressure_type = CST_SOLID;
f->suffocation_per_second = 0;
f->energy_type = CET_CONDUCTIVE;
f->energy_type = CET_DEVICE;
if (f->initial_metadata == NULL)
f->initial_metadata = new DoorNodeMetadata();
lists::add("creative",i);
@ -594,7 +594,7 @@ void content_mapnode_door(bool repeat)
f->hardness = 5.0;
f->pressure_type = CST_SOLID;
f->suffocation_per_second = 0;
f->energy_type = CET_CONDUCTIVE;
f->energy_type = CET_DEVICE;
if (f->initial_metadata == NULL)
f->initial_metadata = new DoorNodeMetadata();
i = CONTENT_STEEL_W_DOOR_RT;
@ -624,7 +624,7 @@ void content_mapnode_door(bool repeat)
f->hardness = 5.0;
f->pressure_type = CST_SOLID;
f->suffocation_per_second = 0;
f->energy_type = CET_CONDUCTIVE;
f->energy_type = CET_DEVICE;
if (f->initial_metadata == NULL)
f->initial_metadata = new DoorNodeMetadata();
crafting::set1To1Recipe(CONTENT_STEEL_W_DOOR_LT,CONTENT_STEEL_W_DOOR_RT);
@ -761,7 +761,7 @@ void content_mapnode_door(bool repeat)
f->hardness = 5.0;
f->pressure_type = CST_SOLID;
f->suffocation_per_second = 0;
f->energy_type = CET_CONDUCTIVE;
f->energy_type = CET_DEVICE;
if (f->initial_metadata == NULL)
f->initial_metadata = new DoorNodeMetadata();
i = CONTENT_STEEL_DOOR_LT_OPEN;
@ -788,7 +788,7 @@ void content_mapnode_door(bool repeat)
f->hardness = 5.0;
f->pressure_type = CST_SOLID;
f->suffocation_per_second = 0;
f->energy_type = CET_CONDUCTIVE;
f->energy_type = CET_DEVICE;
if (f->initial_metadata == NULL)
f->initial_metadata = new DoorNodeMetadata();
@ -869,7 +869,7 @@ void content_mapnode_door(bool repeat)
f->hardness = 5.0;
f->pressure_type = CST_SOLID;
f->suffocation_per_second = 0;
f->energy_type = CET_CONDUCTIVE;
f->energy_type = CET_DEVICE;
if (f->initial_metadata == NULL)
f->initial_metadata = new DoorNodeMetadata();
i = CONTENT_STEEL_W_DOOR_LT_OPEN;
@ -896,7 +896,7 @@ void content_mapnode_door(bool repeat)
f->hardness = 5.0;
f->pressure_type = CST_SOLID;
f->suffocation_per_second = 0;
f->energy_type = CET_CONDUCTIVE;
f->energy_type = CET_DEVICE;
if (f->initial_metadata == NULL)
f->initial_metadata = new DoorNodeMetadata();
@ -1039,7 +1039,7 @@ void content_mapnode_door(bool repeat)
f->hardness = 5.0;
f->pressure_type = CST_SOLID;
f->suffocation_per_second = 0;
f->energy_type = CET_CONDUCTIVE;
f->energy_type = CET_DEVICE;
if (f->initial_metadata == NULL)
f->initial_metadata = new DoorNodeMetadata();
i = CONTENT_STEEL_DOOR_RT_OPEN;
@ -1068,7 +1068,7 @@ void content_mapnode_door(bool repeat)
f->hardness = 5.0;
f->pressure_type = CST_SOLID;
f->suffocation_per_second = 0;
f->energy_type = CET_CONDUCTIVE;
f->energy_type = CET_DEVICE;
if (f->initial_metadata == NULL)
f->initial_metadata = new DoorNodeMetadata();
@ -1155,7 +1155,7 @@ void content_mapnode_door(bool repeat)
f->hardness = 5.0;
f->pressure_type = CST_SOLID;
f->suffocation_per_second = 0;
f->energy_type = CET_CONDUCTIVE;
f->energy_type = CET_DEVICE;
if (f->initial_metadata == NULL)
f->initial_metadata = new DoorNodeMetadata();
i = CONTENT_STEEL_W_DOOR_RT_OPEN;
@ -1184,7 +1184,7 @@ void content_mapnode_door(bool repeat)
f->hardness = 5.0;
f->pressure_type = CST_SOLID;
f->suffocation_per_second = 0;
f->energy_type = CET_CONDUCTIVE;
f->energy_type = CET_DEVICE;
if (f->initial_metadata == NULL)
f->initial_metadata = new DoorNodeMetadata();
@ -1236,7 +1236,7 @@ void content_mapnode_door(bool repeat)
f->hardness = 5.0;
f->pressure_type = CST_SOLID;
f->suffocation_per_second = 0;
f->energy_type = CET_CONDUCTIVE;
f->energy_type = CET_DEVICE;
if (f->initial_metadata == NULL)
f->initial_metadata = new DoorNodeMetadata();
crafting::setSoftBlockRecipe(CONTENT_CRAFTITEM_STEEL_INGOT,CONTENT_STEEL_HATCH);
@ -1295,7 +1295,7 @@ void content_mapnode_door(bool repeat)
f->hardness = 5.0;
f->pressure_type = CST_SOLID;
f->suffocation_per_second = 0;
f->energy_type = CET_CONDUCTIVE;
f->energy_type = CET_DEVICE;
if (f->initial_metadata == NULL)
f->initial_metadata = new DoorNodeMetadata();
crafting::set1over1Recipe(CONTENT_GLASS,CONTENT_STEEL_HATCH,CONTENT_STEEL_W_HATCH);
@ -1360,7 +1360,7 @@ void content_mapnode_door(bool repeat)
f->hardness = 5.0;
f->pressure_type = CST_SOLID;
f->suffocation_per_second = 0;
f->energy_type = CET_CONDUCTIVE;
f->energy_type = CET_DEVICE;
if (f->initial_metadata == NULL)
f->initial_metadata = new DoorNodeMetadata();
crafting::setGateRecipe(CONTENT_CRAFTITEM_STEEL_INGOT,CONTENT_STEEL,CONTENT_STEEL_GATE);
@ -1421,7 +1421,7 @@ void content_mapnode_door(bool repeat)
f->hardness = 5.0;
f->pressure_type = CST_SOLID;
f->suffocation_per_second = 0;
f->energy_type = CET_CONDUCTIVE;
f->energy_type = CET_DEVICE;
if (f->initial_metadata == NULL)
f->initial_metadata = new DoorNodeMetadata();
@ -1478,7 +1478,7 @@ void content_mapnode_door(bool repeat)
f->hardness = 5.0;
f->pressure_type = CST_SOLID;
f->suffocation_per_second = 0;
f->energy_type = CET_CONDUCTIVE;
f->energy_type = CET_DEVICE;
if (f->initial_metadata == NULL)
f->initial_metadata = new DoorNodeMetadata();
@ -1532,7 +1532,7 @@ void content_mapnode_door(bool repeat)
f->hardness = 5.0;
f->pressure_type = CST_SOLID;
f->suffocation_per_second = 0;
f->energy_type = CET_CONDUCTIVE;
f->energy_type = CET_DEVICE;
if (f->initial_metadata == NULL)
f->initial_metadata = new DoorNodeMetadata();
}

View File

@ -1733,7 +1733,7 @@ void content_mapnode_special(bool repeat)
f->setInventoryTextureCube("tnt_top.png", "tnt.png", "tnt.png");
f->draw_type = CDT_CUBELIKE;
f->is_ground_content = true;
f->energy_type = CET_CONDUCTIVE;
f->energy_type = CET_DEVICE;
f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
if(f->initial_metadata == NULL)
f->initial_metadata = new TNTNodeMetadata();

View File

@ -3129,6 +3129,10 @@ bool ServerEnvironment::propogateEnergy(u8 level, v3s16 powersrc, v3s16 signalsr
m_map->addNodeAndUpdate(pos, n, modified_blocks, st);
}
}
if (f.energy_type == CET_DEVICE) {
// devices receive power, but don't propogate it further
return false;
}
if (f.energy_type != CET_SOURCE && f.energy_type != CET_SWITCH)
level -= f.energy_drop;

View File

@ -172,7 +172,8 @@ enum ContentEnergyType {
CET_CONDUCTIVE,
CET_SOURCE,
CET_SWITCH,
CET_GATE
CET_GATE,
CET_DEVICE,
};
/*