LuizB Postado Maio 12, 2016 Denunciar Compartilhar Postado Maio 12, 2016 Como faço pra salvar uma cuboid na config e setar blocos nesse cuboid ?seria tipo um //wand ponto1 ponto2 Link para o comentário Compartilhar em outros sites More sharing options...
ExtraPlays Postado Maio 12, 2016 Denunciar Compartilhar Postado Maio 12, 2016 https://bukkit.org/threads/protection-region-cuboid-creation.164161/ Nao vou explicar pois estou meio ocupado FileConfiguration configpos = Main.getMain().GetConfig("posicoes"); FileConfiguration configpos2 = Main.getMain().GetConfig("posicoes2"); @EventHandler(ignoreCancelled = true, priority = EventPriority.LOW) public void onPlayerInteract(PlayerInteractEvent e) { Player p = e.getPlayer(); if (e.getAction() == Action.RIGHT_CLICK_BLOCK) { if (e.getItem() != null) { if (e.getItem().getType() == Material.GOLD_AXE) { configpos.set("Pos1.X" , e.getClickedBlock().getX()); configpos.set("Pos1.Y" , e.getClickedBlock().getY()); configpos.set("Pos1.Z" , e.getClickedBlock().getZ()); configpos.set("Pos1.Mundo" , p.getWorld().getName()); Main.getMain().SaveConfig("posicoes"); p.sendMessage("§2Posicao 1 setada em: §aX: " + e.getClickedBlock().getX() + " §aY: " + e.getClickedBlock().getY() + " Z: " + e.getClickedBlock().getZ()); } } } else if (e.getAction() == Action.LEFT_CLICK_BLOCK){ if (e.getItem() != null) { if (e.getItem().getType() == Material.GOLD_AXE) { configpos2.set("Pos2.X" , e.getClickedBlock().getX()); configpos2.set("Pos2.Y" , e.getClickedBlock().getY()); configpos2.set("Pos2.Z" , e.getClickedBlock().getZ()); configpos2.set("Pos2.Mundo" , p.getWorld().getName()); Main.getMain().SaveConfig("posicoes2"); p.sendMessage("§2Posicao 2 setada em: §aX: " + e.getClickedBlock().getX() + " §aY: " + e.getClickedBlock().getY() + " Z: " + e.getClickedBlock().getZ()); } } } } Location loc1 = new Location( Bukkit.getWorld(configpos.getString("Pos1.Mundo")), configpos.getDouble("Pos1.X"), configpos.getDouble("Pos1.Y"), configpos.getDouble("Pos1.Z")); Location loc2 = new Location( Bukkit.getServer().getWorld(configpos2.getString("Pos2.Mundo")), configpos2.getDouble("Pos2.X"), configpos2.getDouble("Pos2.Y"), configpos2.getDouble("Pos2.Z")); Cuboid cuboid = new Cuboid(loc1, loc2); for (Block block : cuboid) block.setType(Material.getMaterial(7)); 1 Link para o comentário Compartilhar em outros sites More sharing options...
Thelike Postado Maio 12, 2016 Denunciar Compartilhar Postado Maio 12, 2016 Sua dúvida foi marcada como [Resolvido] e movido à área de dúvidas resolvidas. Atenciosamente, Gamer's Board Link para o comentário Compartilhar em outros sites More sharing options...
Pergunta
LuizB
Como faço pra salvar uma cuboid na config e setar blocos nesse cuboid ?
seria tipo um //wand
ponto1 ponto2
Link para o comentário
Compartilhar em outros sites
2 respostass a esta questão
Posts Recomendados