我有这个代码:
public void onPlayerInteract(PlayerInteractEvent event) {
final Action action = event.getAction();
if (action == Action.LEFT_CLICK_BLOCK){
Location l1 = event.getClickedBlock().getLocation();
} else if (action == Action.RIGHT_CLICK_BLOCK) {
Location l2 = event.getClickedBlock().getLocation();
}
Thread t = new Thread() {
@Override
public void run() {
while(true) {
try {
Thread.sleep(1000*60*60);
//Insert code here
} catch (InterruptedException ie) {
}
}
}
};
t.start();
我如何l1
访问//insert code here
?