diff --git a/code/datums/components/material_container.dm b/code/datums/components/material_container.dm index 6f4e8d586d..56301cdc8b 100644 --- a/code/datums/components/material_container.dm +++ b/code/datums/components/material_container.dm @@ -15,16 +15,18 @@ var/sheet_type var/list/materials var/show_on_examine + var/disable_attackby var/list/allowed_typecache var/last_inserted_id var/precise_insertion = FALSE var/datum/callback/precondition var/datum/callback/after_insert -/datum/component/material_container/Initialize(list/mat_list, max_amt = 0, _show_on_examine = FALSE, list/allowed_types, datum/callback/_precondition, datum/callback/_after_insert) +/datum/component/material_container/Initialize(list/mat_list, max_amt = 0, _show_on_examine = FALSE, list/allowed_types, datum/callback/_precondition, datum/callback/_after_insert, _disable_attackby) materials = list() max_amount = max(0, max_amt) show_on_examine = _show_on_examine + disable_attackby = _disable_attackby if(allowed_types) allowed_typecache = typecacheof(allowed_types) precondition = _precondition @@ -43,14 +45,17 @@ materials[id] = new mat_path() /datum/component/material_container/proc/OnExamine(mob/user) - for(var/I in materials) - var/datum/material/M = materials[I] - var/amt = amount(M.id) - if(amt) - to_chat(user, "It has [amt] units of [lowertext(M.name)] stored.") + if(show_on_examine) + for(var/I in materials) + var/datum/material/M = materials[I] + var/amt = amount(M.id) + if(amt) + to_chat(user, "It has [amt] units of [lowertext(M.name)] stored.") /datum/component/material_container/proc/OnAttackBy(obj/item/I, mob/living/user) var/list/tc = allowed_typecache + if(disable_attackby) + return if(user.a_intent != INTENT_HELP) return if((I.flags_2 & (HOLOGRAM_2 | NO_MAT_REDEMPTION_2)) || (tc && !is_type_in_typecache(I, tc))) diff --git a/code/game/machinery/droneDispenser.dm b/code/game/machinery/droneDispenser.dm index cf2eed6f53..9d4f5dd936 100644 --- a/code/game/machinery/droneDispenser.dm +++ b/code/game/machinery/droneDispenser.dm @@ -51,7 +51,7 @@ /obj/machinery/droneDispenser/Initialize() . = ..() - var/datum/component/material_container/materials = AddComponent(/datum/component/material_container, list(MAT_METAL, MAT_GLASS), MINERAL_MATERIAL_AMOUNT * MAX_STACK_SIZE * 2, TRUE) + var/datum/component/material_container/materials = AddComponent(/datum/component/material_container, list(MAT_METAL, MAT_GLASS), MINERAL_MATERIAL_AMOUNT * MAX_STACK_SIZE * 2, TRUE, list(/obj/item/stack)) materials.insert_amount(starting_amount) materials.precise_insertion = TRUE using_materials = list(MAT_METAL=metal_cost, MAT_GLASS=glass_cost) diff --git a/code/game/machinery/recycler.dm b/code/game/machinery/recycler.dm index ec20efbf84..08fcb1baa8 100644 --- a/code/game/machinery/recycler.dm +++ b/code/game/machinery/recycler.dm @@ -19,7 +19,7 @@ var/item_recycle_sound = 'sound/items/welder.ogg' /obj/machinery/recycler/Initialize() - AddComponent(/datum/component/material_container, list(MAT_METAL, MAT_GLASS, MAT_PLASMA, MAT_SILVER, MAT_GOLD, MAT_DIAMOND, MAT_URANIUM, MAT_BANANIUM, MAT_TITANIUM)) + AddComponent(/datum/component/material_container, list(MAT_METAL, MAT_GLASS, MAT_PLASMA, MAT_SILVER, MAT_GOLD, MAT_DIAMOND, MAT_URANIUM, MAT_BANANIUM, MAT_TITANIUM, MAT_BLUESPACE, MAT_PLASTIC), INFINITY, FALSE, null, null, null, TRUE) AddComponent(/datum/component/butchering, 1, amount_produced,amount_produced/5) . = ..() update_icon() diff --git a/code/game/mecha/mech_fabricator.dm b/code/game/mecha/mech_fabricator.dm index 49f29b5969..526c808809 100644 --- a/code/game/mecha/mech_fabricator.dm +++ b/code/game/mecha/mech_fabricator.dm @@ -37,7 +37,7 @@ /obj/machinery/mecha_part_fabricator/Initialize() var/datum/component/material_container/materials = AddComponent(/datum/component/material_container, list(MAT_METAL, MAT_GLASS, MAT_SILVER, MAT_GOLD, MAT_DIAMOND, MAT_PLASMA, MAT_URANIUM, MAT_BANANIUM, MAT_TITANIUM, MAT_BLUESPACE), 0, - FALSE, list(/obj/item/stack, /obj/item/stack/ore/bluespace_crystal), CALLBACK(src, .proc/is_insertion_ready), CALLBACK(src, .proc/AfterMaterialInsert)) + FALSE, list(/obj/item/stack), CALLBACK(src, .proc/is_insertion_ready), CALLBACK(src, .proc/AfterMaterialInsert)) materials.precise_insertion = TRUE stored_research = new return ..() diff --git a/code/modules/clothing/shoes/bananashoes.dm b/code/modules/clothing/shoes/bananashoes.dm index 7ffd9c1f40..df3aa5007f 100644 --- a/code/modules/clothing/shoes/bananashoes.dm +++ b/code/modules/clothing/shoes/bananashoes.dm @@ -10,7 +10,7 @@ /obj/item/clothing/shoes/clown_shoes/banana_shoes/Initialize() . = ..() - AddComponent(/datum/component/material_container, list(MAT_BANANIUM), 200000, TRUE) + AddComponent(/datum/component/material_container, list(MAT_BANANIUM), 200000, TRUE, list(/obj/item/stack)) AddComponent(/datum/component/squeak, list('sound/items/bikehorn.ogg'=1), 75) if(always_noslip) flags_1 |= NOSLIP_1 diff --git a/code/modules/integrated_electronics/subtypes/manipulation.dm b/code/modules/integrated_electronics/subtypes/manipulation.dm index 1744a468f5..db859ab649 100644 --- a/code/modules/integrated_electronics/subtypes/manipulation.dm +++ b/code/modules/integrated_electronics/subtypes/manipulation.dm @@ -573,7 +573,7 @@ /obj/item/integrated_circuit/manipulation/matman/Initialize() var/datum/component/material_container/materials = AddComponent(/datum/component/material_container, list(MAT_METAL, MAT_GLASS, MAT_SILVER, MAT_GOLD, MAT_DIAMOND, MAT_PLASMA, MAT_URANIUM, MAT_BANANIUM, MAT_TITANIUM, MAT_BLUESPACE), 0, - FALSE, list(/obj/item/stack, /obj/item/stack/ore/bluespace_crystal), CALLBACK(src, .proc/is_insertion_ready), CALLBACK(src, .proc/AfterMaterialInsert)) + FALSE, list(/obj/item/stack), CALLBACK(src, .proc/is_insertion_ready), CALLBACK(src, .proc/AfterMaterialInsert)) materials.max_amount =100000 materials.precise_insertion = TRUE .=..() diff --git a/code/modules/mining/machine_processing.dm b/code/modules/mining/machine_processing.dm index bb5347a152..c7ba9ad6f4 100644 --- a/code/modules/mining/machine_processing.dm +++ b/code/modules/mining/machine_processing.dm @@ -84,7 +84,7 @@ /obj/machinery/mineral/processing_unit/Initialize() . = ..() proximity_monitor = new(src, 1) - AddComponent(/datum/component/material_container, list(MAT_METAL, MAT_GLASS, MAT_SILVER, MAT_GOLD, MAT_DIAMOND, MAT_PLASMA, MAT_URANIUM, MAT_BANANIUM, MAT_TITANIUM, MAT_BLUESPACE), INFINITY) + AddComponent(/datum/component/material_container, list(MAT_METAL, MAT_GLASS, MAT_SILVER, MAT_GOLD, MAT_DIAMOND, MAT_PLASMA, MAT_URANIUM, MAT_BANANIUM, MAT_TITANIUM, MAT_BLUESPACE), INFINITY, FALSE, list(/obj/item/stack)) stored_research = new /datum/techweb/specialized/autounlocking/smelter /obj/machinery/mineral/processing_unit/Destroy() diff --git a/code/modules/mining/machine_redemption.dm b/code/modules/mining/machine_redemption.dm index 63e00f5a38..b7b3d91e54 100644 --- a/code/modules/mining/machine_redemption.dm +++ b/code/modules/mining/machine_redemption.dm @@ -28,7 +28,7 @@ /obj/machinery/mineral/ore_redemption/Initialize() . = ..() - AddComponent(/datum/component/material_container, list(MAT_METAL, MAT_GLASS, MAT_SILVER, MAT_GOLD, MAT_DIAMOND, MAT_PLASMA, MAT_URANIUM, MAT_BANANIUM, MAT_TITANIUM, MAT_BLUESPACE),INFINITY) + AddComponent(/datum/component/material_container, list(MAT_METAL, MAT_GLASS, MAT_SILVER, MAT_GOLD, MAT_DIAMOND, MAT_PLASMA, MAT_URANIUM, MAT_BANANIUM, MAT_TITANIUM, MAT_BLUESPACE),INFINITY, FALSE, list(/obj/item/stack)) stored_research = new /datum/techweb/specialized/autounlocking/smelter /obj/machinery/mineral/ore_redemption/Destroy() diff --git a/code/modules/mining/mint.dm b/code/modules/mining/mint.dm index ec4c9bd714..b7cc0db43f 100644 --- a/code/modules/mining/mint.dm +++ b/code/modules/mining/mint.dm @@ -16,7 +16,7 @@ /obj/machinery/mineral/mint/Initialize() . = ..() - AddComponent(/datum/component/material_container, list(MAT_METAL, MAT_PLASMA, MAT_SILVER, MAT_GOLD, MAT_URANIUM, MAT_DIAMOND, MAT_BANANIUM), MINERAL_MATERIAL_AMOUNT * 50) + AddComponent(/datum/component/material_container, list(MAT_METAL, MAT_PLASMA, MAT_SILVER, MAT_GOLD, MAT_URANIUM, MAT_DIAMOND, MAT_BANANIUM), MINERAL_MATERIAL_AMOUNT * 50, FALSE, list(/obj/item/stack)) /obj/machinery/mineral/mint/process() var/turf/T = get_step(src, input_dir)