Changed access of sheep, added ShepDeshearer.
This commit is contained in:
parent
65122cc098
commit
76bded66df
@ -26,11 +26,15 @@ public final class DiscoSheep extends JavaPlugin {
|
|||||||
// Watashi Wa Kawaii, Ne?
|
// Watashi Wa Kawaii, Ne?
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ArrayList<Sheep> getSheep(){
|
||||||
|
return sheepArray;
|
||||||
|
}
|
||||||
|
|
||||||
void spawnSheep(World world, Location loc) {
|
void spawnSheep(World world, Location loc) {
|
||||||
Sheep newSheep = (Sheep) world.spawnEntity(loc, EntityType.SHEEP);
|
Sheep newSheep = (Sheep) world.spawnEntity(loc, EntityType.SHEEP);
|
||||||
newSheep.setMaxHealth(10000);
|
newSheep.setMaxHealth(10000);
|
||||||
newSheep.setHealth(10000);
|
newSheep.setHealth(10000);
|
||||||
sheepArray.add(newSheep);
|
getSheep().add(newSheep);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Spawn some number of sheep next to given player
|
// Spawn some number of sheep next to given player
|
||||||
@ -53,15 +57,15 @@ public final class DiscoSheep extends JavaPlugin {
|
|||||||
|
|
||||||
// Mark all sheep in the sheep array for removal, then clear the array
|
// Mark all sheep in the sheep array for removal, then clear the array
|
||||||
void removeAllSheep() {
|
void removeAllSheep() {
|
||||||
for (int i = 0; i < sheepArray.size(); i++) {
|
for (Sheep sheep: getSheep()) {
|
||||||
sheepArray.get(i).remove();
|
sheep.remove();
|
||||||
}
|
}
|
||||||
sheepArray.clear();
|
getSheep().clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Cycle colours of all sheep in the array
|
// Cycle colours of all sheep in the array
|
||||||
void cycleSheepColours() {
|
void cycleSheepColours() {
|
||||||
for (int i = 0; i < sheepArray.size(); i++) {
|
for (Sheep shep : getSheep()) {
|
||||||
//sheepArray.get(i) something something
|
//sheepArray.get(i) something something
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
17
src/gibstick/bukkit/discosheep/SheepDeshearer.java
Normal file
17
src/gibstick/bukkit/discosheep/SheepDeshearer.java
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
/*
|
||||||
|
* To change this template, choose Tools | Templates
|
||||||
|
* and open the template in the editor.
|
||||||
|
*/
|
||||||
|
package gibstick.bukkit.discosheep;
|
||||||
|
|
||||||
|
import org.bukkit.event.Listener;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author Mauve
|
||||||
|
*/
|
||||||
|
public class SheepDeshearer implements Listener{
|
||||||
|
public SheepDeshearer(DiscoSheep parent){
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user