Add a way to get and set the bounding box of disguises

This commit is contained in:
libraryaddict
2013-12-22 12:36:06 +13:00
parent 06cb677446
commit 686b25d59b
4 changed files with 132 additions and 0 deletions

View File

@@ -25,6 +25,7 @@ import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.entity.Ageable;
import org.bukkit.entity.Entity;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Zombie;
import org.bukkit.plugin.java.JavaPlugin;
import com.comphenix.protocol.wrappers.WrappedDataWatcher;
@@ -207,6 +208,17 @@ public class LibsDisguises extends JavaPlugin {
sound.setDamageSoundVolume((Float) soundStrength);
}
}
// Get the bounding box
disguiseValues.setAdultBox(ReflectionManager.getBoundingBox(bukkitEntity));
if (bukkitEntity instanceof Ageable) {
((Ageable) bukkitEntity).setBaby();
disguiseValues.setBabyBox(ReflectionManager.getBoundingBox(bukkitEntity));
} else if (bukkitEntity instanceof Zombie) {
((Zombie) bukkitEntity).setBaby(true);
disguiseValues.setBabyBox(ReflectionManager.getBoundingBox(bukkitEntity));
}
} catch (Exception ex) {
System.out.print("[LibsDisguises] Uh oh! Trouble while making values for the disguise " + disguiseType.name()
+ "!");