getPumpkin Methode

This commit is contained in:
Mochaccino 2013-03-18 20:14:31 +01:00
parent 2ce47d7702
commit 443a3ca329

View File

@ -19,6 +19,7 @@ package de.craftinc.replicator;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.block.BlockFace; import org.bukkit.block.BlockFace;
import org.bukkit.Material;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import java.util.ArrayList; import java.util.ArrayList;
@ -79,4 +80,20 @@ public class Replicator {
return false; return false;
} }
private ArrayList<Location> getPumpkin(Location currentBlock){
ArrayList<Location> pumpkins = new ArrayList<Location>();
Location nextBlock;
for(int x=-1;x<=1;x++){
for(int y=-1;y<=1;y++){
for(int z=-1;z<=1;z++){
nextBlock = currentBlock.getBlock().getRelative(x,y,z).getLocation();
if(nextBlock.getBlock().getType().equals(Material.JACK_O_LANTERN)) pumpkins.add(nextBlock);
}
}
}
return pumpkins;
}
} }