mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-17 20:25:13 +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,36 @@
|
||||
package noppes.npcs.scripted.entity;
|
||||
|
||||
import net.minecraft.entity.projectile.EntityFishHook;
|
||||
import noppes.npcs.api.entity.IFishHook;
|
||||
import noppes.npcs.api.entity.IPlayer;
|
||||
import noppes.npcs.scripted.NpcAPI;
|
||||
import noppes.npcs.scripted.constants.EntityType;
|
||||
|
||||
public class ScriptFishHook<T extends EntityFishHook> extends ScriptEntity<T> implements IFishHook {
|
||||
|
||||
public ScriptFishHook(T entity) {
|
||||
super(entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPlayer getCaster() {
|
||||
if(entity.field_146042_b != null)
|
||||
return (IPlayer) NpcAPI.Instance().getIEntity(entity.field_146042_b);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void kill() {
|
||||
entity.setDead();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getType() {
|
||||
return EntityType.FISH_HOOK;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean typeOf(int type) {
|
||||
return type == EntityType.FISH_HOOK || super.typeOf(type);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user