mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-17 05:15:11 +00:00
Used interfaces in implementations instead of the real classes for most scripted classes.
This commit is contained in:
1 parent
6896cec417
commit
cf33b90b26
63 files changed
+466
-551
No files matched your search
@@ -2,26 +2,28 @@ 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;
|
||||
import noppes.npcs.scripted.NpcAPI;
|
||||
import noppes.npcs.scripted.interfaces.IDamageSource;
|
||||
import noppes.npcs.scripted.interfaces.entity.IEntityLivingBase;
|
||||
|
||||
public class ScriptEventKilled extends ScriptEvent{
|
||||
|
||||
private ScriptLivingBase source;
|
||||
private IEntityLivingBase source;
|
||||
private DamageSource damagesource;
|
||||
|
||||
public ScriptEventKilled(EntityLivingBase target, DamageSource damagesource){
|
||||
this.damagesource = damagesource;
|
||||
this.source = (ScriptLivingBase)ScriptController.Instance.getScriptForEntity(target);
|
||||
this.source = (IEntityLivingBase) NpcAPI.Instance().getIEntity(target);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return The source of the damage
|
||||
*/
|
||||
public ScriptLivingBase getSource(){
|
||||
public IEntityLivingBase getSource(){
|
||||
return source;
|
||||
}
|
||||
|
||||
public IDamageSource getDamageSource() { return NpcAPI.Instance().getIDamageSource(damagesource); }
|
||||
|
||||
/**
|
||||
* @return Returns the damage type
|
||||
*/
|
||||
|
||||
Reference in new issue
Block a user