mirror of
https://github.com/BlazingGames/blazing-games-plugin.git
synced 2025-02-03 21:26:41 -05:00
Merge pull request #1 from BlazingGames/netherstar
Some checks failed
Build and Publish / build-and-publish (push) Failing after 2m47s
Some checks failed
Build and Publish / build-and-publish (push) Failing after 2m47s
Make mending less expensive
This commit is contained in:
commit
bbf5be0eb8
4 changed files with 69 additions and 5 deletions
|
@ -94,7 +94,7 @@ public interface EnchantmentWrapper {
|
|||
.decoration(TextDecoration.ITALIC, false));
|
||||
assert name != null;
|
||||
lore.add(Component.text(recipe.itemAmount() + "x ")
|
||||
.append(name)
|
||||
.append(name.color(recipe.matchMaterial(material) ? NamedTextColor.GREEN : NamedTextColor.RED))
|
||||
.color(recipe.matchMaterial(material) ? NamedTextColor.GREEN : NamedTextColor.RED)
|
||||
.decoration(TextDecoration.ITALIC, false));
|
||||
}
|
||||
|
|
|
@ -16,9 +16,7 @@
|
|||
package de.blazemcworld.blazinggames.enchantments.sys;
|
||||
|
||||
import de.blazemcworld.blazinggames.enchantments.sys.altar.AltarRecipe;
|
||||
import de.blazemcworld.blazinggames.items.ColorlessItemPredicate;
|
||||
import de.blazemcworld.blazinggames.items.MaterialItemPredicate;
|
||||
import de.blazemcworld.blazinggames.items.PotionItemPredicate;
|
||||
import de.blazemcworld.blazinggames.items.*;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.NamespacedKey;
|
||||
import org.bukkit.enchantments.Enchantment;
|
||||
|
@ -121,7 +119,7 @@ public class EnchantmentWrappers {
|
|||
public static VanillaEnchantmentWrapper MENDING =
|
||||
new VanillaEnchantmentWrapper(Enchantment.MENDING, () -> new ItemStack(Material.SHULKER_SHELL),
|
||||
0, 0, 0,
|
||||
new AltarRecipe(10, 15, new MaterialItemPredicate(Material.NETHER_STAR))
|
||||
new AltarRecipe(10, 15, CustomItems.NETHER_STAR_CHUNK)
|
||||
);
|
||||
public static VanillaEnchantmentWrapper LOYALTY =
|
||||
new VanillaEnchantmentWrapper(Enchantment.LOYALTY, () -> new ItemStack(Material.STICK),
|
||||
|
|
|
@ -38,6 +38,7 @@ public class CustomItems {
|
|||
public static final List<CustomSlabs.CustomSlab> CUSTOM_SLABS = new CustomSlabs().slabs;
|
||||
public static final SkeletonKey SKELETON_KEY = new SkeletonKey();
|
||||
public static final ToGoBoxItem TO_GO_BOX = new ToGoBoxItem();
|
||||
public static final NetherStarChunk NETHER_STAR_CHUNK = new NetherStarChunk();
|
||||
public static final EnchantmentTome FUSE_TOME = new EnchantmentTome(BlazingGames.get().key("fuse_tome"), "Fuse Tome", EnchantmentWrappers.MENDING);
|
||||
public static final EnchantmentTome BIND_TOME = new EnchantmentTome(BlazingGames.get().key("bind_tome"), "Bind Tome", EnchantmentWrappers.BINDING_CURSE);
|
||||
public static final EnchantmentTome VANISH_TOME = new EnchantmentTome(BlazingGames.get().key("vanish_tome"), "Vanish Tome", EnchantmentWrappers.VANISHING_CURSE);
|
||||
|
@ -59,6 +60,7 @@ public class CustomItems {
|
|||
TOME_ALTAR,
|
||||
SKELETON_KEY,
|
||||
TO_GO_BOX,
|
||||
NETHER_STAR_CHUNK,
|
||||
FUSE_TOME,
|
||||
BIND_TOME,
|
||||
VANISH_TOME,
|
||||
|
|
|
@ -0,0 +1,64 @@
|
|||
package de.blazemcworld.blazinggames.items;
|
||||
|
||||
import com.destroystokyo.paper.profile.PlayerProfile;
|
||||
import com.destroystokyo.paper.profile.ProfileProperty;
|
||||
import de.blazemcworld.blazinggames.BlazingGames;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.format.NamedTextColor;
|
||||
import net.kyori.adventure.text.format.TextDecoration;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.NamespacedKey;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.Recipe;
|
||||
import org.bukkit.inventory.ShapedRecipe;
|
||||
import org.bukkit.inventory.ShapelessRecipe;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
import org.bukkit.inventory.meta.SkullMeta;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
public class NetherStarChunk extends CustomItem {
|
||||
@Override
|
||||
public @NotNull NamespacedKey getKey() {
|
||||
return BlazingGames.get().key("nether_star_chunk");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected @NotNull ItemStack material() {
|
||||
ItemStack item = new ItemStack(Material.GHAST_TEAR);
|
||||
ItemMeta meta = item.getItemMeta();
|
||||
meta.setEnchantmentGlintOverride(true);
|
||||
meta.itemName(Component.text("Nether Star Chunk").color(NamedTextColor.WHITE));
|
||||
List<Component> lore = new ArrayList<>();
|
||||
lore.add(Component.text("Used to enchant mending").color(NamedTextColor.AQUA).decoration(TextDecoration.ITALIC, false));
|
||||
meta.lore(lore);
|
||||
meta.setEnchantmentGlintOverride(true);
|
||||
item.setItemMeta(meta);
|
||||
return item;
|
||||
}
|
||||
|
||||
public Map<NamespacedKey, Recipe> getRecipes() {
|
||||
ItemStack result = create();
|
||||
result.setAmount(4);
|
||||
ShapelessRecipe fragment = new ShapelessRecipe(getKey(), result);
|
||||
fragment.addIngredient(Material.NETHER_STAR);
|
||||
|
||||
ShapedRecipe netherstar = new ShapedRecipe(BlazingGames.get().key("nether_star"), new ItemStack(Material.NETHER_STAR));
|
||||
netherstar.shape(
|
||||
" ",
|
||||
" II",
|
||||
" II"
|
||||
);
|
||||
netherstar.setIngredient('I', create());
|
||||
|
||||
return Map.of(
|
||||
getKey(), fragment,
|
||||
BlazingGames.get().key("nether_star"), netherstar
|
||||
);
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue