Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
matsu1213 committed Aug 8, 2024
1 parent 2c938c6 commit 5df9cfc
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package net.azisaba.leoncsaddon;

import com.shampaggon.crackshot.events.WeaponDamageEntityEvent;
import org.bukkit.Bukkit;
import org.bukkit.entity.Arrow;
import org.bukkit.entity.Egg;
import org.bukkit.entity.Player;
Expand All @@ -19,7 +20,9 @@ public void onDamage(ProjectileHitEvent e){
if(!(e.getHitEntity() instanceof Player)) return;
if(!(e.getEntity().getShooter() instanceof Player)) return;
if(!(e.getEntity() instanceof Snowball) && !(e.getEntity() instanceof Egg) && !(e.getEntity() instanceof Arrow)) return;
Bukkit.broadcastMessage("called");
if(!e.getEntity().hasMetadata("projParentNode")) return;
Bukkit.broadcastMessage("hasMetadata");

WeaponConfigData data = LeonCSAddon.INSTANCE.getWeaponConfig().getWeaponConfigData(((MetadataValue)e.getEntity().getMetadata("projParentNode").get(0)).asString());

Expand All @@ -30,6 +33,7 @@ public void onDamage(ProjectileHitEvent e){

if(shooter.getScoreboard().getEntryTeam(shooter.getName())
== victimPlayer.getScoreboard().getEntryTeam(e.getHitEntity().getName())){
Bukkit.broadcastMessage("same team");
for(PotionEffect effect: data.allyPotion){
victimPlayer.removePotionEffect(effect.getType());
victimPlayer.addPotionEffect(effect);
Expand Down

0 comments on commit 5df9cfc

Please sign in to comment.