Advertisement
Guest User

Untitled

a guest
Jul 17th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.00 KB | None | 0 0
  1. Optional<PetMeta> fromId = metaController.getFromPlayer(player);
  2.         if (fromId.isPresent()) {
  3.             PetMeta petMeta = fromId.get();
  4.             petMeta.setPetDisplayName(currentPet.friendlyName);
  5.             Optional<EngineContainer<GUIItemContainer<Object>>> engine = Config.getInstance().getEngineController().getContainerFromPosition(currentPet.engineId);
  6.             engine.ifPresent(guiItemContainerEngineContainer -> petMeta.setEngine(guiItemContainerEngineContainer, true));
  7.             petMeta.setSoundEnabled(false);
  8.             Bukkit.getScheduler().runTaskAsynchronously(plugin, () -> {
  9.                 metaController.store(petMeta);
  10.                 Bukkit.getScheduler().runTask(plugin, () -> {
  11.                     final PetBlock petBlock = petBlockController.create(player, petMeta); //Spawn PetBlock
  12.                     petBlock.respawn();
  13.                     petBlock.teleport(player.getLocation());    //Teleport the petblock to the target location
  14.                 });
  15.             });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement