From dd1a58b01e7fc9f16ebaf5615b82ccb6b9c6e5a1 Mon Sep 17 00:00:00 2001 From: MysticTempest Date: Sun, 15 May 2022 02:18:21 -0500 Subject: [PATCH 1/5] Implement piston fixes: This enables the feature of unsticky pistons. This allows for some nodes to be unpullable, but otherwise pushable or diggable. A certain selection of nodes that can never be moved. And, stops certain entities from being pushed if they shouldn't move. Along with this change; I've also updated the rules regarding pushing, and pulling of nodes & objects to be more accurate to MC. Now allowing for more complex redstone circuits to be built. --- mods/ITEMS/REDSTONE/mesecons_mvps/init.lua | 501 ++++++++++++++++++++- mods/ITEMS/mcl_core/nodes_misc.lua | 2 +- 2 files changed, 493 insertions(+), 10 deletions(-) diff --git a/mods/ITEMS/REDSTONE/mesecons_mvps/init.lua b/mods/ITEMS/REDSTONE/mesecons_mvps/init.lua index fedb8fa5d7..6e46162994 100644 --- a/mods/ITEMS/REDSTONE/mesecons_mvps/init.lua +++ b/mods/ITEMS/REDSTONE/mesecons_mvps/init.lua @@ -47,8 +47,6 @@ end -- For nodes which ignore sticky sides. -- They can't be pulled by sticky pistons and don't interact with slime blocks. --- TODO: This has NOT any actual effect so far. The actual functionality --- still needs to be implemented. function mesecon.register_mvps_unsticky(nodename, get_unsticky) if get_unsticky == nil then get_unsticky = true @@ -66,9 +64,6 @@ function mesecon.is_mvps_unsticky(node, pulldir, stack, stackid) if type(get_unsticky) == "function" then get_unsticky = get_unsticky(node, pulldir, stack, stackid) end - if get_unsticky == nil then - get_unsticky = false - end return get_unsticky end @@ -211,7 +206,15 @@ function mesecon.mvps_push(pos, dir, maximum, player_name, piston_pos) end function mesecon.mvps_pull_single(pos, dir, maximum, player_name, piston_pos) - return mesecon.mvps_push_or_pull(pos, vector.multiply(dir, -1), dir, maximum, player_name, piston_pos) + local nodes = mesecon.mvps_get_stack(pos, dir, maximum, player_name, piston_pos) + + if not nodes then return end + -- ensure sticky pistons; even without slimeblocks attached adhere to the unpullable rule. + for id, n in ipairs(nodes) do + if not mesecon.is_mvps_unsticky(n.node, dir, nodes, id) then + return mesecon.mvps_push_or_pull(pos, vector.multiply(dir, -1), dir, maximum, player_name, piston_pos) + end + end end -- pos: pos of mvps; stackdir: direction of building the stack @@ -357,13 +360,14 @@ function mesecon.mvps_move_objects(pos, dir, nodestack) end end --- Unmovable by design +-- Unmovable by design: nodes mesecon.register_mvps_stopper("mcl_core:barrier") mesecon.register_mvps_stopper("mcl_core:realm_barrier") mesecon.register_mvps_stopper("mcl_core:void") mesecon.register_mvps_stopper("mcl_core:bedrock") mesecon.register_mvps_stopper("mcl_core:obsidian") mesecon.register_mvps_stopper("mcl_chests:ender_chest") +mesecon.register_mvps_stopper("mcl_chests:ender_chest_small") mesecon.register_mvps_stopper("mcl_mobspawners:spawner") mesecon.register_mvps_stopper("mesecons_commandblock:commandblock_off") mesecon.register_mvps_stopper("mesecons_commandblock:commandblock_on") @@ -371,9 +375,18 @@ mesecon.register_mvps_stopper("mcl_portals:portal") mesecon.register_mvps_stopper("mcl_portals:portal_end") mesecon.register_mvps_stopper("mcl_portals:end_portal_frame") mesecon.register_mvps_stopper("mcl_portals:end_portal_frame_eye") +mesecon.register_mvps_stopper("mcl_enchanting:table") +mesecon.register_mvps_stopper("mcl_jukebox:jukebox") +mesecon.register_mvps_stopper("mesecons_solarpanel:solar_panel_on") +mesecon.register_mvps_stopper("mesecons_solarpanel:solar_panel_off") +mesecon.register_mvps_stopper("mesecons_solarpanel:solar_panel_inverted_on") +mesecon.register_mvps_stopper("mesecons_solarpanel:solar_panel_inverted_off") +mesecon.register_mvps_stopper("mcl_banners:hanging_banner") +mesecon.register_mvps_stopper("mcl_banners:standing_banner") -- Unmovable by technical restrictions. -- Open formspec would screw up if node is destroyed (minor problem) +-- Would screw up on/off state of trapped chest (big problem) mesecon.register_mvps_stopper("mcl_furnaces:furnace") mesecon.register_mvps_stopper("mcl_furnaces:furnace_active") mesecon.register_mvps_stopper("mcl_hoppers:hopper") @@ -387,9 +400,39 @@ mesecon.register_mvps_stopper("mcl_dispensers:dispenser_down") mesecon.register_mvps_stopper("mcl_anvils:anvil") mesecon.register_mvps_stopper("mcl_anvils:anvil_damage_1") mesecon.register_mvps_stopper("mcl_anvils:anvil_damage_2") --- Would screw up on/off state of trapped chest (big problem) +mesecon.register_mvps_stopper("mcl_chests:chest") +mesecon.register_mvps_stopper("mcl_chests:chest_small") +mesecon.register_mvps_stopper("mcl_chests:chest_left") +mesecon.register_mvps_stopper("mcl_chests:chest_right") +mesecon.register_mvps_stopper("mcl_chests:trapped_chest") +mesecon.register_mvps_stopper("mcl_chests:trapped_chest_small") +mesecon.register_mvps_stopper("mcl_chests:trapped_chest_left") +mesecon.register_mvps_stopper("mcl_chests:trapped_chest_right") +mesecon.register_mvps_stopper("mcl_signs:wall_sign") +mesecon.register_mvps_stopper("mcl_signs:standing_sign") +mesecon.register_mvps_stopper("mcl_signs:standing_sign22_5") +mesecon.register_mvps_stopper("mcl_signs:standing_sign45") +mesecon.register_mvps_stopper("mcl_signs:standing_sign67_5") +mesecon.register_mvps_stopper("mcl_barrels:barrel_open") +mesecon.register_mvps_stopper("mcl_barrels:barrel_closed") --- Glazed terracotta: unpullable + +-- Unmovable by design: objects +mesecon.register_mvps_unmov("mcl_enchanting:book") +mesecon.register_mvps_unmov("mcl_chests:chest") +mesecon.register_mvps_unmov("mcl_banners:hanging_banner") +mesecon.register_mvps_unmov("mcl_banners:standing_banner") +mesecon.register_mvps_unmov("mcl_signs:text") +mesecon.register_mvps_unmov("mcl_mobspawners:doll") +mesecon.register_mvps_unmov("mcl_armor_stand:armor_entity") +mesecon.register_mvps_unmov("mcl_itemframes:item") +mesecon.register_mvps_unmov("mcl_itemframes:map") +mesecon.register_mvps_unmov("mcl_paintings:painting") +mesecon.register_mvps_unmov("mcl_end:crystal") + + +-- Unpullable by design: nodes +-- Glazed Terracotta mesecon.register_mvps_unsticky("mcl_colorblocks:glazed_terracotta_red") mesecon.register_mvps_unsticky("mcl_colorblocks:glazed_terracotta_orange") mesecon.register_mvps_unsticky("mcl_colorblocks:glazed_terracotta_yellow") @@ -406,6 +449,446 @@ mesecon.register_mvps_unsticky("mcl_colorblocks:glazed_terracotta_black") mesecon.register_mvps_unsticky("mcl_colorblocks:glazed_terracotta_brown") mesecon.register_mvps_unsticky("mcl_colorblocks:glazed_terracotta_light_blue") mesecon.register_mvps_unsticky("mcl_colorblocks:glazed_terracotta_pink") +-- Beds +mesecon.register_mvps_unsticky("mcl_beds:bed_black_top") +mesecon.register_mvps_unsticky("mcl_beds:bed_black_bottom") +mesecon.register_mvps_unsticky("mcl_beds:bed_blue_top") +mesecon.register_mvps_unsticky("mcl_beds:bed_blue_bottom") +mesecon.register_mvps_unsticky("mcl_beds:bed_brown_top") +mesecon.register_mvps_unsticky("mcl_beds:bed_brown_bottom") +mesecon.register_mvps_unsticky("mcl_beds:bed_cyan_top") +mesecon.register_mvps_unsticky("mcl_beds:bed_cyan_bottom") +mesecon.register_mvps_unsticky("mcl_beds:bed_green_top") +mesecon.register_mvps_unsticky("mcl_beds:bed_green_bottom") +mesecon.register_mvps_unsticky("mcl_beds:bed_grey_top") +mesecon.register_mvps_unsticky("mcl_beds:bed_grey_bottom") +mesecon.register_mvps_unsticky("mcl_beds:bed_light_blue_top") +mesecon.register_mvps_unsticky("mcl_beds:bed_light_blue_bottom") +mesecon.register_mvps_unsticky("mcl_beds:bed_lime_top") +mesecon.register_mvps_unsticky("mcl_beds:bed_lime_bottom") +mesecon.register_mvps_unsticky("mcl_beds:bed_magenta_top") +mesecon.register_mvps_unsticky("mcl_beds:bed_magenta_bottom") +mesecon.register_mvps_unsticky("mcl_beds:bed_orange_top") +mesecon.register_mvps_unsticky("mcl_beds:bed_orange_bottom") +mesecon.register_mvps_unsticky("mcl_beds:bed_pink_top") +mesecon.register_mvps_unsticky("mcl_beds:bed_pink_bottom") +mesecon.register_mvps_unsticky("mcl_beds:bed_purple_top") +mesecon.register_mvps_unsticky("mcl_beds:bed_purple_bottom") +mesecon.register_mvps_unsticky("mcl_beds:bed_red_top") +mesecon.register_mvps_unsticky("mcl_beds:bed_red_bottom") +mesecon.register_mvps_unsticky("mcl_beds:bed_silver_top") +mesecon.register_mvps_unsticky("mcl_beds:bed_silver_bottom") +mesecon.register_mvps_unsticky("mcl_beds:bed_white_top") +mesecon.register_mvps_unsticky("mcl_beds:bed_white_bottom") +mesecon.register_mvps_unsticky("mcl_beds:bed_yellow_top") +mesecon.register_mvps_unsticky("mcl_beds:bed_yellow_bottom") +-- Buttons +mesecon.register_mvps_unsticky("mesecons_button:button_stone_off") +mesecon.register_mvps_unsticky("mesecons_button:button_stone_on") +mesecon.register_mvps_unsticky("mesecons_button:button_wood_off") +mesecon.register_mvps_unsticky("mesecons_button:button_wood_on") +mesecon.register_mvps_unsticky("mesecons_button:button_acaciawood_off") +mesecon.register_mvps_unsticky("mesecons_button:button_acaciawood_on") +mesecon.register_mvps_unsticky("mesecons_button:button_birchwood_off") +mesecon.register_mvps_unsticky("mesecons_button:button_birchwood_on") +mesecon.register_mvps_unsticky("mesecons_button:button_darkwood_off") +mesecon.register_mvps_unsticky("mesecons_button:button_darkwood_on") +mesecon.register_mvps_unsticky("mesecons_button:button_sprucewood_off") +mesecon.register_mvps_unsticky("mesecons_button:button_sprucewood_on") +mesecon.register_mvps_unsticky("mesecons_button:button_junglewood_off") +mesecon.register_mvps_unsticky("mesecons_button:button_junglewood_on") +-- Cactus, Sugarcane & Vines +mesecon.register_mvps_unsticky("mcl_core:cactus") +mesecon.register_mvps_unsticky("mcl_core:reeds") +mesecon.register_mvps_unsticky("mcl_core:vine") +-- Cake +mesecon.register_mvps_unsticky("mcl_cake:cake_1") +mesecon.register_mvps_unsticky("mcl_cake:cake_2") +mesecon.register_mvps_unsticky("mcl_cake:cake_3") +mesecon.register_mvps_unsticky("mcl_cake:cake_4") +mesecon.register_mvps_unsticky("mcl_cake:cake_5") +mesecon.register_mvps_unsticky("mcl_cake:cake_6") +mesecon.register_mvps_unsticky("mcl_cake:cake") +-- Carpet +mesecon.register_mvps_unsticky("mcl_wool:black_carpet") +mesecon.register_mvps_unsticky("mcl_wool:blue_carpet") +mesecon.register_mvps_unsticky("mcl_wool:brown_carpet") +mesecon.register_mvps_unsticky("mcl_wool:cyan_carpet") +mesecon.register_mvps_unsticky("mcl_wool:green_carpet") +mesecon.register_mvps_unsticky("mcl_wool:grey_carpet") +mesecon.register_mvps_unsticky("mcl_wool:light_blue_carpet") +mesecon.register_mvps_unsticky("mcl_wool:lime_carpet") +mesecon.register_mvps_unsticky("mcl_wool:orange_carpet") +mesecon.register_mvps_unsticky("mcl_wool:magenta_carpet") +mesecon.register_mvps_unsticky("mcl_wool:pink_carpet") +mesecon.register_mvps_unsticky("mcl_wool:purple_carpet") +mesecon.register_mvps_unsticky("mcl_wool:red_carpet") +mesecon.register_mvps_unsticky("mcl_wool:silver_carpet") +mesecon.register_mvps_unsticky("mcl_wool:white_carpet") +mesecon.register_mvps_unsticky("mcl_wool:yellow_carpet") +-- Carved & Jack O'Lantern Pumpkins, Pumpkin & Melon +mesecon.register_mvps_unsticky("mcl_farming:pumpkin_face") +mesecon.register_mvps_unsticky("mcl_farming:pumpkin_face_light") +mesecon.register_mvps_unsticky("mcl_farming:pumpkin") +mesecon.register_mvps_unsticky("mcl_farming:melon") +-- Chorus Plant & Flower +mesecon.register_mvps_unsticky("mcl_end:chorus_plant") +mesecon.register_mvps_unsticky("mcl_end:chorus_flower") +-- Cobweb +mesecon.register_mvps_unsticky("mcl_core:cobweb") +-- Cocoa +mesecon.register_mvps_unsticky("mcl_cocoas:cocoa_1") +mesecon.register_mvps_unsticky("mcl_cocoas:cocoa_2") +mesecon.register_mvps_unsticky("mcl_cocoas:cocoa_3") +-- Doors +mesecon.register_mvps_unsticky("mcl_doors:wooden_door_t_1") +mesecon.register_mvps_unsticky("mcl_doors:wooden_door_b_1") +mesecon.register_mvps_unsticky("mcl_doors:wooden_door_t_2") +mesecon.register_mvps_unsticky("mcl_doors:wooden_door_b_2") +mesecon.register_mvps_unsticky("mcl_doors:iron_door_t_1") +mesecon.register_mvps_unsticky("mcl_doors:iron_door_b_1") +mesecon.register_mvps_unsticky("mcl_doors:iron_door_t_2") +mesecon.register_mvps_unsticky("mcl_doors:iron_door_b_2") +mesecon.register_mvps_unsticky("mcl_doors:acacia_door_t_1") +mesecon.register_mvps_unsticky("mcl_doors:acacia_door_b_1") +mesecon.register_mvps_unsticky("mcl_doors:acacia_door_t_2") +mesecon.register_mvps_unsticky("mcl_doors:acacia_door_b_2") +mesecon.register_mvps_unsticky("mcl_doors:birch_door_t_1") +mesecon.register_mvps_unsticky("mcl_doors:birch_door_b_1") +mesecon.register_mvps_unsticky("mcl_doors:birch_door_t_2") +mesecon.register_mvps_unsticky("mcl_doors:birch_door_b_2") +mesecon.register_mvps_unsticky("mcl_doors:dark_oak_door_t_1") +mesecon.register_mvps_unsticky("mcl_doors:dark_oak_door_b_1") +mesecon.register_mvps_unsticky("mcl_doors:dark_oak_door_t_2") +mesecon.register_mvps_unsticky("mcl_doors:dark_oak_door_b_2") +mesecon.register_mvps_unsticky("mcl_doors:spruce_door_t_1") +mesecon.register_mvps_unsticky("mcl_doors:spruce_door_b_1") +mesecon.register_mvps_unsticky("mcl_doors:spruce_door_t_2") +mesecon.register_mvps_unsticky("mcl_doors:spruce_door_b_2") +mesecon.register_mvps_unsticky("mcl_doors:jungle_door_t_1") +mesecon.register_mvps_unsticky("mcl_doors:jungle_door_b_1") +mesecon.register_mvps_unsticky("mcl_doors:jungle_door_t_2") +mesecon.register_mvps_unsticky("mcl_doors:jungle_door_b_2") +-- Dragon Egg +mesecon.register_mvps_unsticky("mcl_end:dragon_egg") +-- Fire +mesecon.register_mvps_unsticky("mcl_fire:fire") +mesecon.register_mvps_unsticky("mcl_fire:eternal_fire") +-- Flower Pots +mesecon.register_mvps_unsticky("mcl_flowerpots:flower_pot") +mesecon.register_mvps_unsticky("mcl_flowerpots:flower_pot_allium") +mesecon.register_mvps_unsticky("mcl_flowerpots:flower_pot_azure_bluet") +mesecon.register_mvps_unsticky("mcl_flowerpots:flower_pot_blue_orchid") +mesecon.register_mvps_unsticky("mcl_flowerpots:flower_pot_dandelion") +mesecon.register_mvps_unsticky("mcl_flowerpots:flower_pot_fern") +mesecon.register_mvps_unsticky("mcl_flowerpots:flower_pot_oxeye_daisy") +mesecon.register_mvps_unsticky("mcl_flowerpots:flower_pot_poppy") +mesecon.register_mvps_unsticky("mcl_flowerpots:flower_pot_tulip_orange") +mesecon.register_mvps_unsticky("mcl_flowerpots:flower_pot_tulip_pink") +mesecon.register_mvps_unsticky("mcl_flowerpots:flower_pot_tulip_red") +mesecon.register_mvps_unsticky("mcl_flowerpots:flower_pot_tulip_white") +-- Flowers, Lilypad & Dead Bush +mesecon.register_mvps_unsticky("mcl_core:deadbush") +mesecon.register_mvps_unsticky("mcl_flowers:allium") +mesecon.register_mvps_unsticky("mcl_flowers:azure_bluet") +mesecon.register_mvps_unsticky("mcl_flowers:blue_orchid") +mesecon.register_mvps_unsticky("mcl_flowers:dandelion") +mesecon.register_mvps_unsticky("mcl_flowers:double_fern") +mesecon.register_mvps_unsticky("mcl_flowers:double_fern_top") +mesecon.register_mvps_unsticky("mcl_flowers:fern") +mesecon.register_mvps_unsticky("mcl_flowers:lilac") +mesecon.register_mvps_unsticky("mcl_flowers:lilac_top") +mesecon.register_mvps_unsticky("mcl_flowers:oxeye_daisy") +mesecon.register_mvps_unsticky("mcl_flowers:peony") +mesecon.register_mvps_unsticky("mcl_flowers:peony_top") +mesecon.register_mvps_unsticky("mcl_flowers:poppy") +mesecon.register_mvps_unsticky("mcl_flowers:rose_bush") +mesecon.register_mvps_unsticky("mcl_flowers:rose_bush_top") +mesecon.register_mvps_unsticky("mcl_flowers:sunflower") +mesecon.register_mvps_unsticky("mcl_flowers:sunflower_top") +mesecon.register_mvps_unsticky("mcl_flowers:tallgrass") +mesecon.register_mvps_unsticky("mcl_flowers:double_grass") +mesecon.register_mvps_unsticky("mcl_flowers:double_grass_top") +mesecon.register_mvps_unsticky("mcl_flowers:tulip_orange") +mesecon.register_mvps_unsticky("mcl_flowers:tulip_pink") +mesecon.register_mvps_unsticky("mcl_flowers:tulip_red") +mesecon.register_mvps_unsticky("mcl_flowers:tulip_white") +mesecon.register_mvps_unsticky("mcl_flowers:waterlily") +-- Heads +mesecon.register_mvps_unsticky("mcl_heads:creeper") +mesecon.register_mvps_unsticky("mcl_heads:skeleton") +mesecon.register_mvps_unsticky("mcl_heads:steve") +mesecon.register_mvps_unsticky("mcl_heads:wither_skeleton") +mesecon.register_mvps_unsticky("mcl_heads:zombie") +-- Item Frame +mesecon.register_mvps_unsticky("mcl_itemframes:item_frame") +-- Ladder +mesecon.register_mvps_unsticky("mcl_core:ladder") +-- Lava & Water +mesecon.register_mvps_unsticky("mcl_core:lava_source") +mesecon.register_mvps_unsticky("mcl_core:lava_flowing") +mesecon.register_mvps_unsticky("mcl_core:water_source") +mesecon.register_mvps_unsticky("mcl_core:water_flowing") +mesecon.register_mvps_unsticky("mclx_core:river_water_source") +mesecon.register_mvps_unsticky("mclx_core:river_water_flowing") +-- Leaves +mesecon.register_mvps_unsticky("mcl_core:leaves") +mesecon.register_mvps_unsticky("mcl_core:acacialeaves") +mesecon.register_mvps_unsticky("mcl_core:birchleaves") +mesecon.register_mvps_unsticky("mcl_core:darkleaves") +mesecon.register_mvps_unsticky("mcl_core:spruceleaves") +mesecon.register_mvps_unsticky("mcl_core:jungleleaves") +-- Lever +mesecon.register_mvps_unsticky("mesecons_walllever:wall_lever_off") +mesecon.register_mvps_unsticky("mesecons_walllever:wall_lever_on") +-- Mushrooms, Nether Wart & Amethyst +mesecon.register_mvps_unsticky("mcl_mushroom:mushroom_brown") +mesecon.register_mvps_unsticky("mcl_mushroom:mushroom_red") +mesecon.register_mvps_unsticky("mcl_nether:nether_wart_0") +mesecon.register_mvps_unsticky("mcl_nether:nether_wart_1") +mesecon.register_mvps_unsticky("mcl_nether:nether_wart_2") +mesecon.register_mvps_unsticky("mcl_nether:nether_wart") +mesecon.register_mvps_unsticky("mcl_amethyst:amethyst_cluster") +mesecon.register_mvps_unsticky("mcl_amethyst:budding_amethyst_block") +-- Pressure Plates +mesecon.register_mvps_unsticky("mesecons_pressureplates:pressure_plate_wood_on") +mesecon.register_mvps_unsticky("mesecons_pressureplates:pressure_plate_wood_off") +mesecon.register_mvps_unsticky("mesecons_pressureplates:pressure_plate_stone_on") +mesecon.register_mvps_unsticky("mesecons_pressureplates:pressure_plate_stone_off") +mesecon.register_mvps_unsticky("mesecons_pressureplates:pressure_plate_acaciawood_on") +mesecon.register_mvps_unsticky("mesecons_pressureplates:pressure_plate_acaciawoood_off") +mesecon.register_mvps_unsticky("mesecons_pressureplates:pressure_plate_birchwood_on") +mesecon.register_mvps_unsticky("mesecons_pressureplates:pressure_plate_birchwood_off") +mesecon.register_mvps_unsticky("mesecons_pressureplates:pressure_plate_darkwood_on") +mesecon.register_mvps_unsticky("mesecons_pressureplates:pressure_plate_darkwood_off") +mesecon.register_mvps_unsticky("mesecons_pressureplates:pressure_plate_sprucekwood_on") +mesecon.register_mvps_unsticky("mesecons_pressureplates:pressure_plate_sprucewood_off") +mesecon.register_mvps_unsticky("mesecons_pressureplates:pressure_plate_junglewood_on") +mesecon.register_mvps_unsticky("mesecons_pressureplates:pressure_plate_junglewood_off") +-- Redstone Comparators +mesecon.register_mvps_unsticky("mcl_comparators:comparator_on_sub") +mesecon.register_mvps_unsticky("mcl_comparators:comparator_off_sub") +mesecon.register_mvps_unsticky("mcl_comparators:comparator_on_comp") +mesecon.register_mvps_unsticky("mcl_comparators:comparator_off_comp") +-- Redstone Dust +mesecon.register_mvps_unsticky("mesecons:wire_00000000_on") +mesecon.register_mvps_unsticky("mesecons:wire_00000000_off") +mesecon.register_mvps_unsticky("mesecons:wire_10000000_on") +mesecon.register_mvps_unsticky("mesecons:wire_10000000_off") +mesecon.register_mvps_unsticky("mesecons:wire_01000000_on") +mesecon.register_mvps_unsticky("mesecons:wire_01000000_off") +mesecon.register_mvps_unsticky("mesecons:wire_11000000_on") +mesecon.register_mvps_unsticky("mesecons:wire_11000000_off") +mesecon.register_mvps_unsticky("mesecons:wire_00100000_on") +mesecon.register_mvps_unsticky("mesecons:wire_00100000_off") +mesecon.register_mvps_unsticky("mesecons:wire_10100000_on") +mesecon.register_mvps_unsticky("mesecons:wire_10100000_off") +mesecon.register_mvps_unsticky("mesecons:wire_01100000_on") +mesecon.register_mvps_unsticky("mesecons:wire_01100000_off") +mesecon.register_mvps_unsticky("mesecons:wire_11100000_on") +mesecon.register_mvps_unsticky("mesecons:wire_11100000_off") +mesecon.register_mvps_unsticky("mesecons:wire_00010000_on") +mesecon.register_mvps_unsticky("mesecons:wire_00010000_off") +mesecon.register_mvps_unsticky("mesecons:wire_10010000_on") +mesecon.register_mvps_unsticky("mesecons:wire_10010000_off") +mesecon.register_mvps_unsticky("mesecons:wire_01010000_on") +mesecon.register_mvps_unsticky("mesecons:wire_01010000_off") +mesecon.register_mvps_unsticky("mesecons:wire_11010000_on") +mesecon.register_mvps_unsticky("mesecons:wire_11010000_off") +mesecon.register_mvps_unsticky("mesecons:wire_00110000_on") +mesecon.register_mvps_unsticky("mesecons:wire_00110000_off") +mesecon.register_mvps_unsticky("mesecons:wire_10110000_on") +mesecon.register_mvps_unsticky("mesecons:wire_10110000_off") +mesecon.register_mvps_unsticky("mesecons:wire_01110000_on") +mesecon.register_mvps_unsticky("mesecons:wire_01110000_off") +mesecon.register_mvps_unsticky("mesecons:wire_11110000_on") +mesecon.register_mvps_unsticky("mesecons:wire_11110000_off") +mesecon.register_mvps_unsticky("mesecons:wire_10001000_on") +mesecon.register_mvps_unsticky("mesecons:wire_10001000_off") +mesecon.register_mvps_unsticky("mesecons:wire_11001000_on") +mesecon.register_mvps_unsticky("mesecons:wire_11001000_off") +mesecon.register_mvps_unsticky("mesecons:wire_10101000_on") +mesecon.register_mvps_unsticky("mesecons:wire_10101000_off") +mesecon.register_mvps_unsticky("mesecons:wire_11101000_on") +mesecon.register_mvps_unsticky("mesecons:wire_11101000_off") +mesecon.register_mvps_unsticky("mesecons:wire_10011000_on") +mesecon.register_mvps_unsticky("mesecons:wire_10011000_off") +mesecon.register_mvps_unsticky("mesecons:wire_11011000_on") +mesecon.register_mvps_unsticky("mesecons:wire_11011000_off") +mesecon.register_mvps_unsticky("mesecons:wire_10111000_on") +mesecon.register_mvps_unsticky("mesecons:wire_10111000_off") +mesecon.register_mvps_unsticky("mesecons:wire_11111000_on") +mesecon.register_mvps_unsticky("mesecons:wire_11111000_off") +mesecon.register_mvps_unsticky("mesecons:wire_01000100_on") +mesecon.register_mvps_unsticky("mesecons:wire_01000100_off") +mesecon.register_mvps_unsticky("mesecons:wire_11000100_on") +mesecon.register_mvps_unsticky("mesecons:wire_11000100_off") +mesecon.register_mvps_unsticky("mesecons:wire_01100100_on") +mesecon.register_mvps_unsticky("mesecons:wire_01100100_off") +mesecon.register_mvps_unsticky("mesecons:wire_11100100_on") +mesecon.register_mvps_unsticky("mesecons:wire_11100100_off") +mesecon.register_mvps_unsticky("mesecons:wire_01010100_on") +mesecon.register_mvps_unsticky("mesecons:wire_01010100_off") +mesecon.register_mvps_unsticky("mesecons:wire_11010100_on") +mesecon.register_mvps_unsticky("mesecons:wire_11010100_off") +mesecon.register_mvps_unsticky("mesecons:wire_01110100_on") +mesecon.register_mvps_unsticky("mesecons:wire_01110100_off") +mesecon.register_mvps_unsticky("mesecons:wire_11110100_on") +mesecon.register_mvps_unsticky("mesecons:wire_11110100_off") +mesecon.register_mvps_unsticky("mesecons:wire_11001100_on") +mesecon.register_mvps_unsticky("mesecons:wire_11001100_off") +mesecon.register_mvps_unsticky("mesecons:wire_11101100_on") +mesecon.register_mvps_unsticky("mesecons:wire_11101100_off") +mesecon.register_mvps_unsticky("mesecons:wire_11011100_on") +mesecon.register_mvps_unsticky("mesecons:wire_11011100_off") +mesecon.register_mvps_unsticky("mesecons:wire_11111100_on") +mesecon.register_mvps_unsticky("mesecons:wire_11111100_off") +mesecon.register_mvps_unsticky("mesecons:wire_00100010_on") +mesecon.register_mvps_unsticky("mesecons:wire_00100010_off") +mesecon.register_mvps_unsticky("mesecons:wire_10100010_on") +mesecon.register_mvps_unsticky("mesecons:wire_10100010_off") +mesecon.register_mvps_unsticky("mesecons:wire_01100010_on") +mesecon.register_mvps_unsticky("mesecons:wire_01100010_off") +mesecon.register_mvps_unsticky("mesecons:wire_11100010_on") +mesecon.register_mvps_unsticky("mesecons:wire_11100010_off") +mesecon.register_mvps_unsticky("mesecons:wire_00110010_on") +mesecon.register_mvps_unsticky("mesecons:wire_00110010_off") +mesecon.register_mvps_unsticky("mesecons:wire_10110010_on") +mesecon.register_mvps_unsticky("mesecons:wire_10110010_off") +mesecon.register_mvps_unsticky("mesecons:wire_01110010_on") +mesecon.register_mvps_unsticky("mesecons:wire_01110010_off") +mesecon.register_mvps_unsticky("mesecons:wire_11110010_on") +mesecon.register_mvps_unsticky("mesecons:wire_11110010_off") +mesecon.register_mvps_unsticky("mesecons:wire_10101010_on") +mesecon.register_mvps_unsticky("mesecons:wire_10101010_off") +mesecon.register_mvps_unsticky("mesecons:wire_11101010_on") +mesecon.register_mvps_unsticky("mesecons:wire_11101010_off") +mesecon.register_mvps_unsticky("mesecons:wire_10111010_on") +mesecon.register_mvps_unsticky("mesecons:wire_10111010_off") +mesecon.register_mvps_unsticky("mesecons:wire_11111010_on") +mesecon.register_mvps_unsticky("mesecons:wire_11111010_off") +mesecon.register_mvps_unsticky("mesecons:wire_01100110_on") +mesecon.register_mvps_unsticky("mesecons:wire_01100110_off") +mesecon.register_mvps_unsticky("mesecons:wire_11100110_on") +mesecon.register_mvps_unsticky("mesecons:wire_11100110_off") +mesecon.register_mvps_unsticky("mesecons:wire_01110110_on") +mesecon.register_mvps_unsticky("mesecons:wire_01110110_off") +mesecon.register_mvps_unsticky("mesecons:wire_11110110_on") +mesecon.register_mvps_unsticky("mesecons:wire_11110110_off") +mesecon.register_mvps_unsticky("mesecons:wire_11101110_on") +mesecon.register_mvps_unsticky("mesecons:wire_11101110_off") +mesecon.register_mvps_unsticky("mesecons:wire_11111110_on") +mesecon.register_mvps_unsticky("mesecons:wire_11111110_off") +mesecon.register_mvps_unsticky("mesecons:wire_00010001_on") +mesecon.register_mvps_unsticky("mesecons:wire_00010001_off") +mesecon.register_mvps_unsticky("mesecons:wire_10010001_on") +mesecon.register_mvps_unsticky("mesecons:wire_10010001_off") +mesecon.register_mvps_unsticky("mesecons:wire_01010001_on") +mesecon.register_mvps_unsticky("mesecons:wire_01010001_off") +mesecon.register_mvps_unsticky("mesecons:wire_11010001_on") +mesecon.register_mvps_unsticky("mesecons:wire_11010001_off") +mesecon.register_mvps_unsticky("mesecons:wire_00110001_on") +mesecon.register_mvps_unsticky("mesecons:wire_00110001_off") +mesecon.register_mvps_unsticky("mesecons:wire_10110001_on") +mesecon.register_mvps_unsticky("mesecons:wire_10110001_off") +mesecon.register_mvps_unsticky("mesecons:wire_01110001_on") +mesecon.register_mvps_unsticky("mesecons:wire_01110001_off") +mesecon.register_mvps_unsticky("mesecons:wire_11110001_on") +mesecon.register_mvps_unsticky("mesecons:wire_11110001_off") +mesecon.register_mvps_unsticky("mesecons:wire_10011001_on") +mesecon.register_mvps_unsticky("mesecons:wire_10011001_off") +mesecon.register_mvps_unsticky("mesecons:wire_11011001_on") +mesecon.register_mvps_unsticky("mesecons:wire_11011001_off") +mesecon.register_mvps_unsticky("mesecons:wire_10111001_on") +mesecon.register_mvps_unsticky("mesecons:wire_10111001_off") +mesecon.register_mvps_unsticky("mesecons:wire_11111001_on") +mesecon.register_mvps_unsticky("mesecons:wire_11111001_off") +mesecon.register_mvps_unsticky("mesecons:wire_01010101_on") +mesecon.register_mvps_unsticky("mesecons:wire_01010101_off") +mesecon.register_mvps_unsticky("mesecons:wire_11010101_on") +mesecon.register_mvps_unsticky("mesecons:wire_11010101_off") +mesecon.register_mvps_unsticky("mesecons:wire_01110101_on") +mesecon.register_mvps_unsticky("mesecons:wire_01110101_off") +mesecon.register_mvps_unsticky("mesecons:wire_11110101_on") +mesecon.register_mvps_unsticky("mesecons:wire_11110101_off") +mesecon.register_mvps_unsticky("mesecons:wire_11011101_on") +mesecon.register_mvps_unsticky("mesecons:wire_11011101_off") +mesecon.register_mvps_unsticky("mesecons:wire_11111101_on") +mesecon.register_mvps_unsticky("mesecons:wire_11111101_off") +mesecon.register_mvps_unsticky("mesecons:wire_00110011_on") +mesecon.register_mvps_unsticky("mesecons:wire_00110011_off") +mesecon.register_mvps_unsticky("mesecons:wire_10110011_on") +mesecon.register_mvps_unsticky("mesecons:wire_10110011_off") +mesecon.register_mvps_unsticky("mesecons:wire_01110011_on") +mesecon.register_mvps_unsticky("mesecons:wire_01110011_off") +mesecon.register_mvps_unsticky("mesecons:wire_11110011_on") +mesecon.register_mvps_unsticky("mesecons:wire_11110011_off") +mesecon.register_mvps_unsticky("mesecons:wire_10111011_on") +mesecon.register_mvps_unsticky("mesecons:wire_10111011_off") +mesecon.register_mvps_unsticky("mesecons:wire_11111011_on") +mesecon.register_mvps_unsticky("mesecons:wire_11111011_off") +mesecon.register_mvps_unsticky("mesecons:wire_01110111_on") +mesecon.register_mvps_unsticky("mesecons:wire_01110111_off") +mesecon.register_mvps_unsticky("mesecons:wire_11110111_on") +mesecon.register_mvps_unsticky("mesecons:wire_11110111_off") +mesecon.register_mvps_unsticky("mesecons:wire_11111111_on") +mesecon.register_mvps_unsticky("mesecons:wire_11111111_off") +-- Redstone Repeater +mesecon.register_mvps_unsticky("mesecons_delayer:delayer_off_1") +mesecon.register_mvps_unsticky("mesecons_delayer:delayer_off_2") +mesecon.register_mvps_unsticky("mesecons_delayer:delayer_off_3") +mesecon.register_mvps_unsticky("mesecons_delayer:delayer_off_4") +mesecon.register_mvps_unsticky("mesecons_delayer:delayer_on_1") +mesecon.register_mvps_unsticky("mesecons_delayer:delayer_on_2") +mesecon.register_mvps_unsticky("mesecons_delayer:delayer_on_3") +mesecon.register_mvps_unsticky("mesecons_delayer:delayer_on_4") +-- Redstone Torch +mesecon.register_mvps_unsticky("mesecons_torch:mesecon_torch_on") +mesecon.register_mvps_unsticky("mesecons_torch:mesecon_torch_off") +mesecon.register_mvps_unsticky("mesecons_torch:mesecon_torch_on_wall") +mesecon.register_mvps_unsticky("mesecons_torch:mesecon_torch_off_wall") +-- Sea Pickle +mesecon.register_mvps_unsticky("mcl_ocean:sea_pickle_1_dead_brain_coral_block") +mesecon.register_mvps_unsticky("mcl_ocean:sea_pickle_2_dead_brain_coral_block") +mesecon.register_mvps_unsticky("mcl_ocean:sea_pickle_3_dead_brain_coral_block") +mesecon.register_mvps_unsticky("mcl_ocean:sea_pickle_4_dead_brain_coral_block") +-- Shulker chests +mesecon.register_mvps_unsticky("mcl_chests:black_shulker_box_small") +mesecon.register_mvps_unsticky("mcl_chests:blue_shulker_box_small") +mesecon.register_mvps_unsticky("mcl_chests:brown_shulker_box_small") +mesecon.register_mvps_unsticky("mcl_chests:cyan_shulker_box_small") +mesecon.register_mvps_unsticky("mcl_chests:green_shulker_box_small") +mesecon.register_mvps_unsticky("mcl_chests:grey_shulker_box_small") +mesecon.register_mvps_unsticky("mcl_chests:light_blue_shulker_box_small") +mesecon.register_mvps_unsticky("mcl_chests:lime_shulker_box_small") +mesecon.register_mvps_unsticky("mcl_chests:orange_shulker_box_small") +mesecon.register_mvps_unsticky("mcl_chests:magenta_shulker_box_small") +mesecon.register_mvps_unsticky("mcl_chests:pink_shulker_box_small") +mesecon.register_mvps_unsticky("mcl_chests:purple_shulker_box_small") +mesecon.register_mvps_unsticky("mcl_chests:red_shulker_box_small") +mesecon.register_mvps_unsticky("mcl_chests:silver_shulker_box_small") +mesecon.register_mvps_unsticky("mcl_chests:white_shulker_box_small") +mesecon.register_mvps_unsticky("mcl_chests:yellow_shulker_box_small") +-- Snow +mesecon.register_mvps_unsticky("mcl_core:snow") +mesecon.register_mvps_unsticky("mcl_core:snow_2") +mesecon.register_mvps_unsticky("mcl_core:snow_3") +mesecon.register_mvps_unsticky("mcl_core:snow_4") +mesecon.register_mvps_unsticky("mcl_core:snow_5") +mesecon.register_mvps_unsticky("mcl_core:snow_6") +mesecon.register_mvps_unsticky("mcl_core:snow_7") +mesecon.register_mvps_unsticky("mcl_core:snow_8") +-- Torch +mesecon.register_mvps_unsticky("mcl_torches:torch") +mesecon.register_mvps_unsticky("mcl_torches:torch_wall") +-- Wheat +mesecon.register_mvps_unsticky("mcl_farming:wheat") +mesecon.register_mvps_unsticky("mcl_farming:wheat_2") +mesecon.register_mvps_unsticky("mcl_farming:wheat_3") +mesecon.register_mvps_unsticky("mcl_farming:wheat_4") +mesecon.register_mvps_unsticky("mcl_farming:wheat_5") +mesecon.register_mvps_unsticky("mcl_farming:wheat_6") +mesecon.register_mvps_unsticky("mcl_farming:wheat_7") -- Includes node heat when moving them mesecon.register_on_mvps_move(mesecon.move_hot_nodes) diff --git a/mods/ITEMS/mcl_core/nodes_misc.lua b/mods/ITEMS/mcl_core/nodes_misc.lua index 67669a861b..5f5b005e20 100644 --- a/mods/ITEMS/mcl_core/nodes_misc.lua +++ b/mods/ITEMS/mcl_core/nodes_misc.lua @@ -65,7 +65,7 @@ minetest.register_node("mcl_core:slimeblock", { neighbor_node = minetest.get_node(neighbor_pos) end local name = neighbor_node.name - if name ~= "air" and name ~= "ignore" then + if name ~= "air" and name ~= "ignore" and not mesecon.mvps_unsticky[name] then local piston, piston_side, piston_up, piston_down = false, false, false, false if name == "mesecons_pistons:piston_sticky_off" or name == "mesecons_pistons:piston_normal_off" then piston, piston_side = true, true From 37e72e333b8322778f91609983952dec92125e3a Mon Sep 17 00:00:00 2001 From: rudzik8 Date: Sun, 15 May 2022 16:15:55 +0700 Subject: [PATCH 2/5] Improve /seed command (now it looks like in modern MC) and update RU locale --- mods/MISC/mcl_commands/locale/mcl_commands.ru.tr | 6 +++--- mods/MISC/mcl_commands/mod.conf | 1 + mods/MISC/mcl_commands/seed.lua | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/mods/MISC/mcl_commands/locale/mcl_commands.ru.tr b/mods/MISC/mcl_commands/locale/mcl_commands.ru.tr index 686c8067c0..fb700cfab8 100644 --- a/mods/MISC/mcl_commands/locale/mcl_commands.ru.tr +++ b/mods/MISC/mcl_commands/locale/mcl_commands.ru.tr @@ -11,9 +11,9 @@ Can use /say=Можно использовать /say =<сообщение> Send a message to every player=Отправляет сообщение всем игрокам Invalid usage, see /help say.=Недопустимое использование, см. /help say. -,, =,, <СтрокаУзла> -Set node at given position=Устанавливает узел в заданной позиции -Invalid node=Неправильный узел +,, =,, <ИмяБлока> +Set node at given position=Устанавливает блок в заданной позиции +Invalid node=Неправильный блок @1 spawned.=@1 возродился(ась). Invalid parameters (see /help setblock)=Недопустимые параметры (см. /help setblock) List bans=Список банов diff --git a/mods/MISC/mcl_commands/mod.conf b/mods/MISC/mcl_commands/mod.conf index 00d707098f..dba1305646 100644 --- a/mods/MISC/mcl_commands/mod.conf +++ b/mods/MISC/mcl_commands/mod.conf @@ -1,3 +1,4 @@ name = mcl_commands author = Wuzzy description = MCL2 commands +depends = mcl_colors diff --git a/mods/MISC/mcl_commands/seed.lua b/mods/MISC/mcl_commands/seed.lua index 6a99d53cba..2ebb044748 100644 --- a/mods/MISC/mcl_commands/seed.lua +++ b/mods/MISC/mcl_commands/seed.lua @@ -5,6 +5,6 @@ minetest.register_chatcommand("seed", { params = "", privs = {}, func = function(name) - minetest.chat_send_player(name, "Seed: "..minetest.get_mapgen_setting("seed")) + minetest.chat_send_player(name, "Seed: ["..minetest.colorize(mcl_colors.GREEN, ""..minetest.get_mapgen_setting("seed")).."]") end }) \ No newline at end of file From 628686ce79c317efad5723031dd53a5aab4ec0c7 Mon Sep 17 00:00:00 2001 From: cora Date: Tue, 5 Apr 2022 22:43:37 +0200 Subject: [PATCH 3/5] Add a command to safely remove all mob objects --- mods/ENTITIES/mcl_mobs/api.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/mods/ENTITIES/mcl_mobs/api.lua b/mods/ENTITIES/mcl_mobs/api.lua index ea92353917..914a919a1d 100644 --- a/mods/ENTITIES/mcl_mobs/api.lua +++ b/mods/ENTITIES/mcl_mobs/api.lua @@ -101,6 +101,16 @@ local mod_worlds = minetest.get_modpath("mcl_worlds") ~= nil local mod_armor = minetest.get_modpath("mcl_armor") ~= nil local mod_experience = minetest.get_modpath("mcl_experience") ~= nil +--Helper function to clear all mobs because /clearobjects removes too much +minetest.register_chatcommand("clearmobs",{ + privs={maphack=true}, + description=S("Removes all spawned mobs"), + func=function() + for k,o in pairs(minetest.luaentities) do + if o.type == "ambient" or o.type == "animal" or o.type == "monster" or o.type == "npc" then o.object:remove() end + end +end}) + ----For Water Flowing: local enable_physics = function(object, luaentity, ignore_check) if luaentity.physical_state == false or ignore_check == true then From e5de4bba65e0607c727a920982f1d23d3d1ca766 Mon Sep 17 00:00:00 2001 From: cora Date: Sun, 17 Apr 2022 12:10:10 +0200 Subject: [PATCH 4/5] keep nametagged mobs, add "all" argument --- mods/ENTITIES/mcl_mobs/api.lua | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/mods/ENTITIES/mcl_mobs/api.lua b/mods/ENTITIES/mcl_mobs/api.lua index 914a919a1d..0429c5ea5b 100644 --- a/mods/ENTITIES/mcl_mobs/api.lua +++ b/mods/ENTITIES/mcl_mobs/api.lua @@ -104,10 +104,15 @@ local mod_experience = minetest.get_modpath("mcl_experience") ~= nil --Helper function to clear all mobs because /clearobjects removes too much minetest.register_chatcommand("clearmobs",{ privs={maphack=true}, - description=S("Removes all spawned mobs"), - func=function() + params = "", + description=S("Removes all spawned mobs except nametagged ones. Supply the optional all argument to remove all mobs"), + func=function(n,p) for k,o in pairs(minetest.luaentities) do - if o.type == "ambient" or o.type == "animal" or o.type == "monster" or o.type == "npc" then o.object:remove() end + if o.type == "ambient" or o.type == "animal" or o.type == "monster" or o.type == "npc" then + if p == "all" or not o.nametag then + o.object:remove() + end + end end end}) From 5282a63bcb52b1ab8b8936601f936217fac98e76 Mon Sep 17 00:00:00 2001 From: cora Date: Fri, 6 May 2022 21:33:27 +0200 Subject: [PATCH 5/5] add options for nametagged mobs and range --- mods/ENTITIES/mcl_mobs/api.lua | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/mods/ENTITIES/mcl_mobs/api.lua b/mods/ENTITIES/mcl_mobs/api.lua index 0429c5ea5b..a046a1205e 100644 --- a/mods/ENTITIES/mcl_mobs/api.lua +++ b/mods/ENTITIES/mcl_mobs/api.lua @@ -102,14 +102,22 @@ local mod_armor = minetest.get_modpath("mcl_armor") ~= nil local mod_experience = minetest.get_modpath("mcl_experience") ~= nil --Helper function to clear all mobs because /clearobjects removes too much +local function is_mob(o) + return o.type == "ambient" or o.type == "animal" or o.type == "monster" or o.type == "npc" +end minetest.register_chatcommand("clearmobs",{ privs={maphack=true}, - params = "", - description=S("Removes all spawned mobs except nametagged ones. Supply the optional all argument to remove all mobs"), - func=function(n,p) - for k,o in pairs(minetest.luaentities) do - if o.type == "ambient" or o.type == "animal" or o.type == "monster" or o.type == "npc" then - if p == "all" or not o.nametag then + params = "||", + description=S("Removes all spawned mobs except nametagged and tamed ones. all removes all mobs, nametagged only nametagged ones and with the range paramter all mobs in a distance of the current player are removed."), + func=function(n,param) + local p = minetest.get_player_by_name(n) + local num=tonumber(param) + for _,o in pairs(minetest.luaentities) do + if is_mob(o) then + if param == "all" or + ( param == "nametagged" and o.nametag ) or + ( param == "" and not o.nametag and not o.tamed ) or + ( num and num > 0 and vector.distance(p:get_pos(),o.object:get_pos()) <= num ) then o.object:remove() end end