本文整理匯總了Java中com.dsh105.echopet.compat.api.entity.IEntityNoClipPet類的典型用法代碼示例。如果您正苦於以下問題:Java IEntityNoClipPet類的具體用法?Java IEntityNoClipPet怎麽用?Java IEntityNoClipPet使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
IEntityNoClipPet類屬於com.dsh105.echopet.compat.api.entity包,在下文中一共展示了IEntityNoClipPet類的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: ownerRidePet
import com.dsh105.echopet.compat.api.entity.IEntityNoClipPet; //導入依賴的package包/類
@Override
public void ownerRidePet(boolean flag) {
if (this.ownerRiding == flag) {
return;
}
this.ownerIsMounting = true;
if (this.isHat) {
this.setAsHat(false);
}
// Ew...This stuff is UGLY :c
if (!flag) {
INMS.getInstance().mount(this.getOwner(), null);
//((CraftPlayer) this.getOwner()).getHandle().mount(null);
if (this.getEntityPet() instanceof IEntityNoClipPet) {
((IEntityNoClipPet) this.getEntityPet()).noClip(true);
}
ownerIsMounting = false;
} else {
if (this.getRider() != null) {
this.getRider().removePet(false);
}
new BukkitRunnable() {
@Override
public void run() {
INMS.getInstance().mount(getOwner(), getEntityPet().getBukkitEntity());
//((CraftPlayer) getOwner()).getHandle().mount(getEntityPet());
ownerIsMounting = false;
if (getEntityPet() instanceof IEntityNoClipPet) {
((IEntityNoClipPet) getEntityPet()).noClip(false);
}
}
}.runTaskLater(EchoPet.getPlugin(), 5L);
}
this.teleportToOwner();
this.getEntityPet().resizeBoundingBox(flag);
this.ownerRiding = flag;
Particle.PORTAL.show(getLocation());
Location l = this.getLocation().clone();
l.setY(l.getY() - 1D);
ParticleBuilder builder = Particle.BLOCK_DUST.builder();
builder.setBlockType(l.getBlock().getType());
builder.setPosition(getLocation());
builder.show();
}