/*
 * 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.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);
        }
    }
}

@@ -713,24 +713,78 @@
 t.Listener;%0A
+import org.bukkit.event.block.BlockPistonExtendEvent;%0A
 import org.b
@@ -1350,10 +1350,8 @@
 %E5%8C%96%E3%82%92%E3%81%AA%E3%81%8F
-%E3%81%97%E3%81%BE
 %E3%81%99(%E6%99%B4%E3%82%8C
@@ -1532,11 +1532,164 @@
  %7D%0A    %7D
+%0A%0A    /**%0A     * %E3%83%94%E3%82%B9%E3%83%88%E3%83%B3%E3%81%AE%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 onPiston(BlockPistonExtendEvent event) %7B%0A        event.setCancelled(true);%0A    %7D
 %0A%7D%0A

Disable piston