Fixed random colours, bumped up version number

This commit is contained in:
Charlie Wang 2013-06-30 18:27:03 -04:00
parent 2a802cfe81
commit e83031769b
2 changed files with 3 additions and 4 deletions

View File

@ -9,7 +9,6 @@ import org.bukkit.World;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import org.bukkit.entity.Sheep;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.java.JavaPlugin;
public final class DiscoSheep extends JavaPlugin {
@ -60,7 +59,7 @@ public final class DiscoSheep extends JavaPlugin {
Sheep newSheep = (Sheep) world.spawnEntity(loc, EntityType.SHEEP);
newSheep.setMaxHealth(10000);
newSheep.setHealth(10000);
newSheep.setColor(discoColours[(int) Math.random() * discoColours.length]);
newSheep.setColor(discoColours[(int)Math.round(Math.random() * (discoColours.length - 1))]);
getSheep().add(newSheep);
}
@ -94,7 +93,7 @@ public final class DiscoSheep extends JavaPlugin {
// Set a random colour for all sheep in array
void randomizeSheepColours() {
for (Sheep sheep : getSheep()) {
sheep.setColor(discoColours[(int) Math.random() * discoColours.length]);
sheep.setColor(discoColours[(int)Math.round(Math.random() * (discoColours.length - 1))]);
}
}

View File

@ -1,6 +1,6 @@
name: DiscoSheep
main: gibstick.bukkit.discosheep.DiscoSheep
version: 0.7
version: 0.9
commands:
ds:
description: "Main DiscoSheep command"