-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
"SetNight" (включить ночь), "SetDay" (включить день), "GiveIronSet" (выдать сет железной брони), "GiveIronSword" (выдать железнsй меч), "GiveDiamondSet" (выдать сет алмазной брони), "GiveDiamondSword" (выдать алмазный меч), "SpawnTamedDog" (заспавнить прирученного волка), "SpawnTamedCat" (заспавнить прирученного кота), "HealPlayer" (полностью вылечить игрока)
- Loading branch information
Showing
9 changed files
with
165 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
src/main/java/igorlink/donationexecutor/executionsstaff/ExecUtils.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package igorlink.donationexecutor.executionsstaff; | ||
|
||
import igorlink.service.MainConfig; | ||
import net.kyori.adventure.text.Component; | ||
import org.bukkit.Material; | ||
import org.bukkit.entity.Player; | ||
import org.bukkit.inventory.ItemStack; | ||
import org.bukkit.inventory.meta.ItemMeta; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
import java.util.List; | ||
|
||
public class ExecUtils { | ||
|
||
public static void giveToPlayer(Player player, Material material, int amount, String donationUsername, String itemName) { | ||
ItemStack itemStack = new ItemStack(material, amount); | ||
ItemMeta meta = itemStack.getItemMeta(); | ||
meta.setDisplayName(itemName); | ||
meta.setLore(List.of("§7Подарочек от §e" + donationUsername)); | ||
itemStack.setItemMeta(meta); | ||
player.getWorld().dropItemNaturally(player.getLocation().clone().add(player.getLocation().getDirection().setY(0).normalize()), itemStack); | ||
} | ||
|
||
public static void giveToPlayer(Player player, Material material, int amount, String donationUsername) { | ||
ItemStack itemStack = new ItemStack(material, amount); | ||
ItemMeta meta = itemStack.getItemMeta(); | ||
meta.setLore(List.of("§7Подарочек от §e" + donationUsername)); | ||
itemStack.setItemMeta(meta); | ||
player.getWorld().dropItemNaturally(player.getLocation().clone().add(player.getLocation().getDirection().setY(0).normalize()), itemStack); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.