Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class NoWeatherHook implements PluginInterface{
- NoWeatherListener nwl;
- public NoWeatherHook(NoWeatherListener nw){ nwl = nw; }
- public String getName(){
- return "NoWeather";
- }
- public int getNumParameters() {
- return 2;
- }
- public String checkParameters(Object[] os) {
- if ((os.length < 1) || (os.length > getNumParameters())) {
- return "Invalid amount of parameters.";
- }
- return null;
- }
- public Object run(Object[] os) {
- String type = (String)os[0];
- if(type.equalsIgnoreCase("CHECK")){
- if (nwl.prevrain){
- return true;
- }else{
- return false;
- }
- }else if (type.equalsIgnoreCase("SET")){
- Boolean b = (Boolean)os[1];
- if (b){
- nwl.prevrain = true;
- }else{
- nwl.prevrain = false;
- }
- }
- return null;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment