2025-07-08 16:56:35 -04:00
|
|
|
package noppes.npcs.scripted.entity;
|
|
|
|
|
|
|
|
|
|
import net.minecraft.entity.projectile.EntityThrowable;
|
2025-07-23 14:22:52 -04:00
|
|
|
import noppes.npcs.api.entity.IEntityLivingBase;
|
|
|
|
|
import noppes.npcs.api.entity.IThrowable;
|
2025-07-08 16:56:35 -04:00
|
|
|
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() {
|
2025-07-23 14:22:52 -04:00
|
|
|
if (entity.getThrower() != null)
|
2025-07-08 16:56:35 -04:00
|
|
|
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);
|
|
|
|
|
}
|
|
|
|
|
}
|