mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-18 06:55:03 +00:00
Implement ScriptArrow, ScriptThrowable, ScriptFishHook
This commit is contained in:
1 parent
1b76f1ab7e
commit
3867ab43b7
6 files changed
+125
-1
No files matched your search
@@ -0,0 +1,35 @@
|
||||
package noppes.npcs.scripted.entity;
|
||||
|
||||
import net.minecraft.entity.projectile.EntityThrowable;
|
||||
import noppes.npcs.api.entity.*;
|
||||
import noppes.npcs.scripted.NpcAPI;
|
||||
import noppes.npcs.scripted.constants.EntityType;
|
||||
|
||||
public class ScriptThrowable<T extends EntityThrowable> extends ScriptEntity<T> implements IThrowable {
|
||||
|
||||
public ScriptThrowable(T entity) {
|
||||
super(entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IEntityLivingBase getThrower() {
|
||||
if(entity.getThrower() != null)
|
||||
return (IEntityLivingBase) NpcAPI.Instance().getIEntity(entity.getThrower());
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void kill() {
|
||||
entity.setDead();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getType() {
|
||||
return EntityType.THROWABLE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean typeOf(int type) {
|
||||
return type == EntityType.THROWABLE || super.typeOf(type);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user