12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- event.load("block_click");
- event.load("explosion");
- all_signs_tag = block.getTag("minecraft:all_signs");
- msg.string("dev", "§bPlots §rloaded.");
- @wait
- wait();
- ignoreGoto(event);
- goto("wait");
- @explosion
- entity_loc = entity.getLocation(entity);
- plot_list = plot.get(entity_loc);
- plot_amount = list.getSize(plot_list);
- for(i = 0; i < plot_amount; i++) {
- plot = list.getIndex(plot_list, i);
- if(plot.isExplosive(plot)) {
- cancel = false;
- } else {
- cancel = true;
- break;
- }
- }
- // no explosions in crea world
- world_name = world.getName(loc.getWorld(entity_loc));
- if(world.isCreativeName(world_name)) {
- goto("wait");
- }
- // if no plot exists allow explosions
- if(plot_amount == 0) {
- cancel = false;
- }
- goto("wait");
- @block_click
- if(action != "RIGHT_CLICK_BLOCK") {
- goto("wait");
- }
- if(!block.hasTag(block, all_signs_tag)) {
- goto("wait");
- }
- plot_list = plot.get(block.getLocation(block));
- plot_amount = list.getSize(plot_list);
- for(i = 0; i < plot_amount; i++) {
- plot = list.getIndex(plot_list, i);
- if(plot.hasDisabledSigns(plot)) {
- cancel = true;
- break;
- } else {
- cancel = false;
- }
- }
- //Kein Grundstück existiert
- if(plot_amount == 0) {
- cancel = false;
- }
- goto("wait");
|