Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void start() {
- new BukkitRunnable() {
- @Override
- public void run() {
- if (!getZombies().isEmpty()) {
- for (LawnTile tile : tiles) {
- if (tile.isPlantHere()) {
- Plant plant = tile.getPlant();
- if (plant.getType().getDelay() != 0) {
- if(plant.canShoot()) {
- new BukkitRunnable() {
- @Override
- public void run() {
- plant.shoot();
- plant.resetDelay();
- }
- }.runTaskLater(PlantsVsZombies.getInstance(), 1);
- } else {
- plant.addDelay(20);
- }
- }
- }
- }
- }
- if(lawn == null) this.cancel();
- }
- }.runTaskTimerAsynchronously(PlantsVsZombies.getInstance(), 0, 20);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement