More work on xbows

This commit is contained in:
nossr50
2020-07-28 18:17:57 -07:00
parent 515d58f04f
commit 3ca06f2518
7 changed files with 111 additions and 36 deletions

View File

@@ -62,22 +62,22 @@ public final class ItemUtils {
return mcMMO.getMaterialMapStore().isTrident(itemStack.getType().getKey().getKey());
}
public static void registerTridentRecipes() {
Material tridentMaterial = Material.getMaterial("trident");
if(tridentMaterial != null) {
ItemStack weakTridentIS = new ItemStack(tridentMaterial);
NamespacedKey weakTridentNamespacedKey = new NamespacedKey(mcMMO.p, "mcmmo:weak_trident");
ShapedRecipe weakTridentRecipe = new ShapedRecipe(weakTridentNamespacedKey, weakTridentIS);
weakTridentRecipe.
Bukkit.addRecipe(weakTridentRecipe);
}
if(Material.getMaterial("trident") == null) {
return;
}
}
// public static void registerTridentRecipes() {
//// Material tridentMaterial = Material.getMaterial("trident");
//// if(tridentMaterial != null) {
//// ItemStack weakTridentIS = new ItemStack(tridentMaterial);
//// NamespacedKey weakTridentNamespacedKey = new NamespacedKey(mcMMO.p, "mcmmo:weak_trident");
////
//// ShapedRecipe weakTridentRecipe = new ShapedRecipe(weakTridentNamespacedKey, weakTridentIS);
////
//// weakTridentRecipe.
//// Bukkit.addRecipe(weakTridentRecipe);
//// }
//// if(Material.getMaterial("trident") == null) {
//// return;
//// }
//
// }

View File

@@ -0,0 +1,26 @@
package com.gmail.nossr50.util;
import org.bukkit.entity.Projectile;
import java.util.HashSet;
import java.util.Set;
public class SpawnedProjectileTracker {
private final Set<Projectile> trackedProjectiles;
public SpawnedProjectileTracker() {
trackedProjectiles = new HashSet<>();
}
public void trackProjectile(Projectile projectile) {
trackedProjectiles.add(projectile);
}
public void untrackProjectile(Projectile projectile) {
trackedProjectiles.remove(projectile);
}
public boolean isSpawnedProjectile(Projectile projectile) {
return trackedProjectiles.contains(projectile);
}
}