Gamebuster icon

EffGoToURL.class

Gamebuster | PRO | 12/27/15 01:44:18 AM UTC | 0 ⭐ | 880 👁️ | Never ⏰ | []
Java |

1.19 KB

|

None

|

0 👍

/

0 👎

package com.gamebuster19901.GameBuSK.effects;
 
import org.bukkit.event.Event;
 
import com.google.common.collect.Iterables;
 
import ch.njol.skript.lang.Effect;
import ch.njol.skript.lang.Expression;
import ch.njol.skript.lang.SkriptParser.ParseResult;
import ch.njol.util.Kleenean;
 
public class EffGoToURL extends Effect {
    private Expression<GWebDriver> browser;
    private Expression<String> URL;
 
    @SuppressWarnings("unchecked")
    @Override
    public boolean init(Expression<?>[] expr, int matchedPattern, Kleenean paramKleenean,
            ParseResult paramParseResult) {
        // TODO Auto-generated method stub
        browser = (Expression<GWebDriver>) expr[0];
        URL = (Expression<String>) expr[1];
        return true;
    }
 
    @Override
    public String toString(Event paramEvent, boolean paramBoolean) {
        // TODO Auto-generated method stub
        return "close window";
    }
 
    @Override
    protected void execute(Event paramEvent) {
        // TODO Auto-generated method stub
        GWebDriver locBrowser = browser.getSingle(paramEvent); //This does not work, getSingle attempts to cast my GWebBrowser as a string, and that is currently not possible
        String locUrl = URL.getSingle(paramEvent);
        locBrowser.goTo(locUrl);
    }
}

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎