mirror of
https://github.com/songoda/UltimateRepairing.git
synced 2024-12-01 23:13:26 +01:00
added repair specific colors
This commit is contained in:
parent
7b55784e08
commit
a4138c6e50
@ -292,19 +292,37 @@ public class RepairHandler {
|
|||||||
|
|
||||||
Effect effect = Effect.STEP_SOUND;
|
Effect effect = Effect.STEP_SOUND;
|
||||||
|
|
||||||
|
Material blockType = Material.REDSTONE_BLOCK;
|
||||||
|
|
||||||
|
String typeStr = playerData.getToBeRepaired().getType().name().toUpperCase();
|
||||||
|
|
||||||
|
if (typeStr.contains("DIAMOND")) {
|
||||||
|
blockType = Material.DIAMOND_BLOCK;
|
||||||
|
} else if (typeStr.contains("IRON")) {
|
||||||
|
blockType = Material.IRON_BLOCK;
|
||||||
|
} else if (typeStr.contains("GOLD")) {
|
||||||
|
blockType = Material.GOLD_BLOCK;
|
||||||
|
} else if (typeStr.contains("STONE")) {
|
||||||
|
blockType = Material.STONE;
|
||||||
|
} else if (typeStr.contains("WOOD")) {
|
||||||
|
blockType = Material.OAK_PLANKS;
|
||||||
|
}
|
||||||
|
|
||||||
|
final Material blockTypeFinal = blockType;
|
||||||
|
|
||||||
Location location = playerData.getLocations();
|
Location location = playerData.getLocations();
|
||||||
player.getWorld().playEffect(location, effect, Material.REDSTONE_BLOCK);
|
player.getWorld().playEffect(location, effect, blockType);
|
||||||
Bukkit.getScheduler().scheduleSyncDelayedTask(instance, () -> player.getWorld().playEffect(location, effect, Material.REDSTONE_BLOCK), 5L);
|
Bukkit.getScheduler().scheduleSyncDelayedTask(instance, () -> player.getWorld().playEffect(location, effect, blockTypeFinal), 5L);
|
||||||
Bukkit.getScheduler().scheduleSyncDelayedTask(instance, () -> {
|
Bukkit.getScheduler().scheduleSyncDelayedTask(instance, () -> {
|
||||||
player.getWorld().playEffect(location, effect, Material.REDSTONE_BLOCK);
|
player.getWorld().playEffect(location, effect, blockTypeFinal);
|
||||||
player.getWorld().playEffect(location, effect, Material.STONE);
|
player.getWorld().playEffect(location, effect, Material.STONE);
|
||||||
Arconix.pl().getApi().getPlayer(player).playSound(Sound.valueOf("BLOCK_ANVIL_LAND"));
|
Arconix.pl().getApi().getPlayer(player).playSound(Sound.valueOf("BLOCK_ANVIL_LAND"));
|
||||||
}, 10L);
|
}, 10L);
|
||||||
Bukkit.getScheduler().scheduleSyncDelayedTask(instance, () -> player.getWorld().playEffect(location, effect, Material.REDSTONE_BLOCK), 15L);
|
Bukkit.getScheduler().scheduleSyncDelayedTask(instance, () -> player.getWorld().playEffect(location, effect, blockTypeFinal), 15L);
|
||||||
Bukkit.getScheduler().scheduleSyncDelayedTask(instance, () -> player.getWorld().playEffect(location, effect, Material.REDSTONE_BLOCK), 20L);
|
Bukkit.getScheduler().scheduleSyncDelayedTask(instance, () -> player.getWorld().playEffect(location, effect, blockTypeFinal), 20L);
|
||||||
Bukkit.getScheduler().scheduleSyncDelayedTask(instance, () -> {
|
Bukkit.getScheduler().scheduleSyncDelayedTask(instance, () -> {
|
||||||
Arconix.pl().getApi().getPlayer(player).playSound(Sound.valueOf("BLOCK_ANVIL_LAND"));
|
Arconix.pl().getApi().getPlayer(player).playSound(Sound.valueOf("BLOCK_ANVIL_LAND"));
|
||||||
player.getWorld().playEffect(location, effect, Material.REDSTONE_BLOCK);
|
player.getWorld().playEffect(location, effect, blockTypeFinal);
|
||||||
player.getWorld().playEffect(location, effect, Material.ANVIL);
|
player.getWorld().playEffect(location, effect, Material.ANVIL);
|
||||||
player.sendMessage(TextComponent.formatText(instance.references.getPrefix() + instance.getLocale().getMessage("event.repair.success")));
|
player.sendMessage(TextComponent.formatText(instance.references.getPrefix() + instance.getLocale().getMessage("event.repair.success")));
|
||||||
ItemStack repairedi = playerData.getToBeRepaired();
|
ItemStack repairedi = playerData.getToBeRepaired();
|
||||||
|
Loading…
Reference in New Issue
Block a user