All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.bukkit.craftbukkit.entity.CraftWolf Maven / Gradle / Ivy

There is a newer version: 2.4.0
Show newest version
package org.bukkit.craftbukkit.entity;

import net.minecraft.server.EntityWolf;
import net.minecraft.server.EnumColor;
import org.bukkit.DyeColor;
import org.bukkit.craftbukkit.CraftServer;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Wolf;

public class CraftWolf extends CraftTameableAnimal implements Wolf {
  public CraftWolf(CraftServer server, EntityWolf wolf) {
    super(server, wolf);
  }

  public boolean isAngry() {
    return getHandle().isAngry();
  }

  public void setAngry(boolean angry) {
    getHandle().setAngry(angry);
  }

  @Override
  public EntityWolf getHandle() {
    return (EntityWolf) entity;
  }

  @Override
  public EntityType getType() {
    return EntityType.WOLF;
  }

  public DyeColor getCollarColor() {
    return DyeColor.getByWoolData((byte) getHandle().getCollarColor().getColorIndex());
  }

  public void setCollarColor(DyeColor color) {
    getHandle().setCollarColor(EnumColor.fromColorIndex(color.getWoolData()));
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy