/*
 * Copyright 2015 TENTO, Mincra, Ralph
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package jp.mcedu.mincra.restriction.listener;

import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.block.BlockPistonExtendEvent;
import org.bukkit.event.block.BlockRedstoneEvent;
import org.bukkit.event.weather.WeatherChangeEvent;

public class RestrictionListener implements Listener {
    /**
     * Redstone信号を無効化
     */
    @EventHandler
    public void onRedstone(BlockRedstoneEvent event) {
        switch (event.getBlock().getType()) {
            case REDSTONE_TORCH_OFF:
            case REDSTONE_TORCH_ON:
                event.setNewCurrent(1);
                break;
            default:
                event.setNewCurrent(0);
                break;
        }
    }

    /**
     * 天気の変化をなくす(晴れのみに)
     */
    @EventHandler
    public void onWeatherChange(WeatherChangeEvent event) {
        if (event.toWeatherState()) {
            event.setCancelled(true);
        }
    }

    /**
     * ピストンのイベントを無効化
     */
    @EventHandler
    public void onPiston(BlockPistonExtendEvent event) {
        event.setCancelled(true);
    }
}

@@ -747,38 +747,17 @@
 t.block.
-BlockPistonExtendEvent
+*
 ;%0Aimport
@@ -778,26 +778,27 @@
 ent.
-block.BlockRedston
+entity.EntityExplod
 eEve
@@ -1665,11 +1665,599 @@
 );%0A    %7D
+%0A%0A    /**%0A     * %E7%88%86%E7%99%BA%E3%82%A4%E3%83%99%E3%83%B3%E3%83%88%E3%82%92%E7%84%A1%E5%8A%B9%E5%8C%96%0A     */%0A    @EventHandler%0A    public void onEntityExplode(EntityExplodeEvent event) %7B%0A        event.setCancelled(true);%0A    %7D%0A%0A    /**%0A     * %E7%82%8E%E3%81%AB%E3%82%88%E3%82%8B%E3%83%96%E3%83%AD%E3%83%83%E3%82%AF%E6%B6%88%E6%BB%85%E3%82%92%E9%98%B2%E6%AD%A2%0A     */%0A    @EventHandler%0A    public void onBurn(BlockBurnEvent event) %7B%0A        event.setCancelled(true);%0A    %7D%0A%0A    /**%0A     * %E7%82%8E%E3%81%AE%E5%BB%B6%E7%84%BC%E3%82%92%E9%98%B2%E6%AD%A2%0A     */%0A    @EventHandler%0A    public void onFireSpread(BlockSpreadEvent event) %7B%0A        event.setCancelled(true);%0A    %7D%0A%0A    /**%0A     * %E7%82%8E%E3%81%AE%E6%B6%88%E6%BB%85%E3%83%BB%E6%B0%B7%E3%81%AE%E8%9E%8D%E8%A7%A3%E3%82%92%E9%98%B2%E6%AD%A2%0A     */%0A    @EventHandler%0A    public void onBlockFade(BlockFadeEvent event) %7B%0A        event.setCancelled(true);%0A    %7D
 %0A%7D%0A

Disable fire events