Created
March 20, 2013 21:09
-
-
Save tehbeard/5208456 to your computer and use it in GitHub Desktop.
test plugin for redstone command block
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.tehbeard.test; | |
| import org.bukkit.block.CommandBlock; | |
| import org.bukkit.command.BlockCommandSender; | |
| import org.bukkit.command.Command; | |
| import org.bukkit.command.CommandSender; | |
| import org.bukkit.plugin.java.JavaPlugin; | |
| public class TestCommandBlockRedstonePlugin extends JavaPlugin { | |
| @Override | |
| public boolean onCommand(CommandSender sender, Command command, | |
| String label, String[] args) { | |
| if(sender instanceof BlockCommandSender){ | |
| CommandBlock cb = (CommandBlock) ((BlockCommandSender)sender).getBlock().getState(); | |
| int level = Integer.parseInt(args[0]); | |
| cb.setRedstoneLevel(level); | |
| cb.update(true); | |
| return true; | |
| } | |
| return false; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment