summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mesecons/actionqueue.lua120
-rw-r--r--mesecons/init.lua86
-rw-r--r--mesecons/internal.lua233
-rw-r--r--mesecons/legacy.lua29
-rw-r--r--mesecons/services.lua11
-rw-r--r--mesecons/settings.lua2
-rw-r--r--mesecons/textures/jeija_fiber.png (renamed from mesecons_textures/textures/jeija_fiber.png)bin592 -> 592 bytes
-rw-r--r--mesecons/textures/jeija_glue.png (renamed from mesecons_textures/textures/jeija_glue.png)bin487 -> 487 bytes
-rw-r--r--mesecons/textures/jeija_mesecon_crossing_off.png (renamed from mesecons_textures/textures/jeija_mesecon_crossing_off.png)bin341 -> 341 bytes
-rw-r--r--mesecons/textures/jeija_mesecon_crossing_on.png (renamed from mesecons_textures/textures/jeija_mesecon_crossing_on.png)bin340 -> 340 bytes
-rw-r--r--mesecons/textures/jeija_mesecon_curved_off.png (renamed from mesecons_textures/textures/jeija_mesecon_curved_off.png)bin307 -> 307 bytes
-rw-r--r--mesecons/textures/jeija_mesecon_curved_on.png (renamed from mesecons_textures/textures/jeija_mesecon_curved_on.png)bin307 -> 307 bytes
-rw-r--r--mesecons/textures/jeija_mesecon_inverter_off.png (renamed from mesecons_textures/textures/jeija_mesecon_inverter_off.png)bin743 -> 743 bytes
-rw-r--r--mesecons/textures/jeija_mesecon_inverter_on.png (renamed from mesecons_textures/textures/jeija_mesecon_inverter_on.png)bin725 -> 725 bytes
-rw-r--r--mesecons/textures/jeija_mesecon_off.png (renamed from mesecons_textures/textures/jeija_mesecon_off.png)bin204 -> 204 bytes
-rw-r--r--mesecons/textures/jeija_mesecon_on.png (renamed from mesecons_textures/textures/jeija_mesecon_on.png)bin196 -> 196 bytes
-rw-r--r--mesecons/textures/jeija_mesecon_plug.png (renamed from mesecons_textures/textures/jeija_mesecon_plug.png)bin713 -> 713 bytes
-rw-r--r--mesecons/textures/jeija_mesecon_socket_off.png (renamed from mesecons_textures/textures/jeija_mesecon_socket_off.png)bin751 -> 751 bytes
-rw-r--r--mesecons/textures/jeija_mesecon_socket_on.png (renamed from mesecons_textures/textures/jeija_mesecon_socket_on.png)bin737 -> 737 bytes
-rw-r--r--mesecons/textures/jeija_mesecon_switch_off.png (renamed from mesecons_textures/textures/jeija_mesecon_switch_off.png)bin598 -> 598 bytes
-rw-r--r--mesecons/textures/jeija_mesecon_switch_on.png (renamed from mesecons_textures/textures/jeija_mesecon_switch_on.png)bin692 -> 692 bytes
-rw-r--r--mesecons/textures/jeija_mesecon_switch_side.png (renamed from mesecons_textures/textures/jeija_mesecon_switch_side.png)bin553 -> 553 bytes
-rw-r--r--mesecons/textures/jeija_mesecon_t_junction_off.png (renamed from mesecons_textures/textures/jeija_mesecon_t_junction_off.png)bin330 -> 330 bytes
-rw-r--r--mesecons/textures/jeija_mesecon_t_junction_on.png (renamed from mesecons_textures/textures/jeija_mesecon_t_junction_on.png)bin319 -> 319 bytes
-rw-r--r--mesecons/textures/jeija_silicon.png (renamed from mesecons_textures/textures/jeija_silicon.png)bin867 -> 867 bytes
-rw-r--r--mesecons/textures/wires_bump_off.png (renamed from mesecons_textures/textures/wires_bump_off.png)bin347 -> 347 bytes
-rw-r--r--mesecons/textures/wires_bump_on.png (renamed from mesecons_textures/textures/wires_bump_on.png)bin386 -> 386 bytes
-rw-r--r--mesecons/textures/wires_full_off.png (renamed from mesecons_textures/textures/wires_full_off.png)bin465 -> 465 bytes
-rw-r--r--mesecons/textures/wires_full_on.png (renamed from mesecons_textures/textures/wires_full_on.png)bin464 -> 464 bytes
-rw-r--r--mesecons/textures/wires_inv.png (renamed from mesecons_textures/textures/wires_inv.png)bin167 -> 167 bytes
-rw-r--r--mesecons/textures/wires_off.png (renamed from mesecons_textures/textures/wires_off.png)bin454 -> 454 bytes
-rw-r--r--mesecons/textures/wires_on.png (renamed from mesecons_textures/textures/wires_on.png)bin492 -> 492 bytes
-rw-r--r--mesecons/textures/wires_vertical_off.png (renamed from mesecons_textures/textures/wires_vertical_off.png)bin373 -> 373 bytes
-rw-r--r--mesecons/textures/wires_vertical_on.png (renamed from mesecons_textures/textures/wires_vertical_on.png)bin396 -> 396 bytes
-rw-r--r--mesecons/util.lua12
-rw-r--r--mesecons_blinkyplant/textures/jeija_blinky_plant_off.png (renamed from mesecons_textures/textures/jeija_blinky_plant_off.png)bin454 -> 454 bytes
-rw-r--r--mesecons_blinkyplant/textures/jeija_blinky_plant_on.png (renamed from mesecons_textures/textures/jeija_blinky_plant_on.png)bin463 -> 463 bytes
-rw-r--r--mesecons_button/textures/jeija_wall_button_off.png (renamed from mesecons_textures/textures/jeija_wall_button_off.png)bin411 -> 411 bytes
-rw-r--r--mesecons_button/textures/jeija_wall_button_on.png (renamed from mesecons_textures/textures/jeija_wall_button_on.png)bin449 -> 449 bytes
-rw-r--r--mesecons_button/textures/jeija_wall_button_sides.png (renamed from mesecons_textures/textures/jeija_wall_button_sides.png)bin434 -> 434 bytes
-rw-r--r--mesecons_commandblock/depends.txt1
-rw-r--r--mesecons_commandblock/init.lua211
-rw-r--r--mesecons_commandblock/textures/jeija_close_window.png (renamed from mesecons_textures/textures/jeija_close_window.png)bin323 -> 323 bytes
-rw-r--r--mesecons_commandblock/textures/jeija_commandblock_off.png (renamed from mesecons_textures/textures/jeija_commandblock_off.png)bin282 -> 282 bytes
-rw-r--r--mesecons_commandblock/textures/jeija_commandblock_on.png (renamed from mesecons_textures/textures/jeija_commandblock_on.png)bin278 -> 278 bytes
-rw-r--r--mesecons_delayer/init.lua14
-rw-r--r--mesecons_detector/init.lua3
-rw-r--r--mesecons_detector/textures/jeija_object_detector_off.png (renamed from mesecons_textures/textures/jeija_object_detector_off.png)bin712 -> 712 bytes
-rw-r--r--mesecons_detector/textures/jeija_object_detector_on.png (renamed from mesecons_textures/textures/jeija_object_detector_on.png)bin735 -> 735 bytes
-rw-r--r--mesecons_gates/init.lua3
-rw-r--r--mesecons_gates/textures/jeija_gate_and.png (renamed from mesecons_textures/textures/jeija_gate_and.png)bin233 -> 233 bytes
-rw-r--r--mesecons_gates/textures/jeija_gate_diode.png (renamed from mesecons_textures/textures/jeija_gate_diode.png)bin231 -> 231 bytes
-rw-r--r--mesecons_gates/textures/jeija_gate_nand.png (renamed from mesecons_textures/textures/jeija_gate_nand.png)bin251 -> 251 bytes
-rw-r--r--mesecons_gates/textures/jeija_gate_not.png (renamed from mesecons_textures/textures/jeija_gate_not.png)bin241 -> 241 bytes
-rw-r--r--mesecons_gates/textures/jeija_gate_off.png (renamed from mesecons_textures/textures/jeija_gate_off.png)bin195 -> 195 bytes
-rw-r--r--mesecons_gates/textures/jeija_gate_on.png (renamed from mesecons_textures/textures/jeija_gate_on.png)bin195 -> 195 bytes
-rw-r--r--mesecons_gates/textures/jeija_gate_xor.png (renamed from mesecons_textures/textures/jeija_gate_xor.png)bin245 -> 245 bytes
-rw-r--r--mesecons_hydroturbine/textures/jeija_hydro_turbine_off.png (renamed from mesecons_textures/textures/jeija_hydro_turbine_off.png)bin835 -> 835 bytes
-rw-r--r--mesecons_hydroturbine/textures/jeija_hydro_turbine_on.png (renamed from mesecons_textures/textures/jeija_hydro_turbine_on.png)bin817 -> 817 bytes
-rw-r--r--mesecons_insulated/textures/jeija_insulated_wire_crossing_tb_01.png (renamed from mesecons_textures/textures/jeija_insulated_wire_crossing_tb_01.png)bin305 -> 305 bytes
-rw-r--r--mesecons_insulated/textures/jeija_insulated_wire_crossing_tb_10.png (renamed from mesecons_textures/textures/jeija_insulated_wire_crossing_tb_10.png)bin270 -> 270 bytes
-rw-r--r--mesecons_insulated/textures/jeija_insulated_wire_crossing_tb_off.png (renamed from mesecons_textures/textures/jeija_insulated_wire_crossing_tb_off.png)bin293 -> 293 bytes
-rw-r--r--mesecons_insulated/textures/jeija_insulated_wire_crossing_tb_on.png (renamed from mesecons_textures/textures/jeija_insulated_wire_crossing_tb_on.png)bin209 -> 209 bytes
-rw-r--r--mesecons_insulated/textures/jeija_insulated_wire_curved_tb_off.png (renamed from mesecons_textures/textures/jeija_insulated_wire_curved_tb_off.png)bin253 -> 253 bytes
-rw-r--r--mesecons_insulated/textures/jeija_insulated_wire_curved_tb_on.png (renamed from mesecons_textures/textures/jeija_insulated_wire_curved_tb_on.png)bin196 -> 196 bytes
-rw-r--r--mesecons_insulated/textures/jeija_insulated_wire_ends_01x.png (renamed from mesecons_textures/textures/jeija_insulated_wire_ends_01x.png)bin246 -> 246 bytes
-rw-r--r--mesecons_insulated/textures/jeija_insulated_wire_ends_01z.png (renamed from mesecons_textures/textures/jeija_insulated_wire_ends_01z.png)bin252 -> 252 bytes
-rw-r--r--mesecons_insulated/textures/jeija_insulated_wire_ends_10x.png (renamed from mesecons_textures/textures/jeija_insulated_wire_ends_10x.png)bin238 -> 238 bytes
-rw-r--r--mesecons_insulated/textures/jeija_insulated_wire_ends_10z.png (renamed from mesecons_textures/textures/jeija_insulated_wire_ends_10z.png)bin261 -> 261 bytes
-rw-r--r--mesecons_insulated/textures/jeija_insulated_wire_ends_off.png (renamed from mesecons_textures/textures/jeija_insulated_wire_ends_off.png)bin142 -> 142 bytes
-rw-r--r--mesecons_insulated/textures/jeija_insulated_wire_ends_on.png (renamed from mesecons_textures/textures/jeija_insulated_wire_ends_on.png)bin126 -> 126 bytes
-rw-r--r--mesecons_insulated/textures/jeija_insulated_wire_sides_off.png (renamed from mesecons_textures/textures/jeija_insulated_wire_sides_off.png)bin200 -> 200 bytes
-rw-r--r--mesecons_insulated/textures/jeija_insulated_wire_sides_on.png (renamed from mesecons_textures/textures/jeija_insulated_wire_sides_on.png)bin169 -> 169 bytes
-rw-r--r--mesecons_insulated/textures/jeija_insulated_wire_tjunction_tb_off.png (renamed from mesecons_textures/textures/jeija_insulated_wire_tjunction_tb_off.png)bin244 -> 244 bytes
-rw-r--r--mesecons_insulated/textures/jeija_insulated_wire_tjunction_tb_on.png (renamed from mesecons_textures/textures/jeija_insulated_wire_tjunction_tb_on.png)bin207 -> 207 bytes
-rw-r--r--mesecons_lamp/textures/jeija_meselamp.png (renamed from mesecons_textures/textures/jeija_meselamp.png)bin260 -> 260 bytes
-rw-r--r--mesecons_lamp/textures/jeija_meselamp_off.png (renamed from mesecons_textures/textures/jeija_meselamp_off.png)bin253 -> 253 bytes
-rw-r--r--mesecons_lamp/textures/jeija_meselamp_on.png (renamed from mesecons_textures/textures/jeija_meselamp_on.png)bin307 -> 307 bytes
-rw-r--r--mesecons_lightstone/textures/jeija_lightstone_blue_off.png (renamed from mesecons_textures/textures/jeija_lightstone_blue_off.png)bin260 -> 260 bytes
-rw-r--r--mesecons_lightstone/textures/jeija_lightstone_blue_on.png (renamed from mesecons_textures/textures/jeija_lightstone_blue_on.png)bin545 -> 545 bytes
-rw-r--r--mesecons_lightstone/textures/jeija_lightstone_darkgray_off.png (renamed from mesecons_textures/textures/jeija_lightstone_darkgray_off.png)bin447 -> 447 bytes
-rw-r--r--mesecons_lightstone/textures/jeija_lightstone_darkgray_on.png (renamed from mesecons_textures/textures/jeija_lightstone_darkgray_on.png)bin667 -> 667 bytes
-rw-r--r--mesecons_lightstone/textures/jeija_lightstone_gray_off.png (renamed from mesecons_textures/textures/jeija_lightstone_gray_off.png)bin452 -> 452 bytes
-rw-r--r--mesecons_lightstone/textures/jeija_lightstone_gray_on.png (renamed from mesecons_textures/textures/jeija_lightstone_gray_on.png)bin662 -> 662 bytes
-rw-r--r--mesecons_lightstone/textures/jeija_lightstone_green_off.png (renamed from mesecons_textures/textures/jeija_lightstone_green_off.png)bin446 -> 446 bytes
-rw-r--r--mesecons_lightstone/textures/jeija_lightstone_green_on.png (renamed from mesecons_textures/textures/jeija_lightstone_green_on.png)bin705 -> 705 bytes
-rw-r--r--mesecons_lightstone/textures/jeija_lightstone_red_off.png (renamed from mesecons_textures/textures/jeija_lightstone_red_off.png)bin408 -> 408 bytes
-rw-r--r--mesecons_lightstone/textures/jeija_lightstone_red_on.png (renamed from mesecons_textures/textures/jeija_lightstone_red_on.png)bin650 -> 650 bytes
-rw-r--r--mesecons_lightstone/textures/jeija_lightstone_yellow_off.png (renamed from mesecons_textures/textures/jeija_lightstone_yellow_off.png)bin291 -> 291 bytes
-rw-r--r--mesecons_lightstone/textures/jeija_lightstone_yellow_on.png (renamed from mesecons_textures/textures/jeija_lightstone_yellow_on.png)bin486 -> 486 bytes
-rw-r--r--mesecons_luacontroller/init.lua131
-rw-r--r--mesecons_luacontroller/textures/jeija_luac_background.png (renamed from mesecons_textures/textures/jeija_luac_background.png)bin2016 -> 2016 bytes
-rw-r--r--mesecons_luacontroller/textures/jeija_luac_runbutton.png (renamed from mesecons_textures/textures/jeija_luac_runbutton.png)bin4262 -> 4262 bytes
-rw-r--r--mesecons_luacontroller/textures/jeija_luacontroller_LED_A.png (renamed from mesecons_textures/textures/jeija_luacontroller_LED_A.png)bin3541 -> 3541 bytes
-rw-r--r--mesecons_luacontroller/textures/jeija_luacontroller_LED_B.png (renamed from mesecons_textures/textures/jeija_luacontroller_LED_B.png)bin3537 -> 3537 bytes
-rw-r--r--mesecons_luacontroller/textures/jeija_luacontroller_LED_C.png (renamed from mesecons_textures/textures/jeija_luacontroller_LED_C.png)bin3537 -> 3537 bytes
-rw-r--r--mesecons_luacontroller/textures/jeija_luacontroller_LED_D.png (renamed from mesecons_textures/textures/jeija_luacontroller_LED_D.png)bin3537 -> 3537 bytes
-rw-r--r--mesecons_luacontroller/textures/jeija_luacontroller_burnt_top.png (renamed from mesecons_textures/textures/jeija_luacontroller_burnt_top.png)bin8706 -> 8706 bytes
-rw-r--r--mesecons_luacontroller/textures/jeija_luacontroller_top.png (renamed from mesecons_textures/textures/jeija_luacontroller_top.png)bin11913 -> 11913 bytes
-rw-r--r--mesecons_microcontroller/init.lua61
-rw-r--r--mesecons_microcontroller/textures/jeija_microcontroller_LED_A.png (renamed from mesecons_textures/textures/jeija_microcontroller_LED_A.png)bin1240 -> 1240 bytes
-rw-r--r--mesecons_microcontroller/textures/jeija_microcontroller_LED_B.png (renamed from mesecons_textures/textures/jeija_microcontroller_LED_B.png)bin1239 -> 1239 bytes
-rw-r--r--mesecons_microcontroller/textures/jeija_microcontroller_LED_C.png (renamed from mesecons_textures/textures/jeija_microcontroller_LED_C.png)bin1240 -> 1240 bytes
-rw-r--r--mesecons_microcontroller/textures/jeija_microcontroller_LED_D.png (renamed from mesecons_textures/textures/jeija_microcontroller_LED_D.png)bin1239 -> 1239 bytes
-rw-r--r--mesecons_microcontroller/textures/jeija_microcontroller_bottom.png (renamed from mesecons_textures/textures/jeija_microcontroller_bottom.png)bin550 -> 550 bytes
-rw-r--r--mesecons_microcontroller/textures/jeija_microcontroller_sides.png (renamed from mesecons_textures/textures/jeija_microcontroller_sides.png)bin613 -> 613 bytes
-rw-r--r--mesecons_microcontroller/textures/jeija_microcontroller_top.png (renamed from mesecons_textures/textures/jeija_microcontroller_top.png)bin1151 -> 1151 bytes
-rw-r--r--mesecons_movestones/textures/jeija_movestone_arrows.png (renamed from mesecons_textures/textures/jeija_movestone_arrows.png)bin344 -> 344 bytes
-rw-r--r--mesecons_movestones/textures/jeija_movestone_side.png (renamed from mesecons_textures/textures/jeija_movestone_side.png)bin466 -> 466 bytes
-rw-r--r--mesecons_movestones/textures/jeija_sticky_movestone.png (renamed from mesecons_textures/textures/jeija_sticky_movestone.png)bin742 -> 742 bytes
-rw-r--r--mesecons_pistons/textures/mesecons_piston_back.png (renamed from mesecons_textures/textures/mesecons_piston_back.png)bin763 -> 763 bytes
-rw-r--r--mesecons_pistons/textures/mesecons_piston_bottom.png (renamed from mesecons_textures/textures/mesecons_piston_bottom.png)bin791 -> 791 bytes
-rw-r--r--mesecons_pistons/textures/mesecons_piston_left.png (renamed from mesecons_textures/textures/mesecons_piston_left.png)bin790 -> 790 bytes
-rw-r--r--mesecons_pistons/textures/mesecons_piston_on_front.png (renamed from mesecons_textures/textures/mesecons_piston_on_front.png)bin759 -> 759 bytes
-rw-r--r--mesecons_pistons/textures/mesecons_piston_pusher_back.png (renamed from mesecons_textures/textures/mesecons_piston_pusher_back.png)bin781 -> 781 bytes
-rw-r--r--mesecons_pistons/textures/mesecons_piston_pusher_bottom.png (renamed from mesecons_textures/textures/mesecons_piston_pusher_bottom.png)bin762 -> 762 bytes
-rw-r--r--mesecons_pistons/textures/mesecons_piston_pusher_front.png (renamed from mesecons_textures/textures/mesecons_piston_pusher_front.png)bin759 -> 759 bytes
-rw-r--r--mesecons_pistons/textures/mesecons_piston_pusher_front_sticky.png (renamed from mesecons_textures/textures/mesecons_piston_pusher_front_sticky.png)bin738 -> 738 bytes
-rw-r--r--mesecons_pistons/textures/mesecons_piston_pusher_left.png (renamed from mesecons_textures/textures/mesecons_piston_pusher_left.png)bin790 -> 790 bytes
-rw-r--r--mesecons_pistons/textures/mesecons_piston_pusher_right.png (renamed from mesecons_textures/textures/mesecons_piston_pusher_right.png)bin802 -> 802 bytes
-rw-r--r--mesecons_pistons/textures/mesecons_piston_pusher_top.png (renamed from mesecons_textures/textures/mesecons_piston_pusher_top.png)bin787 -> 787 bytes
-rw-r--r--mesecons_pistons/textures/mesecons_piston_right.png (renamed from mesecons_textures/textures/mesecons_piston_right.png)bin786 -> 786 bytes
-rw-r--r--mesecons_pistons/textures/mesecons_piston_top.png (renamed from mesecons_textures/textures/mesecons_piston_top.png)bin790 -> 790 bytes
-rw-r--r--mesecons_powerplant/textures/jeija_power_plant.png (renamed from mesecons_textures/textures/jeija_power_plant.png)bin437 -> 437 bytes
-rw-r--r--mesecons_pressureplates/textures/jeija_pressure_plate_stone_inv.png (renamed from mesecons_textures/textures/jeija_pressure_plate_stone_inv.png)bin604 -> 604 bytes
-rw-r--r--mesecons_pressureplates/textures/jeija_pressure_plate_stone_off.png (renamed from mesecons_textures/textures/jeija_pressure_plate_stone_off.png)bin555 -> 555 bytes
-rw-r--r--mesecons_pressureplates/textures/jeija_pressure_plate_stone_off_edges.png (renamed from mesecons_textures/textures/jeija_pressure_plate_stone_off_edges.png)bin292 -> 292 bytes
-rw-r--r--mesecons_pressureplates/textures/jeija_pressure_plate_stone_on.png (renamed from mesecons_textures/textures/jeija_pressure_plate_stone_on.png)bin579 -> 579 bytes
-rw-r--r--mesecons_pressureplates/textures/jeija_pressure_plate_stone_on_edges.png (renamed from mesecons_textures/textures/jeija_pressure_plate_stone_on_edges.png)bin336 -> 336 bytes
-rw-r--r--mesecons_pressureplates/textures/jeija_pressure_plate_stone_wield.png (renamed from mesecons_textures/textures/jeija_pressure_plate_stone_wield.png)bin604 -> 604 bytes
-rw-r--r--mesecons_pressureplates/textures/jeija_pressure_plate_wood_inv.png (renamed from mesecons_textures/textures/jeija_pressure_plate_wood_inv.png)bin716 -> 716 bytes
-rw-r--r--mesecons_pressureplates/textures/jeija_pressure_plate_wood_off.png (renamed from mesecons_textures/textures/jeija_pressure_plate_wood_off.png)bin663 -> 663 bytes
-rw-r--r--mesecons_pressureplates/textures/jeija_pressure_plate_wood_off_edges.png (renamed from mesecons_textures/textures/jeija_pressure_plate_wood_off_edges.png)bin295 -> 295 bytes
-rw-r--r--mesecons_pressureplates/textures/jeija_pressure_plate_wood_on.png (renamed from mesecons_textures/textures/jeija_pressure_plate_wood_on.png)bin675 -> 675 bytes
-rw-r--r--mesecons_pressureplates/textures/jeija_pressure_plate_wood_on_edges.png (renamed from mesecons_textures/textures/jeija_pressure_plate_wood_on_edges.png)bin336 -> 336 bytes
-rw-r--r--mesecons_pressureplates/textures/jeija_pressure_plate_wood_wield.png (renamed from mesecons_textures/textures/jeija_pressure_plate_wood_wield.png)bin716 -> 716 bytes
-rw-r--r--mesecons_random/textures/jeija_ghoststone.png (renamed from mesecons_textures/textures/jeija_ghoststone.png)bin743 -> 743 bytes
-rw-r--r--mesecons_random/textures/jeija_ghoststone_inv.png (renamed from mesecons_textures/textures/jeija_ghoststone_inv.png)bin777 -> 777 bytes
-rw-r--r--mesecons_random/textures/jeija_removestone.png (renamed from mesecons_textures/textures/jeija_removestone.png)bin743 -> 743 bytes
-rw-r--r--mesecons_random/textures/jeija_removestone_inv.png (renamed from mesecons_textures/textures/jeija_removestone_inv.png)bin777 -> 777 bytes
-rw-r--r--mesecons_receiver/textures/receiver_bottom_off.png (renamed from mesecons_textures/textures/receiver_bottom_off.png)bin494 -> 494 bytes
-rw-r--r--mesecons_receiver/textures/receiver_bottom_on.png (renamed from mesecons_textures/textures/receiver_bottom_on.png)bin239 -> 239 bytes
-rw-r--r--mesecons_receiver/textures/receiver_fb_off.png (renamed from mesecons_textures/textures/receiver_fb_off.png)bin494 -> 494 bytes
-rw-r--r--mesecons_receiver/textures/receiver_fb_on.png (renamed from mesecons_textures/textures/receiver_fb_on.png)bin239 -> 239 bytes
-rw-r--r--mesecons_receiver/textures/receiver_lr_off.png (renamed from mesecons_textures/textures/receiver_lr_off.png)bin494 -> 494 bytes
-rw-r--r--mesecons_receiver/textures/receiver_lr_on.png (renamed from mesecons_textures/textures/receiver_lr_on.png)bin239 -> 239 bytes
-rw-r--r--mesecons_receiver/textures/receiver_top_off.png (renamed from mesecons_textures/textures/receiver_top_off.png)bin494 -> 494 bytes
-rw-r--r--mesecons_receiver/textures/receiver_top_on.png (renamed from mesecons_textures/textures/receiver_top_on.png)bin239 -> 239 bytes
-rw-r--r--mesecons_solarpanel/textures/jeija_solar_panel.png (renamed from mesecons_textures/textures/jeija_solar_panel.png)bin652 -> 652 bytes
-rw-r--r--mesecons_textures/init.lua1
-rw-r--r--mesecons_textures/textures/jeija_battery_charging.pngbin497 -> 0 bytes
-rw-r--r--mesecons_textures/textures/jeija_battery_discharging.pngbin418 -> 0 bytes
-rw-r--r--mesecons_torch/textures/jeija_torches_off.png (renamed from mesecons_textures/textures/jeija_torches_off.png)bin219 -> 219 bytes
-rw-r--r--mesecons_torch/textures/jeija_torches_off_ceiling.png (renamed from mesecons_textures/textures/jeija_torches_off_ceiling.png)bin220 -> 220 bytes
-rw-r--r--mesecons_torch/textures/jeija_torches_off_side.png (renamed from mesecons_textures/textures/jeija_torches_off_side.png)bin206 -> 206 bytes
-rw-r--r--mesecons_torch/textures/jeija_torches_on.png (renamed from mesecons_textures/textures/jeija_torches_on.png)bin210 -> 210 bytes
-rw-r--r--mesecons_torch/textures/jeija_torches_on_ceiling.png (renamed from mesecons_textures/textures/jeija_torches_on_ceiling.png)bin220 -> 220 bytes
-rw-r--r--mesecons_torch/textures/jeija_torches_on_side.png (renamed from mesecons_textures/textures/jeija_torches_on_side.png)bin197 -> 197 bytes
-rw-r--r--mesecons_walllever/textures/jeija_wall_lever_back.png (renamed from mesecons_textures/textures/jeija_wall_lever_back.png)bin614 -> 614 bytes
-rw-r--r--mesecons_walllever/textures/jeija_wall_lever_bottom.png (renamed from mesecons_textures/textures/jeija_wall_lever_bottom.png)bin582 -> 582 bytes
-rw-r--r--mesecons_walllever/textures/jeija_wall_lever_off.png (renamed from mesecons_textures/textures/jeija_wall_lever_off.png)bin500 -> 500 bytes
-rw-r--r--mesecons_walllever/textures/jeija_wall_lever_on.png (renamed from mesecons_textures/textures/jeija_wall_lever_on.png)bin517 -> 517 bytes
-rw-r--r--mesecons_walllever/textures/jeija_wall_lever_sides.png (renamed from mesecons_textures/textures/jeija_wall_lever_sides.png)bin612 -> 612 bytes
-rw-r--r--mesecons_walllever/textures/jeija_wall_lever_tb.png (renamed from mesecons_textures/textures/jeija_wall_lever_tb.png)bin575 -> 575 bytes
-rw-r--r--mesecons_walllever/textures/jeija_wall_lever_top.png (renamed from mesecons_textures/textures/jeija_wall_lever_top.png)bin587 -> 587 bytes
165 files changed, 431 insertions, 487 deletions
diff --git a/mesecons/actionqueue.lua b/mesecons/actionqueue.lua
new file mode 100644
index 0000000..f9d197a
--- /dev/null
+++ b/mesecons/actionqueue.lua
@@ -0,0 +1,120 @@
+mesecon.queue.actions={} -- contains all ActionQueue actions
+
+function mesecon.queue:add_function(name, func)
+ mesecon.queue.funcs[name] = func
+end
+
+-- If add_action with twice the same overwritecheck and same position are called, the first one is overwritten
+-- use overwritecheck nil to never overwrite, but just add the event to the queue
+-- priority specifies the order actions are executed within one globalstep, highest first
+-- should be between 0 and 1
+function mesecon.queue:add_action(pos, func, params, time, overwritecheck, priority)
+ -- Create Action Table:
+ time = time or 0 -- time <= 0 --> execute, time > 0 --> wait time until execution
+ priority = priority or 1
+ local action = { pos=mesecon:tablecopy(pos),
+ func=func,
+ params=mesecon:tablecopy(params),
+ time=time,
+ owcheck=(overwritecheck and mesecon:tablecopy(overwritecheck)) or nil,
+ priority=priority}
+
+ -- if not using the queue, (MESECONS_GLOBALSTEP off), just execute the function an we're done
+ if not MESECONS_GLOBALSTEP and action.time == 0 then
+ mesecon.queue:execute(action)
+ return
+ end
+
+ local toremove = nil
+ -- Otherwise, add the action to the queue
+ if overwritecheck then -- check if old action has to be overwritten / removed:
+ for i, ac in ipairs(mesecon.queue.actions) do
+ if(mesecon:cmpPos(pos, ac.pos)
+ and mesecon:cmpAny(overwritecheck, ac.owcheck)) then
+ toremove = i
+ break
+ end
+ end
+ end
+
+ if (toremove ~= nil) then
+ table.remove(mesecon.queue.actions, toremove)
+ end
+
+ table.insert(mesecon.queue.actions, action)
+end
+
+-- execute the stored functions on a globalstep
+-- if however, the pos of a function is not loaded (get_node_or_nil == nil), do NOT execute the function
+-- this makes sure that resuming mesecons circuits when restarting minetest works fine
+-- However, even that does not work in some cases, that's why we delay the time the globalsteps
+-- start to be execute by 5 seconds
+local get_highest_priority = function (actions)
+ local highestp = -1, highesti
+ for i, ac in ipairs(actions) do
+ if ac.priority > highestp then
+ highestp = ac.priority
+ highesti = i
+ end
+ end
+
+ return highesti
+end
+
+local m_time = 0
+minetest.register_globalstep(function (dtime)
+ m_time = m_time + dtime
+ if (m_time < MESECONS_RESUMETIME) then return end -- don't even try if server has not been running for XY seconds
+ local actions = mesecon:tablecopy(mesecon.queue.actions)
+ local actions_now={}
+
+ mesecon.queue.actions = {}
+
+ -- sort actions into two categories:
+ -- those toexecute now (actions_now) and those to execute later (mesecon.queue.actions)
+ for i, ac in ipairs(actions) do
+ if ac.time > 0 then
+ ac.time = ac.time - dtime -- executed later
+ table.insert(mesecon.queue.actions, ac)
+ else
+ table.insert(actions_now, ac)
+ end
+ end
+
+ while(#actions_now > 0) do -- execute highest priorities first, until all are executed
+ local hp = get_highest_priority(actions_now)
+ mesecon.queue:execute(actions_now[hp])
+ table.remove(actions_now, hp)
+ end
+end)
+
+function mesecon.queue:execute(action)
+ mesecon.queue.funcs[action.func](action.pos, unpack(action.params))
+end
+
+
+-- Store and read the ActionQueue to / from a file
+-- so that upcoming actions are remembered when the game
+-- is restarted
+
+local wpath = minetest.get_worldpath()
+local function file2table(filename)
+ local f = io.open(filename, "r")
+ if f==nil then return {} end
+ local t = f:read("*all")
+ f:close()
+ if t=="" or t==nil then return {} end
+ return minetest.deserialize(t)
+end
+
+local function table2file(filename, table)
+ local f = io.open(filename, "w")
+ f:write(minetest.serialize(table))
+ f:close()
+end
+
+mesecon.queue.actions = file2table(wpath.."/mesecon_actionqueue")
+
+minetest.register_on_shutdown(function()
+ mesecon.queue.actions = table2file(wpath.."/mesecon_actionqueue", mesecon.queue.actions)
+end)
diff --git a/mesecons/init.lua b/mesecons/init.lua
index 640af4d..b5cf68b 100644
--- a/mesecons/init.lua
+++ b/mesecons/init.lua
@@ -42,37 +42,8 @@
-- PUBLIC VARIABLES
mesecon={} -- contains all functions and all global variables
-mesecon.actions_on={} -- Saves registered function callbacks for mesecon on | DEPRECATED
-mesecon.actions_off={} -- Saves registered function callbacks for mesecon off | DEPRECATED
-mesecon.actions_change={} -- Saves registered function callbacks for mesecon change | DEPRECATED
-mesecon.receptors={} -- saves all information about receptors | DEPRECATED
-mesecon.effectors={} -- saves all information about effectors | DEPRECATED
-mesecon.conductors={} -- saves all information about conductors | DEPRECATED
-
-
-local wpath = minetest.get_worldpath()
-local function read_file(fn)
- local f = io.open(fn, "r")
- if f==nil then return {} end
- local t = f:read("*all")
- f:close()
- if t=="" or t==nil then return {} end
- return minetest.deserialize(t)
-end
-
-local function write_file(fn, tbl)
- local f = io.open(fn, "w")
- f:write(minetest.serialize(tbl))
- f:close()
-end
-
-mesecon.to_update = read_file(wpath.."/mesecon_to_update")
-mesecon.r_to_update = read_file(wpath.."/mesecon_r_to_update")
-
-minetest.register_on_shutdown(function()
- write_file(wpath.."/mesecon_to_update",mesecon.to_update)
- write_file(wpath.."/mesecon_r_to_update",mesecon.r_to_update)
-end)
+mesecon.queue={} -- contains the ActionQueue
+mesecon.queue.funcs={} -- contains all ActionQueue functions
-- Settings
dofile(minetest.get_modpath("mesecons").."/settings.lua")
@@ -86,6 +57,10 @@ dofile(minetest.get_modpath("mesecons").."/presets.lua");
-- mostly things that make the source look cleaner
dofile(minetest.get_modpath("mesecons").."/util.lua");
+-- The ActionQueue
+-- Saves all the actions that have to be execute in the future
+dofile(minetest.get_modpath("mesecons").."/actionqueue.lua");
+
-- Internal stuff
-- This is the most important file
-- it handles signal transmission and basically everything else
@@ -101,9 +76,22 @@ dofile(minetest.get_modpath("mesecons").."/legacy.lua");
-- API
-- these are the only functions you need to remember
-function mesecon:receptor_on_i(pos, rules)
+mesecon.queue:add_function("receptor_on", function (pos, rules)
rules = rules or mesecon.rules.default
+ -- if area (any of the rule targets) is not loaded, keep trying and call this again later
+ if MESECONS_GLOBALSTEP then -- trying to enable resuming with globalstep disabled would cause an endless loop
+ for _, rule in ipairs(mesecon:flattenrules(rules)) do
+ local np = mesecon:addPosRule(pos, rule)
+ -- if area is not loaded, keep trying
+ if minetest.get_node_or_nil(np) == nil then
+ mesecon.queue:add_action(pos, "receptor_on", {rules}, nil, rules)
+ return
+ end
+ end
+ end
+
+ -- execute action
for _, rule in ipairs(mesecon:flattenrules(rules)) do
local np = mesecon:addPosRule(pos, rule)
local rulenames = mesecon:rules_link_rule_all(pos, rule)
@@ -111,19 +99,26 @@ function mesecon:receptor_on_i(pos, rules)
mesecon:turnon(np, rulename)
end
end
-end
+end)
function mesecon:receptor_on(pos, rules)
- if MESECONS_GLOBALSTEP then
- rules = rules or mesecon.rules.default
- mesecon.r_to_update[#mesecon.r_to_update+1]={pos=pos, rules=rules, action="on"}
- else
- mesecon:receptor_on_i(pos, rules)
- end
+ mesecon.queue:add_action(pos, "receptor_on", {rules}, nil, rules)
end
-function mesecon:receptor_off_i(pos, rules)
+mesecon.queue:add_function("receptor_off", function (pos, rules)
rules = rules or mesecon.rules.default
+
+ -- if area (any of the rule targets) is not loaded, keep trying and call this again later
+ if MESECONS_GLOBALSTEP then
+ for _, rule in ipairs(mesecon:flattenrules(rules)) do
+ local np = mesecon:addPosRule(pos, rule)
+ if minetest.get_node_or_nil(np) == nil then
+ mesecon.queue:add_action(pos, "receptor_off", {rules}, nil, rules)
+ return
+ end
+ end
+ end
+
for _, rule in ipairs(mesecon:flattenrules(rules)) do
local np = mesecon:addPosRule(pos, rule)
local rulenames = mesecon:rules_link_rule_all(pos, rule)
@@ -131,19 +126,14 @@ function mesecon:receptor_off_i(pos, rules)
if not mesecon:connected_to_receptor(np, mesecon:invertRule(rule)) then
mesecon:turnoff(np, rulename)
else
- mesecon:changesignal(np, minetest.get_node(np), rulename, mesecon.state.off)
+ mesecon:changesignal(np, minetest.get_node(np), rulename, mesecon.state.off, 2)
end
end
end
-end
+end)
function mesecon:receptor_off(pos, rules)
- if MESECONS_GLOBALSTEP then
- rules = rules or mesecon.rules.default
- mesecon.r_to_update[#mesecon.r_to_update+1]={pos=pos, rules=rules, action="off"}
- else
- mesecon:receptor_off_i(pos, rules)
- end
+ mesecon.queue:add_action(pos, "receptor_off", {rules}, nil, rules)
end
diff --git a/mesecons/internal.lua b/mesecons/internal.lua
index a958e30..06fbdff 100644
--- a/mesecons/internal.lua
+++ b/mesecons/internal.lua
@@ -22,9 +22,9 @@
-- mesecon:effector_get_rules(node) --> Returns the input rules of the effector (mesecon.rules.default if none specified)
-- SIGNALS
--- mesecon:activate(pos, node) --> Activates the effector node at the specific pos (calls nodedef.mesecons.effector.action_on)
--- mesecon:deactivate(pos, node) --> Deactivates the effector node at the specific pos (calls nodedef.mesecons.effector.action_off)
--- mesecon:changesignal(pos, node, rulename, newstate) --> Changes the effector node at the specific pos (calls nodedef.mesecons.effector.action_change)
+-- mesecon:activate(pos, node, recdepth) --> Activates the effector node at the specific pos (calls nodedef.mesecons.effector.action_on), higher recdepths are executed later
+-- mesecon:deactivate(pos, node, recdepth) --> Deactivates the effector node at the specific pos (calls nodedef.mesecons.effector.action_off), "
+-- mesecon:changesignal(pos, node, rulename, newstate) --> Changes the effector node at the specific pos (calls nodedef.mesecons.effector.action_change), "
-- RULES
-- mesecon:add_rules(name, rules) | deprecated? --> Saves rules table by name
@@ -41,8 +41,8 @@
-- HIGH-LEVEL Internals
-- mesecon:is_power_on(pos) --> Returns true if pos emits power in any way
-- mesecon:is_power_off(pos) --> Returns true if pos does not emit power in any way
--- mesecon:turnon(pos, rulename) --> Returns true whatever there is at pos. Calls itself for connected nodes (if pos is a conductor) --> recursive, the rulename is the name of the input rule that caused calling turnon
--- mesecon:turnoff(pos, rulename) --> Turns off whatever there is at pos. Calls itself for connected nodes (if pos is a conductor) --> recursive, the rulename is the name of the input rule that caused calling turnoff
+-- mesecon:turnon(pos, rulename) --> Returns true whatever there is at pos. Calls itself for connected nodes (if pos is a conductor) --> recursive, the rulename is the name of the input rule that caused calling turnon; Uses third parameter recdepth internally to determine how far away the current node is from the initial pos as it uses recursion
+-- mesecon:turnoff(pos, rulename) --> Turns off whatever there is at pos. Calls itself for connected nodes (if pos is a conductor) --> recursive, the rulename is the name of the input rule that caused calling turnoff; Uses third parameter recdepth internally to determine how far away the current node is from the initial pos as it uses recursion
-- mesecon:connected_to_receptor(pos) --> Returns true if pos is connected to a receptor directly or via conductors; calls itself if pos is a conductor --> recursive
-- mesecon:rules_link(output, input, dug_outputrules) --> Returns true if outputposition + outputrules = inputposition and inputposition + inputrules = outputposition (if the two positions connect)
-- mesecon:rules_link_anydir(outp., inp., d_outpr.) --> Same as rules mesecon:rules_link but also returns true if output and input are swapped
@@ -177,121 +177,76 @@ function mesecon:effector_get_rules(node)
return mesecon.rules.default
end
---Signals
+-- #######################
+-- # Signals (effectors) #
+-- #######################
-function mesecon:activate(pos, node, rulename)
- if MESECONS_GLOBALSTEP then
- if rulename == nil then
- for _,rule in ipairs(mesecon:effector_get_rules(node)) do
- mesecon:activate(pos, node, rule)
- end
- return
- end
- add_action(pos, "on", rulename)
- else
- local effector = mesecon:get_effector(node.name)
- if effector and effector.action_on then
- effector.action_on (pos, node, rulename)
- end
- end
-end
+-- Activation:
+mesecon.queue:add_function("activate", function (pos, rulename)
+ node = minetest.get_node(pos)
+ effector = mesecon:get_effector(node.name)
-function mesecon:deactivate(pos, node, rulename)
- if MESECONS_GLOBALSTEP then
- if rulename == nil then
- for _,rule in ipairs(mesecon:effector_get_rules(node)) do
- mesecon:deactivate(pos, node, rule)
- end
- return
- end
- add_action(pos, "off", rulename)
- else
- local effector = mesecon:get_effector(node.name)
- if effector and effector.action_off then
- effector.action_off (pos, node, rulename)
- end
+ if effector and effector.action_on then
+ effector.action_on(pos, node, rulename)
end
-end
+end)
-function mesecon:changesignal(pos, node, rulename, newstate)
-
- newstate = newstate or "on"
- --rulename = rulename or mesecon.rules.default
- if MESECONS_GLOBALSTEP then
- if rulename == nil then
- for _,rule in ipairs(mesecon:effector_get_rules(node)) do
- mesecon:changesignal(pos, node, rule, newstate)
- end
- return
- end
- add_action(pos, "c"..newstate, rulename)
- else
- local effector = mesecon:get_effector(node.name)
- if effector and effector.action_change then
- effector.action_change (pos, node, rulename, newstate)
+function mesecon:activate(pos, node, rulename, recdepth)
+ if rulename == nil then
+ for _,rule in ipairs(mesecon:effector_get_rules(node)) do
+ mesecon:activate(pos, node, rule, recdepth + 1)
end
+ return
end
+ mesecon.queue:add_action(pos, "activate", {rulename}, nil, rulename, 1 / recdepth)
end
-function execute_actions(dtime)
- local nactions = mesecon.to_update
- mesecon.to_update = {}
- for _,i in ipairs(nactions) do
- node = minetest.get_node(i.pos)
- if node.name=="ignore" then
- add_action(i.pos, i.action, i.rname)
- else
- effector = mesecon:get_effector(node.name)
- if i.action == "on" then
- if effector and effector.action_on then
- effector.action_on(i.pos, node, i.rname)
- end
- elseif i.action == "off" then
- if effector and effector.action_off then
- effector.action_off(i.pos, node, i.rname)
- end
- elseif i.action == "con" then
- if effector and effector.action_change then
- effector.action_change(i.pos, node, i.rname, "on")
- end
- elseif i.action == "coff" then
- if effector and effector.action_change then
- effector.action_change(i.pos, node, i.rname, "off")
- end
- end
- end
+
+-- Deactivation
+mesecon.queue:add_function("deactivate", function (pos, rulename)
+ node = minetest.get_node(pos)
+ effector = mesecon:get_effector(node.name)
+
+ if effector and effector.action_off then
+ effector.action_off(pos, node, rulename)
end
- local nactions = mesecon.r_to_update
- mesecon.r_to_update = {}
- for _,i in ipairs(nactions) do
- if i.action == "on" then
- mesecon:receptor_on_i(i.pos, i.rules)
- else
- mesecon:receptor_off_i(i.pos,i.rules)
+end)
+
+function mesecon:deactivate(pos, node, rulename, recdepth)
+ if rulename == nil then
+ for _,rule in ipairs(mesecon:effector_get_rules(node)) do
+ mesecon:deactivate(pos, node, rule, recdepth + 1)
end
+ return
end
+ mesecon.queue:add_action(pos, "deactivate", {rulename}, nil, rulename, 1 / recdepth)
end
-minetest.register_globalstep(execute_actions)
-function add_action(pos, action, rname)
- for _,i in ipairs(mesecon.to_update) do
- if i.pos.x == pos.x and i.pos.y == pos.y and i.pos.z == pos.z and i.rname.x == rname.x and i.rname.y == rname.y and i.rname.z == rname.z then
- if (i.action == "on" and action == "on") or (i.action == "off" and action == "off") then
- --nothing
- elseif i.action == "coff" and action == "on" then i.action = "on"
- elseif i.action == "con" and action == "off" then i.action = "off"
- else
- if action == "on" or action == "con" then i.action = "con" end
- if action == "off" or action == "coff" then i.action = "coff" end
- end
- break
+-- Change
+mesecon.queue:add_function("change", function (pos, rulename, changetype)
+ node = minetest.get_node(pos)
+ effector = mesecon:get_effector(node.name)
+
+ if effector and effector.action_change then
+ effector.action_change(pos, node, rulename, changetype)
+ end
+end)
+
+function mesecon:changesignal(pos, node, rulename, newstate, recdepth)
+ if rulename == nil then
+ for _,rule in ipairs(mesecon:effector_get_rules(node)) do
+ mesecon:changesignal(pos, node, rule, newstate, recdepth + 1)
end
+ return
end
- mesecon.to_update[#mesecon.to_update+1] = {pos = pos, action = action, rname = rname}
+
+ mesecon.queue:add_action(pos, "change", {rulename, newstate}, nil, rulename, 1 / recdepth)
end
---Rules
+-- #########
+-- # Rules # "Database" for rulenames
+-- #########
function mesecon:add_rules(name, rules)
mesecon.rules[name] = rules
@@ -410,8 +365,15 @@ function mesecon:is_power_off(pos, rulename)
return false
end
-function mesecon:turnon(pos, rulename)
+function mesecon:turnon(pos, rulename, recdepth)
+ recdepth = recdepth or 2
local node = minetest.get_node(pos)
+
+ if(node.name == "ignore") then
+ -- try turning on later again
+ mesecon.queue:add_action(
+ pos, "turnon", {rulename, recdepth + 1}, nil, true)
+ end
if mesecon:is_conductor_off(node, rulename) then
local rules = mesecon:conductor_get_rules(node)
@@ -419,7 +381,7 @@ function mesecon:turnon(pos, rulename)
if not rulename then
for _, rule in ipairs(mesecon:flattenrules(rules)) do
if mesecon:connected_to_receptor(pos, rule) then
- mesecon:turnon(pos, rule)
+ mesecon:turnon(pos, rule, recdepth + 1)
end
end
return
@@ -429,54 +391,75 @@ function mesecon:turnon(pos, rulename)
for _, rule in ipairs(mesecon:rule2meta(rulename, rules)) do
local np = mesecon:addPosRule(pos, rule)
- local rulenames = mesecon:rules_link_rule_all(pos, rule)
+ if(minetest.get_node(np).name == "ignore") then
+ -- try turning on later again
+ mesecon.queue:add_action(
+ np, "turnon", {rulename, recdepth + 1}, nil, true)
+ else
+ local rulenames = mesecon:rules_link_rule_all(pos, rule)
- for _, rulename in ipairs(rulenames) do
- mesecon:turnon(np, rulename)
+ for _, rulename in ipairs(rulenames) do
+ mesecon:turnon(np, rulename, recdepth + 1)
+ end
end
end
elseif mesecon:is_effector(node.name) then
- mesecon:changesignal(pos, node, rulename, mesecon.state.on)
+ mesecon:changesignal(pos, node, rulename, mesecon.state.on, recdepth)
if mesecon:is_effector_off(node.name) then
- mesecon:activate(pos, node, rulename)
+ mesecon:activate(pos, node, rulename, recdepth)
end
end
end
-function mesecon:turnoff(pos, rulename)
+mesecon.queue:add_function("turnon", function (pos, rulename, recdepth)
+ if (MESECONS_GLOBALSTEP) then -- do not resume if we don't use globalstep - that would cause an endless loop
+ mesecon:turnon(pos, rulename, recdepth)
+ end
+end)
+
+function mesecon:turnoff(pos, rulename, recdepth)
+ recdepth = recdepth or 2
local node = minetest.get_node(pos)
+ if(node.name == "ignore") then
+ -- try turning on later again
+ mesecon.queue:add_action(
+ pos, "turnoff", {rulename, recdepth + 1}, nil, true)
+ end
+
if mesecon:is_conductor_on(node, rulename) then
local rules = mesecon:conductor_get_rules(node)
- --[[
- if not rulename then
- for _, rule in ipairs(mesecon:flattenrules(rules)) do
- if mesecon:is_powered(pos, rule) then
- mesecon:turnoff(pos, rule)
- end
- end
- return
- end
- --]]
minetest.swap_node(pos, {name = mesecon:get_conductor_off(node, rulename), param2 = node.param2})
for _, rule in ipairs(mesecon:rule2meta(rulename, rules)) do
local np = mesecon:addPosRule(pos, rule)
- local rulenames = mesecon:rules_link_rule_all(pos, rule)
+ if(minetest.get_node(np).name == "ignore") then
+ -- try turning on later again
+ mesecon.queue:add_action(
+ np, "turnoff", {rulename, recdepth + 1}, nil, true)
+ else
+ local rulenames = mesecon:rules_link_rule_all(pos, rule)
- for _, rulename in ipairs(rulenames) do
- mesecon:turnoff(np, rulename)
+ for _, rulename in ipairs(rulenames) do
+ mesecon:turnoff(np, rulename, recdepth + 1)
+ end
end
end
elseif mesecon:is_effector(node.name) then
- mesecon:changesignal(pos, node, rulename, mesecon.state.off)
+ mesecon:changesignal(pos, node, rulename, mesecon.state.off, recdepth)
if mesecon:is_effector_on(node.name)
and not mesecon:is_powered(pos) then
- mesecon:deactivate(pos, node, rulename)
+ mesecon:deactivate(pos, node, rulename, recdepth + 1)
end
end
end
+mesecon.queue:add_function("turnoff", function (pos, rulename, recdepth)
+ if (MESECONS_GLOBALSTEP) then -- do not resume if we don't use globalstep - that would cause an endless loop
+ mesecon:turnoff(pos, rulename, recdepth)
+ end
+end)
+
function mesecon:connected_to_receptor(pos, rulename)
local node = minetest.get_node(pos)
diff --git a/mesecons/legacy.lua b/mesecons/legacy.lua
index a68bab4..c4334cf 100644
--- a/mesecons/legacy.lua
+++ b/mesecons/legacy.lua
@@ -2,4 +2,31 @@ minetest.swap_node = minetest.swap_node or function(pos, node)
local data = minetest.get_meta(pos):to_table()
minetest.add_node(pos, node)
minetest.get_meta(pos):from_table(data)
-end \ No newline at end of file
+end
+
+local rules = {}
+rules.a = {x = -1, y = 0, z = 0, name="A"}
+rules.b = {x = 0, y = 0, z = 1, name="B"}
+rules.c = {x = 1, y = 0, z = 0, name="C"}
+rules.d = {x = 0, y = 0, z = -1, name="D"}
+
+function legacy_update_ports(pos)
+ local meta = minetest.get_meta(pos)
+ L = {
+ a = mesecon:is_power_on(mesecon:addPosRule(pos, rules.a),
+ mesecon:invertRule(rules.a)) and
+ mesecon:rules_link(mesecon:addPosRule(pos, rules.a), pos),
+ b = mesecon:is_power_on(mesecon:addPosRule(pos, rules.b),
+ mesecon:invertRule(rules.b)) and
+ mesecon:rules_link(mesecon:addPosRule(pos, rules.b), pos),
+ c = mesecon:is_power_on(mesecon:addPosRule(pos, rules.c),
+ mesecon:invertRule(rules.c)) and
+ mesecon:rules_link(mesecon:addPosRule(pos, rules.c), pos),
+ d = mesecon:is_power_on(mesecon:addPosRule(pos, rules.d),
+ mesecon:invertRule(rules.d)) and
+ mesecon:rules_link(mesecon:addPosRule(pos, rules.d), pos),
+ }
+ local n = (L.a and 1 or 0) + (L.b and 2 or 0) + (L.c and 4 or 0) + (L.d and 8 or 0) + 1
+ meta:set_int("real_portstates", n)
+ return L
+end
diff --git a/mesecons/services.lua b/mesecons/services.lua
index 9d192ae..a1ab03a 100644
--- a/mesecons/services.lua
+++ b/mesecons/services.lua
@@ -3,22 +3,23 @@ mesecon.on_placenode = function (pos, node)
mesecon:receptor_on(pos, mesecon:receptor_get_rules(node))
elseif mesecon:is_powered(pos) then
if mesecon:is_conductor(node.name) then
+ -- receptor_on if itself is powered already
mesecon:turnon (pos)
- --mesecon:receptor_on (pos, mesecon:conductor_get_rules(node))
+ mesecon:receptor_on (pos, mesecon:conductor_get_rules(node))
else
- mesecon:changesignal(pos, node, mesecon:effector_get_rules(node), "on")
- mesecon:activate(pos, node)
+ mesecon:changesignal(pos, node, mesecon:effector_get_rules(node), "on", 1)
+ mesecon:activate(pos, node, nil, 1)
end
elseif mesecon:is_conductor_on(node) then
minetest.swap_node(pos, {name = mesecon:get_conductor_off(node)})
elseif mesecon:is_effector_on (node.name) then
- mesecon:deactivate(pos, node)
+ mesecon:deactivate(pos, node, nil, 1)
end
end
mesecon.on_dignode = function (pos, node)
if mesecon:is_conductor_on(node) then
- mesecon:receptor_off_i(pos, mesecon:conductor_get_rules(node))
+ mesecon:receptor_off(pos, mesecon:conductor_get_rules(node))
elseif mesecon:is_receptor_on(node.name) then
mesecon:receptor_off(pos, mesecon:receptor_get_rules(node))
end
diff --git a/mesecons/settings.lua b/mesecons/settings.lua
index e35bb1e..593a79b 100644
--- a/mesecons/settings.lua
+++ b/mesecons/settings.lua
@@ -7,3 +7,5 @@ PISTON_MAXIMUM_PUSH = 15
MOVESTONE_MAXIMUM_PUSH = 100
MESECONS_GLOBALSTEP = true -- true = receptors/effectors won't be updated
-- until next globalstep, decreases server load
+MESECONS_RESUMETIME = 4 -- time to wait when starting the server before
+ -- processing the ActionQueue, don't set this too low
diff --git a/mesecons_textures/textures/jeija_fiber.png b/mesecons/textures/jeija_fiber.png
index e8c7b08..e8c7b08 100644
--- a/mesecons_textures/textures/jeija_fiber.png
+++ b/mesecons/textures/jeija_fiber.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_glue.png b/mesecons/textures/jeija_glue.png
index 2f351d1..2f351d1 100644
--- a/mesecons_textures/textures/jeija_glue.png
+++ b/mesecons/textures/jeija_glue.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_mesecon_crossing_off.png b/mesecons/textures/jeija_mesecon_crossing_off.png
index 4e3ca03..4e3ca03 100644
--- a/mesecons_textures/textures/jeija_mesecon_crossing_off.png
+++ b/mesecons/textures/jeija_mesecon_crossing_off.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_mesecon_crossing_on.png b/mesecons/textures/jeija_mesecon_crossing_on.png
index 4518fa7..4518fa7 100644
--- a/mesecons_textures/textures/jeija_mesecon_crossing_on.png
+++ b/mesecons/textures/jeija_mesecon_crossing_on.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_mesecon_curved_off.png b/mesecons/textures/jeija_mesecon_curved_off.png
index b34335f..b34335f 100644
--- a/mesecons_textures/textures/jeija_mesecon_curved_off.png
+++ b/mesecons/textures/jeija_mesecon_curved_off.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_mesecon_curved_on.png b/mesecons/textures/jeija_mesecon_curved_on.png
index fa882e4..fa882e4 100644
--- a/mesecons_textures/textures/jeija_mesecon_curved_on.png
+++ b/mesecons/textures/jeija_mesecon_curved_on.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_mesecon_inverter_off.png b/mesecons/textures/jeija_mesecon_inverter_off.png
index bd4de1b..bd4de1b 100644
--- a/mesecons_textures/textures/jeija_mesecon_inverter_off.png
+++ b/mesecons/textures/jeija_mesecon_inverter_off.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_mesecon_inverter_on.png b/mesecons/textures/jeija_mesecon_inverter_on.png
index be41599..be41599 100644
--- a/mesecons_textures/textures/jeija_mesecon_inverter_on.png
+++ b/mesecons/textures/jeija_mesecon_inverter_on.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_mesecon_off.png b/mesecons/textures/jeija_mesecon_off.png
index a3930cb..a3930cb 100644
--- a/mesecons_textures/textures/jeija_mesecon_off.png
+++ b/mesecons/textures/jeija_mesecon_off.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_mesecon_on.png b/mesecons/textures/jeija_mesecon_on.png
index d7ebeec..d7ebeec 100644
--- a/mesecons_textures/textures/jeija_mesecon_on.png
+++ b/mesecons/textures/jeija_mesecon_on.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_mesecon_plug.png b/mesecons/textures/jeija_mesecon_plug.png
index 8a4d281..8a4d281 100644
--- a/mesecons_textures/textures/jeija_mesecon_plug.png
+++ b/mesecons/textures/jeija_mesecon_plug.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_mesecon_socket_off.png b/mesecons/textures/jeija_mesecon_socket_off.png
index ad3f601..ad3f601 100644
--- a/mesecons_textures/textures/jeija_mesecon_socket_off.png
+++ b/mesecons/textures/jeija_mesecon_socket_off.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_mesecon_socket_on.png b/mesecons/textures/jeija_mesecon_socket_on.png
index 6a9c480..6a9c480 100644
--- a/mesecons_textures/textures/jeija_mesecon_socket_on.png
+++ b/mesecons/textures/jeija_mesecon_socket_on.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_mesecon_switch_off.png b/mesecons/textures/jeija_mesecon_switch_off.png
index 2a75ef3..2a75ef3 100644
--- a/mesecons_textures/textures/jeija_mesecon_switch_off.png
+++ b/mesecons/textures/jeija_mesecon_switch_off.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_mesecon_switch_on.png b/mesecons/textures/jeija_mesecon_switch_on.png
index 9df3450..9df3450 100644
--- a/mesecons_textures/textures/jeija_mesecon_switch_on.png
+++ b/mesecons/textures/jeija_mesecon_switch_on.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_mesecon_switch_side.png b/mesecons/textures/jeija_mesecon_switch_side.png
index fb5db33..fb5db33 100644
--- a/mesecons_textures/textures/jeija_mesecon_switch_side.png
+++ b/mesecons/textures/jeija_mesecon_switch_side.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_mesecon_t_junction_off.png b/mesecons/textures/jeija_mesecon_t_junction_off.png
index 7131846..7131846 100644
--- a/mesecons_textures/textures/jeija_mesecon_t_junction_off.png
+++ b/mesecons/textures/jeija_mesecon_t_junction_off.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_mesecon_t_junction_on.png b/mesecons/textures/jeija_mesecon_t_junction_on.png
index a6609ee..a6609ee 100644
--- a/mesecons_textures/textures/jeija_mesecon_t_junction_on.png
+++ b/mesecons/textures/jeija_mesecon_t_junction_on.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_silicon.png b/mesecons/textures/jeija_silicon.png
index a7b0d52..a7b0d52 100644
--- a/mesecons_textures/textures/jeija_silicon.png
+++ b/mesecons/textures/jeija_silicon.png
Binary files differ
diff --git a/mesecons_textures/textures/wires_bump_off.png b/mesecons/textures/wires_bump_off.png
index 1e0bd74..1e0bd74 100644
--- a/mesecons_textures/textures/wires_bump_off.png
+++ b/mesecons/textures/wires_bump_off.png
Binary files differ
diff --git a/mesecons_textures/textures/wires_bump_on.png b/mesecons/textures/wires_bump_on.png
index da9a661..da9a661 100644
--- a/mesecons_textures/textures/wires_bump_on.png
+++ b/mesecons/textures/wires_bump_on.png
Binary files differ
diff --git a/mesecons_textures/textures/wires_full_off.png b/mesecons/textures/wires_full_off.png
index 58164fa..58164fa 100644
--- a/mesecons_textures/textures/wires_full_off.png
+++ b/mesecons/textures/wires_full_off.png
Binary files differ
diff --git a/mesecons_textures/textures/wires_full_on.png b/mesecons/textures/wires_full_on.png
index 98a86c8..98a86c8 100644
--- a/mesecons_textures/textures/wires_full_on.png
+++ b/mesecons/textures/wires_full_on.png
Binary files differ
diff --git a/mesecons_textures/textures/wires_inv.png b/mesecons/textures/wires_inv.png
index 626f8d4..626f8d4 100644
--- a/mesecons_textures/textures/wires_inv.png
+++ b/mesecons/textures/wires_inv.png
Binary files differ
diff --git a/mesecons_textures/textures/wires_off.png b/mesecons/textures/wires_off.png
index 757d339..757d339 100644
--- a/mesecons_textures/textures/wires_off.png
+++ b/mesecons/textures/wires_off.png
Binary files differ
diff --git a/mesecons_textures/textures/wires_on.png b/mesecons/textures/wires_on.png
index 57bb82d..57bb82d 100644
--- a/mesecons_textures/textures/wires_on.png
+++ b/mesecons/textures/wires_on.png
Binary files differ
diff --git a/mesecons_textures/textures/wires_vertical_off.png b/mesecons/textures/wires_vertical_off.png
index ba8d472..ba8d472 100644
--- a/mesecons_textures/textures/wires_vertical_off.png
+++ b/mesecons/textures/wires_vertical_off.png
Binary files differ
diff --git a/mesecons_textures/textures/wires_vertical_on.png b/mesecons/textures/wires_vertical_on.png
index 172fa65..172fa65 100644
--- a/mesecons_textures/textures/wires_vertical_on.png
+++ b/mesecons/textures/wires_vertical_on.png
Binary files differ
diff --git a/mesecons/util.lua b/mesecons/util.lua
index b3ca7a0..91d435a 100644
--- a/mesecons/util.lua
+++ b/mesecons/util.lua
@@ -169,6 +169,7 @@ function mesecon:cmpSpecial(r1, r2)
end
function mesecon:tablecopy(table) -- deep table copy
+ if type(table) ~= "table" then return table end -- no need to copy
local newtable = {}
for idx, item in pairs(table) do
@@ -181,3 +182,14 @@ function mesecon:tablecopy(table) -- deep table copy
return newtable
end
+
+function mesecon:cmpAny(t1, t2)
+ if type(t1) ~= type(t2) then return false end
+ if type(t1) ~= "table" and type(t2) ~= "table" then return t1 == t2 end
+
+ for i, e in pairs(t1) do
+ if not mesecon:cmpAny(e, t2[i]) then return false end
+ end
+
+ return true
+end
diff --git a/mesecons_textures/textures/jeija_blinky_plant_off.png b/mesecons_blinkyplant/textures/jeija_blinky_plant_off.png
index 4f507da..4f507da 100644
--- a/mesecons_textures/textures/jeija_blinky_plant_off.png
+++ b/mesecons_blinkyplant/textures/jeija_blinky_plant_off.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_blinky_plant_on.png b/mesecons_blinkyplant/textures/jeija_blinky_plant_on.png
index f77a134..f77a134 100644
--- a/mesecons_textures/textures/jeija_blinky_plant_on.png
+++ b/mesecons_blinkyplant/textures/jeija_blinky_plant_on.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_wall_button_off.png b/mesecons_button/textures/jeija_wall_button_off.png
index 0e3ff25..0e3ff25 100644
--- a/mesecons_textures/textures/jeija_wall_button_off.png
+++ b/mesecons_button/textures/jeija_wall_button_off.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_wall_button_on.png b/mesecons_button/textures/jeija_wall_button_on.png
index 1d97464..1d97464 100644
--- a/mesecons_textures/textures/jeija_wall_button_on.png
+++ b/mesecons_button/textures/jeija_wall_button_on.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_wall_button_sides.png b/mesecons_button/textures/jeija_wall_button_sides.png
index 9b79b57..9b79b57 100644
--- a/mesecons_textures/textures/jeija_wall_button_sides.png
+++ b/mesecons_button/textures/jeija_wall_button_sides.png
Binary files differ
diff --git a/mesecons_commandblock/depends.txt b/mesecons_commandblock/depends.txt
deleted file mode 100644
index acaa924..0000000
--- a/mesecons_commandblock/depends.txt
+++ /dev/null
@@ -1 +0,0 @@
-mesecons
diff --git a/mesecons_commandblock/init.lua b/mesecons_commandblock/init.lua
index af7034d..2b03245 100644
--- a/mesecons_commandblock/init.lua
+++ b/mesecons_commandblock/init.lua
@@ -1,210 +1 @@
-minetest.register_chatcommand("say", {
- params = "<text>",
- description = "Say <text> as the server",
- privs = {server=true},
- func = function(name, param)
- minetest.chat_send_all(name .. ": " .. param)
- end
-})
-
-minetest.register_chatcommand("tell", {
- params = "<name> <text>",
- description = "Say <text> to <name> privately",
- func = function(name, param)
- local found, _, target, message = param:find("^([^%s]+)%s+(.*)$")
- if found == nil then
- minetest.chat_send_player(name, "Invalid usage: " .. param)
- return
- end
- if not minetest.get_player_by_name(target) then
- minetest.chat_send_player(name, "Invalid target: " .. target)
- end
- minetest.chat_send_player(target, name .. " whispers: " .. message, false)
- end
-})
-
-minetest.register_chatcommand("tellme", {
- params = "<text>",
- description = "Say <text> to yourself",
- func = function(name, param)
- minetest.chat_send_player(name, param, false)
- end
-})
-
-minetest.register_chatcommand("hp", {
- params = "<name> <value>",
- description = "Set health of <name> to <value> hitpoints",
- privs = {ban=true},
- func = function(name, param)
- local found, _, target, value = param:find("^([^%s]+)%s+(%d+)$")
- if found == nil then
- minetest.chat_send_player(name, "Invalid usage: " .. param)
- return
- end
- local player = minetest.get_player_by_name(target)
- if player then
- player:set_hp(value)
- else
- minetest.chat_send_player(name, "Invalid target: " .. target)
- end
- end
-})
-
-local initialize_data = function(meta, player, command, param)
- meta:set_string("formspec",
- "invsize[9,6;]" ..
- "field[1,1;7.5,1;player;Player;" .. player .. "]" ..
- "button[1.3,2;2,1;nearest;Nearest]" ..
- "button[3.3,2;2,1;farthest;Farthest]" ..
- "button[5.3,2;2,1;random;Random]" ..
- "field[1,4;2,1;command;Command;" .. command .. "]" ..
- "field[3,4;5.5,1;param;Parameter;" .. param .. "]" ..
- "button_exit[3.3,5;2,1;submit;Submit]")
- local owner = meta:get_string("owner")
- if owner == "" then
- owner = "not owned"
- else
- owner = "owned by " .. owner
- end
- meta:set_string("infotext", "Command Block\n" ..
- "(" .. owner .. ")\n" ..
- "Command: /" .. command .. " " .. param)
-end
-
-local construct = function(pos)
- local meta = minetest.get_meta(pos)
-
- meta:set_string("player", "@nearest")
- meta:set_string("command", "time")
- meta:set_string("param", "7000")
-
- meta:set_string("owner", "")
-
- initialize_data(meta, "@nearest", "time", "7000")
-end
-
-local after_place = function(pos, placer)
- if placer then
- local meta = minetest.get_meta(pos)
- meta:set_string("owner", placer:get_player_name())
- initialize_data(meta, "@nearest", "time", "7000")
- end
-end
-
-local receive_fields = function(pos, formname, fields, sender)
- if fields.quit then
- return
- end
- local meta = minetest.get_meta(pos)
- if fields.nearest then
- initialize_data(meta, "@nearest", fields.command, fields.param)
- elseif fields.farthest then
- initialize_data(meta, "@farthest", fields.command, fields.param)
- elseif fields.random then
- initialize_data(meta, "@random", fields.command, fields.param)
- else --fields.submit or pressed enter
- meta:set_string("player", fields.player)
- meta:set_string("command", fields.command)
- meta:set_string("param", fields.param)
-
- initialize_data(meta, fields.player, fields.command, fields.param)
- end
-end
-
-local resolve_player = function(name, pos)
- local get_distance = function(pos1, pos2)
- return math.sqrt((pos1.x - pos2.x) ^ 2 + (pos1.y - pos2.y) ^ 2 + (pos1.z - pos2.z) ^ 2)
- end
-
- if name == "@nearest" then
- local min_distance = math.huge
- for index, player in ipairs(minetest.get_connected_players()) do
- local distance = get_distance(pos, player:getpos())
- if distance < min_distance then
- min_distance = distance
- name = player:get_player_name()
- end
- end
- elseif name == "@farthest" then
- local max_distance = -1
- for index, player in ipairs(minetest.get_connected_players()) do
- local distance = get_distance(pos, player:getpos())
- if distance > max_distance then
- max_distance = distance
- name = player:get_player_name()
- end
- end
- elseif name == "@random" then
- local players = minetest.get_connected_players()
- local player = players[math.random(#players)]
- name = player:get_player_name()
- end
- return name
-end
-
-local commandblock_action_on = function(pos, node)
- if node.name ~= "mesecons_commandblock:commandblock_off" then
- return
- end
-
- minetest.swap_node(pos, {name = "mesecons_commandblock:commandblock_on"})
-
- local meta = minetest.get_meta(pos)
- local command = minetest.chatcommands[meta:get_string("command")]
- if command == nil then
- return
- end
- local owner = meta:get_string("owner")
- if owner == "" then
- return
- end
- local has_privs, missing_privs = minetest.check_player_privs(owner, command.privs)
- if not has_privs then
- minetest.chat_send_player(owner, "You don't have permission to run this command (missing privileges: "..table.concat(missing_privs, ", ")..")")
- return
- end
- local player = resolve_player(meta:get_string("player"), pos)
- command.func(player, meta:get_string("param"))
-end
-
-local commandblock_action_off = function(pos, node)
- if node.name == "mesecons_commandblock:commandblock_on" then
- minetest.swap_node(pos, {name = "mesecons_commandblock:commandblock_off"})
- end
-end
-
-minetest.register_node("mesecons_commandblock:commandblock_off", {
- description = "Command Block",
- tiles = {"jeija_commandblock_off.png"},
- inventory_image = minetest.inventorycube("jeija_commandblock_off.png"),
- groups = {cracky=2, mesecon_effector_off=1},
- on_construct = construct,
- after_place_node = after_place,
- on_receive_fields = receive_fields,
- can_dig = function(pos,player)
- local owner = minetest.get_meta(pos):get_string("owner")
- return owner == "" or owner == player:get_player_name()
- end,
- sounds = default.node_sound_stone_defaults(),
- mesecons = {effector = {
- action_on = commandblock_action_on
- }}
-})
-
-minetest.register_node("mesecons_commandblock:commandblock_on", {
- tiles = {"jeija_commandblock_on.png"},
- groups = {cracky=2, mesecon_effector_on=1, not_in_creative_inventory=1},
- light_source = 10,
- drop = "mesecons_commandblock:commandblock_off",
- on_construct = construct,
- after_place_node = after_place,
- on_receive_fields = receive_fields,
- can_dig = function(pos,player)
- local owner = minetest.get_meta(pos):get_string("owner")
- return owner == "" or owner == player:get_player_name()
- end,
- sounds = default.node_sound_stone_defaults(),
- mesecons = {effector = {
- action_off = commandblock_action_off
- }}
-})
+-- removed until fixed
diff --git a/mesecons_textures/textures/jeija_close_window.png b/mesecons_commandblock/textures/jeija_close_window.png
index 5c27c6c..5c27c6c 100644
--- a/mesecons_textures/textures/jeija_close_window.png
+++ b/mesecons_commandblock/textures/jeija_close_window.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_commandblock_off.png b/mesecons_commandblock/textures/jeija_commandblock_off.png
index c05b616..c05b616 100644
--- a/mesecons_textures/textures/jeija_commandblock_off.png
+++ b/mesecons_commandblock/textures/jeija_commandblock_off.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_commandblock_on.png b/mesecons_commandblock/textures/jeija_commandblock_on.png
index 7fc35b6..7fc35b6 100644
--- a/mesecons_textures/textures/jeija_commandblock_on.png
+++ b/mesecons_commandblock/textures/jeija_commandblock_on.png
Binary files differ
diff --git a/mesecons_delayer/init.lua b/mesecons_delayer/init.lua
index a03737c..4ec0ebc 100644
--- a/mesecons_delayer/init.lua
+++ b/mesecons_delayer/init.lua
@@ -17,28 +17,18 @@ end
-- Functions that are called after the delay time
-local delayer_turnon = function(params)
- local rules = delayer_get_output_rules(params.node)
- mesecon:receptor_on(params.pos, rules)
-end
-
-local delayer_turnoff = function(params)
- local rules = delayer_get_output_rules(params.node)
- mesecon:receptor_off(params.pos, rules)
-end
-
local delayer_activate = function(pos, node)
local def = minetest.registered_nodes[node.name]
local time = def.delayer_time
minetest.swap_node(pos, {name = def.delayer_onstate, param2=node.param2})
- minetest.after(time, delayer_turnon , {pos = pos, node = node})
+ mesecon.queue:add_action(pos, "receptor_on", {rules=delayer_get_output_rules(node)}, time, nil)
end
local delayer_deactivate = function(pos, node)
local def = minetest.registered_nodes[node.name]
local time = def.delayer_time
minetest.swap_node(pos, {name = def.delayer_offstate, param2=node.param2})
- minetest.after(time, delayer_turnoff, {pos = pos, node = node})
+ mesecon.queue:add_action(pos, "receptor_off", {rules=delayer_get_output_rules(node)}, time, nil)
end
-- Register the 2 (states) x 4 (delay times) delayers
diff --git a/mesecons_detector/init.lua b/mesecons_detector/init.lua
index 7bb516b..79aa1f9 100644
--- a/mesecons_detector/init.lua
+++ b/mesecons_detector/init.lua
@@ -6,7 +6,8 @@ local object_detector_make_formspec = function (pos)
local meta = minetest.get_meta(pos)
meta:set_string("formspec", "size[9,2.5]" ..
"field[0.3, 0;9,2;scanname;Name of player to scan for (empty for any):;${scanname}]"..
- "field[0.3,1.5;4,2;digiline_channel;Digiline Channel (optional):;${digiline_channel}]")
+ "field[0.3,1.5;4,2;digiline_channel;Digiline Channel (optional):;${digiline_channel}]"..
+ "button_exit[7,0.75;2,3;;Save]")
end
local object_detector_on_receive_fields = function(pos, formname, fields)
diff --git a/mesecons_textures/textures/jeija_object_detector_off.png b/mesecons_detector/textures/jeija_object_detector_off.png
index 825d78f..825d78f 100644
--- a/mesecons_textures/textures/jeija_object_detector_off.png
+++ b/mesecons_detector/textures/jeija_object_detector_off.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_object_detector_on.png b/mesecons_detector/textures/jeija_object_detector_on.png
index 96f8ba3..96f8ba3 100644
--- a/mesecons_textures/textures/jeija_object_detector_on.png
+++ b/mesecons_detector/textures/jeija_object_detector_on.png
Binary files differ
diff --git a/mesecons_gates/init.lua b/mesecons_gates/init.lua
index 1a9ee83..51ed4af 100644
--- a/mesecons_gates/init.lua
+++ b/mesecons_gates/init.lua
@@ -23,7 +23,8 @@ function gate_get_input_rules_twoinputs(node)
return gate_rotate_rules(node)
end
-function update_gate(pos)
+function update_gate(pos, node, rulename, newstate)
+ yc_update_real_portstates(pos, node, rulename, newstate)
gate = get_gate(pos)
L = rotate_ports(
yc_get_real_portstates(pos),
diff --git a/mesecons_textures/textures/jeija_gate_and.png b/mesecons_gates/textures/jeija_gate_and.png
index 0ddc043..0ddc043 100644
--- a/mesecons_textures/textures/jeija_gate_and.png
+++ b/mesecons_gates/textures/jeija_gate_and.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_gate_diode.png b/mesecons_gates/textures/jeija_gate_diode.png
index ffa403f..ffa403f 100644
--- a/mesecons_textures/textures/jeija_gate_diode.png
+++ b/mesecons_gates/textures/jeija_gate_diode.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_gate_nand.png b/mesecons_gates/textures/jeija_gate_nand.png
index 0e4294e..0e4294e 100644
--- a/mesecons_textures/textures/jeija_gate_nand.png
+++ b/mesecons_gates/textures/jeija_gate_nand.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_gate_not.png b/mesecons_gates/textures/jeija_gate_not.png
index 939fb76..939fb76 100644
--- a/mesecons_textures/textures/jeija_gate_not.png
+++ b/mesecons_gates/textures/jeija_gate_not.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_gate_off.png b/mesecons_gates/textures/jeija_gate_off.png
index 44017b0..44017b0 100644
--- a/mesecons_textures/textures/jeija_gate_off.png
+++ b/mesecons_gates/textures/jeija_gate_off.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_gate_on.png b/mesecons_gates/textures/jeija_gate_on.png
index 47028a8..47028a8 100644
--- a/mesecons_textures/textures/jeija_gate_on.png
+++ b/mesecons_gates/textures/jeija_gate_on.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_gate_xor.png b/mesecons_gates/textures/jeija_gate_xor.png
index afbd6ab..afbd6ab 100644
--- a/mesecons_textures/textures/jeija_gate_xor.png
+++ b/mesecons_gates/textures/jeija_gate_xor.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_hydro_turbine_off.png b/mesecons_hydroturbine/textures/jeija_hydro_turbine_off.png
index 5ca1a12..5ca1a12 100644
--- a/mesecons_textures/textures/jeija_hydro_turbine_off.png
+++ b/mesecons_hydroturbine/textures/jeija_hydro_turbine_off.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_hydro_turbine_on.png b/mesecons_hydroturbine/textures/jeija_hydro_turbine_on.png
index 28eb0c9..28eb0c9 100644
--- a/mesecons_textures/textures/jeija_hydro_turbine_on.png
+++ b/mesecons_hydroturbine/textures/jeija_hydro_turbine_on.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_insulated_wire_crossing_tb_01.png b/mesecons_insulated/textures/jeija_insulated_wire_crossing_tb_01.png
index d872b2b..d872b2b 100644
--- a/mesecons_textures/textures/jeija_insulated_wire_crossing_tb_01.png
+++ b/mesecons_insulated/textures/jeija_insulated_wire_crossing_tb_01.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_insulated_wire_crossing_tb_10.png b/mesecons_insulated/textures/jeija_insulated_wire_crossing_tb_10.png
index ae06dea..ae06dea 100644
--- a/mesecons_textures/textures/jeija_insulated_wire_crossing_tb_10.png
+++ b/mesecons_insulated/textures/jeija_insulated_wire_crossing_tb_10.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_insulated_wire_crossing_tb_off.png b/mesecons_insulated/textures/jeija_insulated_wire_crossing_tb_off.png
index 41b5ff4..41b5ff4 100644
--- a/mesecons_textures/textures/jeija_insulated_wire_crossing_tb_off.png
+++ b/mesecons_insulated/textures/jeija_insulated_wire_crossing_tb_off.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_insulated_wire_crossing_tb_on.png b/mesecons_insulated/textures/jeija_insulated_wire_crossing_tb_on.png
index 154288b..154288b 100644
--- a/mesecons_textures/textures/jeija_insulated_wire_crossing_tb_on.png
+++ b/mesecons_insulated/textures/jeija_insulated_wire_crossing_tb_on.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_insulated_wire_curved_tb_off.png b/mesecons_insulated/textures/jeija_insulated_wire_curved_tb_off.png
index 85ca90b..85ca90b 100644
--- a/mesecons_textures/textures/jeija_insulated_wire_curved_tb_off.png
+++ b/mesecons_insulated/textures/jeija_insulated_wire_curved_tb_off.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_insulated_wire_curved_tb_on.png b/mesecons_insulated/textures/jeija_insulated_wire_curved_tb_on.png
index 772d9a6..772d9a6 100644
--- a/mesecons_textures/textures/jeija_insulated_wire_curved_tb_on.png
+++ b/mesecons_insulated/textures/jeija_insulated_wire_curved_tb_on.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_insulated_wire_ends_01x.png b/mesecons_insulated/textures/jeija_insulated_wire_ends_01x.png
index b742152..b742152 100644
--- a/mesecons_textures/textures/jeija_insulated_wire_ends_01x.png
+++ b/mesecons_insulated/textures/jeija_insulated_wire_ends_01x.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_insulated_wire_ends_01z.png b/mesecons_insulated/textures/jeija_insulated_wire_ends_01z.png
index 497a467..497a467 100644
--- a/mesecons_textures/textures/jeija_insulated_wire_ends_01z.png
+++ b/mesecons_insulated/textures/jeija_insulated_wire_ends_01z.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_insulated_wire_ends_10x.png b/mesecons_insulated/textures/jeija_insulated_wire_ends_10x.png
index d407cff..d407cff 100644
--- a/mesecons_textures/textures/jeija_insulated_wire_ends_10x.png
+++ b/mesecons_insulated/textures/jeija_insulated_wire_ends_10x.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_insulated_wire_ends_10z.png b/mesecons_insulated/textures/jeija_insulated_wire_ends_10z.png
index 830d390..830d390 100644
--- a/mesecons_textures/textures/jeija_insulated_wire_ends_10z.png
+++ b/mesecons_insulated/textures/jeija_insulated_wire_ends_10z.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_insulated_wire_ends_off.png b/mesecons_insulated/textures/jeija_insulated_wire_ends_off.png
index 89a8385..89a8385 100644
--- a/mesecons_textures/textures/jeija_insulated_wire_ends_off.png
+++ b/mesecons_insulated/textures/jeija_insulated_wire_ends_off.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_insulated_wire_ends_on.png b/mesecons_insulated/textures/jeija_insulated_wire_ends_on.png
index 75cf435..75cf435 100644
--- a/mesecons_textures/textures/jeija_insulated_wire_ends_on.png
+++ b/mesecons_insulated/textures/jeija_insulated_wire_ends_on.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_insulated_wire_sides_off.png b/mesecons_insulated/textures/jeija_insulated_wire_sides_off.png
index db33f14..db33f14 100644
--- a/mesecons_textures/textures/jeija_insulated_wire_sides_off.png
+++ b/mesecons_insulated/textures/jeija_insulated_wire_sides_off.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_insulated_wire_sides_on.png b/mesecons_insulated/textures/jeija_insulated_wire_sides_on.png
index f76e9a8..f76e9a8 100644
--- a/mesecons_textures/textures/jeija_insulated_wire_sides_on.png
+++ b/mesecons_insulated/textures/jeija_insulated_wire_sides_on.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_insulated_wire_tjunction_tb_off.png b/mesecons_insulated/textures/jeija_insulated_wire_tjunction_tb_off.png
index a897b29..a897b29 100644
--- a/mesecons_textures/textures/jeija_insulated_wire_tjunction_tb_off.png
+++ b/mesecons_insulated/textures/jeija_insulated_wire_tjunction_tb_off.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_insulated_wire_tjunction_tb_on.png b/mesecons_insulated/textures/jeija_insulated_wire_tjunction_tb_on.png
index 8fc312b..8fc312b 100644
--- a/mesecons_textures/textures/jeija_insulated_wire_tjunction_tb_on.png
+++ b/mesecons_insulated/textures/jeija_insulated_wire_tjunction_tb_on.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_meselamp.png b/mesecons_lamp/textures/jeija_meselamp.png
index 5456ee9..5456ee9 100644
--- a/mesecons_textures/textures/jeija_meselamp.png
+++ b/mesecons_lamp/textures/jeija_meselamp.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_meselamp_off.png b/mesecons_lamp/textures/jeija_meselamp_off.png
index 67bd7fd..67bd7fd 100644
--- a/mesecons_textures/textures/jeija_meselamp_off.png
+++ b/mesecons_lamp/textures/jeija_meselamp_off.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_meselamp_on.png b/mesecons_lamp/textures/jeija_meselamp_on.png
index 2316e00..2316e00 100644
--- a/mesecons_textures/textures/jeija_meselamp_on.png
+++ b/mesecons_lamp/textures/jeija_meselamp_on.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_lightstone_blue_off.png b/mesecons_lightstone/textures/jeija_lightstone_blue_off.png
index 09acc22..09acc22 100644
--- a/mesecons_textures/textures/jeija_lightstone_blue_off.png
+++ b/mesecons_lightstone/textures/jeija_lightstone_blue_off.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_lightstone_blue_on.png b/mesecons_lightstone/textures/jeija_lightstone_blue_on.png
index 93c8638..93c8638 100644
--- a/mesecons_textures/textures/jeija_lightstone_blue_on.png
+++ b/mesecons_lightstone/textures/jeija_lightstone_blue_on.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_lightstone_darkgray_off.png b/mesecons_lightstone/textures/jeija_lightstone_darkgray_off.png
index 7e5aae7..7e5aae7 100644
--- a/mesecons_textures/textures/jeija_lightstone_darkgray_off.png
+++ b/mesecons_lightstone/textures/jeija_lightstone_darkgray_off.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_lightstone_darkgray_on.png b/mesecons_lightstone/textures/jeija_lightstone_darkgray_on.png
index e6d4d00..e6d4d00 100644
--- a/mesecons_textures/textures/jeija_lightstone_darkgray_on.png
+++ b/mesecons_lightstone/textures/jeija_lightstone_darkgray_on.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_lightstone_gray_off.png b/mesecons_lightstone/textures/jeija_lightstone_gray_off.png
index f168fc2..f168fc2 100644
--- a/mesecons_textures/textures/jeija_lightstone_gray_off.png
+++ b/mesecons_lightstone/textures/jeija_lightstone_gray_off.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_lightstone_gray_on.png b/mesecons_lightstone/textures/jeija_lightstone_gray_on.png
index 24c5470..24c5470 100644
--- a/mesecons_textures/textures/jeija_lightstone_gray_on.png
+++ b/mesecons_lightstone/textures/jeija_lightstone_gray_on.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_lightstone_green_off.png b/mesecons_lightstone/textures/jeija_lightstone_green_off.png
index 2f214fa..2f214fa 100644
--- a/mesecons_textures/textures/jeija_lightstone_green_off.png
+++ b/mesecons_lightstone/textures/jeija_lightstone_green_off.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_lightstone_green_on.png b/mesecons_lightstone/textures/jeija_lightstone_green_on.png
index 225bf4e..225bf4e 100644
--- a/mesecons_textures/textures/jeija_lightstone_green_on.png
+++ b/mesecons_lightstone/textures/jeija_lightstone_green_on.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_lightstone_red_off.png b/mesecons_lightstone/textures/jeija_lightstone_red_off.png
index 3c828b2..3c828b2 100644
--- a/mesecons_textures/textures/jeija_lightstone_red_off.png
+++ b/mesecons_lightstone/textures/jeija_lightstone_red_off.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_lightstone_red_on.png b/mesecons_lightstone/textures/jeija_lightstone_red_on.png
index 512b0fe..512b0fe 100644
--- a/mesecons_textures/textures/jeija_lightstone_red_on.png
+++ b/mesecons_lightstone/textures/jeija_lightstone_red_on.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_lightstone_yellow_off.png b/mesecons_lightstone/textures/jeija_lightstone_yellow_off.png
index 2e7fed0..2e7fed0 100644
--- a/mesecons_textures/textures/jeija_lightstone_yellow_off.png
+++ b/mesecons_lightstone/textures/jeija_lightstone_yellow_off.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_lightstone_yellow_on.png b/mesecons_lightstone/textures/jeija_lightstone_yellow_on.png
index 8943aca..8943aca 100644
--- a/mesecons_textures/textures/jeija_lightstone_yellow_on.png
+++ b/mesecons_lightstone/textures/jeija_lightstone_yellow_on.png
Binary files differ
diff --git a/mesecons_luacontroller/init.lua b/mesecons_luacontroller/init.lua
index acbf023..de3a972 100644
--- a/mesecons_luacontroller/init.lua
+++ b/mesecons_luacontroller/init.lua
@@ -31,18 +31,46 @@ rules.d = {x = 0, y = 0, z = -1, name="D"}
------------------
-- These helpers are required to set the portstates of the luacontroller
+function lc_update_real_portstates(pos, rulename, newstate)
+ local meta = minetest.get_meta(pos)
+ if rulename == nil then
+ meta:set_int("real_portstates", 1)
+ return
+ end
+ local n = meta:get_int("real_portstates") - 1
+ if n < 0 then
+ legacy_update_ports(pos)
+ n = meta:get_int("real_portstates") - 1
+ end
+ local L = {}
+ for i = 1, 4 do
+ L[i] = n%2
+ n = math.floor(n/2)
+ end
+ if rulename.x == nil then
+ for _, rname in ipairs(rulename) do
+ local port = ({4, 1, nil, 3, 2})[rname.x+2*rname.z+3]
+ L[port] = (newstate == "on") and 1 or 0
+ end
+ else
+ local port = ({4, 1, nil, 3, 2})[rulename.x+2*rulename.z+3]
+ L[port] = (newstate == "on") and 1 or 0
+ end
+ meta:set_int("real_portstates", 1 + L[1] + 2*L[2] + 4*L[3] + 8*L[4])
+end
+
local get_real_portstates = function(pos) -- determine if ports are powered (by itself or from outside)
- ports = {
- a = mesecon:is_power_on(mesecon:addPosRule(pos, rules.a), mesecon:invertRule(rules.a))
- and mesecon:rules_link(mesecon:addPosRule(pos, rules.a), pos),
- b = mesecon:is_power_on(mesecon:addPosRule(pos, rules.b), mesecon:invertRule(rules.b))
- and mesecon:rules_link(mesecon:addPosRule(pos, rules.b), pos),
- c = mesecon:is_power_on(mesecon:addPosRule(pos, rules.c), mesecon:invertRule(rules.c))
- and mesecon:rules_link(mesecon:addPosRule(pos, rules.c), pos),
- d = mesecon:is_power_on(mesecon:addPosRule(pos, rules.d), mesecon:invertRule(rules.d))
- and mesecon:rules_link(mesecon:addPosRule(pos, rules.d), pos),
- }
- return ports
+ local meta = minetest.get_meta(pos)
+ local L = {}
+ local n = meta:get_int("real_portstates") - 1
+ if n < 0 then
+ return legacy_update_ports(pos)
+ end
+ for _, index in ipairs({"a", "b", "c", "d"}) do
+ L[index] = ((n%2) == 1)
+ n = math.floor(n/2)
+ end
+ return L
end
local merge_portstates = function (ports, vports)
@@ -164,40 +192,29 @@ local safe_serialize = function(value)
return minetest.serialize(deep_copy(value))
end
-local interrupt = function(params)
- lc_update(params.pos, {type="interrupt", iid = params.iid})
-end
+mesecon.queue:add_function("lc_interrupt", function (pos, iid, luac_id)
+ -- There is no luacontroller anymore / it has been reprogrammed / replaced
+ if (minetest.get_meta(pos):get_int("luac_id") ~= luac_id) then return end
+ lc_update(pos, {type="interrupt", iid = iid})
+end)
local getinterrupt = function(pos)
local interrupt = function (time, iid) -- iid = interrupt id
if type(time) ~= "number" then return end
- local iid = iid or math.random()
- local meta = minetest.get_meta(pos)
- local interrupts = minetest.deserialize(meta:get_string("lc_interrupts")) or {}
- local found = false
- local search = safe_serialize(iid)
- for _, i in ipairs(interrupts) do
- if safe_serialize(i) == search then
- found = true
- break
- end
- end
- if not found then
- table.insert(interrupts, iid)
- meta:set_string("lc_interrupts", safe_serialize(interrupts))
- end
- minetest.after(time, interrupt, {pos=pos, iid = iid})
+ luac_id = minetest.get_meta(pos):get_int("luac_id")
+ mesecon.queue:add_action(pos, "lc_interrupt", {iid, luac_id}, time, iid, 1)
end
return interrupt
end
-local getdigiline_send = function (pos)
- local digiline_send = function (channel, msg)
- if digiline then
+local getdigiline_send = function(pos)
+ if not digiline then return end
+ -- Send messages on next serverstep
+ return function(channel, msg)
+ minetest.after(0, function()
digiline:receptor_send(pos, digiline.rules.default, channel, msg)
- end
+ end)
end
- return digiline_send
end
local create_environment = function(pos, mem, event)
@@ -224,6 +241,7 @@ local create_environment = function(pos, mem, event)
gsub = string.gsub,
len = string.len,
lower = string.lower,
+ upper = string.upper,
match = string.match,
rep = string.rep,
reverse = string.reverse,
@@ -288,7 +306,6 @@ local do_overheat = function (pos, meta)
if overheat(meta) then
local node = minetest.get_node(pos)
minetest.swap_node(pos, {name = BASENAME.."_burnt", param2 = node.param2})
- minetest.get_meta(pos):set_string("lc_interrupts", "")
minetest.after(0.2, overheat_off, pos) -- wait for pending operations
return true
end
@@ -302,20 +319,6 @@ local save_memory = function(meta, mem)
meta:set_string("lc_memory", safe_serialize(mem))
end
-local interrupt_allow = function (meta, event)
- if event.type ~= "interrupt" then return true end
-
- local interrupts = minetest.deserialize(meta:get_string("lc_interrupts")) or {}
- local search = safe_serialize(event.iid)
- for _, i in ipairs(interrupts) do
- if safe_serialize(i) == search then
- return true
- end
- end
-
- return false
-end
-
local ports_invalid = function (var)
if type(var) == "table" then
return false
@@ -329,7 +332,6 @@ end
lc_update = function (pos, event)
local meta = minetest.get_meta(pos)
- if not interrupt_allow(meta, event) then return end
if do_overheat(pos, meta) then return end
-- load code & mem from memory
@@ -338,7 +340,7 @@ lc_update = function (pos, event)
-- make sure code is ok and create environment
local prohibited = code_prohibited(code)
- if prohibited then return prohibited end
+ if prohibited then return prohibited end
local env = create_environment(pos, mem, event)
-- create the sandbox and execute code
@@ -351,7 +353,7 @@ lc_update = function (pos, event)
save_memory(meta, mem)
-- Actually set the ports
- minetest.after(0, action, pos, env.port)
+ action(pos, env.port)
end
local reset_meta = function(pos, code, errmsg)
@@ -366,11 +368,11 @@ local reset_meta = function(pos, code, errmsg)
"image_button_exit[9.72,-0.25;0.425,0.4;jeija_close_window.png;exit;]"..
"label[0.1,5;"..errmsg.."]")
meta:set_int("heat", 0)
+ meta:set_int("luac_id", math.random(1, 1000000))
end
local reset = function (pos)
- minetest.get_meta(pos):set_string("lc_interrupts", "")
- action(pos, {a=false, b=false, c=false, d=false}, true)
+ action(pos, {a=false, b=false, c=false, d=false})
end
-- ______
@@ -457,6 +459,7 @@ local mesecons = {
{
rules = input_rules[cid],
action_change = function (pos, _, rulename, newstate)
+ lc_update_real_portstates(pos, rulename, newstate)
lc_update(pos, {type=newstate, pin=rulename})
end,
},
@@ -488,19 +491,21 @@ minetest.register_node(nodename, {
node_box = nodebox,
on_construct = reset_meta,
on_receive_fields = function(pos, formname, fields)
- if fields.quit then
+ if not fields.program then
return
end
reset(pos)
reset_meta(pos, fields.code)
local err = lc_update(pos, {type="program"})
- if err then print(err) end
- reset_meta(pos, fields.code, err)
+ if err then
+ print(err)
+ reset_meta(pos, fields.code, err)
+ end
end,
+ on_timer = handle_timer,
sounds = default.node_sound_stone_defaults(),
mesecons = mesecons,
digiline = digiline,
- is_luacontroller = true,
virtual_portstates = { a = a == 1, -- virtual portstates are
b = b == 1, -- the ports the the
c = c == 1, -- controller powers itself
@@ -508,6 +513,7 @@ minetest.register_node(nodename, {
after_dig_node = function (pos, node)
mesecon:receptor_off(pos, output_rules)
end,
+ is_luacontroller = true,
})
end
end
@@ -540,11 +546,12 @@ minetest.register_node(BASENAME .. "_burnt", {
reset(pos)
reset_meta(pos, fields.code)
local err = lc_update(pos, {type="program"})
- if err then print(err) end
- reset_meta(pos, fields.code, err)
+ if err then
+ print(err)
+ reset_meta(pos, fields.code, err)
+ end
end,
sounds = default.node_sound_stone_defaults(),
- is_luacontroller = true,
virtual_portstates = {a = false, b = false, c = false, d = false},
})
diff --git a/mesecons_textures/textures/jeija_luac_background.png b/mesecons_luacontroller/textures/jeija_luac_background.png
index 40e316c..40e316c 100644
--- a/mesecons_textures/textures/jeija_luac_background.png
+++ b/mesecons_luacontroller/textures/jeija_luac_background.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_luac_runbutton.png b/mesecons_luacontroller/textures/jeija_luac_runbutton.png
index 157507f..157507f 100644
--- a/mesecons_textures/textures/jeija_luac_runbutton.png
+++ b/mesecons_luacontroller/textures/jeija_luac_runbutton.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_luacontroller_LED_A.png b/mesecons_luacontroller/textures/jeija_luacontroller_LED_A.png
index a187e8e..a187e8e 100644
--- a/mesecons_textures/textures/jeija_luacontroller_LED_A.png
+++ b/mesecons_luacontroller/textures/jeija_luacontroller_LED_A.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_luacontroller_LED_B.png b/mesecons_luacontroller/textures/jeija_luacontroller_LED_B.png
index 738ba96..738ba96 100644
--- a/mesecons_textures/textures/jeija_luacontroller_LED_B.png
+++ b/mesecons_luacontroller/textures/jeija_luacontroller_LED_B.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_luacontroller_LED_C.png b/mesecons_luacontroller/textures/jeija_luacontroller_LED_C.png
index abe0fe6..abe0fe6 100644
--- a/mesecons_textures/textures/jeija_luacontroller_LED_C.png
+++ b/mesecons_luacontroller/textures/jeija_luacontroller_LED_C.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_luacontroller_LED_D.png b/mesecons_luacontroller/textures/jeija_luacontroller_LED_D.png
index cc10170..cc10170 100644
--- a/mesecons_textures/textures/jeija_luacontroller_LED_D.png
+++ b/mesecons_luacontroller/textures/jeija_luacontroller_LED_D.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_luacontroller_burnt_top.png b/mesecons_luacontroller/textures/jeija_luacontroller_burnt_top.png
index d1a17af..d1a17af 100644
--- a/mesecons_textures/textures/jeija_luacontroller_burnt_top.png
+++ b/mesecons_luacontroller/textures/jeija_luacontroller_burnt_top.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_luacontroller_top.png b/mesecons_luacontroller/textures/jeija_luacontroller_top.png
index 3128230..3128230 100644
--- a/mesecons_textures/textures/jeija_luacontroller_top.png
+++ b/mesecons_luacontroller/textures/jeija_luacontroller_top.png
Binary files differ
diff --git a/mesecons_microcontroller/init.lua b/mesecons_microcontroller/init.lua
index 55faa5c..b6134da 100644
--- a/mesecons_microcontroller/init.lua
+++ b/mesecons_microcontroller/init.lua
@@ -39,7 +39,8 @@ mesecon:add_rules(nodename, rules)
local mesecons = {effector =
{
rules = input_rules,
- action_change = function (pos, node, rulename)
+ action_change = function (pos, node, rulename, newstate)
+ yc_update_real_portstates(pos, node, rulename, newstate)
update_yc(pos)
end
}}
@@ -633,25 +634,45 @@ function yc_set_portstate(port, state, L)
return L
end
-function yc_get_real_portstates(pos) -- port powered or not (by itself or from outside)?
- rulesA = mesecon:get_rules("mesecons_microcontroller:microcontroller0001")
- rulesB = mesecon:get_rules("mesecons_microcontroller:microcontroller0010")
- rulesC = mesecon:get_rules("mesecons_microcontroller:microcontroller0100")
- rulesD = mesecon:get_rules("mesecons_microcontroller:microcontroller1000")
- L = {
- a = mesecon:is_power_on(mesecon:addPosRule(pos, rulesA[1]),
- mesecon:invertRule(rulesA[1])) and
- mesecon:rules_link(mesecon:addPosRule(pos, rulesA[1]), pos),
- b = mesecon:is_power_on(mesecon:addPosRule(pos, rulesB[1]),
- mesecon:invertRule(rulesB[1])) and
- mesecon:rules_link(mesecon:addPosRule(pos, rulesB[1]), pos),
- c = mesecon:is_power_on(mesecon:addPosRule(pos, rulesC[1]),
- mesecon:invertRule(rulesC[1])) and
- mesecon:rules_link(mesecon:addPosRule(pos, rulesC[1]), pos),
- d = mesecon:is_power_on(mesecon:addPosRule(pos, rulesD[1]),
- mesecon:invertRule(rulesD[1])) and
- mesecon:rules_link(mesecon:addPosRule(pos, rulesD[1]), pos),
- }
+function yc_update_real_portstates(pos, node, rulename, newstate)
+ local meta = minetest.get_meta(pos)
+ if rulename == nil then
+ meta:set_int("real_portstates", 1)
+ return
+ end
+ local n = meta:get_int("real_portstates") - 1
+ if n < 0 then
+ legacy_update_ports(pos)
+ n = meta:get_int("real_portstates") - 1
+ end
+ local L = {}
+ for i = 1, 4 do
+ L[i] = n%2
+ n = math.floor(n/2)
+ end
+ if rulename.x == nil then
+ for _, rname in ipairs(rulename) do
+ local port = ({4, 1, nil, 3, 2})[rname.x+2*rname.z+3]
+ L[port] = (newstate == "on") and 1 or 0
+ end
+ else
+ local port = ({4, 1, nil, 3, 2})[rulename.x+2*rulename.z+3]
+ L[port] = (newstate == "on") and 1 or 0
+ end
+ meta:set_int("real_portstates", 1 + L[1] + 2*L[2] + 4*L[3] + 8*L[4])
+end
+
+function yc_get_real_portstates(pos) -- determine if ports are powered (by itself or from outside)
+ local meta = minetest.get_meta(pos)
+ local L = {}
+ local n = meta:get_int("real_portstates") - 1
+ if n < 0 then
+ return legacy_update_ports(pos)
+ end
+ for _, index in ipairs({"a", "b", "c", "d"}) do
+ L[index] = ((n%2) == 1)
+ n = math.floor(n/2)
+ end
return L
end
diff --git a/mesecons_textures/textures/jeija_microcontroller_LED_A.png b/mesecons_microcontroller/textures/jeija_microcontroller_LED_A.png
index 64526cf..64526cf 100644
--- a/mesecons_textures/textures/jeija_microcontroller_LED_A.png
+++ b/mesecons_microcontroller/textures/jeija_microcontroller_LED_A.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_microcontroller_LED_B.png b/mesecons_microcontroller/textures/jeija_microcontroller_LED_B.png
index 1f7b451..1f7b451 100644
--- a/mesecons_textures/textures/jeija_microcontroller_LED_B.png
+++ b/mesecons_microcontroller/textures/jeija_microcontroller_LED_B.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_microcontroller_LED_C.png b/mesecons_microcontroller/textures/jeija_microcontroller_LED_C.png
index 399cc2c..399cc2c 100644
--- a/mesecons_textures/textures/jeija_microcontroller_LED_C.png
+++ b/mesecons_microcontroller/textures/jeija_microcontroller_LED_C.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_microcontroller_LED_D.png b/mesecons_microcontroller/textures/jeija_microcontroller_LED_D.png
index 506389c..506389c 100644
--- a/mesecons_textures/textures/jeija_microcontroller_LED_D.png
+++ b/mesecons_microcontroller/textures/jeija_microcontroller_LED_D.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_microcontroller_bottom.png b/mesecons_microcontroller/textures/jeija_microcontroller_bottom.png
index 3a9161e..3a9161e 100644
--- a/mesecons_textures/textures/jeija_microcontroller_bottom.png
+++ b/mesecons_microcontroller/textures/jeija_microcontroller_bottom.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_microcontroller_sides.png b/mesecons_microcontroller/textures/jeija_microcontroller_sides.png
index b367644..b367644 100644
--- a/mesecons_textures/textures/jeija_microcontroller_sides.png
+++ b/mesecons_microcontroller/textures/jeija_microcontroller_sides.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_microcontroller_top.png b/mesecons_microcontroller/textures/jeija_microcontroller_top.png
index 438c934..438c934 100644
--- a/mesecons_textures/textures/jeija_microcontroller_top.png
+++ b/mesecons_microcontroller/textures/jeija_microcontroller_top.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_movestone_arrows.png b/mesecons_movestones/textures/jeija_movestone_arrows.png
index 358c357..358c357 100644
--- a/mesecons_textures/textures/jeija_movestone_arrows.png
+++ b/mesecons_movestones/textures/jeija_movestone_arrows.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_movestone_side.png b/mesecons_movestones/textures/jeija_movestone_side.png
index de753ef..de753ef 100644
--- a/mesecons_textures/textures/jeija_movestone_side.png
+++ b/mesecons_movestones/textures/jeija_movestone_side.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_sticky_movestone.png b/mesecons_movestones/textures/jeija_sticky_movestone.png
index 8953cf1..8953cf1 100644
--- a/mesecons_textures/textures/jeija_sticky_movestone.png
+++ b/mesecons_movestones/textures/jeija_sticky_movestone.png
Binary files differ
diff --git a/mesecons_textures/textures/mesecons_piston_back.png b/mesecons_pistons/textures/mesecons_piston_back.png
index 6a57dce..6a57dce 100644
--- a/mesecons_textures/textures/mesecons_piston_back.png
+++ b/mesecons_pistons/textures/mesecons_piston_back.png
Binary files differ
diff --git a/mesecons_textures/textures/mesecons_piston_bottom.png b/mesecons_pistons/textures/mesecons_piston_bottom.png
index 5a3af9b..5a3af9b 100644
--- a/mesecons_textures/textures/mesecons_piston_bottom.png
+++ b/mesecons_pistons/textures/mesecons_piston_bottom.png
Binary files differ
diff --git a/mesecons_textures/textures/mesecons_piston_left.png b/mesecons_pistons/textures/mesecons_piston_left.png
index 215dd73..215dd73 100644
--- a/mesecons_textures/textures/mesecons_piston_left.png
+++ b/mesecons_pistons/textures/mesecons_piston_left.png
Binary files differ
diff --git a/mesecons_textures/textures/mesecons_piston_on_front.png b/mesecons_pistons/textures/mesecons_piston_on_front.png
index 0ade67e..0ade67e 100644
--- a/mesecons_textures/textures/mesecons_piston_on_front.png
+++ b/mesecons_pistons/textures/mesecons_piston_on_front.png
Binary files differ
diff --git a/mesecons_textures/textures/mesecons_piston_pusher_back.png b/mesecons_pistons/textures/mesecons_piston_pusher_back.png
index fe87943..fe87943 100644
--- a/mesecons_textures/textures/mesecons_piston_pusher_back.png
+++ b/mesecons_pistons/textures/mesecons_piston_pusher_back.png
Binary files differ
diff --git a/mesecons_textures/textures/mesecons_piston_pusher_bottom.png b/mesecons_pistons/textures/mesecons_piston_pusher_bottom.png
index 87c4e81..87c4e81 100644
--- a/mesecons_textures/textures/mesecons_piston_pusher_bottom.png
+++ b/mesecons_pistons/textures/mesecons_piston_pusher_bottom.png
Binary files differ
diff --git a/mesecons_textures/textures/mesecons_piston_pusher_front.png b/mesecons_pistons/textures/mesecons_piston_pusher_front.png
index 8ec9dc6..8ec9dc6 100644
--- a/mesecons_textures/textures/mesecons_piston_pusher_front.png
+++ b/mesecons_pistons/textures/mesecons_piston_pusher_front.png
Binary files differ
diff --git a/mesecons_textures/textures/mesecons_piston_pusher_front_sticky.png b/mesecons_pistons/textures/mesecons_piston_pusher_front_sticky.png
index e38b4e6..e38b4e6 100644
--- a/mesecons_textures/textures/mesecons_piston_pusher_front_sticky.png
+++ b/mesecons_pistons/textures/mesecons_piston_pusher_front_sticky.png
Binary files differ
diff --git a/mesecons_textures/textures/mesecons_piston_pusher_left.png b/mesecons_pistons/textures/mesecons_piston_pusher_left.png
index bc5495b..bc5495b 100644
--- a/mesecons_textures/textures/mesecons_piston_pusher_left.png
+++ b/mesecons_pistons/textures/mesecons_piston_pusher_left.png
Binary files differ
diff --git a/mesecons_textures/textures/mesecons_piston_pusher_right.png b/mesecons_pistons/textures/mesecons_piston_pusher_right.png
index 32ee32f..32ee32f 100644
--- a/mesecons_textures/textures/mesecons_piston_pusher_right.png
+++ b/mesecons_pistons/textures/mesecons_piston_pusher_right.png
Binary files differ
diff --git a/mesecons_textures/textures/mesecons_piston_pusher_top.png b/mesecons_pistons/textures/mesecons_piston_pusher_top.png
index 72f04e9..72f04e9 100644
--- a/mesecons_textures/textures/mesecons_piston_pusher_top.png
+++ b/mesecons_pistons/textures/mesecons_piston_pusher_top.png
Binary files differ
diff --git a/mesecons_textures/textures/mesecons_piston_right.png b/mesecons_pistons/textures/mesecons_piston_right.png
index 176463c..176463c 100644
--- a/mesecons_textures/textures/mesecons_piston_right.png
+++ b/mesecons_pistons/textures/mesecons_piston_right.png
Binary files differ
diff --git a/mesecons_textures/textures/mesecons_piston_top.png b/mesecons_pistons/textures/mesecons_piston_top.png
index 5c8bace..5c8bace 100644
--- a/mesecons_textures/textures/mesecons_piston_top.png
+++ b/mesecons_pistons/textures/mesecons_piston_top.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_power_plant.png b/mesecons_powerplant/textures/jeija_power_plant.png
index edc8891..edc8891 100644
--- a/mesecons_textures/textures/jeija_power_plant.png
+++ b/mesecons_powerplant/textures/jeija_power_plant.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_pressure_plate_stone_inv.png b/mesecons_pressureplates/textures/jeija_pressure_plate_stone_inv.png
index bfe5a1d..bfe5a1d 100644
--- a/mesecons_textures/textures/jeija_pressure_plate_stone_inv.png
+++ b/mesecons_pressureplates/textures/jeija_pressure_plate_stone_inv.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_pressure_plate_stone_off.png b/mesecons_pressureplates/textures/jeija_pressure_plate_stone_off.png
index 46140da..46140da 100644
--- a/mesecons_textures/textures/jeija_pressure_plate_stone_off.png
+++ b/mesecons_pressureplates/textures/jeija_pressure_plate_stone_off.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_pressure_plate_stone_off_edges.png b/mesecons_pressureplates/textures/jeija_pressure_plate_stone_off_edges.png
index 2ad9acc..2ad9acc 100644
--- a/mesecons_textures/textures/jeija_pressure_plate_stone_off_edges.png
+++ b/mesecons_pressureplates/textures/jeija_pressure_plate_stone_off_edges.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_pressure_plate_stone_on.png b/mesecons_pressureplates/textures/jeija_pressure_plate_stone_on.png
index dc64931..dc64931 100644
--- a/mesecons_textures/textures/jeija_pressure_plate_stone_on.png
+++ b/mesecons_pressureplates/textures/jeija_pressure_plate_stone_on.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_pressure_plate_stone_on_edges.png b/mesecons_pressureplates/textures/jeija_pressure_plate_stone_on_edges.png
index 51add95..51add95 100644
--- a/mesecons_textures/textures/jeija_pressure_plate_stone_on_edges.png
+++ b/mesecons_pressureplates/textures/jeija_pressure_plate_stone_on_edges.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_pressure_plate_stone_wield.png b/mesecons_pressureplates/textures/jeija_pressure_plate_stone_wield.png
index c533567..c533567 100644
--- a/mesecons_textures/textures/jeija_pressure_plate_stone_wield.png
+++ b/mesecons_pressureplates/textures/jeija_pressure_plate_stone_wield.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_pressure_plate_wood_inv.png b/mesecons_pressureplates/textures/jeija_pressure_plate_wood_inv.png
index 36dacd0..36dacd0 100644
--- a/mesecons_textures/textures/jeija_pressure_plate_wood_inv.png
+++ b/mesecons_pressureplates/textures/jeija_pressure_plate_wood_inv.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_pressure_plate_wood_off.png b/mesecons_pressureplates/textures/jeija_pressure_plate_wood_off.png
index ca98757..ca98757 100644
--- a/mesecons_textures/textures/jeija_pressure_plate_wood_off.png
+++ b/mesecons_pressureplates/textures/jeija_pressure_plate_wood_off.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_pressure_plate_wood_off_edges.png b/mesecons_pressureplates/textures/jeija_pressure_plate_wood_off_edges.png
index 665ae97..665ae97 100644
--- a/mesecons_textures/textures/jeija_pressure_plate_wood_off_edges.png
+++ b/mesecons_pressureplates/textures/jeija_pressure_plate_wood_off_edges.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_pressure_plate_wood_on.png b/mesecons_pressureplates/textures/jeija_pressure_plate_wood_on.png
index e1a7d8e..e1a7d8e 100644
--- a/mesecons_textures/textures/jeija_pressure_plate_wood_on.png
+++ b/mesecons_pressureplates/textures/jeija_pressure_plate_wood_on.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_pressure_plate_wood_on_edges.png b/mesecons_pressureplates/textures/jeija_pressure_plate_wood_on_edges.png
index 358f2ea..358f2ea 100644
--- a/mesecons_textures/textures/jeija_pressure_plate_wood_on_edges.png
+++ b/mesecons_pressureplates/textures/jeija_pressure_plate_wood_on_edges.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_pressure_plate_wood_wield.png b/mesecons_pressureplates/textures/jeija_pressure_plate_wood_wield.png
index 50b321d..50b321d 100644
--- a/mesecons_textures/textures/jeija_pressure_plate_wood_wield.png
+++ b/mesecons_pressureplates/textures/jeija_pressure_plate_wood_wield.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_ghoststone.png b/mesecons_random/textures/jeija_ghoststone.png
index 1917b7c..1917b7c 100644
--- a/mesecons_textures/textures/jeija_ghoststone.png
+++ b/mesecons_random/textures/jeija_ghoststone.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_ghoststone_inv.png b/mesecons_random/textures/jeija_ghoststone_inv.png
index c715d7f..c715d7f 100644
--- a/mesecons_textures/textures/jeija_ghoststone_inv.png
+++ b/mesecons_random/textures/jeija_ghoststone_inv.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_removestone.png b/mesecons_random/textures/jeija_removestone.png
index 1917b7c..1917b7c 100644
--- a/mesecons_textures/textures/jeija_removestone.png
+++ b/mesecons_random/textures/jeija_removestone.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_removestone_inv.png b/mesecons_random/textures/jeija_removestone_inv.png
index c715d7f..c715d7f 100644
--- a/mesecons_textures/textures/jeija_removestone_inv.png
+++ b/mesecons_random/textures/jeija_removestone_inv.png
Binary files differ
diff --git a/mesecons_textures/textures/receiver_bottom_off.png b/mesecons_receiver/textures/receiver_bottom_off.png
index b95903e..b95903e 100644
--- a/mesecons_textures/textures/receiver_bottom_off.png
+++ b/mesecons_receiver/textures/receiver_bottom_off.png
Binary files differ
diff --git a/mesecons_textures/textures/receiver_bottom_on.png b/mesecons_receiver/textures/receiver_bottom_on.png
index d0b7006..d0b7006 100644
--- a/mesecons_textures/textures/receiver_bottom_on.png
+++ b/mesecons_receiver/textures/receiver_bottom_on.png
Binary files differ
diff --git a/mesecons_textures/textures/receiver_fb_off.png b/mesecons_receiver/textures/receiver_fb_off.png
index aed3008..aed3008 100644
--- a/mesecons_textures/textures/receiver_fb_off.png
+++ b/mesecons_receiver/textures/receiver_fb_off.png
Binary files differ
diff --git a/mesecons_textures/textures/receiver_fb_on.png b/mesecons_receiver/textures/receiver_fb_on.png
index 0916736..0916736 100644
--- a/mesecons_textures/textures/receiver_fb_on.png
+++ b/mesecons_receiver/textures/receiver_fb_on.png
Binary files differ
diff --git a/mesecons_textures/textures/receiver_lr_off.png b/mesecons_receiver/textures/receiver_lr_off.png
index 1fb2b3a..1fb2b3a 100644
--- a/mesecons_textures/textures/receiver_lr_off.png
+++ b/mesecons_receiver/textures/receiver_lr_off.png
Binary files differ
diff --git a/mesecons_textures/textures/receiver_lr_on.png b/mesecons_receiver/textures/receiver_lr_on.png
index 087c0b4..087c0b4 100644
--- a/mesecons_textures/textures/receiver_lr_on.png
+++ b/mesecons_receiver/textures/receiver_lr_on.png
Binary files differ
diff --git a/mesecons_textures/textures/receiver_top_off.png b/mesecons_receiver/textures/receiver_top_off.png
index ae50106..ae50106 100644
--- a/mesecons_textures/textures/receiver_top_off.png
+++ b/mesecons_receiver/textures/receiver_top_off.png
Binary files differ
diff --git a/mesecons_textures/textures/receiver_top_on.png b/mesecons_receiver/textures/receiver_top_on.png
index 5b48cac..5b48cac 100644
--- a/mesecons_textures/textures/receiver_top_on.png
+++ b/mesecons_receiver/textures/receiver_top_on.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_solar_panel.png b/mesecons_solarpanel/textures/jeija_solar_panel.png
index a7b0f75..a7b0f75 100644
--- a/mesecons_textures/textures/jeija_solar_panel.png
+++ b/mesecons_solarpanel/textures/jeija_solar_panel.png
Binary files differ
diff --git a/mesecons_textures/init.lua b/mesecons_textures/init.lua
deleted file mode 100644
index 704eb9c..0000000
--- a/mesecons_textures/init.lua
+++ /dev/null
@@ -1 +0,0 @@
--- place texture packs for mesecons into the textures folder here
diff --git a/mesecons_textures/textures/jeija_battery_charging.png b/mesecons_textures/textures/jeija_battery_charging.png
deleted file mode 100644
index e91c4d5..0000000
--- a/mesecons_textures/textures/jeija_battery_charging.png
+++ /dev/null
Binary files differ
diff --git a/mesecons_textures/textures/jeija_battery_discharging.png b/mesecons_textures/textures/jeija_battery_discharging.png
deleted file mode 100644
index 724a36d..0000000
--- a/mesecons_textures/textures/jeija_battery_discharging.png
+++ /dev/null
Binary files differ
diff --git a/mesecons_textures/textures/jeija_torches_off.png b/mesecons_torch/textures/jeija_torches_off.png
index 537920c..537920c 100644
--- a/mesecons_textures/textures/jeija_torches_off.png
+++ b/mesecons_torch/textures/jeija_torches_off.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_torches_off_ceiling.png b/mesecons_torch/textures/jeija_torches_off_ceiling.png
index 3934e6e..3934e6e 100644
--- a/mesecons_textures/textures/jeija_torches_off_ceiling.png
+++ b/mesecons_torch/textures/jeija_torches_off_ceiling.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_torches_off_side.png b/mesecons_torch/textures/jeija_torches_off_side.png
index ecb2951..ecb2951 100644
--- a/mesecons_textures/textures/jeija_torches_off_side.png
+++ b/mesecons_torch/textures/jeija_torches_off_side.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_torches_on.png b/mesecons_torch/textures/jeija_torches_on.png
index a93dcc2..a93dcc2 100644
--- a/mesecons_textures/textures/jeija_torches_on.png
+++ b/mesecons_torch/textures/jeija_torches_on.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_torches_on_ceiling.png b/mesecons_torch/textures/jeija_torches_on_ceiling.png
index 24fe201..24fe201 100644
--- a/mesecons_textures/textures/jeija_torches_on_ceiling.png
+++ b/mesecons_torch/textures/jeija_torches_on_ceiling.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_torches_on_side.png b/mesecons_torch/textures/jeija_torches_on_side.png
index fe7dfd2..fe7dfd2 100644
--- a/mesecons_textures/textures/jeija_torches_on_side.png
+++ b/mesecons_torch/textures/jeija_torches_on_side.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_wall_lever_back.png b/mesecons_walllever/textures/jeija_wall_lever_back.png
index 9047e70..9047e70 100644
--- a/mesecons_textures/textures/jeija_wall_lever_back.png
+++ b/mesecons_walllever/textures/jeija_wall_lever_back.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_wall_lever_bottom.png b/mesecons_walllever/textures/jeija_wall_lever_bottom.png
index 041da96..041da96 100644
--- a/mesecons_textures/textures/jeija_wall_lever_bottom.png
+++ b/mesecons_walllever/textures/jeija_wall_lever_bottom.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_wall_lever_off.png b/mesecons_walllever/textures/jeija_wall_lever_off.png
index 474f8c1..474f8c1 100644
--- a/mesecons_textures/textures/jeija_wall_lever_off.png
+++ b/mesecons_walllever/textures/jeija_wall_lever_off.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_wall_lever_on.png b/mesecons_walllever/textures/jeija_wall_lever_on.png
index 01cbc24..01cbc24 100644
--- a/mesecons_textures/textures/jeija_wall_lever_on.png
+++ b/mesecons_walllever/textures/jeija_wall_lever_on.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_wall_lever_sides.png b/mesecons_walllever/textures/jeija_wall_lever_sides.png
index 5864f26..5864f26 100644
--- a/mesecons_textures/textures/jeija_wall_lever_sides.png
+++ b/mesecons_walllever/textures/jeija_wall_lever_sides.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_wall_lever_tb.png b/mesecons_walllever/textures/jeija_wall_lever_tb.png
index 50348d3..50348d3 100644
--- a/mesecons_textures/textures/jeija_wall_lever_tb.png
+++ b/mesecons_walllever/textures/jeija_wall_lever_tb.png
Binary files differ
diff --git a/mesecons_textures/textures/jeija_wall_lever_top.png b/mesecons_walllever/textures/jeija_wall_lever_top.png
index 31161ec..31161ec 100644
--- a/mesecons_textures/textures/jeija_wall_lever_top.png
+++ b/mesecons_walllever/textures/jeija_wall_lever_top.png
Binary files differ