- Баллы
- 76
- Имя в Minecraft
- JolyNoska
Вот у меня есть код:
как мне сделать циклический круг, а не это:

он движется, но останавливается внизу блока(НА 0 позиции) я не знаю как мне правильно объяснить, но мне надо чтобы создатель двигался за ДОНОРОМ СПОНСОР ЗА СОздателем и т д, а не разрывалась цепочка
Код:
public static ArmorStand create(int amount, String name, Location loc, Material item) {
ArmorStand armor = (ArmorStand)loc.getWorld().spawn(loc.clone(), ArmorStand.class);
ItemStack stack = new ItemStack(item);
armor.setGravity(false);
armor.setSmall(true);
armor.setVisible(false);
armor.setCustomNameVisible(true);
armor.setHelmet(stack);
armor.setCustomName(name);
astand.put(armor, amount);
return armor;
}
@EventHandler
public void onClick(PlayerInteractEvent e) {
if (e.getAction() == Action.RIGHT_CLICK_BLOCK && e.getClickedBlock().getType() == Material.ENDER_CHEST) {
Location start = e.getClickedBlock().getLocation().add(0.5, -2, 0.5);
for(double t = 0; t < 2 * Math.PI; t += 0.1) {
Location news = start.add(0.15 * Math.cos(t), 0.15 * Math.sin(t), 0);
circle.add(news.clone());
e.setCancelled(true);
}
create(0, "§dДонор", circle.get(0), Material.PRISMARINE_CRYSTALS);
create(8, "§6V I P", circle.get(8), Material.IRON_SWORD);
create(16, "§2Креатив", circle.get(16), Material.MAGMA_CREAM);
create(24, "§9Капрал", circle.get(24), Material.DOUBLE_PLANT);
create(32, "§cСпонсор", circle.get(32), Material.EMERALD);
create(40, "§bАдмин", circle.get(40), Material.BLAZE_ROD);
create(48, "§5Император", circle.get(48), Material.DIAMOND);
create(56, "§4Создатель", circle.get(56), Material.SPECKLED_MELON);
new BukkitRunnable() {
int i = 0;
public void run() {
i++;
Iterator<Entry<ArmorStand, Integer>> iter = astand.entrySet().iterator();
while(iter.hasNext()) {
Entry ent = (Entry)iter.next();
int value = (int) ent.getValue();
CraftEntity stand = (CraftEntity) ent.getKey();
Location loc = circle.get(value+i);
stand.getHandle().setPosition(loc.getX(), loc.getY(), loc.getZ());
}
}
}.runTaskTimerAsynchronously(this, 0, 1);
}
}
}
как мне сделать циклический круг, а не это:

он движется, но останавливается внизу блока(НА 0 позиции) я не знаю как мне правильно объяснить, но мне надо чтобы создатель двигался за ДОНОРОМ СПОНСОР ЗА СОздателем и т д, а не разрывалась цепочка