|
| 1 | +#ifndef __BLING_EDIT_H |
| 2 | +#define __BLING_EDIT_H |
| 3 | + |
| 4 | +#include <entity.h> |
| 5 | +#include <text.h> |
| 6 | +#include <mclib.h> |
| 7 | + |
| 8 | +entity_local disp_plugins; |
| 9 | + |
| 10 | +// Strange syntax, but this allows the entity_local to be attached to the player named "Global" |
| 11 | +entity_local plugin_can_run = "Global"; |
| 12 | +entity_local loaded = "Global"; |
| 13 | + |
| 14 | +entity_local box_xmin = "Global"; |
| 15 | +entity_local box_ymin = "Global"; |
| 16 | +entity_local box_zmin = "Global"; |
| 17 | +entity_local box_xmax = "Global"; |
| 18 | +entity_local box_ymax = "Global"; |
| 19 | +entity_local box_zmax = "Global"; |
| 20 | + |
| 21 | +entity_local box_center_x = "Global"; |
| 22 | +entity_local box_center_y = "Global"; |
| 23 | +entity_local box_center_z = "Global"; |
| 24 | + |
| 25 | +entity_local box_size_x = "Global"; |
| 26 | +entity_local box_size_y = "Global"; |
| 27 | +entity_local box_size_z = "Global"; |
| 28 | + |
| 29 | +entity_local rx1 = "Global"; |
| 30 | +entity_local ry1 = "Global"; |
| 31 | +entity_local rz1 = "Global"; |
| 32 | +entity_local rx2 = "Global"; |
| 33 | +entity_local ry2 = "Global"; |
| 34 | +entity_local rz2 = "Global"; |
| 35 | + |
| 36 | +void run_plugin(); |
| 37 | + |
| 38 | +int blingedit_plugin_can_run() |
| 39 | +{ |
| 40 | + CMD(function blingedit:plugin_can_run); |
| 41 | + return plugin_can_run; |
| 42 | +} |
| 43 | + |
| 44 | +int blingedit_check_loaded() |
| 45 | +{ |
| 46 | + CMD(function blingedit:check_loaded); |
| 47 | + return loaded; |
| 48 | +} |
| 49 | + |
| 50 | +void click_handler() |
| 51 | +{ |
| 52 | + if (blingedit_plugin_can_run()) { |
| 53 | + run_plugin(); |
| 54 | + } |
| 55 | + CMD(gamerule sendCommandFeedback false); |
| 56 | +} |
| 57 | + |
| 58 | +EVENT(minecraft:tick,, tick_handler) |
| 59 | +{ |
| 60 | + select_players(sel_variable(disp_plugins >= 1)) { |
| 61 | + text_begin(); |
| 62 | + text_begin(); |
| 63 | + text_set_text(__str_quote([PLUGIN_NAME])); |
| 64 | + text_set_color("aqua"); |
| 65 | + text_set_click_run(click_handler); |
| 66 | + text_end(TEXT_APPEND_PARENT); |
| 67 | + text_begin(); |
| 68 | + text_set_text(" - by "); |
| 69 | + text_set_color("white"); |
| 70 | + text_end(TEXT_APPEND_PARENT); |
| 71 | + text_begin(); |
| 72 | + text_set_text(__str_quote(PLUGIN_AUTHOR)); |
| 73 | + text_set_color("red"); |
| 74 | +#ifdef PLUGIN_URL |
| 75 | + text_set_click_url(__str_quote(PLUGIN_URL)); |
| 76 | +#endif |
| 77 | + text_end(TEXT_APPEND_PARENT); |
| 78 | + text_end(TEXT_TELLRAW); |
| 79 | + } |
| 80 | +} |
| 81 | + |
| 82 | +#endif /* __BLING_EDIT_H */ |
0 commit comments