Следуйте инструкциям в видео ниже, чтобы узнать, как установить наш сайт как веб-приложение на главный экран вашего устройства.
Примечание: Эта функция может быть недоступна в некоторых браузерах.
Эм.. У себя спроси.Мне нужно только само откидывание?
Себя спроси что-ли ?
Да не, нормально все, тебе просто кажется)Без "?"))
player.setVelcotity(new Vector(x, y, z));
Проверяй игроков рядом, getNearbyEntitiesА как сделать, чтобы откидывало от меня, если игрок в 7 блоках от меня!
Проверяй игроков рядом, getNearbyEntities
public static boolean isInRadius(Player player, Player target, double radius) {
if(!target.getLocation().getWorld().equals(player.getLocation().getWorld())) {
return false;
}
return player.getLocation().distanceSquared(target.getLocation()) <= (radius * radius);
}
Collection<? extends Player> online = Bukkit.getOnlinePlayers();
if (isInRadius(p, (Player) online, 7)) {
}
НетКод:public static boolean isInRadius(Player player, Player target, double radius) { if(!target.getLocation().getWorld().equals(player.getLocation().getWorld())) { return false; } return player.getLocation().distanceSquared(target.getLocation()) <= (radius * radius); }
Код:Collection<? extends Player> online = Bukkit.getOnlinePlayers(); if (isInRadius(p, (Player) online, 7)) { }
Правильно?
public void run()
{
for (Player player : Bukkit.getServer().getOnlinePlayers()) {
if (this.m.contains(player)) {
for (Player player2 : Bukkit.getServer().getOnlinePlayers()) {
if (!player.equals(player2)) {
if (a(player2, player) <= this.e)
{
if (player2.getGameMode() == GameMode.SPECTATOR) {
return;
}
if (player2.hasPermission(this.a)) {
return;
}
for (Object vehicle = player2; ((Entity)vehicle).getVehicle() != null; vehicle = ((Entity)vehicle).getVehicle()) {}
a((Entity)vehicle, b(player, (Entity)vehicle), 1.6D, true, 0.8D, 0.0D, 10.0D);
if (!this.i) {
return;
}
player2.getWorld().playSound(player2.getLocation(), Sound.valueOf(this.j), (float)this.k, (float)this.l);
}
}
}
}
}
}
public double a(Entity entity, Entity entity2)
{
return entity.getLocation().toVector().subtract(entity2.getLocation().toVector()).length();
}
public Vector b(Entity entity, Entity entity2)
{
return entity2.getLocation().toVector().subtract(entity.getLocation().toVector()).setY(0).normalize();
}
public void a(Entity entity, Vector velocity, double n, boolean b, double y, double n2, double y2)
{
if ((Double.isNaN(velocity.getX())) || (Double.isNaN(velocity.getY())) || (Double.isNaN(velocity.getZ())) || (velocity.length() == 0.0D)) {
return;
}
if (b) {
velocity.setY(y);
}
velocity.normalize();
velocity.multiply(n);
velocity.setY(velocity.getY() + n2);
if (velocity.getY() > y2) {
velocity.setY(y2);
}
entity.setFallDistance(0.0F);
entity.setVelocity(velocity);
}
public void a()
{
this.a = getConfig().getString("IgnorePermisison");
this.b = getConfig().getString("UsePermission");
this.c = getConfig().getString("ReloadPermission");
this.d = getConfig().getString("ConfigReloaded");
this.e = getConfig().getInt("Range");
this.f = getConfig().getString("NoPermMessage");
this.g = getConfig().getString("Enabled");
this.h = getConfig().getString("Disabled");
this.i = getConfig().getBoolean("EnableSound");
this.j = getConfig().getString("Sound");
this.k = getConfig().getInt("Volume");
this.l = getConfig().getInt("Pitch");
}
}

названия переменных збсЯ уже понял
Код:public void run() { for (Player player : Bukkit.getServer().getOnlinePlayers()) { if (this.m.contains(player)) { for (Player player2 : Bukkit.getServer().getOnlinePlayers()) { if (!player.equals(player2)) { if (a(player2, player) <= this.e) { if (player2.getGameMode() == GameMode.SPECTATOR) { return; } if (player2.hasPermission(this.a)) { return; } for (Object vehicle = player2; ((Entity)vehicle).getVehicle() != null; vehicle = ((Entity)vehicle).getVehicle()) {} a((Entity)vehicle, b(player, (Entity)vehicle), 1.6D, true, 0.8D, 0.0D, 10.0D); if (!this.i) { return; } player2.getWorld().playSound(player2.getLocation(), Sound.valueOf(this.j), (float)this.k, (float)this.l); } } } } } } public double a(Entity entity, Entity entity2) { return entity.getLocation().toVector().subtract(entity2.getLocation().toVector()).length(); } public Vector b(Entity entity, Entity entity2) { return entity2.getLocation().toVector().subtract(entity.getLocation().toVector()).setY(0).normalize(); } public void a(Entity entity, Vector velocity, double n, boolean b, double y, double n2, double y2) { if ((Double.isNaN(velocity.getX())) || (Double.isNaN(velocity.getY())) || (Double.isNaN(velocity.getZ())) || (velocity.length() == 0.0D)) { return; } if (b) { velocity.setY(y); } velocity.normalize(); velocity.multiply(n); velocity.setY(velocity.getY() + n2); if (velocity.getY() > y2) { velocity.setY(y2); } entity.setFallDistance(0.0F); entity.setVelocity(velocity); } public void a() { this.a = getConfig().getString("IgnorePermisison"); this.b = getConfig().getString("UsePermission"); this.c = getConfig().getString("ReloadPermission"); this.d = getConfig().getString("ConfigReloaded"); this.e = getConfig().getInt("Range"); this.f = getConfig().getString("NoPermMessage"); this.g = getConfig().getString("Enabled"); this.h = getConfig().getString("Disabled"); this.i = getConfig().getBoolean("EnableSound"); this.j = getConfig().getString("Sound"); this.k = getConfig().getInt("Volume"); this.l = getConfig().getInt("Pitch"); } }
почему ошибка в 16 строке (a((Entity)vehicle, b(player, (Entity)vehicle), 1.6D, true, 0.8D, 0.0D, 10.0D)
Подчёркивает <<vehicle>>
"Обфускация"названия переменных збс

школообфа*, или же он просто сп*здил этот кусок кода из плагина с такой же школообфой"Обфускация"![]()
от туда код выдернулЭто к чему?
private Set<Player> players = Sets.newConcurrentHashSet();
public void onEnable() {
Bukkit.getScheduler().scheduleSyncRepeatingTask(this, new Runnable() {
@Override
public void run() {
for (Player p : players) {
for (Entity e : p.getNearbyEntities(4, 4, 4)) {
if (e.getType() == EntityType.PLAYER) {
Player p2 = (Player) e;
if (p != p2) {
p2.setVelocity(p2.getLocation().getDirection().setY(-1.35).multiply(-1.2));
}
}
}
}
}
}, 5, 5);
}