From 8a505471e9035dd4a8d72c938fd88ce387bbe0be Mon Sep 17 00:00:00 2001
From: mms0316 <79147443+mms0316@users.noreply.github.com>
Date: Sun, 27 Apr 2025 01:13:38 -0300
Subject: [PATCH 01/15] Update to 1.20.6 - easy renames
---
pom.xml | 2 +-
src/main/java/com/klin/holoItems/Events.java | 32 +++++++-------
.../abstractClasses/SlidingPack.java | 2 +-
.../en1/guraCollection/items/Bloop.java | 2 +-
.../en1/guraCollection/items/TideRider.java | 2 +-
.../en1/inaCollection/items/Ingraining.java | 2 +-
.../en1/inaCollection/items/WateringCan.java | 4 +-
.../watsonCollection/items/GroundPounder.java | 4 +-
.../en2/SanaCollection/SanaCollection.java | 12 ++---
.../items/SpaceBreadSplash.java | 2 +-
.../gen0/robocoCollection/items/Magnet.java | 2 +-
.../gen0/suiseiCollection/items/Backstab.java | 10 ++---
.../gen0/suiseiCollection/items/Comet.java | 22 +++++-----
.../suiseiCollection/items/Hoshiyumi.java | 6 +--
.../items/RolledNewspaper.java | 2 +-
.../akiCollection/items/QuartzBlossom.java | 2 +-
.../gen1/fubukiCollection/items/Plow.java | 2 +-
.../gen1/haachamaCollection/items/Gnaw.java | 4 +-
.../gen3/flareCollection/items/Splinter.java | 6 +--
.../marineCollection/items/PiratesHook.java | 2 +-
.../pekoraCollection/PekoraCollection.java | 2 +-
.../pekoraCollection/items/CarrotCannon.java | 2 +-
.../items/NecromancersTome.java | 2 +-
.../gen5/lamyCollection/items/Starch.java | 4 +-
.../hidden/archiveCollection/MoltenCore.java | 2 +-
.../franCollection/items/DyeConcentrate.java | 4 +-
.../franCollection/items/SlimeJelly.java | 2 +-
.../hidden/klinCollection/items/Bore.java | 2 +-
.../items/CarnivalUnlimitedKrisWorks.java | 2 +-
.../hidden/opCollection/items/Falchion.java | 4 +-
.../items/UnlimitedKrisWorks.java | 4 +-
.../temmaCollection/items/SSKSword.java | 2 +-
.../dungeons/inaDungeon/Attacks.java | 2 +-
.../dungeons/inaDungeon/Minesweeper.java | 2 +-
.../dungeons/inaDungeon/members/Gura.java | 10 ++---
.../dungeons/inaDungeon/members/Watson.java | 2 +-
.../com/klin/holoItems/utility/Utility.java | 44 +++++++++----------
37 files changed, 107 insertions(+), 107 deletions(-)
diff --git a/pom.xml b/pom.xml
index 2f5c453..57b446c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -19,7 +19,7 @@
io.papermc.paper
paper-api
- 1.20.4-R0.1-SNAPSHOT
+ 1.20.6-R0.1-SNAPSHOT
provided
diff --git a/src/main/java/com/klin/holoItems/Events.java b/src/main/java/com/klin/holoItems/Events.java
index 9337c55..b22edc0 100644
--- a/src/main/java/com/klin/holoItems/Events.java
+++ b/src/main/java/com/klin/holoItems/Events.java
@@ -83,37 +83,37 @@ public class Events implements Listener {
);
private final Map multiplier = new HashMap<>() {{
put(1, new Enchantment[]{
- Enchantment.PROTECTION_ENVIRONMENTAL, Enchantment.DAMAGE_ALL,
- Enchantment.DIG_SPEED, Enchantment.ARROW_DAMAGE,
+ Enchantment.PROTECTION, Enchantment.SHARPNESS,
+ Enchantment.EFFICIENCY, Enchantment.POWER,
Enchantment.LOYALTY, Enchantment.PIERCING
});
put(2, new Enchantment[]{
- Enchantment.PROTECTION_FIRE, Enchantment.PROTECTION_FALL,
- Enchantment.PROTECTION_PROJECTILE, Enchantment.DAMAGE_UNDEAD,
- Enchantment.DAMAGE_ARTHROPODS, Enchantment.KNOCKBACK,
- Enchantment.DURABILITY, Enchantment.QUICK_CHARGE
+ Enchantment.FIRE_PROTECTION, Enchantment.FEATHER_FALLING,
+ Enchantment.PROJECTILE_PROTECTION, Enchantment.SMITE,
+ Enchantment.BANE_OF_ARTHROPODS, Enchantment.KNOCKBACK,
+ Enchantment.UNBREAKING, Enchantment.QUICK_CHARGE
});
put(4, new Enchantment[]{
- Enchantment.PROTECTION_EXPLOSIONS, Enchantment.OXYGEN,
- Enchantment.DEPTH_STRIDER, Enchantment.WATER_WORKER,
- Enchantment.FIRE_ASPECT, Enchantment.LOOT_BONUS_MOBS,
- Enchantment.LOOT_BONUS_BLOCKS, Enchantment.ARROW_KNOCKBACK,
- Enchantment.ARROW_FIRE, Enchantment.LUCK, Enchantment.LURE,
+ Enchantment.BLAST_PROTECTION, Enchantment.RESPIRATION,
+ Enchantment.DEPTH_STRIDER, Enchantment.AQUA_AFFINITY,
+ Enchantment.FIRE_ASPECT, Enchantment.LOOTING,
+ Enchantment.FORTUNE, Enchantment.PUNCH,
+ Enchantment.FLAME, Enchantment.LUCK_OF_THE_SEA, Enchantment.LURE,
Enchantment.FROST_WALKER, Enchantment.MENDING, Enchantment.IMPALING,
Enchantment.RIPTIDE, Enchantment.MULTISHOT, Enchantment.SWEEPING_EDGE
});
put(8, new Enchantment[]{
- Enchantment.THORNS, Enchantment.SILK_TOUCH, Enchantment.ARROW_INFINITE,
+ Enchantment.THORNS, Enchantment.SILK_TOUCH, Enchantment.INFINITY,
Enchantment.BINDING_CURSE, Enchantment.VANISHING_CURSE,
Enchantment.CHANNELING, Enchantment.SOUL_SPEED
});
}};
private final Set> with = Set.of(
- Set.of(Enchantment.DAMAGE_ALL, Enchantment.DAMAGE_UNDEAD, Enchantment.DAMAGE_ARTHROPODS),
- Set.of(Enchantment.PROTECTION_FIRE, Enchantment.PROTECTION_PROJECTILE, Enchantment.PROTECTION_ENVIRONMENTAL, Enchantment.PROTECTION_FALL, Enchantment.PROTECTION_EXPLOSIONS),
+ Set.of(Enchantment.SHARPNESS, Enchantment.SMITE, Enchantment.BANE_OF_ARTHROPODS),
+ Set.of(Enchantment.FIRE_PROTECTION, Enchantment.PROJECTILE_PROTECTION, Enchantment.PROTECTION, Enchantment.FEATHER_FALLING, Enchantment.BLAST_PROTECTION),
Set.of(Enchantment.DEPTH_STRIDER, Enchantment.FROST_WALKER),
- Set.of(Enchantment.LOOT_BONUS_BLOCKS, Enchantment.SILK_TOUCH),
- Set.of(Enchantment.ARROW_INFINITE, Enchantment.MENDING),
+ Set.of(Enchantment.FORTUNE, Enchantment.SILK_TOUCH),
+ Set.of(Enchantment.INFINITY, Enchantment.MENDING),
Set.of(Enchantment.MULTISHOT, Enchantment.PIERCING)
);
private final Map> exclusive = new HashMap<>(){{
diff --git a/src/main/java/com/klin/holoItems/abstractClasses/SlidingPack.java b/src/main/java/com/klin/holoItems/abstractClasses/SlidingPack.java
index 1510893..a30386d 100644
--- a/src/main/java/com/klin/holoItems/abstractClasses/SlidingPack.java
+++ b/src/main/java/com/klin/holoItems/abstractClasses/SlidingPack.java
@@ -48,7 +48,7 @@ public void ability(InventoryClickEvent event, boolean current){
return;
ItemStack selected = event.getCurrentItem();
ItemMeta selectedMeta = selected.getItemMeta();
- selectedMeta.addEnchant(Enchantment.LUCK, 1, false);
+ selectedMeta.addEnchant(Enchantment.LUCK_OF_THE_SEA, 1, false);
selectedMeta.addItemFlags(ItemFlag.HIDE_ENCHANTS);
selected.setItemMeta(selectedMeta);
diff --git a/src/main/java/com/klin/holoItems/collections/en1/guraCollection/items/Bloop.java b/src/main/java/com/klin/holoItems/collections/en1/guraCollection/items/Bloop.java
index 1a3a16c..019420e 100644
--- a/src/main/java/com/klin/holoItems/collections/en1/guraCollection/items/Bloop.java
+++ b/src/main/java/com/klin/holoItems/collections/en1/guraCollection/items/Bloop.java
@@ -80,7 +80,7 @@ public void ability(BlockBreakEvent event){
event.setCancelled(true);
block.setType(Material.AIR);
ItemStack pickaxe = player.getInventory().getItemInMainHand();
- int drops = pickaxe.getEnchantmentLevel(Enchantment.LOOT_BONUS_BLOCKS)+1;
+ int drops = pickaxe.getEnchantmentLevel(Enchantment.FORTUNE)+1;
player.getWorld().dropItemNaturally(block.getLocation(), new ItemStack(Material.QUARTZ_BLOCK, 1+(int)(Math.random()*drops)));
}
}
diff --git a/src/main/java/com/klin/holoItems/collections/en1/guraCollection/items/TideRider.java b/src/main/java/com/klin/holoItems/collections/en1/guraCollection/items/TideRider.java
index 1165788..9f1745b 100644
--- a/src/main/java/com/klin/holoItems/collections/en1/guraCollection/items/TideRider.java
+++ b/src/main/java/com/klin/holoItems/collections/en1/guraCollection/items/TideRider.java
@@ -28,7 +28,7 @@
public class TideRider extends Item implements Interactable {
public static final String name = "tideRider";
- private static final Set accepted = Set.of(Enchantment.DURABILITY, Enchantment.MENDING);
+ private static final Set accepted = Set.of(Enchantment.UNBREAKING, Enchantment.MENDING);
private static final Material material = Material.TRIDENT;
private static final int quantity = 1;
diff --git a/src/main/java/com/klin/holoItems/collections/en1/inaCollection/items/Ingraining.java b/src/main/java/com/klin/holoItems/collections/en1/inaCollection/items/Ingraining.java
index e77c210..14c39ac 100644
--- a/src/main/java/com/klin/holoItems/collections/en1/inaCollection/items/Ingraining.java
+++ b/src/main/java/com/klin/holoItems/collections/en1/inaCollection/items/Ingraining.java
@@ -18,7 +18,7 @@
public class Ingraining extends Enchant implements Extractable {
public static final String name = "ingraining";
- public static final Set accepted = Set.of(Enchantment.DURABILITY, Enchantment.MENDING, Enchantment.LOOT_BONUS_BLOCKS);
+ public static final Set accepted = Set.of(Enchantment.UNBREAKING, Enchantment.MENDING, Enchantment.FORTUNE);
private static final Material material = Material.FLINT;
private static final String lore =
diff --git a/src/main/java/com/klin/holoItems/collections/en1/inaCollection/items/WateringCan.java b/src/main/java/com/klin/holoItems/collections/en1/inaCollection/items/WateringCan.java
index 7d6d321..4ee3e8e 100644
--- a/src/main/java/com/klin/holoItems/collections/en1/inaCollection/items/WateringCan.java
+++ b/src/main/java/com/klin/holoItems/collections/en1/inaCollection/items/WateringCan.java
@@ -84,11 +84,11 @@ public void effect(PlayerInteractEvent event){
crop.setAge(crop.getAge()+1);
block.setBlockData(crop);
- world.spawnParticle(Particle.VILLAGER_HAPPY, loc, 1, 0.5, 0.5, 0.5);
+ world.spawnParticle(Particle.HAPPY_VILLAGER, loc, 1, 0.5, 0.5, 0.5);
}
}
}
- world.spawnParticle(Particle.WATER_SPLASH, player.getLocation(), 100, 2.5, 0.25, 2.5);
+ world.spawnParticle(Particle.SPLASH, player.getLocation(), 100, 2.5, 0.25, 2.5);
if(charge==0)
event.getItem().setType(Material.BUCKET);
}
diff --git a/src/main/java/com/klin/holoItems/collections/en1/watsonCollection/items/GroundPounder.java b/src/main/java/com/klin/holoItems/collections/en1/watsonCollection/items/GroundPounder.java
index 805f4fc..79ca98e 100644
--- a/src/main/java/com/klin/holoItems/collections/en1/watsonCollection/items/GroundPounder.java
+++ b/src/main/java/com/klin/holoItems/collections/en1/watsonCollection/items/GroundPounder.java
@@ -51,7 +51,7 @@ public GroundPounder(){
public void registerRecipes(){
ItemMeta meta = item.getItemMeta();
- meta.addEnchant(Enchantment.DURABILITY, 1, false);
+ meta.addEnchant(Enchantment.UNBREAKING, 1, false);
List lore = meta.getLore();
lore.add(0, "");
meta.setLore(lore);
@@ -175,7 +175,7 @@ public void run(){
return;
}
player.setVelocity(player.getVelocity().add(new Vector(0, -0.2, 0)));
- player.addPotionEffect(new PotionEffect(PotionEffectType.DAMAGE_RESISTANCE, 2, 3));
+ player.addPotionEffect(new PotionEffect(PotionEffectType.RESISTANCE, 2, 3));
increment++;
if(increment%5==0)
offset++;
diff --git a/src/main/java/com/klin/holoItems/collections/en2/SanaCollection/SanaCollection.java b/src/main/java/com/klin/holoItems/collections/en2/SanaCollection/SanaCollection.java
index d519005..ae6bef9 100644
--- a/src/main/java/com/klin/holoItems/collections/en2/SanaCollection/SanaCollection.java
+++ b/src/main/java/com/klin/holoItems/collections/en2/SanaCollection/SanaCollection.java
@@ -45,9 +45,9 @@ public void inquire(Player player, ItemStack itemStack, PlayerInteractEntityEven
if(enchant!=null && enchant.contains(SpaceBreadSplash.name))
return;
Inventory inv = player.getInventory();
- AtomicBoolean sharp = new AtomicBoolean(itemStack.getEnchantmentLevel(Enchantment.DAMAGE_ALL)>=5);
- AtomicBoolean smite = new AtomicBoolean(itemStack.getEnchantmentLevel(Enchantment.DAMAGE_UNDEAD)>=5);
- AtomicBoolean bane = new AtomicBoolean(itemStack.getEnchantmentLevel(Enchantment.DAMAGE_ARTHROPODS)>=5);
+ AtomicBoolean sharp = new AtomicBoolean(itemStack.getEnchantmentLevel(Enchantment.SHARPNESS)>=5);
+ AtomicBoolean smite = new AtomicBoolean(itemStack.getEnchantmentLevel(Enchantment.SMITE)>=5);
+ AtomicBoolean bane = new AtomicBoolean(itemStack.getEnchantmentLevel(Enchantment.BANE_OF_ARTHROPODS)>=5);
Set books = new HashSet<>();
for(ItemStack item : inv.getStorageContents()){
if(item==null)
@@ -61,19 +61,19 @@ public void inquire(Player player, ItemStack itemStack, PlayerInteractEntityEven
if(storedEnchantments.get(enchantment)<5) {
cont = true;
break;
- } if(enchantment.equals(Enchantment.DAMAGE_ALL)) {
+ } if(enchantment.equals(Enchantment.SHARPNESS)) {
if(sharp.get()) {
cont = true;
break;
}
found.add(sharp);
- } else if(enchantment.equals(Enchantment.DAMAGE_UNDEAD)) {
+ } else if(enchantment.equals(Enchantment.SMITE)) {
if(smite.get()){
cont = true;
break;
}
found.add(smite);
- } else if(enchantment.equals(Enchantment.DAMAGE_ARTHROPODS)) {
+ } else if(enchantment.equals(Enchantment.BANE_OF_ARTHROPODS)) {
if(bane.get()){
cont = true;
break;
diff --git a/src/main/java/com/klin/holoItems/collections/en2/SanaCollection/items/SpaceBreadSplash.java b/src/main/java/com/klin/holoItems/collections/en2/SanaCollection/items/SpaceBreadSplash.java
index bf0fcd3..afd07a6 100644
--- a/src/main/java/com/klin/holoItems/collections/en2/SanaCollection/items/SpaceBreadSplash.java
+++ b/src/main/java/com/klin/holoItems/collections/en2/SanaCollection/items/SpaceBreadSplash.java
@@ -22,7 +22,7 @@ public class SpaceBreadSplash extends Enchant{
public static final Set acceptedIds = Stream.of(Comet.name).collect(Collectors.toCollection(HashSet::new));
public static final Set acceptedTypes = null;
- public static final Set exclusive = Stream.of(Enchantment.DAMAGE_ALL, Enchantment.DAMAGE_UNDEAD, Enchantment.DAMAGE_ARTHROPODS).collect(Collectors.toCollection(HashSet::new));
+ public static final Set exclusive = Stream.of(Enchantment.SHARPNESS, Enchantment.SMITE, Enchantment.BANE_OF_ARTHROPODS).collect(Collectors.toCollection(HashSet::new));
public static final int expCost = 40;
public static final int cost = -1;
diff --git a/src/main/java/com/klin/holoItems/collections/gen0/robocoCollection/items/Magnet.java b/src/main/java/com/klin/holoItems/collections/gen0/robocoCollection/items/Magnet.java
index 82c4c65..2e83b14 100644
--- a/src/main/java/com/klin/holoItems/collections/gen0/robocoCollection/items/Magnet.java
+++ b/src/main/java/com/klin/holoItems/collections/gen0/robocoCollection/items/Magnet.java
@@ -21,7 +21,7 @@
public class Magnet extends Enchant implements Extractable {
public static final String name = "magnet";
- public static final Set accepted = Set.of(Enchantment.DURABILITY, Enchantment.MENDING, Enchantment.SILK_TOUCH);
+ public static final Set accepted = Set.of(Enchantment.UNBREAKING, Enchantment.MENDING, Enchantment.SILK_TOUCH);
public static final Set acceptedIds = Stream.of(Comet.name).collect(Collectors.toCollection(HashSet::new));
public static final Set acceptedTypes = new HashSet<>();
public static final int expCost = 39;
diff --git a/src/main/java/com/klin/holoItems/collections/gen0/suiseiCollection/items/Backstab.java b/src/main/java/com/klin/holoItems/collections/gen0/suiseiCollection/items/Backstab.java
index fd0733d..b7e89d5 100644
--- a/src/main/java/com/klin/holoItems/collections/gen0/suiseiCollection/items/Backstab.java
+++ b/src/main/java/com/klin/holoItems/collections/gen0/suiseiCollection/items/Backstab.java
@@ -28,11 +28,11 @@ public class Backstab extends Item implements Interactable{
public static final String name = "backstab";
public static final Set accepted = Set.of(
Enchantment.FIRE_ASPECT,
- Enchantment.DAMAGE_ALL,
- Enchantment.DAMAGE_ARTHROPODS,
- Enchantment.DAMAGE_UNDEAD,
- Enchantment.DURABILITY,
- Enchantment.LOOT_BONUS_MOBS,
+ Enchantment.SHARPNESS,
+ Enchantment.BANE_OF_ARTHROPODS,
+ Enchantment.SMITE,
+ Enchantment.UNBREAKING,
+ Enchantment.LOOTING,
Enchantment.KNOCKBACK,
Enchantment.MENDING,
Enchantment.SWEEPING_EDGE
diff --git a/src/main/java/com/klin/holoItems/collections/gen0/suiseiCollection/items/Comet.java b/src/main/java/com/klin/holoItems/collections/gen0/suiseiCollection/items/Comet.java
index e4f2f28..9ee66bc 100644
--- a/src/main/java/com/klin/holoItems/collections/gen0/suiseiCollection/items/Comet.java
+++ b/src/main/java/com/klin/holoItems/collections/gen0/suiseiCollection/items/Comet.java
@@ -29,13 +29,13 @@ public class Comet extends Item implements Interactable {
public static final String name = "comet";
public static final Set accepted = Set.of(
Enchantment.FIRE_ASPECT,
- Enchantment.DAMAGE_ALL,
- Enchantment.DAMAGE_ARTHROPODS,
- Enchantment.DAMAGE_UNDEAD,
- Enchantment.DIG_SPEED,
- Enchantment.DURABILITY,
- Enchantment.LOOT_BONUS_BLOCKS,
- Enchantment.LOOT_BONUS_MOBS,
+ Enchantment.SHARPNESS,
+ Enchantment.BANE_OF_ARTHROPODS,
+ Enchantment.SMITE,
+ Enchantment.EFFICIENCY,
+ Enchantment.UNBREAKING,
+ Enchantment.FORTUNE,
+ Enchantment.LOOTING,
Enchantment.MENDING,
Enchantment.PIERCING,
Enchantment.SILK_TOUCH
@@ -87,7 +87,7 @@ public void ability(PlayerInteractEvent event, Action action){
// if(Utility.onCooldown(item))
// return;
// Utility.cooldown(item, 20);
- // double damage = 4 + 3 * (Utility.checkPotionEffect(player, PotionEffectType.INCREASE_DAMAGE) -
+ // double damage = 4 + 3 * (Utility.checkPotionEffect(player, PotionEffectType.STRENGTH) -
// Utility.checkPotionEffect(player, PotionEffectType.WEAKNESS));
// Location location = player.getEyeLocation();
@@ -157,9 +157,9 @@ public void ability(PlayerInteractEvent event, Action action){
// Utility.addDurability(item, 0.5, player);
// ItemStack clone = item.clone();
// if(bread) {
- // clone.addUnsafeEnchantment(Enchantment.DAMAGE_UNDEAD, 5);
- // clone.addUnsafeEnchantment(Enchantment.DAMAGE_ARTHROPODS, 5);
- // clone.addUnsafeEnchantment(Enchantment.DAMAGE_ALL, 5);
+ // clone.addUnsafeEnchantment(Enchantment.SMITE, 5);
+ // clone.addUnsafeEnchantment(Enchantment.BANE_OF_ARTHROPODS, 5);
+ // clone.addUnsafeEnchantment(Enchantment.SHARPNESS, 5);
// }
// for (LivingEntity target : targets) {
// if (target.isValid() && (!(target instanceof Player) || !((Player) target).isBlocking()))
diff --git a/src/main/java/com/klin/holoItems/collections/gen0/suiseiCollection/items/Hoshiyumi.java b/src/main/java/com/klin/holoItems/collections/gen0/suiseiCollection/items/Hoshiyumi.java
index 25f23fd..b6f1481 100644
--- a/src/main/java/com/klin/holoItems/collections/gen0/suiseiCollection/items/Hoshiyumi.java
+++ b/src/main/java/com/klin/holoItems/collections/gen0/suiseiCollection/items/Hoshiyumi.java
@@ -27,9 +27,9 @@
public class Hoshiyumi extends Item implements Interactable, Launchable, Hitable {
public static final String name = "hoshiyumi";
public static final Set accepted = Set.of(
- Enchantment.ARROW_DAMAGE,
- Enchantment.ARROW_FIRE,
- Enchantment.ARROW_KNOCKBACK,
+ Enchantment.POWER,
+ Enchantment.FLAME,
+ Enchantment.PUNCH,
Enchantment.FIRE_ASPECT,
Enchantment.MENDING,
Enchantment.KNOCKBACK
diff --git a/src/main/java/com/klin/holoItems/collections/gen0/suiseiCollection/items/RolledNewspaper.java b/src/main/java/com/klin/holoItems/collections/gen0/suiseiCollection/items/RolledNewspaper.java
index 72c0729..64414cd 100644
--- a/src/main/java/com/klin/holoItems/collections/gen0/suiseiCollection/items/RolledNewspaper.java
+++ b/src/main/java/com/klin/holoItems/collections/gen0/suiseiCollection/items/RolledNewspaper.java
@@ -20,7 +20,7 @@
public class RolledNewspaper extends Item implements Responsible {
public static final String name = "rolledNewspaper";
- public static final Set accepted = Stream.of(Enchantment.DURABILITY, Enchantment.MENDING).collect(Collectors.toCollection(HashSet::new));
+ public static final Set accepted = Stream.of(Enchantment.UNBREAKING, Enchantment.MENDING).collect(Collectors.toCollection(HashSet::new));
private static final Material material = Material.PAPER;
private static final int quantity = 1;
diff --git a/src/main/java/com/klin/holoItems/collections/gen1/akiCollection/items/QuartzBlossom.java b/src/main/java/com/klin/holoItems/collections/gen1/akiCollection/items/QuartzBlossom.java
index 3af786f..f5d9172 100644
--- a/src/main/java/com/klin/holoItems/collections/gen1/akiCollection/items/QuartzBlossom.java
+++ b/src/main/java/com/klin/holoItems/collections/gen1/akiCollection/items/QuartzBlossom.java
@@ -77,7 +77,7 @@ public void ability(BlockBreakEvent event){
event.setCancelled(true);
block.setType(Material.AIR);
ItemStack pickaxe = player.getInventory().getItemInMainHand();
- int drops = pickaxe.getEnchantmentLevel(Enchantment.LOOT_BONUS_BLOCKS)+1;
+ int drops = pickaxe.getEnchantmentLevel(Enchantment.FORTUNE)+1;
player.getWorld().dropItemNaturally(block.getLocation(), new ItemStack(Material.QUARTZ_BLOCK, 1+(int)(Math.random()*drops)));
}
}
diff --git a/src/main/java/com/klin/holoItems/collections/gen1/fubukiCollection/items/Plow.java b/src/main/java/com/klin/holoItems/collections/gen1/fubukiCollection/items/Plow.java
index 2c384fa..330cb2f 100644
--- a/src/main/java/com/klin/holoItems/collections/gen1/fubukiCollection/items/Plow.java
+++ b/src/main/java/com/klin/holoItems/collections/gen1/fubukiCollection/items/Plow.java
@@ -22,7 +22,7 @@
public class Plow extends Enchant implements Extractable {
public static final String name = "plow";
- public static final Set accepted = Stream.of(Enchantment.DIG_SPEED, Enchantment.SILK_TOUCH, Enchantment.MENDING).collect(Collectors.toCollection(HashSet::new));
+ public static final Set accepted = Stream.of(Enchantment.EFFICIENCY, Enchantment.SILK_TOUCH, Enchantment.MENDING).collect(Collectors.toCollection(HashSet::new));
public static final Set acceptedIds = null;
public static final Set acceptedTypes = Utility.shovels;
public static final int expCost = 32;
diff --git a/src/main/java/com/klin/holoItems/collections/gen1/haachamaCollection/items/Gnaw.java b/src/main/java/com/klin/holoItems/collections/gen1/haachamaCollection/items/Gnaw.java
index 6ebb282..03f3227 100644
--- a/src/main/java/com/klin/holoItems/collections/gen1/haachamaCollection/items/Gnaw.java
+++ b/src/main/java/com/klin/holoItems/collections/gen1/haachamaCollection/items/Gnaw.java
@@ -33,7 +33,7 @@
public class Gnaw extends Item implements Consumable {
public static final String name = "gnaw";
public static final Set accepted = Stream.of(
- Enchantment.DURABILITY,
+ Enchantment.UNBREAKING,
Enchantment.FIRE_ASPECT,
Enchantment.IMPALING,
Enchantment.LURE,
@@ -97,7 +97,7 @@ else if(knockback!=0)
int size = entities.size();
PlayerInventory inv = player.getInventory();
if(item.equals(inv.getItemInOffHand())){
- if(Math.random()<(1f/(meta.getEnchantLevel(Enchantment.DURABILITY)+1))) {
+ if(Math.random()<(1f/(meta.getEnchantLevel(Enchantment.UNBREAKING)+1))) {
List lore = meta.getLore();
int[] durability = Utility.getDurability(lore);
durability[0] = durability[0] - size;
diff --git a/src/main/java/com/klin/holoItems/collections/gen3/flareCollection/items/Splinter.java b/src/main/java/com/klin/holoItems/collections/gen3/flareCollection/items/Splinter.java
index e50f87e..cc0cf2b 100644
--- a/src/main/java/com/klin/holoItems/collections/gen3/flareCollection/items/Splinter.java
+++ b/src/main/java/com/klin/holoItems/collections/gen3/flareCollection/items/Splinter.java
@@ -27,7 +27,7 @@ public class Splinter extends Enchant implements Extractable {
private static final NamespacedKey KEY = new NamespacedKey(HoloItems.getInstance(), name);
private static final MaterialSetTag COMPATIBLE_MATERIALS = new MaterialSetTag(KEY, Splinter::isCompatibleMaterial).lock();
- public static final Set accepted = Set.of(Enchantment.DURABILITY, Enchantment.MENDING, Enchantment.SILK_TOUCH);
+ public static final Set accepted = Set.of(Enchantment.UNBREAKING, Enchantment.MENDING, Enchantment.SILK_TOUCH);
public static final Set acceptedIds = Set.of(Comet.name);
public static final Set acceptedTypes = Utility.axes;
public static final int expCost = 39;
@@ -48,7 +48,7 @@ public void registerRecipes(){
ShapedRecipe recipe0 =
new ShapedRecipe(new NamespacedKey(HoloItems.getInstance(), name+"0"), item);
recipe0.shape("**","*&"," %");
- recipe0.setIngredient('*', Material.SCUTE);
+ recipe0.setIngredient('*', Material.TURTLE_SCUTE);
recipe0.setIngredient('&', Material.CONDUIT);
recipe0.setIngredient('%', Material.STICK);
recipe0.setGroup(name);
@@ -57,7 +57,7 @@ public void registerRecipes(){
ShapedRecipe recipe1 =
new ShapedRecipe(new NamespacedKey(HoloItems.getInstance(), name+"1"), item);
recipe1.shape("**","&*","% ");
- recipe1.setIngredient('*', Material.SCUTE);
+ recipe1.setIngredient('*', Material.TURTLE_SCUTE);
recipe1.setIngredient('&', Material.CONDUIT);
recipe1.setIngredient('%', Material.STICK);
recipe1.setGroup(name);
diff --git a/src/main/java/com/klin/holoItems/collections/gen3/marineCollection/items/PiratesHook.java b/src/main/java/com/klin/holoItems/collections/gen3/marineCollection/items/PiratesHook.java
index 70900aa..fd1d54f 100644
--- a/src/main/java/com/klin/holoItems/collections/gen3/marineCollection/items/PiratesHook.java
+++ b/src/main/java/com/klin/holoItems/collections/gen3/marineCollection/items/PiratesHook.java
@@ -25,7 +25,7 @@
public class PiratesHook extends Item implements Fishable {
public static final String name = "piratesHook";
- public static final Set accepted = Stream.of(Enchantment.DURABILITY, Enchantment.MENDING).collect(Collectors.toCollection(HashSet::new));
+ public static final Set accepted = Stream.of(Enchantment.UNBREAKING, Enchantment.MENDING).collect(Collectors.toCollection(HashSet::new));
private static final Material material = Material.FISHING_ROD;
private static final int quantity = 1;
diff --git a/src/main/java/com/klin/holoItems/collections/gen3/pekoraCollection/PekoraCollection.java b/src/main/java/com/klin/holoItems/collections/gen3/pekoraCollection/PekoraCollection.java
index f2d8531..3acac6d 100644
--- a/src/main/java/com/klin/holoItems/collections/gen3/pekoraCollection/PekoraCollection.java
+++ b/src/main/java/com/klin/holoItems/collections/gen3/pekoraCollection/PekoraCollection.java
@@ -32,7 +32,7 @@ public Map getStat(Player player){
stat.put("Villagers killed", player.getStatistic(Statistic.KILL_ENTITY, EntityType.VILLAGER));
stat.put("Wandering Traders killed", player.getStatistic(Statistic.KILL_ENTITY, EntityType.WANDERING_TRADER));
stat.put("Iron Golems killed", player.getStatistic(Statistic.KILL_ENTITY, EntityType.IRON_GOLEM));
- stat.put("Snow Golems killed", player.getStatistic(Statistic.KILL_ENTITY, EntityType.SNOWMAN));
+ stat.put("Snow Golems killed", player.getStatistic(Statistic.KILL_ENTITY, EntityType.SNOW_GOLEM));
return stat;
}
}
diff --git a/src/main/java/com/klin/holoItems/collections/gen3/pekoraCollection/items/CarrotCannon.java b/src/main/java/com/klin/holoItems/collections/gen3/pekoraCollection/items/CarrotCannon.java
index 4809d9f..ab8e037 100644
--- a/src/main/java/com/klin/holoItems/collections/gen3/pekoraCollection/items/CarrotCannon.java
+++ b/src/main/java/com/klin/holoItems/collections/gen3/pekoraCollection/items/CarrotCannon.java
@@ -20,7 +20,7 @@
public class CarrotCannon extends BatteryPack {
public static final String name = "carrotCannon";
public static final Set accepted = new HashSet<>(){{
- add(Enchantment.DURABILITY);
+ add(Enchantment.UNBREAKING);
add(Enchantment.MENDING);
}};
private static final ItemStack carrot = new ItemStack(Material.CARROT);
diff --git a/src/main/java/com/klin/holoItems/collections/gen3/rushiaCollection/items/NecromancersTome.java b/src/main/java/com/klin/holoItems/collections/gen3/rushiaCollection/items/NecromancersTome.java
index e1804c7..e037f0e 100644
--- a/src/main/java/com/klin/holoItems/collections/gen3/rushiaCollection/items/NecromancersTome.java
+++ b/src/main/java/com/klin/holoItems/collections/gen3/rushiaCollection/items/NecromancersTome.java
@@ -54,7 +54,7 @@ public NecromancersTome(){
prohibited = Set.of(
EntityType.GHAST,
EntityType.GIANT,
- EntityType.SNOWMAN,
+ EntityType.SNOW_GOLEM,
EntityType.IRON_GOLEM,
EntityType.ELDER_GUARDIAN,
EntityType.WITHER,
diff --git a/src/main/java/com/klin/holoItems/collections/gen5/lamyCollection/items/Starch.java b/src/main/java/com/klin/holoItems/collections/gen5/lamyCollection/items/Starch.java
index b1f11cd..333dc6b 100644
--- a/src/main/java/com/klin/holoItems/collections/gen5/lamyCollection/items/Starch.java
+++ b/src/main/java/com/klin/holoItems/collections/gen5/lamyCollection/items/Starch.java
@@ -63,8 +63,8 @@ public void run(){
if(item.getType()==Material.LINGERING_POTION)
multiplier = 4;
if(type==PotionType.MUNDANE)
- meta.addCustomEffect(new PotionEffect(PotionEffectType.CONFUSION, 400/multiplier, 1), true);
- else if(type==PotionType.SPEED)
+ meta.addCustomEffect(new PotionEffect(PotionEffectType.NAUSEA, 400/multiplier, 1), true);
+ else if(type==PotionType.SWIFTNESS)
meta.addCustomEffect(new PotionEffect(PotionEffectType.BLINDNESS, 800/multiplier, 1), true);
else
continue;
diff --git a/src/main/java/com/klin/holoItems/collections/hidden/archiveCollection/MoltenCore.java b/src/main/java/com/klin/holoItems/collections/hidden/archiveCollection/MoltenCore.java
index f09d087..8fe9ab9 100644
--- a/src/main/java/com/klin/holoItems/collections/hidden/archiveCollection/MoltenCore.java
+++ b/src/main/java/com/klin/holoItems/collections/hidden/archiveCollection/MoltenCore.java
@@ -41,7 +41,7 @@ public MoltenCore(){
"Dispensers wired with this item can\n"+
"melt obsidian using fire charges\n"+
"Break the dispenser to retrieve"));
- activatedMeta.addEnchant(Enchantment.LUCK, 1, false);
+ activatedMeta.addEnchant(Enchantment.LUCK_OF_THE_SEA, 1, false);
activatedMeta.addItemFlags(ItemFlag.HIDE_ENCHANTS);
activated.setItemMeta(activatedMeta);
diff --git a/src/main/java/com/klin/holoItems/collections/hidden/franCollection/items/DyeConcentrate.java b/src/main/java/com/klin/holoItems/collections/hidden/franCollection/items/DyeConcentrate.java
index c4a7709..a005de0 100644
--- a/src/main/java/com/klin/holoItems/collections/hidden/franCollection/items/DyeConcentrate.java
+++ b/src/main/java/com/klin/holoItems/collections/hidden/franCollection/items/DyeConcentrate.java
@@ -71,7 +71,7 @@ public void ability(LivingEntity entity, String info) {
LivingEntity livingEntity = (LivingEntity) nearby;
livingEntity.setNoDamageTicks(0);
livingEntity.damage(8);
- livingEntity.addPotionEffect(new PotionEffect(PotionEffectType.SLOW, 40, 2));
+ livingEntity.addPotionEffect(new PotionEffect(PotionEffectType.SLOWNESS, 40, 2));
equip(world, livingEntity, ink);
}
}
@@ -93,7 +93,7 @@ public void run(){
LivingEntity livingEntity = (LivingEntity) nearby;
livingEntity.setNoDamageTicks(0);
livingEntity.damage(16);
- livingEntity.addPotionEffect(new PotionEffect(PotionEffectType.SLOW, 80, 4));
+ livingEntity.addPotionEffect(new PotionEffect(PotionEffectType.SLOWNESS, 80, 4));
equip(world, livingEntity, ink);
}
}
diff --git a/src/main/java/com/klin/holoItems/collections/hidden/franCollection/items/SlimeJelly.java b/src/main/java/com/klin/holoItems/collections/hidden/franCollection/items/SlimeJelly.java
index 9f14ede..3f7fb56 100644
--- a/src/main/java/com/klin/holoItems/collections/hidden/franCollection/items/SlimeJelly.java
+++ b/src/main/java/com/klin/holoItems/collections/hidden/franCollection/items/SlimeJelly.java
@@ -19,7 +19,7 @@
public class SlimeJelly extends LaserPointer implements Retaliable {
public static final String name = "slimeJelly";
- private static final Material material = Material.SCUTE;
+ private static final Material material = Material.TURTLE_SCUTE;
private static final String lore =
"Find opportunities to rejuvenate";
diff --git a/src/main/java/com/klin/holoItems/collections/hidden/klinCollection/items/Bore.java b/src/main/java/com/klin/holoItems/collections/hidden/klinCollection/items/Bore.java
index ac8402e..378683a 100644
--- a/src/main/java/com/klin/holoItems/collections/hidden/klinCollection/items/Bore.java
+++ b/src/main/java/com/klin/holoItems/collections/hidden/klinCollection/items/Bore.java
@@ -17,7 +17,7 @@
public class Bore extends Item implements Extractable {
public static final String name = "bore";
public static final Set accepted = new HashSet<>(){{
- add(Enchantment.DIG_SPEED);
+ add(Enchantment.EFFICIENCY);
add(Enchantment.SILK_TOUCH);
}};
diff --git a/src/main/java/com/klin/holoItems/collections/hidden/opCollection/items/CarnivalUnlimitedKrisWorks.java b/src/main/java/com/klin/holoItems/collections/hidden/opCollection/items/CarnivalUnlimitedKrisWorks.java
index e02bf9f..8fb7a04 100644
--- a/src/main/java/com/klin/holoItems/collections/hidden/opCollection/items/CarnivalUnlimitedKrisWorks.java
+++ b/src/main/java/com/klin/holoItems/collections/hidden/opCollection/items/CarnivalUnlimitedKrisWorks.java
@@ -128,7 +128,7 @@ public void run() {
}
double damage = swords.get(sword.getType())
- + 3 * (Utility.checkPotionEffect(player, PotionEffectType.INCREASE_DAMAGE) -
+ + 3 * (Utility.checkPotionEffect(player, PotionEffectType.STRENGTH) -
Utility.checkPotionEffect(player, PotionEffectType.WEAKNESS));
Location location = player.getEyeLocation();
World world = player.getWorld();
diff --git a/src/main/java/com/klin/holoItems/collections/hidden/opCollection/items/Falchion.java b/src/main/java/com/klin/holoItems/collections/hidden/opCollection/items/Falchion.java
index d567f01..490dc98 100644
--- a/src/main/java/com/klin/holoItems/collections/hidden/opCollection/items/Falchion.java
+++ b/src/main/java/com/klin/holoItems/collections/hidden/opCollection/items/Falchion.java
@@ -44,12 +44,12 @@ public Falchion(){
super(name, accepted, material, lore, durability, stackable, cost, armorPiece);
ItemMeta meta = item.getItemMeta();
- meta.addEnchant(Enchantment.DAMAGE_ALL, 10, true);
+ meta.addEnchant(Enchantment.SHARPNESS, 10, true);
meta.addEnchant(Enchantment.KNOCKBACK, 1, false);
item.setItemMeta(meta);
PotionMeta potMeta = (PotionMeta) pot.getItemMeta();
- potMeta.setBasePotionData(new PotionData(PotionType.INSTANT_DAMAGE, false, true));
+ potMeta.setBasePotionData(new PotionData(PotionType.HARMING, false, true));
pot.setItemMeta(potMeta);
}
diff --git a/src/main/java/com/klin/holoItems/collections/id2/anyaCollection/items/UnlimitedKrisWorks.java b/src/main/java/com/klin/holoItems/collections/id2/anyaCollection/items/UnlimitedKrisWorks.java
index 44fd39b..7f98806 100644
--- a/src/main/java/com/klin/holoItems/collections/id2/anyaCollection/items/UnlimitedKrisWorks.java
+++ b/src/main/java/com/klin/holoItems/collections/id2/anyaCollection/items/UnlimitedKrisWorks.java
@@ -29,7 +29,7 @@
public class UnlimitedKrisWorks extends Item implements Interactable {
public static final String name = "unlimitedKrisWorks";
- public static final Set accepted = Set.of(Enchantment.DURABILITY, Enchantment.LOYALTY, Enchantment.MENDING);
+ public static final Set accepted = Set.of(Enchantment.UNBREAKING, Enchantment.LOYALTY, Enchantment.MENDING);
private final Map swords;
private static final Material material = Material.GOLDEN_SWORD;
@@ -103,7 +103,7 @@ public void ability(PlayerInteractEvent event, Action action){
inv.removeItem(sword);
}
- double damage = swords.get(sword.getType()) + 3 * (Utility.checkPotionEffect(player, PotionEffectType.INCREASE_DAMAGE) -
+ double damage = swords.get(sword.getType()) + 3 * (Utility.checkPotionEffect(player, PotionEffectType.STRENGTH) -
Utility.checkPotionEffect(player, PotionEffectType.WEAKNESS));
Location location = player.getEyeLocation();
World world = player.getWorld();
diff --git a/src/main/java/com/klin/holoItems/collections/stars2/temmaCollection/items/SSKSword.java b/src/main/java/com/klin/holoItems/collections/stars2/temmaCollection/items/SSKSword.java
index 86232d0..c5577d2 100644
--- a/src/main/java/com/klin/holoItems/collections/stars2/temmaCollection/items/SSKSword.java
+++ b/src/main/java/com/klin/holoItems/collections/stars2/temmaCollection/items/SSKSword.java
@@ -22,7 +22,7 @@
public class SSKSword extends Item implements Afflictable {
public static final String name = "sskSword";
- public static final Set accepted = Stream.of(Enchantment.FIRE_ASPECT, Enchantment.DAMAGE_ALL, Enchantment.DAMAGE_ARTHROPODS, Enchantment.DAMAGE_UNDEAD, Enchantment.DURABILITY, Enchantment.LOOT_BONUS_MOBS, Enchantment.MENDING, Enchantment.KNOCKBACK, Enchantment.SWEEPING_EDGE).collect(Collectors.toCollection(HashSet::new));
+ public static final Set accepted = Stream.of(Enchantment.FIRE_ASPECT, Enchantment.SHARPNESS, Enchantment.BANE_OF_ARTHROPODS, Enchantment.SMITE, Enchantment.UNBREAKING, Enchantment.LOOTING, Enchantment.MENDING, Enchantment.KNOCKBACK, Enchantment.SWEEPING_EDGE).collect(Collectors.toCollection(HashSet::new));
private static final Material material = Material.DIAMOND_SWORD;
private static final int quantity = 1;
diff --git a/src/main/java/com/klin/holoItems/dungeons/inaDungeon/Attacks.java b/src/main/java/com/klin/holoItems/dungeons/inaDungeon/Attacks.java
index 5b19479..585f28d 100644
--- a/src/main/java/com/klin/holoItems/dungeons/inaDungeon/Attacks.java
+++ b/src/main/java/com/klin/holoItems/dungeons/inaDungeon/Attacks.java
@@ -199,7 +199,7 @@ public void run(){
if(squid==null && livingEntity instanceof Squid) {
squid = (Squid) livingEntity;
squid.addPotionEffect(new PotionEffect(PotionEffectType.LEVITATION, 60, 1));
- squid.addPotionEffect(new PotionEffect(PotionEffectType.DAMAGE_RESISTANCE, 60, 3));
+ squid.addPotionEffect(new PotionEffect(PotionEffectType.RESISTANCE, 60, 3));
}
}
}
diff --git a/src/main/java/com/klin/holoItems/dungeons/inaDungeon/Minesweeper.java b/src/main/java/com/klin/holoItems/dungeons/inaDungeon/Minesweeper.java
index 959c1e8..154743d 100644
--- a/src/main/java/com/klin/holoItems/dungeons/inaDungeon/Minesweeper.java
+++ b/src/main/java/com/klin/holoItems/dungeons/inaDungeon/Minesweeper.java
@@ -82,7 +82,7 @@ public void mine(BlockBreakEvent event){
world.playSound(loc, Sound.BLOCK_GLASS_BREAK, 4, 1);
return;
}
- player.addPotionEffect(new PotionEffect(PotionEffectType.SLOW, 10, 8));
+ player.addPotionEffect(new PotionEffect(PotionEffectType.SLOWNESS, 10, 8));
Entity entity = world.spawnEntity(loc, EntityType.EVOKER_FANGS);
entity.getPersistentDataContainer().set(Utility.pack, PersistentDataType.STRING, SharpenedFangs.name+":20");
world.playSound(loc, Sound.AMBIENT_CAVE, 4, 1);
diff --git a/src/main/java/com/klin/holoItems/dungeons/inaDungeon/members/Gura.java b/src/main/java/com/klin/holoItems/dungeons/inaDungeon/members/Gura.java
index 6f5a07d..b780b3c 100644
--- a/src/main/java/com/klin/holoItems/dungeons/inaDungeon/members/Gura.java
+++ b/src/main/java/com/klin/holoItems/dungeons/inaDungeon/members/Gura.java
@@ -51,8 +51,8 @@ public void ability(double angle, PlayerInteractEvent event) {
cooldown = true;
meta.getPersistentDataContainer().set(Utility.key, PersistentDataType.STRING, Torrent.name);
item.setItemMeta(meta);
- player.setVelocity(new Vector(0, 0.45+0.15*Utility.checkPotionEffect(player, PotionEffectType.JUMP), 0));
- PotionEffect effect = player.getPotionEffect(PotionEffectType.SLOW);
+ player.setVelocity(new Vector(0, 0.45+0.15*Utility.checkPotionEffect(player, PotionEffectType.JUMP_BOOST), 0));
+ PotionEffect effect = player.getPotionEffect(PotionEffectType.SLOWNESS);
int duration;
int amplifier;
if(effect==null) {
@@ -63,7 +63,7 @@ public void ability(double angle, PlayerInteractEvent event) {
duration = effect.getDuration();
amplifier = effect.getAmplifier();
}
- player.addPotionEffect(new PotionEffect(PotionEffectType.SLOW, 120, 6));
+ player.addPotionEffect(new PotionEffect(PotionEffectType.SLOWNESS, 120, 6));
player.addPotionEffect(new PotionEffect(PotionEffectType.LEVITATION, 120, 1));
player.spigot().sendMessage(ChatMessageType.ACTION_BAR, new TextComponent("Command: Torrent"));
new Task(HoloItems.getInstance(), 1, 1){
@@ -73,10 +73,10 @@ public void run(){
cooldown = false;
meta.getPersistentDataContainer().remove(Utility.key);
item.setItemMeta(meta);
- player.removePotionEffect(PotionEffectType.SLOW);
+ player.removePotionEffect(PotionEffectType.SLOWNESS);
player.removePotionEffect(PotionEffectType.LEVITATION);
if(duration-increment>0)
- player.addPotionEffect(new PotionEffect(PotionEffectType.SLOW, duration-increment, amplifier));
+ player.addPotionEffect(new PotionEffect(PotionEffectType.SLOWNESS, duration-increment, amplifier));
cancel();
return;
}
diff --git a/src/main/java/com/klin/holoItems/dungeons/inaDungeon/members/Watson.java b/src/main/java/com/klin/holoItems/dungeons/inaDungeon/members/Watson.java
index c980837..4eabb5c 100644
--- a/src/main/java/com/klin/holoItems/dungeons/inaDungeon/members/Watson.java
+++ b/src/main/java/com/klin/holoItems/dungeons/inaDungeon/members/Watson.java
@@ -80,7 +80,7 @@ public void run(){
return;
for(LivingEntity target : targets){
if(!airborne.contains(target)){
- target.addPotionEffect(new PotionEffect(PotionEffectType.SLOW, 6, 6));
+ target.addPotionEffect(new PotionEffect(PotionEffectType.SLOWNESS, 6, 6));
new Task(HoloItems.getInstance(), 6, 1){
int increment = 0;
boolean flip = true;
diff --git a/src/main/java/com/klin/holoItems/utility/Utility.java b/src/main/java/com/klin/holoItems/utility/Utility.java
index 6bc43ae..2571b8c 100644
--- a/src/main/java/com/klin/holoItems/utility/Utility.java
+++ b/src/main/java/com/klin/holoItems/utility/Utility.java
@@ -74,7 +74,7 @@ BlockFace.EAST, new Vector(1, 0, 0),
addAll(Utility.leggings);
addAll(Utility.boots);
}};
- public static final Set enchantedBoots = Set.of(Enchantment.PROTECTION_EXPLOSIONS, Enchantment.DEPTH_STRIDER, Enchantment.PROTECTION_FALL, Enchantment.PROTECTION_FIRE, Enchantment.FROST_WALKER, Enchantment.MENDING, Enchantment.PROTECTION_PROJECTILE, Enchantment.PROTECTION_ENVIRONMENTAL, Enchantment.SOUL_SPEED, Enchantment.THORNS, Enchantment.DURABILITY);
+ public static final Set enchantedBoots = Set.of(Enchantment.BLAST_PROTECTION, Enchantment.DEPTH_STRIDER, Enchantment.FEATHER_FALLING, Enchantment.FIRE_PROTECTION, Enchantment.FROST_WALKER, Enchantment.MENDING, Enchantment.PROJECTILE_PROTECTION, Enchantment.PROTECTION, Enchantment.SOUL_SPEED, Enchantment.THORNS, Enchantment.UNBREAKING);
public static final Set fences = Set.of(Material.ACACIA_FENCE, Material.BIRCH_FENCE, Material.OAK_FENCE, Material.DARK_OAK_FENCE, Material.CRIMSON_FENCE, Material.JUNGLE_FENCE, Material.NETHER_BRICK_FENCE, Material.SPRUCE_FENCE, Material.WARPED_FENCE, Material.CHAIN, Material.IRON_BARS, Material.GLASS_PANE, Material.BLACK_STAINED_GLASS_PANE, Material.RED_STAINED_GLASS_PANE, Material.GREEN_STAINED_GLASS_PANE, Material.BLUE_STAINED_GLASS_PANE, Material.PURPLE_STAINED_GLASS_PANE, Material.CYAN_STAINED_GLASS_PANE, Material.LIGHT_GRAY_STAINED_GLASS_PANE, Material.GRAY_STAINED_GLASS_PANE, Material.PINK_STAINED_GLASS_PANE, Material.LIME_STAINED_GLASS_PANE, Material.YELLOW_STAINED_GLASS_PANE, Material.LIGHT_BLUE_STAINED_GLASS_PANE, Material.MAGENTA_STAINED_GLASS_PANE, Material.ORANGE_STAINED_GLASS_PANE, Material.WHITE_STAINED_GLASS_PANE, Material.BROWN_STAINED_GLASS_PANE, Material.COBBLESTONE_WALL, Material.MOSSY_COBBLESTONE_WALL, Material.STONE_BRICK_WALL, Material.MOSSY_STONE_BRICK_WALL, Material.ANDESITE_WALL, Material.DIORITE_WALL, Material.GRANITE_WALL, Material.SANDSTONE_WALL, Material.RED_SANDSTONE_WALL, Material.BRICK_WALL, Material.PRISMARINE_WALL, Material.NETHER_BRICK_WALL, Material.RED_NETHER_BRICK_WALL, Material.END_STONE_BRICK_WALL, Material.BLACKSTONE_WALL, Material.POLISHED_BLACKSTONE_WALL, Material.POLISHED_BLACKSTONE_BRICK_WALL);
public static final Set flowers = Set.of(RED_MUSHROOM, BROWN_MUSHROOM, DANDELION, POPPY, BLUE_ORCHID, ALLIUM, AZURE_BLUET, RED_TULIP, ORANGE_TULIP, WHITE_TULIP, PINK_TULIP, OXEYE_DAISY, CORNFLOWER, LILY_OF_THE_VALLEY, WITHER_ROSE);
public static final Set humanoids = Set.of(EntityType.PLAYER, EntityType.ZOMBIE, EntityType.ZOMBIE_VILLAGER, EntityType.HUSK, EntityType.SKELETON, EntityType.STRAY, EntityType.PIGLIN_BRUTE, EntityType.PIGLIN, EntityType.ZOMBIFIED_PIGLIN, EntityType.DROWNED, EntityType.WITHER_SKELETON, EntityType.VILLAGER, EntityType.PILLAGER, EntityType.VINDICATOR, EntityType.EVOKER, EntityType.WITCH, EntityType.GIANT);
@@ -110,17 +110,17 @@ BlockFace.EAST, new Vector(1, 0, 0),
}}); }};
public static final Map durations = new HashMap<>() {{
put(PotionType.FIRE_RESISTANCE, 3600);
- put(PotionType.INSTANT_DAMAGE, 0);
- put(PotionType.INSTANT_HEAL, 0);
+ put(PotionType.HARMING, 0);
+ put(PotionType.HEALING, 0);
put(PotionType.INVISIBILITY, 3600);
- put(PotionType.JUMP, 3600);
+ put(PotionType.LEAPING, 3600);
put(PotionType.LUCK, 6000);
put(PotionType.NIGHT_VISION, 3600);
put(PotionType.POISON, 900);
- put(PotionType.REGEN, 900);
+ put(PotionType.REGENERATION, 900);
put(PotionType.SLOW_FALLING, 1800);
put(PotionType.SLOWNESS, 1800);
- put(PotionType.SPEED, 3600);
+ put(PotionType.SWIFTNESS, 3600);
put(PotionType.STRENGTH, 3600);
put(PotionType.TURTLE_MASTER, 400);
put(PotionType.WATER_BREATHING, 3600);
@@ -223,7 +223,7 @@ else if(durability>0) {
list.add("§fDurability: " + durability + "/" + durability);
}
if(shiny){
- meta.addEnchant(Enchantment.LUCK, 1, false);
+ meta.addEnchant(Enchantment.LUCK_OF_THE_SEA, 1, false);
meta.addItemFlags(ItemFlag.HIDE_ENCHANTS);
}
//boolean enchant = meta.getPersistentDataContainer().get(Utility.enchant, PersistentDataType.STRING)!=null;
@@ -314,17 +314,17 @@ public static boolean damage(ItemStack item, double damage, boolean crit,
return false;
if(strength) {
- int multiplier = checkPotionEffect(attacker, PotionEffectType.INCREASE_DAMAGE);
+ int multiplier = checkPotionEffect(attacker, PotionEffectType.STRENGTH);
damage = damage+3*multiplier*
- (checkPotionEffect(attacker, PotionEffectType.INCREASE_DAMAGE)-
+ (checkPotionEffect(attacker, PotionEffectType.STRENGTH)-
checkPotionEffect(attacker, PotionEffectType.WEAKNESS));
}
if(crit)
damage *= 1.5;
- if(target.hasPotionEffect(PotionEffectType.DAMAGE_RESISTANCE))
- damage *= Math.pow(0.8, target.getPotionEffect(PotionEffectType.DAMAGE_RESISTANCE).getAmplifier());
+ if(target.hasPotionEffect(PotionEffectType.RESISTANCE))
+ damage *= Math.pow(0.8, target.getPotionEffect(PotionEffectType.RESISTANCE).getAmplifier());
if(item!=null)
- damage += 0.5+0.5*item.getEnchantmentLevel(Enchantment.DAMAGE_ALL);
+ damage += 0.5+0.5*item.getEnchantmentLevel(Enchantment.SHARPNESS);
double thornsChance = 0;
if(target.getEquipment()!=null && humanoids.contains(target.getType())) {
ItemStack[] armor = target.getEquipment().getArmorContents();
@@ -333,16 +333,16 @@ public static boolean damage(ItemStack item, double damage, boolean crit,
if(piece==null || !piece.hasItemMeta())
continue;
thornsChance += 0.15*piece.getEnchantmentLevel(Enchantment.THORNS);
- projProtection += 0.08*piece.getEnchantmentLevel(Enchantment.PROTECTION_PROJECTILE);
+ projProtection += 0.08*piece.getEnchantmentLevel(Enchantment.PROJECTILE_PROTECTION);
}
if(projectile)
damage *= 1-Math.min(0.8, projProtection);
}
if (item!=null && target.getCategory().equals(EntityCategory.ARTHROPOD))
- damage += 2.5*item.getEnchantmentLevel(Enchantment.DAMAGE_ARTHROPODS);
+ damage += 2.5*item.getEnchantmentLevel(Enchantment.BANE_OF_ARTHROPODS);
if (item!=null && target.getCategory().equals(EntityCategory.UNDEAD))
- damage += 2.5*item.getEnchantmentLevel(Enchantment.DAMAGE_UNDEAD);
+ damage += 2.5*item.getEnchantmentLevel(Enchantment.SMITE);
int fire = item!=null ? item.getEnchantmentLevel(Enchantment.FIRE_ASPECT) : 0;
if(fire>0) {
@@ -372,9 +372,9 @@ public static void arrowDamage(ItemStack item, AbstractArrow abstractArrow, Livi
boolean flame = false;
int multishot = 1;
if (item != null) {
- damage *= (1 + (.25 * item.getEnchantmentLevel(Enchantment.ARROW_DAMAGE)));
- punch = item.getEnchantmentLevel(Enchantment.ARROW_KNOCKBACK) > 0;
- flame = item.getEnchantmentLevel(Enchantment.ARROW_FIRE) > 0;
+ damage *= (1 + (.25 * item.getEnchantmentLevel(Enchantment.POWER)));
+ punch = item.getEnchantmentLevel(Enchantment.PUNCH) > 0;
+ flame = item.getEnchantmentLevel(Enchantment.FLAME) > 0;
multishot = item.getEnchantmentLevel(Enchantment.MULTISHOT) > 0 ? 3 : 1;
}
@@ -386,8 +386,8 @@ public static void arrowDamage(ItemStack item, AbstractArrow abstractArrow, Livi
if (type != null) {
if (type.isInstant()) {
if (target.getCategory().equals(EntityCategory.UNDEAD) &&
- data.getType().equals(PotionType.INSTANT_DAMAGE) ||
- data.getType().equals(PotionType.INSTANT_HEAL)) {
+ data.getType().equals(PotionType.HARMING) ||
+ data.getType().equals(PotionType.HEALING)) {
if (damage < 12)
damage -= data.isUpgraded() ? 6 : 4;
} else
@@ -403,7 +403,7 @@ public static void arrowDamage(ItemStack item, AbstractArrow abstractArrow, Livi
}
if (punch)
target.setVelocity(abstractArrow.getVelocity().setY(0.1).multiply(
- item.getEnchantmentLevel(Enchantment.ARROW_KNOCKBACK)).multiply(multishot));
+ item.getEnchantmentLevel(Enchantment.PUNCH)).multiply(multishot));
if (flame)
target.setFireTicks(100*multishot);
if (damage >= 0) {
@@ -484,7 +484,7 @@ public static int addDurability(ItemStack item, double addend, LivingEntity play
return 0;
if(durability[0]==-1 || addend>0 && durability[0]==durability[1])
return (int) addend;
- int unbreaking = meta.getEnchantLevel(Enchantment.DURABILITY);
+ int unbreaking = meta.getEnchantLevel(Enchantment.UNBREAKING);
int total = durability[0]+(int) (addend*2);
if(addend<0 && Math.random()<(1f/(unbreaking+1))) {
durability[0] = durability[0]+(int) addend;
From 82b402e68aa3f459513f8a62e2820643f652413f Mon Sep 17 00:00:00 2001
From: mms0316 <79147443+mms0316@users.noreply.github.com>
Date: Sun, 27 Apr 2025 16:12:00 -0300
Subject: [PATCH 02/15] Update to 1.20.6 - non-trivial renames
---
.../collections/en2/SanaCollection/SanaCollection.java | 6 +++---
.../gamers/koroneCollection/items/CircleRenderer.java | 2 +-
.../gen0/suiseiCollection/items/Hoshiyumi.java | 2 +-
.../gen2/shionCollection/items/SecretBrew.java | 4 ++--
.../gen3/pekoraCollection/items/CarrotCannon.java | 2 +-
.../collections/gen5/botanCollection/items/Sentry.java | 6 +++---
.../collections/hidden/opCollection/items/Payload.java | 8 ++++----
.../hidden/opCollection/items/QuartzGranule.java | 2 +-
.../klin/holoItems/dungeons/inaDungeon/Maintenance.java | 2 +-
.../com/klin/holoItems/dungeons/inaDungeon/Payload.java | 4 ++--
.../holoItems/dungeons/inaDungeon/members/Watson.java | 2 +-
src/main/java/com/klin/holoItems/utility/Utility.java | 6 +++---
12 files changed, 23 insertions(+), 23 deletions(-)
diff --git a/src/main/java/com/klin/holoItems/collections/en2/SanaCollection/SanaCollection.java b/src/main/java/com/klin/holoItems/collections/en2/SanaCollection/SanaCollection.java
index ae6bef9..a327c57 100644
--- a/src/main/java/com/klin/holoItems/collections/en2/SanaCollection/SanaCollection.java
+++ b/src/main/java/com/klin/holoItems/collections/en2/SanaCollection/SanaCollection.java
@@ -96,9 +96,9 @@ public void inquire(Player player, ItemStack itemStack, PlayerInteractEntityEven
Utility.addEnchant(itemStack, (SpaceBreadSplash) (Collections.items.get(SpaceBreadSplash.name)));
Location loc = event.getRightClicked().getLocation().add(0, 1.4, 0);
World world = player.getWorld();
- world.spawnParticle(Particle.REDSTONE, loc, 4, 1, 1, 1, new Particle.DustOptions(Color.fromBGR(129, 1, 237), 2));
- world.spawnParticle(Particle.REDSTONE, loc, 4, 1, 1, 1, new Particle.DustOptions(Color.WHITE, 2));
- world.spawnParticle(Particle.REDSTONE, loc, 4, 1, 1, 1, new Particle.DustOptions(Color.BLUE, 2));
+ world.spawnParticle(Particle.DUST, loc, 4, 1, 1, 1, new Particle.DustOptions(Color.fromBGR(129, 1, 237), 2));
+ world.spawnParticle(Particle.DUST, loc, 4, 1, 1, 1, new Particle.DustOptions(Color.WHITE, 2));
+ world.spawnParticle(Particle.DUST, loc, 4, 1, 1, 1, new Particle.DustOptions(Color.BLUE, 2));
player.sendMessage("§a[§dSana§a]§f: §dLimiter REMOVED!");
return;
}
diff --git a/src/main/java/com/klin/holoItems/collections/gamers/koroneCollection/items/CircleRenderer.java b/src/main/java/com/klin/holoItems/collections/gamers/koroneCollection/items/CircleRenderer.java
index 919d0e9..ffd5c71 100644
--- a/src/main/java/com/klin/holoItems/collections/gamers/koroneCollection/items/CircleRenderer.java
+++ b/src/main/java/com/klin/holoItems/collections/gamers/koroneCollection/items/CircleRenderer.java
@@ -18,7 +18,7 @@ public void render(MapView mapView, MapCanvas mapCanvas, Player player) {
mapView.setCenterZ(z);
if(center==null) {
center = mapCanvas.getCursors().addCursor(0, 0, (byte) 8);
- center.setType(MapCursor.Type.SMALL_WHITE_CIRCLE);
+ center.setType(MapCursor.Type.PLAYER_OFF_LIMITS); // old "SMALL_WHITE_CIRCLE"
}
else{
center.setX((byte) 0);
diff --git a/src/main/java/com/klin/holoItems/collections/gen0/suiseiCollection/items/Hoshiyumi.java b/src/main/java/com/klin/holoItems/collections/gen0/suiseiCollection/items/Hoshiyumi.java
index b6f1481..54b914e 100644
--- a/src/main/java/com/klin/holoItems/collections/gen0/suiseiCollection/items/Hoshiyumi.java
+++ b/src/main/java/com/klin/holoItems/collections/gen0/suiseiCollection/items/Hoshiyumi.java
@@ -81,7 +81,7 @@ public void ability(PlayerInteractEvent event, Action action){
continue;
entity.setVelocity(entity.getVelocity().setY(1.4));
entity.setArrowsInBody(Math.max(0, entity.getArrowsInBody()-1));
- world.spawnParticle(Particle.EXPLOSION_LARGE, entity.getLocation(), 1);
+ world.spawnParticle(Particle.EXPLOSION, entity.getLocation(), 1);
world.playSound(entity.getLocation(), Sound.ENTITY_DRAGON_FIREBALL_EXPLODE, 0.2f, 1f);
if (player.getGameMode()!=GameMode.CREATIVE)
Utility.addDurability(item, -1, player);
diff --git a/src/main/java/com/klin/holoItems/collections/gen2/shionCollection/items/SecretBrew.java b/src/main/java/com/klin/holoItems/collections/gen2/shionCollection/items/SecretBrew.java
index 625aef5..145c521 100644
--- a/src/main/java/com/klin/holoItems/collections/gen2/shionCollection/items/SecretBrew.java
+++ b/src/main/java/com/klin/holoItems/collections/gen2/shionCollection/items/SecretBrew.java
@@ -60,7 +60,7 @@ public void run(){
if(!(itemMeta instanceof PotionMeta))
continue;
PotionMeta meta = (PotionMeta) itemMeta;
- meta.addItemFlags(ItemFlag.HIDE_POTION_EFFECTS);
+ meta.addItemFlags(ItemFlag.HIDE_ADDITIONAL_TOOLTIP);
meta.setColor(Utility.getRandom(Utility.colors.keySet()).get().getColor());
meta.setDisplayName("§f"+Utility.processType(item.getType().toString()));
meta.getPersistentDataContainer().set(Utility.key, PersistentDataType.STRING, name);
@@ -76,7 +76,7 @@ public void ability(BrewEvent event, ItemStack item, ItemStack ingredient, Brewe
public void run(){
ItemStack item = inv.getItem(slot);
PotionMeta meta = (PotionMeta) item.getItemMeta();
- meta.addItemFlags(ItemFlag.HIDE_POTION_EFFECTS);
+ meta.addItemFlags(ItemFlag.HIDE_ADDITIONAL_TOOLTIP);
meta.setColor(color);
meta.setDisplayName("§f"+Utility.processType(item.getType().toString()));
meta.getPersistentDataContainer().set(Utility.key, PersistentDataType.STRING, name);
diff --git a/src/main/java/com/klin/holoItems/collections/gen3/pekoraCollection/items/CarrotCannon.java b/src/main/java/com/klin/holoItems/collections/gen3/pekoraCollection/items/CarrotCannon.java
index ab8e037..6e9d985 100644
--- a/src/main/java/com/klin/holoItems/collections/gen3/pekoraCollection/items/CarrotCannon.java
+++ b/src/main/java/com/klin/holoItems/collections/gen3/pekoraCollection/items/CarrotCannon.java
@@ -108,7 +108,7 @@ public void effect(PlayerInteractEvent event){
public void run(){
if(!proj.isValid() || increment>=600){
- world.spawnParticle(Particle.EXPLOSION_LARGE, explosion, 1);
+ world.spawnParticle(Particle.EXPLOSION, explosion, 1);
Collection entities = world.getNearbyEntities(explosion, 1.5, 1.5, 1.5,
entity -> entity instanceof LivingEntity);
for(Entity entity : entities) {
diff --git a/src/main/java/com/klin/holoItems/collections/gen5/botanCollection/items/Sentry.java b/src/main/java/com/klin/holoItems/collections/gen5/botanCollection/items/Sentry.java
index b305562..796e189 100644
--- a/src/main/java/com/klin/holoItems/collections/gen5/botanCollection/items/Sentry.java
+++ b/src/main/java/com/klin/holoItems/collections/gen5/botanCollection/items/Sentry.java
@@ -216,7 +216,7 @@ private boolean cause(ItemStack item, Player player){
if(upgrade==0) {
Utility.cooldown(item, 20);
cost = Material.TNT;
- type = EntityType.PRIMED_TNT;
+ type = EntityType.TNT;
velocity.multiply(0.5).add(new Vector(0, 0.2, 0));
}
else if(upgrade==1) {
@@ -237,7 +237,7 @@ else if(upgrade==1) {
entity.setVelocity(velocity);
if(type==EntityType.SPECTRAL_ARROW)
entity.setGlowing(true);
- else if(type==EntityType.PRIMED_TNT){
+ else if(type==EntityType.TNT){
TNTPrimed tnt = (TNTPrimed) entity;
tnt.setFuseTicks(60);
new Task(HoloItems.getInstance(), 3, 1){
@@ -254,7 +254,7 @@ public void run(){
stand++;
}
if(increment>=48 || stand=60){
- world.spawnParticle(Particle.EXPLOSION_HUGE, loc, 1);
+ world.spawnParticle(Particle.EXPLOSION_EMITTER, loc, 1);
world.playSound(loc, Sound.ENTITY_DRAGON_FIREBALL_EXPLODE, 0.4f, 1f);
minecart.remove();
tnt.remove();
@@ -224,7 +224,7 @@ public void run(){
checked.add(center);
center.setType(Material.AIR);
- world.spawnParticle(Particle.EXPLOSION_LARGE, center.getLocation().add(0.5, 0, 0.5), 1);
+ world.spawnParticle(Particle.EXPLOSION, center.getLocation().add(0.5, 0, 0.5), 1);
world.playSound(loc, Sound.ENTITY_DRAGON_FIREBALL_EXPLODE, 0.1f, 1f);
for (Block block : new Block[]{
center.getRelative(BlockFace.UP),
@@ -250,14 +250,14 @@ public void run(){
if(ticks<=0){
Location loc = payload.getLocation();
- world.spawnParticle(Particle.EXPLOSION_HUGE, loc, 1);
+ world.spawnParticle(Particle.EXPLOSION_EMITTER, loc, 1);
world.playSound(loc, Sound.ENTITY_DRAGON_FIREBALL_EXPLODE, 1f, 1f);
payload.remove();
for(Entity entity : payload.getNearbyEntities(10, 10, 10)){
if(entity instanceof LivingEntity) {
((LivingEntity) entity).damage(100);
- world.spawnParticle(Particle.EXPLOSION_LARGE, entity.getLocation(), 1);
+ world.spawnParticle(Particle.EXPLOSION, entity.getLocation(), 1);
}
}
cancel();
diff --git a/src/main/java/com/klin/holoItems/collections/hidden/opCollection/items/QuartzGranule.java b/src/main/java/com/klin/holoItems/collections/hidden/opCollection/items/QuartzGranule.java
index 3eddf59..16967a5 100644
--- a/src/main/java/com/klin/holoItems/collections/hidden/opCollection/items/QuartzGranule.java
+++ b/src/main/java/com/klin/holoItems/collections/hidden/opCollection/items/QuartzGranule.java
@@ -206,7 +206,7 @@ public void ability(EntityDamageByEntityEvent event) {
}
hit();
World world = center.getWorld();
- world.spawnParticle(Particle.EXPLOSION_LARGE, center.getLocation().add(0.5, 0.5, 0.5), 1);
+ world.spawnParticle(Particle.EXPLOSION, center.getLocation().add(0.5, 0.5, 0.5), 1);
world.playSound(center.getLocation(), Sound.ENTITY_DRAGON_FIREBALL_EXPLODE, 0.1f, 1f);
return;
} else if(!(entity instanceof PolarBear))
diff --git a/src/main/java/com/klin/holoItems/dungeons/inaDungeon/Maintenance.java b/src/main/java/com/klin/holoItems/dungeons/inaDungeon/Maintenance.java
index 0be43ae..924f4e6 100644
--- a/src/main/java/com/klin/holoItems/dungeons/inaDungeon/Maintenance.java
+++ b/src/main/java/com/klin/holoItems/dungeons/inaDungeon/Maintenance.java
@@ -219,7 +219,7 @@ private void decay(Block block, int duration){
new BukkitRunnable(){
public void run(){
block.setType(Material.AIR);
- block.getWorld().spawnParticle(Particle.BLOCK_CRACK, block.getLocation().add(0.5,0.5,0.5), 40, 0, 0, 0, 4, block.getType().createBlockData());
+ block.getWorld().spawnParticle(Particle.BLOCK, block.getLocation().add(0.5,0.5,0.5), 40, 0, 0, 0, 4, block.getType().createBlockData());
decay.remove(block);
}
}.runTaskLater(HoloItems.getInstance(), duration).getTaskId());
diff --git a/src/main/java/com/klin/holoItems/dungeons/inaDungeon/Payload.java b/src/main/java/com/klin/holoItems/dungeons/inaDungeon/Payload.java
index 249654a..2efdfef 100644
--- a/src/main/java/com/klin/holoItems/dungeons/inaDungeon/Payload.java
+++ b/src/main/java/com/klin/holoItems/dungeons/inaDungeon/Payload.java
@@ -131,13 +131,13 @@ public void run(){
public void run(){
Location loc = tnt.getLocation();
if(increment>60 || tnt.isOnGround() || tnt.getVelocity().getZ()<0.1){
- world.spawnParticle(Particle.EXPLOSION_HUGE, loc, 1);
+ world.spawnParticle(Particle.EXPLOSION_EMITTER, loc, 1);
world.playSound(loc, Sound.ENTITY_DRAGON_FIREBALL_EXPLODE, 4, 1);
tnt.remove();
cancel();
return;
}
- world.spawnParticle(Particle.REDSTONE, loc, 1, new Particle.DustOptions(Color.RED, 1));
+ world.spawnParticle(Particle.DUST, loc, 1, new Particle.DustOptions(Color.RED, 1));
increment++;
}
};
diff --git a/src/main/java/com/klin/holoItems/dungeons/inaDungeon/members/Watson.java b/src/main/java/com/klin/holoItems/dungeons/inaDungeon/members/Watson.java
index 4eabb5c..fe6fd5a 100644
--- a/src/main/java/com/klin/holoItems/dungeons/inaDungeon/members/Watson.java
+++ b/src/main/java/com/klin/holoItems/dungeons/inaDungeon/members/Watson.java
@@ -70,7 +70,7 @@ public void run(){
cancel();
return;
}
- world.spawnParticle(Particle.REDSTONE, loc.add(dir), 1, new Particle.DustOptions(Color.WHITE, 1));
+ world.spawnParticle(Particle.DUST, loc.add(dir), 1, new Particle.DustOptions(Color.WHITE, 1));
increment += 0.2;
}
}
diff --git a/src/main/java/com/klin/holoItems/utility/Utility.java b/src/main/java/com/klin/holoItems/utility/Utility.java
index 2571b8c..c8a7a58 100644
--- a/src/main/java/com/klin/holoItems/utility/Utility.java
+++ b/src/main/java/com/klin/holoItems/utility/Utility.java
@@ -207,7 +207,7 @@ public static ItemStack process(String name, Material material, int quantity, St
ItemMeta meta = item.getItemMeta();
meta.setDisplayName("§6"+formatName(name));
List list = processStr(lore);
- meta.addItemFlags(ItemFlag.HIDE_POTION_EFFECTS);
+ meta.addItemFlags(ItemFlag.HIDE_ADDITIONAL_TOOLTIP);
if(meta instanceof Damageable) {
meta.setUnbreakable(true);
meta.addItemFlags(ItemFlag.HIDE_UNBREAKABLE);
@@ -684,9 +684,9 @@ public static Map explode(Location loc, int radius, Map
Date: Sun, 27 Apr 2025 16:25:11 -0300
Subject: [PATCH 03/15] Update to 1.20.6 - handle removal of
PotionType.UNCRAFTABLE - Used by Sake, and PotionSatchel had code to
specifically ignore PotionType.UNCRAFTABLE - Changed to a Mundane Potion,
which may have unintended consequences (by being able to be converted in
other recipes) - Added new namespace "id" to be able to specifically
recognize Sake. If the already existing namespace "key" was used, it would
need more changes (such as inheriting Consumable in order to be able to be
right-clicked)
---
.../shionCollection/items/PotionSatchel.java | 3 +-
.../gen5/lamyCollection/items/Starch.java | 31 +++++++++++++++++--
.../com/klin/holoItems/utility/Utility.java | 7 +++++
3 files changed, 37 insertions(+), 4 deletions(-)
diff --git a/src/main/java/com/klin/holoItems/collections/gen2/shionCollection/items/PotionSatchel.java b/src/main/java/com/klin/holoItems/collections/gen2/shionCollection/items/PotionSatchel.java
index aece009..90a809e 100644
--- a/src/main/java/com/klin/holoItems/collections/gen2/shionCollection/items/PotionSatchel.java
+++ b/src/main/java/com/klin/holoItems/collections/gen2/shionCollection/items/PotionSatchel.java
@@ -4,6 +4,7 @@
import com.klin.holoItems.HoloItems;
import com.klin.holoItems.Item;
import com.klin.holoItems.abstractClasses.Pack;
+import com.klin.holoItems.collections.gen5.lamyCollection.items.Starch.Sake;
import com.klin.holoItems.interfaces.Mixable;
import com.klin.holoItems.utility.Utility;
import net.md_5.bungee.api.ChatMessageType;
@@ -71,7 +72,7 @@ public int ability(Inventory inv, ItemStack item, Player player) {
PotionData potData = ((PotionMeta) meta).getBasePotionData();
PotionType type = potData.getType();
String id = meta.getPersistentDataContainer().get(Utility.key, PersistentDataType.STRING);
- boolean drop = id != null && !(Collections.items.get(id) instanceof Mixable) || type==PotionType.UNCRAFTABLE;
+ boolean drop = (id != null && !(Collections.items.get(id) instanceof Mixable)) || Sake.isSakePotion(content);
if(material!=Material.SPLASH_POTION && material!=Material.LINGERING_POTION || drop) {
world.dropItemNaturally(loc, content);
continue;
diff --git a/src/main/java/com/klin/holoItems/collections/gen5/lamyCollection/items/Starch.java b/src/main/java/com/klin/holoItems/collections/gen5/lamyCollection/items/Starch.java
index 333dc6b..3d61aff 100644
--- a/src/main/java/com/klin/holoItems/collections/gen5/lamyCollection/items/Starch.java
+++ b/src/main/java/com/klin/holoItems/collections/gen5/lamyCollection/items/Starch.java
@@ -5,6 +5,8 @@
import com.klin.holoItems.collections.gen5.lamyCollection.LamyCollection;
import com.klin.holoItems.interfaces.Brewable;
import com.klin.holoItems.interfaces.Consumable;
+import com.klin.holoItems.utility.Utility;
+
import org.bukkit.Bukkit;
import org.bukkit.Color;
import org.bukkit.Material;
@@ -16,7 +18,7 @@
import org.bukkit.inventory.ShapelessRecipe;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.inventory.meta.PotionMeta;
-import org.bukkit.potion.PotionData;
+import org.bukkit.persistence.PersistentDataType;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
import org.bukkit.potion.PotionType;
@@ -58,7 +60,7 @@ public void run(){
if(!(itemMeta instanceof PotionMeta))
continue;
PotionMeta meta = (PotionMeta) item.getItemMeta();
- PotionType type = meta.getBasePotionData().getType();
+ PotionType type = meta.getBasePotionType();
int multiplier = 1;
if(item.getType()==Material.LINGERING_POTION)
multiplier = 4;
@@ -68,9 +70,10 @@ else if(type==PotionType.SWIFTNESS)
meta.addCustomEffect(new PotionEffect(PotionEffectType.BLINDNESS, 800/multiplier, 1), true);
else
continue;
- meta.setBasePotionData(new PotionData(PotionType.UNCRAFTABLE));
+ meta.setBasePotionType(PotionType.MUNDANE);
meta.setDisplayName("§6Sake");
meta.setColor(Color.SILVER);
+ Sake.setSakeId(meta);
item.setItemMeta(meta);
}
}
@@ -78,4 +81,26 @@ else if(type==PotionType.SWIFTNESS)
}
public void ability(PlayerItemConsumeEvent event, ItemStack item) {}
+
+ public class Sake {
+ //TODO: move potion transformation above to here
+
+ private static final String id = "sake_potion";
+
+ public static void setSakeId(ItemMeta itemMeta) {
+ itemMeta.getPersistentDataContainer().set(Utility.id, PersistentDataType.STRING, id);
+ }
+
+ public static boolean isSakePotion(ItemStack item) {
+ if (item == null || item.getType() != Material.POTION) {
+ return false;
+ }
+ ItemMeta meta = item.getItemMeta();
+ if (meta == null || !(meta instanceof PotionMeta)) {
+ return false;
+ }
+ String id = meta.getPersistentDataContainer().get(Utility.id, PersistentDataType.STRING);
+ return Sake.id.equals(id);
+ }
+ }
}
diff --git a/src/main/java/com/klin/holoItems/utility/Utility.java b/src/main/java/com/klin/holoItems/utility/Utility.java
index c8a7a58..6440af5 100644
--- a/src/main/java/com/klin/holoItems/utility/Utility.java
+++ b/src/main/java/com/klin/holoItems/utility/Utility.java
@@ -42,6 +42,13 @@
public class Utility {
public static final NamespacedKey key = new NamespacedKey(HoloItems.getInstance(), "holoItems");
+
+ //New namespace for recognizing specific items
+ //There is scuff using the already existing 'key' namespace
+ //As an example, usable items (like potions) that have a 'key' and don't inherit from Consumable are cancelled
+ //Gradually, the usage of 'key' namespace will be reviewed, possibly being limited to very specific usages
+ public static final NamespacedKey id = new NamespacedKey(HoloItems.getInstance(), "id");
+
public static final NamespacedKey stack = new NamespacedKey(HoloItems.getInstance(), "stack");
public static final NamespacedKey cooldown = new NamespacedKey(HoloItems.getInstance(), "cooldown");
public static final NamespacedKey enchant = new NamespacedKey(HoloItems.getInstance(), "enchant");
From a6842ce911570f62e5b3dcc4ca53055c25b74e18 Mon Sep 17 00:00:00 2001
From: mms0316 <79147443+mms0316@users.noreply.github.com>
Date: Sun, 27 Apr 2025 16:48:24 -0300
Subject: [PATCH 04/15] fix Comet - target.getCategory() throws exceptions in
> 1.20.5, and emits a warning to use Tags
---
.../gen0/suiseiCollection/items/Comet.java | 230 ++++++++++--------
.../com/klin/holoItems/utility/Utility.java | 4 +-
2 files changed, 124 insertions(+), 110 deletions(-)
diff --git a/src/main/java/com/klin/holoItems/collections/gen0/suiseiCollection/items/Comet.java b/src/main/java/com/klin/holoItems/collections/gen0/suiseiCollection/items/Comet.java
index 9ee66bc..cec8e0d 100644
--- a/src/main/java/com/klin/holoItems/collections/gen0/suiseiCollection/items/Comet.java
+++ b/src/main/java/com/klin/holoItems/collections/gen0/suiseiCollection/items/Comet.java
@@ -73,113 +73,127 @@ public void registerRecipes(){
}
public void ability(PlayerInteractEvent event, Action action){
- event.setCancelled(true);
- // if(!(action==Action.RIGHT_CLICK_AIR || action==Action.RIGHT_CLICK_BLOCK) ||
- // event.useInteractedBlock()==Event.Result.ALLOW)
- // return;
-
- // Player player = event.getPlayer();
- // if(player.hasPotionEffect(PotionEffectType.WEAKNESS)){
- // player.sendMessage("§7The axe weighs heavily on your arms");
- // return;
- // }
- // ItemStack item = event.getItem();
- // if(Utility.onCooldown(item))
- // return;
- // Utility.cooldown(item, 20);
- // double damage = 4 + 3 * (Utility.checkPotionEffect(player, PotionEffectType.STRENGTH) -
- // Utility.checkPotionEffect(player, PotionEffectType.WEAKNESS));
-
- // Location location = player.getEyeLocation();
- // World world = player.getWorld();
- // boolean hand = event.getHand()==EquipmentSlot.HAND;
-
- // double distance = 50;
- // Vector dir = location.getDirection().multiply(3);
- // Set targets = new HashSet<>();
- // for(int i=0; i<1+item.getEnchantmentLevel(Enchantment.PIERCING); i++) {
- // RayTraceResult result = world.rayTrace(location, dir, 50,
- // FluidCollisionMode.NEVER, true, 0.5,
- // entity -> (entity != player &&
- // entity instanceof LivingEntity && !(entity instanceof ArmorStand) &&
- // !targets.contains(entity)));
- // if (result != null) {
- // LivingEntity entity = (LivingEntity) result.getHitEntity();
- // if (entity != null) {
- // distance = location.distance(result.getHitEntity().getLocation());
- // targets.add(entity);
- // }
- // else if (result.getHitBlock() != null) {
- // distance = location.distance(result.getHitBlock().getLocation());
- // break;
- // }
- // }
- // }
- // double iterations = distance/3;
-
- // ArmorStand stand = world.spawn(location.clone().add(0, -1, 0), ArmorStand.class);
- // stand.setInvisible(true);
- // stand.setInvulnerable(true);
- // stand.setGravity(false);
- // stand.setBasePlate(false);
- // stand.setCanPickupItems(false);
- // stand.addEquipmentLock(EquipmentSlot.CHEST, ArmorStand.LockType.ADDING);
- // stand.addEquipmentLock(EquipmentSlot.FEET, ArmorStand.LockType.ADDING);
- // stand.addEquipmentLock(EquipmentSlot.HEAD, ArmorStand.LockType.ADDING);
- // stand.addEquipmentLock(EquipmentSlot.LEGS, ArmorStand.LockType.ADDING);
- // stand.getPersistentDataContainer().set(Utility.key, PersistentDataType.STRING, "hI");
- // if(hand) {
- // stand.addEquipmentLock(EquipmentSlot.HAND, ArmorStand.LockType.REMOVING_OR_CHANGING);
- // stand.addEquipmentLock(EquipmentSlot.OFF_HAND, ArmorStand.LockType.ADDING);
- // stand.getEquipment().setItemInMainHand(item);
- // }
- // else {
- // stand.addEquipmentLock(EquipmentSlot.OFF_HAND, ArmorStand.LockType.REMOVING_OR_CHANGING);
- // stand.addEquipmentLock(EquipmentSlot.HAND, ArmorStand.LockType.ADDING);
- // stand.getEquipment().setItemInOffHand(item);
- // }
-
- // String enchant = item.getItemMeta().getPersistentDataContainer().get(Utility.enchant, PersistentDataType.STRING);
- // boolean bread = enchant!=null && enchant.contains(SpaceBreadSplash.name);
- // double height = player.getLocation().getY();
-
- // if (player.getGameMode()!=GameMode.CREATIVE)
- // Utility.addDurability(item, -1, player);
- // new Task(HoloItems.getInstance(), 1, 1){
- // double increment = 0;
- // final boolean crit = player.getLocation().getY()=0.3*iterations) {
- // stand.remove();
- // if(!targets.isEmpty()) {
- // if (player.getGameMode()!=GameMode.CREATIVE)
- // Utility.addDurability(item, 0.5, player);
- // ItemStack clone = item.clone();
- // if(bread) {
- // clone.addUnsafeEnchantment(Enchantment.SMITE, 5);
- // clone.addUnsafeEnchantment(Enchantment.BANE_OF_ARTHROPODS, 5);
- // clone.addUnsafeEnchantment(Enchantment.SHARPNESS, 5);
- // }
- // for (LivingEntity target : targets) {
- // if (target.isValid() && (!(target instanceof Player) || !((Player) target).isBlocking()))
- // Utility.damage(clone, damage, crit, player, target, false, true, false);
- // }
- // }
- // cancel();
- // return;
- // }
-
- // double angle = increment*Math.PI;
- // if(hand)
- // stand.setRightArmPose(stand.getRightArmPose().setX(angle));
- // else
- // stand.setLeftArmPose(stand.getLeftArmPose().setX(angle));
- // increment += 0.3;
-
- // stand.teleport(stand.getLocation().clone().
- // add(dir.getX(), -0.3*Math.sin(angle)+dir.getY(), dir.getZ()));
- // }
- // };
+ // Cancel if not right click
+ if(!(action==Action.RIGHT_CLICK_AIR || action==Action.RIGHT_CLICK_BLOCK) ||
+ event.useInteractedBlock()==Event.Result.ALLOW)
+ return;
+
+ // Cancel if owner is affected by Weakness
+ Player player = event.getPlayer();
+ if(player.hasPotionEffect(PotionEffectType.WEAKNESS)){
+ player.sendMessage("§7The axe weighs heavily on your arms");
+ return;
+ }
+
+ // Cancel if on cooldown
+ ItemStack item = event.getItem();
+ if(Utility.onCooldown(item))
+ return;
+ Utility.cooldown(item, 20);
+
+ // TODO: Remove check for PotionEffectType.WEAKNESS, since Comet is cancelled if player is affected by Weakness
+ double damage = 4 + 3 * (Utility.checkPotionEffect(player, PotionEffectType.STRENGTH) -
+ Utility.checkPotionEffect(player, PotionEffectType.WEAKNESS));
+
+ Location location = player.getEyeLocation();
+ World world = player.getWorld();
+ boolean hand = event.getHand()==EquipmentSlot.HAND;
+
+ double distance = 50;
+ Vector dir = location.getDirection().multiply(3);
+ Set targets = new HashSet<>();
+
+ // Raytrace to find entities in the way. If piercing is applied, do it multiple times
+ for(int i=0; i<1+item.getEnchantmentLevel(Enchantment.PIERCING); i++) {
+ RayTraceResult result = world.rayTrace(location, dir, 50,
+ FluidCollisionMode.NEVER, true, 0.5,
+ entity -> (entity != player &&
+ entity instanceof LivingEntity && !(entity instanceof ArmorStand) &&
+ !targets.contains(entity))); // TODO: remove this, since Set<> should be enough
+ if (result != null) {
+ LivingEntity entity = (LivingEntity) result.getHitEntity();
+ if (entity != null) {
+ distance = location.distance(result.getHitEntity().getLocation());
+ targets.add(entity);
+ }
+ else if (result.getHitBlock() != null) {
+ distance = location.distance(result.getHitBlock().getLocation());
+ break;
+ }
+ }
+ }
+ double iterations = distance/3;
+
+ //TODO: change usage of ArmorStand to send visual packets instead
+ ArmorStand stand = world.spawn(location.clone().add(0, -1, 0), ArmorStand.class);
+ stand.setInvisible(true);
+ stand.setInvulnerable(true);
+ stand.setGravity(false);
+ stand.setBasePlate(false);
+ stand.setCanPickupItems(false);
+ stand.addEquipmentLock(EquipmentSlot.CHEST, ArmorStand.LockType.ADDING);
+ stand.addEquipmentLock(EquipmentSlot.FEET, ArmorStand.LockType.ADDING);
+ stand.addEquipmentLock(EquipmentSlot.HEAD, ArmorStand.LockType.ADDING);
+ stand.addEquipmentLock(EquipmentSlot.LEGS, ArmorStand.LockType.ADDING);
+ stand.getPersistentDataContainer().set(Utility.key, PersistentDataType.STRING, "hI");
+ if(hand) {
+ stand.addEquipmentLock(EquipmentSlot.HAND, ArmorStand.LockType.REMOVING_OR_CHANGING);
+ stand.addEquipmentLock(EquipmentSlot.OFF_HAND, ArmorStand.LockType.ADDING);
+ stand.getEquipment().setItemInMainHand(item);
+ }
+ else {
+ stand.addEquipmentLock(EquipmentSlot.OFF_HAND, ArmorStand.LockType.REMOVING_OR_CHANGING);
+ stand.addEquipmentLock(EquipmentSlot.HAND, ArmorStand.LockType.ADDING);
+ stand.getEquipment().setItemInOffHand(item);
+ }
+
+ // Check if SpaceBreadSplash is applied
+ String enchant = item.getItemMeta().getPersistentDataContainer().get(Utility.enchant, PersistentDataType.STRING);
+ boolean bread = enchant!=null && enchant.contains(SpaceBreadSplash.name);
+ double height = player.getLocation().getY();
+
+ // Consume durability
+ if (player.getGameMode()!=GameMode.CREATIVE)
+ Utility.addDurability(item, -1, player);
+
+ new Task(HoloItems.getInstance(), 1, 1){
+ double increment = 0;
+ final boolean crit = player.getLocation().getY()=0.3*iterations) {
+ stand.remove();
+ if(!targets.isEmpty()) {
+ // Restore half durability
+ if (player.getGameMode()!=GameMode.CREATIVE)
+ Utility.addDurability(item, 0.5, player);
+
+ // Prepare a clone for Utility.damage()
+ ItemStack clone = item.clone();
+ if(bread) {
+ clone.addUnsafeEnchantment(Enchantment.SMITE, 5);
+ clone.addUnsafeEnchantment(Enchantment.BANE_OF_ARTHROPODS, 5);
+ clone.addUnsafeEnchantment(Enchantment.SHARPNESS, 5);
+ }
+ for (LivingEntity target : targets) {
+ if (target.isValid() && (!(target instanceof Player) || !((Player) target).isBlocking()))
+ Utility.damage(clone, damage, crit, player, target, false, true, false);
+ }
+ }
+ cancel();
+ return;
+ }
+
+ double angle = increment*Math.PI;
+ if(hand)
+ stand.setRightArmPose(stand.getRightArmPose().setX(angle));
+ else
+ stand.setLeftArmPose(stand.getLeftArmPose().setX(angle));
+ increment += 0.3;
+
+ stand.teleport(stand.getLocation().clone().
+ add(dir.getX(), -0.3*Math.sin(angle)+dir.getY(), dir.getZ()));
+ }
+ };
}
}
diff --git a/src/main/java/com/klin/holoItems/utility/Utility.java b/src/main/java/com/klin/holoItems/utility/Utility.java
index 6440af5..cdb7cf8 100644
--- a/src/main/java/com/klin/holoItems/utility/Utility.java
+++ b/src/main/java/com/klin/holoItems/utility/Utility.java
@@ -346,9 +346,9 @@ public static boolean damage(ItemStack item, double damage, boolean crit,
damage *= 1-Math.min(0.8, projProtection);
}
- if (item!=null && target.getCategory().equals(EntityCategory.ARTHROPOD))
+ if (item!=null && Tag.ENTITY_TYPES_SENSITIVE_TO_BANE_OF_ARTHROPODS.isTagged(target.getType()))
damage += 2.5*item.getEnchantmentLevel(Enchantment.BANE_OF_ARTHROPODS);
- if (item!=null && target.getCategory().equals(EntityCategory.UNDEAD))
+ if (item!=null && Tag.ENTITY_TYPES_SENSITIVE_TO_SMITE.isTagged(target.getType()))
damage += 2.5*item.getEnchantmentLevel(Enchantment.SMITE);
int fire = item!=null ? item.getEnchantmentLevel(Enchantment.FIRE_ASPECT) : 0;
From b6e590cac847a499e9be44fb26e9fe283b66abf1 Mon Sep 17 00:00:00 2001
From: mms0316 <79147443+mms0316@users.noreply.github.com>
Date: Sun, 27 Apr 2025 23:52:55 -0300
Subject: [PATCH 05/15] Update Java to 21 for Paper API 1.20.5+
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index 57b446c..d9ef177 100644
--- a/pom.xml
+++ b/pom.xml
@@ -25,7 +25,7 @@
- 17
+ 21
UTF-8
From 242060151b5a0129a5ad770d9bcbbf8fe87e009c Mon Sep 17 00:00:00 2001
From: mms0316 <79147443+mms0316@users.noreply.github.com>
Date: Mon, 28 Apr 2025 00:00:04 -0300
Subject: [PATCH 06/15] Update dependencies
---
pom.xml | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/pom.xml b/pom.xml
index d9ef177..356d18c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -34,19 +34,19 @@
maven-clean-plugin
- 3.4.0
+ 3.4.1
maven-compiler-plugin
- 3.13.0
+ 3.14.0
maven-resources-plugin
- 3.2.0
+ 3.3.1
maven-jar-plugin
- 3.2.0
+ 3.4.2
From 097d82dbee9802607423934025778e9666839c00 Mon Sep 17 00:00:00 2001
From: mms0316 <79147443+mms0316@users.noreply.github.com>
Date: Mon, 28 Apr 2025 00:02:51 -0300
Subject: [PATCH 07/15] Update workflow to Java 21
---
.github/workflows/build.yml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 364e00a..0b17cbc 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -9,11 +9,11 @@ jobs:
steps:
- uses: actions/checkout@v4
- - name: Set up JDK 17
+ - name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'temurin'
- java-version: '17'
+ java-version: '21'
- name: Build with Maven
run: mvn -B package --file pom.xml
- name: Upload build artifact
From dcb00fedd4e1a87f1217420e6c4f021718a6563c Mon Sep 17 00:00:00 2001
From: mms0316
Date: Wed, 30 Apr 2025 00:09:45 -0300
Subject: [PATCH 08/15] Remove unneeded code for Comet
---
.../collections/gen0/suiseiCollection/items/Comet.java | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/src/main/java/com/klin/holoItems/collections/gen0/suiseiCollection/items/Comet.java b/src/main/java/com/klin/holoItems/collections/gen0/suiseiCollection/items/Comet.java
index cec8e0d..12f34bb 100644
--- a/src/main/java/com/klin/holoItems/collections/gen0/suiseiCollection/items/Comet.java
+++ b/src/main/java/com/klin/holoItems/collections/gen0/suiseiCollection/items/Comet.java
@@ -91,9 +91,7 @@ public void ability(PlayerInteractEvent event, Action action){
return;
Utility.cooldown(item, 20);
- // TODO: Remove check for PotionEffectType.WEAKNESS, since Comet is cancelled if player is affected by Weakness
- double damage = 4 + 3 * (Utility.checkPotionEffect(player, PotionEffectType.STRENGTH) -
- Utility.checkPotionEffect(player, PotionEffectType.WEAKNESS));
+ double damage = 4 + 3 * (Utility.checkPotionEffect(player, PotionEffectType.STRENGTH));
Location location = player.getEyeLocation();
World world = player.getWorld();
@@ -108,8 +106,7 @@ public void ability(PlayerInteractEvent event, Action action){
RayTraceResult result = world.rayTrace(location, dir, 50,
FluidCollisionMode.NEVER, true, 0.5,
entity -> (entity != player &&
- entity instanceof LivingEntity && !(entity instanceof ArmorStand) &&
- !targets.contains(entity))); // TODO: remove this, since Set<> should be enough
+ entity instanceof LivingEntity && !(entity instanceof ArmorStand)));
if (result != null) {
LivingEntity entity = (LivingEntity) result.getHitEntity();
if (entity != null) {
From 79367ef84b8f4b7ef7e59cffd806fbf12d734521 Mon Sep 17 00:00:00 2001
From: mms0316
Date: Wed, 30 Apr 2025 00:12:16 -0300
Subject: [PATCH 09/15] Change use of Armor Stand to ItemDisplay
---
.../gen0/suiseiCollection/items/Comet.java | 138 +++++++++++-------
1 file changed, 82 insertions(+), 56 deletions(-)
diff --git a/src/main/java/com/klin/holoItems/collections/gen0/suiseiCollection/items/Comet.java b/src/main/java/com/klin/holoItems/collections/gen0/suiseiCollection/items/Comet.java
index 12f34bb..6d4fdee 100644
--- a/src/main/java/com/klin/holoItems/collections/gen0/suiseiCollection/items/Comet.java
+++ b/src/main/java/com/klin/holoItems/collections/gen0/suiseiCollection/items/Comet.java
@@ -9,6 +9,7 @@
import org.bukkit.*;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.entity.ArmorStand;
+import org.bukkit.entity.ItemDisplay;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.Event;
@@ -20,7 +21,9 @@
import org.bukkit.persistence.PersistentDataType;
import org.bukkit.potion.PotionEffectType;
import org.bukkit.util.RayTraceResult;
+import org.bukkit.util.Transformation;
import org.bukkit.util.Vector;
+import org.joml.Quaternionf;
import java.util.HashSet;
import java.util.Set;
@@ -95,15 +98,22 @@ public void ability(PlayerInteractEvent event, Action action){
Location location = player.getEyeLocation();
World world = player.getWorld();
- boolean hand = event.getHand()==EquipmentSlot.HAND;
- double distance = 50;
- Vector dir = location.getDirection().multiply(3);
+ final double maxDistance = 50;
+ double distance = maxDistance;
+
+ // Normalized vector
+ Vector direction = location.getDirection();
+
+ // Set vector speed as 3 blocks/sec
+ final double speed = 3;
+ Vector dir = direction.multiply(speed);
+
Set targets = new HashSet<>();
// Raytrace to find entities in the way. If piercing is applied, do it multiple times
for(int i=0; i<1+item.getEnchantmentLevel(Enchantment.PIERCING); i++) {
- RayTraceResult result = world.rayTrace(location, dir, 50,
+ RayTraceResult result = world.rayTrace(location, dir, maxDistance,
FluidCollisionMode.NEVER, true, 0.5,
entity -> (entity != player &&
entity instanceof LivingEntity && !(entity instanceof ArmorStand)));
@@ -119,31 +129,37 @@ else if (result.getHitBlock() != null) {
}
}
}
- double iterations = distance/3;
-
- //TODO: change usage of ArmorStand to send visual packets instead
- ArmorStand stand = world.spawn(location.clone().add(0, -1, 0), ArmorStand.class);
- stand.setInvisible(true);
- stand.setInvulnerable(true);
- stand.setGravity(false);
- stand.setBasePlate(false);
- stand.setCanPickupItems(false);
- stand.addEquipmentLock(EquipmentSlot.CHEST, ArmorStand.LockType.ADDING);
- stand.addEquipmentLock(EquipmentSlot.FEET, ArmorStand.LockType.ADDING);
- stand.addEquipmentLock(EquipmentSlot.HEAD, ArmorStand.LockType.ADDING);
- stand.addEquipmentLock(EquipmentSlot.LEGS, ArmorStand.LockType.ADDING);
- stand.getPersistentDataContainer().set(Utility.key, PersistentDataType.STRING, "hI");
- if(hand) {
- stand.addEquipmentLock(EquipmentSlot.HAND, ArmorStand.LockType.REMOVING_OR_CHANGING);
- stand.addEquipmentLock(EquipmentSlot.OFF_HAND, ArmorStand.LockType.ADDING);
- stand.getEquipment().setItemInMainHand(item);
- }
- else {
- stand.addEquipmentLock(EquipmentSlot.OFF_HAND, ArmorStand.LockType.REMOVING_OR_CHANGING);
- stand.addEquipmentLock(EquipmentSlot.HAND, ArmorStand.LockType.ADDING);
- stand.getEquipment().setItemInOffHand(item);
+
+ // Offset axe according to player's hand
+ int yOffset;
+ if (event.getHand() == EquipmentSlot.HAND) {
+ yOffset = 1; //perpendicular to the right
+ } else {
+ yOffset = -1; //perpendicular to the left
}
+ Vector handOffset = direction.clone()
+ .crossProduct(new Vector(0, yOffset, 0)) // move perpendicular
+ .multiply(0.5);
+
+ // Offset axe a bit backwards
+ Vector backwardOffset = direction.clone()
+ .multiply(-0.75);
+
+ // Add a downward offset to move the axe lower
+ Vector downwardOffset = new Vector(0, -0.2, 0);
+
+ Location axeLocation = location.clone().add(handOffset).add(backwardOffset).add(downwardOffset);
+
+ ItemDisplay axeDisplay = world.spawn(axeLocation, ItemDisplay.class);
+ axeDisplay.setItemStack(item);
+ axeDisplay.setViewRange((float)maxDistance);
+
+ // Rotate vertically (to face forward pointing frontwards)
+ Transformation currentTransformation = axeDisplay.getTransformation();
+ currentTransformation.getLeftRotation().rotateLocalY((float) Math.toRadians(-90));
+ axeDisplay.setTransformation(currentTransformation);
+
// Check if SpaceBreadSplash is applied
String enchant = item.getItemMeta().getPersistentDataContainer().get(Utility.enchant, PersistentDataType.STRING);
boolean bread = enchant!=null && enchant.contains(SpaceBreadSplash.name);
@@ -153,43 +169,53 @@ else if (result.getHitBlock() != null) {
if (player.getGameMode()!=GameMode.CREATIVE)
Utility.addDurability(item, -1, player);
+ final double maxIteration = distance / (double) speed;
new Task(HoloItems.getInstance(), 1, 1){
double increment = 0;
- final boolean crit = player.getLocation().getY()=0.3*iterations) {
- stand.remove();
- if(!targets.isEmpty()) {
- // Restore half durability
- if (player.getGameMode()!=GameMode.CREATIVE)
- Utility.addDurability(item, 0.5, player);
-
- // Prepare a clone for Utility.damage()
- ItemStack clone = item.clone();
- if(bread) {
- clone.addUnsafeEnchantment(Enchantment.SMITE, 5);
- clone.addUnsafeEnchantment(Enchantment.BANE_OF_ARTHROPODS, 5);
- clone.addUnsafeEnchantment(Enchantment.SHARPNESS, 5);
- }
- for (LivingEntity target : targets) {
- if (target.isValid() && (!(target instanceof Player) || !((Player) target).isBlocking()))
- Utility.damage(clone, damage, crit, player, target, false, true, false);
+ try {
+ if(increment >= maxIteration) {
+ if(!targets.isEmpty()) {
+ // Restore half durability
+ if (player.getGameMode()!=GameMode.CREATIVE)
+ Utility.addDurability(item, 0.5, player);
+
+ // Prepare for Utility.damage()
+ ItemStack itemForDamage = item;
+ if(bread) {
+ itemForDamage = item.clone();
+ itemForDamage.addUnsafeEnchantment(Enchantment.SMITE, 5);
+ itemForDamage.addUnsafeEnchantment(Enchantment.BANE_OF_ARTHROPODS, 5);
+ itemForDamage.addUnsafeEnchantment(Enchantment.SHARPNESS, 5);
+ }
+ for (LivingEntity target : targets) {
+ if (target.isValid() && (!(target instanceof Player) || !((Player) target).isBlocking()))
+ Utility.damage(itemForDamage, damage, crit, player, target, false, true, false);
+ }
}
+ axeDisplay.remove();
+ cancel();
+ return;
}
- cancel();
- return;
- }
- double angle = increment*Math.PI;
- if(hand)
- stand.setRightArmPose(stand.getRightArmPose().setX(angle));
- else
- stand.setLeftArmPose(stand.getLeftArmPose().setX(angle));
- increment += 0.3;
+ Location currentLocation = axeDisplay.getLocation();
+ currentLocation.add(dir);
+ axeDisplay.teleport(currentLocation);
+
+ Transformation currentTransformation = axeDisplay.getTransformation();
+ currentTransformation.getLeftRotation().mul(rotationPerTick);
+ axeDisplay.setTransformation(currentTransformation);
- stand.teleport(stand.getLocation().clone().
- add(dir.getX(), -0.3*Math.sin(angle)+dir.getY(), dir.getZ()));
+ ++increment;
+ } catch (Exception e) {
+ // Avoid being in loop logging errors in case of exception
+ HoloItems.getInstance().getLogger().warning("Error in Comet ability: " + e.getMessage());
+ axeDisplay.remove();
+ cancel();
+ }
}
};
}
From 0369925b3eb560836bc3261fc41c2bb3c414d42d Mon Sep 17 00:00:00 2001
From: mms0316
Date: Wed, 30 Apr 2025 22:49:14 -0300
Subject: [PATCH 10/15] Revert attempt to simplify ray tracing in Comet - It
was misleading due to usage of Set. The readded code is needed as a filter to
rayTrace in order for Piercing to work
---
.../collections/gen0/suiseiCollection/items/Comet.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/main/java/com/klin/holoItems/collections/gen0/suiseiCollection/items/Comet.java b/src/main/java/com/klin/holoItems/collections/gen0/suiseiCollection/items/Comet.java
index 6d4fdee..17ab746 100644
--- a/src/main/java/com/klin/holoItems/collections/gen0/suiseiCollection/items/Comet.java
+++ b/src/main/java/com/klin/holoItems/collections/gen0/suiseiCollection/items/Comet.java
@@ -116,7 +116,8 @@ public void ability(PlayerInteractEvent event, Action action){
RayTraceResult result = world.rayTrace(location, dir, maxDistance,
FluidCollisionMode.NEVER, true, 0.5,
entity -> (entity != player &&
- entity instanceof LivingEntity && !(entity instanceof ArmorStand)));
+ entity instanceof LivingEntity && !(entity instanceof ArmorStand) &&
+ !targets.contains(entity))); // Skip previously raytraced entities
if (result != null) {
LivingEntity entity = (LivingEntity) result.getHitEntity();
if (entity != null) {
From f45c485a397741e4fa3c1673bf6b7da42a026d97 Mon Sep 17 00:00:00 2001
From: mms0316
Date: Wed, 30 Apr 2025 23:17:42 -0300
Subject: [PATCH 11/15] Change positioning closer to old Comet
---
.../gen0/suiseiCollection/items/Comet.java | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/src/main/java/com/klin/holoItems/collections/gen0/suiseiCollection/items/Comet.java b/src/main/java/com/klin/holoItems/collections/gen0/suiseiCollection/items/Comet.java
index 17ab746..0a0f63f 100644
--- a/src/main/java/com/klin/holoItems/collections/gen0/suiseiCollection/items/Comet.java
+++ b/src/main/java/com/klin/holoItems/collections/gen0/suiseiCollection/items/Comet.java
@@ -141,11 +141,11 @@ else if (result.getHitBlock() != null) {
Vector handOffset = direction.clone()
.crossProduct(new Vector(0, yOffset, 0)) // move perpendicular
- .multiply(0.5);
+ .multiply(0.15);
- // Offset axe a bit backwards
+ // Offset axe backwards
Vector backwardOffset = direction.clone()
- .multiply(-0.75);
+ .multiply(-1);
// Add a downward offset to move the axe lower
Vector downwardOffset = new Vector(0, -0.2, 0);
@@ -156,9 +156,10 @@ else if (result.getHitBlock() != null) {
axeDisplay.setItemStack(item);
axeDisplay.setViewRange((float)maxDistance);
- // Rotate vertically (to face forward pointing frontwards)
Transformation currentTransformation = axeDisplay.getTransformation();
- currentTransformation.getLeftRotation().rotateLocalY((float) Math.toRadians(-90));
+ currentTransformation.getLeftRotation()
+ .rotateLocalY((float) Math.toRadians(-90)) // Rotate vertically (to face forward pointing frontwards)
+ .rotateLocalZ((float) Math.toRadians(-15)); // Slant inwards
axeDisplay.setTransformation(currentTransformation);
// Check if SpaceBreadSplash is applied
@@ -202,10 +203,12 @@ public void run(){
return;
}
+ // Move forward
Location currentLocation = axeDisplay.getLocation();
currentLocation.add(dir);
axeDisplay.teleport(currentLocation);
+ // Spin
Transformation currentTransformation = axeDisplay.getTransformation();
currentTransformation.getLeftRotation().mul(rotationPerTick);
axeDisplay.setTransformation(currentTransformation);
From c36a7bdc28d8038628e7940b44b2dad78a5a3711 Mon Sep 17 00:00:00 2001
From: mms0316
Date: Wed, 30 Apr 2025 23:31:53 -0300
Subject: [PATCH 12/15] Remove Comet from being shown in minimaps
---
.../holoItems/collections/gen0/suiseiCollection/items/Comet.java | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/main/java/com/klin/holoItems/collections/gen0/suiseiCollection/items/Comet.java b/src/main/java/com/klin/holoItems/collections/gen0/suiseiCollection/items/Comet.java
index 0a0f63f..1c0b0e9 100644
--- a/src/main/java/com/klin/holoItems/collections/gen0/suiseiCollection/items/Comet.java
+++ b/src/main/java/com/klin/holoItems/collections/gen0/suiseiCollection/items/Comet.java
@@ -153,6 +153,7 @@ else if (result.getHitBlock() != null) {
Location axeLocation = location.clone().add(handOffset).add(backwardOffset).add(downwardOffset);
ItemDisplay axeDisplay = world.spawn(axeLocation, ItemDisplay.class);
+ axeDisplay.setInvisible(true); // Remove mark in minimaps
axeDisplay.setItemStack(item);
axeDisplay.setViewRange((float)maxDistance);
From afbbc55661cedd92dcb9e3826e2214bd005134c9 Mon Sep 17 00:00:00 2001
From: mms0316
Date: Thu, 1 May 2025 15:49:04 -0300
Subject: [PATCH 13/15] Remove axe ItemDisplay if chunk unloads
---
.../holoItems/collections/gen0/suiseiCollection/items/Comet.java | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/main/java/com/klin/holoItems/collections/gen0/suiseiCollection/items/Comet.java b/src/main/java/com/klin/holoItems/collections/gen0/suiseiCollection/items/Comet.java
index 1c0b0e9..0c24bc2 100644
--- a/src/main/java/com/klin/holoItems/collections/gen0/suiseiCollection/items/Comet.java
+++ b/src/main/java/com/klin/holoItems/collections/gen0/suiseiCollection/items/Comet.java
@@ -154,6 +154,7 @@ else if (result.getHitBlock() != null) {
ItemDisplay axeDisplay = world.spawn(axeLocation, ItemDisplay.class);
axeDisplay.setInvisible(true); // Remove mark in minimaps
+ axeDisplay.setPersistent(false); // Remove if chunk unloads
axeDisplay.setItemStack(item);
axeDisplay.setViewRange((float)maxDistance);
From 1ccae8fda4e057782bc0b5244d159e6be31640a3 Mon Sep 17 00:00:00 2001
From: mms0316
Date: Thu, 1 May 2025 22:21:47 -0300
Subject: [PATCH 14/15] Fix Comet initial positioning - Fixed initial position
being different depending on player's angle, by using Translation - Moved
initialization to a Consumer, so it is set before a game tick. This fixes
entity dot in minimap in the first tick - Fixed offhand slant
---
.../gen0/suiseiCollection/items/Comet.java | 38 +++++++------------
1 file changed, 14 insertions(+), 24 deletions(-)
diff --git a/src/main/java/com/klin/holoItems/collections/gen0/suiseiCollection/items/Comet.java b/src/main/java/com/klin/holoItems/collections/gen0/suiseiCollection/items/Comet.java
index 0c24bc2..8b32a84 100644
--- a/src/main/java/com/klin/holoItems/collections/gen0/suiseiCollection/items/Comet.java
+++ b/src/main/java/com/klin/holoItems/collections/gen0/suiseiCollection/items/Comet.java
@@ -132,37 +132,27 @@ else if (result.getHitBlock() != null) {
}
// Offset axe according to player's hand
- int yOffset;
+ int rotation;
if (event.getHand() == EquipmentSlot.HAND) {
- yOffset = 1; //perpendicular to the right
+ rotation = -1;
} else {
- yOffset = -1; //perpendicular to the left
+ rotation = 1;
}
- Vector handOffset = direction.clone()
- .crossProduct(new Vector(0, yOffset, 0)) // move perpendicular
- .multiply(0.15);
+ ItemDisplay axeDisplay = world.spawn(location, ItemDisplay.class, entity -> {
+ // This block runs before entity is ticked, meaning it won't show a mark in minimap right as the axe is spawned
+ entity.setInvisible(true); // Remove mark in minimaps
+ entity.setPersistent(false); // Remove if chunk unloads
+ entity.setItemStack(item);
+ entity.setViewRange((float)maxDistance);
- // Offset axe backwards
- Vector backwardOffset = direction.clone()
- .multiply(-1);
-
- // Add a downward offset to move the axe lower
- Vector downwardOffset = new Vector(0, -0.2, 0);
-
- Location axeLocation = location.clone().add(handOffset).add(backwardOffset).add(downwardOffset);
-
- ItemDisplay axeDisplay = world.spawn(axeLocation, ItemDisplay.class);
- axeDisplay.setInvisible(true); // Remove mark in minimaps
- axeDisplay.setPersistent(false); // Remove if chunk unloads
- axeDisplay.setItemStack(item);
- axeDisplay.setViewRange((float)maxDistance);
-
- Transformation currentTransformation = axeDisplay.getTransformation();
+ Transformation currentTransformation = entity.getTransformation();
currentTransformation.getLeftRotation()
.rotateLocalY((float) Math.toRadians(-90)) // Rotate vertically (to face forward pointing frontwards)
- .rotateLocalZ((float) Math.toRadians(-15)); // Slant inwards
- axeDisplay.setTransformation(currentTransformation);
+ .rotateLocalZ((float) Math.toRadians(15 * rotation)); // Slant inwards
+ currentTransformation.getTranslation().add(0.4f * rotation, -0.25f, 0.5f); // Move closer to hand
+ entity.setTransformation(currentTransformation);
+});
// Check if SpaceBreadSplash is applied
String enchant = item.getItemMeta().getPersistentDataContainer().get(Utility.enchant, PersistentDataType.STRING);
From cb9b3e27d8705ffd65247cae2c765deeba479e73 Mon Sep 17 00:00:00 2001
From: mms0316
Date: Thu, 1 May 2025 22:24:27 -0300
Subject: [PATCH 15/15] Fix Comet animation - Animation was choppy, due to use
of teleport(). Fixed by using Translation. - Note: changed raytracing to use
the normalized vector instead of x3 speed vector. This didn't change anything
in testing.
---
.../gen0/suiseiCollection/items/Comet.java | 47 +++++++++----------
1 file changed, 23 insertions(+), 24 deletions(-)
diff --git a/src/main/java/com/klin/holoItems/collections/gen0/suiseiCollection/items/Comet.java b/src/main/java/com/klin/holoItems/collections/gen0/suiseiCollection/items/Comet.java
index 8b32a84..3a6986c 100644
--- a/src/main/java/com/klin/holoItems/collections/gen0/suiseiCollection/items/Comet.java
+++ b/src/main/java/com/klin/holoItems/collections/gen0/suiseiCollection/items/Comet.java
@@ -105,15 +105,11 @@ public void ability(PlayerInteractEvent event, Action action){
// Normalized vector
Vector direction = location.getDirection();
- // Set vector speed as 3 blocks/sec
- final double speed = 3;
- Vector dir = direction.multiply(speed);
-
Set targets = new HashSet<>();
// Raytrace to find entities in the way. If piercing is applied, do it multiple times
for(int i=0; i<1+item.getEnchantmentLevel(Enchantment.PIERCING); i++) {
- RayTraceResult result = world.rayTrace(location, dir, maxDistance,
+ RayTraceResult result = world.rayTrace(location, direction, maxDistance,
FluidCollisionMode.NEVER, true, 0.5,
entity -> (entity != player &&
entity instanceof LivingEntity && !(entity instanceof ArmorStand) &&
@@ -142,17 +138,17 @@ else if (result.getHitBlock() != null) {
ItemDisplay axeDisplay = world.spawn(location, ItemDisplay.class, entity -> {
// This block runs before entity is ticked, meaning it won't show a mark in minimap right as the axe is spawned
entity.setInvisible(true); // Remove mark in minimaps
- entity.setPersistent(false); // Remove if chunk unloads
- entity.setItemStack(item);
- entity.setViewRange((float)maxDistance);
-
- Transformation currentTransformation = entity.getTransformation();
- currentTransformation.getLeftRotation()
- .rotateLocalY((float) Math.toRadians(-90)) // Rotate vertically (to face forward pointing frontwards)
- .rotateLocalZ((float) Math.toRadians(15 * rotation)); // Slant inwards
- currentTransformation.getTranslation().add(0.4f * rotation, -0.25f, 0.5f); // Move closer to hand
+ entity.setPersistent(false); // Remove if chunk unloads
+ entity.setItemStack(item);
+ entity.setViewRange((float)maxDistance);
+
+ Transformation currentTransformation = entity.getTransformation();
+ currentTransformation.getLeftRotation()
+ .rotateLocalY((float) Math.toRadians(-90)) // Rotate vertically (to face forward pointing frontwards)
+ .rotateLocalZ((float) Math.toRadians(15 * rotation)); // Slant inwards
+ currentTransformation.getTranslation().add(0.4f * rotation, -0.25f, 0.5f); // Move closer to hand
entity.setTransformation(currentTransformation);
-});
+ });
// Check if SpaceBreadSplash is applied
String enchant = item.getItemMeta().getPersistentDataContainer().get(Utility.enchant, PersistentDataType.STRING);
@@ -163,7 +159,10 @@ else if (result.getHitBlock() != null) {
if (player.getGameMode()!=GameMode.CREATIVE)
Utility.addDurability(item, -1, player);
+ // Set vector speed as 3 blocks/tick
+ final double speed = 3;
final double maxIteration = distance / (double) speed;
+
new Task(HoloItems.getInstance(), 1, 1){
double increment = 0;
boolean crit = player.getLocation().getY()