This repository has been archived by the owner on Jan 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
679 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
package net.flectone.custom; | ||
|
||
import net.flectone.utils.NMSUtil; | ||
import net.flectone.utils.ObjectUtil; | ||
import org.bukkit.Material; | ||
import org.bukkit.entity.Entity; | ||
import org.bukkit.inventory.ItemStack; | ||
|
||
public class FDamager { | ||
|
||
private int time; | ||
private Entity killer; | ||
private String killerItemName; | ||
private String killerItemAsJson; | ||
private Entity finalEntityDamager; | ||
private Material finalBlockDamager; | ||
private String damagerTranslateName; | ||
|
||
public FDamager() { | ||
} | ||
|
||
public void replaceDamager(Entity damager) { | ||
killer = damager; | ||
time = ObjectUtil.getCurrentTime(); | ||
} | ||
|
||
public Entity getKiller() { | ||
return killer; | ||
} | ||
|
||
public void setKiller(Entity killer) { | ||
this.killer = killer; | ||
} | ||
|
||
public void setKillerItem(ItemStack itemStack) { | ||
this.killerItemName = NMSUtil.getMinecraftName(itemStack); | ||
this.killerItemAsJson = NMSUtil.getItemAsJson(itemStack); | ||
} | ||
|
||
public String getKillerItemName() { | ||
return killerItemName; | ||
} | ||
|
||
public String getKillerItemAsJson() { | ||
return killerItemAsJson; | ||
} | ||
|
||
public int getTime() { | ||
return time; | ||
} | ||
|
||
public void setFinalDamager(Entity finalDamager) { | ||
this.finalEntityDamager = finalDamager; | ||
this.damagerTranslateName = NMSUtil.getMinecraftName(finalDamager); | ||
} | ||
|
||
public void setFinalDamager(Material block) { | ||
this.finalBlockDamager = block; | ||
this.damagerTranslateName = NMSUtil.getMinecraftName(new ItemStack(finalBlockDamager)); | ||
} | ||
|
||
public String getDamagerTranslateName() { | ||
return damagerTranslateName; | ||
} | ||
|
||
public Entity getFinalEntity() { | ||
return finalEntityDamager; | ||
} | ||
|
||
public boolean isFinalEntity() { | ||
return finalEntityDamager != null; | ||
} | ||
|
||
public boolean isFinalBlock() { | ||
return finalBlockDamager != null; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.