mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-18 07:59:08 +00:00
Implemented global Forge events. Reorganized NPC API files.
This commit is contained in:
1 parent
c5ed7497c8
commit
72f2c3c60a
72 files changed
+321
-395
No files matched your search
@@ -0,0 +1,56 @@
|
||||
package noppes.npcs.scripted.event;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import noppes.npcs.controllers.ScriptController;
|
||||
import noppes.npcs.scripted.entity.ScriptLivingBase;
|
||||
|
||||
public class ScriptEventDamaged extends ScriptEvent{
|
||||
|
||||
private float damage;
|
||||
private boolean clear = false;
|
||||
private ScriptLivingBase source;
|
||||
private DamageSource damagesource;
|
||||
|
||||
public ScriptEventDamaged(float damage, EntityLivingBase attackingEntity, DamageSource damagesource){
|
||||
this.damage = damage;
|
||||
this.damagesource = damagesource;
|
||||
this.source = (ScriptLivingBase)ScriptController.Instance.getScriptForEntity(attackingEntity);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return The source of the damage
|
||||
*/
|
||||
public ScriptLivingBase getSource(){
|
||||
return source;
|
||||
}
|
||||
|
||||
public void setClearTarget(boolean bo){
|
||||
this.clear = bo;
|
||||
}
|
||||
|
||||
public boolean getClearTarget(){
|
||||
return clear;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Returns the damage value
|
||||
*/
|
||||
public float getDamage(){
|
||||
return damage;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param damage The new damage value
|
||||
*/
|
||||
public void setDamage(float damage){
|
||||
this.damage = damage;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Returns the damage type
|
||||
*/
|
||||
public String getType(){
|
||||
return damagesource.damageType;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user