本文整理了Java中org.bukkit.entity.Entity.setPassenger()
方法的一些代码示例,展示了Entity.setPassenger()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Entity.setPassenger()
方法的具体详情如下:
包路径:org.bukkit.entity.Entity
类名称:Entity
方法名:setPassenger
[英]Set the passenger of a vehicle.
[中]设置车辆的乘客。
代码示例来源:origin: CitizensDev/CitizensAPI
@Override
public void run() {
entity.setPassenger(passenger);
}
};
代码示例来源:origin: NoCheatPlus/NoCheatPlus
@SuppressWarnings("deprecation")
@Override
public boolean addPassenger(final Entity entity, final Entity vehicle) {
return vehicle.setPassenger(entity);
}
代码示例来源:origin: elBukkit/MagicPlugin
public static void setPassenger(Entity mount, Entity passenger) {
// TODO: Use addPassenger
mount.setPassenger(passenger);
}
代码示例来源:origin: bergerkiller/BKCommonLib
@Override
public boolean setPassenger(Entity arg0) {
return base.setPassenger(arg0);
}
代码示例来源:origin: bergerkiller/BKCommonLib
/**
* Sets the passenger of this Vehicle, while throwing possible events
* If the previous passenger could not eject, or if entering didn't happen, False is returned.
*
* @param passenger to set to
* @return True if the passenger was successfully set, False if not
*/
public boolean setPassenger(org.bukkit.entity.Entity passenger) {
return passenger == null ? entity.eject() : entity.setPassenger(passenger);
}
代码示例来源:origin: bergerkiller/BKCommonLib
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
private void onVehicleEnter(final VehicleEnterEvent event) {
// Set the vehicle and passenger handles for Hook entities
// This is required to avoid problems with replaced Entities
if (CommonNMS.getNative(event.getVehicle()).dead) {
// Find the real Entity and redirect the call
final org.bukkit.entity.Entity realVehicle = EntityUtil.getEntity(event.getEntered().getWorld(), event.getVehicle().getUniqueId());
if (realVehicle != null && realVehicle != event.getVehicle()) {
// Perform the event again for the right Bukkit entity/Handle
event.setCancelled(true);
realVehicle.setPassenger(event.getEntered());
}
}
}
代码示例来源:origin: EngineHub/CommandBook
|| CommandBook.inst().hasPermission(player, target.getWorld(), permString)) {
success = success && vehicle.teleport(player);
vehicle.setPassenger(player);
代码示例来源:origin: elBukkit/MagicPlugin
mountEntity.setPassenger(mage.getEntity());
mountEntity.setMetadata("notarget", new FixedMetadataValue(controller.getPlugin(), true));
mountEntity.setMetadata("broom", new FixedMetadataValue(controller.getPlugin(), true));
代码示例来源:origin: elBukkit/MagicPlugin
mountEntity.setPassenger(null);
mountEntity.removeMetadata("notarget", plugin);
mountEntity.removeMetadata("broom", plugin);
内容来源于网络,如有侵权,请联系作者删除!