package net.glowstone.entity.passive;

import static com.google.common.base.Preconditions.checkNotNull;

import com.google.common.collect.ImmutableBiMap;
import java.util.concurrent.ThreadLocalRandom;
import net.glowstone.entity.GlowAnimal;
import net.glowstone.entity.meta.MetadataIndex;
import org.bukkit.Location;
import org.bukkit.Sound;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Rabbit;

public class GlowRabbit extends GlowAnimal implements Rabbit {

    private static final ImmutableBiMap<Type, Integer> rabbitTypeIntegerMap = ImmutableBiMap.<Type, Integer>builder()
        .put(Type.BROWN, 0)
        .put(Type.WHITE, 1)
        .put(Type.BLACK, 2)
        .put(Type.BLACK_AND_WHITE, 3)
        .put(Type.GOLD, 4)
        .put(Type.SALT_AND_PEPPER, 5)
        .put(Type.THE_KILLER_BUNNY, 99)
        .build();

    private Type rabbitType;

    public GlowRabbit(Location location) {
        super(location, EntityType.RABBIT, 3);
        setSize(0.4F, 0.5F);
        setRabbitType(
            Type.values()[ThreadLocalRandom.current().nextInt(rabbitTypeIntegerMap.size())]);
    }

    @Override
    public Type getRabbitType() {
        return rabbitType;
    }

    @Override
    public void setRabbitType(Type type) {
        checkNotNull(type, "Cannot set a null rabbit type!");
        metadata.set(MetadataIndex.RABBIT_TYPE, rabbitTypeIntegerMap.get(type).byteValue());
        rabbitType = type;
    }

    @Override
    protected Sound getHurtSound() {
        return Sound.ENTITY_RABBIT_HURT;
    }

    @Override
    protected Sound getDeathSound() {
        return Sound.ENTITY_RABBIT_DEATH;
    }

    @Override
    protected Sound getAmbientSound() {
        return Sound.ENTITY_RABBIT_AMBIENT;
    }
}

@@ -562,16 +562,29 @@
 bleBiMap
+%0A            
 .%3CType, 
@@ -601,32 +601,36 @@
 ilder()%0A        
+    
 .put(Type.BROWN,
@@ -633,32 +633,36 @@
 OWN, 0)%0A        
+  
+  
 .put(Type.WHITE,
@@ -665,32 +665,36 @@
 ITE, 1)%0A        
+   
+ 
 .put(Type.BLACK,
@@ -697,32 +697,36 @@
 ACK, 2)%0A        
+   
+ 
 .put(Type.BLACK_
@@ -739,32 +739,36 @@
 ITE, 3)%0A        
+    
 .put(Type.GOLD, 
@@ -770,16 +770,20 @@
 OLD, 4)%0A
+    
         
@@ -812,32 +812,36 @@
 PER, 5)%0A        
+    
 .put(Type.THE_KI
@@ -856,16 +856,20 @@
 NY, 99)%0A
+    
         
@@ -909,16 +909,117 @@
 tType;%0A%0A
+    /**%0A     * Creates a rabbit of a random type.%0A     *%0A     * @param location the location%0A     */%0A
     publ

Fix CheckStyle issues in entity/passive/GlowRabbit.java (#775)